blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
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
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ca3cc6a48362b3706352e8ed8064cae610b363b8 | 2cce464bf31dded1c640f7b62162b7564f724615 | /logsight-core/src/main/java/cn/fishmaple/logsight/config/ConfigLoader.java | cb680c22d195f700c6508ddf15b244ff35be8a7e | [
"MIT"
]
| permissive | fishstormX/logsight | ce61080ece0b4d3ea7799194f189a8c84466e489 | 125656e1f32060511c27025fa57958eb4d966b79 | refs/heads/master | 2022-12-26T16:36:54.582458 | 2021-09-14T16:37:23 | 2021-09-14T16:37:23 | 253,977,742 | 28 | 7 | MIT | 2022-12-14T20:45:16 | 2020-04-08T03:39:56 | Java | UTF-8 | Java | false | false | 220 | java | package cn.fishmaple.logsight.config;
public interface ConfigLoader {
String getConfig(String key);
String getConfig(String key,String defaultValue);
Integer getIntConfig(String key,Integer defaultValue);
}
| [
"[email protected]"
]
| |
873239c6848a024282e327b6420d266cd534b8a4 | 8b5a50fe98439cc123d1bc6b1e18856cfb82a6c9 | /app/src/main/java/yongchao/com/wineapp/ui/set/mvp/body/AddressListBody.java | 650b4efa82d74d1a47f329debcabc895e5ecbfd8 | []
| no_license | ljx123456/wineapp | 948b37c2e2cce91da4ae5b56274babfd5a9bc0ef | 4e830d0ff390cd50508eb1c18d09f97240e1a83f | refs/heads/main | 2022-12-29T00:35:29.779806 | 2020-10-23T08:29:39 | 2020-10-23T08:29:39 | 306,573,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package yongchao.com.wineapp.ui.set.mvp.body;
public class AddressListBody {
/**
* pageIndex : 1
* pageSize : 10
*/
private int pageIndex;
private int pageSize;
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public AddressListBody(int pageIndex, int pageSize) {
this.pageIndex = pageIndex;
this.pageSize = pageSize;
}
}
| [
"[email protected]"
]
| |
b5876179f744859656a926b660477f06817e76b1 | 66d61f901cd9bbc563ac173c1ea544efa349278b | /dashboard/src/main/generated/org/jobscheduler/dashboard/jobdefinition/xml/Script.java | 495b9096935a34cc604f7cc7e3a9fe31d59b3f0e | [
"Apache-2.0"
]
| permissive | adamadieng-it/SoS-JobScheduler | a7e9ab4855e20ce3aa54b2cdc5fa3f35c6b13bd1 | 5555fcf793b774a0fa1c97c9ac508847c66bb589 | refs/heads/master | 2021-05-27T03:56:08.244263 | 2014-08-22T15:46:18 | 2014-08-22T15:46:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,666 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.08.21 at 05:03:57 AM PDT
//
package org.jobscheduler.dashboard.jobdefinition.xml;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice maxOccurs="unbounded" minOccurs="0">
* <element ref="{}include"/>
* </choice>
* <attribute name="language" type="{}Name" />
* <attribute name="use_engine">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="task"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="com_class" type="{}String" />
* <attribute name="filename" type="{}File" />
* <attribute name="java_class" type="{}String" />
* <attribute name="recompile" type="{}Yes_no" />
* <attribute name="encoding" type="{}Code_page_encoding" />
* <attribute name="java_class_path" type="{}String" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"content"
})
@XmlRootElement(name = "script")
public class Script {
@XmlElementRef(name = "include", type = Include.class, required = false)
@XmlMixed
protected List<Object> content;
@XmlAttribute(name = "language")
protected String language;
@XmlAttribute(name = "use_engine")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String useEngine;
@XmlAttribute(name = "com_class")
protected String comClass;
@XmlAttribute(name = "filename")
protected String filename;
@XmlAttribute(name = "java_class")
protected String javaClass;
@XmlAttribute(name = "recompile")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String recompile;
@XmlAttribute(name = "encoding")
protected CodePageEncoding encoding;
@XmlAttribute(name = "java_class_path")
protected String javaClassPath;
/**
* Gets the value of the content property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
* {@link Include }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
/**
* Gets the value of the language property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLanguage() {
return language;
}
/**
* Sets the value of the language property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLanguage(String value) {
this.language = value;
}
/**
* Gets the value of the useEngine property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUseEngine() {
return useEngine;
}
/**
* Sets the value of the useEngine property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUseEngine(String value) {
this.useEngine = value;
}
/**
* Gets the value of the comClass property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getComClass() {
return comClass;
}
/**
* Sets the value of the comClass property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setComClass(String value) {
this.comClass = value;
}
/**
* Gets the value of the filename property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getFilename() {
return filename;
}
/**
* Sets the value of the filename property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFilename(String value) {
this.filename = value;
}
/**
* Gets the value of the javaClass property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getJavaClass() {
return javaClass;
}
/**
* Sets the value of the javaClass property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setJavaClass(String value) {
this.javaClass = value;
}
/**
* Gets the value of the recompile property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRecompile() {
return recompile;
}
/**
* Sets the value of the recompile property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRecompile(String value) {
this.recompile = value;
}
/**
* Gets the value of the encoding property.
*
* @return
* possible object is
* {@link CodePageEncoding }
*
*/
public CodePageEncoding getEncoding() {
return encoding;
}
/**
* Sets the value of the encoding property.
*
* @param value
* allowed object is
* {@link CodePageEncoding }
*
*/
public void setEncoding(CodePageEncoding value) {
this.encoding = value;
}
/**
* Gets the value of the javaClassPath property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getJavaClassPath() {
return javaClassPath;
}
/**
* Sets the value of the javaClassPath property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setJavaClassPath(String value) {
this.javaClassPath = value;
}
}
| [
"[email protected]"
]
| |
e9cb51fa1a19ea54a3aa24e325b6112b2517134f | cded3617f5c54d81dc9ac8677921854cbfd5058d | /ArrayList/ArrayList1/src/com/surbitonix97/Demo.java | ec8099faffd536e1b6fbce3b7bec1f7a9fc24a61 | []
| no_license | Surbitonix/javaXperiments | ef660b3903da26f4f24f36913f821406a0dc2a1e | 7b7b485e1ed9e8fc4a9828b74ab9eb815e22a46c | refs/heads/master | 2022-04-25T18:23:40.197562 | 2020-05-01T14:06:21 | 2020-05-01T14:06:21 | 256,845,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,762 | java | package com.surbitonix97;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
LinkedList<String> placesILived = new LinkedList<String>();
addInOrder(placesILived,"Guimaraes");
addInOrder(placesILived,"Famalicao");
addInOrder(placesILived,"Salamanca");
addInOrder(placesILived,"Roma");
addInOrder(placesILived,"Paris");
addInOrder(placesILived,"Lyon");
addInOrder(placesILived,"Bordeaux");
addInOrder(placesILived,"Tours");
addInOrder(placesILived,"Roma");
addInOrder(placesILived,"Famalicao");
addInOrder(placesILived,"Porto");
addInOrder(placesILived,"Montreaux");
addInOrder(placesILived,"Crans-Montana");
addInOrder(placesILived,"Port Chester");
addInOrder(placesILived,"Greenwich");
addInOrder(placesILived,"Stamford");
addInOrder(placesILived,"London");
addInOrder(placesILived,"Surbiton");
addInOrder(placesILived,"Kingston");
addInOrder(placesILived,"London");
addInOrder(placesILived,"Zurich");
//printList(placesILived);
visit(placesILived);
}
private static void printList(LinkedList<String> linkedList)
{
//another way of iterating
Iterator<String> i = linkedList.iterator();
while (i.hasNext())
{
System.out.println("now visiting "+i.next());
}
System.out.println("*****************");
}
private static boolean addInOrder(LinkedList<String> linkedlist, String newCity){
ListIterator<String> stringIterator = linkedlist.listIterator();
while (stringIterator.hasNext())
{
int comparison = stringIterator.next().compareTo(newCity);
if (comparison == 0)
{
//do not add
System.out.println("WARN - "+newCity+" already exists..discarding.");
return false;
}
else if (comparison > 0)
{
//new city should appear b4 this one
//do note tho that u need to go back to previous record...so u dont skip it
stringIterator.previous();
stringIterator.add(newCity);
System.out.println(newCity+" was added into the list");
return true;
}
else if (comparison < 0)
{
//move to the nxt city
}
}
stringIterator.add(newCity);
return true;
}
private static void visit(LinkedList cities )
{
Scanner userInput = new Scanner(System.in);
boolean quit = false;
boolean moveForward = true;
ListIterator<String> listIterator = cities.listIterator();
if (cities.isEmpty())
{
System.out.println("no cities on the itinerary");
}else
{
System.out.println("now visiting "+listIterator.next());
printMenu();
}
while(!quit)
{
int action = userInput.nextInt();
userInput.nextLine();
switch (action)
{
case 0:
System.out.println("vacation is over\nThx for visiting us....");
quit = true;
break;
case 1:
if (!moveForward)
{
if(listIterator.hasNext())
{
listIterator.next();
}
moveForward=true;
}
if (listIterator.hasNext())
{
System.out.println("now visiting..."+listIterator.next());
}else
{
System.out.println("reached the end of your mission");
moveForward = false;
}
break;
case 2:
if(moveForward){
if(listIterator.hasNext()){
listIterator.previous();
}
moveForward=false;
}
if (listIterator.hasPrevious())
{
System.out.println("Now visiting "+ listIterator.previous());
} else
{
System.out.println("We are at the start of the list");
moveForward = true;
}
break;
case 3:
printMenu();
break;
}
}
}
private static void printMenu()
{
System.out.println("Avaialable Actions\npress" +
"\n0 - to quit"+
"\n1 - Go to Next City"+
"\n2 - Go to Previous City"+
"\n3 - Help Menu");
}
}
| [
"[email protected]"
]
| |
2ea58f182e69c6c806044a85e797050e6ca99f2f | ce09a4afff72daccf9621a74723f0515d78a84c1 | /app/src/main/java/com/example/android/insanyah/ui/activities/SelectInterest.java | 5ca5b25e26d6fd064c50bb2e1f1fb25c459b67d6 | []
| no_license | mohamedmousa95/Insanyah | 022c1ecbcd8d9b44576c54cc766f3bbf1b7644f3 | 4d63b4dffe3fa82ff4046f09f46129f212e16965 | refs/heads/master | 2021-05-16T04:16:49.539640 | 2017-10-05T10:16:25 | 2017-10-05T10:16:25 | 105,878,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,342 | java | package com.example.android.insanyah.ui.activities;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.example.android.insanyah.R;
import java.util.ArrayList;
public class SelectInterest extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener{
int count = 0;
ArrayList<String> interests=new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_interest);
//
// Intent intent = new Intent(this, MainActivity.class);
// startActivity(intent);
}
// public void loadLocale() {
// String langPref = "Language";
// SharedPreferences prefs = getSharedPreferences("CommonPrefs",
// Activity.MODE_PRIVATE);
// String language = prefs.getString(langPref, "");
// changeLang(language);
// }
// public void setLocale(String lang) {
// Locale myLocale = new Locale(lang);
// Resources res = getResources();
// DisplayMetrics dm = res.getDisplayMetrics();
// Configuration conf = res.getConfiguration();
// conf.locale = myLocale;
// res.updateConfiguration(conf, dm);
//// finish();
// }
public void onClickElderly(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_elderly);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("18");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("18");
}
}
public void onClickOrphans(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_orphans);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("2");
// for(int i=0;i<interests.size();i++){
// Log.v(i+" m",interests.get(i)+" m");
// }
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("2");
// for(int i=0;i<interests.size();i++){
// Log.v(i+" m",interests.get(i)+" m");
// }
}
}
public void onClickPoverty(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_poverty);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("1");
// for(int i=0;i<interests.size();i++){
// Log.v(i+" m",interests.get(i)+" m");
// }
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("1");
// for(int i=0;i<interests.size();i++){
// Log.v(i+" m",interests.get(i)+" m");
// }
}
}
public void onClickSpecialNeeds(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_special_needs);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("19");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("19");
}
}
public void onClickNGOs(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_ngos);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("17");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("17");
}
}
public void onClickHunger(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_hunger);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("36");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("36");
}
}
public void onClickWater(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_water);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("34");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("34");
}
}
public void onClickWomenEmp(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_women_emp);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("13");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("13");
}
}
public void onClickYouth(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_youth);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("14");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("14");
}
}
public void onClickEducation(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_education);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("6");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("6");
}
}
public void onClickCulture(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_culture);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("22");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("22");
}
}
public void onClickHealth(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_health);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("21");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("21");
}
}
public void onClickCommSus(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_comm_sus);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("31");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("31");
}
}
public void onClickPertnerships(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_pertnerships);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("25");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("25");
}
}
public void onClickAgriculture(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_agriculture);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("7");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("7");
}
}
public void onClickAnimals(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_animals);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("16");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("16");
}
}
public void onClickUnderwaterLife(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_underwater_life);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("24");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("24");
}
}
public void onClickEnvironment(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_environment);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("5");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("5");
}
}
public void onClickClimateChange(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_climate_change);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("38");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("38");
}
}
public void onClickTourism(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_tourism);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("8");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("8");
}
}
public void onClickEconomics(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_economics);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("10");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("10");
}
}
public void onClickResearch(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_research);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("3");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("3");
}
}
public void onClickIndustry(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_industry);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("27");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("27");
}
}
public void onClickEnergy(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_energy);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("35");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("35");
}
}
public void onClickResponsibleCons(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_responsible_cons);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("39");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("39");
}
}
public void onClickRefuges(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_refuges);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("11");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("11");
}
}
public void onClickReduceIneq(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_reduce_ineq);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("29");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("29");
}
}
public void onClickPeaceAndJustice(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_peace_and_justice);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("28");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("28");
}
}
public void onClickGenderEquality(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_gender_equality);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("30");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("30");
}
}
public void onClickLifeOnEarth(View view) {
ImageView green = (ImageView) findViewById(R.id.shade_green_life_on_earth);
if (green.getVisibility() == View.VISIBLE) {
green.setVisibility(View.INVISIBLE);
count--;
interests.remove("32");
} else {
green.setVisibility(View.VISIBLE);
count++;
interests.add("32");
}
}
public void confirmOnClick(View view) {
if (count == 0) {
Toast.makeText(getBaseContext(), getString(R.string.toast_message), Toast.LENGTH_SHORT).show();
return;
}
// for(int i=0;i<interests.size();i++){
// Log.v("interests",interests.get(i));
// }
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("interests",interests);
startActivity(intent);
}
@Override
public void onBackPressed() {
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
// Handle navigation view item clicks here.
// int id = item.getItemId();
// if (id == R.id.nav_camera) {
// // Handle the camera action
// } else if (id == R.id.nav_gallery) {
//
// } else if (id == R.id.nav_slideshow) {
//
// } else if (id == R.id.nav_manage) {
//
// } else
// if(id == R.id.nav_news_feed){
//
// LinearLayout newsFeed= (LinearLayout) findViewById(R.id.layout_news_feed);
// newsFeed.setVisibility(View.VISIBLE);
//
// LinearLayout mydoempty= (LinearLayout) findViewById(R.id.layout_my_donations_empty);
// mydoempty.setVisibility(View.INVISIBLE);
//
// LinearLayout mydonotempty= (LinearLayout) findViewById(R.id.layout_my_donations_not_empty);
// mydonotempty.setVisibility(View.INVISIBLE);
//
// }else if(id == R.id.nav_my_donations){
//
// LinearLayout newsFeed= (LinearLayout) findViewById(R.id.layout_news_feed);
// newsFeed.setVisibility(View.INVISIBLE);
//
// LinearLayout mydoempty= (LinearLayout) findViewById(R.id.layout_my_donations_empty);
// mydoempty.setVisibility(View.VISIBLE);
//
// LinearLayout mydonotempty= (LinearLayout) findViewById(R.id.layout_my_donations_not_empty);
// mydonotempty.setVisibility(View.INVISIBLE);
//
// }else if (id == R.id.nav_about) {
// Intent intent = new Intent(this, About.class);
// startActivity(intent);
//
// }else if(id == R.id.nav_settings){
// Intent intent = new Intent(this, Settings.class);
// startActivity(intent);
// }else if(id==R.id.nav_share){
//
// }else if(id==R.id.nav_select_interests){
// Intent intent = new Intent(this, SelectInterest.class);
// startActivity(intent);
// }
//
// else if (id == R.id.nav_send) {
//
// }
// DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
// drawer.closeDrawer(GravityCompat.START);
return false;
}
}
| [
"[email protected]"
]
| |
5d4e8cf6453f7091782bba43b8bd7975fc139445 | a3676920ec70d1d659a2123a2164a7af5619bd08 | /modules/booking-portlet/src/main/java/com/liferay/samples/fbo/booking/portlet/InitBookingPortletAction.java | 7aa51c3b0ef594511ee9b6daa9b85011132ab6c9 | []
| no_license | fabian-bouche-liferay/booking-client | 352264075b62f7da8afb3cd893270d88ed0cb581 | 2e2d320254ed788e7dff8eaa6c5d21189c3541c9 | refs/heads/master | 2023-07-09T01:50:54.695681 | 2021-08-24T06:58:46 | 2021-08-24T06:58:46 | 274,511,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | package com.liferay.samples.fbo.booking.portlet;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCActionCommand;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.samples.fbo.booking.constants.BookingPortletKeys;
import com.liferay.samples.fbo.booking.service.api.BookingLocalService;
import com.liferay.samples.fbo.bookings.model.Booking;
import com.liferay.samples.fbo.bookings.model.BookingInformation;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
@Component(
immediate = true,
property = {
"javax.portlet.name=" + BookingPortletKeys.BOOKING,
"mvc.command.name=" + BookingPortletKeys.INIT_BOOKING_ACTION_COMMAND
},
service = MVCActionCommand.class
)
public class InitBookingPortletAction implements MVCActionCommand {
@Override
public boolean processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException {
_log.info("Insertion request...");
try {
String city = ParamUtil.get(actionRequest, "city", "");
BookingInformation bookingInformation = new BookingInformation();
bookingInformation.setCity(city);
bookingInformation.setArrivalDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(ParamUtil.get(actionRequest, "arrivalDate", "")));
bookingInformation.setDepartureDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(ParamUtil.get(actionRequest, "departureDate", "")));
Booking booking = bookingLocalService.initBookingRequest(bookingInformation);
_log.info("Inserted booking with ID: " + booking.getBookingId());
} catch (DatatypeConfigurationException e) {
_log.error("Date conversion error", e);
throw new PortletException();
}
return true;
}
private static Log _log = LogFactoryUtil.getLog(InitBookingPortletAction.class);
@Reference
private BookingLocalService bookingLocalService;
}
| [
"[email protected]"
]
| |
f7955bb2a2b296aafed32dc1e6cda573d4102c6a | 51d1c42b0321a3ebdbf9a923c9b702c921d0b559 | /src/edu/vt/ece5574/sim/StorageAPI.java | c38f2171a7b1a66fd54afbe200b1364f3d9a3e76 | []
| no_license | dkindel/ece5574simulation | 36664f326b7d9d3bb5925d9aca23ecc9e1ee5c43 | 7cb5341e1bc8f18fc223fb64581b777187cac5ee | refs/heads/master | 2021-01-13T00:16:23.771322 | 2016-03-28T14:29:56 | 2016-03-28T14:29:56 | 54,333,822 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,814 | java | package edu.vt.ece5574.sim;
/**
* @author Vinit Gala
*
*/
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.json.JSONException;
import org.json.JSONObject;
public class StorageAPI {
private String baseURL;
public StorageAPI()
{
baseURL = new String ( "http://localhost:8080/api/" );
}
public HttpResponse getRequest ( URI uri ) throws IOException
{
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = null;
try {
HttpGet request = new HttpGet(uri);
response = httpClient.execute(request);
} catch (Exception e) {
System.err.println(e);
} finally {
httpClient.close();
}
return response;
}
public HttpResponse deleteRequest ( URI uri ) throws IOException
{
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = null;
try {
HttpDelete request = new HttpDelete(uri);
response = httpClient.execute(request);
} catch (Exception e) {
System.err.println(e);
} finally {
httpClient.close();
}
return response;
}
public HttpResponse postRequest ( URI uri , JSONObject json ) throws IOException
{
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = null;
try {
HttpPost request = new HttpPost(uri);
StringEntity params = new StringEntity(json.toString());
request.addHeader("content-type", "application/json");
request.setEntity(params);
response = httpClient.execute(request);
} catch (Exception e) {
System.err.println(e);
} finally {
httpClient.close();
}
return response;
}
public HttpResponse putRequest ( URI uri , JSONObject json ) throws IOException
{
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = null;
try {
HttpPut request = new HttpPut(uri);
StringEntity params = new StringEntity(json.toString());
request.addHeader("content-type", "application/json");
request.setEntity(params);
response = httpClient.execute(request);
} catch (Exception e) {
System.err.println(e);
} finally {
httpClient.close();
}
return response;
}
public boolean updRobotPos ( String robotID , int xpos , int ypos )
{
try
{
JSONObject json = new JSONObject();
URI uri = new URI ( baseURL + "robots/" + robotID );
HttpResponse response;
json.put( "xpos", xpos );
json.put( "ypos", ypos );
response = putRequest ( uri , json );
if ( response == null || response.getStatusLine().getStatusCode() != 200 )
return false;
}
catch ( Exception e )
{
System.err.println(e);
return false;
}
return true;
}
public boolean updUserPos ( String userID , int xpos , int ypos )
{
try
{
JSONObject json = new JSONObject();
URI uri = new URI ( baseURL + "users/" + userID );
HttpResponse response;
json.put( "xpos", xpos );
json.put( "ypos", ypos );
response = putRequest ( uri , json );
if ( response == null || response.getStatusLine().getStatusCode() != 200 )
return false;
}
catch ( Exception e )
{
System.err.println(e);
return false;
}
return true;
}
}
| [
"[email protected]"
]
| |
e93fb8cdc6bee1dcbf98a7fce9d626e89040c88e | 4552a082cd979e56761391eb842246edcf039be7 | /ASBNZE13271/src/main/java/com/baske/model/Lek.java | 274dbe80da72f02a620c2fd561e1eec8f9eebbdd | []
| no_license | randomHamSandwich/SBNZ | 32d3005163fdad62300338366069d2bd38bfd54f | c90b4e4de2cbc3d10bf0dec85330ea3fb2854616 | refs/heads/master | 2020-05-29T14:59:43.012180 | 2019-06-04T07:57:48 | 2019-06-04T07:57:48 | 189,207,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,278 | java | package com.baske.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
public class Lek implements Serializable{
private String naziv;
private TipLeka tipLeka;
private HashSet<SastojakLeka> sastojci;
public TipLeka getTipLeka() {
return tipLeka;
}
public void setTipLeka(TipLeka tipLeka) {
this.tipLeka = tipLeka;
}
public HashSet<SastojakLeka> getSastojci() {
return sastojci;
}
public void setSastojci(HashSet<SastojakLeka> sastojci) {
this.sastojci = sastojci;
}
public String getNaziv() {
return naziv;
}
public void setNaziv(String naziv) {
this.naziv = naziv;
}
public Lek(TipLeka tipLeka, HashSet<SastojakLeka> sastojci, String naziv) {
super();
this.tipLeka = tipLeka;
this.sastojci = sastojci;
this.naziv = naziv;
}
public boolean jeAntibiotik() {
if (tipLeka == null) {
return false;
}
if (tipLeka == TipLeka.ANTIBIOTIK) {
return true;
} else {
return false;
}
}
// @Override
// public String toString() {
// return "Lek [naziv=" + naziv + ", tipLeka=" + tipLeka + ", sastojci=" + sastojci + "]";
// }
@Override
public String toString() {
return "Lek [naziv=" + naziv + "]";
}
}
| [
"Lenovo@LAPTOP-VM4RHL16"
]
| Lenovo@LAPTOP-VM4RHL16 |
a0d047eeec91122a5e714c8379dcdff54e53e636 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/63/org/apache/commons/lang/builder/EqualsBuilder_append_453.java | 363bd57e8d7dc7ffc727c1c0ed76207a883c5351 | []
| no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,186 | java |
org apach common lang builder
assist implement link object equal object method
method build good equal method
rule laid
href http java sun doc book effect index html effect java
joshua bloch rule compar code doubl code
code float code arrai tricki make
code equal code code hash code hashcod code consist
difficult
object compar equal gener hash code
object hash code equal
relev field includ calcul equal
deriv field field
gener hash code equal method vice
versa
typic code
pre
equal object obj
obj class myclass
obj
class myclass rh class myclass obj
equal builder equalsbuild
append super appendsup equal obj
append field1 rh field1
append field2 rh field2
append field3 rh field3
equal isequ
pre
altern method reflect determin
field test field method
code reflect equal reflectionequ code code access object accessibleobject set access setaccess code
chang visibl field fail secur
manag permiss set correctli
slower test explicitli
typic invoc method
pre
equal object obj
equal builder equalsbuild reflect equal reflectionequ obj
pre
author href mailto steve downei netfolio steve downei
author stephen colebourn
author gari gregori
author pete gieser
author arun mammen thoma
version
equal builder equalsbuild
test code code equal
param lh left hand code code
param rh hand code code
equal builder equalsbuild chain call
equal builder equalsbuild append lh rh
equal isequ
equal isequ lh rh
| [
"[email protected]"
]
| |
1f1b17a8c046c627845c552d575259abf0fdcaf2 | 339f79a997e3797467b13a491c945acb73613b54 | /src/Gdish/G005/g01/io/aio/ServerCompletionHandler.java | 2520259d5b037ff4770afa9ebcf05fabb6359ffd | []
| no_license | kobe1329989713/java_kobe | d22e165e9387bb3298c67692b9c57faff8172a0b | b2fd76cfa1c1977a5161f5b75d0eb0c65024690e | refs/heads/master | 2018-10-20T18:25:00.572735 | 2018-07-20T16:56:45 | 2018-07-20T16:56:45 | 114,659,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,042 | java | package Gdish.G005.g01.io.aio;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.util.concurrent.ExecutionException;
public class ServerCompletionHandler implements CompletionHandler<AsynchronousSocketChannel, Server> {
// 连接成功 执行的业务逻辑
@Override
public void completed(AsynchronousSocketChannel asc, Server attachment) {
//当有下一个客户端接入的时候 直接调用Server的accept方法,这样反复执行下去,保证多个客户端都可以阻塞
attachment.assc.accept(attachment, this);
read(asc);
}
// AsynchronousSocketChannel 它就是一个通道。
private void read(final AsynchronousSocketChannel asc) {
//读取数据
ByteBuffer buf = ByteBuffer.allocate(1024);
asc.read(buf, buf, new CompletionHandler<Integer, ByteBuffer>() {
@Override
public void completed(Integer resultSize, ByteBuffer attachment) {
//进行读取之后,重置标识位
attachment.flip();
//获得读取的字节数
System.out.println("Server -> " + "收到客户端的数据长度为:" + resultSize);
//获取读取的数据
String resultData = new String(attachment.array()).trim();
System.out.println("Server -> " + "收到客户端的数据信息为:" + resultData);
String response = "服务器响应, 收到了客户端发来的数据: " + resultData;
write(asc, response);
}
@Override
public void failed(Throwable exc, ByteBuffer attachment) {
exc.printStackTrace();
}
});
}
private void write(AsynchronousSocketChannel asc, String response) {
try {
ByteBuffer buf = ByteBuffer.allocate(1024);
buf.put(response.getBytes());
buf.flip();
asc.write(buf).get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
// 连接失败执行的业务逻辑。
@Override
public void failed(Throwable exc, Server attachment) {
exc.printStackTrace();
}
}
| [
"[email protected]"
]
| |
29cc7437f1e189a76a2dac587a23bd5d3dc0dcff | c3ac6bdd5a4038f6d11cc0ea83ad8e15721cde55 | /atech/src/main/java/com/challenge/atech/mapper/FlightMapper.java | aec8c3c0f15f7647995d7f4fdd7a0c8880a955e0 | []
| no_license | vinidual/Development-Challenge | 8b1b8a96d7dc0defdd137963558f1731966f9b66 | e4b02a9dffd21685f7d14359f58fcd5bd7c8498d | refs/heads/master | 2021-07-05T06:11:46.425977 | 2017-09-25T08:20:14 | 2017-09-25T08:20:14 | 104,527,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,541 | java | package com.challenge.atech.mapper;
import java.util.ArrayList;
import java.util.List;
import com.challenge.atech.entity.Flight;
import com.challenge.atech.model.FlightModel;
public final class FlightMapper {
public static FlightModel EntityToModel(Flight flight) {
FlightModel flightModel = new FlightModel(
flight.getId(),
flight.getTakeoffTime(),
flight.getLandingTime(),
CityMapper.EntityToModel(flight.getOriginCity()),
CityMapper.EntityToModel(flight.getDestinyCity()),
AirplaneMapper.EntityToModel(flight.getAirplane()),
PilotMapper.EntityToModel(flight.getPilot()),
flight.getFlightStatus()
);
return flightModel;
}
public static List<FlightModel> EntityToModel(List<Flight> listCities) {
List<FlightModel> listCitiesModel = new ArrayList<FlightModel>();
for(int i = 0; i < listCities.size(); i++) {
listCitiesModel.add(EntityToModel(listCities.get(i)));
}
return listCitiesModel;
}
public static Flight ModelToEntity(FlightModel flightModel) {
Flight flight = new Flight();
flight.setAirplane(AirplaneMapper.ModelToEntity(flightModel.getAirplane()));
flight.setDestinyCity(CityMapper.ModelToEntity(flightModel.getDestinyCity()));
flight.setFlightStatus(flightModel.getFlightStatus());
flight.setLandingTime(flightModel.getLandingTime());
flight.setOriginCity(CityMapper.ModelToEntity(flightModel.getOriginCity()));
flight.setPilot(PilotMapper.ModelToEntity(flightModel.getPilot()));
flight.setTakeoffTime(flightModel.getTakeoffTime());
return flight;
}
}
| [
"[email protected]"
]
| |
98a25a32fceab0bf8a8ffa4d4bc0e74d6b71ee63 | 67501d714633be015d07fd7033d205e8ac0366c0 | /iforward/src/cn/xm/hanley/iforward/utils/ExportUtil.java | e66e113a1c67de26dce72ba7b932440fcd5e78f7 | []
| no_license | jibenfa/iforward | cfe1d5342f3f892ecf9b989f4c1955807573acf5 | add2ba1046555c190f11edb37cab647baf33ba96 | refs/heads/master | 2021-08-27T21:09:23.116368 | 2017-12-02T05:59:50 | 2017-12-02T05:59:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,817 | java | package cn.xm.hanley.iforward.utils;
import java.io.File;
import java.io.FileWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import cn.xm.hanley.iforward.domain.History;
import android.os.Environment;
import android.util.Log;
public class ExportUtil {
private static String TAG = "ExportUtil";
public static boolean saveHistoryToSDCard(ArrayList<History> history){
boolean flag = true;
if(null == history || history.size() ==0){
return false;
}
String fullPath = newFileName();
try {
File file = new File(fullPath);
if(!file.exists()){
file.createNewFile();
}
FileWriter fw = new FileWriter(file);
for(History h:history){
fw.write(h.getHname());
fw.write("\t\t");
fw.write(h.getHnumber());
fw.write("\t\t");
fw.write(h.getHdate()+" "+h.getHtime());
fw.write("\t\t");
fw.write(h.getHtransfer());
fw.write("\n");
fw.flush();
}
fw.close();
} catch (Exception e) {
flag = false;
Log.e(TAG , e.toString());
}
return flag;
}
public static String newFileName(){
StringBuffer sb = null;
try {
sb = new StringBuffer();
String path = Environment.getExternalStorageDirectory().getPath()
+ "/iforward/";
File tempFile = new File(path);
if (!tempFile.exists()) {
tempFile.mkdir();
}
sb.append(path);
sb.append("转接历史[");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date();
String result = sdf.format(date);
sb.append(result);
sb.append("]");
sb.append("-");
sb.append(date.getTime());
sb.append(".txt");
} catch (Exception e) {
Log.e(TAG, e.toString());
}
return sb.toString();
}
}
| [
"[email protected]"
]
| |
25360ed987985f2c473094e80609f430e03e7e2f | fd0e221fd461d1c2ba674948afbc06b96b829a5b | /ImprimirMedia.java | 3e9f5dc56d3ffb9bdd2e612471846e40a465081a | []
| no_license | JoaoVPereira/ExerciciosAula4 | 462ba1b56c27d1e960233e6faa5bf8cd7ff3407f | e7ce949588ce07afc3e6b9d533c2fb5918c0bbd6 | refs/heads/master | 2021-04-22T15:08:02.457628 | 2020-03-25T01:18:13 | 2020-03-25T01:18:13 | 249,856,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package ExerciciosAula4;
import javax.swing.*;
public class ImprimirMedia{
public static void main(String...args){
Double num, soma = 0.0;
int resp = 0;
do{
num = Double.parseDouble(JOptionPane.showInputDialog("Digite os numeros"));
if (num >= 0){
soma = num + soma;
resp++;
}
} while( num>=0 );
JOptionPane.showMessageDialog(null,"A média dos números é: " + (soma/resp));
JOptionPane.showMessageDialog(null,"A quantidade de números é: " + resp);
JOptionPane.showMessageDialog(null,"A soma dos numeros é: " + soma);
}
} | [
"[email protected]"
]
| |
27f120083b0aaa5a7939bb0270a583fcd223327e | 0df88782da7b29f04a17ff4363ce81394b8fea9c | /src/LLD/AmazonShoppingCart/constants/PaymentStatus.java | 75d81085990c415bd02f943184614f33fd84c1b8 | []
| no_license | shubhamsaxena444/DataStructuresAndAlgorithms | cd9dd6de946fc01b9a432eae07d7d665673da23c | bca195f4fb41fe1a373feb5b8ea86bd2b346f683 | refs/heads/master | 2021-07-30T16:22:30.308851 | 2021-07-19T17:48:56 | 2021-07-19T17:48:56 | 239,317,972 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | package LLD.AmazonShoppingCart.constants;
public enum PaymentStatus {
UNPAID, PENDING, COMPLETED, FILLED, DECLINED, CANCELLED, ABANDONED, SETTLING, SETTLED, REFUNDED
}
| [
"[email protected]"
]
| |
2f6479d24312a8e3bedcf63d9dd2472d170d78e3 | 6af436358eb05223e99f129fc80c356a9def917f | /HelloSpring/src/main/java/com/kcing/springprocessor/SpringBeanPostProcessor.java | e55a705c0b3852472e958ef1fa455c2d10c163c3 | []
| no_license | ramkmaharjan/SpringPractice | 77fb90d50e3b9ee7fbe326f6bd89828d933893b1 | e5de08e37232e9ebcb026e18cd4d5b67845a84a4 | refs/heads/master | 2020-12-24T15:49:18.452579 | 2014-11-17T14:08:51 | 2014-11-17T14:08:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package com.kcing.springprocessor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
public class SpringBeanPostProcessor implements BeanPostProcessor{
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
System.out.println("Pre Process:"+beanName);
return bean;
}
public Object postProcessAfterInitialization(Object bean, String beanName)
throws BeansException {
System.out.println("Post Process:"+beanName);
return bean;
}
}
| [
"[email protected]"
]
| |
0958c53e41a727c37db2e098fb1f3fd584a0d9fd | d6556a1d69a650663d763bf43ace69970e9ec5b1 | /test/SimulatorTest.java | 263294b992ebef69c97238344814a106c2aaaa6c | []
| no_license | charmiidalal/PSA-Final-Project | 720ed00b602dc2e3899e89024b643501937ae4b7 | e103eba3a0ab53f1af8687a8ee4c7e680422d6b0 | refs/heads/main | 2023-04-06T13:53:07.279953 | 2021-04-22T03:26:01 | 2021-04-22T03:26:01 | 351,894,391 | 0 | 1 | null | 2021-04-22T03:26:02 | 2021-03-26T19:44:04 | Java | UTF-8 | Java | false | false | 291 | java | import utill.Simulator;
import org.junit.Test;
import java.io.IOException;
import java.util.Timer;
import static org.junit.Assert.*;
public class SimulatorTest {
@Test
public void testSimulator() throws IOException {
Simulator s = new Simulator();
s.run();
}
}
| [
"[email protected]"
]
| |
56efdc9ac17c5470a509d7c6148627172b8415ab | acf14b2da710272d2ca9b9da33e5f7cc214768f2 | /1erParcial/T 05-02 Interface/src/orquestaPack/Cuerda.java | 50fc94e5583b2043d9e23ad06670da57c2c4f960 | []
| no_license | ariel2k/PrograAvanzada | f849f4dd899da3c4bad79a88e1ffa01b514f943b | 293ae9c31ce8e02857d0804da96a8767dc2cf87e | refs/heads/master | 2021-01-20T23:31:18.548906 | 2015-05-03T15:53:08 | 2015-05-03T15:53:08 | 34,209,112 | 1 | 1 | null | null | null | null | WINDOWS-1250 | Java | false | false | 219 | java | package orquestaPack;
public class Cuerda extends Instrumento{
public Cuerda(String nombre){
this.nombre = new String(nombre);
}
public void tocar() {
System.out.println("Tocó Cuerda: "+this.nombre);
}
}
| [
"[email protected]"
]
| |
f37f667ca45f58ba6e63ea9feaaba71f290091b8 | 6ff76c874bcaf985447a64472dde8854574d35f1 | /app/src/main/java/apps/motivateme/activities/VideoActivity.java | 3931f95ec47f5278e293207d5f4df06296423c2b | []
| no_license | vinsanity16985/motivateme | 08ff7eb359643f1cea25bbb2bf7c309d050b959e | 38ce77f2aef837fee7b3d018e5541fa00379bd11 | refs/heads/master | 2021-01-20T18:57:39.176482 | 2017-01-17T18:48:25 | 2017-01-17T18:48:25 | 64,284,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package apps.motivateme.activities;
import android.app.Activity;
import android.os.Bundle;
import apps.motivateme.R;
public class VideoActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video);
}
}
| [
"[email protected]"
]
| |
40352debc2c902f640c9489a35bcd3ab12925804 | f68e9e7c1ef1982a98aac14dcb20035b784590fd | /src/main/java/hzf/demo/sort/BinarySearchMeituan.java | 5b445a42fd4ff59f30585e95de7b8d58a6eb2535 | []
| no_license | english207/Hello | c38e9201a3d8a7df3f0c09ecd4d3b337ae0ea2f5 | c04bba6e077215f064226d29441ab67cf536c62f | refs/heads/master | 2021-01-24T11:59:42.222020 | 2019-01-31T00:33:28 | 2019-01-31T00:33:28 | 57,899,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,321 | java | package hzf.demo.sort;
/**
* Created by fan on 2016/10/10.
*
*/
public class BinarySearchMeituan
{
public static int search(int[] arr, int x)
{
//特殊处理
if (arr == null || arr.length == 0)
{
return -1;
}
int start = 0;
int end = arr.length - 1;
int mid = 0;
while ( start <= end)
{
mid = (start + end) / 2;
int mid_val = arr[mid];
if (mid_val == x)
{
return mid;
}
if (mid_val < arr[mid + 1] && mid_val < arr[mid - 1]) // 正好处于最低
{
break;
}
if (mid_val > arr[mid - 1] && mid_val < arr[mid + 1]) // 处于升序部分
{
end = mid - 1;
}
if (mid_val < arr[mid - 1] && mid_val > arr[mid + 1]) // 处于降序部分
{
start = mid + 1;
}
}
System.out.println("mid - " + mid);
return arr[mid] == x ? mid : -1;
}
public static void main(String[] args) {
//6,7,8,9,4,5,6
//9
//6,7
//6,5
int[] arr = {99, 77, 55, 44, 33, 22, 3, 5, 21, 34, 55};
System.out.println(search(arr, 55));
}
} | [
"[email protected]"
]
| |
8f953b6aa8c2a873af2546044a3b34d6bf125527 | 08b64801ed78fa0a55887481578539a37ea4bc5a | /src/main/java/br/com/digitalhouse/exerciciosSpring/entrypoint/controller/StudentController.java | 3d70f617c0c37ffb63b1972ee853bcd12cb0ed91 | []
| no_license | cfugita/bootcamp-meli-spring | 4eb8f4efd63a82ad8c5a74400d5324b9e7a0b35c | 862549fb132e5ab5d3477e1641ae60e3c8fd6c96 | refs/heads/main | 2023-05-19T04:46:59.821127 | 2021-06-09T21:40:59 | 2021-06-09T21:40:59 | 371,428,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,023 | java | package br.com.digitalhouse.exerciciosSpring.entrypoint.controller;
import br.com.digitalhouse.exerciciosSpring.domain.entitys.Student;
import br.com.digitalhouse.exerciciosSpring.usecase.model.StudentUseCase;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/student")
@RestController
public class StudentController {
private final StudentUseCase studentUseCase;
public StudentController(StudentUseCase studentUseCase) {
this.studentUseCase = studentUseCase;
}
@PostMapping ("/averageGrade")
public ResponseEntity<Object> calculateGrade (@RequestBody Student student) {
return new ResponseEntity<Object>(this.studentUseCase.calculateGrades(student), HttpStatus.OK);
}
}
| [
"[email protected]"
]
| |
ea2e4b982952e3245b96fc9c7d715128860ea804 | 383abd24bb30afa861a68db53f4e2f1f14dac6ca | /Algorithms/Sorting/countingsort1.java | e62f8bb36cf64651d847dd9c9014f4fa2a938da9 | []
| no_license | shaurya10000/HackerRank | ed6e8e664919c6fe9d30247fe477eabcc25f13ce | 0900126a6ba0ef0f9a5c2a1283da808cc2ab1ca5 | refs/heads/master | 2020-09-15T13:34:48.752486 | 2017-03-06T03:01:00 | 2017-03-20T21:03:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | /**
* https://www.hackerrank.com/challenges/countingsort1
*/
/**
* @author rakshith
*
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int[] ar = new int[n];
int max = 0;
for(int i=0; i<n; i++){
ar[i] = input.nextInt();
max = Math.max(max,ar[i]);
}
countSort(ar,max+1);
}
public static void countSort(int[] ar, int n){
int[] count = new int[n];
for(int i=0; i<ar.length; i++){
count[ar[i]]++;
}
printArray(count);
}
public static void printArray(int[] ar){
for(int i=0; i<ar.length; i++){
System.out.print(ar[i]+" ");
}
}
} | [
"[email protected]"
]
| |
f216ab877edcb56bac16631daf100ed600053fb4 | 71dbd1600953f6032ff47b1b6e525c3eb11cfaf8 | /design_pattern/src/com/design/pattern/structural/proxy/dynamicproxy/OrderServiceDynamicProxy.java | 2d58163b81eab033e04810c3e3352b711a96ca31 | []
| no_license | Qgfsixsixsix/JavaDesignPattern | ce3dc679771b63653b4faed2f0339ad2563fecdf | da1a816e7d45704e9c40a84ac7bcb9a1b76eb348 | refs/heads/master | 2020-04-26T04:10:16.294382 | 2019-03-01T03:45:33 | 2019-03-01T03:45:33 | 173,292,799 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,540 | java | package com.design.pattern.structural.proxy.dynamicproxy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import com.design.pattern.structural.proxy.Order;
import com.design.pattern.structural.proxy.db.DataSourceContextHolder;
public class OrderServiceDynamicProxy implements InvocationHandler {
private Object target;
public OrderServiceDynamicProxy(Object target) {
this.target = target;
}
@SuppressWarnings("rawtypes")
public Object bind(){
Class cls = target.getClass();
return Proxy.newProxyInstance(cls.getClassLoader(), cls.getInterfaces(), this);
}
/**
* proxy 相当于一个摆设(代理类)
* method 要被增强的方法对象
* args method的具体参数
*/
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Object argObject = args[0];
beforeMethod(argObject);
//这个值就是要被增强方法的返回值
Object object = method.invoke(target, args);
afterMethod();
return object;
}
private void beforeMethod(Object obj){
int userId = 0;
System.out.println("动态代理 before core");
if(obj instanceof Order){
Order order = (Order)obj;
userId = order.getUserId();
}
int dbRouter = userId % 2;
System.out.println("动态代理分配到【db" + dbRouter + "】处理数据");
//todo 设置dataSource;
DataSourceContextHolder.setDBType(String.valueOf(dbRouter));
}
private void afterMethod(){
System.out.println("动态代理 after core");
}
}
| [
"[email protected]"
]
| |
bc91bbb23591bc99c8e9227d8dacbd9cf3ef273f | 0493ffe947dad031c7b19145523eb39209e8059a | /OpenJdk8uTest/src/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/AppInputStream/ReadBlocksClose.java | 6f44d5d410b568f5a95360cfe1d69babbe1bea65 | []
| no_license | thelinh95/Open_Jdk8u_Test | 7612f1b63b5001d1df85c1df0d70627b123de80f | 4df362a71e680dbd7dfbb28c8922e8f20373757a | refs/heads/master | 2021-01-16T19:27:30.506632 | 2017-08-13T23:26:05 | 2017-08-13T23:26:05 | 100,169,775 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,282 | java | package test.sun.security.ssl.com.sun.net.ssl.internal.ssl.AppInputStream;
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4814140
* @summary AppInputStream: read can block a close
* @run main/othervm ReadBlocksClose
*
* SunJSSE does not support dynamic system properties, no way to re-use
* system properties in samevm/agentvm mode.
* @author Brad Wetmore
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import test.java.io.*;
import test.java.net.*;
import test.javax.net.ssl.*;
public class ReadBlocksClose {
/*
* =============================================================
* Set the various variables needed for the tests, then
* specify what tests to run on each side.
*/
/*
* Should we run the client or server in a separate thread?
* Both sides can throw exceptions, but do you have a preference
* as to which side should be the main thread.
*/
static boolean separateServerThread = false;
/*
* Where do we find the keystores?
*/
static String pathToStores = "../../../../../../../etc";
static String keyStoreFile = "keystore";
static String trustStoreFile = "truststore";
static String passwd = "passphrase";
/*
* Is the server ready to serve?
*/
volatile static boolean serverReady = false;
/*
* Turn on SSL debugging?
*/
static boolean debug = false;
/*
* If the client or server is doing some kind of object creation
* that the other side depends on, and that thread prematurely
* exits, you may experience a hang. The test harness will
* terminate all hung threads after its timeout has expired,
* currently 3 minutes by default, but you might try to be
* smart about it....
*/
/*
* Define the server side of the test.
*
* If the server prematurely exits, serverReady will be set to true
* to avoid infinite hangs.
*/
void doServerSide() throws Exception {
SSLServerSocketFactory sslssf =
(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket sslServerSocket =
(SSLServerSocket) sslssf.createServerSocket(serverPort);
serverPort = sslServerSocket.getLocalPort();
/*
* Signal Client, we're ready for his connect.
*/
serverReady = true;
SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
InputStream sslIS = sslSocket.getInputStream();
OutputStream sslOS = sslSocket.getOutputStream();
try {
sslIS.read();
} catch (IOException e) {
// this is ok, we expect this to time out anyway if the bug
// is not fixed. This is just to make sure that we
// don't inadvertantly fail.
}
sslSocket.close();
}
/*
* Define the client side of the test.
*
* If the server prematurely exits, serverReady will be set to true
* to avoid infinite hangs.
*/
void doClientSide() throws Exception {
/*
* Wait for server to get started.
*/
while (!serverReady) {
Thread.sleep(50);
}
SSLSocketFactory sslsf =
(SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslSocket = (SSLSocket)
sslsf.createSocket("localhost", serverPort);
final InputStream sslIS = sslSocket.getInputStream();
final OutputStream sslOS = sslSocket.getOutputStream();
new Thread(new Runnable() {
public void run() {
try {
System.out.println("Closing Thread started");
Thread.sleep(3000);
System.out.println("Closing Thread closing");
sslIS.close();
} catch (Exception e) {
RuntimeException rte =
new RuntimeException("Check this out");
rte.initCause(e);
throw rte;
}
}
}).start();
try {
/*
* This should timeout and fail the test
*/
System.out.println("Client starting read");
sslIS.read();
} catch (IOException e) {
// this is ok, we expect this to time out anyway if the bug
// is not fixed. This is just to make sure that we
// don't inadvertantly fail.
}
sslSocket.close();
}
/*
* =============================================================
* The remainder is just support stuff
*/
// use any free port by default
volatile int serverPort = 0;
volatile Exception serverException = null;
volatile Exception clientException = null;
public static void main(String[] args) throws Exception {
String keyFilename =
System.getProperty("test.src", "./") + "/" + pathToStores +
"/" + keyStoreFile;
String trustFilename =
System.getProperty("test.src", "./") + "/" + pathToStores +
"/" + trustStoreFile;
System.setProperty("javax.net.ssl.keyStore", keyFilename);
System.setProperty("javax.net.ssl.keyStorePassword", passwd);
System.setProperty("javax.net.ssl.trustStore", trustFilename);
System.setProperty("javax.net.ssl.trustStorePassword", passwd);
if (debug)
System.setProperty("javax.net.debug", "all");
/*
* Start the tests.
*/
new ReadBlocksClose();
}
Thread clientThread = null;
Thread serverThread = null;
/*
* Primary constructor, used to drive remainder of the test.
*
* Fork off the other side, then do your work.
*/
ReadBlocksClose() throws Exception {
try {
if (separateServerThread) {
startServer(true);
startClient(false);
} else {
startClient(true);
startServer(false);
}
} catch (Exception e) {
// swallow for now. Show later
}
/*
* Wait for other side to close down.
*/
if (separateServerThread) {
serverThread.join();
} else {
clientThread.join();
}
/*
* When we get here, the test is pretty much over.
* Which side threw the error?
*/
Exception local;
Exception remote;
String whichRemote;
if (separateServerThread) {
remote = serverException;
local = clientException;
whichRemote = "server";
} else {
remote = clientException;
local = serverException;
whichRemote = "client";
}
/*
* If both failed, return the curthread's exception, but also
* print the remote side Exception
*/
if ((local != null) && (remote != null)) {
System.out.println(whichRemote + " also threw:");
remote.printStackTrace();
System.out.println();
throw local;
}
if (remote != null) {
throw remote;
}
if (local != null) {
throw local;
}
}
void startServer(boolean newThread) throws Exception {
if (newThread) {
serverThread = new Thread() {
public void run() {
try {
doServerSide();
} catch (Exception e) {
/*
* Our server thread just died.
*
* Release the client, if not active already...
*/
System.err.println("Server died...");
serverReady = true;
serverException = e;
}
}
};
serverThread.start();
} else {
try {
doServerSide();
} catch (Exception e) {
serverException = e;
} finally {
serverReady = true;
}
}
}
void startClient(boolean newThread) throws Exception {
if (newThread) {
clientThread = new Thread() {
public void run() {
try {
doClientSide();
} catch (Exception e) {
/*
* Our client thread just died.
*/
System.err.println("Client died...");
clientException = e;
}
}
};
clientThread.start();
} else {
try {
doClientSide();
} catch (Exception e) {
clientException = e;
}
}
}
}
| [
"[email protected]"
]
| |
4be9750727b6719f6c52afeda33e9225f0f58be7 | 4e30cb1346ca84fbcdf961f2f8eabc84ac4fc864 | /common.moplaf.gis/com.misc.common.moplaf.gis.kml.emf.edit/src/com/misc/common/moplaf/gis/kml/provider/LineStringItemProvider.java | 353eac1c42f310094012035cb7b03d463f87d301 | []
| no_license | MichelSc/common.moplaf | 14fda486dac18f66ce0ec5de8f2818be18f23c5a | 58e9b0b20d643d521388a93b609b68dc71f5e7d7 | refs/heads/master | 2022-11-05T05:39:51.935466 | 2022-10-27T06:24:25 | 2022-10-27T06:24:25 | 32,098,602 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,698 | java | /*******************************************************************************
* Copyright (c) 2017, 2018 Michel Schaffers and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michel Schaffers - initial API and implementation
*******************************************************************************/
/**
*/
package com.misc.common.moplaf.gis.kml.provider;
import com.misc.common.moplaf.common.Color;
import com.misc.common.moplaf.common.Coordinates;
import com.misc.common.moplaf.gis.kml.KmlPackage;
import com.misc.common.moplaf.gis.kml.LineString;
import com.misc.common.moplaf.gisview.emf.edit.IItemPathsProvider;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link com.misc.common.moplaf.gis.kml.LineString} object.
* <!-- begin-user-doc -->
* @implements IItemPathsProvider
* <!-- end-user-doc -->
* @generated
*/
public class LineStringItemProvider extends GeometryItemProvider implements IItemPathsProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LineStringItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addCoordinatesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Coordinates feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCoordinatesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LineString_Coordinates_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LineString_Coordinates_feature", "_UI_LineString_type"),
KmlPackage.Literals.LINE_STRING__COORDINATES,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
LineString lineString = (LineString)object;
return getString("_UI_LineString_type") + " " + lineString.getColor();
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(LineString.class)) {
case KmlPackage.LINE_STRING__COORDINATES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
@Override
public Object getPaths(Object element) {
return element;
}
@Override
public String getPathText(Object element, Object path) {
LineString line = (LineString)element;
String text = line.getPlacemark().getName();
return text;
}
@Override
public Object getPathForeground(Object element, Object path) {
LineString line = (LineString)element;
int rgb = line.getColor();
Color color = new Color(rgb);
return color.toURI();
}
@Override
public int getNrPathStops(Object element, Object path) {
LineString line = (LineString)element;
return line.getCoordinates().size();
}
@Override
public double getPathStopLongitude(Object element, Object path, Object stop) {
LineString line = (LineString)element;
Integer location_index = (Integer)stop;
Coordinates coordinates = line.getCoordinates().get(location_index);
return coordinates.getX();
}
@Override
public double getPathStopLatitude(Object element, Object path, Object stop) {
LineString line = (LineString)element;
Integer location_index = (Integer)stop;
Coordinates coordinates = line.getCoordinates().get(location_index);
return coordinates.getY();
}
@Override
public double getPathStopElevation(Object element, Object path, Object stop) {
LineString line = (LineString)element;
Integer location_index = (Integer)stop;
Coordinates coordinates = line.getCoordinates().get(location_index);
return coordinates.getZ();
}
}
| [
"[email protected]"
]
| |
e9339a7221ce341b2cd725450e2761f916c4a429 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /imm-20200930/src/main/java/com/aliyun/imm20200930/models/CreateCompressPointCloudTaskRequest.java | 0df48a2988bd84fa18bd7de4b371c78f4d9b611a | [
"Apache-2.0"
]
| permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 4,197 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.imm20200930.models;
import com.aliyun.tea.*;
public class CreateCompressPointCloudTaskRequest extends TeaModel {
@NameInMap("CompressMethod")
public String compressMethod;
@NameInMap("CredentialConfig")
public CredentialConfig credentialConfig;
@NameInMap("KdtreeOption")
public KdtreeOption kdtreeOption;
@NameInMap("Notification")
public Notification notification;
@NameInMap("OctreeOption")
public OctreeOption octreeOption;
@NameInMap("PointCloudFields")
public java.util.List<String> pointCloudFields;
@NameInMap("PointCloudFileFormat")
public String pointCloudFileFormat;
@NameInMap("ProjectName")
public String projectName;
@NameInMap("SourceURI")
public String sourceURI;
@NameInMap("Tags")
public java.util.Map<String, ?> tags;
@NameInMap("TargetURI")
public String targetURI;
@NameInMap("UserData")
public String userData;
public static CreateCompressPointCloudTaskRequest build(java.util.Map<String, ?> map) throws Exception {
CreateCompressPointCloudTaskRequest self = new CreateCompressPointCloudTaskRequest();
return TeaModel.build(map, self);
}
public CreateCompressPointCloudTaskRequest setCompressMethod(String compressMethod) {
this.compressMethod = compressMethod;
return this;
}
public String getCompressMethod() {
return this.compressMethod;
}
public CreateCompressPointCloudTaskRequest setCredentialConfig(CredentialConfig credentialConfig) {
this.credentialConfig = credentialConfig;
return this;
}
public CredentialConfig getCredentialConfig() {
return this.credentialConfig;
}
public CreateCompressPointCloudTaskRequest setKdtreeOption(KdtreeOption kdtreeOption) {
this.kdtreeOption = kdtreeOption;
return this;
}
public KdtreeOption getKdtreeOption() {
return this.kdtreeOption;
}
public CreateCompressPointCloudTaskRequest setNotification(Notification notification) {
this.notification = notification;
return this;
}
public Notification getNotification() {
return this.notification;
}
public CreateCompressPointCloudTaskRequest setOctreeOption(OctreeOption octreeOption) {
this.octreeOption = octreeOption;
return this;
}
public OctreeOption getOctreeOption() {
return this.octreeOption;
}
public CreateCompressPointCloudTaskRequest setPointCloudFields(java.util.List<String> pointCloudFields) {
this.pointCloudFields = pointCloudFields;
return this;
}
public java.util.List<String> getPointCloudFields() {
return this.pointCloudFields;
}
public CreateCompressPointCloudTaskRequest setPointCloudFileFormat(String pointCloudFileFormat) {
this.pointCloudFileFormat = pointCloudFileFormat;
return this;
}
public String getPointCloudFileFormat() {
return this.pointCloudFileFormat;
}
public CreateCompressPointCloudTaskRequest setProjectName(String projectName) {
this.projectName = projectName;
return this;
}
public String getProjectName() {
return this.projectName;
}
public CreateCompressPointCloudTaskRequest setSourceURI(String sourceURI) {
this.sourceURI = sourceURI;
return this;
}
public String getSourceURI() {
return this.sourceURI;
}
public CreateCompressPointCloudTaskRequest setTags(java.util.Map<String, ?> tags) {
this.tags = tags;
return this;
}
public java.util.Map<String, ?> getTags() {
return this.tags;
}
public CreateCompressPointCloudTaskRequest setTargetURI(String targetURI) {
this.targetURI = targetURI;
return this;
}
public String getTargetURI() {
return this.targetURI;
}
public CreateCompressPointCloudTaskRequest setUserData(String userData) {
this.userData = userData;
return this;
}
public String getUserData() {
return this.userData;
}
}
| [
"[email protected]"
]
| |
c8e8cec9e9bf7e11c0b96f04fd98cbb2aceeca83 | db3e9d90738b26fbd629c77738304f6a8bc28348 | /flash/src/main/java/MavenSetup/flash/excelutils.java | b0dc50a36fefc782a66691c24276f7c259e31348 | []
| no_license | BhavithaT/Test | 72862dca58f8a325180b6cd2c7bfe9872d12d9ed | b980e604a7b5e95a8a5d6412e1b5eaa42e9167e6 | refs/heads/master | 2023-03-30T21:57:20.123966 | 2021-03-31T08:12:45 | 2021-03-31T08:12:45 | 276,908,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,879 | java | package MavenSetup.flash;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class excelutils
{
private static HSSFWorkbook workbook;
private static HSSFSheet sheet;
private static HSSFRow row;
private static HSSFCell cell;
public void setExcelFile(String excelFilePath,String sheetName) throws IOException {
//Create an object of File class to open xls file
File file = new File("C:\\Users\\dell\\OneDrive\\Desktop\\appl.xlsx");
//Create an object of FileInputStream class to read excel file
FileInputStream inputStream = new FileInputStream(file);
//creating workbook instance that refers to .xls file
workbook=new HSSFWorkbook(inputStream);
//creating a Sheet object
sheet=workbook.getSheet(sheetName);
}
public String getCellData(int rowNumber,int cellNumber){
//getting the cell value from rowNumber and cell Number
cell =sheet.getRow(rowNumber).getCell(cellNumber);
//returning the cell value as string
return cell.getStringCellValue();
}
public int getRowCountInSheet(){
int rowcount = sheet.getLastRowNum()-sheet.getFirstRowNum();
return rowcount;
}
public void setCellValue(int rowNum,int cellNum,String cellValue,String excelFilePath) throws IOException {
//creating a new cell in row and setting value to it
sheet.getRow(rowNum).createCell(cellNum).setCellValue(cellValue);
FileOutputStream outputStream = new FileOutputStream(excelFilePath);
workbook.write(outputStream);
}
}
| [
"[email protected]"
]
| |
b18d6b7435c40b6663f1a8ffc3fd4ee98b1e6b15 | 80d39255ab548051b59db9bec85bfe4458cda128 | /app/src/main/java/com/example/veasnahan/locatepublic/LocationUtil/LocationHelper.java | 0756f936000d45c8e6ef5cbf0084444b4513179b | []
| no_license | veasnahan16/LocatePublic | d89f51abfa456776c5550f90ffc7df27d41d915d | 0925aaab934cf9d385040ed99a264bf55e483719 | refs/heads/master | 2018-11-16T02:33:06.487966 | 2018-09-16T14:00:40 | 2018-09-16T14:00:40 | 115,164,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,451 | java | package com.example.veasnahan.locatepublic.LocationUtil;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.support.annotation.NonNull;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.LocationSettingsResult;
import com.google.android.gms.location.LocationSettingsStatusCodes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
/**
* Created by Jaison
*/
public class LocationHelper implements PermissionUtils.PermissionResultCallback{
private Context context;
private Activity current_activity;
private boolean isPermissionGranted;
private Location mLastLocation;
// Google client to interact with Google API
private GoogleApiClient mGoogleApiClient;
// list of permissions
private ArrayList<String> permissions=new ArrayList<> ();
private PermissionUtils permissionUtils;
private final static int PLAY_SERVICES_REQUEST = 1000;
private final static int REQUEST_CHECK_SETTINGS = 2000;
public LocationHelper(Context context) {
this.context=context;
this.current_activity= (Activity) context;
permissionUtils=new PermissionUtils(context,this);
permissions.add( Manifest.permission.ACCESS_FINE_LOCATION);
permissions.add( Manifest.permission.ACCESS_COARSE_LOCATION);
}
/**
* Method to check the availability of location permissions
* */
public void checkpermission()
{
permissionUtils.check_permission(permissions,"Need GPS permission for getting your location",1);
}
private boolean isPermissionGranted() {
return isPermissionGranted;
}
/**
* Method to verify google play services on the device
* */
public boolean checkPlayServices() {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
int resultCode = googleApiAvailability.isGooglePlayServicesAvailable(context);
if (resultCode != ConnectionResult.SUCCESS) {
if (googleApiAvailability.isUserResolvableError(resultCode)) {
googleApiAvailability.getErrorDialog(current_activity,resultCode,
PLAY_SERVICES_REQUEST).show();
} else {
showToast("This device is not supported.");
}
return false;
}
return true;
}
/**
* Method to display the location on UI
* */
public Location getLocation() {
if (isPermissionGranted()) {
try
{
mLastLocation = LocationServices.FusedLocationApi
.getLastLocation(mGoogleApiClient);
return mLastLocation;
}
catch (SecurityException e)
{
e.printStackTrace();
}
}
return null;
}
public Address getAddress(double latitude, double longitude)
{
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder (context, Locale.getDefault());
try {
addresses = geocoder.getFromLocation(latitude,longitude, 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5
return addresses.get(0);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* Method used to build GoogleApiClient
*/
public void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(context)
.addConnectionCallbacks((GoogleApiClient.ConnectionCallbacks) current_activity)
.addOnConnectionFailedListener((GoogleApiClient.OnConnectionFailedListener) current_activity)
.addApi( LocationServices.API).build();
mGoogleApiClient.connect();
LocationRequest mLocationRequest = new LocationRequest ();
mLocationRequest.setInterval(10000);
mLocationRequest.setFastestInterval(5000);
mLocationRequest.setPriority( LocationRequest.PRIORITY_HIGH_ACCURACY);
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
.addLocationRequest(mLocationRequest);
PendingResult<LocationSettingsResult> result =
LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());
result.setResultCallback(new ResultCallback<LocationSettingsResult> () {
@Override
public void onResult(@NonNull LocationSettingsResult locationSettingsResult) {
final Status status = locationSettingsResult.getStatus();
switch (status.getStatusCode()) {
case LocationSettingsStatusCodes.SUCCESS:
// All location settings are satisfied. The client can initialize location requests here
mLastLocation=getLocation();
break;
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
try {
// Show the dialog by calling startResolutionForResult(),
// and check the result in onActivityResult().
status.startResolutionForResult(current_activity, REQUEST_CHECK_SETTINGS);
} catch (IntentSender.SendIntentException e) {
// Ignore the error.
}
break;
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
break;
}
}
});
}
/**
* Method used to connect GoogleApiClient
*/
public void connectApiClient()
{
mGoogleApiClient.connect();
}
/**
* Method used to get the GoogleApiClient
*/
public GoogleApiClient getGoogleApiCLient()
{
return mGoogleApiClient;
}
/**
* Handles the permission results
*/
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
{
permissionUtils.onRequestPermissionsResult(requestCode,permissions,grantResults);
}
/**
* Handles the activity results
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CHECK_SETTINGS:
switch (resultCode) {
case Activity.RESULT_OK:
// All required changes were successfully made
mLastLocation=getLocation();
break;
case Activity.RESULT_CANCELED:
// The user was asked to change settings, but chose not to
break;
default:
break;
}
break;
}
}
@Override
public void PermissionGranted(int request_code) {
Log.i("PERMISSION","GRANTED");
isPermissionGranted=true;
}
@Override
public void PartialPermissionGranted(int request_code, ArrayList<String> granted_permissions) {
Log.i("PERMISSION PARTIALLY","GRANTED");
}
@Override
public void PermissionDenied(int request_code) {
Log.i("PERMISSION","DENIED");
}
@Override
public void NeverAskAgain(int request_code) {
Log.i("PERMISSION","NEVER ASK AGAIN");
}
private void showToast(String message)
{
Toast.makeText(context,message, Toast.LENGTH_SHORT).show();
}
}
| [
"[email protected]"
]
| |
2f0f79c989bee72e6fde76cd294a2a0549ffc412 | ebe5a9cbebaee07f63f6903b03a8cecf4b236326 | /Multi/src/MultiUSBInterface/KeyBoard.java | 025c8d536dbb6f9d9d73a6ba92f4b3eeb7147df7 | []
| no_license | GithubRobot01/itheima01 | cdcb909210c91236a75c9d15a02873de86dcb042 | 3bad1ec2d1ca2d8b9198fcf7dfd5128559124be5 | refs/heads/master | 2022-01-18T10:35:40.446327 | 2019-08-08T02:53:11 | 2019-08-08T02:53:11 | 197,952,235 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package MultiUSBInterface;
public class KeyBoard implements USB {
@Override
public void open() {
System.out.println("成功连接键盘");
}
@Override
public void close() {
System.out.println("断开键盘连接");
}
public void type(){
System.out.println("键盘打字");
}
}
| [
"[email protected]"
]
| |
a38ef4f9397ce03f057cb2e40bb14bee60d443b4 | 0d3bc5abd25fe98292c141a6086bce87741c4dcb | /RequirementExtractor/src/GUI/CreateStepDialog.java | 520014d886370737ec0645dbb72709b2100bff70 | []
| no_license | CSE5322/history | 9a1180e9b9fa72ec47c8c0980256d7b7c39b441b | 24f9d8100938a8fa657f21510abda1f9b38c7d75 | refs/heads/master | 2021-06-08T04:20:35.854399 | 2016-10-31T01:34:34 | 2016-10-31T01:34:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,098 | java | package GUI;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import BusinessObjects.BusinessProcess;
import BusinessObjects.Phrase;
import BusinessObjects.Repository;
import Controller.DefineBusinessProcessController;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class CreateStepDialog extends JDialog {
private JLabel lblVerb;
private JLabel lblNoun;
private JTextField txtVerb;
private JTextField txtNoun;
private JLabel lblSentance;
private JTextField txtSentance;
private JLabel lblSequenceNumber;
private JComboBox cbSequenceNumber;
/**
* Launch the application.
*/
/*main
* public static void main(String[] args) {
try {
CreateBusinessProcessDialog dialog = new CreateBusinessProcessDialog();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
*/
/**
* Create the dialog.
*/
public CreateStepDialog(Phrase phrase) {
setBounds(100, 100, 450, 300);
getContentPane().setLayout(null);
txtVerb = new JTextField(phrase.getVerb());
txtVerb.setBounds(171, 44, 86, 22);
getContentPane().add(txtVerb);
lblVerb = new JLabel("Verb : ");
lblVerb.setBounds(104, 41, 71, 28);
getContentPane().add(lblVerb);
//txtVerb.setFont(font);
// txtVerb.setOpaque(false);
txtNoun = new JTextField(phrase.getNoun());
txtNoun.setBounds(171, 79, 86, 22);
getContentPane().add(txtNoun);
lblNoun = new JLabel("Noun : ");
lblNoun.setBounds(104, 82, 64, 22);
getContentPane().add(lblNoun);
txtSentance = new JTextField(phrase.getSentence());
txtSentance.setBounds(171, 114, 216, 22);
getContentPane().add(txtSentance);
lblSentance=new JLabel("Sentence : ");
lblSentance.setBounds(104, 114, 71, 22);
getContentPane().add(lblSentance);
JComboBox cbSequenceNumber = new JComboBox();
cbSequenceNumber.setBounds(171, 146, 86, 22);
getContentPane().add(cbSequenceNumber);
JLabel lblNewLabel = new JLabel("Sequence No : ");
lblNewLabel.setBounds(104, 149, 56, 16);
getContentPane().add(lblNewLabel);
JButton createButton = new JButton("Create");
createButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
}
});
createButton.setBounds(164, 201, 93, 22);
getContentPane().add(createButton);
createButton.setActionCommand("OK");
getRootPane().setDefaultButton(createButton);
lblSequenceNumber = new JLabel("Sequence Number : ");
//cbSequenceNumber = new JComboBox<>();
DefineBusinessProcessController dbpController= new DefineBusinessProcessController();
int numberOfBusinessProcess=dbpController.getBusinessProcesses().size();
for(int i = 1; i <=( numberOfBusinessProcess+1); i++)
cbSequenceNumber.addItem(i);
cbSequenceNumber.setSelectedIndex(numberOfBusinessProcess);
// this.setvi
createButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg) {
DefineBusinessProcessController dbpController= new DefineBusinessProcessController();
System.out.println( " "+cbSequenceNumber.getSelectedIndex());
dbpController.createBusinessProcess(txtVerb.getText(), txtNoun.getText(), txtSentance.getText(), cbSequenceNumber.getSelectedIndex());
dispose();
}
});
/*if(component.getParent()==null)
cbSequenceNumber.setSelectedIndex(cbSequenceNumber.getItemCount()-1);
else
cbSequenceNumber.setSelectedIndex(Repository.getInstance().getIndex((BusinessProcess)component));
*/
}
}
| [
"[email protected]"
]
| |
73c69399b83d82e178288f5017dc7c38e94fb63c | b7caf647564618195da347b1b843125a8a425c74 | /Fall19/workspace/A2_ABSInterface/src/abs/shape/Viewer.java | 8ba85ecc22ed2c3c44458add2980e7a8d211dfeb | []
| no_license | sdwqdwd5/csc_143 | 1c8d933110be94af64e05a866e6cd5686f776278 | c65fd4c41bda823807474202c9aae41a8577e8b7 | refs/heads/master | 2020-08-11T18:57:59.789007 | 2020-08-10T14:38:54 | 2020-08-10T14:38:54 | 214,611,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 583 | java | package abs.shape;
import javax.swing.JFrame;
public class Viewer {
private static final int WIDTH = 600;
private static final int HEIGHT = 400;
private static final int LEFT_X = 750;
private static final int TOP_Y = 100;
public static void main(String[] args) {
Shape _shape_01;
Shape _shape_02;
ControlPanel panel = new ControlPanel();
JFrame frame = new JFrame("Viewer");
frame.add(panel);
frame.setSize(WIDTH, HEIGHT);
frame.setLocation(LEFT_X, TOP_Y);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
| [
"[email protected]"
]
| |
3825e22954418a21838c9a2b935b62c23e325a11 | a2316425525dc84a6b95d995d57b67dbe61b409c | /src/test/java/org/scu/dao/AreaDaoTest.java | 4bb7ff8e26c1970e8bd81370824b2061da5c73fc | []
| no_license | xingyiyang/myblog | 8a97ee1b55253aef6aae5d3eda88bcc3fad3bec8 | 6fa1a5c16c553acf0a050c4f0af29729d218d92c | refs/heads/master | 2018-09-03T12:54:53.638727 | 2018-06-04T07:09:15 | 2018-06-04T07:09:15 | 110,120,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package org.scu.dao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.scu.domain.Area;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created by xing on 2018/6/4.
*/
@RunWith(SpringJUnit4ClassRunner.class)
//告诉junit spring配置文件
@ContextConfiguration({"classpath:spring/spring-dao.xml"})
public class AreaDaoTest {
@Resource
private AreaDao areaDao;
@Test
public void getAreaListByCitycode() throws Exception {
String citycode = "460100";
List<Area> areas = areaDao.getAreaListByCitycode(citycode);
for(Area area:areas){
System.out.println(area.toString());
}
}
} | [
"[email protected]"
]
| |
2a64a18adab60926286c57847f11ff12eee3e28e | 626f2f6c201b693367b4e8e332e96fc15027970a | /leyou/leyou-upload/src/main/java/com/leyou/upload/controller/UploadController.java | 258812ac14730f258aa8a89bc20d2634cde4449b | []
| no_license | zih1998/leyou | 93f0fcbf200977bbfbd99cfa8614a3a0558b3a3c | de1b5e84cbfc860106e4a3e5895686f635e07836 | refs/heads/master | 2023-05-06T17:53:51.256850 | 2021-04-13T04:58:51 | 2021-04-13T04:58:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,058 | java | package com.leyou.upload.controller;
import com.leyou.upload.service.UploadService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
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.multipart.MultipartFile;
@Controller
@RequestMapping("upload")
public class UploadController {
@Autowired
private UploadService uploadService;
@PostMapping("image")
public ResponseEntity<String> uploadImage(@RequestParam("file")MultipartFile file){
String url = this.uploadService.uploadImage(file);
if (StringUtils.isBlank(url)) {
return ResponseEntity.badRequest().build();
}
return ResponseEntity.status(HttpStatus.CREATED).body(url);
}
}
| [
"[email protected]"
]
| |
268269f97e3d3c91a59ccb232f2c71a2f41d92ec | ab9ef0e5afdaab7e96672bdea5c56ab613e2dc6e | /app/src/main/java/com/example/easychef/models/StepPOJO.java | 28a5f3f8e5e2fda2a5ea114cde987f5e3e77610d | []
| no_license | vaidehiphirke/EasyChef | fb8cbdbb2e57f57b115273c908f318d3aba2b990 | db17ddc76d9e3675a78198b0953000177ad8b80e | refs/heads/main | 2023-07-08T17:53:41.391902 | 2021-08-09T20:29:05 | 2021-08-09T20:29:05 | 385,377,275 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.example.easychef.models;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class StepPOJO {
@SerializedName("number")
private int number;
@SerializedName("step")
private String step;
@SerializedName("ingredients")
private List<IngredientPOJO> ingredients = null;
@SerializedName("equipment")
private List<EquipmentPOJO> equipment = null;
@SerializedName("length")
private LengthPOJO length;
public int getNumber() {
return number;
}
public String getStep() {
return step;
}
public List<IngredientPOJO> getIngredients() {
return ingredients;
}
public List<EquipmentPOJO> getEquipment() {
return equipment;
}
public LengthPOJO getLength() {
return length;
}
}
| [
"[email protected]"
]
| |
fdca12e154a464dca53adf7b050d6dbfaeb79210 | c67d57c9002ba44f9f1921bf645901a5b2dbc436 | /JavaWcp/src/polymorphism/human/Employee.java | c84eb13994d2095eaca2b555eacd69f80cf2e01d | []
| no_license | konmarii/java_practice | 35c136ec2df8b838a9f7b657c5d3cc14d8107f0b | 6c97b3877baf4cd18d0164a7d7bf76f33c982a6c | refs/heads/main | 2023-09-01T05:38:22.957774 | 2021-10-31T13:02:41 | 2021-10-31T13:02:41 | 420,338,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package polymorphism.human;
public class Employee extends Human {
private String department;
public Employee(String name, int age, String department) {
super(name, age);
this.department = department;
}
@Override
public String getProfile() {
String profile = "年齢は" + super.getAge() + "です。";
profile += "サラリーマンで、部署は" + this.department + "です。";
return profile;
}
}
| [
"[email protected]"
]
| |
0f3a73d54a42eb611bbcd4a0a5b52aafe55e135e | 8c8667eeef6487bce01d612d5e948355256b39ac | /cajas/src/main/java/mx/babel/bansefi/banksystem/cajas/webservice/consultaenvioentreoficinas/EjecutarResponse.java | c3c091e1125f2f55d78db4adcdf266a11d6f1947 | []
| no_license | JesusGui/ProyectoBansefi | 7c0c228943be245bf69d1d2a9fe7f40a0a04db9f | 4b6caa502c279c51231d0f5f8cb0399813c233e2 | refs/heads/master | 2020-03-28T14:38:44.536238 | 2018-09-12T16:08:16 | 2018-09-12T16:08:16 | 148,507,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,685 | java |
package mx.babel.bansefi.banksystem.cajas.webservice.consultaenvioentreoficinas;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Clase Java para anonymous complex type.
*
* <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="EjecutarResult" type="{http://BansefiNSS/WebServicesNSS/TR_SOLCT_CONT_IND_SM_TRN}EjecutarResult" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"ejecutarResult"
})
@XmlRootElement(name = "EjecutarResponse")
public class EjecutarResponse {
@XmlElement(name = "EjecutarResult")
protected EjecutarResult ejecutarResult;
/**
* Obtiene el valor de la propiedad ejecutarResult.
*
* @return
* possible object is
* {@link EjecutarResult }
*
*/
public EjecutarResult getEjecutarResult() {
return ejecutarResult;
}
/**
* Define el valor de la propiedad ejecutarResult.
*
* @param value
* allowed object is
* {@link EjecutarResult }
*
*/
public void setEjecutarResult(EjecutarResult value) {
this.ejecutarResult = value;
}
}
| [
"[email protected]"
]
| |
9580d0d0f04f474c124864144d3524494474d981 | e584be470ab7b5aaa852077063780a80f088af4f | /src/graph/FloyedWarshall.java | 37eee7301d530f973de04c7014fa22fada10d8ce | [
"Apache-2.0"
]
| permissive | ayubali/javainterviewprogramwithsolution | 632a41d1fa6fcba2098be6085fa56613164617ca | 26ee3a1bbfa882582a7a41d9a86ecc8e28d0b2b2 | refs/heads/master | 2020-12-25T02:50:09.159792 | 2016-05-01T16:12:56 | 2016-05-01T16:12:56 | 57,597,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,056 | java | package graph;
public class FloyedWarshall {
public int N;
public int[][] dist;
public int[][] path;
public FloyedWarshall(int N) {
this.N = N;
dist = new int[N][N];
path = new int[N][N];
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (i != j) {
dist[i][j] = 10000;
}
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (i != j) {
path[i][j] = j;
}
}
}
}
public void floydWarshall() {
for (int k = 0; k < N; k++) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (dist[i][j] > dist[i][k] + dist[k][j]) {
dist[i][j] = dist[i][k] + dist[k][j];
path[i][j] = k;
}
}
}
}
}
public void displayPath(int i, int j) {
if (path[i][j] == j) {
return;
} else {
displayPath(i, path[i][j]);
System.out.print(path[i][j] + "->");
}
}
/**
* @param args
*/
public static void main(String[] args) {
FloyedWarshall warshall = new FloyedWarshall(4);
warshall.addEdge(0, 1, 2);
warshall.addEdge(0, 2, 4);
warshall.addEdge(1, 2, 1);
warshall.addEdge(1, 3, 5);
warshall.addEdge(2, 3, 3);
System.out.println("path mat: \n");
for (int i = 0; i < warshall.N; i++) {
for (int j = 0; j < warshall.N; j++) {
System.out.print(" " + warshall.path[i][j]);
}
System.out.println();
}
warshall.floydWarshall();
System.out.println("\n cost: \n");
for (int i = 0; i < warshall.N; i++) {
for (int j = 0; j < warshall.N; j++) {
System.out.print(" " + warshall.dist[i][j]);
}
System.out.println();
}
System.out.println("path mat: \n");
for (int i = 0; i < warshall.N; i++) {
for (int j = 0; j < warshall.N; j++) {
System.out.print(" " + warshall.path[i][j]);
}
System.out.println();
}
System.out.println("\n cost of 0--3: " + warshall.dist[0][3]);
System.out.print("0->");
warshall.displayPath(0, 3);
System.out.print("3");
}
private void addEdge(int i, int j, int weight) {
dist[i][j] = weight;
dist[j][i] = weight;
}
}
| [
"[email protected]"
]
| |
c5c7bf3a1c8584a39d72f678d3c25175bf4df78a | f4215389cd0d65946f909cdfc6fbb9827d02f727 | /src/main/java/com/qiantai/QiantaiApplication.java | f25781d6eb8327e006988879a7e5606412626fe4 | []
| no_license | spx1998/qiantai | 57b140e4dd2ed9727d6822393dc7fb2a6e97b0e3 | 3ca78b73618a18d492953deeed5f589591c71e24 | refs/heads/master | 2022-05-26T21:44:23.519687 | 2019-12-07T07:50:59 | 2019-12-07T07:50:59 | 226,474,045 | 0 | 0 | null | 2022-05-20T21:18:04 | 2019-12-07T07:38:44 | Java | UTF-8 | Java | false | false | 470 | java | package com.qiantai;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//TODO: 售罄商品的问题 数据库修改 定时清空 前端反馈
//TODO: 图片url问题
//TODO: 餐桌使用中状态的处理 统计管理
@SpringBootApplication
public class QiantaiApplication {
public static void main(String[] args) {
SpringApplication.run(QiantaiApplication.class, args);
}
}
| [
"[email protected]"
]
| |
7c5b301ad0468a4a7ad4588ff796a5c784d76448 | fc0b354186a1e7c49a811b68aa6641159faee8c3 | /src/main/java/com/dongzj/es/domain/EsSearchResult.java | 09f199d1e49fa077c2900d15bac1d046a6398cea | []
| no_license | oldDong/es-jest | 1f360a955f3d3d9d80e44d54e844369f2078fb83 | b37d38b6c11ef0e6f246530580f04fe0b2ddd887 | refs/heads/master | 2020-04-14T19:58:22.029942 | 2019-01-04T07:59:51 | 2019-01-04T07:59:51 | 164,076,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package com.dongzj.es.domain;
import java.util.List;
/**
* 封装ES查询结果
* <p>
* User: dongzj
* Mail: [email protected]
* Date: 2018/11/8
* Time: 11:54
*/
public class EsSearchResult<T> {
Integer total = null;
List<T> hits = null;
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public List<T> getHits() {
return hits;
}
public void setHits(List<T> hits) {
this.hits = hits;
}
@Override
public String toString() {
return "EsSearchResult{" +
"total=" + total +
", hits=" + hits +
'}';
}
}
| [
"[email protected]"
]
| |
a3202ef50b7cdf269c0c7a82c0dbc35e6c80f287 | bb7a3c958372928032c106241300a8b81bf5abf3 | /code/src/gypsysCarnival/controller/PlayerInfoController.java | 16734472bc942fe919c0d9e2eda26503c72c522f | []
| no_license | SauzeauYannis/HMI-Project | 1d2de58938440e8e37910bddb9e2b60c4546c16a | 246db84bfa49ae4d7eb98c528d08664e18392888 | refs/heads/main | 2023-06-16T13:09:47.800487 | 2021-06-17T15:37:00 | 2021-06-17T15:37:00 | 349,681,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,299 | java | package gypsysCarnival.controller;
import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import gypsysCarnival.model.Level;
import gypsysCarnival.model.character.Player;
import gypsysCarnival.model.command.Interpreter;
import gypsysCarnival.model.place.Game;
import gypsysCarnival.view.ClickableImage;
import java.net.URL;
import java.util.ResourceBundle;
/**
* The Player info gypsysCarnival.controller.
*/
public class PlayerInfoController implements Initializable {
/*--------------------- Private members -------------------------*/
private Player player;
@FXML
private VBox progress_bar;
@FXML
private VBox bar;
@FXML
private Label gameFinishedLabel;
@FXML
private ImageView playerIcon;
// --- ICONS
@FXML
private ImageView padlockIcon;
@FXML
private ProgressBar healthProgressBar;
@FXML
private ClickableImage platinumKeyIcon;
@FXML
private ClickableImage goldKeyIcon;
@FXML
private ClickableImage copperKeyIcon;
@FXML
private ClickableImage chocolateEclairIcon;
@FXML
private ClickableImage cottonCandyIcon;
@FXML
private ClickableImage appleCandyIcon;
// --- QUANTITY
@FXML
private Label platinumKeyQuantity;
@FXML
private Label goldKeyQuantity;
@FXML
private Label copperKeyQuantity;
@FXML
private Label chocolateEclairQuantity;
@FXML
private Label cottonCandyQuantity;
@FXML
private Label appleCandyQuantity;
@FXML
public Label coinQuantity;
/*--------------------- Public methods -------------------------*/
/**
* Initialize.
*
* @param location the location
* @param resources the resources
*/
@Override
public void initialize(URL location, ResourceBundle resources) {
Tooltip tooltipHealth = new Tooltip();
tooltipHealth.textProperty().bind(
Bindings.format("%.0f/100 calories", this.healthProgressBar.progressProperty().multiply(100))
);
Tooltip.install(this.healthProgressBar, tooltipHealth);
this.setBindOpacity(this.copperKeyIcon, this.copperKeyQuantity);
this.setBindOpacity(this.goldKeyIcon, this.goldKeyQuantity);
this.setBindOpacity(this.platinumKeyIcon, this.platinumKeyQuantity);
this.setBindOpacity(this.appleCandyIcon, this.appleCandyQuantity);
this.setBindOpacity(this.cottonCandyIcon, this.cottonCandyQuantity);
this.setBindOpacity(this.chocolateEclairIcon, this.chocolateEclairQuantity);
}
/**
* Item mouse clicked.
*
* @param mouseEvent the mouse event
*/
@FXML
public void itemMouseClicked(MouseEvent mouseEvent) {
ImageView icon = (ImageView) mouseEvent.getTarget();
if (mouseEvent.getButton() == MouseButton.PRIMARY)
lookItem(icon);
else if (mouseEvent.getButton() == MouseButton.SECONDARY)
useItem(icon);
}
/**
* Unlock game.
*
* @param gameName the game name
* @param level the level
*/
public void unlockGame(String gameName, Level level) {
int oldInventorySize = this.player.getItems().size();
Interpreter.interpretCommand(this.player, "unlock " + gameName);
if (this.player.getItems().size() < oldInventorySize) {
switch (level) {
case COPPER:
this.removeItem(this.copperKeyIcon.getId());
break;
case GOLD:
this.removeItem(this.goldKeyIcon.getId());
break;
case PLATINUM:
this.removeItem(this.platinumKeyIcon.getId());
break;
}
}
}
/**
* Add item.
*
* @param id the id
*/
public void addItem(String id) {
this.updateItem(id, +1);
}
/*----------------------- Setters --------------------------------*/
/**
* Sets player.
*
* @param player the player
*/
public void setPlayer(Player player) {
this.player = player;
this.coinQuantity.textProperty().bind(
player.getMoney().asString()
);
this.healthProgressBar.progressProperty().bind(
player.getHealth().divide(100F)
);
this.playerIcon.opacityProperty().bind(
player.getHealth().divide(100F)
);
player.getGamesFinished().addListener((observable, oldValue, newValue) -> {
this.gameFinishedLabel.setText(newValue.intValue() + "/" + Game.NB_GAMES);
this.bar.setPrefHeight(newValue.doubleValue() * (this.progress_bar.getHeight() / 9F));
if (newValue.intValue() == 9) {
this.padlockIcon.setImage(
new Image("gypsysCarnival/view/design/image/unlock.png")
);
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("You finished all games!");
alert.setContentText("Congratulations, you can now enter the sparkling caravan!");
((Stage) alert.getDialogPane().getScene().getWindow()).getIcons().add(
new Image("gypsysCarnival/view/design/image/clapping.png")
);
alert.showAndWait();
}
});
}
/*----------------------- Private methods --------------------------------*/
/**
* Look item.
*
* @param icon the icon
*/
private void lookItem(ImageView icon) {
if (icon.equals(copperKeyIcon))
Interpreter.interpretCommand(this.player, "look copper");
else if (icon.equals(goldKeyIcon))
Interpreter.interpretCommand(this.player, "look gold");
else if (icon.equals(platinumKeyIcon))
Interpreter.interpretCommand(this.player, "look platinum");
else if (icon.equals(appleCandyIcon))
Interpreter.interpretCommand(this.player, "look apple");
else if (icon.equals(cottonCandyIcon))
Interpreter.interpretCommand(this.player, "look cotton");
else
Interpreter.interpretCommand(this.player, "look chocolate");
}
/**
* Use item.
*
* @param icon the icon
*/
private void useItem(ImageView icon) {
int oldInventorySize = this.player.getItems().size();
if (icon.equals(copperKeyIcon))
Interpreter.interpretCommand(this.player, "use copper");
else if (icon.equals(goldKeyIcon))
Interpreter.interpretCommand(this.player, "use gold");
else if (icon.equals(platinumKeyIcon))
Interpreter.interpretCommand(this.player, "use platinum");
else if (icon.equals(appleCandyIcon))
Interpreter.interpretCommand(this.player, "use apple");
else if (icon.equals(cottonCandyIcon))
Interpreter.interpretCommand(this.player, "use cotton");
else
Interpreter.interpretCommand(this.player, "use chocolate");
if (this.player.getItems().size() < oldInventorySize)
this.removeItem(icon.getId());
}
/**
* Remove item.
*
* @param id the id
*/
private void removeItem(String id) {
this.updateItem(id, -1);
}
/**
* Update item.
*
* @param id the id
* @param addValue the add value
*/
private void updateItem(String id, int addValue) {
if (copperKeyIcon.getId().equals(id))
this.updateItemQuantity(copperKeyQuantity, addValue);
else if (goldKeyIcon.getId().equals(id))
this.updateItemQuantity(goldKeyQuantity, addValue);
else if (platinumKeyIcon.getId().equals(id))
this.updateItemQuantity(platinumKeyQuantity, addValue);
else if (appleCandyIcon.getId().equals(id))
this.updateItemQuantity(appleCandyQuantity, addValue);
else if (cottonCandyIcon.getId().equals(id))
this.updateItemQuantity(cottonCandyQuantity, addValue);
else
this.updateItemQuantity(chocolateEclairQuantity, addValue);
}
/**
* Update item quantity.
*
* @param keyQuantity the key quantity
* @param addValue the add value
*/
private void updateItemQuantity(Label keyQuantity, int addValue) {
keyQuantity.setText(String.valueOf(
Integer.parseInt(keyQuantity.getText()) + addValue
));
}
/**
* Sets bind opacity.
*
* @param icon the icon
* @param quantity the quantity
*/
private void setBindOpacity(ImageView icon, Label quantity) {
icon.opacityProperty().bind(
Bindings.when(quantity.textProperty().isEqualTo("0"))
.then(0.25)
.otherwise(1)
);
}
}
| [
"[email protected]"
]
| |
d2cba74a05bc7fb663b73541971d1fb7346c5e39 | f8135257ea25a509e61ed2c1e219b30a0ca83f65 | /app/src/main/java/com/karnaphuli/www/kportal/adapter/OnDutyReportAdapter.java | 82396f4311daf23df2f2cf9c7b8c50c5794e6b8e | []
| no_license | Piashsarker/HRMFinalCode | fbcc18c826d896a1cf8f07f14b2b0fe2bae83341 | cc9e6f54df2cf945c0d00b7362faa0e80022ba05 | refs/heads/master | 2021-01-11T05:33:34.057297 | 2016-10-24T14:58:25 | 2016-10-24T14:58:25 | 71,800,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,558 | java | package com.karnaphuli.www.kportal.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.karnaphuli.www.kportal.R;
import com.karnaphuli.www.kportal.model.OnDutyView;
import java.util.ArrayList;
/**
* Created by pt on 9/21/16.
*/
public class OnDutyReportAdapter extends RecyclerView.Adapter<OnDutyReportAdapter.ViewHolder> {
private Context context ;
private ArrayList<OnDutyView> onDutyViewArrayList;
public OnDutyReportAdapter(Context context , ArrayList<OnDutyView> onDutyViewArrayList){
this.context = context ;
this.onDutyViewArrayList = onDutyViewArrayList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_leave_and_tour,parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.from.setText(onDutyViewArrayList.get(position).getFromDate().substring(0,10));
holder.remark.setText(onDutyViewArrayList.get(position).getRemarks());
String leaveStatus = onDutyViewArrayList.get(position).getTourStatus();
if(leaveStatus.equals("") || leaveStatus.equalsIgnoreCase("0")){
holder.tourStatus.setText("Pending");
}
else if(leaveStatus.equals("1")){
holder.tourStatus.setText("Rejected");
}
else if(leaveStatus.equals("2")){
holder.tourStatus.setText("Reporting A");
}
else if(leaveStatus.equals("3")){
holder.tourStatus.setText("Rejected");
}
else if(leaveStatus.equals("4")){
holder.tourStatus.setText("Final Approved");
}
else {
holder.tourStatus.setText(onDutyViewArrayList.get(position).getTourStatus());
}
}
@Override
public int getItemCount() {
return onDutyViewArrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
TextView from , remark , tourStatus ;
public ViewHolder(View itemView) {
super(itemView);
from = (TextView) itemView.findViewById(R.id.txtFromDays);
remark = (TextView) itemView.findViewById(R.id.txtType);
tourStatus = (TextView) itemView.findViewById(R.id.txtHr);
}
}
}
| [
"[email protected]"
]
| |
d985baf3f2f0e586ca36abb724379437bc05ec40 | 17dc13fb5940da1a467dde770fdb78a60963eda7 | /src/test/java/com/example/app/DemoApplicationTests.java | bbd9085a96f635ad19bb9c391605f4e837540693 | []
| no_license | virat02/Netflix-Recommendation-System-JPA-Server | e8aa3551dc9eff1b9b4b8e121b9fb893765e3bd8 | 8fca3bfeef1b9ef671b842b1aa02fb98a9a4ce71 | refs/heads/master | 2022-06-23T01:20:30.294559 | 2019-07-07T16:38:35 | 2019-07-07T16:38:35 | 195,601,685 | 1 | 1 | null | 2022-06-21T01:25:04 | 2019-07-07T02:31:23 | Java | UTF-8 | Java | false | false | 330 | java | package com.example.app;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
]
| |
b2cc7fa9346f2b1b6c0cee2a5a1707aa5e776908 | d4fdd992ad06363f095b39f93ec7a91445b497a1 | /app/src/main/java/gibran/com/br/movie_db_consumer/helpers/ObserverHelper.java | 8bdb918111158469488a9d65f26e84045bd294b4 | []
| no_license | GibranLyra/movie_db_consumer | 424ec990de5e0c79f997b48e385931e2095fe087 | 7eb98ca294d3d01ef73b6d82b2134d49fe13d69c | refs/heads/master | 2021-05-03T22:07:35.370123 | 2018-02-06T16:27:13 | 2018-02-06T16:27:13 | 120,386,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package gibran.com.br.movie_db_consumer.helpers;
import io.reactivex.disposables.Disposable;
/**
* Created by gibran.lyra on 22/02/2016.
*/
public class ObserverHelper {
public static void safelyDispose(Disposable... disposables) {
for (Disposable subscription : disposables) {
if (subscription != null && !subscription.isDisposed()) {
subscription.dispose();
}
}
}
}
| [
"[email protected]"
]
| |
a1a4400dc4f2328768b6a779925eed12200acc32 | 421c27c49348594b8a8ddd009d4df31d51aacf32 | /src/main/java/com/appavoc/controller/CustomerController.java | d1c0f9714055f171e615f8457924f95a8678e949 | []
| no_license | babs105/projetj | 201e62ba3887130277bc70263aceb4a8499cb277 | a965b99bbcfdf078e70d792f71dddd95146ef5c1 | refs/heads/master | 2020-09-29T22:23:47.171855 | 2019-12-10T13:10:24 | 2019-12-10T13:10:24 | 227,136,215 | 0 | 0 | null | 2020-09-09T19:19:40 | 2019-12-10T14:07:40 | Java | UTF-8 | Java | false | false | 3,407 | java | /**
* *
o * Copyright (c) 2019 KhydmaShore Solutions Inc.
o *
o * All rights reserved.
o *
o *****************************************************************************
*/
/**
* @author ZEYNAB
*
*/
package com.appavoc.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.appavoc.model.Customer;
import com.appavoc.service.CustomerService;
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/customer")
public class CustomerController {
@Autowired
private CustomerService customerService;
@RequestMapping(value = "/create", method = {RequestMethod.POST, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
//@Secured ({"Role_Lawyer"})
public Customer createOrUpdateCustomer(@RequestBody Customer customer) {
return customerService.createOrUpdateCustomer(customer);
}
@RequestMapping(value = "/getCustomer/{customerNumber}", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public Customer getCustomerByCustomerNumber(@PathVariable long customerNumber) {
return customerService.getCustomerByCustomerNumber(customerNumber);
}
@RequestMapping(value = "/delete/{customerNumber}", method = {RequestMethod.DELETE, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
//@Secured ({"Role_Lawyer"})
public void deleteCustomer(@PathVariable long customerNumber) {
customerService.deleteCustomer(customerNumber);
}
@RequestMapping(value = "/getAllCustomer", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public List<Customer> getAllCustomer() {
return customerService.getAllCustomer();
}
@RequestMapping(value = "/getMostActive", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public List<Customer> getMostActiveCustomer() {
return customerService.getMostActiveCustomer();
}
@RequestMapping(value = "/getCustomerByOffice/{officeNumber}", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public List<Customer> getCustomersOfOffice(@PathVariable long officeNumber) {
return customerService.getCustomersOfOffice(officeNumber);
}
@RequestMapping(value = "/search/{critere}", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public List<Customer> searchCustomer(@PathVariable String critere) {
return customerService.searchCustomerByName(critere);
}
@RequestMapping(value = "/getCustomerOf/{critere}", method = {RequestMethod.GET, RequestMethod.OPTIONS }, produces = "application/json")
@ResponseBody
public List<Customer> getCustomerByCritere(@PathVariable String critere,@RequestBody List<Customer> customers) {
return customerService.getfilter(critere, customers);
}
}
| [
"[email protected]"
]
| |
db28e887087eb6af5ebab52b4f1d7f9edd71ab59 | 3fe2578f719f5758a70d42dc06f29a739578db5f | /marketbillmanager/src/club/banyuan/service/ProviderService.java | 6163087cdcdcd2a0ebaaf33080662f277ae05588 | []
| no_license | foreverym/studydemo | e4a18c86a9c64481f22329e176c1f91504a83ace | 7d4d61ebf0bd802965e0ea006873c0d42aeab9bd | refs/heads/master | 2022-12-31T02:18:16.030448 | 2020-10-23T07:03:21 | 2020-10-23T07:03:21 | 297,961,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,178 | java | package club.banyuan.service;
import club.banyuan.util.PropUtil;
import club.banyuan.entity.Bill;
import club.banyuan.entity.Provider;
import com.alibaba.fastjson.JSONObject;
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
public class ProviderService {
private static int countId = 1;
private static List<Provider> providerList = new ArrayList<>();
public int getCountId() {
return countId;
}
public void setCountId(int countId) {
ProviderService.countId = countId;
}
public List<Provider> getProviderList() {
return providerList;
}
public void setProviderList(List<Provider> providerList) {
ProviderService.providerList = providerList;
}
static {
load();
}
/**
* 加载json文件
*/
public static void load() {
Properties properties = new Properties();
InputStream resourceAsStream = ProviderService.class.getResourceAsStream("/app.properties");
try {
properties.load(resourceAsStream);
String path = (String) properties.get("provider.store.path");
InputStream inputStream = new FileInputStream(path);
byte[] bytes = inputStream.readAllBytes();
String providerJsonStr = new String(bytes);
ProviderService providerService = JSONObject.parseObject(providerJsonStr, ProviderService.class);
if (providerService == null) {
providerService = new ProviderService();
} else {
providerList = providerService.getProviderList();
countId = providerService.getCountId();
}
} catch (IOException e) {
List<ProviderService> providerServiceList = new ArrayList<>();
e.printStackTrace();
}
}
/**
* 保存供应商列表
*/
public void save() {
String jsonString = JSONObject.toJSONString(this);
String path = PropUtil.getProp("provider.store.path");
try (OutputStream outputStream = new FileOutputStream(path)) {
outputStream.write(jsonString.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 添加一个供应商
*
* @param provider
*/
public void addProvider(Provider provider) {
validateAddProvider(provider);
provider.setId(countId++);
providerList.add(provider);
save();
}
/**
* 更新供应商信息
*
* @param provider
*/
public void updateProvider(Provider provider) {
for (Provider one : providerList) {
if (provider.getId() == one.getId()) {
one.setName(provider.getName());
one.setDesc(provider.getDesc());
one.setContactPerson(provider.getContactPerson());
one.setPhone(provider.getPhone());
save();
}
}
}
/**
* 获取用户列表
*/
public List<Provider> getListProvider(Provider provider) {
if (provider == null) {
return providerList;
}
String desc = provider.getDesc();
String name = provider.getName();
/**
* 判断desc为空的条件
*/
if (desc == null || desc.length() == 0) {
if (desc == null || name.length() == 0) {
return providerList;
} else {
List<Provider> result = new ArrayList<>();
for (Provider one : providerList) {
if (one.getName().contains(provider.getName().trim())) {
result.add(one);
}
}
return result;
}
}
/**
* 判断name为空的条件
*/
if (name == null || name.length() == 0) {
if (desc == null || desc.length() == 0) {
return providerList;
} else {
List<Provider> result = new ArrayList<>();
result = providerList.stream().filter(one -> one.getDesc().contains(provider.getDesc().trim())).collect(Collectors.toList());
return result;
}
} else {
List<Provider> result = providerList.stream().filter(one -> one.getDesc().contains(provider.getDesc().trim())
&& one.getName().contains(provider.getName().trim())).collect(Collectors.toList());
return result;
}
}
/**
* 查询用户信息
*/
public Provider getProviderInfo(Provider provider) {
for (Provider one : providerList) {
if (one.getId() == provider.getId()) {
return one;
}
}
return null;
}
/**
* 删除供应商信息
*/
public void deleteProvider(Provider provider) {
//先获取账单列表,看是否包含该供应商id
BillService billService = new BillService();
List<Bill> billList = billService.getBillList();
int id = provider.getId();
boolean flag = false;
for (Bill bill : billList) {
if (bill.getProviderId() == provider.getId()) {
flag = true;
}
}
if (flag == false) {
Iterator<Provider> iterator = providerList.iterator();
while (iterator.hasNext()) {
Provider next = iterator.next();
if (next.getId() == id) {
iterator.remove();
}
}
}
}
/**
* 校验添加的数据是否合法
*/
public void validateAddProvider(Provider provider) {
}
public static void main(String[] args) {
Provider provider = new Provider(1, "ssss", "ss", "", "");
ProviderService userService = new ProviderService();
userService.providerList.add(provider);
String s = JSONObject.toJSONString(userService);
System.out.println(s);
}
}
| [
"[email protected]"
]
| |
902ee6a329f8bc9c6c2316edece4335e94ede44c | ccc18a33adfc4b9a2b0270517cd113c328b744fd | /src/main/java/com/benjamin/websocket/router/WebSocketRouterFactoryBean.java | 873dc9251459edb43dfe032fa772da47521c6cc2 | []
| no_license | jiyuefeng/websocket-cluster-support | 80cca9416018bad4e708339386a6bbf7ed1aa3dd | 09cb29eebbf4898dc80a8d47c212ebabbdf286d7 | refs/heads/master | 2021-01-17T15:05:52.310541 | 2015-12-08T11:15:01 | 2015-12-08T11:15:01 | 63,294,051 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,692 | java | package com.benjamin.websocket.router;
import com.benjamin.websocket.router.impl.HttpWebSocketRouter;
import com.benjamin.websocket.router.impl.TcpWebSocketRouter;
import com.benjamin.websocket.router.impl.UdpWebSocketRouter;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.web.context.ServletContextAware;
import javax.servlet.ServletContext;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.List;
/**
* Created by benjamin on 11/19/14.
*/
public class WebSocketRouterFactoryBean implements FactoryBean<WebSocketRouter>, ServletContextAware {
private static final String HTTP ="http";
private static final String TCP = "tcp";
private static final String UDP = "udp";
private ServletContext servletContext;
private List<Collection> cluster;
private String protocol = "HTTP";
public List<Collection> getCluster() {
return cluster;
}
public void setCluster(List<Collection> cluster) {
this.cluster = cluster;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
@Override
public WebSocketRouter getObject() throws Exception {
return WebSocketRouterFactory.getInstance(protocol);
}
@Override
public Class<?> getObjectType() {
Type type= this.getClass().getGenericInterfaces()[0];
Type[] params = ((ParameterizedType) type).getActualTypeArguments();
return (Class) params[0];
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
((AbstractWebSocketRouter) WebSocketRouterFactory.httpWebSocketRouter).setServletContext(servletContext);
((AbstractWebSocketRouter) WebSocketRouterFactory.tcpWebSocketRouter).setServletContext(servletContext);
((AbstractWebSocketRouter) WebSocketRouterFactory.udpWebSocketRouter).setServletContext(servletContext);
}
private static final class WebSocketRouterFactory {
private static WebSocketRouter httpWebSocketRouter = new HttpWebSocketRouter();
private static WebSocketRouter tcpWebSocketRouter = new TcpWebSocketRouter();
private static WebSocketRouter udpWebSocketRouter = new UdpWebSocketRouter();
public static WebSocketRouter getInstance(String type){
if(HTTP.equals(type)){
return httpWebSocketRouter;
}else if(TCP.equals(type)){
return tcpWebSocketRouter;
}else if(UDP.equals(type)){
return udpWebSocketRouter;
}else{
return httpWebSocketRouter;
}
}
}
}
| [
"[email protected]"
]
| |
d37a19ce7bfd14554a2ec1c0f6fdac577f21507f | 088242f5083ad805afe50c71b0e1e6ca3a9b0876 | /starter-code/ShoppingListWithDetailView/app/src/main/java/ly/generalassemb/drewmahrt/shoppinglistwithdetailview/DetailActivity.java | 1e6c818429a6ac8395577ede94650f19eb4cec04 | []
| no_license | mrtmmn/detail-view-lab | 00077c4db662c7152efd001e16ae934f66585f29 | f8828da8e389fbe86888e3ad62c125805fac9ffe | refs/heads/master | 2021-01-18T17:50:07.604201 | 2016-02-03T22:22:59 | 2016-02-03T22:22:59 | 51,029,568 | 0 | 0 | null | 2016-02-03T20:48:54 | 2016-02-03T20:48:53 | Java | UTF-8 | Java | false | false | 1,081 | java | package ly.generalassemb.drewmahrt.shoppinglistwithdetailview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class DetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
int id = getIntent().getIntExtra("id",-1);
if (id >= 0){
String [] description = ShoppingSQLiteOpenHelper.getmInstance(DetailActivity.this).getDescriptionById(id);
TextView textView = (TextView) findViewById(R.id.name);
textView.setText(description[0]);
TextView textView2 = (TextView) findViewById(R.id.price);
textView2.setText(description[1]);
TextView textView3 = (TextView) findViewById(R.id.type);
textView3.setText(description[2]);
TextView textView4 = (TextView) findViewById(R.id.description);
textView4.setText(description[3]);
}
}
}
| [
"[email protected]"
]
| |
876d7281726287cc342a947926516692257576c2 | a1f9a577a070edf26a788f441e76ec515040f491 | /LargestValueFromLables.java | 6560327f5cfab0ab9bf247945be67903b507dad4 | []
| no_license | kannan-mrugapphan/Greedy-Algorithms | 22079ccfa3a1302afaa3f2c2b7de4e70325d96c0 | f99c17f1977b875a509d558eade2797dd8019400 | refs/heads/master | 2021-07-25T05:26:24.081002 | 2020-07-07T17:54:00 | 2020-07-07T17:54:00 | 196,783,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,019 | java | // 1090.
class Pair {
int value;
int label;
public Pair(int value, int label) {
this.label = label;
this.value = value;
}
}
//time - O(n logn)
//space - O(n)
class Solution {
public int largestValsFromLabels(int[] values, int[] labels, int num_wanted, int use_limit) {
//brute force - find all subsequences of length num_wanted, validate each sub sequence - time - O(2^n)
//greedily pick the item with largest value and check if the label constraint is maintained using a map
PriorityQueue<Pair> maxHeap = new PriorityQueue<>((a, b) -> b.value - a.value); //max heap of items based on values of items
for(int i = 0; i < values.length; i++)
{
maxHeap.offer(new Pair(values[i], labels[i]));
}
HashMap<Integer, Integer> labelCounts = new HashMap<>(); //map maintains counts of labels of items picked so far
int maxValue = 0; //return val
while(maxHeap.size() > 0)
{
if(num_wanted == 0)
{
break; //cant select more items
}
Pair item = maxHeap.poll(); //remove the item with largest value
//if the current item's label is not used as many times as use_limit
if(!labelCounts.containsKey(item.label) || labelCounts.get(item.label) < use_limit)
{
maxValue += item.value; //add the value gained to result
num_wanted--; //reduce number wanted by 1
//update the label counts
if(labelCounts.containsKey(item.label))
{
labelCounts.put(item.label, labelCounts.get(item.label) + 1);
}
else
{
labelCounts.put(item.label, 1);
}
}
//else item cant be used
}
return maxValue;
}
}
| [
"[email protected]"
]
| |
3b761ab25e5fcc6fd26b76e15d6ae8f88291005d | 82ea0ec30a8e45a53ea1d366c32c5393fa11dcfa | /app/src/main/java/com/crtf/weather/data/pojo/colorfulclouds/response/Description.java | e8fe485819b2880fb5168c1bb826d9be4ed6ae42 | []
| no_license | RedEarListeningWind/weather | 0b5c38eacd17fb26c9b72026e6d25f0a12ab3057 | f91f62ad5c5ae720e3019615851daddd737c32df | refs/heads/main | 2023-05-05T21:57:42.189293 | 2021-05-17T15:27:10 | 2021-05-17T15:27:10 | 368,192,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package com.crtf.weather.data.pojo.colorfulclouds.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;
/**
* 实时预报自然语言描述
* @author crtf
*/
@Data
public class Description{
@JsonProperty("usa")
private String usa;
@JsonProperty("chn")
private String chn;
} | [
"[email protected]"
]
| |
b487129d934fb828b32a1d775c93c3b4da914cc7 | d2f810efbf145ea3e8b5925a7b5e90419477b586 | /src/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java | 702d3209872ad8ca01600878967b58665656b155 | []
| no_license | nullexthecodegod/Stealth | 7505536594fda0a577a3406b3ed89b75857dc2be | 334edcd2fc0f2fbda88b8845adb9c1a2f17023dd | refs/heads/master | 2021-05-14T18:15:11.746357 | 2018-01-11T04:32:51 | 2018-01-11T04:32:51 | 116,067,644 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,739 | java | package net.minecraft.client.renderer.entity.layers;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelIronGolem;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderIronGolem;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.init.Blocks;
public class LayerIronGolemFlower implements LayerRenderer
{
private final RenderIronGolem ironGolemRenderer;
public LayerIronGolemFlower(RenderIronGolem ironGolemRendererIn)
{
this.ironGolemRenderer = ironGolemRendererIn;
}
public void func_177153_a(EntityIronGolem ironGolem, float p_177153_2_, float p_177153_3_, float p_177153_4_, float p_177153_5_, float p_177153_6_, float p_177153_7_, float p_177153_8_)
{
if (ironGolem.getHoldRoseTick() != 0)
{
BlockRendererDispatcher var9 = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-0.9375F, -0.625F, -0.9375F);
float var10 = 0.5F;
GlStateManager.scale(var10, -var10, var10);
int var11 = ironGolem.getBrightnessForRender(p_177153_4_);
int var12 = var11 % 65536;
int var13 = var11 / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var12 / 1.0F, (float)var13 / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.ironGolemRenderer.bindTexture(TextureMap.locationBlocksTexture);
var9.renderBlockBrightness(Blocks.red_flower.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
public boolean shouldCombineTextures()
{
return false;
}
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
this.func_177153_a((EntityIronGolem)entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale);
}
}
| [
"NullEX@Offset#6604"
]
| NullEX@Offset#6604 |
44e7917f17bb9d72ea875fa6ca7ce4487827f3e7 | 717228e9d33f1917c765b4e950f98fa6c468b30d | /src/com/bakarapp/beeppopup/DynamicHeightImageView.java | 4b74476a900b10a047b75728d6992ee2e8b18a48 | []
| no_license | arpit87/BBD | 569c052bc6a76471efa8575ed9399faf2b76fb18 | 851fd5ba2f755426f36f95922ff821c577c1a262 | refs/heads/master | 2020-05-16T22:12:35.476660 | 2014-11-27T09:10:00 | 2014-11-27T09:10:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,208 | java | package com.bakarapp.beeppopup;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* An {@link android.widget.ImageView} layout that maintains a consistent width to height aspect ratio.
*/
public class DynamicHeightImageView extends ImageView {
private double mHeightRatio;
public DynamicHeightImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public DynamicHeightImageView(Context context) {
super(context);
}
public void setHeightRatio(double ratio) {
if (ratio != mHeightRatio) {
mHeightRatio = ratio;
requestLayout();
}
}
public double getHeightRatio() {
return mHeightRatio;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mHeightRatio > 0.0) {
// set the image views size
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = (int) (width * mHeightRatio);
setMeasuredDimension(width, height);
}
else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
}
| [
"[email protected]"
]
| |
1210b3c6ec0c392492c5a639de93f67dc0912a60 | 78c9ab877617a8e7e96be859dc51bf0ee06db3af | /src/main/java/com/jcoder/JUC/bingfa/chapter2/ThreadGoupName.java | fc62817bd7b79371e1ca1a11b10fd62b649232c3 | []
| no_license | Egbert8527/JUC | a00971e8b7be88ce42c6e2b48e3ff136df965844 | c2a77a84b73aaa5da87addb246aa05e24a3dd1b5 | refs/heads/master | 2020-05-19T12:00:12.738647 | 2019-07-27T02:13:19 | 2019-07-27T02:13:19 | 185,005,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.jcoder.JUC.bingfa.chapter2;
public class ThreadGoupName implements Runnable{
@Override
public void run() {
}
public static void main(String[] args) {
ThreadGroup tg = new ThreadGroup("PrintGroup");
Thread t1 = new Thread();
}
}
| [
"[email protected]"
]
| |
e38998e132d6df9cce4bc9481d6526596910b198 | 281ef14aeb8a64713f33df4c7bf5ebf04070dd6c | /app/src/main/java/com/support/design/fragment/CustomPagerAdapter.java | 724ceb3d3dc6ce03f99ee327fbec98266d858f80 | [
"Apache-2.0"
]
| permissive | ChoicesWang/DesignDemo | 37526858f2c5f1433ccaa07cef3d69be8ab3f669 | 5a21843f6d89c86d1e682f4c2465c5378b0c8b6c | refs/heads/master | 2021-05-04T09:49:11.304549 | 2016-08-31T05:53:08 | 2016-08-31T05:53:08 | 36,725,496 | 48 | 7 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package com.support.design.fragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* FragmentPagerAdapter
* Created by Administrator on 2015/6/12.
*/
public class CustomPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragments = new ArrayList<>();
private final List<String> mFragmentTitles = new ArrayList<>();
public CustomPagerAdapter(FragmentManager fm) {
super(fm);
}
public void addFragment(Fragment fragment, String title) {
mFragments.add(fragment);
mFragmentTitles.add(title);
}
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitles.get(position);
}
}
| [
"[email protected]"
]
| |
b07e6ce068d63e1b0edbc52a3debe9dc78e6ce0f | 55655da08dc81d2d9cc8360d8030516a832d9578 | /Assignment4/src/AccountOverdrawDemo.java | dc39a9734f2d1f34672d3ee2081593851cc0c399 | []
| no_license | anumshka/Java_Assignments | 2ac6c26b6337e8d777cfc5bcb39650d313e1671e | 90d18ac110fe3c1ccdc30d9024e9b0de8b743109 | refs/heads/master | 2023-07-05T03:45:18.977678 | 2021-08-26T08:56:53 | 2021-08-26T08:56:53 | 385,401,580 | 0 | 0 | null | 2021-08-03T21:56:22 | 2021-07-12T22:37:04 | null | UTF-8 | Java | false | false | 2,073 | java | public class AccountOverdrawDemo implements Runnable {
private Account account = new Account();
public static void main(String[] args) {
AccountOverdrawDemo job = new AccountOverdrawDemo();
//Making a job
Thread first = new Thread(job);
Thread second = new Thread(job);
//Making two threads and giving each of them the same job
first.setName("Rachel");
second.setName("Ross");
//Starting the threads
first.start();
second.start();
}
@Override
public void run() {
//The while loop runs 5 times
//Each iteration makes a withdrawl of 200
int times = 5;
while (times > 0) {
makeWihdrawal(200);
//Checks the balance and indicates Overdrawn!! if overdrawn
if (account.getBalance() < 0) {
System.out.println("Overdrawn!!");
}
times--;
}
}
private void makeWihdrawal(int amount) {
System.out.println("Current Balance: " + account.getBalance());
if (account.getBalance() >= amount) {
System.out.println(Thread.currentThread().getName() + " is going to withdraw the money");
System.out.println(Thread.currentThread().getName() + " is going to sleep");
//Thread sleeps here for 5000 milliseconds
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//Thread resumes
System.out.println(Thread.currentThread().getName() + " woke up");
//Amount gets withdrawn
account.withdraw(amount);
//The withdrawl action gets completed here
System.out.println(Thread.currentThread().getName() + " completes the withdrawl");
}
// if the person does not have that much money
else {
System.out.println("Sorry " + Thread.currentThread().getName() + ",You do not have that much money");
}
}
}
| [
"[email protected]"
]
| |
f3dedd3d574c325f7c0d942c31daddaa466809c1 | 0b53312de059e822bd48ea2329e11070bad75103 | /cps/src/main/java/com/jdcloud/sdk/service/cps/model/DescribeLoadBalancerRequest.java | e38815a395e783198b6cd10b2701b3eb6369632e | [
"Apache-2.0"
]
| permissive | 304840508/jdcloud-sdk-java | 33b9cf2a5a0c4b507f8b87607c0e588b19c43ef3 | b0f158123a2d90bb01fa5647a1a33561d008a1ed | refs/heads/master | 2023-01-21T10:59:41.990964 | 2020-12-03T09:08:46 | 2020-12-03T09:08:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,737 | java | /*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* 云物理服务器
* 云物理服务器负载均衡实例操作相关的接口
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
package com.jdcloud.sdk.service.cps.model;
import com.jdcloud.sdk.annotation.Required;
import com.jdcloud.sdk.service.JdcloudRequest;
/**
* 查询负载均衡实例详情
*/
public class DescribeLoadBalancerRequest extends JdcloudRequest implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域
* Required:true
*/
@Required
private String regionId;
/**
* 负载均衡实例ID
* Required:true
*/
@Required
private String loadBalancerId;
/**
* get 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域
*
* @return
*/
public String getRegionId() {
return regionId;
}
/**
* set 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域
*
* @param regionId
*/
public void setRegionId(String regionId) {
this.regionId = regionId;
}
/**
* get 负载均衡实例ID
*
* @return
*/
public String getLoadBalancerId() {
return loadBalancerId;
}
/**
* set 负载均衡实例ID
*
* @param loadBalancerId
*/
public void setLoadBalancerId(String loadBalancerId) {
this.loadBalancerId = loadBalancerId;
}
/**
* set 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域
*
* @param regionId
*/
public DescribeLoadBalancerRequest regionId(String regionId) {
this.regionId = regionId;
return this;
}
/**
* set 负载均衡实例ID
*
* @param loadBalancerId
*/
public DescribeLoadBalancerRequest loadBalancerId(String loadBalancerId) {
this.loadBalancerId = loadBalancerId;
return this;
}
} | [
"[email protected]"
]
| |
401e9786a8728a7524a22133773e68f85cfd24e7 | 72b6fcaed9a47242b04bcb1c2bce6cf7d87632c5 | /PointI.java | f1d4e9c92a3a130816cdaf61c59d9be47bd0e5a3 | []
| no_license | StanBarbeau/KdTree | 39d2e7d82411f12274fb899795b67064641dba90 | cb4e08061537916ea296476be62a2ad4d2e25416 | refs/heads/master | 2021-01-13T13:19:23.563647 | 2016-11-17T13:53:51 | 2016-11-17T13:53:51 | 72,938,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package kdtree;
public abstract class PointI
{
protected int v[];
public int get(int i) {
return v[i];
}
protected void set(int t[]){
this.v = t;
}
public void add(PointI p) {
for(int i=0;i<v.length; ++i) {
v[i] += p.v[i];
}
}
public void div(int d) {
for(int i=0;i<v.length; ++i) {
v[i] /= d;
}
}
public int sqrDist(PointI p) {
int res = 0;
for(int i=0;i<v.length; ++i) {
res += (v[i]-p.v[i])*(v[i]-p.v[i]);
}
return res;
}
public boolean equals(PointI p) {
for(int i=0;i<v.length; ++i) {
if(v[i]!=p.v[i]) return false;
}
return true;
}
int[] cloneValues() {
return v.clone();
}
// this method should be static but that's not possible in Java...
public abstract PointI zero();
}
| [
"[email protected]"
]
| |
a3d4e4e1e28661da86df42f6b24a5d8100b8628f | 2a0101a4aa592b941f084b2e4fb4cf3e2a6b5037 | /APIAIAPP/app/src/main/java/com/ag/apiaiapp/ShopsActivity.java | d52325806588e8ab7a0e9b91c2e1371431d62aad | []
| no_license | Amar0123/SMA | 01816610ec49e4ea94f096bab5c5d5d5adacea4f | 3303bc3ac9186344174d26d76376c97335cd1ca2 | refs/heads/master | 2021-04-15T15:56:55.657161 | 2018-03-27T01:40:07 | 2018-03-27T01:40:07 | 126,907,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,569 | java | package com.ag.apiaiapp;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.google.firebase.FirebaseApp;
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;
public class ShopsActivity extends AppCompatActivity {
private ProgressDialog mRegProgress;
List<Data> datas;
ListView lv;
DatabaseReference ref;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shops);
mRegProgress = new ProgressDialog(this);
datas = new ArrayList<>();
lv = (ListView)findViewById(R.id.lv);
final String productType = getIntent().getStringExtra("productType").toLowerCase();
String mallName = getIntent().getStringExtra("mallName").toLowerCase();
// Get a reference to our posts
FirebaseApp.initializeApp(this);
final FirebaseDatabase database = FirebaseDatabase.getInstance();
ref = database.getReference("SMA/"+ mallName +"/Shops/");
mRegProgress.setTitle("Retrieving Shops");
mRegProgress.setCanceledOnTouchOutside(false);
mRegProgress.show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
mRegProgress.dismiss();
ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
datas.clear();
for (DataSnapshot ss : dataSnapshot.getChildren()){
if(ss.child("tag").getValue().toString().toLowerCase().contains(productType.toString())){
Data d = ss.getValue(Data.class);
datas.add(d);
}
}
if(datas.size() == 0){
Toast.makeText(ShopsActivity.this, "No shops found", Toast.LENGTH_SHORT).show();
}else{
}
ShopCustomAdapter artistAdapter = new ShopCustomAdapter(ShopsActivity.this, datas);
//attaching adapter to the listview
lv.setAdapter(artistAdapter);
}
@Override
public void onCancelled(DatabaseError databaseError) {
System.out.println("The read failed: " + databaseError.getCode());
}
});
}
}, 2000);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(datas.get(position).getShoplink()));
startActivity(browserIntent);
}
});
}
}
| [
"[email protected]"
]
| |
a23304f3839dbdbeb74d056a71b8390a3b31e6af | a53425526520ee7c44c81bed7cb547cf916000ad | /src/main/java/br/com/example/domain/product/query/ProductQuery.java | fb877e08553c61a2a3fcaa55365b991ad6ae3a9a | []
| no_license | eutiagocosta/hexagonal-architecture | 650fd4529c71376b9d3cf459ddce251a6d317b2f | b2763f48f75ebbffbd076a1abd03b4b126ad7251 | refs/heads/master | 2021-07-14T20:32:21.875301 | 2017-10-17T19:16:32 | 2017-10-17T19:16:32 | 105,782,670 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | package br.com.example.domain.product.query;
import java.math.BigDecimal;
public class ProductQuery {
private String productId;
private String name;
private String description;
private BigDecimal amount;
private boolean reserved;
public ProductQuery(String productId, String name, String description, BigDecimal amount, boolean reserved) {
setProductId(productId);
setName(name);
setDescription(description);
setAmount(amount);
setReserved(reserved);
};
@SuppressWarnings("unused")
private ProductQuery() {}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public boolean isReserved() {
return reserved;
}
public void setReserved(boolean reserved) {
this.reserved = reserved;
}
}
| [
"[email protected]"
]
| |
84b5c3888c9e0d61cc7eb5e8cc537817372511b3 | b53762d7eeeecc226987c8b118839f7f4fbd56d4 | /app/src/main/java/com/sunway/lakala/view/MyList.java | 58f7155473e9058d870637f7200b17bc8ebfe016 | []
| no_license | 15000712803peng/sunway_android_lakala | b1457ec98266ffb1624378daf7f6350ecaee7c1c | 140284b56c603f573950e81b02f44d1e4beb136d | refs/heads/master | 2021-01-12T10:47:25.350287 | 2016-12-12T03:27:11 | 2016-12-12T03:27:11 | 72,696,597 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 813 | java | package com.sunway.lakala.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;
public class MyList extends ListView{
public MyList(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyList(Context context) {
super(context);
}
public MyList(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
// Log.d(TAG, "on touch event");
return super.onTouchEvent(ev);
}
}
| [
"[email protected]"
]
| |
5987565eb9a28b5a0b0d68a76bf8acbaed1f7070 | 14c53a0c6be0faaacddc671463e62509b676fbb7 | /apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.java | 9b68db19c06923a3b5a67f889c42e63b409570af | [
"Apache-2.0"
]
| permissive | goodwink/jclouds | a2dd9ea9c2e42e8ee201857653cf8b3208cd7de2 | 029f15f36031748ad913bdee16c8f12c101da16a | refs/heads/master | 2021-01-18T08:06:32.500885 | 2011-05-18T18:16:36 | 2011-05-18T18:16:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,552 | java | /**
*
* Copyright (C) 2011 Cloud Conscious, LLC. <[email protected]>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.vcloud.compute.strategy;
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.processorCount;
import java.net.URI;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.Template;
import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.compute.strategy.CreateNodeWithGroupEncodedIntoName;
import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
import org.jclouds.logging.Logger;
import org.jclouds.vcloud.VCloudClient;
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
import org.jclouds.vcloud.domain.GuestCustomizationSection;
import org.jclouds.vcloud.domain.NetworkConnection;
import org.jclouds.vcloud.domain.NetworkConnectionSection;
import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;
import org.jclouds.vcloud.domain.Task;
import org.jclouds.vcloud.domain.VApp;
import org.jclouds.vcloud.domain.Vm;
import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;
import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
/**
* @author Adrian Cole
*/
@Singleton
public class InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn implements
CreateNodeWithGroupEncodedIntoName {
@Resource
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
protected Logger logger = Logger.NULL;
protected final VCloudClient client;
protected final GetNodeMetadataStrategy getNode;
protected final Predicate<URI> successTester;
@Inject
protected InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn(Predicate<URI> successTester,
VCloudClient client, GetNodeMetadataStrategy getNode) {
this.client = client;
this.successTester = successTester;
this.getNode = getNode;
}
@Override
public NodeMetadata createNodeWithGroupEncodedIntoName(String tag, String name, Template template) {
InstantiateVAppTemplateOptions options = processorCount((int) getCores(template.getHardware())).memory(
template.getHardware().getRam()).disk(
(long) ((template.getHardware().getVolumes().get(0).getSize()) * 1024 * 1024l));
String customizationScript = null;
IpAddressAllocationMode ipAddressAllocationMode = null;
if (template.getOptions() instanceof VCloudTemplateOptions) {
customizationScript = VCloudTemplateOptions.class.cast(template.getOptions()).getCustomizationScript();
ipAddressAllocationMode = VCloudTemplateOptions.class.cast(template.getOptions()).getIpAddressAllocationMode();
if (customizationScript != null || ipAddressAllocationMode != null) {
options.customizeOnInstantiate(false);
options.deploy(false);
options.powerOn(false);
}
}
if (!template.getOptions().shouldBlockUntilRunning())
options.block(false);
URI VDC = URI.create(template.getLocation().getId());
URI templateId = URI.create(template.getImage().getId());
logger.debug(">> instantiating vApp vDC(%s) template(%s) name(%s) options(%s) ", VDC, templateId, name, options);
VApp vAppResponse = client.instantiateVAppTemplateInVDC(VDC, templateId, name, options);
logger.debug("<< instantiated VApp(%s)", vAppResponse.getName());
Task task = vAppResponse.getTasks().get(0);
if (customizationScript == null && ipAddressAllocationMode == null) {
return blockOnDeployAndPowerOnIfConfigured(options, vAppResponse, task);
} else {
if (!successTester.apply(task.getHref())) {
throw new RuntimeException(
String.format("failed to %s %s: %s", "instantiate", vAppResponse.getName(), task));
}
Vm vm = Iterables.get(client.getVApp(vAppResponse.getHref()).getChildren(), 0);
if (customizationScript != null)
updateVmWithCustomizationScript(vm, customizationScript);
if (ipAddressAllocationMode != null)
updateVmWithIpAddressAllocationMode(vm, ipAddressAllocationMode);
task = client.deployAndPowerOnVAppOrVm(vAppResponse.getHref());
return blockOnDeployAndPowerOnIfConfigured(options, vAppResponse, task);
}
}
public void updateVmWithCustomizationScript(Vm vm, String customizationScript) {
Task task;
GuestCustomizationSection guestConfiguration = vm.getGuestCustomizationSection();
// TODO: determine if the server version is beyond 1.0.0, and if so append to, but
// not overwrite the customization script. In version 1.0.0, the api returns a script that
// loses newlines.
guestConfiguration.setCustomizationScript(customizationScript);
task = client.updateGuestCustomizationOfVm(vm.getHref(), guestConfiguration);
if (!successTester.apply(task.getHref())) {
throw new RuntimeException(String.format("failed to %s %s: %s", "updateGuestCustomizationOfVm", vm.getName(),
task));
}
}
public void updateVmWithIpAddressAllocationMode(Vm vm, final IpAddressAllocationMode ipAddressAllocationMode) {
Task task;
NetworkConnectionSection net = vm.getNetworkConnectionSection();
Builder builder = net.toBuilder();
builder.connections(Iterables.transform(net.getConnections(),
new Function<NetworkConnection, NetworkConnection>() {
@Override
public NetworkConnection apply(NetworkConnection arg0) {
return arg0.toBuilder().connected(true).ipAddressAllocationMode(ipAddressAllocationMode).build();
}
}));
task = client.updateNetworkConnectionOfVm(vm.getHref(), builder.build());
if (!successTester.apply(task.getHref())) {
throw new RuntimeException(String.format("failed to %s %s: %s", "updateNetworkConnectionOfVm", vm.getName(),
task));
}
}
private NodeMetadata blockOnDeployAndPowerOnIfConfigured(InstantiateVAppTemplateOptions options, VApp vAppResponse,
Task task) {
if (options.shouldBlock()) {
if (!successTester.apply(task.getHref())) {
throw new RuntimeException(String.format("failed to %s %s: %s", "deploy and power on",
vAppResponse.getName(), task));
}
logger.debug("<< ready vApp(%s)", vAppResponse.getName());
}
return getNode.getNode(vAppResponse.getHref().toASCIIString());
}
} | [
"[email protected]"
]
| |
b5273ad80f67aa4a8c11cc638cef7f247418a3c3 | 471a1d9598d792c18392ca1485bbb3b29d1165c5 | /jadx-MFP/src/main/java/com/myfitnesspal/feature/search/ui/activity/FoodSearchActivityV2$initButtonListeners$2.java | 211e9f65c9a87d0172006cfb2e1b25509551e233 | []
| no_license | reed07/MyPreferencePal | 84db3a93c114868dd3691217cc175a8675e5544f | 365b42fcc5670844187ae61b8cbc02c542aa348e | refs/heads/master | 2020-03-10T23:10:43.112303 | 2019-07-08T00:39:32 | 2019-07-08T00:39:32 | 129,635,379 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package com.myfitnesspal.feature.search.ui.activity;
import android.view.View;
import android.view.View.OnClickListener;
import kotlin.Metadata;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "onClick"}, k = 3, mv = {1, 1, 13})
/* compiled from: FoodSearchActivityV2.kt */
final class FoodSearchActivityV2$initButtonListeners$2 implements OnClickListener {
final /* synthetic */ FoodSearchActivityV2 this$0;
FoodSearchActivityV2$initButtonListeners$2(FoodSearchActivityV2 foodSearchActivityV2) {
this.this$0 = foodSearchActivityV2;
}
public final void onClick(View view) {
this.this$0.navigateToScanBarcode();
}
}
| [
"[email protected]"
]
| |
fe47719e3997d2b5a99d3fccd1b8c096900d50c7 | 344095d7552e53b3122e1f9fa1ccdedd9c4494a8 | /src/main/java/com/cursomc/ClienteDTO.java | 627ba6278a905a1953c15e9041e20393d0b28646 | []
| no_license | willianso/teste-spring-boot | 56a3763b8f8c78d150e6ef9b0fe0c5133bbdce93 | 0d2db02999377c33016ce942fca3b454b4c45de8 | refs/heads/master | 2020-04-26T11:41:58.025678 | 2019-03-18T01:11:49 | 2019-03-18T01:11:49 | 173,525,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,086 | java | package com.cursomc;
import java.io.Serializable;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
import com.cursomc.domain.Cliente;
public class ClienteDTO implements Serializable{
private static final long serialVersionUID = 1L;
private Integer id;
@NotEmpty(message="Campo obrigatório")
@Length(min=5, max=120, message="Tamanho entre 5 e 120")
private String nome;
@Email(message="E-mail inválido")
@NotEmpty(message="Campo obrigatório")
private String email;
public ClienteDTO() {}
public ClienteDTO(Cliente obj) {
id = obj.getId();
nome = obj.getNome();
email = obj.getEmail();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"[email protected]"
]
| |
b61aa875cffd2e2ef8dcf1962012e64d19fd235a | 232e3a6ba4dd00eb887d4b28fa32a5af22956315 | /IGD_BT/app/src/main/java/com/example/ssb/igd_bt/PreferenceScreen.java | 338c466d50e060bbe467d5ecfeea449716b0c393 | []
| no_license | aitsabesartep/IGD | 9dd9433c32aae4931e088a8b9805f073ecb7a666 | b23ec98dae4f6fbb46441d2383a7154154e24ab9 | refs/heads/master | 2021-01-10T14:57:01.700320 | 2016-04-22T13:22:27 | 2016-04-22T13:22:27 | 51,759,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,824 | java | package com.example.ssb.igd_bt;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.concurrent.Semaphore;
public class PreferenceScreen extends AppCompatActivity {
public TextView ip;
public TextView port;
public TextView frec;
public int buf;
public TableLayout tl;
public static boolean conectat;
public Connect asynk;
public Semaphore sem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.preference_screen);
initComonents();
}
private void initComonents() {
final Button button = (Button) findViewById(R.id.guardarBtn);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
conectar_bt();
}
});
CheckBox repeatChkBx = ( CheckBox ) findViewById( R.id.check_media );
repeatChkBx.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
findViewById(R.id.table_media).setVisibility(View.VISIBLE);
TextView tx = (TextView) findViewById(R.id.tam);
buf = Integer.parseInt(tx.getText().toString());
} else {
findViewById(R.id.table_media).setVisibility(View.INVISIBLE);
buf = 1;
}
}
});
ip = (TextView) findViewById(R.id.ip_txt);
port = (TextView) findViewById(R.id.puerto_txt);
tl = (TableLayout) findViewById(R.id.config);
frec = (TextView) findViewById(R.id.frec);
}
private void conectar_bt(){
sem = new Semaphore(0);
MainActivity.tam = buf;
MainActivity.init();
MainActivity.init = true;
new Thread(){
@Override
public void run() {
super.run();
asynk = new Connect(ip.getText().toString(), port.getText().toString(), sem, frec.getText().toString(), buf);
asynk.execute();
}
}.start();
try {
sem.acquire();
if (conectat){
alertOk();
}else{
alertBad();
}
} catch (InterruptedException e) {
System.out.println("Error semafora");
}
}
private void alertOk(){
new AlertDialog.Builder(this)
.setTitle("Conectado")
.setMessage("Connexión correcta")
.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.setIcon(R.mipmap.ic_ok_dialog)
.show();
}
private void alertBad(){
new AlertDialog.Builder(this)
.setTitle("Error")
.setMessage("Problema al conectar con el socket")
.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.setIcon(R.mipmap.ic_err_dialog)
.show();
}
}
| [
"[email protected]"
]
| |
9a627dc76595f028f9151f60b84987d1439e3767 | 7288e5bfa4e69edc77c1e5b91225d5ba0b8212b4 | /src/main/java/refinedstorage/api/network/WirelessGridConsumer.java | c613f2dc655924fbea53fe17708c2048fce90645 | [
"MIT"
]
| permissive | Virindi-AC/refinedstorage | d7ae60960bbe6dc1fe9c1b700d798101125d4cf0 | c90245148cf41f58a9352d9ca150f9474df13963 | refs/heads/mc1.10 | 2021-01-18T17:24:13.953052 | 2016-06-28T20:18:11 | 2016-06-28T20:18:11 | 62,192,860 | 0 | 0 | null | 2016-06-29T03:32:18 | 2016-06-29T03:32:17 | null | UTF-8 | Java | false | false | 1,183 | java | package refinedstorage.api.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
/**
* Represents a player using a wireless grid.
*/
public class WirelessGridConsumer {
private EntityPlayer player;
private EnumHand hand;
private ItemStack wirelessGrid;
/**
* @param player The player using this wireless grid
* @param hand The hand that this wireless grid is in
* @param wirelessGrid The wireless grid {@link ItemStack} in the player's inventory
*/
public WirelessGridConsumer(EntityPlayer player, EnumHand hand, ItemStack wirelessGrid) {
this.player = player;
this.hand = hand;
this.wirelessGrid = wirelessGrid;
}
/**
* @return The wireless grid {@link ItemStack}
*/
public ItemStack getWirelessGrid() {
return wirelessGrid;
}
/**
* @return The hand this wireless grid is in
*/
public EnumHand getHand() {
return hand;
}
/**
* @return The player using the wireless grid
*/
public EntityPlayer getPlayer() {
return player;
}
} | [
"[email protected]"
]
| |
c260e4b2f1915f6b667a4b43b8acdc115b1b58d2 | 6010356e69f00092f3428bb60135c9bea579b4ff | /CustomView/cvlib/src/main/java/com/cvlib/indicator/buildins/commonnavigator/indicators/LinePagerIndicator.java | 6295f808d71141ffa1a3aadad675a2aacd4b6e51 | [
"Apache-2.0"
]
| permissive | Callanna/CustomView | 9531d9f46dcd423ce3e2a9c645c907f7f16f4ee0 | 7d21c32d366ea63fbf315ac205d2938a0b556496 | refs/heads/master | 2020-07-14T04:49:06.790280 | 2018-04-28T06:09:50 | 2018-04-28T06:09:50 | 94,297,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,610 | java | package com.cvlib.indicator.buildins.commonnavigator.indicators;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import com.cvlib.indicator.FragmentContainerHelper;
import com.cvlib.indicator.buildins.ArgbEvaluatorHolder;
import com.cvlib.indicator.buildins.UIUtil;
import com.cvlib.indicator.buildins.commonnavigator.abs.IPagerIndicator;
import com.cvlib.indicator.buildins.commonnavigator.model.PositionData;
import java.util.Arrays;
import java.util.List;
/**
* 直线viewpager指示器,带颜色渐变
* 博客: http://hackware.lucode.net
* Created by hackware on 2016/6/26.
*/
public class LinePagerIndicator extends View implements IPagerIndicator {
public static final int MODE_MATCH_EDGE = 0; // 直线宽度 == title宽度 - 2 * mXOffset
public static final int MODE_WRAP_CONTENT = 1; // 直线宽度 == title内容宽度 - 2 * mXOffset
public static final int MODE_EXACTLY = 2; // 直线宽度 == mLineWidth
private int mMode; // 默认为MODE_MATCH_EDGE模式
// 控制动画
private Interpolator mStartInterpolator = new LinearInterpolator();
private Interpolator mEndInterpolator = new LinearInterpolator();
private float mYOffset; // 相对于底部的偏移量,如果你想让直线位于title上方,设置它即可
private float mLineHeight;
private float mXOffset;
private float mLineWidth;
private float mRoundRadius;
private Paint mPaint;
private List<PositionData> mPositionDataList;
private List<Integer> mColors;
private RectF mLineRect = new RectF();
public LinePagerIndicator(Context context) {
super(context);
init(context);
}
private void init(Context context) {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setStyle(Paint.Style.FILL);
mLineHeight = UIUtil.dip2px(context, 3);
mLineWidth = UIUtil.dip2px(context, 10);
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawRoundRect(mLineRect, mRoundRadius, mRoundRadius, mPaint);
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (mPositionDataList == null || mPositionDataList.isEmpty()) {
return;
}
// 计算颜色
if (mColors != null && mColors.size() > 0) {
int currentColor = mColors.get(Math.abs(position) % mColors.size());
int nextColor = mColors.get(Math.abs(position + 1) % mColors.size());
int color = ArgbEvaluatorHolder.eval(positionOffset, currentColor, nextColor);
mPaint.setColor(color);
}
// 计算锚点位置
PositionData current = FragmentContainerHelper.getImitativePositionData(mPositionDataList, position);
PositionData next = FragmentContainerHelper.getImitativePositionData(mPositionDataList, position + 1);
float leftX;
float nextLeftX;
float rightX;
float nextRightX;
if (mMode == MODE_MATCH_EDGE) {
leftX = current.mLeft + mXOffset;
nextLeftX = next.mLeft + mXOffset;
rightX = current.mRight - mXOffset;
nextRightX = next.mRight - mXOffset;
} else if (mMode == MODE_WRAP_CONTENT) {
leftX = current.mContentLeft + mXOffset;
nextLeftX = next.mContentLeft + mXOffset;
rightX = current.mContentRight - mXOffset;
nextRightX = next.mContentRight - mXOffset;
} else { // MODE_EXACTLY
leftX = current.mLeft + (current.width() - mLineWidth) / 2;
nextLeftX = next.mLeft + (next.width() - mLineWidth) / 2;
rightX = current.mLeft + (current.width() + mLineWidth) / 2;
nextRightX = next.mLeft + (next.width() + mLineWidth) / 2;
}
mLineRect.left = leftX + (nextLeftX - leftX) * mStartInterpolator.getInterpolation(positionOffset);
mLineRect.right = rightX + (nextRightX - rightX) * mEndInterpolator.getInterpolation(positionOffset);
mLineRect.top = getHeight() - mLineHeight - mYOffset;
mLineRect.bottom = getHeight() - mYOffset;
invalidate();
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
@Override
public void onPositionDataProvide(List<PositionData> dataList) {
mPositionDataList = dataList;
}
public float getYOffset() {
return mYOffset;
}
public void setYOffset(float yOffset) {
mYOffset = yOffset;
}
public float getXOffset() {
return mXOffset;
}
public void setXOffset(float xOffset) {
mXOffset = xOffset;
}
public float getLineHeight() {
return mLineHeight;
}
public void setLineHeight(float lineHeight) {
mLineHeight = lineHeight;
}
public float getLineWidth() {
return mLineWidth;
}
public void setLineWidth(float lineWidth) {
mLineWidth = lineWidth;
}
public float getRoundRadius() {
return mRoundRadius;
}
public void setRoundRadius(float roundRadius) {
mRoundRadius = roundRadius;
}
public int getMode() {
return mMode;
}
public void setMode(int mode) {
if (mode == MODE_EXACTLY || mode == MODE_MATCH_EDGE || mode == MODE_WRAP_CONTENT) {
mMode = mode;
} else {
throw new IllegalArgumentException("mode " + mode + " not supported.");
}
}
public Paint getPaint() {
return mPaint;
}
public List<Integer> getColors() {
return mColors;
}
public void setColors(Integer... colors) {
mColors = Arrays.asList(colors);
}
public Interpolator getStartInterpolator() {
return mStartInterpolator;
}
public void setStartInterpolator(Interpolator startInterpolator) {
mStartInterpolator = startInterpolator;
if (mStartInterpolator == null) {
mStartInterpolator = new LinearInterpolator();
}
}
public Interpolator getEndInterpolator() {
return mEndInterpolator;
}
public void setEndInterpolator(Interpolator endInterpolator) {
mEndInterpolator = endInterpolator;
if (mEndInterpolator == null) {
mEndInterpolator = new LinearInterpolator();
}
}
}
| [
"[email protected]"
]
| |
27bcee389f95c0663f74ebf1b9639498af29f305 | 33d1e95a414d4a2d6064f3f3d299f3f674940bc6 | /src/main/java/stepDefinitionPack/DataDrivenOurWebsite.java | cbf1975143105b447343c215812b18d988155add | []
| no_license | 061nehal/Maven_Hybrid_Framework | b408cad3e15b5bdddbc9d6c2905086d84e819703 | 8a8a2977db6bb1aac28eb293ae73b2bda381e209 | refs/heads/master | 2023-02-20T04:50:14.244600 | 2021-01-23T19:16:29 | 2021-01-23T19:16:29 | 332,289,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,985 | java | package stepDefinitionPack;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.Select;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class DataDrivenOurWebsite extends AbstracClassCucumber {
@Given("^I am on Ourwebsite Webpage$")
public void i_am_on_Ourwebsite_Webpage() {
driver.get("file:///D:/ITTraining/OurWebSite.html");
}
@When("^I Enter first name \"([^\"]*)\", last name \"([^\"]*)\", email \"([^\"]*)\", again email \"([^\"]*)\", password \"([^\"]*)\"$")
public void i_Enter_first_name_last_name_email_again_email_password(String Fname, String Lname, String Email, String AEmail, String Pass) {
driver.findElement(By.xpath("//*[@id=\"FN\"]")).sendKeys(Fname);
driver.findElement(By.xpath("//*[@id=\"LN\"]")).sendKeys(Lname);
driver.findElement(By.xpath("//*[@id=\"EM\"]")).sendKeys(Email);
driver.findElement(By.xpath("//*[@id=\"AEM\"]")).sendKeys(AEmail);
driver.findElement(By.xpath("//*[@id=\"PW\"]")).sendKeys(Pass);
}
@When("^I Select month \"([^\"]*)\", day \"([^\"]*)\", year \"([^\"]*)\"$")
public void i_Select_month_day_year(String MN, String DY, String YR) {
Select monthSelect=new Select(driver.findElement(By.id("month")));
monthSelect.selectByVisibleText(MN);
Select daySelect=new Select(driver.findElement(By.id("day")));
daySelect.selectByVisibleText(DY);
Select yearSelect=new Select(driver.findElement(By.id("year")));
yearSelect.selectByVisibleText(YR);
}
@When("^I Click on \"([^\"]*)\" radio button$")
public void i_Click_on_radio_button(String gender) {
if(gender.equalsIgnoreCase("Male")) {
driver.findElement(By.xpath("/html/body/input[6]")).click();
}
else {
driver.findElement(By.xpath("/html/body/input[7]")).click();
}
}
@Then("^I Should create new account successfully$")
public void i_Should_create_new_account_successfully() {
System.out.println("Account created successfully");
}
}
| [
"[email protected]"
]
| |
663941ea0e8e7c839ff2314355d4eb956afd7ee4 | a36dce4b6042356475ae2e0f05475bd6aed4391b | /2005/julypersistenceEJB/ejbModule/com/hps/july/persistence/EJSCMPI13nActResourceSetHomeBean.java | 8ea7faf38a7262b1340923f3a3d8bbdfe9f6d564 | []
| no_license | ildar66/WSAD_NRI | b21dbee82de5d119b0a507654d269832f19378bb | 2a352f164c513967acf04d5e74f36167e836054f | refs/heads/master | 2020-12-02T23:59:09.795209 | 2017-07-01T09:25:27 | 2017-07-01T09:25:27 | 95,954,234 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package com.hps.july.persistence;
/**
* EJSCMPI13nActResourceSetHomeBean
*/
public class EJSCMPI13nActResourceSetHomeBean extends com.hps.july.persistence.EJSCMPI13nActResourceSetHomeBean_1b32abe9 {
/**
* EJSCMPI13nActResourceSetHomeBean
*/
public EJSCMPI13nActResourceSetHomeBean() throws java.rmi.RemoteException {
super(); }
/**
* postCreateWrapper
*/
public com.hps.july.persistence.I13nActResourceSet postCreateWrapper(com.ibm.ejs.container.BeanO beanO, Object ejsKey) throws javax.ejb.CreateException, java.rmi.RemoteException {
return (com.hps.july.persistence.I13nActResourceSet) super.postCreate(beanO, ejsKey);
}
/**
* afterPostCreateWrapper
*/
public void afterPostCreateWrapper(com.ibm.ejs.container.BeanO beanO, Object ejsKey) throws javax.ejb.CreateException, java.rmi.RemoteException {
}
}
| [
"[email protected]"
]
| |
0e2b0d530ef6774df93b351b9cbeeca9c87734d5 | a60e760aa0d59067be90d00847eb1c392acacdef | /app/src/main/java/net/carlosdominguez/tweetslocatorkc/fragments/TweetLocatorFragment.java | 69cfc47e2345b3ecf2b17a6c7aa69c4711321618 | []
| no_license | charlietfe/TweetsLocatorKC | e17f56864c5f5c2833a138d4f5c2613272bf54cd | e16ec251e431c95a1e72c77c2b68d5e26d9ce144 | refs/heads/master | 2021-01-01T04:06:41.107960 | 2016-05-15T17:50:08 | 2016-05-15T17:50:08 | 58,764,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,435 | java | package net.carlosdominguez.tweetslocatorkc.fragments;
import android.location.Address;
import android.location.Geocoder;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import net.carlosdominguez.tweetslocatorkc.R;
import net.carlosdominguez.tweetslocatorkc.model.db.Tweet;
import net.carlosdominguez.tweetslocatorkc.model.db.dao.TweetDAO;
import net.carlosdominguez.tweetslocatorkc.services.external.TwitterService;
import net.carlosdominguez.tweetslocatorkc.utils.map.MapHelper;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import twitter4j.GeoLocation;
import twitter4j.Query;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
/**
* Created by Carlos Domínguez on 14/05/16.
*/
public class TweetLocatorFragment extends SupportMapFragment {
private GoogleApiClient googleApiClient;
private GoogleMap map;
private MenuItem menuItemSearch;
private MenuItem menuItemActionProgressItem;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
googleApiClient = new GoogleApiClient.Builder(getActivity())
.addApi(LocationServices.API)
.build();
getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
map = googleMap;
new LoadTweetsFromDBAsyncTask().execute();
}
});
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.tweet_locator_fragment_menu, menu);
menuItemSearch = menu.findItem(R.id.menu_item_search);
final SearchView searchView = (SearchView) menuItemSearch.getActionView();
menuItemActionProgressItem = menu.findItem(R.id.menu_item_loader);
// Extract the action-view from the menu item
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
new SearchTweetsAsyncTask(query, map).execute();
searchView.setIconified(true);
searchView.clearFocus();
menuItemSearch.collapseActionView();
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
}
// Asynctasks
public class SearchTweetsAsyncTask extends AsyncTask<Void, Void, List<Status>> {
private final String TAG = SearchTweetsAsyncTask.class.getSimpleName();
private String locationName;
private TwitterService service;
private Twitter twitter;
private Geocoder geoCoder;
double selectedLat;
double selectedLng;
private GoogleMap map;
public SearchTweetsAsyncTask(String locationName, GoogleMap map) {
showProgressBar();
this.locationName = locationName;
service = new TwitterService();
twitter = service.getTwitter();
geoCoder = new Geocoder(getContext(),Locale.getDefault());
this.map = map;
map.clear();
}
@Override
protected List<twitter4j.Status> doInBackground(Void... params) {
if (Geocoder.isPresent()) {
try {
List<Address> addressList = geoCoder.getFromLocationName(locationName, 1);
if (addressList != null && addressList.size() > 0) {
Address address = addressList.get(0);
if (address.hasLatitude() && address.hasLongitude()) {
selectedLat = address.getLatitude();
selectedLng = address.getLongitude();
Query query = new Query();
GeoLocation location = new GeoLocation(selectedLat, selectedLng);
query.geoCode(location, 100, Query.KILOMETERS.name());
query.setCount(20);
// TODO: Maybe It could be a good idea to iterate to get
// only tweets with geo
return twitter.search(query).getTweets();
}
}
}
catch (IOException e) {
Log.e(TAG, "Opps! Error searching for a location name");
}
catch (TwitterException e) {
Log.e(TAG, "Opps! Error on twitter query");
}
}
else {
Log.e(TAG, "Opps! Geocoder is not available");
}
return null;
}
@Override
protected void onPostExecute(List<twitter4j.Status> statuses) {
super.onPostExecute(statuses);
hideProgressBar();
if (statuses == null) {
Toast.makeText(getContext(), "Could not find any location", Toast.LENGTH_SHORT).show();
}
else {
List<Tweet> tweets = Tweet.tweetsFromStatuses(statuses, selectedLat, selectedLng);
// We always clean the database and insert the new tweets
TweetDAO dao = new TweetDAO();
dao.deleteAll();
dao.insertTweets(tweets);
MapHelper.centerMap(map, selectedLat, selectedLng);
MapHelper.addGeoTweetsToMap(tweets, map, getContext());
}
}
}
private class LoadTweetsFromDBAsyncTask extends AsyncTask<Void, Void, List<Tweet>> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected List<Tweet> doInBackground(Void... params) {
TweetDAO dao = new TweetDAO();
List<Tweet> tweets = dao.query();
return tweets;
}
@Override
protected void onPostExecute(List<Tweet> tweets) {
super.onPostExecute(tweets);
if (tweets != null && tweets.size() > 0) {
Tweet firstTweet = tweets.get(0);
// Center the map using first tweet
// TODO: Maybe It's a good idea to get the tweets from our current location
MapHelper.centerMap(map, firstTweet.getLat(), firstTweet.getLng());
MapHelper.addGeoTweetsToMap(tweets, map, getContext());
}
}
}
public void showProgressBar() {
menuItemSearch.setVisible(false);
menuItemActionProgressItem.setVisible(true);
}
public void hideProgressBar() {
menuItemSearch.setVisible(true);
menuItemActionProgressItem.setVisible(false);
}
}
| [
"[email protected]"
]
| |
3c86bb5f73b6911c306663f389a5da05b975abe1 | 8143b2434aae090ad8c73c6e4bf4818c80ecd596 | /src/main/java/org/wso2/siddhi/debs2017/markovchain/EventProbability.java | e59b2d6fd28d62bd74c29daf305b0bbaf3edd10e | []
| no_license | miyurud/DEBS2017-1 | 0b35a33d4242bac8ba5f11ff5f0c6c089ef88b15 | 8c373d35b88fb437a3276ab095479e3b39f6e504 | refs/heads/master | 2021-01-11T16:26:23.254436 | 2017-03-29T09:41:27 | 2017-03-29T09:41:27 | 80,084,933 | 0 | 0 | null | 2017-01-26T04:11:44 | 2017-01-26T04:11:44 | null | UTF-8 | Java | false | false | 1,141 | java | /*
*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* /
*
*/
package org.wso2.siddhi.debs2017.markovchain;
public class EventProbability {
private int eventCount =0;
public int getEventCount() {
return eventCount;
}
public void setEventCount(int eventCount) {
this.eventCount = eventCount;
}
public double getProbability() {
return probability;
}
public void setProbability(double probability) {
this.probability = probability;
}
private double probability=1;
}
| [
"[email protected]"
]
| |
61cd5784b7afbf1fc50e7b0ef23261262e0b830b | 47a25fc139848b2fb631ca68c5f54d34588cc438 | /app/src/androidTest/java/com/shamlatech/school_management/ExampleInstrumentedTest.java | f0af5c666b125963951a5ee84c7ca4c092df58ef | [
"MIT"
]
| permissive | MartinDeMundia/ClassTeacherNetworks_Mobile | afe825a3bc74648978b537fef37ec30aa6e0f8ba | d786dd8341e8252e9ba301d574d24ae73ced1b3c | refs/heads/main | 2023-06-28T21:19:22.069046 | 2021-08-01T18:20:47 | 2021-08-01T18:21:57 | 391,702,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | package com.shamlatech.school_management;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.shamlatech.school_management", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
124c2d79a741d405ce37abd4923da5249084845d | efe694983e4b5b1b5877ec94ee662e52aecfa499 | /src/main/java/com/altaik/parser/sendmails/processes/SendMailProcesses.java | 83454948591163214cfe028f86fb1452144de7cc | []
| no_license | assetb/sendmails | 05b779b3604a009a8f3e9de3d519703bf4e9438a | eb1154cb5557b6442c845cef1af4207c28184c09 | refs/heads/master | 2020-03-24T20:16:57.221871 | 2018-07-31T06:05:21 | 2018-07-31T06:05:21 | 142,969,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,836 | java | package com.altaik.parser.sendmails.processes;
import com.altaik.bp.BaseProcesses;
import java.util.Properties;
/**
* Created by admin on 25.09.2017.
*/
public abstract class SendMailProcesses extends BaseProcesses {
public static final String TEST_MODE = "process.test.mode";
public static final String TEST_EMAIL = "process.test.email";
public static final String TEST_EMAIL_CUSTOMER = "process.test.email.customer";
public static final String ORDER_EMAIL = "process.order.email";
private String testEmail;
private String testEmailCustomer;
private String emailForOrder;
private boolean testMode;
SendMailProcesses(Properties properties) {
super(properties);
if (properties != null) {
testMode = "true".equals(properties.getProperty(TEST_MODE));
testEmail = properties.getProperty(TEST_EMAIL);
testEmailCustomer = properties.getProperty(TEST_EMAIL_CUSTOMER);
emailForOrder = properties.getProperty(ORDER_EMAIL);
}
}
/**
* @return
*/
String getTestEmail() {
return testEmail;
}
String getTestEmailCustomer() {
return testEmailCustomer;
}
/**
* Получить электронный адрес на который необходимо отправлять отчет
*
* @return Электронный адрес получателя отчетов
* @see
*/
String getEmailForOrder() {
return emailForOrder;
}
/**
* Запушен ли процесс в тестовом режиме(process.test.mode)
*
* @return Возвращает true если процесс запущен в тестовом режиме, иначе false
*/
Boolean isTestMode() {
return testMode;
}
}
| [
"[email protected]"
]
| |
73908ca0a9d1bc669ce2289d182e02a5cc624146 | c6e516c0d3723b18e6c536b8b8f4cd699d807848 | /src/main/java/auto/freemarker/template/ProjDomainClassScanner.java | ffb2416a6bc0049538db5926949fecc220ca1921 | []
| no_license | jasonsuzhou/AutoEngine | 44f59cf1e26a66125bbcfdd3a45472a21b18d7e2 | 151a7a0e62a8a6fd6e5e853cd9bd5c5ee39b9c59 | refs/heads/master | 2021-01-10T10:36:12.174582 | 2016-03-15T06:39:40 | 2016-03-15T06:39:40 | 48,573,813 | 0 | 1 | null | 2016-03-15T06:39:40 | 2015-12-25T08:46:18 | JavaScript | UTF-8 | Java | false | false | 3,490 | java | package auto.freemarker.template;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ProjDomainClassScanner {
public static void main(String[] args) throws Exception {
String projDomainPath = FreemarkerUtil.getProjJavaDomainPath();
File file = new File(projDomainPath);
List<String> simpleClassNames = new ArrayList<String>();
if (file.exists() && file.isDirectory()) {
String[] fileNames = file.list();
String simpleFiledName = null;
for (String fileName : fileNames) {
if (!fileName.equals("DonotRemove.java")) {
simpleFiledName = fileName.substring(0, fileName.indexOf("."));
processGenerationForMyBatisMapper(simpleFiledName);
processGenerationForDAOLayer(simpleFiledName);
processGenerationForServiceLayer(simpleFiledName);
processGenerationForPageLayer(simpleFiledName);
simpleClassNames.add(simpleFiledName);
}
}
}
MyBatisConfGenerator.generateMyBatisConfFile(simpleClassNames);
MySQLGenerator.startGenerateSQL();
}
public static void processGenerationForPageLayer(String domainFileName) throws Exception {
PageGenerator.generateAddPage(domainFileName);
}
public static void processGenerationForDAOLayer(String domainFileName) throws Exception {
DAOGenerator.generateDAOJavaCode(domainFileName);
MyBatisDAOImplGenerator.generateDAOImplJavaCode(domainFileName);
}
public static void processGenerationForServiceLayer(String domainFileName) throws Exception {
ServiceGenerator.generateServiceJavaCode(domainFileName);
ServiceImplGenerator.generateServiceJavaCode(domainFileName);
}
public static void processGenerationForMyBatisMapper(String domainFileName) throws Exception {
Set<String> fieldNames = new HashSet<String>();
List<Field> fieldList = new ArrayList<Field>();
String classPath = FreemarkerUtil.getProjDomainClassPath(domainFileName);
Class domainClass = Class.forName(classPath);
Class superBaseEntity = domainClass.getSuperclass();
Field[] fields = superBaseEntity.getDeclaredFields();
for (Field field : fields) {
if (!field.getName().equals("serialVersionUID")) {
if (!fieldNames.contains(field.getName())) {
fieldList.add(field);
}
fieldNames.add(field.getName());
}
}
fields = domainClass.getDeclaredFields();
for (Field field : fields) {
if (!field.getName().equals("serialVersionUID")) {
if (!fieldNames.contains(field.getName())) {
fieldList.add(field);
}
fieldNames.add(field.getName());
}
}
fieldNames.remove("id");
StringBuilder propertyList = new StringBuilder(64);
StringBuilder propertyValueList = new StringBuilder(64);
StringBuilder updatePropertyList = new StringBuilder(64);
for (String fieldName : fieldNames) {
propertyList.append(fieldName).append(",");
propertyValueList.append("#{").append(fieldName).append("}").append(",");
updatePropertyList.append(fieldName).append("=").append("#{").append(fieldName).append("}").append(",");
}
propertyList.deleteCharAt(propertyList.length() - 1);
propertyValueList.deleteCharAt(propertyValueList.length() - 1);
updatePropertyList.deleteCharAt(updatePropertyList.length() - 1);
MyBatisMapperGenerator.generateMyBatisMapperFile(domainFileName, propertyList.toString(),
propertyValueList.toString(), updatePropertyList.toString(), fieldList);
MySQLGenerator.preapareData(domainFileName, fieldList);
}
}
| [
"[email protected]"
]
| |
32142f51153eef1ee41ea3dc8968c91b1cbf7cfc | 96977a92194c1717692a9b1d9280139f3e087419 | /MinaTutorial/src/org/example/mina/tls/server/TLSServer.java | bd0edca682f2d6ba683427280e9d6fb4a11cd411 | []
| no_license | oliverswan/OliverGitRepo | 8dc011ef960b58bbca1418dab3e392ed5f3dfad1 | 1e135a29cd8117f0c8cec419f46f2719ee5e9b67 | refs/heads/master | 2016-09-06T02:25:39.174428 | 2012-07-17T01:20:51 | 2012-07-17T01:20:51 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,504 | java | package org.example.mina.tls.server;
import java.net.InetSocketAddress;
import java.nio.charset.Charset;
import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
import org.apache.mina.filter.ssl.SslFilter;
import org.apache.mina.transport.socket.SocketAcceptor;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
import org.example.mina.tls.common.BogusSslContextFactory;
import org.example.mina.tls.server.handler.TLSServerHandler;
public class TLSServer {
private static final int PORT = 50003;
public static void main(String[] args) throws Exception {
// 0. 创建IO接收器
SocketAcceptor acceptor = new NioSocketAcceptor();
acceptor.setReuseAddress(true);
// 1. 设置过滤器
DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
SslFilter sslFilter = new SslFilter(BogusSslContextFactory.getInstance(true));// true指明是server
chain.addLast("sslFilter", sslFilter);// 设置ssl过滤
chain.addLast("codec", new ProtocolCodecFilter(
new TextLineCodecFactory(Charset.forName("UTF-8"))));// 设置编码过滤和按行读取
// 2. 设置IO处理器
acceptor.setHandler(new TLSServerHandler());
// 3. 绑定到端口开始监听
acceptor.bind(new InetSocketAddress(PORT));
System.out.println("服务器在 [" + PORT + "] 等待连接...");
}
} | [
"[email protected]"
]
| |
46634ac3936275273316df155f3d81453c1cdfe3 | 2e0a08178232b07454155d1e3e4b3e9ca5b8e380 | /VM/src/lian/artyom/solver/Solver.java | b3e182d601d8c5d320605bb0ec21acf2ae9aa07c | []
| no_license | dodler/tsp_vm_lab | 4517986f594fb7ca539c72ecc2494a1e867a229d | 020ca3a545ed7376940d1663668a09b7ca1a149d | refs/heads/master | 2020-12-24T09:53:41.643945 | 2015-12-21T17:35:35 | 2015-12-21T17:35:35 | 73,260,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package lian.artyom.solver;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.RealVector;
/**
* Created by artem on 28.11.15.
*/
public interface Solver
{
public boolean isApplicable(RealMatrix a);
public RealVector solve(RealMatrix a, RealVector b);
String getName();
}
| [
"[email protected]"
]
| |
d45028fceee3e946137cd9db5d584935eca737bf | 96d71f73821cfbf3653f148d8a261eceedeac882 | /external/decompiled/blackberry/bb (1)/decompiled/WhatsApp-12/com/whatsapp/client/ContactPickerField$ChatableFilter.java | 1be2c97fd717af5411e4ac0aa42fdc6fbdc08f51 | []
| no_license | JaapSuter/Niets | 9a9ec53f448df9b866a8c15162a5690b6bcca818 | 3cc42f8c2cefd9c3193711cbf15b5304566e08cb | refs/heads/master | 2020-04-09T19:09:40.667155 | 2012-09-28T18:11:33 | 2012-09-28T18:11:33 | 5,751,595 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 533 | java | // #######################################################
// Decompiled by : coddec
// Module : WhatsApp-12.cod
// Module version : 2.7.6550
// Class ID : 37
// ########################################################
package com.whatsapp.client;
interface public class ContactPickerField$ChatableFilter extends Object
{
// @@@@@@@@@@@@@ Virtual routines
abstract public boolean filter( com.whatsapp.client.ContactPickerField$ChatableFilter, module:WhatsApp-11.class#8 ); // address: 0
{
halt
}
}
| [
"[email protected]"
]
| |
66687fa164366bbaef9491d484d4f8a003b40ade | e63c6f606f5530f2e8cdf1972d0d5e77a70d1789 | /Week_09/provider/src/main/java/io/github/jjyy/provider/OrderServiceImpl.java | 1268b2efdad5aa43eb354e365c71229e148b24d0 | []
| no_license | jjyyjjyy/JAVA-000 | 96e60f30679d9c8b4ca12262602b2328017d1f0b | c8e0392966a41aaa58c389ce41db96dbd1c4ad22 | refs/heads/main | 2023-01-31T20:46:30.199919 | 2020-12-17T11:20:06 | 2020-12-17T11:20:06 | 302,811,102 | 0 | 0 | null | 2020-10-10T04:00:18 | 2020-10-10T04:00:17 | null | UTF-8 | Java | false | false | 386 | java | package io.github.jjyy.provider;
import io.github.jjyy.domain.Order;
import io.github.jjyy.service.OrderService;
import java.math.BigDecimal;
public class OrderServiceImpl implements OrderService {
@Override
public Order findOrderById(int id) {
return new Order().setId(id).setName("Cuijing" + System.currentTimeMillis()).setAmount(BigDecimal.valueOf(9.9));
}
}
| [
"[email protected]"
]
| |
d212181a79422fc895337b51401d68765b274b6b | f545120969fe48d867c6c1f02e6ab14692657658 | /src/main/java/com/expleague/sensearch/web/suggest/FastSuggester.java | 699c12aaa2bcf9fadd7d94d6598f717f2ac42936 | []
| no_license | solariq/sensearch | 7f93ba8e7f6c6210f5bf3106fdfa8ab1cc7aeb00 | 95ef056ccb4ac3a480434f97cc7624210825ff5f | refs/heads/master | 2022-11-18T15:03:59.954084 | 2019-12-21T14:07:18 | 2019-12-21T14:07:18 | 150,838,031 | 4 | 4 | null | 2022-11-16T11:32:04 | 2018-09-29T07:35:14 | Java | UTF-8 | Java | false | false | 3,374 | java | package com.expleague.sensearch.web.suggest;
import com.expleague.sensearch.core.Term;
import com.expleague.sensearch.index.Index;
import com.expleague.sensearch.index.plain.PlainIndex;
import com.google.inject.Inject;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.TreeSet;
import java.util.stream.Collectors;
public class FastSuggester implements Suggester {
public final int RETURN_LIMIT = 10;
private final SortedMultigramsArray multigrams;
private final PlainIndex index;
private final SqrtNRMQ rmq;
private final Random rnd = new Random(0);
class WeightIdxIntersect implements Comparable<WeightIdxIntersect>{
public final double weight;
public final int idx;
public final int intersect;
public final int id;
public WeightIdxIntersect(double weight, int idx, int intersect) {
this.weight = weight;
this.idx = idx;
this.intersect = intersect;
id = rnd.nextInt();
}
@Override
public final int compareTo(WeightIdxIntersect o) {
return Double.compare(weight, o.weight);
/*
int res = Double.compare(weight, o.weight);
if (res != 0)
return res;
return Integer.compare(id, o.id);*/
}
}
@Inject
public FastSuggester(Index index) {
this.index = (PlainIndex) index;
SuggestInformationLoader provider = index.getSuggestInformation();
multigrams = new SortedMultigramsArray(provider.multigramFreqNorm);
//System.err.println("Multigrams array was built");
rmq = new SqrtNRMQ(RETURN_LIMIT, multigrams.getList().stream().mapToDouble(mw -> mw.coeff));
//System.err.println("RMQ was built");
}
@Override
public List<String> getSuggestions(String searchString) {
//System.err.println("suggest for " + searchString + " requested");
List<String> res = null;
try {
res = getSuggestions(index.parse(searchString.toLowerCase())
.collect(Collectors.toList()));
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println("returning number suggestions: " + res.size());
return res;
}
@Override
public String getName() {
return "RMQ Links Suggester";
}
private List<String> getSuggestions(List<Term> terms) {
if (terms.isEmpty()) {
return Collections.emptyList();
}
TreeSet<WeightIdxIntersect> phraseProb = new TreeSet<>();
for(int intersectLength = 3; intersectLength >= 1; intersectLength--) {
if (terms.size() < intersectLength) {
continue;
}
Term[] qt = terms.subList(terms.size() - intersectLength, terms.size()).toArray(new Term[0]);
int[] bounds = multigrams.getBounds(qt);
//System.err.println(bounds[0] + " " + bounds[1]);
int[] maxIdxs = rmq.getMaximumIdxs(bounds[0], bounds[1]);
for (int i : maxIdxs) {
phraseProb.add(new WeightIdxIntersect(multigrams.get(i).coeff, i, intersectLength));
}
}
return phraseProb.stream()
.sorted(Comparator.reverseOrder())
.limit(RETURN_LIMIT)
.map(p -> {
String pref = termsToString(terms.subList(0, terms.size() - p.intersect));
String suff = termsToString(multigrams.get(p.idx).phrase);
return wordsConcat(pref, suff);
})
.collect(Collectors.toList());
}
}
| [
"[email protected]"
]
| |
2a61388d6500d6689eb24547223b561cc33845af | 3ca0000e6bc65c590680c41e83124bf8afa19073 | /BankSystemServer/src/main/java/com/cjon/bank/dto/BankDTO.java | 94227f789f8e2854a4053fe5c5ca5df9ddbcc9df | []
| no_license | LEEGISEONG/LastTest_BankSystem | 854fc5c898aac6be7e668df9da455a885297110c | 1b22515deb21db07311395fcbb8f4a4454423621 | refs/heads/master | 2020-12-24T06:37:21.186643 | 2016-11-11T10:19:35 | 2016-11-11T10:19:35 | 73,467,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package com.cjon.bank.dto;
public class BankDTO {
private String memberId;
private String memberName;
private String memberAccount;
private int memberBalance;
public BankDTO() {
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccout) {
this.memberAccount = memberAccout;
}
public int getMemberBalance() {
return memberBalance;
}
public void setMemberBalance(int memberBalance) {
this.memberBalance = memberBalance;
}
}
| [
"[email protected]"
]
| |
062e4eae87b6979f4b5d3f350874d3fac9bbc59e | 8d1062a1e187cae2ebc83055bc75eb0522424db5 | /src/main/java/hello/hello_spring/SpringConfig.java | d2027856fcd74bef4f3b1412a563da6537ffeb91 | []
| no_license | taeukyoon/inflean_springBoot_demo | b92bd753b4170ee6e7c9c7bc42de02e44c90e6eb | 1682cbc1b2b9cfd4824d18689729a7bb3ba53814 | refs/heads/master | 2023-05-08T08:34:13.765331 | 2021-05-27T01:57:26 | 2021-05-27T01:57:26 | 370,316,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package hello.hello_spring;
import hello.hello_spring.Service.MemberService;
import hello.hello_spring.repository.JpaMemberRepository;
import hello.hello_spring.repository.MemberRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SpringConfig {
private final MemberRepository memberRepository;
@Autowired
public SpringConfig(MemberRepository memberRepository) {
this.memberRepository = memberRepository;
}
@Bean
public MemberService memberService() {
return new MemberService(memberRepository);
}
// @Bean
// public MemberRepository memberRepository() {
// return new JdbcMemberRepository(dataSource);
// return new JdbcTemplateMemberRepository(dataSource);
// return new JpaMemberRepository(em);
// }
}
| [
"[email protected]"
]
| |
23bade0494e2dc39713194a0bdb7c67d86e45e82 | 445c3cf84dd4bbcbbccf787b2d3c9eb8ed805602 | /aliyun-java-sdk-ecsops/src/main/java/com/aliyuncs/ecsops/model/v20160401/OpsQueryWorkflowInstanceResponse.java | c1e03842d175497198e05fc27c0af6c09f05241e | [
"Apache-2.0"
]
| permissive | caojiele/aliyun-openapi-java-sdk | b6367cc95469ac32249c3d9c119474bf76fe6db2 | ecc1c949681276b3eed2500ec230637b039771b8 | refs/heads/master | 2023-06-02T02:30:02.232397 | 2021-06-18T04:08:36 | 2021-06-18T04:08:36 | 172,076,930 | 0 | 0 | NOASSERTION | 2019-02-22T14:08:29 | 2019-02-22T14:08:29 | null | UTF-8 | Java | false | false | 5,146 | 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.ecsops.model.v20160401;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.ecsops.transform.v20160401.OpsQueryWorkflowInstanceResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class OpsQueryWorkflowInstanceResponse extends AcsResponse {
private List<WorkflowInstance> workflowInstances;
public List<WorkflowInstance> getWorkflowInstances() {
return this.workflowInstances;
}
public void setWorkflowInstances(List<WorkflowInstance> workflowInstances) {
this.workflowInstances = workflowInstances;
}
public static class WorkflowInstance {
private String workflowId;
private String parentId;
private String workflowName;
private Long version;
private String bizType;
private String bizId;
private Integer priority;
private String initAttributes;
private String state;
private String executionNode;
private Long startDateTime;
private Long expireTime;
private Long endDateTime;
private Long duration;
private Long createTime;
private Long updateTime;
private String tag;
private String extColumn1;
private String extColumn2;
private String extColumn3;
public String getWorkflowId() {
return this.workflowId;
}
public void setWorkflowId(String workflowId) {
this.workflowId = workflowId;
}
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getWorkflowName() {
return this.workflowName;
}
public void setWorkflowName(String workflowName) {
this.workflowName = workflowName;
}
public Long getVersion() {
return this.version;
}
public void setVersion(Long version) {
this.version = version;
}
public String getBizType() {
return this.bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getBizId() {
return this.bizId;
}
public void setBizId(String bizId) {
this.bizId = bizId;
}
public Integer getPriority() {
return this.priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
public String getInitAttributes() {
return this.initAttributes;
}
public void setInitAttributes(String initAttributes) {
this.initAttributes = initAttributes;
}
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getExecutionNode() {
return this.executionNode;
}
public void setExecutionNode(String executionNode) {
this.executionNode = executionNode;
}
public Long getStartDateTime() {
return this.startDateTime;
}
public void setStartDateTime(Long startDateTime) {
this.startDateTime = startDateTime;
}
public Long getExpireTime() {
return this.expireTime;
}
public void setExpireTime(Long expireTime) {
this.expireTime = expireTime;
}
public Long getEndDateTime() {
return this.endDateTime;
}
public void setEndDateTime(Long endDateTime) {
this.endDateTime = endDateTime;
}
public Long getDuration() {
return this.duration;
}
public void setDuration(Long duration) {
this.duration = duration;
}
public Long getCreateTime() {
return this.createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getTag() {
return this.tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getExtColumn1() {
return this.extColumn1;
}
public void setExtColumn1(String extColumn1) {
this.extColumn1 = extColumn1;
}
public String getExtColumn2() {
return this.extColumn2;
}
public void setExtColumn2(String extColumn2) {
this.extColumn2 = extColumn2;
}
public String getExtColumn3() {
return this.extColumn3;
}
public void setExtColumn3(String extColumn3) {
this.extColumn3 = extColumn3;
}
}
@Override
public OpsQueryWorkflowInstanceResponse getInstance(UnmarshallerContext context) {
return OpsQueryWorkflowInstanceResponseUnmarshaller.unmarshall(this, context);
}
}
| [
"[email protected]"
]
| |
bba8d6a6fa701a1d1a6e92c77c65d081d0c683c4 | b07c6f249a483e559aea0ddefc7dfeb6f1da5865 | /app/src/main/java/com/fastapp/viroyal/fm_newstyle/model/entity/TrackInfoBean.java | 977dd721a215f148380a50ec754eea7c0781de4e | []
| no_license | Jiaptti/FM_newstyle | e5eb714a53db1d3ba3424e0994f148a5049e5bfe | 97ae0024e877a010c4023d80a0bbc7f75baa8652 | refs/heads/master | 2021-01-01T05:54:52.286183 | 2017-10-16T07:55:12 | 2017-10-16T07:55:12 | 97,304,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,945 | java | package com.fastapp.viroyal.fm_newstyle.model.entity;
import java.util.List;
/**
* Created by hanjiaqi on 2017/8/9.
*/
public class TrackInfoBean {
private int uid;
private int downloadSize;
private String downloadUrl;
private String albumTitle;
private String playUrl32;
private boolean isAuthorized;
private int sampleDuration;
private String coverSmall;
private int processState;
private String smallLogo;
private String playPathHq;
private int albumId;
private String playUrl64;
private String nickname;
private int status;
private int categoryId;
private String msg;
private boolean isLike;
private int likes;
private int ret;
private int userSource;
private int playtimes;
private String coverLarge;
private boolean isPaid;
private boolean isVideo;
private boolean isDraft;
private String title;
private long createdAt;
private int downloadAacSize;
private int priceTypeEnum;
private String albumImage;
private int priceTypeId;
private UserInfoBean userInfo;
private String tags;
private int trackId;
private String coverMiddle;
private boolean isVipFree;
private boolean isPublic;
private String intro;
private int duration;
private String downloadAacUrl;
private boolean isFree;
private String playPathAacv164;
private String playPathAacv224;
private int comments;
private List<?> priceTypes;
private List<?> trackBlocks;
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public int getDownloadSize() {
return downloadSize;
}
public void setDownloadSize(int downloadSize) {
this.downloadSize = downloadSize;
}
public String getDownloadUrl() {
return downloadUrl;
}
public void setDownloadUrl(String downloadUrl) {
this.downloadUrl = downloadUrl;
}
public String getAlbumTitle() {
return albumTitle;
}
public void setAlbumTitle(String albumTitle) {
this.albumTitle = albumTitle;
}
public String getPlayUrl32() {
return playUrl32;
}
public void setPlayUrl32(String playUrl32) {
this.playUrl32 = playUrl32;
}
public boolean isIsAuthorized() {
return isAuthorized;
}
public void setIsAuthorized(boolean isAuthorized) {
this.isAuthorized = isAuthorized;
}
public int getSampleDuration() {
return sampleDuration;
}
public void setSampleDuration(int sampleDuration) {
this.sampleDuration = sampleDuration;
}
public String getCoverSmall() {
return coverSmall;
}
public void setCoverSmall(String coverSmall) {
this.coverSmall = coverSmall;
}
public int getProcessState() {
return processState;
}
public void setProcessState(int processState) {
this.processState = processState;
}
public String getSmallLogo() {
return smallLogo;
}
public void setSmallLogo(String smallLogo) {
this.smallLogo = smallLogo;
}
public String getPlayPathHq() {
return playPathHq;
}
public void setPlayPathHq(String playPathHq) {
this.playPathHq = playPathHq;
}
public int getAlbumId() {
return albumId;
}
public void setAlbumId(int albumId) {
this.albumId = albumId;
}
public String getPlayUrl64() {
return playUrl64;
}
public void setPlayUrl64(String playUrl64) {
this.playUrl64 = playUrl64;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getCategoryId() {
return categoryId;
}
public void setCategoryId(int categoryId) {
this.categoryId = categoryId;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public boolean isIsLike() {
return isLike;
}
public void setIsLike(boolean isLike) {
this.isLike = isLike;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public int getRet() {
return ret;
}
public void setRet(int ret) {
this.ret = ret;
}
public int getUserSource() {
return userSource;
}
public void setUserSource(int userSource) {
this.userSource = userSource;
}
public int getPlaytimes() {
return playtimes;
}
public void setPlaytimes(int playtimes) {
this.playtimes = playtimes;
}
public String getCoverLarge() {
return coverLarge;
}
public void setCoverLarge(String coverLarge) {
this.coverLarge = coverLarge;
}
public boolean isIsPaid() {
return isPaid;
}
public void setIsPaid(boolean isPaid) {
this.isPaid = isPaid;
}
public boolean isIsVideo() {
return isVideo;
}
public void setIsVideo(boolean isVideo) {
this.isVideo = isVideo;
}
public boolean isIsDraft() {
return isDraft;
}
public void setIsDraft(boolean isDraft) {
this.isDraft = isDraft;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(long createdAt) {
this.createdAt = createdAt;
}
public int getDownloadAacSize() {
return downloadAacSize;
}
public void setDownloadAacSize(int downloadAacSize) {
this.downloadAacSize = downloadAacSize;
}
public int getPriceTypeEnum() {
return priceTypeEnum;
}
public void setPriceTypeEnum(int priceTypeEnum) {
this.priceTypeEnum = priceTypeEnum;
}
public String getAlbumImage() {
return albumImage;
}
public void setAlbumImage(String albumImage) {
this.albumImage = albumImage;
}
public int getPriceTypeId() {
return priceTypeId;
}
public void setPriceTypeId(int priceTypeId) {
this.priceTypeId = priceTypeId;
}
public UserInfoBean getUserInfo() {
return userInfo;
}
public void setUserInfo(UserInfoBean userInfo) {
this.userInfo = userInfo;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
public int getTrackId() {
return trackId;
}
public void setTrackId(int trackId) {
this.trackId = trackId;
}
public String getCoverMiddle() {
return coverMiddle;
}
public void setCoverMiddle(String coverMiddle) {
this.coverMiddle = coverMiddle;
}
public boolean isIsVipFree() {
return isVipFree;
}
public void setIsVipFree(boolean isVipFree) {
this.isVipFree = isVipFree;
}
public boolean isIsPublic() {
return isPublic;
}
public void setIsPublic(boolean isPublic) {
this.isPublic = isPublic;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
public String getDownloadAacUrl() {
return downloadAacUrl;
}
public void setDownloadAacUrl(String downloadAacUrl) {
this.downloadAacUrl = downloadAacUrl;
}
public boolean isIsFree() {
return isFree;
}
public void setIsFree(boolean isFree) {
this.isFree = isFree;
}
public String getPlayPathAacv164() {
return playPathAacv164;
}
public void setPlayPathAacv164(String playPathAacv164) {
this.playPathAacv164 = playPathAacv164;
}
public String getPlayPathAacv224() {
return playPathAacv224;
}
public void setPlayPathAacv224(String playPathAacv224) {
this.playPathAacv224 = playPathAacv224;
}
public int getComments() {
return comments;
}
public void setComments(int comments) {
this.comments = comments;
}
public List<?> getPriceTypes() {
return priceTypes;
}
public void setPriceTypes(List<?> priceTypes) {
this.priceTypes = priceTypes;
}
public List<?> getTrackBlocks() {
return trackBlocks;
}
public void setTrackBlocks(List<?> trackBlocks) {
this.trackBlocks = trackBlocks;
}
}
| [
"[email protected]"
]
| |
f06c947b75294d60c94c8345d84f3a06e8d89a7a | 587900b41b8c19f88d57f260b41b5fda2693352a | /mainapp/src/main/java/com/zconly/pianocourse/mvp/view/AccountView.java | 285f0baa7493b59a4031290a37e34ce85a822730 | []
| no_license | dengbin53/pianocourse | b6bf302075507949f341c7e1fe37c87120264f00 | e98d286c1934c22d501129c1a13f0c56944e9152 | refs/heads/master | 2021-04-03T23:42:25.378421 | 2020-06-22T16:48:44 | 2020-06-22T16:48:44 | 248,405,785 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package com.zconly.pianocourse.mvp.view;
import com.zconly.pianocourse.bean.BalanceBean;
import com.zconly.pianocourse.bean.BaseBean;
import com.zconly.pianocourse.bean.BoughtRecordBean;
import com.zconly.pianocourse.bean.ChangeRecordBean;
/**
* @Description:
* @Author: dengbin
* @CreateDate: 2020/5/2 02:24
* @UpdateUser: dengbin
* @UpdateDate: 2020/5/2 02:24
* @UpdateRemark: 更新说明
*/
public interface AccountView extends BaseView {
void balanceSuccess(BalanceBean.BalanceResult response);
void changeRecordListSuccess(ChangeRecordBean.ChangeRecordListResult response);
void boughtRecordListSuccess(BoughtRecordBean.BoughtRecordListResult response);
void buySuccess(BaseBean response);
}
| [
"[email protected]"
]
| |
bc96e53ea3e0ec4be24959eafd83e52e9ba744d0 | af878310d9228b8a1d969368ca3d319458bb4635 | /src/main/java/falcon/mvc/recipes/services/NotesService.java | ba125cb442f724566cefe356fa3663c9708be955 | []
| no_license | MMrFalcon/Recipe-Project-MVC-Demo | d1615ec7390879f839d12e11bb097c64e73a7906 | cf97bb34780beb4eccf036de731ff436fec7c690 | refs/heads/master | 2020-04-26T05:17:24.013934 | 2019-11-02T23:23:09 | 2019-11-02T23:23:09 | 173,329,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | package falcon.mvc.recipes.services;
import falcon.mvc.recipes.commands.NotesCommand;
public interface NotesService {
NotesCommand createNotes(NotesCommand notes);
}
| [
"[email protected]"
]
| |
d7d17da78868363bfaf4f8233a808cdf95881815 | e0007c7217db9b2f22a7415eef379683b91c0aab | /src/main/java/com/rackspacecloud/blueflood/metricsmetadataservice/model/Metrics.java | 3360835d4bab998f012f500531e5adcc99ba762a | []
| no_license | mritunjaykumar/metrics-metadata-service | 6952d059b96818099f67afdac341cbfca16ac517 | cada03822fa5aa07b5e70b15cbd855808ed9eadf | refs/heads/master | 2020-03-14T04:17:54.411472 | 2018-06-23T01:57:42 | 2018-06-23T01:57:42 | 131,438,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.rackspacecloud.blueflood.metricsmetadataservice.model;
import lombok.Data;
@Data
public class Metrics {
private float metricValue;
private long collectionTime;
private long ttlInSeconds;
private String unit;
private Locator locator;
}
| [
"[email protected]"
]
| |
25143ba6b5e6c86d7729f72db8e70fd2529ccdd5 | 4fb7be5964443a25f115330239085504c4a5122c | /src/main/java/com/zzh/mybatisplusdaynamicannotationsql/config/paramsConfig.java | 27c8477dcf7e8b99947962d4b6fcc67275a853d5 | []
| no_license | zhangzihang3/-workHarvestCode | 0471b67bb5ff05f3445c642e7a03aae98475862f | bfdb7074b3e69465600a48621f773722c907f530 | refs/heads/main | 2023-03-01T13:46:47.260134 | 2021-02-08T09:41:41 | 2021-02-08T10:08:14 | 333,651,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.zzh.mybatisplusdaynamicannotationsql.config;
import com.zzh.mybatisplusdaynamicannotationsql.entity.Goods;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* @author zzh
* @class
*/
@Component
@Data
public class paramsConfig {
@Value("${Good.name}")
private String goodName;
@Value("#{1+1}")
private String jGoodPrice;
@Value("${Good.price}")
private String goodPrice;
@Value("${Good.bad:null}")
private String goodbad;
}
| [
"[email protected]"
]
| |
f3b1d921c819f01f11783ed5b108c947c90de084 | a55f4eb9a9758480b2383f5bd21ba8733cacab68 | /explainability/service/xai-poc-v2/m2x-api/target/generated-sources/swagger/src/main/java/org/kie/trusty/xai/handler/auth/OAuthFlow.java | 8c570bd71dc517e1e7213f092cb0fe0ec00ac860 | [
"Apache-2.0"
]
| permissive | r00ta/trusty-ai-sandbox | be71cee9281af5818d4ce7621273c28d2a779015 | 1bd26e2b8781204f5196719e40f2b37e121922e0 | refs/heads/master | 2021-12-29T09:53:01.852992 | 2021-09-07T12:21:12 | 2021-09-07T12:21:12 | 251,612,974 | 0 | 0 | Apache-2.0 | 2020-03-31T13:37:13 | 2020-03-31T13:37:12 | null | UTF-8 | Java | false | false | 451 | java | /*
* Model to Explainability communication
* Model to Explainability communication protocol
*
* OpenAPI spec version: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package org.kie.trusty.xai.handler.auth;
public enum OAuthFlow {
accessCode, implicit, password, application
}
| [
"[email protected]"
]
| |
a762e69ce580d6a5eed3596ce30ea28356e9526e | 448f833441add1abf30f1d91f120caf89a1df55e | /src/cn/itcast/itcaststore/web/servlet/client/ChangeSendStateServlet.java | 942163441699c84936eba347970ee606c97499ef | []
| no_license | Vict-star/Fitness_equipment_store | 21573833edbe7afddea0eb17517de9daf95dd1d4 | 055a3ace178a5af362942b665ab07d5869c530f9 | refs/heads/master | 2022-10-10T19:32:58.520612 | 2020-06-11T12:08:43 | 2020-06-11T12:08:43 | 271,305,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,139 | java | package cn.itcast.itcaststore.web.servlet.client;
import java.io.IOException;
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 cn.itcast.itcaststore.exception.ActiveUserException;
import cn.itcast.itcaststore.service.OrderService;
@WebServlet("/changeSendState")
public class ChangeSendStateServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 1.获取订单id
String orderid=request.getParameter("orderid");
OrderService service = new OrderService();
try {
service.updateSendState(orderid);
response.sendRedirect(request.getContextPath() + "/client/sendsuccess.jsp");
return;
} catch (Exception e) {
e.printStackTrace();
return;
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"[email protected]"
]
| |
75ed7cdc2d11dc14abea4119d8f23cd449d547a6 | 84f757ad625218f6362b9230d22bb44ae8911993 | /Tutor4/app/src/main/java/com/example/tutor4/ActivityLogin.java | 59d57aa8ff32a3ca48002802a84b777635bf6944 | []
| no_license | SaveroAl-Haqi/TugasTutor | ac0c6165c63d4023ded6c5352ee5c890961e63ac | ded2041525014b37f0512831f146899a85c0c095 | refs/heads/master | 2020-09-15T08:01:10.451121 | 2019-12-17T10:45:00 | 2019-12-17T10:45:00 | 223,387,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,508 | java | package com.example.tutor4;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class ActivityLogin extends AppCompatActivity {
private EditText mViewUser, mViewPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
/* Melakukan Inisialisasi variabel dengan nilai dari UI*/
mViewUser=findViewById(R.id.et_emailSignin);
mViewPassword =findViewById(R.id.et_passwordSignin);
/* Menjalankan fungsi razia() Jika tombol SignIn di keyboard di sentuh */
mViewPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
razia();
return true;
}
return false;
}
});
/* Menjalankan fungsi razia() jika tombol SignIn disentuh */
findViewById(R.id.button_signinSignin).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
razia();
}
});
/* Ke RegisterActivity jika tombol SignUp disentuh */
findViewById(R.id.button_signupSignin).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getBaseContext(), ActivityRegister.class));
}
});
}
/* ke MainActivity jika data Status Login dari Data Preferences bernilai true */
@Override
protected void onStart() {
super.onStart();
if (Preferences.getLoggedInStatus(getBaseContext())){
startActivity(new Intent(getBaseContext(),MainActivity.class));
finish();
}
}
/* Melakukan pegecekan inputan Username dan Password dan Memberikan akses ke MainActivity */
private void razia(){
/* Mereset semua Error dan fokus menjadi default */
mViewUser.setError(null);
mViewPassword.setError(null);
View fokus = null;
boolean cancel = false;
/* Mengambil nilai dari UI dengan variable baru bertipe String*/
String user = mViewUser.getText().toString();
String password = mViewPassword.getText().toString();
/* Pengecekan jika UI komponen username tidak diisi user*/
if (TextUtils.isEmpty(user)){
mViewUser.setError("This field is required");
fokus = mViewUser;
cancel = true;
}else if(!cekUser(user)){
mViewUser.setError("This Username is not found");
fokus = mViewUser;
cancel = true;
}
/* Pengecekan jika UI komponen password tidak diisi user*/
if (TextUtils.isEmpty(password)){
mViewPassword.setError("This field is required");
fokus = mViewPassword;
cancel = true;
}else if (!cekPassword(password)){
mViewPassword.setError("This password is incorrect");
fokus = mViewPassword;
cancel = true;
}
/* Jika cancel true, variable fokus mendapatkan fokus */
if (cancel) fokus.requestFocus();
else masuk();
}
/* Menuju ke MainActivity dan Set User dan Status menjadi sedang login di Preferences */
private void masuk(){
Preferences.setLoggedInUser(getBaseContext(),Preferences.getRegisteredUser(getBaseContext()));
Preferences.setLoggedInStatus(getBaseContext(),true);
startActivity(new Intent(getBaseContext(),MainActivity.class));finish();
}
/* True jika parameter password sama dengan data password yang terdaftar dari Preferences */
private boolean cekPassword(String password){
return password.equals(Preferences.getRegisteredPass(getBaseContext()));
}
/* True jika parameter user sama dengan data user yang terdaftar dari Preferences */
private boolean cekUser(String user){
return user.equals(Preferences.getRegisteredUser(getBaseContext()));
}
}
| [
"[email protected]"
]
| |
a961b0ee2cb5f32bf41b011391b8c2fa4f3e3761 | 7a67c24fde427b2413fde52b96e5432c64978482 | /gulimall-ums/src/main/java/com/atguigu/gulimall/ums/controller/MemberLoginLogController.java | 1a530a752146fe994c5032910bc30faee28422c3 | [
"Apache-2.0"
]
| permissive | jbzhang99/guli-mall | d184ef19a7f12b7e5e08534d0d0e26d312684132 | a6a42891536394b5f831c7f6f0fbe998ed16aeff | refs/heads/master | 2021-04-19T17:59:31.646123 | 2019-10-06T06:19:58 | 2019-10-06T06:19:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,668 | java | package com.atguigu.gulimall.ums.controller;
import java.util.Arrays;
import java.util.Map;
import com.atguigu.gulimall.commons.bean.PageVo;
import com.atguigu.gulimall.commons.bean.QueryCondition;
import com.atguigu.gulimall.commons.bean.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.atguigu.gulimall.ums.entity.MemberLoginLogEntity;
import com.atguigu.gulimall.ums.service.MemberLoginLogService;
/**
* 会员登录记录
*
* @author heyijie
* @email [email protected]
* @date 2019-08-01 19:22:00
*/
@Api(tags = "会员登录记录 管理")
@RestController
@RequestMapping("ums/memberloginlog")
public class MemberLoginLogController {
@Autowired
private MemberLoginLogService memberLoginLogService;
/**
* 列表
*/
@ApiOperation("分页查询(排序)")
@GetMapping("/list")
@PreAuthorize("hasAuthority('ums:memberloginlog:list')")
public Resp<PageVo> list(QueryCondition queryCondition) {
PageVo page = memberLoginLogService.queryPage(queryCondition);
return Resp.ok(page);
}
/**
* 信息
*/
@ApiOperation("详情查询")
@GetMapping("/info/{id}")
@PreAuthorize("hasAuthority('ums:memberloginlog:info')")
public Resp<MemberLoginLogEntity> info(@PathVariable("id") Long id){
MemberLoginLogEntity memberLoginLog = memberLoginLogService.getById(id);
return Resp.ok(memberLoginLog);
}
/**
* 保存
*/
@ApiOperation("保存")
@PostMapping("/save")
@PreAuthorize("hasAuthority('ums:memberloginlog:save')")
public Resp<Object> save(@RequestBody MemberLoginLogEntity memberLoginLog){
memberLoginLogService.save(memberLoginLog);
return Resp.ok(null);
}
/**
* 修改
*/
@ApiOperation("修改")
@PostMapping("/update")
@PreAuthorize("hasAuthority('ums:memberloginlog:update')")
public Resp<Object> update(@RequestBody MemberLoginLogEntity memberLoginLog){
memberLoginLogService.updateById(memberLoginLog);
return Resp.ok(null);
}
/**
* 删除
*/
@ApiOperation("删除")
@PostMapping("/delete")
@PreAuthorize("hasAuthority('ums:memberloginlog:delete')")
public Resp<Object> delete(@RequestBody Long[] ids){
memberLoginLogService.removeByIds(Arrays.asList(ids));
return Resp.ok(null);
}
}
| [
"[email protected]"
]
| |
d015f8afc9d55bb85eff342efbaf43e3d1fc9e04 | 1e9662934c4add1851b1a0e3970bbb38c349f3c3 | /src/main/java/br/com/adprofissionais/dao/LogAcessoDAO.java | 8bb64768e06f5567c5d3e1a8b5d9732babb68c9c | []
| no_license | laespol/condominio | f8939d9703fed04ae53dc9706332a715df2f95b0 | 9efc71d842a47ac9558a583c5a9dc7da182ae993 | refs/heads/master | 2020-06-10T22:32:18.426947 | 2016-12-20T14:11:20 | 2016-12-20T14:11:20 | 75,856,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | package br.com.adprofissionais.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Date;
import br.com.adprofissionais.domain.LogAcesso;
import br.com.adprofissionais.factory.ConexaoFactory;
public class LogAcessoDAO {
public void salvar(LogAcesso l) throws SQLException{
StringBuilder sql = new StringBuilder();
sql.append("INSERT INTO logacesso ");
sql.append("(dataacesso, login , sucesso) ");
sql.append("VALUES (?,?,?) ");
Date date = new Date();
Connection conexao = ConexaoFactory.conectar();
PreparedStatement comando = conexao.prepareStatement(sql.toString());
comando.setTimestamp(1, new java.sql.Timestamp(date.getTime()) );
comando.setString(2, l.getLogin());
comando.setString(3, l.getSucesso());
comando.executeUpdate();
}
}
| [
"laespol@sistema"
]
| laespol@sistema |
020e7fb46745a8f3dfae9d22638772488b3084f2 | 71a8b17480492ac221976eeb985737e5d8cd6c72 | /AIVoice/duer/src/main/java/com/dc/duer/OAuth.java | 1a684ccf1fb99d26cb28a1e91ae663cc25b75974 | []
| no_license | SouvDc/DuerTest | 2ee8f746dda2b8d145171b125cc3526013625e21 | 1a605e978cfcd609d155a83846626f9632420a28 | refs/heads/master | 2020-03-28T12:04:46.970452 | 2018-10-16T01:49:56 | 2018-10-16T01:50:17 | 148,268,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package com.dc.duer;
import com.baidu.duer.dcs.oauth.api.silent.SilentLoginImpl;
import com.baidu.duer.dcs.systeminterface.IOauth;
/**
* 描述:
* 作者:dc on 2018/9/10 14:52
* 邮箱:[email protected]
*/
public class OAuth {
public static IOauth getOauth(String CLIENT_ID) {
return new SilentLoginImpl(CLIENT_ID);
}
}
| [
"[email protected]"
]
| |
51d4e5976d9ebbce50436d7cccaecdb37979ef9f | ef1b72abf5554c94661c495a0bf0a6aded89e37c | /src/net/minecraft/src/czm.java | 8af743fa4db6a1d841802a7ede235ac285a0d4cb | []
| no_license | JimmyZJX/MC1.8_source | ad459b12d0d01db28942b9af87c86393011fd626 | 25f56c7884a320cbf183b23010cccecb5689d707 | refs/heads/master | 2016-09-10T04:26:40.951576 | 2014-11-29T06:22:02 | 2014-11-29T06:22:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | package net.minecraft.src;
public abstract interface czm<T>
{
public abstract int a();
public abstract T g();
}
/* Location: C:\Minecraft1.7.5\.minecraft\versions\1.8\1.8.jar
* Qualified Name: czm
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
]
| |
031862a6eb088172ea178675b93c53a7f528c70d | 114ccce3495a411f08f4a32018851bbf0a4144fe | /tests/structures/statistics/types/StatisticDepOfTypeTest.java | 67547bc766c2a7779d784e5131af2e2dc38b9e41 | [
"MIT"
]
| permissive | guilhermeslacerda/drtools-metric | b5acd4d1386b7a7da03c7eecf98657e36bf3a782 | 07aa8004b166ff4ac73ccee53197d23e7917f6ec | refs/heads/master | 2022-09-22T23:45:55.699671 | 2022-09-20T23:21:12 | 2022-09-20T23:21:12 | 241,103,729 | 18 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,390 | java | package structures.statistics.types;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import fixtures.statistics.StatisticOfTypeFixture;
public class StatisticDepOfTypeTest extends StatisticOfTypeFixture {
@Before
public void setUp() {
createStructureToTest();
st.useDEP();
}
@Test
public void testGetMedian() {
assertEquals(0.0, st.getMedian(), 0.01);
}
@Test
public void testGetAverage() {
assertEquals(0.6, st.getAverage(), 0.01);
}
@Test
public void testGetAmplitude() {
assertEquals(2.0, st.getAmplitude(), 0.01);
}
@Test
public void testGetFirstQuartile() {
assertEquals(0.0, st.getFirstQuartile(), 0.01);
}
@Test
public void testGetThirdQuartile() {
assertEquals(1.5, st.getThirdQuartile(), 0.01);
}
@Test
public void testGetMinValue() {
assertEquals(0.0, st.getMinValue(), 0.01);
}
@Test
public void testGetMaxValue() {
assertEquals(2.0, st.getMaxValue(), 0.01);
}
@Test
public void testGetLowerFence() {
assertEquals(-2.25, st.getLowerFence(), 0.01);
}
@Test
public void testGetUpperFence() {
assertEquals(3.75, st.getUpperFence(), 0.01);
}
@Test
public void testGetStandardDeviation() {
assertEquals(0.8, st.getStandardDeviation(), 0.01);
}
@Test
public void testGetInterQuartileRange() {
assertEquals(1.5, st.getInterQuartileRange(), 0.01);
}
}
| [
"[email protected]"
]
| |
acde6d5deaab4afd4d4e4767fe33349689ab8ca3 | 784c85d9469ef54e5f616aa0170f5cfbfd9dfe9e | /TP2/Auction-Repository/src/main/java/pt/unl/fct/api/RestRepository.java | 68880cd64b0fde1eafe8a93b621d4ec00a67c787 | []
| no_license | rafagameiro/SRSC | c1cd641f754f8da8ea2cecf60c54349a88534d55 | 8a7b182cd460513435ddcb6db0c24574647a79ae | refs/heads/master | 2020-07-31T00:53:18.667141 | 2020-01-17T17:13:24 | 2020-01-17T17:13:24 | 210,423,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,928 | java | package pt.unl.fct.api;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.FormParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import pt.unl.fct.impl.Block;
/**
* REST API of the Repository service
*
* @author Rafael Gameiro
* @author Manuella Vieira
*
*/
@Path(RestRepository.PATH)
public interface RestRepository {
static final String PATH = "/repository";
/**
* Method handling HTTP GET requests. The returned object will be sent
* to the client as "text/plain" media type.
*
* @return String that will be returned as a text/plain response.
*/
@POST
@Path("/new-client")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Response newClient(String client);
@POST
@Path("/login")
@Consumes(MediaType.APPLICATION_JSON)
Response login(String clientId);
@GET
@Path("/auctions/{auctionId}")
@Produces(MediaType.APPLICATION_JSON)
Response getAuction(@PathParam("auctionId") String auctionId);
@GET
@Path("/{clientId}/bids")
@Produces(MediaType.APPLICATION_JSON)
Response listClientBids(@PathParam("clientId") String clientId);
@GET
@Path("/{clientId}/auctions/active")
@Produces(MediaType.APPLICATION_JSON)
Response listClientActiveAuctions(@PathParam("clientId") String clientId);
@GET
@Path("/auctions")
@Produces(MediaType.APPLICATION_JSON)
Response listAuctions();
@GET
@Path("/auctions?type={type}")
@Produces(MediaType.APPLICATION_JSON)
Response listAuctionsByType(@PathParam("type") String type);
@POST
@Path("/new-auction")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Response createAuction(String newAuction);
@PUT
@Path("/auctions/{auctionId}/end")
@Consumes(MediaType.APPLICATION_JSON)
Response endAuction(@PathParam("auctionId") String auctionId, String client);
@PUT
@Path("/auctions/{auctionId}/close")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Response closeAuction(@PathParam("auctionId") String auctionId, String clientNonce);
@GET
@Path("/auctions/{auctionId}/outcome")
@Produces(MediaType.APPLICATION_JSON)
Response checkAuctionOutcome(@PathParam("auctionId") String auctionId);
@POST
@Path("/new-bid")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Response newBid(String newBid);
}
| [
"[email protected]"
]
| |
6a559115c8ba190ba159f27028c8d77f6827af0c | ae4cc98fbf8ff1903d944c1ffe6547d2ccaa3df4 | /BritishGasArrayTest/src/main/java/ArrayUtils.java | e2263f724c40ea759d9db0d26b577b7a2baac217 | []
| no_license | General-Meow/britishgas | 9e1293b3e41ceb287a66317fae9e9cfe4e20c39c | 3f49014e0029a39d19ae1fe8ea54c65478fd6486 | refs/heads/master | 2016-09-11T00:38:55.141657 | 2015-09-16T15:33:38 | 2015-09-16T15:33:38 | 42,595,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,865 | java | import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Arrays;
import java.util.Collections;
/**
* Created by paul on 16/09/15.
*
* Admittedly I spent more than 20 minutes on this but I wanted to get it right.
*
* I'm not sure what your looking for here but i've provided 2 implementations as you may think
* one of them is not actually doing much as its using the utilities provided in the JDK
*
* findStartOfArrayJDK are not the codes your looking for (waves hand across)
*/
public class ArrayUtils {
public static final int ARRAY_NOT_FOUND = -1;
/**
* Find the first index of an array in a target array using the provided JDK utils
* @param target to array to search through
* @param toFind the array to look for in the target
* @return index of the first instance or -1 if not found
*/
public static int findStartOfArrayJDK(final Integer[] target, final Integer[] toFind)
{
Preconditions.checkNotNull(target);
Preconditions.checkNotNull(toFind);
Preconditions.checkArgument(target.length > 0, "target array should not be empty");
Preconditions.checkArgument(toFind.length > 0, "toFind array should not be empty");
Preconditions.checkArgument(toFind.length < target.length, "target array cannot be smaller than toFind");
return Collections.indexOfSubList(Lists.newArrayList(target), Lists.newArrayList(toFind));
}
/**
* Custom find algorithm that finds the first index of an array in a target array
* @param target to array to search through
* @param toFind the array to look for in the target
* @return index of the first instance or -1 (ARRAY_NOT_FOUND) if not found
*/
public static int findStartOfArray(final Integer[] target, final Integer[] toFind)
{
Preconditions.checkNotNull(toFind);
Preconditions.checkNotNull(target);
Preconditions.checkArgument(toFind.length > 0, "toFind array should not be empty");
Preconditions.checkArgument(target.length > 0, "target array should not be empty");
Preconditions.checkArgument(toFind.length <= target.length, "target array cannot be smaller than toFind");
int index = ARRAY_NOT_FOUND;
for(int i = 0; i < target.length; i++)
{
//is there a point in continuing the search?
if((target.length - i) < toFind.length)
{
break;
}
//find first index
if(target[i] == toFind[0])
{
if(containsArray(Arrays.copyOfRange(target, i, target.length), toFind))
{
index = i;
break;
}
}
}
return index;
}
/**
* Companion method to findStartOfArray that returns true if the target array contains
* the toFind array from the beginning.
* @param target to array to search through
* @param toFind the array to look for in the target
* @return true if the target contains the toFind array
*/
private static boolean containsArray(final Integer[] target, final Integer[] toFind)
{
Preconditions.checkNotNull(toFind);
Preconditions.checkNotNull(target);
Preconditions.checkArgument(toFind.length > 0, "toFind array should not be empty");
Preconditions.checkArgument(target.length > 0, "target array should not be empty");
Preconditions.checkArgument(toFind.length <= target.length, "target array cannot be smaller than toFind");
boolean found = true;
for(int i = 0; i < toFind.length; i++)
{
if(toFind[i] != target[i])
{
found = false;
break;
}
}
return found;
}
}
| [
"[email protected]"
]
| |
53ce6049314db7db1e49c467d5a6e9c65c2b5ef7 | ad5e0f62227ab22407dae0ecb4e19e91218ce1b1 | /mediation-old/src/main/java/com/wso2telco/dep/mediator/dao/RequestDAO.java | b55ce3864fb6a38595fd8be1e85457c88373903d | []
| no_license | WSO2Telco/bizao-hub-mediation-dep | 95442baf923663679a4cbdf44bdbed1a8535e7df | 4e5e2bedd9f73ab78770516535ba1c84a7f6cda4 | refs/heads/master | 2023-01-20T02:32:45.548636 | 2020-11-18T06:10:27 | 2020-11-18T06:10:27 | 305,636,480 | 0 | 6 | null | 2020-11-18T06:10:28 | 2020-10-20T08:12:43 | Java | UTF-8 | Java | false | false | 3,439 | java | /**
* Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved.
*
* WSO2.Telco Inc. licences this file to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wso2telco.dep.mediator.dao;
import com.wso2telco.core.dbutils.DbUtils;
import com.wso2telco.core.dbutils.util.DataSourceNames;
import com.wso2telco.dep.mediator.model.MessageDTO;
import com.wso2telco.dep.mediator.model.SpendChargeDTO;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class RequestDAO {
public void publishMessage(MessageDTO messageDAO) throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
con = DbUtils.getDbConnection(DataSourceNames.WSO2TELCO_DEP_DB);
String sql = "INSERT INTO mdtrequestmessage ("
+ "msgtypeId,"
+ "mdtrequestId,"
+ "internalclientrefcode,"
+ "message,"
+ "clientrefcode,"
+ "clientrefval,"
+ "reportedtime"
+ ") "
+ "VALUES (?,?,?,?,?,?,?) ";
ps = con.prepareStatement(sql);
ps.setInt(1, messageDAO.getMsgId());
ps.setString(2, messageDAO.getMdtrequestId());
ps.setString(3, messageDAO.getClienString());
ps.setString(4, messageDAO.getMessage());
ps.setString(5, messageDAO.getRefcode().getRefCode());
ps.setString(6, messageDAO.getRefval());
ps.setLong(7, messageDAO.getReportedTime());
ps.executeUpdate();
} catch (Exception e) {
DbUtils.handleException("Error while inserting data into messat table", e);
} finally {
DbUtils.closeAllConnections(ps, con, rs);
}
}
public void persistSpendCharge(SpendChargeDTO spendChargeDTO) throws Exception{
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
con = DbUtils.getDbConnection(DataSourceNames.WSO2TELCO_DEP_DB);
String sql = "INSERT INTO spendlimitdata ("
+ "msgtype,"
+ "groupName,"
+ "consumerKey,"
+ "operatorId,"
+ "msisdn,amount,"
+ "currentDateTime, "
+ "effectiveTime"
+ ") "
+ "VALUES (?,?,?,?,?,?,?,?) ";
ps = con.prepareStatement(sql);
ps.setInt(1,spendChargeDTO.getMessageType());
ps.setString(2, spendChargeDTO.getGroupName());
ps.setString(3, spendChargeDTO.getConsumerKey());
ps.setString(4, spendChargeDTO.getOperatorId());
ps.setString(5, spendChargeDTO.getMsisdn());
ps.setDouble(6, spendChargeDTO.getAmount());
ps.setLong(7, spendChargeDTO.getCurrentTime());
ps.setLong(8, spendChargeDTO.getOrginalTime());
ps.executeUpdate();
}catch (Exception e){
DbUtils.handleException("Error while inserting data into spendlimitdata table", e);
} finally {
DbUtils.closeAllConnections(ps,con,rs);
}
}
}
| [
"[email protected]"
]
| |
5e8b0dc65c33bea1db22fb30325b1ec4a3d0a2db | 94f843a1970cc53cacced74a97d78f5998d1fff3 | /android_fragment_manager/src/com/example/android_fragment_manager/MyFragment.java | 9485a0c8975654e3f0795ae9546994090f20b067 | []
| no_license | JsonChan0943/android | 3d7c6b83b77d7dc5f40b7be6cb2029377907a561 | 949689b18766d60604da23d222b04556ebb30f51 | refs/heads/master | 2021-01-10T15:54:03.260174 | 2016-04-07T12:00:36 | 2016-04-07T12:00:36 | 55,604,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | package com.example.android_fragment_manager;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MyFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View view = inflater.inflate(R.layout.f1, null);
return view;
}
@Override
public void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
}
| [
"[email protected]"
]
| |
04b0a859481b30c10e795a0c3ebdf93d9dfbfcd7 | e3add623bc1fd779b9983e4d7afa08943123596d | /modims-exports-requires/modi.mod.impl/src/com/mod/impl/ModuleQuery.java | e29cd79d077dc69ed2b814252707fb9b0cd845bb | []
| no_license | forkedjava/java9-module-examples | 33ad9f07c19a325eb4df2a13189b82ec7db22f51 | 2f8bf4d44fbb6ea5c6599cf5ad7899d6956c5451 | refs/heads/master | 2020-05-22T17:46:22.370033 | 2018-07-01T21:20:09 | 2018-07-01T21:20:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package com.mod.impl;
import com.modi.api.query.Query;
/**
* Created by hakan on 12/11/2017
*/
public final class ModuleQuery implements Query {
//a public non-arg constructor class needed to be a service
/**
* find whether the target keyword exists in the module system or not
*
* @param keyword a searchable module name
* @return true if the keyword exists, otherwise false
*/
public boolean exists(String keyword) {
// this module is an application module
final Module module = ModuleQuery.class.getModule();
final ModuleLayer moduleLayer = module.getLayer();
return moduleLayer.modules()
.parallelStream()
.anyMatch(layer -> keyword.equals(layer.getName()));
}
}
| [
"[email protected]"
]
| |
b43bd2c3c60da6bbe49ecac8302ca6cc98df4270 | 183931eedd8ed7ff685e22cb055f86f12a54d707 | /java_puzzlers/02_expressive_puzzlers/puzzle_2/Change.java | 22b9ac53465dbc8afafebb24173a049ae2330cb8 | []
| no_license | cynepCTAPuk/headFirstJava | 94a87be8f6958ab373cd1640a5bdb9c3cc3bf166 | 7cb45f6e2336bbc78852d297ad3474fd491e5870 | refs/heads/master | 2023-08-16T06:51:14.206516 | 2023-08-08T16:44:11 | 2023-08-08T16:44:11 | 154,661,091 | 0 | 1 | null | 2023-01-06T21:32:31 | 2018-10-25T11:40:54 | Java | UTF-8 | Java | false | false | 405 | java | package puzzle_2;
import java.math.*;
public class Change {
public static void main(String args[]) {
System.out.println(2.00 - 1.10);
// Poor solution - still uses binary floating-point!
System.out.printf("%.2f\n", 2.00 - 1.10);
System.out.println((200 -110) + " cents");
System.out.println(new BigDecimal("2.00").subtract(new BigDecimal("1.10")));
}
}
| [
"[email protected]"
]
| |
e9cbeb794430cb555b166e90ddd8b1fe7d5bf4f3 | cc4e35e7f64f2fe8c0f270dd573734dfb37ccdba | /src/main/java/self/sunng/dubbo/demo/DemoService.java | 515c0082b59a77f1b0ccc978a1e1c67c53fa7bd1 | []
| no_license | sunng/dubbo-demo | f92329d57f8b296ee06cbbc9e87fa370d0f4e4ee | d4ff92a90463a45d173e5ee9f87c611cd8fdf949 | refs/heads/master | 2021-01-12T05:45:17.976834 | 2017-06-26T03:16:08 | 2017-06-26T03:16:08 | 77,190,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 137 | java | package self.sunng.dubbo.demo;
/**
* Created by abc on 16/1/13.
*/
public interface DemoService {
String sayHello(String name);
}
| [
"[email protected]"
]
| |
fb6c705b3e3ff3ff71d035d28dea12ee32043aa7 | 69a35589d46480bd78c4ca3bb3ff91784cf85fe1 | /AssignmentsGeneral/src/GarbageTest.java | 9723b7d98f5171fbf3c611811acf86aa4ca8f6df | []
| no_license | priyabagwe/PriyaFirstRepository | ffa538ff7c8e9dd86a7306387542e9c2f286cbfc | f675e6cc114be11b1a058f62b148c8081cf6501e | refs/heads/master | 2021-01-17T16:47:47.639187 | 2018-06-06T04:40:36 | 2018-06-06T04:40:36 | 61,165,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java |
public class GarbageTest {
public void finalize(){System.out.println("object is garbage collected");}
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("unused")
GarbageTest s1 = new GarbageTest();
@SuppressWarnings("unused")
GarbageTest s2 = new GarbageTest();
s1=null;
s2=null;
System.gc();
}
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.