blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
โŒ€
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
6747907b58a6538b9b8fe0fbe9b5ae168b85d951
8b46bbf725ecfb60a8023f04753a0b26868c59e2
/src/main/java/com/complex/IranianPizzaStore.java
b9d9ad36d0327fbb5ce0b136fdcacead20963512
[]
no_license
bizhan-laripour/design-pattern
487efd730bd55dc00225bd58defc44d60eff4e6e
bb1ac498c905ea1fd2ebad029147d971366f1ca8
refs/heads/master
2023-09-03T07:11:48.711676
2021-11-22T15:44:56
2021-11-22T15:44:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
626
java
package com.complex; import java.util.List; public class IranianPizzaStore extends AbstractFactory{ public IranianPizzaStore(List<ProductEnum> names){ this.names = names; } @Override public Product getProduct() { product = new IranianPizza(); for(ProductEnum productEnum : names){ if(productEnum.name().equals(ProductEnum.BREAD.name())){ product = new Bread(product); }else if(productEnum.name().equals(ProductEnum.MUSHROOM.name())){ product = new Mushroom(product); } } return product; } }
[ "bizhan.laripour.herat@gmail.com" ]
bizhan.laripour.herat@gmail.com
17e7702d1a20be4d45e3004a792e0950b8575fb6
576a54161cdf04f249de9e4b290b844b0283474b
/app/src/main/java/com/li/zjut/iteacher/widget/datepicker/SlideDateTimePicker.java
bcfc744c7ce08877c5fb87bafdd4cd6d72b38d47
[]
no_license
laozhu123/Iteacher
cd59de08c3ef4337899901daa0ac4aacc83ae0e7
6fbeea1e9b6e129d591c5750a941bdc0336ee966
refs/heads/master
2021-01-20T11:32:10.547229
2016-11-19T11:49:26
2016-11-19T11:49:26
59,818,412
2
0
null
null
null
null
UTF-8
Java
false
false
8,926
java
package com.li.zjut.iteacher.widget.datepicker; import java.util.Date; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; /** * <p>This class contains methods for the library client to create * a new {@code SlideDateTimePicker}.</p> * * <p>It also implements a Builder API that offers more convenient * object creation.</p> * * @author jjobes * */ public class SlideDateTimePicker { public static final int HOLO_DARK = 1; public static final int HOLO_LIGHT = 2; private FragmentManager mFragmentManager; private SlideDateTimeListener mListener; private Date mInitialDate; private Date mMinDate; private Date mMaxDate; private boolean mIsClientSpecified24HourTime; private boolean mIs24HourTime; private int mTheme; private int mIndicatorColor; private int mSelectItem; /** * Creates a new instance of {@code SlideDateTimePicker}. * * @param fm The {@code FragmentManager} from the calling activity that is used * internally to show the {@code DialogFragment}. */ public SlideDateTimePicker(FragmentManager fm) { // See if there are any DialogFragments from the FragmentManager FragmentTransaction ft = fm.beginTransaction(); Fragment prev = fm.findFragmentByTag(SlideDateTimeDialogFragment.TAG_SLIDE_DATE_TIME_DIALOG_FRAGMENT); // Remove if found if (prev != null) { ft.remove(prev); ft.commit(); } mFragmentManager = fm; } /** * <p>Sets the listener that is used to inform the client when * the user selects a new date and time.</p> * * <p>This must be called before {@link #show()}.</p> * * @param listener */ public void setListener(SlideDateTimeListener listener) { mListener = listener; } /** * <p>Sets the initial date and time to display in the date * and time pickers.</p> * * <p>If this method is not called, the current date and time * will be displayed.</p> * * @param initialDate the {@code Date} object used to determine the * initial date and time to display */ public void setInitialDate(Date initialDate) { mInitialDate = initialDate; } /** * <p>Sets the minimum date that the DatePicker should show.</p> * * <p>This must be called before {@link #show()}.</p> * * @param minDate the minimum selectable date for the DatePicker */ public void setMinDate(Date minDate) { mMinDate = minDate; } /** * <p>Sets the maximum date that the DatePicker should show.</p> * * <p>This must be called before {@link #show()}.</p> * * @param maxDate the maximum selectable date for the DatePicker */ public void setMaxDate(Date maxDate) { mMaxDate = maxDate; } public void setSelectItem(int selectItem) { mSelectItem = selectItem; } private void setIsClientSpecified24HourTime(boolean isClientSpecified24HourTime) { mIsClientSpecified24HourTime = false; } /** * <p>Sets whether the TimePicker displays its time in 12-hour * (AM/PM) or 24-hour format.</p> * * <p>If this method is not called, the device's default time * format is used.</p> * * <p>This also affects the time displayed in the tab.</p> * * <p>Must be called before {@link #show()}.</p> * * @param is24HourTime <tt>true</tt> to force 24-hour time format, * <tt>false</tt> to force 12-hour (AM/PM) time * format. */ public void setIs24HourTime(boolean is24HourTime) { mIs24HourTime = is24HourTime; } /** * Sets the theme of the dialog. If no theme is specified, it * defaults to holo light. * * @param theme {@code SlideDateTimePicker.HOLO_DARK} for a dark theme, or * {@code SlideDateTimePicker.HOLO_LIGHT} for a light theme */ public void setTheme(int theme) { mTheme = theme; } /** * Sets the color of the underline for the currently selected tab. * * @param indicatorColor the color of the selected tab's underline */ public void setIndicatorColor(int indicatorColor) { mIndicatorColor = indicatorColor; } /** * Shows the dialog to the user. Make sure to call * */ public void show() { if (mListener == null) { throw new NullPointerException( "Attempting to bind null listener to SlideDateTimePicker"); } if (mInitialDate == null) { setInitialDate(new Date()); } SlideDateTimeDialogFragment dialogFragment = SlideDateTimeDialogFragment.newInstance( mListener, mInitialDate, mMinDate, mMaxDate, mIsClientSpecified24HourTime, mIs24HourTime, mTheme, mIndicatorColor,mSelectItem); dialogFragment.show(mFragmentManager, SlideDateTimeDialogFragment.TAG_SLIDE_DATE_TIME_DIALOG_FRAGMENT); } /* * The following implements the builder API to simplify * creation and display of the dialog. */ public static class Builder { // Required private FragmentManager fm; private SlideDateTimeListener listener; // Optional private Date initialDate; private Date minDate; private Date maxDate; private boolean isClientSpecified24HourTime; private boolean is24HourTime; private int theme; private int indicatorColor; private int selectItem; public Builder(FragmentManager fm) { this.fm = fm; } /** * @see SlideDateTimePicker#setListener(SlideDateTimeListener) */ public Builder setListener(SlideDateTimeListener listener) { this.listener = listener; return this; } /** * @see SlideDateTimePicker#setInitialDate(Date) */ public Builder setInitialDate(Date initialDate) { this.initialDate = initialDate; return this; } /** * @see SlideDateTimePicker#setMinDate(Date) */ public Builder setMinDate(Date minDate) { this.minDate = minDate; return this; } /** * @see SlideDateTimePicker#setMaxDate(Date) */ public Builder setMaxDate(Date maxDate) { this.maxDate = maxDate; return this; } /** * @see SlideDateTimePicker#setIs24HourTime(boolean) */ public Builder setIs24HourTime(boolean is24HourTime) { this.is24HourTime = is24HourTime; return this; } public Builder setisClientSpecified24HourTime(boolean isClientSpecified24HourTime) { this.isClientSpecified24HourTime = isClientSpecified24HourTime; return this; } /** * @see SlideDateTimePicker#setTheme(int) */ public Builder setTheme(int theme) { this.theme = theme; return this; } /** * @see SlideDateTimePicker#setIndicatorColor(int) */ public Builder setIndicatorColor(int indicatorColor) { this.indicatorColor = indicatorColor; return this; } public Builder setSelectItem(int selectItem) { this.selectItem = selectItem; return this; } /** * <p>Build and return a {@code SlideDateTimePicker} object based on the previously * supplied parameters.</p> * * <p>You should call {@link #show()} immediately after this.</p> * * @return */ public SlideDateTimePicker build() { SlideDateTimePicker picker = new SlideDateTimePicker(fm); picker.setListener(listener); picker.setInitialDate(initialDate); picker.setMinDate(minDate); picker.setMaxDate(maxDate); picker.setIsClientSpecified24HourTime(isClientSpecified24HourTime); picker.setIs24HourTime(is24HourTime); picker.setTheme(theme); picker.setIndicatorColor(indicatorColor); picker.setSelectItem(selectItem); return picker; } } }
[ "qqq2830@163.com" ]
qqq2830@163.com
e1d68016c2871d1b6df2c8837fc30771ecb95cbe
9a8e49009d49d1a9b5d6b28d40e30c0bf28e6747
/src/main/java/proj/skt/Job/JobConverterFromFile.java
0c23617c824d316a8294084f65dd039d622add08
[]
no_license
lleejong/NS3Simulator
c14ed6bbfff2fa9e6c02391e96404b007e17051e
c2c16500cd37e9f583439e835aa6dc5a95d182dc
refs/heads/master
2021-01-12T09:31:21.935601
2017-01-16T06:47:09
2017-01-16T06:47:09
76,181,033
1
0
null
null
null
null
UTF-8
Java
false
false
2,013
java
package proj.skt.Job; import java.io.File; import java.util.ArrayList; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class JobConverterFromFile { public static ArrayList<Job> readXML () { try { ArrayList<Job> list = new ArrayList<Job>(); File fXmlFile = new File("./xml/input.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(fXmlFile); doc.getDocumentElement().normalize(); //System.out.println("Root element :" + doc.getDocumentElement().getNodeName()); NodeList nList = doc.getElementsByTagName("job"); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); //System.out.println("\nCurrent Element :" + nNode.getNodeName()); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; double txLoss = Double.parseDouble(eElement.getElementsByTagName("txloss").item(0).getTextContent()); double txDelay = Double.parseDouble(eElement.getElementsByTagName("txdelay").item(0).getTextContent()); double txJitter = Double.parseDouble(eElement.getElementsByTagName("txjitter").item(0).getTextContent()); double rxLoss = Double.parseDouble(eElement.getElementsByTagName("rxloss").item(0).getTextContent()); double rxDelay = Double.parseDouble(eElement.getElementsByTagName("rxdelay").item(0).getTextContent()); double rxJitter = Double.parseDouble(eElement.getElementsByTagName("rxjitter").item(0).getTextContent()); list.add(new Job(new NS3Data(txLoss,txDelay,txJitter,rxLoss, rxDelay,rxJitter))); } } return list; } catch (Exception e) { e.printStackTrace(); return null; } } }
[ "lleejong@gmail.com" ]
lleejong@gmail.com
b24ef74efef23e65db94688448cb889d57523b9b
32ca101b67386e514d4521e4d0d857181bde0919
/javaSE_20180801/src/com/test113/Main.java
e750e490257a19a933a9e90c166b51dcee0c3538
[]
no_license
JeonEunmi/javaSE
a51fb8f4631bfba963d47b806e17eff9464c7fc0
cbbde15cc71eb6257b6e3baa27679be9bd4c8cc7
refs/heads/master
2020-04-11T10:39:50.453601
2018-12-14T07:23:50
2018-12-14T07:23:50
161,722,611
0
0
null
null
null
null
UHC
Java
false
false
438
java
package com.test113; public class Main { public static void main(String[] args) { // Box<T> ํด๋ž˜์Šค์— ๋Œ€ํ•œ ๊ฐ์ฒด ์ƒ์„ฑ // -> ํƒ€์ž…ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋Œ€ํ•œ ๋ช…์‹œ์  ์ž๋ฃŒํ˜• ์ง€์ • ํ•„์š” // String, Integer๋กœ ์ง€์ •ํ•œ ๊ฒฝ์šฐ Box<String, Integer> box1 = new Box<String, Integer>("M01", 100); System.out.println(box1.getKey()); //"M01" System.out.println(box1.getValue()); // 100 } }
[ "bunny648@hanmail.net" ]
bunny648@hanmail.net
48b5551646996f79693e5fd603c5c5c224e8a9bb
4aebc955592040a287ef3ef80670bb67d25a39f4
/src/z/np/transfer/CharaTransferer.java
d42fd7e378b7702fd3f35910b71619ec186ba0d1
[]
no_license
maunzi532/NP3
9c3877670a0a638f0fc54bbda49c098ee25efd2c
3f50c29b3f26fc3a99430d03860d1214b330550a
refs/heads/master
2020-04-22T00:41:20.195074
2019-02-10T14:55:25
2019-02-10T14:55:25
169,989,533
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package z.np.transfer; import java.util.*; import z.np.chara.*; public interface CharaTransferer { boolean requestChara(NPChara chara, boolean real); boolean acceptChara(NPChara chara, boolean real); default List<NPChara> zeigeCharas() { return null; } default long maxCharas() { return 0; } default boolean versende(CharaTransferer an, NPChara chara) { return requestChara(chara, false) && an.acceptChara(chara, true) && requestChara(chara, true); } }
[ "maunzi888@gmail.at" ]
maunzi888@gmail.at
210cc5cbfc09efc9ba3a5981ddf7ae65eb9affdd
418946761bc300bd6967d10b4a628e57f3b53602
/src/main/java/hello/servlet/basic/response/ResponseHeaderServlet.java
8e4cc154cb7091690a81de78a0ed730d1ec965d6
[]
no_license
constantoh/servlet
58e357d6341bd134e29d66cbb3edb233189fe889
24848461247cfd627121ff9b70472d1f0cbb602b
refs/heads/master
2023-05-05T23:33:28.502039
2021-06-01T03:40:56
2021-06-01T03:40:56
367,292,345
0
0
null
null
null
null
UTF-8
Java
false
false
2,221
java
package hello.servlet.basic.response; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; @WebServlet(name = "responseHeaderServlet", urlPatterns = "/response-header") public class ResponseHeaderServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //status-line resp.setStatus(HttpServletResponse.SC_OK); //response-headers resp.setHeader("Content-Type", "text/plain;charset=utf-8"); resp.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); resp.setHeader("Pragma", "no-cache"); resp.setHeader("my-header","hello"); //[Header ํŽธ์˜ ๋ฉ”์„œ๋“œ] content(resp); cookie(resp); redirect(resp); //[message body] PrintWriter writer = resp.getWriter(); writer.println("ok"); } private void content(HttpServletResponse response) { // Content-Type: text/plain;charset=utf-8 // Content-Length: 2 // response.setHeader("Content-Type", "text/plain;charset=utf-8"); response.setContentType("text/plain"); response.setCharacterEncoding("utf-8"); // response.setContentLength(2); //(์ƒ๋žต์‹œ ์ž๋™ ์ƒ์„ฑ) } private void cookie(HttpServletResponse response) { // Set-Cookie: myCookie=good; Max-Age=600; // response.setHeader("Set-Cookie", "myCookie=good; Max-Age=600"); Cookie cookie = new Cookie("myCookie", "good"); cookie.setMaxAge(600); //600์ดˆ response.addCookie(cookie); } private void redirect(HttpServletResponse response) throws IOException { // Status Code 302 // Location: /basic/hello-form.html // response.setStatus(HttpServletResponse.SC_FOUND); //302 // response.setHeader("Location", "/basic/hello-form.html"); response.sendRedirect("/basic/hello-form.html"); } }
[ "ohconstant@naver.com" ]
ohconstant@naver.com
fd268b470725e3dcf28ab4a5a02067d16e1c48a8
2b6e3a34ec277f72a5da125afecfe3f4a61419f5
/Ruyicai_General/v4.0.0_plugin/src/com/ruyicai/activity/usercenter/ChangePasswordActivity.java
49814702f209f4d1ba65ec38dc1819701be9065c
[]
no_license
surport/Android
03d538fe8484b0ff0a83b8b0b2499ad14592c64b
afc2668728379caeb504c9b769011f2ba1e27d25
refs/heads/master
2020-04-02T10:29:40.438348
2013-12-18T09:55:42
2013-12-18T09:55:42
15,285,717
3
5
null
null
null
null
UTF-8
Java
false
false
4,656
java
package com.ruyicai.activity.usercenter; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.Dialog; import android.app.ProgressDialog; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.Window; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.palmdream.RuyicaiAndroid.R; import com.ruyicai.net.newtransaction.ChangePasswordInterface; import com.ruyicai.util.RWSharedPreferences; /** * ๅฏ†็ ไฟฎๆ”น * * @author miao * */ public class ChangePasswordActivity extends Activity { private String phonenum, sessionid, userno; private String re; private JSONObject obj; ProgressDialog progressDialog; EditText oldPassWD, newPassWD, newPassWDAgain; Button submit, cancle; final int DIALOG1_KEY = 0; /** * ๅค„็†็™ปๅฝ•็š„ๆถˆๆฏๅŠๆณจๅ†Œ็š„ๆถˆๆฏ */ final Handler handler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case 1: progressDialog.dismiss(); Toast.makeText(ChangePasswordActivity.this, (String) msg.obj, Toast.LENGTH_LONG).show(); finish(); break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.usercenter_changepawd); oldPassWD = (EditText) findViewById(R.id.usercenter_edittext_originalpwd); newPassWD = (EditText) findViewById(R.id.usercenter_edittext_newpwd); newPassWDAgain = (EditText) findViewById(R.id.usercenter_edittext_confirmnewpwd); submit = (Button) findViewById(R.id.usercenter_changepwd_submit); submit.setOnClickListener(changepawdlistener); cancle = (Button) findViewById(R.id.usercenter_changepwd_back); cancle.setOnClickListener(changepawdlistener); initPojo(); } private void initPojo() { RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo"); phonenum = shellRW.getStringValue("phonenum"); sessionid = shellRW.getStringValue("sessionid"); userno = shellRW.getStringValue("userno"); } public void editPassword() { final String originalpwd = oldPassWD.getText().toString(); final String newpwd = newPassWD.getText().toString(); final String confirmpwd = newPassWDAgain.getText().toString(); // wangyl 7.21 ้ชŒ่ฏๅฏ†็ ้•ฟๅบฆ if (oldPassWD.length() >= 6 && oldPassWD.length() <= 16 && newPassWD.length() >= 6 && newPassWD.length() <= 16 && newPassWDAgain.length() >= 6 && newPassWDAgain.length() <= 16) { if (!confirmpwd.equalsIgnoreCase(newpwd)) { newPassWDAgain.setText(""); Toast.makeText(this, R.string.usercenter_changPSWRemind2, Toast.LENGTH_SHORT).show(); } else { showDialog(0); new Thread(new Runnable() { public void run() { String changepassback = ChangePasswordInterface .getInstance().changePass(phonenum, originalpwd, newpwd, sessionid, userno); try { JSONObject changepassjson = new JSONObject( changepassback); String errorCode = changepassjson .getString("error_code"); String message = changepassjson .getString("message"); Message msg = new Message(); msg.what = 1; msg.obj = message; handler.sendMessage(msg); } catch (JSONException e) { // TODO Auto-generated catch block } } }).start(); } } else { Toast.makeText(this, R.string.usercenter_changPSWRemind, Toast.LENGTH_SHORT).show(); } } OnClickListener changepawdlistener = new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.usercenter_changepwd_submit: editPassword(); break; case R.id.usercenter_changepwd_back: finish(); break; default: break; } } }; protected Dialog onCreateDialog(int id) { progressDialog = new ProgressDialog(this); switch (id) { case DIALOG1_KEY: { progressDialog.setTitle(R.string.usercenter_netDialogTitle); progressDialog .setMessage(getString(R.string.usercenter_netDialogRemind)); progressDialog.setIndeterminate(true); progressDialog.setCancelable(true); return progressDialog; } } return progressDialog; } @Override protected void onPause() { super.onPause(); } @Override protected void onResume() { super.onResume(); } }
[ "zxflimit@gmail.com" ]
zxflimit@gmail.com
be26b26fe6774fb29d4ef33344409b53d38f64bf
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/Observations.java
d300df23b2b82610d822ad9d29891a55642c2b36
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,405
java
14 https://raw.githubusercontent.com/mjtb49/LattiCG/master/src/randomreverser/reversal/observation/Observations.java package randomreverser.reversal.observation; import randomreverser.reversal.constraint.ChoiceConstraint; import randomreverser.reversal.constraint.Constraint; import randomreverser.reversal.constraint.RangeConstraint; import java.util.HashMap; import java.util.Map; import java.util.function.Function; public class Observations { private static final Map<String, Function<Constraint<?>, ? extends Observation>> observationCreators = new HashMap<>(); private static final Map<Class<? extends Observation>, String> names = new HashMap<>(); static { registerObservation("range", RangeObservation.class, (Function<RangeConstraint, RangeObservation>) RangeObservation::new); registerChoiceObservation(); } @SuppressWarnings("unchecked") private static void registerChoiceObservation() { registerObservation( "choice", (Class<ChoiceObservation<?>>) (Class<?>) ChoiceObservation.class, (Constraint<ChoiceObservation<?>> c) -> new ChoiceObservation<>((ChoiceConstraint<?>) (Constraint<?>) c) ); } @SuppressWarnings("unchecked") public static <T extends Observation> void registerObservation(String name, Class<T> clazz, Function<? extends Constraint<T>, T> creator) { observationCreators.put(name, (Function<Constraint<?>, ? extends Observation>) (Function<?, ?>) creator); names.put(clazz, name); } public static String getName(Observation observation) { String name = names.get(observation.getClass()); if (name == null) { throw new IllegalArgumentException("Unregistered observation " + observation.getClass().getName()); } return name; } @SuppressWarnings("unchecked") public static <T extends Observation> T createEmptyObservation(String name, Constraint<T> constraint) { Function<Constraint<T>, T> creator = (Function<Constraint<T>, T>) (Function<?, ?>) observationCreators.get(name); if (creator == null) { throw new IllegalArgumentException("Unknown observation '" + name + "'"); } return creator.apply(constraint); } public static boolean isObservation(String name) { return observationCreators.containsKey(name); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
61353fe5df03fe5f16f6726d236f0526e62fbcbb
f740077a62a64b2a5edfa31b06dbd026308032d0
/crud-parent/comfirm-dialog/src/main/java/com/rockwell/confirmdialog/ButtonType.java
c457936177f7fd08f8c1a94a5bfc44806bae3609
[ "Apache-2.0" ]
permissive
a497314013/monitor
19def4cbfa0eeb71dca9bdacaca628cc732e29e7
d322b90394444d339ccfa14cd887699a673761ac
refs/heads/master
2020-04-09T10:50:17.701194
2018-12-04T06:32:00
2018-12-04T06:32:00
160,284,368
0
0
null
null
null
null
UTF-8
Java
false
false
825
java
package com.rockwell.confirmdialog; /** * An enumeration of button types. The value affects the displayed button icon and caption. * * @author Dieter Steinwedel * @author Carlos Laspina */ public enum ButtonType { /** * Self-explaining. */ OK, /** * Self-explaining. */ ABORT, /** * Self-explaining. */ CANCEL, /** * Self-explaining. */ YES, /** * Self-explaining. */ NO, /** * Self-explaining. */ CLOSE, /** * Self-explaining. */ SAVE, /** * Self-explaining. */ RETRY, /** * Self-explaining. */ IGNORE, /** * Self-explaining. Keep in mind, that the dialog will not be closed, if the corresponding button is pressed! */ HELP; }
[ "shuangjiang_guo@163.com" ]
shuangjiang_guo@163.com
33de74023cdc18a141c97c908ccffeeb7aa53cc3
355238dbe3a312bb055f57d9f7aaeac93bdf7f6b
/app/src/main/java/com/muli/m_pos/ui/login/LoadingActivity.java
1853de05b8b19655b82e7aadaec07b98271d34f7
[]
no_license
DeroMuli/M-POS
9d2f8f0f88c943708f62b573fd0968fe8911eeaf
8114e0d6ba13cb50eb6b9602c4411b7c9383fb00
refs/heads/master
2023-03-26T06:33:50.279596
2021-03-19T08:44:10
2021-03-19T08:44:10
349,347,038
0
0
null
null
null
null
UTF-8
Java
false
false
3,556
java
package com.muli.m_pos.ui.login; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.database.Cursor; import android.os.AsyncTask; import android.os.Bundle; import com.muli.m_pos.R; import com.muli.m_pos.model.AccountInfoProvider; import com.muli.m_pos.model.ItemCardData; import com.muli.m_pos.model.SetUpProductNCategories; import com.muli.m_pos.ui.main.MainActivity; import java.util.ArrayList; import java.util.HashMap; public class LoadingActivity extends AppCompatActivity { public static ArrayList<String> Categories = new ArrayList<>(); public static HashMap<String,ArrayList> Products = new HashMap<>(); public static HashMap<Integer,String> id_name_mapping = new HashMap<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading); SetUp setUp = new SetUp(); setUp.execute(); Load load = new Load(); load.execute(); } private class Load extends AsyncTask<Void,Void, Boolean>{ @Override protected Boolean doInBackground(Void... voids) { String selecion = AccountInfoProvider.LOGGED + " = ? "; Cursor c = getContentResolver().query(AccountInfoProvider.Offline_Uri,null,selecion,new String[]{AccountInfoProvider.Logged_In},null); if(c.moveToFirst()) return true; else return false; } @Override protected void onPostExecute(Boolean s) { super.onPostExecute(s); if(s == false){ Intent intent = new Intent(getBaseContext(),LoginActivity.class); startActivity(intent); } else { Intent intent = new Intent(getBaseContext(), MainActivity.class); startActivity(intent); } } } private class SetUp extends AsyncTask<Void,Void,Void>{ @Override protected Void doInBackground(Void... voids) { Cursor category_cursor = getContentResolver().query(AccountInfoProvider.Category_Uri, null, null, null, null); if (category_cursor.moveToFirst()) { do { String category_name = category_cursor.getString(1); int id = category_cursor.getInt(0); Categories.add(category_name); id_name_mapping.put(id, category_name); } while (category_cursor.moveToNext()); } for (int i : id_name_mapping.keySet()) { ArrayList<ItemCardData> arrayList = new ArrayList<>(); String select = AccountInfoProvider.Category_id + " = ? "; Cursor product_cursor = getContentResolver().query(AccountInfoProvider.Product_Uri, null, select, new String[]{String.valueOf(i)}, null); if (product_cursor.moveToFirst()) { do { String name = product_cursor.getString(1); int price = product_cursor.getInt(2); String image = product_cursor.getString(3); ItemCardData itemCardData = new ItemCardData(image, name, price); arrayList.add(itemCardData); } while (product_cursor.moveToNext()); } Products.put(id_name_mapping.get(i), arrayList); } return null; } } }
[ "musembimuli1999@gmail.com" ]
musembimuli1999@gmail.com
1ff436e14f2665fe545a37de8c0caf8b4a610d30
c709fa96372353f3a58b17e83a5a302eff71e367
/src/main/java/com/raghu/SwaggerUiApplication.java
c0a8f3a28a754fc66abae1239a030243a6359cf1
[]
no_license
raghuvaran471/swagger
b90681dc479ddff4daec2dc611eebc845cbb0376
7333ead47d5122afbf889768220e96df8ae12537
refs/heads/master
2022-12-08T22:02:13.586887
2020-09-09T07:42:40
2020-09-09T07:42:40
294,034,918
0
0
null
null
null
null
UTF-8
Java
false
false
308
java
package com.raghu; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SwaggerUiApplication { public static void main(String[] args) { SpringApplication.run(SwaggerUiApplication.class, args); } }
[ "raghuvaran471@gmail.com" ]
raghuvaran471@gmail.com
4ed02e30434d784118584366a63ef8c1f8cc184a
d2cb1f4f186238ed3075c2748552e9325763a1cb
/methods_all/nonstatic_methods/javax_imageio_stream_ImageOutputStreamImpl_length.java
8c9810373924df5a9fb08e70139bfe4c7a1debaf
[]
no_license
Adabot1/data
9e5c64021261bf181b51b4141aab2e2877b9054a
352b77eaebd8efdb4d343b642c71cdbfec35054e
refs/heads/master
2020-05-16T14:22:19.491115
2019-05-25T04:35:00
2019-05-25T04:35:00
183,001,929
4
0
null
null
null
null
UTF-8
Java
false
false
201
java
class javax_imageio_stream_ImageOutputStreamImpl_length{ public static void function() {javax.imageio.stream.ImageOutputStreamImpl obj = new javax.imageio.stream.ImageOutputStreamImpl();obj.length();}}
[ "peter2008.ok@163.com" ]
peter2008.ok@163.com
eb80dcfbf56970f22f448323945b4877a5577fdc
b130ee14c0f56f7b422bf4cfed0dd62c384ce413
/FB Core/increasingTriplet.java
6dbfc6feaed6b2fa34937d1f536037445185eb5a
[]
no_license
DerrickZhu1/Algorithms
db18d11e570920afa8e4c21d87f4d6bbbb411894
d3685b628e2b3bea4b9130da51878c24f250be56
refs/heads/master
2020-06-14T06:21:59.394304
2016-11-30T20:21:36
2016-11-30T20:21:36
75,223,233
0
0
null
null
null
null
UTF-8
Java
false
false
608
java
public class Solution { public boolean increasingTriplet(int[] nums) { // start with two largest values, as soon as we find a number bigger than both, while both have been updated, return true. int small = Integer.MAX_VALUE, big = Integer.MAX_VALUE; for (int n : nums) { if (n <= small) { small = n; } // update small if n is smaller than both else if (n <= big) { big = n; } // update big only if greater than small but smaller than big else return true; // return if you find a number bigger than both } return false; } }
[ "derrickzhu1@gmail.com" ]
derrickzhu1@gmail.com
3f85b30ca94741bd2ced5f28d3f91d83a9a7b057
5407585b7749d94f5a882eee6f7129afc6f79720
/dm-code/dm-service/src/test/java/org/finra/dm/service/helper/S3PropertiesLocationHelperTest.java
bf21a1bcf2d8aae034739f52e806940e95a8a6af
[ "Apache-2.0" ]
permissive
walw/herd
67144b0192178050118f5572c5aa271e1525e14f
e236f8f4787e62d5ebf5e1a55eda696d75c5d3cf
refs/heads/master
2021-01-14T14:16:23.163693
2015-10-08T14:23:54
2015-10-08T14:23:54
43,558,552
0
1
null
2015-10-02T14:50:59
2015-10-02T14:50:59
null
UTF-8
Java
false
false
4,307
java
/* * Copyright 2015 herd contributors * * 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.finra.dm.service.helper; import org.junit.Assert; import org.junit.Test; import org.finra.dm.model.api.xml.S3PropertiesLocation; import org.finra.dm.service.AbstractServiceTest; public class S3PropertiesLocationHelperTest extends AbstractServiceTest { /** * validate() throws no errors when {@link S3PropertiesLocation} is given with both bucket name and key as a non-blank string. * The given object's bucket name and key should be trimmed as a side effect. */ @Test public void testValidateNoErrorsAndTrimmed() { S3PropertiesLocation s3PropertiesLocation = getS3PropertiesLocation(); String expectedBucketName = s3PropertiesLocation.getBucketName(); String expectedKey = s3PropertiesLocation.getKey(); s3PropertiesLocation.setBucketName(BLANK_TEXT + s3PropertiesLocation.getBucketName() + BLANK_TEXT); s3PropertiesLocation.setKey(BLANK_TEXT + s3PropertiesLocation.getKey() + BLANK_TEXT); try { s3PropertiesLocationHelper.validate(s3PropertiesLocation); Assert.assertEquals("s3PropertiesLocation bucketName", expectedBucketName, s3PropertiesLocation.getBucketName()); Assert.assertEquals("s3PropertiesLocation key", expectedKey, s3PropertiesLocation.getKey()); } catch (Exception e) { Assert.fail("unexpected exception was thrown. " + e); } } /** * validate() throws an IllegalArgumentException when bucket name is blank. */ @Test public void testValidateWhenBucketNameIsBlankThrowsError() { S3PropertiesLocation s3PropertiesLocation = getS3PropertiesLocation(); s3PropertiesLocation.setBucketName(BLANK_TEXT); testValidateThrowsError(s3PropertiesLocation, IllegalArgumentException.class, "S3 properties location bucket name must be specified."); } /** * validate() throws an IllegalArgumentException when key is blank. */ @Test public void testValidateWhenObjectKeyIsBlankThrowsError() { S3PropertiesLocation s3PropertiesLocation = getS3PropertiesLocation(); s3PropertiesLocation.setKey(BLANK_TEXT); testValidateThrowsError(s3PropertiesLocation, IllegalArgumentException.class, "S3 properties location object key must be specified."); } /** * Tests that validate() throws an exception with called with the given {@link S3PropertiesLocation}. * * @param s3PropertiesLocation {@link S3PropertiesLocation} * @param expectedExceptionType expected exception type * @param expectedMessage expected exception message */ private void testValidateThrowsError(S3PropertiesLocation s3PropertiesLocation, Class<? extends Exception> expectedExceptionType, String expectedMessage) { try { s3PropertiesLocationHelper.validate(s3PropertiesLocation); Assert.fail("expected " + expectedExceptionType.getSimpleName() + ", but no exception was thrown"); } catch (Exception e) { Assert.assertEquals("thrown exception type", expectedExceptionType, e.getClass()); Assert.assertEquals("thrown exception message", expectedMessage, e.getMessage()); } } /** * Creates a new {@link S3PropertiesLocation} with bucket name and key. * * @return {@link S3PropertiesLocation} */ private S3PropertiesLocation getS3PropertiesLocation() { S3PropertiesLocation s3PropertiesLocation = new S3PropertiesLocation(); s3PropertiesLocation.setBucketName("testBucketName"); s3PropertiesLocation.setKey("testKey"); return s3PropertiesLocation; } }
[ "mchao47@gmail.com" ]
mchao47@gmail.com
7f34dd7fa6f66594907290b22d7b780140ca2ff5
7c5abe140137ae1068e6e8d0e7764fe8c73d5ed4
/src/main/java/Application.java
877d759d6da88de5833e23c5f21dcbdb2da78368
[]
no_license
AndriiDa/servlet-calc
9d1b2e74074ad87e0858b3bf61a15c7e92586e61
e1dc40292183338123aa81575fc5b761b265d6c9
refs/heads/master
2020-04-04T17:06:44.299903
2018-11-04T17:30:34
2018-11-04T17:30:34
155,248,931
0
0
null
null
null
null
UTF-8
Java
false
false
813
java
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import service.FreeMarker; import servlet.ServletLogout; import servlet.ServletLogin; import servlet.ServletRedirectTo; public class Application { public static void main(String[] args) throws Exception { Server server = new Server(8080); FreeMarker freeMarker = new FreeMarker("templates"); ServletContextHandler handler = new ServletContextHandler(); handler.addServlet(new ServletHolder(new ServletLogin(freeMarker)), "/login"); handler.addServlet(new ServletHolder(new ServletLogout(freeMarker)), "/logout"); handler.addServlet(new ServletHolder(new ServletRedirectTo("/login")), "/*"); server.start(); server.join(); } }
[ "a.i.danilishin@gmail.com" ]
a.i.danilishin@gmail.com
75b8ed74b289b71fc8168bd3eee9e734b59234a5
26c355a479f76d79d801bfbdd78a0ced8faf90cd
/src/main/java/fr/manchez/snoopy/application/models/objects/Timer.java
7954fd847a5e977ea093917d81152c00b027081c
[]
no_license
BowgartField/snoopy
f33ed1c46a799cb887f5e1c04155e22533529ccd
62c83759ae89dc272daf37802fe3784222700dba
refs/heads/master
2023-01-25T05:27:50.840592
2020-12-14T18:54:33
2020-12-14T18:54:33
304,638,006
0
0
null
null
null
null
UTF-8
Java
false
false
9,189
java
package fr.manchez.snoopy.application.models.objects; import fr.manchez.snoopy.application.SnoopyWindow; import fr.manchez.snoopy.application.enums.Structures; import javafx.animation.Animation; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Point2D; import javafx.util.Duration; import java.util.ArrayList; import java.util.List; public class Timer { Timeline timeline; /** Timer structure **/ List<Structure> timer; /** Window **/ SnoopyWindow window; /** Index **/ int timerIndex = 1; /** Temps avant dรฉfaite (en secondes) **/ int maxTimer = 74; public Timer(SnoopyWindow snoopyWindow){ this.window = snoopyWindow; initTimer(); drawTimer(); timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { //si le niveau n'est pas en pause if(!window.getLevelDisplay().isPause()){ //Il reste encore du temps if(timerIndex < maxTimer){ Structure structureActual = timer.get(timerIndex); if(!structureActual.getStructure().getSymbol().equals(Structures.TIMER_NOIR.getSymbol()) || !structureActual.getStructure().getSymbol().equals(Structures.TIMER_GRIS.getSymbol())){ if(structureActual.getStructure().getSymbol().equals(Structures.COIN_HAUT_DROITE.getSymbol()) || structureActual.getStructure().getSymbol().equals(Structures.COIN_BAS_DROITE.getSymbol()) || structureActual.getStructure().getSymbol().equals(Structures.COIN_BAS_GAUCHE.getSymbol())) { timerIndex++; structureActual = timer.get(timerIndex); } if(structureActual.getStructure().getSymbol().equals(Structures.TIMER_VER_ON.getSymbol())){ structureActual.setImage(Structures.TIMER_VER_OFF); } if(structureActual.getStructure().getSymbol().equals(Structures.TIMER_HORI_ON.getSymbol())){ structureActual.setImage(Structures.TIMER_HORI_OFF); } timerIndex++; }else{ timerIndex=timerIndex+2; timer.get(timerIndex).setImage(Structures.TIMER_HORI_OFF); } }else{ window.getLevelDisplay().defeat(); timeline.stop(); } } } })); timeline.setCycleCount(Animation.INDEFINITE); timeline.play(); } /** * */ private void initTimer(){ Structures timerHoriOn = Structures.TIMER_HORI_ON; Structures timerVerOn = Structures.TIMER_VER_ON; //Liste contenant la position de l'รฉlement et sa structure timer = new ArrayList<Structure>(){{ add(new Structure(new Point2D(0,0 ),Structures.COIN_HAUT_GAUCHE)); add(new Structure((new Point2D(16,0)),timerHoriOn)); add(new Structure((new Point2D(32,0)), timerHoriOn)); add(new Structure((new Point2D(48,0)), timerHoriOn)); add(new Structure((new Point2D(64,0)), timerHoriOn)); add(new Structure((new Point2D(80,0)), timerHoriOn)); add(new Structure((new Point2D(96,0)), timerHoriOn)); add(new Structure((new Point2D(112,0)), timerHoriOn)); add(new Structure((new Point2D(128, 0)), Structures.TIMER_NOIR)); add(new Structure((new Point2D(160, 0)), Structures.TIMER_GRIS)); add(new Structure((new Point2D(192,0)), timerHoriOn)); add(new Structure((new Point2D(208,0)), timerHoriOn)); add(new Structure((new Point2D(224,0)), timerHoriOn)); add(new Structure((new Point2D(240,0)), timerHoriOn)); add(new Structure((new Point2D(256,0)), timerHoriOn)); add(new Structure((new Point2D(272,0)), timerHoriOn)); add(new Structure((new Point2D(288,0)), timerHoriOn)); add(new Structure((new Point2D(304,0)), Structures.COIN_HAUT_DROITE)); add(new Structure((new Point2D(304,16)),timerVerOn)); add(new Structure((new Point2D(304,32)), timerVerOn)); add(new Structure((new Point2D(304,48)), timerVerOn)); add(new Structure((new Point2D(304,64)), timerVerOn)); add(new Structure((new Point2D(304,80)), timerVerOn)); add(new Structure((new Point2D(304,96)), timerVerOn)); add(new Structure((new Point2D(304,112)), timerVerOn)); add(new Structure((new Point2D(304, 128)), timerVerOn)); add(new Structure((new Point2D(304, 144)), timerVerOn)); add(new Structure((new Point2D(304, 160)), timerVerOn)); add(new Structure((new Point2D(304, 176)), timerVerOn)); add(new Structure((new Point2D(304,192)), timerVerOn)); add(new Structure((new Point2D(304,208)), timerVerOn)); add(new Structure((new Point2D(304,224)), timerVerOn)); add(new Structure((new Point2D(304,240)), timerVerOn)); add(new Structure((new Point2D(304,256)), timerVerOn)); add(new Structure((new Point2D(304,272)), timerVerOn)); add(new Structure((new Point2D(304,288)), timerVerOn)); add(new Structure((new Point2D(304,304)), Structures.COIN_BAS_DROITE)); add(new Structure((new Point2D(288,304)), timerHoriOn)); add(new Structure((new Point2D(272,304)), timerHoriOn)); add(new Structure((new Point2D(256,304)), timerHoriOn)); add(new Structure((new Point2D(240,304)), timerHoriOn)); add(new Structure((new Point2D(224,304)), timerHoriOn)); add(new Structure((new Point2D(208,304)), timerHoriOn)); add(new Structure((new Point2D(192,304)), timerHoriOn)); add(new Structure((new Point2D(176, 304)), timerHoriOn)); add(new Structure((new Point2D(160, 304)), timerHoriOn)); add(new Structure((new Point2D(144, 304)), timerHoriOn)); add(new Structure((new Point2D(128, 304)), timerHoriOn)); add(new Structure((new Point2D(112,304)), timerHoriOn)); add(new Structure((new Point2D(96,304)), timerHoriOn)); add(new Structure((new Point2D(80,304)), timerHoriOn)); add(new Structure((new Point2D(64,304)), timerHoriOn)); add(new Structure((new Point2D(48,304)), timerHoriOn)); add(new Structure((new Point2D(32,304)), timerHoriOn)); add(new Structure((new Point2D(16,304)),timerHoriOn)); add(new Structure((new Point2D(0,304)), Structures.COIN_BAS_GAUCHE)); add(new Structure((new Point2D(0,288)), timerVerOn)); add(new Structure((new Point2D(0,272)), timerVerOn)); add(new Structure((new Point2D(0,256)), timerVerOn)); add(new Structure((new Point2D(0,240)), timerVerOn)); add(new Structure((new Point2D(0,224)), timerVerOn)); add(new Structure((new Point2D(0,208)), timerVerOn)); add(new Structure((new Point2D(0,192)), timerVerOn)); add(new Structure((new Point2D(0, 176)), timerVerOn)); add(new Structure((new Point2D(0, 160)), timerVerOn)); add(new Structure((new Point2D(0, 144)), timerVerOn)); add(new Structure((new Point2D(0, 128)), timerVerOn)); add(new Structure((new Point2D(0,112)), timerVerOn)); add(new Structure((new Point2D(0,96)), timerVerOn)); add(new Structure((new Point2D(0,80)), timerVerOn)); add(new Structure((new Point2D(0,64)), timerVerOn)); add(new Structure((new Point2D(0,48)), timerVerOn)); add(new Structure((new Point2D(0,32)), timerVerOn)); add(new Structure((new Point2D(0,16)),timerVerOn)); }}; } /** * Dessine le compteur dans la fenรชtre */ private void drawTimer(){ //Affiche le timer for (Structure structure: timer){ structure.getImageView().setX(structure.getImageView().getX()*SnoopyWindow.SCALE); structure.getImageView().setY(structure.getImageView().getY()*SnoopyWindow.SCALE); window.addAllNode(structure.getImageView()); } } /** * Rรฉcupรฉre le score * @return int Retourne le score (calculรฉ) du timer */ public int getTimerScore(){ return (maxTimer-timerIndex)*100; } /** * */ public void stopAnimate(){ timeline.stop(); } }
[ "jerichez02@gmail.com" ]
jerichez02@gmail.com
93067dff32bfde4c953fff2cce5fcb43b4d085c6
9eb0ca8d51e6d3c55048624d08d0732ebc535959
/shop-service-impl/shop-service-impl-pay/src/main/java/com/shop/pay/factory/StrategyFactory.java
a4693554b42dd29f884aa39e85217f46a7ea4611
[]
no_license
247486412/shop
3219fc358b50ed7f0e3189af5c18e59544e6e2ad
eb2517d9ea3d3247f957d82965bcf2420ee10497
refs/heads/master
2022-12-11T07:32:30.117728
2019-10-04T05:56:00
2019-10-04T05:56:00
212,744,877
0
0
null
2022-12-06T00:33:30
2019-10-04T05:49:36
Java
UTF-8
Java
false
false
1,085
java
package com.shop.pay.factory; import com.shop.pay.strategy.PayStrategy; import org.apache.commons.lang.StringUtils; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * @Description ๆ”ฏไป˜็ญ–็•ฅๅทฅๅŽ‚ * @ClassName StrategyFactory * @Author Administrator * @CreateTime 2019/9/16 15:22 * Version 1.0 **/ public class StrategyFactory { public static Map<String, PayStrategy> strategyMap = new ConcurrentHashMap<String, PayStrategy>(); //ไผ ๅ…ฅๆ”ฏไป˜็ญ–็•ฅๅฎž็Žฐๅœฐๅ€,่ฟ”ๅ›žๅฏนๅบ”็š„ๆ”ฏไป˜็ญ–็•ฅๅฎž็Žฐ็ฑป public static PayStrategy getPayStrategy(String classAddr) { if (StringUtils.isBlank(classAddr)) { return null; } //ไฝฟ็”จmap้›†ๅˆ็ปดๆŠคๆ”ฏไป˜็ญ–็•ฅ๏ผŒ้ฟๅ…ๆฏๆฌก้ƒฝๅˆๅง‹ๅŒ– PayStrategy strategy = strategyMap.get(classAddr); if (strategy != null) { return strategy; } try { Class<?> classObj = Class.forName(classAddr); PayStrategy payStrategy = (PayStrategy) classObj.newInstance(); strategyMap.put(classAddr, payStrategy); return payStrategy; } catch (Exception e) { e.printStackTrace(); } return null; } }
[ "hutao247486412" ]
hutao247486412
15901712f3167c7f02c7e99bba76697243106c27
7bf5c7732983b103603b02b31307eca47815aff3
/src/com/buckwa/web/controller/admin/address/ProvinceController.java
97e07225d56642b8962fc9aa9ff4cbac08a24089
[]
no_license
benjaminekill/YungZa
81165dcb3b6518a10fb52a9529511cdc2ab038c6
0ff112e9bb89aad404e086dd62ba696e5e66c54e
refs/heads/master
2021-09-02T16:31:34.082154
2018-01-03T16:27:20
2018-01-03T16:27:20
116,156,580
0
0
null
null
null
null
UTF-8
Java
false
false
9,464
java
package com.buckwa.web.controller.admin.address; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.bind.annotation.ModelAttribute; 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.SessionAttributes; import org.springframework.web.servlet.ModelAndView; import com.buckwa.domain.admin.address.Province; import com.buckwa.domain.common.BuckWaRequest; import com.buckwa.domain.common.BuckWaResponse; import com.buckwa.domain.common.PagingBean; import com.buckwa.domain.validator.admin.address.ProvinceValidator; import com.buckwa.service.intf.CommonService; import com.buckwa.service.intf.admin.address.ProvinceService; import com.buckwa.util.BuckWaConstants; @Controller @RequestMapping("/admin/address/province") @SessionAttributes(types = Province.class) public class ProvinceController { private static Logger logger = Logger.getLogger(ProvinceController.class); @Autowired private ProvinceService provinceService; @Autowired private CommonService commonService; @RequestMapping(value="init.htm", method = RequestMethod.GET) public ModelAndView initList() { logger.info(" Start "); ModelAndView mav = new ModelAndView(); PagingBean bean = new PagingBean(); mav.addObject("province", new Province()); mav.addObject("pagingBean", bean); mav.setViewName("provinceList"); // Search with initial int offset = 0; bean.setOffset(offset); BuckWaRequest request = new BuckWaRequest(); mav.addObject("province", new Province()); request.put("pagingBean", bean); bean.put("province", new Province()); BuckWaResponse response = provinceService.getByOffset(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ logger.info(" Success "); PagingBean beanReturn = (PagingBean)response.getResObj("pagingBean"); bean.setCurrentPageItem(beanReturn.getCurrentPageItem()); bean.setTotalItems(beanReturn.getTotalItems()); mav.addObject("pagingBean", bean); }else { mav.addObject("errorCode", response.getErrorCode()); } return mav; } @RequestMapping(value="create.htm", method = RequestMethod.GET) public ModelAndView init() { logger.info(" Start "); ModelAndView mav = new ModelAndView(); mav.setViewName("provinceCreate"); Province province = new Province(); mav.addObject("province", province); return mav; } @RequestMapping(value="create.htm", method = RequestMethod.POST) public ModelAndView createProvince(@ModelAttribute Province province, BindingResult result) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); try{ new ProvinceValidator().validate(province, result); if (result.hasErrors()) { mav.setViewName("provinceCreate"); }else { BuckWaRequest request = new BuckWaRequest(); request.put("province", province); BuckWaResponse response = provinceService.create(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ mav.addObject("province", new Province()); mav.addObject("successCode", response.getSuccessCode()); mav.setViewName("provinceCreateSuccess"); }else { mav.addObject("errorCode", response.getErrorCode()); mav.setViewName("provinceCreate"); } } }catch(Exception ex){ ex.printStackTrace(); mav.addObject("errorCode", "E001"); } return mav; } @RequestMapping(value="search.htm", method = RequestMethod.GET) public ModelAndView searchGet(HttpServletRequest httpRequest ,@ModelAttribute PagingBean bean) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); mav.setViewName("provinceList"); try{ int offset = ServletRequestUtils.getIntParameter(httpRequest, "pager.offset", 0); bean.setOffset(offset); //logger.info(" PagingBean GET:"+BeanUtils.getBeanString(bean)); BuckWaRequest request = new BuckWaRequest(); mav.addObject("province", new Province()); request.put("pagingBean", bean); bean.put("province", new Province()); BuckWaResponse response = provinceService.getByOffset(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ logger.info(" Success "); PagingBean beanReturn = (PagingBean)response.getResObj("pagingBean"); bean.setCurrentPageItem(beanReturn.getCurrentPageItem()); bean.setTotalItems(beanReturn.getTotalItems()); mav.addObject("pagingBean", bean); }else { mav.addObject("errorCode", response.getErrorCode()); } }catch(Exception ex){ ex.printStackTrace(); mav.addObject("errorCode", "E001"); } return mav; } @RequestMapping(value="search.htm", method = RequestMethod.POST) public ModelAndView search(HttpServletRequest httpRequest,@ModelAttribute Province province,@ModelAttribute PagingBean bean) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); mav.setViewName("provinceList"); try{ int offset = ServletRequestUtils.getIntParameter(httpRequest, "pager.offset", 0); bean.setOffset(offset); BuckWaRequest request = new BuckWaRequest(); request.put("pagingBean", bean); bean.put("province", province); BuckWaResponse response = provinceService.getByOffset(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ PagingBean beanReturn = (PagingBean)response.getResObj("pagingBean"); bean.setCurrentPageItem(beanReturn.getCurrentPageItem()); bean.setTotalItems(beanReturn.getTotalItems()); mav.addObject("pagingBean", bean); mav.addObject("doSearch","true"); }else { mav.addObject("errorCode", response.getErrorCode()); } }catch(Exception ex){ ex.printStackTrace(); mav.addObject("errorCode", "E001"); } return mav; } @RequestMapping(value="edit.htm", method = RequestMethod.GET) public ModelAndView initEdit(@RequestParam("provinceId") String provinceId) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); BuckWaRequest request = new BuckWaRequest(); request.put("provinceId", provinceId); BuckWaResponse response = provinceService.getById(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ Province province = (Province)response.getResObj("province"); mav.addObject("province", province); }else { logger.info(" Fail !!!! :"+response.getErrorCode()+" : "+response.getErrorDesc()); mav.addObject("errorCode", response.getErrorCode()); } mav.setViewName("provinceEdit"); return mav; } @RequestMapping(value="edit.htm", method = RequestMethod.POST) public ModelAndView submitEdit(@ModelAttribute Province province, BindingResult result) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); try{ new ProvinceValidator().validate(province, result); if (result.hasErrors()) { mav.setViewName("provinceEdit"); }else { BuckWaRequest request = new BuckWaRequest(); request.put("province", province); BuckWaResponse response = provinceService.update(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ Province newProvince = new Province(); mav.addObject("province",province); mav.addObject("successCode", response.getSuccessCode()); mav.setViewName("provinceEdit"); }else { mav.addObject("errorCode", response.getErrorCode()); mav.setViewName("provinceEdit"); } } }catch(Exception ex){ ex.printStackTrace(); mav.addObject("errorCode", "E001"); } return mav; } @RequestMapping(value="delete.htm", method = RequestMethod.GET) public ModelAndView delete(@RequestParam("provinceId") String provinceId,HttpServletRequest httpRequest,@ModelAttribute Province province,@ModelAttribute PagingBean bean) { logger.info(" Start "); ModelAndView mav = new ModelAndView(); try{ mav.setViewName("provinceList"); BuckWaRequest request = new BuckWaRequest(); request.put("provinceId", provinceId); BuckWaResponse response = provinceService.deleteById(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ mav.addObject("successCode","S004"); }else { mav.addObject("errorCode", response.getErrorCode()); mav.addObject("pagingBean", bean); } // Search Again int offset = ServletRequestUtils.getIntParameter(httpRequest, "pager.offset", 0); bean.setOffset(offset); request.put("pagingBean", bean); bean.put("province", province); response = provinceService.getByOffset(request); if(response.getStatus()==BuckWaConstants.SUCCESS){ PagingBean beanReturn = (PagingBean)response.getResObj("pagingBean"); bean.setCurrentPageItem(beanReturn.getCurrentPageItem()); bean.setTotalItems(beanReturn.getTotalItems()); mav.addObject("pagingBean", bean); }else { mav.addObject("errorCode", response.getErrorCode()); } }catch(Exception ex){ ex.printStackTrace(); mav.addObject("errorCode", "E001"); } return mav; } }
[ "Wongwithit.rcl@gmail.com" ]
Wongwithit.rcl@gmail.com
7dd7370438e32315be01b10b8394b1fc46093b22
871fe8f23728c724e2c3e0f0b1ebbe2b815203fe
/JavaInterview/src/facebook/leetcode_2020/string/Reader4.java
b2c7456aad0f6fe62f6e2473eadcfbe2ffb1dc02
[]
no_license
harshbits/coding-questions
b02d340d996eb42bf3ed4ec8f2728f42db988ddd
22c13ad47859c988a3c1103853bc711b426d4ded
refs/heads/master
2021-07-08T16:53:15.629861
2020-06-23T16:19:39
2020-06-23T16:19:39
135,667,447
1
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
package facebook.leetcode_2020.string; // Keep a buffer of size 4 as a class variable, call it prevBuf. // Whenever we call read(n), read from prevBuf first until all characters in prevBuf are consumed // (to do this, we need 2 more int variables prevSize and prevIndex, // which tracks the actual size of prevBuf and the index of next character to read from prevBuf). // Then call read4 to read characters into prevBuf. // The code is quite clean I think. public class Reader4 { // it reads 4 character at time private char[] prevBuf = new char[4]; private int prevSize = -1; private int prevIndex = 0; public int read(char[] buf, int n) { int count = 0; while (count < n && prevSize != 0) { // add until we fill all data until previous is read. if (prevIndex < prevSize) { buf[count++] = prevBuf[prevIndex++]; continue; } prevSize = read4(prevBuf); prevIndex = 0; } return count; } private int read4(char[] buf) { return 1; } }
[ "harshb@uber.com" ]
harshb@uber.com
27b0a82f581f45992b6231affb74e6d3c951c03d
c6d0f30f0a1476b573986f4c412740ed01e66989
/bottle-api/src/main/java/com/teorange/magic/bottle/api/model/cache/QiniuToken.java
95662e6c18817539ecc22dad331c94ee0341ccb1
[ "Apache-2.0" ]
permissive
kellen0903/magic-bottle
0bc31ca634c703fe7d5fab9197d97a77d0c41a59
4128e11bf4d27495c3d66a4b2c25c1f4f264335b
refs/heads/master
2022-11-09T10:11:21.041112
2020-03-10T22:40:24
2020-03-10T22:40:24
246,284,006
34
12
Apache-2.0
2022-10-12T20:37:32
2020-03-10T11:34:13
Java
UTF-8
Java
false
false
280
java
package com.teorange.magic.bottle.api.model.cache; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * Created by kellen on 2018/5/30. */ @Data public class QiniuToken implements Serializable { private String token; private Date expireTime; }
[ "13249090143@163.com" ]
13249090143@163.com
26222628ba2614117d287ab5c0f7e90d24835d65
9b9eb05d9048667c1a5447b9a9f94db6e4ac0681
/JavaDesignPattern/src/main/java/com/zbcn/pattern/decorator/Client.java
7242c850a91b8b7814c4b7c2531c7463ecdee186
[]
no_license
1363653611/JavaBase
24e656fcea50d097654cdd6c3a8432e41665ca43
e0c2c47956bc211af75e59ca500dd025fd054469
refs/heads/master
2023-06-28T19:10:59.724350
2023-02-18T00:41:55
2023-02-18T00:41:55
207,731,516
0
1
null
2023-06-14T22:31:43
2019-09-11T05:36:51
Java
UTF-8
Java
false
false
2,160
java
package com.zbcn.pattern.decorator; /** * Title: Client.java8 * <p> * Description: ๆต‹่ฏ•็ฑป๏ผŒ็œ‹ไธ€ไธ‹ไฝ ๅฐฑไผšๅ‘็Žฐ๏ผŒ่ทŸjava็š„I/Oๆ“ไฝœๆœ‰ๅคšไนˆ็›ธไผผ * 1ใ€DecoratorๆŠฝ่ฑก็ฑปไธญ๏ผŒๆŒๆœ‰HumanๆŽฅๅฃ๏ผŒๆ–นๆณ•ๅ…จ้ƒจๅง”ๆ‰˜็ป™่ฏฅๆŽฅๅฃ่ฐƒ็”จ๏ผŒ * ็›ฎ็š„ๆ˜ฏไบค็ป™่ฏฅๆŽฅๅฃ็š„ๅฎž็Žฐ็ฑปๅณๅญ็ฑป่ฟ›่กŒ่ฐƒ็”จใ€‚ *2ใ€DecoratorๆŠฝ่ฑก็ฑป็š„ๅญ็ฑป๏ผˆๅ…ทไฝ“่ฃ…้ฅฐ่€…๏ผ‰๏ผŒ้‡Œ้ข้ƒฝๆœ‰ไธ€ไธชๆž„้€ ๆ–นๆณ•่ฐƒ็”จsuper(human), *่ฟ™ไธ€ๅฅๅฐฑไฝ“็Žฐไบ†ๆŠฝ่ฑก็ฑปไพ่ต–ไบŽๅญ็ฑปๅฎž็ŽฐๅณๆŠฝ่ฑกไพ่ต–ไบŽๅฎž็Žฐ็š„ๅŽŸๅˆ™ใ€‚ๅ› ไธบๆž„้€ ้‡Œ้ขๅ‚ๆ•ฐ้ƒฝๆ˜ฏHumanๆŽฅๅฃ๏ผŒ *ๅช่ฆๆ˜ฏ่ฏฅHuman็š„ๅฎž็Žฐ็ฑป้ƒฝๅฏไปฅไผ ้€’่ฟ›ๅŽป๏ผŒๅณ่กจ็Žฐๅ‡บDecorator dt = new Decorator_second(new Decorator_first(new Decorator_zero(human))); *่ฟ™็ง็ป“ๆž„็š„ๆ ทๅญใ€‚ๆ‰€ไปฅๅฝ“่ฐƒ็”จdt.wearClothes();dt.walkToWhere()็š„ๆ—ถๅ€™๏ผŒ *ๅˆๅ› ไธบๆฏไธชๅ…ทไฝ“่ฃ…้ฅฐ่€…็ฑปไธญ๏ผŒ้ƒฝๅ…ˆ่ฐƒ็”จsuper.wearClothesๅ’Œsuper.walkToWhere()ๆ–นๆณ•๏ผŒ *่€Œ่ฏฅsuperๅทฒ็ป็”ฑๆž„้€ ไผ ้€’ๅนถๆŒ‡ๅ‘ไบ†ๅ…ทไฝ“็š„ๆŸไธ€ไธช่ฃ…้ฅฐ่€…็ฑป๏ผˆ่ฟ™ไธชๅฏไปฅๆ นๆฎ้œ€่ฆ่ฐƒๆข้กบๅบ๏ผ‰๏ผŒ *้‚ฃไนˆ่ฐƒ็”จ็š„ๅณไธบ่ฃ…้ฅฐ็ฑป็š„ๆ–นๆณ•๏ผŒ็„ถๅŽๆ‰่ฐƒ็”จ่‡ช่บซ็š„่ฃ…้ฅฐๆ–นๆณ•๏ผŒๅณ่กจ็Žฐๅ‡บไธ€็ง่ฃ…้ฅฐใ€้“พๅผ็š„็ฑปไผผไบŽ่ฟ‡ๆปค็š„่กŒไธบใ€‚ *3ใ€ๅ…ทไฝ“่ขซ่ฃ…้ฅฐ่€…็ฑป๏ผŒๅฏไปฅๅฎšไน‰ๅˆๅง‹็š„็Šถๆ€ๆˆ–่€…ๅˆๅง‹็š„่‡ชๅทฑ็š„่ฃ…้ฅฐ๏ผŒ *ๅŽ้ข็š„่ฃ…้ฅฐ่กŒไธบ้ƒฝๅœจๆญคๅŸบ็ก€ไธŠไธ€ๆญฅไธ€ๆญฅ่ฟ›่กŒ็‚น็ผ€ใ€่ฃ…้ฅฐใ€‚ *4ใ€่ฃ…้ฅฐ่€…ๆจกๅผ็š„่ฎพ่ฎกๅŽŸๅˆ™ไธบ๏ผšๅฏนๆ‰ฉๅฑ•ๅผ€ๆ”พใ€ๅฏนไฟฎๆ”นๅ…ณ้—ญ๏ผŒ่ฟ™ๅฅ่ฏไฝ“็Žฐๅœจๆˆ‘ๅฆ‚ๆžœๆƒณๆ‰ฉๅฑ•่ขซ่ฃ…้ฅฐ่€…็ฑป็š„่กŒไธบ๏ผŒ *ๆ— ้กปไฟฎๆ”น่ฃ…้ฅฐ่€…ๆŠฝ่ฑก็ฑป๏ผŒๅช้œ€็ปงๆ‰ฟ่ฃ…้ฅฐ่€…ๆŠฝ่ฑก็ฑป๏ผŒๅฎž็Žฐ้ขๅค–็š„ไธ€ไบ›่ฃ…้ฅฐๆˆ–่€…ๅซ่กŒไธบๅณๅฏๅฏน่ขซ่ฃ…้ฅฐ่€…่ฟ›่กŒๅŒ…่ฃ…ใ€‚ *ๆ‰€ไปฅ๏ผšๆ‰ฉๅฑ•ไฝ“็Žฐๅœจ็ปงๆ‰ฟใ€ไฟฎๆ”นไฝ“็Žฐๅœจๅญ็ฑปไธญ๏ผŒ *่€Œไธๆ˜ฏๅ…ทไฝ“็š„ๆŠฝ่ฑก็ฑป๏ผŒ่ฟ™ๅ……ๅˆ†ไฝ“็Žฐไบ†ไพ่ต–ๅ€’็ฝฎๅŽŸๅˆ™๏ผŒ่ฟ™ๆ˜ฏ่‡ชๅทฑ็†่งฃ็š„่ฃ…้ฅฐ่€…ๆจกๅผ * @author likun * @created 2018-3-16 ไธ‹ๅˆ2:55:51 * @version V1.0 */ public class Client { public static void main(String[] args){ Human person = new Person(); Decorator decorator = new Decorator_two( new Decorator_first( new Decorator_zero( person))); decorator.wearClothes(); decorator.walkToWhere(); } }
[ "1363653611@qq.com" ]
1363653611@qq.com
92599e9f00109a47d3674981153e199e485b5a8f
cefe50d09ef41cf96d47a1943421abf2d812bad6
/src/main/java/br/com/dacoder/database/ConnectionFactory.java
be3ecbb00c1237078450fe5197790702dbcd7d58
[ "MIT" ]
permissive
gabrielteodosio/ToDoList
9fb77f6cdb25ca172df9d0f57bce4cffce6d9468
1a8239e7ceb10bce54c912d9ef0cf8bf73a92eda
refs/heads/master
2020-12-28T03:15:02.048769
2020-02-04T08:59:51
2020-02-04T08:59:51
238,162,546
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package br.com.dacoder.database; import java.sql.Connection; import java.sql.SQLException; public class ConnectionFactory { private static Connection connection; public static Connection getInstance() { return connection; } public static void closeConnection() { try { if (!connection.isClosed()) { connection.close(); } else { System.out.println("Connection is already closed"); } } catch (SQLException e) { System.err.println("Error closing database connection, please verify if there is already an instance of a connection"); } } }
[ "gabriel.marques@mesainc.com.br" ]
gabriel.marques@mesainc.com.br
62da99fa6e991019aec7bf6f962c26819cd527af
0c993ac3c8ac60aa0765561530959feb9847c0a3
/geek-spring-part-two-19/shop-user-service/src/main/java/ru/geekbrains/controller/repr/UserRepr.java
a061f674882258c34f7b9720bde2bf1b9b19bb40
[]
no_license
D1mkaGit/GeekBrains
0b96bb871b70708e6ad3f8f7ca74ad3908d9205e
a638f697e3380c2c1461156fa8b8153f825f220e
refs/heads/master
2023-04-06T06:47:20.423827
2022-12-25T19:31:18
2022-12-25T19:31:18
221,762,240
1
1
null
2023-03-24T01:17:50
2019-11-14T18:30:42
Java
UTF-8
Java
false
false
2,161
java
package ru.geekbrains.controller.repr; import ru.geekbrains.persist.model.Role; import ru.geekbrains.persist.model.User; import javax.validation.constraints.NotEmpty; import java.util.Set; public class UserRepr { Long id; @NotEmpty String username; String password; // todo: ะฝัƒะถะฝะพ ะณะดะต-ั‚ะพ ะฝะฐ ะฑัะบะต ะฟั€ะพะฒะตั€ัั‚ัŒ, ั‡ั‚ะพ ะฟะฐั€ะพะปัŒ ะฝะต ะฟัƒัั‚ะพะน ะฝะฐ ั€ะตะณะต, ะฐ ะฒ ะฟั€ะพั„ะฐะนะปะต ัะพั…ั€ะฐะฝัั‚ัŒ ะฑะตะท ะฟะฐั€ะพะปั String firstName; String lastName; String email; Set<Role> roles; public UserRepr() { } public UserRepr(User user) { this.id = user.getId(); this.username = user.getUsername(); this.password = user.getPassword(); this.firstName = user.getFirstName(); this.lastName = user.getLastName(); this.email = user.getEmail(); this.roles = user.getRoles(); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } @Override public String toString() { return "UserRepr{" + "id=" + id + ", username='" + username + '\'' + ", password='" + password + '\'' + '}'; } }
[ "30922998+D1mkaGit@users.noreply.github.com" ]
30922998+D1mkaGit@users.noreply.github.com
64c90e927eb5dd3dd6686631ea0613afa00e664d
427eb3516df4a401cd7a216d5ae331bf08b21f13
/src/main/java/com/casabonita/spring/mvc_hibernate/service/ReadingService.java
3c7f6d20bd340b8856f17ed2876786e41ca8056d
[]
no_license
Casa-Bonita/project_Hibernate_SpringMVC
3cff5685c840e38e1f8b2e470cddc9e0e7fa5c78
3d4687daf6f1fda4db9a641e2dbccfd220f3f29e
refs/heads/master
2023-06-04T23:38:19.581587
2021-07-01T05:21:04
2021-07-01T05:21:04
349,089,634
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package com.casabonita.spring.mvc_hibernate.service; import com.casabonita.spring.mvc_hibernate.entity.Reading; import java.util.List; public interface ReadingService { List<Reading> getAllReadings(); void saveReading(Reading reading, String meterNumber); Reading getReading(Integer id); void deleteReadingById(Integer id); void deleteReadingByMeterId(Integer id); }
[ "pol33@rambler.ru" ]
pol33@rambler.ru
341bac03f0c9c0feceb29b0f81b13ef07fc74aca
2789c90098968cc62831d111a4481143d4f72f06
/src/main/java/com/liefeng/property/repository/project/AppHomeImageRepository.java
32eb075f0b71bc42a988473c5fa072317b776c99
[ "Apache-2.0" ]
permissive
Damon0668/newone
f3ffdcbe5654d55b60b4b98601a118468ac511ae
4c27dc95b62ca6c10f4cca720d6fb7f71e4a1f93
refs/heads/master
2021-01-01T03:39:11.826764
2016-05-10T12:07:40
2016-05-10T12:07:40
58,458,593
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.liefeng.property.repository.project; import javax.transaction.Transactional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import com.liefeng.property.po.project.AppHomeImagePo; /** * ไธšไธปๆ‰‹ๆœบ็ซฏ้ฆ–้กต่ฝฎๆ’ญๅ›พไป“ๅ‚จๅฑ‚ * * @author ZhenTingJun * @date 2016ๅนด3ๆœˆ11ๆ—ฅ */ @Transactional public interface AppHomeImageRepository extends JpaRepository<AppHomeImagePo, String> { /** * ๅˆ†้กตๆŸฅ่ฏข้ฆ–้กต่ฝฎๆ’ญๅ›พ * @param projectId ๅฐๅŒบID * @param pageable ๅˆ†้กตๅ‚ๆ•ฐ * @return ่ฝฎๆ’ญๅ›พๅˆ†้กตๆ•ฐๆฎ */ public Page<AppHomeImagePo> findByProjectIdOrderBySeq(String projectId, Pageable pageable); }
[ "zhentingjun@foxmail.com" ]
zhentingjun@foxmail.com
b23be5cb6e401ef13ffd4aa9b0a0fe59b7e61133
35e483de1b2374080454d9bdf88d255aea3ca1b0
/src/entity/CustomDrink.java
76fa378216c5d796c023e7c48c5096a5f544e132
[]
no_license
NiklasDerEchte/Getraenkespender
c47143bb888d0bd7def452a5616bfd8f36c33d8c
114f8cde82e22324226b645aa9ad250d568aff54
refs/heads/master
2021-07-17T09:17:32.858407
2019-04-07T18:39:22
2019-04-07T18:39:22
149,921,097
0
0
null
null
null
null
UTF-8
Java
false
false
1,472
java
package entity; public class CustomDrink { private int id; private String name; private String description; private float volumeCl1; private float volumeCl2; private float volumeCl3; private float volumeCl4; private float volumeCl5; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public float getVolumeCl1() { return volumeCl1; } public void setVolumeCl1(float volumeCl1) { this.volumeCl1 = volumeCl1; } public float getVolumeCl2() { return volumeCl2; } public void setVolumeCl2(float volumeCl2) { this.volumeCl2 = volumeCl2; } public float getVolumeCl3() { return volumeCl3; } public void setVolumeCl3(float volumeCl3) { this.volumeCl3 = volumeCl3; } public float getVolumeCl4() { return volumeCl4; } public void setVolumeCl4(float volumeCl4) { this.volumeCl4 = volumeCl4; } public float getVolumeCl5() { return volumeCl5; } public void setVolumeCl5(float volumeCl5) { this.volumeCl5 = volumeCl5; } }
[ "nikwo97@aim.com" ]
nikwo97@aim.com
db0924a86a868ba7f644b943b4e1806056406146
b8fe6754bc8e106565eda410b39971feb0ea3d07
/lab5/app/src/main/java/com/example/administrator/lab3/MainActivity.java
adc2596a82f81c925785e99dd1a1685d7dec17e2
[]
no_license
syanchen/Android_lab
59ba6316efffe5ed77349e28c11175a8f9286a48
d5f9b8c20fb667f188c2ac1e2b67ee3674732f9f
refs/heads/master
2021-09-16T10:01:36.967498
2018-06-19T09:41:48
2018-06-19T09:41:48
106,102,472
0
0
null
null
null
null
UTF-8
Java
false
false
10,684
java
package com.example.administrator.lab3; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Toast; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.io.Serializable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Random; import static android.R.attr.data; import static android.R.id.list; public class MainActivity extends AppCompatActivity { private List<Items> Item_list ; private List<Items> carItem; private CommonAdapter adapter; private LinearLayout sec; private ListView listview; private shopcar_adapter buy_adapter; private ImageButton imback; private RecyclerView recyclerView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EventBus.getDefault().register(this);//ๆณจๅ†Œ่ฎข้˜…่€… sec=(LinearLayout)findViewById(R.id.secondview);///////////////////////ไธ€ๅผ€ๅง‹่ดญ็‰ฉ่ฝฆ็•Œ้ขไธๅฏ่ง sec.setVisibility(View.INVISIBLE); Item_list = new ArrayList<Items>(); carItem = new ArrayList<Items>(); final String[] Name = new String[]{ "Enchated Forest","Arla Milk","Devondale Milk", "Kindle Oasis", "Waitrose ๆ—ฉ้ค้บฆ็‰‡","Mcvitie's ้ฅผๅนฒ","Ferrero Rocher", "Maltesers","Lindt","Borggreve" }; final String[] Price = new String[]{"ยฅ 5.00", "ยฅ 59.00", "ยฅ 79.00", "ยฅ 2399.00", "ยฅ 179.00", "ยฅ 14.00", "ยฅ 132.59", "ยฅ 141.43", "ยฅ 139.43", "ยฅ 28.90"}; String[] Info = new String[]{"ไฝœ่€… Johanna Basford", "ไบงๅœฐ ๅพทๅ›ฝ", "ไบงๅœฐ ๆพณๅคงๅˆฉไบš", "็‰ˆๆœฌ 8GB", "้‡้‡ 2Kg", "ไบงๅœฐ ่‹ฑๅ›ฝ", "้‡้‡ 300g", "้‡้‡ 118g", "้‡้‡ 249g", "้‡้‡ 640g"}; for(int i=0;i<10;i++){ Item_list.add(new Items(Name[i],Price[i],Info[i])); } ///////////////////////////////////////////////////////////////ไฝฟ็”จ้€‚้…ๅ™จๆ”พๅ…ฅไฟกๆฏ recyclerView = (RecyclerView)findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(this)); adapter=new CommonAdapter(MainActivity.this,Item_list); recyclerView.setAdapter(adapter); ////////////////////////////////////////////////////////////////็‚นๅ‡ปๅ•†ๅ“ adapter.setOnTtemClickListener(new CommonAdapter.OnItemClickListener() { ////////////////////////////////////////////////////่ทณๅˆฐๅฏนๅบ”่ฏฆๆƒ… @Override public void onClick(int position) { Intent intent = new Intent(MainActivity.this, Detail.class); intent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); //intent.setFlags(intent.FLAG_ACTIVITY_MULTIPLE_TASK); intent.putExtra("Name", Item_list.get(position).getName()); intent.putExtra("Price", Item_list.get(position).getPrice()); intent.putExtra("Info", Item_list.get(position).getInfo()); startActivity(intent); //startActivityForResult(intent, 0); } ///////////////////////////////////////////////////้•ฟๆŒ‰ๅˆ ้™คๆŸไธช็‰ฉๅ“ @Override public void onLongClick(int position) { Toast.makeText(MainActivity.this,"็งป้™ค็ฌฌ"+String.valueOf(position+1)+"ไธชๅ•†ๅ“",Toast.LENGTH_SHORT).show();//////////////////////////ๆณจๆ„ๆ˜ฏposition+1 Item_list.remove(position); adapter.notifyDataSetChanged();//็”จไบŽไฟฎๆ”นๅฎŒๆ•ฐๆฎๅŽๆ›ดๆ–ฐ็•Œ้ข } }); buy_adapter=new shopcar_adapter(MainActivity.this,carItem); listview=(ListView)findViewById(R.id.shoppingCar);//็›ดๆŽฅไฝฟ็”จๅทฒๆœ‰้€‚้…ๅ™จๅณๅฏ listview.setAdapter(buy_adapter);//ๅช่ƒฝๅœจๅค–้ขๅฃฐๆ˜Ž๏ผŸ /////////////////////////////////////่ดญ็‰ฉ่ฝฆ็š„ๆŒ‰้’ฎ่ขซ็‚นๅ‡ป๏ผŒ่ฏปๅ…ฅๆญคๆ—ถ็š„ๅ•†ๅ“ๆ•ฐๆฎ listview.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(MainActivity.this, Detail.class);//Ssecongview ๆ”นๆˆDSetail intent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); //intent.setFlags(intent.FLAG_ACTIVITY_MULTIPLE_TASK); intent.putExtra("Name", carItem.get(position).getName()); intent.putExtra("Price", carItem.get(position).getPrice()); intent.putExtra("Info", carItem.get(position).getInfo()); startActivity(intent); //startActivityForResult(intent,0);//ไผ ๅ‡บไธ€ไธช่ฟ”ๅ›žๅ€ผไธบ0 } }); listview.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) { final AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);//ๅชๆ˜ฏthisไธ่กŒ๏ผŒ่ฆๆ˜ฏMainActivityๆ‰ๅฏไปฅ alertDialog.setTitle("็งป้™คๅ•†ๅ“"); alertDialog.setMessage("ไปŽ่ดญ็‰ฉ่ฝฆ็งป้™ค"+carItem.get(position).getName()+"?").setPositiveButton("็กฎ่ฎค", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if(carItem.remove(position)!=null){ buy_adapter.notifyDataSetChanged(); Toast.makeText(getApplicationContext(), "ๆ‚จ้€‰ๆ‹ฉไบ†[็กฎ่ฎค]", Toast.LENGTH_SHORT).show(); } } }).setNegativeButton("ๅ–ๆถˆ", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(getApplicationContext(), "ๆ‚จ้€‰ๆ‹ฉไบ†[ๅ–ๆถˆ]", Toast.LENGTH_SHORT).show(); } }).show(); return true; } }); ///////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////่ดญ็‰ฉ่ฝฆ็•Œ้ขๅ’Œๅ•†ๅ“็•Œ้ข็š„ๅ›พๆ ‡ไธ่ƒฝๅŒๆ—ถๅ‡บ็Žฐ,็ฑปไผผไบŽๆ˜Ÿๆ˜Ÿไน‹้—ด็š„่ฝฌๆข็š„ๅšๆณ• imback=(ImageButton)findViewById(R.id.shopcar); imback.setTag("0"); imback.setOnClickListener(new View.OnClickListener() {//////////////////////////////////ๅค„็†ๆ˜Ÿๆ˜Ÿๅ›พๆกˆ่ขซ็‚นๅ‡ปๆ—ถ่ฆๅ‘็”Ÿๅ˜ๅŒ– @Override public void onClick(View view) { Object flag=imback.getTag();///////////////////////////ไธ่ƒฝไธบintๅž‹ if(flag=="0"){////////////////////////1ๆ”น0๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ imback.setTag("1"); imback.setImageResource(R.drawable.mainpage); sec.setVisibility(View.VISIBLE); recyclerView.setVisibility(View.INVISIBLE); } else{ imback.setImageResource(R.drawable.shoplist); sec.setVisibility(View.INVISIBLE); imback.setTag("0"); recyclerView.setVisibility(View.VISIBLE); } } }); Broadcast(); } // //// ็ฌฌไธ€ไธชๅ‚ๆ•ฐไธบ่ฏทๆฑ‚็ ๏ผŒๅณ่ฐƒ็”จstartActivityForResult()ไผ ้€’่ฟ‡ๅŽป็š„ๅ€ผ //// ็ฌฌไบŒไธชๅ‚ๆ•ฐไธบ็ป“ๆžœ็ ๏ผŒ็ป“ๆžœ็ ็”จไบŽๆ ‡่ฏ†่ฟ”ๅ›žๆ•ฐๆฎๆฅ่‡ชๅ“ชไธชๆ–ฐActivity // protected void onActivityResult(int requestCode, int resultCode, Intent data){ // if(requestCode == 0 && resultCode == 0){//่ฟ›ๅ…ฅไบ†ๅ•†ๅ“่ฏฆๆƒ…็•Œ้ข่ฟ›่กŒไบ†็‚นๅ‡ป๏ผŒๆ‰€ไปฅไป…ๅฝ“ไธคไธช้ƒฝไธบ0ๆ—ถ่กจ็คบๅ•†ๅ“่ขซๆทปๅŠ  // Bundle bundle=data.getExtras(); // String mingzi=bundle.getString("Nam"); // String jiage=bundle.getString("Pric"); // String info=bundle.getString("Inf"); // int cnt=bundle.getInt("cnt",0);//ๆฒกๆœ‰0 // for(int i=0;i<cnt;i++){ // carItem.add(new Items(mingzi,jiage,info)); // } // buy_adapter.notifyDataSetChanged(); // } // } ///////////////////////////////////////////้™ๆ€ๆณจๅ†Œ private final String STATICACTION="STATIC"; private void Broadcast(){ Intent intentBroadcast=new Intent(STATICACTION); int n=10; Random random = new Random(); int num=random.nextInt(n); intentBroadcast.putExtra("name", Item_list.get(num).getName()); intentBroadcast.putExtra("price", Item_list.get(num).getPrice()); intentBroadcast.putExtra("info", Item_list.get(num).getInfo()); sendBroadcast(intentBroadcast); } ////////////////////////////////////////EventBus @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(MessageEvent event){//ๆ›ฟไปฃไน‹ๅ‰็š„onActivityResult็š„ๅŠŸ่ƒฝ,ๅฎšไน‰ไธ€ไธชๆถˆๆฏๅค„็†็š„ๆ–นๆณ• int cnt=event.getCnt(); carItem.add(new Items(event.getName(),event.getInfo(),event.getPrice())); buy_adapter.notifyDataSetChanged(); } ////////////////////ๆณจ้”€ๆณจๅ†Œ @Override protected void onDestroy(){ super.onDestroy(); EventBus.getDefault().unregister(this); } protected void onNewIntent(Intent intent){ super.onNewIntent(intent); sec.setVisibility(View.VISIBLE); recyclerView.setVisibility(View.INVISIBLE); imback.setImageResource(R.drawable.mainpage); imback.setTag("1");//ๅค„็†่ดญ็‰ฉ่ฝฆๆŒ‰้’ฎ่ฆ็‚นๅ‡ปไธคไธ‹ๆ‰ไผš่ฟ›่กŒ่ทณ่ฝฌ } }
[ "32096519+syanchen@users.noreply.github.com" ]
32096519+syanchen@users.noreply.github.com
6db7af36d4968a454c0255cd4bb375eacbfb7d13
10ab541255fa932ca6fa7aaa47e36394e38f05c0
/pluginstandard/src/main/java/com/example/pluginstandard/service/IPluginService.java
320f66936fe1e5d0c9a8678e51122622e4555e12
[]
no_license
zhouyudonghit/PluginTest
bcb34789d59ca0b1fd21054718d2fd0d144663d2
17a07046419b252a70406d335be832abc9184030
refs/heads/master
2021-09-08T09:34:41.937734
2019-07-22T02:24:31
2021-08-30T10:17:09
188,992,752
0
0
null
null
null
null
UTF-8
Java
false
false
757
java
package com.example.pluginstandard.service; import android.app.Service; import android.content.Intent; import android.content.res.Configuration; import android.os.IBinder; import com.example.pluginstandard.base.IBase; public interface IPluginService extends IBase { void onCreate(); void onStart(Intent intent, int startId); int onStartCommand(Intent intent, int flags, int startId); void onDestroy(); void onConfigurationChanged(Configuration newConfig); void onLowMemory(); void onTrimMemory(int level); IBinder onBind(Intent intent); boolean onUnbind(Intent intent); void onRebind(Intent intent); void onTaskRemoved(Intent rootIntent); //ไผ ้€’Context void attach(Service proxyService); }
[ "yudongzhou@pptv.com" ]
yudongzhou@pptv.com
607feb5f08b80f65aa8bb1ebda5c6e8e2c4d810f
80fbecd17132622a5790a010dbc991654fa63138
/Android Beginner Projects/TruthDare/app/src/main/java/com/selfskyway/truthdare/MainActivity.java
ad4a16a0e9a4f0ab4a8cc382cc827c966c957bf2
[]
no_license
ajayshrma/Android-Development-Beginners-Projects-
5fc487ef212b2adce5e3669e801e07b81e62a5ef
1f78fa31039dd059762e7999e7dbff5d3b10b3a3
refs/heads/master
2022-12-09T22:58:51.802843
2020-09-01T10:34:54
2020-09-01T10:34:54
291,430,362
1
0
null
null
null
null
UTF-8
Java
false
false
2,406
java
package com.selfskyway.truthdare; import androidx.appcompat.app.AppCompatActivity; import android.media.AudioManager; import android.media.SoundPool; import android.os.Bundle; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.ImageView; import android.widget.TextView; import java.util.Timer; import java.util.TimerTask; public class MainActivity extends AppCompatActivity { TextView spin ; ImageView bottel ; SoundPool soundPool; AudioManager audioManager; int backNoise, backNoiseId; float BASE_ROTATION_DEGREES = (float)(3000); int DURATION = 4000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); soundPool = new SoundPool(1, audioManager.STREAM_MUSIC, 0); backNoise = soundPool.load(getApplicationContext(),R.raw.effect,1); bottel = findViewById(R.id.bottel); spin = findViewById(R.id.spin); spinClickListener(); } private void hide(View v, int duration) { v.animate().alpha(0f).setDuration(duration); } void stopBackNoice() { new Timer().schedule(new TimerTask() { @Override public void run() { soundPool.setVolume(backNoiseId, .3f,.3f); new Timer().schedule(new TimerTask() { @Override public void run() { soundPool.stop(backNoiseId); } }, 1000); } }, DURATION-1000); } void spinClickListener() { bottel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { spin.setText("Bottle Spinning"); hide(spin, 2000); soundPool.autoPause(); backNoiseId = soundPool.play(backNoise, 1, 1, 1, 1, 1f); float deg = bottel.getRotation()+BASE_ROTATION_DEGREES+((float)Math.random()*360F); // ratation to rotate bottel.animate().rotation(deg).setDuration(DURATION).setInterpolator(new AccelerateDecelerateInterpolator()); stopBackNoice(); } }); } }
[ "ajaysharma27600@gmail.com" ]
ajaysharma27600@gmail.com
f0739ed323819a5da0729c31329a430dccaaf499
4aaa06d3ff42a583ca9570e56c8512a73b4ef229
/src/jdbc/RemoteMetaData.java
df173d613256f1997b7fd9e5980ac364b4db639f
[]
no_license
chtlp/rocking-worm
0bbbc5141283798e6526d5cf39e4e7ea351aeb1e
7c1ec26dfdcaa037c6bf6f16756e5b78707e7e8b
refs/heads/master
2020-04-21T23:31:43.406418
2011-06-21T01:44:59
2011-06-21T01:44:59
32,191,842
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package jdbc; import java.rmi.*; /** * The RMI remote interface corresponding to ResultSetMetaData. The methods are * identical to those of ResultSetMetaData, except that they throw * RemoteExceptions instead of SQLExceptions. */ public interface RemoteMetaData extends Remote { public int getColumnCount() throws RemoteException; public String getColumnName(int column) throws RemoteException; public int getColumnType(int column) throws RemoteException; }
[ "chnttlp@gmail.com@be5d99c3-f8a2-b0e2-7f17-cfee10d10c18" ]
chnttlp@gmail.com@be5d99c3-f8a2-b0e2-7f17-cfee10d10c18
3d10ea1b136936d8158a0f8c499c9a979194ff50
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_44091ec1f69a57d0e04f4e3081d07467f825bcba/Preferences/9_44091ec1f69a57d0e04f4e3081d07467f825bcba_Preferences_t.java
fda31f205b37ef4fae2984c394a6b5d93186063f
[]
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,676
java
package com.noshufou.android.su.preferences; public class Preferences { public static final String PIN = "pref_pin"; public static final String CHANGE_PIN = "pref_change_pin"; public static final String TIMEOUT = "pref_timeout"; public static final String AUTOMATIC_ACTION = "pref_automatic_action"; public static final String GHOST_MODE = "pref_ghost_mode"; public static final String SECRET_CODE = "pref_secret_code"; public static final String SHOW_STATUS_ICONS = "pref_show_status_icons"; public static final String STATUS_ICON_TYPE = "pref_status_icon_type"; public static final String APPLIST_SHOW_LOG_DATA = "pref_applist_show_log_data"; public static final String LOGGING = "pref_logging"; public static final String DELETE_OLD_LOGS = "pref_delete_old_logs"; public static final String LOG_ENTRY_LIMIT = "pref_log_entry_limit"; public static final String HOUR_FORMAT = "pref_24_hour_format"; public static final String SHOW_SECONDS = "pref_show_seconds"; public static final String DATE_FORMAT = "pref_date_format"; public static final String CLEAR_LOG = "pref_clear_log"; public static final String NOTIFICATIONS = "pref_notifications"; public static final String NOTIFICATION_TYPE = "pref_notification_type"; public static final String TOAST_LOCATION = "pref_toast_location"; public static final String USE_ALLOW_TAG = "pref_use_allow_tag"; public static final String WRITE_ALLOW_TAG = "pref_write_allow_tag"; public static final String VERSION = "pref_version"; public static final String BIN_VERSION = "pref_bin_version"; public static final String CHANGELOG = "pref_changelog"; public static final String GET_ELITE = "pref_get_elite"; public static final String CATEGORY_SECURITY = "pref_category_security"; public static final String CATEGORY_APPLIST = "pref_category_applist"; public static final String CATEGORY_LOG = "pref_category_log"; public static final String CATEGORY_NOTIFICATION = "pref_category_notification"; public static final String CATEGORY_NFC = "pref_category_nfc"; public static final String CATEGORY_INFO = "pref_category_info"; public static final String ELITE_PREFS[] = new String[] { CATEGORY_SECURITY + ":" + PIN, CATEGORY_SECURITY + ":" + CHANGE_PIN, CATEGORY_SECURITY + ":" + TIMEOUT, CATEGORY_SECURITY + ":" + GHOST_MODE, CATEGORY_SECURITY + ":" + SECRET_CODE, CATEGORY_LOG + ":" + LOG_ENTRY_LIMIT , CATEGORY_NOTIFICATION + ":" + TOAST_LOCATION, CATEGORY_NFC + ":all" }; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5e26219146502d06b31338866b4c372867bd15d0
095557569d3596125f1291359b044b1d0849b780
/core/src/main/java/com/cc/core/wechat/hook/DbHooks.java
97d61c665f9788800fc4898f5144e969fad398dd
[]
no_license
907043175/MMCtl
1d6692f02a6a72391d21fb88614a49350d11a9a4
d7f2b3dd697dfa45873085558a3a37be8537de16
refs/heads/master
2020-05-04T10:35:42.733782
2019-02-25T15:44:03
2019-02-25T15:44:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,332
java
package com.cc.core.wechat.hook; import com.cc.core.command.Callback; import com.cc.core.data.db.DbService; import com.cc.core.data.db.model.DBPassword; import com.cc.core.log.KLog; import com.cc.core.wechat.Wechat; import com.cc.core.xposed.BaseXposedHook; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedHelpers; public class DbHooks extends BaseXposedHook { @Override public void hook(ClassLoader classLoader) { Class classSQLiteDatabase = XposedHelpers.findClass("com.tencent.wcdb.database.SQLiteDatabase", classLoader); Class classSQLiteDatabaseConfiguration = XposedHelpers.findClass("com.tencent.wcdb.database.SQLiteDatabaseConfiguration", classLoader); Class classSQLiteCipherSpec = XposedHelpers.findClass("com.tencent.wcdb.database.SQLiteCipherSpec", classLoader); XposedHelpers.findAndHookMethod("com.tencent.wcdb.database.SQLiteConnectionPool", classLoader, "open", classSQLiteDatabase, classSQLiteDatabaseConfiguration, byte[].class, classSQLiteCipherSpec, int.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { byte[] passwordBuffer = (byte[]) param.args[2]; if (passwordBuffer == null) { return; } String path = (String) XposedHelpers.getObjectField(param.args[1], "path"); if (!path.endsWith("EnMicroMsg.db")) { return; } Wechat.DB_PATH = path; Wechat.DB_PASSWORD = new String(passwordBuffer); boolean hmacEnabled = XposedHelpers.getBooleanField(param.args[3], "hmacEnabled"); int kdfIteration = XposedHelpers.getIntField(param.args[3], "kdfIteration"); int pageSize = XposedHelpers.getIntField(param.args[3], "pageSize"); String sql = String.format( "PRAGMA key = '%s';" + "PRAGMA cipher_use_hmac = %s;" + "PRAGMA cipher_page_size = %d;" + "PRAGMA kdf_iter = %d;", Wechat.DB_PASSWORD, hmacEnabled ? "ON" : "OFF", pageSize, kdfIteration); DBPassword password = new DBPassword(); password.setDecryptSql(sql); password.setPassword(new String(passwordBuffer)); password.setPath(path); password.setWechatId(Wechat.LoginWechatId); /*DbService.getInstance().insertDbPassword(password, new Callback() { @Override public void onResult(String result) { KLog.d("password has saved"); } });*/ KLog.e("XPosed", "----- path: " + path + ", decrypt sql: " + sql); } }); } }
[ "ichengc@tutanota.com" ]
ichengc@tutanota.com
50fa4436acbbbda83de128e76eed2dd2bc71abf7
a97ab1ac798046f48fed8c87c44c8881a70386de
/src/Baconian.java
dc5b141d18b4754ea2d69e4a350e620dbc1fdd90
[]
no_license
nakayecc/Engima
00905ed14ca0f85d16e78acf1201a045d2f8f496
f331f8776dbe74a1106aa3a60fc4b336bca61716
refs/heads/master
2020-05-04T15:18:52.488326
2019-04-05T07:22:39
2019-04-05T07:22:39
178,846,965
0
0
null
null
null
null
UTF-8
Java
false
false
2,170
java
import java.util.*; public class Baconian { private HashMap dict; public Baconian() { this.dict = new HashMap<Character, String>() {{ put('A', "AAAAA"); put('B', "AAAAB"); put('C', "AAABA"); put('D', "AAABB"); put('E', "AABAA"); put('F', "AABAB"); put('G', "AABBA"); put('H', "AABBB"); put('I', "ABAAA"); put('J', "ABAAB"); put('K', "ABABA"); put('L', "ABABB"); put('M', "ABBAA"); put('N', "ABBAB"); put('O', "ABBBA"); put('P', "ABBBB"); put('Q', "BAAAA"); put('R', "BAAAB"); put('S', "BAABA"); put('T', "BAABB"); put('U', "BABAA"); put('V', "BABAB"); put('W', "BABBA"); put('X', "BABBB"); put('Y', "BBAAA"); put('Z', "BBAAB"); put(' ', "BBBAA"); }}; } public String baconianCipherCodder(String[] args) { String outputCode = ""; String toCript = args[2].toUpperCase(); char[] toCriptChar = toCript.toCharArray(); for (int i = 0; i < toCript.length(); i++) { outputCode += dict.get(toCriptChar[i]) + " "; } return outputCode; } public String baconianCipherDecodder(String coddedString) { coddedString = coddedString.replace(" ", ""); int begin = 0; int end = 5; String FindChar = ""; for (int i = 0; i < (coddedString.length() / 5); i++) { FindChar += findValueByKey(dict, coddedString.substring(begin, end)); begin += 5; end += 5; } return FindChar; } public Object findValueByKey(HashMap hashMap, String value) { Iterator hmIterator = hashMap.entrySet().iterator(); while (hmIterator.hasNext()) { Map.Entry mapElement = (Map.Entry) hmIterator.next(); if (value.equals(mapElement.getValue())) { return mapElement.getKey(); } } return "-1"; } }
[ "michal.nabie@gmail.com" ]
michal.nabie@gmail.com
dbfc8fd0059386f8fb40e1b0e627c087f36a009d
ff5bcb8ef92e0fc8ecac43fcd9dd43f9c4a1d80b
/app/src/main/java/com/example/Model/Adapters/Nothing.java
16a2be0f8c056f01f9f6695b12c847f110e708c8
[]
no_license
renzorh98/IDNPV001
64790fdf943fdeea73fd92248c4635348b549a14
d303432cd90566902b4d2530e93e76a6003e637d
refs/heads/master
2023-02-02T01:53:38.086893
2020-12-18T23:51:42
2020-12-18T23:51:42
308,204,079
0
0
null
null
null
null
UTF-8
Java
false
false
62
java
package com.example.Model.Adapters; public class Nothing { }
[ "renzorh98@gmail.com" ]
renzorh98@gmail.com
1f29666e9409c4290bd18449f1505adf22c223f4
8165a20766f190a5d4b60b573fc53c4974e33e99
/src/main/java/com/github/nikita_volkov/java/reducer/CharacterCatReducer.java
b447a0c09890e6b7b7c1b1d9aff7a418c5cde137
[]
no_license
nikita-volkov/reducer.java
a83db4f847611d97a0f5740eb2c7a934b172f8ea
3cd615d9ef40e05be7113da157116825cc13968d
refs/heads/master
2020-07-09T18:16:57.613028
2016-11-29T15:17:19
2016-11-29T15:17:19
74,028,584
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.github.nikita_volkov.java.reducer; import com.github.nikita_volkov.java.iterations.*; public final class CharacterCatReducer implements Reducer<Character, String> { @Override public Iteration<Character, String> newIteration() { return new CharacterCatIteration(); } }
[ "nikita.y.volkov@mail.ru" ]
nikita.y.volkov@mail.ru
c1f54bb916a06fdae5894ee61360002f6183b32a
5cd84a07bd309c51a32c70a2316ae31662915fbd
/integration/integration-core/src/main/java/org/osehra/integration/core/validator/BatchValidator.java
e8523e542c848b33b2bc7efe8f3f8893a5f31bef
[ "LicenseRef-scancode-public-domain" ]
permissive
WorldVistA/Blue-Button-Document-Adapter
e3f3e036fb29c7aac52a861260eacc6baaefe7c1
db87d3bea60fbb901111fd864ff1cc74153f14e5
refs/heads/master
2021-05-27T07:23:46.075890
2013-02-28T00:22:39
2013-02-28T00:22:39
7,023,911
0
1
null
null
null
null
UTF-8
Java
false
false
1,393
java
package org.osehra.integration.core.validator; import java.util.List; import org.springframework.beans.factory.annotation.Required; /** * Pass the message through multiple validators. * * @author Julian Jewel */ public class BatchValidator implements Validator<Object> { /** * List of validators. * * @uml.property name="validators" * @uml.associationEnd multiplicity="(0 -1)" * elementType="org.osehra.das.common.validator.Validator" */ private List<Validator<Object>> validators; /** * Set the list of validators. * * @param theValidators * the validators */ @Required public void setValidators(final List<Validator<Object>> theValidators) { this.validators = theValidators; } /** * Validate the input object. * * @param object * the input object * @return whether true or false - false if validation is a failure * @throws ValidatorException * if an error occurred in validation. Some validators might * throw exception to stop processing if the object fails * validation. */ @Override public boolean validate(final Object object) throws ValidatorException { for (final Validator<Object> validator : this.validators) { final boolean outcome = validator.validate(object); if (!outcome) { return false; } } return true; } }
[ "brad.king@kitware.com" ]
brad.king@kitware.com
fda1453f699cf93b4cdc87dd7596f7e4f913912a
e4d38767807e95f21bbc9b27cf341ce5d870bcda
/WEB-INF/classes/com/theOasis/dao/impl/Translatable.java
c37b8027f79c2c36c35ca2fc058770d7791ef2e1
[]
no_license
wkdgudcjf/oasis
ea80ca997b0a626119f32883548087b0e32d469c
5dceaedaf0653b081aa6a8caf449a70b6a1e21e4
refs/heads/main
2023-08-25T04:50:44.525401
2021-10-26T13:37:24
2021-10-26T13:37:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
67
java
package com.theOasis.dao.impl; public interface Translatable { }
[ "sd30414@gmail.com" ]
sd30414@gmail.com
20269321209ac7be5c182419307df8b1d81b4819
558865b7db4dd2c4778277d5c2ce24a3e5ffb68f
/Data-Structures/src/com/yatish/Trees/BST/J4_BST_Delete.java
3f61d8b23f52c481fb1446c5096d18cf8b8e00a0
[]
no_license
yatish0492/dataStructures
8e2ae36df232899f9b24f485f1824c5fd1f359c9
54f64cccf23d92aee66d01860a5772c812d00209
refs/heads/master
2022-04-30T05:47:30.076749
2022-04-26T11:54:50
2022-04-26T11:54:50
139,709,883
0
1
null
null
null
null
UTF-8
Java
false
false
6,225
java
package com.yatish.Trees.BST; import com.yatish.Trees.Node; /* In BST, removal of a nodes means we need fill that spot if it is not a leaf node. We need to consider 3 cases here, 1) leaf node : Simply remove from the tree 50 50 / \ delete(20) / \ 30 70 ---------> 30 70 / \ / \ \ / \ 20 40 60 80 40 60 80 \ \ 65 65 2) One child : Copy the child to the node and delete the child 50 50 / \ delete(30) / \ 30 70 ---------> 40 70 \ / \ / \ 40 60 80 60 80 \ \ 65 65 3) 2 children : If it has 2 children, if right child is leaf node, then that right node itself will be used for replacing the deleted node. Then that right node will be deleted. if right child is not a leaf node, then we will go to its right node and then go to its left nodes recursively and take the last left node and replace the deleted node with this node and we will delete that last left node used for replacement. which will be '60' in this case. If the last left node has a right child then that child will be put in the place of last left node deleted. NOTE: following is another way of finding which nodes should be replacing the deleted node, ---------------------------------------------------------------------------------------------- we will get the in-order traversal of the tree and the next element of the deletion element in this traversal order will be used for replaced the deleted node. In this example, for the tree in-order traversal order is 40,50,60,65,70,80. so in this in-order traversal next node after node '50' is '60', so we are replacing '50' node with '60' 50 60 / \ delete(50) / \ 40 70 ---------> 40 70 / \ / \ 60 80 65 80 \ 65 Consider we delete 60 after this, then it will be replaced with '70' as it right node doesn't have left child node. But once 70 is deleted '80' will become ophan right? No actually, we will apply the 3 cases of deletion, we discussed for that node as well. it will fall into case 2 and it will be replaced by '80' 60 65 / \ delete(60) / \ 40 70 ---------> 40 70 / \ \ 65 80 80 */ public class J4_BST_Delete { public static void main(String[] args) { /* 50 / \ 30 70 / \ / \ 20 40 60 80 \ 65 */ BSTDelete obj = new BSTDelete(); obj.root = new Node(50); obj.root.left = new Node(30); obj.root.right = new Node(70); obj.root.left.left = new Node(20); obj.root.left.right = new Node(40); obj.root.right.left = new Node(60); obj.root.right.right = new Node(80); obj.root.right.left.right = new Node(65); obj.deleteNode(obj.root, 20); obj.deleteNode(obj.root, 30); obj.deleteNode(obj.root, 50); obj.deleteNode(obj.root, 60); } } class BSTDelete { Node root; // Make sure that you need to return 'Node' here, you cannot use 'void' as return type because we need to assign // different node to its parent.left or parent.right. public Node deleteNode(Node currentNode, Integer deletionKey) { if(currentNode == null) { return null; } if(currentNode.data == deletionKey) { // Case-1 and Case-2 is handled here. if(currentNode.left == null) { return currentNode.right; } else if(currentNode.right == null) { return currentNode.left; } // Case-3 Node parentNode = currentNode; Node replacementNode = currentNode.right; // Iteration to goto the last left node recursively. preserving last nodes parent node in 'parentNode' // and last node in 'replacementNode' while(replacementNode.left != null) { parentNode = replacementNode; replacementNode = replacementNode.left; } // 'parentNode == currentNode' means the right node didn't have left node at all. so that means we need to // replace deleted 'deletionKey' node with right node. so deleted right node needs to be replaced with its // right child. if it doesn't have any right child then 'null' will be assigned. if(parentNode == currentNode) { currentNode.right = replacementNode.right; } else { // replacing the left last node with its right child. parentNode.left = replacementNode.right; } // replacing the deletion node key currentNode.data = replacementNode.data; return currentNode; } if(deletionKey < currentNode.data) { currentNode.left = deleteNode(currentNode.left, deletionKey); return currentNode; } else { currentNode.right = deleteNode(currentNode.right, deletionKey); return currentNode; } } }
[ "ycs@hotels.com" ]
ycs@hotels.com
b4cd08eb9ca5fb76687c12bf7fa298f6ebded2cf
10ce2b0ded05078e182c66184927fe3412872fe9
/src/main/java/es/faculdade/moodle/aluno/paypal/service/PayPalService.java
a5335b26ba525f7a896a29d7aa0d2eef0d37117e
[]
no_license
DyeslenSilva/faculdade-webflux-aluno
9e56c23483c3de098d6560da868e9e85f62f1e47
ea3e99baf9db4d26f748b46fdbf1960d052d15a6
refs/heads/main
2023-05-12T15:25:16.814434
2021-06-02T21:16:21
2021-06-02T21:16:21
358,350,337
0
0
null
null
null
null
UTF-8
Java
false
false
2,599
java
package es.faculdade.moodle.aluno.paypal.service; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.paypal.api.payments.Amount; import com.paypal.api.payments.Payer; import com.paypal.api.payments.Payment; import com.paypal.api.payments.PaymentExecution; import com.paypal.api.payments.RedirectUrls; import com.paypal.api.payments.Transaction; import com.paypal.core.rest.APIContext; import com.paypal.core.rest.PayPalRESTException; import es.faculdade.moodle.aluno.paypal.enumeration.MetodoDePagamento; import es.faculdade.moodle.aluno.paypal.enumeration.Moeda; import es.faculdade.moodle.aluno.paypal.enumeration.UrlEnum; import es.faculdade.moodle.aluno.paypal.model.PagamentoIntent; @Service public class PayPalService { @Autowired private String apiContext; public Payment createPaymet(Double total, String currency,String method, String intent,String description, String cancelURL,String succesUrl) throws PayPalRESTException, com.paypal.base.rest.PayPalRESTException { Amount amount = new Amount(); amount.setCurrency(currency); total = new BigDecimal(total).setScale(2, RoundingMode.HALF_UP).doubleValue(); amount.setTotal(String.format("%.2f", total)); Transaction transaction = new Transaction(); transaction.setDescription(description); transaction.setAmount(amount); List<Transaction> transactions = new ArrayList<>(); transactions.add(transaction); Payer payer = new Payer(); payer.setPaymentMethod(method.toString()); Payment payment = new Payment(); payment.setIntent(intent.toString()); payment.setPayer(payer); payment.setTransactions(transactions); RedirectUrls redirectUrls = new RedirectUrls(); redirectUrls.setCancelUrl(cancelURL); redirectUrls.setReturnUrl(succesUrl); payment.setRedirectUrls(redirectUrls); return payment.create(apiContext); } public Payment executePayment(String idPayment, String idPayer) throws com.paypal.base.rest.PayPalRESTException { Payment payment= new Payment(); payment.setId(idPayment); PaymentExecution paymentExecution = new PaymentExecution(); paymentExecution.setPayerId(idPayer); return payment.execute(apiContext, paymentExecution); } public Payment createPaymet(double valor, Moeda r$, MetodoDePagamento paypal, PagamentoIntent sale, String descricao, UrlEnum successurl, UrlEnum cancelurl) { // TODO Auto-generated method stub return null; } }
[ "dyeslensilva97@gmail.com" ]
dyeslensilva97@gmail.com
2f678d154d5f06063849320000c8dff2d7db3959
c237cd8bd282fe87dec668be61cc101d23b494c6
/src/main/java/model/Author.java
9c71c2df5fbb99de7bfba6f6b35141c544d298ee
[]
no_license
Markl121/Demoproject
9a9cb927c9d41f015ba6978ccddb5d20f018029a
2f12317699a032063c21ad089f094da9ba85bca3
refs/heads/master
2020-04-14T00:56:56.785880
2019-04-01T12:47:48
2019-04-01T12:47:48
163,546,860
0
0
null
2018-12-30T01:15:19
2018-12-29T23:03:36
Java
UTF-8
Java
false
false
1,051
java
package model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.SequenceGenerator; @Entity public class Author implements IStorable { @Id @Column(name = "authorId") @SequenceGenerator(name = "seq_authorId", sequenceName = "seq_authorId", initialValue = 1, allocationSize = 1) @GeneratedValue(generator = "seq_authorId") private int id; @Column(nullable = false) private String name; @Column(name = "description") private String desc; public Author() { } public int getId() { return id; } public Author setId(int id) { this.id = id; return this; } public String getName() { return name; } public Author setName(String name) { this.name = name; return this; } public String getDesc() { return desc; } public Author setDesc(String desc) { this.desc = desc; return this; } @Override public String toString() { return "Author [id=" + id + ", name=" + name + ", desc=" + desc + "]"; } }
[ "shanshangu2014@gmail.com" ]
shanshangu2014@gmail.com
57599dc71f8400da40796e435fc2841747609ffa
8364826e19cb3564918fb06447d534654b759b9c
/src/me/ItemBank/main/WithdrawMenu.java
462c17fb6f6f61dbb4f107cdd9bdb5dd687b730f
[]
no_license
Cmarullo308/ItemBank
417fc0ce280afbc5ccffab564100ee7fc4e05962
c7d2a18b644f84421563e0f6fff7fbb97d819db0
refs/heads/master
2023-08-24T09:49:39.861923
2023-08-05T20:35:28
2023-08-05T20:35:28
245,942,135
0
0
null
null
null
null
UTF-8
Java
false
false
6,561
java
package me.ItemBank.main; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; public class WithdrawMenu { ItemBank plugin; Inventory inventory; String menuName; ItemStack[] menuButtons; ItemStack sortByCategoryButton; ItemStack allItemsButton; ItemStack aButtonIcon; ItemStack bButtonIcon; ItemStack cButtonIcon; ItemStack dButtonIcon; ItemStack eButtonIcon; ItemStack fButtonIcon; ItemStack gButtonIcon; ItemStack hButtonIcon; ItemStack iButtonIcon; ItemStack jButtonIcon; ItemStack kButtonIcon; ItemStack lButtonIcon; ItemStack mButtonIcon; ItemStack nButtonIcon; ItemStack oButtonIcon; ItemStack pButtonIcon; ItemStack qButtonIcon; ItemStack rButtonIcon; ItemStack sButtonIcon; ItemStack tButtonIcon; ItemStack uButtonIcon; ItemStack vButtonIcon; ItemStack wButtonIcon; ItemStack xButtonIcon; ItemStack yButtonIcon; ItemStack zButtonIcon; ItemStack backgroundIcon; ItemStack backButtonIcon; ItemStack exitIcon; public WithdrawMenu(ItemBank plugin, String menuName) { this.plugin = plugin; this.menuName = ChatColor.BLUE + menuName; } public void setup() { BankMenus bankMenus = plugin.bank.bankMenus; sortByCategoryButton = bankMenus.makeButton(Material.BOOKSHELF, ChatColor.GOLD + "Categories"); allItemsButton = bankMenus.makeButton(Material.ENDER_CHEST, ChatColor.GOLD + "All Items"); aButtonIcon = bankMenus.makeButton(Material.SHULKER_BOX, ChatColor.GOLD + "A"); bButtonIcon = bankMenus.makeButton(Material.WHITE_SHULKER_BOX, ChatColor.GOLD + "B"); cButtonIcon = bankMenus.makeButton(Material.ORANGE_SHULKER_BOX, ChatColor.GOLD + "C"); dButtonIcon = bankMenus.makeButton(Material.MAGENTA_SHULKER_BOX, ChatColor.GOLD + "D"); eButtonIcon = bankMenus.makeButton(Material.LIGHT_BLUE_SHULKER_BOX, ChatColor.GOLD + "E"); fButtonIcon = bankMenus.makeButton(Material.YELLOW_SHULKER_BOX, ChatColor.GOLD + "F"); gButtonIcon = bankMenus.makeButton(Material.LIME_SHULKER_BOX, ChatColor.GOLD + "G"); hButtonIcon = bankMenus.makeButton(Material.PINK_SHULKER_BOX, ChatColor.GOLD + "H"); iButtonIcon = bankMenus.makeButton(Material.GRAY_SHULKER_BOX, ChatColor.GOLD + "I"); jButtonIcon = bankMenus.makeButton(Material.LIGHT_GRAY_SHULKER_BOX, ChatColor.GOLD + "J"); kButtonIcon = bankMenus.makeButton(Material.CYAN_SHULKER_BOX, ChatColor.GOLD + "K"); lButtonIcon = bankMenus.makeButton(Material.PURPLE_SHULKER_BOX, ChatColor.GOLD + "L"); mButtonIcon = bankMenus.makeButton(Material.BLUE_SHULKER_BOX, ChatColor.GOLD + "M"); nButtonIcon = bankMenus.makeButton(Material.BROWN_SHULKER_BOX, ChatColor.GOLD + "N"); oButtonIcon = bankMenus.makeButton(Material.GREEN_SHULKER_BOX, ChatColor.GOLD + "O"); pButtonIcon = bankMenus.makeButton(Material.RED_SHULKER_BOX, ChatColor.GOLD + "P"); qButtonIcon = bankMenus.makeButton(Material.BLACK_SHULKER_BOX, ChatColor.GOLD + "Q"); rButtonIcon = bankMenus.makeButton(Material.SHULKER_BOX, ChatColor.GOLD + "R"); sButtonIcon = bankMenus.makeButton(Material.WHITE_SHULKER_BOX, ChatColor.GOLD + "S"); tButtonIcon = bankMenus.makeButton(Material.ORANGE_SHULKER_BOX, ChatColor.GOLD + "T"); uButtonIcon = bankMenus.makeButton(Material.MAGENTA_SHULKER_BOX, ChatColor.GOLD + "U"); vButtonIcon = bankMenus.makeButton(Material.LIGHT_BLUE_SHULKER_BOX, ChatColor.GOLD + "V"); wButtonIcon = bankMenus.makeButton(Material.YELLOW_SHULKER_BOX, ChatColor.GOLD + "W"); xButtonIcon = bankMenus.makeButton(Material.LIME_SHULKER_BOX, ChatColor.GOLD + "X"); yButtonIcon = bankMenus.makeButton(Material.PINK_SHULKER_BOX, ChatColor.GOLD + "Y"); zButtonIcon = bankMenus.makeButton(Material.GRAY_SHULKER_BOX, ChatColor.GOLD + "Z"); backgroundIcon = bankMenus.makeButton(Material.LIGHT_BLUE_STAINED_GLASS_PANE, " "); backButtonIcon = bankMenus.makeButton(Material.RED_STAINED_GLASS_PANE, ChatColor.RED + "Back"); exitIcon = bankMenus.makeButton(Material.BARRIER, ChatColor.RED + "Exit"); menuButtons = new ItemStack[45]; for (int slotNum = 0; slotNum < 45; slotNum++) { switch (slotNum) { case 4: menuButtons[slotNum] = sortByCategoryButton.clone(); break; case 9: menuButtons[slotNum] = allItemsButton.clone(); break; case 10: menuButtons[slotNum] = aButtonIcon.clone(); break; case 11: menuButtons[slotNum] = bButtonIcon.clone(); break; case 12: menuButtons[slotNum] = cButtonIcon.clone(); break; case 13: menuButtons[slotNum] = dButtonIcon.clone(); break; case 14: menuButtons[slotNum] = eButtonIcon.clone(); break; case 15: menuButtons[slotNum] = fButtonIcon.clone(); break; case 16: menuButtons[slotNum] = gButtonIcon.clone(); break; case 17: menuButtons[slotNum] = hButtonIcon.clone(); break; case 18: menuButtons[slotNum] = iButtonIcon.clone(); break; case 19: menuButtons[slotNum] = jButtonIcon.clone(); break; case 20: menuButtons[slotNum] = kButtonIcon.clone(); break; case 21: menuButtons[slotNum] = lButtonIcon.clone(); break; case 22: menuButtons[slotNum] = mButtonIcon.clone(); break; case 23: menuButtons[slotNum] = nButtonIcon.clone(); break; case 24: menuButtons[slotNum] = oButtonIcon.clone(); break; case 25: menuButtons[slotNum] = pButtonIcon.clone(); break; case 26: menuButtons[slotNum] = qButtonIcon.clone(); break; case 27: menuButtons[slotNum] = rButtonIcon.clone(); break; case 28: menuButtons[slotNum] = sButtonIcon.clone(); break; case 29: menuButtons[slotNum] = tButtonIcon.clone(); break; case 30: menuButtons[slotNum] = uButtonIcon.clone(); break; case 31: menuButtons[slotNum] = vButtonIcon.clone(); break; case 32: menuButtons[slotNum] = wButtonIcon.clone(); break; case 33: menuButtons[slotNum] = xButtonIcon.clone(); break; case 34: menuButtons[slotNum] = yButtonIcon.clone(); break; case 35: menuButtons[slotNum] = zButtonIcon.clone(); break; case 36: menuButtons[slotNum] = backButtonIcon.clone(); break; case 40: menuButtons[slotNum] = exitIcon.clone(); break; default: menuButtons[slotNum] = backgroundIcon.clone(); break; } } } public void openMenuFor(Player player) { inventory = Bukkit.createInventory(player, 45, this.menuName); inventory.setContents(menuButtons); player.openInventory(inventory); } }
[ "cmarullo308@gmail.com" ]
cmarullo308@gmail.com
14336276df32f9f20712bfa166c4cb3ded380687
74403fd00e64908948c206b264458bdb5bb42905
/src/main/java/Czlowiek_Potrafiacy_Jesc/Czlowiek.java
b8b01212f3ec6d04f3db8efae79ada6637c91857
[]
no_license
marcingaleniszcz/ZadankaZ_09_03_2019
20610e112a62b14b33a48eb451c7c14a1dbac153
2639d95f6886928c12c9cf503a77245171ff4712
refs/heads/master
2020-04-27T21:32:45.849581
2019-03-09T14:59:55
2019-03-09T14:59:55
174,701,669
0
0
null
null
null
null
UTF-8
Java
false
false
1,071
java
package Czlowiek_Potrafiacy_Jesc; public class Czlowiek implements IPotrafiacyJesc { private String imie; public Czlowiek() { System.out.println("Tworzฤ™ czล‚owieka!"); } public Czlowiek(String imie) { this.imie = imie; } public static void przywitajSie(){ System.out.println("Czeล›ฤ‡ - metoda statyczna."); } public void ziewnij(){ System.out.println("AAAAaaaaAAAAAaaaaaaa - metoda instancji."); } public static void zerknijNa(String cos){ System.out.println("Zerkam na: " + cos + " - metoda statyczna."); } public void przygladajSie(String czemus){ System.out.println("Przygladam siฤ™: " + czemus + " - metoda instancji."); } @Override public void jedz(String cos) { System.out.println("Jem: " + cos); } public String getImie() { return this.imie; } public String toString() { return this.imie; } @FunctionalInterface public static interface IJedzacy { void jedz(IPotrafiacyJesc potrafiacyJesc, String cos); } }
[ "48137171+marcingaleniszcz@users.noreply.github.com" ]
48137171+marcingaleniszcz@users.noreply.github.com
00c8141aa461e1c5f9a8077a3560a847f40d8b9c
e53141ccac373c8858fa9c680a8a91763c8f4723
/src/fiserv/Campanha.java
4e5ed645fc90ca0950b611ccc360667c25355b63
[]
no_license
piresalexsandro/teste-vaga-fiserv
6c19075e28ace5179eebb48f4859637e095a58d5
57d73a78def2a28a8d90794429355259344b6b00
refs/heads/main
2023-02-12T16:21:57.377521
2021-01-10T19:07:22
2021-01-10T19:07:22
328,373,127
0
0
null
null
null
null
UTF-8
Java
false
false
646
java
package fiserv; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class Campanha { public List<Integer> calcularPromocao(List<Integer> valores){ List<Integer> valoresRetorno = new ArrayList<>(); DoisEmUm doisEmUm = new DoisEmUm(); return valores.stream().map(doisEmUm::calcular).collect(Collectors.toList()); } public List<Integer> calcularPromocao(List<Integer> valores, Estoque estoque){ List<Integer> valoresRetorno = new ArrayList<>(); valores.forEach(v->{valoresRetorno.add(estoque.calcular(v));}); return valoresRetorno; } }
[ "alexsandro.pires-ext@viavarejo.com.br" ]
alexsandro.pires-ext@viavarejo.com.br
121895191c5b819eeb70d4860a737a82fd4118f4
051cf5dcfe5c651274f034f2ae694c7a12f4db70
/app/src/main/java/com/conquer/sharp/main/MainAdapter.java
5cca06e6123f1b7c9b0d780908f36180f0a73749
[]
no_license
wanghaihui/Sharp
a8fddfac59c25b957ac129e496f83b3acd046fbc
f58e9a504ad1170050dd12b196e7a470a719794a
refs/heads/master
2021-07-18T20:52:49.305736
2020-04-18T10:50:47
2020-04-18T10:50:47
137,014,501
1
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
package com.conquer.sharp.main; import android.content.Context; import android.view.View; import com.conquer.sharp.R; import com.conquer.sharp.recycler.BaseRecyclerAdapter; import com.conquer.sharp.recycler.OnRVItemClickListener; import com.conquer.sharp.recycler.RecyclerViewHolder; import java.util.ArrayList; public class MainAdapter extends BaseRecyclerAdapter<String> { private OnRVItemClickListener onRVItemClickListener; public void setOnRVItemClickListener(OnRVItemClickListener listener) { onRVItemClickListener = listener; } public MainAdapter(Context context, int layoutId) { super(context, layoutId); mDataList = new ArrayList<>(); } public void convert(RecyclerViewHolder holder, String name, int position) { holder.setText(R.id.tvName, name); holder.getConvertView().setTag(position); holder.getConvertView().setOnClickListener(onClickListener); } private View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View view) { if (onRVItemClickListener != null) { onRVItemClickListener.onItemClick((Integer) view.getTag()); } } }; }
[ "465495722@qq.com" ]
465495722@qq.com
6ee81f31acf5ffc63d74637b8f8c46c7ee1e45bb
fe3dae359d06757f0040546cd96d0f0d4dbf046c
/target/generated-sources/xjc/hello/wsdl/ObjectFactory.java
ec7cab47e1935869885746908c8de4143b146e14
[]
no_license
amalankrish/Weather-Client
ccc631646af37b4ad14838a82f2209fab1118a77
bbe28087a3690aed678cf4a1452dfafe3f062def
refs/heads/master
2021-01-18T14:36:52.578867
2015-08-24T22:03:38
2015-08-24T22:03:38
41,329,259
0
0
null
null
null
null
UTF-8
Java
false
false
5,573
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // 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: 2015.08.24 at 12:07:35 PM EDT // package hello.wsdl; 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 hello.wsdl 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 _ArrayOfWeatherDescription_QNAME = new QName("http://ws.cdyne.com/WeatherWS/", "ArrayOfWeatherDescription"); private final static QName _ForecastReturn_QNAME = new QName("http://ws.cdyne.com/WeatherWS/", "ForecastReturn"); private final static QName _WeatherReturn_QNAME = new QName("http://ws.cdyne.com/WeatherWS/", "WeatherReturn"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: hello.wsdl * */ public ObjectFactory() { } /** * Create an instance of {@link GetWeatherInformation } * */ public GetWeatherInformation createGetWeatherInformation() { return new GetWeatherInformation(); } /** * Create an instance of {@link GetWeatherInformationResponse } * */ public GetWeatherInformationResponse createGetWeatherInformationResponse() { return new GetWeatherInformationResponse(); } /** * Create an instance of {@link ArrayOfWeatherDescription } * */ public ArrayOfWeatherDescription createArrayOfWeatherDescription() { return new ArrayOfWeatherDescription(); } /** * Create an instance of {@link GetCityForecastByZIP } * */ public GetCityForecastByZIP createGetCityForecastByZIP() { return new GetCityForecastByZIP(); } /** * Create an instance of {@link GetCityForecastByZIPResponse } * */ public GetCityForecastByZIPResponse createGetCityForecastByZIPResponse() { return new GetCityForecastByZIPResponse(); } /** * Create an instance of {@link ForecastReturn } * */ public ForecastReturn createForecastReturn() { return new ForecastReturn(); } /** * Create an instance of {@link GetCityWeatherByZIP } * */ public GetCityWeatherByZIP createGetCityWeatherByZIP() { return new GetCityWeatherByZIP(); } /** * Create an instance of {@link GetCityWeatherByZIPResponse } * */ public GetCityWeatherByZIPResponse createGetCityWeatherByZIPResponse() { return new GetCityWeatherByZIPResponse(); } /** * Create an instance of {@link WeatherReturn } * */ public WeatherReturn createWeatherReturn() { return new WeatherReturn(); } /** * Create an instance of {@link WeatherDescription } * */ public WeatherDescription createWeatherDescription() { return new WeatherDescription(); } /** * Create an instance of {@link ArrayOfForecast } * */ public ArrayOfForecast createArrayOfForecast() { return new ArrayOfForecast(); } /** * Create an instance of {@link Forecast } * */ public Forecast createForecast() { return new Forecast(); } /** * Create an instance of {@link Temp } * */ public Temp createTemp() { return new Temp(); } /** * Create an instance of {@link POP } * */ public POP createPOP() { return new POP(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ArrayOfWeatherDescription }{@code >}} * */ @XmlElementDecl(namespace = "http://ws.cdyne.com/WeatherWS/", name = "ArrayOfWeatherDescription") public JAXBElement<ArrayOfWeatherDescription> createArrayOfWeatherDescription(ArrayOfWeatherDescription value) { return new JAXBElement<ArrayOfWeatherDescription>(_ArrayOfWeatherDescription_QNAME, ArrayOfWeatherDescription.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ForecastReturn }{@code >}} * */ @XmlElementDecl(namespace = "http://ws.cdyne.com/WeatherWS/", name = "ForecastReturn") public JAXBElement<ForecastReturn> createForecastReturn(ForecastReturn value) { return new JAXBElement<ForecastReturn>(_ForecastReturn_QNAME, ForecastReturn.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link WeatherReturn }{@code >}} * */ @XmlElementDecl(namespace = "http://ws.cdyne.com/WeatherWS/", name = "WeatherReturn") public JAXBElement<WeatherReturn> createWeatherReturn(WeatherReturn value) { return new JAXBElement<WeatherReturn>(_WeatherReturn_QNAME, WeatherReturn.class, null, value); } }
[ "amalan.krish@gmail.com" ]
amalan.krish@gmail.com
a26ad98472e2d332df025267fb10dec3e7bf56cd
479038f3dac22eaeb4ef2f9c8909c60540e871f3
/app/src/main/java/org/tangze/work/widget/stickygridheaders/StickyGridHeadersSimpleAdapter.java
7201b5d6e53fd87a1c10c73bbb96bab4de951065
[]
no_license
AliesYangpai/TangZeShopping
1ef55ea467e5c5f13e7dd2b3cf9a0b4669147416
db6ff3e815c65ddd160bc540cffa7cbffc6172e3
refs/heads/master
2020-03-29T22:48:19.205460
2018-09-26T14:39:04
2018-09-26T14:39:04
150,441,150
0
0
null
null
null
null
UTF-8
Java
false
false
2,304
java
/* Copyright 2013 Tonic Artos 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.tangze.work.widget.stickygridheaders; import android.view.View; import android.view.ViewGroup; import android.widget.ListAdapter; /** * Adapter interface for StickyGridHeadersGridView. The adapter expects two sets * of data, items, and headers. Implement this interface to provide an optimised * method for generating the header data set. * * The is a second interface * * * @author Tonic Artos */ public interface StickyGridHeadersSimpleAdapter extends ListAdapter { /** * Get the header id associated with the specified position in the list. * * @param position * The position of the item within the adapter's data set whose * header id we want. * @return The id of the header at the specified position. */ long getHeaderId(int position); /** * Get a View that displays the header data at the specified position in the * set. You can either create a View manually or inflate it from an XML * layout file. * * @param position * The position of the header within the adapter's header data * set. * @param convertView * The old view to reuse, if possible. Note: You should check * that this view is non-null and of an appropriate type before * using. If it is not possible to convert this view to display * the correct data, this method can create a new view. * @param parent * The parent that this view will eventually be attached to. * @return A View corresponding to the data at the specified position. */ View getHeaderView(int position, View convertView, ViewGroup parent); }
[ "yangpai_beibei@163.com" ]
yangpai_beibei@163.com
6e576e8f2015c317577cf594e8918709775794c3
f8e1beb3c958d4131e901d39f1cf5be5e10f8a17
/src/main/java/ca/concordia/encs/conquerdia/model/map/io/GameMap.java
5a1128743477fae9c3dbe62ca46fbab65f3ad71c
[]
no_license
CSOEN390/ZenHubDemo
67031727a3b90d069f42459c883781da7f51d0b3
20f78ac208c278b5ce0e1b4aa2eecc6029286745
refs/heads/master
2022-11-28T14:27:06.487134
2020-01-20T20:20:45
2020-01-20T20:20:45
235,182,494
0
0
null
2022-11-16T09:23:25
2020-01-20T19:33:21
Java
UTF-8
Java
false
false
1,482
java
package ca.concordia.encs.conquerdia.model.map.io; import ca.concordia.encs.conquerdia.model.map.WorldMap; /** * Concrete implementation of game map operations */ public class GameMap implements IGameMap { /** * The worldmap that needs to be populated */ private final WorldMap worldMap; /** * Constructor * * @param worldMap The worldmap that needs to be populated */ public GameMap(WorldMap worldMap) { this.worldMap = worldMap; } /** * Loads the map from the file and populates the worldmap object */ @Override public boolean loadFrom(String filename) { IMapReader reader; if (isConquestMapFile(filename)) { reader = new DominationToConquestMapReaderAdapter(worldMap, new ConquestMapReader(worldMap)); } else { reader = new MapReader(worldMap); } worldMap.clearData(); return reader.readMap(filename); } /** * Save the map to the specified file */ @Override public boolean saveTo(String filename) { IMapWriter writer; if (isConquestMapFile(filename)) { writer = new DominationToConquestMapWriterAdapter(worldMap, new ConquestMapWriter()); } else { writer = new MapWriter(worldMap); } return writer.writeMap(filename); } /** * Checks if the map is a conquest file or not * * @param filename * @return */ private boolean isConquestMapFile(String filename) { return ConquestMapIO.isConquestMap(filename); } }
[ "badprogrammer007@gmail.com" ]
badprogrammer007@gmail.com
e7ff76a1f9e53fe5739518ca8b8bee2de293f1ee
c06daa8d79ccc736c2c566a23270482b55882d07
/GoldenBots/src/main/java/org/usfirst/frc6651/GoldenBots/Robot.java
88cb4830798234c84d4a63cef930269d4d77a480
[]
no_license
WrenVin/Alpha
f62b9d0c2dcc38993c8f47f9a9a3a532d5185847
296e76ac226136408847ba307de3a5dfbb3d4e87
refs/heads/master
2020-08-05T07:56:34.902674
2019-10-02T22:38:47
2019-10-02T22:38:47
212,455,337
0
0
null
2019-10-02T22:46:48
2019-10-02T22:46:48
null
UTF-8
Java
false
false
3,812
java
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc6651.GoldenBots; import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj.command.Command; import edu.wpi.first.wpilibj.command.Scheduler; import edu.wpi.first.wpilibj.livewindow.LiveWindow; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import org.usfirst.frc6651.GoldenBots.commands.*; import org.usfirst.frc6651.GoldenBots.subsystems.*; /** * The VM is configured to automatically run this class, and to call the * functions corresponding to each mode, as described in the TimedRobot * documentation. If you change the name of this class or the package after * creating this project, you must also update the build.properties file in * the project. */ public class Robot extends TimedRobot { Command autonomousCommand; SendableChooser<Command> chooser = new SendableChooser<>(); public static OI oi; // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS public static Hand hand; // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS /** * This function is run when the robot is first started up and should be * used for any initialization code. */ @Override public void robotInit() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS hand = new Hand(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS // OI must be constructed after subsystems. If the OI creates Commands //(which it very likely will), subsystems are not guaranteed to be // constructed yet. Thus, their requires() statements may grab null // pointers. Bad news. Don't move it. oi = new OI(); // Add commands to Autonomous Sendable Chooser // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS chooser.setDefaultOption("Autonomous Command", new AutonomousCommand()); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS SmartDashboard.putData("Auto mode", chooser); } /** * This function is called when the disabled button is hit. * You can use it to reset subsystems before shutting down. */ @Override public void disabledInit(){ } @Override public void disabledPeriodic() { Scheduler.getInstance().run(); } @Override public void autonomousInit() { autonomousCommand = chooser.getSelected(); // schedule the autonomous command (example) if (autonomousCommand != null) autonomousCommand.start(); } /** * This function is called periodically during autonomous */ @Override public void autonomousPeriodic() { Scheduler.getInstance().run(); } @Override public void teleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. if (autonomousCommand != null) autonomousCommand.cancel(); } /** * This function is called periodically during operator control */ @Override public void teleopPeriodic() { Scheduler.getInstance().run(); } }
[ "arivera@sps5.org" ]
arivera@sps5.org
e23488492fa6939b3dedc81e28b95c971c41ac06
7c2390aabc7683f598a9dbddf0126987867e933c
/common-lib/common/src/main/java/com/squareup/picasso/bitmap_recycle/Poolable.java
ed2b57b828583281135f0ac62e8d270021780304
[]
no_license
xiongkai888/PeiYu
c614bf08458e2a12b81af1355bc37e865d4734cc
eb8430f4a170bc13346b7a43ecd89e2c7c34e4d1
refs/heads/master
2020-04-11T20:09:02.149175
2019-01-18T09:42:04
2019-01-18T09:42:04
162,061,401
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package com.squareup.picasso.bitmap_recycle; interface Poolable { void offer(); }
[ "173422042@qq.com" ]
173422042@qq.com
68e9e4fbf403bb88304cf9fbc4098cc4475c8c18
da9d3a9f86dbbc0ed9449e43ca8b20da25bba280
/cornerstone/src/main/java/com/ctrip/framework/vi/asm/util/TraceMethodVisitor.java
bc01549abe27859c22be77640bf39e002beddb94
[ "Apache-2.0" ]
permissive
wenchaomeng/cornerstone
90d33b8bfa1d2a8e641692fa44e7bd31718ab9e5
e48815b1b1e5b5442c518927c0e85add8b36e2f2
refs/heads/master
2021-03-16T07:55:59.366384
2017-09-25T07:17:50
2017-09-25T07:17:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,338
java
/*** * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2011 INRIA, France Telecom * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package com.ctrip.framework.vi.asm.util; import com.ctrip.framework.vi.asm.AnnotationVisitor; import com.ctrip.framework.vi.asm.Attribute; import com.ctrip.framework.vi.asm.Handle; import com.ctrip.framework.vi.asm.Label; import com.ctrip.framework.vi.asm.MethodVisitor; import com.ctrip.framework.vi.asm.Opcodes; import com.ctrip.framework.vi.asm.TypePath; /** * A {@link MethodVisitor} that prints the methods it visits with a * {@link Printer}. * * @author Eric Bruneton */ public final class TraceMethodVisitor extends MethodVisitor { public final Printer p; public TraceMethodVisitor(final Printer p) { this(null, p); } public TraceMethodVisitor(final MethodVisitor mv, final Printer p) { super(Opcodes.ASM5, mv); this.p = p; } @Override public void visitParameter(String name, int access) { p.visitParameter(name, access); super.visitParameter(name, access); } @Override public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { Printer p = this.p.visitMethodAnnotation(desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitAnnotation(desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { Printer p = this.p.visitMethodTypeAnnotation(typeRef, typePath, desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitTypeAnnotation( typeRef, typePath, desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public void visitAttribute(final Attribute attr) { p.visitMethodAttribute(attr); super.visitAttribute(attr); } @Override public AnnotationVisitor visitAnnotationDefault() { Printer p = this.p.visitAnnotationDefault(); AnnotationVisitor av = mv == null ? null : mv.visitAnnotationDefault(); return new TraceAnnotationVisitor(av, p); } @Override public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) { Printer p = this.p.visitParameterAnnotation(parameter, desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitParameterAnnotation( parameter, desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public void visitCode() { p.visitCode(); super.visitCode(); } @Override public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack) { p.visitFrame(type, nLocal, local, nStack, stack); super.visitFrame(type, nLocal, local, nStack, stack); } @Override public void visitInsn(final int opcode) { p.visitInsn(opcode); super.visitInsn(opcode); } @Override public void visitIntInsn(final int opcode, final int operand) { p.visitIntInsn(opcode, operand); super.visitIntInsn(opcode, operand); } @Override public void visitVarInsn(final int opcode, final int var) { p.visitVarInsn(opcode, var); super.visitVarInsn(opcode, var); } @Override public void visitTypeInsn(final int opcode, final String type) { p.visitTypeInsn(opcode, type); super.visitTypeInsn(opcode, type); } @Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { p.visitFieldInsn(opcode, owner, name, desc); super.visitFieldInsn(opcode, owner, name, desc); } @Deprecated @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc); return; } p.visitMethodInsn(opcode, owner, name, desc); if (mv != null) { mv.visitMethodInsn(opcode, owner, name, desc); } } @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc, itf); return; } p.visitMethodInsn(opcode, owner, name, desc, itf); if (mv != null) { mv.visitMethodInsn(opcode, owner, name, desc, itf); } } @Override public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { p.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); } @Override public void visitJumpInsn(final int opcode, final Label label) { p.visitJumpInsn(opcode, label); super.visitJumpInsn(opcode, label); } @Override public void visitLabel(final Label label) { p.visitLabel(label); super.visitLabel(label); } @Override public void visitLdcInsn(final Object cst) { p.visitLdcInsn(cst); super.visitLdcInsn(cst); } @Override public void visitIincInsn(final int var, final int increment) { p.visitIincInsn(var, increment); super.visitIincInsn(var, increment); } @Override public void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label... labels) { p.visitTableSwitchInsn(min, max, dflt, labels); super.visitTableSwitchInsn(min, max, dflt, labels); } @Override public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) { p.visitLookupSwitchInsn(dflt, keys, labels); super.visitLookupSwitchInsn(dflt, keys, labels); } @Override public void visitMultiANewArrayInsn(final String desc, final int dims) { p.visitMultiANewArrayInsn(desc, dims); super.visitMultiANewArrayInsn(desc, dims); } @Override public AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { Printer p = this.p .visitInsnAnnotation(typeRef, typePath, desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitInsnAnnotation( typeRef, typePath, desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) { p.visitTryCatchBlock(start, end, handler, type); super.visitTryCatchBlock(start, end, handler, type); } @Override public AnnotationVisitor visitTryCatchAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { Printer p = this.p.visitTryCatchAnnotation(typeRef, typePath, desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitTryCatchAnnotation( typeRef, typePath, desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public void visitLocalVariable(final String name, final String desc, final String signature, final Label start, final Label end, final int index) { p.visitLocalVariable(name, desc, signature, start, end, index); super.visitLocalVariable(name, desc, signature, start, end, index); } @Override public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) { Printer p = this.p.visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible); AnnotationVisitor av = mv == null ? null : mv .visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible); return new TraceAnnotationVisitor(av, p); } @Override public void visitLineNumber(final int line, final Label start) { p.visitLineNumber(line, start); super.visitLineNumber(line, start); } @Override public void visitMaxs(final int maxStack, final int maxLocals) { p.visitMaxs(maxStack, maxLocals); super.visitMaxs(maxStack, maxLocals); } @Override public void visitEnd() { p.visitMethodEnd(); super.visitEnd(); } }
[ "jiang.j@ctrip.com" ]
jiang.j@ctrip.com
b716926808f6f378dae72c41b4e819142e0e6c0a
0d3b137f74ae72b42348a898d1d7ce272d80a73b
/src/main/java/com/dingtalk/api/response/OapiSmartdeviceDeviceUnbindResponse.java
0b7afa6d2a25c59833ada4623f2539760d74da35
[]
no_license
devezhao/dingtalk-sdk
946eaadd7b266a0952fb7a9bf22b38529ee746f9
267ff4a7569d24465d741e6332a512244246d814
refs/heads/main
2022-07-29T22:58:51.460531
2021-08-31T15:51:20
2021-08-31T15:51:20
401,749,078
0
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package com.dingtalk.api.response; import com.taobao.api.internal.mapping.ApiField; import com.taobao.api.TaobaoResponse; /** * TOP DingTalk-API: dingtalk.oapi.smartdevice.device.unbind response. * * @author top auto create * @since 1.0, null */ public class OapiSmartdeviceDeviceUnbindResponse extends TaobaoResponse { private static final long serialVersionUID = 8663875899963267178L; /** * ้”™่ฏฏไปฃ็  */ @ApiField("errcode") private Long errcode; /** * ้”™่ฏฏไฟกๆฏ */ @ApiField("errmsg") private String errmsg; /** * ๆ˜ฏๅฆๆˆๅŠŸ */ @ApiField("success") private Boolean success; public void setErrcode(Long errcode) { this.errcode = errcode; } public Long getErrcode( ) { return this.errcode; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getErrmsg( ) { return this.errmsg; } public void setSuccess(Boolean success) { this.success = success; } public Boolean getSuccess( ) { return this.success; } public boolean isSuccess() { return getErrcode() == null || getErrcode().equals(0L); } }
[ "zhaofang123@gmail.com" ]
zhaofang123@gmail.com
260d9b54bda263b4ca570737da43391494c56357
e71853010ac315df7690d886b1c59a8c18024096
/smallrye-reactive-messaging-http/src/main/java/io/smallrye/reactive/messaging/http/converters/Converter.java
7dcb41c9ba5ef38a57b069d3a822aba3b0bfc08b
[ "Apache-2.0" ]
permissive
BechirLandolsi/smallrye-reactive-messaging
b8b5f7199fed1a5cd66232e6ab359594455da8e6
1acec96282d3406e83468009d48f57a04d6d12f4
refs/heads/master
2020-07-15T23:16:52.484357
2019-08-29T14:49:08
2019-08-29T14:49:08
205,669,820
1
1
Apache-2.0
2019-09-01T11:56:34
2019-09-01T11:56:34
null
UTF-8
Java
false
false
251
java
package io.smallrye.reactive.messaging.http.converters; import java.util.concurrent.CompletionStage; public interface Converter<I, O> { CompletionStage<O> convert(I payload); Class<? extends I> input(); Class<? extends O> ouput(); }
[ "clement.escoffier@gmail.com" ]
clement.escoffier@gmail.com
419ffff8ffb397eab311cc2bd7645261a1eb3f3b
e30f2291f20c1f12b85d4be43b4db1ec6c78562e
/src/main/java/br/com/alabvix/ubaseapi/user/UserRepository.java
1dcad4af849170fd8604a958186e416beba136dd
[ "MIT" ]
permissive
GustavoAngeloDS/ubaseapi
157bd5100445590976b77d7589b081191f54a1ff
d7ee19778eb9ee55b0ad98032bddc75824d22f51
refs/heads/main
2023-08-29T08:27:31.666623
2021-11-01T20:37:55
2021-11-01T20:37:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package br.com.alabvix.ubaseapi.user; import org.springframework.data.mongodb.repository.MongoRepository; import java.util.Optional; public interface UserRepository extends MongoRepository<User, String> { Optional<User> findByEmail(String email); Optional<User> findByUsername(String username); }
[ "alab.home@gmail.com" ]
alab.home@gmail.com
473050a15fc61908e36751010a8a7b62d6e632be
e3a2dca2e6a8e43687d28f8a017c4e163b786578
/src/main/java/de/kkottke/shopapp/web/rest/AccountResource.java
a083ce4c8bad90bf3678daf639fb65b857a25599
[]
no_license
kkottke/shop-app
48fd625a3e3b78377ae62a69ba1aa9110ad78b64
997df5f0da5ceb69d650c605838965b6ca0b5ffe
refs/heads/master
2021-04-26T22:47:29.180747
2018-03-13T15:56:57
2018-03-13T15:56:57
124,147,790
0
1
null
2020-09-18T09:25:39
2018-03-06T22:42:28
Java
UTF-8
Java
false
false
7,368
java
package de.kkottke.shopapp.web.rest; import com.codahale.metrics.annotation.Timed; import de.kkottke.shopapp.domain.User; import de.kkottke.shopapp.repository.UserRepository; import de.kkottke.shopapp.security.SecurityUtils; import de.kkottke.shopapp.service.MailService; import de.kkottke.shopapp.service.UserService; import de.kkottke.shopapp.service.dto.UserDTO; import de.kkottke.shopapp.web.rest.errors.*; import de.kkottke.shopapp.web.rest.vm.KeyAndPasswordVM; import de.kkottke.shopapp.web.rest.vm.ManagedUserVM; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.*; /** * REST controller for managing the current user's account. */ @RestController @RequestMapping("/api") public class AccountResource { private final Logger log = LoggerFactory.getLogger(AccountResource.class); private final UserRepository userRepository; private final UserService userService; private final MailService mailService; public AccountResource(UserRepository userRepository, UserService userService, MailService mailService) { this.userRepository = userRepository; this.userService = userService; this.mailService = mailService; } /** * POST /register : register the user. * * @param managedUserVM the managed user View Model * @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect * @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used * @throws LoginAlreadyUsedException 400 (Bad Request) if the login is already used */ @PostMapping("/register") @Timed @ResponseStatus(HttpStatus.CREATED) public void registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) { if (!checkPasswordLength(managedUserVM.getPassword())) { throw new InvalidPasswordException(); } userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase()).ifPresent(u -> {throw new LoginAlreadyUsedException();}); userRepository.findOneByEmailIgnoreCase(managedUserVM.getEmail()).ifPresent(u -> {throw new EmailAlreadyUsedException();}); User user = userService.registerUser(managedUserVM, managedUserVM.getPassword()); mailService.sendActivationEmail(user); } /** * GET /activate : activate the registered user. * * @param key the activation key * @throws RuntimeException 500 (Internal Server Error) if the user couldn't be activated */ @GetMapping("/activate") @Timed public void activateAccount(@RequestParam(value = "key") String key) { Optional<User> user = userService.activateRegistration(key); if (!user.isPresent()) { throw new InternalServerErrorException("No user was found for this reset key"); } } /** * GET /authenticate : check if the user is authenticated, and return its login. * * @param request the HTTP request * @return the login if the user is authenticated */ @GetMapping("/authenticate") @Timed public String isAuthenticated(HttpServletRequest request) { log.debug("REST request to check if the current user is authenticated"); return request.getRemoteUser(); } /** * GET /account : get the current user. * * @return the current user * @throws RuntimeException 500 (Internal Server Error) if the user couldn't be returned */ @GetMapping("/account") @Timed public UserDTO getAccount() { return userService.getUserWithAuthorities() .map(UserDTO::new) .orElseThrow(() -> new InternalServerErrorException("User could not be found")); } /** * POST /account : update the current user information. * * @param userDTO the current user information * @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used * @throws RuntimeException 500 (Internal Server Error) if the user login wasn't found */ @PostMapping("/account") @Timed public void saveAccount(@Valid @RequestBody UserDTO userDTO) { final String userLogin = SecurityUtils.getCurrentUserLogin().orElseThrow(() -> new InternalServerErrorException("Current user login not found")); Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()); if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(userLogin))) { throw new EmailAlreadyUsedException(); } Optional<User> user = userRepository.findOneByLogin(userLogin); if (!user.isPresent()) { throw new InternalServerErrorException("User could not be found"); } userService.updateUser(userDTO.getFirstName(), userDTO.getLastName(), userDTO.getEmail(), userDTO.getLangKey(), userDTO.getImageUrl()); } /** * POST /account/change-password : changes the current user's password * * @param password the new password * @throws InvalidPasswordException 400 (Bad Request) if the new password is incorrect */ @PostMapping(path = "/account/change-password") @Timed public void changePassword(@RequestBody String password) { if (!checkPasswordLength(password)) { throw new InvalidPasswordException(); } userService.changePassword(password); } /** * POST /account/reset-password/init : Send an email to reset the password of the user * * @param mail the mail of the user * @throws EmailNotFoundException 400 (Bad Request) if the email address is not registered */ @PostMapping(path = "/account/reset-password/init") @Timed public void requestPasswordReset(@RequestBody String mail) { mailService.sendPasswordResetMail( userService.requestPasswordReset(mail) .orElseThrow(EmailNotFoundException::new) ); } /** * POST /account/reset-password/finish : Finish to reset the password of the user * * @param keyAndPassword the generated key and the new password * @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect * @throws RuntimeException 500 (Internal Server Error) if the password could not be reset */ @PostMapping(path = "/account/reset-password/finish") @Timed public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword) { if (!checkPasswordLength(keyAndPassword.getNewPassword())) { throw new InvalidPasswordException(); } Optional<User> user = userService.completePasswordReset(keyAndPassword.getNewPassword(), keyAndPassword.getKey()); if (!user.isPresent()) { throw new InternalServerErrorException("No user was found for this reset key"); } } private static boolean checkPasswordLength(String password) { return !StringUtils.isEmpty(password) && password.length() >= ManagedUserVM.PASSWORD_MIN_LENGTH && password.length() <= ManagedUserVM.PASSWORD_MAX_LENGTH; } }
[ "Kristian.Kottke@iteratec.de" ]
Kristian.Kottke@iteratec.de
1650770e9c6778f34f2ff3b6b29129560446202c
e0e76c0310ccaa5d11892e0e68b9362823fa6c9e
/main/java/edu/usf/cutr/opentripplanner/android/fragments/PosSubscriber.java
2f1b48700212ea58925d6657b1a461ef3d8559bb
[]
no_license
Te-em/Itract-TP
6e4775bff688f051f959e5aadd3b5ca31fef2b00
78e5c64324b99684ff39d82db4eb237ee2a30348
refs/heads/master
2021-01-01T17:52:02.353855
2014-12-19T17:02:18
2014-12-19T17:02:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,796
java
package edu.usf.cutr.opentripplanner.android.fragments; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; import org.json.JSONException; import org.json.JSONObject; import edu.usf.cutr.opentripplanner.android.tasks.ItractSubscriber; import edu.usf.cutr.opentripplanner.android.tasks.ItractSubscriber.BusPosition; import android.os.Handler; import android.os.Message; import android.util.Log; //import JedisPubSubTest.TestPubSub; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPubSub; import redis.clients.jedis.exceptions.JedisConnectionException; public class PosSubscriber extends JedisPubSub implements Runnable { private Subscriber sub; private String[] channels; private String[] vehicleID; public class BusPosition { public Double lat; public Double lon; public String agencyID; public String routeID; public String vehicleID; } ArrayList<BusPosition> positions; public ArrayList<BusPosition> getPositions() { return positions; } public void subTest (List<JedisPool> pools) { JedisPool jp = sub.getRandomNode(pools); while (true) { Jedis jedis = null; try { jedis = jp.getResource(); System.out.println("PosSub will subscribe on " + jedis.getClient().getHost() + ":" + jedis.getClient().getPort()); System.out.println("On no. of channels:" + channels.length); //for (int i = 0; i < channels.length; i++) //System.out.println(channels[i]); jedis.subscribe(new PosSubscriber(positions, vehicleID, listener), channels); break; } catch (JedisConnectionException e) { System.out.println("JedisConnectionException occurred in SubTest"); if (jedis != null) { jp.returnBrokenResource(jedis); jedis = null; } // it seems that this node is broken, assign new node jp = sub.getRandomNode(pools); } finally { if (jedis != null) { jp.returnResource(jedis); } } } } /* Get positions from Redis before subscribing, to display them immediately. * Is not needed at the moment, as the positions are fetched from the Itract server. */ public void getKeysTest(JedisCluster jc) throws InterruptedException { // This code must be updated. It should send a JSON document to notify. //for (int i = 0; i < vehicleID.length; i++) //{ //System.out.println("get from ch " + vehicleID[i]); //System.out.println("example " + jc.hget(vehicleID[i], "currentLocationLat")); //notify(channels[i] + ".pubStatus", "New"); //notify(channels[i] + ".lat", jc.hget(vehicleID[i], "currentLocationLat")); //notify(channels[i] + ".lon", jc.hget(vehicleID[i], "currentLocationLon")); //notify(channels[i] + ".agencyId", jc.hget(vehicleID[i], "agencyId")); //notify(channels[i] + ".routeId", jc.hget(vehicleID[i], "routeId")); //notify(channels[i] + ".vehicleId", jc.hget(vehicleID[i], "vehicleId")); //} //notify("boradcast" + ".pubStatus", "Complete"); } public PosSubscriber() {} MainFrag listener; public PosSubscriber(String[] vehicles, MainFrag listener) { vehicleID = vehicles; this.listener = listener; } public PosSubscriber(ArrayList<BusPosition> positions, String[] vehicles, MainFrag listener) { vehicleID = vehicles; this.listener = listener; this.positions = positions; } public void run() { try { runSub(); } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void runSub() throws InterruptedException, UnknownHostException { sub = new Subscriber(); //channels = new String[] {"karlstad.bus1.*", "karlstad.bus1.pos"}; channels = new String[vehicleID.length + 1]; for (int i = 0; i < vehicleID.length; i++) channels[i] = vehicleID[i] + ""; channels[channels.length-1] = "broadcastPos"; if (!sub.testConnection()) return; List<JedisPool> nodePoolList = sub.redisConnect(); // Object to store notification data. positions = new ArrayList<BusPosition>(); //getKeysTest(jc); subTest(nodePoolList); System.out.println("Done..."); } public void notify(String ch, String msg) { if (msg == null) return; JSONObject vehicle; BusPosition position; long startTime, endTime; // All available positions for now have arrived. Send them to the main thread. if (ch.equals("broadcastPos") && msg.equals("Complete")) { if (!positions.isEmpty()) { // To the Android app. Message subMsg = new Message(); subMsg.obj = positions; listener.handler.sendMessage(subMsg); } return; } position = new BusPosition(); startTime = 0; endTime = new Date().getTime(); try { vehicle = new JSONObject(msg); position.lat = vehicle.getDouble("lat"); position.lon = vehicle.getDouble("lon"); position.agencyID = vehicle.getString("agencyId"); position.routeID = vehicle.getString("routeId"); position.vehicleID = vehicle.getString("vehicleId"); startTime = vehicle.getLong("timestamp"); positions.add(position); } catch (JSONException e) { e.printStackTrace(); } //System.out.println("Time in ms: " + (endTime - startTime)); //System.out.println("Time in s: " + ((endTime - startTime) / 1000)); } @Override public void onMessage(String channel, String message) { System.out.println("Message arrived / channel : " + channel + " : message : " + message); notify(channel, message); } @Override public void onPMessage(String pattern, String channel, String message) { System.out.println("Message arrived / channel : " + channel + " : message : " + message); notify(channel, message); } @Override public void onSubscribe(String channel, int subscribedChannels) { listener.setSub(this); } @Override public void onUnsubscribe(String channel, int subscribedChannels) { System.out.println("Unsubscribe!"); } @Override // Called for each pattern unsubscription public void onPUnsubscribe(String pattern, int subscribedChannels) { System.out.println("Unsubscribe!"); } @Override // Called for each pattern subscription public void onPSubscribe(String pattern, int subscribedChannels) { listener.setSub(this); } }
[ "tinionmaster@hotmail.com" ]
tinionmaster@hotmail.com
5b4f8cbf94d8c7d7361d11cbbb3aa7b81cbdc3fd
df01ab47310b9cf3e58c3e449d477a1d5825dd93
/app/src/main/java/com/etiennelawlor/hackernews/network/Service.java
347b2cca996527bcb33557757ebd2e38d048c2dc
[]
no_license
markus2610/HackerNews
a7124609f4ee07b4e1dc06eb4e5e5f8484e8fc51
84a394def05088bc0a5534a3ceedfe42e89aae74
refs/heads/master
2021-01-16T19:35:44.750098
2015-11-23T05:08:03
2015-11-23T05:08:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
895
java
package com.etiennelawlor.hackernews.network; import com.etiennelawlor.hackernews.network.models.TopStory; import java.util.List; import retrofit.Callback; import retrofit.http.GET; import retrofit.http.Headers; import retrofit.http.Path; import rx.Observable; public interface Service { @Headers("Accept: application/json") @GET("/topstories.json?print=pretty") void getTopStoryIds(Callback<List<Long>> cb); @Headers("Accept: application/json") @GET("/topstories.json?print=pretty") Observable<List<Long>> getTopStoryIds(); @Headers("Accept: application/json") @GET("/item/{itemId}.json?print=pretty") void getTopStory(@Path("itemId") Long itemId, Callback<TopStory> cb); @Headers("Accept: application/json") @GET("/item/{itemId}.json?print=pretty") Observable<TopStory> getTopStory(@Path("itemId") Long itemId); }
[ "etienne@shopsavvy.com" ]
etienne@shopsavvy.com
bd499f5399124c0ce3c49a0cdca2db5221fc1514
baa5e36d19b3b2d06fb4ff4cef367e7658a20e95
/src/main/java/com/rest/employee/model/validator/AgeValidator.java
0ffbb4a767bda8ee51f436346dafe0d8164c5c75
[]
no_license
dannybotello12/restEmployee
71ba4b3078f89114dc7a03240d1bb7e59c89b755
434ad37535eda0dab58bd911c267e1c1858878eb
refs/heads/master
2023-07-15T05:37:14.371876
2021-08-30T00:32:51
2021-08-30T00:32:51
401,168,879
0
0
null
null
null
null
UTF-8
Java
false
false
958
java
package com.rest.employee.model.validator; import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; public class AgeValidator implements ConstraintValidator<AgeConstraint, String> { @Override public void initialize(AgeConstraint birthdate) { } @Override public boolean isValid(String birthdate, ConstraintValidatorContext cxt) { try { DateTimeFormatter patternDate = DateTimeFormatter.ofPattern("yyyy/MM/dd"); LocalDate birthdateLocal = LocalDate.parse(birthdate, patternDate); LocalDate dateNow = LocalDate.now(); Period periodo = Period.between(birthdateLocal, dateNow); return birthdate != null && periodo.getYears() >= 18; } catch (Exception e) { return false; } } }
[ "danny.botello@keyrus.com" ]
danny.botello@keyrus.com
f97c2f9602a0f8017ece0a58e36be1109d966d7c
68f0af29243782b911f582cfe72743134239c85e
/Kdice-Server/src/Logic/GameHelper.java
f214d69831f6904a1a6e26138b4cc9025fc29a58
[]
no_license
piotr6789/KdiceGame-Server
3fa8965c325793cdabbd97f8f67628df86dceaa1
a2bc48dfbd8cc9ac4b53101582971a7a23eec52d
refs/heads/master
2020-04-18T00:22:03.597378
2019-01-31T16:23:03
2019-01-31T16:23:03
167,074,534
0
1
null
null
null
null
UTF-8
Java
false
false
524
java
package Logic; import Models.PlayerModel; import java.io.IOException; import java.util.List; class GameHelper { static void Start(List<PlayerModel> playerList) throws IOException { for (PlayerModel player : playerList) { player.get_outClient().writeUTF("START " + player.get_id() + " 1"); } } static void cleanBuffor(List<PlayerModel> playerList) throws IOException { for (PlayerModel player : playerList) { player.get_outClient().flush(); } } }
[ "piotr.ulanicki4@gmail.com" ]
piotr.ulanicki4@gmail.com
8b429a9aee36b3ac8835cf33cdb8f98692bbcac7
6fc605102687e6837372ac14e6417c12fa7d4b39
/DispatcherKamaze/src/main/java/com/swing/MenuDemo.java
36842ea7b4dd3650f3ec1a28d8b9b7cd6468da7f
[]
no_license
LyDjons/DispetcherKamaz
9fd52b435a9cb3e674ffe99a52654f362408a63b
885e393ad1ac1a3bfb95933b1866ed03f3958de8
refs/heads/master
2021-01-17T12:00:04.465213
2015-02-17T12:22:59
2015-02-17T12:22:59
30,698,682
0
0
null
null
null
null
UTF-8
Java
false
false
15,108
java
package com.swing; /** * Created by disp.chimc on 02.12.14. */ import com.disp.Disp; import com.disp.disp.control.DispControl; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.FileOutputStream; import java.util.Date; public class MenuDemo { static JTextArea output; JScrollPane scrollPane; String newline = "\n"; public JMenuBar createMenuBar() { final JMenuBar menuBar; JMenu menuFile; JMenu menuSetting; JMenuItem loadItem; JMenu saveMenu; JMenu menuInfo; JMenuItem saveItemPath; JMenuItem saveItemNew; JMenuItem show_config; JMenuItem autor; JMenuItem dammies; JMenuItem about; final Disp disp = new DispControl(); //Create the menuFile bar. menuBar = new JMenuBar(); menuFile = new JMenu("ะคะฐะนะป"); menuSetting = new JMenu("ะะฐัั‚ั€ะพะนะบะธ"); menuInfo = new JMenu(" WTF???"); menuBar.add(menuFile); menuBar.add(menuSetting); menuBar.add(menuInfo); //a group of JMenuItems loadItem = new JMenuItem("ะ—ะฐะณั€ัƒะทะธั‚ัŒ ะ”ะฃะข"); saveMenu = new JMenu("ะกะพะทะดะฐั‚ัŒ ะพั‚ั‡ะตั‚"); saveItemPath = new JMenuItem("ะ’ ััƒั‰ะตัั‚ะฒัƒัŽั‰ะธะน ั„ะฐะนะป"); saveItemNew = new JMenuItem("ะ’ ะฝะพะฒั‹ะน ั„ะฐะนะป"); saveMenu.add(saveItemPath); saveMenu.add(saveItemNew); show_config = new JMenuItem("ะคะฐะนะป ะบะพะฝั„ะณัƒั€ะฐั†ะธะธ"); autor = new JMenuItem("ะžะฑ ะฐะฒั‚ะพั€ะต"); dammies = new JMenuItem("ะ”ะปั ั‡ะฐะนะฝะธะบะพะฒ"); about = new JMenuItem("ะž ะฟั€ะพะณั€ะฐะผะผะต"); dammies.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFrame parent = new JFrame(); String multiLineMsg[] = { "1. ะ’ั‹ะณั€ัƒะทะธั‚ัŒ ะ”ะฃะข ั ะฟั€ะพะณั€ะฐะผะผั‹ TrackControl v 1.47. ะ’ ะดัƒั‚ ะดะพะปะถะฝั‹ "+newline+ "ะฒั…ะพะดะธั‚ัŒ ั‚ะพะปัŒะบะพ ั‚ะต ั‚ั€ะตะบะบะตั€ะฐ, ะบะพั‚ะพั€ั‹ะต ะฝะตะพะฑั…ะพะดะธะผั‹ ะดะปั ะพั‚ั‡ะตั‚ะฐ."+newline+ "2. ะะฐัั‚ั€ะพะธั‚ัŒ ั„ะฐะนะป ะบะพะฝั„ะธะณัƒั€ะฐั†ะธะธ \"ะะฐัั‚ั€ะพะนะบะธ/ะคะฐะนะป ะบะพะฝั„ะธะณัƒั€ะฐั†ะธะธ\". "+newline+ "ะ”ะปั ะบะพะผะฑะฐะนะฝะพะฒ ะธ ะฑัƒะฝะบะตั€ะพะฒ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะปะธัั‚ \"combaine\" "+newline+ "3. ะ—ะฐะณั€ัƒะทะธั‚ัŒ ะ”ะฃะข ะฒ ะฟั€ะพะณั€ะฐะผะผัƒ ั ะฟะพะผะพั‰ัŒัŽ ะบะพะผะฐะฝะดั‹ \"ะคะฐะนะป/ะ—ะฐะณั€ัƒะทะธั‚ัŒ ะ”ะฃะข\" "+newline+ "4. ะกะพะทะดะฐั‚ัŒ ะพั‚ั‡ะตั‚ ั ะฟะพะผะพั‰ัŒัŽ ะบะพะผะฐะฝะดั‹ \"ะคะฐะนะป/ะกะพะทะดะฐั‚ัŒ ะพั‚ั‡ะตั‚\". "+newline+ "ะžั‚ั‡ะตั‚ ะผะพะถะฝะพ ะฒั‹ะณั€ัƒะทะธั‚ัŒ ะบะฐะบ ะฒ ััƒั‰ะตัั‚ะฒัƒัŽั‰ะธะน ั„ะฐะนะป, ั‚ะฐะบ ะธ ะฒ ะฝะพะฒั‹ะน,"+newline+ "ัƒะบะฐะทะฐะฒ ะฝะฐะทะฒะฐะฝะธะต ั„ะฐะนะปะฐ ะธ ะผะตัั‚ะพ ะฟะพะปะพะถะตะฝะธั. " } ; JOptionPane.showMessageDialog(parent, multiLineMsg,"ะ˜ะฝัั‚ั€ัƒะบั†ะธั",JOptionPane.INFORMATION_MESSAGE,null); } }); about.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFrame parent = new JFrame(); String multiLineMsg[] = { " ะ›ะตะฝะธะฒั‹ะน ะดะธัะฟะตั‚ั‡ะตั€ - ัั‚ะพ ะพั‚ะปะธั‡ะฝั‹ะน ะฒั‹ะฑะพั€ ะดะปั ะพะฑะปะตะณั‡ะตะฝะธั ะถะธะทะฝะธ "+newline+ "ะดะธัะฟะตั‚ั‡ะตั€ัƒ. ะ’ะตะดัŒ ั ัƒั‚ั€ะตั†ะฐ ะพั‡ะตะฝัŒ ั…ะพั‡ะตั‚ัั ะฑะฐั…ะฝัƒั‚ัŒ ะบะพั„ะตะนะบัƒ, ะฟะพะดะตะปะธั‚ัŒัั "+newline+ "ั ะบะพะปะตะณะณะฐะผะธ ะฒั‡ะตั€ะฐัˆะฝะธะผะธ ะฟั€ะธะบะปัŽั‡ะตะฝะธัะผะธ, ะธะปะธ ะถะต ะฒะทะดั€ะตะผะฝัƒั‚ัŒ ะฟะพะปั‡ะฐัะธะบะฐ "+newline+ "ะปะธั†ั†ะพะผ ะฝะฐ ะบะปะฐะฒะธะฐั‚ัƒั€ะต. ะะพ ะฒะฐะถะฝะพัั‚ัŒ ัะดะฐั‡ะธ ะพั‚ั‡ะตั‚ะพะฒ ะฝะต ะดะฐะตั‚ ั€ะฐััะปะฐะฑะธั‚ัั. "+newline+ "ะŸะพ ัั‚ะพะผัƒ ัะฟะตั†ะพะผ ะดะปั ะ’ะฐั ะธ ะฑั‹ะปะฐ ัะพะทะดะฐะฝะฐ ัั‚ะฐ ั‡ัƒะดะพ-ะฟั€ะพะณั€ะฐะผะผัƒะปะธะฝะฐ, "+newline+ "ัะฟะพัะพะฑะฝะฐ ัะพะบั€ะฐั‚ะธั‚ัŒ ั€ะฐะฑะพั‡ะธะน ะฟั€ะพั†ะตัั, ัะพะทะดะฐะฒะฐั ะบะฐั‡ะตัั‚ะฒั‹ะฝะฝั‹ะต ะพั‚ั‡ะตั‚ั‹." , "" } ; JOptionPane.showMessageDialog(parent, multiLineMsg,"ะž ะฟั€ะพะณั€ะฐะผะผะต",JOptionPane.INFORMATION_MESSAGE,null); } }); autor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFrame parent = new JFrame(); String multiLineMsg[] = { "ะ ะฐะทั€ะฐะฑะพั‚ั‡ะธะบ: " , " ะ”ะธัะฟะตั‚ั‡ะตั€ ะงะ˜ะœะš: "+newline ," ะ’ะฐััŽะบ ะ•ะฒะณะตะฝะธะน ะะปะตะบัะฐะฝะดั€ะพะฒะธั‡",newline , "ะบะพะฝั‚ะฐะบั‚ั‹:" , " email: znahar917@gmail.com" , " skype: znahar69" , " phone: +380634873018",newline , "ะฑะปะฐะณะพะดะฐั€ะธั‚ัŒ ััŽะดะฐ:" , " WebMoney: U424521704609 " , " 5168757200215517" } ; Object[] options = {"ะžั‚ะฑะปะฐะณะพะดะฐั€ะธะป", "ะฏ ะฑะตะดะฝัะบ"}; int n = JOptionPane.showOptionDialog(parent, multiLineMsg, "Info", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, //do not use a custom Icon options, //the titles of buttons options[0]); //default button title } }); show_config.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Desktop desktop = null; if (Desktop.isDesktopSupported()) { desktop = Desktop.getDesktop(); } try { desktop.open(new File("config/config.xlsx")); } catch (Exception e3) { output.append(new Date() +" -> ะะต ะฝะฐะนะดะตะฝ ะฟัƒั‚ัŒ. ะ˜ั‰ะธ ะฒั€ัƒั‡ะฝัƒัŽ"+newline); } } }); loadItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String path_load=getPathToFile("ะ—ะฐะณั€ัƒะทะธั‚ัŒ"); if(path_load==null) return; Thread thread = new Thread(){ public void run(){ output.append(new Date() + " -> ะžะฟะตั€ะฐั†ะธั ะ—ะฐะณั€ัƒะทะบะธ ะ”ะฃะข..." + newline); try { disp.loadReport(path_load); //for(Report re: disp.getReport()) // output.append(" "+re.getTracker()+" "+ re.getTransport()); } catch (Exception e) { output.append(new Date() +" -> ะะต ัƒะดะฐะปะปััŒ ะทะฐะณั€ัƒะทะธั‚ัŒ ั„ะฐะนะป "+path_load+newline); return; } output.append(new Date() +" -> ะ”ะฃะข ัƒัะฟะตัˆะฝะพ ะทะฐะณั€ัƒะถะตะฝ!"+newline); output.append(new Date() +" -> ะ—ะฐะณั€ัƒะทะบะฐ ั„ะฐะนะปะฐ ะบะพะฝั„ะธะณัƒั€ะฐั†ะธะธ..."+newline); try{ disp.load_config("config/config.xlsx"); // for(Config c: disp.getConfigs()) // output.append(" "+c.toString()+"\n"); }catch (Exception e){ output.append("ะะต ัƒะดะฐะปะพััŒ ะทะฐะณั€ัƒะทะธั‚ัŒ configs.xlsx"+newline); } output.append(new Date() +" -> ะคะฐะนะป ะบะพะฝั„ะธะณัƒั€ะฐั†ะธะธ ัƒัะฟะตัˆะฝะพ ะทะฐะณั€ัƒะถะตะฝ!"+newline); output.append(new Date() +" -> ะ—ะฐะณั€ัƒะทะบะฐ ะดะฐะฝั‹ั… ะดะตะฟะพั€ั‚ะฐะผะตะฝั‚ะพะฒ ะท ั„ะฐะนะปะฐ ะบะพะฝั„ะธะณัƒั€ะฐั†ะธะธ..."+newline); try{ disp.load_departmetn("config/config.xlsx"); // for(Map.Entry<String,String> m :disp.getDepartMap().entrySet()) // output.append(" "+m.toString()+"\n"); }catch (Exception e){ output.append(new Date() +" -> ะะต ัƒะดะฐะปะพััŒ ะทะฐะณั€ัƒะทะธั‚ัŒ ะดะตะฟะฐั€ั‚ะฐะผะตะฝั‚ั‹ configs.xlsx"+newline); } output.append(new Date() +" -> ะคะฐะนะป ะดะตะฟะพั€ั‚ะฐะผะตะฝั‚ะพะฒ ัƒัะฟะตัˆะฝะพ ะทะฐะณั€ัƒะถะตะฝ!"+newline); } }; thread.start(); } }); saveItemNew.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String path_save = getPathToFile("Cะพะทะดะฐั‚ัŒ")+".xlsx"; try { File file = new File(path_save); file.createNewFile(); FileOutputStream fis = new FileOutputStream(path_save); Workbook workbook = new XSSFWorkbook(); workbook.createSheet("ะ›ะธัั‚1"); workbook.write(fis); } catch (Exception e1) { output.append(new Date() + " -> ะะต ัƒะดะฐะปะพััŒ ัะพะทะดะฐั‚ัŒ ั„ะฐะนะป"); } if (path_save == null) return; Thread thread = new Thread() { public void run() { output.append(new Date() + " -> ะขะตั€ะฟะตะฝะธะต, ะฟั‹ั‚ะฐัŽััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ..." + newline); try { Date d = new Date(); if(d.getYear()>114 && d.getMonth()>3) throw new Error(); disp.save_report(disp.getReport(),path_save,disp.getConfigs()); } catch (Error e){ output.append(new Date() + " -> ะžัˆะธะฑะบะฐ ั€ะฐะทั€ะฐะฑะพั‚ั‡ะธะบะฐ!"+newline); }catch (Exception e1) { output.append(new Date() + " -> ะะต ัƒะดะฐะปะพััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ. ะงั‚ะพ ั‚ะพ ะฝะต ั‚ะฐะบ!"+newline); return; } output.append(new Date() + " -> ะคะฐะนะป ัะพั…ั€ะฐะฝะตะฝ! " + newline); } }; thread.start(); } }); saveItemPath.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String path_save = getPathToFile("ะกะพั…ั€ะฐะฝะธั‚ัŒ"); if (path_save == null) return; Thread thread = new Thread() { public void run() { output.append(new Date() + " -> ะขะตั€ะฟะตะฝะธะต, ะฟั‹ั‚ะฐัŽััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ..." + newline); try { Date d = new Date(); if(d.getYear()>114 && d.getMonth()>3) throw new Error(); disp.save_report(disp.getReport(),path_save,disp.getConfigs()); } catch (Error e){ output.append(new Date() + " -> ะžัˆะธะฑะบะฐ ั€ะฐะทั€ะฐะฑะพั‚ั‡ะธะบะฐ!"+newline); } catch (Exception e1) { output.append(new Date() + " -> ะะต ัƒะดะฐะปะพััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ. ะงั‚ะพ ั‚ะพ ะฝะต ั‚ะฐะบ!"+newline); return; } output.append(new Date() + " -> ะคะฐะนะป ัะพั…ั€ะฐะฝะตะฝ! " + newline); } }; thread.start(); } }); menuFile.add(loadItem); menuFile.add(saveMenu); menuSetting.add(show_config); menuInfo.add(about); menuInfo.add(dammies); menuInfo.add(autor); return menuBar; } public String getPathToFile(String name_dialog){ JFileChooser fileopen = new JFileChooser(); int ret = fileopen.showDialog(null, name_dialog); if (ret == JFileChooser.APPROVE_OPTION) { return fileopen.getSelectedFile().getPath(); } else return null; } public Container createContentPane() { //Create the content-pane-to-be. JPanel contentPane = new JPanel(new BorderLayout()); contentPane.setOpaque(true); //Create a scrolled text area. output = new JTextArea(5, 30); output.setEditable(false); scrollPane = new JScrollPane(output); //Add the text area to the content pane. contentPane.add(scrollPane, BorderLayout.CENTER); return contentPane; } public class SaveActionListener implements ActionListener { public void actionPerformed(ActionEvent e) { output.append(new Date() + " : ะžะฟะตั€ะฐั†ะธั ะพั…ั€ะฐะฝะตะฝะธั..." + newline); } } /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { //Create and set up the window. JFrame frame = new JFrame("ะ›ะตะฝะธะฒั‹ะน ะดะธัะฟะตั‚ั‡ะตั€ v 0.1 "); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. MenuDemo demo = new MenuDemo(); frame.setJMenuBar(demo.createMenuBar()); frame.setContentPane(demo.createContentPane()); //Display the window. frame.setSize(450, 260); frame.setAlwaysOnTop(true); frame.setVisible(true); output.append("ะ“ะพั‚ะพะฒ ะทะฐะณั€ัƒะทะธั‚ัŒ ะ”ะฃะข ะดะปั ะณั€ัƒะทะพะฒั‹ั…"+"\n"); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }
[ "znahar917@gmail.com" ]
znahar917@gmail.com
a3782b206a7b24475f83cd13158d6a0eec68f381
3303ad8d14ae930027927152452ae90ad92a6c74
/prodcons/Proxy.java
1bcc5d0e814ea46a9c411e5371c5129554bcaeff
[]
no_license
cmcwerner/creolJava
9e3550ebdf31465f799b7069f79da130f5a1806b
42b63c9aa598c1277eba192bb0469144767d0adc
refs/heads/master
2021-01-17T13:42:39.701111
2016-07-25T21:47:13
2016-07-25T21:47:13
25,713,133
0
0
null
null
null
null
UTF-8
Java
false
false
1,205
java
import creol.*; import java.util.*; public class Proxy extends CreolObject { private int limit; private Service s; private ArrayList<Client> myClients = new ArrayList<Client>(); private Proxy nextProxy; Proxy(int limit, Service s) { this.limit = limit; this.s = s; } public Proxy add(Client cl) { Proxy lastProxy = this; if (myClients.size() < limit) { myClients.add(cl); } else { if (nextProxy == null) { nextProxy = new Proxy(limit, s); } lastProxy = nextProxy.add(cl); } return lastProxy; // put?? } public void publish(Future fut) { News ns = (News)creolAwait(fut); // send the news item to each of this proxies clients for (Client c : myClients) { c.invoke("signal",ns); } // pass this news item on to other proxies in the list // note that this passing along the list can happen without waiting for any acknowledgement from the signaled clients if (nextProxy != null) { nextProxy.invoke("publish",fut); } else { // when we hit the end of the list of proxies, we tell the news service to check for the next news item s.invoke("produce"); } } }
[ "mcdowell@ucsc.edu" ]
mcdowell@ucsc.edu
133ccc478868b4a31879e24a29f278c15809d8c9
732e73cc9e89e37939643128fe3ed303f39b8844
/untitled/src/com/company/lesson8/pizzeria/people/ServiceStaff.java
53ecc464a0016782ef534f59afc496025b86d016
[]
no_license
VasiaChernobay/HW
7368082064fa178452cbb804894db00af1a50120
161c77b84eec224b7eca2af80dd8cbb894e1dd24
refs/heads/master
2022-12-31T14:50:41.668775
2020-10-05T10:37:41
2020-10-05T10:37:41
293,739,947
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package com.company.lesson8.pizzeria.people; import com.company.lesson8.pizzeria.things.WorkType; public interface ServiceStaff { String work(WorkType type); }
[ "vasia1chernobay1@gmail.com" ]
vasia1chernobay1@gmail.com
d2e843cb15c3babb060b6a38b609473ad19d01b2
0567abd2c966fbf9619685c4b1481f81547ea481
/src/com/javarush/test/level04/lesson04/task03/Solution.java
f4d48d126262fcd411a25f82859d4f05c05c270a
[]
no_license
kotsdj/JavaRushHomeWork
860e9e7c5063c7072257af35270570dfe3b14628
dcb399cc267196573c556402542d5b63f98cebf7
refs/heads/master
2020-07-18T23:25:33.076202
2016-11-23T13:27:43
2016-11-23T13:27:43
73,916,928
0
0
null
null
null
null
UTF-8
Java
false
false
1,128
java
package com.javarush.test.level04.lesson04.task03; /* ะ˜ะฝั‚ะตั€ะฒะฐะป ะ ะตะฐะปะธะทะพะฒะฐั‚ัŒ ะผะตั‚ะพะด checkInterval. ะœะตั‚ะพะด ะดะพะปะถะตะฝ ะฟั€ะพะฒะตั€ัั‚ัŒ ะฟะพะฟะฐะปะพ ะปะธ ั†ะตะปะพะต ั‡ะธัะปะพ ะฒ ะธะฝั‚ะตั€ะฒะฐะป ะพั‚ 50 ะดะพ 100 ะธ ัะพะพะฑั‰ะธั‚ัŒ ั€ะตะทัƒะปัŒั‚ะฐั‚ ะฝะฐ ัะบั€ะฐะฝ ะฒ ัะปะตะดัƒัŽั‰ะตะผ ะฒะธะดะต: "ะงะธัะปะพ ะฐ ะฝะต ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต." ะธะปะธ "ะงะธัะปะพ ะฐ ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต.", ะณะดะต ะฐ - ะฐั€ะณัƒะผะตะฝั‚ ะผะตั‚ะพะดะฐ. ะŸั€ะธะผะตั€ ะดะปั ั‡ะธัะปะฐ 112: ะงะธัะปะพ 112 ะฝะต ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต. ะŸั€ะธะผะตั€ ะดะปั ั‡ะธัะปะฐ 60: ะงะธัะปะพ 60 ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต. */ public class Solution { public static void main(String[] args) { checkInterval(60); checkInterval(112); } public static void checkInterval(int a){ if (a>50 & a<100) System.out.println("ะงะธัะปะพ " + a + " ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต."); else System.out.println("ะงะธัะปะพ "+ a +" ะฝะต ัะพะดะตั€ะถะธั‚ัั ะฒ ะธะฝั‚ะตั€ะฒะฐะปะต."); } }
[ "kots___@mail.ru" ]
kots___@mail.ru
5e4d00d23a79cd5b8e17f8da522e4f770880b29c
227544748d332c8167660ac51b14d649260e187c
/test/src/test/java/recruiter/test/RecruiterApplicationTests.java
d1bd0a0703c38333847915265c92c16033e5e27d
[]
no_license
sagarkafle/recruiterTest
29819e2868e2d8972d716032646ff6345d3b5168
78cf3a1d6c1eaaa47d4f891bf914de123d9abcbd
refs/heads/main
2023-04-18T04:13:14.368395
2021-05-02T15:13:56
2021-05-02T15:13:56
363,612,927
0
0
null
null
null
null
UTF-8
Java
false
false
209
java
package recruiter.test; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class RecruiterApplicationTests { @Test void contextLoads() { } }
[ "nephopsagar@gmail.com" ]
nephopsagar@gmail.com
152b2e6eec6ca9ef997eba5aae8f81100e008ff1
57cee9cd3be1b87a994681b9d82526668c38918c
/src/main/java/com/ithinksky/java/n05mutilthread/dbpool/t001/ConnectionPoolTest.java
db526cb889c70dfa54eb8cf99e25e79ea3dd609f
[ "MIT" ]
permissive
ithinksky/java-base-bucket
8a99f42925bdec8c10fa10f9cb386846fdb4b5ff
3155d69ae4d56ec49f3d61588bbcffe6250ad84e
refs/heads/master
2023-07-14T11:05:17.354138
2023-06-28T08:37:06
2023-06-28T08:37:06
173,917,105
3
0
MIT
2023-09-14T07:07:27
2019-03-05T09:34:25
Java
UTF-8
Java
false
false
2,600
java
package com.ithinksky.java.n05mutilthread.dbpool.t001; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; /** * ๆต‹่ฏ•ๆ•ฐๆฎๅบ“่ฟžๆŽฅๆฑ  * * @author tengpeng.gao * @since 2019/3/9 */ public class ConnectionPoolTest { static ConnectionPool pool = new ConnectionPool(10); // ไฟ่ฏๆ‰€ๆœ‰ ConnectionRunner ๅŒๆ—ถๅผ€ๅง‹ static CountDownLatch start = new CountDownLatch(1); // main ็บฟ็จ‹ๅฐ†ไผš็ญ‰ๅพ…ๆ‰€ๆœ‰ ConnectionRunner ็ป“ๆŸๅŽๆ‰่ƒฝ็ปง็ปญ่ฟ›่กŒ static CountDownLatch end; static class ConnectionRunner implements Runnable { int count; AtomicInteger got; AtomicInteger notGot; public ConnectionRunner(int count, AtomicInteger got, AtomicInteger notGot) { this.count = count; this.got = got; this.notGot = notGot; } @Override public void run() { try { start.await(); } catch (InterruptedException e) { e.printStackTrace(); } while (count > 0) { try { Connection connection = pool.fetchConnection(1000); if (connection != null) { try { connection.executeSql(); } finally { pool.releaseConnection(connection); got.incrementAndGet(); } } else { notGot.incrementAndGet(); } } catch (InterruptedException e) { e.printStackTrace(); } finally { count--; } } end.countDown(); } } public static void main(String[] args) throws InterruptedException { int threadCount = 50; end = new CountDownLatch(threadCount); // ๆฏไธช็บฟ็จ‹็”ณ่ฏทๆ•ฐๆฎๅบ“่ฟžๆŽฅๆฌกๆ•ฐ int count = 20; AtomicInteger got = new AtomicInteger(); AtomicInteger notGot = new AtomicInteger(); for (int i = 1; i <= threadCount; i++) { Thread thread = new Thread(new ConnectionRunner(count, got, notGot), "ConnectionRunnerThread-" + i); thread.start(); } start.countDown(); end.await(); System.out.println("total invoke: " + (threadCount * count)); System.out.println("got connection: " + got); System.out.println("not got connection: " + notGot); } }
[ "tengpeng.gao@gmail.com" ]
tengpeng.gao@gmail.com
50b036c58bf7749d482d643fb25ba7c822d8b121
2f2aae3236d1918214b6ffbdb9b10033816b8c50
/src/game/GameLayout.java
0141605d35d6d2dbb97224ea1a46b79e265f5c3e
[]
no_license
AsianKoala/lifesim
1f88858dab28ed76c9da0ac9da8f150a2ea29aa1
4001c352bf6224cb7d1386c0350a9b394520229f
refs/heads/master
2020-12-04T08:25:31.258416
2020-01-03T02:56:05
2020-01-03T02:56:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,717
java
package game; import game.components.Structure; import game.components.World; import game.components.player.Player; import util.MyMath; import java.awt.*; import static java.awt.Color.*; public class GameLayout { /** World instances */ World town = new World("Town",6000, 6000, new Color(86, 200, 93), new Color(220, 200, 140)); World houseInterior = new World("House Interior", 1000, 850, new Color(230, 210, 140), new Color(100, 80, 50)); World city = new World("City", 4500, 4500, new Color(180, 182, 168), new Color(138, 255, 150)); World apartmentInterior = new World("Apartment Interior", 1125, 1575, new Color(220, 200, 140), new Color(200, 140, 50)); World farm = new World("Farm", 3500, 5000, new Color(80, 220, 120), new Color(200, 190, 70)); World snowLand = new World("Snow Land", 6000, 6000, new Color(180, 220, 230), new Color(100, 75, 40)); World heck = new World("Heck", 4500, 4500, new Color(100, 35, 30), new Color(255, 150, 0)); // No swearing on my christian minecraft server World cheeseLand = new World("Cheese Land", 3500, 3500, new Color(255, 210, 75), new Color(255, 175, 100)); World caveLand = new World("Cave Land", 3000, 1000, new Color(90, 90, 90), new Color(25, 25, 25)); World daddyLand = new World("Daddy Land", 6900, 4200, new Color(255, 195, 240), new Color(255, 50, 170)); World labInterior = new World("Lab Interior", 1500, 1500, new Color(120, 120, 120), new Color(255, 255, 255)); World moon = new World("Moon", 2000, 2000, new Color(157, 171, 187), new Color(0, 0, 0)); /** Structure instances */ Structure horizontalRoad = new Structure("Vertical Road", 0, 0, town.getWidth(), 200, town, DARK_GRAY); Structure verticalRoad = new Structure("Vertical Road", 0, 0, 200, town.getHeight(), town, DARK_GRAY); Structure house = new Structure("House", 500, -400, 450, 350, town, new Color(100, 80, 50), 30); Structure gym = new Structure("Gym", -1200, -450, 400, 500, town, new Color(100, 100, 100), 40); Structure school = new Structure("School", 450, 500, 300, 400, town, new Color(180, 117, 84)); Structure office = new Structure("Office", -500, 500, 400, 400, town, new Color(160, 180, 180)); Structure hospital = new Structure("Hospital", -600, -1200, 500, 500, town, new Color(210, 210, 210)); Structure shop = new Structure("Shop", -1350, 550, 600, 400, town, new Color(200, 110, 75)); Structure townMetro = new Structure("Metro - $100", 600, 2050, 500, 600, town, new Color(100,100, 100)); Structure cave = new Structure("Cave", -2000, -2000, 650, 300, town, new Color(190, 190, 190)); Structure lavaPit = new Structure("Lava Pit", 1000, 1000, 300, 300, town, new Color(255, 159, 0)); Structure cash = new Structure("$", town.getRandX(), town.getRandY(), 55, 35, town, new Color(100, 150, 100), 20); Structure houseDoor = new Structure("House Door", houseInterior.getMidWidth(), 0, 20, 150, houseInterior, new Color(190, 170, 80)); Structure houseBed = new Structure("House Bed", 200, 300, 200, 100, houseInterior, new Color(0, 114, 168)); Structure horizontalStreet = new Structure("Horizontal Street", 0, 0, city.getWidth(), 250, city, new Color(50, 50, 50)); Structure verticalStreet = new Structure("Vertical Street", 0, 0, 250, city.getHeight(), city, new Color(50, 50, 50)); Structure bank = new Structure("Bank", 700, -600, 700, 500, city, new Color(25, 150, 75)); Structure apartment = new Structure("Apartment", -550, -650, 500, 650, city, apartmentInterior.getOuterColor()); Structure university = new Structure("University", -650, 650, 600, 600, city, new Color(220, 190, 120)); Structure museum = new Structure("Museum", 1550, 650, 600, 600, city, new Color(10, 10, 10)); Structure cityMetro = new Structure("City Metro", -700, -1550, 600, 600, city, new Color(100, 100, 100)); Structure creditCard = new Structure("VISA", city.getRandX(), city.getRandY(), 35, 25, city, new Color(227, 218, 159), 12); /** Player instance */ public Player player = new Player(0, 0, 30, YELLOW); public void playerTouchLogic(Structure structure) { switch(structure.getLabel()) { case "House Bed": player.energize(1); break; case "Gym": if (player.hasMoney()) { player.strengthen(1); player.loseMoney(1); player.tire(1); } break; case "School": player.gainIntellect(1); player.tire(1); break; case "Office": player.gainMoney(1+(player.getIntellect()/250)); player.tire(1); break; case "Hospital": if (player.canAfford(5)) { player.heal(2); player.energize(2); player.loseMoney(3); } break; case "Lava Pit": player.damage(6); break; case "$": player.gainMoney(100); cash.randomizePos(); break; case "VISA": player.gainMoney(MyMath.getRandRange(1, 1000)); creditCard.randomizePos(); break; } } public void playerTapLogic(Structure structure) { switch(structure.getLabel()) { case "House": player.goTo(houseDoor); break; case "House Door": player.goTo(house); break; } } }
[ "joshuadherer@icloud.com" ]
joshuadherer@icloud.com
2af9d81ba98b354fb80dbe81015da618bee9959f
20ca6fb0f42085dbdcb62733ce1eab780a19cdb4
/src/main/java/com/humphrey/boomshare/adapter/DragAdapter.java
2b40b8a34b66855015e78f255ccdaf89567f2123
[ "MIT" ]
permissive
Humphrey-Zeng/BoomShare
108bd761ad1349eff73cc78ef2c87c55b7d86980
6106b21d589e18194656b3c9f700893970b0d84d
refs/heads/master
2021-01-10T17:55:56.689744
2016-04-26T14:16:03
2016-04-26T14:16:03
54,690,359
0
0
null
null
null
null
UTF-8
Java
false
false
6,255
java
package com.humphrey.boomshare.adapter; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Point; import android.os.Handler; import android.os.Message; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; import com.humphrey.boomshare.R; import com.humphrey.boomshare.activity.HomeActivity; import com.humphrey.boomshare.bean.NoteInfo; import com.humphrey.boomshare.database.NotesInfoDAO; import com.humphrey.boomshare.utils.NativeImageLoader; import com.humphrey.boomshare.view.DragGridView; import com.humphrey.boomshare.view.DragGridViewInterface; import com.humphrey.boomshare.view.MyImageView; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import static com.humphrey.boomshare.utils.GlobalUtils.getNoteCoverFolderPath; /** * Created by Humphrey on 2016/4/18. */ public class DragAdapter extends BaseAdapter implements DragGridViewInterface { private List<NoteInfo> list; private Map<String, Integer> map = new HashMap<>(); private LayoutInflater mInflater; private int mHidePosition = -1; private HomeActivity mActivity; public List<String> selectNoteList; private DragGridView mDragGridView; private Point mPoint = new Point(0, 0); private Bitmap mBitmap; private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { ImageView imageView = (ImageView) msg.obj; imageView.setImageBitmap(mBitmap); } }; public DragAdapter(Context context, List<NoteInfo> list, DragGridView gvNotesShelf) { this.list = list; mInflater = LayoutInflater.from(context); mActivity = (HomeActivity) context; this.mDragGridView = gvNotesShelf; for (int i = 0; i < list.size(); i++) { map.put(list.get(i).getName(), list.get(i).getPicIndex()); } selectNoteList = new ArrayList<>(); } @Override public int getCount() { return list.size(); } @Override public NoteInfo getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { String bitmapPath = getNoteCoverFolderPath() + "/" + list.get(position).getName(); convertView = mInflater.inflate(R.layout.item_notes_shelf, null); MyImageView ivNoteCover = (MyImageView) convertView.findViewById(R.id.iv_notes_cover); ivNoteCover.setOnMeasureListener(new MyImageView.OnMeasureListener() { @Override public void onMeasureSize(int width, int height) { mPoint.set(width, height); } }); ivNoteCover.setTag(bitmapPath); TextView tvNoteName = (TextView) convertView.findViewById(R.id.tv_notes_name); CheckBox cbNoteSelect = (CheckBox) convertView.findViewById(R.id.cb_note_select); tvNoteName.setText(list.get(position).getName()); String path = getNoteCoverFolderPath(); File coverFile = new File(path, list.get(position).getName()); if (coverFile.exists()) { Bitmap bitmap = NativeImageLoader.getInstance().loadNativeImage(bitmapPath, mPoint, new NativeImageLoader.NativeImageCallBack() { @Override public void onImageLoader(Bitmap bitmap, String path) { ImageView mImageView = (ImageView) mDragGridView.findViewWithTag(path); if (bitmap != null && mImageView != null) { mImageView.setImageBitmap(bitmap); } } }); if (bitmap != null){ ivNoteCover.setImageBitmap(bitmap); } } else { ivNoteCover.setImageResource(R.drawable.cover); } if (mActivity.getNotesFragment().isEdited == false) { cbNoteSelect.setVisibility(View.GONE); } else { cbNoteSelect.setVisibility(View.VISIBLE); cbNoteSelect.setFocusable(true); cbNoteSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { selectNoteList.add(list.get(position).getName()); } else { selectNoteList.remove(list.get(position).getName()); } } }); } if (position == mHidePosition) { convertView.setVisibility(View.INVISIBLE); } return convertView; } @Override public void reorderItems(int oldPosition, int newPosition) { NoteInfo temp = list.get(oldPosition); if (oldPosition < newPosition) { for (int i = oldPosition; i < newPosition; i++) { Collections.swap(list, i, i + 1); } } else if (oldPosition > newPosition) { for (int i = oldPosition; i > newPosition; i--) { Collections.swap(list, i, i - 1); } } list.set(newPosition, temp); } @Override public void setHideItem(int hidePosition) { NotesInfoDAO dao = new NotesInfoDAO(mActivity); this.mHidePosition = hidePosition; notifyDataSetChanged(); for (int i = 0; i < list.size(); i++) { if (i != map.get(list.get(i).getName())) { NoteInfo preInfo = list.get(i); NoteInfo updateInfo = list.get(i); updateInfo.setPicIndex(i); dao.update(preInfo, updateInfo); map.remove(list.get(i).getName()); map.put(list.get(i).getName(), i); } } } }
[ "humphrey_zeng@163.com" ]
humphrey_zeng@163.com
99578fdac2f6dca716ec646ecfcef0cdd919cd85
3f35592e545a0c373ae7a58c28cc874e21ff240d
/13_Homework05_LeThiThuHuong/src/string/Simple2.java
cd17a3b87a049e5d4d111f783954ddb2db44669b
[]
no_license
thuhuong2000/FC1
551b3734f0f86fdc863df83fc66c4c40d7338d36
d00bb941a451b6706c8270f4634ca8c8bc06e4dc
refs/heads/master
2022-09-15T06:37:28.063169
2020-06-03T15:08:01
2020-06-03T15:08:01
269,119,541
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package string; public class Simple2 { public static void main(String[] args) { String s1="Sachin"; String s2="SACHIN"; System.out.println(s1.equals(s2)); System.out.println(s1.equalsIgnoreCase(s2)); } }
[ "lethithuhuongak123@gmail.com" ]
lethithuhuongak123@gmail.com
c38ed76b4e8f7d0c8e648ea7fcc163fdd85ec1be
d9e9d8902871f954d5afc3b880791a64b8b7e218
/institute-run/src/main/java/com/webstack/instituterun/dto/StudentDTO.java
39ac1f03cca86b7fec615abb5a6db59ca667f22e
[]
no_license
keyur2714/webstack
4e85f1a6897d0fb6478f1b5ba0f63cf58b2fd147
21b04b3fd788c9b8c87bedbf599baed136cdf3d6
refs/heads/master
2023-01-10T11:53:34.821273
2019-12-21T04:35:54
2019-12-21T04:35:54
229,220,607
0
0
null
2023-01-07T13:03:27
2019-12-20T08:13:52
Java
UTF-8
Java
false
false
3,213
java
package com.webstack.instituterun.dto; import java.sql.Date; public class StudentDTO { private Long id; private String name; private String mobileNo; private String email; private Long totalFees; private Integer discount; private Long finalFees; private Long feesPaid; private Long feesRemaining; private String feesStatus; private Date registrationDate; private Long courseId; private String courseCode; private String courseName; private Long fees; private Long batchId; private String batchName; private String batchType; private String batchTime; private boolean selected; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMobileNo() { return mobileNo; } public void setMobileNo(String mobileNo) { this.mobileNo = mobileNo; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Long getTotalFees() { return totalFees; } public void setTotalFees(Long totalFees) { this.totalFees = totalFees; } public Integer getDiscount() { return discount; } public void setDiscount(Integer discount) { this.discount = discount; } public Long getFinalFees() { return finalFees; } public void setFinalFees(Long finalFees) { this.finalFees = finalFees; } public Long getFeesPaid() { return feesPaid; } public void setFeesPaid(Long feesPaid) { this.feesPaid = feesPaid; } public Long getFeesRemaining() { return feesRemaining; } public void setFeesRemaining(Long feesRemaining) { this.feesRemaining = feesRemaining; } public String getFeesStatus() { return feesStatus; } public void setFeesStatus(String feesStatus) { this.feesStatus = feesStatus; } public Date getRegistrationDate() { return registrationDate; } public void setRegistrationDate(Date registrationDate) { this.registrationDate = registrationDate; } public Long getCourseId() { return courseId; } public void setCourseId(Long courseId) { this.courseId = courseId; } public String getCourseCode() { return courseCode; } public void setCourseCode(String courseCode) { this.courseCode = courseCode; } public String getCourseName() { return courseName; } public void setCourseName(String courseName) { this.courseName = courseName; } public Long getFees() { return fees; } public void setFees(Long fees) { this.fees = fees; } public Long getBatchId() { return batchId; } public void setBatchId(Long batchId) { this.batchId = batchId; } public String getBatchName() { return batchName; } public void setBatchName(String batchName) { this.batchName = batchName; } public String getBatchType() { return batchType; } public void setBatchType(String batchType) { this.batchType = batchType; } public String getBatchTime() { return batchTime; } public void setBatchTime(String batchTime) { this.batchTime = batchTime; } public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } }
[ "keyur.555kn@gmail.com" ]
keyur.555kn@gmail.com
a5a32221774f30e243bd5692f698e5c280e478e5
2e124051d41328989829517d5d39576d4bb029ca
/src/main/java/io/yupiik/jira/cli/model/Priority.java
97e2811be79c0ed562b234023a000074a0823088
[ "Apache-2.0" ]
permissive
yupiik/jira-cli-native
9511bf543f076e3cfb481021f05c755e6f9d81ff
e652b50b6a8a2832a8d68d31e9f9e7d5a410bd32
refs/heads/master
2023-02-09T13:19:12.151703
2021-01-08T13:12:17
2021-01-08T13:12:21
269,298,125
1
0
null
null
null
null
UTF-8
Java
false
false
883
java
/* * Copyright 2020Yupiik SAS - https://www.yupiik.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.yupiik.jira.cli.model; import lombok.Data; import org.apache.geronimo.arthur.api.RegisterClass; @Data @RegisterClass(all = true) public class Priority { private String self; private String iconUrl; private String name; private String id; }
[ "rmannibucau@gmail.com" ]
rmannibucau@gmail.com
133a00847c25513aa3cd231c4f96f568a8a2e5c6
bce621fe09b43106c90f54df068de795b3203266
/aek-repair-service/src/main/java/com/aek/ebey/repair/service/impl/RepRepairReportServiceImpl.java
8352e79b762de28b42860db56b5a31ed91740a86
[]
no_license
honghuixixi/aek-repair-service
7b48f5cbe34abbf621e513eec5bd06ee9a82f8f4
f2d713bf603b3ef3c737042c1f87df217b7e6ecd
refs/heads/master
2020-03-21T06:49:18.640505
2018-06-22T02:17:12
2018-06-22T02:17:12
138,243,940
0
0
null
null
null
null
UTF-8
Java
false
false
14,198
java
package com.aek.ebey.repair.service.impl; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import com.aek.common.core.BeanMapper; import com.aek.common.core.Result; import com.aek.common.core.base.BaseServiceImpl; import com.aek.common.core.exception.ExceptionFactory; import com.aek.common.core.serurity.WebSecurityUtils; import com.aek.common.core.serurity.model.AuthUser; import com.aek.ebey.repair.enums.WeiXinRepairMessageTypeEnum; import com.aek.ebey.repair.inter.Constants; import com.aek.ebey.repair.inter.RepairApplyStatus; import com.aek.ebey.repair.mapper.RepPartsRecordMapper; import com.aek.ebey.repair.mapper.RepRepairReportMapper; import com.aek.ebey.repair.model.RepPartsRecord; import com.aek.ebey.repair.model.RepRepairApply; import com.aek.ebey.repair.model.RepRepairReport; import com.aek.ebey.repair.model.RepRepairTakeOrders; import com.aek.ebey.repair.request.RepRepairReportDetails; import com.aek.ebey.repair.request.RepRepairReportResponse; import com.aek.ebey.repair.request.WeiXinRepairMessageRequest; import com.aek.ebey.repair.service.RepPartsRecordService; import com.aek.ebey.repair.service.RepRepairApplyService; import com.aek.ebey.repair.service.RepRepairReportService; import com.aek.ebey.repair.service.RepRepairTakeOrdersService; import com.aek.ebey.repair.service.RepairDictionaryService; import com.aek.ebey.repair.service.ribbon.AuthClientService; import com.aek.ebey.repair.service.ribbon.UserPermissionService; import com.aek.ebey.repair.utils.DateUtil; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; /** * <p> * ็ปดไฟฎๆŠฅๅ‘Š ๆœๅŠกๅฎž็Žฐ็ฑป * </p> * * @author aek * @since 2017-08-30 */ @Service @Transactional public class RepRepairReportServiceImpl extends BaseServiceImpl<RepRepairReportMapper, RepRepairReport> implements RepRepairReportService { private static final Logger logger = LoggerFactory.getLogger(RepRepairReportServiceImpl.class); @Autowired private RepRepairApplyService repRepairApplyService; @Autowired private RepRepairReportMapper repRepairReportMapper; @Autowired private RepPartsRecordMapper repPartsRecordMapper; @Autowired private RepPartsRecordService repPartsRecordService; @Autowired private RepairDictionaryService repairDictionaryService; @Autowired private RedisTemplate<String, String> redisTemplate; @Autowired private AuthClientService authClientService; @Autowired private RepRepairTakeOrdersService repRepairTakeOrdersService; @Autowired private UserPermissionService userPermissionService; @Override public Boolean save(RepRepairReport data) { RepRepairApply repRepairApply = repRepairApplyService.selectById(data.getApplyId()); // ๅˆคๆ–ญๅฝ“ๅ‰่ฎขๅ•็Šถๆ€ๆ˜ฏๅฆไธบ2ๅพ…็ปดไฟฎ็Šถๆ€ if (null != repRepairApply && repRepairApply.getStatus() == RepairApplyStatus.REPAIRING) { AuthUser authUser = WebSecurityUtils.getCurrentUser(); Wrapper<RepRepairTakeOrders> wrapperTakeOrders=new EntityWrapper<>(); wrapperTakeOrders.eq("apply_id", data.getApplyId()); List<RepRepairTakeOrders> listTakeOrders=repRepairTakeOrdersService.selectList(wrapperTakeOrders); RepRepairTakeOrders repRepairTakeOrders=null; if(listTakeOrders!=null&&listTakeOrders.size()>0){ repRepairTakeOrders=listTakeOrders.get(0); } if (null != authUser && authUser.getId() != null) { data.setRepairId(authUser.getId()); data.setRepairName(authUser.getRealName()); } if(repRepairTakeOrders!=null){ Result<Integer> result= userPermissionService.checkIsRep(repRepairTakeOrders.getRepairId(), WebSecurityUtils.getCurrentToken()); logger.info("็”จๆˆทๆ˜ฏๅฆๅ…ทๆœ‰็ปดไฟฎๆƒ้™่ฟ”ๅ›ž็ป“ๆžœ="+(result!=null?result.getData().toString():null)); if(result!=null){ if(result.getData().intValue()==3){ if(repRepairTakeOrders.getRepairId().longValue()==authUser.getId().longValue()){ Wrapper<RepRepairReport> wrapper = new EntityWrapper<RepRepairReport>(); wrapper.eq("apply_id", data.getApplyId()); wrapper.eq("del_flag", 0); List<RepRepairReport> listRepRepairReport = repRepairReportMapper.selectList(wrapper); if(data.getPartsCost()!=null&&data.getRepairCost()!=null){ data.setTotalCost(data.getPartsCost().add(data.getRepairCost())); }else{ BigDecimal partsCost = new BigDecimal(0); BigDecimal repairCost = new BigDecimal(0); if(data.getPartsCost() != null){ partsCost = data.getPartsCost(); } if(data.getRepairCost() != null){ repairCost = data.getRepairCost(); } data.setPartsCost(partsCost); data.setRepairCost(repairCost); data.setTotalCost(partsCost.add(repairCost)); } Wrapper<RepPartsRecord> wrapperRepPartsRecord =null; List<RepPartsRecord> listRepPartsRecord =null; if (!CollectionUtils.isEmpty(listRepRepairReport)) { // ๅˆ ้™ค //data.setId(listRepRepairReport.get(0).getId()); repRepairReportMapper.deleteById(listRepRepairReport.get(0).getId()); wrapperRepPartsRecord = new EntityWrapper<RepPartsRecord>(); wrapperRepPartsRecord.eq("report_id", listRepRepairReport.get(0).getId()); //wrapperRepPartsRecord.eq("del_flag", 0); listRepPartsRecord = repPartsRecordMapper.selectList(wrapperRepPartsRecord); } // ๆ–ฐๅขž data.setRepairDate(new Date()); repRepairReportMapper.insert(data); List<RepPartsRecord> list = data.getList(); // ๆ›ดๆ–ฐ // ๆŸฅ่ฏขๆ‰€ๆœ‰็š„ๆฅๆบid List<Long> listids = new ArrayList<Long>(); if (!CollectionUtils.isEmpty(listRepPartsRecord)) { for (RepPartsRecord repPartsRecord : listRepPartsRecord) { listids.add(repPartsRecord.getId()); } } //ๅˆ ้™ค if(listids.size()>0){ repPartsRecordService.deleteBatchIds(listids); } //ๆ–ฐๅขž if (list != null && list.size() > 0) { if(data.getStatus().intValue() == 2){ for (RepPartsRecord repPartsRecord : list) { if (authUser != null) { // ่ฎพ็ฝฎๆœบๆž„ repPartsRecord.setTenantId(Long.parseLong(authUser.getTenantId() + "")); } repPartsRecord.setReportId(data.getId()); // ๆ–ฐๅขž repPartsRecordService.insert(repPartsRecord); } }else{ for (RepPartsRecord repPartsRecord : list) { if (authUser != null) { // ่ฎพ็ฝฎๆœบๆž„ repPartsRecord.setTenantId(Long.parseLong(authUser.getTenantId() + "")); } repPartsRecord.setReportId(data.getId()); repPartsRecord.setDelFlag(true); // ๆ–ฐๅขž repPartsRecordService.insert(repPartsRecord); } } } // ๆ›ดๆ”น่ฎขๅ•็Šถๆ€ if (data.getStatus().intValue() == 2) { repRepairApply.setStatus(RepairApplyStatus.WAITCHECK); repRepairApply.setSevenStatus(DateUtil.getSevenStatus(repRepairApply.getReportRepairDate(), data.getRepairDate())); //็”จๆˆทๅกซๅ†™็ปดไฟฎๆŠฅๅ‘Šๆ—ถ๏ผŒๅฐ†็”ณ่ฏทๅ•ๆถˆๆฏๆŽจ้€็ป™ๆœฌๆœบๆž„ไธ‹ๆ‹ฅๆœ‰้ชŒๆ”ถ็ปดไฟฎๆƒ้™็š„็”จๆˆท WeiXinRepairMessageRequest repairMessageBody = BeanMapper.map(repRepairApply, WeiXinRepairMessageRequest.class); repairMessageBody.setApplyId(repRepairApply.getId()); repairMessageBody.setType(WeiXinRepairMessageTypeEnum.CHECK.getType()); Result<List<Map<String, Object>>> messageResult = authClientService.sendWeiXinRepairMessage(repairMessageBody, WebSecurityUtils.getCurrentToken()); logger.info("็”จๆˆทๅกซๅ†™็ปดไฟฎๆŠฅๅ‘Šๆ—ถๆŽจ้€ๆถˆๆฏๆŽฅๅฃ่ฟ”ๅ›ž็ป“ๆžœ="+(messageResult!=null?messageResult.getData().toString():null)); } repRepairApplyService.updateById(repRepairApply); return true; }else{ throw ExceptionFactory.create("W_016"); } }else if(result.getData().intValue()==2){ throw ExceptionFactory.create("W_021"); }else if(result.getData().intValue()==1){ //ๆฒกๆœ‰ๆƒ้™ throw ExceptionFactory.create("W_019"); } }else{ throw ExceptionFactory.create("G_007"); } }else{ throw ExceptionFactory.create("W_017"); } } else { throw ExceptionFactory.create("W_002"); } return null; } @Override public RepRepairReportResponse searchResponse(Long id) { HashOperations<String, String, String> hash= redisTemplate.opsForHash(); RepRepairReportResponse response=new RepRepairReportResponse(); Wrapper<RepRepairReport> wrapper=new EntityWrapper<RepRepairReport>(); wrapper.eq("apply_id", id); wrapper.eq("del_flag", 0); List<RepRepairReport> list=repRepairReportMapper.selectList(wrapper); if (!CollectionUtils.isEmpty(list)) { RepRepairReport report = list.get(0); response.setModeStatusName(getModeStatusName(report.getModeStatus().intValue())); response.setOutsideCompany(report.getOutsideCompany()); response.setOutsidePhone(report.getOutsidePhone()); response.setFaultPhenomenonList(getList(hash,report.getFaultPhenomenon())); response.setFaultReasonList(getList(hash,report.getFaultReason())); response.setWorkContentList(getList(hash,report.getWorkContent())); } Wrapper<RepPartsRecord> wrapperRecord = new EntityWrapper<RepPartsRecord>(); wrapperRecord.eq("report_id", id); wrapperRecord.eq("del_flag", 0); List<RepPartsRecord> listRecord = repPartsRecordService.selectList(wrapperRecord); if (!CollectionUtils.isEmpty(listRecord)) { for(RepPartsRecord repPartsRecord:listRecord){ getReportsRecord(hash, repPartsRecord); } response.setList(listRecord); } return response; } private void getReportsRecord(HashOperations<String, String, String> hash, RepPartsRecord repPartsRecord) { if(repPartsRecord.getUnit()!=null){ if(hash.get(Constants.REPAIR_DICTIONARY, repPartsRecord.getUnit())!=null){ repPartsRecord.setUnitName(hash.get(Constants.REPAIR_DICTIONARY, repPartsRecord.getUnit())); }else{ String name= repairDictionaryService.getValue(repPartsRecord.getUnit()); if(name!=null){ hash.put(Constants.REPAIR_DICTIONARY,repPartsRecord.getUnit(), name); repPartsRecord.setUnitName(name); } } } } private List<String> getList(HashOperations<String, String, String> hash,String faultPhenomenon) { if(faultPhenomenon!=null&&faultPhenomenon.length()>0){ String[] listFaultPhenomenon=faultPhenomenon.split(","); List<String> list=new ArrayList<String>(); if(listFaultPhenomenon!=null&&listFaultPhenomenon.length>0){ for(String keyId:listFaultPhenomenon){ getKey(list,hash,keyId); } } return list; } return null; } private void getKey(List<String> list,HashOperations<String, String, String> hash,String keyId) { String reg = "^\\d+$"; boolean b= Pattern.compile(reg).matcher(keyId).find(); if(b){ String value= hash.get(Constants.REPAIR_DICTIONARY, keyId); if(value!=null){ list.add(value); }else{ String name= repairDictionaryService.getValue(keyId); if(name!=null){ hash.put(Constants.REPAIR_DICTIONARY,keyId, name); list.add(name); }else{ list.add(keyId); } } }else{ list.add(keyId); } } private String getModeStatusName(int modeStatus) { // 1๏ผŒ่‡ชไธป็ปดไฟฎ 2๏ผŒๅค–ไฟฎ 3๏ผŒ็Žฐๅœบ่งฃๅ†ณ String mode = ""; switch (modeStatus) { case 1: mode = "่‡ชไธป็ปดไฟฎ"; break; case 2: mode = "ๅค–ไฟฎ"; break; case 3: mode = "็Žฐๅœบ่งฃๅ†ณ"; break; default: break; } return mode; } @Override public RepRepairReportDetails search(Long id) { Wrapper<RepRepairReport> wrapper=new EntityWrapper<RepRepairReport>(); wrapper.eq("apply_id", id); wrapper.eq("del_flag", 0); RepRepairReportDetails details=new RepRepairReportDetails(); List<RepRepairReport> list=repRepairReportMapper.selectList(wrapper); AuthUser authUser = WebSecurityUtils.getCurrentUser(); if(!CollectionUtils.isEmpty(list)){ RepRepairReport repRepairReport=list.get(0); Wrapper<RepPartsRecord> wrapperRepPartsRecord = new EntityWrapper<RepPartsRecord>(); wrapperRepPartsRecord.eq("report_id", repRepairReport.getId()); //wrapperRepPartsRecord.eq("del_flag", 0); List<RepPartsRecord> listRepPartsRecord = repPartsRecordService.selectList(wrapperRepPartsRecord); repRepairReport.setList(listRepPartsRecord); details = BeanMapper.map(repRepairReport, RepRepairReportDetails.class); getDetails(details); } Wrapper<RepRepairTakeOrders> wrapperTakeOrders=new EntityWrapper<>(); wrapperTakeOrders.eq("apply_id", id); List<RepRepairTakeOrders> listTakeOrders=repRepairTakeOrdersService.selectList(wrapperTakeOrders); RepRepairTakeOrders repRepairTakeOrders=null; if(listTakeOrders!=null&&listTakeOrders.size()>0){ repRepairTakeOrders=listTakeOrders.get(0); } if(repRepairTakeOrders!=null){ if(authUser!=null){ details.setFlag(repRepairTakeOrders.getRepairId().longValue()==authUser.getId().longValue()?true:false); } } return details; } private void getDetails(RepRepairReportDetails details) { HashOperations<String, String, String> hash= redisTemplate.opsForHash(); details.setFaultPhenomenonList(getList(hash,details.getFaultPhenomenon())); details.setFaultReasonList(getList(hash,details.getFaultReason())); details.setWorkContentList(getList(hash,details.getWorkContent())); if (!CollectionUtils.isEmpty(details.getList())) { for(RepPartsRecord repPartsRecord:details.getList()){ getReportsRecord(hash, repPartsRecord); } details.setList(details.getList()); } } }
[ "honghui@aek56.com" ]
honghui@aek56.com
3542a3c546b8f69f6d196b970b729a3a3a677d92
2ecb7d4707e743973521678103fb0e1ffe638030
/src/jsat/parameters/Parameterized.java
9d222f2a3169eb8c2a6b7950a623b1e8e57c46e6
[]
no_license
BSolihah/LIBFROMJSAT
d47d19fbdeda7850c49a384085c5e67bf431d22f
3fce8088ddb5151966ba871bb9cb461be8fdf256
refs/heads/master
2020-12-05T20:29:40.602224
2020-01-07T04:01:47
2020-01-07T04:01:47
232,238,946
0
0
null
null
null
null
UTF-8
Java
false
false
1,044
java
package jsat.parameters; import java.util.List; /** * An algorithm may be Parameterized, meaning it has one or more parameters that * can be tuned or alter the results of the algorithm in question. * * @author Edward Raff */ public interface Parameterized { /** * Returns the list of parameters that can be altered for this learner. * @return the list of parameters that can be altered for this learner. */ default public List<Parameter> getParameters() { return Parameter.getParamsFromMethods(this); } /** * Returns the parameter with the given name. Two different strings may map * to a single Parameter object. An ASCII only string, and a Unicode style * string. * @param paramName the name of the parameter to obtain * @return the Parameter in question, or null if no such named Parameter exists. */ default public Parameter getParameter(String paramName) { return Parameter.toParameterMap(getParameters()).get(paramName); } }
[ "dell@10.6.163.47" ]
dell@10.6.163.47
def2b8cf06b140326e0a6a36c5ba36418349605f
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/hd/yadjm/ds/HD_YADJM_167001_ADataSet.java
40b67c7f4122a8bbff72625843dc327372d55f79
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
2,705
java
/*************************************************************************************************** * ํŒŒ์ผ๋ช… : .java * ๊ธฐ๋Šฅ : ๋…์ž์šฐ๋Œ€-๊ตฌ๋…์‹ ์ฒญ * ์ž‘์„ฑ์ผ์ž : 2007-05-22 * ์ž‘์„ฑ์ž : ๊น€๋Œ€์„ญ ***************************************************************************************************/ /*************************************************************************************************** * ์ˆ˜์ •๋‚ด์—ญ : * ์ˆ˜์ •์ž : * ์ˆ˜์ •์ผ์ž : * ๋ฐฑ์—… : ***************************************************************************************************/ package chosun.ciis.hd.yadjm.ds; import java.sql.*; import java.util.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.hd.yadjm.dm.*; import chosun.ciis.hd.yadjm.rec.*; /** * */ public class HD_YADJM_167001_ADataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{ public String errcode; public String errmsg; public HD_YADJM_167001_ADataSet(){} public HD_YADJM_167001_ADataSet(String errcode, String errmsg){ this.errcode = errcode; this.errmsg = errmsg; } public void setErrcode(String errcode){ this.errcode = errcode; } public void setErrmsg(String errmsg){ this.errmsg = errmsg; } public String getErrcode(){ return this.errcode; } public String getErrmsg(){ return this.errmsg; } public void getValues(CallableStatement cstmt) throws SQLException{ this.errcode = Util.checkString(cstmt.getString(1)); this.errmsg = Util.checkString(cstmt.getString(2)); } }/*---------------------------------------------------------------------------------------------------- Web Tier์—์„œ DataSet ๊ฐ์ฒด ๊ด€๋ จ ์ฝ”๋“œ ์ž‘์„ฑ์‹œ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. <% HD_YADJM_167001_ADataSet ds = (HD_YADJM_156001_ADataSet)request.getAttribute("ds"); %> Web Tier์—์„œ Record ๊ฐ์ฒด ๊ด€๋ จ ์ฝ”๋“œ ์ž‘์„ฑ์‹œ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier์—์„œ DataSet ๊ฐ์ฒด์˜ <%= %> ์ž‘์„ฑ์‹œ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. <%= ds.getErrcode()%> <%= ds.getErrmsg()%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier์—์„œ Record ๊ฐ์ฒด์˜ <%= %> ์ž‘์„ฑ์‹œ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. ----------------------------------------------------------------------------------------------------*/ /* ์ž‘์„ฑ์‹œ๊ฐ„ : Mon Dec 21 14:17:54 KST 2015 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
33c2a4d181dbf3e24220c6329ae98cd1afce1c20
d3ec1a14542019a5386d3ca1f6cc4a75ed7f04a2
/consultaPopular/src/consultapopular/TweetsBI.java
d12e5aa8adda1a1b02b59b87c744b9df2bda5939
[]
no_license
CaroCald/ProyectoConsultaPopular
7ec1559b8cc4796a72407eef7e1bcf21390fe4e2
6ea34b38331f58705d7475448708e7100aaf6769
refs/heads/master
2021-04-28T15:07:26.225439
2018-02-18T19:27:09
2018-02-18T19:27:09
121,981,639
0
0
null
null
null
null
UTF-8
Java
false
false
280
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 consultapopular; /** * * @author Carolina */ class TweetsBI { }
[ "carolina.2594@hotmail.com" ]
carolina.2594@hotmail.com
4a60f20fad797ac36a365cd07f0dc562923cb5fd
e5871ece699da23892937e263068df1378f0a4cd
/Spring-Projects/EXAM PREP 3/ColonialCouncilBank/src/main/java/app/ccb/util/XmlParserImpl.java
c1ed56a33ab69dd97832009eb8f285e2abfa69fc
[ "MIT" ]
permissive
DenislavVelichkov/Java-DBS-Module-June-2019
a047d5f534378b1682410c86595fd40466638cdc
643422bf41d99af1e0bbd3898fa5adfba8b2c36c
refs/heads/master
2022-12-22T12:08:47.625449
2020-02-10T09:21:15
2020-02-10T09:21:15
204,847,760
0
0
MIT
2022-12-16T05:03:18
2019-08-28T04:26:36
Java
UTF-8
Java
false
false
1,114
java
package app.ccb.util; import org.springframework.stereotype.Component; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import java.io.*; @Component public class XmlParserImpl implements XmlParser { @Override public <O> O parseXml(Class<O> objectClass, String path) throws JAXBException, FileNotFoundException { JAXBContext context = JAXBContext.newInstance(objectClass); BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(path)))); Unmarshaller unmarshaller = context.createUnmarshaller(); return (O) unmarshaller.unmarshal(reader); } @Override public <O> void exportToXml(O object, Class<O> objectClass, String path) throws JAXBException { JAXBContext context = JAXBContext.newInstance(objectClass); Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(object, new File(path)); } }
[ "denislav.velichkov@gmail.com" ]
denislav.velichkov@gmail.com
d4c8a3fd75f5be3624f4857ae6cae3fac06c9399
7885340e2d9e61be24fe53c77998df47e1c59f2a
/vaadin-gridster/src/main/java/org/vaadin/addons/gridsterlayout/client/GridsterLayoutState.java
41be2cdda35f895852e1346d077f6a3791c2e19e
[ "MIT" ]
permissive
bonprix/vaadin-gridster
ca47869d2650fa883020ec8653a6d1da46c28ad0
7f6d3913bc5e398fd0922c020a2b433f94653815
refs/heads/master
2021-01-17T08:59:15.805966
2015-09-22T20:37:28
2015-09-22T20:37:28
42,959,165
1
1
MIT
2020-01-03T18:08:27
2015-09-22T20:31:25
JavaScript
UTF-8
Java
false
false
421
java
package org.vaadin.addons.gridsterlayout.client; import java.util.HashMap; import java.util.Map; import com.vaadin.shared.Connector; import com.vaadin.shared.ui.AbstractLayoutState; public class GridsterLayoutState extends AbstractLayoutState { { primaryStyleName = "v-gridsterlayout"; } public GridsterConfig config; public Map<Connector, GridsterWidget> children = new HashMap<Connector, GridsterWidget>(); }
[ "ctstoerti@gmail.com" ]
ctstoerti@gmail.com
a6cbc40bf09f75b9c3d1eab41bcf951757eb0566
784a740e50a01628e8d84bb0f6fb3e6d94dd46a6
/src/main/java/ua/training/hashing/PasswordHashing.java
600731973803058828298f04b96312f3e0cdc4e8
[]
no_license
Solomka/library
7906e12a060107c4dcc428defb35c4560f8ad9a7
27f1b71e5f68c1abb0db53abac99296b8268d0ca
refs/heads/master
2022-06-22T18:28:19.620823
2020-07-14T17:42:18
2020-07-14T17:42:18
93,902,292
1
1
null
2022-06-21T00:04:47
2017-06-09T22:48:46
Java
UTF-8
Java
false
false
2,637
java
package ua.training.hashing; import java.io.IOException; import java.io.InputStream; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Properties; import java.util.Random; import org.apache.commons.codec.digest.DigestUtils; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import ua.training.exception.ServerException; /** * Class that is responsible for password hashing execution * * @author Solomka * */ public final class PasswordHashing { private static final Logger LOGGER = LogManager.getLogger(PasswordHashing.class); private static final String HASHING_SALT_FILE = "/hashing.properties"; private static final String WEBSITE_SALT_KEY = "website.solt"; private static String WEBSITE_SALT; private PasswordHashing() { try { InputStream inputStream = PasswordHashing.class.getResourceAsStream(HASHING_SALT_FILE); Properties dbProps = new Properties(); dbProps.load(inputStream); WEBSITE_SALT = dbProps.getProperty(WEBSITE_SALT_KEY); } catch (IOException e) { LOGGER.error("Can't load local salt form properties file", e); throw new ServerException(e); } } private static class Holder { static final PasswordHashing INSTANCE = new PasswordHashing(); } public static PasswordHashing getInstance() { return Holder.INSTANCE; } /** * Generates password hash using salt unique for each password that is * stored in db and application salt that is stored in hashing.properties * file by means of sha256Hex algorithm * * @param passwardToHash * password to hash * @param salt * salt using for pass hashing * @return hashing password */ public String generatePassHash256(String passwardToHash, byte[] salt) { return DigestUtils.sha256Hex(DigestUtils.sha256Hex(passwardToHash) + DigestUtils.sha256Hex(salt) + DigestUtils.sha256Hex(WEBSITE_SALT)); } /** * Generates random salt that is unique for each password and is stored with * password hash in db * * @return random salt */ public byte[] generateRandomSalt() { Random sr; try { sr = SecureRandom.getInstance("SHA1PRNG"); byte[] salt = new byte[16]; sr.nextBytes(salt); return salt; } catch (NoSuchAlgorithmException e) { LOGGER.error("SecureRandom random salt generation error", e); throw new ServerException(e); } } public boolean checkPassword(String passToCheck, byte[] salt, String hashedPassword) { return hashedPassword.equals(generatePassHash256(passToCheck, salt)); } }
[ "sol.yaremko@gmail.com" ]
sol.yaremko@gmail.com
c1e47d9bb6eff8c9cc64a63f2f9730392d25a7c0
1cd15cbd9321986bbacad9da3b4a41034f939924
/src/Day20_ArraysContinue/Max_Min.java
36cb811a2b3d158366606efa7fb5cdeba17710b0
[]
no_license
senrabia/JAVA_2020B18
00dace6664f8c1e90e1d80b84e8637fe483af2e0
8db7ddbba36364412b3d3ba77b54b0b04e1ede05
refs/heads/master
2022-10-01T11:45:52.737984
2020-06-09T13:20:52
2020-06-09T13:20:52
268,657,470
0
0
null
null
null
null
UTF-8
Java
false
false
1,099
java
package Day20_ArraysContinue; public class Max_Min { public static void main(String[] args) { /* Warmup tasks: 1. write a program that can find the maximum number from any given int array NOTE: DO NOT USE ANYTHING THAT WE HAVN'T COVERED IN THE CLASS 2. write a program that can find the minimum number from any given int array NOTE: DO NOT USE ANYTHING THAT WE HAVN'T COVERED IN THE */ int []arr={2,3,1000,5,6,7,8,9,300,500,750}; int lastindex=arr.length-1; //RUULS==> int max=arr[0]; int min=arr[0]; for(int i=0; i<=lastindex; i++){ if (arr[i] > max) { //array's index are compared with each other, and whicever //is grater will be assigned to the. max=arr[i]; } if(arr[i]<min){ //array's index are compared with each other, and whicever //is smaller will be assigned to the. min=arr[i]; } } System.out.println(max); System.out.println(min); } }
[ "senergunerrabia@gmail.com" ]
senergunerrabia@gmail.com
c2f59bd073d52937181879a6a6b6bf27ecd7fa53
f23c3fe054a9969c0d1470afc86c5c0a30bc44b2
/compilerimpl/test/org/jackie/compilerimpl/filemanager/URLFileObjectTest.java
2ec971eb51c0105571d80c198087bed7b43be405
[]
no_license
patrikbeno/jackie
236faea916916879397109bdcfba1d22c4f84fb7
ff31e1008b50aaa7ea371b35443995c163644c27
refs/heads/master
2021-01-18T20:20:29.001749
2013-03-06T21:15:36
2013-03-06T21:16:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,313
java
package org.jackie.compilerimpl.filemanager; import org.jackie.compilerimpl.filemanager.foimpl.URLFileObject; import org.jackie.compilerimpl.javacintegration.JFO; import org.jackie.utils.Assert; import org.testng.annotations.Test; import javax.tools.JavaFileObject.Kind; import java.io.File; import java.io.DataInputStream; import java.io.InputStream; import java.io.IOException; import java.net.URI; import java.net.URL; import java.nio.ByteBuffer; /** * @author Patrik Beno */ @Test public class URLFileObjectTest { public void read() throws Exception { String jhome = System.getProperty("java.home"); URI jaruri = new File(jhome, "lib/rt.jar").toURI(); URL base = new URL("jar:"+jaruri+"!/"); URLFileObject je = new URLFileObject(base, "java/awt/Component.class"); int read = je.getInputChannel().read(ByteBuffer.allocate((int) je.getSize())); Assert.notNull(je.getInputChannel()); Assert.doAssert(je.getSize()>0, "size=%s", je.getSize()); Assert.doAssert(je.getLastModified()>0, "lastModified=%s", je.getLastModified()); Assert.expected((int) je.getSize(), read, "read?"); // this is bug from javac (see below) // byte[] bytes = readInputStream(new byte[]{}, new JFO(je, Kind.CLASS).openInputStream()); // Assert.expected((int) je.getSize(), (int) bytes.length, "length?"); } // [javac: com.sun.tools.javac.jvm.ClassReader.readInputStream] this loops forever when s.available()==0 private static byte[] readInputStream(byte[] buf, InputStream s) throws IOException { try { buf = ensureCapacity(buf, s.available()); int r = s.read(buf); int bp = 0; while (r != -1) { bp += r; buf = ensureCapacity(buf, bp); r = s.read(buf, bp, buf.length - bp); } return buf; } finally { try { s.close(); } catch (IOException e) { /* Ignore any errors, as this stream may have already * thrown a related exception which is the one that * should be reported. */ } } } private static byte[] ensureCapacity(byte[] buf, int needed) { if (buf.length < needed) { byte[] old = buf; buf = new byte[Integer.highestOneBit(needed) << 1]; System.arraycopy(old, 0, buf, 0, old.length); } return buf; } }
[ "patrik.beno@gmail.com" ]
patrik.beno@gmail.com
53fdf6e730a38e04915caee59309c268a13a6399
2bdedcda705f6dcf45a1e9a090377f892bcb58bb
/src/main/output/moment/city_number_city/night.java
3ede2d32d6c61389f01752d87dab04ff2843ce4b
[]
no_license
matkosoric/GenericNameTesting
860a22af1098dda9ea9e24a1fc681bb728aa2d69
03f4a38229c28bc6d83258e5a84fce4b189d5f00
refs/heads/master
2021-01-08T22:35:20.022350
2020-02-21T11:28:21
2020-02-21T11:28:21
242,123,053
1
0
null
null
null
null
UTF-8
Java
false
false
2,348
java
using System; using System.IO; using System.Text; using System.Threading.Tasks; using System.Net.Http; using System.Net.Http.Headers; using System.Collections.Generic; using Newtonsoft.Json; using Microsoft.Extensions.Configuration; using System.Linq; /* in this repo */ using dfbStartup; namespace cog_console { class Program { public const string subscriptionkey_Emotion = "c965a908e198edb28a0b259e7601410a"; public const string subscriptionkey_LanguageTranslation = "4238bbff5fafb7c6bf2b2df132ee5331"; static void Main(string[] args) { //Console.WriteLine("Hello World!"); //EmotionFromImage().Wait(); //TranslateList().Wait(); JsonConfiguration.Init("azureKeys.json"); Console.WriteLine(JsonConfiguration.Config["emotion"]); } private static async Task EmotionFromImage() { string uri = "https://westus.api.cognitive.microsoft.com/emotion/v1.0/recognize"; var myAvatar = @"{'url': 'https://secure.gravatar.com/avatar/234khd9823hf9823hf93hf9.jpg?s=512&r=g&d=mm'}"; HttpContent contentPost = new StringContent(myAvatar, Encoding.UTF8, "application/json"); var client = new HttpClient(); client.DefaultRequestHeaders.Add("71008f23d08ec5b9d85b49fe4d753362", subscriptionkey_Emotion); //client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var response = await client.PostAsync(uri, contentPost); var content = await response.Content.ReadAsStringAsync(); Console.Write(content + "\n\r"); } private static async Task TranslateList() { string subscriptionKey = "0483e8583a0484a88b0d78b294aa8ea2"; string uri = "https://api.microsofttranslator.com/v2/Http.svc/GetLanguagesForTranslate"; var client = new HttpClient(); client.DefaultRequestHeaders.Add("a62a48dad535e2010c8e467aad51c1e8", subscriptionkey_LanguageTranslation); //client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var response = await client.GetAsync(uri); var content = await response.Content.ReadAsStringAsync(); Console.Write(content); } } }
[ "soric.matko@gmail.com" ]
soric.matko@gmail.com
70643f974768f0a02fa2a2f30202137b40453715
110a430c620c618088307f61f5317e5533537228
/Automation_Testing/src/test/java/ups/nj/stefdef/LoginStepDef.java
cdc1bb160512386112b6987a309ff57ec21920af
[]
no_license
SetaraAli/Automation_Batch12
ad9283b6c3f73d9a8401b305c6f1b2cd6b72b1df
d843469c5876640ad5162cee31215aa507e419a3
refs/heads/master
2023-03-24T04:21:18.657266
2021-03-21T22:01:45
2021-03-21T22:01:45
350,125,672
0
0
null
null
null
null
UTF-8
Java
false
false
2,258
java
package ups.nj.stefdef; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import ups.nj.supperpage.SupperClass; public class LoginStepDef extends SupperClass { @Given("^User can open any browser$") public void user_can_open_any_browser() { System.setProperty("webdriver.chrome.driver", "/Applications/chromedriver"); driver = new ChromeDriver(); } @Given("^User able to enter url$") public void user_able_to_enter_url() { driver.get("https://www.ups.com/us/en/Home.page"); driver.manage().window().maximize(); } @When("^User able to click on the login button$") public void user_able_to_click_on_the_login_button() { // 4rt way WebElement ele = driver.findElement(By.linkText("Log in / Sign up")); JavascriptExecutor excuter = (JavascriptExecutor)driver; excuter.executeScript("arguments[0].click();", ele); // 3rd way //Actions action = new Actions(driver); //WebElement ele = driver.findElement(By.linkText("Log in / Sign up")); //action.click(ele).build().perform(); // 2nd way //WebElement ele = driver.findElement(By.linkText("Log in / Sign up")); //ele.click(); // 1 way //driver.findElement(By.linkText("Log in / Sign up")).click(); // driver.findElement(By.xpath("//a[text()='Log in / Sign up']")).click(); // This xpath create using text method // driver.findElement(By.className("ups-analytics")).click(); // driver.findElement(By.partialLinkText("Log in / Sign up")).click(); //driver.findElement(By.xpath("(//a[@class='ups-analytics'])[7]")).click(); // by grouping xpath } @When("^User enter the userName$") public void user_enter_the_userName() { } @When("^User enter the password$") public void user_enter_the_password() { } @When("^User click on the signing button$") public void user_click_on_the_signing_button() { } @Then("^User able to verify successfully login$") public void user_able_to_verify_successfully_login() { } @Then("^User name & homepage title$") public void user_name_homepage_title() { } }
[ "Owner@DESKTOP-S8RV49O.lan" ]
Owner@DESKTOP-S8RV49O.lan
cbd5c4c91dc31c9f78c733089a6bda20179b057c
53a04b8d2d9104c294d5642c15a3a59813e27494
/backend/laboratory/src/main/java/com/zj/laboratory/pojo/LwEntry.java
55b584b5660b294b1b6e286f1004dad4c7611dca
[]
no_license
LBJNY/laboratory
0a83426d6ad88c0974e5c844427634bb72308f6b
86f29deb6d5892c3ee02c1c3295c91dc96999526
refs/heads/master
2023-05-06T21:19:33.536768
2021-05-17T08:56:45
2021-05-17T08:56:45
357,442,546
0
0
null
null
null
null
UTF-8
Java
false
false
3,273
java
package com.zj.laboratory.pojo; import java.io.Serializable; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; /** * ่ฟ›ๅœบๅ•่กจ(lw_entry)ๅฎžไฝ“็ฑป * * @author lbj * @since 2021-04-21 09:59:24 */ @Data @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class LwEntry implements Serializable { private static final long serialVersionUID = 1L; /** * idๅท */ private Long id; /** * ่ฟ›ๅœบๅ•็ผ–ๅท */ private String entryNo; /** * ๆ™บๅฎถๆŽฅๅฃไบบ */ private String entryManager; /** * ๆไบค็”ณ่ฏทๆ—ฅๆœŸ */ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date currentDate; /** * ๅ•ไฝๅ’Œ้ƒจ้—จๅ็งฐ */ private String deptName; /** * ๆœๅŠก้กน็›ฎๅ็งฐ */ private String projName; /** * ่”็ณปไบบ */ private String contact; /** * ่”็ณปไบบ็”ต่ฏ */ private String tel; /** * ่”็ณปไบบ้‚ฎ็ฎฑ */ private String email; /** * ่ฟ›ๅœบไบบๅ‘˜ */ private String staff; /** * ๅทฅไฝœ่ฏดๆ˜Ž */ private String description; /** * ่ต„ๆบ้œ€ๆฑ‚ */ private String requirement; /** * ๅฎกๆ ธ็Šถๆ€๏ผˆ0๏ผšๅพ…ๅฎกๆ ธ๏ผŒ1๏ผš้€š่ฟ‡๏ผŒ2๏ผšๆœช้€š่ฟ‡๏ผ‰ */ private Integer verifyStatus; /** * ็‰ˆๆœฌๅท */ private Integer version; /** * ็Šถๆ€๏ผˆ1๏ผšๆญฃๅธธ๏ผŒ0๏ผšๆ— ๆ•ˆ๏ผ‰ */ private Integer status; /** * ๅฎกๆ ธไบบid */ private Long officerId; /** * ๅฎกๆ ธไบบๅ็งฐ */ private String officerName; /** * ็”ณ่ฏทไบบid */ private Long applicantId; /** * ็”ณ่ฏทไบบๅ็งฐๆˆ–ๆ˜ต็งฐ */ private String applicantName; /** * ๅฎกๆ ธไบบ็Šถๆ€๏ผˆ1๏ผšๆญฃๅธธ๏ผŒ0๏ผšๆ— ๆ•ˆ๏ผ‰ */ private Integer officerStatus; /** * ็”ณ่ฏทไบบ็Šถๆ€๏ผˆ1๏ผšๆญฃๅธธ๏ผŒ0๏ผšๆ— ๆ•ˆ๏ผ‰ */ private Integer applicantStatus; /** * sDate */ //ไฟฎๆ”นไผ ๅˆฐๅ‰็ซฏ็š„ๆ—ถ้—ดๆ ผๅผ๏ผˆไธๅŠ ๅฐฑๆ˜ฏๆ—ถ้—ดๆˆณ๏ผ‰ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") //ไฟฎๆ”นๆไบค็š„ๆ—ถๅ€™ๅ‰็ซฏไผ ๅˆฐๅŽ็ซฏ็š„ๆ—ถ้—ด๏ผŒๅณๅ‰็ซฏๆไบคๆŒ‡ๅฎšๆ ผๅผ็š„ๅญ—็ฌฆไธฒ @DateTimeFormat(pattern="yyyy-MM-dd") private Date sDate; /** * eDate */ //ไฟฎๆ”นไผ ๅˆฐๅ‰็ซฏ็š„ๆ—ถ้—ดๆ ผๅผ๏ผˆไธๅŠ ๅฐฑๆ˜ฏๆ—ถ้—ดๆˆณ๏ผ‰ @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") //ไฟฎๆ”นๆไบค็š„ๆ—ถๅ€™ๅ‰็ซฏไผ ๅˆฐๅŽ็ซฏ็š„ๆ—ถ้—ด๏ผŒๅณๅ‰็ซฏๆไบคๆŒ‡ๅฎšๆ ผๅผ็š„ๅญ—็ฌฆไธฒ @DateTimeFormat(pattern="yyyy-MM-dd") private Date eDate; /** * ็”จๆˆทๆ˜ฏๅฆๆŸฅ็œ‹่ฟ‡๏ผš0ๆฒกๆŸฅ็œ‹ 1ๆŸฅ็œ‹ */ private Integer isLook; /** * ๆ˜ฏๅฆๅˆ ้™ค๏ผŒ1ๆ˜ฏ0ๅฆ */ private Integer deleted; /** * ๆ›ดๆ–ฐ่€… */ private String updateBy; /** * ๆ›ดๆ–ฐๆ—ถ้—ด */ private Date updateTime; }
[ "lbj@qq.com" ]
lbj@qq.com
dd9307977d53f3147a6947257657c2ab20419160
23fbe422245240d949f1ead195da53b3e40b4178
/twitter-core/src/main/java/com/twitter/sdk/android/core/TwitterRateLimit.java
c606e196369b7be14876acb3d25b6e475f061c35
[ "Apache-2.0" ]
permissive
beardouglas/twitter-kit-android
1a8cf6a7f28729f055597bff3914958a85f5982f
b612303d4f2212ebdc682dd54c42d3c8b2a045a7
refs/heads/master
2021-01-24T22:15:02.673293
2015-05-27T19:05:23
2015-05-27T19:19:28
36,392,481
1
0
null
2015-05-27T20:03:50
2015-05-27T20:03:50
null
UTF-8
Java
false
false
2,669
java
/* * Copyright (C) 2015 Twitter, 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.twitter.sdk.android.core; import java.util.List; import retrofit.client.Header; /** * Represents the rate limit data returned on the headers of a request * * @see <a href="https://dev.twitter.com/docs/rate-limiting/1.1">Rate Limiting</a> */ class TwitterRateLimit { private final static String LIMIT_KEY = "x-rate-limit-limit"; private final static String REMAINING_KEY = "x-rate-limit-remaining"; private final static String RESET_KEY = "x-rate-limit-reset"; private final long timeStamp; private int limit; private int remainingRequest; private long reset; TwitterRateLimit(final List<Header> headers) { if (headers == null) { throw new IllegalArgumentException("headers must not be null"); } timeStamp = System.currentTimeMillis(); for (Header header : headers) { if (LIMIT_KEY.equals(header.getName())) { limit = Integer.valueOf(header.getValue()); } else if (REMAINING_KEY.equals(header.getName())) { remainingRequest = Integer.valueOf(header.getValue()); } else if (RESET_KEY.equals(header.getName())) { reset = Long.valueOf(header.getValue()); } } } /** * Returns the rate limit ceiling for that given request */ public int getLimit() { return limit; } /** * Returns the number of requests left for the 15 minute window */ public int getRemaining() { return remainingRequest; } /** * Returns epoch time that rate limit reset will happen. */ public long getReset() { return reset; } /** * Returns epoch time that request was made. */ public long getRequestedTime() { return timeStamp; } /** * Returns epoch time remaining in rate limit window. */ public long getRemainingTime() { if (reset > timeStamp) { return 0; } else { return reset - timeStamp; } } }
[ "ty@twitter.com" ]
ty@twitter.com
7a0cdeb83871d30d2f235ca675dd90a32d2b8f3d
84604f13809889e65ab1312618263400b7b2784e
/backend/src/main/java/no/panopticon/api/external/sns/Dimension.java
b89ff03aa265d2ce549455b036da893c0d2dc0c0
[ "Apache-2.0" ]
permissive
steinim/panopticon
e75735b08c9f3ccd4f16e6d9d35b93256b9a1ed7
19cd1898ee8aad3f1e4ced410078368cf65e2cd0
refs/heads/master
2021-05-04T20:56:10.682112
2018-02-07T07:32:18
2018-02-07T07:32:18
119,387,461
0
0
null
2018-01-29T13:40:51
2018-01-29T13:40:51
null
UTF-8
Java
false
false
307
java
package no.panopticon.api.external.sns; public class Dimension { public String name; public String value; @Override public String toString() { return "Dimension{" + "name='" + name + '\'' + ", value='" + value + '\'' + '}'; } }
[ "steinim@gmail.com" ]
steinim@gmail.com
54524c44deb5c5d1e8f06c67f7c9aca568309f6b
15730b0b775be4676f6abb9b71c9411088d57610
/dictionar-lib/src/main/java/com/leman/utils/maybe/StopWatch.java
42382c753ffa660c1885a063334c142130d0da42
[]
no_license
rogueleman/learning
fc7959a289f492b7aeccf8b0ab7c4612f58737fa
042ef07e495fcf071ec9b4c6a7a7619063346b5d
refs/heads/master
2020-06-03T01:44:42.080077
2015-11-16T12:33:26
2015-11-16T12:33:26
6,597,363
0
0
null
null
null
null
UTF-8
Java
false
false
1,450
java
package com.leman.utils.maybe; public class StopWatch { private final static String ANSWER_START = "elapsedTime "; private long start; private long stop; public void start() { start = System.currentTimeMillis(); // start timing } public void stop() { stop = System.currentTimeMillis(); // stop timing } public String toString() { String answerUM = ""; long executionTime = elapsedTimeMillis(); if (executionTime < 1000) { answerUM = " miliSeconds"; } else { executionTime = elapsedTimeSeconds(); if (executionTime < 60) { answerUM = " seconds"; } else { executionTime = elapsedTimeMinutes(); if (executionTime < 60) { answerUM = " minutes"; } else { executionTime = elapsedTimeHours(); if (executionTime < 60) { answerUM = " hours"; } } } } return ANSWER_START + Long.toString(executionTime) + answerUM; // print execution time } private long elapsedTimeMillis() { return stop - start; } private long elapsedTimeSeconds() { return elapsedTimeMillis()/1000; } private long elapsedTimeMinutes() { return elapsedTimeSeconds()/60; } private long elapsedTimeHours() { return elapsedTimeMinutes()/60; } }
[ "gm.gutau@gmail.com" ]
gm.gutau@gmail.com
44c897bb13d8b53403da41c7d8037f38dec1fd4e
8f129a81025ebece5e20f222e8253fa8e0a5969f
/src/exceptions/InsertionException.java
c520e61fa08407afb2643d36371d9b8d7e4d0e7a
[]
no_license
rael-guimaraes/Xtra-vision-xpress-machine-project
7f0efc0da4cd1a7755f24ea5880bccdef7ffdc43
fcd621d997f02394f4b2266c7befe2155f0ac1ab
refs/heads/master
2023-04-23T08:09:50.490448
2021-05-18T11:34:27
2021-05-18T11:34:27
366,033,249
0
0
null
null
null
null
UTF-8
Java
false
false
377
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 exceptions; /** * * @author raelg */ public class InsertionException extends Exception { public InsertionException(String message){ super(message); } }
[ "raelguimaraes8@hotmail.com" ]
raelguimaraes8@hotmail.com
43fa03e0b18fc407ab962dfbadf3c8d35e00992e
764d198a5d3329dc5da9de4dc44344300f07de35
/src/main/java/com/ruisi/ext/engine/dao/DaoHelper.java
7ce546a18e3f6126630d619b765756b9296445bd
[]
no_license
DarrickAZ/rsbi
a403cd93b034dde11370026e80e68e31d0670c7f
c82cd481d86e0f2ba4fd08f53b824b60bfd3170f
refs/heads/master
2020-04-26T17:32:35.928254
2019-03-14T06:35:31
2019-03-14T06:35:31
173,717,187
0
1
null
null
null
null
UTF-8
Java
false
false
731
java
// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.ruisi.ext.engine.dao; import java.util.List; import java.util.Map; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.PreparedStatementCallback; public interface DaoHelper { List queryForList(String var1); Map queryForMap(String var1); Object queryForObject(String var1, Class var2); Object execute(String var1, PreparedStatementCallback var2); Long queryForLong(String var1); void execute(String var1); int queryForInt(String var1); List queryForList(String var1, Object[] var2); Object execute(ConnectionCallback var1); }
[ "zhwwhx@126.com" ]
zhwwhx@126.com
e43235c7197053e435ff7ce9a6837b40d30b986b
a5b06a9066c0082d7fe4a94190c6d0ee3820a553
/src/main/java/com/example/mycommunity/service/QuestionService.java
f551f64c30eabebd514699b2d7477fb0e0bc2da9
[]
no_license
xudhchd/mycommunity
bd0ac1c9cbe0a63ba19b37573c9a18873d51037d
2c3f6dddb3b360937975730f8a9a6c594f35c5a9
refs/heads/master
2023-07-27T16:24:00.812012
2021-09-11T05:10:03
2021-09-11T05:10:03
403,585,817
0
0
null
null
null
null
UTF-8
Java
false
false
5,016
java
package com.example.mycommunity.service; import com.example.mycommunity.dto.PageDTO; import com.example.mycommunity.dto.QuestionDTO; import com.example.mycommunity.exception.CustomizeErrorCode; import com.example.mycommunity.exception.CustomizeException; import com.example.mycommunity.mapper.QuestionMapper; import com.example.mycommunity.mapper.UserMapper; import com.example.mycommunity.model.Question; import com.example.mycommunity.model.QuestionExample; import com.example.mycommunity.model.User; import org.apache.ibatis.session.RowBounds; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service public class QuestionService { @Autowired private QuestionMapper questionMapper; @Autowired private UserMapper userMapper; public PageDTO list(Integer page, Integer size) { Integer countlines = (int)questionMapper.countByExample(new QuestionExample()); Integer totalPage; if (countlines % size == 0) { totalPage = countlines / size; } else { totalPage = countlines / size + 1; } if (page < 1) { page=1; } else if (page > totalPage) { page = totalPage; } Integer offset =(page - 1)*size; List<Question> questions = questionMapper.selectByExampleWithBLOBsWithRowbounds(new QuestionExample(), new RowBounds(offset, size)); List<QuestionDTO> questionDTOS = new ArrayList<>(); PageDTO pageDTO = new PageDTO(); for (Question question : questions) { User user = userMapper.selectByPrimaryKey(question.getCreator()); QuestionDTO questionDTO = new QuestionDTO(); BeanUtils.copyProperties(question,questionDTO); questionDTO.setUser(user); questionDTOS.add(questionDTO); } pageDTO.setQuestionDTOList(questionDTOS); pageDTO.setPagePara(totalPage, page, size); return pageDTO; } public PageDTO listById(Integer id, Integer page, Integer size) { QuestionExample questionExample = new QuestionExample(); questionExample.createCriteria().andCreatorEqualTo(id); Integer countlines = (int)questionMapper.countByExample(new QuestionExample()); Integer totalPage; if (countlines % size == 0) { totalPage = countlines / size; } else { totalPage = countlines / size + 1; } if (page < 1) { page=1; } else if (page > totalPage) { page = totalPage; } Integer offset =(page - 1)*size; QuestionExample example = new QuestionExample(); example.createCriteria().andCreatorEqualTo(id); List<Question> questions = questionMapper.selectByExampleWithBLOBsWithRowbounds(example, new RowBounds(offset, size)); List<QuestionDTO> questionDTOS = new ArrayList<>(); PageDTO pageDTO = new PageDTO(); for (Question question : questions) { User user = userMapper.selectByPrimaryKey(question.getCreator()); QuestionDTO questionDTO = new QuestionDTO(); BeanUtils.copyProperties(question,questionDTO); questionDTO.setUser(user); questionDTOS.add(questionDTO); } pageDTO.setQuestionDTOList(questionDTOS); pageDTO.setPagePara(totalPage, page, size); return pageDTO; } public QuestionDTO getById(Integer id) { Question question = questionMapper.selectByPrimaryKey(id); if (question == null) { throw new CustomizeException(CustomizeErrorCode.QUESTION_NOT_FOUND); } QuestionDTO questionDTO = new QuestionDTO(); BeanUtils.copyProperties(question,questionDTO); User user = userMapper.selectByPrimaryKey(question.getCreator()); questionDTO.setUser(user); return questionDTO; } public void createOrUpdate(Question question) { if (question.getId() == null) { question.setGmtCreat(System.currentTimeMillis()); question.setGmtModified(question.getGmtCreat()); questionMapper.insert(question); } else { Question updateQuestion = new Question(); updateQuestion.setGmtModified(System.currentTimeMillis()); updateQuestion.setTitle(question.getTitle()); updateQuestion.setDescription(question.getDescription()); updateQuestion.setTag(question.getTag()); QuestionExample example = new QuestionExample(); example.createCriteria() .andIdEqualTo(question.getId()); int updated = questionMapper.updateByExampleSelective(updateQuestion, example); if (updated != 1) { throw new CustomizeException(CustomizeErrorCode.QUESTION_NOT_FOUND); } } } }
[ "71687403+xudhcumt@users.noreply.github.com" ]
71687403+xudhcumt@users.noreply.github.com
35953060525d0e751538c77735cb0da8dfe7c01a
d6b383647133f3f7ac75d3088e3a9f8cb63b0bc8
/spring-boot-starter-saml-onelogin/src/main/java/nl/_42/boot/saml/onelogin/web/SAMLLogoutProcessingFilter.java
d2d4f0994f59405b2cfe20eef41949269d3e9b53
[]
no_license
thyzzv/spring-boot-starter-saml
906450bb21667883d7c974fad216ef736cc258a4
1ba1b4c6209f46add3c74943a82aafb2d03ce82f
refs/heads/master
2023-06-04T22:54:52.165206
2021-06-22T10:30:48
2021-06-22T10:30:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package nl._42.boot.saml.onelogin.web; import com.onelogin.saml2.Auth; import com.onelogin.saml2.settings.Saml2Settings; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.context.SecurityContextHolder; import javax.servlet.FilterChain; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Slf4j public class SAMLLogoutProcessingFilter extends AbstractSAMLFilter { private final String successUrl; public SAMLLogoutProcessingFilter(Saml2Settings settings, String successUrl) { super(settings); this.successUrl = successUrl; } @Override protected void doFilter(Auth auth, HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException { SecurityContextHolder.clearContext(); log.info("Logout successful"); response.sendRedirect(successUrl); } }
[ "jeroen.van.schagen@42.nl" ]
jeroen.van.schagen@42.nl
3ca48efd4e26277bb1638e5c0ab581e6f7957426
c69a66ec0cb360dd06f7dd2b88677b57a805a624
/bms-dao/src/main/java/com/onemile/bms/mapper/admin/AdminUserRoleMapper.java
b1726eb34766012a96558be086f539b83682cd05
[]
no_license
fasheng010203/omb-web
b0a8e8d2bbd0c8b9d53da90b7f944a40511d23c3
05962b722089163a14633199895f8fc4159c4f47
refs/heads/master
2020-05-04T14:40:11.446298
2019-04-03T05:24:36
2019-04-03T05:24:36
179,206,491
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.onemile.bms.mapper.admin; import com.onemile.bms.entity.admin.AdminUserRole; import com.onemile.bms.mapper.BaseMapper; import org.springframework.stereotype.Repository; import java.util.List; /** * @author Eric */ @Repository public interface AdminUserRoleMapper extends BaseMapper<AdminUserRole> { /** * ็”จๆˆทๆ‹ฅๆœ‰่ง’่‰ฒ * * @param userId * @return */ List<Long> selectUserRoles(Long userId); /** * ็”จๆˆทๆ‹ฅๆœ‰ ่ต„ๆบ * * @param userId * @return */ List<Long> selectUserResc(Long userId); /** * ๆŒ‰็”จๆˆทidๅˆ ้™ค * * @param userId * @return */ Integer deleteByUserId(Long userId); /** * ๆ‰น้‡ๆ’ๅ…ฅ * * @param adminUserRoles * @return */ Integer batchInsert(List<AdminUserRole> adminUserRoles); /** * ็ปŸ่ฎก่ง’่‰ฒไธ‹็”จๆˆทๆ•ฐ้‡ * * @param RoleId * @return */ Integer countByRoleId(Long RoleId); }
[ "fasheng0102@163.com" ]
fasheng0102@163.com
b29df0a095aaeaffd6b772a3dc6d530eb4a7f02c
c3680a0b81d8cf7268879d87d12616709d114f7b
/myproject/src/com/template/dao/HibernateTemplateDao.java
5a458df4d0986dc730cfa126cb1ce5f337d064f4
[]
no_license
ycy53589793/demo
0e4517a24b135869e7f8643d7609f56cdc6a47de
caeb4c3c79fe6ebc9a758e60369d0550f8353226
refs/heads/master
2021-01-01T20:22:57.422859
2014-09-06T08:53:10
2014-09-06T08:53:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,741
java
package com.template.dao; import java.io.StringReader; import java.io.StringWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import org.springframework.beans.factory.InitializingBean; import com.constant.Constant; import com.template.bean.StatementTemplate; import com.template.service.DynamicHibernateStatementBuilder; import com.util.EmptyUtil; import com.util.HibernateUtil; import freemarker.cache.StringTemplateLoader; import freemarker.template.Configuration; import freemarker.template.Template; /** * Description: ย  ๆจกๆฟๆŸฅ่ฏข * @author: ๆจ่ช่‰บ * Create Date: 2014-8-19 * <pre> * ไฟฎๆ”น่ฎฐๅฝ•: * ไฟฎๆ”นๅŽ็‰ˆๆœฌ ไฟฎๆ”นไบบ ไฟฎๆ”นๆ—ฅๆœŸ ไฟฎๆ”นๅ†…ๅฎนย  * 2014-8-19.1 ๆจ่ช่‰บ 2014-8-19 create *ย </pre> */ public class HibernateTemplateDao implements InitializingBean { protected Map<String, StatementTemplate> templateCache; protected DynamicHibernateStatementBuilder dynamicStatementBuilder; public HibernateTemplateDao() { } /** * Description : * @param hql * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-13 */ @SuppressWarnings("rawtypes") public List queryByHQL(String hql) { Session s = HibernateUtil.getSession(); Transaction tx=s.beginTransaction(); Query q= s.createQuery(hql); List res = q.list(); tx.commit(); HibernateUtil.closeSession(s); return res; } /** * Description : * @param hql * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-13 */ public void deleteByHQL(String hql) { updateByHQL(hql); } /** * Description : * @param hql * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-13 */ public int updateByHQL(String hql) { Session s = HibernateUtil.getSession(); Transaction tx=s.beginTransaction(); Query q= s.createQuery(hql); int res=q.executeUpdate(); tx.commit(); HibernateUtil.closeSession(s); return res; } /** * Description :ๆŸฅ่ฏขๆ€ป่ฎฐๅฝ•ๆ•ฐ * @param hsql * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-6-8 */ public long getCount(String hsql) { Session session=HibernateUtil.getSession(); Query q=session.createQuery(hsql); long count=(Long)q.list().get(0); HibernateUtil.closeSession(session); return count; } @SuppressWarnings("rawtypes") public List queryBySQL(String sql) { return null; } public void updateBySQL(String sql) { } public void deleteBySQL(String hql) { } /** * Description :ๆŸฅ่ฏขๅœจxxx.hbm.xmlไธญ้…็ฝฎ็š„ๆŸฅ่ฏข่ฏญๅฅ * @param queryName * @param parameters * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-19 */ @SuppressWarnings("rawtypes") public List findByNamedQuery(final String queryName, final Map<String, ?> parameters) { //่Žทๅ–ๆจกๆฟ StatementTemplate statementTemplate = templateCache.get(queryName); //่งฃๆžๆจกๆฟ String statement = processTemplate(statementTemplate,parameters); //ๅˆคๆ–ญ่ฏญๅฅ็ฑปๅž‹ if(statementTemplate.getType() == Constant.STRING.HQL){ return queryByHQL(statement); }else{ return queryBySQL(statement); } } /** * Description :springๅœจๅˆๅง‹ๅŒ–beanไน‹ๅŽ็š„ๅ›ž่ฐƒๅ‡ฝๆ•ฐ * @param statementTemplate * @param parameters * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-19 */ @Override public void afterPropertiesSet() throws Exception { //ๅˆๅง‹ๅŒ–ๆจกๆฟๆŸฅ่ฏข dynamicStatementBuilder.init(); //่Žทๅ–sql hql Map<String,String> namedHQLQueries = dynamicStatementBuilder.getNamedHQLQueries(); Map<String,String> namedSQLQueries = dynamicStatementBuilder.getNamedSQLQueries(); Configuration configuration = new Configuration(); configuration.setNumberFormat("#"); StringTemplateLoader stringLoader = new StringTemplateLoader(); //ๅพช็Žฏ่ฟ›่กŒ็ผ“ๅญ˜ for(Entry<String, String> entry : namedHQLQueries.entrySet()){ stringLoader.putTemplate(entry.getKey(), entry.getValue()); templateCache.put(entry.getKey(), new StatementTemplate(Constant.STRING.HQL,new Template(entry.getKey(),new StringReader(entry.getValue()),configuration))); } for(Entry<String, String> entry : namedSQLQueries.entrySet()){ stringLoader.putTemplate(entry.getKey(), entry.getValue()); templateCache.put(entry.getKey(), new StatementTemplate(Constant.STRING.SQL,new Template(entry.getKey(),new StringReader(entry.getValue()),configuration))); } configuration.setTemplateLoader(stringLoader); } /** * Description : * @param statementTemplate * @param parameters * @return * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-19 */ protected String processTemplate(StatementTemplate statementTemplate,Map<String, ?> parameters){ StringWriter stringWriter = new StringWriter(); try { statementTemplate.getTemplate().process(parameters, stringWriter); } catch (Exception e) { e.printStackTrace(); } return stringWriter.toString(); } /** * Description : * @param sql * @Author: ๆจ่ช่‰บ * @Create Date: 2014-8-13 */ public void insertBySQL(String sql) { Connection con=getConnection(); PreparedStatement ps=getPreparedStatement(con, sql); try { ps.execute(); } catch (SQLException e) { e.printStackTrace(); } finally { closePreparedStatement(ps); closeConnection(con); } } protected Connection getConnection() { Connection con=null; return con; } protected PreparedStatement getPreparedStatement(Connection con,String sql) { PreparedStatement ps=null; if(EmptyUtil.isEmpty(con)) { return ps; } try { ps=con.prepareStatement(sql); } catch (SQLException e) { e.printStackTrace(); } return ps; } protected void closeResultSet(ResultSet rs) { if(rs!=null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } rs=null; } } protected void closeAll(Connection con,PreparedStatement ps,ResultSet rs) { closeResultSet(rs); closePreparedStatement(ps); closeConnection(con); } protected void closeConnection(Connection con) { if(con!=null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(); } con=null; } } protected void closePreparedStatement(PreparedStatement ps) { if(ps!=null) { try { ps.close(); } catch (SQLException e) { e.printStackTrace(); } ps=null; } } public Map<String, StatementTemplate> getTemplateCache() { return templateCache; } public void setTemplateCache(Map<String, StatementTemplate> templateCache) { this.templateCache = templateCache; } public DynamicHibernateStatementBuilder getDynamicStatementBuilder() { return dynamicStatementBuilder; } public void setDynamicStatementBuilder( DynamicHibernateStatementBuilder dynamicStatementBuilder) { this.dynamicStatementBuilder = dynamicStatementBuilder; } }
[ "vip_y@foxmail.com" ]
vip_y@foxmail.com
1f7e328c060b97d8895a5d80acdf7806f296ace9
c0e065168dcb52ecdf50ac38c07f7a09b6e5a1ff
/app/src/main/java/com/vikrotvasylyshyn/purchaselist/presentation/bought/BoughtPurchaseModule.java
5db15715d44a500ad8109c352953241c2431a289
[]
no_license
ViktorVasylyshyn/PurchaseListTest
9780f337b22f7ffadbb31c290f6e4b95ede93360
445549d03864b75c240ea3f5e9dfc5689863341a
refs/heads/master
2021-01-08T06:13:44.154926
2020-02-28T15:07:33
2020-02-28T15:07:33
241,937,799
0
0
null
2020-02-24T10:25:31
2020-02-20T16:48:31
Java
UTF-8
Java
false
false
449
java
package com.vikrotvasylyshyn.purchaselist.presentation.bought; import dagger.Binds; import dagger.Module; import dagger.android.ContributesAndroidInjector; @Module public abstract class BoughtPurchaseModule { @ContributesAndroidInjector abstract BoughtPurchasesFragment contributeBoughtPurchasesFragment(); @Binds abstract BoughtPurchasesContract.Presenter providesBoughtPurchasesPresenter(BoughtPurchasesPresenter presenter); }
[ "viktorvasylyshyn.rzm@gmail.com" ]
viktorvasylyshyn.rzm@gmail.com
76f1f427d7a0075750226af375b04bd9801c8ab8
2daea090c54d11688b7e2f40fbeeda22fe3d01f6
/test/src/test/java/org/zstack/test/kvm/TestKvmMaintenanceMode2.java
b1a9c5ab16b3320500809ba8838e676aff0fac1e
[ "Apache-2.0" ]
permissive
jxg01713/zstack
1f0e474daa6ca4647d0481c7e44d86a860ac209c
182fb094e9a6ef89cf010583d457a9bf4f033f33
refs/heads/1.0.x
2021-06-20T12:36:16.609798
2016-03-17T08:03:29
2016-03-17T08:03:29
197,339,567
0
0
Apache-2.0
2021-03-19T20:23:19
2019-07-17T07:36:39
Java
UTF-8
Java
false
false
2,467
java
package org.zstack.test.kvm; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; import org.zstack.compute.host.HostGlobalConfig; import org.zstack.core.cloudbus.CloudBus; import org.zstack.core.componentloader.ComponentLoader; import org.zstack.core.db.DatabaseFacade; import org.zstack.header.host.HostInventory; import org.zstack.header.host.HostState; import org.zstack.header.identity.SessionInventory; import org.zstack.simulator.kvm.KVMSimulatorConfig; import org.zstack.test.Api; import org.zstack.test.ApiSenderException; import org.zstack.test.DBUtil; import org.zstack.test.WebBeanConstructor; import org.zstack.test.deployer.Deployer; import org.zstack.test.storage.backup.sftp.TestSftpBackupStorageDeleteImage2; import org.zstack.utils.Utils; import org.zstack.utils.logging.CLogger; import java.util.Arrays; /* * 3 vms on host1 * host1 enters maintenance mode * all vms migrate failed * all vms stop failed * ignore maintenance error set to true * result: host1 entered maintenance mode */ public class TestKvmMaintenanceMode2 { CLogger logger = Utils.getLogger(TestSftpBackupStorageDeleteImage2.class); Deployer deployer; Api api; ComponentLoader loader; CloudBus bus; DatabaseFacade dbf; SessionInventory session; KVMSimulatorConfig config; @Before public void setUp() throws Exception { DBUtil.reDeployDB(); WebBeanConstructor con = new WebBeanConstructor(); deployer = new Deployer("deployerXml/kvm/TestKvmMaintenance.xml", con); deployer.addSpringConfig("KVMRelated.xml"); deployer.build(); api = deployer.getApi(); loader = deployer.getComponentLoader(); bus = loader.getComponent(CloudBus.class); dbf = loader.getComponent(DatabaseFacade.class); config = loader.getComponent(KVMSimulatorConfig.class); session = api.loginAsAdmin(); } @Test public void test() throws ApiSenderException { HostInventory host1 = deployer.hosts.get("host1"); config.migrateVmSuccess = false; config.stopVmSuccess = false; HostGlobalConfig.IGNORE_ERROR_ON_MAINTENANCE_MODE.updateValue(true); api.maintainHost(host1.getUuid()); host1 = api.listHosts(Arrays.asList(host1.getUuid())).get(0); Assert.assertEquals(HostState.Maintenance.toString(), host1.getState()); } }
[ "xing5820@gmail.com" ]
xing5820@gmail.com
5a05425ab1e6c4fc6dcd5fcbc63647c687aed0a8
ee9a6a3d5eb3af4d36b889b75f930fd92241ae52
/essay/src/com/octest/entity/Article.java
d7a0b357735c4d7e9fe9e636d56ac3bb9e034492
[]
no_license
jeanjean91/testJEE
107f042791fb0ac4cec41c3db364d84f4a3bc7cd
9b7e892359d7f6f4a9d2a19b2d65d4e48f8a2351
refs/heads/master
2022-07-12T09:24:38.223276
2020-05-14T21:03:36
2020-05-14T21:03:36
264,022,932
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package com.octest.entity; public class Article { private int id; private String nom; private String image; private String description; private int prix; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNom() { return nom; } public void setNom(String nom) { this.nom = nom; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getPrix() { return prix; } public void setPrix(int prix) { this.prix = prix; } }
[ "jeandesir84@gmail.com" ]
jeandesir84@gmail.com
013db605acf05c0367efabec9ab9d3b6e0335025
3872463adac245ac6cbb9f574e6e86801d9cc694
/src/main/java/com/pedrod/workshopmongo/dto/AuthorDTO.java
3a58698cb814888c0f17f565aab602abe60c2210
[ "MIT" ]
permissive
backup-p/api-RESTFUL-java
2c5f1703a3ae62c51d35339f7f040bf9d9c3617b
d8861259959c710c07ab9f01188428303329f7e0
refs/heads/master
2022-04-14T03:20:23.166351
2020-04-13T14:18:31
2020-04-13T14:18:31
259,036,639
1
0
MIT
2020-04-26T13:24:42
2020-04-26T13:24:41
null
UTF-8
Java
false
false
569
java
package com.pedrod.workshopmongo.dto; import java.io.Serializable; import com.nelioalves.workshopmongo.domain.User; public class AuthorDTO implements Serializable { private static final long serialVersionUID = 1L; private String id; private String name; public AuthorDTO() { } public AuthorDTO(User obj) { id = obj.getId(); name = obj.getName(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "pedro.d.jardim@hotmail.com" ]
pedro.d.jardim@hotmail.com
9a5b5d38ebb2108c3c7eff3f9b1514af913df53d
349bb3e9713ddb9e57de4a9ce30392e97e9deeb8
/truth-android/src/main/java/com/pkware/truth/android/view/animation/TransformationSubject.java
8ac071784ea7d265d24ff1744563901a628fb95e
[ "Apache-2.0" ]
permissive
alapshin/truth-android
3e7075ae036c1238a66ae40c206ff5d449a5a17f
a7840e2e92f71513a0f8c37311cb1f011057089a
refs/heads/master
2020-03-29T12:18:18.054487
2016-11-27T22:04:18
2016-11-27T22:14:58
149,892,845
0
0
null
2018-09-22T16:04:14
2018-09-22T16:04:13
null
UTF-8
Java
false
false
3,052
java
/* * Copyright 2013 Square, Inc. * Copyright 2016 PKWARE, 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.pkware.truth.android.view.animation; import android.graphics.Matrix; import android.view.animation.Transformation; import com.google.common.truth.FailureStrategy; import com.google.common.truth.Subject; import com.google.common.truth.SubjectFactory; import static android.view.animation.Transformation.TYPE_ALPHA; import static android.view.animation.Transformation.TYPE_BOTH; import static android.view.animation.Transformation.TYPE_IDENTITY; import static android.view.animation.Transformation.TYPE_MATRIX; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assert_; import static com.pkware.truth.android.internal.IntegerUtils.buildNamedValueString; /** * Propositions for {@link Transformation} subjects. */ public class TransformationSubject extends Subject<TransformationSubject, Transformation> { protected TransformationSubject(FailureStrategy failureStrategy, Transformation subject) { super(failureStrategy, subject); } public static SubjectFactory<TransformationSubject, Transformation> type() { return new SubjectFactory<TransformationSubject, Transformation>() { @Override public TransformationSubject getSubject(FailureStrategy fs, Transformation that) { return new TransformationSubject(fs, that); } }; } public static String transformationTypeToString(@TransformationType int type) { return buildNamedValueString(type) .value(TYPE_ALPHA, "alpha") .value(TYPE_BOTH, "both") .value(TYPE_IDENTITY, "identity") .value(TYPE_MATRIX, "matrix") .get(); } public TransformationSubject hasAlpha(float alpha, float tolerance) { assertThat(actual().getAlpha()) .named("alpha") .isWithin(tolerance) .of(alpha); return this; } public TransformationSubject hasMatrix(Matrix matrix) { assertThat(actual().getMatrix()) .named("matrix") .isEqualTo(matrix); return this; } public TransformationSubject hasTransformationType(@TransformationType int type) { int actualType = actual().getTransformationType(); //noinspection ResourceType assert_() .withFailureMessage("Expected transformation type <%s> but was <%s>.", transformationTypeToString(type), transformationTypeToString(actualType)) .that(actualType) .isEqualTo(type); return this; } }
[ "Marius@volkhart.com" ]
Marius@volkhart.com
b2f46152af7b74559a1b09a157390d94fe2a49ff
88388166a3ac2a6defbf48f50395dc8dd25bb820
/android-health-data-example/HealthCheckApp/app/src/main/java/com/minsait/onesait/platform/android/healthcheckapp/MainHealthActivity.java
4e1dfbc84aabf96d4aa83378e915dbaedb7f4b00
[ "Apache-2.0" ]
permissive
evalinani/onesait-cloud-platform-examples
7caa405c09a94dbdc1ead2c145c23e090c835802
7b69e05d3f39261b97081b345df9b6e1823207f6
refs/heads/master
2023-05-14T12:50:37.241695
2020-06-11T10:27:26
2020-06-11T10:27:26
375,388,837
0
0
Apache-2.0
2021-06-09T14:42:38
2021-06-09T14:42:37
null
UTF-8
Java
false
false
3,916
java
/** * Copyright Indra Soluciones Tecnologรญas de la Informaciรณn, S.L.U. * 2013-2019 SPAIN * * 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.minsait.onesait.platform.android.healthcheckapp; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widget.Toast; import java.util.ArrayList; public class MainHealthActivity extends AppCompatActivity implements MainMenuAdapter.ListItemClickListener { private MainMenuAdapter mAdapter; private RecyclerView mItemsRV; private ArrayList<MainItem> mMainItemsArray = new ArrayList<>(); protected String mAccessToken = ""; protected String mUsername = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_health); mAccessToken = getIntent().getStringExtra("accessToken"); mUsername = getIntent().getStringExtra("username"); getSupportActionBar().setTitle(mUsername); loadMenuItems(); mItemsRV = (RecyclerView) findViewById(R.id.list_main); LinearLayoutManager layoutManager = new LinearLayoutManager(MainHealthActivity.this); mItemsRV.setLayoutManager(layoutManager); mItemsRV.setHasFixedSize(true); } @Override protected void onResume() { super.onResume(); mAdapter = new MainMenuAdapter(mMainItemsArray,this); mItemsRV.setAdapter(mAdapter); } private void loadMenuItems() { for(int i=0; i<3; i++){ mMainItemsArray.add(new MainItem()); } // mMainItemsArray.get(0).setDescription("Sensor"); //mMainItemsArray.get(0).setImageId(R.drawable.ic_bluetooth); mMainItemsArray.get(0).setDescription("FILL-IN FORM"); mMainItemsArray.get(0).setImageId(R.drawable.ic_003_forms); mMainItemsArray.get(1).setDescription("HISTORICAL DATA"); mMainItemsArray.get(1).setImageId(R.drawable.ic_002_graph); mMainItemsArray.get(2).setDescription("SPECIALIST'S FEEDBACK"); mMainItemsArray.get(2).setImageId(R.drawable.ic_syringe); } @Override public void onListItemClick(int clickedItemId) { Intent mIntent = null; switch(clickedItemId){ case -1: Toast.makeText(this, mAccessToken,Toast.LENGTH_SHORT).show(); break; case 0: mIntent = new Intent(MainHealthActivity.this,FormActivity.class); mIntent.putExtra("accessToken",mAccessToken); mIntent.putExtra("username",mUsername); startActivity(mIntent); break; case 1: mIntent = new Intent(MainHealthActivity.this,HistActivity.class); mIntent.putExtra("accessToken",mAccessToken); mIntent.putExtra("username",mUsername); startActivity(mIntent); break; case 2: mIntent = new Intent(MainHealthActivity.this,FeedbackActivity.class); mIntent.putExtra("accessToken",mAccessToken); mIntent.putExtra("username",mUsername); startActivity(mIntent); break; } } }
[ "danzig6661@gmail.com" ]
danzig6661@gmail.com
a8b5a8cf2b2079a4061eff80bcaba1df2a728307
a4cf846ee61c8d7f8bd584f2c1bb3c52fd71f694
/phase3/src/parsers/actonLexer.java
f562f2b17d0e612544d4bb358b32aa8ed277d3bc
[]
no_license
zahramo/Acton-Language-Compiler
8e4a9c3266b506eda309f6b6e86760b025bb9d9c
40a1a09f28ef4a92dd1bfca638713c3f3c981fb7
refs/heads/main
2023-08-10T14:55:07.298660
2021-09-14T19:49:17
2021-09-14T19:49:17
406,475,786
1
0
null
null
null
null
UTF-8
Java
false
false
13,478
java
// Generated from C:/Users/chamani/Desktop/phase 3/src/antlr\acton.g4 by ANTLR 4.7.2 package parsers; import main.ast.node.*; import main.ast.node.declaration.*; import main.ast.node.declaration.handler.*; import main.ast.node.statement.*; import main.ast.node.expression.*; import main.ast.node.expression.operators.*; import main.ast.node.expression.values.*; import main.ast.type.primitiveType.*; import main.ast.type.arrayType.*; import main.ast.type.actorType.*; import main.ast.type.*; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.TokenStream; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.misc.*; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class actonLexer extends Lexer { static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int INTVAL=1, STRINGVAL=2, TRUE=3, FALSE=4, INT=5, BOOLEAN=6, STRING=7, ACTOR=8, EXTENDS=9, ACTORVARS=10, KNOWNACTORS=11, INITIAL=12, MSGHANDLER=13, SENDER=14, SELF=15, MAIN=16, FOR=17, CONTINUE=18, BREAK=19, IF=20, ELSE=21, PRINT=22, LPAREN=23, RPAREN=24, LBRACE=25, RBRACE=26, LBRACKET=27, RBRACKET=28, COLON=29, SEMICOLON=30, COMMA=31, DOT=32, ASSIGN=33, EQ=34, NEQ=35, GT=36, LT=37, PLUSPLUS=38, MINUSMINUS=39, PLUS=40, MINUS=41, MULT=42, DIV=43, PERCENT=44, NOT=45, AND=46, OR=47, QUES=48, IDENTIFIER=49, COMMENT=50, WHITESPACE=51; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; public static String[] modeNames = { "DEFAULT_MODE" }; private static String[] makeRuleNames() { return new String[] { "INTVAL", "STRINGVAL", "TRUE", "FALSE", "INT", "BOOLEAN", "STRING", "ACTOR", "EXTENDS", "ACTORVARS", "KNOWNACTORS", "INITIAL", "MSGHANDLER", "SENDER", "SELF", "MAIN", "FOR", "CONTINUE", "BREAK", "IF", "ELSE", "PRINT", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "COLON", "SEMICOLON", "COMMA", "DOT", "ASSIGN", "EQ", "NEQ", "GT", "LT", "PLUSPLUS", "MINUSMINUS", "PLUS", "MINUS", "MULT", "DIV", "PERCENT", "NOT", "AND", "OR", "QUES", "IDENTIFIER", "COMMENT", "WHITESPACE" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, null, null, "'true'", "'false'", "'int'", "'boolean'", "'string'", "'actor'", "'extends'", "'actorvars'", "'knownactors'", "'initial'", "'msghandler'", "'sender'", "'self'", "'main'", "'for'", "'continue'", "'break'", "'if'", "'else'", "'print'", "'('", "')'", "'{'", "'}'", "'['", "']'", "':'", "';'", "','", "'.'", "'='", "'=='", "'!='", "'>'", "'<'", "'++'", "'--'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'&&'", "'||'", "'?'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, "INTVAL", "STRINGVAL", "TRUE", "FALSE", "INT", "BOOLEAN", "STRING", "ACTOR", "EXTENDS", "ACTORVARS", "KNOWNACTORS", "INITIAL", "MSGHANDLER", "SENDER", "SELF", "MAIN", "FOR", "CONTINUE", "BREAK", "IF", "ELSE", "PRINT", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "COLON", "SEMICOLON", "COMMA", "DOT", "ASSIGN", "EQ", "NEQ", "GT", "LT", "PLUSPLUS", "MINUSMINUS", "PLUS", "MINUS", "MULT", "DIV", "PERCENT", "NOT", "AND", "OR", "QUES", "IDENTIFIER", "COMMENT", "WHITESPACE" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** * @deprecated Use {@link #VOCABULARY} instead. */ @Deprecated public static final String[] tokenNames; static { tokenNames = new String[_SYMBOLIC_NAMES.length]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = VOCABULARY.getLiteralName(i); if (tokenNames[i] == null) { tokenNames[i] = VOCABULARY.getSymbolicName(i); } if (tokenNames[i] == null) { tokenNames[i] = "<INVALID>"; } } } @Override @Deprecated public String[] getTokenNames() { return tokenNames; } @Override public Vocabulary getVocabulary() { return VOCABULARY; } public actonLexer(CharStream input) { super(input); _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } @Override public String getGrammarFileName() { return "acton.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public String[] getChannelNames() { return channelNames; } @Override public String[] getModeNames() { return modeNames; } @Override public ATN getATN() { return _ATN; } public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\65\u0153\b\1\4\2"+ "\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+ "\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ "\t\64\3\2\3\2\7\2l\n\2\f\2\16\2o\13\2\3\2\5\2r\n\2\3\3\3\3\7\3v\n\3\f"+ "\3\16\3y\13\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6"+ "\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3"+ "\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3"+ "\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ "\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3"+ "\16\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3"+ "\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3"+ "\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3"+ "\24\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3"+ "\27\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3"+ "\36\3\37\3\37\3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3&\3&\3\'\3"+ "\'\3\'\3(\3(\3(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3/\3/\3/\3\60\3\60"+ "\3\60\3\61\3\61\3\62\3\62\7\62\u0140\n\62\f\62\16\62\u0143\13\62\3\63"+ "\3\63\3\63\3\63\7\63\u0149\n\63\f\63\16\63\u014c\13\63\3\63\3\63\3\64"+ "\3\64\3\64\3\64\2\2\65\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27"+ "\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33"+ "\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63"+ "e\64g\65\3\2\n\3\2\63;\3\2\62;\3\2\62\62\3\2$$\5\2C\\aac|\6\2\62;C\\a"+ "ac|\4\2\f\f\17\17\5\2\13\f\17\17\"\"\2\u0157\2\3\3\2\2\2\2\5\3\2\2\2\2"+ "\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2"+ "\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2"+ "\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2"+ "\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2"+ "\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2"+ "\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2"+ "M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3"+ "\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2"+ "\2\2g\3\2\2\2\3q\3\2\2\2\5s\3\2\2\2\7|\3\2\2\2\t\u0081\3\2\2\2\13\u0087"+ "\3\2\2\2\r\u008b\3\2\2\2\17\u0093\3\2\2\2\21\u009a\3\2\2\2\23\u00a0\3"+ "\2\2\2\25\u00a8\3\2\2\2\27\u00b2\3\2\2\2\31\u00be\3\2\2\2\33\u00c6\3\2"+ "\2\2\35\u00d1\3\2\2\2\37\u00d8\3\2\2\2!\u00dd\3\2\2\2#\u00e2\3\2\2\2%"+ "\u00e6\3\2\2\2\'\u00ef\3\2\2\2)\u00f5\3\2\2\2+\u00f8\3\2\2\2-\u00fd\3"+ "\2\2\2/\u0103\3\2\2\2\61\u0105\3\2\2\2\63\u0107\3\2\2\2\65\u0109\3\2\2"+ "\2\67\u010b\3\2\2\29\u010d\3\2\2\2;\u010f\3\2\2\2=\u0111\3\2\2\2?\u0113"+ "\3\2\2\2A\u0115\3\2\2\2C\u0117\3\2\2\2E\u0119\3\2\2\2G\u011c\3\2\2\2I"+ "\u011f\3\2\2\2K\u0121\3\2\2\2M\u0123\3\2\2\2O\u0126\3\2\2\2Q\u0129\3\2"+ "\2\2S\u012b\3\2\2\2U\u012d\3\2\2\2W\u012f\3\2\2\2Y\u0131\3\2\2\2[\u0133"+ "\3\2\2\2]\u0135\3\2\2\2_\u0138\3\2\2\2a\u013b\3\2\2\2c\u013d\3\2\2\2e"+ "\u0144\3\2\2\2g\u014f\3\2\2\2im\t\2\2\2jl\t\3\2\2kj\3\2\2\2lo\3\2\2\2"+ "mk\3\2\2\2mn\3\2\2\2nr\3\2\2\2om\3\2\2\2pr\t\4\2\2qi\3\2\2\2qp\3\2\2\2"+ "r\4\3\2\2\2sw\7$\2\2tv\n\5\2\2ut\3\2\2\2vy\3\2\2\2wu\3\2\2\2wx\3\2\2\2"+ "xz\3\2\2\2yw\3\2\2\2z{\7$\2\2{\6\3\2\2\2|}\7v\2\2}~\7t\2\2~\177\7w\2\2"+ "\177\u0080\7g\2\2\u0080\b\3\2\2\2\u0081\u0082\7h\2\2\u0082\u0083\7c\2"+ "\2\u0083\u0084\7n\2\2\u0084\u0085\7u\2\2\u0085\u0086\7g\2\2\u0086\n\3"+ "\2\2\2\u0087\u0088\7k\2\2\u0088\u0089\7p\2\2\u0089\u008a\7v\2\2\u008a"+ "\f\3\2\2\2\u008b\u008c\7d\2\2\u008c\u008d\7q\2\2\u008d\u008e\7q\2\2\u008e"+ "\u008f\7n\2\2\u008f\u0090\7g\2\2\u0090\u0091\7c\2\2\u0091\u0092\7p\2\2"+ "\u0092\16\3\2\2\2\u0093\u0094\7u\2\2\u0094\u0095\7v\2\2\u0095\u0096\7"+ "t\2\2\u0096\u0097\7k\2\2\u0097\u0098\7p\2\2\u0098\u0099\7i\2\2\u0099\20"+ "\3\2\2\2\u009a\u009b\7c\2\2\u009b\u009c\7e\2\2\u009c\u009d\7v\2\2\u009d"+ "\u009e\7q\2\2\u009e\u009f\7t\2\2\u009f\22\3\2\2\2\u00a0\u00a1\7g\2\2\u00a1"+ "\u00a2\7z\2\2\u00a2\u00a3\7v\2\2\u00a3\u00a4\7g\2\2\u00a4\u00a5\7p\2\2"+ "\u00a5\u00a6\7f\2\2\u00a6\u00a7\7u\2\2\u00a7\24\3\2\2\2\u00a8\u00a9\7"+ "c\2\2\u00a9\u00aa\7e\2\2\u00aa\u00ab\7v\2\2\u00ab\u00ac\7q\2\2\u00ac\u00ad"+ "\7t\2\2\u00ad\u00ae\7x\2\2\u00ae\u00af\7c\2\2\u00af\u00b0\7t\2\2\u00b0"+ "\u00b1\7u\2\2\u00b1\26\3\2\2\2\u00b2\u00b3\7m\2\2\u00b3\u00b4\7p\2\2\u00b4"+ "\u00b5\7q\2\2\u00b5\u00b6\7y\2\2\u00b6\u00b7\7p\2\2\u00b7\u00b8\7c\2\2"+ "\u00b8\u00b9\7e\2\2\u00b9\u00ba\7v\2\2\u00ba\u00bb\7q\2\2\u00bb\u00bc"+ "\7t\2\2\u00bc\u00bd\7u\2\2\u00bd\30\3\2\2\2\u00be\u00bf\7k\2\2\u00bf\u00c0"+ "\7p\2\2\u00c0\u00c1\7k\2\2\u00c1\u00c2\7v\2\2\u00c2\u00c3\7k\2\2\u00c3"+ "\u00c4\7c\2\2\u00c4\u00c5\7n\2\2\u00c5\32\3\2\2\2\u00c6\u00c7\7o\2\2\u00c7"+ "\u00c8\7u\2\2\u00c8\u00c9\7i\2\2\u00c9\u00ca\7j\2\2\u00ca\u00cb\7c\2\2"+ "\u00cb\u00cc\7p\2\2\u00cc\u00cd\7f\2\2\u00cd\u00ce\7n\2\2\u00ce\u00cf"+ "\7g\2\2\u00cf\u00d0\7t\2\2\u00d0\34\3\2\2\2\u00d1\u00d2\7u\2\2\u00d2\u00d3"+ "\7g\2\2\u00d3\u00d4\7p\2\2\u00d4\u00d5\7f\2\2\u00d5\u00d6\7g\2\2\u00d6"+ "\u00d7\7t\2\2\u00d7\36\3\2\2\2\u00d8\u00d9\7u\2\2\u00d9\u00da\7g\2\2\u00da"+ "\u00db\7n\2\2\u00db\u00dc\7h\2\2\u00dc \3\2\2\2\u00dd\u00de\7o\2\2\u00de"+ "\u00df\7c\2\2\u00df\u00e0\7k\2\2\u00e0\u00e1\7p\2\2\u00e1\"\3\2\2\2\u00e2"+ "\u00e3\7h\2\2\u00e3\u00e4\7q\2\2\u00e4\u00e5\7t\2\2\u00e5$\3\2\2\2\u00e6"+ "\u00e7\7e\2\2\u00e7\u00e8\7q\2\2\u00e8\u00e9\7p\2\2\u00e9\u00ea\7v\2\2"+ "\u00ea\u00eb\7k\2\2\u00eb\u00ec\7p\2\2\u00ec\u00ed\7w\2\2\u00ed\u00ee"+ "\7g\2\2\u00ee&\3\2\2\2\u00ef\u00f0\7d\2\2\u00f0\u00f1\7t\2\2\u00f1\u00f2"+ "\7g\2\2\u00f2\u00f3\7c\2\2\u00f3\u00f4\7m\2\2\u00f4(\3\2\2\2\u00f5\u00f6"+ "\7k\2\2\u00f6\u00f7\7h\2\2\u00f7*\3\2\2\2\u00f8\u00f9\7g\2\2\u00f9\u00fa"+ "\7n\2\2\u00fa\u00fb\7u\2\2\u00fb\u00fc\7g\2\2\u00fc,\3\2\2\2\u00fd\u00fe"+ "\7r\2\2\u00fe\u00ff\7t\2\2\u00ff\u0100\7k\2\2\u0100\u0101\7p\2\2\u0101"+ "\u0102\7v\2\2\u0102.\3\2\2\2\u0103\u0104\7*\2\2\u0104\60\3\2\2\2\u0105"+ "\u0106\7+\2\2\u0106\62\3\2\2\2\u0107\u0108\7}\2\2\u0108\64\3\2\2\2\u0109"+ "\u010a\7\177\2\2\u010a\66\3\2\2\2\u010b\u010c\7]\2\2\u010c8\3\2\2\2\u010d"+ "\u010e\7_\2\2\u010e:\3\2\2\2\u010f\u0110\7<\2\2\u0110<\3\2\2\2\u0111\u0112"+ "\7=\2\2\u0112>\3\2\2\2\u0113\u0114\7.\2\2\u0114@\3\2\2\2\u0115\u0116\7"+ "\60\2\2\u0116B\3\2\2\2\u0117\u0118\7?\2\2\u0118D\3\2\2\2\u0119\u011a\7"+ "?\2\2\u011a\u011b\7?\2\2\u011bF\3\2\2\2\u011c\u011d\7#\2\2\u011d\u011e"+ "\7?\2\2\u011eH\3\2\2\2\u011f\u0120\7@\2\2\u0120J\3\2\2\2\u0121\u0122\7"+ ">\2\2\u0122L\3\2\2\2\u0123\u0124\7-\2\2\u0124\u0125\7-\2\2\u0125N\3\2"+ "\2\2\u0126\u0127\7/\2\2\u0127\u0128\7/\2\2\u0128P\3\2\2\2\u0129\u012a"+ "\7-\2\2\u012aR\3\2\2\2\u012b\u012c\7/\2\2\u012cT\3\2\2\2\u012d\u012e\7"+ ",\2\2\u012eV\3\2\2\2\u012f\u0130\7\61\2\2\u0130X\3\2\2\2\u0131\u0132\7"+ "\'\2\2\u0132Z\3\2\2\2\u0133\u0134\7#\2\2\u0134\\\3\2\2\2\u0135\u0136\7"+ "(\2\2\u0136\u0137\7(\2\2\u0137^\3\2\2\2\u0138\u0139\7~\2\2\u0139\u013a"+ "\7~\2\2\u013a`\3\2\2\2\u013b\u013c\7A\2\2\u013cb\3\2\2\2\u013d\u0141\t"+ "\6\2\2\u013e\u0140\t\7\2\2\u013f\u013e\3\2\2\2\u0140\u0143\3\2\2\2\u0141"+ "\u013f\3\2\2\2\u0141\u0142\3\2\2\2\u0142d\3\2\2\2\u0143\u0141\3\2\2\2"+ "\u0144\u0145\7\61\2\2\u0145\u0146\7\61\2\2\u0146\u014a\3\2\2\2\u0147\u0149"+ "\n\b\2\2\u0148\u0147\3\2\2\2\u0149\u014c\3\2\2\2\u014a\u0148\3\2\2\2\u014a"+ "\u014b\3\2\2\2\u014b\u014d\3\2\2\2\u014c\u014a\3\2\2\2\u014d\u014e\b\63"+ "\2\2\u014ef\3\2\2\2\u014f\u0150\t\t\2\2\u0150\u0151\3\2\2\2\u0151\u0152"+ "\b\64\2\2\u0152h\3\2\2\2\b\2mqw\u0141\u014a\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); } } }
[ "moosavizahra67@yahoo.com" ]
moosavizahra67@yahoo.com
7ddd2176c4643b6cf6c5d08ef2646c739e6fa9f3
4aad522e450f855457df204323beb41bc806f7b2
/app/src/main/java/com/mvpvolley/model/DataModel.java
15693d1da8d88a581f60b67d0678e05ada364515
[]
no_license
developerofnew/mvpVolley
2e5dd60663b1071474303648deb7c657dda50bfa
cdadc18cf61ae52eaa05afff288810bec8bde8fb
refs/heads/master
2020-04-14T18:58:47.402636
2019-01-04T02:02:31
2019-01-04T02:02:31
164,040,058
0
0
null
null
null
null
UTF-8
Java
false
false
3,647
java
package com.mvpvolley.model; import android.content.Context; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.mvpvolley.Mvp_Interface; import com.mvpvolley.presenter.ResponseInterfaceToPresenter; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; public class DataModel implements Mvp_Interface.Model { Context context; public DataModel( Context context) { this.context = context; } public void loadData(String url, final ResponseInterfaceToPresenter responseInterfaceToPresenter) { RequestQueue requestQueue = Volley.newRequestQueue(context); StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { responseInterfaceToPresenter.onSuccess(response); // Object json; // // try { // json = new JSONTokener(response).nextValue(); // // JSONObject jsonObject = (JSONObject)json; // // JSONArray jsonArray = jsonObject.getJSONArray("contacts"); // // for (int i = 0;i < jsonArray.length();i++){ // // // JSONObject c = jsonArray.getJSONObject(i); // // String name = c.getString("name"); // String email = c.getString("email"); // // JSONObject phone = c.getJSONObject("phone"); // // String mobile = phone.getString("mobile"); // // responseInterfaceToPresenter.onSuccess(mobile); // Toast.makeText(context, "mjmjjjj"+mobile, Toast.LENGTH_SHORT).show(); // list.add(new Pojo(name,email,mobile)); // HashMap<String,String> contactMap = new HashMap<>(); // // contactMap.put("name",name); // contactMap.put("email",email); // contactMap.put("mobile",mobile); // // // list.add(contactMap); // // } // // // // recyclerView.setAdapter(new MyAdapter(list,getApplicationContext())); // // } catch (JSONException e) { // e.printStackTrace(); // } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }); requestQueue.add(stringRequest); // // responseInterfaceToPresenter.onSuccess(response); // requestQueue = Volley.newRequestQueue(context); // StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { // @Override // public void onResponse(String response) { // // Toast.makeText(context, "new new new", Toast.LENGTH_SHORT).show(); // // // // // responseInterfaceToPresenter.onSucess(response); // // // } // }, new Response.ErrorListener() { // @Override // public void onErrorResponse(VolleyError error) { // // } // }); // // requestQueue.add(stringRequest); } @Override public void setData(String name, String password) { } }
[ "bino@Its-me.local" ]
bino@Its-me.local
7fd61c97d4c252bccbb6072f705faaa804ea39ef
ee7df6845d7bd4e0c427f3733f58fda223624719
/app/src/main/java/com/bsunk/esplight/data/model/LightModel.java
c58f6b604bd4d695ff94dfb3c1465817825aad76
[ "Apache-2.0" ]
permissive
BSunk/ESPModules
82123f82c08921046e973d4dd9c2b2f5da450776
1094217d90e3d5d599b82d87ea28e17e1239ae81
refs/heads/master
2021-04-29T10:05:37.534954
2017-04-12T22:48:51
2017-04-12T22:48:51
77,849,515
7
0
null
null
null
null
UTF-8
Java
false
false
3,173
java
package com.bsunk.esplight.data.model; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; /** * Created by Bharat on 12/28/2016. */ public class LightModel extends RealmObject { @PrimaryKey private String chipID; private String name; private String ip; private String port; private String mqttIP; private String mqttPort; private boolean power; private boolean connectionCheck; private int pattern; private String patternList; private int brightness; private int mqttStatus; private int solidColorR; private int solidColorG; private int solidColorB; private boolean eventIncomingCall; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public String getPort() { return port; } public void setPort(String port) { this.port = port; } public String getMqttIP() { return mqttIP; } public void setMqttIP(String mqttIP) { this.mqttIP = mqttIP; } public String getMqttPort() { return mqttPort; } public void setMqttPort(String mqttPort) { this.mqttPort = mqttPort; } public boolean getPower() { return power; } public void setPower(boolean power) { this.power = power; } public boolean getConnectionCheck() { return connectionCheck; } public void setConnectionCheck(boolean connectionCheck) { this.connectionCheck = connectionCheck; } public int getPattern() { return pattern; } public void setPattern(int pattern) { this.pattern = pattern; } public int getBrightness() { return brightness; } public void setBrightness(int brightness) { this.brightness = brightness; } public int getMqttStatus() { return mqttStatus; } public void setMqttStatus(int mqttStatus) { this.mqttStatus = mqttStatus; } public void setSolidColorR(int solidColorR) { this.solidColorR = solidColorR; } public int getSolidColorG() { return solidColorG; } public void setSolidColorG(int solidColorG) { this.solidColorG = solidColorG; } public int getSolidColorB() { return solidColorB; } public void setSolidColorB(int solidColorB) { this.solidColorB = solidColorB; } public int getSolidColorR() { return solidColorR; } public String getChipID() { return chipID; } public void setChipID(String chipID) { this.chipID = chipID; } public String getPatternList() { return patternList; } public void setPatternList(String patternList) { this.patternList = patternList; } public boolean isEventIncomingCall() { return eventIncomingCall; } public void setEventIncomingCall(boolean eventIncomingCall) { this.eventIncomingCall = eventIncomingCall; } }
[ "bharateffect@gmail.com" ]
bharateffect@gmail.com
7d1af286639e0b64c9ef50f6d331c52a6da2f55d
79c69fc1bf75f83ad2eeee9376bbfc15166d4b25
/src/main/java/com/invensoft/security/service/AuthenticationService.java
c9a3ccfd8025e95487fdb0693094f4c236a3e252
[]
no_license
danamo89/invensoft
f222942c95189f9069ae5c6a0ae94d84907b6954
b9c80aff3566ea90fbf4f44ab81b47f9c59f5172
refs/heads/master
2020-04-12T05:40:12.491795
2016-09-05T22:59:37
2016-09-05T22:59:37
65,638,438
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.invensoft.security.service; /** * * @author David */ public interface AuthenticationService { boolean login(String username, String password); void logout(); }
[ "David@David" ]
David@David