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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56fadd4a5f21601dcf02b72282021e6de8d67b1a | 2bbb2449d4fff005bc66da6b21b6a0a2ed554400 | /FriendzzHutMiddleWare/src/main/java/com/config/WebAppDispatcherConfig.java | f5e5bbec19f6427d3753cae601e7b98151a0370a | [] | no_license | chetnapadiya13/FriendzzzHutMiddleWare | 4213b4ebc977a6a97994c3db1fd7cbcfcf1afd83 | 9d2012c53c00f022b25aedd77faeb27a54df88c5 | refs/heads/master | 2020-03-06T22:54:58.986841 | 2018-03-29T03:40:51 | 2018-03-29T03:40:51 | 127,117,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 866 | java | package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages="com.configer")
public class WebAppDispatcherConfig {
@Bean
public ViewResolver viewResolver(){
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
} | [
"chetnapadiya13@gmail.com"
] | chetnapadiya13@gmail.com |
bea60c2880d148c43f2fa4deef483a8824184581 | 238c4e1bf0f53cea29e1ca5430af38dccb076632 | /app/src/main/java/com/williamgdev/example/googleplaceapi/dto/AddressComponent.java | 30df0ee2355b626a06d4bbf89d7150abf9c3b484 | [] | no_license | williamgdev/GooglePlaceApi | 885e7953c702cc7488784fcf1df38ddeefb52372 | 7b25be194bfcc1d553397917cb4c0ef990a25f01 | refs/heads/master | 2020-04-07T06:18:04.466056 | 2018-03-08T22:35:33 | 2018-03-08T22:35:33 | 124,188,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 897 | java | package com.williamgdev.example.googleplaceapi.dto;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AddressComponent {
@SerializedName("long_name")
@Expose
private String longName;
@SerializedName("short_name")
@Expose
private String shortName;
@SerializedName("types")
@Expose
private List<String> types = null;
public String getLongName() {
return longName;
}
public void setLongName(String longName) {
this.longName = longName;
}
public String getShortName() {
return shortName;
}
public void setShortName(String shortName) {
this.shortName = shortName;
}
public List<String> getTypes() {
return types;
}
public void setTypes(List<String> types) {
this.types = types;
}
} | [
"williamg.dev@gmail.com"
] | williamg.dev@gmail.com |
474f8c698708dcc8ca46c28a017f57af0cdd3ed5 | 565597ad168ef4f419f573da46947db4c1650c77 | /app/src/main/java/com/example/sirisha/moviecopy/Pojo.java | d20ca4260b811d1b51d916893ab4ff9932c8c435 | [] | no_license | Sirishamiriyala/MovieApp | 0b683476ace1a9b35fa7086dbead3184ed276578 | 69fcd60c2610e414607fedd1574745bf40f922d8 | refs/heads/master | 2020-03-25T08:24:41.888538 | 2018-08-05T12:29:39 | 2018-08-05T12:29:39 | 143,610,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,219 | java | package com.example.sirisha.moviecopy;
import com.google.gson.annotations.SerializedName;
/**
* Created by sirisha on 15-05-2018.
*/
class Pojo {
String poster2,Poster,title,analysis,rel_date,lang,mtitle;
String vote_count;
String vote_avg;
String Ident;
String popularity;
boolean video,adult;
public Pojo(String poster2, String poster, String title,
String analysis, String rel_date, String vote_avg,
String vote_count,String popularity, boolean video,
String ident, boolean adult, String mtitle, String lang) {
this.poster2=poster2;
this.Poster=poster;
this.title=title;
this.analysis=analysis;
this.rel_date=rel_date;
this.lang=lang;
this.mtitle=mtitle;
this.vote_count=vote_count;
this.vote_avg=vote_avg;
this.Ident=ident;
this.popularity=popularity;
this.video=video;
this.adult=adult;
}
public Pojo(String ident, String poster2,String poster, String vote_avg, String analysis, String rel_date, String mtitle) {
this.Ident=ident;
this.poster2=poster2;
this.Poster=poster;
this.vote_avg=vote_avg;
this.analysis=analysis;
this.rel_date=rel_date;
this.mtitle=mtitle;
}
public String getPoster2() {
return poster2;
}
public void setPoster2(String poster2) {
this.poster2 = poster2;
}
public String getPoster() {
return Poster;
}
public void setPoster(String poster) {
Poster = poster;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAnalysis() {
return analysis;
}
public void setAnalysis(String analysis) {
this.analysis = analysis;
}
public String getRel_date() {
return rel_date;
}
public void setRel_date(String rel_date) {
this.rel_date = rel_date;
}
public String getLang() {
return lang;
}
public void setLang(String lang) {
this.lang = lang;
}
public String getMtitle() {
return mtitle;
}
public void setMtitle(String mtitle) {
this.mtitle = mtitle;
}
public String getVote_count() {
return vote_count;
}
public void setVote_count(String vote_count) {
this.vote_count = vote_count;
}
public String getVote_avg() {
return vote_avg;
}
public void setVote_avg(String vote_avg) {
this.vote_avg = vote_avg;
}
public String getIdent() {
return Ident;
}
public void setIdent(String ident) {
Ident = ident;
}
public String getPopularity() {
return popularity;
}
public void setPopularity(String popularity) {
this.popularity = popularity;
}
public boolean isVideo() {
return video;}
public void setVideo(boolean video) {
this.video = video;
}
public boolean isAdult() {
return adult;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
}
| [
"sirishamiryala@gmail.com"
] | sirishamiryala@gmail.com |
6e1fd47183431b42fdd5d4ea394fe32fb14ecb6a | 4e27d369f1f83d5ddb45a617460cbf0bed40265c | /src/LAB8/ILight.java | 943982ca75e24eca6dcfb59c1089e882ae003764 | [] | no_license | wararat12/OOP_2563_362211760011 | 7e2b81a6a37702461a9f92388e8e473de4d0e4f1 | 189339825c544eb50c1b23d3c6883eb727f7edbe | refs/heads/master | 2023-03-14T10:47:50.422585 | 2021-03-09T04:16:17 | 2021-03-09T04:16:17 | 319,521,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 176 | java | package LAB8;
public interface ILight extends extreamILight{
public void turnOn();
public void turnOff();
}
interface extreamILight {
public void autoHiBeam();
}
| [
"numphuingza@gmail.com"
] | numphuingza@gmail.com |
bda94afcf0069e1aa47c2f6c59acecbd9ee5b2d6 | 7e35e4dbbee5abaa7c28f8aae1b053c5cf1e4157 | /TriveraFarm/src/trivera/farm/location/Structure.java | dbbdf923d6a23847078e9fa79d22fcca0550a941 | [] | no_license | Razia1630/JAVA | 1b8b623bf12fc0eb0612b21b773dc31f827ddb29 | 2d945e4718cac38fef7ac84ee3814f17cda15483 | refs/heads/master | 2023-09-05T20:19:46.499673 | 2018-11-06T22:30:40 | 2018-11-06T22:30:40 | 426,099,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,086 | java | package trivera.farm.location;
import java.util.Arrays;
/*
* Trivera Farm application - Structure
* <p>
* This component and its source code representation are copyright protected
* and proprietary to The Trivera Group, Inc., Worldwide D/B/A Trivera Technologies
*
* This component and source code may be used for instructional and
* evaluation purposes only. No part of this component or its source code
* may be sold, transferred, or publicly posted, nor may it be used in a
* commercial or production environment, without the express written consent
* of the Trivera Group, Inc.
*
* Copyright (c) 2018 The Trivera Group, Inc.
* http://www.triveratech.com http://www.triveragroup.com
* </p>
* @author The Trivera Group Tech Team.
*/
public class Structure extends Location {
// constructors
public Structure () {
super();
}
public Structure (String name) {
super(name);
}
public Structure (Location[] loc) {
super(loc);
}
public Structure (String name, Location[] loc) {
super(name, loc);
}
// getState - name plus count of rooms
public String getState() {
Room[] rooms = this.getRooms();
return getName() + ": contains " +
((rooms == null || rooms.length == 0) ? "NO" : childLocations.length) + " rooms";
}
// getFullState - return getState() plus enumerated rooms, if any
public String getFullState() {
Room[] rooms = this.getRooms();
return getState() + ((rooms == null || rooms.length == 0) ? "." : ":\n\t" + this.getChildState());
}
// get rooms
public Room[] getRooms() {
Room[] rooms = null;
for (int i=0, j=childLocations.length; i<j; i++) {
if (childLocations[i] == null) { continue; }
// see if first
if (rooms == null) {
rooms = new Room[1];
rooms[0] = (Room) childLocations[i];
} else {
rooms = Arrays.copyOf(rooms, (rooms.length + 1));
rooms[rooms.length-1] = (Room) childLocations[i];
}
}
return rooms;
}
// determine if Location subtype is valid
protected boolean isLocationValid (Location loc) {
// a Structure may only contain Rooms
return (loc instanceof Room);
}
}
| [
"stanlick@gmail.com"
] | stanlick@gmail.com |
47a8c35f564b046d1a14cc4cd0654c726a37f9ae | 7a5587180170ca83beed60dc24115aac734bbc24 | /app/src/main/java/com/example/blockcertify_manufacturerapp/Register/RegisterDistributor.java | 1194cc5b171c146e53db18cbb98b17d218b0147e | [] | no_license | JollyJohhny/FYP-App-1 | dc6656c1844903642857955c21ea7519d1dfca60 | 8a4869c803ed8d1c49e8d659a9575f8fee0b4ab6 | refs/heads/master | 2020-12-01T13:56:41.659608 | 2019-12-28T18:58:20 | 2019-12-28T18:58:20 | 230,650,960 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,435 | java | package com.example.blockcertify_manufacturerapp.Register;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.example.blockcertify_manufacturerapp.ChangePasswords.ChangePassword;
import com.example.blockcertify_manufacturerapp.Extra.LoadingDialog;
import com.example.blockcertify_manufacturerapp.R;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
public class RegisterDistributor extends AppCompatActivity {
private LoadingDialog loadingDialog;
EditText txtName,txtEmail,txtPassword,txtCnic,txtCompId,txtCnfrmPwd;
DatabaseReference databaseReference;
FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_distributor);
loadingDialog = new LoadingDialog(this, R.style.DialogLoadingTheme);
txtEmail = findViewById(R.id.txtEmail);
txtPassword = findViewById(R.id.txtPassword);
txtCnfrmPwd = findViewById(R.id.txtCnfrmPwd);
firebaseAuth = FirebaseAuth.getInstance();
}
public void Register(View v){
final String Email = txtEmail.getText().toString();
String Password = txtPassword.getText().toString();
boolean flag = true;
if(TextUtils.isEmpty(Email)){
Toast.makeText(this, "Please Enter Email!",
Toast.LENGTH_LONG).show();
flag = false;
}
if(TextUtils.isEmpty(Password)){
Toast.makeText(this, "Please Enter Password!",
Toast.LENGTH_LONG).show();
flag = false;
}
if(!Patterns.EMAIL_ADDRESS.matcher(Email).matches()){
Toast.makeText(this, "Please Enter Valid Blockcertify Email!",
Toast.LENGTH_LONG).show();
flag = false;
}
if(txtPassword.getText().toString().equals(txtCnfrmPwd.getText().toString())){
}
else{
flag = false;
Toast.makeText(RegisterDistributor.this, "Password does not match!", Toast.LENGTH_SHORT).show();
}
// Check for correct Register panel
if(flag == true){
String[] splitted = Email.split("@");
if(splitted.length >0){
if(!splitted[1].equals("blockcertify.distributor.com")){
flag = false;
Toast.makeText(this, "Use blockcertify.distributor.com after @ to Register the Distributor!",
Toast.LENGTH_LONG).show();
}
}
}
if(flag){
loadingDialog.show();
firebaseAuth.createUserWithEmailAndPassword(Email, Password)
.addOnCompleteListener(RegisterDistributor.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
loadingDialog.dismiss();
Toast.makeText(RegisterDistributor.this, "Distributor Registered!", Toast.LENGTH_SHORT).show();
finish();
} else {
Toast.makeText(RegisterDistributor.this, "Distributor already registered!", Toast.LENGTH_SHORT).show();
Log.i("failed", "createUserWithEmail:failure", task.getException());
loadingDialog.dismiss();
}
// ...
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
loadingDialog.dismiss();
}
});
}
}
}
| [
"johhny424@gmail.com"
] | johhny424@gmail.com |
ab16dac8a543e7e00376dfb27b6f6b7fa600aed4 | 1eb65f3192a246da6b0bb67a9e7f5f12fded3002 | /src/main/java/net/tridentsdk/api/docs/InternalUseOnly.java | e4af85883a20d2d3b4c06248722db165cd8da505 | [
"Apache-2.0"
] | permissive | BeYkeRYkt/TridentSDK | ad3c0d077b8026943f3afc0a7bbe2e7fc72dd02d | a1b8c150c9656cf1c17f6f7de67367f98a6bcbfa | refs/heads/master | 2021-01-14T10:59:50.568492 | 2015-01-16T12:28:15 | 2015-01-16T12:28:15 | 23,748,881 | 1 | 0 | null | 2015-01-16T12:28:15 | 2014-09-07T00:25:52 | null | UTF-8 | Java | false | false | 993 | java | /*
* Trident - A Multithreaded Server Alternative
* Copyright 2014 The TridentSDK Team
*
* 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 net.tridentsdk.api.docs;
import java.lang.annotation.Documented;
/**
* Marks a member of the API or implementation that is designed to be used internally only.
*
* <p>The behavior of callers on those members marked by this annotation is unspecified and left undocumented.</p>
*/
@Documented
public @interface InternalUseOnly {
}
| [
"woodyc40@gmail.com"
] | woodyc40@gmail.com |
f5d5dcc2859dbb06112eba92b159808db24112ef | 3fc13b4068f552b502e04b1c26553592a446d7ac | /api/src/main/java/mb/resource/hierarchical/walk/ResourceWalker.java | 7fb70a5b507bdcdab18ed71c8f33720848e48bc9 | [
"Apache-2.0"
] | permissive | metaborg/resource | 5240772d3b5b3bc58c23dfd233697fdaebc14133 | 197057fb397b49663bee8e1a0bbcac2452ed4276 | refs/heads/master | 2022-05-25T05:27:36.397559 | 2022-05-11T13:41:09 | 2022-05-11T13:41:09 | 179,507,450 | 0 | 4 | Apache-2.0 | 2021-08-24T09:35:45 | 2019-04-04T13:53:57 | Java | UTF-8 | Java | false | false | 1,857 | java | package mb.resource.hierarchical.walk;
import mb.resource.hierarchical.HierarchicalResource;
import mb.resource.hierarchical.match.path.PathMatcher;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@FunctionalInterface
public interface ResourceWalker extends Serializable {
boolean traverse(HierarchicalResource directory, HierarchicalResource rootDirectory) throws IOException;
static TrueResourceWalker ofTrue() {
return new TrueResourceWalker();
}
static FalseResourceWalker ofFalse() {
return new FalseResourceWalker();
}
static AllResourceWalker ofAll(ResourceWalker... walkers) {
return new AllResourceWalker(walkers);
}
static AnyResourceWalker ofAny(ResourceWalker... walkers) {
return new AnyResourceWalker(walkers);
}
static NotResourceWalker ofNot(ResourceWalker walkers) {
return new NotResourceWalker(walkers);
}
static PathResourceWalker ofPath(PathMatcher matcher) {
return new PathResourceWalker(matcher);
}
default NotResourceWalker not() {
return new NotResourceWalker(this);
}
default AllResourceWalker and(ResourceWalker... walkers) {
final ArrayList<ResourceWalker> allWalkers = new ArrayList<>(walkers.length + 1);
allWalkers.add(this);
Collections.addAll(allWalkers, walkers);
return new AllResourceWalker(allWalkers);
}
default AnyResourceWalker or(ResourceWalker... walkers) {
final ArrayList<ResourceWalker> anyWalkers = new ArrayList<>(walkers.length + 1);
anyWalkers.add(this);
Collections.addAll(anyWalkers, walkers);
return new AnyResourceWalker(anyWalkers);
}
static PathResourceWalker ofNoHidden() {return ofPath(PathMatcher.ofNoHidden());}
}
| [
"gabrielkonat@gmail.com"
] | gabrielkonat@gmail.com |
946c4a30b4df9d13f6804c91b7c1896bf1a052a9 | b879055f377e3dc23f2af4247623c601d4257742 | /aliyun-java-sdk-emr/src/main/java/com/aliyuncs/emr/transform/v20160408/DescribeClusterServiceConfigForAdminResponseUnmarshaller.java | f03f6f506d94dbf21fe3993f70522cd14f6ee0bf | [
"Apache-2.0"
] | permissive | pp6563/aliyun-openapi-java-sdk | d9b73462e8b2cb55855571d7309564b572e87a71 | a9527a5ceda4eaffe32323879d28deb92a333e03 | refs/heads/master | 2020-07-11T17:55:17.535632 | 2019-08-27T02:11:25 | 2019-08-27T02:11:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,999 | java | /*
* 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.aliyuncs.emr.transform.v20160408;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.ConfigValue;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.ConfigValue.ConfigItemValue;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfo;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfo.EffectWay;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfo.PropertyValueAttributes;
import com.aliyuncs.emr.model.v20160408.DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfo.PropertyValueAttributes.ValueEntryInfo;
import com.aliyuncs.transform.UnmarshallerContext;
public class DescribeClusterServiceConfigForAdminResponseUnmarshaller {
public static DescribeClusterServiceConfigForAdminResponse unmarshall(DescribeClusterServiceConfigForAdminResponse describeClusterServiceConfigForAdminResponse, UnmarshallerContext _ctx) {
describeClusterServiceConfigForAdminResponse.setRequestId(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.RequestId"));
Config config = new Config();
config.setServiceName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ServiceName"));
config.setConfigVersion(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigVersion"));
config.setApplied(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.Applied"));
config.setCreateTime(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.CreateTime"));
config.setAuthor(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.Author"));
config.setComment(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.Comment"));
List<ConfigValue> configValueList = new ArrayList<ConfigValue>();
for (int i = 0; i < _ctx.lengthValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList.Length"); i++) {
ConfigValue configValue = new ConfigValue();
configValue.setConfigName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigName"));
configValue.setAllowCustom(_ctx.booleanValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].AllowCustom"));
List<ConfigItemValue> configItemValueList = new ArrayList<ConfigItemValue>();
for (int j = 0; j < _ctx.lengthValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigItemValueList.Length"); j++) {
ConfigItemValue configItemValue = new ConfigItemValue();
configItemValue.setItemName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigItemValueList["+ j +"].ItemName"));
configItemValue.setValue(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigItemValueList["+ j +"].Value"));
configItemValue.setIsCustom(_ctx.booleanValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigItemValueList["+ j +"].IsCustom"));
configItemValue.setDescription(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.ConfigValueList["+ i +"].ConfigItemValueList["+ j +"].Description"));
configItemValueList.add(configItemValue);
}
configValue.setConfigItemValueList(configItemValueList);
configValueList.add(configValue);
}
config.setConfigValueList(configValueList);
List<PropertyInfo> propertyInfoList = new ArrayList<PropertyInfo>();
for (int i = 0; i < _ctx.lengthValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList.Length"); i++) {
PropertyInfo propertyInfo = new PropertyInfo();
propertyInfo.setName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].Name"));
propertyInfo.setValue(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].Value"));
propertyInfo.setDescription(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].Description"));
propertyInfo.setFileName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].FileName"));
propertyInfo.setDisplayName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].DisplayName"));
propertyInfo.setServiceName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].ServiceName"));
propertyInfo.setComponent(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].Component"));
List<String> propertyTypes = new ArrayList<String>();
for (int j = 0; j < _ctx.lengthValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyTypes.Length"); j++) {
propertyTypes.add(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyTypes["+ j +"]"));
}
propertyInfo.setPropertyTypes(propertyTypes);
PropertyValueAttributes propertyValueAttributes = new PropertyValueAttributes();
propertyValueAttributes.setType(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Type"));
propertyValueAttributes.setMaximum(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Maximum"));
propertyValueAttributes.setMimimum(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Mimimum"));
propertyValueAttributes.setUnit(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Unit"));
propertyValueAttributes.setReadOnly(_ctx.booleanValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.ReadOnly"));
propertyValueAttributes.setHidden(_ctx.booleanValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Hidden"));
propertyValueAttributes.setIncrememtStep(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.IncrememtStep"));
List<ValueEntryInfo> entries = new ArrayList<ValueEntryInfo>();
for (int j = 0; j < _ctx.lengthValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Entries.Length"); j++) {
ValueEntryInfo valueEntryInfo = new ValueEntryInfo();
valueEntryInfo.setValue(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Entries["+ j +"].Value"));
valueEntryInfo.setLabel(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Entries["+ j +"].Label"));
valueEntryInfo.setDescription(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].PropertyValueAttributes.Entries["+ j +"].Description"));
entries.add(valueEntryInfo);
}
propertyValueAttributes.setEntries(entries);
propertyInfo.setPropertyValueAttributes(propertyValueAttributes);
EffectWay effectWay = new EffectWay();
effectWay.setEffectType(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].EffectWay.EffectType"));
effectWay.setInvokeServiceName(_ctx.stringValue("DescribeClusterServiceConfigForAdminResponse.Config.PropertyInfoList["+ i +"].EffectWay.InvokeServiceName"));
propertyInfo.setEffectWay(effectWay);
propertyInfoList.add(propertyInfo);
}
config.setPropertyInfoList(propertyInfoList);
describeClusterServiceConfigForAdminResponse.setConfig(config);
return describeClusterServiceConfigForAdminResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
4a2cec2ffb7ec3cb821726f705afe037e4c6241d | c66d06321d8cd77b533444c770e5e00bf7730725 | /Engan Actions/src/dao/daoEmpresa.java | 62ec6a007a19d584df8dd7f607a21ecd8b2b260d | [] | no_license | franciswagner/Engan | 4743bde21059d4648901ed4bce0883efe60bfb06 | 224d8cda06afaf009d3ba0b867e10af2d5713a28 | refs/heads/master | 2022-02-12T09:35:33.888043 | 2016-10-03T18:38:12 | 2016-10-03T18:38:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | 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 dao;
import java.util.ArrayList;
import java.util.List;
import model.Empresa;
/**
*
* @author victor
*/
public class daoEmpresa {
private static List<Empresa> empresas= new ArrayList();
public static void adicionar(Empresa empresa) {
empresas.add(empresa);
}
public static void remover(Empresa empresa) {
empresas.remove(empresa);
}
public static List<Empresa> getEmpresas() {
return empresas;
}
// O motivo de utilizar esse for , é converter o a lista em String ;
// porém não funciona jajajajaj.
@Override
public String toString(){
String retornadado = "vazio";
for(int i=0;this.empresas.get(i) != null;i++){
retornadado = this.empresas.get(i).getNome() + " " +this.empresas.get(i).getCNPJ() +";";
}
return retornadado;
}
}
| [
"edilson_alz@hotmail.com"
] | edilson_alz@hotmail.com |
a4f37fc4c0f8b250656e2ae42c86231571f74ba4 | 13d66b82be95244fe3ee28136c78ce08076a6ec1 | /src/main/java/com/labafrique/creporter/controller/ReportController.java | 52f0331af0d81825b18da428e7533f7abd1d78b1 | [] | no_license | lukmanjaji/CReporterServer | 74b8e623902f0deda564962cd6f985525c0ca2ea | 29b329128c3790b02aa239de5ffb982ff275b2d5 | refs/heads/master | 2022-12-04T13:08:00.385216 | 2020-08-15T15:07:55 | 2020-08-15T15:07:55 | 287,761,882 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,380 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.labafrique.creporter.controller;
import com.google.gson.Gson;
import com.labafrique.creporter.model.ReportModel;
import com.labafrique.creporter.service.FileStorageService;
import com.labafrique.creporter.ws.SocketHandler;
import com.labafrique.creporter.repository.ReportRepository;
import java.io.File;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
*
* @author Javalove
*/
@Component
@RestController
@RequestMapping("/creporter/listener")
public class ReportController {
@Autowired
private ReportRepository caseRepo;
@Autowired
private FileStorageService fileStorageService;
@Autowired
SocketHandler handler;
private static final Logger logger = LoggerFactory.getLogger(ReportController.class);
public ReportController()
{
}
@GetMapping(path="/getLatest")
@ResponseBody
public String getLatest(@RequestParam("t") String type, @RequestParam("x") String x)
{
x = x.replace(".0", "");
int a = Integer.parseInt(x);
return URLDecoder.decode(new Gson().toJson(caseRepo.findByCaseType(type, a)));
}
@GetMapping(path="/getCases")
@ResponseBody
public String getCases(@RequestParam("t") String type)
{
return URLDecoder.decode(new Gson().toJson(caseRepo.findAllCases()));
}
@GetMapping(path="/getSent")
@ResponseBody
public String getSent(@RequestParam("sender") String sender, @RequestParam("email") String email, @RequestParam("phone") String phone, @RequestParam("type") String type)
{
try
{
email = URLEncoder.encode(email, "utf-8");
sender = URLEncoder.encode(sender, "utf-8");
phone = URLEncoder.encode(phone, "utf-8");
type = URLEncoder.encode(type, "utf-8");
}catch(Exception er){}
return URLDecoder.decode(new Gson().toJson(caseRepo.getSent(sender, email, phone, type)));
}
public int countAll()
{
return caseRepo.findAllCases().size();
}
@PostMapping(path="/add")
@ResponseBody
public String save(@RequestParam("code") String code, @RequestParam("category") String category,
@RequestParam("details") String details,
@RequestParam("audio") String audio,
@RequestParam("video") String video,
@RequestParam("photo") String photo,
@RequestParam("address") String address, @RequestParam("rtype") String rtype,
@RequestParam("caseLocation") String caseLocation,
@RequestParam("userLocation") String userLocation,
@RequestParam("photoFile") MultipartFile photoFile,
@RequestParam("videoFile") MultipartFile videoFile,
@RequestParam ("audioFile") MultipartFile audioFile,
@RequestParam("email") String email,
@RequestParam("phone") String phone,
@RequestParam("sender") String sender,
@RequestParam("thumb") String thumb)
{
String uploadingDir = System.getProperty("user.dir")+"/CReporterUploads/";
System.out.println(uploadingDir);
String result = "error";
ReportModel model = new ReportModel();
model.setAddress(address);
model.setCaseLocation(caseLocation);
model.setCategory(category);
model.setCode(code);
model.setAudio(audio);
model.setVideo(video);
model.setPhoto(photo);
model.setDetails(details);
model.setRtype(rtype);
model.setEmail(email);
model.setSender(sender);
model.setPhone(phone);
model.setThumb(Integer.parseInt(thumb));
model.setUserLocation(userLocation);
model.setStatus("In Review");
if(audio.equals("true") )
{
doUpload(uploadingDir, audioFile, code);
}
if(video.equals("true") )
{
doUpload(uploadingDir, videoFile, code);
}
if(photo.equals("true") )
{
doUpload(uploadingDir, photoFile, code);
}
ReportModel md = caseRepo.save(model);
/*
if(attachment != null && attachment.length > 0)
{
logger.info("i'm in bro");
uploadM(attachment, code);
}
*/
try {handler.broadcast("broadcast##newCase##"+URLDecoder.decode(new Gson().toJson(md), "utf-8")); }catch(Exception er){}
return "saved##"+getSent(sender, email, phone, "cor");
}
@PostMapping(path = "/thmbUp")
public void vote(@RequestParam("code") String code)
{
caseRepo.ThumbUp(code);
}
public String search(String param)
{
String r ="";
try{
r = URLDecoder.decode(new Gson().toJson(caseRepo.search(param)), "utf-8");
}catch(Exception er){}
return r;
}
public String getVoteCount(String code)
{
return caseRepo.getVoteCount(code)+"";
}
public boolean doUpload(String uploadingDir, MultipartFile uploadedFile, String code)
{
System.out.println("about to upload photo");
boolean done = false;
File f = new File(uploadingDir +code + "/");
if(!f.exists())
{
f.mkdirs();
}
try
{
File file = new File(uploadingDir + "/"+code + "/" +uploadedFile.getOriginalFilename());
uploadedFile.transferTo(file);
}
catch(IOException er)
{
er.printStackTrace();
}
return done;
}
@GetMapping(path = "/test")
public String test()
{
try{
String uploadingDir1 = System.getProperty("user.dir") + "/creporter/";
Path path = Paths.get(uploadingDir1);
if (!Files.exists(path)) {
Files.createDirectory(path);
return("Directory created");
} else {
return("Directory already exists");
}
}catch(Exception er){return er.getMessage();}
}
@GetMapping("/getFile/{fileName:.+}")
public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {
// Load file as Resource
String a[] = fileName.split("_");
Resource resource = fileStorageService.loadFileAsResource(a[1], a[0]);
// Try to determine file's content type
String contentType = null;
try {
contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());
} catch (IOException ex) {
logger.info("Could not determine file type.");
}
// Fallback to the default content type if type could not be determined
if(contentType == null) {
contentType = "application/octet-stream";
}
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType(contentType))
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
.body(resource);
}
}
| [
"lukman@lukmanjaji.com"
] | lukman@lukmanjaji.com |
27103d4ec1c20d077b21ef97285169647330b8c8 | 9b08be559eee78c3d564c5c4dc50dbc6c0d8b2e7 | /telenet/src/main/java/cn/dyt/service/OrderServiceImpl.java | 01425cfe41b924665f296040d635ad5829f8701d | [] | no_license | zhangymeng/telenetwork | 7944e95e87b66c7c0fc34a83f2a8fea3b7f6796b | 939e7160c6e1810060a2afbe7aec4d88a10e9892 | refs/heads/master | 2021-04-28T04:45:06.553932 | 2018-02-25T08:51:54 | 2018-02-25T08:51:54 | 122,166,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,825 | java | package cn.dyt.service;
import java.sql.Timestamp;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.dyt.dao.CustomerDao;
import cn.dyt.dao.OrderDao;
import cn.dyt.dao.PreferentialDao;
import cn.dyt.po.Customer;
import cn.dyt.po.Order;
import cn.dyt.po.Preferential;
import cn.dyt.util.Tools;
import cn.dyt.vo.IndexVo;
import cn.dyt.vo.OrderVo;
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderDao orderDao;
@Autowired
private CustomerDao customerDao;
@Autowired
private PreferentialDao preferentialDao;
@Override
public List<Order> findAll(IndexVo vo) {
List<Order> list = orderDao.findAll(vo);
for(Order o:list){
o.setName(o.getCustomer().getName());
if(o.getCustomer().getSex()==1){
o.setSex("男");
}else{
o.setSex("女");
}
o.setPhone(o.getCustomer().getPhone());
if(o.getPrefId()!=0){
o.setTitle(o.getPreferential().getTitle());
if(o.getPreferential().getType()==1){
o.setType("抵扣");
}else if(o.getPreferential().getType()==2){
o.setType("折扣");
}
o.setPref(o.getPreferential().getPref());
}
}
return list;
}
@Override
public Map<String, Object> del(IndexVo vo) {
boolean result = false;
String reason = "";
Order order = orderDao.getById(vo.getId());
Timestamp createDate = new Timestamp(System.currentTimeMillis());//当前时间
if(Timestamp.valueOf(order.getEndDate()+"-01 00:00:00").getTime()>createDate.getTime()){
reason = "订单未结束,请勿删除";
}else{
orderDao.del(vo);
result = true;
}
return Tools.resultMap(result, reason);
}
public void addOrder(OrderVo vo){
vo.setMoney(vo.getMoney()*vo.getNum());
//减去优惠券
Preferential preferential = preferentialDao.getById(vo.getPrefId());
if(preferential!=null){
if(preferential.getType()==1){
vo.setMoney(vo.getMoney()-preferential.getPref());
}else{
double mon = vo.getMoney()*((double)preferential.getPref()/10);
int money = (int) mon;
vo.setMoney(money);
}
}
orderDao.add(vo);
}
@Override
public Map<String, Object> add(OrderVo vo) {
boolean result = false;
String reason = "";
Customer cu = customerDao.getByPhone(vo.getPhone());
if(cu!=null){
vo.setcId(cu.getId());
//查询最后一条订单
Timestamp createDate = new Timestamp(System.currentTimeMillis());//当前时间
vo.setCreateDate(createDate);
Order order = orderDao.getNew(cu.getId());
if(order!=null){
if(Timestamp.valueOf(order.getEndDate()+"-01 00:00:00").getTime()>createDate.getTime()){
try {
vo.setStartDate(Tools.mathTimetamp(Timestamp.valueOf(order.getEndDate()+"-01 00:00:00"), 1));
vo.setEndDate(Tools.mathTimetamp(vo.getStartDate(),vo.getNum()));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
try {
vo.setStartDate(Tools.addAndSubtractDaysByCalendarTimetamp(1));
vo.setEndDate(Tools.mathTimetamp(vo.getStartDate(),vo.getNum()));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}else{
try {
vo.setStartDate(Tools.addAndSubtractDaysByCalendarTimetamp(1));
vo.setEndDate(Tools.mathTimetamp(vo.getStartDate(),vo.getNum()));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
addOrder(vo);
result = true;
}else{
reason = "该客户不存在";
}
return Tools.resultMap(result, reason);
}
}
| [
"530331466@qq.com"
] | 530331466@qq.com |
42664f3d37c1757f72e9e92c2e695806069aac2f | 03772edd7913eb319d5a9e409c75c303d5378a37 | /src/unspc/net/webservicex/package-info.java | 012652e4301edb1ce01d6df066f637babd0f29ff | [] | no_license | npgarcia/CloudMSC | e247c98b13c4bc3e69bef8380fe75d8b39f668a5 | 8cfbbd088b3480e0045b36f1590e0219bae7c225 | refs/heads/master | 2021-01-22T03:05:37.698512 | 2015-02-10T01:30:59 | 2015-02-10T01:30:59 | 30,568,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | /**
* The United Nations Standard Products and Services Code® (UNSPSC®) provides an open, global multi-sector standard for efficient, accurate classification of products and services. Search the code on this website to locate commodity codes that can be used by your company. The UNSPSC offers a single global classification system that can be used for: Company-wide visibility of spend analysis,Cost-effective procurement optimization, Full exploitation of electronic commerce capabilities
*
*/
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.webservicex.net/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package unspc.net.webservicex;
| [
"ngarcia@tacitknowledge.com"
] | ngarcia@tacitknowledge.com |
c2989eae8aca6b67de00d130dc4504d0d508580d | 380c988212649b021021b90e1fd5c1f548c5bfbb | /src/com/prepare/java8/streams/filter_foreach/DataBase.java | 18a09f2f1c5444c6b88a26116046e3a81ac78224 | [] | no_license | asksharmadeepak/prepare-java | 1342b1f9d5d029db1b403aecd46a11137159bb79 | b41ddda9fc6ceae8512a302617f14dff6b5f14c1 | refs/heads/master | 2023-08-20T16:07:59.442016 | 2021-10-30T18:22:19 | 2021-10-30T18:22:19 | 94,667,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.prepare.java8.streams.filter_foreach;
import java.util.ArrayList;
import java.util.List;
//DAO layer
public class DataBase {
public static List<Employee> getEmployees() {
List<Employee> list = new ArrayList<>();
list.add(new Employee(176, "Roshan", "IT", 600000));
list.add(new Employee(388, "Bikash", "CIVIL", 900000));
list.add(new Employee(470, "Bimal", "DEFENCE", 500000));
list.add(new Employee(624, "Sourav", "CORE", 400000));
list.add(new Employee(176, "Prakash", "SOCIAL", 1200000));
return list;
}
}
| [
"“deepak.asharma@springernature.com”"
] | “deepak.asharma@springernature.com” |
dab52a908cdd7b610ec3e3017c05b26d6d73fe47 | 119aa59e3f6ff8ea5b66227d6e1d77be51ee892d | /app/src/main/java/rchat/info/yourday_new/adapters/NamesAdapter.java | 76f0bf728828681dea20574864964c553a4f58b5 | [] | no_license | IAmProgrammist/YourDayAndroidClient | 975ed8dd0f3ed24e37322920478fb858cbecc874 | ce539a96ebfc9d091c7bfb74048614f760ad5623 | refs/heads/master | 2021-01-01T21:35:38.129653 | 2020-12-08T10:57:23 | 2020-12-08T10:57:23 | 239,349,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,247 | java | package rchat.info.yourday_new.adapters;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import rchat.info.yourday_new.R;
import rchat.info.yourday_new.containers.Names;
public class NamesAdapter extends BaseAdapter {
Names names;
Context ctx;
public NamesAdapter(Context ctx, Names names) {
this.names = names;
this.ctx = ctx;
}
@Override
public int getCount() {
return 4;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View view, ViewGroup parent) {
if (position == 0) {
DisplayMetrics display = ctx.getResources().getDisplayMetrics();
int height = display.heightPixels;
View v = View.inflate(ctx, R.layout.empty, null);
v.setEnabled(false);
v.setClickable(false);
v.setPadding(0, 0, 0, ((int) height / 6));
return v;
} else if (position == 1) {
View va = View.inflate(ctx, R.layout.names_header, null);
va.setEnabled(false);
va.setClickable(false);
return va;
} else if (position == 3) {
View vs = View.inflate(ctx, R.layout.empty, null);
vs.setEnabled(false);
vs.setClickable(false);
vs.setPadding(0, 0, 0, 100);
return vs;
} else {
view = View.inflate(ctx, R.layout.names_end, null);
String boys = "";
for (String a : names.boys) {
boys += "• " + a + ";" + "\n";
}
try {
boys = boys.substring(0, boys.length() - 2);
} catch (Exception e) {
}
String girls = "";
for (String a : names.girls) {
girls += "• " + a + ";" + "\n";
}
try {
girls = girls.substring(0, girls.length() - 2);
} catch (Exception e) {
}
if (boys.equals("")) {
view.findViewById(R.id.presentName).setVisibility(View.GONE);
view.findViewById(R.id.boys).setVisibility(View.GONE);
view.findViewById(R.id.imageView10).setVisibility(View.GONE);
((TextView) view.findViewById(R.id.girls)).setText(girls);
} else if (girls.equals("")) {
view.findViewById(R.id.presentName2).setVisibility(View.GONE);
view.findViewById(R.id.girls).setVisibility(View.GONE);
view.findViewById(R.id.imageView10).setVisibility(View.GONE);
((TextView) view.findViewById(R.id.boys)).setText(boys);
} else {
((TextView) view.findViewById(R.id.girls)).setText(girls);
((TextView) view.findViewById(R.id.boys)).setText(boys);
}
return view;
}
}
}
| [
"vladislav.pakhomov@bk.ru"
] | vladislav.pakhomov@bk.ru |
fa46d2f9d27704624f80482efce0c33df8064f9f | 4ac7a5a92e5b51bcc5904ff78366585eb62945c3 | /src/com/controller/FormController.java | 5ae3232773889c1576f6c64c47f1d634984eeab1 | [] | no_license | lizhaoyang888/mybook-server | 7f183e6e173e850d9445e9d3783aea09507baff9 | c52bc2a8b65088be73682eaf421d9afc7964bcbc | refs/heads/master | 2020-03-24T03:41:57.901278 | 2018-07-26T11:08:23 | 2018-07-26T11:08:23 | 142,429,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package com.controller;
import com.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/*
* 动态页面跳转控制器
*/
@Controller
public class FormController {
@RequestMapping(value="/{formName}")
public String loginForm(@PathVariable String formName){
// 动态跳转页面
return formName;
}
@RequestMapping(value = "/addUser")
public ModelAndView addUser(ModelAndView mv){
User user = new User();
mv.addObject("user",user);
mv.setViewName("insertForm");
return mv;
}
}
| [
"834560891@qq.com"
] | 834560891@qq.com |
9ff0ffe7876c5d786d6dc75786fc015cb8539fb4 | 305d851706549dfa30471682d642bb862d5b6af6 | /src/main/java/be/vdab/TableServlet.java | 3041988831a09113c42c84da7c5032e73b1dcac2 | [] | no_license | JonathanPeypops/servlets-ex | 8ed04d720f67b775cb59865bd8d562b7c78a396a | 4c9d2cae228fb4d4c02322d4eb774c4ea66f8696 | refs/heads/master | 2020-04-05T23:19:24.664500 | 2015-06-25T09:25:50 | 2015-06-25T09:25:50 | 37,909,152 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,233 | java | package be.vdab;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet(urlPatterns = "/multiply")
public class TableServlet extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head><title>Multiply</title><link href=\"style.css\"/></head>");
out.println("<meta charset=\"UTF-8\">");
out.println("<body>");
out.println("<h1>Table</h1>");
printTable(out);
out.println("</body></html>");
}
private void printTable(PrintWriter out){
out.println("<table>");
for(int x=1; x<=25;x++){
out.println("<tr>");
for( int y=1; y<=25;y++){
out.println("<td>" + x * y + "</td>");
}
out.println("</tr>");
}
out.println("</table>");
}
}
| [
"jonathanpeypops@msn.com"
] | jonathanpeypops@msn.com |
fee41ffe1caba6b315ace474aed3fa2ab65bdf96 | fedb78a8f3505182cc42eab982834fb58c8cb7e3 | /JuegoWarlux/src/main/java/com/warlux/domain/objetos/items/ITunelMeta.java | fa9a82a6c393e8d9198eb575536e3f19271d12c0 | [] | no_license | warlux/repWarlux | c9fe01b09d50d37db8ace9294225236829bbe7b2 | 2ce8ef70f53cdfb6664c53c12b62a53d042f35c1 | refs/heads/master | 2016-09-05T10:29:28.577838 | 2012-12-27T20:37:31 | 2012-12-27T20:37:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package com.warlux.domain.objetos.items;
import javax.swing.ImageIcon;
import com.warlux.domain.objetos.ItemEfecto;
public class ITunelMeta extends Item {
public ITunelMeta() {
super();
imagen = new ImageIcon("src/main/resources/modeloObjetos/iTunelMeta.png");
permanente = true;
nombre = "tunelMeta";
efecto = new ItemEfecto();
efecto.setRestringirAcceso(true);
}
@Override
public void cambiarImagenActivada() {
imagen = new ImageIcon(
"src/main/resources/modeloObjetos/iTunelMeta.png");
}
@Override
public void cambiarImagenCondicional() {
imagen = new ImageIcon(
"src/main/resources/modeloObjetos/iTunelMetaAbierto.png");
}
}
| [
"Warlux@Leviathan"
] | Warlux@Leviathan |
1e81360a40c00ce38c47d671619f251f359cc4a0 | 501f10009f6c3f2c2698eb7f51f5eabfd3ff777d | /src/main/java/com/example/OnlineQueueSS/Bootstrap/BootFillialDepartment.java | 7aa97c53067423add099f55e41d96ba70eb4a2a1 | [] | no_license | Turdubaeverkin/OnlineQueueSS | 23ba07fba2faab70b8524656818d9cf394df0085 | d8a5235c03c88e8f55d6b96a615297a4fc7202ff | refs/heads/master | 2020-05-18T07:58:13.269014 | 2019-04-30T14:58:45 | 2019-04-30T14:58:45 | 184,282,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,238 | java | package com.example.OnlineQueueSS.Bootstrap;
import com.example.OnlineQueueSS.Entity.Category;
import com.example.OnlineQueueSS.Entity.Department;
import com.example.OnlineQueueSS.Entity.Fillial;
import com.example.OnlineQueueSS.Services.DepartmentService;
import com.example.OnlineQueueSS.Services.FillialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public class BootFillialDepartment implements CommandLineRunner {
@Autowired
private FillialService fillialService;
@Autowired
private DepartmentService departmentService;
@Override
public void run(String... args) throws Exception {
Category category = new Category("BANKS");
Department department1 = new Department("DemiBank", category);
Department department2 = new Department("Optima", category);
Department department3 = new Department("PCK", category);
Fillial fillial1 = new Fillial("HEAD", "BishkekPark", department1);
Fillial fillial2 = new Fillial("HEAD", "Ala Archa", department2);
Fillial fillial3 = new Fillial("HEAD", "Asia Mall", department3);
}
} | [
"ovganoverkinbek@mail.ru"
] | ovganoverkinbek@mail.ru |
f2f519651464966837efd1699876980a3a2905e8 | c1539b5c1f5874dbb23d3cf5a93c5c2b6cc929e1 | /app/src/main/java/com/example/shivang/contacts/MainActivity.java | d6b74347007bb7bc565c3a36a5d18ac8c3d68d10 | [] | no_license | shivangchopra11/Contacts_App | f3c80cad0b601fafae21f9310429eb324d8952c4 | 34f22787df89c21d0bad5074e581664cbb7a2359 | refs/heads/master | 2020-12-02T16:12:56.987192 | 2017-07-10T00:36:38 | 2017-07-10T00:36:38 | 96,519,164 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,407 | java | package com.example.shivang.contacts;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.provider.SyncStateContract;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
ListView listView;
ArrayList<Contact> contactList;
CustomArrayAdapter contactAdapter;
//static int ctr = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
listView = (ListView)findViewById(R.id.listview);
contactList = new ArrayList<>();
// for(int i=0;i<5;i++) {
// Contact c = new Contact();
// c.name = "SHIVANG";
// c.category = "WORK";
// c.number = "7838826129";
// contactList.add(c);
// }
listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,final int position, long id) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("DELETE");
builder.setMessage("Are you sure you want to delete ??");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Log.i("TAG", "Removing position " + position);
// contactList.remove(position);
// contactAdapter.notifyDataSetChanged();
String name = contactList.get(position).name;
ContactOpenHelper contactOpenHelper = ContactOpenHelper.getOpenHelperInstance(MainActivity.this);
SQLiteDatabase database = contactOpenHelper.getWritableDatabase();
String whereClause = ContactOpenHelper.CONTACT_NAME + "=?";
String[] whereArgs = new String[] {name};
database.delete(contactOpenHelper.CONTACT_TABLE_NAME, whereClause, whereArgs);
updateExpenseList();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
return true;
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent i = new Intent();
i.setClass(MainActivity.this,Edit_Contact.class);
i.putExtra("name",contactList.get(position).name);
i.putExtra("mail",contactList.get(position).email);
i.putExtra("number",contactList.get(position).number);
i.putExtra("category",contactList.get(position).category);
i.putExtra("id",contactList.get(position).id);
i.putExtra("pos",position);
Log.i("TAG","Sent numbers" + contactList.get(position).name + contactList.get(position).id);
MainActivity.this.startActivityForResult(i,1);
//MainActivity.this.startActivity(i);
}
});
contactAdapter = new CustomArrayAdapter(this,contactList);
listView.setAdapter(contactAdapter);
updateExpenseList();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent();
i.setClass(MainActivity.this,Add_Contact.class);
MainActivity.this.startActivityForResult(i,2);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Intent i = new Intent(this,SettingsActivity.class);
startActivity(i);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode==1) {
if (resultCode == RESULT_OK) {
//startActivity(new Intent(data));
// int pos = data.getIntExtra("pos",0);
//
// Contact c1 = new Contact();
// c1.name = data.getStringExtra("name");
// c1.email = data.getStringExtra("mail");
// c1.number = data.getStringExtra("number");
// c1.category = data.getStringExtra("category");
//
// contactList.set(pos,c1);
// contactAdapter.notifyDataSetChanged();
updateExpenseList();
}
}
if(requestCode==2) {
if (resultCode == RESULT_OK) {
//startActivity(new Intent(data));
// Contact c1 = new Contact();
// c1.name = data.getStringExtra("name");
// c1.email = data.getStringExtra("mail");
// c1.number = data.getStringExtra("number");
// c1.category = data.getStringExtra("category");
// Log.i("TAG1", "Editing position " + c1.name);
// contactList.add(c1);
// contactAdapter.notifyDataSetChanged();
updateExpenseList();
}
}
}
private void updateExpenseList() {
ContactOpenHelper contactOpenHelper = ContactOpenHelper.getOpenHelperInstance(this);
contactList.clear();
SQLiteDatabase database = contactOpenHelper.getReadableDatabase();
Cursor cursor = database.query(ContactOpenHelper.CONTACT_TABLE_NAME,null,null,null,null, null, null);
Log.i("TAG1", "Found Querry ");
if(cursor != null) {
while(cursor.moveToNext()){
String name = cursor.getString(cursor.getColumnIndex(contactOpenHelper.CONTACT_NAME));
String number = cursor.getString(cursor.getColumnIndex(contactOpenHelper.CONTACT_NUMBER));
int id = cursor.getInt(cursor.getColumnIndex(contactOpenHelper.CONTACT_ID));
String email = cursor.getString(cursor.getColumnIndex(contactOpenHelper.CONTACT_EMAIL));
String category = cursor.getString(cursor.getColumnIndex(contactOpenHelper.CONTACT_CATEGORY));
Log.i("TAG1", "Found Querry " + name + number + email + id);
Contact e = new Contact();
e.name = name;
e.number = number;
e.email = email;
e.category = category;
e.id =id;
contactList.add(e);
}
contactAdapter.notifyDataSetChanged();
}
}
}
| [
"shivangchopra11@gmail.com"
] | shivangchopra11@gmail.com |
6a0eb2d89d791b5a52f14f00e55bfe04fdeefbb4 | 60239bb1ae7ecc2ce30738db51ad97688c4a669a | /src/main/java/juli/domain/User.java | 1d54da1a5b9e23a1681e134a5587f48a80e9eaa7 | [] | no_license | pangfei0/MyWeb | f4a62c3685fb177d27041e28dc70367c00e527e5 | 45e5d9690cff9af944da04d9f69c26b41afadf08 | refs/heads/master | 2020-09-21T20:27:54.334975 | 2016-10-03T02:43:52 | 2016-10-03T02:43:52 | 67,504,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,683 | java | package juli.domain;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class User extends BaseEntity {
@Column(nullable = false)
private String userName;
@Column(nullable = false)
private String password;
@Column
private String nick;
@Column
private String email;
@Column
private String telephone;
//添加公司
@Column
private String companyId;
//添加公司类型
@Column
private String companyType;
//添加人员状态 0代表不在用,1代表在用
@Column
private String inUse;
//添加申请状态 0代表已审核通过,1代表正在申请
@Column
private String isDemand;
/**
* 经度
*/
@Column
private Double lng;
/**
* 纬度
*/
@Column
private Double lat;
//代表用户与微信端绑定的唯一标示openid
@Column
private String openid;
@ManyToOne
private Organization organization;
@ManyToMany(fetch = FetchType.LAZY)
private List<Role> roles = new ArrayList<>();
public String getIsDemand() {
return isDemand;
}
public void setIsDemand(String isDemand) {
this.isDemand = isDemand;
}
public String getInUse() {
return inUse;
}
public void setInUse(String inUse) {
this.inUse = inUse;
}
public String getCompanyType() {
return companyType;
}
public void setCompanyType(String companyType) {
this.companyType = companyType;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyId() {
return companyId;
}
public User() {
}
public User(String userName, String password) {
this.userName = userName;
this.password = password;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Organization getOrganization() {
return organization;
}
public void setOrganization(Organization organization) {
this.organization = organization;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public Double getLng() {
return lng;
}
public void setLng(Double lng) {
this.lng = lng;
}
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
@Override
public int hashCode() {
return this.getId().length();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof User)) {
return false;
}
if (obj == this) {
return true;
}
return this.getId().equals(((User) obj).getId());
}
}
| [
"18915104282@163.com"
] | 18915104282@163.com |
0fe62e6b2eaf5231b3be4ff536779f7494436c26 | 0bd31201e543a28e5b6d55db3441f5c65173b08a | /client/src/main/java/ru/alex/st/messanger/stub/TCPServerSelector.java | d14c2e987bd0e059b0841ad539fd4e6eab14c666 | [] | no_license | Alexst1989/Socket-train | fa161f855043f114209ef6e31c6ea44762d92bf2 | ae0838fea8ce93d87b05c15320af89a97aa34b83 | refs/heads/master | 2020-03-07T20:48:48.793620 | 2019-09-07T07:33:54 | 2019-09-07T07:33:54 | 127,707,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,800 | java | package ru.alex.st.messanger.stub;
import ru.alex.st.messanger.example.EchoSelectorProtocol;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.util.Iterator;
public class TCPServerSelector {
private static final int BUFSIZE = 256; // Buffer size (bytes)
private static final int TIMEOUT = 3000; // Wait timeout (milliseconds)
public static void main( String[] args ) throws IOException {
args = new String[]{ "9887" };
if ( args.length < 1 ) { // Test for correct # of args
throw new IllegalArgumentException( "Parameter(s): <Port> ..." );
}
// Create a selector to multiplex listening sockets and connections
Selector selector = Selector.open();
// Create listening socket channel for each port and register selector
for ( String arg : args ) {
ServerSocketChannel listnChannel = ServerSocketChannel.open();
listnChannel.socket().bind( new InetSocketAddress( Integer.parseInt( arg ) ) );
listnChannel.configureBlocking( false ); // must be nonblocking to register
// Register selector with channel. The returned key is ignored
listnChannel.register( selector, SelectionKey.OP_ACCEPT );
}
// Create a handler that will implement the protocol
EchoSelectorProtocol protocol = new EchoSelectorProtocol( BUFSIZE );
while ( true ) { // Run forever, processing available I/O operations
// Wait for some channel to be ready (or timeout)
if ( selector.select( TIMEOUT ) == 0 ) { // returns # of ready chans
System.out.print( "." );
continue;
}
// Get iterator on set of keys with I/O to process
Iterator<SelectionKey> keyIter = selector.selectedKeys().iterator();
while ( keyIter.hasNext() ) {
SelectionKey key = keyIter.next(); // Key is bit mask
// Server socket channel has pending connection requests?
if ( key.isAcceptable() ) {
protocol.handleAccept( key );
}
// Client socket channel has pending data?
if ( key.isReadable() ) {
protocol.handleRead( key );
}
// Client socket channel is available for writing and
// key is valid (i.e., channel not closed)?
if ( key.isValid() && key.isWritable() ) {
protocol.handleWrite( key );
}
keyIter.remove(); // remove from set of selected keys
}
}
}
} | [
"alexpro45.dev@yandex.ru"
] | alexpro45.dev@yandex.ru |
7fd12f7b8db4e5dc2d934202a07ea3009b504adf | 977e4cdedd721264cfeeeb4512aff828c7a69622 | /ares.standard/src/test/java/cz/stuchlikova/ares/application/connector/AresRzpClientTestImpl.java | 2f8cf50890de333770626c8f9c3c3670e93057c7 | [] | no_license | PavlaSt/ares.standard | ed5b177ca7ca71173b7fa7490cf939f8c3e050fb | 1d3a50fa4397a490cfb4414f7bd94d5dcac1a45e | refs/heads/main | 2023-05-08T02:28:09.921215 | 2021-05-27T10:03:07 | 2021-05-27T10:03:07 | 346,669,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package cz.stuchlikova.ares.application.connector;
import cz.stuchlikova.ares.application.stub.rzp.AresDotazy;
import cz.stuchlikova.ares.application.stub.rzp.AresOdpovedi;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import javax.xml.bind.JAXB;
import java.io.InputStream;
@Component
@Primary
public class AresRzpClientTestImpl extends ClientBaseTest<AresOdpovedi> implements AresClient<AresOdpovedi, AresDotazy> {
@Override
public AresOdpovedi getAresResponse(AresDotazy dotazy) {
String ico = dotazy.getDotaz().get(0).getICO();
String url = "src/test/resources/getDtoRzpResponseByIco/ico=" + ico + ".xml";
return openXmlFileUnmarshalToObject(url);
}
@Override
AresOdpovedi unmarshalStringToObject(InputStream xmlResult) {
return JAXB.unmarshal(xmlResult, AresOdpovedi.class);
}
}
| [
"pavla.p.novotna@seznam.cz"
] | pavla.p.novotna@seznam.cz |
eb4de65663745a3baacae18458f2dd0cfdbf4835 | 5a97cf21d907b27e1fad652b8e94c6e4ed02ac30 | /petshop_ssm/src/main/java/com/petshop/dao/IPetstoreMapper.java | b354f8fe2d24eae8dc6ec37b2624dddc4e5f4227 | [] | no_license | yangshaguiyang/petshop_ssm | 92d89e5e84f2b0f23984507775d152bb8a20268c | f5821c8e0fa2591434f6e5c16d869768005250d3 | refs/heads/master | 2020-04-16T07:33:42.008508 | 2019-01-12T13:33:29 | 2019-01-12T13:33:29 | 165,391,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package com.petshop.dao;
import java.util.List;
import java.util.Map;
import com.petshop.model.Petstore;
public interface IPetstoreMapper {
int deleteByPrimaryKey(Integer id);
int insert(Petstore record);
int insertSelective(Petstore record);
Petstore selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Petstore record);
int updateByPrimaryKey(Petstore record);
List<Petstore> findByPage(Map<String,Object> map);
List<Petstore> getAll();
} | [
"1931485283@qq.com"
] | 1931485283@qq.com |
56f08df00c9358da8b4cfe95a8e238096f6db45e | d63bcd50e6b4fb15f5e8f5b28931cdbdae581eb3 | /Data/src/main/java/com/data/services/impl/ApplicationServiceImpl.java | 2a84c30a1c1d0928b09d46f13a0eef8d443c9928 | [] | no_license | suyognyati/OA_Cerebro | 46379b7c371875372e256b70e41ecba08b3c1779 | cfa8f24b5ff98cfd8431c777a688d3b2b167a8fa | refs/heads/master | 2021-04-28T06:57:15.502445 | 2018-05-31T17:57:38 | 2018-05-31T17:57:38 | 122,214,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,301 | java | package com.data.services.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.data.entities.College;
import com.data.entities.Application;
import com.data.entities.Student;
import com.data.poco.AppliedStudentPOCO;
import com.data.repository.ApplicationJpaRepository;
import com.data.services.ApplicationService;
@Service("applicationService")
public class ApplicationServiceImpl implements ApplicationService {
@Autowired
ApplicationJpaRepository applicationJpaRepository;
@Override
public Application save(Application application) {
return applicationJpaRepository.save(application);
}
@Override
public List<Application> getByStudentandCollege(Student student, College college) {
return applicationJpaRepository.findByStudentAndCollegeProgramMapCollege(student, college);
}
@Override
public void deleteById(Integer applicationId) {
applicationJpaRepository.delete(applicationId);
}
@Override
public List<AppliedStudentPOCO> getAppliedStudentListOfProgram(Integer collegeProgramMapId) {
return applicationJpaRepository.getMeritStudents(collegeProgramMapId);
}
@Override
public Application getById(Integer id) {
return applicationJpaRepository.findOne(id);
}
}
| [
"suyognyati@gmail.com"
] | suyognyati@gmail.com |
eef4ab74a34c106a81dff6a9cc82873b29fff1d7 | 98212db453a4937c7e16da68e701a6006cb0e1bf | /app/src/main/java/com/example/ryan/places/GetAllMarkers.java | f998d59b97b911ca969d45957b5beb4aa0a4d19f | [] | no_license | bradburyr1/db_android | 788afde0428969f0d09ea8ad628e9b8a58cadc10 | c97fb89c56aae58ef8430b6dd5cbc9532bcb809a | refs/heads/master | 2021-01-02T09:40:13.270721 | 2017-08-03T20:22:44 | 2017-08-03T20:22:44 | 99,270,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,949 | java | package com.example.ryan.places;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
//import org.json.simple.parser.JSONParser;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by Ryan on 7/20/2017.
*/
public class GetAllMarkers extends ListActivity {
public String rst = "";//will contain the json string
/*
//For progress dialog
/*private ProgressDialog ProgDial;
//Create a JSON Parser
JSONParser JPars = new JSONParser();
ArrayList<HashMap<String, String>> markerList;
*/
public void starter(){
Log.d("HELLO*************", "Starter");
fetch();
}
public void fetch() {
Log.d("HELLO*************", "Fetch");
FetchMarkersTask fmt = new FetchMarkersTask();
fmt.execute();
}
private class FetchMarkersTask extends AsyncTask<Void, Void, String> {
//////////////////////////////////
final String ip_address = "192.168.1.21";
final String project = "android_connect";
final String file = "get_all_locations.php";
String builtUri = "http://" + ip_address + "/" + project + "/" + file;
//@Override
protected void onPostExecute(String result){
MapsActivity ma = new MapsActivity();
ma.getLong(result);
}
@Override
protected String doInBackground(Void... params) {
HttpURLConnection urlConnection = null;
String response = "";
Log.d("HELLO*************", "doInBackground: " + builtUri);
try {
URL url = new URL(builtUri);
urlConnection = (HttpURLConnection) url.openConnection();
if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
BufferedReader input = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()), 8192);
String jsonResp = null;
while ((jsonResp = input.readLine()) != null) {
response = response.concat(jsonResp);
Log.d("HELLO*************", "While Loop");
Log.d("HELLO*************", "Response: " + response);
Log.d("HELLO*************", "jsonResp: " + jsonResp);
}
input.close();
}
} catch (IOException e) {
Log.d("HELLO*************", "HERES YOUR DANG STRING", e);
}
////////////
Log.d("JSON Line", response);
rst = response;//store the json string
///////////
return response;
}
//return response;
}
//////////////////////////////////
}
| [
"bradburyrp@gmail.com"
] | bradburyrp@gmail.com |
06e7b7a7d7d0081016dfa4158bd8ef4b620fab79 | 56ed96236b8efed3a9f26df1a07d938792b095d5 | /app/src/main/java/com/spacECE/spaceceedu/VideoLibrary/VideoLibrary_Free.java | 8112b127237ee2d850d2b89ce872f299d059bd9f | [] | no_license | sachin-mohite/SpacECEedu_Android | 4d91fb116fb39c6ca6f4c2d60d841939d8726f3a | ef632d3076f4749bd1ff76a003d5a1182d46a4f2 | refs/heads/master | 2023-07-15T22:41:38.432816 | 2021-08-30T11:58:29 | 2021-08-30T11:58:29 | 401,426,977 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,166 | java | package com.spacECE.spaceceedu.VideoLibrary;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.spacECE.spaceceedu.R;
import java.util.ArrayList;
public class VideoLibrary_Free extends Fragment {
private ArrayList<Topic> list= new ArrayList<>();
private ArrayList<Topic> rlist= new ArrayList<>();
private TextView tv_recentlyViewed;
private RecyclerView recyclerView;
private RecyclerView recentRecyclerView;
VideoLibrary_RecyclerViewAdapter_Free.RecyclerViewClickListener listener;
private VideoLibrary_RecyclerViewAdapter_recent.RecyclerViewClickListener rListener;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v= inflater.inflate(R.layout.fragment_video_library__free, container, false);
list = new ArrayList<>(VideoLibrary_Activity.freeTopicList);
rlist = new ArrayList<>(VideoLibrary_Activity.recentTopicList);
// Bundle extras = getIntent().getExtras();
// if(extras!= null){account_id=extras.getString("account_id");}
tv_recentlyViewed=v.findViewById(R.id.VL_Free_TextView_recentlyViewed);
recyclerView= v.findViewById(R.id.VL_free_RecycleView);
recentRecyclerView=v.findViewById(R.id.VL_recent_RecyclerView);
setAdapter(list);
if(!VideoLibrary_Activity.recentTopicList.isEmpty()){
setRAdapter(rlist);
tv_recentlyViewed.setVisibility(View.VISIBLE);
}
return v;
}
private void setRAdapter(ArrayList<Topic> topicList) {
Log.i("SetAdapter:","Working");
setOnRClickListener();
VideoLibrary_RecyclerViewAdapter_recent adapter = new VideoLibrary_RecyclerViewAdapter_recent(topicList,rListener);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this.getContext(),LinearLayoutManager.HORIZONTAL,false);
recentRecyclerView.setLayoutManager(layoutManager);
recentRecyclerView.setItemAnimator(new DefaultItemAnimator());
recentRecyclerView.setAdapter(adapter);
Log.i("Adapter", "Executed");
}
private void setOnRClickListener() {
rListener = new VideoLibrary_RecyclerViewAdapter_recent.RecyclerViewClickListener() {
@Override
public void onClick(View v, int position) {
Intent intent = new Intent(getContext(), TopicActivity.class);
intent.putExtra("topic_name", rlist.get(position).getTitle());
intent.putExtra("v_url", rlist.get(position).getV_URL());
intent.putExtra("discrp", rlist.get(position).getDesc());
intent.putExtra("status",rlist.get(position).getStatus());
intent.putExtra("v_id",rlist.get(position).getV_id());
intent.putExtra("comments", rlist.get(position).getCntcomment());
intent.putExtra("views", rlist.get(position).getViews());
intent.putExtra("like_count", rlist.get(position).getCntlike());
intent.putExtra("dislike_count", rlist.get(position).getCntdislike());
startActivity(intent);
}
};
}
private void setAdapter(ArrayList<Topic> myList) {
Log.i("SetAdapter:","Working");
setOnClickListener();
VideoLibrary_RecyclerViewAdapter_Free adapter = new VideoLibrary_RecyclerViewAdapter_Free(myList,listener);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(adapter);
Log.i("Adapter", "Executed");
}
private void setOnClickListener() {
listener = new VideoLibrary_RecyclerViewAdapter_Free.RecyclerViewClickListener() {
@Override
public void onClick(View v, int position) {
Intent intent = new Intent(getContext(), TopicActivity.class);
intent.putExtra("topic_name", list.get(position).getTitle());
intent.putExtra("v_url", list.get(position).getV_URL());
intent.putExtra("discrp", list.get(position).getDesc());
intent.putExtra("status",list.get(position).getStatus());
intent.putExtra("v_id",list.get(position).getV_id());
intent.putExtra("comments", list.get(position).getCntcomment());
intent.putExtra("views", list.get(position).getViews());
intent.putExtra("like_count", list.get(position).getCntlike());
intent.putExtra("dislike_count", list.get(position).getCntdislike());
startActivity(intent);
}
};
}
} | [
"awasthi.abhikant28@gmail.com"
] | awasthi.abhikant28@gmail.com |
88bbe7de87e1a7b28661cc7529826aa442aedbf2 | 538c3f1f0a3709b861eb348a0d0acce9b58a32f2 | /ClusterWrapper.java | ecac27857019a470936424b93388ca3bc2bb26b6 | [] | no_license | gasstim/CSC365-B-Tree | 6238bb64bc03263a2e0c54e70e74d973041e9a08 | 3084070569390e6d9bbbe003d76277a68ff7a1e4 | refs/heads/master | 2020-04-13T13:27:33.973384 | 2018-12-27T01:13:54 | 2018-12-27T01:13:54 | 163,231,154 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,303 | 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 csc365lab2;
import java.io.Serializable;
import java.util.ArrayList;
/**
*
* @author tim
*/
public class ClusterWrapper implements Serializable{
private ArrayList<Point> points;
private ArrayList<Cluster> clusters;
public ClusterWrapper() {
points = new ArrayList<>();
clusters = new ArrayList<>();
}
public void addPoints(Point p) {
points.add(p);
}
public int getNumClusters() {
return clusters.size();
}
public ArrayList<Cluster> getClusters() {
return clusters;
}
public void makeCluster(String centerKey, int in, Review cen) {
Cluster cluster = new Cluster();
Point centroid = new Point(centerKey, 350, 350, in);
cluster.center = centroid;
cluster.cent=cen;
clusters.add(cluster);
}
private ArrayList<Point> getCenters() {
ArrayList<Point> centers = new ArrayList<>();
for (Cluster cluster : clusters) {
Point point = cluster.center;
centers.add(point);
}
return centers;
}
}
| [
"tgass@oswego.edu"
] | tgass@oswego.edu |
722e6404c7ddd2717de31e1e3bd5a6f6bdd4ad77 | b93c7ba15d27f384f06e7d57681f471f349d0ffc | /src/main/java/ru/k0r0tk0ff/sequence/processor/domain/SequenceImpl.java | f50ebeac4ee088c18cff9d842799ff54fa941339 | [] | no_license | k0r0tk0ff/SequenceProcessor | 4d7cf00862486cdc2b18c854f2615b56edc4219a | feaa116c015f25b8bb88e31cfef0e5ad36b527d7 | refs/heads/master | 2020-03-19T05:23:54.154191 | 2018-06-30T08:15:56 | 2018-06-30T08:15:56 | 135,926,764 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package ru.k0r0tk0ff.sequence.processor.domain;
import java.util.Collection;
public class SequenceImpl implements Sequence {
private Collection<Integer> collection;
public SequenceImpl(Collection<Integer> collection) {
this.collection = collection;
}
public Collection<Integer> get() {
return collection;
}
}
| [
"korotkov34reg@gmail.com"
] | korotkov34reg@gmail.com |
74f9edf848aa3abc4cfd38d979a6077c45d83d39 | 0b414778ce42c2cfe4f212eaf5a185ac08569279 | /src/CountAndSay_38.java | a24e0f7276497fc3f42db95f539c786e396156f3 | [] | no_license | xiazhixuanc/LeetCode | 25416f361a83a4a20d5de17284617cef47f23747 | 983d2222e8c1252a98f477f585293af314bbe65f | refs/heads/master | 2021-08-30T18:32:20.813604 | 2017-12-19T01:17:38 | 2017-12-19T01:17:38 | 114,699,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java |
public class CountAndSay_38 {
public String countAndSay(int n){
if(n <= 0){
return null;
}
String s = "1";
StringBuilder sb = new StringBuilder();
sb.append("1");
int count = 0;
for(int i = 1; i < n; i++){
s = sb.toString();
sb.setLength(0);
count = 1;
char c = s.charAt(0);
for(int j = 1; j < s.length(); j++){
if(s.charAt(j) == c){
count++;
}
else{
sb.append(count);
sb.append(c);
c = s.charAt(j);
count = 1;
}
}
sb.append(count);
sb.append(c);
}
return sb.toString();
}
}
| [
"irene@YUJIEs-MBP.home"
] | irene@YUJIEs-MBP.home |
f425f77cfbd44974fbd0a3d5bb80636c7e49f1f5 | 1a54d4c45741998b0b66b921fc979c04a70e62ec | /src/main/java/com/example/tugas1/controller/PendudukController.java | 0f4d512e660aa4ee237e227051619a3c2fd4a8c7 | [] | no_license | apap-2017/tugas1_1506689383 | 9af720b4fd18a28ecbced32646b801784763b939 | 7b20656e357aa898b71609ddf888c22f5cd52a40 | refs/heads/master | 2021-07-15T01:02:41.842282 | 2017-10-22T16:43:01 | 2017-10-22T16:43:01 | 107,846,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,803 | java | package com.example.tugas1.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.example.tugas1.model.KecamatanModel;
import com.example.tugas1.model.KelurahanModel;
import com.example.tugas1.model.KotaModel;
import com.example.tugas1.model.PendudukModel;
import com.example.tugas1.service.DaerahService;
import com.example.tugas1.service.PendudukService;
@Controller
public class PendudukController {
@Autowired
PendudukService pendudukDAO;
@Autowired
DaerahService daerahDAO;
@RequestMapping("/penduduk")
public String view(Model model, @RequestParam(value = "nik", required = true) String nik) {
PendudukModel penduduk = pendudukDAO.selectPenduduk(nik);
String tes = (String) model.asMap().get("sukses");
if (tes != null) {
return "sukses";
}
if (penduduk != null) {
String lahir = penduduk.getTanggal_lahir();
model.addAttribute("lahir", lahir);
model.addAttribute("penduduk", penduduk);
model.addAttribute("title", "Lihat Penduduk");
return "view-penduduk";
} else {
model.addAttribute("nik", nik);
model.addAttribute("title", "Not Found");
model.addAttribute("error", "Penduduk tidak ditemukan");
return "not-found";
}
}
@RequestMapping("/")
public String index(Model model) {
model.addAttribute("title", "SI Kependudukan");
return "view";
}
@RequestMapping("/penduduk/tambah")
public String tambah(Model model) {
model.addAttribute("title", "Tambah Penduduk");
return "tambah-penduduk";
}
@RequestMapping(value = "/penduduk/tambah", method = RequestMethod.POST)
public String submitTambah(Model model, PendudukModel penduduk) {
if (pendudukDAO.tambahPenduduk(penduduk)) {
String sukses = "Penduduk dengan NIK " + penduduk.getNik() + " berhasil ditambahkan";
model.addAttribute("sukses", sukses);
model.addAttribute("title", "Tambah Penduduk");
return "sukses";
} else {
String error = "Penduduk gagal ditambahkan. Silahkan isi semua form.";
model.addAttribute("error", error);
model.addAttribute("title", "Tambah Penduduk");
return "tambah-penduduk";
}
}
@RequestMapping("/penduduk/ubah/{nik}")
public String update(Model model, @PathVariable(value = "nik") String nik) {
PendudukModel penduduk = pendudukDAO.selectPenduduk(nik);
if (penduduk != null) {
model.addAttribute("penduduk", penduduk);
model.addAttribute("title", "Ubah Penduduk");
return "ubah-penduduk";
} else {
model.addAttribute("nik", nik);
model.addAttribute("title", "Not Found");
model.addAttribute("error", "Penduduk Tidak Ditemukan");
return "not-found";
}
}
@RequestMapping(value = "/penduduk/ubah/{nik}", method = RequestMethod.POST)
public String submitUbah(Model model, @PathVariable(value = "nik") String nik, PendudukModel penduduk) {
if (pendudukDAO.ubahPenduduk(penduduk)) {
String sukses = "Penduduk dengan NIK " + penduduk.getNik() + " berhasil diubah";
model.addAttribute("sukses", sukses);
model.addAttribute("penduduk", penduduk);
model.addAttribute("title", "Ubah Penduduk");
return "sukses";
}
else {
String error = "Penduduk gagal diubah. Silahkan refresh halaman ini.";
model.addAttribute("error", error);
model.addAttribute("nik", nik);
model.addAttribute("title", "Tambah Penduduk");
return "ubah-penduduk";
}
}
@RequestMapping(value = "/penduduk/mati", method = RequestMethod.POST)
public ModelAndView nonaktif(RedirectAttributes redir, PendudukModel penduduk) {
ModelAndView modelAndView = new ModelAndView();
pendudukDAO.nonaktifPenduduk(penduduk);
String sukses = "Penduduk dengan NIK " + penduduk.getNik() + " sudah tidak aktif";
modelAndView.setViewName("redirect:/penduduk?nik=" + penduduk.getNik());
redir.addFlashAttribute("sukses", sukses);
return modelAndView;
}
@RequestMapping("/penduduk/cari")
public String cari(Model model, @RequestParam(value = "kt", required = false) String kt,
@RequestParam(value = "kc", required = false) String kc,
@RequestParam(value = "kl", required = false) String kl) {
List<KotaModel> kotas = daerahDAO.selectAllKota();
String akhir = "cari-1";
if (kt != null) {
List<KecamatanModel> kecamatans = daerahDAO.selectKecamatan(kt);
KotaModel kota = daerahDAO.getKota(kt);
model.addAttribute("kota", kota);
model.addAttribute("kt", kt);
model.addAttribute("kecamatans", kecamatans);
akhir = "cari-2";
if (kc != null) {
List<KelurahanModel> kelurahans = daerahDAO.selectKelurahan(kc);
KecamatanModel kecamatan = daerahDAO.getKecamatan(kc);
model.addAttribute("kecamatan", kecamatan);
model.addAttribute("kc", kc);
model.addAttribute("kelurahans", kelurahans);
akhir = "cari-3";
if (kl != null) {
KelurahanModel kelurahan = daerahDAO.getKelurahan(kl);
String judul = "Lihat Data Penduduk di " + kota.getNama_kota() + ", Kecamatan "
+ kecamatan.getNama_kecamatan() + ", Kelurahan " + kelurahan.getNama_kelurahan();
List<PendudukModel> penduduks = pendudukDAO.pendudukKelurahan(kl);
model.addAttribute("judul", judul);
model.addAttribute("penduduks", penduduks);
model.addAttribute("kl", kl);
akhir = "hasil-cari";
}
}
}
model.addAttribute("kotas", kotas);
model.addAttribute("title", "Cari Penduduk");
return akhir;
}
}
| [
"najwa.satirah@ui.ac.id"
] | najwa.satirah@ui.ac.id |
75e0d82fbc1584f9db7dbe9a79ddd692d100b1be | 1fe33cac3819ba7832c495677fa8d90ba51ca66c | /src/test/java/com/vc/web/rest/util/PaginationUtilUnitTest.java | e8424f32930c3166945ad122c8c9a95021eb55f7 | [] | no_license | valeriyc/ThreadNote | d353801d3b077084db2cf6d872115d53979e9a03 | dafbdc61c01ff5b29ba93a11cc0f02593df08a50 | refs/heads/master | 2021-01-16T17:55:13.449294 | 2017-08-11T11:06:16 | 2017-08-11T11:06:16 | 100,023,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,733 | java | package com.vc.web.rest.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.HttpHeaders;
/**
* Tests based on parsing algorithm in app/components/util/pagination-util.service.js
*
* @see PaginationUtil
*/
public class PaginationUtilUnitTest {
@Test
public void generatePaginationHttpHeadersTest() {
String baseUrl = "/api/_search/example";
List<String> content = new ArrayList<>();
Page<String> page = new PageImpl<>(content,new PageRequest(6, 50),400L);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, baseUrl);
List<String> strHeaders = headers.get(HttpHeaders.LINK);
assertNotNull(strHeaders);
assertTrue(strHeaders.size() == 1);
String headerData = strHeaders.get(0);
assertTrue(headerData.split(",").length == 4);
String expectedData = "</api/_search/example?page=7&size=50>; rel=\"next\","
+ "</api/_search/example?page=5&size=50>; rel=\"prev\","
+ "</api/_search/example?page=7&size=50>; rel=\"last\","
+ "</api/_search/example?page=0&size=50>; rel=\"first\"";
assertEquals(expectedData, headerData);
List<String> xTotalCountHeaders = headers.get("X-Total-Count");
assertTrue(xTotalCountHeaders.size() == 1);
assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L));
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
80b2c9d6d8f20d9ea2cdedf6de2e6ee6cf86c072 | a695eac710fe15bb64c86869dcedfb8e402a5001 | /fluent-mybatis-processor/src/main/java/cn/org/atool/fluent/processor/mybatis/base/IProcessor.java | 4f27c2251a225195cbb5d8f9dc48c7dc0bb04699 | [
"Apache-2.0"
] | permissive | atool/fluent-mybatis | 33e6eb3dccac0db264fcb3c531005d7a28ab7d20 | 500522573c82d470d33a1f347903597edad4808d | refs/heads/master | 2023-06-22T13:50:12.298938 | 2022-12-22T11:04:06 | 2022-12-22T11:04:06 | 218,672,433 | 789 | 84 | Apache-2.0 | 2023-06-15T09:18:27 | 2019-10-31T02:57:34 | Java | UTF-8 | Java | false | false | 310 | java | package cn.org.atool.fluent.processor.mybatis.base;
import javax.annotation.processing.Messager;
/**
* 编译器相关类
*
* @author darui.wu
*/
@SuppressWarnings({"unused"})
public interface IProcessor {
/**
* 返回Messager
*
* @return Messager
*/
Messager getMessager();
} | [
"darui.wu@163.com"
] | darui.wu@163.com |
f9984626f1cb2ffe6427d5976bcf7b6874508d01 | f5d2095477c79e5cc9d2ad4e1d214300c842b32b | /src/main/java/org/lilu/sns/web/controller/LoginController.java | de43dd7ad2915fafd3d62a8951e8ffbd22302d58 | [] | no_license | llnancy/sns-project | a206070357d081f7ed415f4748300890ca70a61a | ebab8db54c23a2571562e7f0b91c06c67674fb23 | refs/heads/master | 2022-12-10T11:06:57.640487 | 2019-02-25T07:01:54 | 2019-02-25T07:01:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,280 | java | package org.lilu.sns.web.controller;
import org.hibernate.validator.constraints.Length;
import org.lilu.sns.exception.EntityUpdateException;
import org.lilu.sns.pojo.Result;
import org.lilu.sns.pojo.ResultCode;
import org.lilu.sns.pojo.User;
import org.lilu.sns.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Map;
/**
* @Auther: lilu
* @Date: 2019/1/24
* @Description: 登录/注册功能控制器
*/
@RestController
@Validated
@RequestMapping("/user")
public class LoginController {
@Autowired
private UserService userService;
/**
* 登录
* @param loginString
* @param password 登录时不需要校验密码长度
* @param response
* @return
*/
@PostMapping("/login")
public Result login(@Length(min = 2,max = 32,message = "用户名或邮箱有误")
@RequestParam("loginString") String loginString,
@RequestParam("password") String password,
HttpServletResponse response) {
Result result = userService.login(loginString,password);
Map<String,Object> data = result.getData();
// 登录成功,发送cookie
if (data.containsKey("ticket")) {
Cookie cookie = new Cookie("ticket",String.valueOf(data.get("ticket")));
cookie.setPath("/");
// 下发cookie到浏览器客户端
response.addCookie(cookie);
// 删除响应信息中ticket内容
data.remove("ticket");
}
return result;
}
/**
* 注册
* @param user 若校验失败,则抛出异常,由MyExceptionHandler类进行全局的异常处理。
* @param result 必须要写该参数,否则不会抛出ConstraintViolationException异常。
* @return
*/
@PostMapping("/register")
public Result register(@Valid User user, BindingResult result) {
// if (result.hasErrors()) {
// // 服务端校验数据
// Map<String,Object> errors = new HashMap<>();
// List<FieldError> fieldErrors = result.getFieldErrors();
// for (FieldError fieldError : fieldErrors) {
// logger.error("注册异常-->" + fieldError.getField() + " : " + fieldError.getDefaultMessage());
// errors.put(fieldError.getField(),fieldError.getDefaultMessage());
// }
// return Result.info(ResultCode.REGISTER_FAIL).put("fieldErrors",errors);
// } else {
// return userService.register(user);
// }
return userService.register(user);
}
/**
* 退出登录
* @param ticket
* @return
*/
@GetMapping("/logout")
public Result logout(@CookieValue("ticket") String ticket) {
if (userService.logout(ticket) != 1) {
throw new EntityUpdateException("异常:退出登录失败");
}
return Result.info(ResultCode.LOGOUT_SUCCESS);
}
} | [
"tclilu@lilu.org.cn"
] | tclilu@lilu.org.cn |
2c918f165c33aab9b2692a73c9d4eb51809f8f20 | 4df7b310b3ef3ac1417cec656d0242dad8c3ff18 | /app/src/main/java/com/bme/shawn/wobble/Simon.java | 7e7e529d2bb8230e57c36fa1063160f42745ace9 | [] | no_license | svolpe43/Wobble | ce1804e2449223d1ce9e66e17c17d2b7ea0ed79c | 672bb421c3a7590b56e2e937868be6d3a75666f6 | refs/heads/master | 2016-09-02T02:29:41.830305 | 2015-04-14T04:23:47 | 2015-04-14T04:23:47 | 26,848,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,382 | java | package com.bme.shawn.wobble;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.Log;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by shawn on 11/4/14.
*/
public class Simon {
// paints
private Paint mButtonPaint;
private Paint mRedPaint;
private Paint mGreenPaint;
private Paint mBluePaint;
private Paint mYellowPaint;
// paths
private Path mBluePath = new Path();
private Path mYellowPath = new Path();
private Path mGreenPath = new Path();
private Path mRedPath = new Path();
// ovals for drawing buttons
private RectF mOutterOval;
private RectF mInnerOval;
private float mInnerRadius;
private float mOuterRadius;
// Drawing Constants
private static final float X_PADDING = 20;
private static final float SWEEP_SPREAD = 10; // this is half of the total angle between buttons
private static final float BUTTON_ANGLE_SWEEP = 90 - 2 * SWEEP_SPREAD;
// constant buttons
public static final int NO_BUTTON = 0;
public static final int BLUE_BUTTON = 1;
public static final int YELLOW_BUTTON = 2;
public static final int GREEN_BUTTON = 3;
public static final int RED_BUTTON = 4;
// game statuses
public static final int GAME_OVER = -1;
public static final int GAME_RUNNING = 0;
public static final int GAME_PAUSED = 1;
public static final int GAME_RESTART = 2;
public static final int GAME_EXIT = 3;
// button polygons
private Polygon mRedPoly;
private Polygon mBluePoly;
private Polygon mYellowPoly;
private Polygon mGreenPoly;
// delay on the move cycles
private static final int STEP_TIME = 600;
// current status of the game
private int mStatus;
// time of previous animation update (ms)
private long mLastTime;
// animation is on
private boolean mShowingAnimation;
// a button is turned on
private boolean mButtonOn;
// the button that is on
private int mButton;
// top score this session
private int mTopScore;
// the current score
private int score;
// the current place in the sequence
private int index;
// game user message
private String message;
// sequence pattern
private ArrayList<Integer> pattern;
public Simon() {
// initiate pattern
pattern = new ArrayList<Integer>();
addMove();
// set up some status variables
mShowingAnimation = true;
mButtonOn = false;
mButton = 0;
index = 0;
mLastTime = System.currentTimeMillis() + 100;
mStatus = GAME_RUNNING;
message = "";
// set scores
mTopScore = 1;
score = 0;
// Simon button paint
mButtonPaint = new Paint();
mButtonPaint.setStyle(Paint.Style.FILL);
mButtonPaint.setAntiAlias(true);
mButtonPaint.setStrokeWidth(20);
// red paint
mRedPaint = new Paint(mButtonPaint);
mRedPaint.setARGB(255, 204, 0, 0);
// blue paint
mBluePaint = new Paint(mButtonPaint);
mBluePaint.setARGB(255, 51, 102, 255);
// yellow paint
mYellowPaint = new Paint(mButtonPaint);
mYellowPaint.setARGB(255, 255, 204, 0);
// green paint
mGreenPaint = new Paint(mButtonPaint);
mGreenPaint.setARGB(255, 77, 184, 112);
}
public void setRunning(){
mStatus = GAME_RUNNING;
}
public void setPaused(){
mStatus = GAME_PAUSED;
}
// returns the updated button to turn on
public int getButton(){
return mButton;
}
// returns the updated message
public String getMessage(){
return message;
}
// returns the current score
public String getScore(){
// todo give the top and current score here
return Integer.toString(score);
}
// update the game
public void update(int button) {
// catch game status
switch(mStatus) {
case GAME_RESTART:
reset();
break;
case GAME_OVER:
message = "Game Over";
break;
case GAME_EXIT:
message = "Exiting...";
}
// get current time
long now = System.currentTimeMillis();
// are we showing animation
if(mShowingAnimation){
updateAnimation(button, now);
} else{
handleUserInput(button, now);
}
}
// handles updating the game based current button contact and time
private void handleUserInput(int button, long now){
// finished all steps
if(index == score){
// add a move
addMove();
// update game state
index = 0;
mShowingAnimation = true;
mButtonOn = false;
// give animation a little delay
mLastTime = now + STEP_TIME;
// touching a button and pass delay
}else if(button != NO_BUTTON && !mButtonOn) {
// wrong
if (button != pattern.get(index)) {
// game over
mButton = NO_BUTTON;
mStatus = GAME_OVER;
message = "Game Over";
// correct
} else if (!mButtonOn){
mButton = button;
index++;
mButtonOn = true;
message = "Correct!";
}
mLastTime = now;
}else if(button == NO_BUTTON){
mButton = NO_BUTTON;
mButtonOn = false;
}
}
// updates the animation sequence
private void updateAnimation(int button, long now){
// give the graphics 100 ms to calculate (only when Simon object is first created)
if (mLastTime > now)
return;
// set up animation mode
if(button == NO_BUTTON && !mButtonOn) {
mButton = NO_BUTTON;
message = "watch...";
}
// update the animation
if (now - mLastTime > STEP_TIME){
if(index == score){
mButtonOn = false;
index = 0;
mButton = NO_BUTTON;
mShowingAnimation = false;
message = "Go!";
}else if(mButtonOn){
mButtonOn = false;
index++;
mButton = NO_BUTTON;
}else {
mButtonOn = true;
mButton = pattern.get(index);
}
mLastTime = now;
}
}
// adds a move to the
private void addMove(){
Random rand = new Random();
int button = rand.nextInt(4) + 1;
pattern.add(button);
score++;
}
// clears the pattern and restarts the game
public void reset(){
// set up some status variables
mShowingAnimation = true;
mButtonOn = false;
mButton = 0;
index = 0;
message = "Tap the screen to start";
// pause game
mStatus = GAME_PAUSED;
pattern.clear();
score = 0;
}
// returns the button that the accelerometer locator is touching
private int findContact(int x, int y){
// is it blue button
if(mBluePoly.contains(x, y))
return BLUE_BUTTON;
else if(mYellowPoly.contains(x, y))
return YELLOW_BUTTON;
else if(mGreenPoly.contains(x, y))
return GREEN_BUTTON;
else if(mRedPoly.contains(x, y))
return RED_BUTTON;
return NO_BUTTON;
}
// updates the screen adding STROKE to the specified paint
private void updateButtonPaint(int contact){
// Simon button out-line
switch(contact){
case 0:
mBluePaint.setStyle(Paint.Style.FILL);
mYellowPaint.setStyle(Paint.Style.FILL);
mGreenPaint.setStyle(Paint.Style.FILL);
mRedPaint.setStyle(Paint.Style.FILL);
break;
case 1:
mBluePaint.setStyle(Paint.Style.FILL_AND_STROKE);
mYellowPaint.setStyle(Paint.Style.FILL);
mGreenPaint.setStyle(Paint.Style.FILL);
mRedPaint.setStyle(Paint.Style.FILL);
break;
case 2:
mBluePaint.setStyle(Paint.Style.FILL);
mYellowPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mGreenPaint.setStyle(Paint.Style.FILL);
mRedPaint.setStyle(Paint.Style.FILL);
break;
case 3:
mBluePaint.setStyle(Paint.Style.FILL);
mYellowPaint.setStyle(Paint.Style.FILL);
mGreenPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mRedPaint.setStyle(Paint.Style.FILL);
break;
case 4:
mBluePaint.setStyle(Paint.Style.FILL);
mYellowPaint.setStyle(Paint.Style.FILL);
mGreenPaint.setStyle(Paint.Style.FILL);
mRedPaint.setStyle(Paint.Style.FILL_AND_STROKE);
break;
}
}
public void updateGraphics(int xCenter, int yCenter){
// resize Simon Oval
mOuterRadius = xCenter - X_PADDING;
mInnerRadius = (xCenter - X_PADDING)/2;
mOutterOval = new RectF(xCenter - mOuterRadius, yCenter - mOuterRadius, xCenter + mOuterRadius, yCenter + mOuterRadius);
mInnerOval = new RectF(xCenter - mInnerRadius, yCenter - mInnerRadius, xCenter + mInnerRadius, yCenter + mInnerRadius);
/*****************************************
* update yellow path
*******************************************/
mYellowPath.reset();
mYellowPath.addArc(mOutterOval, 90 + SWEEP_SPREAD / 2, BUTTON_ANGLE_SWEEP + SWEEP_SPREAD);
mYellowPath.arcTo(mInnerOval, 180 - SWEEP_SPREAD, -BUTTON_ANGLE_SWEEP);
mYellowPath.close();
// store yellow polygon
float[] yellow_x = new float[] {
xCenter - mOuterRadius,
xCenter - mInnerRadius,
xCenter - SWEEP_SPREAD,
xCenter - SWEEP_SPREAD
};
float[] yellow_y = new float[] {
yCenter + SWEEP_SPREAD,
yCenter + SWEEP_SPREAD,
yCenter + mInnerRadius,
yCenter + mOuterRadius
};
mYellowPoly = new Polygon(yellow_x, yellow_y, 4);
/******************************************
* update green path
********************************************/
mGreenPath.reset();
mGreenPath.addArc(mOutterOval, 180 + SWEEP_SPREAD / 2, BUTTON_ANGLE_SWEEP + SWEEP_SPREAD);
mGreenPath.arcTo(mInnerOval, 270 - SWEEP_SPREAD, -BUTTON_ANGLE_SWEEP);
mGreenPath.close();
// store green polygon
float[] green_x = new float[] {
xCenter - mInnerRadius,
xCenter - mOuterRadius,
xCenter - SWEEP_SPREAD,
xCenter - SWEEP_SPREAD
};
float[] green_y = new float[] {
yCenter - SWEEP_SPREAD,
yCenter - SWEEP_SPREAD,
yCenter - mOuterRadius,
yCenter - mInnerRadius
};
mGreenPoly = new Polygon(green_x, green_y, 4);
/******************************************
* update blue path
*********************************************/
mBluePath.reset();
mBluePath.addArc(mOutterOval, SWEEP_SPREAD / 2, BUTTON_ANGLE_SWEEP + SWEEP_SPREAD);
mBluePath.arcTo(mInnerOval, 90 - SWEEP_SPREAD, -BUTTON_ANGLE_SWEEP);
mBluePath.close();
// store blue polygon
float[] blue_x = new float[] {
xCenter + mInnerRadius,
xCenter + mOuterRadius,
xCenter + SWEEP_SPREAD,
xCenter + SWEEP_SPREAD
};
float[] blue_y = new float[] {
yCenter + SWEEP_SPREAD,
yCenter + SWEEP_SPREAD,
yCenter + mOuterRadius,
yCenter + mInnerRadius
};
mBluePoly = new Polygon(blue_x, blue_y, 4);
/*****************************************
* update red path
*********************************************/
mRedPath.reset();
mRedPath.addArc(mOutterOval, 270 + SWEEP_SPREAD / 2, BUTTON_ANGLE_SWEEP + SWEEP_SPREAD);
mRedPath.arcTo(mInnerOval, 0 - SWEEP_SPREAD, -BUTTON_ANGLE_SWEEP);
mRedPath.close();
// store red polygon
float[] red_x = new float[] {
xCenter + SWEEP_SPREAD,
xCenter + SWEEP_SPREAD,
xCenter + mOuterRadius,
xCenter + mInnerRadius
};
float[] red_y = new float[] {
yCenter - mInnerRadius,
yCenter - mOuterRadius,
yCenter - SWEEP_SPREAD,
yCenter - SWEEP_SPREAD
};
mRedPoly = new Polygon(red_x, red_y, 4);
}
}
/*
// draw
canvas.drawPath(mBluePath, mBluePaint);
canvas.drawPath(mYellowPath, mYellowPaint);
canvas.drawPath(mGreenPath, mGreenPaint);
canvas.drawPath(mRedPath, mRedPaint);
*/
| [
"svolpe43@gmail.com"
] | svolpe43@gmail.com |
f0823035e932f2724ea4c783f9ed51d84bca496f | 6ed23b65cf677b6e0ddf97f2f75a810bc1a8b42c | /src/main/java/base/hw6/animals/Animal.java | 591bf785ff946090c055b3cbe1c4d0f8953898dc | [] | no_license | Nati098/geek-java-core | dc4c25d685aef0f0e30f8fdbd861ae16639934ec | 3391b716ac842361a1cd45e189f535a48ba7d590 | refs/heads/master | 2022-12-27T13:24:47.156460 | 2020-10-12T19:39:48 | 2020-10-12T19:39:48 | 280,247,869 | 0 | 0 | null | 2020-10-12T19:39:49 | 2020-07-16T20:07:37 | Java | UTF-8 | Java | false | false | 1,107 | java | package base.hw6.animals;
public abstract class Animal {
protected int runThreshold = 0;
protected int swimThreshold = 0;
protected String name;
protected int age;
public Animal(String name, int age) {
this.name = name;
this.age = age;
}
protected void setThresholds(int run, int swim) {
this.runThreshold = run;
this.swimThreshold = swim;
}
public void run(int distance) {
if (distance > runThreshold) {
System.out.print(String.format("%s не пробежит\n", name));
}
else {
System.out.print(String.format("%s пробежал %d м\n", name, distance));
}
}
public void swim(int distance) {
if (distance > swimThreshold) {
System.out.print(String.format("%s не поплывет\n", name));
}
else {
System.out.print(String.format("%s проплыл %d м\n", name, distance));
}
}
@Override
public String toString() {
return String.format("Animal:\n%s, %d\n", name, age);
}
}
| [
"bogatyreva@bpcbt.com"
] | bogatyreva@bpcbt.com |
4400e475c9eaf955f29d4231d773201f5acc7d55 | 0f24f1133b44ee939fa9ce5ddad61f44a27dfcdd | /src/main/java/net/easyappsecurity/account/recovery/repository/PasswordResetTokenRepository.java | c60cd1059b4f605a2e00496a218195933f40acb0 | [] | no_license | Jzacha21/secure-account-recovery | 326aa2f976299e4b929d7c551f386d425a871af1 | 8fdeb163ab4660c75b33cdc2e81d6384fcf440d7 | refs/heads/master | 2022-01-06T20:08:03.074977 | 2018-05-14T15:09:45 | 2018-05-14T15:09:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package net.easyappsecurity.account.recovery.repository;
import net.easyappsecurity.account.recovery.domain.PasswordResetToken;
import java.util.Date;
public interface PasswordResetTokenRepository {
public PasswordResetToken save(PasswordResetToken token);
public PasswordResetToken update(PasswordResetToken token);
public PasswordResetToken getToken(String selector);
public void deleteExpiredSince(Date date);
public void delete(PasswordResetToken token);
}
| [
"mikhail.complete@gmail.com"
] | mikhail.complete@gmail.com |
2f1c929e9bb81606c039b293e8d87d7a13d3e050 | 8494c17b608e144370ee5848756b7c6ae38e8046 | /gulimall-coupon/src/main/java/com/atguigu/gulimall/coupon/controller/SkuLadderController.java | 7b4a0c039c5206252115304f1ac2a56ac945e8ce | [
"Apache-2.0"
] | permissive | cchaoqun/SideProject1_GuliMall | b235ee01df30bc207c747cf281108006482a778a | aef4c26b7ed4b6d17f7dcadd62e725f5ee68b13e | refs/heads/main | 2023-06-11T02:23:28.729831 | 2021-07-07T11:56:13 | 2021-07-07T11:56:13 | 375,354,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,301 | java | package com.atguigu.gulimall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.atguigu.gulimall.coupon.entity.SkuLadderEntity;
import com.atguigu.gulimall.coupon.service.SkuLadderService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.R;
/**
* 商品阶梯价格
*
* @author chengchaoqun
* @email chengchaoqun@gmail.com
* @date 2021-06-10 17:23:56
*/
@RestController
@RequestMapping("coupon/skuladder")
public class SkuLadderController {
@Autowired
private SkuLadderService skuLadderService;
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("coupon:skuladder:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = skuLadderService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("coupon:skuladder:info")
public R info(@PathVariable("id") Long id){
SkuLadderEntity skuLadder = skuLadderService.getById(id);
return R.ok().put("skuLadder", skuLadder);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("coupon:skuladder:save")
public R save(@RequestBody SkuLadderEntity skuLadder){
skuLadderService.save(skuLadder);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("coupon:skuladder:update")
public R update(@RequestBody SkuLadderEntity skuLadder){
skuLadderService.updateById(skuLadder);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("coupon:skuladder:delete")
public R delete(@RequestBody Long[] ids){
skuLadderService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| [
"chengchaoqun@hotmail.com"
] | chengchaoqun@hotmail.com |
57e984133fda75f9da6c82dd4cf0a894250c3f16 | e170556250bc3b1e8707b0c26aa10b923e47adbb | /app/src/main/java/com/udacity/sandwichclub/DetailActivity.java | a05e2ff4fe8671b812d10f7adca9f2c7f4edcfd6 | [] | no_license | SCasandra/SandwichClub | 7bae281d335e29b21a5c30123c9180e28f694465 | ebcf0a1e5ed9647eefbdbd098b1c65246f1104c9 | refs/heads/master | 2021-04-28T13:31:17.535989 | 2018-02-19T19:10:27 | 2018-02-19T19:10:27 | 122,106,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,381 | java | package com.udacity.sandwichclub;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import com.udacity.sandwichclub.model.Sandwich;
import com.udacity.sandwichclub.utils.JsonUtils;
import org.json.JSONException;
public class DetailActivity extends AppCompatActivity {
public static final String EXTRA_POSITION = "extra_position";
private static final int DEFAULT_POSITION = -1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
Intent intent = getIntent();
if (intent == null) {
closeOnError();
}
int position = intent.getIntExtra(EXTRA_POSITION, DEFAULT_POSITION);
if (position == DEFAULT_POSITION) {
// EXTRA_POSITION not found in intent
closeOnError();
return;
}
String[] sandwiches = getResources().getStringArray(R.array.sandwich_details);
String json = sandwiches[position];
Sandwich sandwich = null;
try {
sandwich = JsonUtils.parseSandwichJson(json);
} catch (JSONException e) {
e.printStackTrace();
}
if (sandwich == null) {
// Sandwich data unavailable
closeOnError();
return;
}
populateUI(sandwich);
}
private void closeOnError() {
finish();
Toast.makeText(this, R.string.detail_error_message, Toast.LENGTH_SHORT).show();
}
private void populateUI(Sandwich sandwich) {
/* Find the Views */
ImageView ingredientsIv = findViewById(R.id.image_iv);
TextView ingredients = findViewById(R.id.ingredients_tv);
TextView description = findViewById(R.id.description_tv);
TextView placeOfOrgin = findViewById(R.id.origin_tv);
TextView alsoKnownAs = findViewById(R.id.also_known_tv);
TextView alsoKnownTitle = findViewById(R.id.also_known);
TextView origin = findViewById(R.id.origin);
setTitle(sandwich.getMainName());
Picasso.with(this)
.load(sandwich.getImage())
.into(ingredientsIv);
if (sandwich.getIngredients() != null) {
String ingredientsString = sandwich.getIngredients().toString();
ingredients.setText(ingredientsString.substring(1, ingredientsString.length() - 1));
}
description.setText(sandwich.getDescription());
if (sandwich.getPlaceOfOrigin().isEmpty()) {
/* Hide the empty views */
origin.setVisibility(View.GONE);
placeOfOrgin.setVisibility(View.GONE);
} else {
placeOfOrgin.setText(sandwich.getPlaceOfOrigin());
}
if (sandwich.getAlsoKnownAs() != null) {
String alsoKnownAsString = sandwich.getAlsoKnownAs().toString();
alsoKnownAs.setText(alsoKnownAsString.substring(1, alsoKnownAsString.length() - 1));
} else {
/* Hide the empty views */
alsoKnownAs.setVisibility(View.GONE);
alsoKnownTitle.setVisibility(View.GONE);
}
}
}
| [
"casandra_sucala@yahoo.com"
] | casandra_sucala@yahoo.com |
6a3df82738730090c60dd9ade6e1f3a83261b259 | 624d12a1ded529db68360a5e692d4346ad85ed30 | /guli-order/src/main/java/com/shui/gulimall/order/entity/MqMessageEntity.java | 8b56f3f5cecb1e2867478c06e2675cc75144bffa | [] | no_license | ShuiLinzi/gulimall | 87d93de59f5288425e7250100b67c76bf70a863e | 779fdf6f3d841efd1f7758885bb9f2c9994885ce | refs/heads/main | 2023-08-23T23:26:31.434396 | 2021-10-14T11:50:59 | 2021-10-14T11:50:59 | 409,246,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 883 | java | package com.shui.gulimall.order.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* @author lin
* @email shuilinzi@qq.com
* @date 2021-08-30 11:32:40
*/
@Data
@TableName("mq_message")
public class MqMessageEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
private String messageId;
/**
* JSON
*/
private String content;
/**
*
*/
private String toExchange;
/**
*
*/
private String classType;
/**
* 0-新建 1-已发送 2-错误抵达 3-已抵达
*/
private Integer messageStatus;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
}
| [
"chenguoqinga@gmail.com"
] | chenguoqinga@gmail.com |
cecfd8db9a485151ab451fb1d27f6741b3b08e56 | 585bcecfc968816e5382175328bf53ea9460f49f | /dao/src/main/java/com/biz/train/enumaration/CommonStatusEnum.java | 4f2e030391e9ff01642bf0414f3450577cb8ce9a | [] | no_license | qq505877100/train-app | 5d05642188cd151d1c6558ee1f250743048b8a70 | 4e6bc520edf5b7be17ea08762cb8d5c4db4e2f43 | refs/heads/master | 2021-08-14T09:50:15.929503 | 2017-11-15T08:39:56 | 2017-11-15T08:39:56 | 110,807,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package com.biz.train.enumaration;
/**
* @author fuxianhui
* @Description:
* @Date: create in 13:58 2017/11/15
*/
public enum CommonStatusEnum {
ENABLE(1),DISABLE(0);
private int value;
CommonStatusEnum(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public boolean isEnable() {
return this.value == 1;
}
}
| [
"xianhui_fu@163.com"
] | xianhui_fu@163.com |
ba11b903adc7a69057f4397edc15a6127c23e236 | 49aef479b48ecaad839bbe293b75b07a9edda654 | /FormatCLASS/src/main/java/org/freeinternals/format/classfile/JavaSEVersion.java | 519e86e9c1320e7e191c5b1e79941a9821f772cf | [
"Apache-2.0"
] | permissive | george-latk/freeinternals | 1b774f75dd38c85359327a46d8c23e9d39ff17b9 | 344ea3793b47dfbce7dbfe7ce3a33bd6e325e35a | refs/heads/master | 2022-12-06T16:34:14.324430 | 2020-06-23T07:08:03 | 2020-06-23T07:08:03 | 272,042,231 | 0 | 0 | Apache-2.0 | 2020-06-13T16:08:20 | 2020-06-13T16:08:19 | null | UTF-8 | Java | false | false | 912 | java | /*
* JavaSEVersion.java June 4, 2019
*
* Copyright 2019, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.classfile;
/**
* Java SE platform version.
*
* @see
* <a href="https://docs.oracle.com/javase/specs/jvms/se12/html/jvms-4.html#jvms-4.1">The
* ClassFile Structure</a>
* @author Amos Shi
*/
public enum JavaSEVersion {
Version_1_0_2("1.0.2", 1),
Version_1_1("1.1", 1),
Version_5_0("5.0", 5),
Version_6("6", 6),
Version_7("7", 7),
Version_8("8", 8),
Version_9("9", 9),
Version_11("11", 11),
Version_12("12", 12),
Version_13("13", 13),
Version_14("14", 14),
Version_15("15", 15);
public final String name;
public final int majorVersion;
private JavaSEVersion(String name, int majorVersion) {
this.name = name;
this.majorVersion = majorVersion;
}
}
| [
"amosshi@users.noreply.github.com"
] | amosshi@users.noreply.github.com |
ea9aa4cbd47b044f4c667cd4b55a73cccf3f5cbe | 075a0802606ea01493129c5128234eb49967218c | /chapter10/src/difault/CompleteCalc.java | 407368f10b50726e35d043aecd0a6d63a6c82d51 | [] | no_license | larryback/java | 64455433ef1aa17431230e9b1eecc6691c733840 | 61088c81776f6cad243dd8595509b0b7c4d6027b | refs/heads/master | 2020-05-30T20:43:02.782788 | 2019-10-29T12:57:30 | 2019-10-29T12:57:30 | 189,954,428 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 440 | java | package difault;
public class CompleteCalc extends Calculator {
@Override
public int times(int num1, int num2) {
return num1 * num2;
}
@Override
public int divide(int num1, int num2) {
if(num2 != 0 )
return num1/num2;
else
return Calc.ERROR;
}
public void showInfo(){
System.out.println("Calc 인터페이스를 구현하였습니다" );
}
@Override
public void description() {
super.description();
}
}
| [
"41230266+larryback@users.noreply.github.com"
] | 41230266+larryback@users.noreply.github.com |
615cc5768899a872991f07767a3b79b8c7ff80be | 0d4bc72155d0d35d55562c9ea986a3e930510499 | /src/org/traccar/model/SNSMessage.java | 0822767864e1a34f3cd7d3e514eb8309ac674229 | [
"Apache-2.0"
] | permissive | sparselabs/GpsDataServer | 2c927bc0a239ddd8ae8192e29e303a829a7fb987 | b4fb4ce9dc2c51e2cce062570bc56a5f381d4730 | refs/heads/master | 2020-04-05T22:59:09.427880 | 2017-02-06T14:44:49 | 2017-02-06T14:44:49 | 30,155,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,373 | java | package org.traccar.model;
import java.util.Date;
/**
* Created by pankaj on 3/3/16.
*
*/
public class SNSMessage {
private double latitude;
private double longitude;
private double altitude;
private double speed;
private double course;
private double bearing;
private double accuracy;
private long createdAt;
private long updatedAt;
private String deviceId;
private String extendedInfo;
private String provider;
private String externalId;
public static SNSMessage fromPosition(Position position, String imei, String externalId){
SNSMessage message = new SNSMessage();
message.setLatitude(position.getLatitude());
message.setLongitude(position.getLongitude());
message.setAltitude(position.getAltitude()!=null?position.getAltitude():0);
message.setSpeed(position.getSpeed()!=null?position.getSpeed():0);
message.setCourse(position.getCourse()!=null?position.getCourse():0);
message.setCreatedAt(position.getStartTime().getTime());
message.setUpdatedAt(position.getTime().getTime());
message.setExtendedInfo(position.getExtendedInfo()!=null?position.getExtendedInfo():"");
message.setDeviceId(imei);
message.setExternalId(externalId);
message.setProvider("gps_tracker");
return message;
}
public String getExternalId() {
return externalId;
}
public void setExternalId(String externalId) {
this.externalId = externalId;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getAltitude() {
return altitude;
}
public void setAltitude(double altitude) {
this.altitude = altitude;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public double getCourse() {
return course;
}
public void setCourse(double course) {
this.course = course;
}
public double getBearing() {
return bearing;
}
public void setBearing(double bearing) {
this.bearing = bearing;
}
public double getAccuracy() {
return accuracy;
}
public void setAccuracy(double accuracy) {
this.accuracy = accuracy;
}
public long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(long createdAt) {
this.createdAt = createdAt;
}
public long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(long updatedAt) {
this.updatedAt = updatedAt;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getExtendedInfo() {
return extendedInfo;
}
public void setExtendedInfo(String extendedInfo) {
this.extendedInfo = extendedInfo;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
}
| [
"pankajb@gmail.com"
] | pankajb@gmail.com |
23a2a265b287b8eada70c6f908efd3a127d77d90 | 39bc4ae73f9599844ee83b58c3217f38f3009a8e | /app/src/main/java/in/pureway/cinemaflix/activity/privacysettings/PhotofitBadgeActivity.java | e0b86828ff2d9b430f4a15073bcfb46eaa3b752c | [] | no_license | Sagarinfosif/NaturalBornFool | 7c4e7f1b6cc630fd04aebad42a8f527a960c296f | 460a7864ed6f1360cb98a7b0750cf88a9b189814 | refs/heads/master | 2023-04-29T07:03:37.660322 | 2021-04-17T06:54:37 | 2021-04-17T06:54:37 | 358,805,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,179 | java | package in.pureway.cinemaflix.activity.privacysettings;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import in.pureway.cinemaflix.R;
import in.pureway.cinemaflix.adapters.AdapterBadges;
public class PhotofitBadgeActivity extends AppCompatActivity {
private RecyclerView recycler_badge;
private Activity activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photofit_badge);
activity = PhotofitBadgeActivity.this;
findiDs();
setRecycler();
}
private void setRecycler() {
AdapterBadges adapterBadges = new AdapterBadges(activity, new AdapterBadges.Select() {
@Override
public void choose(int position) {
}
});
recycler_badge.setAdapter(adapterBadges);
}
private void findiDs() {
recycler_badge = findViewById(R.id.recycler_badge);
}
public void backPress(View view) {
onBackPressed();
}
} | [
"omninos@12345"
] | omninos@12345 |
f72f0b261bd09cb019c5d489499ce6f993d13b60 | fe81fc24c5a527d48e072fd40b231f8e516eda47 | /src/java/org/datanucleus/cache/ehcache/EhcacheLevel2Cache.java | cfaf4744069c24026170aed14525184375101cf4 | [
"Apache-2.0"
] | permissive | nbartels/datanucleus-cache | 5c05589be6eafbd6d6b39b677f0aa19721ddfd3d | c89b8daa3f9da27e6acca4494af90a4b4e5b8e9d | refs/heads/master | 2021-01-23T03:54:06.258092 | 2014-01-21T20:36:15 | 2014-01-21T20:36:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,273 | java | /**********************************************************************
Copyright (c) 2005 Erik Bengtson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributors:
...
**********************************************************************/
package org.datanucleus.cache.ehcache;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import org.datanucleus.NucleusContext;
import org.datanucleus.PersistenceConfiguration;
import org.datanucleus.cache.AbstractLevel2Cache;
import org.datanucleus.cache.CachedPC;
import org.datanucleus.exceptions.NucleusException;
import org.datanucleus.identity.OID;
import org.datanucleus.metadata.AbstractClassMetaData;
import org.datanucleus.metadata.IdentityType;
import org.datanucleus.util.NucleusLogger;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheException;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import net.sf.ehcache.ObjectExistsException;
/**
* Simple implementation of a plugin for use of Ehcache caching product with DataNucleus.
* Please refer to <a href="http://ehcache.sourceforge.net">ehcache.sourceforge.net</a>
* for full details of their product.
*/
public class EhcacheLevel2Cache extends AbstractLevel2Cache
{
/** The cache manager */
private final CacheManager cacheManager;
/** The cache */
private final Cache cache;
/**
* Constructor.
* @param nucleusCtx Context
*/
public EhcacheLevel2Cache(NucleusContext nucleusCtx)
{
super(nucleusCtx);
PersistenceConfiguration conf = nucleusCtx.getPersistenceConfiguration();
String configFile = conf.getStringProperty("datanucleus.cache.level2.configurationFile");
try
{
if (configFile == null)
{
cacheManager = CacheManager.create();
}
else
{
cacheManager = CacheManager.create(CacheManager.class.getResource(configFile));
}
}
catch (CacheException e)
{
throw new NucleusException("Cant create cache", e);
}
if (!cacheManager.cacheExists(cacheName))
{
try
{
cacheManager.addCache(cacheName);
}
catch (IllegalStateException e)
{
NucleusLogger.CACHE.warn("Error creating Cache : " + e.getMessage());
throw new NucleusException("Cant create cache", e);
}
catch (ObjectExistsException e)
{
NucleusLogger.CACHE.warn("Error creating Cache : " + e.getMessage());
throw new NucleusException("Cant create cache", e);
}
catch (CacheException e)
{
NucleusLogger.CACHE.warn("Error creating Cache : " + e.getMessage());
throw new NucleusException("Cant create cache", e);
}
}
cache = cacheManager.getCache(cacheName);
}
/**
* Method to close the cache when no longer needed. Provides a hook to release resources etc.
*/
public void close()
{
if (clearAtClose)
{
evictAll();
}
cacheManager.shutdown();
}
/**
* Accessor for whether the cache contains the specified id.
* @see org.datanucleus.cache.Level2Cache#containsOid(java.lang.Object)
*/
public boolean containsOid(Object oid)
{
try
{
return (get(oid) != null);
}
catch (IllegalStateException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.containsOid : " + e.getMessage());
}
return false;
}
/**
* Accessor for an object in the cache.
* @see org.datanucleus.cache.Level2Cache#get(java.lang.Object)
*/
public CachedPC get(Object oid)
{
try
{
Element element = cache.get((Serializable) oid);
if (element == null)
{
return null;
}
return toPC(element);
}
catch (IllegalStateException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.get : " + e.getMessage());
}
catch (CacheException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.get : " + e.getMessage());
}
return null;
}
/**
* Convert from Element to a cacheable object
* @param object the Element
* @return the cacheable object
*/
private CachedPC toPC(Element object)
{
return (CachedPC)object.getObjectValue();
}
/**
* Convert from PersistenceCapable to Element
* @param oid the id
* @param object the PersistenceCapable
* @return the Element
*/
private Element toElement(Object oid, CachedPC object)
{
return new Element((Serializable) oid, object);
}
/**
* Accessor for the size of the cache.
* @see org.datanucleus.cache.Level2Cache#getSize()
*/
public int getSize()
{
try
{
return cache.getSize();
}
catch (IllegalStateException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.getSize : " + e.getMessage());
}
catch (CacheException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.getSize : " + e.getMessage());
}
return 0;
}
/**
* Accessor for whether the cache is empty
* @see org.datanucleus.cache.Level2Cache#isEmpty()
*/
public boolean isEmpty()
{
try
{
return cache.getSize() == 0;
}
catch (IllegalStateException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.isEmpty : " + e.getMessage());
}
catch (CacheException e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.isEmpty : " + e.getMessage());
}
return true;
}
/**
* Method to add an object to the cache under its id
* @param oid The identity
* @param pc The cacheable object
*/
public CachedPC put(Object oid, CachedPC pc)
{
if (oid == null || pc == null)
{
return null;
}
else if (maxSize >= 0 && getSize() == maxSize)
{
return null;
}
cache.put(toElement(oid, pc));
return pc;
}
/**
* Evict the parameter instance from the second-level cache.
* @param oid the object id of the instance to evict.
*/
public void evict(Object oid)
{
Object pc = get(oid);
if (pc != null)
{
cache.remove((Serializable) oid);
}
}
/**
* Evict the parameter instances from the second-level cache.
* All instances in the PersistenceManager's cache are evicted
* from the second-level cache.
*/
public void evictAll()
{
try
{
cache.removeAll();
}
catch (Exception e)
{
NucleusLogger.CACHE.warn("Error invoking Cache.clear : " + e.getMessage());
}
}
/**
* Evict the parameter instances from the second-level cache.
* @param pcClass the class of instances to evict
* @param subclasses if true, evict instances of subclasses also
*/
public void evictAll(Class pcClass, boolean subclasses)
{
if (!nucleusCtx.getApiAdapter().isPersistable(pcClass))
{
return;
}
evictAllOfClass(pcClass.getName());
if (subclasses)
{
String[] subclassNames = nucleusCtx.getMetaDataManager().getSubclassesForClass(pcClass.getName(), true);
if (subclassNames != null)
{
for (int i=0;i<subclassNames.length;i++)
{
evictAllOfClass(subclassNames[i]);
}
}
}
}
void evictAllOfClass(String className)
{
AbstractClassMetaData cmd =
nucleusCtx.getMetaDataManager().getMetaDataForClass(className, nucleusCtx.getClassLoaderResolver(null));
Iterator keyIter = cache.getKeys().iterator();
while (keyIter.hasNext())
{
Object key = keyIter.next();
if (cmd.getIdentityType() == IdentityType.APPLICATION)
{
String targetClassName = nucleusCtx.getApiAdapter().getTargetClassNameForSingleFieldIdentity(key);
if (className.equals(targetClassName))
{
keyIter.remove();
}
}
else if (cmd.getIdentityType() == IdentityType.DATASTORE && key instanceof OID)
{
OID oid = (OID)key;
if (className.equals(oid.getPcClass()))
{
keyIter.remove();
}
}
}
}
/**
* Evict the parameter instances from the second-level cache.
* @param oids the object ids of the instance to evict.
*/
public void evictAll(Collection oids)
{
if (oids == null)
{
return;
}
Iterator iter = oids.iterator();
while (iter.hasNext())
{
evict(iter.next());
}
}
/**
* Evict the parameter instances from the second-level cache.
* @param oids the object ids of the instance to evict.
*/
public void evictAll(Object[] oids)
{
if (oids == null)
{
return;
}
for (int i=0;i<oids.length;i++)
{
evict(oids[i]);
}
}
} | [
"andy@datanucleus.org"
] | andy@datanucleus.org |
85169623a5d0c04baf0f7d6ec36251fa0cb0c0fe | 46720f0a11c8c51af0aa9c489f28d976f7d23e73 | /src/server/vm2/PiBeaconSoilSensor.java | ed669e48fad38ff1fd3d4cad956d15fd30981876 | [] | no_license | DuncanCragg/NetMash | ccc074e0fb8ac5948d392913d08d78334803f3af | 796afe69b3a93e428666874625e800222fa5ef99 | refs/heads/master | 2021-01-17T04:39:48.987740 | 2018-11-27T13:15:49 | 2018-11-27T13:15:49 | 1,354,571 | 10 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,718 | java |
import java.util.*;
import java.io.*;
import java.net.*;
import java.util.regex.*;
import java.nio.file.*;
import java.nio.charset.*;
import cyrus.platform.*;
import cyrus.forest.*;
import static cyrus.lib.Utils.*;
/** Class to fetch the soil moisture level detected by a sensor on a Raspberry Pi and broadcast its URL through a BLE beacon.
*/
public class PiBeaconSoilSensor extends CyrusLanguage {
public PiBeaconSoilSensor(){
super("{ is: editable 3d notice soil moisture sensor\n"+
" title: \"Soil Moisture Sensor\"\n"+
" text: Waiting..\n"+
" rotation: 0 45 0\n"+
" scale: 1 1 1\n"+
" position: 0 0 0\n"+
" soil-moisture: 25\n"+
" within: http://localhost:8081/o/uid-41b6-5f8f-f143-b30d.json\n"+
"}\n", true);
}
private boolean running=false;
public void evaluate(){
if(!running){ running=true;
BLE.doAdvert(uid);
new Thread(){ public void run(){ doit(); }}.start();
}
super.evaluate();
notifying(content("within"));
}
void doit(){ try{
while(true){
Kernel.sleep(3000);
String ms=new String(Files.readAllBytes(Paths.get("/run/moisture.txt")));
Number n=findANumberIn(ms);
if(n==null) continue;
final int moisture=n.intValue();
logXX(moisture);
new Evaluator(this){ public void evaluate(){
contentInt("soil-moisture", moisture);
content("text", String.format("Soil Moisture: %d%%", moisture));
}};
}
}catch(Throwable t){ t.printStackTrace(); } }
}
| [
"cyrus@cilux.org"
] | cyrus@cilux.org |
eca23ccda46e661ef55587a93a70396f70acc35f | 2b5005fbc89fe6bde09d61600dd7252b31760396 | /Homework5/src/com/company/Main.java | bd57bdf121cf0dc6b8ec5752316fbc180469f2af | [] | no_license | tyssie/Projects | aa0516f293df1ce23a0c5eaf631e7ab07a9e5f77 | eb4d8696bfbb5237eafe17a0bda994aeef3168d4 | refs/heads/main | 2023-03-27T21:49:56.806710 | 2021-03-27T07:04:44 | 2021-03-27T07:04:44 | 343,953,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 893 | java | package com.company;
public abstract class Main {
public static void main(String[] args) {
Employee[] employees = new Employee[5];
employees[0] = new Employee("Jack Sparrow", "CEO", "jackSW@rambler.com", "15423221234", 300000, 42);
employees[1] = new Employee("Danny Beck", "Head of Logistic", "DDD13.12@google.com", "13246443212", 100000, 35);
employees[2] = new Employee("Nick Davidson", "Programmer", "dark_hacck@gmail.com", "17433456677", 70000, 26);
employees[3] = new Employee("Cecil Jameson", "Engineer", "JameTime@gmail.com", "18688872356", 80000, 51);
employees[4] = new Employee("Tom Fletcher", "Manager", "BigTommyGun@rambler.com", "12223465555", 75000, 30);
for (int i = 0; i < employees.length; i++) {
if (employees[i].getAge() > 40) {
employees[i].info();
}
}
}
}
| [
"lesha_25091995@mail.ru"
] | lesha_25091995@mail.ru |
346560ac3c6abb471b1809bd7428781ff88b1952 | ac9755d08b16d9a7ae3f7f97858889855068ad53 | /lang/lucene/src/main/java/org/carrot2/language/extras/BrazilianLanguageComponents.java | 85b5e25b595b5e809d12562fb78fe11abbcf495c | [
"LicenseRef-scancode-bsd-ack-carrot2",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | rahulanishetty/carrot2 | febaddececa6c18f435645ae74438e89561ab0ae | cb4adcc3b4ea030f4b64e2d0b881f43b51a90ae6 | refs/heads/master | 2022-02-19T03:18:34.730395 | 2022-01-10T08:32:00 | 2022-01-10T08:32:04 | 91,449,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,665 | java | /*
* Carrot2 project.
*
* Copyright (C) 2002-2021, Dawid Weiss, Stanisław Osiński.
* All rights reserved.
*
* Refer to the full license file "carrot2.LICENSE"
* in the root folder of the repository checkout or at:
* https://www.carrot2.org/carrot2.LICENSE
*/
package org.carrot2.language.extras;
import java.util.Objects;
import org.apache.lucene.analysis.br.BrazilianStemmer;
import org.carrot2.language.ExtendedWhitespaceTokenizer;
import org.carrot2.language.SingleLanguageComponentsProviderImpl;
import org.carrot2.language.Stemmer;
import org.carrot2.language.Tokenizer;
import org.carrot2.text.preprocessing.LabelFormatter;
import org.carrot2.text.preprocessing.LabelFormatterImpl;
/** */
public class BrazilianLanguageComponents extends SingleLanguageComponentsProviderImpl {
public static final String NAME = "Brazilian";
public BrazilianLanguageComponents() {
super("Carrot2 (" + NAME + " support via Apache Lucene components)", NAME);
registerResourceless(Tokenizer.class, ExtendedWhitespaceTokenizer::new);
registerResourceless(LabelFormatter.class, () -> new LabelFormatterImpl(" "));
registerDefaultLexicalData();
registerResourceless(
Stemmer.class, () -> new LuceneStemmerAdapter(new BrazilianStemmerAdapter()::stems, 5));
}
private class BrazilianStemmerAdapter extends BrazilianStemmer {
public int stems(char[] chars, int len) {
String word = new String(chars, 0, len);
String stem = super.stem(word);
if (Objects.equals(word, stem)) {
return len;
} else {
stem.getChars(0, stem.length(), chars, 0);
return stem.length();
}
}
}
}
| [
"dawid.weiss@carrotsearch.com"
] | dawid.weiss@carrotsearch.com |
7b4ff48963aa97c5bff75a649996c37d529f79d3 | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateNotebookInstanceResult.java | e73ceb59ff59bfc7eef5db8131dd515099e69a4f | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 4,169 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.sagemaker.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateNotebookInstance" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateNotebookInstanceResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* The Amazon Resource Name (ARN) of the notebook instance.
* </p>
*/
private String notebookInstanceArn;
/**
* <p>
* The Amazon Resource Name (ARN) of the notebook instance.
* </p>
*
* @param notebookInstanceArn
* The Amazon Resource Name (ARN) of the notebook instance.
*/
public void setNotebookInstanceArn(String notebookInstanceArn) {
this.notebookInstanceArn = notebookInstanceArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the notebook instance.
* </p>
*
* @return The Amazon Resource Name (ARN) of the notebook instance.
*/
public String getNotebookInstanceArn() {
return this.notebookInstanceArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the notebook instance.
* </p>
*
* @param notebookInstanceArn
* The Amazon Resource Name (ARN) of the notebook instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNotebookInstanceResult withNotebookInstanceArn(String notebookInstanceArn) {
setNotebookInstanceArn(notebookInstanceArn);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getNotebookInstanceArn() != null)
sb.append("NotebookInstanceArn: ").append(getNotebookInstanceArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateNotebookInstanceResult == false)
return false;
CreateNotebookInstanceResult other = (CreateNotebookInstanceResult) obj;
if (other.getNotebookInstanceArn() == null ^ this.getNotebookInstanceArn() == null)
return false;
if (other.getNotebookInstanceArn() != null && other.getNotebookInstanceArn().equals(this.getNotebookInstanceArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNotebookInstanceArn() == null) ? 0 : getNotebookInstanceArn().hashCode());
return hashCode;
}
@Override
public CreateNotebookInstanceResult clone() {
try {
return (CreateNotebookInstanceResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
d189633c35f54cdc12ee0d533640b583128bbac5 | 951afc432822583987ee1bd2374db4949aeea4c1 | /src/edu/northeastern/oaset/demoXXIsThisATree.java | e69237c6c4fda1d651964fd7d7644c90b30a4049 | [] | no_license | Joe-Ngan/LeetCode | 78dff67a6fe04220698891f6b56329b068fd7c82 | fae2bed8edd19ee9212eb7111f40cb2eb986258b | refs/heads/master | 2023-08-26T13:36:32.040551 | 2021-11-06T05:45:00 | 2021-11-06T05:45:00 | 411,762,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,163 | java | package edu.northeastern.oaset;
import java.util.HashSet;
public class demoXXIsThisATree {
public static void main(String[] args) {
String s = "(A,B) (A,C) (B,D) (D,C)";
System.out.println(GetSExpression(s));
}
public static String GetSExpression(String s){
boolean graph[][] = new boolean[26][26];
HashSet<Character> nodes = new HashSet<>();
//construct graph and check error E2: duplicate edges
boolean E2 = false;
for(int i=1;i<s.length();i+=6){
int x = s.charAt(i)-'A', y = s.charAt(i+2)-'A';
if(graph[x][y]) //duplicate edge
E2 = true;
graph[x][y] = true;
nodes.add(s.charAt(i));
nodes.add(s.charAt(i+2));
}
//check error E1: more than 2 children
boolean E1 = false;
for(int i=0;i<26;i++){
int count = 0; //number of child
for(int j=0;j<26;j++){
if(graph[i][j])
count++;
}
if(count>2)
return "E1";
}
if(E2) return "E2"; //return E2 after checking E1
//check E3: cycle present and E4: multiple roots
int numOfRoots = 0;
char root =' ';
for(char node : nodes){ //only check char that in the tree
for(int i=0;i<26;i++){
if(graph[i][node-'A'])
break;
if(i==25){
numOfRoots++;
root = node;
boolean[] visited = new boolean[26];
if(IsCycle(node, graph, visited))
return "E3";
}
}
}
if(numOfRoots==0) return "E3"; //if no root, must be a cycle
if(numOfRoots>1) return "E4"; //if more than one roots
if(root==' ') return "E5"; //if no edge in input string, invalid input error
return GetExpressionHelper(root, graph);
}
//true means there is a cycle, false means no cycle
private static boolean IsCycle(char node, boolean[][] graph, boolean[] visited){
if(visited[node-'A']) //node has already been visited, must has a cycle
return true;
visited[node-'A'] = true;
for(int i=0;i<26;i++){
if(graph[node-'A'][i]){
if(IsCycle((char)(i+'A'), graph, visited))
return true;
}
}
return false;
}
//Recursive DFS to get the expression/construct the tree
private static String GetExpressionHelper(char root, boolean[][] graph){
String left = "", right = ""; //if no children, left and right should be empty
for(int i=0;i<26;i++){
if(graph[root-'A'][i]){
left = GetExpressionHelper((char)(i+'A'), graph);
for(int j=i+1;j<26;j++){
if(graph[root-'A'][j]){
right = GetExpressionHelper((char)(j+'A') ,graph);
break;
}
}
break;
}
}
return "("+root+left+right+")";
}
}
| [
"yan.jinz@northeastern.edu"
] | yan.jinz@northeastern.edu |
018088ea2a27ab068a2540a0bc63607a7b15fca2 | 9343da7645ad606f9498f5698280b626ad1a63ac | /spoj-solutions/TEST/TEST.java | 6f935f7d38446b3ac21f7a21e3cc79e48abd0530 | [] | no_license | goldenrati0/oj | 5a75bebba049c92fc320944b6d71a2f6a2427925 | 41be0004f2143bfbf0db3c66ab26b0f45e343059 | refs/heads/master | 2022-04-06T09:21:12.732290 | 2020-03-09T17:16:56 | 2020-03-09T17:16:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | //Status: RE
import java.util.*;
import java.lang.*;
class TEST{
public static void main (String[] args) throws java.lang.Exception{
Scanner ana = new Scanner(System.in);
int x = 0;
while((x = ana.nextInt()) != 42){
System.out.println(x);
}
while(true){
ana.nextInt();
}
}
} | [
"tahmid.choyon@gmail.com"
] | tahmid.choyon@gmail.com |
cd540ce5e0fac1d7c9c20804c134477a500b6c13 | 3dbbfac39ac33d3fabec60b290118b361736f897 | /BOJ/9000/9011.java | c13845c4a16c9914ba26ab5bad04177ec3783cc7 | [] | no_license | joshua-qa/PS | 7e0a61f764f7746e6b3c693c103da06b845552b7 | c49c0b377f85c483b6d274806afb0cbc534500b7 | refs/heads/master | 2023-05-28T15:01:28.709522 | 2023-05-21T04:46:29 | 2023-05-21T04:46:29 | 77,836,098 | 7 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,599 | java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task task = new Task();
task.run(in, out);
out.close();
}
static class Task {
int n, count;
StringBuilder sb = new StringBuilder();
Stack<Integer> currList = new Stack<>();
ArrayList<Integer> numList = new ArrayList<>();
public void run(InputReader in, PrintWriter out) {
n = in.nextInt();
while(n-- > 0) {
count = in.nextInt();
int[] rank = new int[count];
for(int i = 1; i <= count; i++) {
rank[i-1] = in.nextInt();
numList.add(i);
}
for(int i = count-1; i >= 0; i--) {
if(numList.size() > rank[i]) {
currList.push(numList.remove(rank[i]));
} else {
break;
}
}
if(!numList.isEmpty()) {
numList.clear();
currList.clear();
sb.append("IMPOSSIBLE\n");
} else {
while(!currList.isEmpty()) {
sb.append(currList.pop() + " ");
}
sb.append("\n");
}
}
out.print(sb);
}
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String nextLine() {
try {
return reader.readLine();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
} | [
"jgchoi.qa@gmail.com"
] | jgchoi.qa@gmail.com |
5fcd0722649fc330c73c1997fca4da5a6cdeb7ef | bfac99890aad5f43f4d20f8737dd963b857814c2 | /reg4/v1/xwiki-platform-core/xwiki-platform-formula/xwiki-platform-formula-renderer/src/main/java/org/xwiki/formula/AbstractFormulaRenderer.java | 125ff5dcf9757065c293205221b3483c6cf61e9a | [] | no_license | STAMP-project/dbug | 3b3776b80517c47e5cac04664cc07112ea26b2a4 | 69830c00bba4d6b37ad649aa576f569df0965c72 | refs/heads/master | 2021-01-20T03:59:39.330218 | 2017-07-12T08:03:40 | 2017-07-12T08:03:40 | 89,613,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,046 | java | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.formula;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Base class for all implementations of the {@link FormulaRenderer} component. Provides all the common functionalities
* (caching, storage, and retrieval), so that the only responsibility of each implementation remains just to actually
* transform the formula into an image.
*
* @version $Id: a80ee6a82c57e8f2e63db62b903ad982618b96c2 $
* @since 2.0M3
*/
public abstract class AbstractFormulaRenderer implements FormulaRenderer
{
/** Logging helper object. */
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFormulaRenderer.class);
/** A storage system for rendered images, for reuse in subsequent requests. */
@Inject
private ImageStorage storage;
@Override
public String process(String formula, boolean inline, FontSize size, Type type) throws IllegalArgumentException,
IOException
{
// Only render the image if it is not already in the cache
String cacheKey = computeImageID(formula, inline, size, type);
if (this.storage.get(cacheKey) == null) {
ImageData image = renderImage(formula, inline, size, type);
this.storage.put(cacheKey, image);
}
return cacheKey;
}
@Override
public ImageData getImage(String imageID)
{
return this.storage.get(imageID);
}
/**
* Renders a mathematical formula into an image.
*
* @param formula a string representation of the formula, in LaTeX syntax, without any commands that specify the
* environment (such as $$ .. $$, \begin{math} ... \end{math}, etc)
* @param inline specifies if the rendered formula will be displayed inline in the text, or as a separate block
* @param size the font size used for displaying the formula
* @param type the format in which the formula is rendered
* @return the rendered image, as an {@link ImageData} instance
* @throws IllegalArgumentException if the LaTeX syntax of the formula is incorrect and the error is unrecoverable
* @throws IOException in case of a renderer execution error
*/
protected abstract ImageData renderImage(String formula, boolean inline, FontSize size, Type type)
throws IllegalArgumentException, IOException;
/**
* Computes the identifier under which the rendered formula will be stored for later reuse.
*
* @param formula a string representation of the formula, in LaTeX syntax, without any commands that specify the
* environment (such as $$ .. $$, \begin{math} ... \end{math}, etc)
* @param inline specifies if the rendered formula will be displayed inline in the text, or as a separate block
* @param size the font size used for displaying the formula
* @param type the format in which the formula is rendered
* @return a string representation of the hash code for the four information items
*/
protected String computeImageID(String formula, boolean inline, FontSize size, Type type)
{
// Try computing a long hash
try {
MessageDigest hashAlgorithm = MessageDigest.getInstance("SHA-256");
hashAlgorithm.update(inline ? (byte) 't' : (byte) 'f');
hashAlgorithm.update((byte) size.ordinal());
hashAlgorithm.update((byte) type.ordinal());
hashAlgorithm.update(formula.getBytes());
return new String(org.apache.commons.codec.binary.Hex.encodeHex(hashAlgorithm.digest()));
} catch (NoSuchAlgorithmException ex) {
LOGGER.error("No MD5 hash algorithm implementation", ex);
} catch (NullPointerException ex) {
LOGGER.error("Error hashing image name", ex);
}
// Fallback to a simple hashcode
final int prime = 37;
int result = 1;
result = prime * result + formula.hashCode();
result = prime * result + (inline ? 0 : 1);
result = prime * result + size.hashCode();
result = prime * result + type.hashCode();
result = prime * result + this.getClass().getCanonicalName().hashCode();
return result + "";
}
/**
* Prepares the mathematical formula for rendering by wrapping it in the proper math environment.
*
* @param formula the mathematical formula that needs to be rendered
* @param inline a boolean that specifies if the rendered formula will be displayed inline in the text, or as a
* separate block
* @return the formula, surrounded by "\begin{math}" / "\end{math}" if it is supposed to be displayed inline, and by
* "\begin{displaymath}" / \end{displaymath} if it should be displayed as a block.
*/
protected String wrapFormula(String formula, boolean inline)
{
return (inline ? "\\begin{math}" : "\\begin{displaymath}") + "\n{ " + formula + " }\n"
+ (inline ? "\\end{math}" : "\\end{displaymath}");
}
}
| [
"caroline.landry@inria.fr"
] | caroline.landry@inria.fr |
06a8209f26e2ce67bc59d84e8dd551e761cd652e | dfe052a4de503af20e10232f062df7d9a058f262 | /app/src/main/java/loise/kbc/ui/activity/InstagramFeed.java | 9137ef7869718d2629f8c3a474d4a43b26eacc7c | [] | no_license | Homeboyzandroid/KBC_APP | b1179cbecaeb69f60a492a39604e3a00f832b001 | d375c1c6218c9662af179b2499b55409d6ab5dda | refs/heads/master | 2021-01-10T17:52:29.751889 | 2016-02-16T06:58:22 | 2016-02-16T06:58:22 | 43,285,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 921 | java | package loise.kbc.ui.activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import loise.kbc.navigationviewpagerliveo.R;
public class InstagramFeed extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_instagram_feed);
Uri uri = Uri.parse("http://instagram.com/_u/kbckenya");
Intent Instagram = new Intent(Intent.ACTION_VIEW, uri);
Instagram.setPackage("com.instagram.android");
try {
startActivity(Instagram);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.instagram.com/kbckenya")));
}
}
}
| [
"faithmuli33@gmail.com"
] | faithmuli33@gmail.com |
de740283a5d54a926e31f817e60a242822f2386b | 9679a5cda74dc6106ee9b3e194f69060655cff9f | /src/main/java/cz/muni/fi/pv168/project/autocamp/ReservationManager.java | 9503f1bf9c485ba1661edd28c2205e2a1fd8c5ad | [] | no_license | lenka783/PV168 | 4d4580452d16f35ba6fd39c1ecce5ee14a6d4f58 | 8382ee95d856d4ae373c2283f0c9634ca4366869 | refs/heads/master | 2021-06-03T17:47:20.052582 | 2016-05-25T19:51:46 | 2016-05-25T19:51:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,870 | java | package cz.muni.fi.pv168.project.autocamp;
import cz.muni.fi.pv168.project.autocamp.Parcel;
import cz.muni.fi.pv168.project.autocamp.Guest;
import java.util.List;
/**
* Interface for reservations, e.g. find reservation
* @author Adam Gdovin, 433305
* @author Lenka Smitalova, 410198
* @version Mar 11, 2016
*/
public interface ReservationManager {
/**
* creates new reservation
* @param reservation
*/
void createReservation (Reservation reservation);
/**
* updates the reservation
* @param reservation
*/
void updateReservation (Reservation reservation);
/**
* deletes the reservation
* @param reservation
*/
void deleteReservation (Reservation reservation);
/**
* find specific reservation by its ID
* @param id of the reservation
* @return reservation with given ID
*/
Reservation findReservationByID(Long id);
/**
* find all reservations with given parcel
* @param parcel of the reservation
* @return list of all reservations with given parcel
*/
List<Reservation> findReservationsByParcel(Parcel parcel);
/**
* find all reservations with given guest
* @param guest of the reservation
* @return list of all reservations with given parcel
*/
List<Reservation> findReservationsByGuest(Guest guest);
/**
* finds all reservations
* @return list of all reservations
*/
List<Reservation> findAllReservations();
/**
* Find all reservations with given filter parameter in their
* ID or location.
*
* @param filter wanted value
* @return list of reservations whose attributes contain given filter,
* in case of id values must be the same
*/
List<Reservation> filterReservations(String filter);
}
| [
"adam.gdovin@gmail.com"
] | adam.gdovin@gmail.com |
d5ccbe50bf353ce33199eba1b4c183af089bb8e5 | 02bb889c36c2a91e055bab635893e9b7030797b5 | /FragmentsLabTestTablet/src/course/labs/fragmentslab/test/TabletTest.java | 7cf925764b2b5591f2beb5c6934736ab88791114 | [] | no_license | thiagotigaz/solutions_android_tests | 3ad14dcd9adbe44fbceee681c0290d3a174b2a86 | dccfcdda69f2f56ef3ecc75ef14c51a6bf396cc1 | refs/heads/master | 2016-09-09T17:45:46.845151 | 2014-08-27T00:29:06 | 2014-08-27T00:29:06 | 23,371,480 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,489 | java | package course.labs.fragmentslab.test;
import course.labs.fragmentslab.MainActivity;
import com.robotium.solo.*;
import android.test.ActivityInstrumentationTestCase2;
public class TabletTest extends ActivityInstrumentationTestCase2<MainActivity> {
private Solo solo;
public TabletTest() {
super(MainActivity.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation());
getActivity();
}
@Override
public void tearDown() throws Exception {
solo.finishOpenedActivities();
}
public void testRun() {
int timeout = 8;
// Wait for activity: 'course.labs.fragmentslab.MainActivity'
solo.waitForActivity(course.labs.fragmentslab.MainActivity.class, 2000);
// Wait for view: 'android.R.id.text1'
assertTrue("text1 not found", solo.waitForView(android.R.id.text1));
// Assert that: feed_view is shown
assertTrue("'feed_view' was not found!", solo.waitForView(solo
.getView(course.labs.fragmentslab.R.id.feed_view)));
// Wait for onActivityCreated()Log Message:
assertTrue("onActivityCreated() Log Message not found",
solo.waitForLogMessage("Entered onActivityCreated()", timeout));
// Click on ladygaga
solo.clickOnView(solo.getView(android.R.id.text1));
// Assert that: feed_view is shown
assertTrue("'Select a feed to view!' is not shown!",
solo.waitForView(solo
.getView(course.labs.fragmentslab.R.id.feed_view)));
// Assert that: 'the audience cheering!' is shown
assertTrue("'the audience cheering!' is not shown!",
solo.searchText("the audience cheering!"));
// Wait for onItemSelected(0) Log Message:
assertTrue("onItemSelected(0) Log Message not found",
solo.waitForLogMessage("Entered onItemSelected(0)", timeout));
// Wait for updateFeedDisplay() Log Message:
assertTrue("updateFeedDisplay() Log Message not found",
solo.waitForLogMessage("Entered updateFeedDisplay()", timeout));
// Clear log
solo.clearLog();
// Click on msrebeccablack
solo.clickOnView(solo.getView(android.R.id.text1, 1));
// Assert that: feed_view is shown
assertTrue("'Select a feed to view!' is not shown!",
solo.waitForView(solo
.getView(course.labs.fragmentslab.R.id.feed_view)));
// Assert that: 'save me from school' is shown
assertTrue("'save me from school' is not shown!",
solo.searchText("save me from school"));
// Wait for onItemSelected(1) Log Message:
assertTrue("onItemSelected(1) Log Message not found",
solo.waitForLogMessage("Entered onItemSelected(1)", timeout));
// Wait for updateFeedDisplay() Log Message:
assertTrue("updateFeedDisplay() Log Message not found",
solo.waitForLogMessage("Entered updateFeedDisplay()", timeout));
// Clear log
solo.clearLog();
// Click on taylorswift13
solo.clickOnView(solo.getView(android.R.id.text1, 2));
// Assert that: feed_view is shown
assertTrue("'Select a feed to view!' is not shown!",
solo.waitForView(solo
.getView(course.labs.fragmentslab.R.id.feed_view)));
// Assert that: 'I love you guys so much' is shown
assertTrue("'I love you guys so much' is not shown!",
solo.searchText("I love you guys so much"));
// Wait for onItemSelected(2) Log Message:
assertTrue("onItemSelected(2) Log Message not found",
solo.waitForLogMessage("Entered onItemSelected(2)"));
// Wait for updateFeedDisplay() Log Message:
assertTrue("updateFeedDisplay() Log Message not found",
solo.waitForLogMessage("Entered updateFeedDisplay()"));
}
}
| [
"thiagotigaz@gmail.com"
] | thiagotigaz@gmail.com |
246a93b9bae469159907854b8ab9ea7a6d337940 | ef66e972f04cc5f67724d929215e4d402ed90e94 | /src/Arista.java | f7ee3260994d973fed745b0a80bac83339b64ece | [] | no_license | miguelnietoa/mapUN | ad857923e4d626c704bd3ded601ba1f91eaa5d1e | 18e860e4f0dbdc728b596d5b84e590d58abb0396 | refs/heads/master | 2023-04-02T03:06:22.203886 | 2021-04-07T02:54:25 | 2021-04-07T02:54:25 | 254,906,062 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 622 | java |
/**
* Representa una arista ponderada.
*
* @author MCJ
* @version 1.0
*/
public class Arista {
private Nodo nodo;
private int peso;
public Arista(Nodo nodo, int peso) {
this.nodo = nodo;
this.peso = peso;
}
public Nodo getNodo() {
return nodo;
}
public void setNodo(Nodo nodo) {
this.nodo = nodo;
}
public int getPeso() {
return peso;
}
public void setPeso(int peso) {
this.peso = peso;
}
public String toString() {
return nodo.getNombre() + "," + peso;
}
}
| [
"miguelnietoarias3@gmail.com"
] | miguelnietoarias3@gmail.com |
3d4bcedb9e6489e3b4af57d1b0a59ccfa14ccef8 | aad637ff6b08065ba40937653bb071f97a971311 | /app/src/main/java/com/example/chatapplication/HomeFragment.java | 00f6d5a126825aea873ee61ffa8731e75a028810 | [] | no_license | MdGolam-Kibria/SocialMediaChatApplication | 46df2032bb8c9a08131fed5fce48cf6a5e923d1b | cf2b084f967ae7b0a609e23aa9063a7cf3a8c8ed | refs/heads/master | 2022-11-14T13:11:38.514638 | 2020-06-29T18:55:45 | 2020-06-29T18:55:45 | 266,576,270 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,474 | java | package com.example.chatapplication;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
import androidx.core.view.MenuItemCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.example.chatapplication.adapter.AdapterPost;
import com.example.chatapplication.modelAll.ModelPost;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
*/
public class HomeFragment extends Fragment {
FirebaseAuth firebaseAuth;
RecyclerView recyclerView;
List<ModelPost> postList;
AdapterPost adapterPost;
public HomeFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_home, container, false);
firebaseAuth = FirebaseAuth.getInstance();
//recycler view and its properties
recyclerView = view.findViewById(R.id.postsRecyclerview);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
//show newest post last ,for this load from last
layoutManager.setStackFromEnd(true);
layoutManager.setReverseLayout(true);
recyclerView.setLayoutManager(layoutManager);
//inti...post list
postList = new ArrayList<>();
loadPosts();
return view;
}
private void loadPosts() {
//path of all posts
final DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("Posts");
//now get all data from this databaseReference
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
postList.clear();
for (DataSnapshot ds : dataSnapshot.getChildren()) {
ModelPost modelPost = ds.getValue(ModelPost.class);
postList.add(modelPost);
//adapter
adapterPost = new AdapterPost(getActivity(),postList);
//now set adapter to recycler view
recyclerView.setAdapter(adapterPost);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
//in case any error from loading data time
Toast.makeText(getActivity(), ""+ databaseError.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
private void searchPost(final String searchQuery){
//path of all posts
final DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("Posts");
//now get all data from this databaseReference
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
postList.clear();
for (DataSnapshot ds : dataSnapshot.getChildren()) {
ModelPost modelPost = ds.getValue(ModelPost.class);
/*
if in search view user enter query match with postTitle and descriptions
*/
if (modelPost.getPTitle().toLowerCase().contains(searchQuery.toLowerCase())||
modelPost.getPDescr().toLowerCase().contains(searchQuery.toLowerCase())){
postList.add(modelPost);
}
//adapter
adapterPost = new AdapterPost(getActivity(),postList);
//now set adapter to recycler view
recyclerView.setAdapter(adapterPost);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
//in case any error from loading data time
Toast.makeText(getActivity(), ""+ databaseError.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
private void checkUserStatus() {//check user sign in or not and accessibility
FirebaseUser user = firebaseAuth.getCurrentUser();//get current user
if (user != null) {
//user signed in stay here
// mProfileTv.setText(user.getEmail());
} else {
//user not signed in
startActivity(new Intent(getActivity(), MainActivity.class));
getActivity().finish();
}
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
setHasOptionsMenu(true);//to show menu option in fragment
super.onCreate(savedInstanceState);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {//for inflate option menu
inflater.inflate(R.menu.menu, menu);
//add search view for search post by title/description
MenuItem menuItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuItem);
//now search listen...
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {//called when user press search button
if (!TextUtils.isEmpty(query)){//if user set any search query in search view
searchPost(query);
}else {//if user dont search anything
loadPosts();
}
return false;
}
@Override
public boolean onQueryTextChange(String query) {//called as when user press any latter
if (!TextUtils.isEmpty(query)){//if user set any search query in search view
searchPost(query);
}else {//if user dont search anything
loadPosts();
}
return false;
}
});
super.onCreateOptionsMenu(menu, inflater);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {//for option item selection handle "logout"
int id = item.getItemId();
if (id == R.id.actionLogout) {
firebaseAuth.signOut();
checkUserStatus();
}
if (id == R.id.actionAddPost) {
startActivity(new Intent(getActivity(), AddPostActivity.class));
}
return super.onOptionsItemSelected(item);
}
}
| [
"kibria92@gmail.com"
] | kibria92@gmail.com |
5e8259b50b6d00ce9c4e157162c5034104c2a9ea | 2cce6e839569e2786203ef71d648702f6e89625b | /src/main/java/com/wang/service/role/RoleServiceImpl.java | e4466acee002315056c9bca4f30afe479125c732 | [] | no_license | ShikaiWang-Sky/smbms | 9dfd88ed8b1fe289118d0c89077f6e9f0dd6f22b | 048f9914b514500534a8da890f73d86f1ef7ed0b | refs/heads/master | 2022-12-09T10:33:37.376563 | 2020-08-25T08:07:55 | 2020-08-25T08:07:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package com.wang.service.role;
import com.wang.dao.BaseDao;
import com.wang.dao.role.RoleDao;
import com.wang.dao.role.RoleDaoImpl;
import com.wang.pojo.Role;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
public class RoleServiceImpl implements RoleService{
//引入Dao
private RoleDao roleDao;
public RoleServiceImpl() {
roleDao = new RoleDaoImpl();
}
@Override
public List<Role> getRoleList() {
Connection connection = null;
List<Role> roleList = null;
try {
connection = BaseDao.getConnection();
roleList = roleDao.getRoleList(connection);
} catch (SQLException throwables) {
throwables.printStackTrace();
} finally {
BaseDao.closeResource(connection, null, null);
}
return roleList;
}
}
| [
"seuwsk@gmail.com"
] | seuwsk@gmail.com |
bef6de46db914a350afb3570a7c44d12619552d6 | 9b0a4720febd145ee16eb06b735fc56dba569c6b | /JAVA/core-webservices/src/main/java/com/tmg/ebscorews/template/TemplateService.java | 7577a8259721f48a26da0f145ea2071eddb373e7 | [
"Apache-2.0"
] | permissive | govindrgaikwad/java_repo | 6c3865a3bf534447af668b987596348e9282626e | 19b25514ebf3063acf613bfe637285040396f4d0 | refs/heads/master | 2022-12-23T10:18:56.246620 | 2019-11-25T14:18:41 | 2019-11-25T14:18:41 | 19,309,946 | 0 | 0 | Apache-2.0 | 2022-12-16T01:58:08 | 2014-04-30T10:20:46 | Java | UTF-8 | Java | false | false | 13,381 | java | package com.tmg.ebscorews.template;
import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
import javax.xml.ws.BindingType;
import com.tmg.ebscore.dto.ServiceOperationResult;
import com.tmg.ebscore.dto.ebspackage.BenifitPackageData;
import com.tmg.ebscore.dto.template.PackageTemplateData;
import com.tmg.ebscore.dto.template.PkgVersionWorkflowStateData;
import com.tmg.ebscore.dto.template.ShapeValueDefaultData;
import com.tmg.ebscore.dto.template.TemplateAllowsIntValData;
import com.tmg.ebscore.dto.template.TemplateAllowsLimitValData;
import com.tmg.ebscore.dto.template.TemplateAllowsMessageValData;
import com.tmg.ebscore.dto.template.TemplateAllowsServiceDefinitionData;
import com.tmg.ebscore.dto.template.TemplateAllowsStringValData;
import com.tmg.ebscore.dto.template.TemplateContainer;
import com.tmg.ebscore.dto.template.TemplateSummaryData;
import com.tmg.ebscore.dto.template.TemplateTreeData;
import com.tmg.ebscore.dto.template.TemplateWorkFlowStateData;
import com.tmg.ebscore.orm.template.TemplateWorkflowState;
import com.tmg.ebscorews.common.ServiceFault;
@WebService(targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
@SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, style = Style.DOCUMENT, use = Use.LITERAL)
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public interface TemplateService {
@WebMethod(operationName = "GetTemplateList", action = "GetTemplateList")
public @WebResult(name = "TemplateListData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateSummaryData> getTemplateList(
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResult") int maxResults) throws ServiceFault;
@WebMethod(operationName = "DeleteTemplate", action = "DeleteTemplate")
public @WebResult(name = "DeleteTemplateResult", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
ServiceOperationResult deleteTemplate(
@WebParam(name = "TemplateId") int templateId) throws ServiceFault;
@WebMethod(operationName = "ChangeWorkFlowState", action = "ChangeWorkFlowState")
public @WebResult(name = "SaveChangeWorkFlowState")
ServiceOperationResult changeWorkFlowState(
@WebParam(name = "TemplateWorkFlowid") int templateWorkFlowid,
@WebParam(name = "PackageTemplateid") int packageTemplateid)
throws ServiceFault;
@WebMethod(operationName = "GetTemplateWorkFlowStateListAtTemplate", action = "GetTemplateWorkFlowStateListAtTemplate")
public @WebResult(name = "TemplateWorkFlowData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateWorkFlowStateData> getTemplateWorkFlowStateListAtTemplate(
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetNoOFReleasedPackage", action = "GetNoOFReleasedPackage")
public @WebResult(name = "NoOFReleasedPackages", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
int getNoOFReleasedPackage(@WebParam(name = "templateId") int tempId)
throws ServiceFault;
@WebMethod(operationName = "GetNoOFUnReleasedPackage", action = "GetNoOFUnReleasedPackage")
public @WebResult(name = "NoOFUnReleasedPackages", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
int getNoOFUnReleasedPackage(@WebParam(name = "templateId") int tempId)
throws ServiceFault;
@WebMethod(operationName = "GetPackagesForTemplate", action = "GetPackagesForTemplate")
public @WebResult(name = "GetBenifitPackageData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<BenifitPackageData> getPackagesForTemplate(
@WebParam(name = "TempId") int id,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetIntValListForTemplate", action = "GetIntValListForTemplate")
public @WebResult(name = "TemplateAllowsIntValData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateAllowsIntValData> getIntValListForTemplate(
@WebParam(name = "MasterListId") int masterListId,
@WebParam(name = "TemplateId") int tempId,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetStringValListForTemplate", action = "GetStringValListForTemplate")
public @WebResult(name = "TemplateAllowsStringValData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateAllowsStringValData> getStringValListForTemplate(
@WebParam(name = "MasterListId") int masterListId,
@WebParam(name = "TempId") int tempId,
@WebParam(name = "page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetMessageValListForTemplate", action = "GetMessageValListForTemplate")
public @WebResult(name = "TemplateAllowsMessageValData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateAllowsMessageValData> getMessageValListForTemplate(
@WebParam(name = "MasterListId") int masterListId,
@WebParam(name = "TempId") int tempId,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetLimitValListForTemplate", action = "GetLimitValListForTemplate")
public @WebResult(name = "TemplateAllowsLimitValData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateAllowsLimitValData> getLimitValListForTemplate(
@WebParam(name = "MasterListId") int masterListId,
@WebParam(name = "TempId") int tempId,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetServiceDefinitionValListForTemplate", action = "GetServiceDefinitionValListForTemplate")
public @WebResult(name = "TemplateAllowsServiceDefinitionData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateAllowsServiceDefinitionData> getServiceDefinitionValListForTemplate(
@WebParam(name = "MasterListId") int masterListId,
@WebParam(name = "TempId") int tempId,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetWorkFlowStateForEachTemplate", action = "GetWorkFlowStateForEachTemplate")
public @WebResult(name = "PkgVersionWorkflowStateData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<PkgVersionWorkflowStateData> getWorkFlowStateForEachTemplate(
@WebParam(name = "packageTemplateId") int id,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "GetAllTemplateTreeForTemplate", action = "GetAllTemplateTreeForTemplate")
public @WebResult(name = "TemplateTreeData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateContainer<TemplateTreeData> getAllTemplateTreeForTemplate(
@WebParam(name = "TempId") int id,
@WebParam(name = "Page") int page,
@WebParam(name = "MaxResults") int maxResults) throws ServiceFault;
@WebMethod(operationName = "SaveTemplateFromExistingTemplate", action = "SaveTemplateFromExistingTemplate")
public @WebResult(name = "SaveTemplateFromExistingTemplate", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
ServiceOperationResult saveTemplateFromExistingTemplate(
@WebParam(name = "PackageTemplateData", targetNamespace = "http://www.tmg.com/coreservices/data") PackageTemplateData data,
@WebParam(name = "MasterListBooleanVal") Boolean masterList,
@WebParam(name = "PackageWorkFlowStateBooleanVal") Boolean packageWorkFlowState,
@WebParam(name = "TemplateTreeBooleanVal") Boolean TemplateTree)
throws ServiceFault;
@WebMethod(operationName = "SaveUpdateTemplate", action = "SaveUpdateTemplate")
public @WebResult(name = "SaveResult")
ServiceOperationResult saveUpdateTemplate(
@WebParam(name = "PackageTemplateData", targetNamespace = "http://www.tmg.com/coreservices/data") PackageTemplateData data)
throws ServiceFault;
@WebMethod(operationName = "SaveUpdateAndDeleteAllowIntValForTemplate", action = "SaveUpdateAndDeleteAllowIntValForTemplate")
public @WebResult(name = "SaveTemplateAllowsIntValData")
ServiceOperationResult saveUpdateAndDeleteAllowIntValForTemplate(
@WebParam(name = "TemplateAllowsIntValData", targetNamespace = "http://www.tmg.com/coreservices/data") List<TemplateAllowsIntValData> allowsIntVals,
@WebParam(name = "TempId") int tempId,
@WebParam(name = "MasterListId") int mastId) throws ServiceFault;
@WebMethod(operationName = "SaveAndDeleteAllowLimitValForTemplate", action = "SaveAndDeleteAllowLimitValForTemplate")
public @WebResult(name = "SaveTemplateAllowsLimitValData")
ServiceOperationResult saveAndDeleteAllowLimitValForTemplate(
@WebParam(name = "TemplateAllowsLimitValData", targetNamespace = "http://www.tmg.com/coreservices/data") List<TemplateAllowsLimitValData> allowsLimitVals,
@WebParam(name = "TempId") int tempId) throws ServiceFault;
@WebMethod(operationName = "SaveAndDeleteAllowServiceDefinitionForTemplate", action = "SaveAndDeleteAllowServiceDefinitionForTemplate")
public @WebResult(name = "SaveTemplateAllowsServiceDefinitionData")
ServiceOperationResult saveAndDeleteAllowServiceDefinitionForTemplate(
@WebParam(name = "TemplateAllowsServiceDefinitionData", targetNamespace = "http://www.tmg.com/coreservices/data") List<TemplateAllowsServiceDefinitionData> allowServiceDefinitionList,
@WebParam(name = "TempId") int tempId) throws ServiceFault;
@WebMethod(operationName = "SaveAndDeleteAllowMessageValForTemplate", action = "SaveAndDeleteAllowMessageValForTemplate")
public @WebResult(name = "SaveTemplateAllowsMessageValData")
ServiceOperationResult saveAndDeleteAllowMessageValForTemplate(
@WebParam(name = "AllowMessageValList", targetNamespace = "http://www.tmg.com/coreservices/data") List<TemplateAllowsMessageValData> allowMessageValList,
@WebParam(name = "TempId") int tempId) throws ServiceFault;
@WebMethod(operationName = "SaveUpdateAndDeleteAllowStringValForTemplate", action = "SaveUpdateAndDeleteAllowStringValForTemplate")
public @WebResult(name = "SaveTemplateAllowsStringValData")
ServiceOperationResult saveUpdateAndDeleteAllowStringValForTemplate(
@WebParam(name = "TemplateAllowsStringValData", targetNamespace = "http://www.tmg.com/coreservices/data") List<TemplateAllowsStringValData> allowsStringValDatas,
@WebParam(name = "TemplateId") int templateId,
@WebParam(name = "MasterId") int mastId) throws ServiceFault;
@WebMethod(operationName = "SaveAndUpdatePkgVerWorkflowStateForTemplate", action = "SaveAndUpdatePkgVerWorkflowStateForTemplate")
public @WebResult(name = "SavePkgVersionWorkflowStateData")
ServiceOperationResult saveAndUpdatePkgVerWorkflowStateForTemplate(
@WebParam(name = "PkgVersionWorkflowStateData", targetNamespace = "http://www.tmg.com/coreservices/data") List<PkgVersionWorkflowStateData> workFlowStateData)
throws ServiceFault;
@WebMethod(operationName = "DeleteWorkFlowStateTemplate", action = "DeleteWorkFlowStateTemplate")
public @WebResult(name = "DeleteWorkFlowState", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
ServiceOperationResult deleteWorkFlowStateTemplate(
@WebParam(name = "Ids") List<Integer> ids) throws ServiceFault;
@WebMethod(operationName = "GetBenefitPackageType", action = "GetBenefitPackageType")
public @WebResult(name = "BenefitPackageTypes", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
List<String> getBenefitPackageType(@WebParam(name = "MasterListId") int id)
throws ServiceFault;
@WebMethod(operationName = "GetTemplateDetail", action = "GetTemplateDetail")
public @WebResult(name = "TemplateDetailData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
PackageTemplateData getTemplateDetail(@WebParam(name = "TempId") int id)
throws ServiceFault;
@WebMethod(operationName = "GetTemplateWorkFlowStateById", action = "GetTemplateWorkFlowStateById")
public @WebResult(name = "TemplateWorkflowStateData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
TemplateWorkflowState getTemplateWorkFlowStateById(
@WebParam(name = "TemplateWorkflowStateId") int id)
throws ServiceFault;
@WebMethod(operationName = "GetAllTreeShapesForTemplateTree", action = "GetAllTreeShapesForTemplateTree")
public @WebResult(name = "ShapeValueDefaultData", targetNamespace = "http://www.tmg.com/coreservices/TemplateService")
List<ShapeValueDefaultData> getAllTreeShapesForTemplateTree(@WebParam(name = "TemplateTreeId") int id)
throws ServiceFault;
}
| [
"govindrgaikwad@gmail.com"
] | govindrgaikwad@gmail.com |
d7802ec846adb5e598ddf42a79b9f5d955a30981 | 9d9d0b0b3d171dc764b9b7ebb31759c0a133adcc | /src/main/java/com/swvalerian/basepatterns/structural/facade/SongSingFacade.java | cfc6c35972726e801aced0bbcc38ee56e8253262 | [] | no_license | swvalerian/pattern | 71aec4bc7c29bec23713bc3026cc3c5a0dafc2bb | 10aeb551e9d3acae73e2c488243e0d3ab60d2221 | refs/heads/main | 2023-04-08T09:12:14.653538 | 2021-04-13T18:23:15 | 2021-04-13T18:23:15 | 356,013,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package main.java.com.swvalerian.basepatterns.structural.facade;
public class SongSingFacade {
Singer singer = new Singer();
Song song = new Song();
BugFanera bugFanera = new BugFanera();
public void singASong() {
bugFanera.singSong();
singer.singSongBeforeHoarse(bugFanera);
song.singSong();
}
}
| [
"swvalerianJava@yandex.ru"
] | swvalerianJava@yandex.ru |
f7aa4601bed0f6a8c0816d569fb2de443fc05629 | ed12e2425c51268700070d1a88c4f6be201167ee | /UserFront/src/main/java/com/userfront/domain/PrimaryAccount.java | 533f5f8ddcb184f11ab422cec2182882c216ce70 | [] | no_license | ganan2/STS_AWS | 01cbe0bdd2d5900936d7ed9c8622c58c56ab2b61 | 0be972ced112bbead341d7e0c837f44f40edbc38 | refs/heads/master | 2021-01-01T17:46:02.850214 | 2017-08-03T09:57:27 | 2017-08-03T09:57:27 | 98,153,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,230 | java | /**
* Created by Girish Ananda
*/
package com.userfront.domain;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class PrimaryAccount {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private int accountNumber;
private BigDecimal accountBalance;
@OneToMany(mappedBy = "primaryAccount", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JsonIgnore
private List<PrimaryTransaction> primaryTransactionList;
/** mappedBy = "primaryAccount" means that the class: PrimaryAccount has a field in the same field name: primaryAccount, which will be used for mapping */
/** fetch = FetchType.LAZY means that when an object of the class is created, the values from the list need not be retrieved unless required */
/** cascade = CascadeType.ALL means that actions on the list will be propagated to the class: PrimaryAccount */
/** @JsonIgnore => List, during serialization references to the class: PrimaryAccount which will reference back to the List which forms an infinite loop. To avoid this loop and stop at returning the class as Json Object, the loop is broken. i.e., the List declaration is skipped after it is processed once. */
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public int getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(int accountNumber) {
this.accountNumber = accountNumber;
}
public BigDecimal getAccountBalance() {
return accountBalance;
}
public void setAccountBalance(BigDecimal accountBalance) {
this.accountBalance = accountBalance;
}
public List<PrimaryTransaction> getPrimaryTransactionList() {
return primaryTransactionList;
}
public void setPrimaryTransactionList(List<PrimaryTransaction> primaryTransactionList) {
this.primaryTransactionList = primaryTransactionList;
}
}
| [
"ganan2@uis.edu"
] | ganan2@uis.edu |
ba5256c0601a1f40bf870d74fbb3dc55b34771d9 | 9e637f63604794424ecc15c871f79bb2d3ae961a | /app/src/main/java/com/example/administrator/learning/common/view/CompletedView.java | cc49a15823a22f9bd19e3df41a8377cea2646c5a | [] | no_license | carsher/StudyPlatform | fcb44569358ae90f612d8792285b8a6de9d0bc5e | ce8e0331d7793f07d9e564398b8dc56e5911bd6c | refs/heads/master | 2020-08-14T16:08:53.922403 | 2019-10-15T06:10:29 | 2019-10-15T06:10:29 | 215,196,286 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,872 | java | package com.example.administrator.learning.common.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import com.example.administrator.learning.R;
/**
* Created by Administrator on 2018/11/2 0002.
*/
public class CompletedView extends View {
// 画实心圆的画笔
private Paint mCirclePaint;
// 画圆环的画笔
private Paint mRingPaint;
// 画圆环的画笔背景色
private Paint mRingPaintBg;
// 画字体的画笔
private Paint mTextPaint;
// 圆形颜色
private int mCircleColor;
// 圆环颜色
private int mRingColor;
// 圆环背景颜色
private int mRingBgColor;
// 半径
private float mRadius;
// 圆环半径
private float mRingRadius;
// 圆环宽度
private float mStrokeWidth;
// 圆心x坐标
private int mXCenter;
// 圆心y坐标
private int mYCenter;
// 字的长度
private float mTxtWidth;
// 字的高度
private float mTxtHeight;
// 总进度
private int mTotalProgress = 100;
// 当前进度
private int mProgress;
public CompletedView(Context context, AttributeSet attrs) {
super(context, attrs);
// 获取自定义的属性
initAttrs(context, attrs);
initVariable();
}
//属性
private void initAttrs(Context context, AttributeSet attrs) {
TypedArray typeArray = context.getTheme().obtainStyledAttributes(attrs,
R.styleable.TasksCompletedView, 0, 0);
mRadius = typeArray.getDimension(R.styleable.TasksCompletedView_radius, 80);
mStrokeWidth = typeArray.getDimension(R.styleable.TasksCompletedView_strokeWidth, 10);
mCircleColor = typeArray.getColor(R.styleable.TasksCompletedView_circleColor, 0xFFFFFFFF);
mRingColor = typeArray.getColor(R.styleable.TasksCompletedView_ringColor, 0xFFFFFFFF);
mRingBgColor = typeArray.getColor(R.styleable.TasksCompletedView_ringBgColor, 0xFFFFFFFF);
mRingRadius = mRadius + mStrokeWidth / 2;
}
//初始化画笔
private void initVariable() {
//内圆
mCirclePaint = new Paint();
mCirclePaint.setAntiAlias(true);
mCirclePaint.setColor(mCircleColor);
mCirclePaint.setStyle(Paint.Style.FILL);
//外圆弧背景
mRingPaintBg = new Paint();
mRingPaintBg.setAntiAlias(true);
mRingPaintBg.setColor(mRingBgColor);
mRingPaintBg.setStyle(Paint.Style.STROKE);
mRingPaintBg.setStrokeWidth(mStrokeWidth);
//外圆弧
mRingPaint = new Paint();
mRingPaint.setAntiAlias(true);
mRingPaint.setColor(mRingColor);
mRingPaint.setStyle(Paint.Style.STROKE);
mRingPaint.setStrokeWidth(mStrokeWidth);
//mRingPaint.setStrokeCap(Paint.Cap.ROUND);//设置线冒样式,有圆 有方
//中间字
mTextPaint = new Paint();
mTextPaint.setAntiAlias(true);
mTextPaint.setStyle(Paint.Style.FILL);
mTextPaint.setColor(mRingColor);
mTextPaint.setTextSize(mRadius / 2);
Paint.FontMetrics fm = mTextPaint.getFontMetrics();
mTxtHeight = (int) Math.ceil(fm.descent - fm.ascent);
}
//画图
@Override
protected void onDraw(Canvas canvas) {
mXCenter = getWidth() / 2;
mYCenter = getHeight() / 2;
//内圆
canvas.drawCircle(mXCenter, mYCenter, mRadius, mCirclePaint);
//外圆弧背景
RectF oval1 = new RectF();
oval1.left = (mXCenter - mRingRadius);
oval1.top = (mYCenter - mRingRadius);
oval1.right = mRingRadius * 2 + (mXCenter - mRingRadius);
oval1.bottom = mRingRadius * 2 + (mYCenter - mRingRadius);
canvas.drawArc(oval1, 0, 360, false, mRingPaintBg); //圆弧所在的椭圆对象、圆弧的起始角度、圆弧的角度、是否显示半径连线
//外圆弧
if (mProgress > 0 ) {
RectF oval = new RectF();
oval.left = (mXCenter - mRingRadius);
oval.top = (mYCenter - mRingRadius);
oval.right = mRingRadius * 2 + (mXCenter - mRingRadius);
oval.bottom = mRingRadius * 2 + (mYCenter - mRingRadius);
canvas.drawArc(oval, -90, ((float)mProgress / mTotalProgress) * 360, false, mRingPaint); //
//字体
String txt = mProgress + "分";
mTxtWidth = mTextPaint.measureText(txt, 0, txt.length());
canvas.drawText(txt, mXCenter - mTxtWidth / 2, mYCenter + mTxtHeight / 4, mTextPaint);
}
}
//设置进度
public void setProgress(int progress) {
mProgress = progress;
postInvalidate();//重绘
}
}
| [
"1570186932@qq.com"
] | 1570186932@qq.com |
ef6ab20ed60a3557c1ee59522e06c4c2b604b99f | 3ec2dd7eba10b0dfaaf5aa95252262cdaf3d7ef4 | /java/src/zuzu/compiler/ir/convert/LongToIntNode.java | 65bd2b2b284a95174906c39e2331421967495c2a | [] | no_license | hrskevin/zuzu | 5faa2666dc0a23d652bcbae8014388597731e9f3 | eebe6c4f276a56537b6ac088e290946a67f0413b | refs/heads/master | 2016-09-02T16:12:08.679666 | 2013-04-18T04:00:32 | 2013-04-18T04:00:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package zuzu.compiler.ir.convert;
import zuzu.compiler.ir.InterpreterState;
import zuzu.compiler.ir.constant.ConstantIntNode;
import zuzu.compiler.ir.node.LongNode;
import zuzu.compiler.ir.node.UnaryIntNode;
public class LongToIntNode extends UnaryIntNode<LongNode>
{
public LongToIntNode(LongNode input)
{
super(input);
}
@Override
public void interpret(InterpreterState state)
{
state.pushInt((int) state.popLong());
}
@Override
public ConstantIntNode replaceWithConstant()
{
return newConstant((int) _input.constantLongValue());
}
}
| [
"Christopher.Barber@analog.com"
] | Christopher.Barber@analog.com |
577c73b6225aed5cada5b24aeb51270a2671fbce | d36e5733c987cfb17447e29f4153be49bc4868f6 | /src/org/usajusaj/jtex/items/TeXItemEnum.java | cf472c3f59b5db9a8a2f668d0e2a576133bd5eb6 | [] | no_license | Abnegazar/jtex | ec4e8566cc6d677175e8b986bc2aab82a8dbea3e | 8ce4e726b324d796049030adff96831b08c35244 | refs/heads/master | 2022-02-06T12:59:45.120864 | 2018-06-04T01:29:43 | 2018-06-04T01:29:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | /*
* This file is created by jTeX library.
*
* jTeX 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.
*
* jTeX 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 jTeX. If not, see <http://www.gnu.org/licenses/>.
*/
package org.usajusaj.jtex.items;
/**
* @author Matej Usaj
*/
public enum TeXItemEnum
{
CREATED,
CLOSED,
ADDED
}
| [
"251601797@qq.com"
] | 251601797@qq.com |
b8f135077968364a7b24abd561f802144059bde9 | f96404883b26724bcd32911ad04d185cb3dd009c | /hxmzs-common/src/main/java/com/lockbur/book/common/utils/StringUtils.java | c20648b09384a1033835a03efc977c1a73019c61 | [] | no_license | hbs429469861/hxmzs | 024635eff8a3ae768681c6c774ff4442c0e125b6 | 09b21eb4974d54e23a629266b056f1c74b67658c | refs/heads/master | 2021-09-04T03:06:42.393958 | 2018-01-15T02:11:06 | 2018-01-15T02:11:06 | 112,173,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,421 | java | package com.lockbur.book.common.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtils {
public static boolean isBlank(String str){
return str == null || str.trim().length()<=0;
}
public static boolean isBlank(Object object){
boolean flag = false;
if (null == object) {
flag = true;
} else {
if(isBlank(String.valueOf(object))){
flag = true;
}
}
return flag;
}
public static boolean isNotBlank(String str){
return str != null && str.trim().length()>0;
}
/**
* 格式化字符串
*/
public static String formatString(String text) {
return (text == null ? "" : text.trim());
}
/**
* String2Integer
*/
public static int string2Int(String text) throws NumberFormatException {
return text == null ? 0 : Integer.valueOf(text);
}
/**
* 处理字符串:隐藏部分内容
* @param text 目标字符串
* @param leftShowCount 左边显示位数
* @param rightShowCount 右边显示位数
* @return
*/
public static String hideString(String text, int leftShowCount, int rightShowCount) {
StringBuffer sb = new StringBuffer();
if(text != null && text.length() >= leftShowCount + rightShowCount ){
sb.append(text.substring(0, leftShowCount));
for (int i = 0; i < text.length() - leftShowCount - rightShowCount; i++) {
sb.append("*");
}
sb.append(text.substring(text.length() - rightShowCount));
}
return sb.toString();
}
/**处理姓名*/
public static String handleName(String text){
return StringUtils.hideString(text, 0, 1);
}
/**处理证件号*/
public static String handleIdCardNo(String text){
return StringUtils.hideString(text, 2, 2);
}
/**处理银行卡号*/
public static String handleBankCardNo(String text){
return StringUtils.hideString(text, 3, 3);
}
/**处理手机号*/
public static String handlePhoneNo(String text){
return StringUtils.hideString(text, 0, 2);
}
/**
* @Description: 去空格
* @Param
* @Return String
* @Author:youhuiran
* @Datetime 2016年12月4日 下午10:04:36
*/
public static String replaceBlank(String str) {
String dest = "";
if (str!=null) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
Matcher m = p.matcher(str);
dest = m.replaceAll("");
}
return dest;
}
}
| [
"429469861@qq.com"
] | 429469861@qq.com |
1233d09d03b8cf033e25b9a7096623489d3eb0f3 | 5d5c0c358f764554edbc2cd57c46cfa353951acd | /cyf/src/main/java/com/cyf/model/UserExample.java | b2a42bf542491b82dcc86aa752ea6abc125546a2 | [] | no_license | zhanghc521/chengyifang | c3e74a60176a6f8625801b04e448a748c3ad497b | be5f9466eb6c7b36d438ecbf6aedff0ab4367e52 | refs/heads/master | 2020-05-25T00:09:38.359799 | 2017-07-12T14:14:49 | 2017-07-12T14:14:49 | 84,892,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 27,456 | java | package com.cyf.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class UserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andPasswordIsNull() {
addCriterion("password is null");
return (Criteria) this;
}
public Criteria andPasswordIsNotNull() {
addCriterion("password is not null");
return (Criteria) this;
}
public Criteria andPasswordEqualTo(String value) {
addCriterion("password =", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotEqualTo(String value) {
addCriterion("password <>", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThan(String value) {
addCriterion("password >", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThanOrEqualTo(String value) {
addCriterion("password >=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThan(String value) {
addCriterion("password <", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThanOrEqualTo(String value) {
addCriterion("password <=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLike(String value) {
addCriterion("password like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotLike(String value) {
addCriterion("password not like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordIn(List<String> values) {
addCriterion("password in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordNotIn(List<String> values) {
addCriterion("password not in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordBetween(String value1, String value2) {
addCriterion("password between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andPasswordNotBetween(String value1, String value2) {
addCriterion("password not between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andAvatarIsNull() {
addCriterion("avatar is null");
return (Criteria) this;
}
public Criteria andAvatarIsNotNull() {
addCriterion("avatar is not null");
return (Criteria) this;
}
public Criteria andAvatarEqualTo(String value) {
addCriterion("avatar =", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotEqualTo(String value) {
addCriterion("avatar <>", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarGreaterThan(String value) {
addCriterion("avatar >", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarGreaterThanOrEqualTo(String value) {
addCriterion("avatar >=", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLessThan(String value) {
addCriterion("avatar <", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLessThanOrEqualTo(String value) {
addCriterion("avatar <=", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarLike(String value) {
addCriterion("avatar like", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotLike(String value) {
addCriterion("avatar not like", value, "avatar");
return (Criteria) this;
}
public Criteria andAvatarIn(List<String> values) {
addCriterion("avatar in", values, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotIn(List<String> values) {
addCriterion("avatar not in", values, "avatar");
return (Criteria) this;
}
public Criteria andAvatarBetween(String value1, String value2) {
addCriterion("avatar between", value1, value2, "avatar");
return (Criteria) this;
}
public Criteria andAvatarNotBetween(String value1, String value2) {
addCriterion("avatar not between", value1, value2, "avatar");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andIsdeleteIsNull() {
addCriterion("isDelete is null");
return (Criteria) this;
}
public Criteria andIsdeleteIsNotNull() {
addCriterion("isDelete is not null");
return (Criteria) this;
}
public Criteria andIsdeleteEqualTo(Boolean value) {
addCriterion("isDelete =", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteNotEqualTo(Boolean value) {
addCriterion("isDelete <>", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteGreaterThan(Boolean value) {
addCriterion("isDelete >", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteGreaterThanOrEqualTo(Boolean value) {
addCriterion("isDelete >=", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteLessThan(Boolean value) {
addCriterion("isDelete <", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteLessThanOrEqualTo(Boolean value) {
addCriterion("isDelete <=", value, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteIn(List<Boolean> values) {
addCriterion("isDelete in", values, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteNotIn(List<Boolean> values) {
addCriterion("isDelete not in", values, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteBetween(Boolean value1, Boolean value2) {
addCriterion("isDelete between", value1, value2, "isdelete");
return (Criteria) this;
}
public Criteria andIsdeleteNotBetween(Boolean value1, Boolean value2) {
addCriterion("isDelete not between", value1, value2, "isdelete");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createtime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createtime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createtime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createtime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createtime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createtime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createtime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createtime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createtime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createtime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createtime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createtime not between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreaterIsNull() {
addCriterion("creater is null");
return (Criteria) this;
}
public Criteria andCreaterIsNotNull() {
addCriterion("creater is not null");
return (Criteria) this;
}
public Criteria andCreaterEqualTo(String value) {
addCriterion("creater =", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterNotEqualTo(String value) {
addCriterion("creater <>", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterGreaterThan(String value) {
addCriterion("creater >", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterGreaterThanOrEqualTo(String value) {
addCriterion("creater >=", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterLessThan(String value) {
addCriterion("creater <", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterLessThanOrEqualTo(String value) {
addCriterion("creater <=", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterLike(String value) {
addCriterion("creater like", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterNotLike(String value) {
addCriterion("creater not like", value, "creater");
return (Criteria) this;
}
public Criteria andCreaterIn(List<String> values) {
addCriterion("creater in", values, "creater");
return (Criteria) this;
}
public Criteria andCreaterNotIn(List<String> values) {
addCriterion("creater not in", values, "creater");
return (Criteria) this;
}
public Criteria andCreaterBetween(String value1, String value2) {
addCriterion("creater between", value1, value2, "creater");
return (Criteria) this;
}
public Criteria andCreaterNotBetween(String value1, String value2) {
addCriterion("creater not between", value1, value2, "creater");
return (Criteria) this;
}
public Criteria andEditetimeIsNull() {
addCriterion("editetime is null");
return (Criteria) this;
}
public Criteria andEditetimeIsNotNull() {
addCriterion("editetime is not null");
return (Criteria) this;
}
public Criteria andEditetimeEqualTo(Date value) {
addCriterion("editetime =", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeNotEqualTo(Date value) {
addCriterion("editetime <>", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeGreaterThan(Date value) {
addCriterion("editetime >", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeGreaterThanOrEqualTo(Date value) {
addCriterion("editetime >=", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeLessThan(Date value) {
addCriterion("editetime <", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeLessThanOrEqualTo(Date value) {
addCriterion("editetime <=", value, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeIn(List<Date> values) {
addCriterion("editetime in", values, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeNotIn(List<Date> values) {
addCriterion("editetime not in", values, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeBetween(Date value1, Date value2) {
addCriterion("editetime between", value1, value2, "editetime");
return (Criteria) this;
}
public Criteria andEditetimeNotBetween(Date value1, Date value2) {
addCriterion("editetime not between", value1, value2, "editetime");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(String value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(String value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(String value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(String value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(String value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(String value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLike(String value) {
addCriterion("operator like", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotLike(String value) {
addCriterion("operator not like", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<String> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<String> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(String value1, String value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(String value1, String value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"18600409059@163.com"
] | 18600409059@163.com |
bdf47fb64f1265384768afd4b3f5f6d0997b5d3e | 7e1eee5e431a1a9f2236a39f40f943a0d089c331 | /src/Persistencia/Controller/ColorProductoJpaController.java | 488e5d9ac51a80f41e862e4aebaeae141fb5cb02 | [] | no_license | sebasmonca/Philae | 6b370d179b1279fcf096bbd5a7f0b704419b1a89 | 0bd8aa7ab6ec9c802cbf5ca2d802bf23a25fb22c | refs/heads/master | 2021-01-10T04:09:50.333185 | 2015-10-28T14:29:27 | 2015-10-28T14:29:27 | 43,270,159 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,168 | 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 Persistencia.Controller;
import Persistencia.Controller.exceptions.IllegalOrphanException;
import Persistencia.Controller.exceptions.NonexistentEntityException;
import Persistencia.Entities.ColorProducto;
import java.io.Serializable;
import javax.persistence.Query;
import javax.persistence.EntityNotFoundException;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import Persistencia.Entities.OrdenProduccion;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
/**
*
* @author Sebas
*/
public class ColorProductoJpaController implements Serializable {
public ColorProductoJpaController(EntityManagerFactory emf) {
this.emf = emf;
}
private EntityManagerFactory emf = null;
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
public void create(ColorProducto colorProducto) {
if (colorProducto.getOrdenProduccionList() == null) {
colorProducto.setOrdenProduccionList(new ArrayList<OrdenProduccion>());
}
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
List<OrdenProduccion> attachedOrdenProduccionList = new ArrayList<OrdenProduccion>();
for (OrdenProduccion ordenProduccionListOrdenProduccionToAttach : colorProducto.getOrdenProduccionList()) {
ordenProduccionListOrdenProduccionToAttach = em.getReference(ordenProduccionListOrdenProduccionToAttach.getClass(), ordenProduccionListOrdenProduccionToAttach.getIdOrdenProduccion());
attachedOrdenProduccionList.add(ordenProduccionListOrdenProduccionToAttach);
}
colorProducto.setOrdenProduccionList(attachedOrdenProduccionList);
em.persist(colorProducto);
for (OrdenProduccion ordenProduccionListOrdenProduccion : colorProducto.getOrdenProduccionList()) {
ColorProducto oldIdColorProductoOfOrdenProduccionListOrdenProduccion = ordenProduccionListOrdenProduccion.getIdColorProducto();
ordenProduccionListOrdenProduccion.setIdColorProducto(colorProducto);
ordenProduccionListOrdenProduccion = em.merge(ordenProduccionListOrdenProduccion);
if (oldIdColorProductoOfOrdenProduccionListOrdenProduccion != null) {
oldIdColorProductoOfOrdenProduccionListOrdenProduccion.getOrdenProduccionList().remove(ordenProduccionListOrdenProduccion);
oldIdColorProductoOfOrdenProduccionListOrdenProduccion = em.merge(oldIdColorProductoOfOrdenProduccionListOrdenProduccion);
}
}
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public void edit(ColorProducto colorProducto) throws IllegalOrphanException, NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
ColorProducto persistentColorProducto = em.find(ColorProducto.class, colorProducto.getIdColorProducto());
List<OrdenProduccion> ordenProduccionListOld = persistentColorProducto.getOrdenProduccionList();
List<OrdenProduccion> ordenProduccionListNew = colorProducto.getOrdenProduccionList();
List<String> illegalOrphanMessages = null;
for (OrdenProduccion ordenProduccionListOldOrdenProduccion : ordenProduccionListOld) {
if (!ordenProduccionListNew.contains(ordenProduccionListOldOrdenProduccion)) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("You must retain OrdenProduccion " + ordenProduccionListOldOrdenProduccion + " since its idColorProducto field is not nullable.");
}
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
List<OrdenProduccion> attachedOrdenProduccionListNew = new ArrayList<OrdenProduccion>();
for (OrdenProduccion ordenProduccionListNewOrdenProduccionToAttach : ordenProduccionListNew) {
ordenProduccionListNewOrdenProduccionToAttach = em.getReference(ordenProduccionListNewOrdenProduccionToAttach.getClass(), ordenProduccionListNewOrdenProduccionToAttach.getIdOrdenProduccion());
attachedOrdenProduccionListNew.add(ordenProduccionListNewOrdenProduccionToAttach);
}
ordenProduccionListNew = attachedOrdenProduccionListNew;
colorProducto.setOrdenProduccionList(ordenProduccionListNew);
colorProducto = em.merge(colorProducto);
for (OrdenProduccion ordenProduccionListNewOrdenProduccion : ordenProduccionListNew) {
if (!ordenProduccionListOld.contains(ordenProduccionListNewOrdenProduccion)) {
ColorProducto oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion = ordenProduccionListNewOrdenProduccion.getIdColorProducto();
ordenProduccionListNewOrdenProduccion.setIdColorProducto(colorProducto);
ordenProduccionListNewOrdenProduccion = em.merge(ordenProduccionListNewOrdenProduccion);
if (oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion != null && !oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion.equals(colorProducto)) {
oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion.getOrdenProduccionList().remove(ordenProduccionListNewOrdenProduccion);
oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion = em.merge(oldIdColorProductoOfOrdenProduccionListNewOrdenProduccion);
}
}
}
em.getTransaction().commit();
} catch (Exception ex) {
String msg = ex.getLocalizedMessage();
if (msg == null || msg.length() == 0) {
Integer id = colorProducto.getIdColorProducto();
if (findColorProducto(id) == null) {
throw new NonexistentEntityException("The colorProducto with id " + id + " no longer exists.");
}
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
ColorProducto colorProducto;
try {
colorProducto = em.getReference(ColorProducto.class, id);
colorProducto.getIdColorProducto();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The colorProducto with id " + id + " no longer exists.", enfe);
}
List<String> illegalOrphanMessages = null;
List<OrdenProduccion> ordenProduccionListOrphanCheck = colorProducto.getOrdenProduccionList();
for (OrdenProduccion ordenProduccionListOrphanCheckOrdenProduccion : ordenProduccionListOrphanCheck) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("This ColorProducto (" + colorProducto + ") cannot be destroyed since the OrdenProduccion " + ordenProduccionListOrphanCheckOrdenProduccion + " in its ordenProduccionList field has a non-nullable idColorProducto field.");
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
em.remove(colorProducto);
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public List<ColorProducto> findColorProductoEntities() {
return findColorProductoEntities(true, -1, -1);
}
public List<ColorProducto> findColorProductoEntities(int maxResults, int firstResult) {
return findColorProductoEntities(false, maxResults, firstResult);
}
private List<ColorProducto> findColorProductoEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(ColorProducto.class));
Query q = em.createQuery(cq);
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
public ColorProducto findColorProducto(Integer id) {
EntityManager em = getEntityManager();
try {
return em.find(ColorProducto.class, id);
} finally {
em.close();
}
}
public int getColorProductoCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<ColorProducto> rt = cq.from(ColorProducto.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
}
| [
"Sebas@Sebastian"
] | Sebas@Sebastian |
21c4217c9360ac2040f60b505e93a3a61575dcd5 | b23f37aa7dcae1033cf84490a830b89d8e3ff01f | /src/main/java/com/bth/lht/rest/CheckPhone.java | 11bf685eb016563d02fd64a7c8d2c4eafa0a0e12 | [] | no_license | ttangxing950125/lht | 817674de61f0fec873ef01090041c77b789c6475 | 185e0c58a95e683d13f195ad900b908b9de3c48c | refs/heads/tx | 2022-07-11T21:07:14.806009 | 2019-05-30T02:25:45 | 2019-05-30T02:25:45 | 185,150,615 | 0 | 0 | null | 2022-06-21T01:06:42 | 2019-05-06T08:00:36 | Java | UTF-8 | Java | false | false | 618 | java | package com.bth.lht.rest;
import com.bth.lht.respose.base.OneResponse;
import com.bth.lht.util.SendSMS;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
@Api("手机验证")
@RestController("checkPhone")
public class CheckPhone {
@GetMapping("/getPHoneCode")
public String toSendCode( @RequestHeader("token") String token){
return SendSMS.check();
}
}
| [
"407425690@qq.com"
] | 407425690@qq.com |
e185dcc4eebaa4e7afe939041f76be4d30746b2d | bf6fa881f8fcbcfc20de370286fdeb30c228300a | /youtube/coding-in-flow/DodgeInsetEdgesExample/app/src/test/java/com/example/dodgeinsetedgesexample/ExampleUnitTest.java | a750e67de025744a1cbf218be01171fdec67e965 | [] | no_license | danglvh-jp/android-developer-training | 4b2fd5bceec97a1bb8c07e4e5e6a5b1b34dc2695 | abda450081ad42ae736cc828f394f1fd6b4a8411 | refs/heads/main | 2023-05-28T08:14:39.688423 | 2021-06-10T13:15:54 | 2021-06-10T13:15:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java | package com.example.dodgeinsetedgesexample;
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);
}
} | [
"lvhd.hdlv@gmail.com"
] | lvhd.hdlv@gmail.com |
9ab6318f19d347f1f87e0ef9342c2a68266afab3 | 7ad527bad3bd0d7eb94d1d8a0fe08df67aa26c3e | /软件学院/高级语言程序设计(Java)/答案/Exercise18_33.java | b702daa4f85db663afb2e41efa9ca8add0e35070 | [] | no_license | SCUTMSC/SCUT-Course | 67e67ac494aef7fc73de17f61b7fab8450f17952 | 90f884a9032e951ebc9421cc88ca807b9ec211da | refs/heads/master | 2020-07-16T22:22:53.359477 | 2019-09-07T08:28:09 | 2019-09-07T08:28:09 | 205,880,291 | 10 | 6 | null | null | null | null | UTF-8 | Java | false | false | 7,770 | java | import java.util.ArrayList;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.geometry.Point2D;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Line;
import javafx.stage.Stage;
import javafx.util.Duration;
public class Exercise18_33 extends Application {
private static final int SIZE = 8;
private int startX = 0;
private int startY = 0;
private ArrayList<Point2D> moveHistory = null;
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
BorderPane pane = new BorderPane();
ChessBoard board = new ChessBoard();
pane.setCenter(board);
Button btSolve = new Button("Solve");
pane.setBottom(btSolve);
BorderPane.setAlignment(btSolve, Pos.CENTER);
// Create a scene and place it in the stage
Scene scene = new Scene(pane, 250, 250);
primaryStage.setTitle("Exercise18_33"); // Set the stage title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage
board.paint();
btSolve.setOnAction(e -> {
boolean[][] moves = new boolean[SIZE][SIZE];
moves[startX][startY] = true;
resetMoveHistory();
addMoveHistory(startX, startY);
solvePuzzle(moves, 1, startX, startY);
board.startAnimation();;
});
scene.widthProperty().addListener(ov -> board.paint());
scene.heightProperty().addListener(ov -> board.paint());
}
// This method does the bulk of the work.
// I'm not *thrilled* with this solution as
// it has more redundant code than I'd prefer
// but it gets the job done and done efficiently.
// Uses Warnsdorf's heuristic discovered in 1823
// that says the best move is the one with the
// fewest next moves. I found it necessary to
// back up in only one case (3,0) and choose to
// try the second best move which worked well.
private boolean solvePuzzle(boolean[][] moves, int numMoves, int x, int y) {
int nextX = 0;
int nextY = 0;
int bestMoveX = 0;
int bestMoveY = 0;
int bestMoveX2 = 0;
int bestMoveY2 = 0;
int minMoveCount = SIZE; // Knight has max of 8 moves
int moveCount = 0;
for (int i = 2; i >= -2; i += -4) {
for (int j = 1; j >= -1; j += -2) {
nextX = x + i;
nextY = y + j;
if (nextX >= 0 && nextX <= SIZE - 1 && nextY >= 0 && nextY <= SIZE - 1
&& !moves[nextX][nextY]) {
moveCount = lookAheadCount(moves, nextX, nextY);
if (moveCount <= minMoveCount) {
minMoveCount = moveCount;
bestMoveX2 = bestMoveX;
bestMoveY2 = bestMoveY;
bestMoveX = nextX;
bestMoveY = nextY;
}
}
nextX = x + j;
nextY = y + i;
if (nextX >= 0 && nextX <= SIZE - 1 && nextY >= 0 && nextY <= SIZE - 1
&& !moves[nextX][nextY]) {
moveCount = lookAheadCount(moves, nextX, nextY);
if (moveCount <= minMoveCount) {
minMoveCount = moveCount;
bestMoveX2 = bestMoveX;
bestMoveY2 = bestMoveY;
bestMoveX = nextX;
bestMoveY = nextY;
}
}
}
}
moves[bestMoveX][bestMoveY] = true;
addMoveHistory(bestMoveX, bestMoveY);
numMoves++;
if (numMoves == (SIZE * SIZE))
return true;
if (moveCount > 0 && solvePuzzle(moves, numMoves, bestMoveX, bestMoveY)) {
return true;
}
moves[bestMoveX][bestMoveY] = false;
moves[bestMoveX2][bestMoveY2] = true;
removeLastMoveHistory();
addMoveHistory(bestMoveX2, bestMoveY2);
if (moveCount > 1 && solvePuzzle(moves, numMoves, bestMoveX2, bestMoveY2)) {
return true;
}
moves[bestMoveX2][bestMoveY2] = false;
removeLastMoveHistory();
numMoves--;
return false;
}
private int lookAheadCount(boolean[][] moves, int x, int y) {
int maxCount = 0;
for (int i = -2; i <= 2; i += 4) {
for (int j = -1; j <= 1; j += 2) {
int nextX = x + i;
int nextY = y + j;
if (nextX >= 0 && nextX <= SIZE - 1 && nextY >= 0 && nextY <= SIZE - 1
&& !moves[nextX][nextY]) {
maxCount++;
}
nextX = x + j;
nextY = y + i;
if (nextX >= 0 && nextX <= SIZE - 1 && nextY >= 0 && nextY <= SIZE - 1
&& !moves[nextX][nextY]) {
maxCount++;
}
}
}
return maxCount;
}
public void resetMoveHistory() {
moveHistory = new ArrayList(63);
}
public void addMoveHistory(int x, int y) {
moveHistory.add(new Point2D(x, y));
}
public void removeLastMoveHistory() {
moveHistory.remove(moveHistory.size() - 1);
}
private class ChessBoard extends Pane {
private ImageView knightImageView = new ImageView("image/knight.jpg");
private Timeline animation;
private int index = 0;
ChessBoard() {
this.setOnMouseClicked(e -> {
startX = (int)(e.getX() / (getWidth() / SIZE));
startY = (int)(e.getY() / (getHeight() / SIZE));
resetMoveHistory();
paint();
});
animation = new Timeline(
new KeyFrame(Duration.millis(1000), e -> controlPaint()));
animation.setCycleCount(Timeline.INDEFINITE);
}
private void controlPaint() {
index++;
paint();
if (index == moveHistory.size())
animation.stop();
}
public void startAnimation() {
index = 0;
animation.play();
}
private void paint() {
// Clear previous drawing
this.getChildren().clear();
// Add the Knight image
this.getChildren().add(knightImageView);
knightImageView.setX(startX * getWidth() / SIZE);
knightImageView.setY(startY * getHeight() / SIZE);
knightImageView.setFitWidth(getWidth() / SIZE);
knightImageView.setFitHeight(getHeight() / SIZE);
// Draw the lines
for (int i = 1; i <= SIZE; i++) {
this.getChildren().add(
new Line(0, i * getHeight() / SIZE, getWidth(), i * getHeight() / SIZE));
this.getChildren().add(
new Line(i * getWidth() / SIZE, 0, i * getWidth() / SIZE, getHeight()));
}
// Draw the moves
if (moveHistory != null && moveHistory.size() > 0) {
for (int i = 1; i < index; i++) {
Point2D p1 = moveHistory.get(i - 1);
Point2D p2 = moveHistory.get(i);
this.getChildren().add(
new Line(p1.getX() * (getWidth() / SIZE) + getWidth() / SIZE / 2,
p1.getY() * (getHeight() / SIZE) + (getHeight() / SIZE / 2),
p2.getX() * (getWidth() / SIZE) + getWidth() / SIZE / 2,
p2.getY() * (getHeight() / SIZE) + getHeight() / SIZE / 2));
}
// Add the Knight image
if (moveHistory.size() > 0) {
// Add the Knight image
ImageView knightImageView1 = new ImageView("image/knight.jpg");
this.getChildren().add(knightImageView1);
Point2D p = moveHistory.get(index - 1);
knightImageView1.setX(p.getX() * getWidth() / SIZE);
knightImageView1.setY(p.getY() * getHeight() / SIZE);
knightImageView1.setFitWidth(getWidth() / SIZE);
knightImageView1.setFitHeight(getHeight() / SIZE);
}
}
}
}
/**
* The main method is only needed for the IDE with limited
* JavaFX support. Not needed for running from the command line.
*/
public static void main(String[] args) {
launch(args);
}
}
| [
"LotteWong21@gmail.com"
] | LotteWong21@gmail.com |
5876529059c2980ccacc6e83e0dfc7289797fe5b | 0ef6dde4a34a6f80edb58b6b0bf5cff003d1dcac | /app/src/main/java/com/example/pc/myapplication/MyArrayAdapter.java | 38ddb3e0ec650c817d435d13d75b4a6fbe6bf452 | [] | no_license | levubao/BaoLe | 567316db71f99f21004e76743817e7c508286f71 | b5f3831c519904f3a889c11bc3a76c4e5a08ad33 | refs/heads/master | 2020-03-28T20:51:53.547408 | 2018-09-17T10:53:40 | 2018-09-17T10:53:40 | 149,109,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,993 | java | package com.example.pc.myapplication;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
public class MyArrayAdapter extends BaseAdapter {
Context myConText;
int myLayout;
List<CauThu> mylstCT;
public MyArrayAdapter(Context contex, int layout, List<CauThu> lstCT)
{
myConText=contex;
myLayout= layout;
mylstCT= lstCT;
}
@Override
public int getCount() {
return mylstCT.size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup)
{
ViewHolder holder;
if(view==null)
{
LayoutInflater inflater = (LayoutInflater) myConText.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(myLayout, null);
holder= new ViewHolder();
//Ánh xạ
holder.name = (TextView) view.findViewById(R.id.tvName);
holder.year = (TextView) view.findViewById(R.id.tvYear);
holder.hinh = (ImageView) view.findViewById(R.id.img_Hinh);
holder.hinhmot = (ImageView) view.findViewById(R.id.img_Hinh1);
view.setTag(holder);
} else
holder= (ViewHolder) view.getTag();
//Gán giá trị từ List SV
holder.name.setText(mylstCT.get(i).getName());
holder.year.setText(mylstCT.get(i).getYear());
holder.hinh.setImageResource(mylstCT.get(i).getHinh());
holder.hinhmot.setImageResource(mylstCT.get(i).getHinhmot());
return view;
}
private class ViewHolder
{
private TextView name, year;
private ImageView hinh,hinhmot;
}
}
| [
"levubao54@gmail.com"
] | levubao54@gmail.com |
7fc53fbe8eab8de6135a66d2dc01e0e7fc919d1a | f1ddd865291a3681839c79c68684f4740b7bc9b1 | /Day5/Assertion/src/com/hcl/as/AssertDemo.java | a3293a9a78ef0f52aae0090c3c567727b30ed834 | [] | no_license | anisha-r/Mode1-Training | a0aaba2b251a27373e5fb17cbba99d9170389adf | 19fb5c1dec8803884a1caffedbcc2981d1b52e68 | refs/heads/master | 2022-12-22T13:56:39.834627 | 2019-10-22T06:22:55 | 2019-10-22T06:22:55 | 212,010,084 | 0 | 0 | null | 2022-12-15T23:30:22 | 2019-10-01T04:08:21 | JavaScript | UTF-8 | Java | false | false | 363 | java | package com.hcl.as;
public class AssertDemo {
/**
* method for business logic.
*/
public void incr() {
int basic = 30000;
for (int i = 0; i < 8; i++) {
basic = basic + 4000;
assert basic < 48000;
System.out.println("salary" + basic);
}
}
public static void main(String[] args) {
new AssertDemo().incr();
}
}
| [
"goalwon@outlook.com"
] | goalwon@outlook.com |
f53795a6a6c02477d6df04639b137abfa88b70f4 | f68d2799aab3aab4c08c471b961ad93c04eed573 | /src/main/java/ya/eventdetector/Main.java | ceaf1a2406718db9f07977b99e7a0dbdc69c678e | [] | no_license | IgorRyabtsev/EventDetector | b52bafaea5e463335ea8c4495c65efb77641960b | 1e3ecc5e35cef3c419c193a4a79d86e513c9eb82 | refs/heads/master | 2021-07-09T00:37:04.847181 | 2017-10-07T22:03:55 | 2017-10-07T22:03:55 | 106,060,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package ya.eventdetector;
import ya.eventdetector.dbversion.EventCounterImpl;
import ya.eventdetector.treeversion.EventCounterImplTree;
public class Main {
public static void main(String[] args) {
EventCounterImplTree eventCounterImplTree = new EventCounterImplTree();
for (int i = 0; i < 200000; i++) {
eventCounterImplTree.addEvent();
}
System.out.println(eventCounterImplTree.getCountOfEventsPerMinute());
System.out.println(eventCounterImplTree.getCountOfEventsPerHour());
System.out.println(eventCounterImplTree.getCountOfEventsPerDay());
EventCounterImpl eventCounterImpl = new EventCounterImpl();
for (int i = 0; i < 200000; i++) {
eventCounterImpl.addEvent();
}
System.out.println(eventCounterImpl.getCountOfEventsPerMinute());
System.out.println(eventCounterImpl.getCountOfEventsPerHour());
System.out.println(eventCounterImpl.getCountOfEventsPerDay());
}
}
| [
"igorryabtsev@inbox.ru"
] | igorryabtsev@inbox.ru |
d071f7cfd6b11b92ba1ee504471a0f21b229ac67 | 128eb90ce7b21a7ce621524dfad2402e5e32a1e8 | /laravel-converted/src/main/java/com/project/convertedCode/globalNamespace/namespaces/Illuminate/namespaces/Notifications/classes/AnonymousNotifiable.java | 8898f1af1b62f4c5f7d2932120191878ebe89c87 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | RuntimeConverter/RuntimeConverterLaravelJava | 657b4c73085b4e34fe4404a53277e056cf9094ba | 7ae848744fbcd993122347ffac853925ea4ea3b9 | refs/heads/master | 2020-04-12T17:22:30.345589 | 2018-12-22T10:32:34 | 2018-12-22T10:32:34 | 162,642,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,816 | java | package com.project.convertedCode.globalNamespace.namespaces.Illuminate.namespaces.Notifications.classes;
import com.runtimeconverter.runtime.references.ReferenceContainer;
import com.project.convertedCode.globalNamespace.functions.app;
import com.runtimeconverter.runtime.passByReference.PassByReferenceArgs;
import com.runtimeconverter.runtime.references.BasicReferenceContainer;
import com.runtimeconverter.runtime.classes.StaticBaseClass;
import com.runtimeconverter.runtime.classes.RuntimeClassBase;
import com.runtimeconverter.runtime.RuntimeEnv;
import com.runtimeconverter.runtime.passByReference.RuntimeArgsWithReferences;
import com.runtimeconverter.runtime.references.ReferenceClassProperty;
import com.project.convertedCode.globalNamespace.namespaces.Illuminate.namespaces.Contracts.namespaces.Notifications.classes.Dispatcher;
import com.runtimeconverter.runtime.ZVal;
import com.runtimeconverter.runtime.reflection.ReflectionClassData;
import com.runtimeconverter.runtime.annotations.ConvertedParameter;
import com.runtimeconverter.runtime.arrays.ZPair;
import java.lang.invoke.MethodHandles;
import com.runtimeconverter.runtime.classes.NoConstructor;
import com.runtimeconverter.runtime.annotations.ConvertedMethod;
import static com.runtimeconverter.runtime.ZVal.assignParameter;
/*
Converted with The Runtime Converter (runtimeconverter.com)
vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php
*/
public class AnonymousNotifiable extends RuntimeClassBase {
public Object routes = ZVal.newArray();
public AnonymousNotifiable(RuntimeEnv env, Object... args) {
super(env);
}
public AnonymousNotifiable(NoConstructor n) {
super(n);
}
@ConvertedMethod
@ConvertedParameter(index = 0, name = "channel")
@ConvertedParameter(index = 1, name = "route")
public Object route(RuntimeEnv env, Object... args) {
Object channel = assignParameter(args, 0, false);
Object route = assignParameter(args, 1, false);
new ReferenceClassProperty(this, "routes", env).arrayAccess(env, channel).set(route);
return ZVal.assign(this);
}
@ConvertedMethod
@ConvertedParameter(index = 0, name = "notification")
public Object notify(RuntimeEnv env, Object... args) {
ReferenceContainer notification =
new BasicReferenceContainer(assignParameter(args, 0, false));
env.callMethod(
app.f.env(env).call(Dispatcher.CONST_class).value(),
new RuntimeArgsWithReferences().add(1, notification),
"send",
AnonymousNotifiable.class,
this,
notification.getObject());
return null;
}
@ConvertedMethod
@ConvertedParameter(index = 0, name = "notification")
public Object notifyNow(RuntimeEnv env, Object... args) {
Object notification = assignParameter(args, 0, false);
env.callMethod(
app.f.env(env).call(Dispatcher.CONST_class).value(),
"sendNow",
AnonymousNotifiable.class,
this,
notification);
return null;
}
@ConvertedMethod
@ConvertedParameter(index = 0, name = "driver")
public Object routeNotificationFor(RuntimeEnv env, Object... args) {
Object driver = assignParameter(args, 0, false);
Object ternaryExpressionTemp = null;
return ZVal.assign(
ZVal.isDefined(
ternaryExpressionTemp =
new ReferenceClassProperty(this, "routes", env)
.arrayGet(env, driver))
? ternaryExpressionTemp
: ZVal.getNull());
}
@ConvertedMethod
public Object getKey(RuntimeEnv env, Object... args) {
return null;
}
public static final Object CONST_class = "Illuminate\\Notifications\\AnonymousNotifiable";
// Runtime Converter Internals
// RuntimeStaticCompanion contains static methods
// RequestStaticProperties contains static (per-request) properties
// ReflectionClassData contains php reflection data used by the runtime library
public static class RuntimeStaticCompanion extends StaticBaseClass {
private static final MethodHandles.Lookup staticCompanionLookup = MethodHandles.lookup();
}
public static final RuntimeStaticCompanion runtimeStaticObject = new RuntimeStaticCompanion();
private static final ReflectionClassData runtimeConverterReflectionData =
ReflectionClassData.builder()
.setName("Illuminate\\Notifications\\AnonymousNotifiable")
.setLookup(
AnonymousNotifiable.class,
MethodHandles.lookup(),
RuntimeStaticCompanion.staticCompanionLookup)
.setLocalProperties("routes")
.setFilename(
"vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php")
.get();
@Override
public ReflectionClassData getRuntimeConverterReflectionData() {
return runtimeConverterReflectionData;
}
@Override
public Object converterRuntimeCallExtended(
RuntimeEnv env,
String method,
Class<?> caller,
PassByReferenceArgs passByReferenceArgs,
Object... args) {
return RuntimeClassBase.converterRuntimeCallExtendedWithDataStatic(
this,
runtimeConverterReflectionData,
env,
method,
caller,
passByReferenceArgs,
args);
}
}
| [
"git@runtimeconverter.com"
] | git@runtimeconverter.com |
7b159fc125c921b8e147dfce3bbe3f4f1ebe56fd | a7d2b45e72d745f51db450cc16dc332269a6b5f1 | /AlmullaExchange/src/com/amg/exchange/remittance/bean/AdditionalBankAmiecTemp.java | 5867d4ac1a16eece1a59af4a9260ca472ea7696b | [] | no_license | Anilreddyvasantham/AlmullaExchange | 2974ecd53b1d752931c50b7ecd22c5a37fa05a03 | b68bca218ce4b7585210deeda2a8cf84c6306ee3 | refs/heads/master | 2021-05-08T17:48:01.976582 | 2018-02-02T09:32:22 | 2018-02-02T09:32:22 | 119,484,446 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,642 | java | package com.amg.exchange.remittance.bean;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import com.amg.exchange.remittance.model.AdditionalBankRuleAddData;
public class AdditionalBankAmiecTemp implements Serializable{
private static final long serialVersionUID = 1L;
private BigDecimal bankId;
private String bankName;
private String addtionalFieldDesc;
private Boolean ifRecordEdited;
private BigDecimal amiecAndBankMappingPK;
private List<AdditionalBankRuleAddData> addtionalBankRuleList;
public Boolean getIfRecordEdited() {
return ifRecordEdited;
}
public void setIfRecordEdited(Boolean ifRecordEdited) {
this.ifRecordEdited = ifRecordEdited;
}
public BigDecimal getAmiecAndBankMappingPK() {
return amiecAndBankMappingPK;
}
public void setAmiecAndBankMappingPK(BigDecimal amiecAndBankMappingPK) {
this.amiecAndBankMappingPK = amiecAndBankMappingPK;
}
public BigDecimal getBankId() {
return bankId;
}
public String getBankName() {
return bankName;
}
public List<AdditionalBankRuleAddData> getAddtionalBankRuleList() {
return addtionalBankRuleList;
}
public void setBankId(BigDecimal bankId) {
this.bankId = bankId;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public void setAddtionalBankRuleList(
List<AdditionalBankRuleAddData> addtionalBankRuleList) {
this.addtionalBankRuleList = addtionalBankRuleList;
}
public String getAddtionalFieldDesc() {
return addtionalFieldDesc;
}
public void setAddtionalFieldDesc(String addtionalFieldDesc) {
this.addtionalFieldDesc = addtionalFieldDesc;
}
}
| [
"anilreddy.vasantham@gmail.com"
] | anilreddy.vasantham@gmail.com |
25f7e4dd04750e1cc1310e4bd53b238d627d9e57 | fa5d3d620485c9e384cf0018b2e64ec3d13f3fe6 | /app/src/test/java/com/niedzielski/translucentactivitydemo/ExampleUnitTest.java | c88c74fde5b59a4d3746e10e439569cef4b2bca5 | [] | no_license | niedzielski/TranslucentActivityDemo | c77058f353659e593553b3b35e1c543125a696db | 61701beef3f24f96dac564a0f500e37f374ce3c0 | refs/heads/master | 2020-07-04T14:14:46.252113 | 2016-11-18T18:56:24 | 2016-11-18T18:56:24 | 74,157,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package com.niedzielski.translucentactivitydemo;
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() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"stephen@niedzielski.com"
] | stephen@niedzielski.com |
8b0411b87e4bbe732b8f1cce86ce485b7f519e46 | 961c86629949b47335def35b3cda7578009b2ab9 | /src/main/java/com/murphy1/inventory/services/UserService.java | 1d4f096b3a9a5cdb7b3e04aa776acacb378dcaf7 | [
"MIT"
] | permissive | murphy1/inventory-management-spring | a2851975d77c9b71c4f41b0cc986480d1d781caf | 0d1ac25179f2ca91a13ddeb79f4e75466a72f07f | refs/heads/master | 2020-07-05T08:10:24.563549 | 2019-12-12T15:04:57 | 2019-12-12T15:04:57 | 202,584,228 | 2 | 0 | null | 2019-09-18T16:06:34 | 2019-08-15T17:30:35 | Java | UTF-8 | Java | false | false | 262 | java | package com.murphy1.inventory.services;
import com.murphy1.inventory.model.User;
import java.util.List;
public interface UserService {
List<User> getAllUsers();
User saveUser(User user);
User findUserById(Long id);
void deleteById(Long id);
}
| [
"smurphy54321@gmail.com"
] | smurphy54321@gmail.com |
2642286a7f67a0b94c2dd3b56de5821ea2a37e56 | b3e8f27ce641f2a830c4ece48afd5e0190d8b8b2 | /src/main/java/com/tilitili/common/mysqlautocode/client/ColumnAutocode.java | 3aa83a6067cbaeb9241f7289ca8e264aeb2ff83e | [] | no_license | Jadlokin-Scarlet/tilitili-common | 718db2689222a98c0dcb5d8154c1f54e2b178f04 | 986e3d38d70d262ad0f1363173b72aeac6bd4309 | refs/heads/master | 2023-07-10T22:36:27.611325 | 2021-08-06T02:02:30 | 2021-08-06T02:02:30 | 307,113,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,208 | java | package com.tilitili.common.mysqlautocode.client;
import com.google.gson.Gson;
import com.tilitili.common.mysqlautocode.server.FieldPair;
import com.tilitili.common.mysqlautocode.server.Filter;
import com.tilitili.common.mysqlautocode.server.Table2Domain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
public class ColumnAutocode {
private static Logger logger = LoggerFactory.getLogger(ColumnAutocode.class);
public static String run() throws IOException {
// File file = new File(AutocodeHelper.antdesignPath+ Table2Domain.domainName+"Columns.jsx");
// if(file.exists()) {
// file.delete();
// }
//
// OutputStream outStream = new FileOutputStream(file, true);
// BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outStream));
List<Column> columns = new ArrayList<>();
for(Map.Entry<String, FieldPair> entry: Table2Domain.fieldPairMap.entrySet()) {
FieldPair fieldPair = entry.getValue();
String columnName = fieldPair.columnName;
String columnType = fieldPair.columnType;
String propertyName = fieldPair.propertyName;
String propertyType = fieldPair.propertyType;
String propertyClassName = fieldPair.propertyClassName;
Column column = new Column();
column.title = "'"+fieldPair.getDisplayName()+"'";
column.dataIndex = "'"+fieldPair.getPropertyName()+"'";
if ("DATETIME".equals(columnType)) {
column.width = 170;
column.render = "(val) => { return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '' }";
}
if ("DATE".equals(columnType)) {
column.width = 170;
column.render = "(val) => { return val ? moment(val).format('YYYY-MM-DD') : '' }";
}
if(isNotEmpty(fieldPair.filters)) {
column.filteredValue = "filteredInfo."+fieldPair.getPropertyName()+" || null";
column.filterMultiple = false;
column.filters = fieldPair.filters;
StringBuffer renderBuf = new StringBuffer();
renderBuf.append("(").append(fieldPair.getPropertyName()).append(") => {");
renderBuf.append("switch (").append(fieldPair.getPropertyName()).append(") {");
for(Filter filter: column.filters) {
renderBuf.append("case ").append(filter.value).append(":")
.append("return ").append(filter.text).append("; ");
}
renderBuf.append("}}");
column.render = renderBuf.toString();
}else if(column.dataIndex.contains("image") || column.dataIndex.contains("img") || column.dataIndex.contains("icon")) {
StringBuffer renderBuf = new StringBuffer();
renderBuf.append("(").append(fieldPair.getPropertyName()).append(") => {")
.append("return <img src={").append(fieldPair.getPropertyName()).append("} style={{width: '80px', height: '80px'}}/>").append("}");
column.render = renderBuf.toString();
}else if(fieldPair.isIndex) {
//System.out.println(fieldPair.toString());
//getInputTitle = (title, index, pagination, filteredInfo
StringBuffer renderBuf = new StringBuffer();
renderBuf.append("getInputTitle(")
.append(column.title).append(",")
.append(column.dataIndex).append(",")
.append("pagination, filteredInfo").append(")").toString();
if(column.render !=null) {
column.render = column.render + ", ..." + renderBuf.toString();
}else{
column.render = renderBuf.toString();
}
}
columns.add(column);
}
return columns.toString().replaceAll("\"", "").replaceAll("render:getInputTitle", "...getInputTitle");
// bw.write("const columns = "+columns.toString().replaceAll("\"", ""));
// bw.close();
// logger.error("成功生成文件"+ AutocodeHelper.antdesignPath+ Table2Domain.domainName+"Columns.jsx");
}
public static class Column {
@Override
public String toString() {
return new Gson().toJson(this);
}
public String title;
public String dataIndex;
public Integer width = 100;
public Boolean filterMultiple;
public String filteredValue;
public List<Filter> filters;
public String render;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDataIndex() {
return dataIndex;
}
public void setDataIndex(String dataIndex) {
this.dataIndex = dataIndex;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Boolean getFilterMultiple() {
return filterMultiple;
}
public void setFilterMultiple(Boolean filterMultiple) {
this.filterMultiple = filterMultiple;
}
public String getFilteredValue() {
return filteredValue;
}
public void setFilteredValue(String filteredValue) {
this.filteredValue = filteredValue;
}
public List<Filter> getFilters() {
return filters;
}
public void setFilters(List<Filter> filters) {
this.filters = filters;
}
public String getRender() {
return render;
}
public void setRender(String render) {
this.render = render;
}
}
}
| [
"w545459363@126.com"
] | w545459363@126.com |
b2e07d13f96bf7ae0b0cee51f39cbe76c60d3e3e | 3870c4449e96eaa4dedd73ab266e75290bd0697f | /Clases/Clase8/src/clase8/Clase8.java | 53d8f872658cc6476287498270e6ff23aec3c042 | [] | no_license | Luis07/progra_1_lll_cuatri_2014_Luis_Brenes | 66b4303df069fa6012a4ac5e8b957625c064d9ef | 7e551e7ee822a75d796c116af439c5d09c256290 | refs/heads/master | 2021-01-20T04:40:04.310972 | 2014-12-02T16:01:12 | 2014-12-02T16:01:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | 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 clase8;
/**
*
* @author Luis B
*/
public class Clase8 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Ejercicio1 oEjercicio1= new Ejercicio1();
oEjercicio1.CrearMatriz(3, 5);
oEjercicio1.Cargamatriz();
System.out.println(oEjercicio1.mprimir()+"\n");
Ejercicio2 oEjercicio2= new Ejercicio2();
oEjercicio2.CrearMatriz(4, 4);
oEjercicio2.CargarMatriz();
System.out.println(oEjercicio2.Imprimir());
}
}
| [
"luisbrenes250594@gmail.com"
] | luisbrenes250594@gmail.com |
227560b9a2f10b73d20745cbef6d46167b767bb0 | 9e8cd7a960450b15c8e059e4f18a5dc9385f0b8c | /app/src/main/java/mx/edu/ittepic/practica2_inmobiliaria_u4/Main2Activity.java | 34d985500a87500cbce9878184f3038151b380a4 | [] | no_license | EdgarPaulRamirez/Practica2_Inmobiliaria_U4 | 8a60c43c2ffe399fd4f9919cd061c6cecb968a32 | d158e02a902741c90b4209b0914301c06c1ea280 | refs/heads/master | 2020-04-09T22:18:11.276217 | 2018-12-06T05:48:20 | 2018-12-06T05:48:20 | 160,624,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,125 | java | package mx.edu.ittepic.practica2_inmobiliaria_u4;
import android.content.DialogInterface;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class Main2Activity extends AppCompatActivity {
EditText IDInmueble, domicilioInmueble, precioVentaInmueble, precioRentaInmueble, fechaTransaccionInmueble, idpInmueble;
Button insertar, consultar, eliminar, actualizar;
BaseDatos base;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
IDInmueble = findViewById(R.id.IDInmueble);
domicilioInmueble = findViewById(R.id.domicilioInmueble);
precioVentaInmueble = findViewById(R.id.precioVentaInmueble);
precioRentaInmueble = findViewById(R.id.precioRentaInmueble);
fechaTransaccionInmueble = findViewById(R.id.fechaTransaccionInmueble);
idpInmueble = findViewById(R.id.idpInmueble);
insertar = findViewById(R.id.insertarInmueble);
consultar = findViewById(R.id.consultarInmueble);
eliminar = findViewById(R.id.eliminarInmueble);
actualizar = findViewById(R.id.actualizarInmueble);
base = new BaseDatos(this,"inmobiliaria",null,1);
insertar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
codigoInsertar();
}
});
consultar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pedirID(1);
}
});
actualizar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (actualizar.getText().toString().startsWith("CONFIRMAR ACTUALIZACION")){
confirmacionActualizacion();
}else{
pedirID(2);
}
}
});
eliminar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pedirID(3);
}
});
}
private void confirmacionActualizacion(){
AlertDialog.Builder confir = new AlertDialog.Builder(this);
confir.setTitle("ATENCIÓN").setMessage("¿Seguro que deseeas realiar los cambios?")
.setPositiveButton("Si, estoy seguro", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
aplicarActualizar();
dialog.dismiss();
}
}).setNegativeButton("cancelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
habilitarBotonesYLimpiarCampos();
dialog.cancel();
}
}).show();
}
private void aplicarActualizar(){
try{
SQLiteDatabase tabla = base.getWritableDatabase();
String SQL = "UPDATE INMUEBLE SET DOMICILIO='" + domicilioInmueble.getText().toString() + "', PRECIOVENTA=" + precioVentaInmueble.getText().toString() + ", PRECIORENTA=" + precioRentaInmueble.getText().toString()+",FECHATRANSACCION='"+fechaTransaccionInmueble.getText().toString()+"' WHERE IDINMUEBLE ="+idpInmueble.getText().toString();
tabla.execSQL(SQL);
tabla.close();
Toast.makeText(this,"Se actualizó CORRECTAMENTE",Toast.LENGTH_LONG).show();
}catch (SQLiteException e){
Toast.makeText(this,"ERROR: No se pudo actualizar",Toast.LENGTH_LONG).show();
}
habilitarBotonesYLimpiarCampos();
}
private void habilitarBotonesYLimpiarCampos(){
IDInmueble.setText("");
domicilioInmueble.setText("");
precioVentaInmueble.setText("");
precioRentaInmueble.setText("");
fechaTransaccionInmueble.setText("");
insertar.setEnabled(true);
consultar.setEnabled(true);
eliminar.setEnabled(true);
actualizar.setText("");
IDInmueble.setEnabled(true);
}
private void eliminarIdtodo(String idEliminar) {
try{
SQLiteDatabase tabla = base.getReadableDatabase();
String SQL = "DELETE FROM INMUEBLE WHERE IDINMUEBLE =" + idEliminar;
tabla.execSQL(SQL);
tabla.close();
Toast.makeText(this, "Se eleminó CORRECTAMENTE ", Toast.LENGTH_LONG).show();
}catch (SQLiteException e){
Toast.makeText(this, "ERROR: No se pudo Eliminar", Toast.LENGTH_LONG).show();
}
}
/////////////////////////para pedir el numero
private void pedirID(final int origen){
final EditText pidoID = new EditText(this);
pidoID.setInputType(InputType.TYPE_CLASS_NUMBER);
pidoID.setHint("Valor entero mayor de 0");
String mensaje ="Escriba el id a buscar";
String mensajeTitulo = "Buscando...";
AlertDialog.Builder alerta = new AlertDialog.Builder(this);
if(origen ==2){
mensaje ="Ecriba el id a modificar";
mensajeTitulo = "Modificando...";
}
if(origen ==3){
mensaje ="Favor de ingresar el ID a eliminar:";
mensajeTitulo = "Eliminando...";
}
alerta.setTitle(mensajeTitulo).setMessage(mensaje)
.setView(pidoID)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(pidoID.getText().toString().isEmpty()){
Toast.makeText(Main2Activity.this,"Favor de ingresar el ID a eliminar: ",Toast.LENGTH_LONG).show();
return;
}
buscarDato(pidoID.getText().toString(), origen);
dialog.dismiss();
}
})
.setNegativeButton("Cancelar",null).show();
}
//////////////////////////////////////////eliminar
private void buscarDato(String idaBuscar, int origen){
try{
SQLiteDatabase tabla = base.getReadableDatabase();
String SQL = "SELECT *FROM INMUEBLE WHERE IDINMUEBLE ="+idaBuscar;
Cursor resultado = tabla.rawQuery(SQL,null);
if(resultado.moveToFirst()){//mover le primer resultado obtenido de la consulta
//si hay resulta´do
if(origen==3){
//se consulto para borrar
String dato = idaBuscar+"&"+ resultado.getString(1)+"&"+resultado.getString(2)+
"&"+resultado.getString(3)+resultado.getString(4);
confirmacionEliminacion(dato);
return;
}
IDInmueble.setText(resultado.getString(0));
domicilioInmueble.setText(resultado.getString(1));
precioVentaInmueble.setText(resultado.getString(2));
precioRentaInmueble.setText(resultado.getString(3));
fechaTransaccionInmueble.setText(resultado.getString(4));
if(origen==2){
//modificar
insertar.setEnabled(false);
consultar.setEnabled(false);
eliminar.setEnabled(false);
actualizar.setText("CONFIRMAR ACTUALIZACION");
IDInmueble.setEnabled(false);
}
}else {
//no hay resultado!
Toast.makeText(this,"ERROR: No se encontró el resultado",Toast.LENGTH_LONG).show();
}
tabla.close();
}catch (SQLiteException e){
Toast.makeText(this,"ERROR: No se pudo realizar la busqueda",Toast.LENGTH_LONG).show();
}
}
private void confirmacionEliminacion(String dato) {
String datos[] = dato.split("&");
final String id = datos[0];
String nombre = datos[1];
AlertDialog.Builder alerta = new AlertDialog.Builder(this);
alerta.setTitle("ATENCIÓN").setMessage("Deseas eliminar el platillo: "+nombre)
.setPositiveButton("Si, estoy de acuerdo", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
eliminarIdtodo(id);
dialog.dismiss();
}
})
.setNegativeButton("Cancelar",null).show();
}
private void codigoInsertar(){
try {
//metodo que compete a la inserccion,
SQLiteDatabase tabla = base.getWritableDatabase();
String SQL = "INSERT INTO INMUEBLE VALUES(1,'%2', 3, 4,'%5', '%6')";
SQL = SQL.replace("1", IDInmueble.getText().toString());
SQL = SQL.replace("%2", domicilioInmueble.getText().toString());
SQL = SQL.replace("3", precioVentaInmueble.getText().toString());
SQL = SQL.replace("4", precioRentaInmueble.getText().toString());
SQL = SQL.replace("%5", fechaTransaccionInmueble.getText().toString());
SQL = SQL.replace("%6", idpInmueble.getText().toString());
tabla.execSQL(SQL);
Toast.makeText(this,"La insercción se realizó correctamente",Toast.LENGTH_LONG).show();
tabla.close();
}catch (SQLiteException e){
Toast.makeText(this,"No se pudo realizar la insercción",Toast.LENGTH_LONG).show();
}
}
}
| [
"edparamirezvi@ittepic.edu.mx"
] | edparamirezvi@ittepic.edu.mx |
4d93399556785dcfd1b87add86dee31c8bf6f380 | 9254e7279570ac8ef687c416a79bb472146e9b35 | /sofa-20190815/src/main/java/com/aliyun/sofa20190815/models/RemoveLinkeLinktWorkitemtagResponse.java | d708b1511a3e7003e77e67124e5f9733e05ae7b4 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,170 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sofa20190815.models;
import com.aliyun.tea.*;
public class RemoveLinkeLinktWorkitemtagResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("body")
@Validation(required = true)
public RemoveLinkeLinktWorkitemtagResponseBody body;
public static RemoveLinkeLinktWorkitemtagResponse build(java.util.Map<String, ?> map) throws Exception {
RemoveLinkeLinktWorkitemtagResponse self = new RemoveLinkeLinktWorkitemtagResponse();
return TeaModel.build(map, self);
}
public RemoveLinkeLinktWorkitemtagResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public RemoveLinkeLinktWorkitemtagResponse setBody(RemoveLinkeLinktWorkitemtagResponseBody body) {
this.body = body;
return this;
}
public RemoveLinkeLinktWorkitemtagResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
8058eb3ca7da06f58b02d0d758a6c1a49a2915a1 | 49ba5178f5993d02b457b93cdbab04e39d0fd6c3 | /exercicio4/PIF/nodes/nodeImplementations/PIFNode.java | dbba2866ec0a8f62de3d5ca918dc28635a74f966 | [] | no_license | renanccastro/MC833AB | dfe7ec84593a6d33355db15ec84a778eebe02ff6 | 063dd9dc7236bac0c52ef2ac504f10579cfa4b51 | refs/heads/master | 2021-01-19T03:15:22.175129 | 2016-06-29T04:51:25 | 2016-06-29T04:51:25 | 53,706,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,605 | java | package projects.PIF.nodes.nodeImplementations;
import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import projects.PIF.nodes.messages.FEEDBACKMessage;
import projects.PIF.nodes.messages.INFMessage;
import projects.PIF.nodes.timers.PIF_FeedbackTimer;
import projects.PIF.nodes.timers.MessageTimer;
import projects.PIF.nodes.timers.ResetTimer;
import sinalgo.configuration.WrongConfigurationException;
import sinalgo.gui.transformation.PositionTransformation;
import sinalgo.nodes.Node;
import sinalgo.nodes.messages.Inbox;
import sinalgo.nodes.messages.Message;
import sinalgo.runtime.Global;
import sinalgo.tools.Tools;
public class PIFNode extends Node {
private boolean reached = false;
private boolean leaf = false;
private int nextHopToSource;
public static int messages = 0;
public static int sentINF = 0;
public static int receivedINF = 0;
public static int sentFeedback = 0;
public static int receivedFeedback = 0;
public ArrayList<Integer> ids = new ArrayList<Integer>();
public boolean has_sent_feedback = false;
double time;
double timeSent;
/// Constantes
public static int timeToReset = 4000;
public static int timeToResend = 5000;
public static int timeToWaitFeedback = 20000;
int numerador = 500;
int inf_count = 0;
MessageTimer infMSG = null;
public enum TNO {TNO_FEEDBACK, TNO_FIRST_FEEDBACK };
private PIF_FeedbackTimer feedbackTimer;
private ResetTimer resetTimer;
@Override
public void handleMessages(Inbox inbox) {
// TODO Auto-generated method stub
int sender;
while(inbox.hasNext()) {
Message msg = inbox.next();
sender = inbox.getSender().ID;
//N� recebeu uma mensagem INF
if(msg instanceof INFMessage) {
inf_count++;
//System.out.println("Node: "+this.ID+" recebeu INF do Node "+sender);
INFMessage msgINF = (INFMessage) msg;
if(!this.reached)
{
time = Global.currentTime;
receivedINF++;
this.setColor(Color.GREEN);
this.reached = true;
this.nextHopToSource = msgINF.getSenderID();
msgINF.setSenderID(this.ID);
infMSG = new MessageTimer(msgINF);
infMSG.startRelative(1,this);
resetTimer = new ResetTimer(this);
resetTimer.startRelative(timeToReset, this);
//Agenda o FEEDBACK
ids.add(this.ID);
feedbackTimer = new PIF_FeedbackTimer(this, TNO.TNO_FIRST_FEEDBACK);
feedbackTimer.tnoStartRelative(1.1, this, TNO.TNO_FIRST_FEEDBACK);
}
if (inf_count > 2 && infMSG != null) {
infMSG.canSendInf(false);
leaf = true;
}
}
//Mensagem de Confirma��o
if(msg instanceof FEEDBACKMessage) {
FEEDBACKMessage msgFeedback = (FEEDBACKMessage) msg;
if (this.ID != 1){
if (msgFeedback.getDestinationID() == this.ID) {
if (has_sent_feedback) {
ids.clear();
has_sent_feedback = false;
feedbackTimer = new PIF_FeedbackTimer(this, TNO.TNO_FEEDBACK);
feedbackTimer.tnoStartRelative((float)timeToWaitFeedback/(time-timeSent), this, TNO.TNO_FEEDBACK);
//System.out.println("----- criando nova mensagem de feedback ----- ");
}
ids.addAll(msgFeedback.ids);
//System.out.println("Node: " + this.ID + " Recebeu Feedback do Node "+ msgFeedback.getSourceFeedbackID());
}
} else {
//System.out.println("Source node recebeu Feedback do Node "+ msgFeedback.getSourceFeedbackID());
//System.out.println("List size: " + msgFeedback.ids.size() );
receivedFeedback += msgFeedback.ids.size();
}
}
}
}
public void feedbackStart(){
has_sent_feedback= true;
//System.out.println("List size de " + this.ID + " quando vai mandar: " + ids.size() );
MessageTimer feedbackMSG = new MessageTimer (new FEEDBACKMessage(this.ID, this.nextHopToSource, this.ids));
feedbackMSG.startRelative(0.1, this);
}
public void timeout(TNO tno){
switch(tno){
case TNO_FEEDBACK:
feedbackStart();
break;
case TNO_FIRST_FEEDBACK:
if (leaf)
feedbackStart();
else
feedbackTimer.tnoStartRelative((float)numerador/time, this, TNO.TNO_FEEDBACK);
}
}
@Override
public void init() {
//Considerando que o n� 1 tem a mensagem inf
if (this.ID==1){
int i;
for (i = 1; i <= 1;i++) {
timeSent = Global.currentTime;
messages++;
this.setColor(Color.RED);
this.nextHopToSource = this.ID;
this.reached = true;
MessageTimer infMSG = new MessageTimer (new INFMessage(this.ID, timeSent));
infMSG.startRelative(timeToResend*i+0.1, this);
}
}
}
public void reset() {
this.setColor(Color.BLACK);
this.has_sent_feedback = false;
this.ids.clear();
this.inf_count = 0;
this.reached = false;
}
@Override
public void postStep() {
// TODO Auto-generated method stub
}
@Override
public void preStep() {
// TODO Auto-generated method stub
}
@Override
public void draw(Graphics g, PositionTransformation pt, boolean highlight) {
// TODO Auto-generated method stub
//if (this.ID == 1) highlight = true;
super.drawNodeAsDiskWithText(g, pt, highlight, Integer.toString(this.ID), 6, Color.WHITE);
}
@Override
public void neighborhoodChange() {
// TODO Auto-generated method stub
}
@Override
public void checkRequirements() throws WrongConfigurationException {
// TODO Auto-generated method stub
}
}
| [
"renanccastro@gmail.com"
] | renanccastro@gmail.com |
b129ba83d4283c5e9c3449899e1d8df07f1d7d2a | 34b713d69bae7d83bb431b8d9152ae7708109e74 | /core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/payment/service/OrderToPaymentRequestDTOService.java | 0253ac3bc9eae3153a781b575654ba3f4d118b1f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sinotopia/BroadleafCommerce | d367a22af589b51cc16e2ad094f98ec612df1577 | 502ff293d2a8d58ba50a640ed03c2847cb6369f6 | refs/heads/BroadleafCommerce-4.0.x | 2021-01-23T14:14:45.029362 | 2019-07-26T14:18:05 | 2019-07-26T14:18:05 | 93,246,635 | 0 | 0 | null | 2017-06-03T12:27:13 | 2017-06-03T12:27:13 | null | UTF-8 | Java | false | false | 3,784 | java | /*
* #%L
* BroadleafCommerce Framework
* %%
* Copyright (C) 2009 - 2013 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.core.payment.service;
import org.broadleafcommerce.common.money.Money;
import org.broadleafcommerce.common.payment.PaymentType;
import org.broadleafcommerce.common.payment.dto.PaymentRequestDTO;
import org.broadleafcommerce.core.order.domain.Order;
import org.broadleafcommerce.core.order.service.FulfillmentGroupService;
import org.broadleafcommerce.core.payment.domain.PaymentTransaction;
/**
* @author Elbert Bautista (elbertbautista)
*/
public interface OrderToPaymentRequestDTOService {
/**
* <p>This translates an Order of {@link PaymentType#CREDIT_CARD} into a PaymentRequestDTO.
* This method assumes that this translation will apply to a final payment which means that the transaction amount for
* the returned {@link PaymentRequestDTO} will be {@link Order#getTotalAfterAppliedPayments()}
* It assumes that all other payments (e.g. gift cards/account credit) have already
* been applied to the {@link Order}.</p>
*
* @param order the {@link Order} to be translated
* @return a {@link PaymentRequestDTO} based on the properties of <b>order</b>. This will only utilize the payments
* that are of type {@link PaymentType#CREDIT_CARD}
*/
public PaymentRequestDTO translateOrder(Order order);
/**
* Utilizes the {@link PaymentTransaction#getAdditionalFields()} map to populate necessary request parameters on the
* resulting {@link PaymentRequestDTO}. These additional fields are then used by the payment gateway to construct
* additional requests to the payment gateway. For instance, this might be use to refund or void the given <b>paymentTransaction</b>
*
* @param transactionAmount the amount that should be placed on {@link PaymentRequestDTO#getTransactionTotal()}
* @param paymentTransaction the transaction whose additional fields should be placed on {@link PaymentRequestDTO#getAdditionalFields()}
* for the gateway to use
* @return a new {@link PaymentRequestDTO} populated with the additional fields from <b>paymentTransaction</b> and
* the amount from <b>transactionAmount<b>
*/
public PaymentRequestDTO translatePaymentTransaction(Money transactionAmount, PaymentTransaction paymentTransaction);
public void populateTotals(Order order, PaymentRequestDTO requestDTO);
public void populateCustomerInfo(Order order, PaymentRequestDTO requestDTO);
/**
* Uses the first shippable fulfillment group to populate the {@link PaymentRequestDTO#shipTo()} object
* @param order the {@link Order} to get data from
* @param requestDTO the {@link PaymentRequestDTO} that should be populated
* @see {@link FulfillmentGroupService#getFirstShippableFulfillmentGroup(Order)}
*/
public void populateShipTo(Order order, PaymentRequestDTO requestDTO);
public void populateBillTo(Order order, PaymentRequestDTO requestDTO);
public void populateDefaultLineItemsAndSubtotal(Order order, PaymentRequestDTO requestDTO);
}
| [
"sinosie7en@gmail.com"
] | sinosie7en@gmail.com |
c62a7982a1d675b31f1f3931257ec9b331312dfe | f1eeb23473d5dabfbcdd18c80fd0eb5da0d0a08e | /sys/src/test/java/com/g/sys/log/service/SysLogServiceTest.java | 8174d3d746b6c7b5d280825487ab443810b3e772 | [
"MIT"
] | permissive | gaven004/g.next | f86c97be8b9ba478d4b5509a97ee425c48fc11c8 | 7828c937758eea0152e320c32644cc52ae57e6b3 | refs/heads/master | 2023-02-08T01:34:17.384421 | 2019-11-29T02:39:10 | 2019-11-29T02:39:10 | 112,418,712 | 0 | 0 | MIT | 2022-12-16T12:07:28 | 2017-11-29T02:58:53 | Java | UTF-8 | Java | false | false | 1,846 | java | package com.g.sys.log.service;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.g.sys.log.model.SysLog;
import com.g.sys.sec.model.SysUser;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/test-context.xml")
public class SysLogServiceTest {
@Autowired
SysLogService service;
public void logCreate() {
SysUser user = new SysUser();
user.setUid(1L);
user.setAccount("test");
user.setUsername("test");
user.setEnabled("VALID");
service.logCreate(0L, user);
}
public void logUpdate() {
SysUser user = new SysUser();
user.setUid(1L);
user.setAccount("test");
user.setUsername("test_user");
user.setEnabled("INVALID");
service.logUpdate(0L, user);
}
public void logDelete() {
SysUser user = new SysUser();
user.setUid(1L);
service.logDelete(0L, user);
}
public void getTrace() {
SysUser user = new SysUser();
user.setUid(1L);
List<SysLog> list = service.getTrace(user);
System.out.println(list);
}
public void remove() {
QueryWrapper<SysLog> wrapper = new QueryWrapper();
wrapper.eq(SysLog.CLAZZ, SysUser.class.getName());
wrapper.eq(SysLog.OID, "{\"uid\":\"test\"}");
service.remove(wrapper);
}
@Test
public void testAll() {
remove();
logCreate();
logUpdate();
logUpdate();
logUpdate();
logDelete();
getTrace();
}
} | [
"gaven_yeung@163.com"
] | gaven_yeung@163.com |
eaaeda5a940b3972f598e6d7ef19eec500fdbeed | a78cb207d9f65210b3b6c52c64809217157b6902 | /ulewo2.5/src/com/ulewo/controller/TopicAction.java | f8110edf0b888726f93150545c370c46dfdfbb7c | [] | no_license | songdragon/mycode | 4cfbf00cd0eef0bd6f42490706cd25009b064964 | 33c3d6ea6b554a8025783e233f97e02b319a5c4b | refs/heads/master | 2021-01-18T09:59:39.771585 | 2014-10-13T03:55:58 | 2014-10-13T03:55:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,111 | java | package com.ulewo.controller;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.ulewo.enums.AllowPostEnums;
import com.ulewo.enums.FileSizeEnums;
import com.ulewo.enums.ResultCode;
import com.ulewo.enums.SourceFromEnums;
import com.ulewo.enums.TopicCommentTypeEnums;
import com.ulewo.exception.BusinessException;
import com.ulewo.model.AttachmentDownload;
import com.ulewo.model.Group;
import com.ulewo.model.SessionUser;
import com.ulewo.model.Topic;
import com.ulewo.model.TopicCategory;
import com.ulewo.model.TopicComment;
import com.ulewo.model.TopicSurvey;
import com.ulewo.service.AttachmentDownloadService;
import com.ulewo.service.AttachmentService;
import com.ulewo.service.GroupMemberService;
import com.ulewo.service.GroupService;
import com.ulewo.service.Log;
import com.ulewo.service.TopicCategoryService;
import com.ulewo.service.TopicCommentService;
import com.ulewo.service.TopicService;
import com.ulewo.service.TopicSurveyService;
import com.ulewo.service.UserService;
import com.ulewo.util.Constant;
import com.ulewo.util.ErrorReport;
import com.ulewo.util.StringUtils;
import com.ulewo.util.UlewoPaginationResult;
@Controller
@RequestMapping("/group")
public class TopicAction extends BaseGroupAction {
@Autowired
GroupService groupService;
@Autowired
TopicService topicService;
@Autowired
TopicSurveyService topicSurveyService;
@Autowired
TopicCategoryService topicCategoryService;
@Autowired
UserService userService;
@Autowired
GroupMemberService groupMemberService;
@Autowired
TopicCommentService topicCmmentService;
@Autowired
AttachmentService attachedService;
@Autowired
AttachmentDownloadService attachedDownloadService;
@Log
Logger log;
/**
* 主题列表,所有主题,分类主题
*
* @param gid
* @param cateId
* @param session
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/{gid}/cateId/{cateId}", method = RequestMethod.GET)
public ModelAndView groupArticleInItem(@PathVariable String gid, @PathVariable String cateId, HttpSession session,
HttpServletRequest request, HttpServletResponse response) {
ModelAndView mv = new ModelAndView();
try {
Map<String, String> map = this.builderParams(request, true);
map.put("gid", gid);
map.put("categoryId", cateId);
Group group = this.checkGroup(map, session);
// 查询文章
UlewoPaginationResult<Topic> topicResult = topicService.findTopics(map);
// 查询分类
List<TopicCategory> categoryList = topicCategoryService.queryCategoryAndTopicCount(map);
SessionUser sessionUser = this.getSessionUser(session);
TopicCategory category = topicCategoryService.getCategroy(map);
if (sessionUser != null && sessionUser.getUserId().intValue() == group.getGroupUserId().intValue()) {
category.setAllowPost(AllowPostEnums.ALLOW.getValue());
}
mv.addObject("group", group);
mv.addObject("category", category);
mv.addObject("gid", gid);
mv.addObject("topicResult", topicResult);
mv.addObject("categoryList", categoryList);
mv.addObject("cateId", cateId);
if (StringUtils.isEmpty(cateId)) {
mv.setViewName("group/group");
} else {
mv.setViewName("group/group_articles");
}
} catch (Exception e) {
String errorMethod = "GroupAction-->groupIndex()<br>";
ErrorReport report = new ErrorReport(errorMethod + e.getMessage());
Thread thread = new Thread(report);
thread.start();
mv.setViewName("redirect:" + Constant.ERRORPAGE);
return mv;
}
return mv;
}
/**
* 详情
*
* @param gid
* @param topicId
* @param session
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/{gid}/topic/{topicId}", method = RequestMethod.GET)
public ModelAndView showTopic(@PathVariable String gid, @PathVariable String topicId, HttpSession session,
HttpServletRequest request, HttpServletResponse response) {
ModelAndView mv = new ModelAndView();
try {
Map<String, String> map = this.builderParams(request, true);
map.put("gid", gid);
map.put("topicId", topicId);
Group group = this.checkGroup(map, session);
Topic topic = this.topicService.showTopic(map);
// 查询分类
List<TopicCategory> categoryList = topicCategoryService.queryCategoryAndTopicCount(map);
mv.addObject("group", group);
mv.addObject("topic", topic);
mv.addObject("categoryList", categoryList);
mv.setViewName("group/show_detail");
} catch (Exception e) {
log.error(e.getMessage());
mv.setViewName("redirect:" + Constant.ERRORPAGE);
return mv;
}
return mv;
}
@ResponseBody
@RequestMapping(value = "/loadSurvey", method = RequestMethod.GET)
public Map<String, Object> loadSurvey(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> result = new HashMap<String, Object>();
try {
Map<String, String> map = this.builderParams(request, true);
TopicSurvey survey = this.topicSurveyService.findTopicSurveyById(map, this.getSessionUser(session));
result.put("survey", survey);
result.put("result", ResultCode.SUCCESS.getCode());
} catch (Exception e) {
log.error(e.getMessage(), e);
result.put("result", ResultCode.SUCCESS.getCode());
result.put("msg", "加载调查失败");
return result;
}
return result;
}
@ResponseBody
@RequestMapping(value = "/saveSurvey.action", method = RequestMethod.POST)
public Map<String, Object> saveSurvey(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> result = new HashMap<String, Object>();
try {
String[] ids = request.getParameterValues("surveyId");
Map<String, String> map = this.builderParams(request, true);
topicSurveyService.SurveyDo(map, ids, this.getSessionUser(session));
TopicSurvey survey = this.topicSurveyService.findTopicSurveyById(map, this.getSessionUser(session));
result.put("survey", survey);
result.put("result", ResultCode.SUCCESS.getCode());
} catch (BusinessException e) {
log.error(e.getMessage(), e);
result.put("result", ResultCode.ERROR.getCode());
result.put("msg", e.getMessage());
return result;
} catch (Exception e) {
log.error(e.getMessage(), e);
result.put("result", ResultCode.ERROR.getCode());
result.put("msg", "系统异常");
return result;
}
return result;
}
/**
* 附件上传
*
* @param session
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/fileupload", method = RequestMethod.POST)
public ModelAndView fileupload(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
ModelAndView mv = new ModelAndView();
try {
Object user = session.getAttribute("user");
if (null == user) {
mv.addObject("result", "fail");
mv.addObject("message", "你登陆已超时,请重新登陆");
mv.setViewName("group/fileupload");
return mv;
}
String realPath = session.getServletContext().getRealPath("/");
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile multipartFile = multipartRequest.getFile("file");
long size = multipartFile.getSize();
if (size > FileSizeEnums.SIZE1024_1024.getSize()) {
mv.addObject("result", "fail");
mv.addObject("message", "文件超过1M");
mv.setViewName("group/fileupload");
return mv;
}
String fileName = multipartFile.getOriginalFilename();
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
if (!"rar".equalsIgnoreCase(suffix) && !"zip".equalsIgnoreCase(suffix)) {
mv.addObject("result", "fail");
mv.addObject("message", "文件类型只能是.rar 压缩文件");
mv.setViewName("group/fileupload");
return mv;
}
SimpleDateFormat formater = new SimpleDateFormat("yyyyMM");
String saveDir = formater.format(new Date());
String realName = String.valueOf(System.currentTimeMillis()) + "." + suffix;
String savePath = saveDir + "/" + realName;
String fileDir = realPath + "upload" + "/" + saveDir;
File dir = new File(fileDir);
if (!dir.exists()) {
dir.mkdirs();
}
String filePath = fileDir + "/" + realName;
File file = new File(filePath);
multipartFile.transferTo(file);
mv.addObject("result", "success");
mv.addObject("savePath", savePath);
mv.setViewName("group/fileupload");
return mv;
} catch (Exception e) {
String errorMethod = "GroupAction-->fileupload()<br>";
ErrorReport report = new ErrorReport(errorMethod + e.getMessage());
Thread thread = new Thread(report);
thread.start();
mv.addObject("result", "fail");
mv.setViewName("group/fileupload");
return mv;
}
}
/**
* 删除附件
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/deleteFile.action", method = RequestMethod.POST)
public Map<String, Object> deleteFile(HttpSession session, HttpServletRequest request) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
String fileName = request.getParameter("fileName");
String userId = request.getParameter("userId");
if (!StringUtils.isNumber(userId)) {
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "参数异常");
return modelMap;
}
if (this.getSessionUserId(session).intValue() != Integer.parseInt(userId)) {
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "参数异常");
return modelMap;
}
if (StringUtils.isEmpty(fileName)) {
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "参数异常");
return modelMap;
}
String realPath = session.getServletContext().getRealPath("/") + "upload/";
File file = new File(realPath + fileName);
if (file.exists()) {
file.delete();
}
modelMap.put("result", ResultCode.SUCCESS.getCode());
return modelMap;
} catch (Exception e) {
String errorMethod = "GroupAction-->deleteFile()<br>";
ErrorReport report = new ErrorReport(errorMethod + e.getMessage());
Thread thread = new Thread(report);
thread.start();
modelMap.put("result", "fail");
return modelMap;
}
}
/**
* 检测下载
*
* @param session
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/checkDownLoad.action", method = RequestMethod.GET)
public Map<String, Object> downloadFile(HttpSession session, HttpServletRequest request,
HttpServletResponse response) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
Map<String, String> map = this.builderParams(request, true);
attachedDownloadService.checkDownLoad(map, this.getSessionUser(session));
modelMap.put("result", ResultCode.SUCCESS.getCode());
return modelMap;
} catch (BusinessException e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", e.getMessage());
return modelMap;
} catch (Exception e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "系统异常");
return modelMap;
}
}
/**
* 下载附件
*
* @param session
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/downloadFile.action", method = RequestMethod.GET)
public ModelAndView downloadFileDo(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
ModelAndView mv = new ModelAndView();
try {
this.attachedDownloadService.downloadFile(this.builderParams(request, true), this.getSessionUser(session),
response, session, request);
} catch (Exception e) {
log.error(e.getMessage(), e);
mv.setViewName("redirect:" + Constant.ERRORPAGE);
return mv;
}
return null;
}
/**
* 查询附件下载人
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/fetchAttachedUsers.do", method = RequestMethod.GET)
public Map<String, Object> fetchAttachedUsers(HttpSession session, HttpServletRequest request) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
Map<String, String> map = this.builderParams(request, true);
List<AttachmentDownload> list = attachedDownloadService.queryAttachedUserByAttachedId(map);
modelMap.put("result", ResultCode.SUCCESS.getCode());
modelMap.put("list", list);
return modelMap;
} catch (BusinessException e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", e.getMessage());
return modelMap;
} catch (Exception e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "系统异常");
return modelMap;
}
}
/**
* 新增文章
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/addTopic.action", method = RequestMethod.POST)
public Map<String, Object> addTopic(HttpSession session, HttpServletRequest request) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
Map<String, String> param = this.builderParams(request, false);
String[] surveyTitles = request.getParameterValues("surveyTitle");
String realPath = session.getServletContext().getRealPath("/");
Topic topic = this.topicService.addTopic(param, this.getSessionUser(session), surveyTitles, request);
modelMap.put("result", ResultCode.SUCCESS.getCode());
modelMap.put("topic", topic);
return modelMap;
} catch (BusinessException e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", e.getMessage());
return modelMap;
} catch (Exception e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "系统异常");
return modelMap;
}
}
/**
* 加载评论
*
* @param session
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/loadComment", method = RequestMethod.GET)
@ResponseBody
public UlewoPaginationResult<TopicComment> loadComment(HttpSession session, HttpServletRequest request,
HttpServletResponse response) {
try {
Map<String, String> map = this.builderParams(request, true);
UlewoPaginationResult<TopicComment> result = this.topicCmmentService.queryCommentByTopicId(map);
return result;
} catch (Exception e) {
log.error(e.getMessage());
return new UlewoPaginationResult<TopicComment>(new ArrayList<TopicComment>(), ResultCode.ERROR,
new StringBuilder(e.getMessage()));
}
}
/**
* 新增评论
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/addComment.action", method = RequestMethod.POST)
public Map<String, Object> addComment(HttpSession session, HttpServletRequest request) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
Map<String, String> map = this.builderParams(request, false);
map.put("sourceFrom",SourceFromEnums.PC.getValue());
TopicComment comment = topicCmmentService.addComment(map, this.getSessionUser(session));
modelMap.put("comment", comment);
modelMap.put("result", ResultCode.SUCCESS.getCode());
return modelMap;
} catch (BusinessException e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", e.getMessage());
return modelMap;
} catch (Exception e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "系统异常");
return modelMap;
}
}
/**
* 新增二级回复
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/addSubComment.action", method = RequestMethod.POST)
public Map<String, Object> addSubReComment(HttpSession session, HttpServletRequest request) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
Map<String, String> map = this.builderParams(request, false);
map.put("commentType", TopicCommentTypeEnums.SUBCOMMENT.getValue());
map.put("sourceFrom",SourceFromEnums.PC.getValue());
TopicComment comment = topicCmmentService.addComment(map, this.getSessionUser(session));
modelMap.put("comment", comment);
modelMap.put("result", ResultCode.SUCCESS.getCode());
return modelMap;
} catch (BusinessException e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", e.getMessage());
return modelMap;
} catch (Exception e) {
log.error(e.getMessage(), e);
modelMap.put("result", ResultCode.ERROR.getCode());
modelMap.put("msg", "系统异常");
return modelMap;
}
}
}
| [
"308106363@qq.com"
] | 308106363@qq.com |
02ab13d522899a5d8510cbedf0cb7292c73d8604 | 4ce998c916b82bc00079ce8554dea7ddfc3ea997 | /code-camp-java-base/src/main/java/com/wuwenxu/codecamp/base/question/QuestionTest2.java | b5e693ef67e83819ed7dffb500d5efd7bc861857 | [
"Apache-2.0"
] | permissive | Wuwenxu/code-camp-java | 429b3e299363218c28383b99db14745e0902f050 | ffec9bcde9d42b866055eef838fa173a7b56c4dc | refs/heads/master | 2022-12-12T06:55:56.692370 | 2020-08-23T12:07:55 | 2020-08-23T12:07:55 | 232,478,694 | 2 | 0 | Apache-2.0 | 2022-12-06T00:35:13 | 2020-01-08T04:36:47 | Java | UTF-8 | Java | false | false | 1,291 | java | package com.wuwenxu.codecamp.base.question;
/**
* @Title: QuestionTest1
* @Description:
* @Version:1.0.0
* @author pancm
* @date 2017年7月21日
*/
public class QuestionTest2 {
/**
* @param args
*/
public static void main(String[] args) {
/*
* 请实现一个函数,将一个字符串中的空格替换成“%20”。
* 例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
*/
StringBuffer str=new StringBuffer("We Are Happy");
System.out.println(replaceString(str));
System.out.println(replaceString2(str));
}
/**
* 方法一:利用String的replace 直接替换
* @param str
* @return String
*/
public static String replaceString(StringBuffer str){
if(str==null){
return null;
}
return str.toString().replaceAll(" ", "%20");
}
/**
* 方法二:利用数组循环取出
* @param str
* @return
*/
public static String replaceString2(StringBuffer str){
if(str==null){
return null;
}
char []c =str.toString().toCharArray();
StringBuffer sb=new StringBuffer();
for(int i=0;i<c.length;i++){
if(c[i]==' '){
sb.append("%20");
}else{
sb.append(c[i]);
}
}
return sb.toString();
}
}
| [
"13731169513@163.com"
] | 13731169513@163.com |
96b1eeb9a36a4228a76a4be6beb558100dff47df | e4fc38f6f6d2697792062b1dab53abd43d9fcbef | /Exception/ClassNotFoundExp.java | 80a353b7f016a33060e0a1b5947d06162bbd4d6f | [] | no_license | sandalcg91/jeetendra | ff1b2014c1672e5917602189a70ad6104b95a604 | 9793e8312f509d169adc6d336fb3824d67f1b7cf | refs/heads/master | 2022-04-25T01:32:00.897977 | 2020-04-26T09:59:26 | 2020-04-26T09:59:26 | 258,992,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java | class ClassNotFoundExp
{
public static void main(String[] args)
{
try
{
Class.forName("cg.class");
}
catch(ClassNotFoundException cnfe)
{
System.out.println("getting Exception " +cnfe);
}
}
} | [
"gchandan1191@gmail.com"
] | gchandan1191@gmail.com |
5ca0677d7316e9054a8fb57a467bc900a8fdcf32 | 54a6596f6d45639925d83a226404e5bdd7f79039 | /week-03/day-2/src/SquareGrid.java | 057e649ecee4ab2d6c52990a8b9a5570d4e2a89e | [] | no_license | green-fox-academy/purveeuka | dadc74632fc16c6f61658340e1e29176e0e3fb69 | 156f9b011fdf0864911582accc06a8a6bd476215 | refs/heads/master | 2023-04-05T02:33:17.132640 | 2021-05-07T13:49:28 | 2021-05-07T13:49:28 | 342,862,288 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,835 | java | import javax.swing.*;
import java.awt.*;
import static javax.swing.WindowConstants.EXIT_ON_CLOSE;
public class SquareGrid {
public static void drawImage(Graphics graphics) {
fractals(graphics, 200, 200, 100, 20);
}
public static int randomColor() {
int randomColor = (int) (Math.random() * 256);
return randomColor;
}
public static void drawBox(Graphics graphics, int x, int y, int l, float w) {
Graphics2D graphics2 = (Graphics2D) graphics;
graphics2.setStroke(new BasicStroke(w));
graphics.drawRect(x - l, y - l, 2 * l, 2 * l);
}
public static void fractals(Graphics graphics, int x, int y, int l, float w) {
if (l < 4) {
return;
} else {
graphics.setColor(new Color(randomColor(), randomColor(), randomColor()));
drawBox(graphics, x, y, l, w);
fractals(graphics, x - l, y - l, l / 2, w / 2);
fractals(graphics, x + l, y + l, l / 2, w / 2);
fractals(graphics, x + l, y - l, l / 2, w / 2);
fractals(graphics, x - l, y + l, l / 2, w / 2);
}
}
// Don't touch the code below
static int WIDTH = 400;
static int HEIGHT = 400;
public static void main(String[] args) {
JFrame jFrame = new JFrame("Drawing");
jFrame.setDefaultCloseOperation(EXIT_ON_CLOSE);
ImagePanel panel = new ImagePanel();
panel.setPreferredSize(new Dimension(WIDTH, HEIGHT));
jFrame.add(panel);
jFrame.setLocationRelativeTo(null);
jFrame.setVisible(true);
jFrame.pack();
}
static class ImagePanel extends JPanel {
@Override
protected void paintComponent(Graphics graphics) {
super.paintComponent(graphics);
drawImage(graphics);
}
}
}
| [
"purveeuka@gmail.com"
] | purveeuka@gmail.com |
50583156a295556e591a54764fcedb4551d2e2cc | 9877b5b24ca333db93a57bfcf35034a86b7e2a95 | /app/src/androidTest/java/com/mutualmonitor/testing/ExampleInstrumentedTest.java | 4619e6dfc1d4adad2aad14e0a1cd98a8844c4ba7 | [] | no_license | anusandhann/testing | d8de8ef5e78c8d37839110d1c8f186961f349fb8 | 1caab44763ddd88520b314aa3d18ec9d2078f57c | refs/heads/master | 2022-02-10T19:18:22.110762 | 2022-01-27T04:24:24 | 2022-01-27T04:24:24 | 223,832,901 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.mutualmonitor.testing;
import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.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.example.testing", appContext.getPackageName());
}
}
| [
"anusan_dawadi@yahoo.com"
] | anusan_dawadi@yahoo.com |
b1d419432d5d866e91a5c585b133aac0d85852a9 | a1b64d2275a3f3ef4fc4b58d23b2c9fb2b05de01 | /sim/TaskParser.java | 0d36f647cc7ee9a80719597bfc77dfa199ac3008 | [] | no_license | amoghavs/PSaPP | b9a2f9eaf782069d25fcd4e3ce44fccde257e6b9 | d98b1dcff9e3d369ba0c154585d4238f3cc7c9c0 | refs/heads/master | 2016-08-12T05:35:10.649753 | 2015-10-22T23:09:11 | 2015-10-22T23:09:11 | 44,771,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,540 | java | package PSaPP.sim;
/*
Copyright (c) 2010, The Regents of the University of California
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 name of the Regents of the University of California nor the names of its contributors may be
used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
*/
import java.util.*;
import java.io.*;
import PSaPP.util.*;
import PSaPP.pred.*;
/**
* This class parses a .task file and uses the data contained
* within to populate a TaskData object.
* @author bsheely
*/
public class TaskParser {
public TaskParser() {}
/**
* Parse the specified file and populate the data object
* @param file The .task file to be parsed
* @param data The object to be populated with the parse results
* @return boolean True if successful
*/
public boolean parse(String file, TaskData data) throws Exception {
try {
FileInputStream fstream = new FileInputStream(file);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = br.readLine()) != null) {
String tokens[] = line.split("\t");
if (Util.isNumeric(tokens[0].trim())) {
data.compTimes.add(new Double(Double.valueOf(tokens[1].trim()).doubleValue()));
} else if (tokens[0].contentEquals("avg")) {
data.avg = Double.valueOf(tokens[1].trim()).doubleValue();
} else if (tokens[0].contentEquals("min")) {
data.min = Double.valueOf(tokens[1].trim()).doubleValue();
} else if (tokens[0].contentEquals("max")) {
data.max = Double.valueOf(tokens[1].trim()).doubleValue();
}
}
in.close();
} catch (Exception e) {
throw e;
}
Iterator iter = data.compTimes.iterator();
double summation = 0;
while (iter.hasNext()) {
double time = ((Double) iter.next()).doubleValue();
summation += Math.pow(time - data.avg, 2);
}
data.standardDeviation = Math.sqrt(summation / data.compTimes.size());
return true;
}
}
| [
"amoghavs@gmail.com"
] | amoghavs@gmail.com |
7a1a5ad0bf9aa7c97a3fa63ea62761d731e1ec10 | 63b97d694aae7a47118d014999c96b48b3a7e6d8 | /uvereignisservice/src/main/java/de/th/koeln/ungewoehnlichesverhalten/uvereignisservice/eventing/Notlage/NotlageEventConsumer.java | 064d65f86c4899de23e7769a1d389dbf5072a872 | [] | no_license | Archi-Lab/fae-team-4 | 7b4127d29337abadc6d0fe615b6ddaf331f7716f | ee347c6e4b2e1155bc5068873b672ef51b893a6f | refs/heads/master | 2020-04-02T12:56:07.674015 | 2019-02-28T20:09:30 | 2019-02-28T20:09:30 | 154,459,039 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,648 | java | package de.th.koeln.ungewoehnlichesverhalten.uvereignisservice.eventing.Notlage;
import de.th.koeln.ungewoehnlichesverhalten.uvereignisservice.eventing.Notlage.models.NotlageEventMessage;
import de.th.koeln.ungewoehnlichesverhalten.uvereignisservice.eventing.Notlage.service.NotlageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;
@Service
public class NotlageEventConsumer {
private static final Logger LOGGER = LoggerFactory.getLogger(NotlageEventConsumer.class);
private final NotlageService notlageService;
public NotlageEventConsumer(NotlageService notlageService){
this.notlageService = notlageService;
}
@KafkaListener(topics = "${topics.notlage}", containerFactory = "dvpConsumerContainerFactory")
public void receive(@Payload NotlageEventMessage notlageEventMessage) {
switch (notlageEventMessage.payload.status) {
case "ERSTELLT":
notlageService.handleNotlageCreatedEvent(notlageEventMessage.payload);
break;
case "IN_BEAREITUNG":
notlageService.handleNotlageInBearbeitungEvent(notlageEventMessage.payload);
break;
case "BEHOBEN":
notlageService.handleNotlageGeloestEvent(notlageEventMessage.payload);
break;
default:
LOGGER.info("Status " + notlageEventMessage.payload.status + " nicht erkannt");
break;
}
}
}
| [
"dk@nevoxo.com"
] | dk@nevoxo.com |
04f457a2aab76704d30f7a244b99d4f5e45ca5f2 | 90470c848790d4f731f0cc808bc8bddf972095ee | /languages/xjsnark/source_gen/xjsnark/behavior/PreTestBlock_BehaviorDescriptor.java | 188bec8f8572d4dda1b26e6f5bddfa518cf80406 | [
"MIT"
] | permissive | mstraka100/xjsnark | 23ea5931e72778773abde776e247c74e577e2134 | bd30e062bea5f6d5801ad50088060933ddaebb48 | refs/heads/master | 2020-03-30T18:42:21.626765 | 2018-10-04T15:39:50 | 2018-10-04T15:39:50 | 151,511,588 | 1 | 0 | MIT | 2018-10-04T03:03:31 | 2018-10-04T03:03:30 | null | UTF-8 | Java | false | false | 518 | java | package xjsnark.behavior;
/*Generated by MPS */
import jetbrains.mps.baseLanguage.behavior.Statement_BehaviorDescriptor;
/**
* Will be removed after 3.3
* Need to support compilation of the legacy behavior descriptors before the language is rebuilt
* This class is not involved in the actual method invocation
*/
@Deprecated
public class PreTestBlock_BehaviorDescriptor extends Statement_BehaviorDescriptor {
@Override
public String getConceptFqName() {
return "xjsnark.structure.PreTestBlock";
}
}
| [
"akosba@cs.umd.edu"
] | akosba@cs.umd.edu |
d508e85856122389d2a730b60c55aeba50aa2283 | c0d80d60a0649a15fc3b6b6e597b3f64f6f68091 | /seata-order-service2003/src/main/java/zwf/cloudalibaba/domain/Account.java | 445e288e725b9ba0efd8d975c42607cab5efe5ed | [] | no_license | zwf-leaves/SpringCloud | 12fe29d213e69ea7dd0a6554533672f8bd76dbda | 4a421ddb1a394f28b0eb2488a73bbabbb81c6edd | refs/heads/master | 2023-03-06T16:06:50.742492 | 2021-02-06T12:03:20 | 2021-02-06T12:03:20 | 336,527,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package zwf.cloudalibaba.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @author Dark
* @date 2020-08-02 15:35
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Account {
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 总额度
*/
private BigDecimal total;
/**
* 已用额度
*/
private BigDecimal used;
/**
* 剩余额度
*/
private BigDecimal residue;
}
| [
"zwf@zwf.com"
] | zwf@zwf.com |
79344d17719f4ebb9d1d98219982f400757aa734 | a6120463106ff704f1596752a355404c6e87f3d2 | /School/src/Dijkstra_Shortest_Path_and_Datastructuren/Rit.java | 10bf359de961603251bc54d54637475d48452ba6 | [] | no_license | wail0152/Adaptive-Programming | e490e5f21b19c9d1f11f2350d491378dfbedda85 | 516f67612460b6cb95077ef26b18881a82572c8c | refs/heads/master | 2022-09-11T06:42:34.581970 | 2020-05-29T14:40:56 | 2020-05-29T14:40:56 | 255,618,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 273 | java | package Dijkstra_Shortest_Path_and_Datastructuren;
public class Rit extends Stap {
public Double fuel;
public Rit(String name)
{
super(name);
}
public Double getFuel()
{
fuel = getDistance() * 10.1;
return fuel;
}
}
| [
"60653485+wail0152@users.noreply.github.com"
] | 60653485+wail0152@users.noreply.github.com |
1d6d0669d243b28ef1fb043fa5167ef7be662d05 | f966b26f6d11fbc4e0b2188471440809b27d2da4 | /springcloud-stream/eureka-stream/src/test/java/com/wpp/eurekaalone/RibbonEurekaApplicationTests.java | a316e81c312734f6deaf9e20f2bb23affdd57abb | [] | no_license | jackgeeks/springcloud-samples | 557f8fab05c59fa16be68f4b063fac734db9a019 | 7a7305ed3054618fcacc3df2cb72dd2445548b68 | refs/heads/master | 2022-11-22T13:30:44.855891 | 2020-07-25T19:38:29 | 2020-07-25T19:38:29 | 263,635,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.wpp.eurekaalone;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RibbonEurekaApplicationTests {
@Test
void contextLoads() {
}
}
| [
"1315423739@qq.com"
] | 1315423739@qq.com |
789437af89fe9ce05e14d3d9cfe0bcac041b460f | 241031721e317ceab2f9521a236762ecb943e07e | /app/src/main/java/android/csulb/edu/crisisconnect/WifiHotspotApis/ClientScanResult.java | 0431883b3ba2e18469616acc2eeff16688b976f0 | [] | no_license | KiranNayak29/CrisisConnect | 72e0b136cfbbc9474c4f039077c4643793d4c4ca | 9bab0182f7293cdd49f6432fe8b6a7e6656c0e50 | refs/heads/master | 2021-01-18T21:57:00.886674 | 2017-05-17T02:26:02 | 2017-05-17T02:26:02 | 87,031,282 | 0 | 1 | null | 2017-04-03T08:40:59 | 2017-04-03T02:20:46 | Java | UTF-8 | Java | false | false | 1,552 | java | /*
* Copyright 2013 WhiteByte (Nick Russler, Ahmet Yueksektepe).
*
* 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 android.csulb.edu.crisisconnect.WifiHotspotApis;
public class ClientScanResult implements java.io.Serializable {
private String IpAddr;
private String HWAddr;
private String Device;
private boolean isReachable;
public ClientScanResult(String ipAddr, String hWAddr, String device, boolean isReachable) {
super();
this.IpAddr = ipAddr;
this.HWAddr = hWAddr;
this.Device = device;
this.isReachable = isReachable;
}
public String getIpAddr() {
return IpAddr;
}
public void setIpAddr(String ipAddr) {
IpAddr = ipAddr;
}
public String getHWAddr() {
return HWAddr;
}
public void setHWAddr(String hWAddr) {
HWAddr = hWAddr;
}
public String getDevice() {
return Device;
}
public void setDevice(String device) {
Device = device;
}
public boolean isReachable() {
return isReachable;
}
public void setReachable(boolean isReachable) {
this.isReachable = isReachable;
}
} | [
"kgn.kn4u@gmail.com"
] | kgn.kn4u@gmail.com |
771f487fc9998e588990346929fc24074fbdc45c | 1647bc072d206453f20410e21908f0958c7ac8f2 | /app/src/main/java/ro/example/myapplication/lab1/MainActivity.java | cd65a9687a3ece11a5be12d18755cdcab0785081 | [] | no_license | DobrescuAnca/LaboratorAndroid2021 | cb260ca0cb70422523e243d8bac8a55ab02745f6 | 8c44b354204afac9b4ac9c972f38670362c9096d | refs/heads/main | 2023-03-25T08:01:28.337798 | 2021-03-23T19:16:01 | 2021-03-23T19:16:01 | 343,522,506 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,766 | java | package ro.example.myapplication.lab1;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatEditText;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import ro.example.myapplication.R;
public class MainActivity extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "MESSAGE";
private TextView textView;
private Button button;
private AppCompatEditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
button = findViewById(R.id.button);
editText = findViewById(R.id.editText);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String text = "";
if(editText.getText() != null)
text = editText.getText().toString();
if(text.isEmpty())
showErrorPopup();
else
gotoSecondApp(text);
}
});
}
private void gotoSecondApp(String extra){
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra(EXTRA_MESSAGE, extra);
startActivity(intent);
}
private void gotoSecondApp2(String extra){
Intent intent = new Intent(this, SecondActivity.class);
Bundle mBundle = new Bundle();
mBundle.putString(EXTRA_MESSAGE, extra);
intent.putExtras(mBundle);
}
private void showErrorToast(){
Toast.makeText(this, getString(R.string.error_msg), Toast.LENGTH_LONG).show();
}
private void showErrorPopup(){
new AlertDialog.Builder(this)
.setTitle("Error")
.setMessage(R.string.error_msg)
// Specifying a listener allows you to take an action before dismissing the dialog.
// The dialog is automatically dismissed when a dialog button is clicked.
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
// A null listener allows the button to dismiss the dialog and take no further action.
// .setNegativeButton(android.R.string.no, null)
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
} | [
"anca.dobrescu@esolutions.ro"
] | anca.dobrescu@esolutions.ro |
36b64f6cb9bc18ed0f18f7e2891ee4b4c2928cd6 | bcaad8c5a1c32842188527467009437a00d70db7 | /bilo-access-android/src/main/java/ch/bitzgi/android/bluetooth/spp/Input.java | 05db28aba74954feffd4446126f83190bb1b12a3 | [
"Apache-2.0"
] | permissive | bilo/bilo-access | 49010f59442d930d4c144e26c4e1fbdbb1a5b5f1 | 362b77d8f404a34b1eb6159b7a8ba6a30800932c | refs/heads/master | 2021-01-01T17:34:33.412899 | 2019-01-06T16:57:08 | 2019-01-06T16:57:08 | 98,102,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | /*
* Copyright 2018 Urs Fässler
* SPDX-License-Identifier: Apache-2.0
*/
package ch.bitzgi.android.bluetooth.spp;
import android.bluetooth.BluetoothDevice;
import java.util.List;
public interface Input {
public void connect(BluetoothDevice device);
public void disconnect();
public void send(List<Byte> data);
public void poll();
}
| [
"urs@bitzgi.ch"
] | urs@bitzgi.ch |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.