blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
ebc6a770e44fee8bb6d97b963a9f80fb9a42d4e9
a0b5c5a3b24ae2296620e39de41eb4ee26302bc5
/src/java/org/lucidcentral/_2007/ds/LabelText.java
a391888d43f4228113b02a4f14a9424b7fb2f530
[]
no_license
AtlasOfLivingAustralia/ala-keys
e75b8d002a1ddf337b0f9e0962c2862c28a7d21a
3edce1ab0751881559f519450a3ba805154a054e
refs/heads/master
2016-09-06T13:41:18.300716
2015-07-07T04:45:58
2015-07-07T04:45:58
27,800,677
0
0
null
null
null
null
UTF-8
Java
false
false
1,798
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.11.13 at 10:31:49 AM EST // package org.lucidcentral._2007.ds; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * human readable, language and audience specific label with role semantics * * <p>Java class for LabelText complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="LabelText"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.lucidcentral.org/2007/DS/>ShortStringText"> * &lt;attribute name="role" type="{http://www.lucidcentral.org/2007/DS/}LabelRoleEnum" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LabelText") public class LabelText extends ShortStringText { @XmlAttribute(name = "role") protected LabelRoleEnum role; /** * Gets the value of the role property. * * @return * possible object is * {@link LabelRoleEnum } * */ public LabelRoleEnum getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link LabelRoleEnum } * */ public void setRole(LabelRoleEnum value) { this.role = value; } }
[ "adam.collins832@gmail.com" ]
adam.collins832@gmail.com
28f354db14af09527598dab03744816cf0ba394e
768e6bb0d1df70f642b880ceb5c2191b7ad5e577
/android/app/src/main/java/com/example/blinkist/MainActivity.java
f62efba46a2274990367020fc15f7a608fce5eef
[]
no_license
hui00/blinkist_flutter_ui
1c3310823fd904986f41fa2324f733dbbb598899
e36a682dcc419dd35bb419b4e7cebd6e080165bd
refs/heads/master
2020-07-06T05:24:51.913982
2019-08-20T09:10:39
2019-08-20T09:10:39
202,905,722
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package com.example.blinkist; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
[ "kevinbrinkschulte@hotmail.de" ]
kevinbrinkschulte@hotmail.de
f3b5cb1bf29adde7f287a0df2544307d084a901a
0fae8e0c052744e8d1a05cc42818e73d15b756be
/PerfectReminderApp/app/src/main/java/com/example/perfectreminderapp/Reminder.java
ccb3ee99380734430b0bbaeaadb1b46a72f32999
[]
no_license
maneestha/PerfectReminder
d9d558299172c33dae00e0a6214f8fe1f049d296
fd7e79a9e05856e417478516ea9fda7aad11eb77
refs/heads/master
2020-05-18T19:21:30.939982
2019-05-02T15:37:15
2019-05-02T15:37:15
184,606,726
0
0
null
null
null
null
UTF-8
Java
false
false
2,886
java
package com.example.perfectreminderapp; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class Reminder extends AppCompatActivity { SQLiteDatabase db; DbHelper mDbHelper; ListView list; FloatingActionButton floatingActionButton; TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_reminder); getSupportActionBar().setTitle("Task Reminder"); getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.blue))); list=(ListView)findViewById(R.id.reminderlist); floatingActionButton = (FloatingActionButton)findViewById(R.id.btn_add); floatingActionButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Reminder.this, AddReminder.class ); startActivity(intent); } }); mDbHelper = new DbHelper(this); db= mDbHelper.getWritableDatabase(); String[] from = {mDbHelper.R_Type, mDbHelper.R_Date, mDbHelper.R_Time, mDbHelper.R_Notify,mDbHelper.R_Desc}; final String[] column = { mDbHelper.R_ID, mDbHelper.R_Type, mDbHelper.R_Date, mDbHelper.R_Time, mDbHelper.R_Notify, mDbHelper.R_Image, mDbHelper.R_Desc}; int [] to = {R.id.RType, R.id.Date, R.id.Time,R.id.Notify, R.id.Desc}; //Cursor cursor = db.rawQuery("Select * from Reminder", null); final Cursor cursor1= db.query(mDbHelper.Reminders,column,null,null,null,null,null); final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.list_reminder, cursor1, from, to, 0); list.setAdapter(adapter); list.setOnItemClickListener(new AdapterView.OnItemClickListener(){ public void onItemClick(AdapterView<?> listView, View view, int position, long id){ Intent intent = new Intent(Reminder.this, viewreminder.class); intent.putExtra(getString(R.string.rodId), id); startActivity(intent); } }); } @Override public void onBackPressed(){ Intent openMainScreen = new Intent(Reminder.this, MainActivity.class); openMainScreen.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(openMainScreen); } }
[ "maneesmanish@gmail.com" ]
maneesmanish@gmail.com
1357ad5f86b208c61e84341f15f6a665efc66835
51cdaea3b7627cd471866e0dfd621e3aee173c08
/project/src/main/java/com/alejandro/project/dao/ServicioDaoImpl.java
d91a331638f886b098b3bae50ca9065404691f31
[]
no_license
Blazotaker/javareactivoparte2
b16fd37834cdb84726f1229be5c1a984506d8f17
031863d405351b43dc2df6a06c5eb6bf47b1782e
refs/heads/master
2022-12-26T13:24:38.704732
2020-09-29T03:52:47
2020-09-29T03:52:47
299,498,757
0
0
null
null
null
null
UTF-8
Java
false
false
442
java
package com.alejandro.project.dao; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; @Repository public class clienteDaoImpl implements IClienteDao { private JdbcTemplate jdbcTemplate; private NamedParameterJdbcTemplate namedParameterJdbcTemplate; @Override public void agregarHoras() { } }
[ "josealejandro221@gmail.com" ]
josealejandro221@gmail.com
67fc67fee1ea7033fad4175e59732ebd1cf99807
bec80dff765ddb77efc3c15886e262f084bafa5a
/webDemo/common/src/main/java/com/mystudy/web/common/amqp/MqSend.java
3b65aad8ec98953b7f670281eeeb05d38b087259
[]
no_license
azrael1911/myStudy
80b9a2d1cd44c67eae376cfc534e7bdc1e2c86e0
bef061cf154abab3298b99d34398b5e4a253ce85
refs/heads/master
2020-12-02T07:46:41.264657
2016-05-26T10:04:02
2016-05-26T10:04:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,801
java
package com.mystudy.web.common.amqp; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.MessageProperties; import java.io.IOException; import java.util.concurrent.TimeoutException; /** * Created by 程祥 on 16/5/6. * Function: */ public class MqSend { private final static String QUEUE_NAME = "hello"; private static final String TASK_QUEUE_NAME = "task_queue"; private final static String EXCHANGE_NAME="logs"; public static void main(String[] args){ MqSend send = new MqSend(); send.testExchangeSend(); } private void testExchangeSend(){ try { Connection connection = getConnection(); Channel channel = connection.createChannel(); channel.exchangeDeclare(EXCHANGE_NAME, "fanout"); String message = "getMessage(argv) aa exchange"; channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes()); // System.out.println(" [x] Sent '" + message + "'"); channel.close(); connection.close(); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } } private void taskSend(){ try { Connection connection = getConnection(); Channel channel = connection.createChannel(); channel.queueDeclare(TASK_QUEUE_NAME, true, false, false, null); for (int i=0;i<100;i++){ String message = "getMessage(argv) hello task ~"+i; channel.basicPublish( "", TASK_QUEUE_NAME, MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes()); } // System.out.println(" [x] Sent '" + message + "'"); channel.close(); connection.close(); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } } public void testSend(){ Connection conn =null; Channel channel = null; try { conn = getConnection(); channel = conn.createChannel(); channel.queueDeclare(QUEUE_NAME, false, false, false, null); // channel.exchangeDeclare(EXCHANGE_NAME, "direct",true);//fanout direct // String queueName = channel.queueDeclare().getQueue(); // channel.queueBind(queueName, EXCHANGE_NAME, "routingKey"); byte[] messageBodyBytes = ("Hello, world!"+System.currentTimeMillis()).getBytes(); channel.basicPublish("", QUEUE_NAME, null, messageBodyBytes); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); }finally { try { if(channel!=null){ channel.close(); } if(conn!=null){ conn.close(); } } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } } } private Connection getConnection() throws IOException, TimeoutException { ConnectionFactory factory = new ConnectionFactory(); factory.setUsername("m_test"); factory.setPassword("nopass.2"); factory.setVirtualHost("hoset_test"); factory.setHost("192.168.9.92"); factory.setPort(5672); factory.setConnectionTimeout(10000); // factory.sets Connection connection = factory.newConnection(); return connection; } }
[ "308695548@qq.com" ]
308695548@qq.com
21b0e40a5450dcfa01429a9b1b859f8acc15dbdc
06cc73cf45533244af2980323a043452be0e7cb6
/src/test/java/stepdefinition/hooks.java
71d9320a5a8e1d6e7a3c10d68dfc52557ba1c6ae
[]
no_license
laxmi81/Redfin.com1
e94e4bf9d57653e1a002ea2ac7cc53a7989efb28
72ea062ba1bdcb7a8ad5884070a77c84bac192d7
refs/heads/master
2022-12-08T01:21:03.040301
2020-09-02T20:38:37
2020-09-02T20:38:37
292,389,740
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package stepdefinition; import java.util.concurrent.TimeUnit; import org.openqa.selenium.chrome.ChromeDriver; import cucumber.api.java.After; import cucumber.api.java.Before; import io.github.bonigarcia.wdm.WebDriverManager; public class hooks { private com.framework.utilities.TestBase base; public hooks(com.framework.utilities.TestBase base) { this.base = base; } @Before public void initDriver() { System.out.println("Open browser"); //System.setProperty("webdriver.chrome.driver", "lib/chromedriver 3"); WebDriverManager.chromedriver().setup(); com.framework.utilities.TestBase.driver = new ChromeDriver(); com.framework.utilities.TestBase.driver.manage().window().maximize(); com.framework.utilities.TestBase.driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); } @After public void teardown() { System.out.println("Close browser"); com.framework.utilities.TestBase.driver.quit(); } }
[ "l81rajput@gmail.com" ]
l81rajput@gmail.com
fcc21aca7cba58af0404cb5c88ab0e9f4ec55a36
f1a2abcfdfcc8f4b7e20a00e68dcb54f6e9e0d5e
/lostandfound/src/main/java/edu/njxz/lostandfound/entity/CommentExample.java
d56bb97e0af74e9d1f4d37e97b5369ac95d9cb59
[]
no_license
zhouweiwei18/lostandfound
f8b0c183af10b8d6a4d9913d789d343a54de9563
960dac00a56e28768fee17c59f81a6d739b6ea7b
refs/heads/master
2020-04-07T15:50:02.224794
2018-12-26T02:57:30
2018-12-26T02:57:30
158,502,997
0
1
null
2018-11-23T03:51:34
2018-11-21T06:44:18
Java
UTF-8
Java
false
false
20,866
java
package edu.njxz.lostandfound.entity; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; public class CommentExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public CommentExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } protected void addCriterionForJDBCDate(String condition, Date value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value.getTime()), property); } protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); } List<java.sql.Date> dateList = new ArrayList<java.sql.Date>(); Iterator<Date> iter = values.iterator(); while (iter.hasNext()) { dateList.add(new java.sql.Date(iter.next().getTime())); } addCriterion(condition, dateList, property); } protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); } public Criteria andCommentIdIsNull() { addCriterion("comment_id is null"); return (Criteria) this; } public Criteria andCommentIdIsNotNull() { addCriterion("comment_id is not null"); return (Criteria) this; } public Criteria andCommentIdEqualTo(Integer value) { addCriterion("comment_id =", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdNotEqualTo(Integer value) { addCriterion("comment_id <>", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdGreaterThan(Integer value) { addCriterion("comment_id >", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdGreaterThanOrEqualTo(Integer value) { addCriterion("comment_id >=", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdLessThan(Integer value) { addCriterion("comment_id <", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdLessThanOrEqualTo(Integer value) { addCriterion("comment_id <=", value, "commentId"); return (Criteria) this; } public Criteria andCommentIdIn(List<Integer> values) { addCriterion("comment_id in", values, "commentId"); return (Criteria) this; } public Criteria andCommentIdNotIn(List<Integer> values) { addCriterion("comment_id not in", values, "commentId"); return (Criteria) this; } public Criteria andCommentIdBetween(Integer value1, Integer value2) { addCriterion("comment_id between", value1, value2, "commentId"); return (Criteria) this; } public Criteria andCommentIdNotBetween(Integer value1, Integer value2) { addCriterion("comment_id not between", value1, value2, "commentId"); return (Criteria) this; } public Criteria andCommentContentIsNull() { addCriterion("comment_content is null"); return (Criteria) this; } public Criteria andCommentContentIsNotNull() { addCriterion("comment_content is not null"); return (Criteria) this; } public Criteria andCommentContentEqualTo(String value) { addCriterion("comment_content =", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentNotEqualTo(String value) { addCriterion("comment_content <>", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentGreaterThan(String value) { addCriterion("comment_content >", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentGreaterThanOrEqualTo(String value) { addCriterion("comment_content >=", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentLessThan(String value) { addCriterion("comment_content <", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentLessThanOrEqualTo(String value) { addCriterion("comment_content <=", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentLike(String value) { addCriterion("comment_content like", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentNotLike(String value) { addCriterion("comment_content not like", value, "commentContent"); return (Criteria) this; } public Criteria andCommentContentIn(List<String> values) { addCriterion("comment_content in", values, "commentContent"); return (Criteria) this; } public Criteria andCommentContentNotIn(List<String> values) { addCriterion("comment_content not in", values, "commentContent"); return (Criteria) this; } public Criteria andCommentContentBetween(String value1, String value2) { addCriterion("comment_content between", value1, value2, "commentContent"); return (Criteria) this; } public Criteria andCommentContentNotBetween(String value1, String value2) { addCriterion("comment_content not between", value1, value2, "commentContent"); return (Criteria) this; } public Criteria andCommentUseridIsNull() { addCriterion("comment_userId is null"); return (Criteria) this; } public Criteria andCommentUseridIsNotNull() { addCriterion("comment_userId is not null"); return (Criteria) this; } public Criteria andCommentUseridEqualTo(String value) { addCriterion("comment_userId =", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridNotEqualTo(String value) { addCriterion("comment_userId <>", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridGreaterThan(String value) { addCriterion("comment_userId >", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridGreaterThanOrEqualTo(String value) { addCriterion("comment_userId >=", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridLessThan(String value) { addCriterion("comment_userId <", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridLessThanOrEqualTo(String value) { addCriterion("comment_userId <=", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridLike(String value) { addCriterion("comment_userId like", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridNotLike(String value) { addCriterion("comment_userId not like", value, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridIn(List<String> values) { addCriterion("comment_userId in", values, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridNotIn(List<String> values) { addCriterion("comment_userId not in", values, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridBetween(String value1, String value2) { addCriterion("comment_userId between", value1, value2, "commentUserid"); return (Criteria) this; } public Criteria andCommentUseridNotBetween(String value1, String value2) { addCriterion("comment_userId not between", value1, value2, "commentUserid"); return (Criteria) this; } public Criteria andCommentMessageidIsNull() { addCriterion("comment_messageId is null"); return (Criteria) this; } public Criteria andCommentMessageidIsNotNull() { addCriterion("comment_messageId is not null"); return (Criteria) this; } public Criteria andCommentMessageidEqualTo(Integer value) { addCriterion("comment_messageId =", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidNotEqualTo(Integer value) { addCriterion("comment_messageId <>", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidGreaterThan(Integer value) { addCriterion("comment_messageId >", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidGreaterThanOrEqualTo(Integer value) { addCriterion("comment_messageId >=", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidLessThan(Integer value) { addCriterion("comment_messageId <", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidLessThanOrEqualTo(Integer value) { addCriterion("comment_messageId <=", value, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidIn(List<Integer> values) { addCriterion("comment_messageId in", values, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidNotIn(List<Integer> values) { addCriterion("comment_messageId not in", values, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidBetween(Integer value1, Integer value2) { addCriterion("comment_messageId between", value1, value2, "commentMessageid"); return (Criteria) this; } public Criteria andCommentMessageidNotBetween(Integer value1, Integer value2) { addCriterion("comment_messageId not between", value1, value2, "commentMessageid"); return (Criteria) this; } public Criteria andCommentDateIsNull() { addCriterion("comment_date is null"); return (Criteria) this; } public Criteria andCommentDateIsNotNull() { addCriterion("comment_date is not null"); return (Criteria) this; } public Criteria andCommentDateEqualTo(Date value) { addCriterionForJDBCDate("comment_date =", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateNotEqualTo(Date value) { addCriterionForJDBCDate("comment_date <>", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateGreaterThan(Date value) { addCriterionForJDBCDate("comment_date >", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("comment_date >=", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateLessThan(Date value) { addCriterionForJDBCDate("comment_date <", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("comment_date <=", value, "commentDate"); return (Criteria) this; } public Criteria andCommentDateIn(List<Date> values) { addCriterionForJDBCDate("comment_date in", values, "commentDate"); return (Criteria) this; } public Criteria andCommentDateNotIn(List<Date> values) { addCriterionForJDBCDate("comment_date not in", values, "commentDate"); return (Criteria) this; } public Criteria andCommentDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("comment_date between", value1, value2, "commentDate"); return (Criteria) this; } public Criteria andCommentDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("comment_date not between", value1, value2, "commentDate"); return (Criteria) this; } public Criteria andCommentSubmitCountIsNull() { addCriterion("comment_submit_count is null"); return (Criteria) this; } public Criteria andCommentSubmitCountIsNotNull() { addCriterion("comment_submit_count is not null"); return (Criteria) this; } public Criteria andCommentSubmitCountEqualTo(Integer value) { addCriterion("comment_submit_count =", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountNotEqualTo(Integer value) { addCriterion("comment_submit_count <>", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountGreaterThan(Integer value) { addCriterion("comment_submit_count >", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountGreaterThanOrEqualTo(Integer value) { addCriterion("comment_submit_count >=", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountLessThan(Integer value) { addCriterion("comment_submit_count <", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountLessThanOrEqualTo(Integer value) { addCriterion("comment_submit_count <=", value, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountIn(List<Integer> values) { addCriterion("comment_submit_count in", values, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountNotIn(List<Integer> values) { addCriterion("comment_submit_count not in", values, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountBetween(Integer value1, Integer value2) { addCriterion("comment_submit_count between", value1, value2, "commentSubmitCount"); return (Criteria) this; } public Criteria andCommentSubmitCountNotBetween(Integer value1, Integer value2) { addCriterion("comment_submit_count not between", value1, value2, "commentSubmitCount"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "15950507893@163.com" ]
15950507893@163.com
6eb084fe533d1661e938c76f4a6760521cc9bc08
8be29d4602f2d36b0f78d62c95c90b4c7286da49
/src/main/java/Domain/User/Interfaces/IDeckRepository.java
977a422d2a3b34be6f7b07b0f1c098086e8de0c1
[]
no_license
lukashofbauer99/MTCG
5cbee796b95f618216deecdeb5861638d4cc1b2a
bf935c35833d06a7177b06dcd36082e292f80532
refs/heads/main
2023-02-15T00:38:45.587336
2021-01-07T22:47:10
2021-01-07T22:47:10
304,936,468
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package Domain.User.Interfaces; import Domain.IRepository; import Model.User.Deck; public interface IDeckRepository extends IRepository<Deck, Long> { Deck findDeckOfUser(String Username); }
[ "if20b274@technikum-wien.at" ]
if20b274@technikum-wien.at
79e6deadc86927f5b121d1b1ba8a23409d69fd45
7783074547110b095ea77241aac0f810aeca1214
/Servlet/TestServlet.java
5388617017e2c55767caadb7da8076cf2ee9a836
[]
no_license
satvinder-panesar/Java
211fe445dceb1deeef35a1c428ec485b46cc7678
aa1d8b7340577b5c413f9ae1f22116ee42e00d9d
refs/heads/master
2018-12-20T15:34:04.959274
2018-09-17T19:27:37
2018-09-17T19:27:37
116,465,708
0
0
null
null
null
null
UTF-8
Java
false
false
988
java
// Import required java libraries import java.io.*; import javax.servlet.*; import javax.servlet.http.*; // Extend HttpServlet class public class TestServlet extends HttpServlet { public void init() throws ServletException { } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Set response content type response.setContentType("text/html"); //response.setIntHeader("Refresh",5); String name = request.getParameter("name"); Cookie username = new Cookie("username", request.getParameter("name")); username.setMaxAge(60*60*24); response.addCookie(username); // Actual logic goes here. PrintWriter out = response.getWriter(); out.println("<center><h1> Servlet response -- Welcome " + name + "</h1></center>"); //response.sendRedirect("http://www.google.com"); } public void destroy() { // do nothing. } }
[ "panesar.satvindersingh@gmail.com" ]
panesar.satvindersingh@gmail.com
50a8be5b1c354968c38379e29eb11a38b51f3ee6
4af851c330f2340547922b2cd68697818af6949c
/app/src/main/java/guoShubang/DialogUtils.java
e1dea3c90302ba7250c227bc83624dbc7d528f7f
[]
no_license
duboAndroid/MyDialog
9651f09816afda3cc27982b9bb4156ea6b25ab92
428d0797c9121967f157d0dc1ddaf6ee574bdda6
refs/heads/master
2021-01-22T09:26:32.798771
2017-08-12T01:36:13
2017-08-12T01:36:13
100,022,892
0
0
null
null
null
null
UTF-8
Java
false
false
6,901
java
package guoShubang; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.widget.RelativeLayout; import android.widget.TextView; import dub.mydialog.R; /** * 对话框工具类 */ public class DialogUtils { /** * 普通对话框 * * @param message * @param listener * @return */ public static AlertDialog showNormalDialog(Context context, String message, DialogInterface.OnClickListener listener) { final AlertDialog.Builder builder = new AlertDialog.Builder(context); // builder.setIcon(R.mipmap.ic_launcher); // builder.setTitle("温馨提示"); builder.setMessage(message); builder.setCancelable(false);//外部不可点击 builder.setPositiveButton("确定", listener); builder.setNegativeButton("关闭", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); AlertDialog alertDialog = builder.create(); // 显示 alertDialog.show(); return alertDialog; } /** * 普通对话框只有一个按钮 * * @param message * @return */ public static void showDialog(Context context, String message) { final AlertDialog.Builder builder = new AlertDialog.Builder(context); // builder.setIcon(R.mipmap.ic_launcher); // builder.setTitle("温馨提示"); builder.setMessage(message); builder.setCancelable(false);//外部不可点击 builder.setNegativeButton("返回", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); AlertDialog alertDialog = builder.create(); // 显示 alertDialog.show(); } /** * 普通对话框只有一个按钮 * * @return */ public static void showDialogSingle(Context context, int resId, DialogInterface.OnClickListener listener) { final AlertDialog.Builder builder = new AlertDialog.Builder(context); // builder.setIcon(R.mipmap.ic_launcher); // builder.setTitle("温馨提示"); builder.setMessage(resId); builder.setCancelable(false);//外部不可点击 builder.setNegativeButton("返回", listener); AlertDialog alertDialog = builder.create(); // 显示 alertDialog.show(); } /** * 提示是否登陆对话框 * * @return */ public static AlertDialog loginDialog(final Activity activity) { final AlertDialog.Builder builder = new AlertDialog.Builder(activity); // builder.setIcon(R.mipmap.ic_launcher); // builder.setTitle("温馨提示"); builder.setMessage("您当前未登录,是否要登陆?"); builder.setCancelable(false);//外部不可点击 builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //跳转到登陆界面 //ActivityJump.startActivity(activity, LoginActivity.class); } }); builder.setNegativeButton("关闭", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); AlertDialog alertDialog = builder.create(); // 显示 alertDialog.show(); return alertDialog; } /** * 等待动画 * * @return */ public static Dialog loadingDialog(Context context, String text) { View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null); TextView tv = (TextView) view.findViewById(R.id.tv_more); tv.setText(text); Dialog dialog = new Dialog(context, R.style.loading_Dialog); dialog.setContentView(view); dialog.setCancelable(false); return dialog; } //下方显示对话框 public static Dialog downDialog(Activity context, View view) { Dialog dialog = new Dialog(context, R.style.transparentFrameWindowStyle); dialog.setContentView(view, new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT)); Window window = dialog.getWindow(); window.setWindowAnimations(R.style.main_menu_animstyle);// 设置显示动画 WindowManager.LayoutParams wl = window.getAttributes(); wl.x = 0; wl.y = context.getWindowManager().getDefaultDisplay().getHeight(); // 以下这两句是为了保证按钮可以水平满屏 wl.width = ViewGroup.LayoutParams.MATCH_PARENT; wl.height = ViewGroup.LayoutParams.WRAP_CONTENT; dialog.onWindowAttributesChanged(wl);// 设置显示位置 dialog.setCanceledOnTouchOutside(false);// 设置点击外围解散 return dialog; } //无网络对话框 public static Dialog noNetworkDialog(final Context context) { View view = LayoutInflater.from(context).inflate(R.layout.dialog_no_network, null); final Dialog dialog = new Dialog(context); dialog.setContentView(view); dialog.setCancelable(false); TextView more = (TextView) view.findViewById(R.id.tv_more); more.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isNetworkConnected(context)){ dialog.dismiss(); }else { dialog.show(); //ToastUtils.getInstance().toast("网络连接失败,请检查网络"); } } }); if (isNetworkConnected(context)){ dialog.dismiss(); }else { dialog.show(); //ToastUtils.getInstance().toast("网络连接失败,请检查网络"); } return dialog; } public static boolean isNetworkConnected(Context context) { if (context != null) { ConnectivityManager mConnectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo(); if (mNetworkInfo != null) { return mNetworkInfo.isAvailable(); } } return false; } }
[ "277627117@qq.com" ]
277627117@qq.com
2745609481470ee434f0f6f796a2ff72e8baffb3
a46db40b85a20963f9e9bd5512f0458d0bb08e03
/app/src/main/java/com/example/slidingimagewithsearch/Carousel.java
b1ce3c3f4e859659cd9fd2db46a908b97446deb0
[]
no_license
ravishankar518/SlidingImage
866d76e8b7472e2f5fbf10dfea652844855ac30f
3fb1e61c0ddc674e53709ed8df45126cf4f65e3e
refs/heads/master
2023-07-10T03:47:07.553435
2021-08-06T12:54:35
2021-08-06T12:54:35
393,376,937
0
0
null
null
null
null
UTF-8
Java
false
false
616
java
package com.example.slidingimagewithsearch; import java.util.ArrayList; public class Carousel { private String image; private ArrayList<Student> students; public Carousel(String image, ArrayList<Student> students) { this.image = image; this.students = students; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public ArrayList<Student> getStudents() { return students; } public void setStudents(ArrayList<Student> students) { this.students = students; } }
[ "54094766+Ravishankar412@users.noreply.github.com" ]
54094766+Ravishankar412@users.noreply.github.com
32aac8658c152a6d67f3f0ecc0ce2a0a1d98a81c
ff27196ffddc9937a74215daa24da0af0e398a65
/repository/server/src/main/java/org/outerj/daisy/httpconnector/handlers/CollectionByNameHandler.java
eb7f619e3eebdb56501bb8a64092b64ff9dcebdb
[ "Apache-2.0" ]
permissive
stevekaeser/daisycms
ac3a9cc7e6f2c0d46c8938f01eba63ea41569eaa
e772652c98742dbdb5268a9516a6ae210b9b4348
refs/heads/master
2023-03-08T10:14:43.600368
2022-03-16T16:42:29
2022-03-16T16:42:29
250,640,483
0
3
Apache-2.0
2023-02-22T00:15:26
2020-03-27T20:32:37
Java
UTF-8
Java
false
false
1,746
java
/* * Copyright 2004 Outerthought bvba and Schaubroeck nv * * 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.outerj.daisy.httpconnector.handlers; import org.outerj.daisy.repository.Repository; import org.outerj.daisy.repository.DocumentCollection; import org.outerj.daisy.util.HttpConstants; import org.outerj.daisy.httpconnector.spi.RequestHandlerSupport; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; public class CollectionByNameHandler extends AbstractRepositoryRequestHandler { public String getPathPattern() { return "/collectionByName/*"; } public void handleRequest(Map matchMap, HttpServletRequest request, HttpServletResponse response, Repository repository, RequestHandlerSupport support) throws Exception { String name = (String)matchMap.get("1"); if (request.getMethod().equals(HttpConstants.GET)) { DocumentCollection documentCollection = repository.getCollectionManager().getCollectionByName(name, false); documentCollection.getXml().save(response.getOutputStream()); } else { response.sendError(HttpConstants._405_Method_Not_Allowed); } } }
[ "stevek@ngdata.com" ]
stevek@ngdata.com
106cde62a501cc72047188917d1d80939dffd77a
0366f7ddaadfb1941fed3580481e0418c3edbe6c
/src/main/com/stinted/excel/Excel.java
b51474ec07def701173ab7c69144c22b00490f6e
[ "Apache-2.0" ]
permissive
rafaelvanat/ExcelPojos
efcb9274e8ce4c57ebe41419d25da73ae62b5a21
e76afe965307c4816bf7ebfef3960339a0a279d5
refs/heads/master
2021-01-16T20:25:22.268645
2015-04-27T16:49:23
2015-04-27T16:49:23
34,435,017
1
0
null
null
null
null
UTF-8
Java
false
false
6,626
java
package com.stinted.excel; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import lombok.Getter; import lombok.extern.log4j.Log4j; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import com.stinted.reflection.ClassMapper; import com.stinted.util.StringUtil; @Log4j public class Excel { @Getter private final ClassMapper classMapper = new ClassMapper(); @Getter private List<String> fieldNames = new ArrayList<String>(); @Getter private ExcelWorkbook workbook = null; /** * Cria objeto Excel para ler dados e escrevê-los em planilha Excel. * Gera objeto File, ou seja, se não existir o arquivo cria-o. * O nome do arquivo vem do parâmetro workbookName * IMPORTANTE: Não esqueça de invocar o método close! * @param workbookName String * @return excel Excel * @throws InvalidFormatException * @throws IOException */ public Excel(String workbookName) throws InvalidFormatException, IOException { this.workbook = new ExcelWorkbook(workbookName); new File(workbookName); } /** * Lê arquivo EXCEL, sendo que encontra a planilha certa para o objeto pelo ClassName. * Exemplo: quero ler uma planilha para carregar um objeto da classe com.totvs.fluig.User, logo * a planilha no arquivo deverá ter o nome com.totvs.fluig.User. * @param className String * @return objectList List<T> * @throws Exception */ public <T> List<T> read(String className) throws Exception { return read(className, className); } /** * Lê arquivo EXCEL, sendo que encontra a planilha pelo sheetName e carrega objetos de acordo com o className. * @param className String * @param sheetName String * @return objectList List<T> * @throws Exception */ @SuppressWarnings("unchecked") public <T> List<T> read(String className, String sheetName) throws Exception { this.getWorkbook().initializeForRead(); log.debug(this.getWorkbook().toString() + " - " + (this.getWorkbook() == null)); log.debug(this.getWorkbook().getSheetByName(sheetName) + " - " + sheetName); Sheet sheet = this.getWorkbook().getSheetByName(sheetName); List<T> result = new ArrayList<T>(); if(sheet!=null){ log.info("The sheet is: " + sheet.getSheetName()); @SuppressWarnings("rawtypes") Class clazz = Class.forName(className); this.fieldNames = this.getClassMapper().getFieldsForClass(clazz); Row row; for (int rowCount = 1; rowCount < 4; rowCount++) { T one = (T) clazz.newInstance(); row = sheet.getRow(rowCount); int colCount = 0; result.add(one); for (Cell cell : row) { int type = cell.getCellType(); String fieldName = fieldNames.get(colCount++); log.debug("Method: set" + StringUtil.capitalize(fieldName)); log.debug("Cell type: " + type); Method method = null; method = this.getClassMapper().setMethod(clazz, fieldName); if (type == 1) { String value = cell.getStringCellValue(); Object[] values = new Object[1]; values[0] = value; log.debug("METHOD = " + (method == null) + " - one = " + (one == null) + " - value = " + (values == null)); log.debug("METHOD = " + method.getName() + " - one = " + one.toString() + " - value = " + values[0]); method.invoke(one, values); } else if (type == 0) { Double num = cell.getNumericCellValue(); Class<?> returnType = this.getClassMapper().getGetterReturnClass(clazz,fieldName); if(returnType == Integer.class){ method.invoke(one, num.intValue()); } else if(returnType == Double.class){ method.invoke(one, num); } else if(returnType == Float.class){ method.invoke(one, num.floatValue()); } } else if (type == 3) { double num = cell.getNumericCellValue(); Object[] values = new Object[1]; values[0] =num; method.invoke(one, values); } } } log.info("The result set contains: " + result.size() + " items."); } return result; } /** * Gera arquivo EXCEL, sendo que define a planilha * e gera dados de acordo com a classe do primeiro objeto da lista. * @param data List<T> * @throws Exception */ public <T> void write(List<T> data) throws Exception { write(data.get(0).getClass().getName(), data); } /** * Gera arquivo EXCEL, sendo que define a planilha pelo sheetName * e gera dados de acordo com a classe do primeiro objeto da lista. * @param data List<T> * @throws Exception */ public <T> void write(String sheetName, List<T> data) throws Exception { Sheet sheet = this.getWorkbook().getWorkbook().createSheet(sheetName); this.fieldNames = this.getClassMapper().getFieldsForClass(data.get(0).getClass()); // Create a row and put some cells in it. Rows are 0 based. int rowCount = 0; int columnCount = 0; Row row = sheet.createRow(rowCount++); log.debug("FIELD NAMES SIZE - " + this.fieldNames.size()); for (String fieldName : this.fieldNames) { Cell cel = row.createCell(columnCount++); cel.setCellValue(fieldName); } Class<? extends Object> clazz = data.get(0).getClass(); for (T t : data) { row = sheet.createRow(rowCount++); columnCount = 0; for (String fieldName : this.fieldNames) { Cell cel = row.createCell(columnCount); Method method = null; try{ // method = classz.getMethod("get" + StringUtil.capitalize(fieldName)); method = this.classMapper.getMethod(clazz, fieldName); } catch (NoSuchMethodException e){ log.warn("NoSuchMethod: " + e.getMessage() + " - " + e.getMessage().endsWith("Logger()")); if(!e.getMessage().endsWith("Logger()")){ throw e; } else{ continue; } } Object value = method.invoke(t, (Object[]) null); if (value != null) { if (value instanceof String) { cel.setCellValue((String) value); } else if (value instanceof Long) { cel.setCellValue((Long) value); } else if (value instanceof Integer) { cel.setCellValue((Integer)value); }else if (value instanceof Double) { cel.setCellValue((Double) value); } else { cel.setCellValue(value.toString()); } } columnCount++; } } } /** * Libera memória dos streams para não ocorrer leak (estouro). */ public void close() { this.getWorkbook().closeWorksheet(); } }
[ "rafaelvant@gmail.com" ]
rafaelvant@gmail.com
ef9e5522e919928f62df8832ff53cf1d7811afc9
06f68f6bfbf8634b26e0304fab29dd624b36741e
/src/main/java/com/example/demo/domain/Camera.java
a02ef14f67d6591b84c922eeea36f6bb3cc7f497
[]
no_license
gitHubwhl562916378/Jni
7451bfce71059fa003d08dd0b401e0821069e8ed
50c5849727d2adbea5db656db18c2ebaf961a575
refs/heads/master
2022-12-04T00:38:32.410992
2020-08-27T10:47:21
2020-08-27T10:47:21
290,748,788
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
package com.example.demo.domain; import java.util.Arrays; public class Camera { private int id; private String name; private float[] feature; @Override public String toString() { return "Camera{" + "id=" + id + ", name='" + name + '\'' + ", feature=" + Arrays.toString(feature) + '}'; } }
[ "wanghualin@yourangroup.com" ]
wanghualin@yourangroup.com
18526c7c8acb78f9052b00125d65e7ccf7faaf05
7c0e6521f3e481bc93f062de3412789ddc8d6779
/MOTOSTORE/src/test/java/vn/edu/vtc/blTest/OrderBLTestInsert.java
94f56323e6e4bafc78b7246bfcde63fd92cd983b
[ "MIT" ]
permissive
duoclv-260500-halong/PROJECT_SEM1_PF08_GROUP5
4b4ecc91cf74efc2a0c191e5d838059af6dd8db5
c5323f973ea2e9c14d325e5c5cbc53d14d817fa7
refs/heads/master
2022-12-15T00:41:15.181855
2020-09-17T07:30:19
2020-09-17T07:30:19
287,205,648
0
0
null
null
null
null
UTF-8
Java
false
false
10,164
java
package vn.edu.vtc.blTest; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.junit.Test; import vn.edu.vtc.bl.OrderBL; import vn.edu.vtc.persistance.Customer; import vn.edu.vtc.persistance.Order; import vn.edu.vtc.persistance.Product; public class OrderBLTestInsert { @Test public void insertOrderBLTest1(){ //create order thành công, trả về true try { Customer customer = new Customer(); customer.setCustomerName("Customer 3"); customer.setCustomerAddress("Address 3"); customer.setPhoneNumber("000000002"); Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = true; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest2(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName(""); //Name Customer bị trống customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000003"); Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest3(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress(""); //Địa chỉ bị trống customer.setPhoneNumber("0000000003"); Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest4(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000002"); //Số điện thoại bị trùng lặp Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest6(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000003"); Product product1 = new Product(); product1.setProductName("Product not exist 1"); //sản phẩm 1 không tồn tại product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Product not exist 2"); //sản phẩm 2 không tồn tại product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); //can't add product products.add(product2); //can't add product Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest7(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000003"); Product product1 = new Product(); product1.setProductName("Product not exist 1"); //sản phẩm 1 tồn tại product1.setQuantity(2); product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Product not exist 2"); //sản phẩm 2 không tồn tại product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); products.add(product2); //can't add product => rollback Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest8(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000003"); Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(-1); //Số lượng <= 0 product1.setPrice(1100000); Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); //rollback products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } @Test public void insertOrderBLTest9(){ //create order không thành công, trả về false try { Customer customer = new Customer(); customer.setCustomerName("Customer 4"); customer.setCustomerAddress("Address 4"); customer.setPhoneNumber("000000003"); Product product1 = new Product(); product1.setProductName("Mu Yohe Fullface 981"); product1.setQuantity(2); product1.setPrice(-1000); //Giá <= 0 Product product2 = new Product(); product2.setProductName("Mu KYT NFR Axel Bassani"); product2.setQuantity(2); product2.setPrice(1100000); ArrayList<Product> products = new ArrayList<>(); products.add(product1); //rollback products.add(product2); Order order = new Order(); order.setCustomer(customer); order.setProducts(products); OrderBL orderBL = new OrderBL(); boolean result = orderBL.createOrder(order); boolean expected = false; assertTrue(result == expected); } catch (Exception e) { } } }
[ "duoclv.260500.halong@gmail.com" ]
duoclv.260500.halong@gmail.com
4332c34e436fbe20e6680ad93fb6dc0d88b3e0ed
1e8c16ac095f39443808d964da29638ea6f39a72
/Mirafuente13/src/mirafuente13/Mirafuente13.java
7b3ae8aae392a49c68991befb333e5d146ad66c1
[]
no_license
prometheusaxiom/Java-Programming-Projects
4b0d9d00877c22cbdc758c13393726aaf8c866e8
a24c986d9796abfae95d5fc1c5862c498a1036ca
refs/heads/master
2023-04-28T05:54:11.261446
2021-05-21T08:11:17
2021-05-21T08:11:17
369,459,809
0
0
null
null
null
null
UTF-8
Java
false
false
1,557
java
package mirafuente13; import java.util.Scanner; public class Mirafuente13 { //Mark Rayden C. Mirafuente DICT 2-4// public static void main(String[] args) { Scanner scan = new Scanner(System.in); double weight_pound, weight_kg, height_ft, height_inch, height_incft, height_meter, bmi = 0.0; System.out.print("Enter your weight in pounds: "); weight_pound = scan.nextDouble(); System.out.print("Enter your height in feet followed \n" + "by a space then additional inches: "); height_ft = scan.nextDouble(); height_inch = scan.nextDouble(); height_incft = height_ft * 12; height_meter = (height_inch + height_incft) * 0.0254; weight_kg = weight_pound / 2.2; bmi = weight_kg / (height_meter * height_meter); if (bmi < 18.5){ System.out.print("Your BMI is "+bmi); System.out.print("\nYour risk catergory is Underweight."); } else if (bmi < 25){ System.out.print("Your BMI is "+bmi); System.out.print("\nYour risk category is Normal weight."); } else if(bmi < 30){ System.out.print("Your BMI is "+bmi); System.out.print("\nYour risk category is Overweight."); } else if (bmi >= 30){ System.out.print("Your BMI is "+bmi); System.out.print("\nYour risk category is Obese."); } } }
[ "markraydenm@gmail.com" ]
markraydenm@gmail.com
bf40516c942e077ab9b9f9ed61ab9ac61777c876
f36a78d35f657a21e7950f3a37f9d6a0e527ea6b
/app/src/main/java/com/zq/jz/ui/adapter/ChooseAccountAdapter.java
157ca2a011fefff859f34d67a0e5e880a397b304
[]
no_license
qazz4508/MR
ffe537925b5aa7ae7b708a249dc2a44c91124504
d4d9c516bddc1d8912aa52de1ed1ac276f31eea9
refs/heads/master
2023-04-26T12:09:39.096925
2021-05-14T06:05:43
2021-05-14T06:05:43
365,402,586
0
0
null
null
null
null
UTF-8
Java
false
false
1,888
java
package com.zq.jz.ui.adapter; import android.view.View; import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.entity.MultiItemEntity; import com.zq.jz.R; import com.zq.jz.bean.AccountChildItem; import com.zq.jz.bean.AccountExpandItem; import java.util.List; public class ChooseAccountAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, BaseViewHolder> { public ChooseAccountAdapter(List<MultiItemEntity> data) { super(data); addItemType(AccountExpandItem.TYPE_L0, R.layout.item_add_accout_l0); addItemType(AccountExpandItem.TYPE_L1, R.layout.item_add_accout_l0); } @Override protected void convert(BaseViewHolder helper, MultiItemEntity item) { switch (helper.getItemViewType()) { case AccountExpandItem.TYPE_L0: AccountExpandItem accountExpandItem = (AccountExpandItem) item; helper.setText(R.id.tv_title, accountExpandItem.getAccountType().getName()); if(accountExpandItem.hasSubItem()){ helper.setText(R.id.tv_sub, accountExpandItem.getSubItemNameString()); helper.getView(R.id.iv_arrow).setVisibility(View.VISIBLE); }else { helper.getView(R.id.tv_sub).setVisibility(View.GONE); helper.getView(R.id.iv_arrow).setVisibility(View.GONE); } break; case AccountExpandItem.TYPE_L1: AccountChildItem accountChildItem = (AccountChildItem) item; helper.setText(R.id.tv_title, accountChildItem.getAccount().getName()); helper.getView(R.id.tv_sub).setVisibility(View.GONE); helper.getView(R.id.iv_arrow).setVisibility(View.GONE); break; } } }
[ "jUm0w0w6eAc3srUr" ]
jUm0w0w6eAc3srUr
5f9ecd7490649f8f55b8145754688f4e1b648b9d
7f0ae4505432b6ed70a3b867862ed157b0159812
/code94.java
24cce5a15172b1ad8a267c59269aad5ed2de95df
[]
no_license
SamJosephD/Sam
6be1a625df577b9771e73e8ff8d26237628f0b94
d257c97dde43b2efc5a4cba86994b35c977aecbd
refs/heads/master
2020-05-24T11:35:11.225678
2019-05-23T17:29:34
2019-05-23T17:29:34
187,251,185
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
import java.io.*; import java.util.*; public class code94 { public static void main(String[] args) { Scanner get=new Scanner(System.in); int i,m,n; n=get.nextInt(); m=get.nextInt(); int[] a=new int[n]; for(i=0;i<n;i++) { a[i]=get.nextInt(); } int sub=m-1; System.out.print(a[sub]); } }
[ "noreply@github.com" ]
noreply@github.com
d9ffec665e682d7ad578733d4c2e55efe13c2fbd
6fdd4c0fef4663a767188de55f8b707f9b16403f
/common/hermes-service/src/main/generated-java/com/hermes/profile/service/impl/MediaServiceImpl.java
e34d5919e062833d4d89ae45651e3dc573cea79a
[]
no_license
bulong0721/hermes
c2ff5fb98f89758e3b234ae2832fba3f47ecb9e8
e752154bffc1a1903104bd3a0a9c661c8bf62c0b
refs/heads/master
2020-12-29T03:34:30.511912
2016-09-30T11:10:03
2016-09-30T11:10:03
62,801,705
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package com.hermes.profile.service.impl; import com.hermes.profile.domain.Media; import com.hermes.profile.dao.MediaDao; import com.hermes.profile.service.MediaService; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import com.hermes.core.service.GenericEntityServiceImpl; @Service public class MediaServiceImpl extends GenericEntityServiceImpl<Long, Media> implements MediaService { protected MediaDao dao; @Autowired public MediaServiceImpl(MediaDao dao) { super(dao); this.dao = dao; } }
[ "bulong0721@163.com" ]
bulong0721@163.com
3765230d8be69510598ce872b59dc990dc3701d0
91c3bfc476a5bd4da03fcd84adc852cc830a70de
/OWLTools-Core/src/main/java/owltools/phenolog/GenePheno.java
6807cd885389c32d7220a79a3b427c19aef1bf7e
[]
permissive
VirtualFlyBrain/owltools
7a6439c9a9b6460acc7d080e104c3ae39d345605
fc5c7f86322ac773d09f1bce37c39e95326e605c
refs/heads/master
2023-06-22T16:04:04.629851
2017-04-05T20:12:42
2017-04-05T20:22:44
87,724,961
0
0
BSD-3-Clause
2023-06-19T18:04:03
2017-04-09T17:06:28
Web Ontology Language
UTF-8
Java
false
false
1,981
java
package owltools.phenolog; //import org.semanticweb.owlapi.model.OWLObject; /** * Represents a characteristic of an individual. * This could be represented using an ID for an ontology class. * */ public class GenePheno implements Comparable<GenePheno>{ private String id; private String label; private String phenoid; private String phenolabel; // @Override public boolean equals(Object aGenePheno){ if (aGenePheno == null) { return false; } if (aGenePheno instanceof GenePheno == false) { return false; } GenePheno gp = (GenePheno) aGenePheno; String cc1 = this.id.concat(this.phenoid); return cc1.equals(gp.getid().concat(gp.getphenoid())); } // @Override public int hashCode(){ return id.hashCode(); } // @Override public int compareTo(GenePheno g){ String cc1 = this.id.concat(this.phenoid); String cc2 = g.getid().concat(g.getphenoid()); return cc1.compareTo(cc2); } public GenePheno(String id, String label, String phenoid, String phenolabel){ this.id = id; this.label = label; this.phenoid = phenoid; this.phenolabel = phenolabel; } public GenePheno(String id, String phenoid){ this.id = id; this.phenoid = phenoid; } public void setid(String id){ this.id = id; } public void setphenoid(String phenoid){ this.phenoid = phenoid; } public void setlabel(String label){ this.label = label; } public void setphenolabel(String phenolabel){ this.phenolabel = phenolabel; } public String getid(){ return this.id; } public String getlabel(){ return this.label; } public String getphenoid(){ return this.phenoid; } public String getphenolabel(){ return this.phenolabel; } }
[ "hdietze@lbl.gov" ]
hdietze@lbl.gov
976e8d269ff0198e9dc26c996e2a7d3b207e2769
5f9ef996e5be954ccf95df44d94164fc7588dec7
/payasia-dao-bean/src/main/java/com/payasia/dao/bean/TimesheetApplicationReviewer.java
ae46c62257d2277e131fd0dc68e80fa962b447f5
[]
no_license
VaibhavMind/dummycode
26f5e6db2820470b6e958947c21984443187ca0b
a0679a042f817719b90f00101037f83a1e918b59
refs/heads/master
2022-12-06T02:02:25.251493
2019-10-01T07:19:44
2019-10-01T07:19:44
212,033,145
3
0
null
2022-12-06T00:33:03
2019-10-01T07:06:32
Java
UTF-8
Java
false
false
2,058
java
package com.payasia.dao.bean; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * The persistent class for the Lundin_Timesheet_Reviewer database table. * */ @Entity @Table(name = "Timesheet_Application_Reviewer") public class TimesheetApplicationReviewer extends CompanyBaseEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue @Column(name = "Timesheet_Reviewer_ID") private long timesheetReviewerId; @Column(name = "Pending") private boolean pending; @ManyToOne @JoinColumn(name = "Timesheet_ID") private EmployeeTimesheetApplication employeeTimesheetApplication; @ManyToOne @JoinColumn(name = "Employee_Reviewer_ID") private Employee employee; @ManyToOne @JoinColumn(name = "Work_Flow_Rule_ID") private WorkFlowRuleMaster workFlowRuleMaster; public TimesheetApplicationReviewer() { } public boolean isPending() { return pending; } public void setPending(boolean pending) { this.pending = pending; } public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } public WorkFlowRuleMaster getWorkFlowRuleMaster() { return workFlowRuleMaster; } public void setWorkFlowRuleMaster(WorkFlowRuleMaster workFlowRuleMaster) { this.workFlowRuleMaster = workFlowRuleMaster; } public long getTimesheetReviewerId() { return timesheetReviewerId; } public void setTimesheetReviewerId(long timesheetReviewerId) { this.timesheetReviewerId = timesheetReviewerId; } public EmployeeTimesheetApplication getEmployeeTimesheetApplication() { return employeeTimesheetApplication; } public void setEmployeeTimesheetApplication( EmployeeTimesheetApplication employeeTimesheetApplication) { this.employeeTimesheetApplication = employeeTimesheetApplication; } }
[ "Vaibhav.Dhawan@mind-infotech.com" ]
Vaibhav.Dhawan@mind-infotech.com
e32120448043602970683067454ad60ffd4f5dfc
70a74031344ffb0302e2edc3d6e8ddff4df507ab
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/hotelPremier/org/apache/jsp/gestionarPasajero_jsp.java
7fa8b1b1081a93a34d91fb9f9a972fa87f8ab3e1
[]
no_license
dariovtx/JavaUTNDise-o
c3663104652a849701f3b8b89b33920c929ae5af
339c77771d39a686d9bea73e9a77563a7b580cf8
refs/heads/master
2023-08-27T07:38:49.424851
2021-10-28T18:55:13
2021-10-28T18:55:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,678
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/9.0.53 * Generated at: 2021-10-24 21:35:28 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.LinkedList; import tpUtn.hotel.entidades.Pasajero; import java.util.List; import tpUtn.hotel.gestionar.GestionarPasajero; public final class gestionarPasajero_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = new java.util.HashSet<>(); _jspx_imports_classes.add("tpUtn.hotel.entidades.Pasajero"); _jspx_imports_classes.add("java.util.List"); _jspx_imports_classes.add("tpUtn.hotel.gestionar.GestionarPasajero"); _jspx_imports_classes.add("java.util.LinkedList"); } private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { if (!javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { final java.lang.String _jspx_method = request.getMethod(); if ("OPTIONS".equals(_jspx_method)) { response.setHeader("Allow","GET, HEAD, POST, OPTIONS"); return; } if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method)) { response.setHeader("Allow","GET, HEAD, POST, OPTIONS"); response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET, POST or HEAD. Jasper also permits OPTIONS"); return; } } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<!DOCTYPE html>\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<meta charset=\"ISO-8859-1\">\r\n"); out.write("<link rel=\"stylesheet\" href=\"css/style.css\">\r\n"); out.write("<link rel=\"stylesheet\" href=\"css/form.css\">\r\n"); out.write("<link rel=\"stylesheet\" href=\"css/button.css\">\r\n"); out.write("<link rel=\"stylesheet\" href=\"css/table.css\">\r\n"); out.write("<title>Insert title here</title>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); out.write(" <div>\r\n"); out.write(" <form action=\"pasajeroABM\" method=\"get\">\r\n"); out.write(" <label for=\"tipoDocumento\">Tipo de Documento</label>\r\n"); out.write(" <select name=\"tipoDoc\" required >\r\n"); out.write(" <option value=\"DNI\" >DNI</option>\r\n"); out.write(" <option value=\"PAS\" >PAS</option>\r\n"); out.write(" <option value=\"LE\" >LE</option>\r\n"); out.write(" <option value=\"CI\" >CI</option>\r\n"); out.write(" </select>\r\n"); out.write(" <label for=\"numeroDocumento\">Numero de documento</label>\r\n"); out.write(" <input type=\"text\" name=\"numeroDoc\" required>\r\n"); out.write(" <label for=\"Apellido\">Apellido</label>\r\n"); out.write(" <input type=\"text\" name=\"apellido\" required>\r\n"); out.write(" <label for=\"Nombre\">Nombre</label>\r\n"); out.write(" <input type=\"text\" name=\"nombre\" required>\r\n"); out.write(" <input class=\"success\" type=\"submit\" value=\"Buscar\"> \r\n"); out.write(" </form>\r\n"); out.write(" </div>\r\n"); out.write(" <section>\r\n"); out.write(" <form action=\"pasajeroABM\" method=\"post\" >\r\n"); out.write(" <table>\r\n"); out.write(" <tr>\r\n"); out.write(" <th>Tipo de Documento</th>\r\n"); out.write(" <th>Numero de Documento</th>\r\n"); out.write(" <th>Apellido</th>\r\n"); out.write(" <th>Nombre</th>\r\n"); out.write(" <th>Accion</th>\r\n"); out.write(" </tr>\r\n"); out.write(" "); if(request.getParameter("tipoDoc")!=null){ String tipoDoc = request.getParameter("tipoDoc"); int numeroDoc = Integer.valueOf(request.getParameter("numeroDoc")); String apellido = request.getParameter("apellidon"); String nombre = request.getParameter("nombren"); System.out.println(request.getParameter("tipoDocSesion")); GestionarPasajero gestionarPasajero= new GestionarPasajero(); for(Pasajero pasajero : gestionarPasajero.buscarPasajero(tipoDoc, numeroDoc, apellido, nombre)){ out.write("\r\n"); out.write(" <tr>\r\n"); out.write(" <td>"); out.print(pasajero.getTipoDocumento() ); out.write("</td>\r\n"); out.write(" <td>"); out.print(pasajero.getDocumento() ); out.write("</td>\r\n"); out.write(" <td>"); out.print(pasajero.getApellido() ); out.write("</td>\r\n"); out.write(" <td>"); out.print(pasajero.getNombre()); out.write("</td>\r\n"); out.write(" <td>\r\n"); out.write(" <input type=\"radio\" value=\""); out.print(pasajero.getId() ); out.write("\" name=\"idPasajero\">\r\n"); out.write(" </td>\r\n"); out.write(" \r\n"); out.write(" </tr>\r\n"); out.write(" "); }}else { out.write(" <tr>\r\n"); out.write(" <td></td>\r\n"); out.write(" <td></td>\r\n"); out.write(" <td></td>\r\n"); out.write(" <td></td>\r\n"); out.write(" <td>\r\n"); out.write(" <input type=\"radio\" value=\"\" name=\"idPasajero\">\r\n"); out.write(" </td>\r\n"); out.write(" \r\n"); out.write(" </tr>\r\n"); out.write(" "); } out.write("\r\n"); out.write(" </table> \r\n"); out.write(" \r\n"); out.write(" <input class=\"warning\" type=\"button\" onclick=\"location.href='index.jsp'\" value=\"Cancelar\" />\r\n"); out.write(" <input class=\"success\" type=\"submit\" value=\"Siguiente\"> \r\n"); out.write(" </form>\r\n"); out.write(" </section>\r\n"); out.write("</body>\r\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
[ "dariovictorbarboso@hotmail.com" ]
dariovictorbarboso@hotmail.com
be42e07942fc60e2632d4989bdd6e9d67b07dffb
b776ab1c1635b54082c150b388a786bbf5dfae1a
/src/com/cyprias/ChunkSpawnerLimiter/listeners/WorldListener.java
f0dfb5698216b5a852eea1c7ac2a46d468ecfe77
[]
no_license
hector-romero/ChunkSpawnerLimiter
cf0789a3f01225f2ba56e071bd784515aef5468d
f8c19cacb9d4cc4f05b2522261828c784505658b
refs/heads/master
2020-12-29T01:54:19.827335
2014-10-26T21:21:10
2014-10-26T21:21:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,162
java
package com.cyprias.ChunkSpawnerLimiter.listeners; import java.util.ArrayList; import java.util.HashMap; import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; import org.bukkit.scheduler.BukkitRunnable; import com.cyprias.ChunkSpawnerLimiter.ChatUtils; import com.cyprias.ChunkSpawnerLimiter.Config; import com.cyprias.ChunkSpawnerLimiter.Logger; import com.cyprias.ChunkSpawnerLimiter.Plugin; import com.cyprias.ChunkSpawnerLimiter.compare.MobGroupCompare; public class WorldListener implements Listener { HashMap<Chunk, Integer> chunkTasks = new HashMap<Chunk, Integer>(); class inspectTask extends BukkitRunnable { Chunk c; public inspectTask(Chunk c) { this.c = c; } @Override public void run() { Logger.debug("Active check " + c.getX() + " " + c.getZ()); if (!c.isLoaded()){ Plugin.cancelTask(taskID); return; } CheckChunk(c); } int taskID; public void setId(int taskID) { this.taskID = taskID; } } @EventHandler public void onChunkLoadEvent(final ChunkLoadEvent e) { Logger.debug("ChunkLoadEvent " + e.getChunk().getX() + " " + e.getChunk().getZ()); if (Config.getBoolean("properties.active-inspections")){ inspectTask task = new inspectTask(e.getChunk()); int taskID = Plugin.scheduleSyncRepeatingTask(task, Config.getInt("properties.inspection-frequency") * 20L); task.setId(taskID); chunkTasks.put(e.getChunk(), taskID); } if (Config.getBoolean("properties.check-chunk-load")) CheckChunk(e.getChunk()); } @EventHandler public void onChunkUnloadEvent(final ChunkUnloadEvent e) { Logger.debug("ChunkUnloadEvent " + e.getChunk().getX() + " " + e.getChunk().getZ()); if (chunkTasks.containsKey(e.getChunk())){ Plugin.getInstance().getServer().getScheduler().cancelTask(chunkTasks.get(e.getChunk())); chunkTasks.remove(e.getChunk()); } if (Config.getBoolean("properties.check-chunk-unload")) CheckChunk(e.getChunk()); } public static void CheckChunk(Chunk c) { // Stop processing quickly if this world is excluded from limits. if (Config.getStringList("excludedWorlds").contains(c.getWorld().getName())) { return; } Entity[] ents = c.getEntities(); HashMap<String, ArrayList<Entity>> types = new HashMap<String, ArrayList<Entity>>(); for (int i = ents.length - 1; i >= 0; i--) { // ents[i].getType(); EntityType t = ents[i].getType(); String eType = t.toString(); String eGroup = MobGroupCompare.getMobGroup(ents[i]); if (Config.contains("entities." + eType)) { if (!types.containsKey(eType)) types.put(eType, new ArrayList<Entity>()); types.get(eType).add(ents[i]); } if (Config.contains("entities." + eGroup)) { if (!types.containsKey(eGroup)) types.put(eGroup, new ArrayList<Entity>()); types.get(eGroup).add(ents[i]); } } for (Entry<String, ArrayList<Entity>> entry : types.entrySet()) { String eType = entry.getKey(); int limit = Config.getInt("entities." + eType); // Logger.debug(c.getX() + " " + c.getZ() + ": " + eType + " = " + // entry.getValue().size()); if (entry.getValue().size() > limit) { Logger.debug("Removing " + (entry.getValue().size() - limit) + " " + eType + " @ " + c.getX() + " " + c.getZ()); if (Config.getBoolean("properties.notify-players")){ for (int i = ents.length - 1; i >= 0; i--) { if (ents[i] instanceof Player){ Player p = (Player) ents[i]; ChatUtils.send(p, Config.getString("messages.removedEntites", entry.getValue().size() - limit, eType)); } } } for (int i = entry.getValue().size() - 1; i >= limit; i--) { entry.getValue().get(i).remove(); } } } } }
[ "Cyprias@gmail.com" ]
Cyprias@gmail.com
976124df191344e7f3af10bbf415095ee5ba3f48
53d3d5365682d5cc876a2f33d8af197dd900ae0d
/AllyWebSite/AllyWebSite/src/main/java/com/app/allyworld/AllyWebSite/resource/WebsiteResource.java
ce44e69353f133b2e77b0f69690dd156bdf04f03
[]
no_license
harishchinna/allywebsite
319ddca11893eb41847498f19ad1820c57e2a0a0
cb0bb63da97feb0e23b0dc335c831a0d23ee6a56
refs/heads/master
2020-04-22T03:20:42.423738
2019-02-11T07:09:00
2019-02-11T07:09:00
170,083,421
0
0
null
null
null
null
UTF-8
Java
false
false
297
java
package com.app.allyworld.AllyWebSite.resource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller //@EnableOAuth2Sso public class WebsiteResource { @RequestMapping("/") public String home() { return "index"; } }
[ "javvaji.harish@capgemini.com" ]
javvaji.harish@capgemini.com
bcf994d4423906e20c70a1d98db63fce5f1e650b
9a4bf397643b394490521f1d8e43597e9e34b52d
/app/src/main/java/com/login/mobi/loginapp/views/client/authorization/SignUpPage.java
e908bb9743dd2414ee10e272728daa67cee1ff4b
[]
no_license
berikkadanTeam/diplomaAndroid
56bf819db4eeb7787e63c3eb0ed3c600573d1a5b
eb4ceb8832adb950eb59612d880383089c02c3a2
refs/heads/master
2020-04-15T12:40:38.434530
2019-06-03T17:55:05
2019-06-03T17:55:05
154,871,665
0
0
null
null
null
null
UTF-8
Java
false
false
9,958
java
package com.login.mobi.loginapp.views.client.authorization; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import com.login.mobi.loginapp.R; import com.login.mobi.loginapp.network.model.ServerResponse; import com.login.mobi.loginapp.network.requests.authorization.PostSignUp; import br.com.sapereaude.maskedEditText.MaskedEditText; public class SignUpPage extends AppCompatActivity implements PostSignUp.PostSignUpInterface{ //GetCities.GetCitiesInterface, private EditText email, password, firstName, lastName, phoneNumber; private MaskedEditText maskedPhoneNumber; private AutoCompleteTextView acTextView; private Button btnCancel, btnRegister; // Snackbar View parentLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sign_up_page); parentLayout = findViewById(android.R.id.content); email = findViewById(R.id.email); password = findViewById(R.id.password); firstName = findViewById(R.id.firstName); lastName = findViewById(R.id.lastName); phoneNumber = findViewById(R.id.phone_number); btnCancel = findViewById(R.id.cancel); btnRegister = findViewById(R.id.register); MaskedEditText maskedPhoneNumber = (MaskedEditText) findViewById(R.id.phone_number_2); //Find TextView control acTextView = (AutoCompleteTextView) findViewById(R.id.cities); btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(SignUpPage.this, WelcomePage.class)); finish(); } }); btnRegister.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String str1 = email.getText().toString(); String str2 = password.getText().toString(); String str3 = firstName.getText().toString(); String str4 = lastName.getText().toString(); String str5 = acTextView.getText().toString(); //String str6 = phoneNumber.getText().toString(); if (str2.length() < 6) { password.setError("Пароль должен состоять минимум из 6 символов"); //Snackbar.make(parentLayout, "Пароль должен состоять минимум из 6 символов", Snackbar.LENGTH_LONG).setAction("Action", null).show(); } else { // if (!str1.isEmpty() && !str2.isEmpty() && !str3.isEmpty() && !str4.isEmpty() && !str5.isEmpty()) { // signUp(str1, str2, str3, str4, str5); // } else { // Snackbar.make(parentLayout, "Заполните все поля", Snackbar.LENGTH_LONG).setAction("Action", null).show(); // } boolean fieldsOK = validate(new EditText[] { email, password, firstName, lastName, acTextView }); if (!fieldsOK) { if (!isEmailValid(str1)) email.setError("Адрес электронной почты недействителен"); else { Log.i("MASK", maskedPhoneNumber.getMask() + " RAW TEXT: " + maskedPhoneNumber.getRawText().toString()); if (!maskedPhoneNumber.getRawText().toString().isEmpty() || maskedPhoneNumber.getRawText().toString().length() != 0) { String str6 = "+7" + maskedPhoneNumber.getRawText(); Log.i("FORMATTED MASK+TEXT", str6 + " LENGTH: " + String.valueOf(str6.length())); if (str6.length() < 12) maskedPhoneNumber.setError("Заполните поле"); else signUp(str1, str2, str3, str4, str5, str6); } else { maskedPhoneNumber.setError("Заполните поле"); } } } } } //} }); // GetCities getCities = new GetCities(this); // getCities.getCities(); } public void signUp (String str1, String str2, String str3, String str4, String str5, String str6){ Log.d("SignUp",str1 + " " + str2 + " " + str3 + " " + str4 + " " + str5 + " " + str6); PostSignUp postSignUp = new PostSignUp(this, str1, str2, str3, str4, str5, str6); postSignUp.postSignUp(); } boolean isEmailValid(CharSequence email) { return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); } private boolean validate (EditText[] fields){ boolean foundedEmptyEditText = false; for (int i = 0; i < fields.length; i++){ EditText currentField = fields[i]; if (currentField.getText().toString().length() <= 0){ currentField.setError("Заполните поле"); foundedEmptyEditText = true; //return false; } } if (!foundedEmptyEditText) return false; else return true; } // @Override // public void getCities(List<Cities> response) { // if(response != null){ // Log.d("Cities",response.toString()); // Toast.makeText(this,"" + response.size(), Toast.LENGTH_LONG).show(); // // String[] arrayOfCities = new String[response.size()]; // for (int i = 0; i < response.size(); i++) { // Cities element = response.get(i); // arrayOfCities[i] = response.get(i).getCityTitle(); // } // //Create Array Adapter // ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.select_dialog_singlechoice, arrayOfCities); // acTextView.setThreshold(1); //Set the number of characters the user must type before the drop down list is shown // acTextView.setAdapter(adapter); //Set the adapter // // } else{ // Toast.makeText(this,"Список городов пуст", Toast.LENGTH_LONG).show(); // } // } @Override public void signUp(ServerResponse response, int code) { Log.d("CODE", String.valueOf(code)); if (code == 200){ // Snackbar.make(parentLayout, "Регистрация прошла успешно!", Snackbar.LENGTH_LONG).setAction("Action", null).show(); // final Handler handler = new Handler(); // handler.postDelayed(new Runnable() { // @Override // public void run() { // startActivity(new Intent(SignUpPage.this, SignInPage.class)); // finish(); // } // }, 1000); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(SignUpPage.this); alertDialogBuilder.setIcon(R.drawable.icon_email_connect); alertDialogBuilder.setTitle("Письмо отправлено!"); alertDialogBuilder.setMessage(response.getStatus()); alertDialogBuilder.setCancelable(false); alertDialogBuilder.setPositiveButton("ОК", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent(SignUpPage.this, SignInPage.class); startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); finish(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } else { if (response.getDuplicateUserName() != null){ //Snackbar.make(parentLayout, "Пользователь с электронной почтой " + email.getText().toString() + " уже существует, введите другую почту", Snackbar.LENGTH_LONG).setAction("Action", null).show(); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(SignUpPage.this); alertDialogBuilder.setIcon(R.drawable.icon_email_error); alertDialogBuilder.setTitle("Ошибка..."); alertDialogBuilder.setMessage("Пользователь с электронной почтой " + email.getText().toString() + " уже существует, введите другую почту"); alertDialogBuilder.setCancelable(false); alertDialogBuilder.setNegativeButton("ОК", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // Intent intent = new Intent(SignUpPage.this, SignInPage.class); // startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); // finish(); dialog.cancel(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } } } @Override public void onBackPressed() { super.onBackPressed(); startActivity(new Intent(this, WelcomePage.class)); finish(); } }
[ "nurilatolegenova@gmail.com" ]
nurilatolegenova@gmail.com
2b1e2ab7472e2f54bbabf0212faad8ac7e81a81e
bad53f7ee36066668365a38d47d0ff0158457d06
/LICTChatApp/app/src/main/java/com/example/bulbul/lictchatapp/EndlessRecyclerOnScrollListener.java
9bb3d885070e8871fc793d8fa6638f0135689b76
[]
no_license
bdbulbul12/AndroidIntermidiateProject
0c9ca0ddcc4d2e2fbad177c6db84fa4ed7e5c157
2727b927a3a584097bc9b11162de064b651f0cab
refs/heads/master
2022-11-06T19:24:33.091954
2018-09-10T10:41:18
2018-09-10T10:41:18
136,428,844
1
2
null
2022-10-27T10:43:29
2018-06-07T05:57:28
Java
UTF-8
Java
false
false
1,870
java
package com.example.bulbul.lictchatapp; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; /** * Created by bulbul on 2/15/2018. */ public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); private int previousTotal = 0; // The total number of items in the dataset after the last load private boolean loading = true; // True if we are still waiting for the last set of data to load. private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. int firstVisibleItem, visibleItemCount, totalItemCount; private int current_page = 1; private LinearLayoutManager mLinearLayoutManager; public EndlessRecyclerOnScrollListener(LinearLayoutManager linearLayoutManager) { this.mLinearLayoutManager = linearLayoutManager; } @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); visibleItemCount = recyclerView.getChildCount(); totalItemCount = mLinearLayoutManager.getItemCount(); firstVisibleItem = mLinearLayoutManager.findFirstVisibleItemPosition(); if (loading) { if (totalItemCount > previousTotal) { loading = false; previousTotal = totalItemCount; } } if (!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold)) { // End has been reached // Do something current_page++; onLoadMore(current_page); loading = true; } } public abstract void onLoadMore(int current_page); }
[ "bulbulahmed.cse@yahoo.com" ]
bulbulahmed.cse@yahoo.com
bcdd1459161c4881a4d7cfec78bd6e9716c9718c
5e224ff6d555ee74e0fda6dfa9a645fb7de60989
/database/src/main/java/adila/db/kc2ds301ae_kc2ds301ae.java
e9e6477c4c1822c493c898b04fd2bb33e7e12292
[ "MIT" ]
permissive
karim/adila
8b0b6ba56d83f3f29f6354a2964377e6197761c4
00f262f6d5352b9d535ae54a2023e4a807449faa
refs/heads/master
2021-01-18T22:52:51.508129
2016-11-13T13:08:04
2016-11-13T13:08:04
45,054,909
3
1
null
null
null
null
UTF-8
Java
false
false
221
java
// This file is automatically generated. package adila.db; /* * Kyocera S301 * * DEVICE: KC-S301AE * MODEL: KC-S301AE */ final class kc2ds301ae_kc2ds301ae { public static final String DATA = "Kyocera|S301|"; }
[ "keldeeb@gmail.com" ]
keldeeb@gmail.com
e404efbc66509c8137ecf8c82bb9f2dd3101500f
ffaaa5ddd55fcf960ea322ea3479eec2e3de3c1f
/model/Color.java
46e7bf7b6243c8a759e047da6012c7cd486c5130
[]
no_license
stejes/SET
37857edcb9add65020978ae7a8486e1384831095
bd2e0497c14f2a6dbca60add186dc7da0e5e61a5
refs/heads/master
2021-01-01T20:38:45.967310
2017-07-31T15:47:04
2017-07-31T15:47:04
98,904,743
0
0
null
null
null
null
UTF-8
Java
false
false
99
java
package model; /** * Created by fed on 1/31/15. */ public enum Color { purple, green, red }
[ "obex_nielssen@hotmail.com" ]
obex_nielssen@hotmail.com
3b6eec1f2444df9d123b8d5d75a5418634df6610
8b53f6d6590f20fba2d0c87db888d9b820ea89d0
/src/main/java/com/study/demoinflearnrestapi/events/EventController.java
0877e2eb3d6de466c9c1337e77a48dc4b87a1133
[]
no_license
newzinee/rest-api-with-spring
f0fff396c555ca566bdba9ee5e0dea75c13a9930
966f5c414f3488df225c1c9c372813540d72ea28
refs/heads/master
2023-02-25T22:06:11.828043
2021-02-05T14:45:11
2021-02-05T14:45:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,641
java
package com.study.demoinflearnrestapi.events; import com.study.demoinflearnrestapi.common.ErrorResource; import org.modelmapper.ModelMapper; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PagedResourcesAssembler; import org.springframework.hateoas.Link; import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.util.Optional; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; /** * @author yj * @version 0.1.0 * @since 2020/12/28 */ @Controller @RequestMapping(value = "/api/events", produces = MediaTypes.HAL_JSON_VALUE) public class EventController { private final EventRepository eventRepository; private final ModelMapper modelMapper; private final EventValidator eventValidator; public EventController(EventRepository eventRepository, ModelMapper modelMapper, EventValidator eventValidator) { this.eventRepository = eventRepository; this.modelMapper = modelMapper; this.eventValidator = eventValidator; } @PostMapping public ResponseEntity createEvent(@RequestBody @Valid EventDto eventDto, Errors errors) { if(errors.hasErrors()) { return badRequest(errors); } eventValidator.validate(eventDto, errors); if(errors.hasErrors()) { return badRequest(errors); } Event event = modelMapper.map(eventDto, Event.class); event.update(); Event newEvent = this.eventRepository.save(event); WebMvcLinkBuilder selfLinkBuilder = linkTo(EventController.class).slash(newEvent.getId()); URI createdUri = selfLinkBuilder.toUri(); EventResource eventResource = new EventResource(event); eventResource.add(linkTo(EventController.class).withRel("query-events")); eventResource.add(selfLinkBuilder.withRel("update-event")); eventResource.add(Link.of("/docs/index.html#resources-events-create").withRel("profile")); return ResponseEntity.created(createdUri).body(eventResource); } @GetMapping public ResponseEntity queryEvents(Pageable pageable, PagedResourcesAssembler<Event> assembler) { Page<Event> page = this.eventRepository.findAll(pageable); var pageResources = assembler.toModel(page); pageResources.forEach(e -> e.add(linkTo(EventController.class).slash(e.getContent().getId()).withSelfRel())); pageResources.add(Link.of("/docs/index.html#resources-events-list").withRel("profile")); return ResponseEntity.ok(pageResources); } @GetMapping("/{id}") public ResponseEntity getEvent(@PathVariable Integer id) { final Optional<Event> optionalEvent = this.eventRepository.findById(id); if(optionalEvent.isEmpty()) { return ResponseEntity.notFound().build(); } final Event event = optionalEvent.get(); final EventResource eventResource = new EventResource(event); eventResource.add(Link.of("/docs/index.html#resources-events-get").withRel("profile")); return ResponseEntity.ok(eventResource); } @PutMapping("/{id}") public ResponseEntity updateEvent(@PathVariable Integer id, @RequestBody @Valid EventDto eventDto, Errors errors) { final Optional<Event> optionalEvent = this.eventRepository.findById(id); if(optionalEvent.isEmpty()) { return ResponseEntity.notFound().build(); } if(errors.hasErrors()) { return badRequest(errors); } this.eventValidator.validate(eventDto, errors); if(errors.hasErrors()) { return badRequest(errors); } final Event existingEvent = optionalEvent.get(); this.modelMapper.map(eventDto, existingEvent); final Event savedEvent = this.eventRepository.save(existingEvent); EventResource eventResource = new EventResource(savedEvent); eventResource.add(Link.of("/docs/index.html#resources-events-update").withRel("profile")); return ResponseEntity.ok(eventResource); } private ResponseEntity badRequest(final Errors errors) { return ResponseEntity.badRequest().body(new ErrorResource(errors)); } }
[ "qvo7896@gmail.com" ]
qvo7896@gmail.com
361b5fedb3c2602299b08ad848ae27ab2b234803
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_88f5995b4348a35eaf2f1d3126b6e7bbd9e8928c/ResXFilter/4_88f5995b4348a35eaf2f1d3126b6e7bbd9e8928c_ResXFilter_s.java
99779dd9601f99c0eeb97856835a6de2c76b5bef
[]
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
3,994
java
/************************************************************************** OmegaT - Computer Assisted Translation (CAT) tool with fuzzy matching, translation memory, keyword search, glossaries, and translation leveraging into updated projects. Copyright (C) 2000-2006 Keith Godfrey and Maxym Mykhalchuk 2009 Didier Briel Home page: http://www.omegat.org/ Support center: http://groups.yahoo.com/group/OmegaT/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **************************************************************************/ package org.omegat.filters3.xml.resx; import org.omegat.filters2.Instance; import org.omegat.filters3.xml.XMLFilter; import org.omegat.util.OStrings; import org.omegat.util.StringUtil; import org.xml.sax.Attributes; /** * Filter for ResX files. * * @author Didier Briel */ public class ResXFilter extends XMLFilter { private String id = ""; private String entryText; private String comment; private String text; /** * Creates a new instance of ResXFilter */ public ResXFilter() { super(new ResXDialect()); } /** * Human-readable name of the File Format this filter supports. * * @return File format name */ public String getFileFormatName() { return OStrings.getString("RESX_FILTER_NAME"); } /** * The default list of filter instances that this filter class has. One filter class may have different * filter instances, different by source file mask, encoding of the source file etc. * <p> * Note that the user may change the instances freely. * * @return Default filter instances */ public Instance[] getDefaultInstances() { return new Instance[] { new Instance("*.resx", null, null), }; } /** * Either the encoding can be read, or it is UTF-8. * * @return <code>false</code> */ public boolean isSourceEncodingVariable() { return false; } /** * Yes, ResX may be written out in a variety of encodings. * * @return <code>true</code> */ public boolean isTargetEncodingVariable() { return true; } @Override public void tagStart(String path, Attributes atts) { if ("/root/data".equals(path)) { id = StringUtil.nvl(atts.getValue("name"), ""); comment = null; } } @Override public void tagEnd(String path) { if ("/root/data/comment".equals(path)) { comment = text; } else if ("/root/data".equals(path)) { entryParseCallback.addEntry(id, entryText, null, false, comment, null, this); id = null; entryText = null; comment = null; } } @Override public void text(String text) { this.text = text; } @Override public String translate(String entry) { if (entryParseCallback != null) { entryText = entry; return entry; } else { String trans = entryTranslateCallback.getTranslation(id, entry, null); return trans != null ? trans : entry; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
61aa6daed3bc1b74a728a2c6cc03cc8de5b2527e
eaafac4921da7afce7559c3ed895253652db2ef4
/app/src/main/java/com/example/tchatker/fragment/SettingFragment.java
7da94026fed7b84a629b8b522fdf37e5039c4a5e
[]
no_license
robocon321/tchatker
9bcfdecd479e1c5c015423cdeb71b6df6d37e187
f965618a10d048cba783202c8f2b6c39a9ee9432
refs/heads/master
2023-04-01T22:45:02.811438
2021-04-03T13:50:38
2021-04-03T13:50:38
340,957,165
0
0
null
null
null
null
UTF-8
Java
false
false
13,739
java
package com.example.tchatker.fragment; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.example.tchatker.R; import com.example.tchatker.model.Account; import com.example.tchatker.model.Message; import com.example.tchatker.model.Time; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; import com.squareup.picasso.Picasso; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.Calendar; import br.com.sapereaude.maskedEditText.MaskedEditText; import static android.app.Activity.RESULT_OK; public class SettingFragment extends Fragment { final int REQ_GET_AVATAR = 100; final int REQ_GET_BACKGROUND = 101; ImageView imgBackground, imgEditBackgound, imgAvatar, imgEditAvatar; EditText editName, editPhone, editEmail, editPwd, editRePwd; Spinner spDay, spMonth, spYear; Button btnSave; FirebaseDatabase database; DatabaseReference reference; FirebaseStorage storage; StorageReference storageReference; SharedPreferences sharedPreferences; String uname; String urlUploadAvatar; String urlUploadBackground; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_setting, null); init(view); setEvents(); return view; } public void init(View view){ imgBackground = view.findViewById(R.id.imgBackground); imgEditBackgound = view.findViewById(R.id.imgEditBackground); imgAvatar = view.findViewById(R.id.imgAvatar); imgEditAvatar = view.findViewById(R.id.imgEditAvatar); editName = view.findViewById(R.id.editName); editPhone = view.findViewById(R.id.editPhone); editEmail = view.findViewById(R.id.editEmail); editPwd = view.findViewById(R.id.editPwd); editRePwd = view.findViewById(R.id.editRePwd); spDay = view.findViewById(R.id.spDay); ArrayList<Integer> days = new ArrayList<>(); for(int i=1; i<=31; i++){ days.add(i); } ArrayAdapter adapterDay = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_item, days); spDay.setAdapter(adapterDay); spMonth = view.findViewById(R.id.spMonth); ArrayList<Integer> months = new ArrayList<>(); for(int i=1; i<=12;i++){ months.add(i); } ArrayAdapter adapterMonth = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_item, months); spMonth.setAdapter(adapterMonth); spYear = view.findViewById(R.id.spYear); ArrayList<Integer> years = new ArrayList<>(); for(int i=1980; i<= Calendar.getInstance().get(Calendar.YEAR);i++){ years.add(i); } ArrayAdapter adapterYear = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_item, years); spYear.setAdapter(adapterYear); btnSave = view.findViewById(R.id.btnSave); database = FirebaseDatabase.getInstance(); reference = database.getReference("user"); storage = FirebaseStorage.getInstance(); storageReference = storage.getReferenceFromUrl("gs://tchatker.appspot.com"); sharedPreferences = getActivity().getSharedPreferences("login", Context.MODE_PRIVATE); uname = sharedPreferences.getString("uname", "robocon321"); reference.child(uname).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { Account account = snapshot.getValue(Account.class); editName.setText(account.getName()); editPhone.setText(account.getPhoneNumber().substring(3)); editEmail.setText(account.getEmail()); editPwd.setText(account.getPwd()); editRePwd.setText(account.getPwd()); String avatar = account.getAvatar(); if(avatar != null){ Picasso.get().load(account.getAvatar()).into(imgAvatar); } String background = account.getBackground(); if(background != null){ Picasso.get().load(snapshot.child("background").getValue(String.class)).into(imgBackground); } spDay.setSelection(account.getBirthday().getDay()-1); spMonth.setSelection(account.getBirthday().getMonth()-1); spYear.setSelection(account.getBirthday().getYear()- 1980); } @Override public void onCancelled(@NonNull DatabaseError error) { Log.e("Error", error.getMessage()); } }); } public void setEvents(){ imgEditAvatar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intent, REQ_GET_AVATAR); } }); imgEditBackgound.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intent, REQ_GET_BACKGROUND); } }); btnSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Get data String name = editName.getText().toString().trim(); int day = (int) spDay.getSelectedItem(); int month = (int) spMonth.getSelectedItem(); int year = (int) spYear.getSelectedItem(); String phone = editPhone.getText().toString().trim().replaceAll("[() ]", ""); String email = editEmail.getText().toString().trim(); String pwd = editPwd.getText().toString().trim(); String rePwd = editRePwd.getText().toString().trim(); // Validate data if(name.equals("")) { editName.setError("Not empty"); editName.requestFocus(); return ; } if(phone.length() < 12){ editPhone.setError("Error format phone number"); editPhone.requestFocus(); return; } if(!email.matches("^\\S+@\\S+\\.\\S+$")){ editEmail.setError("Error format email"); editEmail.requestFocus(); return ; } if(pwd.length()<6){ editPwd.setError("Length password must >= 6"); editPwd.requestFocus(); return ; } if(!rePwd.equals(pwd)){ editRePwd.setError("Re-password don't match with password"); editRePwd.requestFocus(); return ; } // update data Account account = new Account(uname, pwd, name, phone, email, new Time(year, month, day), "", "online", ""); // upload avatar Bitmap bitmap = ((BitmapDrawable) imgAvatar.getDrawable()).getBitmap(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] data = baos.toByteArray(); UploadTask uploadTask = storageReference.child("image").child("image" + System.currentTimeMillis()).putBytes(data); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { Log.e("Error", exception.getMessage()); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Task task = taskSnapshot.getMetadata().getReference().getDownloadUrl(); task.addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { if (task.isSuccessful()) { account.setAvatar(uri.toString()); // upload background Bitmap bitmap = ((BitmapDrawable) imgBackground.getDrawable()).getBitmap(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] data = baos.toByteArray(); UploadTask uploadTask = storageReference.child("image").child("image" + System.currentTimeMillis()).putBytes(data); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { Log.e("Error", exception.getMessage()); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Task task = taskSnapshot.getMetadata().getReference().getDownloadUrl(); task.addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { if (task.isSuccessful()) { account.setBackground(uri.toString()); reference.child(uname).setValue(account); Toast.makeText(getActivity(), "Completed!", Toast.LENGTH_SHORT).show(); } else Log.e("Error", "Uncompleted!"); } }); } }); } else Log.e("Error", "Uncompleted!"); } }); } }); } }); } @Override public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode == REQ_GET_AVATAR && resultCode == getActivity().RESULT_OK && data != null){ try { InputStream inputStream = getActivity().getContentResolver().openInputStream(data.getData()); Bitmap bitmap = BitmapFactory.decodeStream(inputStream); imgAvatar.setImageBitmap(bitmap); } catch (FileNotFoundException e) { e.printStackTrace(); } }else if(requestCode == REQ_GET_BACKGROUND && resultCode == getActivity().RESULT_OK && data != null){ try { InputStream inputStream = getActivity().getContentResolver().openInputStream(data.getData()); Bitmap bitmap = BitmapFactory.decodeStream(inputStream); imgBackground.setImageBitmap(bitmap); } catch (FileNotFoundException e) { e.printStackTrace(); } } } }
[ "robocon321n@gmail.com" ]
robocon321n@gmail.com
9eee51a563347798a647d282822d411f99dfd6a5
6a14cc6ffacbe4459b19f882b33d307ab08e8783
/aliyun-java-sdk-cms/src/main/java/com/aliyuncs/cms/model/v20150801/DescribeMetricResponse.java
9097c15ead74ffa96cf95e0b471bde728ad8c7ad
[ "Apache-2.0" ]
permissive
425296516/aliyun-openapi-java-sdk
ea547c7dc8f05d1741848e1db65df91b19a390da
0ed6542ff71e907bab3cf21311db3bfbca6ca84c
refs/heads/master
2023-09-04T18:27:36.624698
2015-11-10T07:52:55
2015-11-10T07:52:55
46,623,385
1
2
null
2016-12-07T18:36:30
2015-11-21T16:28:33
Java
UTF-8
Java
false
false
2,098
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.cms.model.v20150801; import java.util.List; import com.aliyuncs.AcsResponse; import com.aliyuncs.cms.transform.v20150801.DescribeMetricResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DescribeMetricResponse extends AcsResponse { private String code; private String message; private String success; private String traceId; private List<String> datapoints; public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getSuccess() { return this.success; } public void setSuccess(String success) { this.success = success; } public String getTraceId() { return this.traceId; } public void setTraceId(String traceId) { this.traceId = traceId; } public List<String> getDatapoints() { return this.datapoints; } public void setDatapoints(List<String> datapoints) { this.datapoints = datapoints; } @Override public DescribeMetricResponse getInstance(UnmarshallerContext context) { return DescribeMetricResponseUnmarshaller.unmarshall(this, context); } }
[ "malijie@foxmail.com" ]
malijie@foxmail.com
4932b5cda985d31ffcab52ba67631d5c88adf1bf
c65e582dcdf4ed52077fa799dc55adcd0739a147
/entwurfsmuster/src/main/java/de/thorstendiekhof/kurs/entwurfsmuster/state/praxis/erweiterung/EspressoZubereitenZustand.java
f21c9b4ba468f717bcc85692bf09d79791a35d27
[]
no_license
imaan1411/OODesign
3d7ebfdb490e2e7a4d4172620a84ec12dcf52400
8cc24c6a18f4288d7f93e2d35f10900917b125aa
refs/heads/master
2022-04-12T05:14:46.050515
2020-04-01T10:27:22
2020-04-01T10:27:22
248,460,647
0
0
null
null
null
null
UTF-8
Java
false
false
1,217
java
package de.thorstendiekhof.kurs.entwurfsmuster.state.praxis.erweiterung; public class EspressoZubereitenZustand implements Zustand { private KaffeeAutomat automat; public EspressoZubereitenZustand(KaffeeAutomat automat){ this.automat = automat; } public void kaffeeAuswaehlen() { System.out.println("Bitte warten Sie. Ein Espresso wird aktuell zubereitet."); } public void espressoAuswaehlen() { System.out.println("Bitte warten Sie. Ein Espresso wird aktuell zubereitet."); } public void kaffeeBereiten() { } public void espressoBereiten() { automat.bohnen --; System.out.println("Bereite Espresso zu..."); automat.simuliereHardware(); System.out.println("Bitte sehr! Espresso zubereitet."); if(automat.bohnen < 1) automat.zustand = automat.bohnenLeerZustand; else automat.zustand = automat.keinGeldEingeworfenZustand; } public void bohnenAuffuellen() { automat.bohnen = automat.maxBohnen; System.out.println("Bohnen sind wieder voll."); } public void geldEinwerfen() { System.out.println("–Geld wird nicht angenommen–"); System.out.println("Bitte warten Sie. Ein Espresso wird aktuell zubereitet."); } }
[ "iman.luensmann@gmail.com" ]
iman.luensmann@gmail.com
c5f13449a0544e393318bca1854d250169f93efa
f2d82a6bba4abd98d01cf0144dd5bc185d5ae156
/src/main/java/com/mohsen/customer/statementprocessor/controller/StatementProcessorController.java
9e8154c6a3ba04341517226f6738399bc2b917eb
[]
no_license
mohsenV1980/CustomerStatementProcessor
ad56c7ba0f90fdc4718df6c4f819d2803427460e
c3fd1de5057b0e04693ee5d5636710df2741fb27
refs/heads/main
2023-05-26T00:15:08.120836
2021-05-19T08:47:03
2021-05-19T08:47:03
368,494,019
0
0
null
null
null
null
UTF-8
Java
false
false
1,586
java
package com.mohsen.customer.statementprocessor.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.mohsen.customer.statementprocessor.entity.CustomerRecord; import com.mohsen.customer.statementprocessor.entity.StatementResponse; import com.mohsen.customer.statementprocessor.exception.InvalidCustomerRecordException; import com.mohsen.customer.statementprocessor.service.StatementProcessorService; @RestController public class StatementProcessorController { @Autowired private StatementProcessorService statementService; @PostMapping("/") public ResponseEntity<StatementResponse> processStatement(@RequestBody CustomerRecord customerRec) { boolean validBalance = statementService.checkEndingBalance(customerRec); CustomerRecord dupRec = statementService.findDuplicateRef(customerRec); try { if (validBalance && dupRec == null) statementService.addRecord(customerRec); } catch (InvalidCustomerRecordException exp) { StatementResponse response = statementService.createResponse(false, null, null, validBalance); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); } StatementResponse response = statementService.createResponse(true, customerRec, dupRec, validBalance); return new ResponseEntity<>(response, HttpStatus.OK); } }
[ "mohsen.v1980@yahoo.com" ]
mohsen.v1980@yahoo.com
5b1ce1e6c31463092498a76aa4eb1ec8e91890d9
e181dbef56578cc8c41e78cdab8908f204aac3ba
/app/src/test/java/com/example/practica1android/ExampleUnitTest.java
8c401c7728dd5a78a9f5b1a1e5d86a57853caa6f
[]
no_license
MauriciioGS/Practica_1_Android1
feeec4833ff36a11f9d67806389e6af34d792107
5c96455acf2b707700ed863c93cc6875c45aee8c
refs/heads/master
2022-12-11T08:14:32.579389
2020-09-09T00:59:10
2020-09-09T00:59:10
293,943,736
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.example.practica1android; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "mauricaz@outlook.com" ]
mauricaz@outlook.com
8f7ef9c942eceb0b1252a1d95a395778a89bb936
7ae83b5747a87ea885d7e6ab5b02a52fcb2d0ce9
/app/src/main/java/me/jlhp/sivale/database/dao/BaseRepository.java
9a9338fdb47b02906a65b2ecc0dee54914ef11a6
[]
no_license
jlhp/SiVale
e26000f611be0620a3f9d096bf83d62be48d74ab
0927ac40ff65616dbffc0da384deaa6b4bb493e9
refs/heads/master
2021-01-22T13:13:28.599578
2017-03-12T07:02:22
2017-03-12T07:02:22
31,191,589
1
0
null
null
null
null
UTF-8
Java
false
false
4,363
java
package me.jlhp.sivale.database.dao; /** * Created by JOSELUIS on 7/10/2014. */ import android.content.Context; import com.j256.ormlite.dao.RuntimeExceptionDao; import com.j256.ormlite.misc.TransactionManager; import com.j256.ormlite.table.TableUtils; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import me.jlhp.sivale.database.DatabaseHelper; public abstract class BaseRepository<T> { DatabaseHelper databaseHelper; RuntimeExceptionDao<T, Integer> dao; Class<T> entityClass; Context context; public BaseRepository(Context ctx, Class<T> entityClass) { try { this.context = ctx; this.entityClass = entityClass; databaseHelper = new DatabaseHelper(ctx); dao = RuntimeExceptionDao.createDao(databaseHelper.getConnectionSource(), entityClass); } catch (SQLException e) { e.printStackTrace(); } } public int create(T item) { try { return dao.create(item); } catch (Exception e) { e.printStackTrace(); } return 0; } public int createOrUpdate(T item) { try { return dao.createOrUpdate(item).getNumLinesChanged(); } catch (Exception e) { e.printStackTrace(); } return 0; } public int update(T item) { try { return dao.update(item); } catch (Exception e) { e.printStackTrace(); } return 0; } public int delete(T item) { try { return dao.delete(item); } catch (Exception e) { e.printStackTrace(); } return 0; } public T get(int id) { try { return dao.queryForId(id); } catch (Exception e) { e.printStackTrace(); } return null; } public List<T> get(T item) { try { return dao.queryForMatching(item); } catch (Exception e) { e.printStackTrace(); } return new ArrayList<T>(); } public List<T> getAll() { try { return dao.queryForAll(); } catch (Exception e) { e.printStackTrace(); } return new ArrayList<T>(); } public void removeAll() { List<T> items = getAll(); if(items != null && items.size() > 0) { for(T item : items) { delete(item); } } } public void inserBatch(final List<T> items) { try { TransactionManager.callInTransaction(databaseHelper.getConnectionSource(), new Callable<Void>() { public Void call() throws Exception { for (T item : items) { dao.create(item); } return null; } } ); } catch (SQLException e) { e.printStackTrace(); } } public void insertBatchDeleteAllFirst(final List<T> items) { try { TransactionManager.callInTransaction(databaseHelper.getConnectionSource(), new Callable<Void>() { public Void call() throws Exception { TableUtils.clearTable(databaseHelper.getConnectionSource(), entityClass); for (T item : items) { dao.create(item); } return null; } } ); } catch (SQLException e) { e.printStackTrace(); } } public void insertBatchDeleteAllFirst(final List<T> items, boolean dropTable) { try { if(dropTable) { TableUtils.dropTable(databaseHelper.getConnectionSource(), entityClass, true); TableUtils.createTable(databaseHelper.getConnectionSource(), entityClass); } insertBatchDeleteAllFirst(items); } catch (SQLException e) { e.printStackTrace(); } } public RuntimeExceptionDao<T, Integer> getDao(){ return dao; } }
[ "jlherrera1000@gmail.com" ]
jlherrera1000@gmail.com
7cf9e1a3b6c27be0b1a3bb47018d283236b04994
b65318f80650dde027fb30d3ce42e3736ce56f60
/exemplos_livro/chapter02/book-exercise/Book.java
4783bb4440c6be03ea87b5ceafac9e2bc5dd066b
[]
no_license
helioh2/exemplos-bluej
17b679fa8292e46ddcdaee1a57cc963c560907f2
56faea6c6f2b6e4b82a691afd5778fc68db60ae2
refs/heads/master
2022-05-07T19:05:10.766225
2022-05-03T14:48:27
2022-05-03T14:48:27
144,214,914
0
0
null
null
null
null
UTF-8
Java
false
false
1,468
java
/** * A class that maintains information on a book. * This might form part of a larger application such * as a library system, for instance. * * @author (Insert your name here.) * @version (Insert today's date here.) */ class Book { // The fields. private String author; private String title; private int contEmprestimos; /** * Construtor */ public Book(String bookAuthor, String bookTitle) { this.author = bookAuthor; this.title = bookTitle; } /** * Recuperar (pegar) o valor do atributo 'author' */ public String getAuthor(){ return this.author; } public void printAuthor(){ System.out.println(this.author); } public void printDetails(){ String detalhes = "Title: "+this.title + "BLABLABLA"; detalhes = detalhes + "BLUBLU"; if (this.refNumber.length() == 0){ detalhes += "ZZZ"; } else { detalhes += ... } System.out.print(detalhes); } public void setRefNumber(String ref){ //ref = "537" ... ref.length() --> 3 if (ref.length() >= 3) { } else { System.out.print(... } } public void emprestar(){ this.contEmprestimo++; // Exemplo: this.contEmprestimo == 2 --> this.contEmprestimo == 3 } getContEmprestimos() }
[ "heliohenrique3@gmail.com" ]
heliohenrique3@gmail.com
ec9685e15fdad607456ee3c1a715609e5d34b9d9
3809929041e9a943066b4e736f3ae6f44ee0e534
/JavaPractice/MethodArray.java
60f6ffdd58a4fd0906bacf95c2b562df6000554e
[]
no_license
Deva1624/Java_Practise_Programs
0545ebbbd4a7223e31e2683a9936a61b92bf1f79
e18d7934cc33b944b0dba89f78888c0289cf03ba
refs/heads/master
2020-07-05T11:37:00.649916
2019-08-16T01:59:20
2019-08-16T01:59:20
202,638,709
1
0
null
null
null
null
UTF-8
Java
false
false
1,298
java
import java.util.Random; class MethodArray { public int average(int[] data) { int avg = 0; int temp = 0; for (int i = 0; i < data.length; i++) { temp += data[i]; } System.out.println("This iss temp[[[[" + temp); avg = temp / data.length; System.out.println("Thhhhhsisisis average0" + avg); return avg; } public double average(double[] data) { double avg = 0; double temp = 0; for (int i = 0; i < data.length; i++) { temp += data[i]; } System.out.println("This iss temp[[[[" + temp); avg = temp / data.length; System.out.println("Thhhhhsisisis average0" + avg); return avg; } public static void main(String[] args) { int[] data = new int[10]; double[] data2 = new double[10]; Random random = new Random(); for (int i = 0; i < data.length; i++) { data[i] = random.nextInt(20); } for (int i = 0; i < data.length; i++) { data2[i] = random.nextInt(20); } MethodArray ml = new MethodArray(); MethodArray ml2 = new MethodArray(); System.out.println(ml.average(data)); System.out.println(ml2.average(data2)); } }
[ "deva@saasmate.co.in" ]
deva@saasmate.co.in
8455bf131249ef994a8ad516256f1cc247f10c2c
c39918d5cdce90ec74e0be9840792b439b92fae4
/src/main/java/com/doubleysoft/alg/jzoffer/QA_23_HeadOfCircleList.java
31a21969aec06113402cfdc0f6e591ea8758a06a
[]
no_license
AngusLean/leetcode_practice
3a655dfc754f213b5bdb7520fb15be8498464be2
65de4cefe6888b48c21f322b6929368061d50ad4
refs/heads/master
2022-01-20T04:42:12.957142
2022-01-06T15:27:20
2022-01-06T15:27:20
202,334,345
0
0
null
null
null
null
UTF-8
Java
false
false
1,576
java
package com.doubleysoft.alg.jzoffer; import com.doubleysoft.alg.ListNode; /** * 找到有环链表中的头部节点 */ public class QA_23_HeadOfCircleList { public ListNode entryNodeOfLoop(ListNode head) { // 首先找到在环形中的相遇节点 ListNode meetingNode = meetingNode(head); if (meetingNode == null) { return null; } int loopLen = lengthOfLoop(meetingNode); ListNode right = head; ListNode left = head; for (int i = 0; i < loopLen; i++) { right = right.next; } while (right != left) { right = right.next; left = left.next; } return left; } /** * 环形链表中相遇节点 */ private ListNode meetingNode(ListNode head) { if (head == null) { return null; } ListNode slow = head; ListNode fast = slow.next; while (slow != null && fast != null) { if (slow == fast) { return slow; } slow = slow.next; fast = fast.next; if (fast != null) { fast = fast.next; } } return null; } /** * 环形链表的长度 */ private int lengthOfLoop(ListNode meetingNode) { int len = 1; ListNode crt = meetingNode; meetingNode = meetingNode.next; while (meetingNode != crt) { meetingNode = meetingNode.next; len++; } return len; } }
[ "cupofish@gmail.com" ]
cupofish@gmail.com
71ae15449b310a99ecb2c3d791499dceea54115d
a5995b89beb020e7f666038976c85aa12b57c46b
/HospitalPASCode/src/pasCode/ILogin.java
73fe9199cc36e91355a3d2a26b9b9fcc1086c23f
[]
no_license
hannahmcdade/ProjectCode
6eadea6d70cb88a2369ec5aa05e04ed9acc417c0
3228116e848ec04f1bc446fca6ed18ee9193128a
refs/heads/master
2016-09-05T23:01:28.455449
2015-04-27T14:15:04
2015-04-27T14:15:30
34,632,870
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package pasCode; /** * interface to be implemented by staff members to allow them to login to the system * */ public interface ILogin { /** * method to allow staff members to log into the system * @param staffID * @param password * @return */ public Staff login(String staffID, String password); }
[ "hmcdade01@qub.ac.uk" ]
hmcdade01@qub.ac.uk
a2b86d6636796a1d2bea3f23917c8a3f742d4429
99ea48edd08ad69fb1d6d4f0311ecbd71c0622d8
/src/main/java/org/singhindustry/controller/Electric_billController.java
5a890e43037be3aeedadcb1fc030f2a1bc927c1f
[]
no_license
krijanniroula/SinghIndustry
39dce957523960872b1a7fad035cddf5c6795c4b
a691cfd5f92f9fa6d14358e1c46c42ccdefec778
refs/heads/master
2020-04-17T16:59:50.619549
2019-04-06T09:14:23
2019-04-06T09:14:23
166,765,544
1
0
null
null
null
null
UTF-8
Java
false
false
2,851
java
package org.singhindustry.controller; import javax.validation.Valid; import org.singhindustry.entities.Electric_bill; import org.singhindustry.services.Electric_billService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller @RequestMapping("electric_bill") public class Electric_billController { @Autowired private Electric_billService electric_billService; @RequestMapping(value= {"","/"}) public ModelAndView electric_bills() { ModelAndView modelAndView = new ModelAndView(); modelAndView.addObject("electric_bills",electric_billService.findAll()); modelAndView.addObject("mode", "MODE_ALL"); modelAndView.setViewName("electric_bill/index"); return modelAndView; } @GetMapping(value = "/create") public ModelAndView createelectric_bill(Electric_bill electric_bill,Model model) { String[] monthNames = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; model.addAttribute("months", monthNames); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("electric_bill/create"); return modelAndView; } @PostMapping(value = "/save") public String saveelectric_bill(@Valid Electric_bill electric_bill, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return "electric_bill/create"; } electric_billService.save(electric_bill); return "redirect:/electric_bill"; } @GetMapping(value = "/update") public ModelAndView updateelectric_bill(@RequestParam int id) { ModelAndView modelAndView = new ModelAndView(); modelAndView.addObject("electric_bill", electric_billService.findelectric_bill(id)); modelAndView.addObject("mode", "MODE_UPDATE"); modelAndView.setViewName("electric_bill/index"); return modelAndView; } @GetMapping(value = "/view") public ModelAndView viewelectric_bill(@RequestParam int id) { ModelAndView modelAndView = new ModelAndView(); modelAndView.addObject("electric_bill", electric_billService.findelectric_bill(id)); modelAndView.addObject("mode", "MODE_VIEW"); modelAndView.setViewName("electric_bill/index"); return modelAndView; } @GetMapping(value = "/delete") public ModelAndView deleteelectric_bill(@RequestParam int id) { ModelAndView modelAndView = new ModelAndView("redirect:/electric_bill"); electric_billService.delete(id); return modelAndView; } }
[ "krijan.segonatech@gmail.com" ]
krijan.segonatech@gmail.com
3c228f2ae52f881d83baf4a29414a0f6e6eb6804
7cc25a314e494a6324ab0cf31a766a9d423fb501
/src/main/java/com/jninformatica/coursejava/resources/UserResource.java
762b4422c42042c171eff56c3ea28e20561bde5c
[]
no_license
jhooonds/CursoSpringBot-2-java-11
f5ff27823792bc462e38e5452a6aa1a5143e8c00
77795d267afa9a6f85548923ea14aaa8fc5dc391
refs/heads/master
2020-12-05T00:11:56.905432
2020-01-12T15:29:00
2020-01-12T15:29:00
231,946,790
0
0
null
null
null
null
UTF-8
Java
false
false
1,963
java
package com.jninformatica.coursejava.resources; import java.net.URI; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import com.jninformatica.coursejava.entities.User; import com.jninformatica.coursejava.services.UserService; @RestController @RequestMapping(value = "/users") public class UserResource { @Autowired private UserService service; @GetMapping public ResponseEntity<List<User>> findAll() { List<User> list = service.findAll(); return ResponseEntity.ok().body(list); } @GetMapping(value = "/{id}") public ResponseEntity<User> findById(@PathVariable Long id) { User obj = service.findById(id); return ResponseEntity.ok().body(obj); } @PostMapping public ResponseEntity<User> insert(@RequestBody User obj) { obj = service.insert(obj); URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") .buildAndExpand(obj.getId()).toUri(); return ResponseEntity.created(uri).body(obj); } @DeleteMapping(value = "/{id}") public ResponseEntity<Void> delete(@PathVariable Long id){ service.delete(id); return ResponseEntity.noContent().build(); } @PutMapping(value = "/{id}") public ResponseEntity<User> update(@PathVariable Long id, @RequestBody User obj) { obj = service.update(id, obj); return ResponseEntity.ok().body(obj); } }
[ "41707797+jhooonds@users.noreply.github.com" ]
41707797+jhooonds@users.noreply.github.com
c19b14d9ed406459a007182484d3e538f3fbed2b
ac238eb722cdc32ea8a7a95d5eae91f1250f048c
/src/main/java/com/kamalova/java8/transfer/optionals/Card.java
101d72003f9784ef5d4c42c52cbd697aa4994252
[]
no_license
irenkamalova/examples2
47389b2a1ab1739fba8e36ce80d27b2c268ddefb
194c4fd8c4cf1ee8ff44b42461419a406a0212ff
refs/heads/master
2021-06-25T18:37:42.347566
2019-02-05T16:21:03
2019-02-05T16:21:03
129,601,023
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
package com.kamalova.java8.transfer.optionals; import lombok.AllArgsConstructor; import lombok.Getter; import java.util.Optional; @AllArgsConstructor @Getter public class Card { private Optional<Currency> currency; private String tb; }
[ "SBT-Kamalova-IP@sigma.sbrf.ru" ]
SBT-Kamalova-IP@sigma.sbrf.ru
b2abf183db2a0b7497d52397e5798d9d148ff6c5
0bab021cb1727ecd64ade0a4288815109b60fa2b
/e3-manager/e3-manager-pojo/src/main/java/cn/librarian/e3mall/pojo/TbContent.java
e3e7d90fe5d5549c018dfdca75e4e386b65fbbf0
[]
no_license
NLibrarian/e3mall
0469d0383c544a2510b82eefbc3869fadf7cbc61
c87292d4199f9e3d35494460bf54287c8b35e698
refs/heads/master
2021-07-05T19:51:34.253619
2017-09-24T13:05:02
2017-09-24T13:05:02
104,641,432
0
0
null
null
null
null
UTF-8
Java
false
false
2,137
java
package cn.librarian.e3mall.pojo; import java.util.Date; public class TbContent { private Long id; private Long categoryId; private String title; private String subTitle; private String titleDesc; private String url; private String pic; private String pic2; private Date created; private Date updated; private String content; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getCategoryId() { return categoryId; } public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title == null ? null : title.trim(); } public String getSubTitle() { return subTitle; } public void setSubTitle(String subTitle) { this.subTitle = subTitle == null ? null : subTitle.trim(); } public String getTitleDesc() { return titleDesc; } public void setTitleDesc(String titleDesc) { this.titleDesc = titleDesc == null ? null : titleDesc.trim(); } public String getUrl() { return url; } public void setUrl(String url) { this.url = url == null ? null : url.trim(); } public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic == null ? null : pic.trim(); } public String getPic2() { return pic2; } public void setPic2(String pic2) { this.pic2 = pic2 == null ? null : pic2.trim(); } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } public String getContent() { return content; } public void setContent(String content) { this.content = content == null ? null : content.trim(); } }
[ "15539485159@163.com" ]
15539485159@163.com
a570b2714de3e9049a675b8054a298901dd5be9f
0bc247e66f977e2e5f6f7afb773675dfde08ae94
/java-checks/src/main/java/org/sonar/java/checks/FloatEqualityCheck.java
24cad0d56132c3954d9728196137da6d6e793a22
[]
no_license
KetothXupack/sonar-java
f6789e11f012a553fbc07c07aed40143cc42e194
2a2f516dff06c40ebb94421e9ccdce7683fcf54c
refs/heads/master
2020-12-14T07:32:07.646854
2014-10-31T09:54:55
2014-10-31T09:54:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,313
java
/* * SonarQube Java * Copyright (C) 2012 SonarSource * dev@sonar.codehaus.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.java.checks; import com.google.common.collect.ImmutableList; import org.sonar.check.BelongsToProfile; import org.sonar.check.Priority; import org.sonar.check.Rule; import org.sonar.java.model.AbstractTypedTree; import org.sonar.java.model.JavaTree; import org.sonar.java.model.SyntacticEquivalence; import org.sonar.java.resolve.Type; import org.sonar.plugins.java.api.tree.BinaryExpressionTree; import org.sonar.plugins.java.api.tree.ExpressionTree; import org.sonar.plugins.java.api.tree.Tree; import java.util.List; @Rule( key = "S1244", priority = Priority.CRITICAL, tags = {"bug"}) @BelongsToProfile(title = "Sonar way", priority = Priority.CRITICAL) public class FloatEqualityCheck extends SubscriptionBaseVisitor { @Override public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.EQUAL_TO, Tree.Kind.NOT_EQUAL_TO, Tree.Kind.CONDITIONAL_AND, Tree.Kind.CONDITIONAL_OR); } @Override public void visitNode(Tree tree) { BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) tree; if (binaryExpressionTree.is(Tree.Kind.CONDITIONAL_AND, Tree.Kind.CONDITIONAL_OR) && isIndirectEquality(binaryExpressionTree)) { binaryExpressionTree = (BinaryExpressionTree) binaryExpressionTree.leftOperand(); } if ((hasFloatingType(binaryExpressionTree.leftOperand()) || hasFloatingType(binaryExpressionTree.rightOperand())) && !isNanTest(binaryExpressionTree)) { addIssue(binaryExpressionTree, "Equality tests should not be made with floating point values."); } } private boolean isIndirectEquality(BinaryExpressionTree binaryExpressionTree) { return isIndirectEquality(binaryExpressionTree, Tree.Kind.CONDITIONAL_AND, Tree.Kind.GREATER_THAN_OR_EQUAL_TO, Tree.Kind.LESS_THAN_OR_EQUAL_TO) || isIndirectEquality(binaryExpressionTree, Tree.Kind.CONDITIONAL_OR, Tree.Kind.GREATER_THAN, Tree.Kind.LESS_THAN); } private boolean isIndirectEquality(BinaryExpressionTree binaryExpressionTree, Tree.Kind indirectOperator, Tree.Kind comparator1, Tree.Kind comparator2) { if (binaryExpressionTree.is(indirectOperator) && binaryExpressionTree.leftOperand().is(comparator1, comparator2)) { BinaryExpressionTree leftOp = (BinaryExpressionTree) binaryExpressionTree.leftOperand(); if (binaryExpressionTree.rightOperand().is(comparator1, comparator2)) { BinaryExpressionTree rightOp = (BinaryExpressionTree) binaryExpressionTree.rightOperand(); if (((JavaTree) leftOp).getKind().equals(((JavaTree) rightOp).getKind())) { //same operator return SyntacticEquivalence.areEquivalent(leftOp.leftOperand(), rightOp.rightOperand()) && SyntacticEquivalence.areEquivalent(leftOp.rightOperand(), rightOp.leftOperand()); } else { //different operator return SyntacticEquivalence.areEquivalent(leftOp.leftOperand(), rightOp.leftOperand()) && SyntacticEquivalence.areEquivalent(leftOp.rightOperand(), rightOp.rightOperand()); } } } return false; } private boolean isNanTest(BinaryExpressionTree binaryExpressionTree) { return SyntacticEquivalence.areEquivalent(binaryExpressionTree.leftOperand(), binaryExpressionTree.rightOperand()); } private boolean hasFloatingType(ExpressionTree expressionTree) { Type symbolType = ((AbstractTypedTree) expressionTree).getSymbolType(); return symbolType.isTagged(Type.FLOAT) || symbolType.isTagged(Type.DOUBLE); } }
[ "nicolas.peru@sonarsource.com" ]
nicolas.peru@sonarsource.com
6554a50a7d6c7e912384b53bc2ded7a1c1f0f333
9c1388e0d2947198a938e258e62be57e514bbbd1
/sal/util/ErrorStream.java
0a72724fecbffde4314b0969eb724e1077f8c254
[]
no_license
remyfischer/ProgrammingLanguageTheory
cbf192c6e824a6dc9eb3d3a7a7357796f8621e01
4fb0a47b4dc691f94df78557d9ed5d4b015c2b86
refs/heads/master
2021-01-01T17:54:15.617998
2017-07-29T09:21:13
2017-07-29T09:21:13
98,193,813
0
0
null
null
null
null
UTF-8
Java
false
false
4,269
java
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package sal.util; import java.io.PrintStream; /** * Created by simon on 02/06/17. */ public class ErrorStream { private static PrintStream err = System.err; private static boolean stackTrace = false; public static void errorStream(PrintStream ps) { err = ps; } public static void stackTrace(boolean b) { stackTrace = b; } private static String errorSource = ""; public static void errorSource(String errSource) { errorSource = (errSource == null) ? "" : errSource; } private static int errorCount = 0; public static void errorCount(int n) { errorCount = n; } public static void countError() { errorCount++; } public static int errorCount() { return errorCount; } public static void log(int lineNumber) { if(errorSource.length() != 0) err.printf("%s : ", errorSource); if(lineNumber > 0) err.printf("(line %d) ", lineNumber); countError(); } public static void log(int lineNumber, String format, Object... msg) { log(lineNumber); err.printf(format, msg); } public static void log(String format, Object... msg) { log(-1, format, msg); } public static void log(CharView view, String format, Object... msg) { log(-1, view, format, msg); } public static void log(int lineNumber, Throwable exception) { countError(); if(lineNumber > 0) { err.printf("At about line %d ", lineNumber); } err.printf("Uncaught Exception Thrown: %s\n", exception.getMessage() ); if(stackTrace) exception.printStackTrace(err); } public static void log(Throwable exception) { log(-1, exception); } static private final String SPACES = " "; static private final String HIGHLIGHT = "^^^^^^^^^^"; private static void fill(int n, String chars) { int len = chars.length(); while(n >= len) { err.append(chars); n -= len; } char ch = chars.charAt(0); while(n >= 0) { err.append(ch); n -= 1; } } public static void log(int lineNumber, CharView view, String format, Object... msg) { // first print the underlying file buffer CharSequence buffer = view.sequence(); err.append(buffer); int length = buffer.length(); if((length != 0) && (buffer.charAt(length-1) != '\n')) err.append('\n'); // now use the view to highlight the error int start = view.getBeginIndex(); fill(start, SPACES); fill(view.length(), HIGHLIGHT); err.println(); err.print("Error "); if(lineNumber > 0) err.printf("Line %d, ", lineNumber); err.printf("Column %d: ", start); err.printf(format, msg); countError(); } }
[ "remyfischer@live.fr" ]
remyfischer@live.fr
58dc04f8d71cc3270efcd7986d92ae0e8b5d67da
251cb3900b85db8b9dedbdfc46f319be3e81c5a1
/s05e01_acesso/src/s05e01_acesso2/ClasseTres.java
e295c3e942a22d4df64e9ec4bf7698c3d7e1423a
[]
no_license
senapk/poo_2019_2
3cd1e33ee31625ac8927a9b92bc8f72050bc1932
e76b0687f0b2c025cf223a5391ba23a08289ba70
refs/heads/master
2020-07-01T19:14:16.041560
2019-11-08T15:08:51
2019-11-08T15:08:51
201,268,996
5
3
null
null
null
null
UTF-8
Java
false
false
168
java
package s05e01_acesso2; import s05e01_acesso.ClasseDois; public class ClasseTres { public static void main(String[] args) { ClasseDois c2 = new ClasseDois(); } }
[ "sena.ufc@gmail.com" ]
sena.ufc@gmail.com
ea8057e55a99d09b05dd17378cdbf1bf1bb207de
9ee734247827006ed2ef201de7999b6e7dca6390
/ibm.jdk8/src/javax/swing/plaf/synth/SynthToolBarUI.java
1ab43d0db45c1eb82701366f1a1501d61a5b6930
[ "MIT" ]
permissive
flyzsd/java-code-snippets
33341764176f9ea4d023eaa75d36fb8be9786b97
1202b941ec4686d157fbc8643b65d247c6cd2b27
refs/heads/master
2021-01-13T07:48:23.217223
2017-06-23T04:45:12
2017-06-23T04:45:12
95,096,070
0
0
null
null
null
null
UTF-8
Java
false
false
20,486
java
/*=========================================================================== * Licensed Materials - Property of IBM * "Restricted Materials of IBM" * * IBM SDK, Java(tm) Technology Edition, v8 * (C) Copyright IBM Corp. 2002, 2013. All Rights Reserved * * US Government Users Restricted Rights - Use, duplication or disclosure * restricted by GSA ADP Schedule Contract with IBM Corp. *=========================================================================== */ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing.plaf.synth; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Insets; import java.awt.LayoutManager; import java.awt.Rectangle; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.Box; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JSeparator; import javax.swing.JToolBar; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicToolBarUI; import sun.swing.plaf.synth.SynthIcon; /** * Provides the Synth L&amp;F UI delegate for * {@link javax.swing.JToolBar}. * * @since 1.7 */ public class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, SynthUI { private Icon handleIcon = null; private Rectangle contentRect = new Rectangle(); private SynthStyle style; private SynthStyle contentStyle; private SynthStyle dragWindowStyle; /** * Creates a new UI object for the given component. * * @param c component to create UI object for * @return the UI object */ public static ComponentUI createUI(JComponent c) { return new SynthToolBarUI(); } /** * {@inheritDoc} */ @Override protected void installDefaults() { toolBar.setLayout(createLayout()); updateStyle(toolBar); } /** * {@inheritDoc} */ @Override protected void installListeners() { super.installListeners(); toolBar.addPropertyChangeListener(this); } /** * {@inheritDoc} */ @Override protected void uninstallListeners() { super.uninstallListeners(); toolBar.removePropertyChangeListener(this); } private void updateStyle(JToolBar c) { SynthContext context = getContext( c, Region.TOOL_BAR_CONTENT, null, ENABLED); contentStyle = SynthLookAndFeel.updateStyle(context, this); context.dispose(); context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED); dragWindowStyle = SynthLookAndFeel.updateStyle(context, this); context.dispose(); context = getContext(c, ENABLED); SynthStyle oldStyle = style; style = SynthLookAndFeel.updateStyle(context, this); if (oldStyle != style) { handleIcon = style.getIcon(context, "ToolBar.handleIcon"); if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } context.dispose(); } /** * {@inheritDoc} */ @Override protected void uninstallDefaults() { SynthContext context = getContext(toolBar, ENABLED); style.uninstallDefaults(context); context.dispose(); style = null; handleIcon = null; context = getContext(toolBar, Region.TOOL_BAR_CONTENT, contentStyle, ENABLED); contentStyle.uninstallDefaults(context); context.dispose(); contentStyle = null; context = getContext(toolBar, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle, ENABLED); dragWindowStyle.uninstallDefaults(context); context.dispose(); dragWindowStyle = null; toolBar.setLayout(null); } /** * {@inheritDoc} */ @Override protected void installComponents() {} /** * {@inheritDoc} */ @Override protected void uninstallComponents() {} /** * Creates a {@code LayoutManager} to use with the toolbar. * * @return a {@code LayoutManager} instance */ protected LayoutManager createLayout() { return new SynthToolBarLayoutManager(); } /** * {@inheritDoc} */ @Override public SynthContext getContext(JComponent c) { return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { return SynthContext.getContext(c, style, state); } private SynthContext getContext(JComponent c, Region region, SynthStyle style) { return SynthContext.getContext(c, region, style, getComponentState(c, region)); } private SynthContext getContext(JComponent c, Region region, SynthStyle style, int state) { return SynthContext.getContext(c, region, style, state); } private int getComponentState(JComponent c, Region region) { return SynthLookAndFeel.getComponentState(c); } /** * Notifies this UI delegate to repaint the specified component. * This method paints the component background, then calls * the {@link #paint(SynthContext,Graphics)} method. * * <p>In general, this method does not need to be overridden by subclasses. * All Look and Feel rendering code should reside in the {@code paint} method. * * @param g the {@code Graphics} object used for painting * @param c the component being painted * @see #paint(SynthContext,Graphics) */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); SynthLookAndFeel.update(context, g); context.getPainter().paintToolBarBackground(context, g, 0, 0, c.getWidth(), c.getHeight(), toolBar.getOrientation()); paint(context, g); context.dispose(); } /** * Paints the specified component according to the Look and Feel. * <p>This method is not used by Synth Look and Feel. * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. * * @param g the {@code Graphics} object used for painting * @param c the component being painted * @see #paint(SynthContext,Graphics) */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); paint(context, g); context.dispose(); } /** * {@inheritDoc} */ @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintToolBarBorder(context, g, x, y, w, h, toolBar.getOrientation()); } /** * This implementation does nothing, because the {@code rollover} * property of the {@code JToolBar} class is not used * in the Synth Look and Feel. */ @Override protected void setBorderToNonRollover(Component c) {} /** * This implementation does nothing, because the {@code rollover} * property of the {@code JToolBar} class is not used * in the Synth Look and Feel. */ @Override protected void setBorderToRollover(Component c) {} /** * This implementation does nothing, because the {@code rollover} * property of the {@code JToolBar} class is not used * in the Synth Look and Feel. */ @Override protected void setBorderToNormal(Component c) {} /** * Paints the toolbar. * * @param context context for the component being painted * @param g the {@code Graphics} object used for painting * @see #update(Graphics,JComponent) */ protected void paint(SynthContext context, Graphics g) { if (handleIcon != null && toolBar.isFloatable()) { int startX = toolBar.getComponentOrientation().isLeftToRight() ? 0 : toolBar.getWidth() - SynthIcon.getIconWidth(handleIcon, context); SynthIcon.paintIcon(handleIcon, context, g, startX, 0, SynthIcon.getIconWidth(handleIcon, context), SynthIcon.getIconHeight(handleIcon, context)); } SynthContext subcontext = getContext( toolBar, Region.TOOL_BAR_CONTENT, contentStyle); paintContent(subcontext, g, contentRect); subcontext.dispose(); } /** * Paints the toolbar content. * * @param context context for the component being painted * @param g {@code Graphics} object used for painting * @param bounds bounding box for the toolbar */ protected void paintContent(SynthContext context, Graphics g, Rectangle bounds) { SynthLookAndFeel.updateSubregion(context, g, bounds); context.getPainter().paintToolBarContentBackground(context, g, bounds.x, bounds.y, bounds.width, bounds.height, toolBar.getOrientation()); context.getPainter().paintToolBarContentBorder(context, g, bounds.x, bounds.y, bounds.width, bounds.height, toolBar.getOrientation()); } /** * {@inheritDoc} */ @Override protected void paintDragWindow(Graphics g) { int w = dragWindow.getWidth(); int h = dragWindow.getHeight(); SynthContext context = getContext( toolBar, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle); SynthLookAndFeel.updateSubregion( context, g, new Rectangle(0, 0, w, h)); context.getPainter().paintToolBarDragWindowBackground(context, g, 0, 0, w, h, dragWindow.getOrientation()); context.getPainter().paintToolBarDragWindowBorder(context, g, 0, 0, w, h, dragWindow.getOrientation()); context.dispose(); } // // PropertyChangeListener // /** * {@inheritDoc} */ @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JToolBar)e.getSource()); } } class SynthToolBarLayoutManager implements LayoutManager { public void addLayoutComponent(String name, Component comp) {} public void removeLayoutComponent(Component comp) {} public Dimension minimumLayoutSize(Container parent) { JToolBar tb = (JToolBar)parent; Insets insets = tb.getInsets(); Dimension dim = new Dimension(); SynthContext context = getContext(tb); if (tb.getOrientation() == JToolBar.HORIZONTAL) { dim.width = tb.isFloatable() ? SynthIcon.getIconWidth(handleIcon, context) : 0; Dimension compDim; for (int i = 0; i < tb.getComponentCount(); i++) { Component component = tb.getComponent(i); if (component.isVisible()) { compDim = component.getMinimumSize(); dim.width += compDim.width; dim.height = Math.max(dim.height, compDim.height); } } } else { dim.height = tb.isFloatable() ? SynthIcon.getIconHeight(handleIcon, context) : 0; Dimension compDim; for (int i = 0; i < tb.getComponentCount(); i++) { Component component = tb.getComponent(i); if (component.isVisible()) { compDim = component.getMinimumSize(); dim.width = Math.max(dim.width, compDim.width); dim.height += compDim.height; } } } dim.width += insets.left + insets.right; dim.height += insets.top + insets.bottom; context.dispose(); return dim; } public Dimension preferredLayoutSize(Container parent) { JToolBar tb = (JToolBar)parent; Insets insets = tb.getInsets(); Dimension dim = new Dimension(); SynthContext context = getContext(tb); if (tb.getOrientation() == JToolBar.HORIZONTAL) { dim.width = tb.isFloatable() ? SynthIcon.getIconWidth(handleIcon, context) : 0; Dimension compDim; for (int i = 0; i < tb.getComponentCount(); i++) { Component component = tb.getComponent(i); if (component.isVisible()) { compDim = component.getPreferredSize(); dim.width += compDim.width; dim.height = Math.max(dim.height, compDim.height); } } } else { dim.height = tb.isFloatable() ? SynthIcon.getIconHeight(handleIcon, context) : 0; Dimension compDim; for (int i = 0; i < tb.getComponentCount(); i++) { Component component = tb.getComponent(i); if (component.isVisible()) { compDim = component.getPreferredSize(); dim.width = Math.max(dim.width, compDim.width); dim.height += compDim.height; } } } dim.width += insets.left + insets.right; dim.height += insets.top + insets.bottom; context.dispose(); return dim; } public void layoutContainer(Container parent) { JToolBar tb = (JToolBar)parent; Insets insets = tb.getInsets(); boolean ltr = tb.getComponentOrientation().isLeftToRight(); SynthContext context = getContext(tb); Component c; Dimension d; // JToolBar by default uses a somewhat modified BoxLayout as // its layout manager. For compatibility reasons, we want to // support Box "glue" as a way to move things around on the // toolbar. "glue" is represented in BoxLayout as a Box.Filler // with a minimum and preferred size of (0,0). // So what we do here is find the number of such glue fillers // and figure out how much space should be allocated to them. int glueCount = 0; for (int i=0; i<tb.getComponentCount(); i++) { if (isGlue(tb.getComponent(i))) glueCount++; } if (tb.getOrientation() == JToolBar.HORIZONTAL) { int handleWidth = tb.isFloatable() ? SynthIcon.getIconWidth(handleIcon, context) : 0; // Note: contentRect does not take insets into account // since it is used for determining the bounds that are // passed to paintToolBarContentBackground(). contentRect.x = ltr ? handleWidth : 0; contentRect.y = 0; contentRect.width = tb.getWidth() - handleWidth; contentRect.height = tb.getHeight(); // However, we do take the insets into account here for // the purposes of laying out the toolbar child components. int x = ltr ? handleWidth + insets.left : tb.getWidth() - handleWidth - insets.right; int baseY = insets.top; int baseH = tb.getHeight() - insets.top - insets.bottom; // we need to get the minimum width for laying things out // so that we can calculate how much empty space needs to // be distributed among the "glue", if any int extraSpacePerGlue = 0; if (glueCount > 0) { int minWidth = minimumLayoutSize(parent).width; extraSpacePerGlue = (tb.getWidth() - minWidth) / glueCount; if (extraSpacePerGlue < 0) extraSpacePerGlue = 0; } for (int i = 0; i < tb.getComponentCount(); i++) { c = tb.getComponent(i); if (c.isVisible()) { d = c.getPreferredSize(); int y, h; if (d.height >= baseH || c instanceof JSeparator) { // Fill available height y = baseY; h = baseH; } else { // Center component vertically in the available space y = baseY + (baseH / 2) - (d.height / 2); h = d.height; } //if the component is a "glue" component then add to its //width the extraSpacePerGlue it is due if (isGlue(c)) d.width += extraSpacePerGlue; c.setBounds(ltr ? x : x - d.width, y, d.width, h); x = ltr ? x + d.width : x - d.width; } } } else { int handleHeight = tb.isFloatable() ? SynthIcon.getIconHeight(handleIcon, context) : 0; // See notes above regarding the use of insets contentRect.x = 0; contentRect.y = handleHeight; contentRect.width = tb.getWidth(); contentRect.height = tb.getHeight() - handleHeight; int baseX = insets.left; int baseW = tb.getWidth() - insets.left - insets.right; int y = handleHeight + insets.top; // we need to get the minimum height for laying things out // so that we can calculate how much empty space needs to // be distributed among the "glue", if any int extraSpacePerGlue = 0; if (glueCount > 0) { int minHeight = minimumLayoutSize(parent).height; extraSpacePerGlue = (tb.getHeight() - minHeight) / glueCount; if (extraSpacePerGlue < 0) extraSpacePerGlue = 0; } for (int i = 0; i < tb.getComponentCount(); i++) { c = tb.getComponent(i); if (c.isVisible()) { d = c.getPreferredSize(); int x, w; if (d.width >= baseW || c instanceof JSeparator) { // Fill available width x = baseX; w = baseW; } else { // Center component horizontally in the available space x = baseX + (baseW / 2) - (d.width / 2); w = d.width; } //if the component is a "glue" component then add to its //height the extraSpacePerGlue it is due if (isGlue(c)) d.height += extraSpacePerGlue; c.setBounds(x, y, w, d.height); y += d.height; } } } context.dispose(); } private boolean isGlue(Component c) { if (c.isVisible() && c instanceof Box.Filler) { Box.Filler f = (Box.Filler)c; Dimension min = f.getMinimumSize(); Dimension pref = f.getPreferredSize(); return min.width == 0 && min.height == 0 && pref.width == 0 && pref.height == 0; } return false; } } }
[ "zhangshudong@gmail.com" ]
zhangshudong@gmail.com
83bd838040d4c0d4b3df262eebda91afb9709d1b
23f5846e260e20ce6324add9b1e6786cd98012d2
/src/test/java/cn/wolfcode/test/threadpool/TestRunnable.java
43571b4a8ce74ced4c94fe2fa8fe869cee00d352
[]
no_license
KonnaWu/app-test
8cf5c1fb9505eff478f2d51683c92a0dcc112837
401f9ae38daff2c7eea1f79bba1433e175abc9a9
refs/heads/master
2020-03-18T17:29:40.108416
2018-05-27T09:54:48
2018-05-27T09:54:48
135,032,016
0
0
null
null
null
null
UTF-8
Java
false
false
951
java
package cn.wolfcode.test.threadpool; import org.apache.log4j.Logger; public class TestRunnable implements Runnable { private static final Logger LOGGER = Logger.getLogger(TestRunnable.class); private Integer index; public TestRunnable(Integer index) { this.index = index; } public Integer getIndex() { return this.index; } public void run() { Thread currentThread = Thread.currentThread(); TestRunnable.LOGGER.info("线程:" + currentThread.getId() + " 中的任务(" + this.getIndex() + ")开始执行==="); synchronized (currentThread) { try { currentThread.wait(500); } catch (InterruptedException e) { TestRunnable.LOGGER.error(e.getMessage(), e); } } TestRunnable.LOGGER.info("线程:" + currentThread.getId() + " 中的任务(" + this.getIndex() + ")执行完成"); } }
[ "wukanghui2006@163.com" ]
wukanghui2006@163.com
3200b08d91f6ed1cc8bd6fa380e59102be6056c3
75c131be334978fd4c9d64f3e3f90f67dc667261
/ingestion/src/main/java/feast/ingestion/transform/FeatureRowJsonTextIO.java
5814334d8659c7081e8d2231a09549612846f48d
[ "Apache-2.0" ]
permissive
mansiib/feast
27b9dc0ce4c5d60effbedd146bae56d3d2258af8
06cb1ec4ce11c49e76228a49942c6332b2fffee3
refs/heads/master
2020-04-15T10:53:58.235103
2019-01-17T02:28:58
2019-01-17T02:28:58
164,602,593
0
0
Apache-2.0
2019-01-08T08:35:14
2019-01-08T08:35:14
null
UTF-8
Java
false
false
2,863
java
/* * Copyright 2018 The Feast Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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 feast.ingestion.transform; import com.google.common.base.Preconditions; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.util.JsonFormat; import feast.specs.ImportSpecProto.ImportSpec; import feast.types.FeatureRowProto.FeatureRow; import lombok.Builder; import lombok.NonNull; import org.apache.beam.sdk.io.TextIO; import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.ParDo; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PInput; public class FeatureRowJsonTextIO { public static Read read(ImportSpec importSpec) { return Read.builder().importSpec(importSpec).build(); } /** * Transform for processing JSON text jsonfiles and that contain JSON serialised FeatureRow messages, * one per line. * * <p>This transform asserts that the import spec is for only one entity, as all columns must have * the same entity. * * <p>The output is a PCollection of {@link feast.types.FeatureRowProto.FeatureRow FeatureRows}. */ @Builder public static class Read extends FeatureIO.Read { @NonNull private final ImportSpec importSpec; @Override public PCollection<FeatureRow> expand(PInput input) { String path = importSpec.getOptionsOrDefault("path", null); Preconditions.checkNotNull(path, "Path must be set in for file import"); PCollection<String> jsonLines = input.getPipeline().apply(TextIO.read().from(path)); return jsonLines.apply( ParDo.of( new DoFn<String, FeatureRow>() { @ProcessElement public void processElement(ProcessContext context) { String line = context.element(); FeatureRow.Builder builder = FeatureRow.newBuilder(); try { // TODO use proto registry so that it can read Any feature values, not just // primitives. JsonFormat.parser().merge(line, builder); context.output(builder.build()); } catch (InvalidProtocolBufferException e) { throw new RuntimeException(e); } } })); } } }
[ "tsell@google.com" ]
tsell@google.com
5e4e0350ece23e3318923c25bb90f1e9f52abf20
14204c8201ccdf3bd4ea0b40f7756c334214a4d4
/kanban-app/src/main/java/za/co/bmw/kanban/config/SwaggerConfig.java
ba3c07033182f181931ed0ff29a00cfec956a206
[]
no_license
msfurusa/dev-kanban-test
cc9bd655a14b8df9ae52a597c3957427fce54051
15a386284e05f02daf18bec06cf1f19756d2d441
refs/heads/master
2023-06-14T01:14:06.197068
2021-07-15T14:45:58
2021-07-15T14:45:58
385,549,675
0
0
null
null
null
null
UTF-8
Java
false
false
1,386
java
package za.co.bmw.kanban.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Collections; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build() .apiInfo(getApiInfo()); } private ApiInfo getApiInfo() { return new ApiInfo( "Kanban REST API", "This is a REST API of Kanban REST API, where you can get/add/remove/modify Kanban board and its task.", "v1", "Terms of service", new Contact("Contact Guy", "www.doamin.com", "address@domain.com"), "License of API", "API license URL", Collections.emptyList() ); } }
[ "msfurusa@gmail.com" ]
msfurusa@gmail.com
a1ff5ccf06cdc9d0441ae41a9edd8a0827b80030
68c768421e74b681ab9dd7c7dd37c828f63a4d48
/app/src/main/java/com/fixpocket/Fragment/Categories.java
bd2ea419b3e269f04c0b4e8e27a4282d2284b47e
[]
no_license
divine9/Android
9faa4943e60914f93f9863d2e5d0d987fd8daeb0
01b23b4ce0f1d46c35a579baf4e04abbef1d8521
refs/heads/master
2021-01-21T18:24:42.810112
2017-05-23T21:38:11
2017-05-23T21:38:11
92,044,040
0
0
null
null
null
null
UTF-8
Java
false
false
5,381
java
package com.fixpocket.Fragment; import android.content.Context; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.fixpocket.Adapter.TopCategories; import com.fixpocket.Model.CategoryModel.Datum; import com.fixpocket.R; import java.util.List; public class Categories extends Fragment { private ListView CategoryListView; private TextView toolBarTitle; private LinearLayout backButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.categories, container, false); toolBarTitle = (TextView) view.findViewById(R.id.toolBarTitle); toolBarTitle.setText("CATEGORIES"); // loading Categories CategoryListView = (ListView) view.findViewById(R.id.categoryListView); CategoriesAdpter categoriesAdpter = new CategoriesAdpter(getContext(), TopCategories.CategoryList); CategoryListView.setAdapter(categoriesAdpter); backButton = (LinearLayout) view.findViewById(R.id.back_button); backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getFragmentManager().popBackStackImmediate(); } }); return view; } public static Fragment newInstance() { Categories fragment = new Categories(); return fragment; } public class CategoriesAdpter extends BaseAdapter { Fragment selectedFragment = null; private final String CATNAME = null; Context context; List<Datum> CategoryList; public int[] CategoryIcon = {R.drawable.ic_graphic_design, R.drawable.ic_writing, R.drawable.ic_digitalmarketing, R.drawable.ic_cat_video_icon, R.drawable.ic_category_music, R.drawable.ic_cat_programming, R.drawable.ic_cat_advertising, R.drawable.ic_cat_business, R.drawable.ic_cat_funlifestyle}; public CategoriesAdpter(Context c, List<Datum> CategoryList) { // TODO Auto-generated constructor stub context = c; this.CategoryList = CategoryList; } public class Holder { TextView categoryName; ImageView iconCategories; Holder(View view) { categoryName = (TextView) view.findViewById(R.id.categoryName); iconCategories = (ImageView) view.findViewById(R.id.iconCategories); } } @Override public int getCount() { return CategoryList.size(); } @Override public Object getItem(int position) { return CategoryList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { View rowView = convertView; Holder holder = null; if (rowView == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); rowView = inflater.inflate(R.layout.top_categories_single_row, null); holder = new Holder(rowView); rowView.setTag(holder); } else { holder = (Holder) rowView.getTag(); } holder.categoryName.setText(CategoryList.get(position).getTitle()); if (position < 9) holder.iconCategories.setImageResource(CategoryIcon[position]); else holder.iconCategories.setImageResource(0); rowView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub selectedFragment = SubCategories.newInstance(); FragmentTransaction transactionBeatList = ((AppCompatActivity) context).getSupportFragmentManager().beginTransaction(); transactionBeatList.replace(R.id.frame_layout, selectedFragment); transactionBeatList.addToBackStack(null); Bundle args = new Bundle(); args.putString("CATNAME", CategoryList.get(position).getTitle()); args.putString("CATID", CategoryList.get(position).getId()); selectedFragment.setArguments(args); transactionBeatList.commit(); } }); return rowView; } } }
[ "ckpatel219@gmail.com" ]
ckpatel219@gmail.com
aa22fcea311c06f38e5629db2c21b2317853eb92
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/places/adapters/PlaceActivityHoursController_EpoxyHelper.java
33723ade093ea0d70e6cc76558ebed66ddc1b3d9
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
1,039
java
package com.airbnb.android.places.adapters; import com.airbnb.android.core.viewcomponents.models.SectionHeaderEpoxyModel_; import com.airbnb.android.core.viewcomponents.models.ToolbarSpacerEpoxyModel_; import com.airbnb.epoxy.ControllerHelper; public class PlaceActivityHoursController_EpoxyHelper extends ControllerHelper<PlaceActivityHoursController> { private final PlaceActivityHoursController controller; public PlaceActivityHoursController_EpoxyHelper(PlaceActivityHoursController controller2) { this.controller = controller2; } public void resetAutoModels() { this.controller.toolbarSpacerModel = new ToolbarSpacerEpoxyModel_(); this.controller.toolbarSpacerModel.m5710id(-1); setControllerToStageTo(this.controller.toolbarSpacerModel, this.controller); this.controller.sectionHeaderModel = new SectionHeaderEpoxyModel_(); this.controller.sectionHeaderModel.m5554id(-2); setControllerToStageTo(this.controller.sectionHeaderModel, this.controller); } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
a9cdde7561933881c24ee853a9d4abf1d4a27cbd
46deb89a1aef6c6439bc21a1739d458a14da2c7d
/ModulTwoPlusProjects/CookingAll/MyCooking/src/Ingredients/General/Liquid.java
3ef1cd3960ffceb0d2d6d81b3f4c4b89c4a8ad6b
[]
no_license
Bebyno/Progmatic
730a9c86a3b8cdab6b2a166c5bfc0cb581294cdf
587ec9284b277fcef91a35b9ff64dc8ee49dc33a
refs/heads/main
2023-08-28T05:08:19.684646
2021-11-05T18:54:47
2021-11-05T18:54:47
374,940,484
0
0
null
null
null
null
UTF-8
Java
false
false
745
java
package Ingredients.General; public class Liquid { private boolean isPoured = false; private boolean isHeated = false; private String name; public String liquidStatus(Liquid liquid) { String status = ""; if (!isPoured) { status = "Not poured"; } return status; } public boolean isPoured() { return isPoured; } public void setPoured(boolean poured) { isPoured = poured; } public boolean isHeated() { return isHeated; } public void setHeated(boolean heated) { isHeated = heated; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "bebyno888@gmail.com" ]
bebyno888@gmail.com
cf6e325a4f0c2955d47222f573d85806f9138b19
d4cc1b084c6954aee050d449dba1ebff194dfcce
/reactor-stream/src/main/java/reactor/rx/action/error/IgnoreErrorAction.java
d47f32fc9c7b26a6fa0775d9bcad025e34dd774e
[ "Apache-2.0" ]
permissive
sdtm1016/reactor
c08a862d7bf885d2534e0f08d63b909dff6b2c1e
3e5278dee711e5e5c60ae228344326e2f890976d
refs/heads/master
2020-04-03T16:07:59.067424
2015-11-09T01:53:11
2015-11-09T01:53:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,380
java
/* * Copyright (c) 2011-2015 Pivotal Software Inc., Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package reactor.rx.action.error; import reactor.fn.Predicate; import reactor.rx.action.Action; /** * @author Stephane Maldini * @since 2.0 */ final public class IgnoreErrorAction<T> extends Action<T, T> { private final Predicate<? super Throwable> ignorePredicate; public IgnoreErrorAction(Predicate<? super Throwable> ignorePredicate) { this.ignorePredicate = ignorePredicate; } @Override protected void doNext(T ev) { broadcastNext(ev); } @Override public void onError(Throwable cause) { if (!ignorePredicate.test(cause)) { super.onError(cause); }else{ onComplete(); } } @Override public String toString() { return super.toString()+"{" + "ignorePredicate=" + ignorePredicate+ '}'; } }
[ "smaldini@gopivotal.com" ]
smaldini@gopivotal.com
7907fef0d1fbca9dca5bfdbf66c8d922bbcf4a83
cac2400082a961863d069508d19a07e54ae7072c
/src/main/java/SDA/Players.java
8f3ed7468eda1d0501902ad2b78587c284330ecb
[]
no_license
Astropl/KolkoKrzyzykSwing
c818e41dba84aef1cbc5fb73fb62668aa5c6eb9c
7a8bf3e028446ef599467c93837ebbe91f45a3b8
refs/heads/master
2020-03-09T00:49:00.013280
2018-04-07T05:05:09
2018-04-07T05:05:09
128,497,872
0
0
null
null
null
null
UTF-8
Java
false
false
5,303
java
package SDA; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Players extends JFrame { String imie1; String imie2; int imie1SetPionek, imie2SetPionek; int punkty, ustawKolejnosc; private JButton button1; private JPanel panel1; private JTextField textField1; private JButton button2; private JButton button3; private JLabel label, label1; private JButton button4; private JButton button5; //public SDA.PlanszaGlowna planszaGlowna; Players() { System.out.printf("Playrs"); ustawKolejnosc = 1; wyborPlayerow(); } public void wyborPlayerow() { setLayout(null); //setSize(200, 200); setResizable(false); setBounds(800, 200, 300, 300); setTitle(" Wybór imienia"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); add(button1); button1.setBounds(10, 200, 80, 20); button1.setText("Ok"); add(button2); button2.setBounds(110, 200, 80, 20); button2.setText("Anuluj"); add(label); label.setBounds(10, 0, 120, 80); label.setText("WPISZ SWOJE IMIE :"); add(textField1); textField1.setBounds(130, 30, 120, 20); add(label1); label1.setBounds(10, 50, 180, 80); label1.setText("WYBIERZ KRZYZYK LUB KÓŁKO"); add(button4); add(button5); button4.setBounds(10, 110, 50, 50); button5.setBounds(80, 110, 50, 50); button4.setText(""); button5.setText(""); // ImageIcon imageIcon = new ImageIcon(new ImageIcon("Resources/x.jpg").getImage().getScaledInstance(120, 120, Image.SCALE_DEFAULT)); // button4.setIcon(imageIcon); button4.setIcon(new ImageIcon(PlanszaGlowna.class.getResource("Resources/xsmall.jpg"))); button5.setIcon(new ImageIcon(PlanszaGlowna.class.getResource("Resources/osmall.jpg"))); setVisible(true); button4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("krzyzyk"); button5.setEnabled(false); imie1SetPionek = 0; // 0 to krzyzyk, 1 to kołko } }); button5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("kólko"); button4.setEnabled(false); imie1SetPionek = 1; // 0 to krzyzyk, 1 to kołko } }); button1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //System.out.println("Ok"); if (textField1.getText().equals("")) { System.out.println("Podaj imie"); } else { System.out.println("Imie ok " + textField1.getText()); imie1 = textField1.getText(); setImie1(imie1); String msg = textField1.getText(); setImie1(imie1); //dispose(); } } }); } public String getImie1(String imie1) { return imie1; } public void setImie1(String imie1) { this.imie1 = imie1; Class <PlanszaGlowna> p = PlanszaGlowna.class; System.out.println(p);; p.lbl1.setText(textField1.getText());//************************** p. } @Override public String toString() { return "Players{" + "imie1='" + imie1 + '\'' + ", imie2='" + imie2 + '\'' + ", imie1SetPionek=" + imie1SetPionek + ", imie2SetPionek=" + imie2SetPionek + ", punkty=" + punkty + ", ustawKolejnosc=" + ustawKolejnosc + ", button1=" + button1 + ", panel1=" + panel1 + ", textField1=" + textField1 + ", button2=" + button2 + ", button3=" + button3 + ", label=" + label + ", label1=" + label1 + ", button4=" + button4 + ", button5=" + button5 + ", PlanszaGlowna=" + planszaGlowna + "} " + super.toString(); } public String getImie2() { return imie2; } public void setImie2(String imie2) { this.imie2 = imie2; } public int getImie1SetPionek() { return imie1SetPionek; } public void setImie1SetPionek(int imie1SetPionek) { this.imie1SetPionek = imie1SetPionek; } public int getImie2SetPionek() { return imie2SetPionek; } public void setImie2SetPionek(int imie2SetPionek) { this.imie2SetPionek = imie2SetPionek; } public int getPunkty() { return punkty; } public void setPunkty(int punkty) { this.punkty = punkty; } public int getUstawKolejnosc() { return ustawKolejnosc; } public void setUstawKolejnosc(int ustawKolejnosc) { this.ustawKolejnosc = ustawKolejnosc; } }
[ "30636834+Astropl@users.noreply.github.com" ]
30636834+Astropl@users.noreply.github.com
bcbeb985c69f57cc0bbb3884db4fc77e08e04550
9be27614f0a8ee3e71d4868b8dc697855b3ad32b
/dc3_mgt/src/main/java/com/sxit/mgt/caseManage/controller/TeamAction.java
421f70792ef52f9cd55308afeef12a8b53d872ef
[]
no_license
Hoop88/dc3_mgt
a09735ab01eeed656ead0fb60ac2e5c157170f3e
adb88ce4eaf6815fb1df0144adbd7a5ef2dc5af4
refs/heads/master
2016-09-05T17:32:46.489647
2015-09-19T08:38:01
2015-09-19T08:38:01
42,766,070
3
4
null
null
null
null
UTF-8
Java
false
false
6,188
java
package com.sxit.mgt.caseManage.controller; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.validation.Valid; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.Errors; import org.springframework.validation.FieldError; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.sxit.common.utils.MyBeanUtils; import com.sxit.common.excel.ExcelExport; import com.sxit.common.excel.ExcelUtil; import com.sxit.common.action.BaseAction; import com.sxit.common.annatation.AuthPassport; import com.sxit.common.pagehelper.Page; import com.sxit.common.pagehelper.PageVo; import com.sxit.common.dto.ResultMessage; import com.sxit.common.dto.SearchVo; import com.sxit.mgt.caseManage.service.TeamService; import com.sxit.mgt.caseManage.dto.TeamModel; import com.sxit.model.caseManage.TcasTeam; /** * @公司:深讯信科 * @功能:项目团队 Action * @作者:张如兵 * @日期:2015-07-30 14:23:53 * @版本:1.0 * @修改: */ @Controller @RequestMapping("/caseManage") public class TeamAction extends BaseAction { @Autowired private TeamService teamService; /** * 列表 * @param searchTxt * @param page * @param model * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamList") public @ResponseBody ResultMessage list(@ModelAttribute SearchVo vo, PageVo pagevo) { //列表查询 if(pagevo==null) { pagevo = new PageVo(0,10); } Page page = teamService.getTeamList(pagevo, vo.getMap()); return ResultMessage.successPage(page); } /** * 导出Excel * @param searchTxt * @param page * @param model * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamExport") public @ResponseBody ResultMessage export(@ModelAttribute SearchVo vo, PageVo pagevo) { pagevo = new PageVo(0,5000); List list = teamService.getTeamList(pagevo, vo.getMap()); if (list != null && list.size() > 0) { Map map = new HashMap(); Map<Integer, String> stateMap = new HashMap<Integer, String>(); stateMap.put(0, "禁用"); stateMap.put(1, "正常"); stateMap.put(2, "冻结"); map.put("stateMap", stateMap); try { ExcelExport export = ExcelUtil.exportList(list, "teamData", "项目团队数据", map); this.dowloadExcel(export, "teamdata.xls"); return ResultMessage.successMsg("下载成功!"); } catch (Exception e) { e.printStackTrace(); return ResultMessage.errorMsg("下载出错!"); } } else { return ResultMessage.errorMsg("您要下载的数据为空!"); } } /** * 明细 * * @param teamId * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamDetail") public @ResponseBody ResultMessage detail(@RequestParam Long teamId) { String message = ""; if (teamId == null) { message = "项目团队ID不能空"; return ResultMessage.errorMsg(message); } TcasTeam team = teamService.getTeamById(teamId); if (team == null) { message = "未找到该项目团队"; return ResultMessage.errorMsg(message); } return ResultMessage.successMsg("获取成功", team); } /** * 增加 * * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamAdd") public @ResponseBody ResultMessage add(@Valid @RequestBody TeamModel teamModel, Errors errors) { // 判断验证是否通过 if (errors.hasErrors()) { StringBuilder sb = new StringBuilder(); for (FieldError e : errors.getFieldErrors()) { if (sb.length() > 0) { sb.append(","); } sb.append(e.getDefaultMessage()); break; } return ResultMessage.errorMsg(sb.toString()); } TcasTeam team = new TcasTeam(); BeanUtils.copyProperties(teamModel, team); team.setCreateTime(new Date()); //team.setState(1); teamService.insert(team); return ResultMessage.successMsg("添加成功"); } /** * 编辑 * @param vo * @param teamId * @param errors * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamEdit") public @ResponseBody ResultMessage edit(@Valid @RequestBody TeamModel teamModel, Errors errors) { // 判断验证是否通过 if (errors.hasErrors()) { StringBuilder sb = new StringBuilder(); for (FieldError e : errors.getFieldErrors()) { if (sb.length() > 0) { sb.append(","); } sb.append(e.getDefaultMessage()); break; } return ResultMessage.errorMsg(sb.toString()); } Long teamId = teamModel.getTeamId(); String message = ""; if (teamId == null) { message = "项目团队ID不能空"; return ResultMessage.errorMsg(message); } TcasTeam team = teamService.getTeamById(teamId); if (team == null) { message = "未找到该项目团队"; return ResultMessage.errorMsg(message); } MyBeanUtils.copyProperties(teamModel, team,teamModel.colset); //team.setModifyTime(new Date()); teamService.update(team); return ResultMessage.successMsg("修改成功"); } /** * * @param teamId * @return */ @AuthPassport(rightCode = "CaseManage.Team") @RequestMapping(value = "/teamDelete") public @ResponseBody ResultMessage delete(@RequestParam Long teamId) { if (teamId == null) { return ResultMessage.errorMsg("项目团队ID不能空"); } TcasTeam team = teamService.getTeamById(teamId); if (team == null) { return ResultMessage.errorMsg("未找到该项目团队"); } //判断状态 //if(team.getState()==2) //{ teamService.delete(teamId); //}else{ // teamService.updateToDelete(teamId); //} return ResultMessage.successMsg("删除成功"); } }
[ "liudi7799@163.com" ]
liudi7799@163.com
2fad327b949a31d56b8bc87360554658db058f65
ca9b864b1eddc38cf8c199bfca170e4425927eae
/prj10/src/ua/univer/prodCon/Program.java
91d6a360c462c68d382f2d41007a9bf0c4e7846e
[]
no_license
Vlad991/java2
48c22b0e7fd503eda2bf5914dbb85e44bea70a38
2c03706bbe896b575bb395dda223d11778786580
refs/heads/master
2022-06-12T22:21:45.975979
2020-05-03T10:20:23
2020-05-03T10:20:23
260,880,447
0
0
null
null
null
null
UTF-8
Java
false
false
1,526
java
package ua.univer.prodCon; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class Buffer { int n; boolean emptyBuf = true; public synchronized void put(int n) { while (!emptyBuf) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } this.n = n; System.out.println("put = " + n); emptyBuf = false; notifyAll(); } public synchronized int get() { while (emptyBuf) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println("get = " + n); emptyBuf = true; notifyAll(); return n; } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class Producer { public Producer(Buffer buf) { new Thread(() -> { int i = 0; while (true) buf.put(i++); }).start(); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class Consumer { public Consumer(Buffer buf) { new Thread(() -> { while (true) buf.get(); }).start(); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public class Program { public static void main(String[] args) { Buffer buf = new Buffer(); new Consumer(buf); new Producer(buf); new Consumer(buf); new Producer(buf); new Consumer(buf); new Producer(buf); } }
[ "vladkuzma99@gmail.com" ]
vladkuzma99@gmail.com
dc9fec2c9120f8865b849439a52f9bbaa6feb413
2d7ff8c5fc4d25a653cb78a0a8f73267b97b7e00
/ssmOA/src/main/java/com/jzk/simple/bus/domain/BusCustomerExample.java
fa182cb0857e8abe04a232f62b52c5155cd9dbd2
[]
no_license
JiangZhikuan/SpringMVC
4a80ac5eb03caa754c203c7369ae1248bee892b2
f3ad194c65ca4b18239c4df3c2a84f64199269cd
refs/heads/master
2022-12-23T11:24:24.740436
2020-06-03T09:31:29
2020-06-03T09:31:29
250,720,829
3
0
null
2022-12-16T15:26:20
2020-03-28T05:22:41
JavaScript
UTF-8
Java
false
false
20,829
java
package com.jzk.simple.bus.domain; import java.util.ArrayList; import java.util.Date; import java.util.List; public class BusCustomerExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public BusCustomerExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdentityIsNull() { addCriterion("identity is null"); return (Criteria) this; } public Criteria andIdentityIsNotNull() { addCriterion("identity is not null"); return (Criteria) this; } public Criteria andIdentityEqualTo(String value) { addCriterion("identity =", value, "identity"); return (Criteria) this; } public Criteria andIdentityNotEqualTo(String value) { addCriterion("identity <>", value, "identity"); return (Criteria) this; } public Criteria andIdentityGreaterThan(String value) { addCriterion("identity >", value, "identity"); return (Criteria) this; } public Criteria andIdentityGreaterThanOrEqualTo(String value) { addCriterion("identity >=", value, "identity"); return (Criteria) this; } public Criteria andIdentityLessThan(String value) { addCriterion("identity <", value, "identity"); return (Criteria) this; } public Criteria andIdentityLessThanOrEqualTo(String value) { addCriterion("identity <=", value, "identity"); return (Criteria) this; } public Criteria andIdentityLike(String value) { addCriterion("identity like", value, "identity"); return (Criteria) this; } public Criteria andIdentityNotLike(String value) { addCriterion("identity not like", value, "identity"); return (Criteria) this; } public Criteria andIdentityIn(List<String> values) { addCriterion("identity in", values, "identity"); return (Criteria) this; } public Criteria andIdentityNotIn(List<String> values) { addCriterion("identity not in", values, "identity"); return (Criteria) this; } public Criteria andIdentityBetween(String value1, String value2) { addCriterion("identity between", value1, value2, "identity"); return (Criteria) this; } public Criteria andIdentityNotBetween(String value1, String value2) { addCriterion("identity not between", value1, value2, "identity"); return (Criteria) this; } public Criteria andCustnameIsNull() { addCriterion("custname is null"); return (Criteria) this; } public Criteria andCustnameIsNotNull() { addCriterion("custname is not null"); return (Criteria) this; } public Criteria andCustnameEqualTo(String value) { addCriterion("custname =", value, "custname"); return (Criteria) this; } public Criteria andCustnameNotEqualTo(String value) { addCriterion("custname <>", value, "custname"); return (Criteria) this; } public Criteria andCustnameGreaterThan(String value) { addCriterion("custname >", value, "custname"); return (Criteria) this; } public Criteria andCustnameGreaterThanOrEqualTo(String value) { addCriterion("custname >=", value, "custname"); return (Criteria) this; } public Criteria andCustnameLessThan(String value) { addCriterion("custname <", value, "custname"); return (Criteria) this; } public Criteria andCustnameLessThanOrEqualTo(String value) { addCriterion("custname <=", value, "custname"); return (Criteria) this; } public Criteria andCustnameLike(String value) { addCriterion("custname like", value, "custname"); return (Criteria) this; } public Criteria andCustnameNotLike(String value) { addCriterion("custname not like", value, "custname"); return (Criteria) this; } public Criteria andCustnameIn(List<String> values) { addCriterion("custname in", values, "custname"); return (Criteria) this; } public Criteria andCustnameNotIn(List<String> values) { addCriterion("custname not in", values, "custname"); return (Criteria) this; } public Criteria andCustnameBetween(String value1, String value2) { addCriterion("custname between", value1, value2, "custname"); return (Criteria) this; } public Criteria andCustnameNotBetween(String value1, String value2) { addCriterion("custname not between", value1, value2, "custname"); return (Criteria) this; } public Criteria andSexIsNull() { addCriterion("sex is null"); return (Criteria) this; } public Criteria andSexIsNotNull() { addCriterion("sex is not null"); return (Criteria) this; } public Criteria andSexEqualTo(Integer value) { addCriterion("sex =", value, "sex"); return (Criteria) this; } public Criteria andSexNotEqualTo(Integer value) { addCriterion("sex <>", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThan(Integer value) { addCriterion("sex >", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThanOrEqualTo(Integer value) { addCriterion("sex >=", value, "sex"); return (Criteria) this; } public Criteria andSexLessThan(Integer value) { addCriterion("sex <", value, "sex"); return (Criteria) this; } public Criteria andSexLessThanOrEqualTo(Integer value) { addCriterion("sex <=", value, "sex"); return (Criteria) this; } public Criteria andSexIn(List<Integer> values) { addCriterion("sex in", values, "sex"); return (Criteria) this; } public Criteria andSexNotIn(List<Integer> values) { addCriterion("sex not in", values, "sex"); return (Criteria) this; } public Criteria andSexBetween(Integer value1, Integer value2) { addCriterion("sex between", value1, value2, "sex"); return (Criteria) this; } public Criteria andSexNotBetween(Integer value1, Integer value2) { addCriterion("sex not between", value1, value2, "sex"); return (Criteria) this; } public Criteria andAddressIsNull() { addCriterion("address is null"); return (Criteria) this; } public Criteria andAddressIsNotNull() { addCriterion("address is not null"); return (Criteria) this; } public Criteria andAddressEqualTo(String value) { addCriterion("address =", value, "address"); return (Criteria) this; } public Criteria andAddressNotEqualTo(String value) { addCriterion("address <>", value, "address"); return (Criteria) this; } public Criteria andAddressGreaterThan(String value) { addCriterion("address >", value, "address"); return (Criteria) this; } public Criteria andAddressGreaterThanOrEqualTo(String value) { addCriterion("address >=", value, "address"); return (Criteria) this; } public Criteria andAddressLessThan(String value) { addCriterion("address <", value, "address"); return (Criteria) this; } public Criteria andAddressLessThanOrEqualTo(String value) { addCriterion("address <=", value, "address"); return (Criteria) this; } public Criteria andAddressLike(String value) { addCriterion("address like", value, "address"); return (Criteria) this; } public Criteria andAddressNotLike(String value) { addCriterion("address not like", value, "address"); return (Criteria) this; } public Criteria andAddressIn(List<String> values) { addCriterion("address in", values, "address"); return (Criteria) this; } public Criteria andAddressNotIn(List<String> values) { addCriterion("address not in", values, "address"); return (Criteria) this; } public Criteria andAddressBetween(String value1, String value2) { addCriterion("address between", value1, value2, "address"); return (Criteria) this; } public Criteria andAddressNotBetween(String value1, String value2) { addCriterion("address not between", value1, value2, "address"); return (Criteria) this; } public Criteria andPhoneIsNull() { addCriterion("phone is null"); return (Criteria) this; } public Criteria andPhoneIsNotNull() { addCriterion("phone is not null"); return (Criteria) this; } public Criteria andPhoneEqualTo(String value) { addCriterion("phone =", value, "phone"); return (Criteria) this; } public Criteria andPhoneNotEqualTo(String value) { addCriterion("phone <>", value, "phone"); return (Criteria) this; } public Criteria andPhoneGreaterThan(String value) { addCriterion("phone >", value, "phone"); return (Criteria) this; } public Criteria andPhoneGreaterThanOrEqualTo(String value) { addCriterion("phone >=", value, "phone"); return (Criteria) this; } public Criteria andPhoneLessThan(String value) { addCriterion("phone <", value, "phone"); return (Criteria) this; } public Criteria andPhoneLessThanOrEqualTo(String value) { addCriterion("phone <=", value, "phone"); return (Criteria) this; } public Criteria andPhoneLike(String value) { addCriterion("phone like", value, "phone"); return (Criteria) this; } public Criteria andPhoneNotLike(String value) { addCriterion("phone not like", value, "phone"); return (Criteria) this; } public Criteria andPhoneIn(List<String> values) { addCriterion("phone in", values, "phone"); return (Criteria) this; } public Criteria andPhoneNotIn(List<String> values) { addCriterion("phone not in", values, "phone"); return (Criteria) this; } public Criteria andPhoneBetween(String value1, String value2) { addCriterion("phone between", value1, value2, "phone"); return (Criteria) this; } public Criteria andPhoneNotBetween(String value1, String value2) { addCriterion("phone not between", value1, value2, "phone"); return (Criteria) this; } public Criteria andCareerIsNull() { addCriterion("career is null"); return (Criteria) this; } public Criteria andCareerIsNotNull() { addCriterion("career is not null"); return (Criteria) this; } public Criteria andCareerEqualTo(String value) { addCriterion("career =", value, "career"); return (Criteria) this; } public Criteria andCareerNotEqualTo(String value) { addCriterion("career <>", value, "career"); return (Criteria) this; } public Criteria andCareerGreaterThan(String value) { addCriterion("career >", value, "career"); return (Criteria) this; } public Criteria andCareerGreaterThanOrEqualTo(String value) { addCriterion("career >=", value, "career"); return (Criteria) this; } public Criteria andCareerLessThan(String value) { addCriterion("career <", value, "career"); return (Criteria) this; } public Criteria andCareerLessThanOrEqualTo(String value) { addCriterion("career <=", value, "career"); return (Criteria) this; } public Criteria andCareerLike(String value) { addCriterion("career like", value, "career"); return (Criteria) this; } public Criteria andCareerNotLike(String value) { addCriterion("career not like", value, "career"); return (Criteria) this; } public Criteria andCareerIn(List<String> values) { addCriterion("career in", values, "career"); return (Criteria) this; } public Criteria andCareerNotIn(List<String> values) { addCriterion("career not in", values, "career"); return (Criteria) this; } public Criteria andCareerBetween(String value1, String value2) { addCriterion("career between", value1, value2, "career"); return (Criteria) this; } public Criteria andCareerNotBetween(String value1, String value2) { addCriterion("career not between", value1, value2, "career"); return (Criteria) this; } public Criteria andCreatetimeIsNull() { addCriterion("createtime is null"); return (Criteria) this; } public Criteria andCreatetimeIsNotNull() { addCriterion("createtime is not null"); return (Criteria) this; } public Criteria andCreatetimeEqualTo(Date value) { addCriterion("createtime =", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeNotEqualTo(Date value) { addCriterion("createtime <>", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeGreaterThan(Date value) { addCriterion("createtime >", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) { addCriterion("createtime >=", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeLessThan(Date value) { addCriterion("createtime <", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeLessThanOrEqualTo(Date value) { addCriterion("createtime <=", value, "createtime"); return (Criteria) this; } public Criteria andCreatetimeIn(List<Date> values) { addCriterion("createtime in", values, "createtime"); return (Criteria) this; } public Criteria andCreatetimeNotIn(List<Date> values) { addCriterion("createtime not in", values, "createtime"); return (Criteria) this; } public Criteria andCreatetimeBetween(Date value1, Date value2) { addCriterion("createtime between", value1, value2, "createtime"); return (Criteria) this; } public Criteria andCreatetimeNotBetween(Date value1, Date value2) { addCriterion("createtime not between", value1, value2, "createtime"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "62143285+ZhangY46@users.noreply.github.com" ]
62143285+ZhangY46@users.noreply.github.com
5831ba1c2011ae6030a35b548adf29003e01e5f0
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes5.dex_source_from_JADX/com/facebook/graphql/enums/GraphQLPageSuperCategoryType.java
775c36f06ff9835505414e42373331d71206a83d
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
17,800
java
package com.facebook.graphql.enums; import android.support.v7.widget.LinearLayoutCompat; /* compiled from: mCoverPhoto */ public enum GraphQLPageSuperCategoryType { UNSET_OR_UNRECOGNIZED_ENUM_VALUE, ACTIVITIES, APPLICATIONS, BOOKS_MAGAZINES, BRANDS_PRODUCTS, CELEBRITIES, COMPANY_ORGANIZATIONS, DEPRECATED_CATEGORIES, DRINKABLE, DRINKABLE_EXPERIMENT, EDIBLE, EDIBLE_EXPERIMENT, ENTERTAINMENT, FOOD_DRINK, GEO_HUB, GEOGRAPHY, GOINGTOABLE, GOINGTOABLE_EXPERIMENT, LISTENABLE, LISTENABLE_EXPERIMENT, LOCAL, LOCAL_ATTRIBUTES, LOCAL_TOP, DEPRECATED_23, DEPRECATED_24, DEPRECATED_25, DEPRECATED_26, DEPRECATED_27, DEPRECATED_28, MOVIES, MUSIC, NEARBY_PLACES, NEARBY_PLACES__ARTS, NEARBY_PLACES__BAR, DEPRECATED_34, NEARBY_PLACES__BREAKFAST, NEARBY_PLACES__BRUNCH, NEARBY_PLACES__CASUAL_DINING, NEARBY_PLACES__COFFEE_SHOP, DEPRECATED_39, NEARBY_PLACES__DESSERT, NEARBY_PLACES__DINNER, NEARBY_PLACES__ENTERTAINMENT, NEARBY_PLACES__FAST_FOOD, NEARBY_PLACES__GROCERY, NEARBY_PLACES__HOTEL, NEARBY_PLACES__LUNCH, NEARBY_PLACES__NIGHTLIFE, NEARBY_PLACES__OUTDOORS, NEARBY_PLACES__PIZZA, NEARBY_PLACES__PROFESSIONAL_SERVICES, NEARBY_PLACES__RESTAURANT, DEPRECATED_52, NEARBY_PLACES__SHOPPING, NEARBY_PLACES__SIGHTS, NON_REVIEWABLE, NON_REVIEWABLE_CATEGORIES_FOR_UNOWNED_PAGES, OTHER, P0__ARTS_ENTERTAINMENT, P0__AUTOMOTIVE, P0__CITY, P0__COMMUNITY_GOVERNMENT, P0__LODGING, P0__MEDICAL_HEALTH, P0__OTHER, P0__PLACE_TO_EAT_DRINK, P0__PROFESSIONAL_SERVICES, P0__PUBLIC_STRUCTURE, P0__REGION, P0__RELIGIOUS_CENTER, P0__RESIDENCE, P0__SCHOOL, P0__SHOPPING, P0__SPA_BEAUTY_PERSONAL_CARE, P0__SPORTS_RECREATION, P0__TRAVEL_TRANSPORTATION, P0__WORKPLACE_OFFICE, P0_CATEGORIES, PAGE_CATEGORIES, PLACE_TOPICS, PLAYABLE, PLAYABLE_EXPERIMENT, READABLE, READABLE_EXPERIMENT, SPORTS_TEAMS_LEAGUES, SUPPORTABLE, SUPPORTABLE_EXPERIMENT, TOO_BROAD_CATEGORIES, TOPIC_LOCAL, TRAVELLABLE, TRAVELLABLE_EXPERIMENT, TV, WATCHABLE, WATCHABLE_EXPERIMENT, WEBSITE_BLOGS; public static GraphQLPageSuperCategoryType fromString(String str) { if (str == null || str.isEmpty()) { return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; } switch ((((Character.toUpperCase(str.charAt(0)) * 961) + (Character.toUpperCase(str.charAt(str.length() - 1)) * 31)) + str.length()) & 63) { case 0: if (str.equalsIgnoreCase("TV")) { return TV; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 1: if (str.equalsIgnoreCase("NEARBY_PLACES__NIGHTLIFE")) { return NEARBY_PLACES__NIGHTLIFE; } if (str.equalsIgnoreCase("NEARBY_PLACES__PIZZA")) { return NEARBY_PLACES__PIZZA; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case LinearLayoutCompat.SHOW_DIVIDER_MIDDLE /*2*/: if (str.equalsIgnoreCase("EDIBLE_EXPERIMENT")) { return EDIBLE_EXPERIMENT; } if (str.equalsIgnoreCase("OTHER")) { return OTHER; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 3: if (str.equalsIgnoreCase("NEARBY_PLACES__CASUAL_DINING")) { return NEARBY_PLACES__CASUAL_DINING; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case LinearLayoutCompat.SHOW_DIVIDER_END /*4*/: if (str.equalsIgnoreCase("DRINKABLE_EXPERIMENT")) { return DRINKABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 5: if (str.equalsIgnoreCase("LOCAL")) { return LOCAL; } if (str.equalsIgnoreCase("LOCAL_TOP")) { return LOCAL_TOP; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 6: if (str.equalsIgnoreCase("NON_REVIEWABLE_CATEGORIES_FOR_UNOWNED_PAGES")) { return NON_REVIEWABLE_CATEGORIES_FOR_UNOWNED_PAGES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 7: if (str.equalsIgnoreCase("P0__OTHER")) { return P0__OTHER; } if (str.equalsIgnoreCase("P0__SPA_BEAUTY_PERSONAL_CARE")) { return P0__SPA_BEAUTY_PERSONAL_CARE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 9: if (str.equalsIgnoreCase("GOINGTOABLE_EXPERIMENT")) { return GOINGTOABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 12: if (str.equalsIgnoreCase("GEO_HUB")) { return GEO_HUB; } if (str.equalsIgnoreCase("P0__REGION")) { return P0__REGION; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 13: if (str.equalsIgnoreCase("LISTENABLE_EXPERIMENT")) { return LISTENABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 14: if (str.equalsIgnoreCase("NEARBY_PLACES__BAR")) { return NEARBY_PLACES__BAR; } if (str.equalsIgnoreCase("P0__SCHOOL")) { return P0__SCHOOL; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 15: if (str.equalsIgnoreCase("PLAYABLE_EXPERIMENT")) { return PLAYABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 16: if (str.equalsIgnoreCase("NEARBY_PLACES__DESSERT")) { return NEARBY_PLACES__DESSERT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 17: if (str.equalsIgnoreCase("NEARBY_PLACES__DINNER")) { return NEARBY_PLACES__DINNER; } if (str.equalsIgnoreCase("READABLE_EXPERIMENT")) { return READABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 18: if (str.equalsIgnoreCase("NEARBY_PLACES__BREAKFAST")) { return NEARBY_PLACES__BREAKFAST; } if (str.equalsIgnoreCase("P0__ARTS_ENTERTAINMENT")) { return P0__ARTS_ENTERTAINMENT; } if (str.equalsIgnoreCase("P0__RELIGIOUS_CENTER")) { return P0__RELIGIOUS_CENTER; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 19: if (str.equalsIgnoreCase("NEARBY_PLACES__RESTAURANT")) { return NEARBY_PLACES__RESTAURANT; } if (str.equalsIgnoreCase("TOPIC_LOCAL")) { return TOPIC_LOCAL; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 20: if (str.equalsIgnoreCase("P0__COMMUNITY_GOVERNMENT")) { return P0__COMMUNITY_GOVERNMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 21: if (str.equalsIgnoreCase("SUPPORTABLE_EXPERIMENT")) { return SUPPORTABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 22: if (str.equalsIgnoreCase("NEARBY_PLACES__ENTERTAINMENT")) { return NEARBY_PLACES__ENTERTAINMENT; } if (str.equalsIgnoreCase("NEARBY_PLACES__HOTEL")) { return NEARBY_PLACES__HOTEL; } if (str.equalsIgnoreCase("TRAVELLABLE_EXPERIMENT")) { return TRAVELLABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 23: if (str.equalsIgnoreCase("GEOGRAPHY")) { return GEOGRAPHY; } if (str.equalsIgnoreCase("P0__SPORTS_RECREATION")) { return P0__SPORTS_RECREATION; } if (str.equalsIgnoreCase("WATCHABLE_EXPERIMENT")) { return WATCHABLE_EXPERIMENT; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 24: if (str.equalsIgnoreCase("ACTIVITIES")) { return ACTIVITIES; } if (str.equalsIgnoreCase("NEARBY_PLACES__COFFEE_SHOP")) { return NEARBY_PLACES__COFFEE_SHOP; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 26: if (str.equalsIgnoreCase("APPLICATIONS")) { return APPLICATIONS; } if (str.equalsIgnoreCase("NEARBY_PLACES__LUNCH")) { return NEARBY_PLACES__LUNCH; } if (str.equalsIgnoreCase("P0__MEDICAL_HEALTH")) { return P0__MEDICAL_HEALTH; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 27: if (str.equalsIgnoreCase("CELEBRITIES")) { return CELEBRITIES; } if (str.equalsIgnoreCase("NEARBY_PLACES__BRUNCH")) { return NEARBY_PLACES__BRUNCH; } if (str.equalsIgnoreCase("P0__TRAVEL_TRANSPORTATION")) { return P0__TRAVEL_TRANSPORTATION; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 30: if (str.equalsIgnoreCase("BOOKS_MAGAZINES")) { return BOOKS_MAGAZINES; } if (str.equalsIgnoreCase("BRANDS_PRODUCTS")) { return BRANDS_PRODUCTS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 31: if (str.equalsIgnoreCase("P0__CITY")) { return P0__CITY; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 32: if (str.equalsIgnoreCase("MOVIES")) { return MOVIES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 34: if (str.equalsIgnoreCase("NEARBY_PLACES__FAST_FOOD")) { return NEARBY_PLACES__FAST_FOOD; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 37: if (str.equalsIgnoreCase("COMPANY_ORGANIZATIONS")) { return COMPANY_ORGANIZATIONS; } if (str.equalsIgnoreCase("FOOD_DRINK")) { return FOOD_DRINK; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 38: if (str.equalsIgnoreCase("DEPRECATED_CATEGORIES")) { return DEPRECATED_CATEGORIES; } if (str.equalsIgnoreCase("EDIBLE")) { return EDIBLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 40: if (str.equalsIgnoreCase("DRINKABLE")) { return DRINKABLE; } if (str.equalsIgnoreCase("NEARBY_PLACES")) { return NEARBY_PLACES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 41: if (str.equalsIgnoreCase("LOCAL_ATTRIBUTES")) { return LOCAL_ATTRIBUTES; } if (str.equalsIgnoreCase("PLACE_TOPICS")) { return PLACE_TOPICS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 42: if (str.equalsIgnoreCase("P0_CATEGORIES")) { return P0_CATEGORIES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 43: if (str.equalsIgnoreCase("NEARBY_PLACES__GROCERY")) { return NEARBY_PLACES__GROCERY; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 44: if (str.equalsIgnoreCase("PAGE_CATEGORIES")) { return PAGE_CATEGORIES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 45: if (str.equalsIgnoreCase("GOINGTOABLE")) { return GOINGTOABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 46: if (str.equalsIgnoreCase("NEARBY_PLACES__ARTS")) { return NEARBY_PLACES__ARTS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 47: if (str.equalsIgnoreCase("MUSIC")) { return MUSIC; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 48: if (str.equalsIgnoreCase("NEARBY_PLACES__SIGHTS")) { return NEARBY_PLACES__SIGHTS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 49: if (str.equalsIgnoreCase("LISTENABLE")) { return LISTENABLE; } if (str.equalsIgnoreCase("WEBSITE_BLOGS")) { return WEBSITE_BLOGS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 50: if (str.equalsIgnoreCase("NEARBY_PLACES__OUTDOORS")) { return NEARBY_PLACES__OUTDOORS; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 51: if (str.equalsIgnoreCase("PLAYABLE")) { return PLAYABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 52: if (str.equalsIgnoreCase("P0__LODGING")) { return P0__LODGING; } if (str.equalsIgnoreCase("SPORTS_TEAMS_LEAGUES")) { return SPORTS_TEAMS_LEAGUES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 53: if (str.equalsIgnoreCase("P0__SHOPPING")) { return P0__SHOPPING; } if (str.equalsIgnoreCase("READABLE")) { return READABLE; } if (str.equalsIgnoreCase("TOO_BROAD_CATEGORIES")) { return TOO_BROAD_CATEGORIES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 54: if (str.equalsIgnoreCase("P0__PROFESSIONAL_SERVICES")) { return P0__PROFESSIONAL_SERVICES; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 55: if (str.equalsIgnoreCase("NON_REVIEWABLE")) { return NON_REVIEWABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 56: if (str.equalsIgnoreCase("P0__RESIDENCE")) { return P0__RESIDENCE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 57: if (str.equalsIgnoreCase("P0__AUTOMOTIVE")) { return P0__AUTOMOTIVE; } if (str.equalsIgnoreCase("SUPPORTABLE")) { return SUPPORTABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 58: if (str.equalsIgnoreCase("TRAVELLABLE")) { return TRAVELLABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 59: if (str.equalsIgnoreCase("P0__PLACE_TO_EAT_DRINK")) { return P0__PLACE_TO_EAT_DRINK; } if (str.equalsIgnoreCase("WATCHABLE")) { return WATCHABLE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 62: if (str.equalsIgnoreCase("ENTERTAINMENT")) { return ENTERTAINMENT; } if (str.equalsIgnoreCase("NEARBY_PLACES__SHOPPING")) { return NEARBY_PLACES__SHOPPING; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; case 63: if (str.equalsIgnoreCase("NEARBY_PLACES__PROFESSIONAL_SERVICES")) { return NEARBY_PLACES__PROFESSIONAL_SERVICES; } if (str.equalsIgnoreCase("P0__PUBLIC_STRUCTURE")) { return P0__PUBLIC_STRUCTURE; } if (str.equalsIgnoreCase("P0__WORKPLACE_OFFICE")) { return P0__WORKPLACE_OFFICE; } return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; default: return UNSET_OR_UNRECOGNIZED_ENUM_VALUE; } } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
bebad775baa2bab4f94f59be90d98d74520f9e01
f04692611e6e230608dcbedc69f9250db6c130a6
/EclipseProject7_Reynolds/src/Class1.java
3b0c638d7de16fd761e621b20563daa7c6b26c47
[]
no_license
DReynolds4001/myRepository
c98ec5c8b4d3d7c650adb214ba83287acab4479d
9ba3eddf1d1c6f853f73aaeede7983c4b830c9ca
refs/heads/master
2022-12-04T00:35:50.368934
2020-08-02T14:40:30
2020-08-02T14:40:30
284,476,263
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
import java.util.Scanner; public class Class1 { public static void main(String[] args) { } }
[ "daniel2017@my.fit.edu" ]
daniel2017@my.fit.edu
53709d1105ff029b54e1f4b77872165d25860b42
abe60f9bb436e43ea39536edfd7cc2db10604a4c
/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/state/StateRequestHandler.java
cfa86db1b04815bb5bb016073628caf1fbe212b8
[ "Apache-2.0" ]
permissive
VaclavPlajt/beam
b8eae7734931e40c753684d12c158a0b547aa9e6
247a62ff1d4368f1e7c2ade6bed5dec71d8d2bcc
refs/heads/master
2020-03-12T14:25:23.962141
2018-04-23T08:41:08
2018-04-23T08:41:08
130,666,670
0
0
Apache-2.0
2018-04-23T08:41:26
2018-04-23T08:41:26
null
UTF-8
Java
false
false
1,707
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.beam.runners.fnexecution.state; import java.util.concurrent.CompletionStage; import org.apache.beam.model.fnexecution.v1.BeamFnApi; /** * Handler for {@link org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest StateRequests}. */ public interface StateRequestHandler { /** * Handle a {@link org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest} asynchronously. * * <p>The handler is allowed to complete the future within the callers thread if it can be * completed without blocking. Otherwise the caller should delegate to another thread to perform * any blocking work completing the future when able. * * <p>Throwing an error during handling will complete the handler result {@link CompletionStage} * exceptionally. */ CompletionStage<BeamFnApi.StateResponse.Builder> handle(BeamFnApi.StateRequest request) throws Exception; }
[ "axelmagn@gmail.com" ]
axelmagn@gmail.com
7d01f51e1f0d49ba78390620464023210a9ba3f6
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/google/android/exoplayer2/drm/DummyExoMediaDrm.java
78807f09ee61c4b9feb457f39d112d8480b1a484
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
2,619
java
package com.google.android.exoplayer2.drm; import android.media.MediaDrmException; import android.os.PersistableBundle; import com.google.android.exoplayer2.drm.DrmInitData.SchemeData; import com.google.android.exoplayer2.drm.ExoMediaCrypto; import com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest; import com.google.android.exoplayer2.drm.ExoMediaDrm.OnEventListener; import com.google.android.exoplayer2.drm.ExoMediaDrm.OnKeyStatusChangeListener; import com.google.android.exoplayer2.drm.ExoMediaDrm.ProvisionRequest; import com.google.android.exoplayer2.util.Util; import java.util.HashMap; import java.util.List; import java.util.Map; public final class DummyExoMediaDrm<T extends ExoMediaCrypto> implements ExoMediaDrm<T> { public void acquire() { } public void closeSession(byte[] bArr) { } public Class<T> getExoMediaCryptoType() { return null; } public PersistableBundle getMetrics() { return null; } public String getPropertyString(String str) { return ""; } public void release() { } public void setOnEventListener(OnEventListener<? super T> onEventListener) { } public void setOnKeyStatusChangeListener(OnKeyStatusChangeListener<? super T> onKeyStatusChangeListener) { } public void setPropertyByteArray(String str, byte[] bArr) { } public void setPropertyString(String str, String str2) { } public static <T extends ExoMediaCrypto> DummyExoMediaDrm<T> getInstance() { return new DummyExoMediaDrm<>(); } public byte[] openSession() throws MediaDrmException { throw new MediaDrmException("Attempting to open a session using a dummy ExoMediaDrm."); } public KeyRequest getKeyRequest(byte[] bArr, List<SchemeData> list, int i, HashMap<String, String> hashMap) { throw new IllegalStateException(); } public byte[] provideKeyResponse(byte[] bArr, byte[] bArr2) { throw new IllegalStateException(); } public ProvisionRequest getProvisionRequest() { throw new IllegalStateException(); } public void provideProvisionResponse(byte[] bArr) { throw new IllegalStateException(); } public Map<String, String> queryKeyStatus(byte[] bArr) { throw new IllegalStateException(); } public void restoreKeys(byte[] bArr, byte[] bArr2) { throw new IllegalStateException(); } public byte[] getPropertyByteArray(String str) { return Util.EMPTY_BYTE_ARRAY; } public T createMediaCrypto(byte[] bArr) { throw new IllegalStateException(); } }
[ "knag88@gmail.com" ]
knag88@gmail.com
552544b717448cb256e5c3aee88dbea20b03099d
83f256753c32f2d23949dfa70ad29c6e9d2fc71e
/src/main/java/com/maojianwei/service/framework/incubator/network/lib/MaoPeerState.java
1549451773a63cdc82dfd173dee5fbd256bef5a5
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
MaoJianwei/Mao_Service_Framework
71d587e155c51787c37ae59413623772dae5c7b5
a72409715c40fe19d2c2da99ccccf7c9efe795c9
refs/heads/master
2023-08-14T12:13:59.064186
2021-01-25T06:24:55
2021-01-25T06:24:55
219,244,060
1
1
Apache-2.0
2021-09-24T16:22:47
2019-11-03T03:03:38
Java
UTF-8
Java
false
false
158
java
package com.maojianwei.service.framework.incubator.network.lib; public enum MaoPeerState { INIT, CONNECTED, DISCONNECTED, DEAD, ERROR }
[ "maojianwei2012@126.com" ]
maojianwei2012@126.com
d165f4919016d6580b087159ec70ae21e5852501
16d810b426c8fa08fa7a166ba2b8e38e731ee998
/LAB4/src/SunCondition.java
c29e2d62f24c8f1cdb7d3434a4587cfaeb87254a
[]
no_license
sunDalik/Programming-Labs-1course
fdc57e7d7f04eb1e01fa5e0c401e6083c012adc2
9d8659cdcbb4cfee1bb52bfb8e2ed19537f325a0
refs/heads/master
2020-03-31T14:08:31.873312
2018-11-07T12:05:54
2018-11-07T12:05:54
152,281,063
1
0
null
null
null
null
UTF-8
Java
false
false
321
java
public enum SunCondition { Dawn("красивые рассветы"), Sunset("чудесные темно-багровые закаты"); private final String name; SunCondition(String name) { this.name = name; } public String getName() { return this.name; } }
[ "dali1999@mail.ru" ]
dali1999@mail.ru
cf6ebf15360e2a06175557e15f76beb29484c434
949eb5dafbea74ab88fabfadefa1ef378a43f6eb
/src/com/andriidoro/arrays/loops/MinMaxNumber.java
9748dc6356427c01223369eae00158cd382154a8
[]
no_license
andriidoro/autotests
c0163ee1ffded0573c6cce471221e9d3fc6d3fad
6a60c28a8805073764a135641e5439da73b38bc5
refs/heads/master
2021-01-20T22:25:27.884927
2016-08-22T16:25:08
2016-08-22T16:25:08
63,189,772
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package com.andriidoro.arrays.loops; import java.util.Random; public class MinMaxNumber { public static void minMaxNubers() { Random ram = new Random(); System.out.println("Random array is: "); int[] arr3 = new int[50]; for (int i = 0; i < arr3.length; i++) { arr3[i] = ram.nextInt(15); System.out.print(arr3[i] + " "); } System.out.println(); int maxIndex = 0; System.out.println("Max value is: "); for (int b : arr3){ if (arr3[b] > maxIndex) maxIndex = arr3[b]; } System.out.print(maxIndex + " "); System.out.println(); int minIndex = 0; System.out.println("Min value is: "); for (int b : arr3){ if (arr3[b] < minIndex) minIndex = arr3[b]; } System.out.print(minIndex + " "); } }
[ "tafin.avd@gmail.com" ]
tafin.avd@gmail.com
5cd2a81e93f41ce41f2deda5769dbba518649f5e
fd6b9cd58c4b1bf31083e63cb5e116d4e5f1330c
/src/main/java/br/com/petz/api/payload/request/ClientRequest.java
748de340843acffe4bd18dee74bcfc376d620893
[]
no_license
r1casabona/petz
877a5cb154cac7e67328a5d282646eddac7b9c5a
4edff17db69e9f19a0cbec2062659bb0c336a400
refs/heads/master
2022-11-17T14:55:06.520631
2020-07-16T11:20:27
2020-07-16T11:20:27
280,134,349
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package br.com.petz.api.payload.request; import lombok.AllArgsConstructor; import lombok.Data; import javax.validation.constraints.NotBlank; @Data @AllArgsConstructor public class ClientRequest { @NotBlank(message = "Campo obrigatório") private String name; }
[ "r1casabona@gmail.com" ]
r1casabona@gmail.com
4cb9c4fef37b9082f1e48be64100cd988a571644
b68a7e4c5c6c31d6637bcbe5f66f0606d5cef89b
/src/main/java/corona/survivor/spring/model/KodePuskesDTO.java
e63151e510b487c6f887461558b295a3de0713ae
[]
no_license
angga1518/CoronaSurvivor_Spring
145ce12633e3ac99074ba1158a0e6d2aa7da800a
d9e33ec0110629301a1d9fd7f7e1297111782185
refs/heads/master
2023-03-12T05:19:15.487424
2021-02-28T16:36:16
2021-02-28T16:36:16
334,993,706
0
0
null
null
null
null
UTF-8
Java
false
false
705
java
package corona.survivor.spring.model; public class KodePuskesDTO { String kodePuskesmas; String nomorKalender; public String getNomorKalender() { return this.nomorKalender; } public void setNomorKalender(String nomorKalender) { this.nomorKalender = nomorKalender; } public String getKodePuskesmas() { return this.kodePuskesmas; } public void setKodePuskesmas(String kodePuskesmas) { this.kodePuskesmas = kodePuskesmas; } public KodePuskesDTO(){ super(); } public KodePuskesDTO(String kodePuskesmas, String nomorKalender){ this.kodePuskesmas = kodePuskesmas; this.nomorKalender = nomorKalender; } }
[ "hasanahnur@msani.net" ]
hasanahnur@msani.net
d0186c907015328bd92ca012675f9404f857f84c
3af0f8540bef9873c4852b3d99824f8fe56140a3
/app/src/main/java/com/example/mh/MainActivity.java
fc92c77c33d59e301601f1fc7eb937151da34acc
[]
no_license
ajmal8898/data-passsing-toast-activity-navigation
5c2bd0bd1da575855390b5d6d07725d2b99fdc32
4efc992d83c04eb88ae7b5996a338a185af4fd97
refs/heads/master
2023-04-17T18:27:23.124912
2021-03-31T08:35:20
2021-03-31T08:35:20
353,284,173
0
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package com.example.mh; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.content.Intent; import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.text.TextUtils; public class MainActivity extends AppCompatActivity { Button sndbutt; EditText sndtxt; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sndbutt = (Button)findViewById(R.id.btn); sndtxt = (EditText)findViewById(R.id.txtname); sndbutt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (TextUtils.isEmpty(sndtxt.getText().toString())) { Toast.makeText(MainActivity.this, "Empty field not allowed!", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "login sucess..", Toast.LENGTH_SHORT).show(); String str = sndtxt.getText().toString(); Intent intent = new Intent(getApplicationContext(), MainActivity2.class); intent.putExtra("message", str); startActivity(intent); } } }); } }
[ "ajmal.m@inxsasia.com" ]
ajmal.m@inxsasia.com
048d96aab2c907b984cabb48b96961adbed2209d
2adaa3f82b06069b64a6da9aa9f502f2be2e4b11
/src/com/study/designmodel/factory/commonfactory/MailSender.java
9b8733a7bcaf563b3e835455207c9cf3f2e26611
[]
no_license
yezuoyi/javastudy
72fc828ef74001b751526092abd5368639b31017
802519c239fc286e8a570e3fd9735e666c3390bd
refs/heads/master
2021-09-05T04:06:52.495974
2018-01-24T02:47:17
2018-01-24T02:47:17
107,487,624
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
package com.study.designmodel.factory.commonfactory; public class MailSender implements Sender { @Override public void Send() { System.out.println("this is mailsender!"); } }
[ "yezuoyi@163.com" ]
yezuoyi@163.com
64d744705ac102d935233a28f75b89407bff6ea6
7af8d00c9c80087e6e503717e081066dc40609d5
/microservice-kubernetes-demo/microservice-catalog/src/test/java/com/cts/microservice/catalog/cdc/CatalogConsumerDrivenContractTest.java
0517978f31a2e9f6aa658a3a4453dee4fe78a7e8
[ "Apache-2.0" ]
permissive
aditya05193/kube-microsvc
73ce4d99c5e8e73a3549320156af65cd564af9b5
108441c16e13ad171aef739918d9e99e23dac1c1
refs/heads/master
2020-03-29T09:05:38.317761
2018-10-15T10:39:26
2018-10-15T10:39:26
149,741,094
0
0
null
null
null
null
UTF-8
Java
false
false
1,281
java
package com.cts.microservice.catalog.cdc; import static org.junit.Assert.*; import java.util.Collection; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.cts.microservice.catalog.CatalogApp; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = CatalogApp.class, webEnvironment = WebEnvironment.DEFINED_PORT) @ActiveProfiles("test") public class CatalogConsumerDrivenContractTest { @Autowired private CatalogClient catalogClient; @Test public void testFindAll() { //Collection<Item> result = catalogClient.findAll(); //assertEquals(1, result.stream().filter(i -> (i.getName().equals("iPhone") && i.getPrice() == 32670.0 && i.getItemId() == 1)).count()); } @Test public void testGetOne() { //Collection<Item> allItems = catalogClient.findAll(); //Long id = allItems.iterator().next().getItemId(); //Item result = catalogClient.getOne(id); //assertEquals(id.longValue(), result.getItemId()); } }
[ "noreply@github.com" ]
noreply@github.com
70c995c65f5289cdb96adbf5a91cffbcb0aa367b
e75f3ca89a43c99af89f4e5a88a5af406c42c9bc
/4/AI/src/Agents/Fireman.java
3789a5c3474ca417032b885c46e7bd66352ee6c7
[]
no_license
catarinamachado/uminho-miei
95e8f17eb81b0031c773eff78ed7df30060dd53d
029795b55fdd582641b3bc05a12b43f84060d72a
refs/heads/master
2023-03-09T07:50:46.281220
2021-05-30T16:23:45
2021-05-30T16:23:45
156,120,243
26
13
null
2023-02-25T05:45:21
2018-11-04T20:08:07
HTML
UTF-8
Java
false
false
5,477
java
package Agents; import Agents.Behaviours.HandleFiremanMessages; import Agents.Behaviours.MovingFireman; import Logic.Fire; import Logic.World; import Logic.Zone; import Util.Ocupation; import Util.Position; import jade.core.AID; import jade.core.Agent; import jade.core.behaviours.TickerBehaviour; import java.util.ArrayList; import java.util.List; public abstract class Fireman extends Agent { private Position std_position; private Position actual_position; private Fire treating_fire; private Fire exception_fire; private Zone zone; private List<Position> fuel; private List<Position> water; private List<Position> houses; private ArrayList<Fire> fires; private int cap_max_water; private int cap_max_fuel; private int cap_water; private int cap_fuel; private int vel; private Ocupation ocupation; private AID station; private int dimension; private Position destiny; public void setup(){ super.setup(); Object[] args = getArguments(); World world = (World) args[0]; this.fuel = world.getFuel(); this.water = world.getWater(); this.houses = world.getHouses(); this.fires = new ArrayList<>(); this.std_position = new Position(0,0); this.actual_position = new Position(0,0); this.ocupation = Ocupation.RESTING; this.dimension = World.dimension; this.destiny = null; this.addBehaviour(new HandleFiremanMessages()); this.addBehaviour(new MovingFireman(this)); /* this.addBehaviour(new TickerBehaviour(this,1000) { @Override protected void onTick() { Fireman f = (Fireman)this.myAgent; System.out.println(f.toString()); } }); */ } public void takeDown(){ //System.out.println(fuel.toString()); } public Position getDestiny(){ return this.destiny; } public void setDestiny(Position pos) { this.destiny = pos; } public ArrayList<Fire> getFires() { return fires; } public Position getStd_position() { return std_position; } public Position getActual_position() { return actual_position; } public Fire getTreating_fire() { return treating_fire; } public Fire getException_fire() { return exception_fire; } public Zone getZone() { return zone; } public List<Position> getFuel() { return fuel; } public List<Position> getWater() { return water; } public List<Position> getHouses() { return houses; } public int getCap_max_water() { return cap_max_water; } public int getCap_max_fuel() { return cap_max_fuel; } public int getCap_water() { return cap_water; } public int getCap_fuel() { return cap_fuel; } public int getVel() { return vel; } public Ocupation getOcupation() { return ocupation; } public void setStd_position(Position std_position) { this.std_position = std_position; } public void setActual_position(Position actual_position) { this.actual_position = actual_position; } public void setTreating_fire(Fire treating_fire) { this.treating_fire = treating_fire; } public void setException_fire(Fire exception_fire) { this.exception_fire = exception_fire; } public void setZone(Zone zone) { this.zone = zone; } public void setFuel(List<Position> fuel) { this.fuel = fuel; } public void setWater(List<Position> water) { this.water = water; } public void setHouses(List<Position> houses) { this.houses = houses; } public void setCap_max_water(int cap_max_water) { this.cap_max_water = cap_max_water; } public void setCap_max_fuel(int cap_max_fuel) { this.cap_max_fuel = cap_max_fuel; } public void setCap_water(int cap_water) { this.cap_water = cap_water; } public void setCap_fuel(int cap_fuel) { this.cap_fuel = cap_fuel; } public void setVel(int vel) { this.vel = vel; } public void setOcupation(Ocupation ocupation) { this.ocupation = ocupation; } public AID getStation() { return station; } public void setStation(AID station) { this.station = station; } public void setFires(ArrayList<Fire> fires) { this.fires = fires; } public int getDimension() { return dimension; } public void setDimension(int dimension) { this.dimension = dimension; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("\nFireman " + getAID().getName() + " Information: \n"); sb.append("- Std position: " + this.getStd_position() + "\n"); sb.append("- Actual position: " + this.getActual_position() + "\n"); sb.append("- Actual Fuel: " + this.getCap_fuel() + "\n"); sb.append("- Actual Water: " + this.getCap_water() + "\n"); sb.append("- Destiny: " + this.getDestiny() + "\n"); sb.append("- Treating fire: " + this.getTreating_fire() + "\n"); sb.append("- Exception fire: " + this.getException_fire() + "\n\n"); return sb.toString(); } }
[ "catarinamachado11@gmail.com" ]
catarinamachado11@gmail.com
9d26d698ff7873550aa0f65324e68a920a36d9a1
80653b441e54e1db172380791686bfe9e2d0355b
/Demo001/app/src/main/java/com/example/asus/Core/storage/FileStorage.java
dff347fe5e0931d97b7ebc27aa0550164b3603fe
[]
no_license
MrBigCuck/NF-torrent-complete
23c4855e9969fccb993969b6dcb3d96e0295afe1
39fee3181b125459940b7a02ceb99260487a0a0f
refs/heads/master
2020-03-23T15:18:27.400121
2018-07-22T22:38:04
2018-07-22T22:38:04
141,736,994
0
2
null
null
null
null
UTF-8
Java
false
false
2,851
java
package com.example.asus.Core.storage; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import org.apache.commons.io.FileUtils; public class FileStorage implements TorrentByteStorage{ private File current; private final File target; private final File partial; private final long offset; private final long size; private RandomAccessFile raf; private FileChannel channel; public FileStorage(File file ,long size)throws IOException{ this(file , 0 , size); } public FileStorage(File file , long offset , long size)throws IOException{ this.target = file; this.offset=offset; this.size=size; this.partial = new File(this.target.getAbsolutePath() + TorrentByteStorage.PARTIAL_FILE_NAME_SUFFIX); if(this.partial.exists()){ System.out.println("partial download found continuing.."); this.current = this.partial; } else if(!this.target.exists()){ System.out.println("starting new download .."); this.current=this.partial; } else{ System.out.println("existing file found lets use it.."); this.current = this.target; } this.raf = new RandomAccessFile(this.current , "rw"); if(file.length() != this.size){ this.raf.setLength(this.size); } this.channel = raf.getChannel(); } protected long offset() { return this.offset; } @Override public int read(ByteBuffer buffer, long offset) throws IOException { int requested = buffer.remaining(); if(offset + requested > this.size){ throw new IllegalArgumentException("invalid storage read request nigger!"); } int bytes = channel.read(buffer,offset); if(bytes < requested){ throw new IOException("storage underrun!"); } return bytes; } @Override public int write(ByteBuffer buffer, long offset) throws IOException { int requested = buffer.remaining(); if(offset + requested > this.size){ throw new IllegalArgumentException("invalid storage write request nigger!"); } return this.channel.write(buffer,offset); } @Override public long size() { return this.size; } @Override public synchronized void close() throws IOException { if(channel.isOpen()){ channel.force(true); } this.raf.close(); } @Override public synchronized void finish() throws IOException { if(channel.isOpen()){ channel.force(true); } if(isFinished()){ return; } this.raf.close(); FileUtils.deleteQuietly(this.target); FileUtils.moveFile(this.current,this.target); this.raf = new RandomAccessFile(this.target, "rw"); this.raf.setLength(this.size); this.channel = this.raf.getChannel(); this.current = this.target; FileUtils.deleteQuietly(this.partial); } @Override public boolean isFinished() { return this.current.equals(this.target); } }
[ "hahah@gmail.com" ]
hahah@gmail.com
1dbf0966fed01f3eef533de3c0e608d8b36c607a
fbe959c8c8bb435721183e3a29b43651e803f467
/src/main/java/com/restful/sales/repository/SanphamRepository.java
e8d11c20fb99c30c380364170bd0773260c1bdaf
[]
no_license
dinhthuy1602/SAPO
564cb66e5c4bf801c9e58c75bdf85b95d0a194ab
ae019eb2c25913eba69a4acb39478c3672858c2d
refs/heads/master
2022-04-08T11:30:10.279014
2020-03-08T15:23:32
2020-03-08T15:23:32
245,838,197
0
1
null
null
null
null
UTF-8
Java
false
false
288
java
package com.restful.sales.repository; import com.restful.sales.entities.Sanpham; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface SanphamRepository extends JpaRepository<Sanpham, Integer> { }
[ "dinhthuy1602@users.noreply.github.com" ]
dinhthuy1602@users.noreply.github.com
6f204201ec6c8dfc56dc57f3bae7dbea3657025e
23c273292e39b55715c3dc2684530de7f86be470
/ProblemaCompuesto.java
1b2725803709b0d1331f5c94c4a84b15a15ecbcf
[]
no_license
SaguiraBlack/ProblemaCompuestoProba
baf7c96aa1d5efa42eb5618da6f757f878bd52f1
f91ee05dbfa6cadf0dc8033185f11ae816f1ffe4
refs/heads/main
2023-03-17T12:56:29.775954
2021-03-09T06:30:09
2021-03-09T06:30:09
345,905,857
0
0
null
null
null
null
UTF-8
Java
false
false
3,462
java
/** TOVAR ESPEJO M. JOSEFINA | ESCOM | PROBABILIDAD Y ESTADÍSTICA 2CV18 **/ /* Importación de bibliotecas */ import java.util.Scanner; /* Clase del Problema Compuesto */ public class ProblemaCompuesto { /* Inicializando variables a usar */ Scanner lector = new Scanner(System.in); private int cantidadProblemasSimples; private ProblemaSimple[] problemasSimples; private int cantidadCombinaciones; private String[][] combinaciones; private int[] indices; /* Función para pedir el número de problemas simples a ingresar */ public void pedirProblemasSimples() { System.out.println("¿Cuantos problemas simples hay?"); cantidadProblemasSimples = lector.nextInt(); lector.nextLine(); /* Se inicializa el arreglo con el tamaño de la cantidad de problemas simples */ problemasSimples = new ProblemaSimple[cantidadProblemasSimples]; for(int i = 0; i < cantidadProblemasSimples; i++) { System.out.println("Ingresando problema simple " + (i+1)); /* Se agrega un nuevo objeto */ problemasSimples[i] = new ProblemaSimple(); } /* Arreglo de indices auxiliares para mostrar las combinaciones posibles */ indices = new int[cantidadProblemasSimples]; } /* Función que calcula la cantidad de resultados posibles */ public void imprimirResultadosTotales() { for(int i = 0; i < cantidadProblemasSimples; i++) { problemasSimples[i].imprimirResultados(i); } } /* Funcióm que calcula cuáles son las combinaciones posibles */ public void calcularCombinaciones() { cantidadCombinaciones = 1; for(int i = 0; i < cantidadProblemasSimples; i++) { cantidadCombinaciones = cantidadCombinaciones * problemasSimples[i].getCantidadResultados(); } System.out.println("La cantidad de combinaciones posibles es: " + cantidadCombinaciones); /* Se utiliza un arreglo bidimensional */ combinaciones = new String[cantidadCombinaciones][cantidadProblemasSimples]; for(int j = 0; j < cantidadCombinaciones; j++) { for(int k = 0; k < cantidadProblemasSimples; k++) { combinaciones[j][k] = problemasSimples[k].getNombresResultados()[indices[k]]; } /* Esto corresponde a los índices auxiliares */ aumentarIndice(cantidadProblemasSimples-1); } } /* Función que imprime las combinaciones posibles, guardadas en el arreglo */ public void imprimirCombinaciones() { for (int x = 0; x < combinaciones.length; x++) { System.out.print("["); for (int y = 0; y < combinaciones[x].length; y++) { System.out.print (combinaciones[x][y]); if (y != combinaciones[x].length-1) System.out.print("\t"); } System.out.println("]"); } } /* Función que aumenta el índice del arreglo auxiliar */ public void aumentarIndice(int k) { if (k < 0) return; if(indices[k] >= problemasSimples[k].getCantidadResultados()-1) { indices[k] = 0; aumentarIndice(k-1); } else { indices[k] += 1; } } /* Constructor de la clase */ public ProblemaCompuesto() { pedirProblemasSimples(); } }
[ "noreply@github.com" ]
noreply@github.com
857797fc25b31962a3bc36fda6c09b609f5822b6
dd15304b40e895af11cc3f00fe4f65c42b7ea84e
/src/main/java/com/gtj/spider/impl/store/HBaseStoreImpl.java
f0d78574f380c40cedbcbc4d0fc96666fe275733
[]
no_license
gtimars/bilibili_spider
ce4f451c0ddb406f5b4e1c32c1a7657754b71224
3d4b77376b1e62cd4c4493bde3d6d5d460c889bb
refs/heads/master
2020-05-18T05:38:18.789064
2019-05-02T05:44:21
2019-05-02T05:44:21
184,212,750
1
0
null
null
null
null
UTF-8
Java
false
false
4,083
java
package com.gtj.spider.impl.store; import com.gtj.spider.entity.UserPage; import com.gtj.spider.entity.VideoPage; import com.gtj.spider.service.IStorePage; import com.gtj.spider.util.HBaseUtil; import com.gtj.spider.util.StringUtil; import java.io.IOException; /** * Hbase存储实现类 * * @author gtj */ public class HBaseStoreImpl implements IStorePage{ HBaseUtil hBaseUtil = new HBaseUtil(); @Override public void storeVideo(VideoPage page) { //设计rowkey String aid = StringUtil.getFixedLengthStr(page.getAid(),8); String rowkey = StringUtil.getReverseStr(aid); try { hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.AID, page.getAid()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.TITLE, page.getTitle()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.DESC, page.getDesc()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.PUBDATE, page.getPubdate()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.AUTHOR, page.getAuthor()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.VIEW, page.getView()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.DANMAKU, page.getDanmaku()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.FAVORITE, page.getFavorite()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.LIKE, page.getLike()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.SHARE, page.getShare()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.REPLY, page.getReply()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.TNAME, page.getTname()); hBaseUtil.put(HBaseUtil.VIDEO_TABLE_NAME, rowkey, HBaseUtil.VIDEO_COLUMNFAMILY, HBaseUtil.COIN, page.getCoin()); } catch (IOException e) { e.printStackTrace(); } } @Override public void storeUser(UserPage page) { //设计rowkey String userid = StringUtil.getFixedLengthStr(page.getUserid(),8); String rowkey = StringUtil.getReverseStr(userid); try { hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.USERID, page.getUserid()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.USERNAME, page.getUsername()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.SIGN, page.getSign()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.SEX, page.getSex()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.BIRTHDAY, page.getBirthday()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.LEVEL, page.getLevel()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.COINS, page.getCoins()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.FOLLOWER, page.getFollower()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.FOLLOWING, page.getFollowing()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.VIEWNUM, page.getView()); hBaseUtil.put(HBaseUtil.USER_TABLE_NAME, rowkey , HBaseUtil.USER_COLUMNFAMILY,HBaseUtil.VIDEONUM, page.getVideoNum()); } catch (IOException e) { e.printStackTrace(); } } }
[ "gtj1416630217@163.com" ]
gtj1416630217@163.com
b5adab43e2b6dfdfd8d6b6e832f1d582241512cc
cfdc3747549b018f4ebaccae28c6e5ff4d52da50
/app/src/main/java/com/maymeng/read/ui/activity/ZhihuWebViewActivity.java
68fc6630503a055df453ff9ba7f8b1448672200b
[]
no_license
leijiaxq/Read
bcd86506f424be1b2baf76556c7da07bf3fa62ae
212ff67de64f984d57d2a15314552dd374c8727c
refs/heads/master
2021-01-19T12:34:16.134295
2017-04-12T10:32:48
2017-04-12T10:32:48
88,038,093
0
0
null
null
null
null
UTF-8
Java
false
false
9,820
java
package com.maymeng.read.ui.activity; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; import com.maymeng.read.R; import com.maymeng.read.api.RetrofitHelper; import com.maymeng.read.base.RxBaseActivity; import com.maymeng.read.bean.BaseBean; import com.maymeng.read.bean.ZhihuDetailBean; import com.maymeng.read.utils.ConvertUtil; import com.maymeng.read.utils.ScreenUtil; import butterknife.BindView; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by leijiaxq * Date 2017/4/7 17:53 * Describe */ public class ZhihuWebViewActivity extends RxBaseActivity { @BindView(R.id.web_view) WebView mWebView; @BindView(R.id.toolbar) Toolbar mToolbar; private int mZhihu_id; ProgressBar mProgressBar; @Override public int getLayoutId() { return R.layout.activity_zhihu_webview; } @Override public void initViews(Bundle savedInstanceState) { showProgressDialog(""); mZhihu_id = getIntent().getIntExtra("zhihu_id", 0); setSupportActionBar(mToolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { // actionBar.setHomeAsUpIndicator(R.drawable.); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(""); } WebSettings webSetting = mWebView.getSettings(); webSetting.setJavaScriptEnabled(true); webSetting.setSupportMultipleWindows(true); webSetting.setDefaultTextEncodingName("UTF-8"); webSetting.setSupportZoom(true); // 设置出现缩放工具 webSetting.setBuiltInZoomControls(true); //扩大比例的缩放 // webSetting.setUseWideViewPort(true); //自适应屏幕 webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); webSetting.setLoadWithOverviewMode(true); // webSetting.setUserAgentString(Constant.UA); // 设置允许JS弹窗 webSetting.setJavaScriptCanOpenWindowsAutomatically(true); //载入js mWebView.addJavascriptInterface(new JavascriptInterface(this), "imagelistner"); // DocumentsContract.Document document = Jsoup.connect(mUrl).get(); // document.getElementsByClass("header-container").remove(); // document.getElementsByClass("footer").remove(); // WebSettings ws = mWebView.getSettings(); // ws.setJavaScriptEnabled(true); // //mWebView.loadData(document.toString(),"text/html","utf-8"); // mWebView.loadDataWithBaseURL(mUrl,document.toString(),"text/html","utf-8",""); // mClient = new OkHttpClient(); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // Map<String, String> mMap = new HashMap<>(); // mMap.put("X-Requested-With", BaseApplication.getInstance().getPackageName()); // view.loadUrl(url, mMap); // android.webkit.WebView webView = new android.webkit.WebView(SecondWebActivity.this); // webView.loadUrl(); view.loadUrl(url); return true; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); //这段js函数的功能就是注册监听,遍历所有的img标签,并添加onClick函数,函数的功能是在图片点击的时候调用本地java接口并传递url过去 mWebView.loadUrl("javascript:(function(){" + "var objs = document.getElementsByTagName(\"img\"); " + "for(var i=0;i<objs.length;i++) " + "{" + " objs[i].onclick=function() " + " { " + " window.imagelistner.openImage(this.src,objs); " + " } " + "}" + "})()"); } }); mProgressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal); mProgressBar.setLayoutParams(new ViewGroup.LayoutParams(ScreenUtil .getScreenWidth(this), ConvertUtil.px2dp(this,20))); Drawable drawable = this.getResources().getDrawable( R.drawable.progress_bar_states); mProgressBar.setProgressDrawable(drawable); mWebView.addView(mProgressBar); mWebView.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int newProgress) { if (newProgress == 100) { mProgressBar.setVisibility(View.INVISIBLE); } else { if (View.INVISIBLE == mProgressBar.getVisibility()) { mProgressBar.setVisibility(View.VISIBLE); } mProgressBar.setProgress(newProgress); } super.onProgressChanged(view, newProgress); } /* @Override public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, android.os.Message resultMsg) { WebView.HitTestResult result = view.getHitTestResult(); String data = result.getExtra(); Context context = view.getContext(); *//*Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(data)); context.startActivity(browserIntent);*//* Intent intent = new Intent(ZhihuWebViewActivity.this, ZhihuWebViewActivity.class); intent.putExtra("url", data); context.startActivity(intent); return false; }*/ }); } // js通信接口 public class JavascriptInterface { private Context context; public JavascriptInterface(Context context) { this.context = context; } @android.webkit.JavascriptInterface public void openImage(String img,Object[] imags) { Intent intent = new Intent(); intent.putExtra("img", img); intent.setClass(context, ImageActivity.class); context.startActivity(intent); } } @Override public void initToolBar() { } @Override public void loadData() { super.loadData(); getZhihuH5Net(); } private void getZhihuH5Net() { RetrofitHelper.getZhihuApi() .getZhihuDetailNet(mZhihu_id) .compose(this.<ZhihuDetailBean>bindToLifecycle()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<ZhihuDetailBean>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { showNetError(); } @Override public void onNext(ZhihuDetailBean zhihuDetailBean) { hideProgressDialog(); finishTask(zhihuDetailBean); } }); } @Override public void finishTask(BaseBean bean) { if (bean instanceof ZhihuDetailBean) { setZhihuDetailBeanData((ZhihuDetailBean) bean); } } private void setZhihuDetailBeanData(ZhihuDetailBean bean) { ActionBar actionBar = getSupportActionBar(); if (actionBar !=null) { actionBar.setTitle(TextUtils.isEmpty(bean.title)?"":bean.title); } mWebView.loadData(bean.body, "text/html; charset=UTF-8", null); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (mWebView.canGoBack()) { mWebView.goBack();// 返回前一个页面 } else { // clearCookie(); finish(); } return true; } return super.onKeyDown(keyCode, event); } @Override public boolean dispatchKeyEvent(KeyEvent event) { int action = event.getAction(); int keyCode = event.getKeyCode(); // WebView scrollView = (WebView) findViewById(R.id.ch01); switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: if (action == KeyEvent.ACTION_DOWN) { mWebView.pageUp(false); } return true; case KeyEvent.KEYCODE_VOLUME_DOWN: if (action == KeyEvent.ACTION_DOWN) { mWebView.pageDown(false); } return true; default: return super.dispatchKeyEvent(event); } } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); return true; } return super.onOptionsItemSelected(item); } }
[ "leijiaxq.@gmail.com" ]
leijiaxq.@gmail.com
61dfe84b517f626d2cb310302f403d79aeea7c41
8adb5c0585d57173114ee61ccd34743d0b467a6d
/src/com/hauxin/shop/test/TestFirstMybatis.java
e409be2bb09539859dbcb544de9ad815daf7f714
[]
no_license
jky520/shop
18f305e01ead858b7a5e2248c0d22a9228dd1138
f9761d25af6a84e3569f0f5ecc9693bfd6caa9bc
refs/heads/master
2021-01-20T13:12:18.448371
2017-08-29T08:55:03
2017-08-29T08:55:03
101,612,054
0
0
null
null
null
null
UTF-8
Java
false
false
2,524
java
package com.hauxin.shop.test; import java.io.IOException; import java.io.InputStream; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import com.hauxin.shop.entity.User; /** * @author @DT人 2017年7月13日 上午11:58:29 * */ public class TestFirstMybatis { public static void main(String[] args) { add(); } public static void delete() { try { InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(is); SqlSession session = factory.openSession(); session.delete(User.class.getName()+".delete", 2); session.commit(); session.close(); } catch (IOException e) { e.printStackTrace(); } } public static void update() { try { // 1.创建配置文件mybatis-config配置文件的输入流。 InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); // 2.创建SqlSessionFactory SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(is); // 3.创建SqlSession SqlSession session = factory.openSession(); // 4.调用相应的mapper文件,操作数据库(操作之前现在配置文件中注册mapper文件) User user = new User(); user.setId(2); user.setUserName("悟空11"); user.setPassWord("123456"); user.setNickName("张三11"); user.setEmail("zhangsan@qq.com"); session.update("com.huaxin.shop.entity.User.update", user); session.commit(); session.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void add() { try { // 1.创建配置文件mybatis-config配置文件的输入流。 InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); // 2.创建SqlSessionFactory SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(is); // 3.创建SqlSession SqlSession session = factory.openSession(); // 4.调用相应的mapper文件,操作数据库(操作之前现在配置文件中注册mapper文件) User user = new User(); user.setUserName("悟空"); user.setPassWord("123456"); user.setNickName("张三"); user.setEmail("zhangsan@qq.com"); session.insert(User.class.getName()+".add", user); session.commit(); session.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "jky1988@qq.com" ]
jky1988@qq.com
db1b0557ad5a8d452e0c80d1853255f7b152168c
91cfba5ecfd16f7c4d9bca7829406db90a3a6230
/Paintapp/app/src/main/java/com/example/paintapp/GalleryAdapter.java
ad047f9165696f4001fbbddb789cbb0775f879d5
[]
no_license
115vidit/PaintApp
d65a7dc6c78896042f72fc6fb194a30c264c73d8
76b8e1470031200ccca58924536cb31529db36e3
refs/heads/master
2022-12-03T23:14:57.477533
2020-08-04T09:03:42
2020-08-04T09:03:42
284,923,202
0
0
null
null
null
null
UTF-8
Java
false
false
4,072
java
package com.example.paintapp; import android.content.Context; import android.net.Uri; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.ImageView; import com.bumptech.glide.Glide; import java.util.ArrayList; public class GalleryAdapter extends BaseAdapter{ private Context ctx; private ArrayList<Uri> mArrayUri; // private ArrayList<Boolean> checkBoxes; private ViewHolder viewHolder; boolean[] selection; // private String[] arrPath = new String[getCount()]; private boolean checked = false; GalleryAdapter(Context ctx, ArrayList<Uri> mArrayUri) { this.ctx = ctx; this.mArrayUri = mArrayUri; this.selection = new boolean[getCount()]; //checkBoxes = new ArrayList<>(); } @Override public int getCount() { return mArrayUri.size() + 1; } @Override public Object getItem(int position) { return mArrayUri.get(position); } @Override public long getItemId(int position) { return 0; } public static class ViewHolder{ ImageView imageView; CheckBox check; } boolean toggleChecks(String t) { if(t.equals("Select")) checked = true; else { Log.d("yo", "yo"); checked = false; } notifyDataSetChanged(); return checked; } @Override public View getView(final int position, View convertView, final ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if(convertView == null){ assert inflater != null; convertView = inflater.inflate(R.layout.pics, parent, false); viewHolder = new ViewHolder(); viewHolder.check = convertView.findViewById(R.id.chk); viewHolder.imageView = convertView.findViewById(R.id.picture); viewHolder.check.setVisibility(View.INVISIBLE); convertView.setTag(viewHolder); //convertView.setTag(R.id.chk, viewHolder.check); //convertView.setTag(R.id.picture, viewHolder.imageView); } else { viewHolder = (ViewHolder) convertView.getTag(); } //viewHolder.check.setTag(position); //checkBoxes.add(viewHolder.check); //viewHolder.check.setChecked(checked); //ImageView imageView = convertView.findViewById(R.id.picture); viewHolder.check.setId(position); viewHolder.imageView.setId(position); if(checked){ viewHolder.check.setVisibility(View.VISIBLE); } else{ viewHolder.check.setVisibility(View.GONE); } viewHolder.check.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub CheckBox cb = (CheckBox) v; int id = cb.getId(); if (selection[id]){ cb.setChecked(false); selection[id] = false; } else { cb.setChecked(true); selection[id] = true; } } }); if(position == mArrayUri.size()) { Glide.with(ctx).load(R.mipmap.add).placeholder(R.mipmap.progress_image).into(viewHolder.imageView); // imageView.setImageResource(R.mipmap.add); return convertView; } Glide.with(ctx).load(mArrayUri.get(position)).placeholder(R.mipmap.progress_image).into(viewHolder.imageView); viewHolder.check.setChecked(selection[position]); // imageView.setImageURI(mArrayUri.get(position)); return convertView; } void clear_selection(){ CheckBox cb = viewHolder.check; int id = cb.getId(); cb.setChecked(false); selection[id] = false; } }
[ "45714945+115vidit@users.noreply.github.com" ]
45714945+115vidit@users.noreply.github.com
7c833901830f98bf728535b0129e8505c96e1dbe
02f363a8e59eec4f7f6e1403a30408644fea9d76
/src/main/java/org/springframework/jdbc/core/metadata/PostgresCallMetaDataProvider.java
a6c97cdd3a94a1851abe72c27cb2cead377e8d11
[ "Apache-2.0" ]
permissive
liudebin/zero-springframework
43a7dee3569f38b6e62b36b45270b4259b3e8148
dcb6b11b1a17bd4f934527edccf8d1dc8ff4fb4f
refs/heads/master
2021-07-04T10:55:36.695965
2019-03-21T08:21:13
2019-03-21T08:21:13
107,293,540
0
0
null
null
null
null
UTF-8
Java
false
false
2,384
java
/* * Copyright 2002-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jdbc.core.metadata; import org.springframework.jdbc.core.ColumnMapRowMapper; import org.springframework.jdbc.core.SqlOutParameter; import org.springframework.jdbc.core.SqlParameter; import org.springframework.lang.Nullable; import java.sql.DatabaseMetaData; import java.sql.SQLException; import java.sql.Types; /** * Postgres-specific implementation for the {@link CallMetaDataProvider} interface. * This class is intended for internal use by the Simple JDBC classes. * * @author Thomas Risberg * @since 2.5 */ public class PostgresCallMetaDataProvider extends GenericCallMetaDataProvider { private static final String RETURN_VALUE_NAME = "returnValue"; public PostgresCallMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException { super(databaseMetaData); } @Override public boolean isReturnResultSetSupported() { return false; } @Override public boolean isRefCursorSupported() { return true; } @Override public int getRefCursorSqlType() { return Types.OTHER; } @Override public String metaDataSchemaNameToUse(@Nullable String schemaName) { // Use public schema if no schema specified return (schemaName == null ? "public" : super.metaDataSchemaNameToUse(schemaName)); } @Override public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) { if (meta.getSqlType() == Types.OTHER && "refcursor".equals(meta.getTypeName())) { return new SqlOutParameter(parameterName, getRefCursorSqlType(), new ColumnMapRowMapper()); } else { return super.createDefaultOutParameter(parameterName, meta); } } @Override public boolean byPassReturnParameter(String parameterName) { return RETURN_VALUE_NAME.equals(parameterName); } }
[ "liuguobin@nonobank.com" ]
liuguobin@nonobank.com
246c7d0a28ef170315586b3d7b99a4bfa7fbca2f
01ad2542db587a082650f04fcaa72fa94f859fb1
/forum.forum/src/main/java/forum/forum/dao/MessageDao.java
76970f1e583b92b2d905ecf48ea79f7ddcfe0798
[]
no_license
lewandowski2004/Forum-in-Java
0467d6681056b650b0e486ea554dbb2a8bec6957
dbd20a410ac5ee0efbfd7b4a56ddc3c7fe4e7cd2
refs/heads/master
2021-10-25T01:32:42.834064
2019-03-30T18:56:27
2019-03-30T18:56:27
119,894,026
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
package forum.forum.dao; import java.util.List; import forum.forum.dto.Message; public interface MessageDao { public List<Message> getAllMessages(); public boolean addMessage(Message m); public Message getMessage(int id); public void delete(int id); }
[ "lewandowski2004@o2.pl" ]
lewandowski2004@o2.pl
fea6a4bb4f3badee0ff209fd17c31d6688ac9539
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3-rc2/providers/http/src/test/java/org/mule/providers/http/HttpMessageAdapterTestCase.java
91cf7eb36f128cccebd2eae83baa2d59891112b2
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-symphonysoft" ]
permissive
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
1,791
java
/* * $Header$ * $Revision$ * $Date$ * ------------------------------------------------------------------------------------------------------ * * Copyright (c) SymphonySoft Limited. All rights reserved. * http://www.symphonysoft.com * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.mule.providers.http; import org.mule.tck.providers.AbstractMessageAdapterTestCase; import org.mule.umo.provider.UMOMessageAdapter; /** * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a> * @version $Revision$ */ public class HttpMessageAdapterTestCase extends AbstractMessageAdapterTestCase { protected static final String TEST_MESSAGE = "Hello"; private byte[] message = TEST_MESSAGE.getBytes(); public Object getValidMessage() throws Exception { return message; } public UMOMessageAdapter createAdapter(Object payload) throws Exception { return new HttpMessageAdapter(payload); } public void testMessageRetrieval() throws Exception { Object message = getValidMessage(); UMOMessageAdapter adapter = createAdapter(message); assertEquals("Hello", adapter.getPayloadAsString()); byte[] bytes = adapter.getPayloadAsBytes(); assertNotNull(bytes); String stringMessage = adapter.getPayloadAsString(); assertNotNull(stringMessage); assertNotNull(adapter.getPayload()); try { adapter = createAdapter(getInvalidMessage()); fail("Message adapter should throw exception if an invalid messgae is set"); } catch (Exception e) { // expected } } }
[ "(no author)@bf997673-6b11-0410-b953-e057580c5b09" ]
(no author)@bf997673-6b11-0410-b953-e057580c5b09
bafbadb7f3e45e65fc330dacd275f3413bf956d3
dd6a40aba69b7f4d4c7ac8e229576fce3ad8821c
/app/src/main/java/com/utmostapp/freqtionary/AudioPlayer.java
56b9441074e9cf1d0c45d6806ff3ca40687fa7d7
[]
no_license
pglee/Freqtionary
e5826dae2f5a407fa09dad882c44d2dc090dbd57
644dd97e350e549f65b657feb5401104d5bf04cb
refs/heads/master
2016-09-09T19:17:41.801370
2016-01-18T01:02:11
2016-01-18T01:02:11
24,488,655
0
0
null
null
null
null
UTF-8
Java
false
false
2,722
java
package com.utmostapp.freqtionary; import android.content.Context; import android.media.MediaPlayer; import android.util.Log; /** * Plays audio for the user * * Created by plee on 10/15/14. */ public class AudioPlayer { private static final String TAG = "AudioPlayer"; //utility to play audio private MediaPlayer mPlayer; /********************************************************************************** * Stops the currently playing audio if an audio is playing. Does nothing if no * audio is playing. ***********************************************************************************/ public void stop() { if(mPlayer != null) { //release instead of stop to let go of this resource mPlayer.release(); mPlayer = null; } } /********************************************************************************** * Plays the audio stored int the fileName * * @param context The context defines where the file is located * @param fileName The name of the audio file to play ***********************************************************************************/ public void play(Context context, String fileName) { stop(); try { mPlayer = MediaPlayer.create(context, resourceId(context, fileName)); //stop when audio is completed. mPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { public void onCompletion(MediaPlayer mp) { stop(); } }); //start only when media player is ready mPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { mediaPlayer.start(); } }); } catch(Exception e) { Log.d(TAG, "Unable to play the file." + e); } } //gets the resourceId based on the fileName passed of the actual file private int resourceId(Context context, String fileName) { int resourceId = context.getResources().getIdentifier(resourceName(fileName), "raw", context.getPackageName()); Log.d(TAG, "resourceId: " + resourceId); return resourceId; } //simply removes the fileName extension private String resourceName(String fileName) { String resourceName = fileName.substring(0, fileName.lastIndexOf('.')); Log.d(TAG, "resourceName: " + resourceName); return resourceName; } }
[ "paul.g.lee@gmail.com" ]
paul.g.lee@gmail.com
314b94248439e6d95e5b489960a1ec661ce02fce
c7fadfc479bddcf1ecb7a2d3b72a6c0684919581
/eclipse-workspace/Java Reference 2.0/src/SubtractionQuizLoop.java
ec8dfc4db9a710c884c7e415c090b6621494ddac
[]
no_license
alanshi33/Java-References
d45d5df8265218af151765c7995e71f828179271
2958cfd3e4f809ce829337e879040933ec2679e7
refs/heads/master
2020-03-23T03:41:34.763296
2018-08-02T23:07:56
2018-08-02T23:07:56
141,044,061
0
0
null
null
null
null
UTF-8
Java
false
false
1,258
java
import java.util.Scanner; public class SubtractionQuizLoop { public static void main(String[] args) { // TODO Auto-generated method stub final int NUMBER_OF_QUESTIONS = 5; int correctCount = 0; int count = 0; long startTime = System.currentTimeMillis(); String output = " "; Scanner input = new Scanner(System.in); while(count < NUMBER_OF_QUESTIONS) { int number1 = (int)(Math.random() * 10); int number2 = (int)(Math.random() * 10); if (number1<number2) { int temp = number1; number1 = number2; number2 = temp; } System.out.print( "What is "+ number1 + " - " + number2 + "?"); int answer = input.nextInt(); if (number1 - number2 == answer) { System.out.println("You are correct!"); correctCount++; } else System.out.println("Your answer is wrong.\n" + number1 + " - " + number2 + " should be " + (number1 - number2)); count ++; output += "\n" + number1 + "-" +number2+ "=" +answer+ ((number1 - number2 == answer)? " correct" : " wrong"); } long endTime = System.currentTimeMillis(); long testTime = endTime - startTime; System.out.println("Correct count is " +correctCount + "\nTest time is " +testTime / 1000 + " seconds\n" + output); } }
[ "noreply@github.com" ]
noreply@github.com
083a3ff13f7aeb183ce1f547ebe1e0a8e3a84a69
b29cf14ddc80b631d488c56a9f1c9e0fec4096c6
/SpringBoot/springboot_security/springboot_security/src/main/java/jit/wxs/entity/SysUser.java
38f18d3a488d75d3aebb8619c51a7adc794b5405
[ "Apache-2.0" ]
permissive
feifei233/blog-sample
a143d44a18685f77c622794384076797980c0d3e
334224209556382d5df3c5feba373de6462f796f
refs/heads/master
2020-08-14T16:39:42.445109
2019-09-02T16:16:29
2019-09-02T16:16:29
215,201,071
1
0
Apache-2.0
2019-10-15T03:44:57
2019-10-15T03:44:57
null
UTF-8
Java
false
false
683
java
package jit.wxs.entity; import java.io.Serializable; /** * @author jitwxs * @date 2018/3/30 1:18 */ public class SysUser implements Serializable{ static final long serialVersionUID = 1L; private Integer id; private String name; private String password; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "jitwxs@foxmail.com" ]
jitwxs@foxmail.com
845e7a390b37f13a35aa64e2d67a51550fdabe53
fda9d2475e56055165ad706d939822db2e90eeae
/Project 1/supplier_nvidia.java
7940ac18ba6132317b5c884e26dbcabf240cae46
[]
no_license
ronkeyx5/kbs
f16596718f4d63585cab365f79b06240aeeb7044
ad4ec96b7b338868f5c1a54023452c90ff1562af
refs/heads/main
2023-05-31T13:35:00.593572
2021-06-23T13:49:07
2021-06-23T13:49:07
369,249,319
0
0
null
null
null
null
UTF-8
Java
false
false
4,777
java
package proyect1; import jade.core.Agent; import jade.core.AID; import jade.core.behaviours.*; import jade.lang.acl.ACLMessage; import jade.lang.acl.MessageTemplate; import jade.domain.DFService; import jade.domain.FIPAException; import jade.domain.FIPAAgentManagement.DFAgentDescription; import jade.domain.FIPAAgentManagement.ServiceDescription; import java.util.*; import java.sql.*; public class supplier_nvidia extends Agent { List<String> productos = Arrays.asList("RTX 3080", "RTX 3060"); String db; String producto; String AgentName = "Nvidia"; int ID_proveedor = 3; // Put agent initializations here protected void setup() { // Register the supplier service in the yellow pages DFAgentDescription dfd = new DFAgentDescription(); dfd.setName(getAID()); ServiceDescription sd = new ServiceDescription(); // item-selling sd.setType("item-supply"); sd.setName("JADE-item-supply"); dfd.addServices(sd); try { DFService.register(this, dfd); } catch (FIPAException fe) { fe.printStackTrace(); } // Add the behaviour serving queries from buyer agents addBehaviour(new OfferRequestsServer()); } // Put agent clean-up operations here protected void takeDown() { // Deregister from the yellow pages try { DFService.deregister(this); } catch (FIPAException fe) { fe.printStackTrace(); } // Printout a dismissal message System.out.println("Supplier-agent " + getAID().getName() + " terminando."); } private void Surtir() { try { // Class.forName("com.mysql.jdbc.Driver"); Class.forName("com.mysql.cj.jdbc.Driver"); // Connect to DB Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+db, "root", "root"); // SURTIENDO EN PRODUCTO // Query Statement stmt = con.createStatement(); // Query Data String query = "UPDATE `producto` SET `existencia`=? WHERE nombre=?"; PreparedStatement preparedStmt = con.prepareStatement(query); preparedStmt.setInt(1, 2); preparedStmt.setString(2, producto); preparedStmt.executeUpdate(); // GENERANDO ORDEN DE SURTIDO // Query stmt = con.createStatement(); // Query Data query = "INSERT INTO orden_surtido (`id`, `producto`, `cantidad`) VALUES (?, ?, ?)"; preparedStmt = con.prepareStatement(query); preparedStmt.setInt(1, 0); preparedStmt.setString(2, producto); preparedStmt.setInt(3, 2); preparedStmt.executeUpdate(); // End DB connection con.close(); } catch (Exception e) { System.out.println("[SUPPLIER - " + AgentName + "] " + " Surtir() " + e); } System.out.println("[SUPPLIER - " + AgentName + "] Pedido entregado de " + producto); } private class OfferRequestsServer extends CyclicBehaviour { public void action() { MessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.CFP); ACLMessage msg = myAgent.receive(mt); if (msg != null) { // CFP Message received. Process it String title = msg.getContent().split("@")[0]; producto = title; db = msg.getContent().split("@")[1]; ACLMessage reply = msg.createReply(); if (productos.contains(title)) { // The requested item is available for supply. Reply with confirmation. reply.setPerformative(ACLMessage.INFORM); System.out.println("[SUPPLIER - " + AgentName + "] Recibida solicitud para proveer " + producto); // Esperar 10 segundos try { Thread.sleep(20000); } catch (InterruptedException e) { System.out.println(e); } // Ejecutar update de SQL Surtir(); } else { // The requested item is NOT available. reply.setPerformative(ACLMessage.REFUSE); reply.setContent("not-available"); } myAgent.send(reply); } else { block(); } } } // End of inner class OfferRequestsServer }
[ "noreply@github.com" ]
noreply@github.com
ca6a2b911121f622bcd2750e223180ffde6784f7
8e77ec17ffca6fdc42279ae2e1327e3615dff653
/soapui/target/generated-sources/xmlbeans/org/oasisOpen/docs/wss/x2004/x01/oasis200401WssWssecuritySecext10/SecurityDocument.java
c197068fb064ba64dbfbe0e522e70ae02974c480
[]
no_license
LyleHenkeman/soap_ui_and_builds
dd24cee359f11715cf86ae2b5b1ee34b88b7dc80
2660bcda4633f940d832bb827104d40ee38c0436
refs/heads/master
2021-06-30T12:00:00.642961
2017-09-19T20:02:42
2017-09-19T20:02:42
104,122,267
1
0
null
null
null
null
UTF-8
Java
false
false
10,135
java
/* * An XML document type. * Localname: Security * Namespace: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd * Java type: org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument * * Automatically generated - do not modify. */ package org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10; /** * A document containing one Security(@http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd) element. * * This is a complex type. */ public interface SecurityDocument extends org.apache.xmlbeans.XmlObject { public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType) org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(SecurityDocument.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.s5D1810259B92CCC14368B111486E2FBA").resolveHandle("security6122doctype"); /** * Gets the "Security" element */ org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityHeaderType getSecurity(); /** * Sets the "Security" element */ void setSecurity(org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityHeaderType security); /** * Appends and returns a new empty "Security" element */ org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityHeaderType addNewSecurity(); /** * A factory class with static methods for creating instances * of this type. */ public static final class Factory { public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument newInstance() { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument newInstance(org.apache.xmlbeans.XmlOptions options) { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); } /** @param xmlAsString the string value to parse */ public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); } /** @param file the file from which to load an xml document */ public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); } public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ public static org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return (org.oasisOpen.docs.wss.x2004.x01.oasis200401WssWssecuritySecext10.SecurityDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); } private Factory() { } // No instance of this class allowed } }
[ "l.henkeman@activevideo.com" ]
l.henkeman@activevideo.com
19c96780556cdce7fafcb9a411d6ef224785e3ec
0a3d6738ab20c525e7f69fb574ae5a195827ee18
/src/netflow/DebugClient.java
400e74bd88cb069c5370a1974e0bc4be55341414
[]
no_license
zkxs/netflow
fe8cff7383c0eed3711976acd5245d0becf6c15c
5f14fa00a75a1f7fd91df3f8766319fcd1c1ff2d
refs/heads/master
2021-01-10T01:50:49.237384
2015-06-24T17:32:09
2015-06-24T17:32:09
36,942,006
1
0
null
null
null
null
UTF-8
Java
false
false
895
java
package netflow; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; public class DebugClient { public static void main(String[] args) throws IOException, InterruptedException { InetAddress addr = InetAddress.getLoopbackAddress(); int port = 9010; final DatagramSocket socket = new DatagramSocket(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){ @Override public void run(){ socket.close(); } })); byte[] buf = new byte[17]; buf[1] = 5; System.arraycopy(new byte[]{(byte)0xDE, (byte)0xAD, (byte)0xBE, (byte)0xEF}, 0, buf, 13, 4); DatagramPacket packet = new DatagramPacket(buf, buf.length, addr, port); System.out.println("running..."); for (int i = 1; i <= 7; i++) { buf[3] = (byte)i; socket.send(packet); Thread.sleep(1000); } } }
[ "zkxs00@gmail.com" ]
zkxs00@gmail.com
c25ded7e5200c1c8ce31a9d182d81b2443fa7ffe
4aa90348abcb2119011728dc067afd501f275374
/app/src/main/java/com/tencent/mm/plugin/appbrand/jsapi/k/a$a.java
2b7e1d69b1540504706f8b5d035fedc27e5262ae
[]
no_license
jambestwick/HackWechat
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
6a34899c8bfd50d19e5a5ec36a58218598172a6b
refs/heads/master
2022-01-27T12:48:43.446804
2021-12-29T10:36:30
2021-12-29T10:36:30
249,366,791
0
0
null
2020-03-23T07:48:32
2020-03-23T07:48:32
null
UTF-8
Java
false
false
244
java
package com.tencent.mm.plugin.appbrand.jsapi.k; import com.tencent.mm.plugin.appbrand.jsapi.f; public final class a$a extends f { private static final int CTRL_INDEX = 93; private static final String NAME = "onAccelerometerChange"; }
[ "malin.myemail@163.com" ]
malin.myemail@163.com
aaa62ae56e296d82a2e98a76320bdc7932709b0c
c1f7c8a67e1493068c54f14b83ca3b4dae28fa5f
/app/src/main/java/com/example/osamamac/taskmanager/Services/WakefulReceiver.java
b5ebf275c2387e02ca06b3e18b0ac601ee69ac64
[]
no_license
osama-a-rehman/TaskManager
2e3950b713d6649bffff860273c491320ac86a63
6af1e0546038d747aaa8af7722501cec1c22695a
refs/heads/master
2021-08-07T03:27:13.187703
2017-11-07T11:55:01
2017-11-07T11:55:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,434
java
package com.example.osamamac.taskmanager.Services; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.support.annotation.RequiresApi; import android.support.v4.content.WakefulBroadcastReceiver; import android.util.Log; import java.util.Calendar; import java.util.Date; /** * When the alarm fires, this WakefulBroadcastReceiver receives the broadcast Intent * and then posts the notification. */ public class WakefulReceiver extends WakefulBroadcastReceiver { // provides access to the system alarm services. private AlarmManager mAlarmManager; public void onReceive(Context context, Intent intent) { //// TODO: post notification WakefulReceiver.completeWakefulIntent(intent); } /** * Sets the next alarm to run. When the alarm fires, * the app broadcasts an Intent to this WakefulBroadcastReceiver. * * @param context the context of the app's Activity. */ @RequiresApi(api = Build.VERSION_CODES.KITKAT) public void setAlarm(Context context) { mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, WakefulReceiver.class); PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); //// TODO: use calendar.add(Calendar.SECOND,MINUTE,HOUR, int); //calendar.add(Calendar.SECOND, 10); //ALWAYS recompute the calendar after using add, set, roll Date date = calendar.getTime(); mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, date.getTime(), alarmIntent); // Enable {@code BootReceiver} to automatically restart when the // device is rebooted. //// TODO: you may need to reference the context by ApplicationActivity.class ComponentName receiver = new ComponentName(context, BootReceiver.class); PackageManager pm = context.getPackageManager(); pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } /** * Cancels the next alarm from running. Removes any intents set by this * WakefulBroadcastReceiver. * * @param context the context of the app's Activity */ public void cancelAlarm(Context context) { Log.d("WakefulAlarmReceiver", "{cancelAlarm}"); mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, WakefulReceiver.class); PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); mAlarmManager.cancel(alarmIntent); // Disable {@code BootReceiver} so that it doesn't automatically restart when the device is rebooted. //// TODO: you may need to reference the context by ApplicationActivity.class ComponentName receiver = new ComponentName(context, BootReceiver.class); PackageManager pm = context.getPackageManager(); pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } }
[ "osama.a.rehman@gmail.com" ]
osama.a.rehman@gmail.com
d34a6cc6ddbcd015ecd9eb74f793c2aa70a790af
41144622f268a008526ed5d7c0555fdf05da5ed2
/app/src/main/java/ua/com/sevenpowerx/android/devcolibriandroidcours/LastActivity.java
39fa9e67251a8a77a9c56179fe8c46df5534cdfe
[]
no_license
SevenPowerX-Android/DevcolibriAndroidCours
461d039b8b18660fe1652aa8c607adfc0ee2232b
1da0d34ca62e30c0c18f3d373905388414a62322
refs/heads/master
2021-09-07T06:59:37.629070
2018-02-19T07:48:19
2018-02-19T07:48:19
119,889,444
0
0
null
null
null
null
UTF-8
Java
false
false
871
java
package ua.com.sevenpowerx.android.devcolibriandroidcours; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; /** * Created by splaa User notebook acer on 04.02.2018. */ @SuppressLint("Registered") public class LastActivity extends Activity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.last_layout); } public void goToBackMainActivity(View view) { Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } public void goToFirstActivity(View view) { Intent intent = new Intent(this, FirstActivity.class); startActivity(intent); } }
[ "splaandrey@gmail.com" ]
splaandrey@gmail.com
4e46fd355a9a1c52f82860d3af91df7425c29187
80d5a92d2dbf4aa6595e161e210eb35cf270a659
/app/src/test/java/edu/tacoma/uw/css/sextod/memeups/UserTest.java
f9b74c0463622e5c910c53cf265258d6b186ea41
[]
no_license
fwtravisbain/MemeUps-Social-App
2722000962358fbad6879df87b63d25979103381
46439c284af138554cf9a58efa291047721187b6
refs/heads/master
2020-05-02T19:45:15.707161
2018-06-01T18:18:33
2018-06-01T18:18:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,468
java
package edu.tacoma.uw.css.sextod.memeups; import junit.framework.Assert; import org.json.JSONException; import org.junit.Test; import java.util.List; import edu.tacoma.uw.css.sextod.memeups.database.User; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.fail; public class UserTest { //Test constructor /** * Test constructor */ @Test public void testAccountConstructor() { assertNotNull(new User("mmuppa@uw.edu", "test1@3")); } //Test bad email @Test /** * Test Bad Email */ public void testAccountConstructorBadEmail() { try { new User("mmuppauw.edu", "test1@3"); fail("Account created with invalid email"); } catch (IllegalArgumentException e) { } } //Test bad password /** * Test bad password */ @Test public void testAccountConstructorBadPassword() { try { //no numbers new User("mmuppauw@uw.edu", "testtttttt"); fail("Account created with invalid password"); } catch (IllegalArgumentException e) { } } //Test empty email /** * Test Empty Email */ @Test public void testUserConstructorEmptyEmail() { try { new User("", "testtttt$4"); fail("Account created with invalid username"); } catch (IllegalArgumentException e) { } } //Test empty password /** * Test Empty Password */ @Test public void testAccountConstructorEmptyPassword() { try { new User("mmuppauw@uw.edu", ""); fail("Account created with invalid password"); } catch (IllegalArgumentException e) { } } //Test get email /** * Test getting email */ @Test public void testGetEmail() { User test = new User("mmuppauw@uw.edu", "testtttt$4"); Assert.assertEquals("mmuppauw@uw.edu", test.getEmail()); } //test get password /** * Test getting password */ @Test public void testGetPassword() { User test = new User("mmuppauw@uw.edu", "testtttt$4"); Assert.assertEquals("testtttt$4", test.getPassword()); } //Test set email /** * Test setting email */ @Test public void testSetEmail() { User test = new User("temporary@uw.edu", "testtttt$4"); test.setEmail("mmuppauw@uw.edu"); Assert.assertEquals("mmuppauw@uw.edu", test.getEmail()); } //test set password /** * Test setting password */ @Test public void testSetPassword() { User test = new User("mmuppauw@uw.edu", "temppass2@1"); test.setPassword("testtttt$4"); Assert.assertEquals("testtttt$4", test.getPassword()); } /** * Test parsing json with a sample json string from our app */ @Test public void testParseJSON() { List<User> testList = null; String JSONString = "[{\"email\":\"example@gmail.com\",\"password\":\"password123\"},{\"email\":\"ILmarissa@gmail.com\",\"password\":\"pass123\"},{\"email\":\"jameshomeemail@gmail.com\",\"password\":\"pass123\"}]"; try { testList = User.parseUserJSON(JSONString); }catch(JSONException e) { fail("JSONException"); } assertNotNull(testList); } }
[ "fwtravisbain@outlook.com" ]
fwtravisbain@outlook.com
7d37d379cd63081b2bace897cb2c8965b5985586
dcd8e8110c13bd03fe089804a07a38095f616125
/EasyHttp/app/src/main/java/com/ht/easy/net/Callback.java
ea395b5d38efdb8dbbaef53a750c1ddc58e7f126
[]
no_license
rayht/android-valuableCode
bc0393ec0391356aa49d8d778de804b90ae7ac68
f581bb119dfdfcef58fe1d786724e3290b10aca9
refs/heads/master
2020-03-17T18:42:43.193661
2018-10-06T11:15:55
2018-10-06T11:15:55
133,830,556
0
0
null
null
null
null
UTF-8
Java
false
false
205
java
package com.ht.easy.net; /** * @author Leiht * @date 2018/5/3 */ public interface Callback { void onFailure(Call call, Throwable throwable); void onResponse(Call call, Response response); }
[ "530316112@qq.com" ]
530316112@qq.com
3748ea306ef3da945f1ffca3e185db2a4035940e
0cbb1121f2ea2e3f140e9906a04b4bae6fcb1e95
/src/java/edu/psu/citeseerx/citeinf/InferenceBuilder.java
4996b3777835aab5674ecb4598013dc6e133c35a
[ "Apache-2.0" ]
permissive
WebSciences/citeseer-ucl
be63577454a40a310e5c561dfcaa9c56d20584be
c4869317c51e91dcc36e30b55d2619ac0a7a6f89
refs/heads/master
2021-01-25T05:28:05.521271
2012-11-02T19:32:11
2012-11-02T19:32:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,464
java
/* * Copyright 2007 Penn State University * 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 edu.psu.citeseerx.citeinf; import org.json.*; import edu.psu.citeseerx.domain.*; /** * Generates canonical metadata for cluster records based on the most frequent * values for updatable fields among citations within the cluster. * Fields checked include the following: * <br> * <ul> * <li>title</li> * <li>authors</li> * <li>year</li> * <li>venue</li> * <li>venue type</li> * <li>pages</li> * <li>volume</li> * <li>number</li> * <li>publisher</li> * <li>tech report number</li> * </ul> * <br> * This class uses JSON strings to store intermediary frequency and canonical * data so that frequency information can be updated iteratively without * going back to each citation source. * * @author Isaac Councill * @version $Rev: 666 $ $Date: 2008-07-27 13:57:23 -0400 (Sun, 27 Jul 2008) $ */ public class InferenceBuilder { private static final String TITLE = "title"; private static final String AUTH = "auths"; private static final String YEAR = "year"; private static final String VENUE = "venue"; private static final String VENTYPE = "ventype"; private static final String PAGES = "pages"; private static final String VOL = "vol"; private static final String NUM = "num"; private static final String PUBLISHER = "publisher"; private static final String TECH = "tech"; private static final String SIZE = "size"; private static final String OBS = "obs"; private static final String CANON = "canon"; private static final String CANON_SIZE = "ccount"; private static float minConfidence = (float)0.1; /** * Adds a metadata record to the specified JSON metadata object, * updating frequency and canonical data in a iterative fashion. * @param doc * @param metadata * @return whether any field has changed its canonical value. * @throws JSONException */ public static boolean addObservation(ThinDoc doc, JSONObject metadata) throws JSONException { boolean changed = false; int size = metadata.optInt(SIZE); String title = doc.getTitle(); if (title != null) { if (insertValue(title, TITLE, metadata, size)) { changed = true; } } String auth = doc.getAuthors(); if (auth != null) { if (insertValue(auth, AUTH, metadata, size)) { changed = true; } } int year = doc.getYear(); if (year > 0) { if (insertValue(Integer.toString(year), YEAR, metadata, size)) { changed = true; } } String venue = doc.getVenue(); if (venue != null) { if (insertValue(venue, VENUE, metadata, size)) { changed = true; } } String ventype = doc.getVentype(); if (ventype != null) { if (insertValue(ventype, VENTYPE, metadata, size)) { changed = true; } } String pages = doc.getPages(); if (pages != null) { if (insertValue(pages, PAGES, metadata, size)) { changed = true; } } int vol = doc.getVol(); if (vol > 0) { if (insertValue(Integer.toString(vol), VOL, metadata, size)) { changed = true; } } int num = doc.getNum(); if (num > 0) { if (insertValue(Integer.toString(num), NUM, metadata, size)) { changed = true; } } String publisher = doc.getPublisher(); if (publisher != null) { if (insertValue(publisher, PUBLISHER, metadata, size)) { changed = true; } } String tech = doc.getTech(); if (tech != null) { if (insertValue(tech, TECH, metadata, size)) { changed = true; } } metadata.put(SIZE, ++size); return changed; } //- addObservation /** * Removes a metadata record from the JSON data bundle, updating frequency * and canonical data iteratively. * @param doc * @param metadata * @return whether any field value has changed its canonical value. * @throws JSONException */ public static boolean deleteObservation(ThinDoc doc, JSONObject metadata) throws JSONException { boolean changed = false; int size = metadata.optInt(SIZE); String title = doc.getTitle(); if (title != null) { if (removeValue(title, TITLE, metadata, size)) { changed = true; } } String auth = doc.getAuthors(); if (auth != null) { if (removeValue(auth, AUTH, metadata, size)) { changed = true; } } int year = doc.getYear(); if (year > 0) { if (removeValue(Integer.toString(year), YEAR, metadata, size)) { changed = true; } } String venue = doc.getVenue(); if (venue != null) { if (removeValue(venue, VENUE, metadata, size)) { changed = true; } } String ventype = doc.getVentype(); if (ventype != null) { if (removeValue(ventype, VENTYPE, metadata, size)) { changed = true; } } String pages = doc.getPages(); if (pages != null) { if (removeValue(pages, PAGES, metadata, size)) { changed = true; } } int vol = doc.getVol(); if (vol > 0) { if (removeValue(Integer.toString(vol), VOL, metadata, size)) { changed = true; } } int num = doc.getNum(); if (num > 0) { if (removeValue(Integer.toString(num), NUM, metadata, size)) { changed = true; } } String publisher = doc.getPublisher(); if (publisher != null) { if (removeValue(publisher, PUBLISHER, metadata, size)) { changed = true; } } String tech = doc.getTech(); if (tech != null) { if (removeValue(tech, TECH, metadata, size)) { changed = true; } } metadata.put(SIZE, --size); return changed; } //- deleteObservation /** * Returns a ThinDoc representation of the canonical metadata represented * by the JSON metadata bundle. * @param metadata * @return */ public static ThinDoc toThinDoc(JSONObject metadata) { int size = metadata.optInt(SIZE); ThinDoc doc = new ThinDoc(); JSONObject title = metadata.optJSONObject(TITLE); JSONObject auth = metadata.optJSONObject(AUTH); JSONObject venue = metadata.optJSONObject(VENUE); JSONObject ventype = metadata.optJSONObject(VENTYPE); JSONObject pages = metadata.optJSONObject(PAGES); JSONObject publisher = metadata.optJSONObject(PUBLISHER); JSONObject tech = metadata.optJSONObject(TECH); JSONObject year = metadata.optJSONObject(YEAR); JSONObject vol = metadata.optJSONObject(VOL); JSONObject num = metadata.optJSONObject(NUM); if (title != null) { int csize = title.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setTitle(title.optString(CANON)); } } if (auth != null) { int csize = auth.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setAuthors(auth.optString(CANON)); } } if (venue != null) { int csize = venue.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setVenue(venue.optString(CANON)); } } if (ventype != null) { int csize = ventype.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setVentype(ventype.optString(CANON)); } } if (pages != null) { int csize = pages.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setPages(pages.optString(CANON)); } } if (publisher != null) { int csize = publisher.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setPublisher(publisher.optString(CANON)); } } if (tech != null) { int csize = tech.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { doc.setTech(tech.optString(CANON)); } } if (year != null) { int csize = year.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { try { doc.setYear(year.getInt(CANON)); } catch (Exception e) {} } } if (vol != null) { int csize = vol.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { try { doc.setVol(vol.getInt(CANON)); } catch (Exception e) {} } } if (num != null) { int csize = num.optInt(CANON_SIZE); if (checkConfidence(size, csize)) { try { doc.setNum(num.getInt(CANON)); } catch (Exception e) {} } } doc.setNcites(size); doc.setObservations(metadata.toString()); return doc; } //- toThinDoc private static boolean insertValue(String value, String key, JSONObject metadata, int priorSize) throws JSONException { if (value == null) { return false; } JSONObject json = metadata.optJSONObject(key); if (json == null) { json = new JSONObject(); metadata.put(key, json); } String priorCanon = json.optString(CANON); JSONObject observations = json.optJSONObject(OBS); if (observations == null) { observations = new JSONObject(); json.put(OBS, observations); } int priorLargestCount = 0; int largestCount = 0; boolean found = false; String[] names = JSONObject.getNames(observations); if (names == null) names = new String[0]; for (int i=0; i<names.length; i++) { String obsVal = names[i]; int obsCount = observations.getInt(obsVal); if (obsCount > priorLargestCount) { priorLargestCount = obsCount; } if (value.equalsIgnoreCase(obsVal)) { found = true; obsCount++; if (obsCount > largestCount) { largestCount = obsCount; } observations.put(obsVal, obsCount); } } if (found == false) { observations.put(value, 1); if (1 > largestCount) largestCount = 1; } boolean priorConfident = checkConfidence(priorSize, priorLargestCount); boolean postConfident = checkConfidence(priorSize+1, largestCount); boolean confidenceChanged = (priorConfident != postConfident); boolean valueChanged = false; if (largestCount > priorLargestCount && !value.equalsIgnoreCase(priorCanon)) { json.put(CANON, value); valueChanged = true; } if (largestCount > priorLargestCount) { json.put(CANON_SIZE, largestCount); } if (confidenceChanged) { return true; } else { return valueChanged; } } //- insertValue private static boolean removeValue(String value, String key, JSONObject metadata, int priorSize) throws JSONException { if (value == null) { return false; } JSONObject json = metadata.optJSONObject(key); if (json == null) { return false; } String priorCanon = json.optString(CANON); JSONObject observations = json.optJSONObject(OBS); if (observations == null) { return false; } int largestCount = 0; String largestValue = null; String[] names = JSONObject.getNames(observations); if (names == null) names = new String[0]; for (int i=0; i<names.length; i++) { String obsVal = names[i]; int obsCount = observations.getInt(obsVal); if (value.equalsIgnoreCase(obsVal)) { obsCount--; if (obsCount <= 0) { observations.remove(obsVal); } else { observations.put(obsVal, obsCount); } } if (obsCount > largestCount) { largestCount = obsCount; largestValue = obsVal; } } boolean canonChanged = false; int priorLargestCount = largestCount; if (value.equalsIgnoreCase(priorCanon)) { canonChanged = true; priorLargestCount--; } boolean priorConfident = checkConfidence(priorSize, priorLargestCount); boolean postConfident = checkConfidence(priorSize-1, largestCount); boolean confidenceChanged = (priorConfident != postConfident); boolean valueChanged = false; if (canonChanged && !priorCanon.equalsIgnoreCase(largestValue)) { if (largestValue != null) { json.put(CANON, largestValue); } else { metadata.remove(key); } valueChanged = true; } if (largestCount != priorLargestCount) { json.put(CANON_SIZE, largestCount); } if (largestCount <= 0) { metadata.remove(key); } if (confidenceChanged) { return true; } else { return valueChanged; } } //- removeValue private static boolean checkConfidence(int size, int count) { float percent = (float)count/(float)size; if (percent >= minConfidence) { return true; } else { return false; } } } //- class InferenceBuilder
[ "Krispy2009@gmail.com" ]
Krispy2009@gmail.com
75d6181490daca453fa5178d82a32dded82c8a37
b3148c99b07ab6626ac2e41739bb76cdaa615860
/src/com/yt/test/MyWindow.java
90e970e56d4ac52a96976847b9da32cb26f862b0
[]
no_license
596299589/xfxy-java
7ce738dd0c66aaff21b93761fe9e324789111fea
74327b7f82f8eea9ea2ee1a4749c709973434fea
refs/heads/master
2020-03-11T08:31:46.953576
2018-05-25T21:24:58
2018-05-25T21:24:58
129,886,144
0
0
null
null
null
null
UTF-8
Java
false
false
5,151
java
package com.yt.test; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.IOException; import java.util.ArrayList; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.Timer; import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List; public class MyWindow extends JFrame { private static final long serialVersionUID = -6580208698260406651L; private MyService myService; int index; private ArrayList<Image> mImageList; public MyWindow() { // 构造函数 initService(); initView(); } private void initService() { myService = MyService.getInstance(); myService.init(); myService.setOnMessageListener(mOnMessageListener); } private void initView() { this.setUndecorated(true); // 不显示边框 // com.sun.awt.AWTUtilities.setWindowOpacity(this, 0.0f); // //设置窗体透明度,需与setUndecorated(true)结合使用 // 窗体风格 // JFrame.setDefaultLookAndFeelDecorated(true); this.setTitle("幸福享印智拍馆"); this.setResizable(true);// 可以调节窗口的大小 // 得到显示器屏幕的宽高 int width = Toolkit.getDefaultToolkit().getScreenSize().width; int height = Toolkit.getDefaultToolkit().getScreenSize().height; int windowsWidth = width; int windowsHeight = height; this.setSize(windowsWidth, windowsHeight);// 窗口大小 // 设置窗体在显示器居中显示 // this.setBounds((width - windowsWidth) / 2, // (height - windowsHeight) / 2, windowsWidth, windowsHeight); try { // 更改左上角小图标 Image image = ImageIO.read(this.getClass().getResource("/img/timg.jpg")); this.setIconImage(image); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } this.addWindowListener(new WindowAdapter() {// 关闭窗口自动退出程序 public void windowClosing(WindowEvent we) { // myService.release(); System.exit(0); } }); initPanel(); // 关闭窗口自动退出程序 // this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setWindowMaximum(); } private MyJPanel mPanel; private void initPanel() { mImageList = new ArrayList<Image>(); try { // 更改左上角小图标 Image image11 = ImageIO.read(this.getClass().getResource("/img/1.jpg")); Image image12 = ImageIO.read(this.getClass().getResource("/img/2.jpg")); Image image13 = ImageIO.read(this.getClass().getResource("/img/3.jpg")); Image image14 = ImageIO.read(this.getClass().getResource("/img/4.jpg")); mImageList.add(image11); mImageList.add(image12); mImageList.add(image13); mImageList.add(image14); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } mPanel = new MyJPanel(); mPanel.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent arg0) { // TODO 自动生成的方法存根 } @Override public void mousePressed(MouseEvent arg0) { // TODO 自动生成的方法存根 } @Override public void mouseExited(MouseEvent arg0) { // TODO 自动生成的方法存根 } @Override public void mouseEntered(MouseEvent arg0) { // TODO 自动生成的方法存根 } @Override public void mouseClicked(MouseEvent arg0) { // TODO 自动生成的方法存根 setWindowMinimum(); } }); this.add(mPanel, BorderLayout.CENTER); Timer timer = new Timer(2000, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { mPanel.repaint(); } }); timer.start(); } class MyJPanel extends JPanel { private static final long serialVersionUID = -20088985234233354L; @Override public void paint(Graphics g) { super.paint(g); // g.drawImage(imgs[index % imgs.length].getImage(), 0, 0, // getWidth(), // getHeight(), this); g.drawImage(mImageList.get(index % mImageList.size()), 0, 0, getWidth(), getHeight(), this); index++; } } MyService.OnMessageListener mOnMessageListener = new MyService.OnMessageListener() { @Override public void onMessage(String message) { // TODO 自动生成的方法存根 if ("show".equals(message)) { setWindowMaximum(); } else if ("hide".equals(message)) { setWindowMinimum(); } } }; /** * 设置窗体最大化 */ private void setWindowMaximum() { this.setAlwaysOnTop(true); this.setVisible(true); this.setExtendedState(JFrame.MAXIMIZED_BOTH); // 最大化 } /** * 设置窗体最小化 */ private void setWindowMinimum() { this.setAlwaysOnTop(false); // this.setVisible(false); this.setExtendedState(JFrame.ICONIFIED); // 最小化 } }
[ "tao.yang@aispeech.com" ]
tao.yang@aispeech.com
d7fd4b7fb20cb5fb0a92e8a3e4bbc6fa5c59d16f
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a171/A171501.java
1fbc3ac682498f6d752fe71a375411726ad8da99
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package irvine.oeis.a171; // Generated by gen_pattern.pl - DO NOT EDIT here! import irvine.oeis.GeneratingFunctionSequence; /** * A171501 Inverse binomial transform of <code>A084640</code>. * @author Georg Fischer */ public class A171501 extends GeneratingFunctionSequence { /** Construct the sequence. */ public A171501() { super(0, new long[] {0, 1, 4}, new long[] {1, 1, -2}); } }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
9dd7fb22190317af47afaa3d89d173b1df27aa81
a9343bf89e2d59dc65879c3e4317639317c4a4d2
/CWE90_LDAP_Injection/CWE90_LDAP_Injection__Servlet_getParameterServlet_71a.java
6d07bdf48827370b8e5a099ad26db420b77f73d1
[]
no_license
amitfun/DroneOne
0770addaa856c4ba4e559ba95229a5d7fb539c71
7a4c8e5af7c0aa05ca88f6623ae15bb3adf6d9e0
refs/heads/master
2021-01-15T20:27:52.316553
2017-08-15T23:49:17
2017-08-15T23:49:17
99,850,257
0
0
null
null
null
null
UTF-8
Java
false
false
2,475
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE90_LDAP_Injection__Servlet_getParameterServlet_71a.java Label Definition File: CWE90_LDAP_Injection__Servlet.label.xml Template File: sources-sink-71a.tmpl.java */ /* * @description * CWE: 90 LDAP Injection * BadSource: getParameterServlet Read data from a querystring using getParameter * GoodSource: A hardcoded string * Sinks: * BadSink : unchecked data leads to LDAP injection * Flow Variant: 71 Data flow: data passed as an Object reference argument from one method to another in different classes in the same package * * */ package testcases.CWE90_LDAP_Injection; import testcasesupport.*; import javax.naming.*; import javax.naming.directory.*; import javax.servlet.http.*; import java.util.Hashtable; import java.io.IOException; import org.apache.commons.lang.StringEscapeUtils; import java.util.logging.Logger; public class CWE90_LDAP_Injection__Servlet_getParameterServlet_71a extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; Logger log_bad = Logger.getLogger("local-logger"); /* read parameter from request */ data = request.getParameter("name"); (new CWE90_LDAP_Injection__Servlet_getParameterServlet_71b()).bad_sink((Object)data , request, response ); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); } /* goodG2B() - use goodsource and badsink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger"); /* FIX: Use a hardcoded string */ data = "foo"; (new CWE90_LDAP_Injection__Servlet_getParameterServlet_71b()).goodG2B_sink((Object)data , request, response ); } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "amitf@chackmarx.com" ]
amitf@chackmarx.com
a9392ee7d21aaaa3979cace86bfe90955f232498
6361e978cab4eb91d7d451c6880617671493a039
/src/main/java/hello/GreetingController.java
ac9bc735986fea6cf88779bd61e137e8e02ca420
[]
no_license
thedpws/armjs
cceabd750ff224e86342e81f460c094b4b48b525
51bc6c46e7c88b6a794816b0a4c70c13dc36e729
refs/heads/master
2020-04-16T21:13:22.787691
2019-09-19T19:47:03
2019-09-19T19:47:03
165,917,287
0
0
null
null
null
null
UTF-8
Java
false
false
428
java
package hello; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @Controller public class GreetingController { @GetMapping("/greeting") public String greeting(@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) { model.addAttribute("name", name); return "greeting"; } }
[ "azvasquez99@gmail.com" ]
azvasquez99@gmail.com
69a43d3421c43b7e78b850e03c004a1a8c7b4c65
560510f1f38de0a576e6945dd50252ba0b1d6b72
/Home_Works/Home_Works/src/employee_app/gui/service/EmployeeBirthDate.java
c8e8f9fa52d97647d9d18fa569908d25786ea247
[]
no_license
CechinaDenis/HomeWork
c1b98086a68eb3fa87aa53804fdc824c7768c2bc
011ba902b87d20fa62249898afd76c10174e38e2
refs/heads/master
2020-04-17T23:39:17.254204
2019-06-09T12:22:41
2019-06-09T12:22:41
167,044,167
0
0
null
null
null
null
UTF-8
Java
false
false
1,810
java
package employee_app.gui.service; import java.text.DecimalFormat; import java.util.Calendar; /** * @author Denis Cechina */ public class EmployeeBirthDate { public static String[] getYears() { int startYear = Calendar.getInstance().get(Calendar.YEAR); int endYear = startYear - 100; String[] years = new String[100]; int y = 0; for (int i = startYear; i > endYear; i--) { years[y++] = (String.valueOf(i)); } return years; } public static String[] getDays(int year, String month) { DecimalFormat formatter = new DecimalFormat("00"); boolean isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)); int day; if (month.equals("Sep") || month.equals("Apr") || month.equals("Jun") || month.equals("Nov")) { day = 1; String[] days = new String[30]; for (int i = 0; i < 30; i++) { days[i] = formatter.format(day++); } return days; } else if (!isLeapYear && month.equals("Feb")) { day = 1; String[] days = new String[28]; for (int i = 0; i < 28; i++) { days[i] = formatter.format(day++); } return days; } else if (isLeapYear && month.equals("Feb")) { day = 1; String[] days = new String[29]; for (int i = 0; i < 29; i++) { days[i] = formatter.format(day++); } return days; } else { day = 1; String[] days = new String[31]; for (int i = 0; i < 31; i++) { days[i] = formatter.format(day++); } return days; } } }
[ "Cechina.Denis@gmail.com" ]
Cechina.Denis@gmail.com
5e89ec825505d4b7849f2f44795296f46450688c
11cb599dbd2a736841fe3b7ed38dba4343a59cbd
/poo2020/src/disenio_repeticion/EjecutaEmpleadoWhile.java
b5b1d7a2f6979c238a91ba99e8d0f2b6578fa8c1
[]
no_license
LeonardoAV7/poo2020
95810a578616eeb48df5ef62b91de90ad2eced47
2395efaf04d88b1bcb3ccc37cbd14011193e913f
refs/heads/master
2020-12-31T08:17:25.207990
2020-03-06T17:31:14
2020-03-06T17:31:14
238,947,543
0
0
null
null
null
null
UTF-8
Java
false
false
1,042
java
package disenio_repeticion; import java.util.Scanner; public class EjecutaEmpleadoWhile { public static void main(String[] args) { Scanner teclado = new Scanner(System.in); String opcion = "si"; System.out.println("cuota por hora: "); double cuota = teclado.nextDouble(); teclado.nextLine(); while(opcion.equals("si")) { System.out.println("Nombre del empleado: "); String nombre = teclado.nextLine(); System.out.println("horas trabajadas: "); int horas = teclado.nextInt(); Empleado empleado = new Empleado(nombre, horas); empleado.setCuota(cuota); empleado.calcularSueldo(); System.out.println("Nombre: " + empleado.getNombre() + "\nSueldo: " + empleado.getSueldo()); teclado.nextLine(); System.out.println("Desea calcular el sueldo de otro empleado si/no: "); opcion = teclado.nextLine(); } } }
[ "noreply@github.com" ]
noreply@github.com