blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e81953fcd7b35b2f17c8659e117e9bf1d832fc5a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_257c87a88ecdfa8def9079133a9ad8e801ddc3be/ObjectMapperTest/2_257c87a88ecdfa8def9079133a9ad8e801ddc3be_ObjectMapperTest_s.java | bcb6589606b9eae8c7bdc7184c1e522ded5dac0f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,583 | java | package de.caluga.test.mongo.suite;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import de.caluga.morphium.Morphium;
import de.caluga.morphium.ObjectMapperImpl;
import org.bson.types.ObjectId;
import org.junit.Test;
import java.util.Date;
/**
* User: Stpehan Bösebeck
* Date: 26.03.12
* Time: 14:04
* <p/>
* TODO: Add documentation here
*/
public class ObjectMapperTest extends MongoTest {
@Test
public void testCreateCamelCase() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
assert (om.createCamelCase("this_is_a_test", false).equals("thisIsATest")) : "Error camil case translation not working";
assert (om.createCamelCase("a_test_this_is", true).equals("ATestThisIs")) : "Error - capitalized String wrong";
}
@Test
public void testConvertCamelCase() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
assert (om.convertCamelCase("thisIsATest").equals("this_is_a_test")) : "Conversion failed!";
}
@Test
public void testGetCollectionName() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
assert (om.getCollectionName(CachedObject.class).equals("cached_object")) : "Cached object test failed";
assert (om.getCollectionName(UncachedObject.class).equals("uncached_object")) : "Uncached object test failed";
}
@Test
public void testMarshall() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
UncachedObject o = new UncachedObject();
o.setCounter(12345);
o.setValue("This \" is $ test");
DBObject dbo = om.marshall(o);
System.out.println("Marshalling was: " + dbo.toString());
assert (dbo.toString().equals("{ \"value\" : \"This \\\" is $ test\" , \"counter\" : 12345 , \"_id\" : null }")) : "String creation failed?" + dbo.toString();
}
@Test
public void testUnmarshall() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
BasicDBObject dbo = new BasicDBObject();
dbo.put("counter", 12345);
dbo.put("value", "A test");
om.unmarshall(UncachedObject.class, dbo);
}
@Test
public void testGetId() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
UncachedObject o = new UncachedObject();
o.setCounter(12345);
o.setValue("This \" is $ test");
o.setMongoId(new ObjectId(new Date()));
ObjectId id = om.getId(o);
assert (id.equals(o.getMongoId())) : "IDs not equal!";
}
@Test
public void testIsEntity() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
assert (om.isEntity(UncachedObject.class)) : "Uncached Object no Entity?=!?=!?";
assert (om.isEntity(new UncachedObject())) : "Uncached Object no Entity?=!?=!?";
assert (!om.isEntity("")) : "String is an Entity?";
}
@Test
public void testGetValue() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
UncachedObject o = new UncachedObject();
o.setCounter(12345);
o.setValue("This \" is $ test");
assert (om.getValue(o, "counter").equals(12345)) : "Value not ok!";
}
@Test
public void testSetValue() throws Exception {
ObjectMapperImpl om = new ObjectMapperImpl();
UncachedObject o = new UncachedObject();
o.setCounter(12345);
om.setValue(o, "A test", "value");
assert ("A test".equals(o.getValue())) : "Value not set";
}
@Test
public void complexObjectTest() {
ObjectMapperImpl om = new ObjectMapperImpl();
UncachedObject o = new UncachedObject();
o.setCounter(12345);
o.setValue("Embedded value");
Morphium.get().store(o);
ComplexObject co = new ComplexObject();
co.setEinText("Ein text");
co.setEmbed(o);
ObjectId embedId = o.getMongoId();
o = new UncachedObject();
o.setCounter(12345);
o.setValue("Referenced value");
// o.setMongoId(new ObjectId(new Date()));
Morphium.get().store(o);
co.setRef(o);
co.setId(new ObjectId(new Date()));
String st = co.toString();
System.out.println("Referenced object: " + om.marshall(o).toString());
DBObject marshall = om.marshall(co);
System.out.println("Complex object: " + marshall.toString());
//Unmarshalling stuff
co = om.unmarshall(ComplexObject.class, marshall);
co.getEmbed().setMongoId(embedId); //need to set ID manually, as it won't be stored!
String st2 = co.toString();
assert (st.equals(st2)) : "Strings not equal?\n" + st + "\n" + st2;
}
@Test
public void nullValueTests() {
ObjectMapperImpl om = new ObjectMapperImpl();
ComplexObject o=new ComplexObject();
o.setTrans("TRANSIENT");
DBObject obj=null;
try {
obj= om.marshall(o);
} catch(IllegalArgumentException e) {
//good, ein_text is null - should trigger this exception!
}
assert(obj==null):"NotNull constraint not enforced! "+obj.toString();
o.setEinText("Ein Text");
obj=om.marshall(o);
assert(!obj.containsField("trans")):"Transient field used?!?!?";
assert(obj.containsField("null_value")):"Null value not set";
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1a6af4607bb9c6b26d7bd9a2c408c65575eab81b | 9324f7177a6c139af8dc691b98f5aced07cdcc29 | /app/src/main/java/com/example/vitalle/Sprite.java | 57b5c9ed0c3315e0f2673bb89ebc2b3adce42d60 | [] | no_license | matthewlsimms94/Vitalle | 1e1bcb44539bc722bbf3a116e362257bd31c4275 | e56fc6a9d07a100a291d758eb7ac66064f3d59d9 | refs/heads/master | 2021-01-18T17:46:44.595498 | 2016-09-25T17:02:19 | 2016-09-25T17:02:19 | 69,120,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,230 | java | package com.example.vitalle;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.widget.ImageView;
import android.graphics.Rect;
/**
* Created by samsung on 9/24/2016.
*/
public class Sprite {
private int iCurrentFrame;
private int iNumberOfFrames;
private int iFrameLength;
private int iFrameCounter;
private int iFrameWidth;
private int iFrameHeight;
private int x, y;
private float scaleX,scaleY;
private Bitmap bSource;
private Bitmap bFrame;
//private Context parentContext;
public Sprite(int resourceId, Context parentContext, int numberOfFrames, int frameLength, float scaleX, float scaleY) {
bSource = BitmapFactory.decodeResource(parentContext.getResources(), resourceId);
iCurrentFrame = 0;
iNumberOfFrames = numberOfFrames;
iFrameLength = frameLength;
iFrameCounter = 0;
x = 50;
y = 50;
this.scaleX = scaleX;
this.scaleY = scaleY;
iFrameWidth = bSource.getWidth()/iNumberOfFrames;
iFrameHeight = bSource.getHeight();
bFrame = Bitmap.createBitmap(iFrameWidth, iFrameHeight, Bitmap.Config.RGB_565);
//cTarget = new Canvas(bSource);
}
void update(int x, int y){
this.x = x;
this.y = y;
iFrameCounter++;
if (iFrameCounter >= iFrameLength)
{
iFrameCounter = 0;
iCurrentFrame++;
if (iCurrentFrame >= iNumberOfFrames)
iCurrentFrame = 0;
bFrame = Bitmap.createBitmap(bSource,iCurrentFrame*iFrameWidth,0,iFrameWidth,iFrameHeight);
}
}
void draw(Canvas canvas){
Rect src = new Rect(0,0,iFrameWidth-1, iFrameHeight-1);
Rect dest = new Rect((int)(x*scaleX),(int)(y*scaleY),(int)((x+iFrameWidth-1)*scaleX), (int)((y+iFrameHeight-1)*scaleY));
canvas.drawBitmap(bFrame, src, dest, null);
//canvas.drawBitmap(bFrame,x,y,null);
//imTarget.setImageDrawable(new BitmapDrawable(parentContext.getResources(), bFrame));
}
}
| [
"matthewlsimms94@gmail.com"
] | matthewlsimms94@gmail.com |
dab3a06022121ed3248bdbdfbd6d80cc4d022fb5 | 729db4b8070ca7d5d41d20a19a645fe5d2e1db32 | /app/src/test/java/cn/edu/swl/s07150741/mycamera/ExampleUnitTest.java | 907ce91dbb9d3a0e9eebb773859352ea4512cb26 | [] | no_license | gdmec07150741/MyCamera | 2358c8ab5e11bb7ab7cb9c9ea0bea9e88119c61a | 613da2fbcd32b13c66c0b797e28072ccf12d6976 | refs/heads/master | 2020-06-09T12:21:04.053081 | 2016-12-09T13:52:52 | 2016-12-09T13:52:52 | 76,039,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package cn.edu.swl.s07150741.mycamera;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"tyxingxue@163.com"
] | tyxingxue@163.com |
b6c2b9b3d9aa8605d295b6fedaf83f0f5abfa504 | abc616ce431a07fcd0bae01431793084372c17eb | /app/src/androidTest/java/com/myapplicationdev/android/demoradiobuttons/ExampleInstrumentedTest.java | d409b130c2ddef608bec75287857d1ea834e1e24 | [] | no_license | QaiWalker/DemoRadioButton | 7071fed1d9e9634c5f7feb83d67d62828ce5254e | 2a152d4acb605071d547b84110a46fc025d71836 | refs/heads/master | 2020-03-11T04:18:22.779938 | 2018-07-03T10:18:22 | 2018-07-03T10:18:22 | 129,773,569 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.myapplicationdev.android.demoradiobuttons;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.myapplicationdev.android.demoradiobuttons", appContext.getPackageName());
}
}
| [
"16014753@myrp.edu.sg"
] | 16014753@myrp.edu.sg |
769f76784da0d0ece10255af9d51519c3d86c57e | 96a31b041b617d2fc62fcfc694481401ab1c0bed | /lets-spring-data-jpa-pagination/src/main/java/io/github/wdpm/domain/Person.java | 5b89ec68db7f5aa62b1dc06263ae81eb9be89723 | [
"MIT"
] | permissive | wdpm/lets-spring | 5534911a296df2fb75f2c99da6c42ce66a18b705 | 073f02fbbba745334b445fe256e955c6be4e20d3 | refs/heads/master | 2023-01-23T12:06:42.363835 | 2020-05-25T07:19:05 | 2020-05-25T07:19:05 | 266,372,658 | 0 | 0 | MIT | 2020-12-13T07:25:50 | 2020-05-23T16:11:12 | Java | UTF-8 | Java | false | false | 1,790 | java | package io.github.wdpm.domain;
import javax.persistence.*;
import java.util.Objects;
@Entity
@NamedQuery(name = "Person.findByFirstNameNamed",
query = "SELECT p FROM Person p WHERE p.firstName = ?1")
@NamedNativeQuery(name = "Person.findByLastNameNativeNamed",
query = "SELECT * FROM Person p WHERE p.lastName = :lastName")
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String firstName;
private String lastName;
private int age;
public Person() {
}
public Person(String firstName, String lastName, int age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Person person = (Person) o;
return id.equals(person.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public String toString() {
return "Person{" + "id=" + id + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' +
", age=" + age + '}';
}
}
| [
"1137299673@qq.com"
] | 1137299673@qq.com |
fb9646d44e85adbed31787910b9a711d477c39a4 | 79cfe3a37d3edee488035d61b8f462d1a0b725ff | /Tourism/app/src/main/java/Adapter/hainanAdapter.java | 98adafa075d97eda89412a78d41cc3add9200287 | [] | no_license | Davidlover/mygraduationdesign | 80d2b2cac42b08699a26b92e1d7525e3745e7d32 | b03e972028f53a33d4cdd5d803f32daf64a8821f | refs/heads/master | 2020-06-15T06:47:04.305184 | 2019-07-04T11:52:31 | 2019-07-04T11:52:31 | 195,230,028 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,280 | java | package Adapter;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.lenovo.tourism.R;
import java.util.List;
//import java.util.List;
//
public class hainanAdapter extends RecyclerView.Adapter<hainanAdapter.ViewHolder> {
// private int resourceId;
private List<Hainan> mHainanList;
static class ViewHolder extends RecyclerView.ViewHolder{
ImageView hainanimage;
// TextView beijingname;
public ViewHolder(View view){
super(view);
hainanimage=(ImageView)view.findViewById(R.id.hainan_item_image);
// beijingname=(TextView)view.findViewById(R.id.beijing_item_name);
}
}
public hainanAdapter(List<Hainan>mHainanList1)
{
mHainanList=mHainanList1;
}
@NonNull
@Override
public hainanAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view=LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.hainan_item,viewGroup,false);
ViewHolder holder=new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull hainanAdapter.ViewHolder viewHolder, int position) {
Hainan hainan=mHainanList.get(position);
viewHolder.hainanimage.setImageResource(hainan.getImageId());
//viewHolder.beijingname.setText(beijing.getName());
}
@Override
public int getItemCount() {
return mHainanList.size();
}
/**
* ListView的代码
*
* */
// @Override
// public View getView(int position, View convertView, ViewGroup parent)
// {
// //获取当前实例
// Beijing beijing=getItem(position);
// View view=LayoutInflater.from(getContext()).inflate(resourceId,parent,false);
// ImageView BeijingImage=(ImageView)view.findViewById(R.id.beijing_item_image);
// TextView BeijingName=(TextView)view.findViewById(R.id.beijing_item_name);
// BeijingImage.setImageResource(beijing.getImageId());
// BeijingName.setText(beijing.getName());
// return view;
// }
}
| [
"1249264723@qq.com"
] | 1249264723@qq.com |
f876b9411546ca4b585ed58b3a1c5b4e572f3826 | 57323bcb93524752dce658e128ba165c95e1a6e4 | /bmrb_plus_pdb_ext/src/EDU/bmrb/starlibj/DataValueNode.java | c61eb798da603910b06d71cc7474e1c285a7fee6 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yokochi47/BMRBxTool | b1e922940bac6e2d010b3dcbd96661efe1ec563f | 78acbf8fae9a3dd1aae2fdf5ba8b0b469624a761 | refs/heads/master | 2023-08-18T18:31:28.076291 | 2023-08-10T03:50:30 | 2023-08-10T03:50:30 | 120,285,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,500 | java | package EDU.bmrb.starlibj;
/** DataValueNode is the class that stores a single value from the
* STAR tree. It is used for both loop values and the values associated
* with tags outside of loops. Making this a class instead of just a
* string allows for the handling of the delimiter type.
*/
public class DataValueNode extends StarNode implements Cloneable {
protected String myStrVal;
protected short delimType;
/** delimiter type that indicates that you don't care about
* the delimiter type - only used for searches such as
* <TT>searchForType()</TT>
* @see getDelimType
@ @see StarNode.searchForType()
*/
public static short DONT_CARE = -1;
/** delimiter type that indicates that this is a nonquoted value.
* @see getDelimType
*/
public static short NON = 0;
/** delimiter type that indicates that this is a doublequoted value (")
* @see getDelimType
*/
public static short DOUBLE = 1;
/** delimiter type that indicates that this is a singlequoted value (')
* @see getDelimType
*/
public static short SINGLE = 2;
/** delimiter type that indicates that this is semicolon demilited (;)
* @see getDelimType
*/
public static short SEMICOLON = 3;
/** delimiter type that indicates that this is a framecode value
* @see getDelimType
*/
public static short FRAMECODE = 4;
/** Returns the delimiter type of this value.
* Note that the delimiter type of this value determines what kind
* of delimiter is used by this value. The delimiter itself is not
* Included as part of the value string. So a value that appears
* as "sample value" in the STAR file will contain <TT>sample value</TT>
* in the string, and will be of delimiter type <TT>DOUBLE</TT>. This
* is true for all the value types, including framecodes (the dollarsign
* is not part of the string value itself).
* @return NON, DOUBLE, SINGLE, SEMICOLON, or FRAMECODE
*/
public short getDelimType() {
return delimType;
}
/** Sets the delimiter type of this value.
* Lets the programmer choose a delimiter type for this value.
*
* @exception BadValueForDelimiter Throws this exception if
* the delimiter type is incorrect for the given type of string
* (for example, if a string with whitespace is given a delimiter
* type of "NON", that's an error.)
*/
public void setDelimType(short setTo) throws BadValueForDelimiter {
if (StarValidity.isValidForDelim(myStrVal, setTo)) delimType = setTo;
else throw new BadValueForDelimiter(myStrVal, setTo);
}
/** Returns the string containing the value of this node. All values
* are stored as strings, even numbers. If you desire to look at the
* value as a number, there are many Java methods that will let you
* convert strings to numbers on-the-fly.
*/
public String getValue() {
return myStrVal;
}
/** Sets the string value for this node.
* @exception BadValueForDelimiter The string value is not
* acceptable for the delimiter the value has. If you are
* intending to change the delimiter too in the next statement,
* try changing the delimiter *first*, or use the method to
* change both at once <TT>setValAndDelim</TT>
* @see setValAndDelim()
*/
public void setValue(String newVal) throws BadValueForDelimiter {
if (StarValidity.isValidForDelim(newVal, delimType)) myStrVal = newVal;
else throw new BadValueForDelimiter(newVal, delimType);
}
/** Sets the string for this value, and the delimiter.
* @exception BadValueForDelimiter The string value is not
* acceptable for the delimiter given..
*/
public void setValue(String newVal, short newDelim) throws BadValueForDelimiter {
if (StarValidity.isValidForDelim(newVal, newDelim)) {
myStrVal = newVal;
delimType = newDelim;
} else throw new BadValueForDelimiter(newVal, newDelim);
}
/** Constructor - all DataValueNodes must have a string value,
* so no provisions are made for a 'default' no-args constructor.
* The delimiter type will be chosen as the first delimiter type
* that is valid for the string value. It will try all the
* types of delimiter until a valid type is found, using the
* following order to try them in:
* <TT><OL>
* <LI>NON</LI>
* <LI>DOUBLE</LI>
* <LI>SINGLE</LI>
* <LI>SEMICOLON</LI>
* </OL></TT>
* @exception BadValueForDelimiter if the value for the
* node won't be valid syntax given the kind of delimiter
* the node has. In theory this should be very rare
* given that most strings should fit into at least one of
* the delimiter types. The only problem is when a multiline
* string cannot be a semicolon string because it has
* embedded semicolons that appear at the start of a line.
*/
public DataValueNode(String str) throws BadValueForDelimiter {
super();
short i;
myStrVal = str;
// Find the appropriate delimiter type:
// (Never pick FRAMECODE unless explicitly told to do so.)
for (i = NON; i <= SEMICOLON; i++) {
if (StarValidity.isValidForDelim(str, i)) {
delimType = i;
break;
}
}
if (i > SEMICOLON) throw new BadValueForDelimiter(str, i);
}
/** Constructor - all DataValueNodes must have a string value,
* so no provisions are made for a 'default' no-args constructor.
* @param str The string to set the value to.
* @param delim The delimiter type to set the value to.
*/
public DataValueNode(String str, short delim) throws BadValueForDelimiter {
super();
if (StarValidity.isValidForDelim(str, delim)) {
myStrVal = str;
delimType = delim;
} else throw new BadValueForDelimiter(str, delim);
}
/** Constructor - copy another DataValueNode. */
public DataValueNode(DataValueNode copyMe) {
super(copyMe);
myStrVal = (copyMe.getValue() == null) ? null : new String(copyMe.getValue());
delimType = copyMe.getDelimType();
}
/** Allocates a new copy of me and returns a reference to it.
* This is a deep copy, meaning that all children are copied
* instead of linked.
*/
public Object clone() {
return new DataValueNode(this);
}
/** Alias for getValue */
public String getLabel() {
return myStrVal;
}
/** Unparse prints the contents of the StarNode object out to the
* given stream. This is essentially the inverse of the CS term
* to "parse", hence the name "Unparse". The parameter given is
* the indentation level to print things.
*/
public void Unparse(int indent) {
// Fill this messy thing in later.
}
/** Useful for printing.
*/
public int myLongestStr() {
int retVal = myStrVal.length();
if (delimType == NON) retVal += 0; // Leave it as it is.
else if (delimType == SINGLE) retVal += 2;
else if (delimType == DOUBLE) retVal += 2;
else if (delimType == FRAMECODE) retVal += 1;
else if (delimType == SEMICOLON) retVal += 4; // fairly meaningless, really
return retVal;
}
public VectorCheckType searchForType(Class <? > type, short delim) {
// Default behavior if not overridden is to check my
// own type and add myself to the list if I am the
// type being looked for.
VectorCheckType retVal = new VectorCheckType();
try {
retVal.addType(Class.forName(StarValidity.clsNameStarNode));
retVal.freezeTypes();
if (type.isInstance(this) && (delim == getDelimType() || delim == DONT_CARE)) retVal.addElement(this);
} catch (ClassNotFoundException exc) {
System.err.println("Should never happen exception: " + exc.getMessage());
exc.printStackTrace();
}
return retVal; // Intended to be overridden
}
} | [
"yokochi47@gmail.com"
] | yokochi47@gmail.com |
4df333d08970a524e4f25d6285c1dc682493459e | 890af51efbc9b8237e0fd09903f78fe2bb9caadd | /general/storage/com/hd/agent/storage/dao/AdjustmentsMapper.java | af5019b574419fa00b4a918ee9a0ac01ebdc0989 | [] | no_license | 1045907427/project | 815fb0c5b4b44bf5d8365acfde61b6f68be6e52a | 6eaecf09cd3414295ccf91454f62cf4d619cdbf2 | refs/heads/master | 2020-04-14T19:17:54.310613 | 2019-01-14T10:49:11 | 2019-01-14T10:49:11 | 164,052,678 | 0 | 5 | null | null | null | null | UTF-8 | Java | false | false | 4,072 | java | package com.hd.agent.storage.dao;
import com.hd.agent.common.util.PageMap;
import com.hd.agent.storage.model.Adjustments;
import com.hd.agent.storage.model.AdjustmentsDetail;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 库存调账单dao
* @author chenwei
*/
public interface AdjustmentsMapper {
/**
* 添加调账单基本信息
* @param adjustments
* @return
* @author chenwei
* @date May 24, 2013
*/
public int addAdjustments(Adjustments adjustments);
/**
* 添加调整单明细信息
* @param adjustmentsDetail
* @return
* @author chenwei
* @date May 24, 2013
*/
public int addAdjustmentsDetail(AdjustmentsDetail adjustmentsDetail);
/**
* 获取调账单列表
* @param pageMap
* @return
* @author chenwei
* @date May 25, 2013
*/
public List showAdjustmentsList(PageMap pageMap);
/**
* 获取调账单数量
* @param pageMap
* @return
* @author chenwei
* @date May 25, 2013
*/
public int showAdjustmentsCount(PageMap pageMap);
/**
* 获取调账单信息
* @param id
* @return
* @author chenwei
* @date May 25, 2013
*/
public Adjustments getAdjustmentsInfo(@Param("id")String id);
/**
* 根据调账单编号获取调账单明细列表
* @param adjustmentsid
* @param storageid
* @return
* @author chenwei
* @date May 25, 2013
*/
public List getAdjustmentsDetailList(@Param("adjustmentsid")String adjustmentsid, @Param("storageid")String storageid);
/**
* 删除调账单
* @param id
* @return
* @author chenwei
* @date May 25, 2013
*/
public int deleteAdjustments(@Param("id")String id);
/**
* 删除调账单明细
* @param adjustmentsid
* @return
* @author chenwei
* @date May 25, 2013
*/
public int deleteAdjustmentsDetail(@Param("adjustmentsid")String adjustmentsid);
/**
* 修改调账单
* @param adjustments
* @return
* @author chenwei
* @date May 27, 2013
*/
public int editAdjustments(Adjustments adjustments);
/**
* 通过盘点单编号,获取调账单信息
* @param checkListid
* @return
* @author chenwei
* @date May 28, 2013
*/
public Adjustments getAdjustmentsByCheckListid(String checkListid);
/**
* 审核调账单
* @param id
* @param userid
* @param username
* @return
* @author chenwei
* @date May 28, 2013
*/
public int auditAdjustments(@Param("id")String id,@Param("userid")String userid,@Param("username")String username,@Param("businessdate")String businessdate);
/**
* 反审调账单
* @param id
* @return
* @author chenwei
* @date May 28, 2013
*/
public int oppauditAdjustments(@Param("id")String id);
/**
* 导出调账单
* @param pageMap
* @return
* @author panxiaoxiao
* @date Apr 29, 2014
*/
public List<Map<String, Object>> getAdjustmentListExport(PageMap pageMap);
/**
* 获取调账单列表<br/>
* map中参数:<br/>
* dataSql:数据权限<br/>
* idarrs: 编号字符串组,类似 1,2,3<br/>
* status: 表示状态3<br/>
* statusarr: 表示状态,类似 1,2,3<br/>
* billtype : 单据类型1报益单2报损单<br/>
* @param map
* @return
* @author zhanghonghui
* @date 2013-10-16
*/
public List showAdjustmentsListBy(Map map);
/**
* 更新打印次数
* @param adjustments
* @return
* @author zhanghonghui
* @date 2015年1月9日
*/
public int updateOrderPrinttimes(Adjustments adjustments);
/**
* 更新调账单明细相关的商品批次编号
* @param id
* @param summarybatchid
* @return
* @author chenwei
* @date 2015年10月28日
*/
public int updateAdjustmentsDetailSummarybatchid(@Param("id")String id,@Param("summarybatchid")String summarybatchid,@Param("price")BigDecimal price);
/**
* 获取报溢调账单生成凭证的数据
* @param list
* @return java.util.List
* @throws
* @author luoqiang
* @date Jan 03, 2018
*/
public List getAdjustmentsSumData(@Param("list")List list,@Param("billtype")String billtype);
} | [
"1045907427@qq.com"
] | 1045907427@qq.com |
500788a8cbd0eacf1789f87cbd1ff40c73e13d5f | 1b7598667fe72dc6a4057ca42dbd1ae9f1f4d63c | /src/main/java/com/lanyu/jenkins/hellojenkins/common/vo/RedisInfo.java | c62c3fed6da8a0a4f84bc48a1c82cc286d9db6d0 | [] | no_license | lanyu1/helloJenkins | a9e0aef5c8065c29f5d9818c3e142c7179a9703a | 20f28ea7d2ee736dc6cdabeba5476772e2f33af4 | refs/heads/master | 2023-07-15T15:05:51.782922 | 2021-09-01T01:49:52 | 2021-09-01T01:49:52 | 370,936,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,331 | java | package com.lanyu.jenkins.hellojenkins.common.vo;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @author lanyu
* @date 2021年08月11日 10:59
*/
@Data
public class RedisInfo {
private static Map<String, String> map = new HashMap<>();
static {
map.put("redis_version", "Redis 服务器版本");
map.put("os", "Redis 服务器的宿主操作系统");
map.put("arch_bits", " 架构(32 或 64 位)");
map.put("multiplexing_api", "Redis 所使用的事件处理机制");
map.put("gcc_version", "编译 Redis 时所使用的 GCC 版本");
map.put("process_id", "服务器进程的 PID");
map.put("run_id", "Redis 服务器的随机标识符(用于 Sentinel 和集群)");
map.put("tcp_port", "TCP/IP 监听端口");
map.put("uptime_in_seconds", "自 Redis 服务器启动以来,经过的秒数");
map.put("uptime_in_days", "自 Redis 服务器启动以来,经过的天数");
map.put("lru_clock", " 以分钟为单位进行自增的时钟,用于 LRU 管理");
map.put("connected_clients", "已连接客户端的数量(不包括通过从属服务器连接的客户端)");
map.put("client_longest_output_list", "当前连接的客户端当中,最长的输出列表");
map.put("client_longest_input_buf", "当前连接的客户端当中,最大输入缓存");
map.put("blocked_clients", "正在等待阻塞命令(BLPOP、BRPOP、BRPOPLPUSH)的客户端的数量");
map.put("used_memory", "由 Redis 分配器分配的内存总量,以字节(byte)为单位");
map.put("used_memory_human", "以人类可读的格式返回 Redis 分配的内存总量");
map.put("used_memory_rss", "从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps 等命令的输出一致");
map.put("used_memory_peak", " Redis 的内存消耗峰值(以字节为单位)");
map.put("used_memory_peak_human", "以人类可读的格式返回 Redis 的内存消耗峰值");
map.put("used_memory_lua", "Lua 引擎所使用的内存大小(以字节为单位)");
map.put("redis_mode", "运行模式,单机(standalone)或者集群(cluster)");
map.put("executable", "server脚本目录");
map.put("config_file", "配置文件目录");
map.put("used_memory_rss_human", "以人类可读的方式返回 Redis 已分配的内存总量");
map.put("used_memory_peak_perc", "内存使用率峰值");
map.put("total_system_memory", "系统总内存");
map.put("total_system_memory_human", "以人类可读的方式返回系统总内存");
map.put("used_memory_lua_human", "以人类可读的方式返回Lua 引擎所使用的内存大小");
map.put("maxmemory", "最大内存限制,0表示无限制");
map.put("maxmemory_human", "以人类可读的方式返回最大限制内存");
map.put("maxmemory_policy", "超过内存限制后的处理策略");
map.put("loading", "服务器是否正在载入持久化文件");
map.put("rdb_changes_since_last_save", "离最近一次成功生成rdb文件,写入命令的个数,即有多少个写入命令没有持久化");
map.put("rdb_bgsave_in_progress", "服务器是否正在创建rdb文件");
map.put("rdb_last_bgsave_status", "最近一次rdb持久化是否成功");
map.put("rdb_last_bgsave_time_sec", "最近一次成功生成rdb文件耗时秒数");
map.put("rdb_current_bgsave_time_sec", "如果服务器正在创建rdb文件,那么这个域记录的就是当前的创建操作已经耗费的秒数");
map.put("aof_enabled", "是否开启了aof");
map.put("aof_rewrite_in_progress", "标识aof的rewrite操作是否在进行中");
map.put("aof_last_rewrite_time_sec", "最近一次aof rewrite耗费的时长");
map.put("aof_current_rewrite_time_sec", "如果rewrite操作正在进行,则记录所使用的时间,单位秒");
map.put("aof_last_bgrewrite_status", "上次bgrewrite aof操作的状态");
map.put("aof_last_write_status", "上次aof写入状态");
map.put("total_commands_processed", "redis处理的命令数");
map.put("instantaneous_ops_per_sec", "redis当前的qps,redis内部较实时的每秒执行的命令数");
map.put("total_net_input_bytes", "redis网络入口流量字节数");
map.put("total_net_output_bytes", "redis网络出口流量字节数");
map.put("instantaneous_input_kbps", "redis网络入口kps");
map.put("instantaneous_output_kbps", "redis网络出口kps");
map.put("rejected_connections", "拒绝的连接个数,redis连接个数达到maxclients限制,拒绝新连接的个数");
map.put("expired_keys", "运行以来过期的key的数量");
map.put("evicted_keys", "运行以来剔除(超过了maxmemory后)的key的数量");
map.put("keyspace_hits", "命中次数");
map.put("keyspace_misses", "没命中次数");
}
private String key;
private String value;
private String description;
public String getDescription() {
return map.get(this.key);
}
}
| [
"lanyu@bsoft.com.cn"
] | lanyu@bsoft.com.cn |
5e384b0cab02d8a394efd9d6bbac22e25f3d83ff | 38335bb81ec864b820f171dff86e48ea7fcf94de | /src/data_structures/grafo/ArcoYaExisteException.java | 97723c620ec349c3611632c061c2df9bf8cd012d | [] | no_license | Juan2707/Proyecto_3_201910_SEC_02_TEAM_3 | 4ef64962ad571c803afb7229864c9e7566826544 | 99168b347ab5fdf8886eff2209bdd1dd5784378d | refs/heads/master | 2020-05-25T10:09:23.224241 | 2019-05-21T03:16:40 | 2019-05-21T03:16:40 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,552 | java | /**
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* $Id: ArcoYaExisteException.java,v 1.3 2008/10/11 22:02:54 alf-mora Exp $
* Universidad de los Andes (Bogotá - Colombia)
* Departamento de Ingeniería de Sistemas y Computación
* Licenciado bajo el esquema Academic Free License version 2.1
*
* Proyecto Cupi2 (http://cupi2.uniandes.edu.co)
* Framework: Cupi2Collections
* Autor: Pablo Barvo - Mar 29, 2006
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
package data_structures.grafo;
/**
* Excepción lanzada cuando el arco especificado ya existe
*/
public class ArcoYaExisteException extends Exception
{
// -----------------------------------------------------------------
// Constantes
// -----------------------------------------------------------------
/**
* Constante para la serialización
*/
private static final long serialVersionUID = 1L;
// -----------------------------------------------------------------
// Atributos
// -----------------------------------------------------------------
/**
* Identificador del vértice desde donde debería salir el arco
*/
private Object origen;
/**
* Identificador del vértice hasta donde debería llegar el arco
*/
private Object destino;
// -----------------------------------------------------------------
// Constructores
// -----------------------------------------------------------------
/**
* Constructor de la excepción
* @param mensaje Mensaje de error
* @param idDesde Identificador del vértice desde donde sale el arco
* @param idHasta Identificador del vértice hasta donde llega el arco
*/
public ArcoYaExisteException( String mensaje, Object idDesde, Object idHasta )
{
super( mensaje );
origen = idDesde;
destino = idHasta;
}
// -----------------------------------------------------------------
// Métodos
// -----------------------------------------------------------------
/**
* Devuelve el identificador del vértice desde donde debe salir el arco
* @return identificador del vértice desde donde debe salir el arco
*/
public Object darOrigen( )
{
return origen;
}
/**
* Devuelve el identificador del vértice hasta donde debe llegar el arco
* @return identificador del vértice hasta donde debe llegar el arco
*/
public Object darDestino( )
{
return destino;
}
}
| [
"ja.guzmanb1@uniandes.edu.co"
] | ja.guzmanb1@uniandes.edu.co |
5f4c29a4a04303d5a001e6510787fb078722ff68 | cd0466177f20a893cb2ef00e7e1d6682c2b9091a | /app/src/main/java/com/chen/fy/patshow/util/RUtil.java | 2b01014cf934aed09d61b359a15f45cc4f0b70eb | [] | no_license | StephenChenOk/PatShow | 497583321280a23fcca3e6a1af7623ff2d1f4277 | 77bef76e9c358bb0d1b964e5e8d28d0b0853392e | refs/heads/master | 2023-04-13T22:22:38.545291 | 2021-04-23T05:53:37 | 2021-04-23T05:53:37 | 345,638,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package com.chen.fy.patshow.util;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.chen.fy.patshow.MyApplication;
public class RUtil {
public static String toString(int key){
return MyApplication.getContext().getResources().getString(key);
}
public static int toInt(int key){
return MyApplication.getContext().getResources().getInteger(key);
}
/// R -> Bitmap
public static Bitmap RToBitmap(Resources resources, int resource){
return BitmapFactory.decodeResource(resources, resource);
}
}
| [
"1670617529@qq.com"
] | 1670617529@qq.com |
cf1ea5f1713d947f1be882a6a795f90140d82a59 | 7572fd4d0c4689b28dc7a4278d3ff1be926f4895 | /src/main/java/api/message/error/APIReplyParseException.java | bcd65295d69dd5c8f1bca09f68b3afd47dab5450 | [] | no_license | anhmanh1011/FxExchange | ec463c52c305ba875e50e11973d109325951e5a8 | d2dc7f63c3c63a1551a2dc40ba88f174947ed9e7 | refs/heads/master | 2023-07-30T15:28:05.834146 | 2021-09-13T06:54:21 | 2021-09-13T06:54:21 | 384,871,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package api.message.error;
public class APIReplyParseException extends Exception {
private static final long serialVersionUID = 6518944426920316999L;
/**
* Creates a new instance of
* <code>APIReplyParseException</code> without detail message.
*/
public APIReplyParseException() {}
/**
* Constructs an instance of
* <code>APIReplyParseException</code> with the specified detail message.
*
* @param msg the detail message.
*/
public APIReplyParseException(String msg) {
super(msg);
}
}
| [
"daoducmanh28101997@gmail.com"
] | daoducmanh28101997@gmail.com |
9c534682c72f0de3b7ae508737049325c4ccc2b8 | e4423f90ddfce24798620089fdbee09b5718d41e | /Corejavetraining/src/com/corejava/training/Exceptionhandling/MultipleCatchBlockDemo.java | e58802206cc809c989e03192ebad8ce0dc71c8d9 | [] | no_license | MrPathak21/Lab-book | be8679ac9863cd827d8b87e7bac74971b11d756e | 2f40baa9f2995944811290a853ba58a48eaa6fc5 | refs/heads/main | 2023-04-08T05:37:25.016003 | 2021-04-14T20:20:50 | 2021-04-14T20:20:50 | 357,949,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,074 | java | package com.corejava.training.Exceptionhandling;
public class MultipleCatchBlockDemo {
public static void main(String[] args) {
System.out.println("Main starts....");
try {
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int c = a/b;
System.out.println("Result: "+c);
}
catch(ArithmeticException e) {
System.out.println("Denominator should not be zero");
//System.out.println(e.getMessage());
e.printStackTrace();
}
catch(NumberFormatException e) {
System.out.println("Pass correct type of args");
//System.out.println(e.getMessage());
e.printStackTrace();
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println("Pass correct no. of args");
//System.out.println(e.getMessage());
e.printStackTrace();
}
System.out.println("Main ends....");
}
}
| [
"66026814+MrPathak21@users.noreply.github.com"
] | 66026814+MrPathak21@users.noreply.github.com |
30bb5f5f466c875e4f6993ae5af479f2cb26ddac | 866cb725f9490fd11cdd44e6ecec1366980b0402 | /src/java/modelo/Comparendo_Curso.java | 35930c6176fa8cfb3335c6784c2c7754758fe847 | [] | no_license | rcamacholci/Transito | 40abe81d107f1596c2748269b1bf9ace7ab51027 | e12813a4072dbdcaa61892e874f442bed291f65d | refs/heads/master | 2020-03-13T14:34:25.747242 | 2018-04-26T18:16:29 | 2018-04-26T18:16:29 | 131,161,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,587 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package modelo;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
*
* @author Administrador
*/
public class Comparendo_Curso {
private long id_comparendo_curso;
private long fk_persona;
private long fk_comparendo;
private int certificado;
private Date fecha;
private int lugar;
private float valor;
private int estado;
private int descuento;
public int getCertificado() {
return certificado;
}
public void setCertificado(int certificado) {
this.certificado = certificado;
}
public int getEstado() {
return estado;
}
public void setEstado(int estado) {
this.estado = estado;
}
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public long getFk_comparendo() {
return fk_comparendo;
}
public void setFk_comparendo(long fk_comparendo) {
this.fk_comparendo = fk_comparendo;
}
public long getFk_persona() {
return fk_persona;
}
public void setFk_persona(long fk_persona) {
this.fk_persona = fk_persona;
}
public long getId_comparendo_curso() {
return id_comparendo_curso;
}
public void setId_comparendo_curso(long id_comparendo_curso) {
this.id_comparendo_curso = id_comparendo_curso;
}
public int getLugar() {
return lugar;
}
public void setLugar(int lugar) {
this.lugar = lugar;
}
public float getValor() {
return valor;
}
public void setValor(float valor) {
this.valor = valor;
}
public int getDescuento() {
return descuento;
}
public void setDescuento(int descuento) {
this.descuento = descuento;
}
public static Comparendo_Curso load(ResultSet rs) throws SQLException{
Comparendo_Curso comparendoCurso = new Comparendo_Curso();
comparendoCurso.setId_comparendo_curso(rs.getLong(1));
comparendoCurso.setFk_persona(rs.getLong(2));
comparendoCurso.setFk_comparendo(rs.getLong(3));
comparendoCurso.setCertificado(rs.getInt(4));
comparendoCurso.setFecha(rs.getDate(5));
comparendoCurso.setLugar(rs.getInt(6));
comparendoCurso.setValor(rs.getFloat(7));
comparendoCurso.setEstado(rs.getInt(8));
comparendoCurso.setDescuento(rs.getInt(9));
return comparendoCurso;
}
}
| [
"rcamacho@Civitrans.com"
] | rcamacho@Civitrans.com |
dd60d533c7737885d96c58fb8da99858da5f6959 | 355096b78c5c1c670663f372034495e4930ff34b | /src/test/java/DemoTraditionalChinese2SimplifiedChinese.java | 69abbd6f0b73d45fc20fdb1be48ec2f54642d4b4 | [] | no_license | pconcool/nlp | 3ee25511b676f1574364eccbd33776361ff7fb2f | d1ac1e92e1368fe3a8ad5808914483b1d6896ad8 | refs/heads/master | 2020-10-01T13:07:28.501396 | 2017-11-28T10:48:21 | 2017-11-28T10:48:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | import com.hankcs.hanlp.HanLP;
/**
* 简繁转换
* @author hankcs
*/
public class DemoTraditionalChinese2SimplifiedChinese
{
public static void main(String[] args)
{
System.out.println(HanLP.convertToTraditionalChinese("用笔记本电脑写程序"));
System.out.println(HanLP.convertToSimplifiedChinese("「以後等妳當上皇后,就能買士多啤梨慶祝了」"));
}
} | [
"xuzhiping@zhongan.io"
] | xuzhiping@zhongan.io |
08d36e9eea7a9d0d11d448422085061db5498d62 | 3c542e30fa49f2f847d475c62dbcbfdea8f493b6 | /src/main/java/com/ebizcuit/security/ajax/AjaxLoginProcessingFilter.java | 0cf1da0ddc2beac42cdb94fdf9334ae189ae6e47 | [] | no_license | onoph/100-days-of-code | 5c80301eb3599f4e42c82542c975687a4ae2504b | 362463f48750198c0d9e37c86c470c069992f61d | refs/heads/master | 2021-01-12T02:04:14.225106 | 2017-02-13T22:35:41 | 2017-02-13T22:35:41 | 78,465,001 | 0 | 0 | null | 2017-01-09T20:14:52 | 2017-01-09T20:14:51 | null | UTF-8 | Java | false | false | 3,640 | java | package com.ebizcuit.security.ajax;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import com.ebizcuit.security.exception.AuthMethodNotSupportedException;
import com.ebizcuit.security.model.LoginRequest;
import com.ebizcuit.security.util.WebUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
public class AjaxLoginProcessingFilter extends AbstractAuthenticationProcessingFilter {
private static Logger logger = LoggerFactory.getLogger(AjaxLoginProcessingFilter.class);
private final AuthenticationSuccessHandler successHandler;
private final AuthenticationFailureHandler failureHandler;
private final ObjectMapper objectMapper;
public AjaxLoginProcessingFilter(String defaultProcessUrl, AuthenticationSuccessHandler successHandler,
AuthenticationFailureHandler failureHandler, ObjectMapper mapper)
{
super(defaultProcessUrl);
this.successHandler = successHandler;
this.failureHandler = failureHandler;
this.objectMapper = mapper;
}
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws AuthenticationException, IOException, ServletException
{
if (!HttpMethod.POST.name().equals(request.getMethod()) || !WebUtil.isAjax(request)) {
if(logger.isDebugEnabled()) {
logger.debug("Authentication method not supported. Request method: " + request.getMethod());
}
throw new AuthMethodNotSupportedException("Authentication method not supported");
}
LoginRequest loginRequest = objectMapper.readValue(request.getReader(), LoginRequest.class);
if(StringUtils.isBlank(loginRequest.getUsername())
|| StringUtils.isBlank(loginRequest.getPassword()))
{
throw new AuthenticationServiceException("Username or Password not provided");
}
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
loginRequest.getUsername(), loginRequest.getPassword());
return this.getAuthenticationManager().authenticate(token);
}
@Override
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response,
FilterChain chain, Authentication authResult) throws IOException, ServletException
{
successHandler.onAuthenticationSuccess(request, response, authResult);
}
@Override
protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response,
AuthenticationException failed) throws IOException, ServletException
{
SecurityContextHolder.clearContext();
failureHandler.onAuthenticationFailure(request, response, failed);
}
}
| [
"x.philipponneau@gmail.com"
] | x.philipponneau@gmail.com |
b5e4e13500bb53c136a7e0cd323fd0a91b342251 | c7419e15724c8f6d147522e252b07c168f853a2c | /src/main/java/net/consensys/eventeum/integration/broadcast/BlockchainEventBroadcaster.java | 9bdc8001f0c9155dcc8cf23b160c4d7000f846c4 | [
"Apache-2.0"
] | permissive | azeem-r00t/eventeum | 3a34b413bf7716e4cea26bc3d2fb929b69e91153 | 7358ea3b2c04ca60743daed5caf74f92e9229416 | refs/heads/master | 2020-03-19T02:35:45.507529 | 2018-06-04T16:05:51 | 2018-06-04T16:05:51 | 135,642,562 | 0 | 0 | Apache-2.0 | 2018-06-04T16:05:52 | 2018-05-31T22:49:34 | Java | UTF-8 | Java | false | false | 747 | java | package net.consensys.eventeum.integration.broadcast;
import net.consensys.eventeum.dto.block.BlockDetails;
import net.consensys.eventeum.dto.event.ContractEventDetails;
/**
* An interface for a class that broadcasts etheruem blockchain details to the wider system.
*
* @author Craig Williams <craig.williams@consensys.net>
*/
public interface BlockchainEventBroadcaster {
/**
* Broadcast details of a new block that has been mined.
* @param block
*/
void broadcastNewBlock(BlockDetails block);
/**
* Broadcasts details of a new smart contract event that has been emitted from the ethereum blockchain.
* @param eventDetails
*/
void broadcastContractEvent(ContractEventDetails eventDetails);
}
| [
"craigwilliams84@googlemail.com"
] | craigwilliams84@googlemail.com |
cb51ae46e9ca9305f7df6181dc6f4681cea0a2a1 | a58f3cfcd76f30336478e16e370a75bcdab014b8 | /web-project/src/main/java/cn/yy/b2c/gciantispider/service/IRealTimeComputDataService.java | f223734bbfda41b3f6879e43c8d5d4098b38325b | [] | no_license | YANGPenny/anti-spider | 9859d0fcc7a6ae34d73b48ccf54cdc0a14640453 | 990772f76554d686b792fedb95c94cb28b7aa6b1 | refs/heads/master | 2022-12-24T10:32:43.376957 | 2019-09-26T09:28:33 | 2019-09-26T09:28:33 | 211,049,432 | 0 | 0 | null | 2022-12-10T00:39:22 | 2019-09-26T09:18:10 | JavaScript | UTF-8 | Java | false | false | 727 | java | /*
* Created on 2017年7月28日
* INhRedisDataService.java V1.0
*
* Copyright Notice =========================================================
* This file contains proprietary information of Kingpintcn Information Technology Co.,Ltd
* Copying or reproduction without prior written approval is prohibited.
* Copyright (c) 2012 =======================================================
*/
package cn.yy.b2c.gciantispider.service;
public interface IRealTimeComputDataService {
/**
* 从redis备份流量数据
*/
void saveRealTimeComputData();
/**
* 统计一天的流量信息
*/
void saveNhCrawlerCurdayInfo();
/**
* 统计链路数据
*/
void saveDataCollectData();
}
| [
"yangyoungmn@163.com"
] | yangyoungmn@163.com |
5a64955b581154a51083b11154011789d71072ce | 37bd9beca09122463e0d406e572f25720daa2d1c | /Lab 6/src/Main.java | fb5d63c63fc9a0f7a80ae0adc8f69c253857fcd4 | [] | no_license | Vitaljaz/Java-course | 35aac469dcf8155ce93b8cecd202bed77089313e | 045950447e32de38eeb88932cab5012d35643b6e | refs/heads/master | 2021-01-05T19:51:10.306604 | 2020-03-11T18:29:43 | 2020-03-11T18:29:43 | 241,121,543 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,304 | java | import java.io.*;
public class Main {
private static double[] sinArray;
private static double[] newArray;
public static void main(String[] args) {
sinArray = new double[360];
newArray = new double[360];
task1();
task2();
task3();
task4();
}
public static void task1() {
try {
PrintWriter pw = new PrintWriter("sin.txt");
for (int i = 0; i < 360; i++) {
pw.println(Math.sin(i));
}
pw.flush();
pw.close();
} catch (FileNotFoundException e) {
System.out.println("[TASK 1]: Error with file sin.txt");
e.printStackTrace();
}
}
public static void task2() {
try {
BufferedReader sinReader = new BufferedReader(new FileReader("sin.txt"));
String str;
int i = 0;
while ((str = sinReader.readLine()) != null) {
sinArray[i] = Double.parseDouble(str);
i++;
}
sinReader.close();
} catch (Exception e) {
System.out.println("[TASK 2]: Error with file sin.txt.");
e.printStackTrace();
}
try {
BufferedReader iReader = new BufferedReader(new FileReader("input.txt"));
String str = iReader.readLine();
iReader.close();
int k = Integer.parseInt(str);
System.out.println("[TASK 2]: " + sinArray[k]);
} catch (Exception e) {
System.out.println("[TASK 2]: Error with file input.txt");
e.printStackTrace();
}
}
public static void task3() {
try {
FileOutputStream fos = new FileOutputStream("sin2.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(sinArray);
oos.close();
double[] newArray;
FileInputStream fis = new FileInputStream("sin2.dat");
ObjectInputStream iis = new ObjectInputStream(fis);
newArray = (double[]) iis.readObject();
iis.close();
System.out.println("[TASK 3]: oldArray[223] = " + sinArray[223] + " ; newArray[223] = " + newArray[223]);
} catch (Exception e) {
e.printStackTrace();
System.out.println("[TASK 3]: Error with sin2.dat");
}
}
public static void task4() {
try {
FileOutputStream fos = new FileOutputStream("sin3.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
for (double i : sinArray) {
oos.writeDouble(i);
}
oos.close();
FileInputStream fis = new FileInputStream("sin3.dat");
ObjectInputStream iis = new ObjectInputStream(fis);
double[] newArray = new double[360];
for (int i = 0; i < sinArray.length; i++) {
newArray[i] = iis.readDouble();
}
iis.close();
System.out.println("[TASK 4]: oldArray[333] = " + sinArray[333] + " ; newArray[333] = " + newArray[33]);
} catch (Exception e) {
e.printStackTrace();
System.out.println("[TASK 4]: Error with sin3.dat");
}
}
}
| [
"43145747+Vitaljaz@users.noreply.github.com"
] | 43145747+Vitaljaz@users.noreply.github.com |
6c79be7b8792f507f492c459f5cd7f6168f2a1b5 | 9075319a8ffaae62e79fd91d85a01831a8ecf629 | /app/src/androidTest/java/com/bufflife/bufflife/mapViewTest.java | 311beb2925121888917f0f008cfbe0e2df9114e7 | [] | no_license | jbirdman48/BuffLifeV3 | 1e55844d2cd905a4501fea750e1c251eadc8a17c | a369288e704f4c8b9b98be3a6bc6711d7c10ddb1 | refs/heads/master | 2021-05-31T11:37:45.070368 | 2015-12-11T21:38:26 | 2015-12-11T21:38:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,355 | java | package com.bufflife.bufflife;
/**
* @author Jesse Bird on 11/7/15.
*/
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.webkit.WebView;
import android.widget.Button;
public class mapViewTest extends ActivityUnitTestCase<mapView> {
private Intent mStartIntent;
private WebView mButton;
public mapViewTest() {
super(mapView.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
// In setUp, you can create any shared test data, or set up mock components to inject
// into your Activity. But do not call startActivity() until the actual test methods.
mStartIntent = new Intent(Intent.ACTION_MAIN);
}
/**
* The name 'test preconditions' is a convention to signal that if this
* test doesn't pass, the test case was not set up properly and it might
* explain any and all failures in other tests. This is not guaranteed
* to run before other tests, as junit uses reflection to find the tests.
*/
@MediumTest
public void testPreconditions() {
startActivity(mStartIntent, null, null);
mButton = (WebView) getActivity().findViewById(R.id.bustracker1);
//assertNotNull(getActivity());
//assertNotNull(mButton);
}
/**
* This test demonstrates examining the way that activity calls startActivity() to launch
* other activities.
*/
@MediumTest
public void testSubLaunch() {
mapView activity = startActivity(mStartIntent, null, null);
mButton = (WebView) activity.findViewById(R.id.mapview1);
// This test confirms that when you click the button, the activity attempts to open
// another activity (by calling startActivity) and close itself (by calling finish()).
mButton.performClick();
//assertNotNull(getStartedActivityIntent());
//assertTrue(isFinishCalled());
}
/**
* This test demonstrates ways to exercise the Activity's life cycle.
*/
@MediumTest
public void testLifeCycleCreate() {
mapView activity = startActivity(mStartIntent, null, null);
// At this point, onCreate() has been called, but nothing else
// Complete the startup of the activity
getInstrumentation().callActivityOnStart(activity);
getInstrumentation().callActivityOnResume(activity);
// At this point you could test for various configuration aspects, or you could
// use a Mock Context to confirm that your activity has made certain calls to the system
// and set itself up properly.
getInstrumentation().callActivityOnPause(activity);
// At this point you could confirm that the activity has paused properly, as if it is
// no longer the topmost activity on screen.
getInstrumentation().callActivityOnStop(activity);
// At this point, you could confirm that the activity has shut itself down appropriately,
// or you could use a Mock Context to confirm that your activity has released any system
// resources it should no longer be holding.
// ActivityUnitTestCase.tearDown(), which is always automatically called, will take care
// of calling onDestroy().
}
} | [
"mansfield8@yahoo.com"
] | mansfield8@yahoo.com |
51d8c58b6013063e04d55e3a32cff4677d356e5b | 733676ce14530e49c12f9bf1bb27060def9ffb72 | /src/main/java/BusinessLayer/BankAccountType.java | 57d71611ebf869a23d3223690805ec902e14eb6a | [] | no_license | dstokes1623/BankAccountManager | a6a9bf38986b69610b75242576d12454a874d781 | e574d32c8e29b8a32e30f9e2f7720f4e7f312370 | refs/heads/master | 2023-01-04T02:46:06.266689 | 2020-10-27T16:50:44 | 2020-10-27T16:50:44 | 307,768,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package BusinessLayer;
/**
*
* @author 0798727
*/
public enum BankAccountType {
Checking,
Saving,
Investment
}
| [
"0798727@KELCE-LABS09-P.pittstate.edu"
] | 0798727@KELCE-LABS09-P.pittstate.edu |
e05258671a7ef2da56ed8043d4af14739b71bdb5 | 8fa221482da055f4c8105b590617a27595826cc3 | /sources/com/google/android/gms/games/internal/api/zzcg.java | 7257538360fba8f27aae2c75fd6992ff53462184 | [] | no_license | TehVenomm/sauceCodeProject | 4ed2f12393e67508986aded101fa2db772bd5c6b | 0b4e49a98d14b99e7d144a20e4c9ead408694d78 | refs/heads/master | 2023-03-15T16:36:41.544529 | 2018-10-08T03:44:58 | 2018-10-08T03:44:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package com.google.android.gms.games.internal.api;
import android.os.RemoteException;
import com.google.android.gms.common.api.Api.zzb;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.internal.zzn;
import com.google.android.gms.games.internal.GamesClientImpl;
import com.google.android.gms.games.snapshot.SnapshotContents;
import com.google.android.gms.games.snapshot.SnapshotMetadataChange;
final class zzcg extends zzcn {
private /* synthetic */ SnapshotMetadataChange zzhhz;
private /* synthetic */ String zzhib;
private /* synthetic */ String zzhic;
private /* synthetic */ SnapshotContents zzhid;
zzcg(zzcb zzcb, GoogleApiClient googleApiClient, String str, String str2, SnapshotMetadataChange snapshotMetadataChange, SnapshotContents snapshotContents) {
this.zzhib = str;
this.zzhic = str2;
this.zzhhz = snapshotMetadataChange;
this.zzhid = snapshotContents;
super(googleApiClient);
}
protected final /* synthetic */ void zza(zzb zzb) throws RemoteException {
((GamesClientImpl) zzb).zza((zzn) this, this.zzhib, this.zzhic, this.zzhhz, this.zzhid);
}
}
| [
"gabrielbrazs@gmail.com"
] | gabrielbrazs@gmail.com |
50d1b50309453cb0699d6e80d60b6f121a4a325f | 3386dd7e7be492cfb06912215e5ef222bbc7ce34 | /autocomment_netbeans/spooned/org/jbpm/query/jpa/data/JaxbQuerySerializationTest.java | c06af43f0f7c49a9b82a6eb9e06885411eba0be5 | [
"Apache-2.0"
] | permissive | nerzid/autocomment | cc1d3af05045bf24d279e2f824199ac8ae51b5fd | 5803cf674f5cadfdc672d4957d46130a3cca6cd9 | refs/heads/master | 2021-03-24T09:17:16.799705 | 2016-09-28T14:32:21 | 2016-09-28T14:32:21 | 69,360,519 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,576 | java | /**
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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.jbpm.query.jpa.data;
import java.util.ArrayList;
import java.io.ByteArrayInputStream;
import java.util.HashSet;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import java.util.List;
import javax.xml.bind.Marshaller;
import java.util.Set;
import java.io.StringWriter;
import javax.xml.bind.Unmarshaller;
public class JaxbQuerySerializationTest extends AbstractQuerySerializationTest {
Set<Class> extraClasses = new HashSet<Class>();
@Override
public <T> T testRoundTrip(T input) throws Exception {
String xmlStr = convertJaxbObjectToString(input);
logger.debug(xmlStr);
return ((T) (convertStringToJaxbObject(xmlStr, input.getClass())));
}
public String convertJaxbObjectToString(Object object) throws JAXBException {
List<Class> classes = new ArrayList<Class>();
classes.add(object.getClass());
classes.addAll(extraClasses);
Marshaller marshaller = JAXBContext.newInstance(classes.toArray(new Class[classes.size()])).createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
StringWriter stringWriter = new StringWriter();
marshaller.marshal(object, stringWriter);
String output = stringWriter.toString();
return output;
}
public Object convertStringToJaxbObject(String xmlStr, Class clazz) throws JAXBException {
List<Class> classes = new ArrayList<Class>();
classes.add(clazz);
classes.addAll(extraClasses);
Unmarshaller unmarshaller = JAXBContext.newInstance(classes.toArray(new Class[classes.size()])).createUnmarshaller();
ByteArrayInputStream xmlStrInputStream = new ByteArrayInputStream(xmlStr.getBytes());
Object jaxbObj = unmarshaller.unmarshal(xmlStrInputStream);
return jaxbObj;
}
@Override
void addSerializableClass(Class objClass) {
JaxbQuerySerializationTest.this.extraClasses.add(objClass);
}
}
| [
"nerzid@gmail.com"
] | nerzid@gmail.com |
faaa1b43705296c84709864b5505914a169cfb75 | 2f250fe113b6fe2b1ce896ba9b5586b48c96d10e | /opfpush/src/main/java/org/onepf/opfpush/RetryBroadcastReceiver.java | a632ffa5ae91884470b5d5c0a1d1f495cc55a010 | [
"Apache-2.0"
] | permissive | GrimReio/OPFPush | 31fc256abac0920a56ae28957e05b03cc4394824 | 210a0f39aec24ddfdfe43a1617c69c0afff6e9db | refs/heads/master | 2021-01-17T20:52:06.111945 | 2014-10-24T21:53:15 | 2014-10-24T21:53:15 | 28,494,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,382 | java | /*
* Copyright 2012-2014 One Platform Foundation
*
* 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.onepf.opfpush;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* @author Kirill Rozov
* @since 01.10.14.
*/
public final class RetryBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final OPFPushHelper helper = OPFPushHelper.getInstance(context);
if (helper.isInitDone()) {
final String action = intent.getAction();
if (Constants.ACTION_REGISTER.equals(action)) {
helper.register(intent.getStringExtra(Constants.EXTRA_PROVIDER_NAME));
} else {
throw new OPFPushException("Unknown action '%s'.", action);
}
}
}
}
| [
"kirich1409@gmail.com"
] | kirich1409@gmail.com |
09deff5cdcbf5b2edc22237bea398fa212186ae9 | 0bbf9aeadb6fface74435fe1560f3d5811ab4eec | /src/Controller/AddNewStudentController.java | cbffbc4977e5459fc357d89c1ea5cec491162d38 | [] | no_license | Direct-Entry-Program-Dulanga/StudentMS | 7589f65114d68320842bb182425ce92f1262c830 | ca2068a30465ee5c02497a4f06e6b4f363b9b964 | refs/heads/master | 2023-05-10T19:33:18.706626 | 2021-06-01T11:16:33 | 2021-06-01T11:16:33 | 372,736,943 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 62 | java | package Controller;
public class AddNewStudentController {
}
| [
"idulanganimesha@gmail.com"
] | idulanganimesha@gmail.com |
2e4c24a7110aa6b3491d5110d0101c2af85b5899 | 4f8f44009520adb622b5e0cc110ff8aa52e30cf6 | /src/com/tom/dp22Mediator/Test.java | 77cc6539efa185cbf669d039d6fe3b8bbf8512a6 | [] | no_license | ZhuChuanchuan/DesignPattern | f7521db36a63eb8a96b2a45413c4715adf2e801a | 501429b2c92fad69abe8668efd6d04bbb33a892d | refs/heads/master | 2021-01-19T14:15:50.133916 | 2017-04-13T08:56:14 | 2017-04-13T08:56:14 | 88,139,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.tom.dp22Mediator;
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Mediator mediator=new MyMediator();
mediator.createMediator();
mediator.workAll();
}
}
| [
"zhuchuanchuan0904@gmail.com"
] | zhuchuanchuan0904@gmail.com |
cc9b081b6b7755fcd54c3291b24e32b3eaf0112e | 3e6b8cbac56c43947cce053286bed6be4cd17496 | /data/src/main/java/com/calabashCat/android/sample/data/executor/UIThread.java | fd73d1866eaadae03f13d8c3fc070341e72a4d99 | [
"Apache-2.0"
] | permissive | BitTigerInst/calabashCat | 74652f596be962a64a503e1a2a89fc71f38080a6 | 02bf7f0631e6c07d855468b8eaaa705026cbc9a1 | refs/heads/master | 2021-01-13T00:59:19.839011 | 2016-03-11T09:35:53 | 2016-03-11T09:35:53 | 51,179,144 | 5 | 3 | null | 2016-03-06T10:22:01 | 2016-02-05T22:51:46 | Java | UTF-8 | Java | false | false | 1,069 | java | /**
* Copyright (C) 2015 Fernando Cejas Open Source Project
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* 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.calabashCat.android.sample.data.executor;
import rx.Scheduler;
import rx.android.schedulers.AndroidSchedulers;
/**
* MainThread (UI Thread) implementation based on a {@link rx.Scheduler}
* which will execute actions on the Android UI thread
*/
public class UIThread implements PostExecutionThread {
public UIThread() {
}
@Override
public Scheduler getScheduler() {
return AndroidSchedulers.mainThread();
}
}
| [
"signnowmobile@gmail.com"
] | signnowmobile@gmail.com |
4e0dd38226bfa0037998aacaec909f1ed4efedba | a2faf74eb89a0cfbd713d4e2f94048967b0ab284 | /src/main/java/com/mitix/yiming/service/impl/DesignsServiceImpl.java | 5ada1507ff6abd019a566220b3ddcce0e1d124ff | [] | no_license | manzusaka/yiming | b9c172fd5289d2fe72e42e738ab90f076e762911 | e8a2d54fb55f2114b2ef05095d2415646b165045 | refs/heads/master | 2021-09-10T13:37:20.160037 | 2018-03-27T03:26:58 | 2018-03-27T03:26:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,369 | java | package com.mitix.yiming.service.impl;
import com.mitix.yiming.FileUtil;
import com.mitix.yiming.SIDUtil;
import com.mitix.yiming.bean.DesFiles;
import com.mitix.yiming.bean.Designs;
import com.mitix.yiming.mapper.YiMingMapper;
import com.mitix.yiming.service.DesignsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by oldflame on 2017/6/16.
*/
@Service
public class DesignsServiceImpl implements DesignsService {
@Autowired
private YiMingMapper yiMingMapper;
@Autowired
private FilePathComponent filePathComponent;
private static Map<String, String> dTypeMap = new HashMap<>();
private static Map<String, String> dlTypeMap = new HashMap<>();
{
dTypeMap.put("设计效果图", "1");
dTypeMap.put("空间效果图", "2");
dTypeMap.put("软装搭配设计", "3");
dTypeMap.put("客户回访照", "4");
dlTypeMap.put("1", "设计效果图");
dlTypeMap.put("2", "空间效果图");
dlTypeMap.put("3", "软装搭配设计");
dlTypeMap.put("4", "客户回访照");
}
@Override
@Transactional
public void saveDesigns(String liningcode, String designname, List<DesFiles> sjlist/*, List<DesFiles> xglist*/) {
String liningcodeTouse = liningcode.trim();
String designnameTouse = designname.trim();
int count = yiMingMapper.selectLiningsExists(liningcodeTouse);
if (count == 0) {
throw new RuntimeException("请正确填写布料信息");
}
Map<String, Object> map = new HashMap<>();
map.put("liningcode", liningcodeTouse);
map.put("designname", designnameTouse);
int count1 = yiMingMapper.selectDisignsExists(map);
if (count1 > 0) {
throw new RuntimeException("同一个面料下存在同款的设计");
}
String designcode = SIDUtil.getUUID16();
Designs designs = new Designs();
designs.setLiningcode(liningcodeTouse);
designs.setDesigncode(designcode);
designs.setDesignname(designnameTouse);
yiMingMapper.insertDesigns(designs);
if (sjlist != null && sjlist.size() > 0) {
for (DesFiles desFiles : sjlist) {
File sourceFile = new File(filePathComponent.getTempFolder(), desFiles.getUrlfix());
File destFile = new File(filePathComponent.getLogosFolder());
try {
FileUtil.move(sourceFile, destFile, true);
} catch (Exception e) {
throw new RuntimeException();
}
desFiles.setDesigncode(designcode);
desFiles.setType(dTypeMap.get(desFiles.getType()));
yiMingMapper.insertFiles(desFiles);
}
}
// if (xglist != null && xglist.size() > 0) {
// for (DesFiles desFiles : xglist) {
// File sourceFile = new File(filePathComponent.getTempFolder(), desFiles.getUrlfix());
// File destFile = new File(filePathComponent.getLogosFolder());
// try {
// FileUtil.move(sourceFile, destFile, true);
// } catch (Exception e) {
// throw new RuntimeException();
// }
// desFiles.setDesigncode(designcode);
// desFiles.setType("2");
// yiMingMapper.insertFiles(desFiles);
// }
// }
}
@Transactional
@Override
public void updateDesigns(Integer id, String liningcode, String designname, List<DesFiles> sjlistList) {
String liningcodeTouse = liningcode.trim();
String designnameTouse = designname.trim();
int count = yiMingMapper.selectLiningsExists(liningcodeTouse);
if (count == 0) {
throw new RuntimeException("请正确填写布料信息");
}
Map<String, Object> map = new HashMap<>();
map.put("id", id);
map.put("designname", designnameTouse);
yiMingMapper.updateDesignsById(map);
Designs designs = yiMingMapper.selectDesignsById(id);
List<DesFiles> inFilesList = yiMingMapper.listDesFilesByDesignCode(designs.getDesigncode());
List<DesFiles> insertDesFiles = new ArrayList<>();
List<DesFiles> updateDesFiles = new ArrayList<>();
List<DesFiles> deleteDesFiles = new ArrayList<>();
List<Integer> updateIdList = new ArrayList<>();
for (DesFiles desFiles : sjlistList) {
if (desFiles.getId() == null) {
insertDesFiles.add(desFiles);
} else {
updateDesFiles.add(desFiles);
updateIdList.add(desFiles.getId());
}
}
for (DesFiles desFiles : inFilesList) {
if (!updateIdList.contains(desFiles.getId())) {
deleteDesFiles.add(desFiles);
}
}
if (insertDesFiles != null && insertDesFiles.size() > 0) {
for (DesFiles insertDesFile : insertDesFiles) {
File sourceFile = new File(filePathComponent.getTempFolder(), insertDesFile.getUrlfix());
File destFile = new File(filePathComponent.getLogosFolder());
try {
FileUtil.move(sourceFile, destFile, true);
} catch (Exception e) {
throw new RuntimeException();
}
insertDesFile.setDesigncode(designs.getDesigncode());
insertDesFile.setType(dTypeMap.get(insertDesFile.getType()));
yiMingMapper.insertFiles(insertDesFile);
}
}
if (updateDesFiles != null && updateDesFiles.size() > 0) {
for (DesFiles updateDesFile : updateDesFiles) {
updateDesFile.setType(dTypeMap.get(updateDesFile.getType()));
yiMingMapper.updateDesFiles(updateDesFile);
}
}
if (deleteDesFiles != null && deleteDesFiles.size() > 0) {
for (DesFiles deleteDesFile : deleteDesFiles) {
yiMingMapper.deleteDesFiles(deleteDesFile);
}
}
}
@Override
public List<Designs> listLiningsDesigns(String lcode) {
String liningcodeToUse = lcode.trim();
Map<String, Object> param = new HashMap<>();
param.put("liningcode", liningcodeToUse);
List<Designs> designsList = yiMingMapper.listLiningsDesigns(param);
return designsList;
}
@Override
@Transactional
public void deleteLiningsDesigns(String designcode, String liningcode) {
String liningcodeTouse = liningcode.trim();
String designcodeTouse = designcode.trim();
List<DesFiles> desFilesList = yiMingMapper.selectFilesByDesigns(designcodeTouse);
//删除图片
if (desFilesList != null && desFilesList.size() > 0) {
for (DesFiles desFiles : desFilesList) {
Integer id = desFiles.getId();
yiMingMapper.deleteFiles(id);
}
}
//删除设计
yiMingMapper.deleteDesignsByDesigns(designcodeTouse);
if (desFilesList != null && desFilesList.size() > 0) {
for (DesFiles desFiles : desFilesList) {
try {
String filenamenew = desFiles.getUrlfix();
File filepath = new File(filePathComponent.getLogosFolder(), filenamenew);
filepath.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
@Override
public Designs selectById(Integer desid) {
return yiMingMapper.selectDesignsById(desid);
}
@Override
public List<DesFiles> listDesFilesByDesignCode(String designcode) {
List<DesFiles> desFiles = yiMingMapper.listDesFilesByDesignCode(designcode);
if (desFiles != null && desFiles.size() > 0) {
for (DesFiles desFile : desFiles) {
desFile.setType(dlTypeMap.get(desFile.getType()));
}
}
return desFiles;
}
}
| [
"hlh19850220@163.com"
] | hlh19850220@163.com |
3a7bd73b4d4385498f45edbbd1daab348cd87417 | cef75b4b7de59d4b76a386862fe6172712adc545 | /src/com/ymdq/thy/bean/personcenter/UpdateVersionResponse.java | 6181d310e35013f812fc46c63a328d3387e5bb83 | [] | no_license | tgf229/THYProperty | 9ccde1ad6518a037b3f1ef73de26941763064e29 | f7182d9e376dbe31bfa521b1f110fef2c8c84515 | refs/heads/master | 2021-01-10T21:54:44.561564 | 2015-12-28T12:07:44 | 2015-12-28T12:07:44 | 42,927,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,553 | java | /*
* 文 件 名: UpdateVersionResponse.java
* 版 权: Linkage Technology Co., Ltd. Copyright 2010-2011, All rights reserved
* 描 述: <描述>
* 版 本: <版本号>
* 创 建 人: user
* 创建时间: 2014-11-28
*/
package com.ymdq.thy.bean.personcenter;
import com.ymdq.thy.bean.BaseResponse;
/**
* <版本更新检查>
* <功能详细描述>
*
* @author WT
* @version [版本号, 2014-11-28]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class UpdateVersionResponse extends BaseResponse
{
/**
* 最新版本
*/
private String version;
/**
* 更新内容
*/
private String content;
/**
* 是否强制更新 0不强制 1强制
*/
private String isUpdate;
/**
* 下载地址
*/
private String urlAddress;
public String getVersion()
{
return version;
}
public void setVersion(String version)
{
this.version = version;
}
public String getContent()
{
return content;
}
public void setContent(String content)
{
this.content = content;
}
public String getIsUpdate()
{
return isUpdate;
}
public void setIsUpdate(String isUpdate)
{
this.isUpdate = isUpdate;
}
public String getUrlAddress()
{
return urlAddress;
}
public void setUrlAddress(String urlAddress)
{
this.urlAddress = urlAddress;
}
}
| [
"tugf@crossroad.love"
] | tugf@crossroad.love |
cc8cd94c7c3da652ae9aba60b1a4fe1a1406b17e | ba005c6729aed08554c70f284599360a5b3f1174 | /lib/selenium-server-standalone-3.4.0/org/apache/http/conn/OperatedClientConnection.java | ca717ff1b4d952d4d637216f46d7d56fe364266a | [] | no_license | Viral-patel703/Testyourbond-aut0 | f6727a6da3b1fbf69cc57aeb89e15635f09e249a | 784ab7a3df33d0efbd41f3adadeda22844965a56 | refs/heads/master | 2020-08-09T00:27:26.261661 | 2017-11-07T10:12:05 | 2017-11-07T10:12:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package org.apache.http.conn;
import java.io.IOException;
import java.net.Socket;
import org.apache.http.HttpClientConnection;
import org.apache.http.HttpHost;
import org.apache.http.HttpInetConnection;
import org.apache.http.params.HttpParams;
@Deprecated
public abstract interface OperatedClientConnection
extends HttpClientConnection, HttpInetConnection
{
public abstract HttpHost getTargetHost();
public abstract boolean isSecure();
public abstract Socket getSocket();
public abstract void opening(Socket paramSocket, HttpHost paramHttpHost)
throws IOException;
public abstract void openCompleted(boolean paramBoolean, HttpParams paramHttpParams)
throws IOException;
public abstract void update(Socket paramSocket, HttpHost paramHttpHost, boolean paramBoolean, HttpParams paramHttpParams)
throws IOException;
}
| [
"VIRUS-inside@users.noreply.github.com"
] | VIRUS-inside@users.noreply.github.com |
2c10843045fa66a5ca004a0f178da00a9bd0e72b | d4b9484c6f13edc179a1aa6814e061f170b84403 | /boot-web-admin/src/test/java/com/example/admin/AssertionsTest.java | f542724740e80443291fb1ca58c1045a807b42ef | [] | no_license | jiushigao/springboot-learn | 0f354cbf5867d3a37bf421a65861d587a38417ab | 5bb1eea8b27b2a8bb6b64d4376254861fae1a562 | refs/heads/master | 2023-03-24T07:35:20.300468 | 2021-03-22T12:44:30 | 2021-03-22T12:44:30 | 350,338,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,643 | java | package com.example.admin;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.*;
public class AssertionsTest {
@DisplayName("测试简单断言")
@Test
void testSimpleAssertion(){
int cal = cal(2, 3);
//相等
assertEquals(5,cal,"业务逻辑错误");
Object obj1 = new Object();
Object obj2 = new Object();
//判断两个引用是否指向同一对象
assertSame(obj1,obj2,"不是同一对象");
}
int cal(int a,int b){
return a+b;
}
@DisplayName("数组断言")
@Test
void array(){
assertArrayEquals(new int[]{1,2},new int[]{1,2});
}
@DisplayName("组合断言")
@Test
void all(){
/**
* 所有断言都需要成功
*/
assertAll("test",
()->assertTrue(true&&true),
()->assertEquals(1,1));
System.out.println("测试成功");
}
//需要抛出指定异常
@DisplayName("异常断言")
@Test
void testException(){
assertThrows(ArithmeticException.class,()->{int i = 10/1;},"没有发生数学计算异常");
}
@DisplayName("快速失败")
@Test
void testFail(){
if(1==1){
fail("测试失败");
}
}
@DisplayName("测试前置条件")
@Test
void testAssumptions(){
Assumptions.assumeTrue(false,"前置条件失败");
System.out.println("======");
}
}
| [
"2836428900@qq.com"
] | 2836428900@qq.com |
151b2c6b4fba0e01011f83224680021cc1f523e1 | b6492f34e185dc8e155d4dfb29303c363b1938aa | /yunGuo-service/src/main/java/com/yunguo/config/JacksonConfig.java | dd9b19da07dacdbdaa986511763bbbb9c770ec20 | [] | no_license | TiMiWang/yunguo | 434fae949ac995cee991ae4ae59fc8c90bebf6b8 | cce5810373756a92ae4b11828851b68816fb18be | refs/heads/master | 2020-04-09T09:00:00.688613 | 2018-12-03T16:15:24 | 2018-12-03T16:15:24 | 160,216,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,322 | java | package com.yunguo.config;
import java.io.IOException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
@Configuration
public class JacksonConfig {
@Bean
@Primary
@ConditionalOnMissingBean(ObjectMapper.class)
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
@Override
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
jsonGenerator.writeString("");
}
});
return objectMapper;
}
}
| [
"173459653@qq.com"
] | 173459653@qq.com |
5ee0a4ab1c100e468f1f267f372aac6d836bd730 | d9228cdbfd15ae1f82be4222e76ee5097311774f | /src/org/usfirst/frc/team2834/robot/commands/auto/DoLowBar.java | 6b9f3a27f783a6cabc95df0cd95d4534478f6d63 | [] | no_license | adamraine/frc2016 | 1b5b76abee25b0f8771e085f4f9a6348df9f404a | ac63134ea976db8c41868f3cb75b9ece62fd6fbd | refs/heads/master | 2021-06-08T16:42:34.186666 | 2016-08-19T16:04:50 | 2016-08-19T16:04:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package org.usfirst.frc.team2834.robot.commands.auto;
import edu.wpi.first.wpilibj.command.CommandGroup;
/**
*
*/
public class DoLowBar extends CommandGroup {
public DoLowBar() {
super("Do Low Bar");
addSequential(new TimedAngler(-0.5, 0.6));
addSequential(new TimedHaloDrive(0.5, 0.2, false, 1.5));
addSequential(new TimedHaloDrive(-0.1, 0.0, false, 0.1));
addSequential(new TimedAngler(0.5, 1));
}
}
| [
"theoperatorfiles@gmail.com"
] | theoperatorfiles@gmail.com |
0aa237efe323a3e5a60cb14826d67354849c6aa3 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-core/src/test/java/com/amazonaws/regions/InstanceMetadataRegionProviderTest.java | faa2eb1490bf129af62b2cc541155f86bc06821c | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 3,973 | java | /*
* Copyright 2011-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.regions;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import com.amazonaws.AmazonClientException;
import com.amazonaws.SDKGlobalConfiguration;
import com.amazonaws.util.EC2MetadataUtilsServer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
/**
* Tests broken up by fixture.
*/
@RunWith(Enclosed.class)
public class InstanceMetadataRegionProviderTest {
/**
* If the EC2 metadata service is running it should return the region the server is mocked
* with.
*/
public static class MetadataServiceRunningTest {
private static EC2MetadataUtilsServer server;
private AwsRegionProvider regionProvider;
@BeforeClass
public static void setupFixture() throws IOException {
server = new EC2MetadataUtilsServer("localhost", 0, true);
server.start();
System.setProperty(SDKGlobalConfiguration.EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY,
"http://localhost:" + server.getLocalPort());
}
@AfterClass
public static void tearDownFixture() throws IOException {
server.stop();
System.clearProperty(
SDKGlobalConfiguration.EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY);
}
@Before
public void setup() {
regionProvider = new InstanceMetadataRegionProvider();
}
@Test
public void metadataServiceRunning_ProvidesCorrectRegion() {
assertEquals("us-east-1", regionProvider.getRegion());
}
@Test
public void ec2MetadataDisabled_shouldReturnRegionAfterEnabled() {
try {
System.setProperty("com.amazonaws.sdk.disableEc2Metadata", "true");
regionProvider.getRegion();
fail("exception not thrown when EC2Metadata disabled");
} catch (AmazonClientException ex) {
//expected
} finally {
System.clearProperty("com.amazonaws.sdk.disableEc2Metadata");
}
assertNotNull("region should not be null", regionProvider.getRegion());
}
}
/**
* If the EC2 metdata service is not present then the provider should just return null instead
* of failing. This is to allow the provider to be used in a chain context where another
* provider further down the chain may be able to provide the region.
*/
public static class MetadataServiceNotRunning {
private AwsRegionProvider regionProvider;
@Before
public void setup() {
System.setProperty(SDKGlobalConfiguration.EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY,
"http://localhost:54123");
regionProvider = new InstanceMetadataRegionProvider();
}
@Test
public void metadataServiceRunning_ProvidesCorrectRegion() {
assertNull(regionProvider.getRegion());
}
}
} | [
""
] | |
48fbd14e07d4d89360520f0c4ffd5650cf6d2be4 | 4e65035c3a7c8043ff446177f4874955fbae9565 | /src/com/jpm/supersimplestock/service/ServiceSimpleStockImpl.java | 306c2ab9994f6dbc459c0022d0241fc1a932232a | [] | no_license | adelmogentilini/superSimpleStock | a95f2c0c4b7c489ee36546e8b0ee76ac2d7b180c | 44a413143eae11f07626074851c86c2a0158679c | refs/heads/master | 2020-07-07T06:36:18.177133 | 2016-08-21T10:12:48 | 2016-08-21T10:12:48 | 66,188,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,238 | java | package com.jpm.supersimplestock.service;
import com.jpm.supersimplestock.PersistenceMarket;
import com.jpm.supersimplestock.shared.BigFunctions;
import com.jpm.supersimplestock.shared.Constants;
import com.jpm.supersimplestock.stock.SimpleStock;
import com.jpm.supersimplestock.trade.Trade;
import java.math.BigDecimal;
import java.util.Date;
/**
* This class is the 'default implementation for interface' for respond to requirements of
* example project.
* <p>
* Created by adelmo on 20/08/2016.
*/
public class ServiceSimpleStockImpl implements ServiceSimpleStock {
/**
* Calculate dividend yeld for the stock wth symbol at price indicated.
*
* @param symbol
* @param price
*/
@Override
public BigDecimal dividendYeldFor(String symbol, double price) {
return dividendYeldFor(symbol, new BigDecimal(price, Constants.MC));
}
@Override
public BigDecimal dividendYeldFor(String symbol, BigDecimal price) {
SimpleStock stock = PersistenceMarket.getInstance().getStock(symbol);
return stock.dividendYeld(price);
}
/**
* Calculate pe ratio for the stock with symbol at price indicated.
*
* @param symbol
* @param price
*/
@Override
public BigDecimal peRatioFor(String symbol, BigDecimal price) {
SimpleStock stock = PersistenceMarket.getInstance().getStock(symbol);
return stock.peRatio(price);
}
/**
* Record a buy of a quantity of qty for Stock identify by simple at price.
*
* @param symbol
* @param qty
* @param price
*/
@Override
public void tradeBuy(String symbol, BigDecimal qty, BigDecimal price) {
SimpleStock stock = PersistenceMarket.getInstance().getStock(symbol);
Trade td = stock.buy(qty, price);
PersistenceMarket.getInstance().addTrade(td);
}
/**
* Record a sell of a quantity of qty for Stock identify by simple at price.
*
* @param symbol
* @param qty
* @param price
*/
@Override
public void tradeSell(String symbol, BigDecimal qty, BigDecimal price) {
SimpleStock stock = PersistenceMarket.getInstance().getStock(symbol);
Trade td = stock.sell(qty, price);
PersistenceMarket.getInstance().addTrade(td);
}
/**
* For default consider only the trade in the last CONSTANTS.DEF_FOR_STOCK minutes
* (15 is default like requirements).
*
* @param symbol
* @return
*/
@Override
public BigDecimal stockPrice(String symbol) {
return stockPrice(symbol, Constants.DEF_FOR_STOCK);
}
@Override
public BigDecimal stockPrice(String symbol, long minutes) {
Date limit = new Date();
limit.setTime(limit.getTime() - Constants.MILLIS_FOR_MINUTE * minutes); // tot minutes before
BigDecimal sumtq, sumq;
sumtq = new BigDecimal(0, Constants.MC);
sumq = new BigDecimal(0, Constants.MC);
for (Trade trade : PersistenceMarket.getInstance().getTradeFrom(symbol, limit)) {
sumtq = sumtq.add(trade.getPrice().multiply(trade.getQuantity(), Constants.MC), Constants.MC);
sumq = sumq.add(trade.getQuantity(), Constants.MC);
}
if (sumq.compareTo(BigDecimal.ZERO) == 0){
// Not possible divide by zero
return BigDecimal.ZERO;
}else{
return sumtq.divide(sumq, Constants.MC);
}
}
/**
* Use a precision of SCALE decimal for exponential function.
* SCALE is definde in constants.
*
* @return
*/
@Override
public BigDecimal gbce() {
BigDecimal geometric = new BigDecimal(1, Constants.MC), total = new BigDecimal(0);
for(SimpleStock stk: PersistenceMarket.getInstance().getAllStock()){
geometric = geometric.multiply(stockPrice(stk.getSymbol()), Constants.MC);
total = total.add(BigDecimal.ONE);
}
BigDecimal exponent = BigDecimal.ONE.divide(total, Constants.MC);
// z = x^y --> z = exp ( ln(x) * y )
BigDecimal gbce = BigFunctions.exp( BigFunctions.ln(geometric, Constants.SCALE).multiply(exponent), Constants.SCALE );
return gbce;
}
}
| [
"adelmo.gentilini@gmail.com"
] | adelmo.gentilini@gmail.com |
5c5e6fbbb53a7fb48bacab1893aa00a45728673c | 72d13850e4ff2fb0b1740153615820018a6676eb | /src/main/java/pl/edu/wat/backend/services/UserDetailsServiceImpl.java | 2d17d03edb4126211e0e8ca321cbd0a8b57dd9a1 | [] | no_license | mateuszjwat/web-backend | c62e4ffb223b90155ec44078c11ddc526d3db66b | 5601c205c1d89b5ca3567bad9976cca083e08207 | refs/heads/master | 2023-06-09T08:12:57.487184 | 2021-06-24T19:02:03 | 2021-06-24T19:02:03 | 372,816,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,012 | java | package pl.edu.wat.backend.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pl.edu.wat.backend.entities.UserImpl;
import pl.edu.wat.backend.repositories.UserRepository;
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired
UserRepository userRepository;
@Override
@Transactional
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
UserImpl userImpl = userRepository.findUserByUsername(username)
.orElseThrow(() -> new UsernameNotFoundException("UserImpl Not Found with username: " + username));
return userImpl;
}
}
| [
"mateusz.jarzebski01@student.wat.edu.pl"
] | mateusz.jarzebski01@student.wat.edu.pl |
6f2f584f47568e0091ad4762bef5cbf08b36dfe9 | dfa1b897529378f5bfc046a0c6d7eb798aec3149 | /test/ekraft/javabrake/JavaBrakeTest.java | 54df2248c08f6fd2540f8fe6ff59f33ef3359c9a | [
"MIT"
] | permissive | Gigafrosty/JavaBrake | 234948addadacc64f85d20d1bd417eba4a7496ad | 7faabb50a2beee07f000f3c7aed1c78f3d03810e | refs/heads/master | 2020-04-23T12:52:55.655676 | 2015-08-30T08:26:44 | 2015-08-30T08:26:44 | 41,612,382 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,310 | java | package ekraft.javabrake;
import ekraft.javabrake.db.Disc;
import ekraft.javabrake.db.Title;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;
/**
* Created by ekraft on 8/30/15
*/
public class JavaBrakeTest {
@Test
public void testSwordArtOnline2Volume1Disc1() {
Disc disc = JavaBrake.convertToDisc("Sword Art Online 2 Volume 1 Disc 1", "+ title 1:\n" +
" + Main Feature\n" +
" + vts 1, ttn 1, cells 0->17 (2014372 blocks)\n" +
" + duration: 01:11:07\n" +
" + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps\n" +
" + autocrop: 0/0/0/0\n" +
" + support opencl: no\n" +
" + support hwd: not built-in\n" +
" + chapters:\n" +
" + 1: cells 0->0, 100610 blocks, duration 00:03:22\n" +
" + 2: cells 1->1, 145020 blocks, duration 00:05:06\n" +
" + 3: cells 2->2, 379884 blocks, duration 00:13:36\n" +
" + 4: cells 3->3, 45528 blocks, duration 00:01:30\n" +
" + 5: cells 4->4, 3152 blocks, duration 00:00:07\n" +
" + 6: cells 5->5, 52560 blocks, duration 00:01:53\n" +
" + 7: cells 6->6, 44297 blocks, duration 00:01:30\n" +
" + 8: cells 7->7, 255265 blocks, duration 00:09:07\n" +
" + 9: cells 8->8, 270449 blocks, duration 00:09:34\n" +
" + 10: cells 9->9, 46850 blocks, duration 00:01:30\n" +
" + 11: cells 10->10, 3122 blocks, duration 00:00:07\n" +
" + 12: cells 11->11, 12291 blocks, duration 00:00:27\n" +
" + 13: cells 12->12, 44428 blocks, duration 00:01:30\n" +
" + 14: cells 13->13, 332539 blocks, duration 00:12:01\n" +
" + 15: cells 14->14, 225660 blocks, duration 00:08:06\n" +
" + 16: cells 15->15, 46858 blocks, duration 00:01:30\n" +
" + 17: cells 16->17, 5859 blocks, duration 00:00:13\n" +
" + audio tracks:\n" +
" + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 384000bps\n" +
" + 2, Japanese (AC3) (2.0 ch) (iso639-2: jpn), 48000Hz, 384000bps\n" +
" + subtitle tracks:\n" +
" + 1, English (iso639-2: eng) (Bitmap)(VOBSUB)\n" +
" + 2, English (iso639-2: eng) (Bitmap)(VOBSUB)\n" +
" + 3, Espanol (iso639-2: spa) (Bitmap)(VOBSUB)\n" +
"+ title 2:\n" +
" + vts 2, ttn 1, cells 0->0 (43585 blocks)\n" +
" + duration: 00:01:32\n" +
" + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps\n" +
" + autocrop: 0/0/0/0\n" +
" + support opencl: no\n" +
" + support hwd: not built-in\n" +
" + chapters:\n" +
" + 1: cells 0->0, 43585 blocks, duration 00:01:32\n" +
" + audio tracks:\n" +
" + 1, Japanese (AC3) (2.0 ch) (iso639-2: jpn), 48000Hz, 384000bps\n" +
" + subtitle tracks:\n" +
"\n");
assertEquals("Sword Art Online 2 Volume 1 Disc 1", disc.getName());
assertTrue(disc.isDvd());
assertEquals(2, disc.getTitles().size());
Title title1 = disc.getTitles().get(0);
assertEquals(1, title1.getIndex());
assertEquals(1, title1.getAngles());
assertTrue(title1.isMainFeature());
assertEquals(4267, title1.getDuration());
assertEquals(Arrays.asList(202, 306, 816, 90, 7, 113, 90, 547, 574, 90, 7, 27, 90, 721, 486, 90, 13),
title1.getChapters());
assertEquals(Arrays.asList("English", "English", "Espanol"), title1.getSubtitleTracks());
assertEquals(2, title1.getAudioTracks().size());
assertEquals(1, title1.getAudioTracks().get(0).getIndex());
assertEquals("English", title1.getAudioTracks().get(0).getLanguage());
assertEquals(2.0, title1.getAudioTracks().get(0).getChannels());
assertEquals(2, title1.getAudioTracks().get(1).getIndex());
assertEquals("Japanese", title1.getAudioTracks().get(1).getLanguage());
assertEquals(2.0, title1.getAudioTracks().get(1).getChannels());
Title title2 = disc.getTitles().get(1);
assertEquals(2, title2.getIndex());
assertEquals(1, title2.getAngles());
assertFalse(title2.isMainFeature());
assertEquals(92, title2.getDuration());
assertEquals(Collections.singletonList(92), title2.getChapters());
assertEquals(new ArrayList<>(), title2.getSubtitleTracks());
assertEquals(1, title2.getAudioTracks().size());
assertEquals(1, title2.getAudioTracks().get(0).getIndex());
assertEquals("Japanese", title2.getAudioTracks().get(0).getLanguage());
assertEquals(2.0, title2.getAudioTracks().get(0).getChannels());
}
@Test
public void test20MillionMilesToEarthDisc1() {
Disc disc = JavaBrake.convertToDisc("20 Million Miles to Earth (Disc 1)", "+ title 2:\n" +
" + vts 2, ttn 1, cells 0->32 (3321668 blocks)\n" +
" + angle(s) 2\n" +
" + duration: 01:22:27\n" +
" + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 29.970 fps\n" +
" + autocrop: 6/10/0/0\n" +
" + support opencl: no\n" +
" + support hwd: not built-in\n" +
" + chapters:\n" +
" + 1: cells 0->1, 171664 blocks, duration 00:03:38\n" +
" + 2: cells 2->3, 271740 blocks, duration 00:05:47\n" +
" + 3: cells 4->5, 327567 blocks, duration 00:08:17\n" +
" + 4: cells 6->7, 163747 blocks, duration 00:04:22\n" +
" + 5: cells 8->9, 186870 blocks, duration 00:04:57\n" +
" + 6: cells 10->11, 178400 blocks, duration 00:04:50\n" +
" + 7: cells 12->13, 204418 blocks, duration 00:05:31\n" +
" + 8: cells 14->15, 297170 blocks, duration 00:07:49\n" +
" + 9: cells 16->17, 171401 blocks, duration 00:04:50\n" +
" + 10: cells 18->19, 317947 blocks, duration 00:06:51\n" +
" + 11: cells 20->21, 244054 blocks, duration 00:06:56\n" +
" + 12: cells 22->23, 169773 blocks, duration 00:04:10\n" +
" + 13: cells 24->25, 152584 blocks, duration 00:03:34\n" +
" + 14: cells 26->27, 117534 blocks, duration 00:02:51\n" +
" + 15: cells 28->29, 176722 blocks, duration 00:04:13\n" +
" + 16: cells 30->31, 169323 blocks, duration 00:03:50\n" +
" + 17: cells 32->32, 754 blocks, duration 00:00:02\n" +
" + audio tracks:\n" +
" + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 192000bps\n" +
" + 2, English (AC3) (Director's Commentary 1) (2.0 ch) (iso639-2: eng), 48000Hz, 192000bps\n" +
" + subtitle tracks:\n" +
" + 1, English (iso639-2: eng) (Bitmap)(VOBSUB)\n" +
" + 2, Francais (iso639-2: fra) (Bitmap)(VOBSUB)\n" +
" + 3, Closed Captions (iso639-2: eng) (Text)(CC)\n" +
"+ title 5:\n" +
" + vts 4, ttn 1, cells 0->0 (4391 blocks)\n" +
" + duration: 00:00:14\n" +
" + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 29.970 fps\n" +
" + autocrop: 0/2/0/10\n" +
" + support opencl: no\n" +
" + support hwd: not built-in\n" +
" + chapters:\n" +
" + 1: cells 0->0, 4204 blocks, duration 00:00:14\n" +
" + 2: cells 0->0, 187 blocks, duration 00:00:01\n" +
" + audio tracks:\n" +
" + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 448000bps\n" +
" + subtitle tracks:\n" +
"+ title 10:\n" +
" + vts 8, ttn 1, cells 0->1 (5513 blocks)\n" +
" + duration: 00:00:17\n" +
" + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 29.970 fps\n" +
" + autocrop: 66/72/0/0\n" +
" + support opencl: no\n" +
" + support hwd: not built-in\n" +
" + chapters:\n" +
" + 1: cells 0->0, 5326 blocks, duration 00:00:17\n" +
" + 2: cells 1->1, 187 blocks, duration 00:00:01\n" +
" + audio tracks:\n" +
" + 1, Unknown (AC3) (2.0 ch) (iso639-2: und), 48000Hz, 192000bps\n" +
" + subtitle tracks:\n");
assertEquals("20 Million Miles to Earth (Disc 1)", disc.getName());
assertTrue(disc.isDvd());
assertEquals(3, disc.getTitles().size());
Title title1 = disc.getTitles().get(0);
assertEquals(2, title1.getIndex());
assertEquals(2, title1.getAngles());
assertFalse(title1.isMainFeature());
assertEquals(4947, title1.getDuration());
assertEquals(Arrays.asList(218, 347, 497, 262, 297, 290, 331, 469, 290, 411, 416, 250, 214, 171, 253, 230, 2),
title1.getChapters());
assertEquals(Arrays.asList("English", "Francais", "Closed Captions"), title1.getSubtitleTracks());
assertEquals(2, title1.getAudioTracks().size());
assertEquals(1, title1.getAudioTracks().get(0).getIndex());
assertEquals("English", title1.getAudioTracks().get(0).getLanguage());
assertEquals(2.0, title1.getAudioTracks().get(0).getChannels());
assertEquals(2, title1.getAudioTracks().get(1).getIndex());
assertEquals("English", title1.getAudioTracks().get(1).getLanguage());
assertEquals(2.0, title1.getAudioTracks().get(1).getChannels());
Title title2 = disc.getTitles().get(1);
assertEquals(5, title2.getIndex());
assertEquals(1, title2.getAngles());
assertFalse(title2.isMainFeature());
assertEquals(14, title2.getDuration());
assertEquals(Arrays.asList(14, 1),
title2.getChapters());
assertEquals(new ArrayList<String>(), title2.getSubtitleTracks());
assertEquals(1, title2.getAudioTracks().size());
assertEquals(1, title2.getAudioTracks().get(0).getIndex());
assertEquals("Unknown", title2.getAudioTracks().get(0).getLanguage());
assertEquals(5.1, title2.getAudioTracks().get(0).getChannels());
Title title3 = disc.getTitles().get(2);
assertEquals(10, title3.getIndex());
assertEquals(1, title3.getAngles());
assertFalse(title3.isMainFeature());
assertEquals(17, title3.getDuration());
assertEquals(Arrays.asList(17, 1), title3.getChapters());
assertEquals(new ArrayList<String>(), title3.getSubtitleTracks());
assertEquals(1, title3.getAudioTracks().size());
assertEquals(1, title3.getAudioTracks().get(0).getIndex());
assertEquals("Unknown", title3.getAudioTracks().get(0).getLanguage());
assertEquals(2.0, title3.getAudioTracks().get(0).getChannels());
}
} | [
"gigafrost@gmail.com"
] | gigafrost@gmail.com |
db14c7ef6c6209cc10dd00bbb0680ca774960b1b | 84609ef7eeae1ff118260255b3513f93cee530f7 | /app/src/main/java/ucai/cn/fulicter/adapter/CollectsAdapter.java | 947649b2352da1c2f06902450e4f9a8dbffb966a | [] | no_license | huaxiaojii/Fulicenter | 450540838babf90cb55bf7ec202f9d8abc380012 | 0899aaa09399be74089dc342961bcc5d985863ff | refs/heads/master | 2021-01-11T00:00:51.298857 | 2016-10-31T01:13:59 | 2016-10-31T01:13:59 | 70,772,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,426 | java | package ucai.cn.fulicter.adapter;
/**
* Created by User on 2016/10/26.
*/
import android.content.Context;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.ucai.fulicenter.R;
import ucai.cn.fulicter.FuLiCenterApplication;
import ucai.cn.fulicter.I;
import ucai.cn.fulicter.bean.CollectBean;
import ucai.cn.fulicter.bean.MessageBean;
import ucai.cn.fulicter.net.NetDao;
import ucai.cn.fulicter.net.OkHttpUtils;
import ucai.cn.fulicter.utils.CommonUtils;
import ucai.cn.fulicter.utils.ImageLoader;
import ucai.cn.fulicter.utils.L;
import ucai.cn.fulicter.utils.MFGT;
import ucai.cn.fulicter.view.FooterViewHolder;
public class CollectsAdapter extends Adapter {
Context mContext;
List<CollectBean> mList;
boolean isMore;
int soryBy = I.SORT_BY_ADDTIME_DESC;
public CollectsAdapter(Context context, List<CollectBean> list) {
mContext = context;
mList = new ArrayList<>();
mList.addAll(list);
}
public void setSoryBy(int soryBy) {
this.soryBy = soryBy;
notifyDataSetChanged();
}
public boolean isMore() {
return isMore;
}
public void setMore(boolean more) {
isMore = more;
notifyDataSetChanged();
}
public void remove(CollectBean bean) {
mList.remove(bean);
notifyDataSetChanged();
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewHolder holder = null;
if (viewType == I.TYPE_FOOTER) {
holder = new FooterViewHolder(View.inflate(mContext, R.layout.item_footer, null));
} else {
holder = new ColelctsViewHolder(View.inflate(mContext, R.layout.item_collects, null));
}
return holder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
if(getItemViewType(position)==I.TYPE_FOOTER){
FooterViewHolder vh = (FooterViewHolder) holder;
vh.mtvFooter.setText(String.valueOf(getFootString()));
}else{
ColelctsViewHolder vh = (ColelctsViewHolder) holder;
CollectBean goods = mList.get(position);
ImageLoader.downloadImg(mContext,vh.mIvGoodsThumb,goods.getGoodsThumb());
vh.mTvGoodsName.setText(goods.getGoodsName());
vh.mLayoutGoods.setTag(goods.getGoodsId());
vh.mLayoutGoods.setTag(goods);
}
}
private int getFootString() {
return isMore?R.string.load_more:R.string.no_more;
}
@Override
public int getItemCount() {
return mList != null ? mList.size() + 1 : 1;
}
@Override
public int getItemViewType(int position) {
if (position == getItemCount() - 1) {
return I.TYPE_FOOTER;
}
return I.TYPE_ITEM;
}
public void initData(ArrayList<CollectBean> list) {
if(mList!=null){
mList.clear();
}
mList.addAll(list);
notifyDataSetChanged();
}
public void addData(ArrayList<CollectBean> list) {
mList.addAll(list);
notifyDataSetChanged();
}
class ColelctsViewHolder extends ViewHolder{
@BindView(R.id.ivGoodsThumb)
ImageView mIvGoodsThumb;
@BindView(R.id.tvGoodsName)
TextView mTvGoodsName;
@BindView(R.id.iv_collect_del)
ImageView mIvCollectDel;
@BindView(R.id.layout_goods)
RelativeLayout mLayoutGoods;
ColelctsViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
}
@OnClick(R.id.layout_goods)
public void onGoodsItemClick(){
// int goodsId = (int) mLayoutGoods.getTag();
// MFGT.gotoGoodsDetailsActivity(mContext,goodsId);
CollectBean goods = (CollectBean) mLayoutGoods.getTag();
MFGT.gotoGoodsDetailsActivity(mContext,goods.getGoodsId());
}
@OnClick(R.id.iv_collect_del)
public void deleteCollect(){
final CollectBean goods = (CollectBean) mLayoutGoods.getTag();
String username = FuLiCenterApplication.getUser().getMuserName();
NetDao.deleteCollect(mContext, username, goods.getGoodsId(), new OkHttpUtils.OnCompleteListener<MessageBean>() {
@Override
public void onSuccess(MessageBean result) {
if(result!=null && result.isSuccess()){
mList.remove(goods);
notifyDataSetChanged();
}else{
CommonUtils.showLongToast(result!=null?result.getMsg():
mContext.getResources().getString(R.string.delete_collect_fail));
}
}
@Override
public void onError(String error) {
L.e("error="+error);
CommonUtils.showLongToast(mContext.getResources().getString(R.string.delete_collect_fail));
}
});
}
}
} | [
"726471847@qq.com"
] | 726471847@qq.com |
752bfaee0829eae54af5448d64af36d35df4396b | e1c6ef7778727932ea9ab7979ca1e0993b655327 | /plugins/caex30/caex.caex30.edit/src-gen/caex/caex30/caex/provider/NominalScaledItemProvider.java | 1884db241df19e1029a15c533b25668427c1d57a | [] | no_license | kit-sdq/AutomationML-CAEX-Metamodel | b8c262b14a39623b2560df99569310de3a9b86f2 | c2a10acb1f0fc594be1de3ad62b7d1569d16c9b6 | refs/heads/master | 2021-04-15T13:31:21.809712 | 2019-11-27T08:40:08 | 2019-11-27T08:40:08 | 126,177,811 | 1 | 1 | null | 2019-02-03T21:08:55 | 2018-03-21T12:49:54 | Java | UTF-8 | Java | false | false | 4,487 | java | /**
*/
package caex.caex30.caex.provider;
import caex.caex30.caex.CAEXPackage;
import caex.caex30.caex.NominalScaled;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link caex.caex30.caex.NominalScaled} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class NominalScaledItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NominalScaledItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addRequiredValuePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Required Value feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRequiredValuePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_NominalScaled_requiredValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_NominalScaled_requiredValue_feature", "_UI_NominalScaled_type"),
CAEXPackage.Literals.NOMINAL_SCALED__REQUIRED_VALUE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns NominalScaled.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/NominalScaled"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
return getString("_UI_NominalScaled_type");
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(NominalScaled.class)) {
case CAEXPackage.NOMINAL_SCALED__REQUIRED_VALUE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return CAEX30EditPlugin.INSTANCE;
}
}
| [
"mayerhofer@big.tuwien.ac.at"
] | mayerhofer@big.tuwien.ac.at |
e3906dea960ae60e2a800b0b5aaa149d370ecd4f | 4f80fd8c1b9c608584f3473690f8fa4c245421e4 | /10Applications/src/pkg10applications/Prime.java | 40db7d55f7c192a4d32777946306595df629045f | [] | no_license | BedirT/JavaStudy | 3989600f47e545529af80b566c66cea30d77e019 | 030409db0525fedf7af8d70c15a229202f5fa393 | refs/heads/master | 2016-09-01T07:26:26.465695 | 2016-05-01T22:47:10 | 2016-05-01T22:47:10 | 50,141,495 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg10applications;
import java.util.Scanner;
/**
*
* @author BedirTapkan
*/
public class Prime {
public static void main(String[] args) {
//Write a program in Java to find out if a number is prime in Java?
//(input 7: output true , input 9 : output false)
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
boolean a = false;
System.out.println(n);
for(int i = 2 ; i < n ; i++){
if(n%i==0){
a = true;
}
}
if(a){System.out.println("True");}
else{System.out.println("False");}
}
}
| [
"bedir.tapkan.53@gmail.com"
] | bedir.tapkan.53@gmail.com |
91f4660f185483aec2aafa2c6c6361021c728bd9 | bc12106d1c0a727cac074bcdfd85f1ed08846519 | /src/main/java/com/example/mbenben/studydemo/anim/swipbackhelper/view/SwipeBackPage.java | ee72e8d6ec2eb563dc0a6b323c2a3c612fa55f3a | [] | no_license | zhiaixinyang/PersonalCollect | 35810b03683725f437006da3613089aa94a436bf | 5f70cfa12275b2c492af66454b6c039a861f3f10 | refs/heads/master | 2021-01-11T20:00:14.080510 | 2018-12-15T09:10:12 | 2018-12-15T09:10:12 | 79,442,513 | 59 | 11 | null | null | null | null | UTF-8 | Java | false | false | 3,605 | java | package com.example.mbenben.studydemo.anim.swipbackhelper.view;
import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.ViewGroup;
/**
* Created by Mr.Jude on 2015/8/3.
* 每个滑动页面的管理
*/
public class SwipeBackPage {
//仅为判断是否需要将mSwipeBackLayout注入进去
private boolean mEnable = true;
private boolean mRelativeEnable = false;
Activity mActivity;
SwipeBackLayout mSwipeBackLayout;
RelateSlider slider;
SwipeBackPage(Activity activity){
this.mActivity = activity;
}
//页面的回调用于配置滑动效果
void onCreate(){
mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
mActivity.getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
mSwipeBackLayout = new SwipeBackLayout(mActivity);
mSwipeBackLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
slider = new RelateSlider(this);
}
void onPostCreate(){
handleLayout();
}
@TargetApi(11)
public SwipeBackPage setSwipeRelateEnable(boolean enable){
mRelativeEnable = enable;
slider.setEnable(enable);
return this;
}
public SwipeBackPage setSwipeRelateOffset(int offset){
slider.setOffset(offset);
return this;
}
//是否可滑动关闭
public SwipeBackPage setSwipeBackEnable(boolean enable) {
mEnable = enable;
mSwipeBackLayout.setEnableGesture(enable);
handleLayout();
return this;
}
private void handleLayout(){
if (mEnable||mRelativeEnable){
mSwipeBackLayout.attachToActivity(mActivity);
}else {
mSwipeBackLayout.removeFromActivity(mActivity);
}
}
//可滑动的范围。百分比。200表示为左边200px的屏幕
public SwipeBackPage setSwipeEdge(int swipeEdge){
mSwipeBackLayout.setEdgeSize(swipeEdge);
return this;
}
//可滑动的范围。百分比。0.2表示为左边20%的屏幕
public SwipeBackPage setSwipeEdgePercent(float swipeEdgePercent){
mSwipeBackLayout.setEdgeSizePercent(swipeEdgePercent);
return this;
}
//对横向滑动手势的敏感程度。0为迟钝 1为敏感
public SwipeBackPage setSwipeSensitivity(float sensitivity){
mSwipeBackLayout.setSensitivity(mActivity, sensitivity);
return this;
}
//底层阴影颜色
public SwipeBackPage setScrimColor(int color){
mSwipeBackLayout.setScrimColor(color);
return this;
}
//触发关闭Activity百分比
public SwipeBackPage setClosePercent(float percent){
mSwipeBackLayout.setScrollThreshold(percent);
return this;
}
public SwipeBackPage setDisallowInterceptTouchEvent(boolean disallowIntercept){
mSwipeBackLayout.setDisallowInterceptTouchEvent(disallowIntercept);
return this;
}
public SwipeBackPage addListener(SwipeListener listener){
mSwipeBackLayout.addSwipeListener(listener);
return this;
}
public SwipeBackPage removeListener(SwipeListener listener){
mSwipeBackLayout.removeSwipeListener(listener);
return this;
}
public SwipeBackLayout getSwipeBackLayout() {
return mSwipeBackLayout;
}
public void scrollToFinishActivity() {
mSwipeBackLayout.scrollToFinishActivity();
}
}
| [
"1024624013@qq.com"
] | 1024624013@qq.com |
21388132fa394d594ab7e7e7851b4c840d08f733 | 2e51d94f48da1472a7f0cc9dc411c10822c5f856 | /src/test/java/com/mycompany/myapp/selenium/LoginPageObject.java | b9bcc6312c22fa9d30a70b372b98b23c9d2b1d06 | [] | no_license | BulkSecurityGeneratorProject/fauxshop-angular1 | baf2632b6c204e1ce5746fae7219470eaa92cf4f | 14f9b3012374356263f0eb0cda57a876ab22e003 | refs/heads/master | 2022-12-16T17:27:18.292166 | 2018-03-27T03:26:07 | 2018-03-27T03:26:07 | 296,549,286 | 0 | 0 | null | 2020-09-18T07:39:23 | 2020-09-18T07:39:22 | null | UTF-8 | Java | false | false | 717 | java | package com.mycompany.myapp.selenium;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class LoginPageObject {
private WebDriver driver;
private static WebElement element = null;
private static By loginTitle = By.id("loginTitle");
public LoginPageObject(WebDriver driver) {
this.driver = driver;
}
public WebElement loginTitle(WebDriver driver){
element = driver.findElement(loginTitle);
return element;
}
public boolean verifyLoginTitle() {
String loginTitleText = "Sign in";
return loginTitle(driver).getText().contains(loginTitleText);
}
}
| [
"derekzuk@gmail.com"
] | derekzuk@gmail.com |
3410b933bcf350e7747891e1a6f67e00e5eff90a | 1467876aa95046f802cc29a1a523dd8699f91bb0 | /src/main/java/com/wfh/controller/MainController.java | 91e6bca5968f73dcd72530e038dda4f5f0187ba4 | [] | no_license | My-Heaven/Chamilo | b42155b1e103c64269e5300b0c2ed5d1dc418324 | 2509aa8862c0438a3294f2fc8c2d9a7f76200ab0 | refs/heads/master | 2023-06-27T05:30:11.353423 | 2021-07-27T06:42:18 | 2021-07-27T06:42:18 | 388,067,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,255 | java | package com.wfh.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.wfh.dao.UserDAO;
import com.wfh.dao.UserInfoDAO;
import com.wfh.model.User;
import com.wfh.model.UserInfo;
@Controller
public class MainController {
@Autowired
private UserDAO UserDAO;
@Autowired
private UserInfoDAO UserInfoDAO;
@RequestMapping("/")
public String loadApp() {
return "index";
}
@RequestMapping("/AdminPage")
public String adminPage() {
return "AdminPage";
}
@RequestMapping("/StudentPage")
public String studentPage() {
return "StudentPage";
}
@RequestMapping("/TeacherPage")
public String teacherPage() {
return "TeacherPage";
}
@RequestMapping("/CreateUserPage")
public String createUserPage() {
return "CreateUserPage";
}
@RequestMapping("/UpdatePage")
public String updateUserPage(HttpServletRequest request) {
int id= Integer.parseInt(request.getParameter("ids"));
UserInfo user = UserInfoDAO.findUserById(id);
request.setAttribute("u", user);
return "UpdatePage";
}
@RequestMapping("/login")
public String login(HttpServletRequest request) {
HttpSession session = request.getSession();
String username = request.getParameter("username");
String password = request.getParameter("password");
if (null!=username & !username.isEmpty() & null!=password & !password.isEmpty()) {
User u = UserDAO.findUser(username, password);
if (u != null) {
if (u.getRole_id() == 1) {
UserInfo user = UserInfoDAO.findUserById(u.getId());
session.setAttribute("user", user);
return "AdminPage";
} else if (u.getRole_id() == 2) {
return "TeacherPage";
} else if (u.getRole_id() == 3) {
return "StudentPage";
}
}
}
return "index";
}
@RequestMapping("/logout")
public String logout(HttpServletRequest request) {
HttpSession session = request.getSession();
session.invalidate();
return "index";
}
@RequestMapping("/list-user")
public String listUser(HttpServletRequest request) {
List<UserInfo> listUser = UserInfoDAO.getListUser();
request.setAttribute("LISTUSER", listUser);
return "FindPage";
}
@RequestMapping("/create-user")
public String createNewUser(HttpServletRequest request) {
String username =request.getParameter("username");
String password =request.getParameter("password");
String lastname =request.getParameter("lastname");
String firstname =request.getParameter("firstname");
String email =request.getParameter("email");
String role_id =request.getParameter("role_id");
String phone = request.getParameter("phone");
String code = request.getParameter("code");
UserInfoDAO.createUser(code, username, password, email, lastname, firstname, phone, role_id);
return "AdminPage";
}
@RequestMapping("/search-by-id")
public String searchById(HttpServletRequest request) {
String searchValue = request.getParameter("searchValue");
List<UserInfo> listUser = UserInfoDAO.searchUserById(searchValue);
request.setAttribute("LISTUSER", listUser);
return "FindPage";
}
@RequestMapping("/update-user")
public String updateUser(HttpServletRequest request) {
String username =request.getParameter("username");
String password =request.getParameter("password");
String lastname =request.getParameter("lastname");
String firstname =request.getParameter("firstname");
String email =request.getParameter("email");
String role_id =request.getParameter("role_id");
String id = request.getParameter("id");
UserInfoDAO.updateUserById(username, password, email, lastname, firstname, role_id, id);
//--------
List<UserInfo> listUser = UserInfoDAO.getListUser();
request.setAttribute("LISTUSER", listUser);
return "FindPage";
}
@RequestMapping("/delete-user")
public String deleteUser(HttpServletRequest request) {
int id = Integer.parseInt(request.getParameter("ids"));
UserInfoDAO.deleteUser(id);
//-------
List<UserInfo> listUser = UserInfoDAO.getListUser();
request.setAttribute("LISTUSER", listUser);
return "FindPage";
}
}
| [
"tdse2k@gmail.com"
] | tdse2k@gmail.com |
cfbfff173e041d6a99ee5ac72fbd7c545f7f469b | cdab7a5f358b8a15439827fb001cb838a6d30f56 | /src/com/sonic/juc/Lock8Demo05.java | 10e101384bc20a22010d2a72a2b60e0b7bf0acb9 | [] | no_license | SonicXia/lianxi | bd82d6b84a191345ea36c58d9e9b7dcaf429f9bd | 35b125f1aebfb95b9dac667dfb2d1753b4d3b1f0 | refs/heads/master | 2020-12-03T21:02:16.949155 | 2020-02-25T01:22:34 | 2020-02-25T01:22:34 | 231,486,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,242 | java | package com.sonic.juc;
import java.util.concurrent.TimeUnit;
class Phone {
public static synchronized void sendEmail() throws InterruptedException {
TimeUnit.SECONDS.sleep(3);
System.out.println("*****sendEmail");
}
public static synchronized void sendSMS() {
System.out.println("*****sendSMS");
}
public void sayHello() {
System.out.println("*****sayHello");
}
}
/**
* 8 lock
*
*1 标准访问,请问先打印邮件还是短信?[对象锁](*****sendEmail*****sendSMS)
*2 暂停4秒在邮件方法中,请问先打印邮件还是短信?[对象锁](抱着资源睡,*****sendEmail*****sendSMS)
*3 新增普通 sayHello方法,请问先打印邮件还是短信?[对象锁](普通方法不加锁,各执行各的,互不影响)
*4 两部手机,请问先打印邮件还是短信?[对象锁](两个不同实例对象,各执行各的,互不影响)
*5 两个静态同步方法,同一部手机,请问先打印邮件还是短信?[类锁](*****sendEmail*****sendSMS)
*6 两个静态同步方法,2部手机请问先打印邮件还是短信?[类锁](*****sendEmail*****sendSMS)
*7 1个静态同步方法,1个普通同步方法,同一部手机请问先打印邮件还是短信?(锁的对象不同[类锁、对象锁]。各执行各的,互不影响)
*8 1个静态同步方法,1个普通同步方法,2部手机请问先打印邮件还是短信?(锁的对象不同[类锁、对象锁]。各执行各的,互不影响)
*
* 笔记:
* (1~2)一个对象里面如果有多个 synchronized方法,某个时刻内,只要一个线程去调用其中的一个 synchronized方法了,
* 其他的线程都只能等待,换句话说,某一时刻内,只能有唯一一个线程去访问这些 synchronized方法。
* 锁的是当前对象 this,被锁定后,其他的线程都不能进入到当前对象的其他的 synchronized方法。
* (synchronized方法只影响所在对象中的其他 synchronized方法)
* (3)加个普通方法后发现和同步锁无关。
* (4)换成两个对象后,不是同一把(对象)锁了,情况立刻变化。
* (1~4)synchronized实现同步的基础:Java中的每一个对象都可以作为锁。
* 具体表现为以下三种形式:
* 1、对于普通同步方法,锁的是当前实例对象(this);
* 2、对于同步方法块,锁的是 Synchronized括号里配置的对象;
* (5~6)3、对于静态同步方法,锁的是当前类的 Class对象。
*
* 当一个线程试图访问同步代码块时,它首先必须得到锁,退出或抛出异常时必须释放锁。
*
* 也就是说,如果一个实例对象的非静态同步方法获取锁后,该实例对象的其他非静态同步方法必须等待获取锁
* 的方法释放锁后才能获取锁,可是别的实例对象的非静态同步方法因为跟该实例对象的非静态同步方法用的是不同的锁,
* 所以无须等待该实例对象释放锁就可以获取它们自己的锁。
*
* 所有的静态同步方法用的也是用一把锁 --> 类对象本身(Class)
* (7~8)这两把锁是两个不同的对象,所以静态同步方法与非静态同步方法之间是不会有竞态条件的。
* 但是一旦一个静态同步方法获取锁后,其他的静态同步方法都必须等待该方法释放锁后才能获取锁(锁的都是Class对象),
* 不论是否是同一个实例对象的静态同步方法之间(phone1),
* 还是不同的实例对象的静态同步方法之间(phone1与phone2),只要它们是同一个类(Class)的实例对象。
*
* this:当前对象锁
* Class:全局锁(类锁)
*
* @author Sonic
*/
public class Lock8Demo05 {
public static void main(String[] args) throws Exception {
Phone phone = new Phone();
Phone phone2 = new Phone();
new Thread(() -> {
try {
phone.sendEmail();
} catch (Exception e) {
e.printStackTrace();
}
}, "A").start();
TimeUnit.MILLISECONDS.sleep(100);
new Thread(() -> {
try {
// phone.sendSMS();
// phone.sayHello();
phone2.sendSMS();
} catch (Exception e) {
e.printStackTrace();
}
}, "B").start();
}
}
| [
"sonicdxf@gmail.com"
] | sonicdxf@gmail.com |
59ee95d1639c9c75f098aa972417ece982a4d6c6 | c14fb0f9b029829c56beec12c96e579835c6502b | /app/src/main/java/com/example/xiaolitongxue/wieying/view/fragment/MyFragment.java | 41ad1f1f22ac262b483a2a78c2df48dc8c2ff662 | [] | no_license | WeiYingApp/WeiYingApp | 4ce836e0b2c37c5754551cc4a9436b86fd73e781 | 0801a6cf878720cbcec327dbeead49890a8af5cd | refs/heads/master | 2020-03-17T16:54:36.242489 | 2018-05-22T08:20:00 | 2018-05-22T08:20:00 | 133,767,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 973 | java | package com.example.xiaolitongxue.wieying.view.fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.xiaolitongxue.wieying.R;
import com.example.xiaolitongxue.wieying.presenter.MyPresenter;
/**
* Created by xiaolitongxue on 2018/5/16.
* 我的
*/
public class MyFragment extends BaseFragment<MyPresenter>{
@Override
View initView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) {
View view = inflater.inflate(R.layout.fragment_my_layout,container,false);
return view;
}
@Override
void initData(@Nullable Bundle savedInstanceState) {
}
@Override
void findViewByIdView(View view) {
}
@Override
MyPresenter newPresenter() {
return new MyPresenter();
}
}
| [
"https://github.com/liyanan039164/text.git"
] | https://github.com/liyanan039164/text.git |
2723089b8e3d44e0d3079b847826473f2575c873 | a7a28039a642232a849922882419ed26f161be06 | /app/src/main/java/com/app/thinkfit/ui/auth/sign_up/survey_strengthen/SurveyStrengthenActivity.java | 3e14e9804ef41ae9b9eaf47f1ea117aa7148fe92 | [] | no_license | cmFodWx5YWRhdjEyMTA5/ThinkFit-Android-2018 | 0ce257ee52f026e0cea30a4ec47700dcbf35c5de | cf8fc92915d807d0ea59fccd3073be299367364e | refs/heads/master | 2020-03-30T07:21:47.095137 | 2018-06-12T16:21:17 | 2018-06-12T16:21:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,988 | java | package com.app.thinkfit.ui.auth.sign_up.survey_strengthen;
/*
* Copyright Ⓒ 2018. All rights reserved
* Author DangTin. Create on 2018/05/20
*/
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.app.thinkfit.R;
import com.app.thinkfit.constant.Constant;
import com.app.thinkfit.constant.GlobalFuntion;
import com.app.thinkfit.ui.base.BaseMVPDialogActivity;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class SurveyStrengthenActivity extends BaseMVPDialogActivity implements SurveyStrengthenMVPView {
@Inject
SurveyStrengthenPresenter presenter;
@BindView(R.id.tv_question_survey_strengthen)
TextView tvQuestionSurveyStrengthen;
@BindView(R.id.rdg_strengthen)
RadioGroup rdgStrengthen;
@BindView(R.id.rdb1)
RadioButton rdb1;
@BindView(R.id.rdb2)
RadioButton rdb2;
@BindView(R.id.rdb3)
RadioButton rdb3;
@BindView(R.id.img_back)
ImageView imgBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActivityComponent().inject(this);
viewUnbind = ButterKnife.bind(this);
presenter.initialView(this);
imgBack.setVisibility(View.VISIBLE);
loadData();
onClickSelectMode();
}
@Override
protected boolean bindView() {
return true;
}
@Override
protected int addContextView() {
return R.layout.activity_survey_strengthen;
}
@Override
protected void onDestroy() {
presenter.destroyView();
super.onDestroy();
}
@Override
public void showNoNetworkAlert() {
showAlert(getString(R.string.error_not_connect_to_internet));
}
@Override
public void onErrorCallApi(int code) {
GlobalFuntion.showMessageError(this, code);
}
private void loadData() {
Spannable question_1 = new SpannableString(getString(R.string.question_survey_strengthen_1));
tvQuestionSurveyStrengthen.setText(question_1);
tvQuestionSurveyStrengthen.append(" ");
Spannable question_2 = new SpannableString(getString(R.string.strengthen_));
ClickableSpan clickStrengthen = new ClickableSpan() {
@Override
public void onClick(View textView) {
GlobalFuntion.showDialogDescription(
SurveyStrengthenActivity.this,
"Hi, thank you. I set its gravity to top, the dialog goes on the");
}
@Override
public void updateDrawState(TextPaint textPaint) {
textPaint.setColor(getResources().getColor(R.color.orange));
}
};
question_2.setSpan(clickStrengthen, 0, question_2.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tvQuestionSurveyStrengthen.append(question_2);
tvQuestionSurveyStrengthen.append(" ");
Spannable question_3 = new SpannableString(getString(R.string.question_survey_strengthen_2));
tvQuestionSurveyStrengthen.append(question_3);
tvQuestionSurveyStrengthen.setMovementMethod(LinkMovementMethod.getInstance());
}
private void onClickSelectMode() {
rdgStrengthen.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.rdb1:
rdb1.setTextColor(getResources().getColor(R.color.orange));
rdb2.setTextColor(getResources().getColor(R.color.black));
rdb3.setTextColor(getResources().getColor(R.color.black));
break;
case R.id.rdb2:
rdb2.setTextColor(getResources().getColor(R.color.orange));
rdb1.setTextColor(getResources().getColor(R.color.black));
rdb3.setTextColor(getResources().getColor(R.color.black));
break;
case R.id.rdb3:
rdb3.setTextColor(getResources().getColor(R.color.orange));
rdb1.setTextColor(getResources().getColor(R.color.black));
rdb2.setTextColor(getResources().getColor(R.color.black));
break;
}
}
});
}
@OnClick(R.id.tv_continue)
public void onClickContinue() {
int checkedRadioButtonId = rdgStrengthen.getCheckedRadioButtonId();
switch (checkedRadioButtonId) {
case R.id.rdb1:
GlobalFuntion.goToDetailSelected(SurveyStrengthenActivity.this,
getString(R.string.title_strengthen_1), getString(R.string.message_strengthen_1),
Constant.SURVEY_STRENGTHEN_ACTIVITY);
break;
case R.id.rdb2:
GlobalFuntion.goToDetailSelected(SurveyStrengthenActivity.this,
getString(R.string.title_strengthen_2), getString(R.string.message_strengthen_2),
Constant.SURVEY_STRENGTHEN_ACTIVITY);
break;
case R.id.rdb3:
GlobalFuntion.goToDetailSelected(SurveyStrengthenActivity.this,
getString(R.string.title_strengthen_3), getString(R.string.message_strengthen_3),
Constant.SURVEY_STRENGTHEN_ACTIVITY);
break;
}
}
@OnClick(R.id.img_back)
public void onClickBack() {
onBackPressed();
}
}
| [
"dangtin29932@gmail.com"
] | dangtin29932@gmail.com |
b2b38000e65ff103e46806ccf0a33082c0a79385 | acdddd8fd8b8cb78c33bec70b480436a7dbb11d9 | /src/com/itap/jira/agile/Board.java | 406a4f479f39451e549b25db1f7cceaa8b962183 | [] | no_license | ynrani/iTAP | d72f77a2db9f5e96ad015a7095cf1c647282fff7 | c5d4e369de7add21e443950c5b57721128669405 | refs/heads/master | 2021-01-02T14:29:45.970058 | 2020-02-09T03:57:08 | 2020-02-09T03:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,748 | java | /**
* jira-client - a simple JIRA REST client
* Copyright (c) 2013 Bob Carroll (bob.carroll@alum.rit.edu)
* <p>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p>
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* <p>
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.itap.jira.agile;
import com.itap.jira.Field;
import com.itap.jira.JiraException;
import com.itap.jira.RestClient;
import net.sf.json.JSONObject;
import java.util.List;
/**
* Represents an Agile Board.
*
* @author pldupont
*/
public class Board extends AgileResource {
private String type;
/**
* Creates a Board from a JSON payload.
*
* @param restclient REST client instance
* @param json JSON payload
*/
protected Board(RestClient restclient, JSONObject json) throws JiraException {
super(restclient, json);
}
/**
* Retrieves the given rapid view.
*
* @param restclient REST client instance
* @param id Internal JIRA ID of the rapid view
* @return a rapid view instance
* @throws JiraException when the retrieval fails
*/
public static Board get(RestClient restclient, long id) throws JiraException {
return AgileResource.get(restclient, Board.class, RESOURCE_URI + "board/" + id);
}
/**
* Retrieves all boards visible to the session user.
*
* @param restclient REST client instance
* @return a list of boards
* @throws JiraException when the retrieval fails
*/
public static List<Board> getAll(RestClient restclient) throws JiraException {
return AgileResource.list(restclient, Board.class, RESOURCE_URI + "board");
}
@Override
protected void deserialize(JSONObject json) throws JiraException {
super.deserialize(json);
type = Field.getString(json.get("type"));
}
/**
* @return The board type.
*/
public String getType() {
return this.type;
}
/**
* @return All sprints related to the current board.
* @throws JiraException when the retrieval fails
*/
public List<Sprint> getSprints() throws JiraException {
return Sprint.getAll(getRestclient(), getId());
}
/**
* @return All issues in the Board backlog.
* @throws JiraException when the retrieval fails
*/
public List<Issue> getBacklog() throws JiraException {
return AgileResource.list(getRestclient(), Issue.class, RESOURCE_URI + "board/" + getId() + "/backlog", "issues");
}
/**
* @return All issues without epic in the Board .
* @throws JiraException when the retrieval fails
*/
public List<Issue> getIssuesWithoutEpic() throws JiraException {
return AgileResource.list(getRestclient(), Issue.class, RESOURCE_URI + "board/" + getId() + "/epic/none/issue", "issues");
}
/**
* @return All epics associated to the Board.
* @throws JiraException when the retrieval fails
*/
public List<Epic> getEpics() throws JiraException {
return AgileResource.list(getRestclient(), Epic.class, RESOURCE_URI + "board/" + getId() + "/epic");
}
}
| [
"bnrani@yahoo.com"
] | bnrani@yahoo.com |
f9639d5ba9aca3fbfa10e7d1962d2e7eeb957fde | 641fc9df7f344bf661f9c931d45761506e57eb37 | /gmall-admin-web/src/main/java/com/itcast/gmall/admin/oms/controller/OrderReturnApplyController.java | b25a8b4ad9b9b224cb241ec235e216fbbc0ed5e3 | [
"MIT"
] | permissive | Pursuexy/gmall-parent01 | 3a10f4a16e260026f0aa4930cb1f3f3e0583d73c | 5e27544620410f0b3880f7d53579a5a20f727c3b | refs/heads/master | 2023-03-31T00:03:06.914941 | 2021-04-04T16:49:15 | 2021-04-04T16:49:15 | 354,592,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.itcast.gmall.admin.oms.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 订单退货申请 前端控制器
* </p>
*
* @author Pursuexy
* @since 2021-02-26
*/
@RestController
@RequestMapping("/oms/order-return-apply")
public class OrderReturnApplyController {
}
| [
"1365409209@qq.com"
] | 1365409209@qq.com |
080c18b79a209d8f1eda6efab23b6b1fe5506e79 | af0d940b8a09d02e9aaa25498a3e4227e766cd15 | /src/main/java/com/library/domain/response/LoginResponse.java | 5b08af1ba98437e77211d892cfb03277ccdaad0b | [] | no_license | Franky238/book-app | f4cd62e5a9382a7b67b6513718af0d6432873d69 | b473dfe965504ebb7fdb9ecafdaaf9813b6a7ac0 | refs/heads/master | 2021-01-11T17:12:18.544084 | 2017-01-21T19:47:38 | 2017-01-21T19:47:38 | 79,738,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package com.library.domain.response;
public class LoginResponse {
private String token;
public LoginResponse (String token) {
this.token = token;
}
public String getToken() {
return token;
}
}
| [
"frank238238@gmail.com"
] | frank238238@gmail.com |
b8215ef85bfd93cd07f2ba01d97c880d15377494 | 7e6d0095a7c2589eb07c887ae8efb454881e782c | /src/main/java/model/Admin.java | 28cfe40d632a93db1739ef3469cbc3afc03a28af | [] | no_license | Whatder/xuexue_web | 82a3f43ae663353edd438d9ebad2d5f3576095c9 | a0de4941846606d879f9ade65fa7708a5d63f9fc | refs/heads/master | 2021-04-15T14:41:32.074690 | 2018-04-08T07:21:34 | 2018-04-08T07:21:34 | 126,697,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | package model;
public class Admin {
int id;
String account;
String password;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"523035216@qq.com"
] | 523035216@qq.com |
e7c5ee88d0b6791b10786a8bbfa74f9d10298222 | b2565b85745fdaf0aaafbadf1a6766b1209b508f | /ruoyi-system/src/main/java/com/ruoyi/system/service/ISlGroupsService.java | cd8a91fb2b4e433818e231789f1b22ae98dde9c5 | [
"MIT"
] | permissive | Qihao97/ruoyi | 942ce5f64d5069f06d85858ec14d139944fd42ce | ae8239aa0f45db1cd08857600c16f20dd39c4587 | refs/heads/master | 2022-09-14T12:27:58.475573 | 2019-11-10T01:49:33 | 2019-11-10T01:50:51 | 220,728,065 | 0 | 1 | MIT | 2022-09-01T23:15:42 | 2019-11-10T01:52:33 | CSS | UTF-8 | Java | false | false | 965 | java | package com.ruoyi.system.service;
import com.ruoyi.system.domain.senselink.SlDevice;
import com.ruoyi.system.domain.senselink.SlGroups;
import java.util.List;
/**
* 人员组业务层
*
* @author ruoyi
*/
public interface ISlGroupsService
{
/**
* 通过人员组ID查询人员组
*
* @param id 人员组D
* @return 人员组对象信息
*/
public SlGroups selectGroupsById(Long id);
/**
* 通过人员组ID删除人员组
*
* @param id 角色ID
* @return 结果
*/
public boolean deleteGroupsById(Long id);
/**
* 保存或更新人员组信息
*
* @param slGroups 人员组信息
* @return 结果
*/
public int saveOrUpdateGroups(SlGroups slGroups);
/**
* 批量保存或更新人员组信息
*
* @param groupsList 人员组信息列表
* @return 结果
*/
public int batchSaveOrUpdateGroups(List groupsList);
}
| [
"qihao_97@126.com"
] | qihao_97@126.com |
fe20256aa068ee8bc6686aa44445cc66eee34865 | 238acd37aed3a8575ef08ee5e41dc4cacc406a9e | /src/com/github/koys/adventura/logika/PrikazKufor.java | 96e88c9ba5cb4b4b874f0815c114a7bfaf986b23 | [] | no_license | samkoys/hotovaVerze | d8ce705daff67bf8c4b2eea50fb65b1d9d988668 | 9ce94b724300cfcc42f68b7f52ca037c63e11e89 | refs/heads/master | 2020-03-08T00:36:12.996093 | 2018-04-09T21:14:05 | 2018-04-09T21:14:05 | 127,809,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,895 | java | /* Soubor je ulozen v kodovani UTF-8.
* Kontrola kódování: Příliš žluťoučký kůň úpěl ďábelské ódy. */
package com.github.koys.adventura.logika;
/*******************************************************************************
* Pomocí příkazu kufor se nám vypíše seznam věcí uložených v kufru.
*
* @author jméno autora
* @version 0.00.000
*/
public class PrikazKufor implements IPrikaz
{
//== Datové atributy (statické i instancí)======================================
private static final String NAME = "kufor";
private HerniPlan herniPlan;
//== Konstruktory a tovární metody =============================================
/***************************************************************************
* Konstruktor třídy PrikazKufor
*
* @param herniPlan herní plán, ve kterém se bude ve hře "chodit"
*/
public PrikazKufor(HerniPlan herniPlan) {
this.herniPlan = herniPlan;
}
//== Nesoukromé metody (instancí i třídy) ======================================
/**
* Provádí příkaz "inventory". Vypíše všechny věci, které jsou v kufru.
*
* @return zpráva, kterou vypíše hra hráči
*/
@Override
public String proved(String... parametry) {
if (herniPlan.getKufor().getVeci().isEmpty()) {
// pokud je kufor prázdný
return "Kufor je prazdny";
}
else {
// pokud je v kufru jedna a více věcí.
return "Seznam veci v kufru:" + herniPlan.getKufor().getVeci() + ".";
}
}
/**
* Metoda vrací název příkazu
*
* @ return název příkazu
*/
@Override
public String getNazev() {
return NAME;
}
//== Soukromé metody (instancí i třídy) ========================================
} | [
"koys00@vse.cz"
] | koys00@vse.cz |
615e3b2ca12e9fce8a91d07f68a8ba7f066aef2e | 553ee734ba4d0959294debb16b02a217bd1e634a | /BaseProcessor/src/main/java/net/sunxu/mybatis/automapper/processor/mapper/mapper/HandlerForDecorator.java | 67332e8aa88215c612ad5ccb3d79210fe3d9179c | [
"MIT"
] | permissive | sunxuia/MyBatisAutoMapper | f235b265729d295fa391dfa95d7c2ae5eef8edd6 | 3e7475ffe57710bcd3532905ade9069c14f2ebb4 | refs/heads/master | 2021-07-01T05:45:12.109248 | 2019-11-02T12:53:57 | 2019-11-02T12:53:57 | 219,153,441 | 0 | 0 | MIT | 2021-04-22T18:43:37 | 2019-11-02T12:52:33 | Java | UTF-8 | Java | false | false | 267 | java | package net.sunxu.mybatis.automapper.processor.mapper.mapper;
import net.sunxu.mybatis.automapper.processor.mapper.MapperElementsCreator;
interface HandlerForDecorator {
MapperElementsCreator decorate(MapperElementsCreator provider, MapperModel mapperModel);
}
| [
"ntsunxu@163.com"
] | ntsunxu@163.com |
e3796591f0821c7475b82e1ad21f7df331030ee8 | e09e3c31934628241b73baf7cce31fd06e274907 | /plugin/src/main/java/io/dazraf/vertx/maven/compiler/Compiler.java | d9720de1fc99286f4d74eeeea2e03ef26fc808cb | [
"MIT"
] | permissive | illuminace/vertx-hot | cd298e653b9bd295e05679fb04d569853da78d43 | c62cbaef57fc434ede0ccaea472c45410d69c463 | refs/heads/master | 2021-01-21T04:08:46.171190 | 2015-12-03T18:42:33 | 2015-12-03T18:42:33 | 44,908,596 | 0 | 0 | null | 2015-10-25T12:12:23 | 2015-10-25T12:12:23 | null | UTF-8 | Java | false | false | 3,433 | java | package io.dazraf.vertx.maven.compiler;
import org.apache.maven.model.Resource;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.invoker.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* This class represents the primary interaction with the Maven runtime to build the project
*/
public class Compiler {
private static final Logger logger = LoggerFactory.getLogger(Compiler.class);
private static final Pattern ERROR_PATTERN = Pattern.compile("\\[ERROR\\] [^:]+:\\[\\d+,\\d+\\].*");
private static final Pattern DEPENDENCY_RESOLUTION_PATTERN = Pattern.compile("^\\[INFO\\].*:compile:(.*)$");
private static final List<String> GOALS = Collections.singletonList("dependency:resolve compile");
private final Properties compilerProperties = new Properties();
public Compiler() {
compilerProperties.setProperty("outputAbsoluteArtifactFilename", "true");
}
/**
* Compile the maven project, returning the list of classpath paths as reported by maven
*
* @param project This is the top level maven project that was provided by the maven run time when the plugin was invoked
* @return the result of compilation containing the classpaths etc
* @throws CompilerException for any compiler errors
* @throws MavenInvocationException for any unexpected maven invocation errors
*/
public CompileResult compile(MavenProject project) throws CompilerException, MavenInvocationException {
List<String> classPath = new ArrayList<>();
// precendence to load from the resources folders rather than the build
project.getResources().stream().map(Resource::getDirectory).forEach(classPath::add);
classPath.add(project.getBuild().getOutputDirectory());
Set<String> messages = new HashSet<>();
InvocationRequest request = setupInvocationRequest(project, classPath, messages);
return execute(request, messages, classPath);
}
private CompileResult execute(InvocationRequest request, Set<String> messages, List<String> classPath) throws CompilerException, MavenInvocationException {
try {
InvocationResult result = new DefaultInvoker().execute(request);
if (result.getExitCode() != 0) {
logger.error("Error with exit code {}", result.getExitCode());
throw new CompilerException(result.getExitCode(), messages);
}
return new CompileResult(classPath);
} catch (MavenInvocationException e) {
logger.error("Maven invocation exception:", e);
throw e;
}
}
private InvocationRequest setupInvocationRequest(MavenProject project, List<String> classPath, Set<String> messages) {
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(project.getFile());
request.setOutputHandler(msg -> collectResults(msg, messages, classPath));
request.setGoals(GOALS);
request.setProperties(compilerProperties);
return request;
}
private void collectResults(String msg, Set<String> messages, List<String> classPath) {
Matcher matcher = DEPENDENCY_RESOLUTION_PATTERN.matcher(msg);
if (matcher.matches()) {
String dependency = matcher.group(1);
classPath.add(dependency);
}
if (ERROR_PATTERN.matcher(msg).matches()) {
System.out.println(msg);
messages.add(msg);
}
}
}
| [
"farzad.pezeshkpour@gmail.com"
] | farzad.pezeshkpour@gmail.com |
d8ab1a3ab92749f1854d4c68272bca48c3238512 | 4180e942d47e4ebad1784dcc5b4407aaedf10b26 | /app/src/androidTest/java/com/lambertsoft/app03/ApplicationTest.java | c2a998404e12cc3d245999490922b616fa8d1470 | [] | no_license | PabloLambert/App03 | 61d4a438f3a8138518a9b1f346d25384a334c1be | 49ccfdf2cb922986113f5cb7e5eab8e3b20530df | refs/heads/master | 2020-04-18T21:09:47.964525 | 2014-12-13T16:32:35 | 2014-12-13T16:32:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.lambertsoft.app03;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"InnovaTI@MacBook-Pro-de-Innovacion.local"
] | InnovaTI@MacBook-Pro-de-Innovacion.local |
950112fb01da82a20ada96e6eda2d620cff0c94f | 05aff24eac0a8545e6489f88a6c671edb2ee5b6d | /CoderByteAlgorithms/CodelandUsernameValidation.java | e812c697db230e7061489d60264bf2a5efb8d9c8 | [] | no_license | SoneSaile/Bootcamp-InterJavaDeveloper | c79df5cbb5835e36bc723a69eb119f28c144abd9 | 5e4ec81e81ac6a94c8b18f269165aba3df227c74 | refs/heads/master | 2023-03-14T14:39:19.739362 | 2021-03-07T18:02:16 | 2021-03-07T18:02:16 | 342,070,528 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,038 | java | package CoderByteAlgorithms;
import java.util.Scanner;
import java.util.*;
import java.io.*;
class CodelandUsernameValidation {
public static String CodeLandUsernameValidation(String str) {
String validation = "false";
if ((str.length() >= 4) && (str.length() <= 25)) {
if (Character.isLetter(str.charAt(0))) {
if (!str.endsWith("_")) {
for (int n = 0; n < str.length(); n++) {
if (Character.isDigit((str.charAt(n))) || Character.isLetter((str.charAt(n))) || str.charAt(n) == '_') {
validation = "true";
} else {
validation = "false";
break;
}
}
}
}
}
return validation;
}
public static void main(String[] args) {
//Scanner s = Scanner(System.in);
System.out.print(CodeLandUsernameValidation("usernamehello123"));
}
}
| [
"enoselias28@gmail.com"
] | enoselias28@gmail.com |
e93570b815cbbcaa737e38f5a98eac06ad7ce0c4 | fbd00cdf4c68ee7f7ccebf71b761de4692a17d89 | /LeetCode/44.wildcard-matching.java | 4ec02514ca234216adf2dac4640d4d3cd0f9f5bd | [] | no_license | Andiedie/Algorithm | 3211f8cf27da91f12a3d282a139a963d3e9be891 | a3742e7782cdbecb52d57d41054355d0c05ff9b9 | refs/heads/master | 2020-04-24T10:20:31.375736 | 2019-03-26T09:06:13 | 2019-03-26T09:06:13 | 171,891,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,755 | java | /*
* @lc app=leetcode id=44 lang=java
*
* [44] Wildcard Matching
*
* https://leetcode.com/problems/wildcard-matching/description/
*
* algorithms
* Hard (22.33%)
* Total Accepted: 161.7K
* Total Submissions: 723.8K
* Testcase Example: '"aa"\n"a"'
*
* Given an input string (s) and a pattern (p), implement wildcard pattern
* matching with support for '?' and '*'.
*
*
* '?' Matches any single character.
* '*' Matches any sequence of characters (including the empty sequence).
*
*
* The matching should cover the entire input string (not partial).
*
* Note:
*
*
* s could be empty and contains only lowercase letters a-z.
* p could be empty and contains only lowercase letters a-z, and characters
* like ? or *.
*
*
* Example 1:
*
*
* Input:
* s = "aa"
* p = "a"
* Output: false
* Explanation: "a" does not match the entire string "aa".
*
*
* Example 2:
*
*
* Input:
* s = "aa"
* p = "*"
* Output: true
* Explanation: '*' matches any sequence.
*
*
* Example 3:
*
*
* Input:
* s = "cb"
* p = "?a"
* Output: false
* Explanation: '?' matches 'c', but the second letter is 'a', which does not
* match 'b'.
*
*
* Example 4:
*
*
* Input:
* s = "adceb"
* p = "*a*b"
* Output: true
* Explanation: The first '*' matches the empty sequence, while the second '*'
* matches the substring "dce".
*
*
* Example 5:
*
*
* Input:
* s = "acdcb"
* p = "a*c?b"
* Output: false
*
*
*/
/**
* 给定一个匹配串和一个模式串,模式串可能包含符号 * 和符号 ?
* ? 匹配任何单一字符
* * 匹配任何字符串(包括空字符串)
*
* Reference https://leetcode.com/problems/wildcard-matching/discuss/17810/Linear-runtime-and-constant-space-solution
* 使用迭代的方式处理,详细请看注释
* 另外也可以用类似第十题的 DP,速度比这个稍慢
*/
class Solution {
public boolean isMatch(String s, String p) {
// 指向当前 s 和 p 正在比较的位置
int sIndex = 0, pIndex = 0;
// * 号出现或匹配后,记录 * 号和主字符串匹配当前的位置
int sIndex4LastStar = -1;
// * 号出现后,继续其位置
int lastStar = -1;
while (sIndex < s.length()) {
if (pIndex < p.length() && (p.charAt(pIndex) == s.charAt(sIndex) || p.charAt(pIndex) == '?')) {
// 字符串正常匹配(包括 ? 号匹配)
sIndex++;
pIndex++;
} else if (pIndex < p.length() && p.charAt(pIndex) == '*') {
// 字符串不匹配,遇到 * 号
// 惰性:我们假设这个 * 号什么都不匹配
// 记录下这个星号的位置
lastStar = pIndex;
// 记录下现在 * 号和主字符串匹配的位置,( 0 个匹配也算是匹配的一种)
sIndex4LastStar = sIndex;
// 从下一个符号开始匹配
pIndex++;
} else if (sIndex4LastStar != -1) {
// 字符串不匹配,但是之前有星号可用
// 惰性:使用 * 匹配一位,并将 * 号和主字符串匹配的位置 + 1
sIndex = ++sIndex4LastStar;
// 由于上述惰性,假设 * 号的匹配到此为止了,从 * 号下一位开始匹配
pIndex = lastStar + 1;
} else {
// 没有任何匹配,失败
return false;
}
}
// 如果还有 * 号,那么直接设这些 * 号不匹配任何东西,跳过即可
while (pIndex < p.length() && p.charAt(pIndex) == '*')
pIndex++;
return pIndex == p.length();
}
}
| [
"zchangan@163.com"
] | zchangan@163.com |
08e1c3d7829afed779c8dcc857f66b2d76f76f34 | 5cb6a5c87d9bd6f6c3006564ce6441cbaf331890 | /src/test/java/org/ayfaar/app/controllers/NewSearchControllerUnitTest.java | cc9c371e76db44e707af147b99dc7e1ddae58ad6 | [] | no_license | maxsemen/ii | 041078b9621ee650f4f483ca4712cbac91c23c57 | 32cbe834c710097c5690e5766090404ca2156c11 | refs/heads/master | 2020-12-25T11:31:46.624057 | 2014-08-11T08:05:49 | 2014-08-11T08:05:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,111 | java | package org.ayfaar.app.controllers;
import org.ayfaar.app.controllers.search.SearchCache;
import org.ayfaar.app.controllers.search.SearchQuotesHelper;
import org.ayfaar.app.controllers.search.SearchResultPage;
import org.ayfaar.app.dao.SearchDao;
import org.ayfaar.app.model.Term;
import org.ayfaar.app.utils.AliasesMap;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.List;
import static java.util.Arrays.asList;
import static org.ayfaar.app.controllers.NewSearchController.PAGE_SIZE;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyList;
import static org.mockito.Mockito.*;
@RunWith(MockitoJUnitRunner.class)
public class NewSearchControllerUnitTest {
@Mock SearchDao searchDao;
@Mock SearchCache cache;
@Mock SearchQuotesHelper handleItems;
@Mock AliasesMap aliasesMap;
@InjectMocks @Spy
NewSearchController controller;
@Before
public void setUp() {
}
@SuppressWarnings("unchecked")
@Test
public void testHasMore() {
String q = "время";
Term term = new Term(q);
when(aliasesMap.getTerm(q)).thenReturn(term);
List<String> morphs = asList(q);
when(controller.getAllMorphs(anyList())).thenReturn(morphs);
List items = mock(List.class);
when(searchDao.findInItems(morphs, 0, PAGE_SIZE+1, null)).thenReturn(items);
when(items.size()).thenReturn(21);
SearchResultPage page = controller.search(q, 0, null);
assertTrue(page.isHasMore());
verify(searchDao, only()).findInItems(anyList(), anyInt(), anyInt(), anyString());
verify(items).remove(20);
}
// в таком же стиле можно добавить тесты на:
// поиск фразы - не термина
// поиск второй страницы
// поиск со двумя запросами в базу (второй для синонимов)
}
| [
"ylebid@gmail.com"
] | ylebid@gmail.com |
068451abeeed50dc049e25e11a505ffa769174f6 | b43c06ea353643da89d8543207dbeefa9fa09117 | /src/leetcode/GuessNumberHigherOrLowerII.java | 53aa8e43f181183186b6b1b9ccf74be88c86075a | [] | no_license | weichenjiegit/algorithm_data_structure | 7d52f5370e52b968c4892951ebf69dd26cb94255 | c4ebbeba30a536315ad0731ef29f7261faa8639e | refs/heads/master | 2021-01-19T01:49:44.538018 | 2016-10-23T19:21:59 | 2016-10-23T19:21:59 | 45,594,283 | 0 | 0 | null | 2015-12-07T07:35:41 | 2015-11-05T07:11:13 | null | UTF-8 | Java | false | false | 2,166 | java | package leetcode;
/**
* We are playing the Guess Game. The game is as follows:
*
* I pick a number from 1 to n. You have to guess which number I picked.
*
* Every time you guess wrong, I'll tell you whether the number I picked is higher or lower.
*
* However, when you guess a particular number x, and you guess wrong, you pay $x. You win the game
* when you guess the number I picked.
*/
public class GuessNumberHigherOrLowerII {
/**
* Given any n, we make a guess k. Then we break the interval [1,n] into [1,k - 1] and [k +
* 1,n]. The min of worst case cost can be calculated recursively as
*
* cost[1,n] = k + max{cost[1,k - 1] + cost[k+1,n]}
*/
public int getMoneyAmount(int n) {
int[][] dp = new int[n + 2][n + 2];
for (int len = 1; len < n; len++) {
for (int from = 1, to = from + len; to <= n; from++, to++) {
dp[from][to] = Integer.MAX_VALUE;
for (int k = from; k <= to; k++)
dp[from][to] = Math.min(dp[from][to], k + Math.max(dp[from][k - 1], dp[k + 1][to]));
}
}
return dp[1][n];
}
public int getMoneyAmount2(int n) {
// all intervals are inclusive
// add 1 to the length just to make the index the same as numbers used
int[][] dp = new int[n + 1][n + 1];
// iterate the lengths of the intervals since the calculations of longer intervals rely on
// shorter ones
for (int l = 2; l <= n; l++) {
// iterate all the intervals with length l, the start of which is i. Hence the interval
// will be [i, i + (l - 1)]
for (int i = 1; i <= n - (l - 1); i++) {
dp[i][i + (l - 1)] = Integer.MAX_VALUE;
// iterate all the first guesses g
for (int g = i; g <= i + (l - 1); g++) {
int costForThisGuess;
// if g is the last integer, g + 1 does not exist.
// else dp[i, i + (l - 1)]: g (first guess) + max{the cost of left part [i, g
// - 1], the cost of right part [g + 1, i + (l - 1)]}
if (g == n) {
costForThisGuess = dp[i][g - 1] + g;
} else {
costForThisGuess = g + Math.max(dp[i][g - 1], dp[g + 1][i + (l - 1)]);
}
dp[i][i + (l - 1)] = Math.min(dp[i][i + (l - 1)], costForThisGuess);
}
}
}
return dp[1][n];
}
}
| [
"weichenjie2015@gmail.com"
] | weichenjie2015@gmail.com |
92d691cc73e0a91dace980ea583e8daa8465a071 | f2eb9e26cc75d9e31ef4212f2d967e816a9371bd | /modules/datamodel/src/main/java/org/shaolin/bmdp/datamodel/page/OpInvokeWorkflowType.java | 062dc91f16673ff49a55b522c320b72e659d3f8a | [
"Apache-2.0"
] | permissive | predans/uimaster | 9b641b031ed5bedbf6c266ea8202cb273fd0835f | 4071cca988394053dfae5c0592c302d22228b53e | refs/heads/master | 2021-01-18T12:38:50.736814 | 2015-12-23T05:55:41 | 2015-12-23T05:55:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,029 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.21 at 10:32:01 AM CST
//
package org.shaolin.bmdp.datamodel.page;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import org.shaolin.bmdp.datamodel.common.ExpressionType;
import org.shaolin.javacc.context.ParsingContext;
import org.shaolin.javacc.exception.ParsingException;
/**
* <p>Java class for OpInvokeWorkflowType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="OpInvokeWorkflowType">
* <complexContent>
* <extension base="{http://bmdp.shaolin.org/datamodel/Page}OpType">
* <sequence>
* <element name="expression" type="{http://bmdp.shaolin.org/datamodel/Common}ExpressionType" minOccurs="0"/>
* </sequence>
* <attribute name="eventConsumer" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="partyType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="beforeActionWidget" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="nextActionWidget" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OpInvokeWorkflowType", propOrder = {
"expression"
})
public class OpInvokeWorkflowType
extends OpType
implements Serializable
{
private final static long serialVersionUID = 1L;
protected ExpressionType expression;
@XmlAttribute(name = "eventConsumer", required = true)
protected String eventConsumer;
@XmlAttribute(name = "partyType", required = true)
protected String partyType;
@XmlAttribute(name = "beforeActionWidget")
protected String beforeActionWidget;
@XmlAttribute(name = "nextActionWidget")
protected String nextActionWidget;
/**
* Gets the value of the expression property.
*
* @return
* possible object is
* {@link ExpressionType }
*
*/
public ExpressionType getExpression() {
return expression;
}
/**
* Sets the value of the expression property.
*
* @param value
* allowed object is
* {@link ExpressionType }
*
*/
public void setExpression(ExpressionType value) {
this.expression = value;
}
/**
* Gets the value of the eventConsumer property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEventConsumer() {
return eventConsumer;
}
/**
* Sets the value of the eventConsumer property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEventConsumer(String value) {
this.eventConsumer = value;
}
/**
* Gets the value of the partyType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPartyType() {
return partyType;
}
/**
* Sets the value of the partyType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPartyType(String value) {
this.partyType = value;
}
/**
* Gets the value of the beforeActionWidget property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBeforeActionWidget() {
return beforeActionWidget;
}
/**
* Sets the value of the beforeActionWidget property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBeforeActionWidget(String value) {
this.beforeActionWidget = value;
}
/**
* Gets the value of the nextActionWidget property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNextActionWidget() {
return nextActionWidget;
}
/**
* Sets the value of the nextActionWidget property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNextActionWidget(String value) {
this.nextActionWidget = value;
}
public void parse(ParsingContext context) throws ParsingException
{
getExpression().parse(context);
}
}
| [
"shao.lin@live.com"
] | shao.lin@live.com |
8e28480cf306c6586e51a8cc7d15c0dcabef1b56 | 3f38d4150c6c0d61b526101761c920a74141d777 | /6P/Number.java | 38f4b4a4ebfe85ddee8e8bdfec037ebd5fafd4a9 | [] | no_license | khite95/Java-Projects | f965b79690900e349f56326860986f6462607389 | 455ffc8d7ff4078beb8cd693cb5876efdbd85971 | refs/heads/master | 2022-04-07T21:30:37.794221 | 2020-03-03T16:48:31 | 2020-03-03T16:48:31 | 244,688,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 828 | java | /**
* Number.java.
*
* @author Kenneth Hite
* CS416 7/1/2016
*
*/
public class Number extends Operand
{
private Float token;
/**
* Number.
*
* @param s float.
*/
public Number( float s )
{
token = s;
}
/**
* getToken.
*
* @return token float.
*/
public float getToken()
{
return token;
}
/**
* print.
*
* @return returnstring String.
*/
public String printable( )
{
int tokenint = Math.round( token );
String returnstring = "@" + tokenint;
return returnstring;
}
/**
* getop.
*
* @return s String.
*/
public String getop()
{
String floatString = String.valueOf( token );
return floatString;
}
} | [
"khite95@users.noreply.github.com"
] | khite95@users.noreply.github.com |
cda850b11ec89708c02848c512068471aa660ee1 | 35c40b73478185f6f1e48c1265b01cd9ef551588 | /src/com/enation/javashop/core/model/mapper/GoodsListMapper.java | 2c6b6bb83625f3fec11c54b0c4203cdb4bfb469f | [] | no_license | chaseluo/JavaShop | 2e42a76ebf6893894d13653140c77a311ca0e28c | 604b327d60c88cd2e12487cef5a1d5f8bab18e6d | refs/heads/master | 2021-07-24T23:06:02.031608 | 2017-11-06T08:15:05 | 2017-11-06T08:15:05 | 109,664,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,560 | java | package com.enation.javashop.core.model.mapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.springframework.jdbc.core.RowMapper;
import com.enation.eop.sdk.utils.UploadUtil;
import com.enation.javashop.core.model.support.GoodsView;
/**
* 商品列表mapper
* @author kingapex
* 2010-7-16下午01:48:59
*/
public class GoodsListMapper implements RowMapper {
/**
* 返回{@link GooodsView}
* 在本方法中对属性进行了读取和处理,并放入到了 propMap属性
*/
@Override
public Object mapRow(ResultSet rs, int arg1) throws SQLException {
GoodsView goods = new GoodsView();
goods.setName(rs.getString("name"));
goods.setGoods_id(rs.getInt("goods_id"));
goods.setImage_default(rs.getString("image_default"));
goods.setMktprice(rs.getDouble("mktprice"));
goods.setPrice(rs.getDouble("price"));
goods.setCreate_time(rs.getLong("create_time"));
goods.setLast_modify(rs.getLong("last_modify"));
goods.setType_id(rs.getInt("type_id"));
goods.setPoint(rs.getInt("point"));
goods.setStore(rs.getInt("store"));
goods.setCat_id(rs.getInt("cat_id"));
goods.setSn(rs.getString("sn"));
goods.setIntro(rs.getString("intro"));
goods.setStore(rs.getInt("store"));
goods.setImage_file(UploadUtil.replacePath(rs.getString("image_file")));
Map propMap = new HashMap();
for(int i=0;i<20;i++){
String value = rs.getString("p" + (i+1));
propMap.put("p"+(i+1),value);
}
goods.setPropMap(propMap);
return goods;
}
}
| [
"luoheng211@gmail.com"
] | luoheng211@gmail.com |
38ed108d9737ba8b53d2a45f8b5387da2fc19e4e | 501a472cefd3ca014a7c1b3587bbb7e863917ea5 | /src/main/java/sorting/Sort.java | 6bd1289a9709825915ecca11151d66e62cf7932c | [] | no_license | cleancoder1/programmerNotes | a855e5126deea12a8b87139c42f1e190a32e9107 | 228ab6c726966600c972c017523b97f375e86c9d | refs/heads/master | 2020-03-22T01:08:12.938938 | 2018-12-26T15:52:47 | 2018-12-26T15:52:47 | 139,285,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | package sorting;
import edu.princeton.cs.algs4.StdOut;
public abstract class Sort {
// public abstract void sort(Comparable a[]);
protected void exchange(Comparable input[], int a, int b) {
Comparable temp = input[a];
input[a] = input[b];
input[b] = temp;
}
protected boolean less(Comparable a, Comparable b) {
return a.compareTo(b) < 0;
}
public boolean isSorted(Comparable[] a) { // Test whether the array entries are in order.
for (int i = 1; i < a.length; i++)
if (less(a[i], a[i - 1])) return false;
return true;
}
public void show(Comparable[] a) { // Print the array, on a single line.
for (int i = 0; i < a.length; i++)
StdOut.print(a[i] + " ");
StdOut.println();
}
}
| [
"rparsi@deltadentalia.com"
] | rparsi@deltadentalia.com |
06d5853d780b60390688592eea358c10329f8c34 | 9127e73fb9ff6ca5fed8af9317a3a31ee2da3532 | /app/src/main/java/com/zhongyou/meettvapplicaion/utils/SizeUtils.java | 09bf8a14ea565cbf73bb0b4b6cee2167ebe66e82 | [] | no_license | woyl/zy_tv | 3e156ad0dc5982d9d994cbacddb4cc1d11a82003 | ddd1b98695817c18687d0f3e0b18291a09d29f27 | refs/heads/master | 2023-01-19T01:59:33.987412 | 2020-11-26T04:59:18 | 2020-11-26T04:59:18 | 316,114,199 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,723 | java | package com.zhongyou.meettvapplicaion.utils;
import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
/**
* @author luopan@centerm.com
* @date 2019-11-22 10:24.
*/
public class SizeUtils {
Activity mActivity;
public SizeUtils(Activity mActivity) {
this.mActivity = mActivity;
}
/**
* px转sp
*
* @param px
* @return
*/
public float pxToSp(int px) {
float sp;
DisplayMetrics dm = new DisplayMetrics();
dm = mActivity.getResources().getDisplayMetrics();
int ppi = dm.densityDpi;
sp = (float) (px * 160 / ppi);
return sp;
}
public DisplayMetrics screenSize() {
DisplayMetrics dm = new DisplayMetrics();
mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm);
return dm;
}
public void setLayoutSize(View view, int wdith, int height) {
ViewGroup.LayoutParams lt = view.getLayoutParams();
lt.height = height * screenHeight() / 1334;
lt.width = wdith * screenWidth() / 750;
view.setLayoutParams(lt);
}
public void setViewMatchParent(View view){
ViewGroup.LayoutParams lt = view.getLayoutParams();
lt.height = DisplayUtil.getHeight(mActivity);
lt.width = DisplayUtil.getWidth(mActivity);
view.setLayoutParams(lt);
}
public void setLayoutSizeHeight(View view, int height) {
ViewGroup.LayoutParams lt = view.getLayoutParams();
lt.height = height;
view.setLayoutParams(lt);
}
public void setLayoutSizeWidht(View view, int widht) {
ViewGroup.LayoutParams lt = view.getLayoutParams();
lt.width = widht * screenWidth() / 750;
view.setLayoutParams(lt);
}
public void setTextSize(TextView view, int size) {
view.setTextSize(pxToSp(size * screenWidth() / 750) + 3);
}
public void setButtonTextSize(Button view, int size) {
view.setTextSize(pxToSp(size * screenWidth() / 750) + 3);
}
public void setRelativeLayoutMargin(
View view,
int left,
int top,
int right,
int bottom) {
RelativeLayout navigationLl = new RelativeLayout(mActivity);
RelativeLayout.LayoutParams lt = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
navigationLl.setLayoutParams(lt);
lt.setMargins(left * screenWidth() / 750, top * screenHeight() / 1334, right * screenWidth() / 750, bottom * screenHeight() / 1334);
view.setLayoutParams(lt);
}
public void setRelativeLayoutMargin(
View view,
int left,
int top,
int right,
int bottom, int a) {
RelativeLayout navigationLl = new RelativeLayout(mActivity);
RelativeLayout.LayoutParams lt = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
navigationLl.setLayoutParams(lt);
lt.setMargins(left * screenWidth() / 750, top * screenHeight() / 1334, right * screenWidth() / 750, bottom * screenHeight() / 1334);
view.setLayoutParams(lt);
}
public void setLinearLayoutMargin(
LinearLayout viewGroup,
View view,
int left,
int top,
int right,
int bottom) {
LinearLayout.LayoutParams lt = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
viewGroup.setLayoutParams(lt);
lt.setMargins(left * screenWidth() / 750, top * screenHeight() / 1334, right * screenWidth() / 750, bottom * screenHeight() / 1334);
view.setLayoutParams(lt);
}
//得到屏幕宽
public int screenWidth() {
return screenSize().widthPixels;
}
//得到屏幕的高
public int screenHeight() {
return screenSize().heightPixels;
}
}
| [
"676051397@qq.com"
] | 676051397@qq.com |
1505badef218293c25465f0c558b2d72fdb6b2fe | 805b90a6e35e73126d18353b9b7ad7474d4cbd4c | /src/test/java/org/got5/tapestry5/jquery/pages/ShowSource.java | 07602858babd5f7e95277a7de9eb82ad72b14381 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | got5/tapestry5-jquery | 53fba925fe6746645bb64f3cc547a8213ada72e8 | d929e8bfe7e9d6489c36dc23c54cd95b4b3e7c7b | refs/heads/master | 2023-03-07T10:07:57.790884 | 2018-08-23T09:06:30 | 2018-08-23T09:06:30 | 613,533 | 57 | 54 | NOASSERTION | 2022-08-08T20:00:02 | 2010-04-16T12:50:28 | HTML | UTF-8 | Java | false | false | 2,187 | java | package org.got5.tapestry5.jquery.pages;
import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.beaneditor.BeanModel;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.BeanModelSource;
import org.apache.tapestry5.services.Request;
import org.got5.tapestry5.jquery.entities.User;
public class ShowSource {
@Property
private User user;
@Property
private User currentUser;
@Property
private int currentIndex;
@Property
@Persist
private List<User> users;
@Component
private Zone detailZone;
@Inject
private BeanModelSource _beanModelSource;
@Inject
private ComponentResources _componentResources;
@Inject
private Request request;
void setupRender() {
users = createUsers(50);
}
public BeanModel getMyModel(){
BeanModel myModel = _beanModelSource.createDisplayModel(User.class,
_componentResources.getMessages());
myModel.add("action", null);
myModel.include("firstName", "lastName", "action");
myModel.get("firstName").sortable(false);
myModel.get("lastName").label("Surname");
return myModel;
}
@OnEvent(value = EventConstants.ACTION)
Object showDetail(String lastName)
{
if (!request.isXHR()) { return this; }
for(User u : users){
if(u.getLastName().equalsIgnoreCase(lastName))
user= u;
}
return detailZone;
}
public JSONObject getDialogParam()
{
JSONObject param = new JSONObject();
param.put("width", 400);
return param;
}
private User createUser(int i)
{
User u = new User();
u.setAge(i);
u.setFirstName("Humpty" + i + 10);
u.setLastName("Dumpty" + i + 200);
return u;
}
private List<User> createUsers(int number)
{
List<User> users = new ArrayList<User>();
for (int i = 0; i < number; i++)
{
users.add(createUser(i));
}
return users;
}
}
| [
"demey.emmanuel@gmail.com"
] | demey.emmanuel@gmail.com |
c23d8072aec8e68388b955ce018aaeb223c15d1d | 95733b93bd698fe47bbf9990f37ffdf06f44ba21 | /givus/src/kr/co/zadusoft/contents/model/MainModel.java | c9c8b77d3b4685ea2ebba3d42fd4d0880bb3039f | [] | no_license | choiseungchul/jsp | b9c4ab4e32c9e9741d2334604f3fec47028c0a9b | c29942ed7b8be8d5a94f6ce5025b54eebd735296 | refs/heads/master | 2021-01-18T19:26:27.332470 | 2015-06-24T16:13:58 | 2015-06-24T16:13:58 | 37,726,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package kr.co.zadusoft.contents.model;
public class MainModel {
public String id;
public String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"arcray@naver.com"
] | arcray@naver.com |
cd6b297d93707f0971d5c1bb3535fa2ac31eede8 | 61389bbb3a1c71e5e10101985913be0b52fcae87 | /usage/src/main/java/com/ning/billing/usage/timeline/categories/CategoryAndMetrics.java | c1ba8b5fcd932700a5e135dd4840c3c2963f4204 | [
"Apache-2.0"
] | permissive | pengfanhust/killbill | 513de990b701d4bc98ecaa90eb054fc2b24eb10f | 9acd2ea2745a96b35a9a4bb0648364ac04fa08c9 | refs/heads/master | 2021-01-18T12:07:57.489859 | 2012-10-28T20:19:28 | 2012-10-28T20:19:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,142 | java | /*
* Copyright 2010-2012 Ning, Inc.
*
* Ning 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.ning.billing.usage.timeline.categories;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CategoryAndMetrics implements Comparable<CategoryAndMetrics> {
@JsonProperty
private final String eventCategory;
@JsonProperty
private final Set<String> metrics = new HashSet<String>();
public CategoryAndMetrics(final String eventCategory) {
this.eventCategory = eventCategory;
}
@JsonCreator
public CategoryAndMetrics(@JsonProperty("eventCategory") final String eventCategory, @JsonProperty("metrics") final List<String> metrics) {
this.eventCategory = eventCategory;
this.metrics.addAll(metrics);
}
public void addMetric(final String metric) {
metrics.add(metric);
}
public String getEventCategory() {
return eventCategory;
}
public Set<String> getMetrics() {
return metrics;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("CategoryAndMetrics");
sb.append("{eventCategory='").append(eventCategory).append('\'');
sb.append(", metrics=").append(metrics);
sb.append('}');
return sb.toString();
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CategoryAndMetrics that = (CategoryAndMetrics) o;
if (!eventCategory.equals(that.eventCategory)) {
return false;
}
if (!metrics.equals(that.metrics)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = eventCategory.hashCode();
result = 31 * result + metrics.hashCode();
return result;
}
@Override
public int compareTo(final CategoryAndMetrics o) {
final int categoryComparison = eventCategory.compareTo(o.getEventCategory());
if (categoryComparison != 0) {
return categoryComparison;
} else {
if (metrics.size() > o.getMetrics().size()) {
return 1;
} else if (metrics.size() < o.getMetrics().size()) {
return -1;
} else {
return 0;
}
}
}
}
| [
"pierre@mouraf.org"
] | pierre@mouraf.org |
7409cb41ec3a8923cce79b03cfd89c457b66814e | 7db19d6ea18c566220c797e59afdc65e8cfde114 | /tcc-core/src/main/java/org/bytesoft/openjtcc/remote/Committable.java | 9f6d7e6e840b1b8f5002e1430beea8f3c8645038 | [
"Apache-2.0"
] | permissive | xushaomin/openjtcc | 34e590d60f4e76c26c1c6e2d60ed497945cb4004 | 569f4a0e782f53eeee8a496763eb9e061b0cf902 | refs/heads/master | 2021-01-18T11:12:39.605639 | 2015-03-04T06:00:40 | 2015-03-04T06:00:40 | 31,840,751 | 2 | 4 | null | 2015-03-08T06:29:35 | 2015-03-08T06:29:34 | null | UTF-8 | Java | false | false | 1,108 | java | /**
* Copyright 2014 yangming.liu<liuyangming@gmail.com>.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* 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 distribution; if not, see <http://www.gnu.org/licenses/>.
*/
package org.bytesoft.openjtcc.remote;
import java.rmi.RemoteException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.SystemException;
public interface Committable {
public void commit() throws HeuristicMixedException, HeuristicRollbackException, SystemException, RemoteException;
}
| [
"e.yangting@gmail.com"
] | e.yangting@gmail.com |
d80e99fd83f4cf7dfc7ce3ea22f0b408c9390032 | 70b93fc3640b2ddec70eb6f0c035fde79d05b63e | /Recipe_Teller/app/src/main/java/com/example/recipe_teller/modelHTWD/TwdModel.java | 37cfd675bb7607e19876fdc6e385feca7c18111a | [] | no_license | tehloo/RecipeTeller | 53a613d409c2c9fcca7b341eab476d58b96bd079 | abe51964a780a351cf37e9706cffacb98111ad25 | refs/heads/master | 2022-09-26T10:25:51.921743 | 2020-06-04T13:34:19 | 2020-06-04T13:34:19 | 269,369,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | /*
* Copyright (c) 2018 LG Electronics Inc.
*/
package com.example.recipe_teller.modelHTWD;
/*
* This class makes it easy to load various model files for demonstration of the startup engine.
* It is not required for actual products.
*/
/**
* Model information are de-serialized from json files in asset/keyword_model for TWD config using Gson.
*/
public class TwdModel {
/**
* am file path
*/
String amModelFile;
/**
* net file path
*/
String netModelFile;
/**
* Sensitivity value, decimal number
*/
int sensitivity;
/**
* cm value, floating-point number
*/
float cm;
/**
* Weight value, decimal number
*/
int weight;
@Override
public String toString() {
return "TwdModel{" +
"amModelFile='" + amModelFile + '\'' +
", netModelFile='" + netModelFile + '\'' +
", sensitivity=" + sensitivity +
", cm=" + cm +
", weight=" + weight +
'}';
}
}
| [
"kan5016@naver.com"
] | kan5016@naver.com |
dcfda8aefe6c6e90e827a05f60ff1c8ec308aac5 | 3b95f494fc07ee8cccb5b12b6b4f2c4e101f3f08 | /src/program_tugas/MHS.java | 9f21341b5ded5ab7152756d2c37f536aa6afe305 | [] | no_license | 5170411316/PBO_Aisa_InformatikaE | 9b2bd135c32c92adddd9549a4051455eec9917b7 | 622964dc5d44d1bcf25ea34df2606caa76e74ca1 | refs/heads/master | 2020-04-05T18:11:03.034176 | 2018-11-11T15:42:08 | 2018-11-11T15:42:08 | 157,091,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,751 | java |
package program_tugas;
import java.util.*;
/**
*
* @author Bismillah
*/
public class MHS {
private String nim;
private String nama, ipk;
public static List<MHS> sMhs = new ArrayList<>();
public MHS() {
}
public MHS(String nim, String nama, String ipk) {
this.nim = nim;
this.nama = nama;
this.ipk = ipk;
}
public void sortIpk() {
Collections.sort(sMhs, new Comparator<MHS>(){
@Override
public int compare(MHS t, MHS t1) {
return t.getIpk().compareTo(t1.getIpk());
}
});
for (MHS mahasiswa : sMhs) {
System.out.println(mahasiswa.getIpk() + " => " + mahasiswa.getIpk());
}
}
public void sortNama() {
Collections.sort(sMhs, new Comparator<MHS>(){
@Override
public int compare(MHS t, MHS t1) {
return t1.getNama().compareTo(t.getNama());
}
});
for (MHS mahasiswa : sMhs) {
System.out.println(mahasiswa.getNama() + " => " + mahasiswa.getNama());
}
}
public void sortNim() {
Collections.sort(sMhs, new Comparator<MHS>(){
@Override
public int compare(MHS t, MHS t1) {
return t.getNim().compareTo(t1.getNim());
}
});
for (MHS mahasiswa : sMhs) {
System.out.println(mahasiswa.getNim() + " => " + mahasiswa.getNim());
}
}
public void isiData(String nim, String nama, String ipk) {
sMhs.add(new MHS(nim, nama, ipk));
//System.out.println(nama);
}
public void tampilData() {
int i=1;
for (MHS mahasiswa : sMhs) {
System.out.println("Data ke - " + i++);
System.out.println("Nim : " + mahasiswa.nim);
System.out.println("Nama : " + mahasiswa.nama);
System.out.println("IPK : " + mahasiswa.ipk);
}
}
public String getNim() {
return nim;
}
public String getNama() {
return nama;
}
public String getIpk() {
return ipk;
}
public void setNim(String nim) {
this.nim = nim;
}
public void setNama(String nama) {
this.nama = nama;
}
public void setIpk(String ipk) {
this.ipk = ipk;
}
@Override
public String toString() {
String str = "Nim: " + nim + "\n" +
"Nama: " + nama + "\n" +
"IPK: " + ipk;
return str;
}
}
| [
"Bismillah@LAPTOP-3JQ8KR8I"
] | Bismillah@LAPTOP-3JQ8KR8I |
8f4fd3a36a34c33de2bc8243ce35704c6570bedc | bc180e77724b817c9b1aa0c355ad7011695ef828 | /src/roundrobin/Roundrobin_main.java | f3d780de0dba1bd3db5ea07308a50252f3f250cd | [] | no_license | smzn/Roundrobin | a94c9536aa8ef695b8ac1d798ceec149703babde | 6149e46e2c34d420e9b820700778166a9e7343a3 | refs/heads/master | 2021-01-10T03:34:34.596046 | 2015-12-22T04:14:14 | 2015-12-22T04:14:14 | 48,409,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package roundrobin;
public class Roundrobin_main {
public static void main(String[] args) {
// TODO Auto-generated method stub
int n=10;
int k=5;
Combination c = new Combination(n,k);
System.out.println("C("+c.getN()+","+c.getK()+")="
+c.getSize());
System.out.println("全ての組合せを表示します。");
System.out.println("toString を利用");
for(int i=0; i<c.getSize(); ++i){
System.out.println(i+1+ ":" + c.toString(i));
}
System.out.println("直接値を取得");
int temp[] = new int[k];
for(int i=0; i<c.getSize(); ++i){
String result = "";
c.getElements(i,temp);
result += i+":";
for(int j=0; j<temp.length; ++j){
result += temp[j];
if(j!=temp.length-1){
result += ",";
}
}
System.out.println(result);
}
}
}
| [
"s.mzn.eng@gmail.com"
] | s.mzn.eng@gmail.com |
6e3e6fcf998fabaab40704ca53f7dc013e0f3af4 | 0b70a9ce5be81ec29e40e99fcb925774eb726e2f | /src/main/java/com/wx/service/combine/HeadLineShopCategoryCombineService.java | 2d794e5a9352adfd3f765b426a5e22f23bc4b9c7 | [] | no_license | lihaowen31/springbasic | 6a595f50f3612895d2a2e835231e7caaf7128609 | 2108db0ef9bf81cd5754ef4c340351eb147f2b61 | refs/heads/master | 2023-02-22T20:02:36.900385 | 2021-01-26T14:43:14 | 2021-01-26T14:43:14 | 330,969,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package com.wx.service.combine;
import com.wx.entity.dto.MainPageInfoDTO;
import com.wx.entity.dto.Result;
public interface HeadLineShopCategoryCombineService {
Result<MainPageInfoDTO> getMainPageInfo();
}
| [
"lihaowen9331@163.com"
] | lihaowen9331@163.com |
91584883290b227386c88184d9aebe4a8ab16306 | 478106dd8b16402cc17cc39b8d65f6cd4e445042 | /l2junity-gameserver/src/main/java/org/l2junity/gameserver/enums/MatchingRoomType.java | 2c92c8d7a7a753a590a735dc8d56af0e82582c56 | [] | no_license | czekay22/L2JUnderGround | 9f014cf87ddc10d7db97a2810cc5e49d74e26cdf | 1597b28eab6ec4babbf333c11f6abbc1518b6393 | refs/heads/master | 2020-12-30T16:58:50.979574 | 2018-09-28T13:38:02 | 2018-09-28T13:38:02 | 91,043,466 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | /*
* Copyright (C) 2004-2015 L2J Unity
*
* This file is part of L2J Unity.
*
* L2J Unity 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.
*
* L2J Unity 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 org.l2junity.gameserver.enums;
/**
* @author Sdw
*/
public enum MatchingRoomType
{
PARTY,
COMMAND_CHANNEL
}
| [
"unafraid89@gmail.com"
] | unafraid89@gmail.com |
00426e3d535af119424b8071747ccd66353ef4dd | 3f767d13fc4dd0db69aaa50b0792ccf40292dc09 | /src/leetcode/Leet27.java | 41aaa77d4e58223a1f32b68f5bc288cf7ae7bcbb | [] | no_license | brook-joker/algorithm | b5ed5ae556bdf6cbd7b4f9901989506f41e33405 | 04e187544129ebe9837425cc73aea74189e4dd16 | refs/heads/master | 2020-04-26T18:05:14.833428 | 2020-04-06T04:22:48 | 2020-04-06T04:22:48 | 173,733,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package leetcode;
public class Leet27 {
// public int removeElement(int[] nums, int val) {
// int i = 0;
// for (int j = 0; j < nums.length; j++) {
// if (nums[i] != val) {
// nums[i++] = nums[j];
// }
// }
// return i;
// }
public int removeElement(int[] nums, int val) {
int n = nums.length;
for (int j = 0; j < nums.length; j++) {
if (nums[j] == val) {
nums[j] = nums[n-1];
n--;
}
}
return n;
}
}
| [
"maqiang@ke.com"
] | maqiang@ke.com |
2e3c6fbf33cfb854171fbf221b9bf15b47076d35 | 4f2142d37b9dbc4b8f22ecbac2c38484c6ac28fa | /src/main/java/edu/example/Player.java | c59265e3c50547f98448fa59f2e850054ef8e9bb | [] | no_license | ashleymariecramer/salvo | 27ae74198b891ab2ce25f6653a5ede6a0d377fac | 6fac158c7a49095769878c50fc623688383ae3d4 | refs/heads/master | 2021-01-13T13:46:32.825660 | 2017-02-09T17:45:43 | 2017-02-09T17:45:43 | 76,348,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,589 | java | /**
* Created by ashleymariecramer on 07/12/16.
*/
package edu.example;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import javax.persistence.*;
import javax.validation.constraints.Pattern;
import java.util.Set;
@Entity // tells Java to create a 'Player' table for this class
public class Player {
//---------------------Properties(private)----------------------------------
@Id // id instance variable holds the database key for this class.
@GeneratedValue(strategy=GenerationType.AUTO) // tells JPA to get the ID from the DBMS.
private long id;
@NotEmpty (message = "Please enter a nickname")
private String nickname;
@NotEmpty (message = "Please enter a username")
@Email (message = "Please enter valid email address")
@Pattern(regexp=".+@.+\\..+", message="Please provide a valid email address") //checks email has format x@y.z
private String username;
@NotEmpty (message = "Please enter a password")
private String password;
@OneToMany(mappedBy="player", fetch= FetchType.EAGER)
private Set<GamePlayer> gamePlayers;
@OneToMany(mappedBy="player", fetch= FetchType.EAGER)
private Set<GameScore> gameScores;
// ---------------------Constructors(public)----------------------------------
public Player() { }
public Player(String nickname, String email, String password) {
this.nickname = nickname;
this.username = email;
this.password = password;
}
// ---------------------Methods(public)----------------------------------
// Double validation - in Javascript & JAVA - checks nickname, username and password are not empty @Empty
// and also that the username has a correct email format @Email
// Can put these validation annotations either in the getters or in properties (above)
public String getNickname() {
return nickname;
}
public void setNickname(String firstName) {
this.nickname = firstName;
}
@Email (message = "Please enter valid email address")
public String getUsername() {
return username;
}
public void setUsername(String email) {
this.username = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public long getId() {
return id;
}
public Set<GamePlayer> getGamePlayers() {
return gamePlayers;
}
public Set<GameScore> getGameScores() {
return gameScores;
}
}
| [
"ashleymariecramer@gmail.com"
] | ashleymariecramer@gmail.com |
e96df1d16db5ba83e991e75a4d9764f239d12b11 | c23041e73978456e589da48c6df983cff2cb7b25 | /weather/src/main/java/com/gddst/lhy/weather/fragment/WeatherFragment.java | e824f6e2001d3bd0b351ab96ab28aafc8a45f1b5 | [] | no_license | laihouyou/HFWeather | aacd664d261900706637b0467a1010d51773a5d8 | 201187643ac7acc099cffb9f678db04f73875766 | refs/heads/master | 2021-07-10T14:41:03.876971 | 2020-07-27T10:12:00 | 2020-07-27T10:12:00 | 167,662,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,349 | java | package com.gddst.lhy.weather.fragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.widget.NestedScrollView;
import com.bumptech.glide.Glide;
import com.com.sky.downloader.greendao.CityVoDao;
import com.gddst.app.lib_common.MPAndroidChart.LineChartManager;
import com.gddst.app.lib_common.base.BaseApplication;
import com.gddst.app.lib_common.base.fragment.BaseFragment;
import com.gddst.app.lib_common.net.DlObserve;
import com.gddst.app.lib_common.net.NetManager;
import com.gddst.app.lib_common.utils.DateUtil;
import com.gddst.app.lib_common.weather.db.CityVo;
import com.gddst.app.lib_common.weather.util.Keys;
import com.gddst.lhy.weather.R;
import com.gddst.lhy.weather.WeatherActivity;
import com.gddst.lhy.weather.util.WeatherUtil;
import com.gddst.lhy.weather.vo.AirNow;
import com.gddst.lhy.weather.vo.WeatherVo;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.formatter.ValueFormatter;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import retrofit2.Response;
public class WeatherFragment extends BaseFragment {
// private SwipeRefreshLayout swipeRefres;
//空气质量aqi
private TextView aqi_text;
private TextView pm25_text;
//当日天气
private TextView tv_Celsius;
private TextView tv_situation;
private NestedScrollView scrollView;
private LinearLayout day_linelayout;
private LinearLayout suggestion_linearlayout;
private LineChart lineChart_host24;
private WeatherActivity context;
private String cityCid;
public static WeatherFragment getFragment(String cityCid){
WeatherFragment weatherFragment=new WeatherFragment();
Bundle bundle=new Bundle();
bundle.putString(WeatherUtil.cid,cityCid);
weatherFragment.setArguments(bundle);
return weatherFragment;
}
@Override
protected View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
context= (WeatherActivity) getActivity();
return getLayoutInflater().inflate(R.layout.fragment_weather_layout,container,false);
}
@Override
protected void initView(View view) {
aqi_text = view.findViewById(R.id.aqi_text);
pm25_text = view.findViewById(R.id.pm25_text);
tv_Celsius = view.findViewById(R.id.tv_Celsius);
tv_situation = view.findViewById(R.id.tv_situation);
scrollView = view.findViewById(R.id.scrollView);
scrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
context.swipeRefres.setEnabled(scrollView.getScrollY() == 0);
}
});
day_linelayout = view.findViewById(R.id.day_linelayout);
suggestion_linearlayout = view.findViewById(R.id.suggestion_linearlayout);
lineChart_host24 = view.findViewById(R.id.host_24);
}
private void intiLineChartView(List<WeatherVo.HourlyBean> hourlyBeanList) {
//设置X轴数据格式
XAxis xAxis=lineChart_host24.getXAxis();
xAxis.setValueFormatter(new ValueFormatter() {
@Override
public String getFormattedValue(float value) {
int i= (int) value;
String time=hourlyBeanList.get(i).getTime();
String timeStr=time.split(" ")[1];
return timeStr;
}
});
YAxis yAxis=lineChart_host24.getAxisLeft();
yAxis.setAxisMinimum(0);
yAxis.setValueFormatter(new ValueFormatter() {
@Override
public String getFormattedValue(float value) {
return value+"°";
}
});
ArrayList<Entry> values = new ArrayList<>();
for (int i = 0; i < hourlyBeanList.size(); i++) {
String tmp=hourlyBeanList.get(i).getTmp();
values.add(new Entry(i,Float.parseFloat(tmp)));
}
LineChartManager.initSingleLineChart(context,lineChart_host24,values);
}
@Override
protected void initListener() {
}
@Override
protected void lazyLoad() {
if (getArguments()!=null){
cityCid=getArguments().getString(WeatherUtil.cid);
}
initWeathert();
}
private void initWeathert() {
SharedPreferences sharedPreferences = PreferenceManager
.getDefaultSharedPreferences(BaseApplication.getIns());
String cityId=this.cityCid;
String weatherVoString = sharedPreferences.getString(cityId, "");
if (TextUtils.isEmpty(weatherVoString)) {
//刚进来如果没有城市信息则去定位获取当前位置坐标
showLocationBefore();
} else {
WeatherVoToGson(weatherVoString);
}
String picUrl = sharedPreferences.getString(WeatherUtil.picUrl, "");
if (TextUtils.isEmpty(picUrl)) {
getPicImage();
} else {
showPicImage(picUrl);
}
}
private void WeatherVoToGson(String weatherVoString) {
WeatherVo weatherVo = BaseApplication.getGson().fromJson(weatherVoString, WeatherVo.class);
context.isLocationValue=true;
long time= DateUtil.timeSub(weatherVo.getUpdateTime(),DateUtil.getNow());
if (time>= WeatherUtil.weatherUpdateTimeInterval){
showTimeOutBefore();
requestWeather(weatherVo.getBasic().getCid(),weatherVo.getCityType());
}else {
showText(weatherVo);
}
}
private void showLocationBefore() {
// context.isLocationValue=false;
// context.tv_title.setText("正在获取当前所在城市");
// context.swipeRefres.setRefreshing(true);
tv_Celsius.setText("暂无数据");
tv_situation.setText("暂无数据");
}
private void showTimeOutBefore() {
context.swipeRefres.setRefreshing(true);
context.tv_title.setText("数据已过期正在更新");
}
private void showPicImage(String picUrl) {
Glide.with(context).load(picUrl).into(context.im_pic);
}
public Observable getWeatherObservable(String cityCid, final int cityType){
return Observable.just(cityCid)
.subscribeOn(Schedulers.io())
.flatMap(new Function<String, ObservableSource<WeatherVo>>() {
@Override
public ObservableSource<WeatherVo> apply(String weatherCode) throws Exception {
return getZip(
getobservableNow(weatherCode,cityType),
getobservableAirNow(weatherCode),
cityType
);
}
});
}
public void requestWeather(String cityCid, final int cityType) {
getWeatherObservable(cityCid,cityType)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new DlObserve<WeatherVo>() {
@Override
public void onResponse(WeatherVo weatherVo) throws IOException {
showText(weatherVo);
context.swipeRefres.setRefreshing(false);
Toast.makeText(context, weatherVo.getStatus(), Toast.LENGTH_LONG).show();
}
@Override
public void onError(int errorCode, String errorMsg) {
Toast.makeText(context, errorMsg, Toast.LENGTH_LONG).show();
context.swipeRefres.setRefreshing(false);
}
});
}
private Observable getZip(Observable observableNow, Observable observableAirNow, final int cityType){
return Observable.zip(observableNow, observableAirNow, new BiFunction<WeatherVo,AirNow,WeatherVo>() {
@Override
public WeatherVo apply(WeatherVo weatherVo, AirNow airNow) throws Exception {
weatherVo.setAirNow(airNow);
SharedPreferences.Editor editor = PreferenceManager
.getDefaultSharedPreferences(BaseApplication.getIns()).edit();
editor.putString(weatherVo.getBasic().getCid(), BaseApplication.getGson().toJson(weatherVo));
editor.apply();
//保存城市信息
CityVo cityVo = new CityVo();
cityVo.setCid(weatherVo.getBasic().getCid());
cityVo.setLocation(weatherVo.getBasic().getLocation());
cityVo.setAdmin_area(weatherVo.getBasic().getAdmin_area());
cityVo.setCnty(weatherVo.getBasic().getCnty());
cityVo.setLat(weatherVo.getBasic().getLat());
cityVo.setLon(weatherVo.getBasic().getLon());
cityVo.setParent_city(weatherVo.getBasic().getParent_city());
cityVo.setTz(weatherVo.getBasic().getTz());
cityVo.setAddCityTime(DateUtil.getNow());
cityVo.setCityType(cityType);
List<CityVo> cityVoList = BaseApplication.getIns().getDaoSession().getCityVoDao()
.queryBuilder().where(CityVoDao.Properties.Cid.eq(cityVo.getCid())).list();
if (cityVoList.size() == 0) {
BaseApplication.getIns().getDaoSession().getCityVoDao().insertOrReplace(cityVo);
Map<String, Object> parMap = new HashMap<>();
parMap.put(WeatherUtil.add_action, cityVo);
//数据插入成功发送
EventBus.getDefault().post(parMap);
}
return weatherVo;
}
});
}
private Observable getobservableNow(String weatherId, final int cityType){
return NetManager.INSTANCE.getShopClient()
.getWeatherNow(Keys.key, weatherId)
.map(new Function<Response<ResponseBody>, WeatherVo>() {
@Override
public WeatherVo apply(Response<ResponseBody> response) throws Exception {
return ResponseToWeatherVo(response,cityType);
}
});
}
private Observable getobservableAirNow(String weatherId){
return NetManager.INSTANCE.getShopClient()
.getAirNow(Keys.key, weatherId)
.map(new Function<Response<ResponseBody>, AirNow>() {
@Override
public AirNow apply(Response<ResponseBody> response) throws Exception {
AirNow airNow=ResponseToAirNow(response);
return airNow;
}
});
}
public void getPicImage() {
NetManager.INSTANCE.getShopClient()
.getPicUrl()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new DlObserve<Response<ResponseBody>>() {
@Override
public void onResponse(Response<ResponseBody> s) throws IOException {
if (s.code() == 200) {
String picUrl = s.body().string();
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences
(BaseApplication.getIns()).edit();
editor.putString(WeatherUtil.picUrl, picUrl);
editor.apply();
showPicImage(picUrl);
}
}
@Override
public void onError(int errorCode, String errorMsg) {
Toast.makeText(context, errorMsg, Toast.LENGTH_LONG).show();
}
});
}
private void showText(WeatherVo weatherVo) {
if (weatherVo == null)
return;
// context.newWeatherVo=weatherVo;
List<WeatherVo.LifestyleBean> lifestyleVos = weatherVo.getLifestyle();
List<WeatherVo.DailyForecastBean> weatherForecasts = weatherVo.getDaily_forecast();
AirNow airNow = weatherVo.getAirNow();
WeatherVo.NowBean now = weatherVo.getNow();
if (lifestyleVos == null)
return;
suggestion_linearlayout.removeAllViews();
for (WeatherVo.LifestyleBean lifestyleBase : lifestyleVos) {
View view = getLayoutInflater().inflate(R.layout.item_suggestion_text, suggestion_linearlayout, false);
TextView item_suggestion_text_tv = view.findViewById(R.id.item_suggestion_text_tv);
String text = "";
switch (lifestyleBase.getType()){
case WeatherUtil.comf:
text="舒适度指数";
break;
case WeatherUtil.cw:
text="洗车指数";
break;
case WeatherUtil.drsg:
text="穿衣指数";
break;
case WeatherUtil.flu:
text="感冒指数";
break;
case WeatherUtil.sport:
text="运动指数";
break;
case WeatherUtil.trav:
text="旅游指数";
break;
case WeatherUtil.uv:
text="紫外线指数";
break;
case WeatherUtil.air:
text="空气污染扩散条件指数";
break;
default:
break;
}
if (lifestyleVos.indexOf(lifestyleBase)==lifestyleVos.size()){
text+=":"+lifestyleBase.getBrf() + " " + lifestyleBase.getTxt();
}else {
text+=":"+lifestyleBase.getBrf() + " " + lifestyleBase.getTxt()+"\n";
}
item_suggestion_text_tv.setText(text);
suggestion_linearlayout.addView(item_suggestion_text_tv);
}
if (weatherForecasts == null)
return;
day_linelayout.removeAllViews();
for (WeatherVo.DailyForecastBean forecastBase : weatherForecasts) {
View view = getLayoutInflater().inflate(R.layout.item_day_text, day_linelayout, false);
TextView tv_date = view.findViewById(R.id.tv_date);
TextView tv_two = view.findViewById(R.id.tv_two);
TextView tv_max = view.findViewById(R.id.tv_max);
TextView tv_min = view.findViewById(R.id.tv_min);
tv_date.setText(forecastBase.getDate());
tv_two.setText(forecastBase.getCond_txt_d());
tv_max.setText(forecastBase.getTmp_max());
tv_min.setText(forecastBase.getTmp_min());
day_linelayout.addView(view);
}
aqi_text.setText(TextUtils.isEmpty(airNow.getAqi())?"暂无数据":airNow.getAqi());
pm25_text.setText(TextUtils.isEmpty(airNow.getPm25())?"暂无数据":airNow.getPm25());
if (now != null) {
tv_Celsius.setText(now.getFl() + "℃");
tv_situation.setText(now.getCond_txt());
}
context.tv_title.setText(weatherVo.getBasic().getLocation());
String timeStr=weatherVo.getUpdate().getLoc().split(" ")[1];
context.tv_time.setText(timeStr);
//设置24小时天气数据
List<WeatherVo.HourlyBean> hourlyBeanList= weatherVo.getHourly();
intiLineChartView(hourlyBeanList);
}
private WeatherVo ResponseToWeatherVo(Response<ResponseBody> response,int cityType) throws IOException, JSONException {
if (response.code() != 200 ) {
return new WeatherVo();
}
String body = response.body().string();
JSONObject jsonObject = new JSONObject(body);
JSONArray jsonArray = jsonObject.getJSONArray(WeatherUtil.HeWeather6);
JSONObject weatherObject = jsonArray.getJSONObject(0);
String status=weatherObject.getString(WeatherUtil.status);
if (status.equals(WeatherUtil.ok)){
WeatherVo weatherVo = BaseApplication.getGson().fromJson(weatherObject.toString(), WeatherVo.class);
weatherVo.setUpdateTime(DateUtil.getNow());
weatherVo.setCityType(cityType);
return weatherVo;
}
return new WeatherVo();
}
private AirNow ResponseToAirNow(Response<ResponseBody> response) throws IOException, JSONException {
if (response.code() != 200 ) {
return new AirNow();
}
String body = response.body().string();
JSONObject jsonObject = new JSONObject(body);
JSONArray jsonArray = jsonObject.getJSONArray(WeatherUtil.HeWeather6);
JSONObject weatherObject = jsonArray.getJSONObject(0);
String status=weatherObject.getString(WeatherUtil.status);
if (status.equals(WeatherUtil.ok)){
AirNow airNow = BaseApplication.getGson().fromJson(weatherObject.getJSONObject(WeatherUtil.air_now_city).toString(), AirNow.class);
return airNow;
}
return new AirNow();
}
@Override
public boolean excueOnKeyDown(int keyCode, KeyEvent event) {
return false;
}
}
| [
"laihouyou163@163.com"
] | laihouyou163@163.com |
4ab783bac04f13972d8bbcf9363630010ea69abd | 2ea1f9fa18a799eeef9b81fcd3c0f8951b2aacb5 | /src/stochasticSimulation/SpecialZone.java | 2bc727f032527839d22c6f2c720475e40c68bdeb | [] | no_license | m-serra/rEvolutionary | 3ef30564f88c6ec57b389f5a757aaf3f06dc002f | 8c8f29f60d7b6380b9922afcf892713c52119726 | refs/heads/master | 2020-03-17T01:26:21.617984 | 2018-05-12T16:01:06 | 2018-05-12T16:01:06 | 133,152,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package stochasticSimulation;
/**
* The class special zone defines special cost zones within a Grid.
* Special cost zones have higher cost of movement than normal zones.
* The zone is defined by the initial and final point of a square.
* @author ManuelSerraNunes
*
*/
class SpecialZone {
/**
* The cost of the special cost zone.
*/
protected int cost;
/**
* The initial point of the square that forms the special cost zone.
*/
protected Point pInitial;
/**
* The final point of the square that forms the special cost zone.
*/
protected Point pFinal;
/**
* Constructor for SpecialCost zones.
* @param cost the cost of the zone
* @param i the initial point of the square that forms the special cost zone.
* @param f the final point of the square that forms the special cost zone.
*/
SpecialZone(int cost, Point i, Point f){
this.cost = cost;
pInitial = i;
pFinal = f;
}
/**
* Setter for the the cost
* @param cost the cost to be set.
*/
protected void setCost(int cost){
this.cost = cost;
}
/**
* Redefinition of the toString method to retrieve all the fields of the zone.
*/
@Override
public String toString() {
return "cost: " + cost + "; Initial: " + pInitial + "; Final: " + pFinal;
}
}
| [
"manuelserranunes@gmail.com"
] | manuelserranunes@gmail.com |
77fc323ffc1acdf4bd9cb9d145aadccd92d12fdd | 84e88d9818116ec1f44f4e9352415d4575236208 | /src/creational/abstractfactory/ComputerAbstractFactory.java | 800275ab30d4db32687adfdca8017a22273aa6f8 | [] | no_license | kurtke1990/DesignPatterns | a96cbf5842b14e5f2404e29ea4fce98db5372526 | 68d4ee2c73a90ea48546ef599c7011bb33d9f52a | refs/heads/main | 2023-02-25T00:22:32.331010 | 2021-02-01T06:14:51 | 2021-02-01T06:14:51 | 334,109,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package creational.abstractfactory;
public interface ComputerAbstractFactory {
Computer createComputer(ComputerSpec spec);
}
| [
"kurtke1990@gmail.com"
] | kurtke1990@gmail.com |
afa139f9de6cd7214a5a74ec302038061cf81e78 | 7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b | /Crawler/data/MyFunctionalInterface.java | 2575330d8bc04a8eaea1170a5dcb7c94bd7c6664 | [] | no_license | NayrozD/DD2476-Project | b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0 | 94dfb3c0a470527b069e2e0fd9ee375787ee5532 | refs/heads/master | 2023-03-18T04:04:59.111664 | 2021-03-10T15:03:07 | 2021-03-10T15:03:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | 2
https://raw.githubusercontent.com/liuminchao123/JavaWeb_Learning/master/02.%20java/Java/%E9%BB%91%E9%A9%AC%E6%95%99%E7%A8%8B/23.%E3%80%90%E5%87%BD%E6%95%B0%E5%BC%8F%E6%8E%A5%E5%8F%A3%E3%80%91-%E7%AC%94%E8%AE%B0/code/12_FunctionalInterface/src/com/itheima/demo01/FunctionalInterface/MyFunctionalInterface.java
package com.itheima.demo01.FunctionalInterface;
/*
函数式接口:有且只有一个抽象方法的接口,称之为函数式接口
当然接口中可以包含其他的方法(默认,静态,私有)
@FunctionalInterface注解
作用:可以检测接口是否是一个函数式接口
是:编译成功
否:编译失败(接口中没有抽象方法抽象方法的个数多余1个)
*/
@FunctionalInterface
public interface MyFunctionalInterface {
//定义一个抽象方法
public abstract void method();
}
| [
"veronika.cucorova@gmail.com"
] | veronika.cucorova@gmail.com |
e269394989f0a7191ed37c0c72d1c7da50ace38c | 94ebed63ba7cab2f6b3d3bcb007eac26e78a82f1 | /src/test/java/com/central/varth/resp/RespSerializerTest.java | 892fc5dde3284eaad732f62c30443b9da9f705fe | [
"Apache-2.0"
] | permissive | faisaladnan/varth | ccce82df6042dd310f243b530c39da856caa15c2 | 5f0202bb9fa1554ab26746e80d0d5f4ddc0668b5 | refs/heads/master | 2021-01-01T19:42:08.915243 | 2014-06-15T01:45:06 | 2014-06-15T01:45:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,012 | java | /**
*
* Copyright 2014 Central Software
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.central.varth.resp;
import org.junit.Assert;
import org.junit.Test;
public class RespSerializerTest {
@Test
public void pingCommand()
{
String command = "PING";
String expCommand = "*1\r\n$4\r\nPING\r\n";
RespSerializer serializer = new RespSerializer();
String cmdz = serializer.serialize(command);
System.err.println(cmdz);
Assert.assertEquals(expCommand, cmdz);
}
}
| [
"faisal.adnan@gmail.com"
] | faisal.adnan@gmail.com |
fec987542b580400fc6866c2b4287d83d295cd80 | 0e0dae718251c31cbe9181ccabf01d2b791bc2c2 | /SCT2/tags/Before_Expression_refactoring/plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphAdapterFactory.java | 2b474ba33161bb11715dc6fc04ae4e7e9b327351 | [] | no_license | huybuidac20593/yakindu | 377fb9100d7db6f4bb33a3caa78776c4a4b03773 | 304fb02b9c166f340f521f5e4c41d970268f28e9 | refs/heads/master | 2021-05-29T14:46:43.225721 | 2015-05-28T11:54:07 | 2015-05-28T11:54:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,890 | java | /**
* Copyright (c) 2011 committers of YAKINDU and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Contributors:
* committers of YAKINDU - initial API and implementation
*
*/
package org.yakindu.sct.model.sgraph.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
import org.yakindu.base.base.DocumentedElement;
import org.yakindu.base.base.NamedElement;
import org.yakindu.sct.model.sgraph.*;
import org.yakindu.sct.model.sgraph.Choice;
import org.yakindu.sct.model.sgraph.CompositeElement;
import org.yakindu.sct.model.sgraph.Declaration;
import org.yakindu.sct.model.sgraph.Effect;
import org.yakindu.sct.model.sgraph.Entry;
import org.yakindu.sct.model.sgraph.Event;
import org.yakindu.sct.model.sgraph.Exit;
import org.yakindu.sct.model.sgraph.FinalState;
import org.yakindu.sct.model.sgraph.Pseudostate;
import org.yakindu.sct.model.sgraph.Reaction;
import org.yakindu.sct.model.sgraph.ReactiveElement;
import org.yakindu.sct.model.sgraph.Region;
import org.yakindu.sct.model.sgraph.RegularState;
import org.yakindu.sct.model.sgraph.SGraphPackage;
import org.yakindu.sct.model.sgraph.Scope;
import org.yakindu.sct.model.sgraph.ScopedElement;
import org.yakindu.sct.model.sgraph.SpecificationElement;
import org.yakindu.sct.model.sgraph.State;
import org.yakindu.sct.model.sgraph.Statechart;
import org.yakindu.sct.model.sgraph.Statement;
import org.yakindu.sct.model.sgraph.Synchronization;
import org.yakindu.sct.model.sgraph.Transition;
import org.yakindu.sct.model.sgraph.Trigger;
import org.yakindu.sct.model.sgraph.Variable;
import org.yakindu.sct.model.sgraph.Vertex;
/**
* <!-- begin-user-doc -->
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
* @see org.yakindu.sct.model.sgraph.SGraphPackage
* @generated
*/
public class SGraphAdapterFactory extends AdapterFactoryImpl {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SGraphPackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SGraphAdapterFactory() {
if (modelPackage == null) {
modelPackage = SGraphPackage.eINSTANCE;
}
}
/**
* Returns whether this factory is applicable for the type of the object.
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@Override
public boolean isFactoryForType(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SGraphSwitch<Adapter> modelSwitch =
new SGraphSwitch<Adapter>() {
@Override
public Adapter casePseudostate(Pseudostate object) {
return createPseudostateAdapter();
}
@Override
public Adapter caseVertex(Vertex object) {
return createVertexAdapter();
}
@Override
public Adapter caseRegion(Region object) {
return createRegionAdapter();
}
@Override
public Adapter caseTransition(Transition object) {
return createTransitionAdapter();
}
@Override
public Adapter caseFinalState(FinalState object) {
return createFinalStateAdapter();
}
@Override
public Adapter caseVariable(Variable object) {
return createVariableAdapter();
}
@Override
public Adapter caseEvent(Event object) {
return createEventAdapter();
}
@Override
public Adapter caseChoice(Choice object) {
return createChoiceAdapter();
}
@Override
public Adapter caseStatechart(Statechart object) {
return createStatechartAdapter();
}
@Override
public Adapter caseEntry(Entry object) {
return createEntryAdapter();
}
@Override
public Adapter caseExit(Exit object) {
return createExitAdapter();
}
@Override
public Adapter caseReactiveElement(ReactiveElement object) {
return createReactiveElementAdapter();
}
@Override
public Adapter caseReaction(Reaction object) {
return createReactionAdapter();
}
@Override
public Adapter caseTrigger(Trigger object) {
return createTriggerAdapter();
}
@Override
public Adapter caseEffect(Effect object) {
return createEffectAdapter();
}
@Override
public Adapter caseReactionProperty(ReactionProperty object) {
return createReactionPropertyAdapter();
}
@Override
public Adapter caseSpecificationElement(SpecificationElement object) {
return createSpecificationElementAdapter();
}
@Override
public Adapter caseDeclaration(Declaration object) {
return createDeclarationAdapter();
}
@Override
public Adapter caseScope(Scope object) {
return createScopeAdapter();
}
@Override
public Adapter caseScopedElement(ScopedElement object) {
return createScopedElementAdapter();
}
@Override
public Adapter caseSynchronization(Synchronization object) {
return createSynchronizationAdapter();
}
@Override
public Adapter caseState(State object) {
return createStateAdapter();
}
@Override
public Adapter caseStatement(Statement object) {
return createStatementAdapter();
}
@Override
public Adapter caseRegularState(RegularState object) {
return createRegularStateAdapter();
}
@Override
public Adapter caseCompositeElement(CompositeElement object) {
return createCompositeElementAdapter();
}
@Override
public Adapter caseNamedElement(NamedElement object) {
return createNamedElementAdapter();
}
@Override
public Adapter caseDocumentedElement(DocumentedElement object) {
return createDocumentedElementAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
return modelSwitch.doSwitch((EObject)target);
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Pseudostate <em>Pseudostate</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Pseudostate
* @generated
*/
public Adapter createPseudostateAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Vertex <em>Vertex</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Vertex
* @generated
*/
public Adapter createVertexAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.base.base.NamedElement <em>Named Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.base.base.NamedElement
* @generated
*/
public Adapter createNamedElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.base.base.DocumentedElement <em>Documented Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.base.base.DocumentedElement
* @generated
*/
public Adapter createDocumentedElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Region <em>Region</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Region
* @generated
*/
public Adapter createRegionAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Transition <em>Transition</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Transition
* @generated
*/
public Adapter createTransitionAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.FinalState <em>Final State</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.FinalState
* @generated
*/
public Adapter createFinalStateAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.State <em>State</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.State
* @generated
*/
public Adapter createStateAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Statement <em>Statement</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Statement
* @generated
*/
public Adapter createStatementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.RegularState <em>Regular State</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.RegularState
* @generated
*/
public Adapter createRegularStateAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.CompositeElement <em>Composite Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.CompositeElement
* @generated
*/
public Adapter createCompositeElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Variable <em>Variable</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Variable
* @generated
*/
public Adapter createVariableAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Event <em>Event</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Event
* @generated
*/
public Adapter createEventAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Choice <em>Choice</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Choice
* @generated
*/
public Adapter createChoiceAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Statechart <em>Statechart</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Statechart
* @generated
*/
public Adapter createStatechartAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Entry <em>Entry</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Entry
* @generated
*/
public Adapter createEntryAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Trigger <em>Trigger</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Trigger
* @generated
*/
public Adapter createTriggerAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Effect <em>Effect</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Effect
* @generated
*/
public Adapter createEffectAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.ReactionProperty <em>Reaction Property</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.ReactionProperty
* @generated
*/
public Adapter createReactionPropertyAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.SpecificationElement <em>Specification Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.SpecificationElement
* @generated
*/
public Adapter createSpecificationElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Declaration <em>Declaration</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Declaration
* @generated
*/
public Adapter createDeclarationAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Reaction <em>Reaction</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Reaction
* @generated
*/
public Adapter createReactionAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.ReactiveElement <em>Reactive Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.ReactiveElement
* @generated
*/
public Adapter createReactiveElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Exit <em>Exit</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Exit
* @generated
*/
public Adapter createExitAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Scope <em>Scope</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Scope
* @generated
*/
public Adapter createScopeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.ScopedElement <em>Scoped Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.ScopedElement
* @generated
*/
public Adapter createScopedElementAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.Synchronization <em>Synchronization</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.sct.model.sgraph.Synchronization
* @generated
*/
public Adapter createSynchronizationAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter() {
return null;
}
} //SGraphAdapterFactory
| [
"A.Muelder@gmail.com"
] | A.Muelder@gmail.com |
a181e7c88097b439e3e6148bd326254a28b4e3c1 | db6e901331155b96a42f641332ee34c730433a15 | /src/main/java/pl/mg/checkers/message/msgs/ChangeNicknameMessage.java | 736f327c8a0f4b4afcaa4542b4b6ea2cb1fd636b | [] | no_license | mgrzeszczak/checkers-client | e26e44bfb230991c80a549f8902b5b14a0660475 | fe9293f60fcc1908952a7dd24ec4086bd6fe738d | refs/heads/master | 2021-01-18T04:36:55.160658 | 2016-02-10T22:33:19 | 2016-02-10T22:33:19 | 48,804,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package pl.mg.checkers.message.msgs;
import pl.mg.checkers.message.Message;
/**
* Created by maciej on 25.12.15.
*/
public class ChangeNicknameMessage extends Message {
private String newNickname;
public ChangeNicknameMessage(String newNickname) {
this.newNickname = newNickname;
}
public ChangeNicknameMessage() {
}
public String getNewNickname() {
return newNickname;
}
public void setNewNickname(String newNickname) {
this.newNickname = newNickname;
}
}
| [
"maciejgrzeszczak@gmail.com"
] | maciejgrzeszczak@gmail.com |
cc19dfd6f8190f4026239efc6f173d66ca7b3356 | 1b996fd16eb93c63341a9de377bfeb5cfae4d21e | /src/leetcodeProblems/medium/ZigzagTraversal103.java | 4a3cb01013c272473b2442bb08eb36dbf1584050 | [] | no_license | nikhilagrwl07/Leetcode-Java-Solutions | 8d5fd3a28afdf27b51c1e638cbe0283967f73224 | 28d97dd96d3faa93d6cac975518c08143be53ebe | refs/heads/master | 2021-06-15T06:08:04.860423 | 2021-05-03T15:20:53 | 2021-05-03T15:20:53 | 192,016,779 | 1 | 1 | null | 2021-04-19T13:26:06 | 2019-06-14T23:39:53 | Java | UTF-8 | Java | false | false | 2,406 | java | package leetcodeProblems.medium;
import java.util.*;
public class ZigzagTraversal103 {
public static void main(String[] args) {
ZigzagTraversal103 ob = new ZigzagTraversal103();
TreeNode treeNode = ob.buildTree();
List<List<Integer>> lists = ob.zigzagLevelOrder(treeNode);
System.out.println(lists);
}
private TreeNode buildTree() {
TreeNode root = new TreeNode(3);
TreeNode nine = new TreeNode(9);
TreeNode tweenty = new TreeNode(20);
TreeNode fifteen = new TreeNode(15);
TreeNode seven = new TreeNode(7);
root.left = nine;
root.right = tweenty;
tweenty.left = fifteen;
tweenty.right = seven;
return root;
}
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {
if (root == null)
return new ArrayList<>();
List<List<Integer>> result = new ArrayList<>();
Queue<TreeNode> q = new LinkedList<>();
q.add(root);
q.add(null);
boolean flip = false;
LinkedList<Integer> levelNode = new LinkedList<>();
Stack<Integer> stack = new Stack<>();
while (!q.isEmpty()) {
TreeNode poll = q.poll();
// System.out.println(poll);
if (poll == null) {
if (flip) {
List<Integer> tmp = new ArrayList<>();
while (!stack.isEmpty()){
tmp.add(stack.pop());
}
result.add(tmp);
stack.clear();
} else {
result.add(new ArrayList<>(levelNode));
levelNode.clear();
}
flip = !flip;
if (q.peek() == null)
break;
q.add(null);
} else {
if (flip) {
stack.push(poll.val);
} else {
levelNode.add(poll.val);
}
if (poll.left != null)
q.offer(poll.left);
if (poll.right != null)
q.offer(poll.right);
}
}
return result;
}
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int val) {
this.val = val;
}
}
}
| [
"nikhil.agrwl07@gmail.com"
] | nikhil.agrwl07@gmail.com |
2cf3d4d8462547a992ff55caf91c8c7c97fe867d | 099fc90a03f2e396a447dc5f36d4db1fe3676bce | /core/src/main/java/hivemall/utils/collections/arrays/FloatArray.java | b72bdef37d8d4170ce6be7d9359a2e03b2b0c505 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-public-domain",
"OFL-1.1",
"SunPro",
"MIT"
] | permissive | apache/incubator-hivemall | 7f4cc9490a8367ad1add2535f969436eec34fc31 | 34079778a96495ba428940a866b4a08af9f45088 | refs/heads/master | 2023-08-31T08:34:46.336464 | 2022-09-06T15:55:16 | 2022-09-06T15:55:16 | 68,273,151 | 322 | 213 | Apache-2.0 | 2023-04-23T15:03:20 | 2016-09-15T07:00:08 | Java | UTF-8 | Java | false | false | 1,288 | 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 hivemall.utils.collections.arrays;
import java.io.Serializable;
import javax.annotation.Nonnull;
public interface FloatArray extends Serializable {
public float get(int key);
public float get(int key, float valueIfKeyNotFound);
public void put(int key, float value);
public int size();
public int keyAt(int index);
@Nonnull
public float[] toArray();
@Nonnull
public float[] toArray(boolean copy);
public void clear();
}
| [
"yuin405@gmail.com"
] | yuin405@gmail.com |
59ec5c6008a334a9508b976d87debb2e252eb359 | b2bfc22d850ddecee37ab55422a5b0041acdccb0 | /src/main/java/by/undrul/shapestask/factory/impl/PointFactoryImpl.java | 86d90b15b8f305f03447c5f9abfa1e61a0e5c63d | [] | no_license | antonundrul/shapesTask | 044e9dc66dadb04908cdc5fe888c7ef8ee8b5213 | 857a6c104a32734924a6380fd7b7e46284b87a15 | refs/heads/master | 2023-04-12T09:57:00.228532 | 2021-05-04T09:51:45 | 2021-05-04T09:51:45 | 361,407,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package by.undrul.shapestask.factory.impl;
import by.undrul.shapestask.entity.Point;
import by.undrul.shapestask.factory.PointFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class PointFactoryImpl implements PointFactory {
private static Logger logger = LogManager.getLogger();
public PointFactoryImpl() {
}
@Override
public Point createPoint(double x, double y, double z) {
logger.info("Method to create point start");
Point point = new Point(x, y, z);
logger.info("Point created");
return point;
}
}
| [
"antonundrul@gmail.com"
] | antonundrul@gmail.com |
95c26848834f6ad309f56a59cf9333af017bc244 | 0d3a782e3e5989cd1d5263a6dc93d9e8d867d631 | /pay-web/src/main/java/com/github/dzhai/pay/dubbo/service/impl/PayDubboServiceImpl.java | 8d6e845408b928b6140a3ab3d79c01552cf3a0d7 | [] | no_license | dzhai/pay-module-demo | 277f8194bff13378da76b06ddab1d53ecdc39966 | 85e2e8988d8e5762c0b40741d4187f2d869cbb70 | refs/heads/master | 2021-01-01T03:56:14.870741 | 2016-05-22T09:16:19 | 2016-05-22T09:16:19 | 58,993,842 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,172 | java | package com.github.dzhai.pay.dubbo.service.impl;
import com.github.dzhai.pay.common.PayMethod;
import com.github.dzhai.pay.dto.PaymentData;
import com.github.dzhai.pay.dto.PaymentResultData;
import com.github.dzhai.pay.dto.RefundData;
import com.github.dzhai.pay.dto.RefundResultData;
import com.github.dzhai.pay.payment.service.IPaymentService;
import com.github.dzhai.pay.payment.utils.PaymentUtils;
import com.github.dzhai.pay.service.IPayDubboService;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PayDubboServiceImpl implements IPayDubboService {
@Override
public PaymentResultData paycreate(PaymentData data) {
log.info("----");
Integer paymethod=data.getPayMehtod();
Integer payClientType=data.getPayClientType();
if(paymethod==null){ //如何paymethod是NULL,直接设置paymethod是unionpay 银联
paymethod= PayMethod.UNIONPAY.getId();
}
IPaymentService paymentService=PaymentUtils.getPaymentService(paymethod, payClientType);
PaymentResultData resultData=paymentService.paycreate();
return resultData;
}
@Override
public RefundResultData refund(RefundData data) {
// TODO Auto-generated method stub
return null;
}
}
| [
"347112281@qq.com"
] | 347112281@qq.com |
665c5437ba8cd0e785b6abe6e940404940920783 | 3966a29da262fa26e9434d602dd8dc113db7036b | /src/main/java/com/modria/questionaire/model/Answer.java | 24bf3c45796f46ac17de79e585f5b6fa5966dc1d | [] | no_license | jayka/dyanmic-questionaire | 81b22f5f3d09d04f64f253065bef9f9a0efba987 | 05a5397e9c6002622278eee55372bec84569fdc1 | refs/heads/master | 2020-05-20T09:22:53.608391 | 2013-12-11T11:47:49 | 2013-12-11T11:47:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package com.modria.questionaire.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="answer")
public class Answer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
int rowid;
int masterId;
int id;
String value;
public int getRowid() {
return rowid;
}
public void setRowid(int rowid) {
this.rowid = rowid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public int getMasterId() {
return masterId;
}
public void setMasterId(int masterId) {
this.masterId = masterId;
}
}
| [
"ajaykaarthick@yahoo.com"
] | ajaykaarthick@yahoo.com |
58460814e54aa211129d50bb918123aa7a32651d | 1be3c58802588e168d02fd40600c996699abaed4 | /test/plugin/scenarios/jedis-scenario/src/main/java/org/apache/skywalking/apm/testcase/jedis/controller/CaseController.java | e38b2b2a311bd6279e6072616e66de6d747d3c91 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | zhentaoJin/skywalking | e73a4dd612e01d93981345444a462c47096d6ab5 | dbce5f5cce2cd8ed26ce6d662f2bd6d5a0886bc1 | refs/heads/master | 2021-04-09T23:40:19.407603 | 2020-11-05T15:13:29 | 2020-11-05T15:13:29 | 305,288,772 | 6 | 0 | Apache-2.0 | 2020-10-19T06:48:38 | 2020-10-19T06:48:38 | null | UTF-8 | Java | false | false | 1,952 | 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.skywalking.apm.testcase.jedis.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/case")
public class CaseController {
private static final String SUCCESS = "Success";
@Value("${redis.host:127.0.0.1}")
private String redisHost;
@Value("${redis.port:6379}")
private Integer redisPort;
@RequestMapping("/jedis-scenario")
@ResponseBody
public String testcase() throws Exception {
try (RedisCommandExecutor command = new RedisCommandExecutor(redisHost, redisPort)) {
command.set("a", "a");
command.get("a");
command.del("a");
}
return SUCCESS;
}
@RequestMapping("/healthCheck")
@ResponseBody
public String healthCheck() throws Exception {
try (RedisCommandExecutor command = new RedisCommandExecutor(redisHost, redisPort)) {
}
return SUCCESS;
}
}
| [
"wu.sheng@foxmail.com"
] | wu.sheng@foxmail.com |
2e58590561fcaf665f33dc2ff34ce60d810b2403 | 81c7a4aef7cb02ec642843750d99278520addace | /oral_exam2/S5_Scoreboard_Hard/src/Period.java | 18f544a7d6182b3a30080f465d648a8b97098746 | [] | no_license | konnor-s/swd | 7ecf4cad45bff37bce8fe6ab18595b21b0bfeaaa | bca5d84483251fc4f3ef7991d21c3e2f8d336f96 | refs/heads/master | 2023-02-20T06:14:21.087603 | 2020-12-01T16:54:35 | 2020-12-01T16:54:35 | 331,702,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,521 | java | /**
* Defines characteristics of a game period.
* @author Konnor Sommer
*/
public class Period {
/**
* Current period
*/
private int period;
/**
* Length of period in minutes
*/
private final int length;
/**
* Name of period.
*/
private final String name;
/**
* Number of periods
*/
private final int numPeriods;
/**
* Constructs the type of period for this game
* @param period current period
* @param length length in minutes
* @param name name of period
* @param numPeriods number of periods in a game
*/
Period(int period,int length,String name,int numPeriods){
this.period = period;
this.length = length;
this.name = name;
this.numPeriods = numPeriods;
}
/**
* Sets the current period
* @param p current period
*/
public void setPeriod(int p){
period = p;
}
/**
* Returns the current period.
* @return current period
*/
public int getPeriod(){
return period;
}
/**
* Returns the length of a period.
* @return length of period
*/
public int getLength(){
return length;
}
/**
* Returns the name of a period.
* @return name of period
*/
public String getName(){
return name;
}
/**
* Return number of periods
* @return number of periods
*/
public int getNumPeriods(){
return numPeriods;
}
}
| [
"kksommer@uiowa.edu"
] | kksommer@uiowa.edu |
5bc6a2fae71ef20f012c34d264e8a36e00824cb9 | 751dca6f553fd22dec40fae52a0490a57985743a | /app/src/test/java/com/johnstrack/odometer/ExampleUnitTest.java | 7beb53bd96e29b8dac603cbaa51641dde26d8b60 | [] | no_license | Braveheart22/Odometer | 6e92be94b2b61bdfbc249861c3da8efccfc8229c | 5f62880ba5e1611ed0757accf55c7aea421f6c4d | refs/heads/master | 2020-03-09T13:15:50.150644 | 2018-04-09T21:34:20 | 2018-04-09T21:34:20 | 128,806,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package com.johnstrack.odometer;
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);
}
} | [
"Braveheart22@GMail.com"
] | Braveheart22@GMail.com |
38e60658e0526977af2289eba4a62e4ff0ac76db | 20e345bea2b7f9662fff2fdd579a40f8397f5710 | /SpringBootIn28Minutes/src/main/java/com/boa/SpringBootIn28Minutes/exception/CustomisedExceptionHandler.java | fcafd93761258c48655451808d79c983510ac66c | [] | no_license | vipin17rathore/vipin_sts_local_repo | 527e8546043e31814e50de3cdd8e63be1c054e3e | 8d17f4d9d00c021009b841eec4fcd78878ff66aa | refs/heads/master | 2023-05-04T18:33:07.973345 | 2021-05-28T10:47:58 | 2021-05-28T10:47:58 | 254,809,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,617 | java | package com.boa.SpringBootIn28Minutes.exception;
import java.util.Date;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
@ControllerAdvice
@RestController
public class CustomisedExceptionHandler extends ResponseEntityExceptionHandler {
@ExceptionHandler(Exception.class)
public final ResponseEntity<ExceptionResponse> handleAllException(Exception ex , WebRequest webreq){
ExceptionResponse response = new ExceptionResponse();
response.setMessage(ex.getMessage());
response.setDate(new Date());
response.setDetails(webreq.getDescription(false));
return new ResponseEntity<ExceptionResponse>(response,HttpStatus.INTERNAL_SERVER_ERROR);
}
@Override
protected ResponseEntity<Object> handleMethodArgumentNotValid(
MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) {
ExceptionResponse response = new ExceptionResponse();
response.setMessage(ex.getMessage());
response.setDate(new Date());
response.setDetails(ex.getBindingResult().toString());
return new ResponseEntity<Object>(response,HttpStatus.BAD_REQUEST);
}
}
| [
"vicky17rathore@gmail.com"
] | vicky17rathore@gmail.com |
2a95094941782b2cb21fe814f36796fe767920fa | d82c200e270aced2b790e6aa389043aa28238aaa | /src/sample/Winner.java | b5638876cf95b18031d51dd1b6b16bb81cd8a224 | [] | no_license | pszczepcio/TicTacToe | 311c9a33300f8d1ad6c5529689571c94a1b57d7c | e8da6dc3743c3db8e581bd8e353329664845529c | refs/heads/master | 2020-09-05T13:34:25.433926 | 2019-11-15T00:22:12 | 2019-11-15T00:22:12 | 220,120,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,673 | java | package sample;
import javafx.scene.text.Text;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;
public class Winner {
private List<Long>list = new ArrayList<>();
private String name;
private String sign;
private int fields;
public Winner(String sign, String name) {
this.sign = sign;
this.name = name;
}
public boolean findWinner() {
list.clear();
list.add(checkRow(0,3));
list.add(checkRow(3,6));
list.add(checkRow(6,9));
list.add(checkColumn(0, 3));
list.add(checkColumn(1, 3));
list.add(checkColumn(2, 3));
list.add(checkDiagonal(0, 4));
list.add(checkDiagonal(2, 2));
return list.stream()
.anyMatch(n -> n == 3);
}
private Long checkRow(int firstFieldInRow, int stepNextRow) {
return IntStream.range(firstFieldInRow, stepNextRow)
.filter(n -> Board.getBoard().get(n).getChildren().size() == 2)
.mapToObj(s -> (Text)Board.getBoard().get(s).getChildren().get(1))
.filter(d -> d.getText().equals(sign))
.count();
}
private Long checkColumn(int firstFieldInColumn, int stepToNextColumn) {
return IntStream.iterate(firstFieldInColumn, n -> n + stepToNextColumn)
.limit(3)
.filter(n -> Board.getBoard().get(n).getChildren().size() == 2)
.mapToObj(s -> (Text)Board.getBoard().get(s).getChildren().get(1))
.filter(d -> d.getText().equals(sign))
.count();
}
private Long checkDiagonal(int firstFieldOnDiagonal, int stepNexTFieldOnDiagonal) {
return IntStream.iterate(firstFieldOnDiagonal, n -> n + stepNexTFieldOnDiagonal)
.limit(3)
.filter(n -> Board.getBoard().get(n).getChildren().size() ==2)
.mapToObj(n -> (Text)Board.getBoard().get(n).getChildren().get(1))
.filter(n -> n.getText().equals(sign))
.count();
}
public List<Integer> getWinnersFields() {
List<Integer> winnersFields = new ArrayList<>();
for (int i = 0 ; i < list.size() ; i++){
if (list.get(i) == 3) {
fields = i;
break;
}
}
switch (fields) {
case 0:
winnersFields.add(0);
winnersFields.add(1);
winnersFields.add(2);
break;
case 1:
winnersFields.add(3);
winnersFields.add(4);
winnersFields.add(5);
break;
case 2:
winnersFields.add(6);
winnersFields.add(7);
winnersFields.add(8);
break;
case 3:
winnersFields.add(0);
winnersFields.add(3);
winnersFields.add(6);
break;
case 4:
winnersFields.add(1);
winnersFields.add(4);
winnersFields.add(7);
break;
case 5:
winnersFields.add(2);
winnersFields.add(5);
winnersFields.add(8);
break;
case 6:
winnersFields.add(0);
winnersFields.add(4);
winnersFields.add(8);
break;
case 7:
winnersFields.add(2);
winnersFields.add(4);
winnersFields.add(6);
break;
}
return winnersFields;
}
}
| [
"spiotrek1985@gmail.com"
] | spiotrek1985@gmail.com |
25150b89c05b8f3a821193109882c88bd440c349 | e6d8ca0907ff165feb22064ca9e1fc81adb09b95 | /src/main/java/com/vmware/vim25/HostServiceSourcePackage.java | e00db708952be737c409997b85bac66739a25260 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | incloudmanager/incloud-vijava | 5821ada4226cb472c4e539643793bddeeb408726 | f82ea6b5db9f87b118743d18c84256949755093c | refs/heads/inspur | 2020-04-23T14:33:53.313358 | 2019-07-02T05:59:34 | 2019-07-02T05:59:34 | 171,236,085 | 0 | 1 | BSD-3-Clause | 2019-02-20T02:08:59 | 2019-02-18T07:32:26 | Java | UTF-8 | Java | false | false | 2,256 | java | /*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the names of copyright holders nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class HostServiceSourcePackage extends DynamicData {
public String sourcePackageName;
public String description;
public String getSourcePackageName() {
return this.sourcePackageName;
}
public String getDescription() {
return this.description;
}
public void setSourcePackageName(String sourcePackageName) {
this.sourcePackageName=sourcePackageName;
}
public void setDescription(String description) {
this.description=description;
}
} | [
"sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1"
] | sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1 |
e7034d04453d7525763a9c3377da0e18ece8f79a | 1b36a06510cdfa0104318fe8e712dd93d50529b4 | /Month2/app/src/main/java/shixun/lj/bw/month/bean/Tou.java | b792ef0289b216a07c6cee3dca307f49b66e9723 | [] | no_license | janggege/one | 1c98b3687d9f026e4602ecccbc03893eee6445e4 | a9343ec493b884e3d0eeb6079e369d7d31ab9531 | refs/heads/master | 2020-04-23T15:33:09.544255 | 2019-02-25T12:52:38 | 2019-02-25T12:52:38 | 171,269,692 | 0 | 0 | null | 2019-02-25T12:54:40 | 2019-02-18T11:13:41 | Java | UTF-8 | Java | false | false | 1,482 | java | package shixun.lj.bw.month.bean;
import java.util.List;
/*
name:刘江
data:2019
*/public class Tou {
private String message;
private String status;
private List<ResultBean> result;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<ResultBean> getResult() {
return result;
}
public void setResult(List<ResultBean> result) {
this.result = result;
}
public static class ResultBean {
private String imageUrl;
private String jumpUrl;
private int rank;
private String title;
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getJumpUrl() {
return jumpUrl;
}
public void setJumpUrl(String jumpUrl) {
this.jumpUrl = jumpUrl;
}
public int getRank() {
return rank;
}
public void setRank(int rank) {
this.rank = rank;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
}
| [
"3193531395@qq.com"
] | 3193531395@qq.com |
9356e209ebf6471bc8fd28f384ca27da279d962a | a25d491e9d4bb218eb6e94444b12e8b8e1d57596 | /nwpu/src/main/java/com/zyw/nwpu/jifen/DuihuanActivity.java | 1cc7279f3f4f33ca0d27f3e26b9fa24d5c908cb1 | [] | no_license | 50mengzhu/NWPU | 7d809d660c068337f2dac7af0b6c8fb0b014b413 | 95976c6d2bd5d8127fd762bd8ea3866f37b92c05 | refs/heads/master | 2021-08-16T15:44:46.055883 | 2017-11-13T05:43:56 | 2017-11-13T05:43:56 | 110,503,926 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,747 | java | package com.zyw.nwpu.jifen;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.xutils.view.annotation.ContentView;
import com.zyw.nwpu.Login;
import com.zyw.nwpu.R;
import com.zyw.nwpu.app.AccountHelper;
import com.zyw.nwpu.base.BaseActivity;
import com.zyw.nwpu.jifen.leancloud.ScoreDetail;
import com.zyw.nwpu.jifen.leancloud.ScoreHelper;
import com.zyw.nwpu.jifen.leancloud.ScoreHelper.GetScoreDetailCallback;
import com.zyw.nwpu.jifen.widget.XListView;
import com.zyw.nwpulib.utils.CommonUtil;
@ContentView(R.layout.activity_duihuan)
public class DuihuanActivity extends BaseActivity implements XListView.IXListViewListener {
private XListView mListView;
List<ScoreDetail> scoreDetailList;
public static void startThis(Context cxt) {
// 判断是否已经登录
if (!AccountHelper.isLogedIn(cxt)) {
CommonUtil.ToastUtils.showShortToast(cxt, "请先登陆");
Login.startThis(cxt);
} else {
Intent intent = new Intent(cxt, DuihuanActivity.class);
cxt.startActivity(intent);
((Activity) cxt).overridePendingTransition(R.anim.slide_in_right, R.anim.fade_outs);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
public void initView() {
mListView = (XListView) findViewById(R.id.List_duihuanjilu);
mListView.setPullRefreshEnable(false);
mListView.setPullLoadEnable(false);
mListView.setAutoLoadEnable(true);
mListView.setXListViewListener(this);
mListView.setRefreshTime(getTime());
ScoreHelper.getPurchaseRecord(new GetScoreDetailCallback() {
public void onSuccess(List<ScoreDetail> list) {
scoreDetailList = list;
JifenCardAdapter mAdapter = new JifenCardAdapter(DuihuanActivity.this, getItems());
mListView.setAdapter(mAdapter);
}
public void onFailure(String errTip) {
Toast.makeText(DuihuanActivity.this, errTip, Toast.LENGTH_SHORT).show();
}
});
}
private List<JifenCard> getItems() {
List<JifenCard> mCards = new ArrayList<JifenCard>();
for (int i = 0; i < scoreDetailList.size(); i++) {
JifenCard mCard = new JifenCard(scoreDetailList.get(i).getDescription(), scoreDetailList.get(i).getDate(),
scoreDetailList.get(i).getScore());
mCards.add(mCard);
}
return mCards;
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
mListView.autoRefresh();
}
}
@Override
public void onRefresh() {
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// // 这里是对列表的更新。
// ++mRefreshIndex;
// mAdapter = new DuihuanCardAdapter(DuihuanActivity.this,
// getItems(mCount));
// mListView.setAdapter(mAdapter);
// onLoad();
// }
// }, 1000);
}
@Override
public void onLoadMore() {
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// mAdapter.notifyDataSetChanged();
// mCount += 5;
// mAdapter = new DuihuanCardAdapter(DuihuanActivity.this,
// getItems(mCount));
// mListView.setAdapter(mAdapter);
// mListView.setSelection(mCount);
// onLoad();
// }
// }, 1000);
}
private void onLoad() {
mListView.stopRefresh();
mListView.stopLoadMore();
mListView.setRefreshTime(getTime());
}
private String getTime() {
return new SimpleDateFormat("MM-dd HH:mm", Locale.CHINA).format(new Date());
}
}
| [
"1670041876@qq.com"
] | 1670041876@qq.com |
de265969c1f0d139c9c9ab0ab9227adc242860f9 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/22_byuic-com.yahoo.platform.yui.compressor.JarClassLoader-1.0-10/com/yahoo/platform/yui/compressor/JarClassLoader_ESTest_scaffolding.java | e792a1e10bfc0e70ef771285ba672807437e6c62 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Oct 26 01:42:40 GMT 2019
*/
package com.yahoo.platform.yui.compressor;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class JarClassLoader_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
d6404e16999ac4fb36d5f36fc0ec7d39f6e288ba | 5b8f51919217bb21cadb089eded30cb55e1c9f5e | /113.PathSumII/solution2.java | caef9a6c7fc895f24716a95ddc255c90c9c880d2 | [] | no_license | nora-lu/leetcode-Java | 466dffda29301608899fb4b87d5abfd6247599b1 | 70dc6b2dcf50b6903261597e050860533343d454 | refs/heads/master | 2020-04-09T16:50:55.035975 | 2016-05-27T08:48:03 | 2016-05-27T08:48:03 | 30,814,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,294 | java | /* Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
return
[
[5,4,11,2],
[5,8,4,5]
] */
public class Solution {
public List<List<Integer>> pathSum(TreeNode root, int sum) {
List<List<Integer>> ret = new ArrayList<>();
if (root == null) { return ret; }
List<Integer> path = new ArrayList<>();
path.add(root.val);
pathSum(root, sum, path, ret);
return ret;
}
private void pathSum(TreeNode node, int sum, List<Integer> path, List<List<Integer>> ret) {
if (node.left == null && node.right == null && node.val == sum) {
ret.add(new ArrayList<Integer>(path));
return;
}
if (node.left != null) {
path.add(node.left.val);
pathSum(node.left, sum - node.val, path, ret);
path.remove(path.size() - 1);
}
if (node.right != null) {
path.add(node.right.val);
pathSum(node.right, sum - node.val, path, ret);
path.remove(path.size() - 1);
}
}
}
| [
"nora-lu@users.noreply.github.com"
] | nora-lu@users.noreply.github.com |
9ee94679b9861e53a28227206bbc5160543f1b3d | 7784ef372e1be8a208362fd2675278ef08393687 | /Hope/src/com/service/ForumService.java | f7ee3357f34b76ad43209dff3fae10618e2ae8ae | [] | no_license | lchcoming/cng1985 | df8eb473ecf6e8d716cd2936c16a60ab718c2c11 | d122b878b9aa3c242f3d12d2ce65761f09666b6d | refs/heads/master | 2016-09-05T12:07:03.838786 | 2011-08-31T00:53:05 | 2011-08-31T00:53:05 | 41,707,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,835 | java | package com.service;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ada.daoimpl.ForumDaoImpl;
import com.ada.model.Forum;
public class ForumService extends HttpServlet {
/**
* Constructor of the object.
*/
public ForumService() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to
* post.
*
* @param request
* the request send by the client to the server
* @param response
* the response send by the server to the client
* @throws ServletException
* if an error occurred
* @throws IOException
* if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String title = request.getParameter("title");
String d = request.getParameter("content");
String type = request.getParameter("type");
Forum forum = new Forum();
forum.setPubtime(new Date());
forum.setTitle(title);
forum.setDescribe(d);
forum.setForumtype(type);
ForumDaoImpl dao =new ForumDaoImpl();
dao.addForum(forum);
response.sendRedirect("/admin/main.jsp");
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException
* if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
| [
"cng1985@4a583d68-532f-11de-8b28-e1b452efc53a"
] | cng1985@4a583d68-532f-11de-8b28-e1b452efc53a |
36b9c1817dfba90ec429f41e33cb012a34573c76 | cc21233ae526ed74d7dfe0bc4313751bb16b18bc | /src/main/java/SimplePubSub.java | 035a93e5dcae4f9afc1c02c150dfbee4592e444e | [] | no_license | kimptoc/ibmmq-no-ssl-test | ec522b8a0c1e31a7cd519f38d40e71438eb02a93 | 696b7ec51b1dd8ae0356746626b6f20b8e5f720e | refs/heads/master | 2021-01-20T01:17:12.872304 | 2017-04-25T08:20:21 | 2017-04-25T08:20:21 | 89,248,614 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,595 | java | // SCCSID "@(#) MQMBID sn=p750-007-160812 su=_Q7L2EGB5EeavWqNpgfWvaA pn=MQJavaSamples/jms/simple/SimplePubSub.java"
/*
* <copyright
* notice="lm-source-program"
* pids="5724-H72,5655-R36,5655-L82,5724-L26,"
* years="2008,2012"
* crc="3812808746" >
* Licensed Materials - Property of IBM
*
* 5724-H72,5655-R36,5655-L82,5724-L26,
*
* (C) Copyright IBM Corp. 2008, 2012 All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with
* IBM Corp.
* </copyright>
*/
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import com.ibm.msg.client.jms.JmsConnectionFactory;
import com.ibm.msg.client.jms.JmsFactoryFactory;
import com.ibm.msg.client.wmq.WMQConstants;
/**
* A minimal and simple application for Publish-Subscribe messaging.
*
* Application makes use of fixed literals, any customisations will require re-compilation of this
* source file.
*
* Notes:
*
* API type: JMS API (v1.1, unified domain)
*
* Messaging domain: Publish-Subscribe
*
* Provider type: WebSphere MQ
*
* Connection mode: Client connection
*
* JNDI in use: No
*
*/
public class SimplePubSub {
// System exit status value (assume unset value to be 1)
private static int status = 1;
/**
* Main method
*
* @param args
*/
public static void main(String[] args) throws InterruptedException {
// Variables
Connection connection = null;
Session session = null;
Destination destination = null;
MessageProducer producer = null;
MessageConsumer consumer = null;
try {
// Create a connection factory
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();
// Set the properties
cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, "ibmmq");
cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, "DEV.ADMIN.SVRCONN");
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, "QM1");
// cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, "SSL_RSA_WITH_AES_256_GCM_SHA384");
// cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SPEC, "TLS_RSA_WITH_AES_256_GCM_SHA384");
// Create JMS objects
connection = cf.createConnection("admin","passw0rd");
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
destination = session.createTopic("topic://foo");
producer = session.createProducer(destination);
consumer = session.createConsumer(destination);
long uniqueNumber = System.currentTimeMillis() % 1000;
TextMessage message = session.createTextMessage("SimplePubSub: Your lucky number today is "
+ uniqueNumber);
// Start the connection
connection.start();
// And, send the message
producer.send(message);
System.out.println("Sent message:\n" + message);
Thread.sleep(30000);
Message receivedMessage = consumer.receive(1500000); // in ms or 15 seconds
System.out.println("\nReceived message:\n" + receivedMessage);
recordSuccess();
}
catch (JMSException jmsex) {
recordFailure(jmsex);
}
finally {
if (producer != null) {
try {
producer.close();
}
catch (JMSException jmsex) {
System.out.println("Producer could not be closed.");
recordFailure(jmsex);
}
}
if (consumer != null) {
try {
consumer.close();
}
catch (JMSException jmsex) {
System.out.println("Consumer could not be closed.");
recordFailure(jmsex);
}
}
if (session != null) {
try {
session.close();
}
catch (JMSException jmsex) {
System.out.println("Session could not be closed.");
recordFailure(jmsex);
}
}
if (connection != null) {
try {
connection.close();
}
catch (JMSException jmsex) {
System.out.println("Connection could not be closed.");
recordFailure(jmsex);
}
}
}
System.exit(status);
return;
} // end main()
/**
* Process a JMSException and any associated inner exceptions.
*
* @param jmsex
*/
private static void processJMSException(JMSException jmsex) {
System.out.println(jmsex);
Throwable innerException = jmsex.getLinkedException();
if (innerException != null) {
System.out.println("Inner exception(s):");
}
while (innerException != null) {
System.out.println(innerException);
innerException = innerException.getCause();
}
return;
}
/**
* Record this run as successful.
*/
private static void recordSuccess() {
System.out.println("SUCCESS");
status = 0;
return;
}
/**
* Record this run as failure.
*
* @param ex
*/
private static void recordFailure(Exception ex) {
if (ex != null) {
if (ex instanceof JMSException) {
processJMSException((JMSException) ex);
}
else {
System.out.println(ex);
}
}
System.out.println("FAILURE");
status = -1;
return;
}
}
| [
"chris@kimptoc.net"
] | chris@kimptoc.net |
b2483026849d2fd19663ee1e2df55f3504dfa768 | afc8f7187aa1f0503d37994141d4ad81743adb8c | /RN例子/android/app/src/main/java/com/rnexample/MainApplication.java | f2f57002b0be06708ea93204b4265333e1dc1e4d | [] | no_license | lllyyy/RNNeteaseNews | e25f94fa56cc6aef70859391459a0016ec6fedb1 | ea6fd03b05f098cb7501896c56a2e7273da31613 | refs/heads/master | 2020-03-16T00:24:35.139788 | 2018-12-19T13:07:18 | 2018-12-19T13:07:18 | 132,415,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,366 | java | package com.rnexample;
import android.app.Application;
import com.example.customlib.CustomPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.horcrux.svg.SvgPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.microsoft.codepush.react.CodePush;
import com.puti.paylib.PayReactPackage;
import com.puti.upgrade.UpgradePackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.reactnativecomponent.barcode.RCTCapturePackage;
import com.rnexample.module.NativeConstantPackage;
import com.tencent.bugly.crashreport.CrashReport;
import com.uemnglib.DplusReactPackage;
import com.uemnglib.RNUMConfigure;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.Config;
import com.umeng.socialize.PlatformConfig;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import java.util.Arrays;
import java.util.List;
import cn.jpush.reactnativejpush.JPushPackage;
import cn.reactnative.httpcache.HttpCachePackage;
public class MainApplication extends Application implements ReactApplication {
{
Config.DEBUG = BuildConfig.DEBUG;
PlatformConfig.setWeixin(BuildConfig.WX_APPKEY, BuildConfig.WX_SECRET);
PlatformConfig.setSinaWeibo(BuildConfig.SINA_APPID, BuildConfig.SINA_SECRET, "https://api.weibo.com/oauth2/default.html");
PlatformConfig.setQQZone(BuildConfig.QQ_APPID, BuildConfig.QQ_SECRET);
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new UpgradePackage(),
new PayReactPackage(),
new RCTCapturePackage(),
new CodePush(BuildConfig.CODEPUSH_KEY, getApplicationContext(), BuildConfig.DEBUG),
new SvgPackage(),
new RNDeviceInfo(),
new HttpCachePackage(),
new SplashScreenReactPackage(),
new RNSpinkitPackage(),
new CustomPackage(),
new NativeConstantPackage(),
new DplusReactPackage(),
new JPushPackage(!BuildConfig.DEBUG, !BuildConfig.DEBUG)
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
CrashReport.initCrashReport(getApplicationContext(), BuildConfig.BUGLY_ID, BuildConfig.DEBUG);
RNUMConfigure.init(getApplicationContext(), BuildConfig.UMENG_APPKEY, "android", UMConfigure.DEVICE_TYPE_PHONE, null);
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
}
}
| [
"luyang@M.local"
] | luyang@M.local |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.