blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1d322652ea35b692c276158a9b30a3423b9ef094 | 3c8ea6c339a9b7cc3e7f0a5913a96d26c533d44c | /android/src/main/java/com/applozic/flutter_applozic_plugin/FlutterApplozicPlugin.java | ffb30eab4b9a90b0a64db526de90061bf4244a7e | [] | no_license | reytum/Applozic-Flutter-SDK | fe349828e4cb309a5bf70e754bc81f567b292af0 | e58b7ca1c23e8d12b00653e8be3b1e771790c52f | refs/heads/master | 2020-05-31T23:53:29.649600 | 2019-06-06T08:45:38 | 2019-06-06T08:45:38 | 190,546,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,439 | java | package com.applozic.flutter_applozic_plugin;
import android.content.Context;
import android.content.Intent;
import com.applozic.mobicomkit.Applozic;
import com.applozic.mobicomkit.api.account.register.RegistrationResponse;
import com.applozic.mobicomkit.api.account.user.User;
import com.applozic.mobicomkit.listners.AlLoginHandler;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;
/**
* FlutterApplozicPlugin
*/
public class FlutterApplozicPlugin implements MethodCallHandler {
private final Registrar registrar;
private final MethodChannel channel;
/**
* Plugin registration.
*/
public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_applozic_plugin");
FlutterApplozicPlugin plugin = new FlutterApplozicPlugin(registrar, channel);
channel.setMethodCallHandler(plugin);
}
private FlutterApplozicPlugin(Registrar registrar, MethodChannel channel) {
this.registrar = registrar;
this.channel = channel;
}
@Override
public void onMethodCall(MethodCall call, final Result result) {
if (call.method.equals("getPlatformVersion")) {
result.success("Android " + android.os.Build.VERSION.RELEASE);
} else if (call.method.equals("loginUser")) {
User user = call.arguments();
Applozic.connectUser(registrar.context(), user, new AlLoginHandler() {
@Override
public void onSuccess(RegistrationResponse registrationResponse, Context context) {
result.success(registrationResponse);
}
@Override
public void onFailure(RegistrationResponse registrationResponse, Exception exception) {
result.error("Error", exception != null ? exception.getMessage() : null, registrationResponse);
}
});
} else if (call.method.equals("launchChat")) {
Intent intent = new Intent(registrar.activity(), ConversationActivity.class);
registrar.context().startActivity(intent);
} else {
result.notImplemented();
}
}
}
| [
"reytum@live.com"
] | reytum@live.com |
185700d5ba1b53cb47e4526e75d16bb624348f59 | e6a16b80dbc5b183e2c315d9e3c5dd2d7076b175 | /src/de/jetsli/graph/util/MyIntDeque.java | 631870252d404c7cc892ea7e60bef0d54ef54672 | [] | no_license | kastur/MapBasedLocationPrivacy | c756894a789a038f04232e90bf55780d4750251f | 9099a2c42246c18c9efa4fded9c7417ff4555f79 | refs/heads/master | 2020-06-07T08:29:48.069404 | 2012-08-31T02:39:24 | 2012-08-31T02:39:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,677 | java | /*
* Copyright 2012 Peter Karich info@jetsli.de
*
* 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 de.jetsli.graph.util;
import java.util.Arrays;
/**
* push to end, pop from beginning
*
* @author Peter Karich, info@jetsli.de
*/
public class MyIntDeque {
private int[] arr;
private float factor;
private int frontIndex;
private int endIndexPlusOne;
public MyIntDeque() {
this(100, 2);
}
public MyIntDeque(int initSize) {
this(initSize, 2);
}
public MyIntDeque(int initSize, float factor) {
if ((int) (initSize * factor) <= initSize)
throw new RuntimeException("initial size or increasing factor too low!");
this.factor = factor;
this.arr = new int[initSize];
}
int getCapacity() {
return arr.length;
}
public void setFactor(float factor) {
this.factor = factor;
}
public boolean isEmpty() {
return frontIndex >= endIndexPlusOne;
}
public int pop() {
int tmp = arr[frontIndex];
frontIndex++;
// removing the empty space of the front if too much is unused
int smallerSize = (int) (arr.length / factor);
if (frontIndex > smallerSize) {
endIndexPlusOne = size();
// ensure that there are at least 10 entries
int[] newArr = new int[endIndexPlusOne + 10];
System.arraycopy(arr, frontIndex, newArr, 0, endIndexPlusOne);
arr = newArr;
frontIndex = 0;
}
return tmp;
}
public int size() {
return endIndexPlusOne - frontIndex;
}
public void push(int v) {
if (endIndexPlusOne >= arr.length)
arr = Arrays.copyOf(arr, (int) (arr.length * factor));
arr[endIndexPlusOne] = v;
endIndexPlusOne++;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (int i = frontIndex; i < endIndexPlusOne; i++) {
if (i > frontIndex)
sb.append(", ");
sb.append(arr[i]);
}
return sb.toString();
}
}
| [
"kastur@gmail.com"
] | kastur@gmail.com |
9e931ec7c00dc971b4fb8ade479b1567b78586d9 | 1b9a6b5ee02cac0c0979cb5c78c53d26cadd8507 | /app/src/main/java/br/com/aplication/Phones.java | 0f61e69873e5508bcadd32bae59b30b146d51b8a | [] | no_license | MarioJunio/WHERESAPP-MOB | 7f4a60bb503392a532ceb277d8c003ae945de172 | a62015bfa8d5ffd2c499bbbaca41321020ebda42 | refs/heads/master | 2020-12-30T13:21:19.096202 | 2016-03-14T17:41:15 | 2016-03-14T17:41:15 | 91,207,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,710 | java | package br.com.aplication;
import android.content.Context;
import android.telephony.TelephonyManager;
import android.util.Log;
import java.security.NoSuchAlgorithmException;
import java.util.Set;
import com.br.wheresapp.R;
import br.com.model.domain.Contact;
import br.com.service.PhoneFormatTextWatcher;
import br.com.util.Utils;
/**
* Created by MarioJ on 08/05/15.
*/
public class Phones {
public static final String INTERNATIONAL_IDENTIFIER = "+";
private static final String TAG = "Phones";
public static String formatNumber(String phone) {
phone = phone.replaceAll("[^\\d" + INTERNATIONAL_IDENTIFIER + "]", "").trim();
while (phone.startsWith("0")) {
phone = phone.replaceFirst("0", "");
}
return phone;
}
public static String extractDDD(String phoneNumber, String countryISO) {
String phone;
int index;
if (countryISO.equals("BR")) {
phone = phoneNumber.replaceAll("[^\\d]", "");
index = 2;
} else {
phone = PhoneFormatTextWatcher.formatNumber(phoneNumber, countryISO).replaceAll("[^\\d\\s]", "");
index = phone.indexOf(" ");
}
if (index > 0)
return phone.substring(0, index);
else
return "";
}
public static String parseNumber(String ddi, String ddd, String number) {
number = formatNumber(number);
// if not starts with '+', check whether starts with DDD or DDI local
if (!number.startsWith(INTERNATIONAL_IDENTIFIER) && !number.startsWith(ddi + ddd)) {
String tmpNumber = INTERNATIONAL_IDENTIFIER;
if (number.startsWith(ddd) || ddd.isEmpty())
tmpNumber += ddi + number;
else
tmpNumber += ddi + ddd + number;
return tmpNumber.substring(INTERNATIONAL_IDENTIFIER.length());
}
return number.replace(INTERNATIONAL_IDENTIFIER, "");
}
public static String getPhoneCountryISO(Context context) {
return ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getSimCountryIso();
}
public static String getCountryCode(Context context, String countryISO) {
String[] countries = context.getResources().getStringArray(R.array.countries);
for (String country : countries) {
String[] tokens = country.split(",");
if (countryISO.equalsIgnoreCase(tokens[1]))
return tokens[0];
}
return null;
}
public static String getCountryISO(Context context, String countryCode) {
String[] countries = context.getResources().getStringArray(R.array.countries);
for (String country : countries) {
String tokens[] = country.split(",");
if (countryCode.equals(tokens[0]))
return tokens[1];
}
return null;
}
public static String getPhoneNumber(Context context, String countryCode) {
TelephonyManager telemamanger = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String line1Number = telemamanger.getLine1Number();
if (line1Number != null && !line1Number.isEmpty()) {
return line1Number.replaceFirst(countryCode, "");
}
return "";
}
public static String getContactsCheckSum(Set<Contact> contacts) throws NoSuchAlgorithmException {
String phones = "";
if (contacts != null && !contacts.isEmpty()) {
for (Contact c : contacts)
phones += c.getPhone();
return Utils.sha1(phones).toString();
}
return null;
}
}
| [
"mario.mj.95@gmail.com"
] | mario.mj.95@gmail.com |
79062ed1aa653514cbde0d531240230cf088df39 | 72cb7edd1550dbe806e18f12c39d285adee11ca3 | /src/main/java/org/inovout/message/codec/impl/MessageTag.java | 0fd4bae9f2a3a636996dcfff8be491c584467fa0 | [
"Apache-2.0"
] | permissive | inovout/message-codec | 9fd0857d5f463e708dba862278c10501e71434eb | aabc279c553ee4c17d4b9d1030fe41b35d7b64fe | refs/heads/main | 2023-06-15T10:46:17.477409 | 2021-07-07T09:25:14 | 2021-07-07T09:25:14 | 381,873,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package org.inovout.message.codec.impl;
import lombok.NonNull;
import org.inovout.message.codec.MessageBlock;
import org.inovout.message.codec.block.Codecs;
public class MessageTag
extends MessageBlockImpl
implements MessageBlock {
@NonNull
private byte[] tag;
public MessageTag(byte[] tag) {
super(Codecs.BYTE_ARRAY,
context -> tag.length,
context -> tag,
tag);
this.tag = tag;
}
public static MessageTag of(byte[] tag) {
return new MessageTag(tag);
}
}
| [
"huay@njcky.com"
] | huay@njcky.com |
f05a204d3a241777de8619f3ba9873bb7161b603 | b997f9de6b1410fa0cf5fd9b85ce9575b3031fd7 | /CMA/src/main/java/com/virtusa/cmadv/dao/AlumniDAOIface.java | da3bc85ac45daed799cdf3f67a5aee105de51157 | [] | no_license | avkapratwar/CMA-Application | f9343a01ad4b4164525f0af1b04772189f9740c9 | 2aff2d28ee8582591d40b9b05c50a6947debda64 | refs/heads/master | 2020-07-30T13:14:05.499692 | 2019-09-22T19:48:32 | 2019-09-22T19:48:32 | 210,246,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package com.virtusa.cmadv.dao;
import java.util.List;
import com.virtusa.cmadv.entity.Alumni;
public interface AlumniDAOIface {
List<Alumni> showAllAlumni();
}
| [
"abhiapratwar@gmail.com"
] | abhiapratwar@gmail.com |
92ec53027de060e7f24a36536b67f9cad49bb7c7 | f94b9e38363546f233e2e77fa32ff3c147d04110 | /src/com/ReversePolishNotation/AddOperator.java | c42a63c6d3c449a044a0a8c3e6274794753dec69 | [] | no_license | aravindh/EvaluateReversePolishNotation | 7cc4f5bdc2e74578785bce76db0dad69a937d4e4 | cd2a1e6a759ab38e0375bb58666736139f3bce7a | refs/heads/master | 2016-09-10T10:10:43.436177 | 2014-06-25T15:05:18 | 2014-06-25T15:05:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | package com.ReversePolishNotation;
public class AddOperator extends OperatorNode {
public AddOperator(Node l, Node r) {
left = l;
right = r;
}
@Override
protected double evaluate() {
return left.evaluate() + right.evaluate();
}
}
| [
"aravindh.ravindran@gmail.com"
] | aravindh.ravindran@gmail.com |
3ccc9f46525993a965f572eb5f6f2f15456397d0 | 8dc84558f0058d90dfc4955e905dab1b22d12c08 | /third_party/android_tools/sdk/sources/android-25/android/net/metrics/ApfStats.java | 8451e539a7f677beb71c293a1c5d0d321c4fbbed | [
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | meniossin/src | 42a95cc6c4a9c71d43d62bc4311224ca1fd61e03 | 44f73f7e76119e5ab415d4593ac66485e65d700a | refs/heads/master | 2022-12-16T20:17:03.747113 | 2020-09-03T10:43:12 | 2020-09-03T10:43:12 | 263,710,168 | 1 | 0 | BSD-3-Clause | 2020-05-13T18:20:09 | 2020-05-13T18:20:08 | null | UTF-8 | Java | false | false | 3,966 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.net.metrics;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
/**
* An event logged for an interface with APF capabilities when its IpManager state machine exits.
* {@hide}
*/
@SystemApi
public final class ApfStats implements Parcelable {
public final long durationMs; // time interval in milliseconds these stastistics covers
public final int receivedRas; // number of received RAs
public final int matchingRas; // number of received RAs matching a known RA
public final int droppedRas; // number of received RAs ignored due to the MAX_RAS limit
public final int zeroLifetimeRas; // number of received RAs with a minimum lifetime of 0
public final int parseErrors; // number of received RAs that could not be parsed
public final int programUpdates; // number of APF program updates
public final int maxProgramSize; // maximum APF program size advertised by hardware
/** {@hide} */
public ApfStats(long durationMs, int receivedRas, int matchingRas, int droppedRas,
int zeroLifetimeRas, int parseErrors, int programUpdates, int maxProgramSize) {
this.durationMs = durationMs;
this.receivedRas = receivedRas;
this.matchingRas = matchingRas;
this.droppedRas = droppedRas;
this.zeroLifetimeRas = zeroLifetimeRas;
this.parseErrors = parseErrors;
this.programUpdates = programUpdates;
this.maxProgramSize = maxProgramSize;
}
private ApfStats(Parcel in) {
this.durationMs = in.readLong();
this.receivedRas = in.readInt();
this.matchingRas = in.readInt();
this.droppedRas = in.readInt();
this.zeroLifetimeRas = in.readInt();
this.parseErrors = in.readInt();
this.programUpdates = in.readInt();
this.maxProgramSize = in.readInt();
}
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeLong(durationMs);
out.writeInt(receivedRas);
out.writeInt(matchingRas);
out.writeInt(droppedRas);
out.writeInt(zeroLifetimeRas);
out.writeInt(parseErrors);
out.writeInt(programUpdates);
out.writeInt(maxProgramSize);
}
@Override
public int describeContents() {
return 0;
}
@Override
public String toString() {
return new StringBuilder("ApfStats(")
.append(String.format("%dms ", durationMs))
.append(String.format("%dB RA: {", maxProgramSize))
.append(String.format("%d received, ", receivedRas))
.append(String.format("%d matching, ", matchingRas))
.append(String.format("%d dropped, ", droppedRas))
.append(String.format("%d zero lifetime, ", zeroLifetimeRas))
.append(String.format("%d parse errors, ", parseErrors))
.append(String.format("%d program updates})", programUpdates))
.toString();
}
public static final Parcelable.Creator<ApfStats> CREATOR = new Parcelable.Creator<ApfStats>() {
public ApfStats createFromParcel(Parcel in) {
return new ApfStats(in);
}
public ApfStats[] newArray(int size) {
return new ApfStats[size];
}
};
}
| [
"arnaud@geometry.ee"
] | arnaud@geometry.ee |
7ffe56a659fb29627c233a9ae5739da9b5f8143f | 080ffc71e7d38a96d3ff78cc88b6e1f7cd1616e3 | /app/src/main/java/com/example/larry_sea/norember/view/fragment/SurePasswordFragment.java | ddd25d07c97fa2d8255b01c23dccfa89554b07ed | [] | no_license | luoyiqi/norember | fa305318b546f9d0b6d597cc7dcef814e0f1e923 | b34f9af046a6c4ddad4b34d2b9e77dfad9d2f360 | refs/heads/master | 2021-07-16T12:21:53.860727 | 2017-10-22T15:05:24 | 2017-10-22T15:05:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,546 | java | package com.example.larry_sea.norember.view.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.larry_sea.norember.MainActivity;
import com.example.larry_sea.norember.R;
import com.example.larry_sea.norember.manager.PasswordManager;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* Created by Larry-sea on 10/14/2016.
* <p>
* 确认用户密码的fragment
*/
public class SurePasswordFragment extends Fragment {
@BindView(R.id.id_sure_main_password_next_btn)
Button idSureMainPasswordNextBtn;
@BindView(R.id.id_sure_main_password_et)
EditText idSureMainPasswordEt;
@OnClick(R.id.id_sure_main_password_next_btn)
void onClick(View view) {
if (PasswordManager.getFirstPassword().equals(idSureMainPasswordEt.getText().toString())) {
getActivity().finish();
startActivity(new Intent(getActivity(), MainActivity.class));
PasswordManager.savePassword(getActivity(), idSureMainPasswordEt.getText().toString());
} else {
Toast.makeText(getActivity(), R.string.twice_password_not_same, Toast.LENGTH_SHORT).show();
}
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sure_password, container, false);
ButterKnife.bind(this, view);
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
bindListener();
}
/*
* 绑定监听器
*
* */
private void bindListener() {
idSureMainPasswordEt.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (count > 0) {
idSureMainPasswordNextBtn.setEnabled(true);
} else {
idSureMainPasswordNextBtn.setEnabled(false);
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
@Override
public void onResume() {
super.onResume();
Handler handler = new Handler();
handler.postAtTime(new Runnable() {
@Override
public void run() {
idSureMainPasswordEt.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, idSureMainPasswordEt.getLeft() + 5, idSureMainPasswordEt.getTop() + 5, 0));
idSureMainPasswordEt.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, idSureMainPasswordEt.getLeft() + 5, idSureMainPasswordEt.getTop() + 5, 0));
}
}, 500);
}
}
| [
"lzh1994610@163.com"
] | lzh1994610@163.com |
1c702f163221d9a7611da9d0262b253a269ff00b | 48aeb1f7b8b8dec1db0fe489f7fb1035b75c4384 | /java/news-analysis/src/main/java/com/imaginea/dc/mahout/model/MahoutCauseClassifierModelBuilder.java | 54ecbe5ddd22560b705e5bc91d2b9eb85242af3d | [] | no_license | finder518/LearnR | 8e8f23d38eb25e7d989b53cb076eb91f6d6bac97 | b60c9cf3e87eafc7a3ea1dcc760ae700432b20a3 | refs/heads/master | 2021-01-21T16:53:53.643212 | 2015-02-10T19:37:21 | 2015-02-10T19:37:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,977 | java | package com.imaginea.dc.mahout.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.imaginea.dc.mahout.model.buider.MahoutClassifierModelBuilder;
import com.imaginea.dc.mahout.model.buider.ModelBuilderException;
import com.imaginea.dc.mahout.model.buider.TableInputCauseNBClassifierModelBuilder;
import com.imaginea.dc.service.NewsArticleService;
import com.imaginea.dc.service.impl.NewsArticleServiceImpl;
import com.imaginea.dc.utils.MessageUtil;
public class MahoutCauseClassifierModelBuilder {
private NewsArticleService newsArticleService;
private final Logger LOGGER = LoggerFactory.getLogger(NewsArticleServiceImpl.class);
public void buildDeathCauseClassifierModel() {
try {
// get the property value and print it out
//String hdfsName = prop.getProperty("hdfs.name");
//String hdfsURI = prop.getProperty("hdfs.uri");
//String hdfsBaseDir = prop.getProperty("hdfs.base.dir");
String localBaseDir = MessageUtil.getMessage("local.base.dir");
String localInputSeqFileName = localBaseDir + MessageUtil.getMessage("model1.local.input.sequence.filename");
String localVectorOutputFileDir = localBaseDir + MessageUtil.getMessage("model1.local.output.vector.filedir");
String localModelOutputFileDir = localBaseDir + MessageUtil.getMessage("model1.local.output.model.filedir");
String luceneAnalyser = MessageUtil.getMessage("model1.lucene.analyser");
MahoutClassifierModelBuilder template = new TableInputCauseNBClassifierModelBuilder(newsArticleService,
localInputSeqFileName, localVectorOutputFileDir, localModelOutputFileDir, luceneAnalyser);
template.buildModel();
} catch (ModelBuilderException e) {
LOGGER.error("Error building the model", e);
}
}
public NewsArticleService getNewsArticleService() {
return newsArticleService;
}
public void setNewsArticleService(NewsArticleService newsArticleService) {
this.newsArticleService = newsArticleService;
}
}
| [
"gowrishankar.milli@gmail.com"
] | gowrishankar.milli@gmail.com |
c890229e71b21b9878bd603b9901ce91532148c4 | d8d85cc368d0e226e8a51c2c4d5d33adebf7dec5 | /src/control/PSO.java | 0ad3a76829fdfed5f37011c2b82a22f9ce7e5873 | [] | no_license | azhry/c45-pso-java | bd2cd6e809f458622b1045a9e00e8b6ddaf9e081 | 07ee34b4e79112906cc3372c7d087e4b0ef96da2 | refs/heads/master | 2020-04-29T09:01:34.494227 | 2019-05-12T06:32:04 | 2019-05-12T06:32:04 | 176,008,345 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,379 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package control;
import entity.Data;
import entity.Particle;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
*
* @author Azhary Arliansyah
*/
public class PSO {
private int particleSize;
private int populationSize;
private int numIteration;
private double c1;
private double c2;
private double target;
private List<Particle> particles = new ArrayList<>();
private List<Particle> iterationBest = new ArrayList<>();
public PSO(int particleSize, int populationSize, int numIteration,
double c1, double c2, double target) {
this.particleSize = particleSize;
this.populationSize = populationSize;
this.numIteration = numIteration;
this.c1 = c1;
this.c2 = c2;
this.target = target;
for (int i = 0; i < populationSize; i++) {
this.particles.add(new Particle(particleSize));
}
}
public Particle exec(List<Data> train, List<Data> test) {
for (int i = 0; i < this.numIteration; i++) {
System.out.println("ITERATION: " + (i + 1));
for (int j = 0; j < this.populationSize; j++) {
this.particles.get(j).calculateBest(train, test);
this.particles.get(j).tentMap();
System.out.println("\tPARTICLE " + (j + 1) + ": " +
this.particles.get(j).getBest());
}
Collections.sort(this.particles);
this.iterationBest.add(this.particles.get(0));
System.out.println("\tBEST PARTICLE: " +
this.particles.get(0).getBest());
if (this.particles.get(0).getBest() > this.target) {
return this.particles.get(0);
}
for (int j = 0; j < this.populationSize; j++) {
this.particles.get(j).updateVelocity(this.c1, this.c2,
this.particles.get(0).getPosition());
this.particles.get(j).updatePosition();
}
}
Collections.sort(this.iterationBest);
return this.iterationBest.get(0);
}
}
| [
"arliansyah_azhary@yahoo.com"
] | arliansyah_azhary@yahoo.com |
d0173f5a282b17daf9b97f29ae879161d6201a8f | 1b038a35554f14511f20f01552694132d8136992 | /src/main/java/com/channelize/apisdk/network/mqtt/ChannelizeConnectionHandler.java | 502836efd8dcf3bdeaad95481be7dc447c1020b4 | [] | no_license | Vaibhavbairagi/ChannelizeAPI | eaf3208a78c7c83b1beef44820f8eb5d00902eab | 12f7f1d1ab77e9db878c881396e9923011d5cfab | refs/heads/main | 2022-12-22T17:30:20.470111 | 2020-10-05T05:36:44 | 2020-10-05T05:36:44 | 300,605,533 | 1 | 0 | null | 2020-10-02T12:20:23 | 2020-10-02T12:20:22 | null | UTF-8 | Java | false | false | 1,187 | java | package com.channelize.apisdk.network.mqtt;
/**
* The {@link ChannelizeConnectionHandler} class contains all the real time events related to user/conversation/connection which can be arrived when app is active.
* But all the methods are optional and they need to be added according to the need,
* {@link ChannelizeConnectionHandler#onRealTimeDataUpdate can be override if you want to modify the real time data according to your need}
*/
public interface ChannelizeConnectionHandler {
/**
* Method gets invoked when the mqtt lost the connection.
*/
default void onDisconnected() {
}
/**
* Method gets invoked when the mqtt connection established.
*/
default void onConnected() {
}
/**
* This method is universal and gets invoked for every kind of real time updates.
* If you want to modify the real time data then you can override this method.
*
* @param topic Topic for which the real time updated has came.
* @param responseMessage Complete response that has been arrived for real time update.
*/
default void onRealTimeDataUpdate(String topic, String responseMessage) {
}
}
| [
"vaibhavbairagi105@gmail.com"
] | vaibhavbairagi105@gmail.com |
c70dc86b771598f2430f5f19e18528218f9345af | e7d44a7762bd1e345a36f38ba80feefa284ce56c | /rest-common/src/main/java/org/eclipse/stardust/ui/web/rest/service/dto/InfoDTO.java | 671cfbd77980a0230d0f7f3778384a0506d6d573 | [] | no_license | robsman/stardust.ui.web | 3463f16f010b23a1dd8efed073b0e09b82801ef6 | c6e670f98ef84a2e589971751a4571c42127d89e | refs/heads/master | 2021-01-01T19:48:26.459865 | 2016-02-22T15:24:18 | 2016-02-22T15:24:18 | 11,172,029 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package org.eclipse.stardust.ui.web.rest.service.dto;
import org.eclipse.stardust.ui.web.rest.service.dto.common.DTOClass;
@DTOClass
public class InfoDTO extends AbstractDTO
{
public static enum MessageType {
INFO, WARNING, ERROR
}
public MessageType messageType;
public String details;
public InfoDTO(MessageType messageType, String details)
{
super();
this.messageType = messageType;
this.details = details;
}
}
| [
"anoop.nair@sungard.com"
] | anoop.nair@sungard.com |
34c4c5f66b997a955cb5c78819ed12351d98c8c0 | 380c81f3fd877c7d1347b973a3c43c46a8d110a9 | /merchandise.web/src/test/java/de/mq/merchandise/subject/support/ConditionToContainerConverterTest.java | 2a424d6bcb8e635fe9eeac9fba94e409569f3ccf | [] | no_license | mquasten/merchandise | f5a84293b154bee371f2e6cbe12e51210ad8b0c9 | 3e2b7ec0bc9faea98e15d63ad94eafa67ce19010 | refs/heads/master | 2016-09-06T04:39:44.389367 | 2016-03-08T20:49:49 | 2016-03-08T20:49:49 | 8,311,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,904 | java | package de.mq.merchandise.subject.support;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.BeanUtils;
import org.springframework.core.convert.converter.Converter;
import org.springframework.test.util.ReflectionTestUtils;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
import de.mq.merchandise.subject.Condition;
public class ConditionToContainerConverterTest {
private static final String CONDITION_QUALITY = "Quality";
private static final long ID = 19680528L;
private final Converter<Collection<Condition>, Container> converter = new ConditionToContainerConverter();
@Test
public final void convert() {
final Collection<Condition> conditions = new ArrayList<>();
final Condition condition = new ConditionImpl(Mockito.mock(SubjectImpl.class), CONDITION_QUALITY, ConditionDataType.String);
ReflectionTestUtils.setField(condition, "id", ID);
conditions.add(condition);
final Container results = converter.convert(conditions);
Assert.assertEquals(1, results.getItemIds().size());
final Optional<?> id = (Optional<?>) results.getItemIds().stream().findFirst();
Assert.assertTrue(id.isPresent());
final Item item = results.getItem(id.get());
Assert.assertEquals(condition.id().get(), item.getItemProperty(ConditionCols.Id).getValue());
Assert.assertEquals(condition.conditionDataType(), item.getItemProperty(ConditionCols.DataType).getValue());
Assert.assertEquals(condition.conditionType(), item.getItemProperty(ConditionCols.ConditionType).getValue());
}
@Test
public final void convertNulls() {
final Collection<Condition> conditions = new ArrayList<>();
final Condition condition = BeanUtils.instantiateClass(ConditionImpl.class);
conditions.add(condition);
final Container results = converter.convert(conditions);
Assert.assertEquals(1, results.getItemIds().size());
final Optional<?> id = (Optional<?>) results.getItemIds().stream().findFirst();
Assert.assertTrue(id.isPresent());
final Item item = results.getItem(id.get());
Arrays.asList(ConditionCols.values()).stream().forEach(col -> Assert.assertEquals(col.nvl(), item.getItemProperty(col).getValue()));
}
@SuppressWarnings("unchecked")
@Test
public final void convertHibernateProxy() {
final HibernateProxy proxy = Mockito.mock(HibernateProxy.class);
final LazyInitializer lazyInitializer = Mockito.mock(LazyInitializer.class);
final Condition condition = new ConditionImpl(Mockito.mock(SubjectImpl.class), CONDITION_QUALITY, ConditionDataType.String);
ReflectionTestUtils.setField(condition, "id", ID);
Mockito.when(lazyInitializer.getImplementation()).thenReturn(condition);
Mockito.when(proxy.getHibernateLazyInitializer()).thenReturn(lazyInitializer);
@SuppressWarnings("rawtypes")
final Collection conditions = new ArrayList<>();
conditions.add( proxy);
final Container results = converter.convert(conditions);
Assert.assertEquals(1, results.getItemIds().size());
final Optional<?> id = (Optional<?>) results.getItemIds().stream().findFirst();
Assert.assertTrue(id.isPresent());
final Item item = results.getItem(id.get());
Assert.assertEquals(condition.id().get(), item.getItemProperty(ConditionCols.Id).getValue());
Assert.assertEquals(condition.conditionDataType(), item.getItemProperty(ConditionCols.DataType).getValue());
Assert.assertEquals(condition.conditionType(), item.getItemProperty(ConditionCols.ConditionType).getValue());
Mockito.verify(proxy).getHibernateLazyInitializer();
Mockito.verify(lazyInitializer).getImplementation();
}
}
| [
"manfred.quasten@arcor.de"
] | manfred.quasten@arcor.de |
ca86be202529c9822b388fc316659e3f0a75165a | 8ecd7816544483fa7680966e70a3bb6fb7fb09d0 | /CoreGame/src/main/java/com/game/manager/DBServiceManager.java | 347bdad33b80ba68f6e6e967fc4c87bd300e2302 | [] | no_license | billee1011/LGameQiPai | d99fc66bdab8fd9c60378b6b95a829a4c2679ef4 | 67c91f888ba7c0b9c636c608b8c0d7d3fb72f2eb | refs/heads/master | 2021-04-09T17:03:55.541135 | 2017-07-24T01:49:27 | 2017-07-24T01:49:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,376 | java | package com.game.manager;
import com.game.core.dao.mysql.ServerService;
import com.game.core.dao.mysql.UserDao;
import com.game.core.dao.redis.GameRedis;
import com.game.core.dao.redis.UserRedis;
import com.game.core.service.UserService;
import com.game.core.service.impl.UserServiceImpl;
import com.lgame.util.comm.StringTool;
import com.lgame.util.file.PropertiesTool;
import com.lgame.util.json.JsonUtil;
import com.logger.log.SystemLogger;
import com.lsocket.config.SocketConfig;
import com.lsocket.core.ICommon;
import com.lsocket.module.IP;
import com.lsocket.util.SocketConstant;
import com.module.GameServer;
import com.module.ServerGroup;
import com.mysql.impl.SqlPool;
import com.redis.impl.RedisConnectionManager;
import java.util.Enumeration;
import java.util.Properties;
/**
* Created by Administrator on 2017/4/14.
*/
public class DBServiceManager extends ICommon {
private static DBServiceManager dbServiceManager = null;
private DBServiceManager(){
}
public synchronized static DBServiceManager getInstance(){
if(dbServiceManager != null){
return dbServiceManager;
}
dbServiceManager = new DBServiceManager();
return dbServiceManager;
}
private SqlPool commUserPool;//用户中心数据连接池
private SqlPool commGamePool;//游戏数据连接池
private GameServer gameServer;
private ServerGroup serverGroup;
private ServerService serverService;
private UserRedis userRedis;
private GameRedis gameRedis;
private UserService userService;
// private UserDao userDao;
private Properties getProperties(SqlPool.DataSourceType sourceType){
if(sourceType == SqlPool.DataSourceType.Druid){
return PropertiesTool.loadProperty("druid_db.properties");
}
return PropertiesTool.loadProperty("hikari_db.properties");
}
private Properties resetProper(Properties dbProper) {
dbProper.setProperty("username",serverGroup.getSqlUserName());
dbProper.setProperty("password",serverGroup.getSqlPwd());
if(StringTool.isNotNull(dbProper.getProperty("jdbcUrl"))){
dbProper.setProperty("jdbcUrl",serverGroup.getSqlUrl());
}else {
dbProper.setProperty("url",serverGroup.getSqlUrl());
}
return dbProper;
}
private void loadConfig(){
SocketConfig socketConfig = SocketConfig.getInstance();
SqlPool.DataSourceType sourceType = SqlPool.DataSourceType.valueOf(socketConfig.getDbType());
if(sourceType == null){
throw new RuntimeException(socketConfig.getDbType()+" can not find in DataSourceType");
}
Properties dbProper = getProperties(sourceType);
commUserPool = new SqlPool(sourceType,dbProper);
serverService = new ServerService(commUserPool);
gameServer = serverService.getServerById(socketConfig.getServerId());
if(gameServer == null){
throw new RuntimeException(socketConfig.getServerId()+" cant find from db");
}else {
SystemLogger.info(this.getClass(),"localhost:"+gameServer.getIp()+" serverType:"+gameServer.getServerType());
}
/* if(gameServer.getServerType() != GameServer.ServerType.gate){
throw new RuntimeException(socketConfig.getServerId()+" serverType:"+gameServer.getServerType());
}*/
serverGroup = serverService.getServerGroup(gameServer.getGroupNum());
if(serverGroup == null){
throw new RuntimeException("can not find goupNum:"+gameServer.getGroupNum() + " in serverGroup db");
}
dbProper = resetProper(dbProper);
commGamePool = new SqlPool(sourceType,dbProper);
SocketConstant.init(new IP(gameServer.getIp(),gameServer.getPort()),socketConfig.getMaxSocketLength(),socketConfig.getMaxQuqueVistor(),socketConfig.getSameIpMaxConnections());
}
protected void initService(){
loadConfig();
Properties redisProperties = PropertiesTool.loadProperty("redis.properties");
RedisConnectionManager redisUserConnectionManager = new RedisConnectionManager(redisProperties);
userRedis = new UserRedis(redisUserConnectionManager);
this.userService = new UserServiceImpl(new UserDao(commUserPool,commGamePool),userRedis);
Properties masterProperties = new Properties(redisProperties);
masterProperties.setProperty("url",serverGroup.getRedisUrl()+"/"+(StringTool.isEmpty(serverGroup.getRedisPwd())?"":serverGroup.getRedisPwd()));
RedisConnectionManager gameRedisConnectionManager = new RedisConnectionManager(masterProperties);
gameRedis = new GameRedis(gameRedisConnectionManager);
}
@Override
protected void check() {
}
public SqlPool getCommUserPool() {
return commUserPool;
}
public SqlPool getCommGamePool() {
return commGamePool;
}
public GameServer getGameServer() {
return gameServer;
}
public ServerGroup getServerGroup() {
return serverGroup;
}
public ServerService getServerService() {
return serverService;
}
public UserService getUserService() {
return userService;
}
public UserRedis getUserRedis() {
return userRedis;
}
public GameRedis getGameRedis() {
return gameRedis;
}
}
| [
"wlvxiaohui@163.com"
] | wlvxiaohui@163.com |
2e5640fc9d66d098203f4fac62e0945b299b2de0 | bfdfa7da398a9d95cb38d4c7148f5c43565718ff | /integration/boofcv-swing/src/main/java/boofcv/gui/image/SaveImageOnClick.java | c42d2d79c2cca25e3d92d4aaedd99044071e8c55 | [
"Apache-2.0",
"LicenseRef-scancode-takuya-ooura"
] | permissive | tandygong/BoofCV | 85d1e2946f235ce509b0caefc6921ccfeae0a303 | d6aec5817db6b7efad5da4701487ceddf18da9c4 | refs/heads/master | 2021-05-09T07:38:22.957727 | 2018-01-20T16:05:36 | 2018-01-20T16:05:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,279 | java | /*
* Copyright (c) 2011-2017, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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 boofcv.gui.image;
import boofcv.io.image.UtilImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
/**
* Renders what's currently visible in the component and saves to disk. Opens a dialog to let the user know what's going
* on and provides the open to silently save in the future.
*
* @author Peter Abeles
*/
public class SaveImageOnClick extends MouseAdapter {
private static int saveCounter = 0;
private static boolean hideSaveDialog = false;
Component parent;
public SaveImageOnClick(Component parent) {
this.parent = parent;
}
@Override
public void mouseClicked(MouseEvent e) {
boolean clicked = SwingUtilities.isMiddleMouseButton(e);
if( clicked ) {
String fileName = String.format("saved_image%03d.png",saveCounter++);
System.out.println("Image saved to "+fileName);
BufferedImage output = getBufferedImage();
UtilImageIO.saveImage(output, fileName);
if( hideSaveDialog )
return;
Object[] options = {"Hide in Future","OK"};
int n = JOptionPane.showOptionDialog(parent,
"Saved image to "+fileName,
"Middle Mouse Click Image Saving",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[1]);
if( n == 0 )
hideSaveDialog = true;
}
}
protected BufferedImage getBufferedImage() {
BufferedImage output = new BufferedImage(parent.getWidth(),parent.getHeight(), BufferedImage.TYPE_INT_BGR);
parent.paint(output.createGraphics());
return output;
}
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
096867fade1eef55c40c159a7c605367bb70f1e8 | ca7da6499e839c5d12eb475abe019370d5dd557d | /spring-web/src/main/java/org/springframework/http/converter/xml/AbstractJaxb2HttpMessageConverter.java | b7b77730a24ec239762845460268a8f52606b467 | [
"Apache-2.0"
] | permissive | yangfancoming/spring-5.1.x | 19d423f96627636a01222ba747f951a0de83c7cd | db4c2cbcaf8ba58f43463eff865d46bdbd742064 | refs/heads/master | 2021-12-28T16:21:26.101946 | 2021-12-22T08:55:13 | 2021-12-22T08:55:13 | 194,103,586 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,531 | java |
package org.springframework.http.converter.xml;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.springframework.http.converter.HttpMessageConversionException;
import org.springframework.util.Assert;
/**
* Abstract base class for {@link org.springframework.http.converter.HttpMessageConverter HttpMessageConverters}
* that use JAXB2. Creates {@link JAXBContext} object lazily.
*
* @author Arjen Poutsma
*
* @since 3.0
* @param <T> the converted object type
*/
public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHttpMessageConverter<T> {
private final ConcurrentMap<Class<?>, JAXBContext> jaxbContexts = new ConcurrentHashMap<>(64);
/**
* Create a new {@link Marshaller} for the given class.
* @param clazz the class to create the marshaller for
* @return the {@code Marshaller}
* @throws HttpMessageConversionException in case of JAXB errors
*/
protected final Marshaller createMarshaller(Class<?> clazz) {
try {
JAXBContext jaxbContext = getJaxbContext(clazz);
Marshaller marshaller = jaxbContext.createMarshaller();
customizeMarshaller(marshaller);
return marshaller;
}
catch (JAXBException ex) {
throw new HttpMessageConversionException(
"Could not create Marshaller for class [" + clazz + "]: " + ex.getMessage(), ex);
}
}
/**
* Customize the {@link Marshaller} created by this
* message converter before using it to write the object to the output.
* @param marshaller the marshaller to customize
* @since 4.0.3
* @see #createMarshaller(Class)
*/
protected void customizeMarshaller(Marshaller marshaller) {
}
/**
* Create a new {@link Unmarshaller} for the given class.
* @param clazz the class to create the unmarshaller for
* @return the {@code Unmarshaller}
* @throws HttpMessageConversionException in case of JAXB errors
*/
protected final Unmarshaller createUnmarshaller(Class<?> clazz) {
try {
JAXBContext jaxbContext = getJaxbContext(clazz);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
customizeUnmarshaller(unmarshaller);
return unmarshaller;
}
catch (JAXBException ex) {
throw new HttpMessageConversionException(
"Could not create Unmarshaller for class [" + clazz + "]: " + ex.getMessage(), ex);
}
}
/**
* Customize the {@link Unmarshaller} created by this
* message converter before using it to read the object from the input.
* @param unmarshaller the unmarshaller to customize
* @since 4.0.3
* @see #createUnmarshaller(Class)
*/
protected void customizeUnmarshaller(Unmarshaller unmarshaller) {
}
/**
* Return a {@link JAXBContext} for the given class.
* @param clazz the class to return the context for
* @return the {@code JAXBContext}
* @throws HttpMessageConversionException in case of JAXB errors
*/
protected final JAXBContext getJaxbContext(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
JAXBContext jaxbContext = this.jaxbContexts.get(clazz);
if (jaxbContext == null) {
try {
jaxbContext = JAXBContext.newInstance(clazz);
this.jaxbContexts.putIfAbsent(clazz, jaxbContext);
}
catch (JAXBException ex) {
throw new HttpMessageConversionException(
"Could not instantiate JAXBContext for class [" + clazz + "]: " + ex.getMessage(), ex);
}
}
return jaxbContext;
}
}
| [
"34465021+jwfl724168@users.noreply.github.com"
] | 34465021+jwfl724168@users.noreply.github.com |
3cac142975a6ae2c4c3452027aab4e08327c53a1 | 2451bd112c3df3ac03ee23b94eea7b91d9ffb1da | /app/src/main/java/larissa/l/ComponenteView.java | 21144161b6c57c38838687364c651108baee718e | [] | no_license | larissajunges/AulaInternacionalizacao | afa3d07adc3881de67946d85811411b9024c67dc | b4747cecbef804426afae960c4a9e4b1b831942e | refs/heads/master | 2021-03-10T08:14:05.891846 | 2020-03-11T00:56:54 | 2020-03-11T00:56:54 | 246,437,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package larissa.l;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ComponenteView extends AppCompatActivity {
@Override
protected void OnCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_component_view);
}
}
| [
"adsroot.aluno.ifsc.edu.br"
] | adsroot.aluno.ifsc.edu.br |
697ddb31e550ff539a370fc6e62ee8d500b4983c | 288260ed44ef42efada277d43b9258316e5854d6 | /src/jp/ne/sakura/snowman8765/simple_concentration/MainActivity.java | 9037103bb1225814e5a5dc417c4999f14550a4ca | [] | no_license | snowman8765/simple_concentration | c0ca1b8c024b77430f00c6f9be0f5b248ea89cb7 | cbd3dc4bd79f5307449ed3f47fc6be271c39ffa8 | refs/heads/master | 2021-01-15T18:50:52.717873 | 2014-07-09T10:25:41 | 2014-07-09T10:25:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,934 | java | package jp.ne.sakura.snowman8765.simple_concentration;
import jp.maru.scorecenter.ScoreCenter;
import android.app.Activity;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
public class MainActivity extends Activity {
public int disp_w, disp_h;
public ScoreCenter scoreCenter;
// Log用のTAG
private static final String TAG = MainActivity.class.getSimpleName();
// BackボタンPress時の有効タイマー
private CountDownTimer keyEventTimer;
// 一度目のBackボタンが押されたかどうかを判定するフラグ
private boolean pressed = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = getWindow();
window.setFormat(PixelFormat.TRANSLUCENT);
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
WindowManager manager = window.getWindowManager();
Display disp = manager.getDefaultDisplay();
Display display = getWindowManager().getDefaultDisplay();
if (Integer.valueOf(android.os.Build.VERSION.SDK_INT) < 13) {
disp_w = display.getWidth();
disp_w = display.getHeight();
} else {
Point size = new Point();
disp.getSize(size);
disp_w = size.x;
disp_h = size.y;
}
// onFinish(), onTick()
keyEventTimer = new CountDownTimer(1000, 100) {
@Override
public void onTick(long millisUntilFinished) {
Log.d(TAG, "call onTick method");
}
@Override
public void onFinish() {
pressed = false;
}
};
scoreCenter = ScoreCenter.getInstance();
scoreCenter.initialize(getApplicationContext());
// scoreCenter.setLogEnable(true);
// scoreCenter.setKeepViewCacheEnable(true);
setContentView(new MainLoop(this));
// setContentView(R.layout.activity_main);
scoreCenter.hello();
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Backボタン検知
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
if (!pressed) {
// Timerを開始
keyEventTimer.cancel(); // いらない?
keyEventTimer.start();
// 終了する場合, もう一度タップするようにメッセージを出力する
Toast.makeText(this, "終了する場合は、もう一度バックボタンを押してください",
Toast.LENGTH_SHORT).show();
pressed = true;
return false;
}
// pressed=trueの時、通常のBackボタンで終了処理.
return super.dispatchKeyEvent(event);
}
// Backボタンに関わらないボタンが押された場合は、通常処理.
return super.dispatchKeyEvent(event);
}
}
| [
"snowman8765@gmail.com"
] | snowman8765@gmail.com |
be17781251e63a806854cf0e3777a2a6cdcea218 | 9fb771ee68767865323f2b7d68ac276db6ea1f08 | /microservice-authentication/src/main/java/de/wieczorek/chart/core/ui/AuthenticationResource.java | fa2893726adafe79fe5321cd2bac6dec5d2b9a6b | [] | no_license | DanielWieczorek/RSS-Grabber | 4acaf07ebb94f520a26e0d3709a787600e26fb82 | dd32cf4a0b432209462f1d54c8815ab1f28bd9f0 | refs/heads/master | 2021-09-24T12:22:51.534699 | 2021-09-18T16:05:10 | 2021-09-18T16:05:10 | 122,782,760 | 0 | 1 | null | 2021-03-08T20:01:14 | 2018-02-24T21:48:03 | Java | UTF-8 | Java | false | false | 2,355 | java | package de.wieczorek.chart.core.ui;
import de.wieczorek.chart.core.business.Controller;
import de.wieczorek.core.persistence.EntityManagerContext;
import de.wieczorek.core.ui.Resource;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import java.util.List;
import java.util.regex.Pattern;
@Resource
@ApplicationScoped
@EntityManagerContext
@Path("/")
public class AuthenticationResource {
@Inject
private Controller controller;
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("login")
public String login(@Context HttpHeaders headers) throws NoSuchAlgorithmException {
List<String> authHeader = headers.getRequestHeader(HttpHeaders.AUTHORIZATION);
if (authHeader == null || authHeader.isEmpty()) {
throw new BadRequestException("Missing authentication data");
}
String[] authData = headers.getRequestHeader(HttpHeaders.AUTHORIZATION).get(0).split(" ");
if (authData.length < 2) {
throw new BadRequestException("Missing authentication data");
}
String authType = authData[0];
if (authType.equals("Basic")) {
String authString = authData[1];
authString = new String(Base64.getDecoder().decode(authString), Charset.forName("ascii"));
String[] credentials = authString.split(Pattern.quote(":"));
if (credentials.length == 2) {
return controller.login(credentials[0], credentials[1]);
}
throw new BadRequestException("Invalid authentication data");
}
throw new BadRequestException("Invalid authentication type");
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("logout")
public void logout(SessionInfo info) {
controller.logout(info.getUsername(), info.getToken());
}
@POST
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_JSON)
@Path("validate")
public String isSessionValid(SessionInfo info) {
return controller.isSessionValid(info.getUsername(), info.getToken()) ? "true" : "false";
}
}
| [
"daniel.wieczorek0@googlemail.com"
] | daniel.wieczorek0@googlemail.com |
10e520458b143a3eb8957e9ba814176a50aa311a | f94d659ab01d967cb353e92bd8b2cb1ea6a4e695 | /android/Golf/src/com/jason/network/HttpResponse.java | 6bb9cb888dd3ad910db7f48aed98c7f43e0e73d3 | [] | no_license | sudk/golf | e3edb4ca03dd59ec85ba37f67cac54a72b9693d8 | 27747105e52aa746849fa3686405d3af14e41724 | refs/heads/master | 2020-12-24T15:22:25.691915 | 2015-03-24T00:56:49 | 2015-03-24T00:56:49 | 18,541,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package com.jason.network;
public class HttpResponse {
public int responseCode;
public String content;
}
| [
"jason@JasontekiMacBook-Pro.local"
] | jason@JasontekiMacBook-Pro.local |
d7a64b56685686023fc88d76989c3d2618464b3d | 78693f4e722d5c23e2124613a8c22d6101d35702 | /aptina/aptina-beans/src/main/java/org/seasar/aptina/beans/JavaBean.java | 5a62fbc65b5af20433091c4b88ca8a988ce08426 | [
"Apache-2.0"
] | permissive | seasarorg/aptina | febc9802b4f0c00ee9c89087bce6c5afbe2cfa95 | a454c22094d82a1c9be90a10f47c78fc6fa556c7 | refs/heads/master | 2021-01-23T22:39:12.510250 | 2013-10-04T02:32:22 | 2013-10-04T02:32:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,007 | java | /*
* Copyright 2004-2010 the Seasar Foundation and the Others.
*
* 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.seasar.aptina.beans;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Aptina Beans によって {@link BeanState} で注釈されたクラスから生成された JavaBeans であることを示す注釈です.
* <p>
* 生成される Bean クラスは状態クラスと同じパッケージに生成されます. Bean クラスの名前は次のようになります.
* </p>
* <dl>
* <dt>状態クラスの名前が {@code Abstract} で始まっている場合</dt>
* <dd>状態クラスの名前の先頭から {@code Abstract} を除去した名前になります.</dd>
* <dt>状態クラスの名前が {@code State} で終わっている場合</dt>
* <dd>状態クラスの名前の末尾から {@code State} を除去した名前になります.</dd>
* <dt>状態クラスの名前が {@code Bean} で終わっている場合</dt>
* <dd>状態クラスの名前の末尾に {@code Impl} を付加した名前になります.</dd>
* <dt>その他の場合</dt>
* <dd>状態クラスの名前の末尾に {@code Bean} を付加した名前になります.</dd>
* </dl>
* <p>
* 例
* </p>
* <table border="1">
* <tr>
* <th>状態クラスの名前</th>
* <th>生成される Bean クラスの名前</th>
* </tr>
* <tr>
* <td>{@code AbstractHogeBean}</td>
* <td>{@code HogeBean}</td>
* </tr>
* <tr>
* <td>{@code HogeBeanState}</td>
* <td>{@code HogeBean}</td>
* </tr>
* <tr>
* <td>{@code HogeBean}</td>
* <td>{@code HogeBeanImpl}</td>
* </tr>
* <tr>
* <td>{@code Hoge}</td>
* <td>{@code HogeBean}</td>
* </tr>
* </table>
* <h3>プロパティ</h3>
* <p>
* Bean クラスは, 状態クラスのフィールドに対する getter/setter メソッドを持ちます.
* </p>
* <h3>コンストラクタ</h3>
* <p>
* Bean クラスは状態クラスの非 {@code private} コンストラクタを引き継ぎます.
* 引き継ぐことのできるコンストラクタが一つもない場合はエラーとなります.
* </p>
*
* @author koichik
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
@Documented
public @interface JavaBean {
}
| [
"koichik@improvement.jp"
] | koichik@improvement.jp |
13a194a7b866c611841da81e697ca676544e01ab | 33a40d1cd5e52c9ec96514c68d5384505d9f0202 | /achilles-core/src/test/java/info/archinnov/achilles/junit/AchillesTestResourceTest.java | 0ae45d1e47b3d002022f57d8d6bd3ec1d7e01bed | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | mboudraa/Achilles | 87271fc1c8a141aac8dca1b540d1dcd1beb7c472 | 80d1ee7baa04e11fad17eff152175dcda5c816bc | refs/heads/master | 2021-01-20T11:50:10.246889 | 2013-09-03T20:32:17 | 2013-09-03T20:32:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,177 | java | package info.archinnov.achilles.junit;
import static org.fest.assertions.api.Assertions.assertThat;
import info.archinnov.achilles.junit.AchillesTestResource.Steps;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class AchillesTestResourceTest {
private AchillesTestResource resource;
@Test
public void should_trigger_before_and_after_when_steps_is_both() throws Throwable
{
final StringBuilder witness = new StringBuilder();
resource = new AchillesTestResource(Steps.BOTH, "table")
{
@Override
protected void truncateTables() {
witness.append("called");
}
};
resource.before();
assertThat(witness.toString()).isEqualTo("called");
witness.delete(0, witness.length());
resource.after();
assertThat(witness.toString()).isEqualTo("called");
}
@Test
public void should_trigger_only_before_when_steps_is_before() throws Throwable
{
final StringBuilder witness = new StringBuilder();
resource = new AchillesTestResource(Steps.BEFORE_TEST, "table")
{
@Override
protected void truncateTables() {
witness.append("called");
}
};
resource.before();
assertThat(witness.toString()).isEqualTo("called");
witness.delete(0, witness.length());
resource.after();
assertThat(witness.toString()).isEmpty();
}
@Test
public void should_trigger_only_after_when_steps_is_after() throws Throwable
{
final StringBuilder witness = new StringBuilder();
resource = new AchillesTestResource(Steps.AFTER_TEST, "table")
{
@Override
protected void truncateTables() {
witness.append("called");
}
};
resource.after();
assertThat(witness.toString()).isEqualTo("called");
witness.delete(0, witness.length());
resource.before();
assertThat(witness.toString()).isEmpty();
}
}
| [
"doanduyhai@gmail.com"
] | doanduyhai@gmail.com |
39a9b1d727e5a5dedcf950b9d335212a466b797c | a1b80a8b99dc9dda23690382a27043fa7c38ee04 | /src/main/java/de/fraunhofer/iais/eis/AppStoreBuilder.java | 0874799a00b845502fd07469e3ad00035c56f1be | [] | no_license | ashokkumarta/infomodel | 35cbf78847f835f9cc16fa37949ef8bd81a16078 | 475c1d8c081024e439763e9044785ade427831a9 | refs/heads/main | 2023-06-24T14:21:10.937026 | 2021-07-17T09:17:54 | 2021-07-17T09:17:54 | 386,892,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,661 | java | package de.fraunhofer.iais.eis;
import de.fraunhofer.iais.eis.util.*;
import de.fraunhofer.iais.eis.*;
import javax.xml.datatype.XMLGregorianCalendar;
import java.lang.String;
import java.math.BigInteger;
import java.net.URL;
import java.net.URI;
import java.util.*;
import javax.validation.constraints.*;
import java.util.Arrays;
import java.io.Serializable;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.*;
public class AppStoreBuilder {
private AppStoreImpl appStoreImpl;
public AppStoreBuilder() {
appStoreImpl = new AppStoreImpl();
}
public AppStoreBuilder(@javax.validation.constraints.NotNull URI id) {
this();
appStoreImpl.id = id;
}
final public AppStoreBuilder _hasEndpoint_(java.util.ArrayList<? extends ConnectorEndpoint> _hasEndpoint_) {
this.appStoreImpl._hasEndpoint = _hasEndpoint_;
return this;
}
final public AppStoreBuilder _hasAgent_(java.util.ArrayList<? extends URI> _hasAgent_) {
this.appStoreImpl._hasAgent = _hasAgent_;
return this;
}
final public AppStoreBuilder _resourceCatalog_(java.util.ArrayList<? extends ResourceCatalog> _resourceCatalog_) {
this.appStoreImpl._resourceCatalog = _resourceCatalog_;
return this;
}
final public AppStoreBuilder _hasDefaultEndpoint_(ConnectorEndpoint _hasDefaultEndpoint_) {
this.appStoreImpl._hasDefaultEndpoint = _hasDefaultEndpoint_;
return this;
}
final public AppStoreBuilder _authInfo_(AuthInfo _authInfo_) {
this.appStoreImpl._authInfo = _authInfo_;
return this;
}
final public AppStoreBuilder _securityProfile_(SecurityProfile _securityProfile_) {
this.appStoreImpl._securityProfile = _securityProfile_;
return this;
}
final public AppStoreBuilder _extendedGuarantee_(java.util.ArrayList<? extends SecurityGuarantee> _extendedGuarantee_) {
this.appStoreImpl._extendedGuarantee = _extendedGuarantee_;
return this;
}
final public AppStoreBuilder _maintainer_(URI _maintainer_) {
this.appStoreImpl._maintainer = _maintainer_;
return this;
}
final public AppStoreBuilder _curator_(URI _curator_) {
this.appStoreImpl._curator = _curator_;
return this;
}
final public AppStoreBuilder _inboundModelVersion_(java.util.ArrayList<? extends String> _inboundModelVersion_) {
this.appStoreImpl._inboundModelVersion = _inboundModelVersion_;
return this;
}
final public AppStoreBuilder _outboundModelVersion_(String _outboundModelVersion_) {
this.appStoreImpl._outboundModelVersion = _outboundModelVersion_;
return this;
}
final public AppStoreBuilder _physicalLocation_(Location _physicalLocation_) {
this.appStoreImpl._physicalLocation = _physicalLocation_;
return this;
}
final public AppStoreBuilder _componentCertification_(ComponentCertification _componentCertification_) {
this.appStoreImpl._componentCertification = _componentCertification_;
return this;
}
final public AppStoreBuilder _publicKey_(PublicKey _publicKey_) {
this.appStoreImpl._publicKey = _publicKey_;
return this;
}
final public AppStoreBuilder _version_(String _version_) {
this.appStoreImpl._version = _version_;
return this;
}
final public AppStoreBuilder _title_(java.util.ArrayList<? extends de.fraunhofer.iais.eis.util.TypedLiteral> _title_) {
this.appStoreImpl._title = _title_;
return this;
}
final public AppStoreBuilder _description_(java.util.ArrayList<? extends de.fraunhofer.iais.eis.util.TypedLiteral> _description_) {
this.appStoreImpl._description = _description_;
return this;
}
public final AppStore build() throws ConstraintViolationException {
VocabUtil.getInstance().validate(appStoreImpl);
return appStoreImpl;
}
}
| [
"ashokkumar.ta@gmail.com"
] | ashokkumar.ta@gmail.com |
0d13bb4b2174396ba73b18b1543943f868a29f9d | 1b02929bffa91aaa3c17a3a2430abacc558250f5 | /DesignPatterns-Factory/DesignPatterns-Factory-AbstractFactory/src/main/java/wang/chunfan/ShangYiBei.java | b60a5c8d354513e3e03767ba0772ab0f51c9ad3c | [
"MIT"
] | permissive | wangchunfan/DesignPatterns | 1a4947d7e897412242ce7a71163d3b37eda71eb0 | a8c4688e273c588355df17e16d8bf145619dc23a | refs/heads/master | 2020-10-02T06:52:04.948179 | 2020-03-07T12:15:48 | 2020-03-07T12:15:48 | 227,726,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package wang.chunfan;
public class ShangYiBei extends ShangYi {
public ShangYiBei() {
System.out.println("工厂生产一件衣服:一件上衣(北方)");
}
}
| [
"171250669@qq.com"
] | 171250669@qq.com |
19863f00f847be0b8476fb49fde961bc83a74591 | a70282cace0de5ee23f67e3377fece26b7123848 | /app/src/main/java/com/example/pokedex/dataRepository/pokemonService/pokemonCalls/PokemonsCalls.java | 00a82294b9772ac9220c07303d4af16b2b154f7e | [] | no_license | needhelp17/pokedex | 95a23f81495a3398dff1ed2377ceea5648a4c053 | 618021bd6f83599fcd9456e8baea5f324c480b18 | refs/heads/master | 2020-09-12T05:24:37.523368 | 2019-12-19T19:43:30 | 2019-12-19T19:43:30 | 222,323,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,024 | java | package com.example.pokedex.dataRepository.pokemonService.pokemonCalls;
import androidx.annotation.Nullable;
import com.example.pokedex.dataRepository.entitites.pokemon.Pokemon;
import com.example.pokedex.dataRepository.entitites.pokemon.ResultsPokemons;
import com.example.pokedex.dataRepository.pokemonService.PokemonService;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class PokemonsCalls {
public interface Callbacks {
void onResponse(@Nullable List<Pokemon> result);
void onFailure();
}
/**
* ask the pokemon of the first generation to the api
* @param callbacks the callback to launch
*/
public static void fetchPokemonFirstGen(PokemonsCalls.Callbacks callbacks) {
final WeakReference<PokemonsCalls.Callbacks> callbacksWeakReference = new WeakReference<>(callbacks);
final PokemonService pokemonService = PokemonService.retrofit.create(PokemonService.class);
Call<ResultsPokemons> call = pokemonService.getPokemonFirstGen();
call.enqueue(new Callback<ResultsPokemons>() {
@Override
public void onResponse(Call<ResultsPokemons> call, Response<ResultsPokemons> response) {
if (callbacksWeakReference.get() != null) {
List<Pokemon> listpoke = new ArrayList<>();
for (int i = 0; i < response.body().getResults().size(); i++) {
Pokemon p = new Pokemon(i+1,response.body().getResults().get(i).getName());
listpoke.add(p);
}
callbacksWeakReference.get().onResponse(listpoke);
}
}
@Override
public void onFailure(Call<ResultsPokemons> call, Throwable t) {
if (callbacksWeakReference.get() != null) callbacksWeakReference.get().onFailure();
}
});
}
}
| [
"gautierdrincqbier@gmail.com"
] | gautierdrincqbier@gmail.com |
2edefc4f2795262a45ac20b1b5557a4df9ce0c5b | d8cef9a84b50013a493b01242dccb081da6ebd66 | /ad-service/ad-commom/src/main/java/com/cx/ad/entity/AdUser.java | 137669fd51940e033f917da591583cdf761b8d34 | [] | no_license | jungkook-cx/cx-ad-spring-cloud | f172be18c19b272d361a47ac1300e2276f23ca5b | 9f33716ef8206f9d7a9d13ff0564dec4fff9df05 | refs/heads/master | 2023-02-23T06:00:13.205826 | 2021-01-22T09:40:34 | 2021-01-22T09:40:34 | 330,930,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,812 | java | package com.cx.ad.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cx.ad.constant.CommonStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @description:
* @author: ChenXi
* @time: 2021/1/20 13:51
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户实体类")
@TableName("ad_user")
public class AdUser implements Serializable {
@TableId(value = "id",type = IdType.AUTO)
@NotNull
@ApiModelProperty("用户id")
private Long id;
@TableField(value = "username",exist = true)
@ApiModelProperty("用户姓名")
@NotNull
private String username;
@TableField(value = "token",exist = true)
@ApiModelProperty("用户登录携带的token")
@NotNull
private String token;
@TableField(value = "user_status",exist = true)
@ApiModelProperty("用户状态")
@NotNull
private Integer userStatus;
@TableField(value = "create_time",exist = true)
@ApiModelProperty("用户创建时间")
@NotNull
private Date createTime;
@NotNull
@TableField(value = "update_time",exist = true)
@ApiModelProperty("用户更新时间")
private Date updateTime;
public AdUser(String username,String token){
this.username=username;
this.token=token;
this.userStatus= CommonStatus.VALID.getStatus();
this.createTime=new Date();
this.updateTime=this.createTime;
}
}
| [
"1351488703@qq.com"
] | 1351488703@qq.com |
4fdaa82094e2262db294661d0814ba7aa042eede | c061f1e03385a36482f2d59b3b6d901f56080631 | /Selenium practice/src/IELaunch.java | 405747712b6250c6c26d8054f90566c72ad54ea8 | [] | no_license | skollipa/Demo-repo | e25ea3f404a30130d58c58ea9442177d8261584f | 094e20cf1030c88021748c47b91ff2d81225f6ec | refs/heads/master | 2020-06-20T06:28:03.362111 | 2019-07-15T15:44:33 | 2019-07-15T15:44:33 | 197,025,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class IELaunch {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.ie.driver", "C:\\Sowjanya\\Selenium\\Jars\\MicrosoftWebDriver.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("https://finance.google.com");
System.out.println(driver.manage().logs());
driver.close();
}
}
| [
"sowjanyakollipa@gmail.com"
] | sowjanyakollipa@gmail.com |
d0b93e41c16d0576f6eb3faf92305d4736a79c6a | cfe43613dba6bf7f8ae6689a1f766a05e158bbd1 | /portal/src/main/java/org/bonitasoft/web/toolkit/client/ui/component/form/view/ItemPage.java | ffd76d0209097a80004f83fc5a66668a05cf412a | [] | no_license | bpupadhyaya/bonita-web | f178c9ba6c26a8f0a5290fb9b68e41a737170a72 | 38d116b46dae70e651ea39e8b6d2e7bf8273395b | refs/heads/master | 2020-02-26T17:32:52.832148 | 2015-12-21T10:05:14 | 2015-12-21T10:05:14 | 48,715,650 | 0 | 1 | null | 2015-12-28T22:34:33 | 2015-12-28T22:34:33 | null | UTF-8 | Java | false | false | 1,342 | java | /**
* Copyright (C) 2011 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.web.toolkit.client.ui.component.form.view;
import org.bonitasoft.web.toolkit.client.data.item.ItemDefinition;
import org.bonitasoft.web.toolkit.client.ui.Page;
import org.bonitasoft.web.toolkit.client.ui.action.ItemAction;
/**
* @author Julien Mege
*/
public abstract class ItemPage extends Page {
public final void setItemDefinition(final ItemDefinition itemDefinition) {
this.addParameter(ItemAction.PARAM_ITEM_DEFINITION_NAME, itemDefinition.getToken());
}
public final void setItemId(final String id) {
this.addParameter("id", id);
}
}
| [
"vincent.elcrin@bonitasoft.com"
] | vincent.elcrin@bonitasoft.com |
d0d901b1d13c0b14108f5f1f57239561049cb2c5 | ff091f6ade8c3279c856d33c59457503ce4093ff | /prototype-data-mysql/src/main/java/xyz/masaimara/prototype/data/domain/JobInfo.java | e5c4ad9ef471dbc8f60e071fa395a88afbae7bb0 | [
"MIT"
] | permissive | Lun624/prototype | 04b483466d811ebec958fae623d9d234cdf8cec3 | e8842e184b5b8083af6f4c4f55dcab7d233b48b7 | refs/heads/master | 2020-03-27T06:16:41.351472 | 2018-08-25T13:00:07 | 2018-08-25T13:00:07 | 146,017,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 544 | java | package xyz.masaimara.prototype.data.domain;
import com.google.common.base.MoreObjects;
import java.io.Serializable;
public class JobInfo implements Serializable {
private String jobName = "";
public String getJobName() {
return jobName;
}
public JobInfo setJobName(String jobName) {
this.jobName = jobName;
return this;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("jobName", jobName)
.toString();
}
}
| [
"themostss@hotmail.com"
] | themostss@hotmail.com |
c99c3b3c507eb6d3c4cec62926d7fd38e30991c7 | dbc38acf22abe431d7dc4d5a5631dfb4ced23c19 | /src/main/java/aka/jmetaagents/main/tmdb/movies/moviestranslations/JMoviestranslationsResponseJacksonMapper.java | e2e7077f20b771d19e4c1d0fa3bdc92aaacfd166 | [] | no_license | welle/JMetaAgents | 8cdca7f7ed08a1e38babe20cb929920fb987b789 | 8e9b15f0699f05a77889e1ed3204f89082ad3283 | refs/heads/master | 2021-06-12T00:17:06.075117 | 2018-10-23T05:17:07 | 2018-10-23T05:17:07 | 96,074,007 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,007 | java | package aka.jmetaagents.main.tmdb.movies.moviestranslations;
import java.io.IOException;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* This is a generated file.
*
* @author Welle
*/
public final class JMoviestranslationsResponseJacksonMapper {
/**
* Method to deserialize JSON content into a non-container type.
*
* @param jsonString
* JSon string to be deserialize.
* @return JMoviestranslationsResponse.
* @throws IOException
* @throws JsonParseException
* when non-well-formed content (content that does not conform
* to JSON syntax as per specification) is encountered.
*/
@Nullable
public static JMoviestranslationsResponse readValue(@NonNull final String jsonString) throws JsonParseException, IOException {
JMoviestranslationsResponse result = null;
if (jsonString.trim().length() > 0) {
final ObjectMapper objectMapper = new ObjectMapper();
final JsonFactory jsonFactory = new JsonFactory();
final JsonParser jp = jsonFactory.createParser(jsonString);
result = objectMapper.readValue(jp, JMoviestranslationsResponse.class);
}
return result;
}
/**
* Method that can be used to serialize given object as a JSon String.
*
* @param object
* Object to be serialize.
* @return JSon String.
* @throws IOException
* signal fatal problems with mapping of content.
*/
@Nullable
public static String writeValue(@NonNull final JMoviestranslationsResponse object) throws IOException {
final ObjectMapper objectMapper = new ObjectMapper();
return objectMapper.writeValueAsString(object);
}
}
| [
"charlottewelle@yahoo.fr"
] | charlottewelle@yahoo.fr |
3f56720464f9d25e5a44d0b2bda3d7b71a879725 | 378d6356f95571b016c5baa46b947ae249946957 | /src/com/it2299/reincoast/servlet/AuthenticateAccountServlet.java | d6bea7170cdb098174977b4857999c00b96036b0 | [] | no_license | Ziimiin/it2299-ffth-reincoast | 3096d784d003ffdebfcf240b91a3ba68be7671de | 261d234020623e628737d9d3cd4c04741ced9854 | refs/heads/master | 2020-12-07T03:50:06.196014 | 2014-02-10T01:11:48 | 2014-02-10T01:11:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,043 | java | package com.it2299.reincoast.servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
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 com.it2299.ffth.reincoast.dao.MemberDao;
import com.it2299.ffth.reincoast.dao.VolunteerDao;
import com.it2299.ffth.reincoast.dto.Member;
import com.it2299.ffth.reincoast.dto.Volunteer;
/**
* Servlet implementation class AuthenticateAccountServlet
*/
@WebServlet("/AuthenticateAccountServlet")
public class AuthenticateAccountServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public AuthenticateAccountServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher rd = null;
String userName = request.getParameter("username").toLowerCase();
String tempPassword = request.getParameter("tempPwd");
String status = request.getParameter("role");
String pwd = request.getParameter("pwd");
if (status.equals("STAFF")) {
MemberDao memberdao = new MemberDao();
Member member = memberdao.getByUsernameMember(userName);
System.out.println("Member name : " + member.getName());
if (member!=null && member.getrPwd()!=null && member.getrPwd().equals(tempPassword)){
member.setPassword(pwd);
member.setrPwd(null);
memberdao.saveOrUpdate(member);
rd = request.getRequestDispatcher("/login.jsp?msg=You%20have%20successfully%20changed%20your%20password&isType=alert-success");
rd.forward(request, response);
}
else if(member!=null && member.getrPwd()==null){
rd = request.getRequestDispatcher("/authenticate-account.jsp?msg=Please%20request%20%5Bchange%20password%20instruction%5D%20again.%20.&isType=alert-danger");
rd.forward(request, response);
}
else if(member!=null && member.getrPwd()!=null && !member.getrPwd().equals(tempPassword)){
rd = request.getRequestDispatcher("/authenticate-account.jsp?msg=The%20unique%20code%20is%20wrongly%20entered.%20Please%20enter%20a%20valid%20unique%20code%2C%20it%20can%20be%20found%20in%20your%20email.&isType=alert-danger");
rd.forward(request, response);
}
}else if (status.equals("VOLUNTEER")) {
VolunteerDao volunteerdao = new VolunteerDao();
Volunteer volunteer = volunteerdao.getByUsernameVolunteer(userName);
System.out.println("Member code : " + volunteer.getrPwd());
if (volunteer!=null && volunteer.getrPwd()!=null && volunteer.getrPwd().equals(tempPassword)){
volunteer.setPassword(pwd);
volunteer.setrPwd(null);
volunteerdao.saveOrUpdate(volunteer);
rd = request.getRequestDispatcher("/login.jsp?msg=You%20have%20successfully%20changed%20your%20passwordt&isType=alert-success");
rd.forward(request, response);
}
else if(volunteer!=null && volunteer.getrPwd()==null){
rd = request.getRequestDispatcher("/authenticate-account.jsp?msg=Please%20request%20%5Bchange%20password%20instruction%5D%20again.%20.&isType=alert-danger");
rd.forward(request, response);
}
else if(volunteer!=null && volunteer.getrPwd()!=null && !volunteer.getrPwd().equals(tempPassword)){
rd = request.getRequestDispatcher("/authenticate-account.jsp?msg=The%20unique%20code%20is%20wrongly%20entered.%20Please%20enter%20a%20valid%20unique%20code%2C%20it%20can%20be%20found%20in%20your%20email.&isType=alert-danger");
rd.forward(request, response);
}
}
}
}
| [
"miniz.project@gmail.com"
] | miniz.project@gmail.com |
a062d60734d97caa88fae55a029396f9716c0f33 | 7fc59068b47ce91c6f2b03c4e1a5a4e219b09a9b | /app/src/main/java/com/wyroczen/alphacamera/location/LocationUpdateListener.java | 2c557b171e34f8df5cba773e4645d4f76f31463b | [] | no_license | Wyroczen/AlphaCamera | 9a79af632182a2d27967309fdbc11200345b9a13 | 1852b56f472e250a4b67e6586dd57f6391161706 | refs/heads/master | 2023-01-07T20:00:08.777071 | 2020-09-20T14:33:15 | 2020-09-20T14:33:15 | 288,949,872 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 868 | java | package com.wyroczen.alphacamera.location;
import android.location.Location;
public interface LocationUpdateListener {
/**
* Called immediately the service starts if the service can obtain location
*/
void canReceiveLocationUpdates();
/**
* Called immediately the service tries to start if it cannot obtain location - eg the user has disabled wireless and
*/
void cannotReceiveLocationUpdates();
/**
* Called whenever the location has changed (at least non-trivially)
* @param location
*/
void updateLocation(Location location);
/**
* Called when GoogleLocationServices detects that the device has moved to a new location.
* @param localityName The name of the locality (somewhere below street but above area).
*/
void updateLocationName(String localityName, Location location);
} | [
"wisniewskibw@gmail.com"
] | wisniewskibw@gmail.com |
3c9d768566e357136f0a7db415c9611cf97887fd | cd3dd098fc1df1620ab6c89bcf7e38fb13a2e12e | /glide/src/main/java/com/bumptech/glide/load/engine/GlideException.java | 702eff8b2add2e8d10c6348a41da132ddd026f66 | [] | no_license | sunkeding/GlideSourceCode | caba86202b7459663315c7ab052baea987e33efd | 78ed19fd63495c35f562cb24dbb46b8ebcea1686 | refs/heads/main | 2023-02-09T21:22:16.287180 | 2021-01-05T10:19:17 | 2021-01-05T10:19:17 | 326,959,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,873 | java | package com.bumptech.glide.load.engine;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.Key;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** An exception with zero or more causes indicating why a load in Glide failed. */
// Public API.
@SuppressWarnings("WeakerAccess")
public final class GlideException extends Exception {
private static final long serialVersionUID = 1L;
private static final StackTraceElement[] EMPTY_ELEMENTS = new StackTraceElement[0];
private final List<Throwable> causes;
private Key key;
private DataSource dataSource;
private Class<?> dataClass;
private String detailMessage;
@Nullable private Exception exception;
public GlideException(String message) {
this(message, Collections.<Throwable>emptyList());
}
public GlideException(String detailMessage, Throwable cause) {
this(detailMessage, Collections.singletonList(cause));
}
public GlideException(String detailMessage, List<Throwable> causes) {
this.detailMessage = detailMessage;
setStackTrace(EMPTY_ELEMENTS);
this.causes = causes;
}
void setLoggingDetails(Key key, DataSource dataSource) {
setLoggingDetails(key, dataSource, null);
}
void setLoggingDetails(Key key, DataSource dataSource, Class<?> dataClass) {
this.key = key;
this.dataSource = dataSource;
this.dataClass = dataClass;
}
/**
* Sets a stack trace that includes where the request originated.
*
* <p>This is an experimental API that may be removed in the future.
*/
public void setOrigin(@Nullable Exception exception) {
this.exception = exception;
}
/**
* Returns an {@link Exception} with a stack trace that includes where the request originated (if
* previously set via {@link #setOrigin(Exception)})
*
* <p>This is an experimental API that may be removed in the future.
*/
@Nullable
public Exception getOrigin() {
return exception;
}
// No need to synchronize when doing nothing whatsoever.
@SuppressWarnings("UnsynchronizedOverridesSynchronized")
@Override
public Throwable fillInStackTrace() {
// Avoid an expensive allocation by doing nothing here. Causes should contain all relevant
// stack traces.
return this;
}
/**
* Returns a list of causes that are immediate children of this exception.
*
* <p>Causes may or may not be {@link GlideException GlideExceptions}. Causes may also not be root
* causes, and in turn my have been caused by other failures.
*
* @see #getRootCauses()
*/
public List<Throwable> getCauses() {
return causes;
}
/**
* Returns the list of root causes that are the leaf nodes of all children of this exception.
*
* <p>Use this method to do things like look for http exceptions that indicate the load may have
* failed due to an error that can be retried. Keep in mind that because Glide may attempt to load
* a given model using multiple different pathways, there may be multiple related or unrelated
* reasons for a load to fail.
*/
public List<Throwable> getRootCauses() {
List<Throwable> rootCauses = new ArrayList<>();
addRootCauses(this, rootCauses);
return rootCauses;
}
/**
* Logs all root causes using the given tag.
*
* <p>Each root cause is logged separately to avoid throttling. {@link #printStackTrace()} will
* provide a more succinct overview of why the exception occurred, although it does not include
* complete stack traces.
*/
public void logRootCauses(String tag) {
List<Throwable> causes = getRootCauses();
for (int i = 0, size = causes.size(); i < size; i++) {
Log.i(tag, "Root cause (" + (i + 1) + " of " + size + ")", causes.get(i));
}
}
private void addRootCauses(Throwable throwable, List<Throwable> rootCauses) {
if (throwable instanceof GlideException) {
GlideException glideException = (GlideException) throwable;
for (Throwable t : glideException.getCauses()) {
addRootCauses(t, rootCauses);
}
} else {
rootCauses.add(throwable);
}
}
@Override
public void printStackTrace() {
printStackTrace(System.err);
}
@Override
public void printStackTrace(PrintStream err) {
printStackTrace((Appendable) err);
}
@Override
public void printStackTrace(PrintWriter err) {
printStackTrace((Appendable) err);
}
private void printStackTrace(Appendable appendable) {
appendExceptionMessage(this, appendable);
appendCauses(getCauses(), new IndentedAppendable(appendable));
}
// PMD doesn't seem to notice that we're allocating the builder with the suggested size.
@SuppressWarnings("PMD.InsufficientStringBufferDeclaration")
@Override
public String getMessage() {
StringBuilder result =
new StringBuilder(71)
.append(detailMessage)
.append(dataClass != null ? ", " + dataClass : "")
.append(dataSource != null ? ", " + dataSource : "")
.append(key != null ? ", " + key : "");
List<Throwable> rootCauses = getRootCauses();
if (rootCauses.isEmpty()) {
return result.toString();
} else if (rootCauses.size() == 1) {
result.append("\nThere was 1 cause:");
} else {
result.append("\nThere were ").append(rootCauses.size()).append(" causes:");
}
for (Throwable cause : rootCauses) {
result
.append('\n')
.append(cause.getClass().getName())
.append('(')
.append(cause.getMessage())
.append(')');
}
result.append("\n call GlideException#logRootCauses(String) for more detail");
return result.toString();
}
// Appendable throws, PrintWriter, PrintStream, and IndentedAppendable do not, so this should
// never happen.
@SuppressWarnings("PMD.PreserveStackTrace")
private static void appendExceptionMessage(Throwable t, Appendable appendable) {
try {
appendable.append(t.getClass().toString()).append(": ").append(t.getMessage()).append('\n');
} catch (IOException e1) {
throw new RuntimeException(t);
}
}
// Appendable throws, PrintWriter, PrintStream, and IndentedAppendable do not, so this should
// never happen.
@SuppressWarnings("PMD.PreserveStackTrace")
private static void appendCauses(List<Throwable> causes, Appendable appendable) {
try {
appendCausesWrapped(causes, appendable);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private static void appendCausesWrapped(List<Throwable> causes, Appendable appendable)
throws IOException {
int size = causes.size();
for (int i = 0; i < size; i++) {
appendable
.append("Cause (")
.append(String.valueOf(i + 1))
.append(" of ")
.append(String.valueOf(size))
.append("): ");
Throwable cause = causes.get(i);
if (cause instanceof GlideException) {
GlideException glideCause = (GlideException) cause;
glideCause.printStackTrace(appendable);
} else {
appendExceptionMessage(cause, appendable);
}
}
}
private static final class IndentedAppendable implements Appendable {
private static final String EMPTY_SEQUENCE = "";
private static final String INDENT = " ";
private final Appendable appendable;
private boolean printedNewLine = true;
IndentedAppendable(Appendable appendable) {
this.appendable = appendable;
}
@Override
public Appendable append(char c) throws IOException {
if (printedNewLine) {
printedNewLine = false;
appendable.append(INDENT);
}
printedNewLine = c == '\n';
appendable.append(c);
return this;
}
@Override
public Appendable append(@Nullable CharSequence charSequence) throws IOException {
charSequence = safeSequence(charSequence);
return append(charSequence, 0, charSequence.length());
}
@Override
public Appendable append(@Nullable CharSequence charSequence, int start, int end)
throws IOException {
charSequence = safeSequence(charSequence);
if (printedNewLine) {
printedNewLine = false;
appendable.append(INDENT);
}
printedNewLine = charSequence.length() > 0 && charSequence.charAt(end - 1) == '\n';
appendable.append(charSequence, start, end);
return this;
}
@NonNull
private CharSequence safeSequence(@Nullable CharSequence sequence) {
if (sequence == null) {
return EMPTY_SEQUENCE;
} else {
return sequence;
}
}
}
}
| [
"970335012@qq.com"
] | 970335012@qq.com |
06bf5c34556ed6d51ad1e3b5485d8e1d27ec348e | c68ebf9fc07633a58ed28d0c0989a0206df1d58a | /src/main/java/org/acme/HealthUsingMetrics.java | cd7dc49123e4b173cfeb94f8140e7679043ce28a | [] | no_license | jclingan/mp-health-metrics | 3c99979efe37ef3c918059d871b5a178b5c4712c | ed2849523dda501bbfb3b59daa273328d53929a4 | refs/heads/master | 2020-12-14T17:05:29.780360 | 2020-01-19T03:40:29 | 2020-01-19T03:40:29 | 234,818,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package org.acme;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.faulttolerance.Fallback;
import org.eclipse.microprofile.faulttolerance.Timeout;
import org.eclipse.microprofile.metrics.annotation.Metered;
@Path("/ping")
public class HealthUsingMetrics {
@Inject
@ConfigProperty(name="delay")
Optional<Integer> delay;
@GET
@Produces(MediaType.TEXT_PLAIN)
@Timeout(value = 500)
@Fallback(fallbackMethod = "pingTimeout")
@Metered(absolute = true, name="ping")
public String ping() {
try {
int delayTime = (int)(Math.random()*delay.orElse(1000));
System.out.println("** Waiting " + delayTime + "ms **");
TimeUnit.MILLISECONDS.sleep(delayTime);
} catch (InterruptedException ex) {
}
return "** Pong **";
}
@Metered(absolute = true, name="fallbackPing")
public String pingTimeout() {
return "** timeout **";
}
} | [
"jclingan@redhat.com"
] | jclingan@redhat.com |
6dc760417b383403040736e30d5a6f7aab98004e | 8d42994c70548f061b84f9ee0e432ba18b384040 | /src/java/personal/wuyi/demo/CreateThread2.java | 5d3bd3811fcb76e1341e9f0a63b95f147cbcd47d | [] | no_license | nv-krishna/java-concurrency-in-practice | 87118453aba924adac7abd51834a571d52e22305 | 0d1719d1d6b1959cb5f6f98533a7b54bbeb2018c | refs/heads/master | 2023-06-25T22:06:33.137170 | 2021-07-24T21:03:58 | 2021-07-24T21:03:58 | 389,200,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package personal.wuyi.demo;
public class CreateThread2 implements Runnable{
public void run(){
System.out.println("thread is running...");
}
public static void main(String args[]){
CreateThread2 obj = new CreateThread2();
Thread trd =new Thread(obj);
trd.start();
}
}
| [
"venkata.logtokris@gmail.com"
] | venkata.logtokris@gmail.com |
11769d1030fdec6e56399695f376c7cc06d20d13 | 369fb1910ab0aee739a247b5b5ffcea04bf54da5 | /component-orm/src/main/java/com/fty1/orm/extension/injector/methods/LogicDeleteByMap.java | 1a9aed116734ae89ed3b2bb5ca33ec3cc3fbfa06 | [] | no_license | Cray-Bear/starters | f0318e30c239fefd1a5079a45faf1bcc0cf34d39 | b6537789af56988bcb1d617cc4e6e1a1ef7dfc92 | refs/heads/master | 2020-04-08T11:27:42.993024 | 2019-03-24T15:15:17 | 2019-03-24T15:15:17 | 159,306,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,842 | java | /*
* Copyright (c) 2011-2019, hubin (jobob@qq.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.fty1.orm.extension.injector.methods;
import com.fty1.orm.core.enums.SqlMethod;
import com.fty1.orm.core.metadata.TableInfo;
import com.fty1.orm.extension.injector.AbstractLogicMethod;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
import java.util.Map;
/**
* 根据 map 条件删除
*
* @author hubin
* @since 2018-06-13
*/
public class LogicDeleteByMap extends AbstractLogicMethod {
@Override
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
String sql;
SqlMethod sqlMethod = SqlMethod.LOGIC_DELETE_BY_MAP;
if (tableInfo.isLogicDelete()) {
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), sqlLogicSet(tableInfo), sqlWhereByMap(tableInfo));
} else {
sqlMethod = SqlMethod.DELETE_BY_MAP;
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), this.sqlWhereByMap(tableInfo));
}
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, Map.class);
return addUpdateMappedStatement(mapperClass, Map.class, sqlMethod.getMethod(), sqlSource);
}
}
| [
"1798900899@qq.com"
] | 1798900899@qq.com |
45ef0896fbffc50234019654e5c256ee68ce81cb | 60408604968ece877be0dd11dd459133fd7a1ebe | /src/test/java/com/automation/stepdefinitions/ElempleoStepdefinitions.java | 1ad524fa014cadadf4ecaec4de99d1877fcb2411 | [] | no_license | andresl31/TrabajoFinal | e23c73b1e1b901b0fb0276f026e05adb6dd1afa3 | efe87926dae9ef7a89cd6096e21d9db922ba4bc6 | refs/heads/master | 2020-08-03T12:36:51.354915 | 2019-09-30T03:38:12 | 2019-09-30T03:38:12 | 211,755,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package com.automation.stepdefinitions;
import com.automation.steps.TrabajoSteps;
import cucumber.api.java.es.Cuando;
import cucumber.api.java.es.Dado;
import cucumber.api.java.es.Entonces;
import net.thucydides.core.annotations.Steps;
public class ElempleoStepdefinitions {
@Steps
TrabajoSteps trabstep;
@Dado("^que estoy en la pagina del empleo\\.com$")
public void queEstoyEnLaPaginaDelEmpleoCom() {
trabstep.abrirurl();
}
@Cuando("^ingreso los datos de (.*) y (.*) del formulario de consulta de empleo$")
public void ingresoLosDatosDeContYBogotaDelFormularioDeConsultaDeEmpleo(String cargo, String ciudad) {
trabstep.ingresardatos(cargo, ciudad);
}
@Entonces("^puedo visulizar las ofertas disponibles$")
public void puedoVisulizarLasOfertasDisponibles() throws InterruptedException {
trabstep.filtrosm();
trabstep.listadoOfertas();
trabstep.screen();
}
}
| [
"ealopezb@axacolpatria.co"
] | ealopezb@axacolpatria.co |
944fcb70789bfbe10e5e57f5e8f9f6e62ff52cf8 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipsejdt_cluster/45118/tar_0.java | a751b69f1835040b41cc007ea560552d23df787e | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,303 | java | /*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.core.search.indexing;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.search.SearchDocument;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo;
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo;
import org.eclipse.jdt.internal.compiler.env.IGenericType;
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
private static final char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$
private static final char[] CHAR = "char".toCharArray(); //$NON-NLS-1$
private static final char[] DOUBLE = "double".toCharArray(); //$NON-NLS-1$
private static final char[] FLOAT = "float".toCharArray(); //$NON-NLS-1$
private static final char[] INT = "int".toCharArray(); //$NON-NLS-1$
private static final char[] LONG = "long".toCharArray(); //$NON-NLS-1$
private static final char[] SHORT = "short".toCharArray(); //$NON-NLS-1$
private static final char[] BOOLEAN = "boolean".toCharArray(); //$NON-NLS-1$
private static final char[] VOID = "void".toCharArray(); //$NON-NLS-1$
private static final char[] INIT = "<init>".toCharArray(); //$NON-NLS-1$
public BinaryIndexer(SearchDocument document) {
super(document);
}
public void addTypeReference(char[] typeName) {
int length = typeName.length;
if (length > 2 && typeName[length - 2] == '$') {
switch (typeName[length - 1]) {
case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
case '5' :
case '6' :
case '7' :
case '8' :
case '9' :
return; // skip local type names
}
}
// consider that A$B is a member type: so replace '$' with '.'
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=40116)
typeName = CharOperation.replaceOnCopy(typeName, '$', '.'); // copy it so the original is not modified
super.addTypeReference(typeName);
}
/**
* For example:
* - int foo(String[]) is ([Ljava/lang/String;)I => java.lang.String[] in a char[][]
* - void foo(int) is (I)V ==> int
*/
private void convertToArrayType(char[][] parameterTypes, int counter, int arrayDim) {
int length = parameterTypes[counter].length;
char[] arrayType = new char[length + arrayDim*2];
System.arraycopy(parameterTypes[counter], 0, arrayType, 0, length);
for (int i = 0; i < arrayDim; i++) {
arrayType[length + (i * 2)] = '[';
arrayType[length + (i * 2) + 1] = ']';
}
parameterTypes[counter] = arrayType;
}
/**
* For example:
* - int foo(String[]) is ([Ljava/lang/String;)I => java.lang.String[] in a char[][]
* - void foo(int) is (I)V ==> int
*/
private char[] convertToArrayType(char[] typeName, int arrayDim) {
int length = typeName.length;
char[] arrayType = new char[length + arrayDim*2];
System.arraycopy(typeName, 0, arrayType, 0, length);
for (int i = 0; i < arrayDim; i++) {
arrayType[length + (i * 2)] = '[';
arrayType[length + (i * 2) + 1] = ']';
}
return arrayType;
}
private char[] decodeFieldType(char[] signature) throws ClassFormatException {
if (signature == null) return null;
int arrayDim = 0;
for (int i = 0, max = signature.length; i < max; i++) {
switch(signature[i]) {
case 'B':
if (arrayDim > 0)
return convertToArrayType(BYTE, arrayDim);
return BYTE;
case 'C':
if (arrayDim > 0)
return convertToArrayType(CHAR, arrayDim);
return CHAR;
case 'D':
if (arrayDim > 0)
return convertToArrayType(DOUBLE, arrayDim);
return DOUBLE;
case 'F':
if (arrayDim > 0)
return convertToArrayType(FLOAT, arrayDim);
return FLOAT;
case 'I':
if (arrayDim > 0)
return convertToArrayType(INT, arrayDim);
return INT;
case 'J':
if (arrayDim > 0)
return convertToArrayType(LONG, arrayDim);
return LONG;
case 'L':
int indexOfSemiColon = CharOperation.indexOf(';', signature, i+1);
if (indexOfSemiColon == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
if (arrayDim > 0) {
return convertToArrayType(replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon)), arrayDim);
}
return replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon));
case 'S':
if (arrayDim > 0)
return convertToArrayType(SHORT, arrayDim);
return SHORT;
case 'Z':
if (arrayDim > 0)
return convertToArrayType(BOOLEAN, arrayDim);
return BOOLEAN;
case 'V':
return VOID;
case '[':
arrayDim++;
break;
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
}
return null;
}
/**
* For example:
* - int foo(String[]) is ([Ljava/lang/String;)I => java.lang.String[] in a char[][]
* - void foo(int) is (I)V ==> int
*/
private char[][] decodeParameterTypes(char[] signature) throws ClassFormatException {
if (signature == null) return null;
int indexOfClosingParen = CharOperation.lastIndexOf(')', signature);
if (indexOfClosingParen == 1) {
// there is no parameter
return null;
}
if (indexOfClosingParen == -1) {
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
char[][] parameterTypes = new char[3][];
int parameterTypesCounter = 0;
int arrayDim = 0;
for (int i = 1; i < indexOfClosingParen; i++) {
if (parameterTypesCounter == parameterTypes.length) {
// resize
System.arraycopy(parameterTypes, 0, (parameterTypes = new char[parameterTypesCounter * 2][]), 0, parameterTypesCounter);
}
switch(signature[i]) {
case 'B':
parameterTypes[parameterTypesCounter++] = BYTE;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'C':
parameterTypes[parameterTypesCounter++] = CHAR;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'D':
parameterTypes[parameterTypesCounter++] = DOUBLE;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'F':
parameterTypes[parameterTypesCounter++] = FLOAT;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'I':
parameterTypes[parameterTypesCounter++] = INT;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'J':
parameterTypes[parameterTypesCounter++] = LONG;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'L':
int indexOfSemiColon = CharOperation.indexOf(';', signature, i+1);
if (indexOfSemiColon == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
parameterTypes[parameterTypesCounter++] = replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon));
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
i = indexOfSemiColon;
arrayDim = 0;
break;
case 'S':
parameterTypes[parameterTypesCounter++] = SHORT;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case 'Z':
parameterTypes[parameterTypesCounter++] = BOOLEAN;
if (arrayDim > 0)
convertToArrayType(parameterTypes, parameterTypesCounter-1, arrayDim);
arrayDim = 0;
break;
case '[':
arrayDim++;
break;
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
}
if (parameterTypes.length != parameterTypesCounter) {
System.arraycopy(parameterTypes, 0, parameterTypes = new char[parameterTypesCounter][], 0, parameterTypesCounter);
}
return parameterTypes;
}
private char[] decodeReturnType(char[] signature) throws ClassFormatException {
if (signature == null) return null;
int indexOfClosingParen = CharOperation.lastIndexOf(')', signature);
if (indexOfClosingParen == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
int arrayDim = 0;
for (int i = indexOfClosingParen + 1, max = signature.length; i < max; i++) {
switch(signature[i]) {
case 'B':
if (arrayDim > 0)
return convertToArrayType(BYTE, arrayDim);
return BYTE;
case 'C':
if (arrayDim > 0)
return convertToArrayType(CHAR, arrayDim);
return CHAR;
case 'D':
if (arrayDim > 0)
return convertToArrayType(DOUBLE, arrayDim);
return DOUBLE;
case 'F':
if (arrayDim > 0)
return convertToArrayType(FLOAT, arrayDim);
return FLOAT;
case 'I':
if (arrayDim > 0)
return convertToArrayType(INT, arrayDim);
return INT;
case 'J':
if (arrayDim > 0)
return convertToArrayType(LONG, arrayDim);
return LONG;
case 'L':
int indexOfSemiColon = CharOperation.indexOf(';', signature, i+1);
if (indexOfSemiColon == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
if (arrayDim > 0) {
return convertToArrayType(replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon)), arrayDim);
}
return replace('/','.',CharOperation.subarray(signature, i + 1, indexOfSemiColon));
case 'S':
if (arrayDim > 0)
return convertToArrayType(SHORT, arrayDim);
return SHORT;
case 'Z':
if (arrayDim > 0)
return convertToArrayType(BOOLEAN, arrayDim);
return BOOLEAN;
case 'V':
return VOID;
case '[':
arrayDim++;
break;
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
}
return null;
}
private int extractArgCount(char[] signature) throws ClassFormatException {
int indexOfClosingParen = CharOperation.lastIndexOf(')', signature);
if (indexOfClosingParen == 1) {
// there is no parameter
return 0;
}
if (indexOfClosingParen == -1) {
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
int parameterTypesCounter = 0;
for (int i = 1; i < indexOfClosingParen; i++) {
switch(signature[i]) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'Z':
parameterTypesCounter++;
break;
case 'L':
int indexOfSemiColon = CharOperation.indexOf(';', signature, i+1);
if (indexOfSemiColon == -1) throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
parameterTypesCounter++;
i = indexOfSemiColon;
break;
case '[':
break;
default:
throw new ClassFormatException(ClassFormatException.ErrInvalidMethodSignature);
}
}
return parameterTypesCounter;
}
private char[] extractClassName(int[] constantPoolOffsets, ClassFileReader reader, int index) {
// the entry at i has to be a field ref or a method/interface method ref.
int class_index = reader.u2At(constantPoolOffsets[index] + 1);
int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[class_index] + 1)];
return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));
}
private char[] extractName(int[] constantPoolOffsets, ClassFileReader reader, int index) {
int nameAndTypeIndex = reader.u2At(constantPoolOffsets[index] + 3);
int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[nameAndTypeIndex] + 1)];
return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));
}
private char[] extractClassReference(int[] constantPoolOffsets, ClassFileReader reader, int index) {
// the entry at i has to be a class ref.
int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[index] + 1)];
return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));
}
/**
* Extract all type, method, field and interface method references from the constant pool
*/
private void extractReferenceFromConstantPool(byte[] contents, ClassFileReader reader) throws ClassFormatException {
int[] constantPoolOffsets = reader.getConstantPoolOffsets();
int constantPoolCount = constantPoolOffsets.length;
for (int i = 1; i < constantPoolCount; i++) {
int tag = reader.u1At(constantPoolOffsets[i]);
/**
* u1 tag
* u2 class_index
* u2 name_and_type_index
*/
char[] name = null;
char[] type = null;
switch (tag) {
case ClassFileConstants.FieldRefTag :
// add reference to the class/interface and field name and type
name = extractName(constantPoolOffsets, reader, i);
addFieldReference(name);
break;
case ClassFileConstants.MethodRefTag :
// add reference to the class and method name and type
case ClassFileConstants.InterfaceMethodRefTag :
// add reference to the interface and method name and type
name = extractName(constantPoolOffsets, reader, i);
type = extractType(constantPoolOffsets, reader, i);
if (CharOperation.equals(INIT, name)) {
// add a constructor reference
char[] className = replace('/', '.', extractClassName(constantPoolOffsets, reader, i)); // so that it looks like java.lang.String
addConstructorReference(className, extractArgCount(type));
} else {
// add a method reference
addMethodReference(name, extractArgCount(type));
}
break;
case ClassFileConstants.ClassTag :
// add a type reference
name = extractClassReference(constantPoolOffsets, reader, i);
if (name.length > 0 && name[0] == '[')
break; // skip over array references
name = replace('/', '.', name); // so that it looks like java.lang.String
addTypeReference(name);
// also add a simple reference on each segment of the qualification (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=24741)
char[][] qualification = CharOperation.splitOn('.', name);
for (int j = 0, length = qualification.length; j < length; j++) {
addNameReference(qualification[j]);
}
break;
}
}
}
private char[] extractType(int[] constantPoolOffsets, ClassFileReader reader, int index) {
int constantPoolIndex = reader.u2At(constantPoolOffsets[index] + 3);
int utf8Offset = constantPoolOffsets[reader.u2At(constantPoolOffsets[constantPoolIndex] + 3)];
return reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));
}
public void indexDocument() {
try {
byte[] contents = this.document.getByteContents();
ClassFileReader reader = new ClassFileReader(contents, this.document.getPath().toCharArray());
// first add type references
char[] className = replace('/', '.', reader.getName()); // looks like java/lang/String
// need to extract the package name and the simple name
int packageNameIndex = CharOperation.lastIndexOf('.', className);
char[] packageName = null;
char[] name = null;
if (packageNameIndex >= 0) {
packageName = CharOperation.subarray(className, 0, packageNameIndex);
name = CharOperation.subarray(className, packageNameIndex + 1, className.length);
} else {
packageName = CharOperation.NO_CHAR;
name = className;
}
char[] enclosingTypeName = null;
if (reader.isNestedType()) {
if (reader.isAnonymous()) {
name = CharOperation.NO_CHAR;
} else {
name = reader.getInnerSourceName();
}
if (reader.isLocal() || reader.isAnonymous()) {
enclosingTypeName = ONE_ZERO;
} else {
char[] fullEnclosingName = reader.getEnclosingTypeName();
int nameLength = fullEnclosingName.length - packageNameIndex - 1;
if (nameLength <= 0) {
// See PR 1GIR345: ITPJCORE:ALL - Indexer: NegativeArraySizeException
return;
}
enclosingTypeName = new char[nameLength];
System.arraycopy(fullEnclosingName, packageNameIndex + 1, enclosingTypeName, 0, nameLength);
}
}
// type parameters
char[][] typeParameterSignatures = null;
char[] genericSignature = reader.getGenericSignature();
if (genericSignature != null) {
CharOperation.replace(genericSignature, '/', '.');
typeParameterSignatures = Signature.getTypeParameters(genericSignature);
}
// eliminate invalid innerclasses (1G4KCF7)
if (name == null) return;
char[][] superinterfaces = replace('/', '.', reader.getInterfaceNames());
char[][] enclosingTypeNames = enclosingTypeName == null ? null : new char[][] {enclosingTypeName};
switch (reader.getKind()) {
case IGenericType.CLASS_DECL :
char[] superclass = replace('/', '.', reader.getSuperclassName());
addClassDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames, superclass, superinterfaces, typeParameterSignatures);
break;
case IGenericType.INTERFACE_DECL :
addInterfaceDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames, superinterfaces, typeParameterSignatures);
break;
case IGenericType.ENUM_DECL :
addEnumDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames, superinterfaces);
break;
case IGenericType.ANNOTATION_TYPE_DECL :
addAnnotationTypeDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames);
break;
}
// first reference all methods declarations and field declarations
MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
if (methods != null) {
for (int i = 0, max = methods.length; i < max; i++) {
MethodInfo method = methods[i];
char[] descriptor = method.getMethodDescriptor();
char[][] parameterTypes = decodeParameterTypes(descriptor);
char[] returnType = decodeReturnType(descriptor);
char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());
if (method.isConstructor()) {
addConstructorDeclaration(className, parameterTypes, exceptionTypes);
} else {
if (!method.isClinit()) {
addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
}
}
}
}
FieldInfo[] fields = (FieldInfo[]) reader.getFields();
if (fields != null) {
for (int i = 0, max = fields.length; i < max; i++) {
FieldInfo field = fields[i];
char[] fieldName = field.getName();
char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));
addFieldDeclaration(fieldType, fieldName);
}
}
// record all references found inside the .class file
extractReferenceFromConstantPool(contents, reader);
} catch (ClassFormatException e) {
// ignore
}
}
/*
* Modify the array by replacing all occurences of toBeReplaced with newChar
*/
private char[][] replace(char toBeReplaced, char newChar, char[][] array) {
if (array == null) return null;
for (int i = 0, max = array.length; i < max; i++) {
replace(toBeReplaced, newChar, array[i]);
}
return array;
}
/*
* Modify the array by replacing all occurences of toBeReplaced with newChar
*/
private char[] replace(char toBeReplaced, char newChar, char[] array) {
if (array == null) return null;
for (int i = 0, max = array.length; i < max; i++) {
if (array[i] == toBeReplaced) {
array[i] = newChar;
}
}
return array;
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
4117b3dee6a5215dfba261ae2cfd55024130d736 | 07ed3fc87ea0f10b295faea090bda5f1aae71c45 | /app/src/main/java/com/jszf/jingdong/market/fragment/DiscoverFragment.java | 3c400eb26c2c20517319e870c17753f4bb49b845 | [] | no_license | dhyking/JingDong | 5e15205fef3b3db8fe0a804f0af6685625f0ffd5 | 9db5aab8b1a9618aad1ad28ebe3f182369523c54 | refs/heads/master | 2021-01-20T19:00:23.773553 | 2016-07-14T06:47:25 | 2016-07-14T06:47:25 | 62,624,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.jszf.jingdong.market.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by Administrator on 2016/7/7.
*/
public class DiscoverFragment extends Fragment {
private View mView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
public static DiscoverFragment newInstance() {
Bundle args = new Bundle();
DiscoverFragment fragment = new DiscoverFragment();
fragment.setArguments(args);
return fragment;
}
}
| [
"779339753@qq.com"
] | 779339753@qq.com |
b3a1ccc8168b3baa6b4d71bfa373c26dce21d419 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/guardianproject_Gibberbot/src/info/guardianproject/util/Version.java | d1e22c28ea7cb2c23e10fa44a4f652bf82a37128 | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,868 | java | // isComment
package info.guardianproject.util;
public class isClassOrIsInterface implements Comparable<Version> {
private String isVariable;
public isConstructor(String isParameter) {
if (isNameExpr == null)
throw new IllegalArgumentException("isStringConstant");
if (!isNameExpr.isMethod("isStringConstant"))
throw new IllegalArgumentException("isStringConstant");
this.isFieldAccessExpr = isNameExpr;
}
@Override
public int isMethod(Version isParameter) {
if (isNameExpr == null)
return isIntegerConstant;
String[] isVariable = isNameExpr.isMethod("isStringConstant");
String[] isVariable = isNameExpr.isFieldAccessExpr.isMethod("isStringConstant");
int isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, isNameExpr.isFieldAccessExpr);
for (int isVariable = isIntegerConstant; isNameExpr < isNameExpr; isNameExpr++) {
int isVariable = isNameExpr < isNameExpr.isFieldAccessExpr ? isNameExpr.isMethod(isNameExpr[isNameExpr]) : isIntegerConstant;
int isVariable = isNameExpr < isNameExpr.isFieldAccessExpr ? isNameExpr.isMethod(isNameExpr[isNameExpr]) : isIntegerConstant;
if (isNameExpr < isNameExpr)
return -isIntegerConstant;
if (isNameExpr > isNameExpr)
return isIntegerConstant;
}
return isIntegerConstant;
}
@Override
public boolean isMethod(Object isParameter) {
if (this == isNameExpr)
return true;
if (isNameExpr == null)
return true;
if (this.isMethod() != isNameExpr.isMethod())
return true;
return this.isMethod((Version) isNameExpr) == isIntegerConstant;
}
@Override
public String isMethod() {
return isNameExpr;
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
95a4824df65241d0d1bd08191c90b38a88fcf298 | 022980735384919a0e9084f57ea2f495b10c0d12 | /src/ext_cttdt_ca/ext-impl/src/com/nss/portlet/nss_don_vi_thu_tuc/search/DonViThuTucDisplayTerms.java | f5f4bdaf3f25c007402e0073f9c6b0f0cbdc06c6 | [] | no_license | thaond/nsscttdt | 474d8e359f899d4ea6f48dd46ccd19bbcf34b73a | ae7dacc924efe578ce655ddfc455d10c953abbac | refs/heads/master | 2021-01-10T03:00:24.086974 | 2011-02-19T09:18:34 | 2011-02-19T09:18:34 | 50,081,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package com.nss.portlet.nss_don_vi_thu_tuc.search;
import javax.portlet.PortletRequest;
import com.liferay.portal.kernel.dao.search.DisplayTerms;
import com.liferay.portal.kernel.util.ParamUtil;
public class DonViThuTucDisplayTerms extends DisplayTerms {
public static final String TEN_DON_VI_THU_TUC = "tenDonViThuTuc";
public static final String MO_TA = "moTa";
protected String tenDonViThuTuc;
protected String moTa;
public DonViThuTucDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
tenDonViThuTuc = ParamUtil.getString(portletRequest, TEN_DON_VI_THU_TUC);
moTa = ParamUtil.getString(portletRequest, MO_TA);
}
public String getTenDonViThuTuc() {
return tenDonViThuTuc;
}
public void setTenDonViThuTuc(String tenDonViThuTuc) {
this.tenDonViThuTuc = tenDonViThuTuc;
}
public String getMoTa() {
return moTa;
}
public void setMoTa(String moTa) {
this.moTa = moTa;
}
}
| [
"nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e"
] | nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e |
46ff7237081cc929343de20d166041926cd0152d | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/zhihu/android/p1480db/p1486b/DBSyncClubDelegate.java | 4284ede19cc1de62aeb80ae5901435ebe5713f7f | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,030 | java | package com.zhihu.android.p1480db.p1486b;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewStub;
import android.widget.CompoundButton;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.core.content.ContextCompat;
import com.secneo.apkwrapper.C6969H;
import com.trello.rxlifecycle2.android.FragmentEvent;
import com.zhihu.android.R;
import com.zhihu.android.api.model.SyncClub;
import com.zhihu.android.app.router.RouterUrl;
import com.zhihu.android.app.router.ZRouter;
import com.zhihu.android.base.util.RxBus;
import com.zhihu.android.base.widget.ZHCheckBox;
import com.zhihu.android.base.widget.ZHTextView;
import com.zhihu.android.club.interfaces.ClubABInterface;
import com.zhihu.android.club.p1428c.ClubSyncSelectEvent;
import com.zhihu.android.module.InstanceProvider;
import com.zhihu.android.p1480db.fragment.DbEditorFragment;
import com.zhihu.android.p1480db.p1486b.p1487a.DBClubSPUtils;
import com.zhihu.android.p1480db.p1486b.p1487a.DBClubZAUtils;
import kotlin.Metadata;
import kotlin.TypeCastException;
import kotlin.p2243e.p2245b.C32569u;
import kotlin.p2253l.C32646n;
import p2189io.reactivex.p2205a.p2207b.AndroidSchedulers;
import p2189io.reactivex.p2209c.AbstractC31735g;
@Metadata
/* renamed from: com.zhihu.android.db.b.a */
/* compiled from: DBSyncClubDelegate.kt */
public final class DBSyncClubDelegate {
/* renamed from: a */
private String f64230a;
/* renamed from: b */
private LinearLayout f64231b;
/* renamed from: c */
private ZHCheckBox f64232c;
/* renamed from: d */
private ZHTextView f64233d;
/* renamed from: e */
private ViewStub f64234e;
/* renamed from: f */
private final DbEditorFragment f64235f;
public DBSyncClubDelegate(DbEditorFragment dbEditorFragment) {
C32569u.m150519b(dbEditorFragment, C6969H.m41409d("G6F91D41DB235A53D"));
this.f64235f = dbEditorFragment;
if (((ClubABInterface) InstanceProvider.m107964b(ClubABInterface.class)).getHadJoinedClub()) {
m92172c();
m92173d();
m92174e();
}
}
@SuppressLint({"CheckResult"})
/* renamed from: c */
private final void m92172c() {
RxBus.m86979a().mo84363a(ClubSyncSelectEvent.class).compose(this.f64235f.bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new C18159a(this), C18160b.f64237a);
}
/* access modifiers changed from: package-private */
@Metadata
/* renamed from: com.zhihu.android.db.b.a$a */
/* compiled from: DBSyncClubDelegate.kt */
public static final class C18159a<T> implements AbstractC31735g<ClubSyncSelectEvent> {
/* renamed from: a */
final /* synthetic */ DBSyncClubDelegate f64236a;
C18159a(DBSyncClubDelegate aVar) {
this.f64236a = aVar;
}
/* renamed from: a */
public final void accept(ClubSyncSelectEvent bVar) {
this.f64236a.m92166a((DBSyncClubDelegate) bVar);
}
}
/* access modifiers changed from: package-private */
@Metadata
/* renamed from: com.zhihu.android.db.b.a$b */
/* compiled from: DBSyncClubDelegate.kt */
public static final class C18160b<T> implements AbstractC31735g<Throwable> {
/* renamed from: a */
public static final C18160b f64237a = new C18160b();
C18160b() {
}
/* renamed from: a */
public final void accept(Throwable th) {
C32569u.m150519b(th, C6969H.m41409d("G6681DF"));
th.printStackTrace();
}
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
/* renamed from: a */
private final void m92166a(ClubSyncSelectEvent bVar) {
if (bVar != null) {
SyncClub syncClub = new SyncClub();
syncClub.name = bVar.mo85779a().name;
syncClub.f40364id = String.valueOf(bVar.mo85779a().f40250id);
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
if (zHCheckBox.isChecked() && (!C32569u.m150517a((Object) this.f64230a, (Object) syncClub.f40364id))) {
DBClubZAUtils.m92185b(syncClub.name, syncClub.f40364id);
}
m92165a(syncClub);
m92171a(true, true);
}
}
/* renamed from: d */
private final void m92173d() {
if (this.f64235f.getView() != null && this.f64235f.getContext() != null) {
View view = this.f64235f.getView();
if (view == null) {
C32569u.m150511a();
}
this.f64234e = (ViewStub) view.findViewById(R.id.view_stub_layout_sync_club);
ViewStub viewStub = this.f64234e;
View inflate = viewStub != null ? viewStub.inflate() : null;
if (inflate != null) {
View findViewById = ((FrameLayout) inflate).findViewById(R.id.ll_sync_club);
C32569u.m150513a((Object) findViewById, C6969H.m41409d("G6F8FE603B1338728FF01855CBCE3CAD96DB5DC1FA812B200E246A206FBE18DDB65BCC603B133942AEA1B9201"));
this.f64231b = (LinearLayout) findViewById;
LinearLayout linearLayout = this.f64231b;
if (linearLayout == null) {
C32569u.m150520b(C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F1"));
}
View findViewById2 = linearLayout.findViewById(R.id.select);
C32569u.m150513a((Object) findViewById2, C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F18DD1608DD12CB635BC0BFF279400C0ABCAD32790D016BA33BF60"));
this.f64232c = (ZHCheckBox) findViewById2;
LinearLayout linearLayout2 = this.f64231b;
if (linearLayout2 == null) {
C32569u.m150520b(C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F1"));
}
View findViewById3 = linearLayout2.findViewById(R.id.tv_club_name);
C32569u.m150513a((Object) findViewById3, C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F18DD1608DD12CB635BC0BFF279400C0ABCAD32797C325BC3CBE2BD9009145F7AC"));
this.f64233d = (ZHTextView) findViewById3;
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
zHTextView.setOnClickListener(new View$OnClickListenerC18161c(this));
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
zHCheckBox.setOnCheckedChangeListener(new C18162d(this));
ZHTextView zHTextView2 = this.f64233d;
if (zHTextView2 == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
DBClubZAUtils.m92184a(zHTextView2.getText().toString(), this.f64230a);
return;
}
throw new TypeCastException(C6969H.m41409d("G6796D916FF33AA27E8018408F0E083D46890C15AAB3FEB27E900DD46E7E9CF977D9AC51FFF31A52DF401994CBCF2CAD36E86C1549922AA24E3229151FDF0D7"));
}
}
/* access modifiers changed from: package-private */
@Metadata
/* renamed from: com.zhihu.android.db.b.a$c */
/* compiled from: DBSyncClubDelegate.kt */
public static final class View$OnClickListenerC18161c implements View.OnClickListener {
/* renamed from: a */
final /* synthetic */ DBSyncClubDelegate f64238a;
View$OnClickListenerC18161c(DBSyncClubDelegate aVar) {
this.f64238a = aVar;
}
public final void onClick(View view) {
this.f64238a.m92175f();
}
}
/* access modifiers changed from: package-private */
@Metadata
/* renamed from: com.zhihu.android.db.b.a$d */
/* compiled from: DBSyncClubDelegate.kt */
public static final class C18162d implements CompoundButton.OnCheckedChangeListener {
/* renamed from: a */
final /* synthetic */ DBSyncClubDelegate f64239a;
C18162d(DBSyncClubDelegate aVar) {
this.f64239a = aVar;
}
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
this.f64239a.m92171a((DBSyncClubDelegate) z, false);
}
}
/* renamed from: e */
private final void m92174e() {
SyncClub a = DBClubSPUtils.f64240a.mo88172a();
if (a != null) {
m92165a(a);
}
}
/* renamed from: a */
public final String mo88166a() {
if (((ClubABInterface) InstanceProvider.m107964b(ClubABInterface.class)).getHadJoinedClub() && this.f64234e != null && m92176g()) {
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
if (zHCheckBox.isChecked()) {
return this.f64230a;
}
}
return null;
}
/* renamed from: b */
public final void mo88167b() {
String a = mo88166a();
if (a != null) {
DBClubSPUtils aVar = DBClubSPUtils.f64240a;
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
aVar.mo88173a(a, zHTextView.getText().toString());
}
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
/* renamed from: a */
private final void m92171a(boolean z, boolean z2) {
if (m92176g()) {
if (z2) {
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
zHCheckBox.setChecked(z);
} else if (z) {
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
DBClubZAUtils.m92185b(zHTextView.getText().toString(), this.f64230a);
}
m92170a(z);
return;
}
ZHCheckBox zHCheckBox2 = this.f64232c;
if (zHCheckBox2 == null) {
C32569u.m150520b("select");
}
zHCheckBox2.setChecked(false);
m92175f();
}
/* renamed from: a */
private final void m92170a(boolean z) {
int i = z ? R.drawable.p6 : R.drawable.p5;
int i2 = R.color.GBL01A;
int i3 = z ? R.color.GBL01A : R.color.GBK07A;
if (!z) {
i2 = R.color.GBK06A;
}
int i4 = z ? 21 : 255;
LinearLayout linearLayout = this.f64231b;
if (linearLayout == null) {
C32569u.m150520b(C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F1"));
}
linearLayout.setBackground(ContextCompat.getDrawable(this.f64235f.requireContext(), i));
LinearLayout linearLayout2 = this.f64231b;
if (linearLayout2 == null) {
C32569u.m150520b(C6969H.m41409d("G7A9ADB199C3CBE2BCA0F8947E7F1"));
}
Drawable background = linearLayout2.getBackground();
if (background != null) {
background.setAlpha(i4);
}
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
zHTextView.setTextColorRes(i2);
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
zHCheckBox.setTextColor(ContextCompat.getColor(this.f64235f.requireContext(), i3));
ZHTextView zHTextView2 = this.f64233d;
if (zHTextView2 == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
zHTextView2.setDrawableTintColorResource(i2);
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
/* renamed from: f */
private final void m92175f() {
RouterUrl.C14428a c = ZRouter.m72975c(C6969H.m41409d("G738BDC12AA6AE466E502854ABDF6C6D96DCCC603B133A33BE9009952F7E1"));
ZHCheckBox zHCheckBox = this.f64232c;
if (zHCheckBox == null) {
C32569u.m150520b(C6969H.m41409d("G7A86D91FBC24"));
}
if (zHCheckBox.isChecked()) {
String str = this.f64230a;
if (!(str == null || str.length() == 0)) {
c.mo76341a(C6969H.m41409d("G6A8FC0189634"), this.f64230a);
}
}
ZRouter.m72966a(this.f64235f.getContext(), c.mo76345a());
}
/* renamed from: a */
private final void m92165a(SyncClub syncClub) {
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
zHTextView.setVisibility(0);
ZHTextView zHTextView2 = this.f64233d;
if (zHTextView2 == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
zHTextView2.setText(syncClub.name);
this.f64230a = syncClub.f40364id;
}
/* renamed from: g */
private final boolean m92176g() {
ZHTextView zHTextView = this.f64233d;
if (zHTextView == null) {
C32569u.m150520b(C6969H.m41409d("G7D95F616AA328528EB0B"));
}
if (zHTextView.getVisibility() == 0) {
String str = this.f64230a;
if (!(str == null || C32646n.m150693a(str))) {
return true;
}
}
return false;
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
81a598297bcbb76b9bc304113da1bba41a375c22 | 6e57bdc0a6cd18f9f546559875256c4570256c45 | /packages/apps/Dialer/java/com/android/dialer/smartdial/util/SmartDialNameMatcher.java | d89fbc734d5de452f5cad193134cc0465a1e6e85 | [
"Apache-2.0"
] | permissive | dongdong331/test | 969d6e945f7f21a5819cd1d5f536d12c552e825c | 2ba7bcea4f9d9715cbb1c4e69271f7b185a0786e | refs/heads/master | 2023-03-07T06:56:55.210503 | 2020-12-07T04:15:33 | 2020-12-07T04:15:33 | 134,398,935 | 2 | 1 | null | 2022-11-21T07:53:41 | 2018-05-22T10:26:42 | null | UTF-8 | Java | false | false | 19,365 | java | /*
* Copyright (C) 2012 The Android Open Source Project
*
* 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.android.dialer.smartdial.util;
import android.content.Context;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.android.dialer.smartdial.map.CompositeSmartDialMap;
import com.android.dialer.smartdial.util.SmartDialPrefix.PhoneNumberTokens;
import java.util.ArrayList;
/**
* {@link #SmartDialNameMatcher} contains utility functions to remove accents from accented
* characters and normalize a phone number. It also contains the matching logic that determines if a
* contact's display name matches a numeric query. The boolean variable {@link #ALLOW_INITIAL_MATCH}
* controls the behavior of the matching logic and determines whether we allow matches like 57 -
* (J)ohn (S)mith.
*/
public class SmartDialNameMatcher {
// Whether or not we allow matches like 57 - (J)ohn (S)mith
private static final boolean ALLOW_INITIAL_MATCH = true;
// The maximum length of the initial we will match - typically set to 1 to minimize false
// positives
private static final int INITIAL_LENGTH_LIMIT = 1;
private final ArrayList<SmartDialMatchPosition> matchPositions = new ArrayList<>();
private String query;
// Controls whether to treat an empty query as a match (with anything).
private boolean shouldMatchEmptyQuery = false;
//SPRD: FEATURE_MATCH_COUNTRY_CODE_IN_DIALPAD
private static boolean mNeedstripCountryCode = false;
public SmartDialNameMatcher(String query) {
this.query = query;
}
/**
* Strips a phone number of unnecessary characters (spaces, dashes, etc.)
*
* @param number Phone number we want to normalize
* @return Phone number consisting of digits from 0-9
*/
public static String normalizeNumber(Context context, String number) {
return normalizeNumber(context, number, /* offset = */ 0);
}
/**
* Strips a phone number of unnecessary characters (spaces, dashes, etc.)
*
* @param number Phone number we want to normalize
* @param offset Offset to start from
* @return Phone number consisting of digits from 0-9
*/
public static String normalizeNumber(Context context, String number, int offset) {
final StringBuilder s = new StringBuilder();
for (int i = offset; i < number.length(); i++) {
char ch = number.charAt(i);
if (CompositeSmartDialMap.isValidDialpadNumericChar(context, ch)) {
s.append(ch);
}
}
return s.toString();
}
/**
* Constructs empty highlight mask. Bit 0 at a position means there is no match, Bit 1 means there
* is a match and should be highlighted in the TextView.
*
* @param builder StringBuilder object
* @param length Length of the desired mask.
*/
private void constructEmptyMask(StringBuilder builder, int length) {
for (int i = 0; i < length; ++i) {
builder.append("0");
}
}
/**
* Replaces the 0-bit at a position with 1-bit, indicating that there is a match.
*
* @param builder StringBuilder object.
* @param matchPos Match Positions to mask as 1.
*/
private void replaceBitInMask(StringBuilder builder, SmartDialMatchPosition matchPos) {
for (int i = matchPos.start; i < matchPos.end; ++i) {
builder.replace(i, i + 1, "1");
}
}
/**
* Matches a phone number against a query. Let the test application overwrite the NANP setting.
*
* @param phoneNumber - Raw phone number
* @param query - Normalized query (only contains numbers from 0-9)
* @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
* with the matching positions otherwise
*/
@Nullable
public SmartDialMatchPosition matchesNumber(Context context, String phoneNumber, String query) {
if (TextUtils.isEmpty(phoneNumber)) {
return shouldMatchEmptyQuery ? new SmartDialMatchPosition(0, 0) : null;
}
StringBuilder builder = new StringBuilder();
constructEmptyMask(builder, phoneNumber.length());
// Try matching the number as is
SmartDialMatchPosition matchPos =
matchesNumberWithOffset(context, phoneNumber, query, /* offset = */ 0);
if (matchPos == null) {
PhoneNumberTokens phoneNumberTokens = SmartDialPrefix.parsePhoneNumber(context, phoneNumber);
if (phoneNumberTokens.countryCodeOffset != 0) {
matchPos =
matchesNumberWithOffset(
context, phoneNumber, query, phoneNumberTokens.countryCodeOffset);
}
if (matchPos == null && phoneNumberTokens.nanpCodeOffset != 0) {
matchPos =
matchesNumberWithOffset(context, phoneNumber, query, phoneNumberTokens.nanpCodeOffset);
}
}
if (matchPos != null) {
replaceBitInMask(builder, matchPos);
}
return matchPos;
}
/**
* Matches a phone number against the saved query, taking care of formatting characters and also
* taking into account country code prefixes and special NANP number treatment.
*
* @param phoneNumber - Raw phone number
* @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
* with the matching positions otherwise
*/
public SmartDialMatchPosition matchesNumber(Context context, String phoneNumber) {
return matchesNumber(context, phoneNumber, query);
}
/**
* Matches a phone number against a query, taking care of formatting characters
*
* @param phoneNumber - Raw phone number
* @param query - Normalized query (only contains numbers from 0-9)
* @param offset - The position in the number to start the match against (used to ignore leading
* prefixes/country codes)
* @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
* with the matching positions otherwise
*/
private SmartDialMatchPosition matchesNumberWithOffset(
Context context, String phoneNumber, String query, int offset) {
if (TextUtils.isEmpty(phoneNumber) || TextUtils.isEmpty(query)) {
return shouldMatchEmptyQuery ? new SmartDialMatchPosition(offset, offset) : null;
}
int queryAt = 0;
int numberAt = offset;
for (int i = offset; i < phoneNumber.length(); i++) {
if (queryAt == query.length()) {
break;
}
char ch = phoneNumber.charAt(i);
if (CompositeSmartDialMap.isValidDialpadNumericChar(context, ch)) {
if (ch != query.charAt(queryAt)) {
return null;
}
queryAt++;
} else {
if (queryAt == 0) {
// Found a separator before any part of the query was matched, so advance the
// offset to avoid prematurely highlighting separators before the rest of the
// query.
// E.g. don't highlight the first '-' if we're matching 1-510-111-1111 with
// '510'.
// However, if the current offset is 0, just include the beginning separators
// anyway, otherwise the highlighting ends up looking weird.
// E.g. if we're matching (510)-111-1111 with '510', we should include the
// first '('.
if (offset != 0) {
offset++;
}
}
}
numberAt++;
}
return new SmartDialMatchPosition(0 + offset, numberAt);
}
/**
* This function iterates through each token in the display name, trying to match the query to the
* numeric equivalent of the token.
*
* <p>A token is defined as a range in the display name delimited by characters that have no latin
* alphabet equivalents (e.g. spaces - ' ', periods - ',', underscores - '_' or chinese characters
* - '王'). Transliteration from non-latin characters to latin character will be done on a best
* effort basis - e.g. 'Ü' - 'u'.
*
* <p>For example, the display name "Phillips Thomas Jr" contains three tokens: "phillips",
* "thomas", and "jr".
*
* <p>A match must begin at the start of a token. For example, typing 846(Tho) would match
* "Phillips Thomas", but 466(hom) would not.
*
* <p>Also, a match can extend across tokens. For example, typing 37337(FredS) would match (Fred
* S)mith.
*
* @param displayName The normalized(no accented characters) display name we intend to match
* against.
* @param query The string of digits that we want to match the display name to.
* @param matchList An array list of {@link SmartDialMatchPosition}s that we add matched positions
* to.
* @return Returns true if a combination of the tokens in displayName match the query string
* contained in query. If the function returns true, matchList will contain an ArrayList of
* match positions (multiple matches correspond to initial matches).
*/
private boolean matchesCombination(
Context context,
String displayName,
String query,
ArrayList<SmartDialMatchPosition> matchList) {
StringBuilder builder = new StringBuilder();
/**
* UNISOC: Bug998212 occur java.lang.NullPointerException in monkey test. {@
* */
if (displayName == null) {
return false;
}
/**
* }@
* */
constructEmptyMask(builder, displayName.length());
final int nameLength = displayName.length();
final int queryLength = query.length();
if (nameLength < queryLength) {
return false;
}
if (queryLength == 0) {
return false;
}
// The current character index in displayName
// E.g. 3 corresponds to 'd' in "Fred Smith"
int nameStart = 0;
// The current character in the query we are trying to match the displayName against
int queryStart = 0;
// The start position of the current token we are inspecting
int tokenStart = 0;
// The number of non-alphabetic characters we've encountered so far in the current match.
// E.g. if we've currently matched 3733764849 to (Fred Smith W)illiam, then the
// seperatorCount should be 2. This allows us to correctly calculate offsets for the match
// positions
int seperatorCount = 0;
ArrayList<SmartDialMatchPosition> partial = new ArrayList<SmartDialMatchPosition>();
// Keep going until we reach the end of displayName
while (nameStart < nameLength && queryStart < queryLength) {
char ch = displayName.charAt(nameStart);
// Strip diacritics from accented characters if any
ch = CompositeSmartDialMap.normalizeCharacter(context, ch);
if (CompositeSmartDialMap.isValidDialpadCharacter(context, ch)) {
if (CompositeSmartDialMap.isValidDialpadAlphabeticChar(context, ch)) {
ch = CompositeSmartDialMap.getDialpadNumericCharacter(context, ch);
}
if (ch != query.charAt(queryStart)) {
// Failed to match the current character in the query.
// Case 1: Failed to match the first character in the query. Skip to the next
// token since there is no chance of this token matching the query.
// Case 2: Previous characters in the query matched, but the current character
// failed to match. This happened in the middle of a token. Skip to the next
// token since there is no chance of this token matching the query.
// Case 3: Previous characters in the query matched, but the current character
// failed to match. This happened right at the start of the current token. In
// this case, we should restart the query and try again with the current token.
// Otherwise, we would fail to match a query like "964"(yog) against a name
// Yo-Yoghurt because the query match would fail on the 3rd character, and
// then skip to the end of the "Yoghurt" token.
if (queryStart == 0
|| CompositeSmartDialMap.isValidDialpadCharacter(
context,
CompositeSmartDialMap.normalizeCharacter(
context, displayName.charAt(nameStart - 1)))) {
// skip to the next token, in the case of 1 or 2.
while (nameStart < nameLength
&& CompositeSmartDialMap.isValidDialpadCharacter(
context,
CompositeSmartDialMap.normalizeCharacter(
context, displayName.charAt(nameStart)))) {
nameStart++;
}
nameStart++;
}
// Restart the query and set the correct token position
queryStart = 0;
seperatorCount = 0;
tokenStart = nameStart;
} else {
if (queryStart == queryLength - 1) {
// As much as possible, we prioritize a full token match over a sub token
// one so if we find a full token match, we can return right away
matchList.add(
new SmartDialMatchPosition(tokenStart, queryLength + tokenStart + seperatorCount));
for (SmartDialMatchPosition match : matchList) {
replaceBitInMask(builder, match);
}
return true;
} else if (ALLOW_INITIAL_MATCH && queryStart < INITIAL_LENGTH_LIMIT) {
// we matched the first character.
// branch off and see if we can find another match with the remaining
// characters in the query string and the remaining tokens
// find the next separator in the query string
int j;
for (j = nameStart; j < nameLength; j++) {
if (!CompositeSmartDialMap.isValidDialpadCharacter(
context,
CompositeSmartDialMap.normalizeCharacter(context, displayName.charAt(j)))) {
break;
}
}
// this means there is at least one character left after the separator
if (j < nameLength - 1) {
final String remainder = displayName.substring(j + 1);
final ArrayList<SmartDialMatchPosition> partialTemp = new ArrayList<>();
if (matchesCombination(
context, remainder, query.substring(queryStart + 1), partialTemp)) {
// store the list of possible match positions
SmartDialMatchPosition.advanceMatchPositions(partialTemp, j + 1);
partialTemp.add(0, new SmartDialMatchPosition(nameStart, nameStart + 1));
// we found a partial token match, store the data in a
// temp buffer and return it if we end up not finding a full
// token match
partial = partialTemp;
}
}
}
nameStart++;
queryStart++;
// we matched the current character in the name against one in the query,
// continue and see if the rest of the characters match
}
} else {
// found a separator, we skip this character and continue to the next one
nameStart++;
if (queryStart == 0) {
// This means we found a separator before the start of a token,
// so we should increment the token's start position to reflect its true
// start position
tokenStart = nameStart;
} else {
// Otherwise this separator was found in the middle of a token being matched,
// so increase the separator count
seperatorCount++;
}
}
}
// if we have no complete match at this point, then we attempt to fall back to the partial
// token match(if any). If we don't allow initial matching (ALLOW_INITIAL_MATCH = false)
// then partial will always be empty.
if (!partial.isEmpty()) {
matchList.addAll(partial);
for (SmartDialMatchPosition match : matchList) {
replaceBitInMask(builder, match);
}
return true;
}
return false;
}
/**
* This function iterates through each token in the display name, trying to match the query to the
* numeric equivalent of the token.
*
* <p>A token is defined as a range in the display name delimited by characters that have no latin
* alphabet equivalents (e.g. spaces - ' ', periods - ',', underscores - '_' or chinese characters
* - '王'). Transliteration from non-latin characters to latin character will be done on a best
* effort basis - e.g. 'Ü' - 'u'.
*
* <p>For example, the display name "Phillips Thomas Jr" contains three tokens: "phillips",
* "thomas", and "jr".
*
* <p>A match must begin at the start of a token. For example, typing 846(Tho) would match
* "Phillips Thomas", but 466(hom) would not.
*
* <p>Also, a match can extend across tokens. For example, typing 37337(FredS) would match (Fred
* S)mith.
*
* @param displayName The normalized(no accented characters) display name we intend to match
* against.
* @return Returns true if a combination of the tokens in displayName match the query string
* contained in query. If the function returns true, matchList will contain an ArrayList of
* match positions (multiple matches correspond to initial matches).
*/
public boolean matches(Context context, String displayName) {
matchPositions.clear();
return matchesCombination(context, displayName, query, matchPositions);
}
public ArrayList<SmartDialMatchPosition> getMatchPositions() {
// Return a clone of mMatchPositions so that the caller can use it without
// worrying about it changing
return new ArrayList<>(matchPositions);
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public void setShouldMatchEmptyQuery(boolean matches) {
shouldMatchEmptyQuery = matches;
}
/**
* SPRD: FEATURE_MATCH_COUNTRY_CODE_IN_DIALPAD @{
* judge if the numner is a countrycode number
*
* @param number Phone number we want to Strip
* @param countrycode countrycode we want to match
* @return if the numner is a countrycode number
*/
public static boolean isCountryCodeNumber(String number,
String[] countryCodeArray) {
if (countryCodeArray == null || countryCodeArray.length <= 0
|| TextUtils.isEmpty(number)) {
return false;
}
int count = countryCodeArray.length;
for (int i = 0; i < count; i++) {
if (countryCodeArray[i] != null
&& number.length() > countryCodeArray[i].length()
&& number.startsWith(countryCodeArray[i])) {
return true;
}
}
return false;
}
/** @} */
/* SPRD: FEATURE_MATCH_COUNTRY_CODE_IN_DIALPAD @{ */
public static void setNeedstripCountryCode(boolean stripCountryCode) {
mNeedstripCountryCode = stripCountryCode;
}
public static boolean isNeedstripCountryCode() {
return mNeedstripCountryCode;
}
/* @} */
}
| [
"dongdong331@163.com"
] | dongdong331@163.com |
28db7a77abbc57303706aa0f6d3af003e01ab631 | 616a23701152553788eb969abce31c1831a62d83 | /Endereço/src/dao/EnderecoDao.java | 5124a6271808047b375dbc5c242247dbab9c71a7 | [] | no_license | segozachan/Endere-o | 417bab71903630e3270b89684fcc5a7874e535c9 | 76b363a6968de5428546e856391fb0797a9a536a | refs/heads/master | 2020-06-28T01:00:34.400418 | 2019-08-01T22:29:58 | 2019-08-01T22:29:58 | 200,100,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,698 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dao;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import modelo.Endereco;
public class EnderecoDao {
public static boolean inserir(Endereco objeto) {
String sql = "INSERT INTO endereco (logradouro, complemento, bairro) VALUES (?, ?, ?)";
try {
PreparedStatement ps = conexao.Conexao.getConexao().prepareStatement(sql);
ps.setString(1, objeto.getLogradouro());
ps.setString(2, objeto.getComplemento());
ps.setString(3, objeto.getBairro());
ps.executeUpdate();
return true;
} catch (SQLException | ClassNotFoundException ex) {
System.out.println(ex.getMessage());
return false;
}
}
public static void main(String[] args) {
Endereco objeto = new Endereco();
objeto.setLogradouro("Renato 37");
objeto.setComplemento("Casa");
objeto.setBairro("Madeira");
boolean resultado = inserir(objeto);
if (resultado) {
JOptionPane.showMessageDialog(null, "Inserido com sucesso!");
} else {
JOptionPane.showMessageDialog(null, "Erro!");
}
}
public static boolean alterar(Endereco objeto) {
String sql = "UPDATE endereco SET logradouro = ?, complemento = ?, bairro = ? WHERE codigo=?";
try {
PreparedStatement ps = conexao.Conexao.getConexao().prepareStatement(sql);
ps.setString(1, objeto.getLogradouro());
ps.setString(2, objeto.getComplemento());
ps.setString(3, objeto.getBairro());
ps.setInt(4, objeto.getCodigo());
ps.executeUpdate();
return true;
} catch (SQLException | ClassNotFoundException ex) {
System.out.println(ex.getMessage());
return false;
}}
public static boolean excluir(Endereco objeto){
String sql = "DELETE FROM endereco WHERE codigo=?";
try {
PreparedStatement ps = conexao.Conexao.getConexao().prepareStatement(sql);
ps.setInt(1, objeto.getCodigo());
ps.executeUpdate();
return true;
} catch (SQLException | ClassNotFoundException ex) {
System.out.println(ex.getMessage());
return false;
}
}
}
| [
"Administrador@10.10.4.15"
] | Administrador@10.10.4.15 |
985b8239b4c6c495f21d12590f15f417667a2eae | c0a48cc2fe4e82f68dac11c0a448bd236558fe9e | /src/main/java/com/infotel/ig/mabanque/services/ICompteResource.java | b03148619c8a4afbc56ec37606008b32ce6b08db | [] | no_license | gady777/Mabanque | 5da26a9d7a7bc630bed94df6234942c4335913bb | 854e2eec82f1268d9fed20a4d3c473f9fb78403b | refs/heads/master | 2023-09-04T04:42:02.638464 | 2020-09-07T15:15:59 | 2020-09-07T15:15:59 | 293,561,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package com.infotel.ig.mabanque.services;
import com.infotel.ig.mabanque.entities.Compte;
import com.infotel.ig.mabanque.entities.Operation;
import java.util.List;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
/**
*
* @author HP
*/
@Path("/comptes")
public interface ICompteResource {
@GET
@Produces(value = {MediaType.APPLICATION_JSON})
public ResponseEntity<Page<Compte>> getAllComptes(@QueryParam("page") @DefaultValue("0")int page, @QueryParam("size") @DefaultValue("20")int pagesize);
@GET
@Path("{id : \\d+}")
@Produces(value = {MediaType.APPLICATION_JSON})
public ResponseEntity<Compte> findCompte(@PathParam("id")long id);
@GET
@Path("/search")
@Produces(value = {MediaType.APPLICATION_JSON})
public ResponseEntity<Compte> searchCompte(@QueryParam("numero")String numero);
@GET
@Path("{id : \\d+}/operations")
@Produces(value = {MediaType.APPLICATION_JSON})
public ResponseEntity<List<Operation>> getAllOperationsCompte(@PathParam("id") long id);
}
| [
"douwevincent@yahoo.fr"
] | douwevincent@yahoo.fr |
85dbc39db3595618f7bdd0a4aa519bf3dd65cf9d | 4ddf0512874b6833c1d39d954a90e83b235a1ac1 | /api/src/main/java/com/api/common/controller/DjItrnAkpController.java | dfeefb5a12752dce3c73032dbdedf1a2c8a89e21 | [] | no_license | looooogan/icomp-4gb-api | a6a77882408077e6c65212f7b077c55ab83d49ab | 4fd701c5ca694abecb05a13f2e32ab890cad3269 | refs/heads/master | 2020-03-17T20:11:58.057762 | 2018-06-28T09:02:26 | 2018-06-28T09:02:26 | 133,897,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,453 | java | package com.api.common.controller;
import com.api.base.controller.BaseController;
import com.common.pojo.DjItrnAkp;
import com.common.vo.DjItrnAkpVO;
import com.service.common.IDjItrnAkpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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 java.util.HashMap;
import java.util.Map;
/**
*
* @ClassName DjItrnAkpController
* @Description DjItrnAkpController控制器
* @author Jivoin
*/
@Controller
@RequestMapping("djItrnAkp")
public class DjItrnAkpController extends BaseController{
@Autowired
private IDjItrnAkpService djItrnAkpService;
/**
* @Title: add
* @Description: 添加DjItrnAkp
* @param djItrnAkp
* @throws Exception
* @return: void
*/
@RequestMapping(value = "add",method = RequestMethod.POST)
@ResponseBody
public void add(@RequestBody DjItrnAkp djItrnAkp) throws Exception{
this.djItrnAkpService.addDjItrnAkp(djItrnAkp);
}
/**
* @Title: update
* @Description: 修改DjItrnAkp
* @param djItrnAkp
* @throws Exception
* @return: void
*/
@RequestMapping(value = "upd",method = RequestMethod.POST)
@ResponseBody
public void update(@RequestBody DjItrnAkp djItrnAkp) throws Exception{
this.djItrnAkpService.updDjItrnAkp(djItrnAkp);
}
/**
* @Title: del
* @Description: 删除DjItrnAkp
* @param djItrnAkp
* @throws Exception
* @return: void
*/
@RequestMapping(value = "del",method = RequestMethod.POST)
@ResponseBody
public void del(@RequestBody DjItrnAkp djItrnAkp) throws Exception{
this.djItrnAkpService.delDjItrnAkpForLogic(djItrnAkp);
}
/**
* @Title: getDjItrnAkpByVo
* @Description: 根据查询条件查询
* @param djItrnAkpVO
* @throws Exception
* @return: void
*/
@RequestMapping(value = "search",method = RequestMethod.POST)
@ResponseBody
public DjItrnAkp getDjItrnAkpByVo(@RequestBody DjItrnAkpVO djItrnAkpVO) throws Exception{
return this.djItrnAkpService.getDjItrnAkp(djItrnAkpVO);
}
/**
* @Title: getDjItrnAkpByPage
* @Description: 根据查询条件查询
* @param djItrnAkpVO
* @throws Exception
* @return: void
*/
@RequestMapping(value = "list",method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> getDjItrnAkpByPage(@RequestBody DjItrnAkpVO djItrnAkpVO) throws Exception{
Map<String,Object> result = new HashMap<>();
result.put("data",this.djItrnAkpService.getDjItrnAkpByPage(djItrnAkpVO));
result.put("vo",djItrnAkpVO);
return result;
}
/**
* @Title: toListPage
* @Description: 跳转到列表页面
* @throws Exception
* @return: void
*/
@RequestMapping("toListPage")
public String toListPage() throws Exception{
return "/djItrnAkp/djItrnAkpList";
}
/**
* @Title: toInsAndUpdPage
* @Description: 跳转到添加 修改页面
* @throws Exception
* @return: void
*/
@RequestMapping("toInsAndUpdPage")
public String toInsAndUpdPage() throws Exception{
return "/djItrnAkp/djItrnAkpInsAndUpd";
}
}
| [
"logan.box2016@gmail.com"
] | logan.box2016@gmail.com |
0a9b971466ac2f6816718d3b7e08f868152b44dd | 9d721c465ef64bd13c27d710bf3815f21fbf383e | /src/main/java/ci/bda/confirming/model/Tickets.java | d7758d2f216ffb74d0420c99e9e84136ee06db26 | [] | no_license | stephanehu/confirming | 649b7b25d0610bd318b0b2e6600671669c32abd8 | 1d16539afc7900ff5fe3786c9a64d633074c7aaa | refs/heads/master | 2020-05-19T06:49:14.509620 | 2019-05-11T16:35:14 | 2019-05-11T16:35:14 | 184,883,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package ci.bda.confirming.model;
public class Tickets {
private long id;
private String description;
public Tickets(){
}
public Long getId(){
return this.id;
}
public void setId(Long id){
this.id=id;
}
public String getDescription(){
return this.description;
}
public void setDescription(String description){
this.description=description;
}
}
//e295ddd889fed7ad4cbeaa752e83ca825d0f2aa8
/*
mvn sonar:sonar \
-Dsonar.projectKey=stephanehu_confirming \
-Dsonar.organization=stephanehu-github \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=e295ddd889fed7ad4cbeaa752e83ca825d0f2aa8
*/ | [
"stephaneehu@gmail.com"
] | stephaneehu@gmail.com |
c870607ba737d9030d3a1f493656797174d05d71 | 7a5daa8621dc6d1d483931862b48e07b1e80cb05 | /Tumobi/app/src/main/java/com/example/lenovo/tumobi/base/BaseMvpFragment.java | f5037a86dcb9997c2268ff36d6b8212472611d73 | [] | no_license | tumobihahaha/Project | 456c933bf1dffeaf076df40742cfddb96e9a7eb3 | 2d0380d5ca4c0b03252c24bb69a6fbb43ef8eeee | refs/heads/master | 2020-06-11T15:36:19.062990 | 2019-06-27T03:10:03 | 2019-06-27T03:10:03 | 193,497,858 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,443 | java | package com.example.lenovo.tumobi.base;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.lenovo.tumobi.interfaces.IBaseView;
import com.example.lenovo.tumobi.interfaces.IPersenter;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by Lenovo on 2019/6/6.
*/
public abstract class BaseMvpFragment<V extends IBaseView,P extends IPersenter> extends Fragment implements IBaseView{
protected P mPresenter;
protected Context mContext;
private Unbinder mBind;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View inflate = inflater.inflate(getLayout(), null);
mBind = ButterKnife.bind(this, inflate);
mContext = getActivity();
mPresenter = initMvpPresenter();
mPresenter.attchView(this);
initView();
initData();
initListener();
return inflate;
}
protected abstract void initListener();
protected abstract void initData();
protected abstract void initView();
protected abstract P initMvpPresenter();
protected abstract int getLayout();
}
| [
"772427019@qq.com"
] | 772427019@qq.com |
29e08b4fee71b53c0020a15f7a12963a8f5b658c | ab4d7df6705eaa4d3364d037b695221a25a1acde | /src/codility/ArrayJmpSolution.java | 6c863d4718186e72ec332db7fe740903341bb8a3 | [] | no_license | sergeybezzub/SandBox | e4ab48de4790545b1c4d128ec4ce4ff0a9a974d8 | 33ca7b2ea81b4d298e2ecbea4c9e870cc054d1b0 | refs/heads/master | 2021-01-10T04:57:33.820511 | 2016-03-16T17:36:31 | 2016-03-16T17:36:31 | 54,051,344 | 0 | 0 | null | 2023-09-12T16:47:29 | 2016-03-16T17:08:34 | Java | UTF-8 | Java | false | false | 863 | java | package codility;
class ArrayJmpSolution {
public static void main(String[] args) {
int[] buf = {2,3,-1,1,3};
//int[] buf = {1,1,-1,1};
ArrayJmpSolution so = new ArrayJmpSolution();
System.out.println(so.solution(buf));
}
public int solution(int[] A) {
int size = A.length;
if(A == null || size == 0)
{
return -1;
}
if(size == 1 && A[0] == 0)
{
return -1;
}
if(size == 1 && A[0] != 0)
{
return 1;
}
int i=0;
int index=0;
int count=0;
boolean[] visited = new boolean[size];
while(true)
{
count ++;
visited[index]=true;
index = index + A[index];
if(index >= size || index < 0)
{
return count;
}
if(visited[index])
{
return -1;
}
}
}
} | [
"sergeybezzub@yahoo.com"
] | sergeybezzub@yahoo.com |
68dc421dd1b9114743ef64d498192578ce63fb2e | 4340bb08d7beb87121af90a80debc090c78a0af8 | /SpringIntroExercise/src/main/java/erxs/spring/springintroexercise/appRunner/CommandLineRunnerImpl.java | dc0ca48ac9fe328883abce6a4c6a5c67816ed3e8 | [] | no_license | marin0v89/Spring-Data | 7f0320ff131d4cadabfe292ab21be5d204d919bb | 45c9268d7530c88739bee6ded637f5523a94c04b | refs/heads/main | 2023-06-29T04:32:56.813599 | 2021-08-01T10:59:58 | 2021-08-01T10:59:58 | 379,516,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,147 | java | package erxs.spring.springintroexercise.appRunner;
import erxs.spring.springintroexercise.models.entity.AgeRestriction;
import erxs.spring.springintroexercise.models.entity.Book;
import erxs.spring.springintroexercise.service.AuthorService;
import erxs.spring.springintroexercise.service.BookService;
import erxs.spring.springintroexercise.service.CategoryService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.io.BufferedReader;
import java.io.IOException;
@Component
public class CommandLineRunnerImpl implements CommandLineRunner {
private final CategoryService categoryService;
private final AuthorService authorService;
private final BookService bookService;
private final BufferedReader bufferedReader;
public CommandLineRunnerImpl(CategoryService categoryService, AuthorService authorService, BookService bookService, BufferedReader bufferedReader) {
this.categoryService = categoryService;
this.authorService = authorService;
this.bookService = bookService;
this.bufferedReader = bufferedReader;
}
@Override
public void run(String... args) throws Exception {
seedComponents();
// Problem solutions
// problemOne(2000);
// problemTwo(1990);
// problemThree();
// problemFour("George", "Powell");
System.out.println("Please select the problem number :");
int exNumber = Integer.parseInt(bufferedReader.readLine());
switch (exNumber) {
case 1 -> bookTitleByAgeRestriction();
case 2 -> goldenBooks();
case 3 -> booksByPrice();
case 4 -> notReleasedBook();
case 5 -> booksReleasedBeforeDate();
case 6 -> authorsSearch();
case 7 -> bookSearch();
case 8 -> bookTitleSearch();
case 9 -> countBooks();
case 10 -> totalBooksCopies();
case 11 -> reducedBook();
}
}
private void reducedBook() throws IOException {
System.out.println("Please enter a title :");
String title = bufferedReader.readLine();
System.out.println(bookService
.findBookByTitle(title));
}
private void totalBooksCopies() {
authorService
.findAllAuthorsTotalCopies()
.forEach(System.out::println);
}
private void countBooks() throws IOException {
System.out.println("Please enter title length :");
int length = Integer.parseInt(bufferedReader.readLine());
int titlesCount = bookService.
countAllBooksWithLength(length);
System.out.printf
("There are %d books with longer title than %d symbols%n"
, titlesCount
, length);
}
private void bookTitleSearch() throws IOException {
System.out.println("Please enter string that author`s last name starts with :");
String startsWith = bufferedReader.readLine();
bookService
.findBookTitleWritenByAuthor(startsWith)
.forEach(System.out::println);
}
private void bookSearch() throws IOException {
System.out.println("Please enter string that title of the book ends with");
String contains = bufferedReader.readLine().toLowerCase();
bookService
.findBooksThatTitleContains(contains)
.forEach(System.out::println);
}
private void authorsSearch() throws IOException {
System.out.println("Please enter the string that author`s name ends with :");
String endsWith = bufferedReader.readLine();
authorService
.findAuthorsWhosFirstNameEndsWith(endsWith)
.forEach(System.out::println);
}
private void booksReleasedBeforeDate() throws IOException {
System.out.println("Please enter date format :");
String[] dateFormat = bufferedReader.readLine().split("-");
int day = Integer.parseInt(dateFormat[0]);
int month = Integer.parseInt(dateFormat[1]);
int year = Integer.parseInt(dateFormat[2]);
bookService
.findBooksReleasedBeforeDate(day, month, year)
.forEach(System.out::println);
}
private void notReleasedBook() throws IOException {
System.out.println("Please enter year :");
int year = Integer.parseInt(bufferedReader.readLine());
bookService.findNotReleasedBooks(year)
.forEach(System.out::println);
}
private void booksByPrice() {
bookService.findAllBooksByPrice()
.forEach(System.out::println);
}
private void goldenBooks() {
bookService
.findAllGoldBooks()
.forEach(System.out::println);
}
private void bookTitleByAgeRestriction() throws IOException {
System.out.println("Please enter age restriction :");
AgeRestriction ageRestriction =
AgeRestriction.valueOf(bufferedReader.readLine().toUpperCase());
bookService.findAllByAgeRestriction(ageRestriction)
.forEach(book -> System.out.println(book.getTitle()));
}
private void problemFour(String firstName, String lastName) {
bookService.findAllBooksByAuthor(firstName, lastName)
.forEach(System.out::println);
}
private void problemThree() {
authorService.getAllAuthorsByBooks()
.forEach(System.out::println);
}
private void problemTwo(int year) {
bookService
.findAllAuthorsAfterYear(year)
.forEach(System.out::println);
}
private void problemOne(int year) {
bookService
.findAllBooksAfterYear(year)
.stream()
.map(Book::getTitle)
.forEach(System.out::println);
}
private void seedComponents() throws IOException {
categoryService.seedCategories();
authorService.seedAuthors();
bookService.seedBooks();
}
}
| [
"xandarous89@gmail.com"
] | xandarous89@gmail.com |
3454c907d99f54efca00bd31eabb09bc96b3a3ea | 27a6da3930612299abd819e6da19c5cb3e9bc439 | /src/main/java/ir/codefather/my_webb_app/HomeController.java | a07d96d969657a8fa6a5349be0615876fb46f63d | [] | no_license | parsa-JPM/spring_boot_web | d0be462c02f0529423e5261ead589c9dd02cdd2a | 9cc803fc63b8f6f921caffa257446fbb0503b1ba | refs/heads/master | 2021-10-11T22:52:45.989386 | 2019-01-30T09:08:26 | 2019-01-30T09:08:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | package ir.codefather.my_webb_app;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/home")
public String index() {
return "home";
}
}
| [
"mihandoost.p@gmail.com"
] | mihandoost.p@gmail.com |
23b21762aebce99bd2011fb86d99abffd9d068d6 | 11d54d9fb1c2783007709ded1acf6bb143a87fcc | /GestionDesBiens1/src/com/android/gestiondesbiens/LocationsActivity.java | 5b5aaef8e1338a765b1a096737e8ce4d0b908d90 | [] | no_license | Hayat5/smb215 | 3742f288311012ceb98d4ecd21f14b49781402be | 9a45e7b852379f26935b206298fc48e560b47243 | refs/heads/master | 2016-09-03T07:06:15.424935 | 2015-11-30T19:02:13 | 2015-11-30T19:02:13 | 37,181,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,892 | java | package com.android.gestiondesbiens;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.android.gestiondesbiens.model.Locations;
import com.android.gestiondesbiens.parsers.LocationsXMLParser;
import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
public class LocationsActivity extends Activity {
public static boolean blnReloadGrid = false;
List<Locations> locationsList;
List<MyTask> tasks;
private class MyTask extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
// updateDisplay("Starting task");
if (tasks.size() == 0) {
//pb.setVisibility(View.VISIBLE);
}
tasks.add(this);
}
@Override
protected String doInBackground(String... params) {
Log.w("params:", params[0]);
String content = HttpManager.getData(params[0]);
HttpManager hm = new HttpManager();
String data = hm.getData(params[0]);
//HttpManager
System.out.println("RESULT === "+data);
return data;
}
@Override
protected void onPostExecute(String result) {
tasks.remove(this);
if (tasks.size() == 0) {
//pb.setVisibility(View.INVISIBLE);
}
if (result == null) {
Toast.makeText(getApplicationContext(), "Web service not available", Toast.LENGTH_LONG).show();
return;
}
locationsList = LocationsXMLParser.parseFeed(result);
LoadGridDetails();
}
@Override
protected void onProgressUpdate(String... values) {
// updateDisplay(values[0]);
}
}
ArrayList<HashMap<String, String>> arrHeader, arrDetails;
HashMap<String, String> mapReservedWorkHeader, mapReservedWorkDetails;
ListAdapter adHeader, adDetails;
ListView lstHeader, lstReservedWorkDetails;
public void btnNewLocation_Click(View v){
Intent I = new Intent(this, EditLocationDetails.class);
I.putExtra("location_id", "0");
startActivity(I);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_locations);
this.lstHeader = (ListView)findViewById(R.id.lstReservedWorkHeader);
this.lstReservedWorkDetails = (ListView)findViewById(R.id.lstReservedWorkDetails);
tasks = new ArrayList<>();
this.lstReservedWorkDetails.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Intent I = new Intent(getApplicationContext(), EditLocationDetails.class);
I.putExtra("location_id", arrDetails.get(position).get("LocationID"));
startActivity(I);
}
});
this.RequestLocationData();
new Thread(new Runnable() {
@Override
public void run() {
while(true){
if(blnReloadGrid){
RequestLocationData();
blnReloadGrid = false;
}
}
}
}).start();
}
void RequestLocationData(){
this.requestData("http://" + ClsCommon.SERVER_IP.split(":")[0] + ":8080/GestionDesBiens/webresources/model.location");
}
private void requestData(String uri) {
MyTask task = new MyTask();
task.execute(uri);
}
void LoadGridHeader(){
try{
this.adHeader = null;
this.lstHeader.setAdapter(this.adHeader);
this.arrHeader = new ArrayList<HashMap<String, String>>();
this.mapReservedWorkHeader = new HashMap<String, String>();
this.mapReservedWorkHeader.put("LocationID", "Location ID");
this.mapReservedWorkHeader.put("CenterName", "Center name");
this.mapReservedWorkHeader.put("SalleName", "Salle name");
this.mapReservedWorkHeader.put("PersonnelName", "Personnel name");
this.arrHeader.add(this.mapReservedWorkHeader);
this.adHeader = new SimpleAdapter(this, arrHeader, R.layout.grid_template, new String[] {"LocationID", "CenterName", "SalleName", "PersonnelName"}, new int[] {R.id.labLocationID, R.id.labCenterName, R.id.labSalleName, R.id.labPersonnelName});
this.lstHeader.setAdapter(this.adHeader);
}
catch(Exception e){
e.printStackTrace();
}
}
void LoadGridDetails(){
try{
this.LoadGridHeader();
this.adDetails = null;
this.lstReservedWorkDetails.setAdapter(this.adDetails);
this.arrDetails = new ArrayList<HashMap<String, String>>();
for(int i = 0; i < this.locationsList.size(); i++){
this.mapReservedWorkDetails = new HashMap<String, String>();
this.mapReservedWorkDetails.put("LocationID", Integer.toString(this.locationsList.get(i).getLocationId()));
this.mapReservedWorkDetails.put("CenterName", this.locationsList.get(i).getCenterName());
this.mapReservedWorkDetails.put("SalleName", this.locationsList.get(i).getSalleName());
this.mapReservedWorkDetails.put("PersonnelName", this.locationsList.get(i).getPersonnelName());
this.arrDetails.add(this.mapReservedWorkDetails);
}
this.adDetails = new SimpleAdapter(this, arrDetails, R.layout.grid_template, new String[] {"LocationID", "CenterName", "SalleName", "PersonnelName"}, new int[] {R.id.labLocationID, R.id.labCenterName, R.id.labSalleName, R.id.labPersonnelName});
this.lstReservedWorkDetails.setAdapter(this.adDetails);
}
catch(Exception e){
e.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.locations, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_get_centers) {
Intent I = new Intent(getApplicationContext(), CenterActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_type) {
Intent I = new Intent(getApplicationContext(), TypeActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_personnel) {
Intent I = new Intent(getApplicationContext(), PersonnelActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_users) {
Intent I = new Intent(getApplicationContext(), UsersActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_groups) {
Intent I = new Intent(getApplicationContext(), GroupsActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_items) {
Intent I = new Intent(getApplicationContext(), ItemsActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_salles) {
Intent I = new Intent(getApplicationContext(), SallesActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_transations) {
Intent I = new Intent(getApplicationContext(), UserTransactionsActivity.class);
startActivity(I);
return true;
}else if (id == R.id.action_get_transport) {
Intent I = new Intent(getApplicationContext(), TransportActivity.class);
startActivity(I);
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"hayat.bourgi@gmail.com"
] | hayat.bourgi@gmail.com |
1c7bb680413163bcb59ef566a887a0573a31c4c3 | 53551ba969fab23b870035f2258ec41af49366b5 | /src/InterBlockCommunication/NXTReceive.java | 29359ad0fbfe630092c98ec335b06737914abda3 | [] | no_license | KatieDuff/DPM_Group5 | 0e16a869c2b206be3b622a163f20317e14d9a22c | ade6f3382f43d9bd3c8c4783de0332005b4ea148 | refs/heads/master | 2020-04-08T09:45:04.519191 | 2014-11-11T21:17:07 | 2014-11-11T21:17:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,371 | java | package InterBlockCommunication;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import lejos.nxt.LCD;
import lejos.nxt.comm.NXTConnection;
import lejos.nxt.comm.RS485;
/**
*
*
* author Joey Kazma
*/
public class NXTReceive
{
//Declare streams and connection
DataInputStream dis;
DataOutputStream dos;
NXTConnection conn;
private int data;
//Constructor
public NXTReceive(){
LCD.clear();
LCD.drawString("Waiting for", 0, 2);
LCD.drawString("connection...", 0, 3);
//A while loop is required since it is always waiting for data
//Try to connect
conn = RS485.getConnector().waitForConnection(0, NXTConnection.PACKET);
LCD.drawString("Connection", 0, 2);
LCD.drawString("Succeeded", 0, 3);
LCD.refresh();
dis = conn.openDataInputStream();
dos = conn.openDataOutputStream();
}
// Method to receive data
public int receiveData() {
try {
data = dis.readInt();
LCD.drawString("Read: ", 0, 4);
LCD.drawInt(data, 7, 6, 4);
// Send back 1 if reading succeeded
send(1);
} catch (IOException e) {
// Send 0 if reading failed
LCD.drawString("Error: Data loss", 0, 4);
send(0);
closeConnection();
}
return data;
}
//Method to send data
public void send(int data){
try {
dos.writeInt(data);
dos.flush(); //Not sure if this is required, will have to test it
} catch (IOException e) {
LCD.drawString("Read Exception ", 0, 5);
e.printStackTrace();
}
}
//Close connection
public void closeConnection(){
try
{
LCD.drawString("Closing... ", 0, 3);
dis.close();
dos.close();
conn.close();
}
catch (IOException ioe)
{
LCD.drawString("Close Exception", 0, 5);
LCD.refresh();
}
LCD.drawString("Finished ", 0, 3);
try {
Thread.sleep(2000);} catch (InterruptedException e) {}
}
} | [
"katherine.duff@mail.mcgill.ca"
] | katherine.duff@mail.mcgill.ca |
cd944948155bf826da78886fcf4d35f3bb866f95 | 1f2693e57a8f6300993aee9caa847d576f009431 | /testleo/myfaces-skins2/trinidad-core-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/GlobalButtonRenderer.java | 47a01671574837e04053a24e2eccb649a9e9acc8 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | mr-sobol/myfaces-csi | ad80ed1daadab75d449ef9990a461d9c06d8c731 | c142b20012dda9c096e1384a46915171bf504eb8 | refs/heads/master | 2021-01-10T06:11:13.345702 | 2009-01-05T09:46:26 | 2009-01-05T09:46:26 | 43,557,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,133 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.trinidadinternal.ui.laf.base.desktop;
import java.io.IOException;
import javax.faces.context.ResponseWriter;
import org.apache.myfaces.trinidadinternal.ui.UINode;
import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
import org.apache.myfaces.trinidadinternal.ui.action.ClientAction;
import org.apache.myfaces.trinidadinternal.ui.action.ClientActionUtils;
import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.LinkUtils;
import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafUtils;
/**
* Renderer for global buttons
*
* @version $Name: $ ($Revision$) $Date$
* @deprecated This class comes from the old Java 1.2 UIX codebase and should not be used anymore.
*/
@Deprecated
public class GlobalButtonRenderer extends HtmlLafRenderer
{
/**
*
*/
@Override
protected void prerender(UIXRenderingContext context, UINode node)
throws IOException
{
// If we've got a ClientAction, let it write its dependencies
// before we start rendering the link
ClientAction action = ClientActionUtils.getPrimaryClientAction(context,
node);
if (action != null)
action.writeDependencies(context, node);
super.prerender(context, node);
Object iconURI = node.getAttributeValue(context, ICON_ATTR);
// Okay - now we can render. Get our other render attributes
Object text = getText(context, node);
Object styleClass = getStyleClass(context, node);
Object destination = getDestination(context, node);
Object shortDesc = getShortDesc(context, node);
if ( shortDesc == null )
shortDesc = text;
boolean isLink = (destination != null);
ResponseWriter writer = context.getResponseWriter();
writer.startElement(LINK_ELEMENT, null);
renderID(context, node);
super.renderEventHandlers(context, node);
renderStyleClassAttribute(context, styleClass);
if (isLink)
{
renderEncodedActionURI(context, HREF_ATTRIBUTE, destination);
renderAttribute(context, node,
TARGET_FRAME_ATTRIBUTE, TARGET_FRAME_ATTR);
}
if ( iconURI != null )
{
writer.startElement(IMAGE_ELEMENT, null);
renderStyleClassAttribute(context, AF_MENU_BUTTONS_IMAGE_STYLE_CLASS);
renderEncodedResourceURI(context, SOURCE_ATTRIBUTE, iconURI);
renderAltAndTooltipForImage(context, shortDesc);
renderAttribute(context, BORDER_ATTRIBUTE, 0);
renderAttribute(context, node, WIDTH_ATTRIBUTE, WIDTH_ATTR);
renderAttribute(context, node, HEIGHT_ATTRIBUTE, HEIGHT_ATTR);
writer.endElement(IMAGE_ELEMENT);
}
if (text != null)
writer.writeText(text, TEXT_ATTR.getAttributeName());
writer.endElement(LINK_ELEMENT);
}
@Override
protected void renderContent(
UIXRenderingContext context,
UINode node
)
{
// Don't bother with renderContent - it's all done in the prerender
}
/*
* @todo added basic fireAction support, didn't do the part commented out
* about _getPartialChangeScript if action is null
*/
@Override
protected Object getOnClick(
UIXRenderingContext context,
UINode node
)
{
// Disabled is already checked before we render
if (isSelected(context, node))
return null;
// We build up the actual onclick handler by chaining the value the
// ONCLICK_ATTR with the script of the PRIMARY_CLIENT_ACTION_ATTR.
// Since we get the onclick handler multiple times (getDestination(),
// which is called multiple times, and renderEventHandlers()), and
// since building up the handler can be expensive, we store the
// script in a local property, so that this work does not need to
// be repeated.
Object prop = context.getLocalProperty(0,
_LOCAL_ON_CLICK_KEY,
_NONE);
if (prop != _NONE)
return prop;
Object onClick = super.getOnClick(context, node);
ClientAction action = ClientActionUtils.getPrimaryClientAction(context,
node);
String actionScript = null;
if (action != null)
{
if (action.renderAsEvent(context, node) &&
(getDestinationAttr(context, node) == null))
{
// We must ignore actionScript if there is a destination or else the
// destination will never execute because the onclick will run first.
actionScript = action.getScript(context, node, Boolean.FALSE);
}
}
/*
else
{
// If we don't have a ClientAction, check to see if we've got
// partial targets provided by an ancestor link container.
actionScript = _getPartialChangeScript(context, node);
}
*/
Object chainedScript = null;
if ((onClick != null) || (actionScript != null))
{
chainedScript = XhtmlLafUtils.getChainedJS(onClick,
actionScript,
true);
}
// Store away the script for next time
context.setLocalProperty(_LOCAL_ON_CLICK_KEY, chainedScript);
return chainedScript;
}
protected Object getDestination(
UIXRenderingContext context,
UINode node
)
{
if (isDisabled(context, node) || isSelected(context, node))
return null;
Object destination;
if (supportsNavigation(context))
destination = node.getAttributeValue(context, DESTINATION_ATTR);
else
destination = null;
// If we have an onclick handler, always provide a destination
if ((destination == null) &&
supportsIntrinsicEvents(context))
{
Object onClick = getOnClick(context, node);
if (onClick != null)
{
destination = "#";
}
}
return destination;
}
protected final String getDestinationAttr(
UIXRenderingContext context,
UINode node
)
{
return XhtmlLafUtils.getLocalTextAttribute(context,
node,
DESTINATION_ATTR);
}
protected static boolean isSelected(
UIXRenderingContext context,
UINode node
)
{
boolean selectedAttr = Boolean.TRUE.equals(node.getAttributeValue(context, SELECTED_ATTR));
boolean linkProp = LinkUtils.isSelected(context);
return (selectedAttr || linkProp);
}
@Override
protected Object getStyleClass(
UIXRenderingContext context,
UINode node
)
{
Object styleClass = super.getStyleClass(context, node);
if (styleClass == null)
{
styleClass = (isSelected(context, node))
? AF_MENU_BUTTONS_TEXT_SELECTED_STYLE_CLASS
: (isDisabled(context, node))
? AF_MENU_BUTTONS_TEXT_DISABLED_STYLE_CLASS
: AF_MENU_BUTTONS_TEXT_STYLE_CLASS;
}
return styleClass;
}
// object indicating that there is no local property
private static final Object _NONE = new Object();
// object used to store the local copy of the onClick handler
private static final Object _LOCAL_ON_CLICK_KEY = new Object();
}
| [
"lu4242@ea1d4837-9632-0410-a0b9-156113df8070"
] | lu4242@ea1d4837-9632-0410-a0b9-156113df8070 |
2cdfb9cd4cf824db1a5ae42622e243b7ce92778b | 538efc446098b2b0b6feee13d1c6e90f95fecbd0 | /src/main/java/ru/ionov/timetable/api/models/DateRange.java | 983e0f00c4eea8ed41b6941e0a93510da31e103d | [] | no_license | ocassio/timetable-api | 675a14d3ea6210a95657d43aaa669745035208c2 | 3a7c957535ab5d81f15eff78e0fc99c8249d7c1e | refs/heads/master | 2022-09-16T18:19:15.760020 | 2022-09-02T18:26:12 | 2022-09-02T18:26:12 | 76,188,728 | 0 | 0 | null | 2022-09-02T18:26:13 | 2016-12-11T17:23:03 | Java | UTF-8 | Java | false | false | 917 | java | package ru.ionov.timetable.api.models;
import java.util.Date;
import ru.ionov.timetable.api.utils.DateUtils;
public class DateRange
{
private Date from;
private Date to;
public DateRange()
{
}
public DateRange(Date from, Date to)
{
this.from = from;
this.to = to;
}
public Date getFrom()
{
return from;
}
public void setFrom(Date from)
{
if (from != null && to != null && from.after(to))
{
to = from;
}
this.from = from;
}
public Date getTo()
{
return to;
}
public void setTo(Date to)
{
if (from != null && to != null && from.after(to))
{
from = to;
}
this.to = to;
}
@Override
public String toString()
{
return DateUtils.toDateString(from) + " - " + DateUtils.toDateString(to);
}
}
| [
"orlicus@gmail.com"
] | orlicus@gmail.com |
c6902bb2ba15b78634d516fa35bff30437b5c412 | 3f13f73abbf82684ac93ae3cc0669633c4094e78 | /ccp/src/main/java/com/futuremind/recyclerviewfastscroll/viewprovider/DefaultScrollerViewProvider.java | a6e3bff9302735b5f726004fbdff28a4d0141437 | [
"Apache-2.0"
] | permissive | hbb20/CountryCodePickerProject | 441f857b0b550123e4a96288ed2bef281da5a79c | 7a76d92a460df02f33b0d1ea5262c867223fc568 | refs/heads/master | 2023-08-24T02:28:58.072517 | 2023-07-11T06:33:42 | 2023-07-11T06:33:42 | 50,022,769 | 1,559 | 583 | Apache-2.0 | 2023-08-09T14:01:25 | 2016-01-20T10:28:34 | Java | UTF-8 | Java | false | false | 2,539 | java | package com.futuremind.recyclerviewfastscroll.viewprovider;
import android.graphics.drawable.InsetDrawable;
import androidx.core.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.futuremind.recyclerviewfastscroll.Utils;
import com.hbb20.R;
/**
* Created by Michal on 05/08/16.
*/
public class DefaultScrollerViewProvider extends ScrollerViewProvider {
protected View bubble;
protected View handle;
@Override
public View provideHandleView(ViewGroup container) {
handle = new View(getContext());
int verticalInset = getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
int horizontalInset = !getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
InsetDrawable handleBg = new InsetDrawable(ContextCompat.getDrawable(getContext(), R.drawable.fastscroll__default_handle), horizontalInset, verticalInset, horizontalInset, verticalInset);
Utils.setBackground(handle, handleBg);
int handleWidth = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_clickable_width : R.dimen.fastscroll__handle_height);
int handleHeight = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_height : R.dimen.fastscroll__handle_clickable_width);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(handleWidth, handleHeight);
handle.setLayoutParams(params);
return handle;
}
@Override
public View provideBubbleView(ViewGroup container) {
bubble = LayoutInflater.from(getContext()).inflate(R.layout.fastscroll__default_bubble, container, false);
return bubble;
}
@Override
public TextView provideBubbleTextView() {
return (TextView) bubble;
}
@Override
public int getBubbleOffset() {
return (int) (getScroller().isVertical() ? ((float)handle.getHeight()/2f)-bubble.getHeight() : ((float)handle.getWidth()/2f)-bubble.getWidth());
}
@Override
protected ViewBehavior provideHandleBehavior() {
return null;
}
@Override
protected ViewBehavior provideBubbleBehavior() {
return new DefaultBubbleBehavior(new VisibilityAnimationManager.Builder(bubble).withPivotX(1f).withPivotY(1f).build());
}
}
| [
"sergiocrz@hotmail.com"
] | sergiocrz@hotmail.com |
bfaab6a661684ad2bfef54d755b7cf8667cfb337 | 8f31edad264603216f920cafe3c5ae5ed65c8eb4 | /ejld/src/test/java/ningjiaxin1/bwie/com/ejld/ExampleUnitTest.java | e82dbd3795473ad8c8d26e0d8334ac0ea32b4b27 | [] | no_license | BEATAangelan/drylx | afaf57e44ff006c8f8e617701675b6d3ebc8780b | 1d5b3cef92042445757a0268fa8b772d6edbb984 | refs/heads/master | 2020-04-12T18:04:19.364870 | 2018-12-21T05:04:07 | 2018-12-21T05:04:07 | 162,668,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package ningjiaxin1.bwie.com.ejld;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"1378185274@qq.com"
] | 1378185274@qq.com |
a0adcb4403182b09b2d4592f9f35f04bbd562a13 | b63fbc621ef492f315060534590925b0f002e5f7 | /src/main/java/com/knc/ntcs/core/config/modelmapper/CommonBean.java | 5be4b87a553af77e14a50b91d7c3c4d57388dbde | [] | no_license | hyomee/KNC_PRJ | 37e3de04bc030185035938e307ccc9a4edc4b7ce | d208f7f2b04ce56395d8c50b43d0e34df5bdeb99 | refs/heads/main | 2023-03-28T15:09:35.424996 | 2021-03-22T14:24:06 | 2021-03-22T14:24:06 | 330,659,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,435 | java | package com.knc.ntcs.core.config.modelmapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CommonBean {
@Bean
public ModelMapper modelMapper() {
// ModelMapper modelMapper = new ModelMapper();
// modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE);
ModelMapper modelMapper = new CustomModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
modelMapper.getConfiguration().setFieldMatchingEnabled(true);
modelMapper.getConfiguration().setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE);
return modelMapper;
}
/**
* UTF-8로 변환
* @return
*/
// @Bean
// public FilterRegistrationBean encodingBean() {
// FilterRegistrationBean registrationBean = new FilterRegistrationBean();
// CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
// characterEncodingFilter.setForceEncoding(true);
// characterEncodingFilter.setEncoding("UTF-8");
// registrationBean.setFilter(characterEncodingFilter);
// return registrationBean;
// }
@Bean
public ObjectMapper objectMapper() {
return new ObjectMapper();
}
}
| [
"hyomee@naver.com"
] | hyomee@naver.com |
f4727809d5ef64a8ae69043c4428fa9c9a6dafec | fdd106a6fcc5a78b05592316653473a23c9a4b8a | /ApJavaClasswork/src/HelloWorld/Book.java | 8b7a5556bf31079dddb9951e57c67124d5d82fa0 | [] | no_license | Zilong-Yuen/ApJavaClasswork | e7eb18199b2b8c2c4f9d927ebe8e7ed469a130ba | 74e0a1b86d167ce02e7a9e540530f1677b14013e | refs/heads/master | 2021-09-04T04:42:57.007468 | 2018-01-15T23:52:30 | 2018-01-15T23:52:30 | 109,731,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 849 | java | package HelloWorld;
public class Book
{
private String name;
private int price;
private String author;
public Book(String name, int price, String author)
{
this.name = name;
this.price = price;
this.author = author;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public int getPrice()
{
return price;
}
public void setPrice(int price)
{
this.price = price;
}
public String getAuthor()
{
return author;
}
public void setAuthor(String author)
{
this.author = author;
}
@Override
public String toString()
{
return "Book [name=" + name + ", price=" + price + ", author=" + author + "]";
}
}
| [
"BT_1N3_21@BT_1N3_21.bktech.local"
] | BT_1N3_21@BT_1N3_21.bktech.local |
c1a6268d1ec361d4cde2085aa03aa3fd941f67d6 | 09d0ddd512472a10bab82c912b66cbb13113fcbf | /TestApplications/TF-BETA-THERMATK-v5.7.1/DecompiledCode/Procyon/src/main/java/com/google/android/exoplayer2/text/webvtt/Mp4WebvttSubtitle.java | e6afd9dc4608c27b34327901ef3f6a9c5f81607a | [] | no_license | sgros/activity_flow_plugin | bde2de3745d95e8097c053795c9e990c829a88f4 | 9e59f8b3adacf078946990db9c58f4965a5ccb48 | refs/heads/master | 2020-06-19T02:39:13.865609 | 2019-07-08T20:17:28 | 2019-07-08T20:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,198 | java | //
// Decompiled by Procyon v0.5.34
//
package com.google.android.exoplayer2.text.webvtt;
import com.google.android.exoplayer2.util.Assertions;
import java.util.Collections;
import com.google.android.exoplayer2.text.Cue;
import java.util.List;
import com.google.android.exoplayer2.text.Subtitle;
final class Mp4WebvttSubtitle implements Subtitle
{
private final List<Cue> cues;
public Mp4WebvttSubtitle(final List<Cue> list) {
this.cues = Collections.unmodifiableList((List<? extends Cue>)list);
}
@Override
public List<Cue> getCues(final long n) {
List<Cue> list;
if (n >= 0L) {
list = this.cues;
}
else {
list = Collections.emptyList();
}
return list;
}
@Override
public long getEventTime(final int n) {
Assertions.checkArgument(n == 0);
return 0L;
}
@Override
public int getEventTimeCount() {
return 1;
}
@Override
public int getNextEventTimeIndex(final long n) {
int n2;
if (n < 0L) {
n2 = 0;
}
else {
n2 = -1;
}
return n2;
}
}
| [
"crash@home.home.hr"
] | crash@home.home.hr |
4cc7b125d5be89b08ee81ac7d7ffe6ec0fd5487b | 275b6aec224ca7f454b0c4a63431d60dcb48ea89 | /generatorSqlmapCustom/src/com/vcgo/pojo/TbOrderItemExample.java | 8500fc5b7b8a97f0e548c2e4c9b14acab33a109a | [] | no_license | Vcgoyo/vcgomail | 65c0316b382c7b84357b15628cbf44804eed629b | d8d6f3fa00c615230d3c3df910ab28cbc8c269d5 | refs/heads/master | 2021-01-21T05:05:32.124666 | 2017-02-25T13:47:53 | 2017-02-25T13:47:53 | 83,133,354 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,427 | java | package com.vcgo.pojo;
import java.util.ArrayList;
import java.util.List;
public class TbOrderItemExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TbOrderItemExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andItemIdIsNull() {
addCriterion("item_id is null");
return (Criteria) this;
}
public Criteria andItemIdIsNotNull() {
addCriterion("item_id is not null");
return (Criteria) this;
}
public Criteria andItemIdEqualTo(String value) {
addCriterion("item_id =", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotEqualTo(String value) {
addCriterion("item_id <>", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdGreaterThan(String value) {
addCriterion("item_id >", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdGreaterThanOrEqualTo(String value) {
addCriterion("item_id >=", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdLessThan(String value) {
addCriterion("item_id <", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdLessThanOrEqualTo(String value) {
addCriterion("item_id <=", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdLike(String value) {
addCriterion("item_id like", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotLike(String value) {
addCriterion("item_id not like", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdIn(List<String> values) {
addCriterion("item_id in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotIn(List<String> values) {
addCriterion("item_id not in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdBetween(String value1, String value2) {
addCriterion("item_id between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotBetween(String value1, String value2) {
addCriterion("item_id not between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andOrderIdIsNull() {
addCriterion("order_id is null");
return (Criteria) this;
}
public Criteria andOrderIdIsNotNull() {
addCriterion("order_id is not null");
return (Criteria) this;
}
public Criteria andOrderIdEqualTo(String value) {
addCriterion("order_id =", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotEqualTo(String value) {
addCriterion("order_id <>", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdGreaterThan(String value) {
addCriterion("order_id >", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdGreaterThanOrEqualTo(String value) {
addCriterion("order_id >=", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdLessThan(String value) {
addCriterion("order_id <", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdLessThanOrEqualTo(String value) {
addCriterion("order_id <=", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdLike(String value) {
addCriterion("order_id like", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotLike(String value) {
addCriterion("order_id not like", value, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdIn(List<String> values) {
addCriterion("order_id in", values, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotIn(List<String> values) {
addCriterion("order_id not in", values, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdBetween(String value1, String value2) {
addCriterion("order_id between", value1, value2, "orderId");
return (Criteria) this;
}
public Criteria andOrderIdNotBetween(String value1, String value2) {
addCriterion("order_id not between", value1, value2, "orderId");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;
}
public Criteria andNumIsNotNull() {
addCriterion("num is not null");
return (Criteria) this;
}
public Criteria andNumEqualTo(Integer value) {
addCriterion("num =", value, "num");
return (Criteria) this;
}
public Criteria andNumNotEqualTo(Integer value) {
addCriterion("num <>", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThan(Integer value) {
addCriterion("num >", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThanOrEqualTo(Integer value) {
addCriterion("num >=", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThan(Integer value) {
addCriterion("num <", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThanOrEqualTo(Integer value) {
addCriterion("num <=", value, "num");
return (Criteria) this;
}
public Criteria andNumIn(List<Integer> values) {
addCriterion("num in", values, "num");
return (Criteria) this;
}
public Criteria andNumNotIn(List<Integer> values) {
addCriterion("num not in", values, "num");
return (Criteria) this;
}
public Criteria andNumBetween(Integer value1, Integer value2) {
addCriterion("num between", value1, value2, "num");
return (Criteria) this;
}
public Criteria andNumNotBetween(Integer value1, Integer value2) {
addCriterion("num not between", value1, value2, "num");
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andPriceIsNull() {
addCriterion("price is null");
return (Criteria) this;
}
public Criteria andPriceIsNotNull() {
addCriterion("price is not null");
return (Criteria) this;
}
public Criteria andPriceEqualTo(Long value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(Long value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThan(Long value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(Long value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThan(Long value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(Long value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
public Criteria andPriceIn(List<Long> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<Long> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(Long value1, Long value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(Long value1, Long value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andTotalFeeIsNull() {
addCriterion("total_fee is null");
return (Criteria) this;
}
public Criteria andTotalFeeIsNotNull() {
addCriterion("total_fee is not null");
return (Criteria) this;
}
public Criteria andTotalFeeEqualTo(Long value) {
addCriterion("total_fee =", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeNotEqualTo(Long value) {
addCriterion("total_fee <>", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeGreaterThan(Long value) {
addCriterion("total_fee >", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeGreaterThanOrEqualTo(Long value) {
addCriterion("total_fee >=", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeLessThan(Long value) {
addCriterion("total_fee <", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeLessThanOrEqualTo(Long value) {
addCriterion("total_fee <=", value, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeIn(List<Long> values) {
addCriterion("total_fee in", values, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeNotIn(List<Long> values) {
addCriterion("total_fee not in", values, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeBetween(Long value1, Long value2) {
addCriterion("total_fee between", value1, value2, "totalFee");
return (Criteria) this;
}
public Criteria andTotalFeeNotBetween(Long value1, Long value2) {
addCriterion("total_fee not between", value1, value2, "totalFee");
return (Criteria) this;
}
public Criteria andPicPathIsNull() {
addCriterion("pic_path is null");
return (Criteria) this;
}
public Criteria andPicPathIsNotNull() {
addCriterion("pic_path is not null");
return (Criteria) this;
}
public Criteria andPicPathEqualTo(String value) {
addCriterion("pic_path =", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathNotEqualTo(String value) {
addCriterion("pic_path <>", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathGreaterThan(String value) {
addCriterion("pic_path >", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathGreaterThanOrEqualTo(String value) {
addCriterion("pic_path >=", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathLessThan(String value) {
addCriterion("pic_path <", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathLessThanOrEqualTo(String value) {
addCriterion("pic_path <=", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathLike(String value) {
addCriterion("pic_path like", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathNotLike(String value) {
addCriterion("pic_path not like", value, "picPath");
return (Criteria) this;
}
public Criteria andPicPathIn(List<String> values) {
addCriterion("pic_path in", values, "picPath");
return (Criteria) this;
}
public Criteria andPicPathNotIn(List<String> values) {
addCriterion("pic_path not in", values, "picPath");
return (Criteria) this;
}
public Criteria andPicPathBetween(String value1, String value2) {
addCriterion("pic_path between", value1, value2, "picPath");
return (Criteria) this;
}
public Criteria andPicPathNotBetween(String value1, String value2) {
addCriterion("pic_path not between", value1, value2, "picPath");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"334697361@qq.com"
] | 334697361@qq.com |
21849a1f2223732baec148dd02e809e378cdc117 | 4317d8fd370757176d6a618c5b4060c4a23ee576 | /app/src/main/java/org/example/snovaisg/myuploadFCT/UploadPageSobremesa.java | 92b3c9c1365aad4ed534c7359fcb52414eb0dbfe | [] | no_license | miguelCalado/upload_fct | c0689b1cb82dd479f92a2ab72d2be5474b1e2522 | 7dce979e1736cd56591248fe4adf6f79be41863f | refs/heads/master | 2020-05-05T08:09:48.649580 | 2019-04-06T15:51:08 | 2019-04-06T15:51:08 | 179,853,313 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,101 | java | package org.example.snovaisg.myuploadFCT;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import org.example.snovaisg.myuploadFCT.BarCampus.BarCampusPreVisualiza;
import org.example.snovaisg.myuploadFCT.Cantina.CantinaPreVisualiza;
import org.example.snovaisg.myuploadFCT.CasaPessoal.CasaPPreVisualiza;
import org.example.snovaisg.myuploadFCT.Come.ComePreVisualiza;
import org.example.snovaisg.myuploadFCT.Girassol.GirassolPreVisualiza;
import org.example.snovaisg.myuploadFCT.Lidia.BarLidiaPreVisualiza;
import org.example.snovaisg.myuploadFCT.MySpot.mySpotPreVisualiza;
import org.example.snovaisg.myuploadFCT.Sector7.Sector7PreVisualiza;
import org.example.snovaisg.myuploadFCT.SectorDep.SectorDepPreVisualiza;
import org.example.snovaisg.myuploadFCT.Teresa.TeresaPreVisualiza;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.FileInputStream;
import java.text.SimpleDateFormat;
/**
* Created by Miguel-PC on 03/03/2018.
*/
public class UploadPageSobremesa extends AppCompatActivity {
public DataHolder DH = new DataHolder().getInstance();
String fileToInternal = DH.fileToInternal();
String PrecoInvalido = DH.PrecoInvalido();
String restaurante = DH.getData();
public static String[] sobremesa = new String[8];
public static String[] preco = new String[8];
int[] ids;
int[] ids_preco;
// para fazer auto fill quando se volta à página
public String[] backupPrato = new String[8];
public String[] backupPreco = new String[8];
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload_page_sobremesa);
ids = new int[]{R.id.Sobremesa1, R.id.Sobremesa2, R.id.Sobremesa3, R.id.Sobremesa4, R.id.Sobremesa5, R.id.Sobremesa6, R.id.Sobremesa7, R.id.Sobremesa8};
ids_preco = new int[]{R.id.precoSobremesa1, R.id.precoSobremesa2, R.id.precoSobremesa3, R.id.precoSobremesa4, R.id.precoSobremesa5, R.id.precoSobremesa6, R.id.precoSobremesa7, R.id.precoSobremesa8};
Preencher();
try {
Editar();
} catch (JSONException e) {
e.printStackTrace();
}
Button cancelar = (Button) findViewById(R.id.button4);
cancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
DH.setEditar(false);
DH.setDenovo(false);
if (getEstado()) {
Intent intent = new Intent(UploadPageSobremesa.this, Atualizado.class);
startActivity(intent);
}
else {
Intent intent = new Intent(UploadPageSobremesa.this, PorAtualizar.class);
startActivity(intent);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Button seguinte = (Button) findViewById(R.id.button2);
seguinte.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
recordString();
Intent intent;
if(restaurante.equals("Cantina")) {
intent = new Intent(UploadPageSobremesa.this, CantinaPreVisualiza.class);
} else {
if(restaurante.equals("Teresa")) {
intent = new Intent(UploadPageSobremesa.this, TeresaPreVisualiza.class);
} else {
if(restaurante.equals("My Spot")) {
intent = new Intent(UploadPageSobremesa.this, mySpotPreVisualiza.class);
} else {
if(restaurante.equals("Bar Campus")) {
intent = new Intent(UploadPageSobremesa.this, BarCampusPreVisualiza.class);
} else {
if(restaurante.equals("Casa do P.")) {
intent = new Intent(UploadPageSobremesa.this, CasaPPreVisualiza.class);
} else {
if(restaurante.equals("C@m. Come")) {
intent = new Intent(UploadPageSobremesa.this, ComePreVisualiza.class);
} else {
if(restaurante.equals("Sector + Dep")) {
intent = new Intent(UploadPageSobremesa.this, SectorDepPreVisualiza.class);
} else {
if(restaurante.equals("Sector + Ed.7")) {
intent = new Intent(UploadPageSobremesa.this, Sector7PreVisualiza.class);
} else {
if(restaurante.equals("Girassol")) {
intent = new Intent(UploadPageSobremesa.this, GirassolPreVisualiza.class);
} else {
intent = new Intent(UploadPageSobremesa.this, BarLidiaPreVisualiza.class);
}
}
}
}
}
}
}
}
}
startActivity(intent);
}
});
Button anterior = (Button) findViewById(R.id.button3);
anterior.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
recordString();
if(restaurante.equals("C@m. Come")) {
Intent intent = new Intent(UploadPageSobremesa.this, UploadPageMenu.class);
startActivity(intent);
} else {
if(restaurante.equals("Sector + Dep")) {
Intent intent = new Intent(UploadPageSobremesa.this, UploadPageOpcao.class);
startActivity(intent);
} else{
goToVegetariano();
}
}
}
});
}
void recordString(){
getAll();
}
public void goToVegetariano()
{
Intent intent = new Intent(UploadPageSobremesa.this, UploadPageVegetariano.class);
startActivity(intent);
}
public void getAll(){
String prato;
String temp_preco;
String [] ans = new String[8];
int pos = 0;
for (int i = 0; i<= 7;i++){
EditText tempPrato = (EditText) findViewById(ids[i]);
prato = tempPrato.getText().toString();
Log.d("PRATO","<"+prato+">");
if (!prato.isEmpty() && prato.trim().length() > 0) {
Log.d("Prato","im IN");
sobremesa[pos] = prato;
EditText tempPreco = (EditText) findViewById(ids_preco[i]);
temp_preco = tempPreco.getText().toString();
if (!temp_preco.isEmpty() && temp_preco.trim().length() > 0)
preco[pos] = temp_preco;
else
preco[pos] = PrecoInvalido;
}
else{
Log.d("Prato","NOT IN");
sobremesa[pos]=null;
preco[pos]=null;
}
pos++;
}
}
public void Preencher() {
if (!DH.getDenovo()) {
if (sobremesa != null) {
int e = sobremesa.length;
for (int i = 0; i < e; i++) {
if (sobremesa[i] != null) {
//prato
EditText temp = (EditText) findViewById(ids[i]);
temp.setText(sobremesa[i]);
//preco
EditText temp2 = (EditText) findViewById(ids_preco[i]);
if (preco[i] != PrecoInvalido || preco[i].isEmpty())
temp2.setText(preco[i]);
}
}
}
}
}
public void Editar() throws JSONException {
if (DH.getEditar()){
Log.d("Editar","1");
JSONObject fullmenu = readJsonFromFile(fileToInternal);
JSONObject menu = fullmenu.getJSONObject(restaurante);
String [] carneV1 = toStringArray(menu.getJSONArray("sobremesa"));
Log.d("Editar","2");
int pos = 0;
for (int i = 0; i < carneV1.length; i = i + 2) {
Log.d("Editar","3");
if (carneV1[i] != null && carneV1[i+1] != null) {
Log.d("Editar","4");
//prato
EditText temp = (EditText) findViewById(ids[pos]);
temp.setText(carneV1[i]);
//preco
EditText temp2 = (EditText) findViewById(ids_preco[pos]);
if (!carneV1[i+1].equals(PrecoInvalido) && !carneV1[i+1].isEmpty())
temp2.setText(carneV1[i+1]);
pos++;
}
}
}
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
int pos = 0;
if (sobremesa != null) {
for (int i = 0; i < sobremesa.length; i++) {
if (sobremesa[i] != null){
if (sobremesa[i].trim().length() >0){
savedInstanceState.putString(backupPrato[pos], sobremesa[i]);
savedInstanceState.putString(backupPreco[pos],preco[i]);
pos++;
}
}
}
}
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
int pos = 0;
if (backupPrato != null){
for (int i = 0;i < backupPrato.length;i++){
sobremesa[i] = backupPrato[i];
preco[i] = backupPreco[i];
}
}
}
public boolean getEstado() throws JSONException {
JSONObject fullDic = readJsonFromFile(fileToInternal);
String weekId = fullDic.getJSONObject(restaurante).getString("weekId");
String timeStamp = new SimpleDateFormat("dd-MM-yyyy").format(new java.util.Date());
Log.d("TESTE",weekId);
Log.d("TESTE",timeStamp);
return weekId.equals(timeStamp);
}
public JSONObject readJsonFromFile(String filename){
String JsonData ="";
JSONObject myJson;
try {
FileInputStream fis = this.openFileInput(filename);
int size = fis.available();
byte[] buffer = new byte[size];
fis.read(buffer);
fis.close();
JsonData = new String(buffer);
Log.d("Hallo",JsonData);
myJson = new JSONObject(JsonData);
int a = 1 + 2;
return myJson;
}
catch (Exception e) {
e.printStackTrace();
Log.d("MEH","Something went wrong");
return null;
}
}
public static String[] toStringArray(JSONArray array) {
if (array == null)
return null;
String[] arr = new String[array.length()];
for (int i = 0; i < arr.length; i++) {
arr[i] = array.optString(i);
}
return arr;
}
}
| [
"m.calado@campus.fct.unl.pt"
] | m.calado@campus.fct.unl.pt |
2711dde74c923faebccb566214ab3e3bee083081 | 7670403f07eb54bcfaa044373e61f9be547b1276 | /sce-web-201507/src/br/fatec/persistencia/EmpresaDAO.java | 8c154849a60a465454f153456bf345029ea7a7aa | [] | no_license | esalmeida/workspace201507 | bb0af1fe75297bf66538f2d6965f8f4dd33ade6c | d8aa9ab3d7266ca96189ce65f145cf08ecc6494c | refs/heads/master | 2016-09-05T20:20:55.277295 | 2015-08-01T14:36:22 | 2015-08-01T14:36:22 | 38,437,688 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 713 | java | package br.fatec.persistencia;
import org.hibernate.Session;
import br.fatec.dominio.Empresa;
public class EmpresaDAO {
private final Session session;
public EmpresaDAO(Session session) {
this.session = session;
}
public Empresa porId(int id) {
return (Empresa) session.load(Empresa.class, id);
}
public Empresa porNomeEEmail (String nome, String email){
return (Empresa) session.createQuery("from Empresa e where e.nome =:nome and e.email =:email")
.setParameter("nome", nome)
.setParameter("email", email)
.uniqueResult();
}
public void salvar(Empresa empresa){
session.save(empresa);
}
public void atualizar(Empresa empresa){
session.merge(empresa);
}
}
| [
"almeidaesa@gmail.com"
] | almeidaesa@gmail.com |
ecd719fb1f7d3915862cdbec49d2c0fc2d655d78 | 616e19937e72ab604766ff8a11b239c821dfd042 | /mediacore/src/main/java/com/zxzx74147/mediacore/components/video/filter/advanced/MagicEmeraldFilter.java | 17765e2678dc32d408aa5ba2a42e83b3a97d8dc4 | [] | no_license | cllanjim/MediaCore | cf09b95ac235e4f700b23b9aabe263888b52e1d8 | e190a2b059c8fcaf1c21888e868c442ed26b25e0 | refs/heads/master | 2020-03-17T20:38:36.959721 | 2017-12-14T09:21:31 | 2017-12-14T09:21:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,070 | java | package com.zxzx74147.mediacore.components.video.filter.advanced;
import android.opengl.GLES20;
import com.zxzx74147.mediacore.R;
import com.zxzx74147.mediacore.components.video.filter.base.gpuimage.GPUImageFilter;
import com.zxzx74147.mediacore.components.video.util.OpenGlUtils;
import java.nio.ByteBuffer;
public class MagicEmeraldFilter extends GPUImageFilter {
private int[] mToneCurveTexture = {-1};
private int mToneCurveTextureUniformLocation;
public MagicEmeraldFilter(){
super(NO_FILTER_VERTEX_SHADER, OpenGlUtils.readShaderFromRawResource(R.raw.emerald));
}
protected void onDestroy(){
super.onDestroy();
GLES20.glDeleteTextures(1, mToneCurveTexture, 0);
mToneCurveTexture[0] = -1;
}
protected void onDrawArraysAfter(){
if (mToneCurveTexture[0] != -1){
GLES20.glActiveTexture(GLES20.GL_TEXTURE3);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
}
}
protected void onDrawArraysPre(){
if (mToneCurveTexture[0] != -1){
GLES20.glActiveTexture(GLES20.GL_TEXTURE3);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mToneCurveTexture[0]);
GLES20.glUniform1i(mToneCurveTextureUniformLocation, 3);
}
}
protected void onInit(){
super.onInit();
mToneCurveTextureUniformLocation = GLES20.glGetUniformLocation(mGLProgId, "curve");
}
protected void onInitialized(){
super.onInitialized();
runOnDraw(new Runnable(){
public void run(){
GLES20.glGenTextures(1, mToneCurveTexture, 0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mToneCurveTexture[0]);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
byte[] arrayOfByte = new byte[2048];
int[] arrayOfInt1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 7, 8, 9, 10, 12, 13, 14, 17, 18, 19, 21, 22, 23, 25, 26, 29, 30, 31, 32, 34, 35, 36, 39, 40, 41, 43, 44, 45, 46, 48, 50, 51, 53, 54, 55, 56, 58, 60, 61, 62, 64, 65, 66, 67, 69, 70, 72, 73, 75, 76, 77, 78, 79, 81, 82, 84, 85, 87, 88, 89, 90, 91, 92, 94, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 110, 111, 112, 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 231, 232, 233, 234, 234, 235, 236, 236, 237, 237, 238, 239, 239, 240, 241, 242, 242, 243, 244, 244, 245, 246, 247, 247, 248, 249, 249, 250, 251, 251, 252, 253, 254, 254, 255 };
int[] arrayOfInt2 = { 0, 0, 0, 0, 0, 0, 1, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 16, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 43, 44, 45, 46, 48, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 65, 66, 67, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 109, 111, 112, 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225, 226, 226, 227, 228, 229, 230, 231, 231, 232, 233, 234, 234, 235, 236, 237, 237, 238, 239, 239, 240, 241, 242, 242, 243, 244, 244, 245, 247, 247, 248, 249, 249, 250, 251, 251, 252, 253, 254, 254, 255, 255, 255, 255, 255, 255 };
int[] arrayOfInt3 = { 0, 1, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 43, 44, 45, 46, 48, 49, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 65, 66, 67, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 189, 190, 191, 191, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 231, 232, 233, 234, 234, 235, 236, 237, 237, 238, 239, 239, 240, 241, 242, 242, 243, 244, 244, 245, 246, 247, 247, 248, 249, 249, 250, 251, 251, 252, 253, 254, 254, 255 };
for (int i = 0; i < 256; i++){
arrayOfByte[(i * 4)] = ((byte)arrayOfInt1[i]);
arrayOfByte[(1 + i * 4)] = ((byte)arrayOfInt2[i]);
arrayOfByte[(2 + i * 4)] = ((byte)arrayOfInt3[i]);
arrayOfByte[(3 + i * 4)] = -1;
}
int[] arrayOfInt4 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 164, 165, 166, 167, 168, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 224, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 255, 255, 255, 255, 255 };
int[] arrayOfInt5 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 223, 224, 225, 226, 227, 228, 229, 229, 230, 231, 232, 233, 233, 234, 235, 236, 237, 237, 238, 239, 240, 240, 241, 242, 243, 243, 244, 245, 245, 246, 247, 247, 248, 249, 249, 250, 250, 251, 252, 252, 253, 253, 254, 254, 255 };
int[] arrayOfInt6 = { 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 28, 29, 29, 30, 29, 31, 31, 31, 31, 32, 32, 33, 33, 34, 34, 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 39, 40, 40, 40, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 47, 47, 48, 48, 49, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 57, 57, 58, 59, 60, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 100, 101, 103, 104, 105, 107, 108, 110, 111, 113, 115, 116, 118, 119, 120, 122, 123, 125, 127, 128, 130, 132, 134, 135, 137, 139, 141, 143, 144, 146, 148, 150, 152, 154, 156, 158, 160, 163, 165, 167, 169, 171, 173, 175, 178, 180, 182, 185, 187, 189, 192, 194, 197, 199, 201, 204, 206, 209, 211, 214, 216, 219, 221, 224, 226, 229, 232, 234, 236, 239, 241, 245, 247, 250, 252, 255 };
for (int j = 0; j < 256; j++){
arrayOfByte[(1024 + j * 4)] = ((byte)arrayOfInt5[j]);
arrayOfByte[(1 + (1024 + j * 4))] = ((byte)arrayOfInt4[j]);
arrayOfByte[(2 + (1024 + j * 4))] = ((byte)arrayOfInt6[j]);
arrayOfByte[(3 + (1024 + j * 4))] = -1;
}
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 256, 2, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, ByteBuffer.wrap(arrayOfByte));
}
});
}
}
| [
"zxzx25952@gmail.com"
] | zxzx25952@gmail.com |
ef9bdb5e1fc46090c7e8f926f3bf5131ff2fe578 | 9189b49f0e9b28c53c860f9e7a438a044b40dc70 | /BarConta/app/src/main/java/com/puc/pos/barconta/AdapterListView.java | 0666813269ab8d640c9c58eea6e3620aaaf5c71d | [] | no_license | gustaviter/bar-conta | 5ba9c155c3fbfe93c485d4e433f03b56d283028c | c98b595b0dba3431587ddd8f591c20aa551c5f83 | refs/heads/master | 2021-01-10T10:57:58.875396 | 2015-12-16T23:54:27 | 2015-12-16T23:54:27 | 48,141,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,699 | java | package com.puc.pos.barconta;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
public class AdapterListView extends BaseAdapter
{
private LayoutInflater mInflater;
private ArrayList<ItemListView> itens;
public AdapterListView(Context context, ArrayList<ItemListView> itens)
{
//Itens que preencheram o listview
this.itens = itens;
//responsavel por pegar o Layout do item.
mInflater = LayoutInflater.from(context);
}
/**
* Retorna a quantidade de itens
*
* @return
*/
public int getCount()
{
return itens.size();
}
/**
* Retorna o item de acordo com a posicao dele na tela.
*
* @param position
* @return
*/
public ItemListView getItem(int position)
{
return itens.get(position);
}
/**
* Sem implementação
*
* @param position
* @return
*/
public long getItemId(int position)
{
return position;
}
public View getView(int position, View view, ViewGroup parent)
{
//Pega o item de acordo com a posção.
ItemListView item = itens.get(position);
//infla o layout para podermos preencher os dados
view = mInflater.inflate(R.layout.item_listview, null);
//atravez do layout pego pelo LayoutInflater, pegamos cada id relacionado
//ao item e definimos as informações.
((TextView) view.findViewById(R.id.text)).setText(item.getTexto());
return view;
}
}
| [
"gustaviter@gmail.com"
] | gustaviter@gmail.com |
3140c9ba3473f16d8faf3be948c6f76c26e0b661 | b6e7496f1c0c1ec6e3ad9afe6feead008d4bda6b | /src/main/java/com/zhaidaosi/game/jgframework/message/InMessage.java | 5e7ce9a516f36bdad098a585024c2f3d40ef199f | [
"Apache-2.0"
] | permissive | mengtest/JgFramework | 294afeffa4554d43f35cd60c262059e1a4e9d7e6 | 58158db9b76a288522f0774bbb6fb146dd56e4b3 | refs/heads/master | 2020-12-11T03:55:44.899576 | 2015-05-25T10:45:25 | 2015-05-25T10:45:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,425 | java | package com.zhaidaosi.game.jgframework.message;
import com.zhaidaosi.game.jgframework.common.BaseJson;
import com.zhaidaosi.game.jgframework.common.excption.MessageException;
import java.util.HashMap;
public class InMessage implements IBaseMessage {
/**
* 控制器handler路径
*/
private String h;
/**
* 参数
*/
private HashMap<String, Object> p = new HashMap<String, Object>();
public InMessage() {
}
public InMessage(String h) {
this.h = h;
}
public InMessage(String h, HashMap<String, Object> p) {
this.h = h;
this.p = p;
}
public static InMessage getMessage(String msg) throws MessageException {
if (msg.startsWith("{") && msg.endsWith("}")) {
return BaseJson.JsonToObject(msg, InMessage.class);
} else {
throw new MessageException("msg格式错误");
}
}
public String toString() {
return BaseJson.ObjectToJson(this);
}
public String getH() {
return h;
}
public HashMap<String, Object> getP() {
return p;
}
public void setH(String h) {
this.h = h;
}
public void setP(HashMap<String, Object> p) {
this.p = p;
}
public void putMember(String key, Object value) {
this.p.put(key, value);
}
public Object getMember(String key) {
return p.get(key);
}
}
| [
"bupt1987@gmail.com"
] | bupt1987@gmail.com |
7194bf3c4588df2e700de31d450f9970e80e8dbe | 814686683b515b6216878dfa51a3d6cc03b70eda | /src/main/java/SUthread/IChecker.java | f78b2f6fe3a0c8ab29bf4353dc2841920771d586 | [] | no_license | raxis86/innopolis1 | cc71cd9605e518634586ac3a8482478f92fe2306 | 0b6aa03c2962a3b1852fffde7d2fd2c4b892bdcc | refs/heads/master | 2021-01-11T10:50:25.463047 | 2016-12-18T11:28:16 | 2016-12-18T11:28:16 | 76,158,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package SUthread;
import java.util.List;
/**
* Created by raxis on 17.12.2016.
* Интерфейс для чекера
*/
public interface IChecker {
/**
* Объявляет метод, который должен осуществлять
* проверку списка строк и находить некоторое
* проблемное слово
* @param stringList - список проверяемых строк
* @return - проблемное слово, иначе - null
*/
public String check(List<String> stringList);
}
| [
"Сергей Иванов"
] | Сергей Иванов |
cc691b48b80f1d5ac5ed2f880d12ccb73d75d71a | b5f7fa659acd88d0c3b0003a2c98dd43facb9ffc | /src/Bridge/ConcreteImplementor.java | 2f05c2abae229c976b802cb716e818a8bf175a5e | [] | no_license | SITOKYO/DesignPattern | d78fe1876dece6583d72235c0f0b68d1d5719c4b | 16c79f98f2a99714289ee94b67df836464dc8025 | refs/heads/master | 2021-01-10T15:32:10.685815 | 2019-08-11T22:27:48 | 2019-08-11T22:27:48 | 52,132,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package Bridge;
public class ConcreteImplementor implements Implementor{
@Override
public void implMethodA() {
System.out.println("実装メソッドAです");
}
@Override
public void implMethodB() {
System.out.println("実装メソッドBです");
}
}
| [
"kinopp@192.168.11.2"
] | kinopp@192.168.11.2 |
61b2ba7fed8551ad272e6643ed53eadfac351669 | 61abe0f15a736611733c3c7b043702c9b96c67de | /app/src/main/java/gst/trainingcourse/appchatonline/listener/ClickChatUser.java | df30cf474a328665a55b8c1298c8e4288b26e4ef | [] | no_license | NguyenTaTrung/AppChatOnline | 50b0a0330cba9d5e537540a49471f007d4fd2972 | d460b5c79e397f69ec5ec797f86d2a43fb784f61 | refs/heads/master | 2022-06-17T09:04:44.429905 | 2020-05-07T10:25:09 | 2020-05-07T10:25:09 | 258,201,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123 | java | package gst.trainingcourse.appchatonline.listener;
public interface ClickChatUser {
void onClickUser(int position);
}
| [
"trungnt83@fsoft.com.vn"
] | trungnt83@fsoft.com.vn |
d2aec0b286dd12fcd024337d446759e8dcf52f93 | f966c57b2e166c459a6d3b479fa29b5dee3ae17c | /processing/src/test/java/io/druid/segment/filter/BaseFilterTest.java | a6307342ae19e0f3859b74b3c0f812e10996bd4b | [
"Apache-2.0"
] | permissive | pdeva/druid | 153b89b019535b8d04f8374630970ad588d56800 | c8af37e9ac0a8c00c80b727969feb0dbc7d50f65 | refs/heads/master | 2022-11-23T11:59:37.542964 | 2016-04-02T05:31:22 | 2016-04-02T05:31:22 | 23,347,125 | 0 | 0 | Apache-2.0 | 2022-11-16T04:28:26 | 2014-08-26T09:58:39 | Java | UTF-8 | Java | false | false | 9,522 | java | /*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package io.druid.segment.filter;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.metamx.common.Pair;
import com.metamx.common.guava.Sequence;
import com.metamx.common.guava.Sequences;
import io.druid.common.utils.JodaUtils;
import io.druid.data.input.InputRow;
import io.druid.granularity.QueryGranularity;
import io.druid.query.aggregation.Aggregator;
import io.druid.query.aggregation.CountAggregatorFactory;
import io.druid.query.aggregation.FilteredAggregatorFactory;
import io.druid.query.dimension.DefaultDimensionSpec;
import io.druid.query.filter.DimFilter;
import io.druid.query.filter.Filter;
import io.druid.segment.Cursor;
import io.druid.segment.DimensionSelector;
import io.druid.segment.IndexBuilder;
import io.druid.segment.IndexMerger;
import io.druid.segment.IndexSpec;
import io.druid.segment.QueryableIndex;
import io.druid.segment.QueryableIndexStorageAdapter;
import io.druid.segment.StorageAdapter;
import io.druid.segment.TestHelper;
import io.druid.segment.data.BitmapSerdeFactory;
import io.druid.segment.data.ConciseBitmapSerdeFactory;
import io.druid.segment.data.IndexedInts;
import io.druid.segment.data.RoaringBitmapSerdeFactory;
import io.druid.segment.incremental.IncrementalIndex;
import io.druid.segment.incremental.IncrementalIndexStorageAdapter;
import org.joda.time.Interval;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.runners.Parameterized;
import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public abstract class BaseFilterTest
{
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
private final List<InputRow> rows;
protected final IndexBuilder indexBuilder;
protected final Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher;
protected StorageAdapter adapter;
protected Closeable closeable;
protected boolean optimize;
public BaseFilterTest(
List<InputRow> rows,
IndexBuilder indexBuilder,
Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher,
boolean optimize
)
{
this.rows = rows;
this.indexBuilder = indexBuilder;
this.finisher = finisher;
this.optimize = optimize;
}
@Before
public void setUp() throws Exception
{
final Pair<StorageAdapter, Closeable> pair = finisher.apply(
indexBuilder.tmpDir(temporaryFolder.newFolder()).add(rows)
);
this.adapter = pair.lhs;
this.closeable = pair.rhs;
}
@After
public void tearDown() throws Exception
{
closeable.close();
}
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> constructorFeeder() throws IOException
{
return makeConstructors();
}
public static Collection<Object[]> makeConstructors()
{
final List<Object[]> constructors = Lists.newArrayList();
final Map<String, BitmapSerdeFactory> bitmapSerdeFactories = ImmutableMap.<String, BitmapSerdeFactory>of(
"concise", new ConciseBitmapSerdeFactory(),
"roaring", new RoaringBitmapSerdeFactory()
);
final Map<String, IndexMerger> indexMergers = ImmutableMap.<String, IndexMerger>of(
"IndexMerger", TestHelper.getTestIndexMerger(),
"IndexMergerV9", TestHelper.getTestIndexMergerV9()
);
final Map<String, Function<IndexBuilder, Pair<StorageAdapter, Closeable>>> finishers = ImmutableMap.of(
"incremental", new Function<IndexBuilder, Pair<StorageAdapter, Closeable>>()
{
@Override
public Pair<StorageAdapter, Closeable> apply(IndexBuilder input)
{
final IncrementalIndex index = input.buildIncrementalIndex();
return Pair.<StorageAdapter, Closeable>of(
new IncrementalIndexStorageAdapter(index),
new Closeable()
{
@Override
public void close() throws IOException
{
index.close();
}
}
);
}
},
"mmapped", new Function<IndexBuilder, Pair<StorageAdapter, Closeable>>()
{
@Override
public Pair<StorageAdapter, Closeable> apply(IndexBuilder input)
{
final QueryableIndex index = input.buildMMappedIndex();
return Pair.<StorageAdapter, Closeable>of(
new QueryableIndexStorageAdapter(index),
new Closeable()
{
@Override
public void close() throws IOException
{
index.close();
}
}
);
}
},
"mmappedMerged", new Function<IndexBuilder, Pair<StorageAdapter, Closeable>>()
{
@Override
public Pair<StorageAdapter, Closeable> apply(IndexBuilder input)
{
final QueryableIndex index = input.buildMMappedMergedIndex();
return Pair.<StorageAdapter, Closeable>of(
new QueryableIndexStorageAdapter(index),
new Closeable()
{
@Override
public void close() throws IOException
{
index.close();
}
}
);
}
}
);
for (Map.Entry<String, BitmapSerdeFactory> bitmapSerdeFactoryEntry : bitmapSerdeFactories.entrySet()) {
for (Map.Entry<String, IndexMerger> indexMergerEntry : indexMergers.entrySet()) {
for (Map.Entry<String, Function<IndexBuilder, Pair<StorageAdapter, Closeable>>> finisherEntry : finishers.entrySet()) {
for (boolean optimize : ImmutableList.of(false, true)) {
final String testName = String.format(
"bitmaps[%s], indexMerger[%s], finisher[%s], optimize[%s]",
bitmapSerdeFactoryEntry.getKey(),
indexMergerEntry.getKey(),
finisherEntry.getKey(),
optimize
);
final IndexBuilder indexBuilder = IndexBuilder.create()
.indexSpec(new IndexSpec(
bitmapSerdeFactoryEntry.getValue(),
null,
null
))
.indexMerger(indexMergerEntry.getValue());
constructors.add(new Object[]{testName, indexBuilder, finisherEntry.getValue(), optimize});
}
}
}
}
return constructors;
}
/**
* Selects elements from "selectColumn" from rows matching a filter. selectColumn must be a single valued dimension.
*/
protected List<String> selectColumnValuesMatchingFilter(final DimFilter filter, final String selectColumn)
{
final Cursor cursor = makeCursor(Filters.toFilter(maybeOptimize(filter)));
final List<String> values = Lists.newArrayList();
final DimensionSelector selector = cursor.makeDimensionSelector(
new DefaultDimensionSpec(selectColumn, selectColumn)
);
for (; !cursor.isDone(); cursor.advance()) {
final IndexedInts row = selector.getRow();
Preconditions.checkState(row.size() == 1);
values.add(selector.lookupName(row.get(0)));
}
return values;
}
protected long selectCountUsingFilteredAggregator(final DimFilter filter)
{
final Cursor cursor = makeCursor(null);
final Aggregator agg = new FilteredAggregatorFactory(
new CountAggregatorFactory("count"),
maybeOptimize(filter)
).factorize(cursor);
for (; !cursor.isDone(); cursor.advance()) {
agg.aggregate();
}
return agg.getLong();
}
private DimFilter maybeOptimize(final DimFilter dimFilter)
{
if (dimFilter == null) {
return null;
}
return optimize ? dimFilter.optimize() : dimFilter;
}
private Cursor makeCursor(final Filter filter)
{
final Sequence<Cursor> cursors = adapter.makeCursors(
filter,
new Interval(JodaUtils.MIN_INSTANT, JodaUtils.MAX_INSTANT),
QueryGranularity.ALL,
false
);
return Iterables.getOnlyElement(Sequences.toList(cursors, Lists.<Cursor>newArrayList()));
}
}
| [
"gianmerlino@gmail.com"
] | gianmerlino@gmail.com |
31719b1206352c5e7e0ffad98b2a8f16bb744800 | 7c4b0f13e636337831faf1ab04636d495cdd2331 | /c2c-mall/java/service/diandian-facade/src/main/java/com/diandian/dubbo/facade/model/order/OrderDetailModel.java | 1e676f1606c79a6709c3751437b51f788eef872d | [] | no_license | little6/c2c-mall | 93255c1e3ed32b29439af7577af085f4bd47a8e7 | fc0dacdfed23c3223aca1b8fd5cb9129b92b347f | refs/heads/master | 2022-11-18T06:19:22.177651 | 2020-07-20T08:58:17 | 2020-07-20T08:58:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,481 | java | package com.diandian.dubbo.facade.model.order;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diandian.dubbo.facade.model.BaseModel;
import com.diandian.dubbo.facade.model.member.MemberOrderOptLogModel;
import com.diandian.dubbo.facade.model.merchant.MerchantProductInfoModel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author: yqingyuan
* @Date: 2019/2/28 14:33
* @Version 1.0
*/
@Data
@TableName("order_detail")
public class OrderDetailModel extends BaseModel {
private static final long serialVersionUID = 1993429443271059530L;
/**
* 订单号
*/
@TableField("order_no")
private String orderNo;
/**
* 店铺ID
*/
@TableField("shop_id")
private Long shopId;
/**
* 店铺名称
*/
@TableField("shop_name")
private String shopName;
/**
* 产品ID
*/
@TableField("product_id")
private Long productId;
/**
* 商户积分商城商品ID
*/
@TableField("mch_product_id")
private Long mchProductId;
/**
* 产品图片URL
*/
@TableField("product_image_url")
private String productImageUrl;
/**
* SKUID
*/
@TableField("sku_id")
private Long skuId;
/**
* sku名称
*/
@TableField("sku_name")
private String skuName;
/**
* 规格信息 逗号隔开
*/
@TableField("spec_info")
private String specInfo;
/**
* 仓库ID
*/
@TableField("repository_id")
private Long repositoryId;
/**
* 仓库名称
*/
@TableField("repository_name")
private String repositoryName;
/**
* 价格
*/
@TableField("price")
private BigDecimal price;
/**
* 分享加价
*/
@TableField("add_price")
private BigDecimal addPrice;
/**
* 数量
*/
@TableField("num")
private Integer num;
/**
* 服务费
*/
@TableField("service_fee")
private BigDecimal serviceFee;
/**
* 收货人
*/
@TableField("recv_name")
private String recvName;
/**
* 收货电话
*/
@TableField("recv_phone")
private String recvPhone;
/**
* 收货地址
*/
@TableField("recv_address")
private String recvAddress;
/**
* 收货邮编
*/
@TableField("recv_post_code")
private String recvPostCode;
/**
* 运输费用
*/
@TableField("transport_fee")
private BigDecimal transportFee;
/**
* 运输费用介绍
*/
@TableField("transport_fee_introduce")
private String transportFeeIntroduce;
/**
* 运输方式ID
*/
@TableField("transport_id")
private Long transportId;
/**
* 运输方式名称
*/
@TableField("transport_name")
private String transportName;
/**
* 运输公司ID
*/
@TableField("transport_company_id")
private Long transportCompanyId;
/**
* 运输公司名称
*/
@TableField("transport_company_name")
private String transportCompanyName;
/**
* 售后标识 0正常 1售后状态
*/
@TableField("after_sale_flag")
private Integer afterSaleFlag;
/**
* 分润标识(0未分润 1已分润 2分润返还)
*/
@TableField("share_flag")
private Integer shareFlag;
/**
* 0待付款 1待发货 2已发货 3已完成 98关闭订单 99异常单
*/
@TableField("state")
private Integer state;
/**
* 支付时间
*/
@TableField("pay_time")
private Date payTime;
/**
* 发货时间
*/
@TableField("transmit_time")
private Date transmitTime;
/**
* 确认收货时间
*/
@TableField("confirm_recv_time")
private Date confirmRecvTime;
/**
* 完成时间
*/
@TableField("complete_time")
private Date completeTime;
/**
* 备注
*/
@TableField("remark")
private String remark;
/**
* 在售标识 M天猫 T淘宝 D京东
*/
@TableField(exist = false)
private String sellFlag;
/**
* 在售商品链接
*/
@TableField(exist = false)
private String sellUrl;
@TableField(exist = false)
private MerchantProductInfoModel merchantProductInfoModel;
@TableField(exist = false)
private MemberOrderOptLogModel memberOrderOptLog;
}
| [
"1348691929@qq.com"
] | 1348691929@qq.com |
746c7317bcb98e30d54dc9fdcc25b8f5b36ba3ac | 858761a5810934c51cb0987903f3f97f161bc4a6 | /tags/kernel-1.3.0-rc03/kernel-storage-util/src/main/java/org/sakaiproject/util/MultiSingleStorageSqlDb2.java | d5f33d170b62360e25bf04cf4eab3c45e7990b21 | [] | no_license | svn2github/sakai-kernel | f10821d51e39651788c97e1d2739f762c25e79de | 2b97c9b7ad53becc8de57a5233c7d35873edd10d | refs/heads/master | 2020-04-14T21:44:05.973159 | 2014-12-23T21:38:01 | 2014-12-23T21:38:01 | 10,166,725 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,405 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/kernel/trunk/kernel-util/src/main/java/org/sakaiproject/util/MultiSingleStorageSqlDb2.java $
* $Id: MultiSingleStorageSqlDb2.java 51317 2008-08-24 04:38:02Z csev@umich.edu $
***********************************************************************************
*
* Copyright (c) 2007, 2008 Sakai Foundation
*
* Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.sakaiproject.util;
/**
* methods for accessing single storage data in a db2 database.
*/
public class MultiSingleStorageSqlDb2 extends MultiSingleStorageSqlDefault
{
/**
* @param storage_fields
*/
public MultiSingleStorageSqlDb2(String storage_fields)
{
super(storage_fields);
}
}
| [
"cle-release-team@collab.sakaiproject.org@66ffb92e-73f9-0310-93c1-f5514f145a0a"
] | cle-release-team@collab.sakaiproject.org@66ffb92e-73f9-0310-93c1-f5514f145a0a |
1edf6df7427fcdf8913de638798812d16177e082 | 5ebfa1aedd6a51cb1f16c0462765ad7cd9d8296a | /Heap/src/MaxHeap.java | 737c7416645c2c91bc1c0f5ab5d5dad84cdfcfcc | [] | no_license | hgblalock/CSCE145_146 | 7541634711be32d255d3b041e3ed15cb02946099 | 1940f64a1f9a0f6ce31ed271ea432b056a144a48 | refs/heads/main | 2023-03-25T07:20:29.936175 | 2021-03-23T23:59:48 | 2021-03-23T23:59:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,567 | java | /*
* In-Class Example
* 04.02.2020
*/
public class MaxHeap <T extends Comparable<T>> {
private T[] heap;
private int lastIndex;
public static final int DEF_SIZE = 127;
public MaxHeap()
{
init(DEF_SIZE);
}
public MaxHeap(int size)
{
init(size);
}
private void init(int size)
{
if (size > 0)
{
heap = (T[])(new Comparable[size]);
lastIndex = 0;
}
else
{
init(DEF_SIZE);
}
}
public void add(T aData)
{
if (lastIndex >= heap.length)
return;
heap[lastIndex] = aData;
bubbleUp();
lastIndex++;
}
private void bubbleUp()
{
int index = lastIndex;
while (index > 0 &&
heap[(index-1)/2].compareTo(heap[index]) < 0)
{
// swap
T temp = heap[(index-1)/2];
heap[(index-1)/2] = heap[index];
heap[index] = temp;
index = (index-1)/2;
}
}
public T remove()
{
if (heap[0] == null)
return null;
T ret = heap[0];
heap[0] = heap[lastIndex-1];
heap[lastIndex-1] = null;
lastIndex--;
bubbleDown();
return ret;
}
private void bubbleDown()
{
int index = 0;
while ((index*2)+1 < lastIndex)
{
int bigIndex = index*2 + 1;
if ((index*2)+2 < lastIndex &&
heap[index*2+1].compareTo(heap[index*2+2]) < 0)
{
bigIndex = index*2+2;
}
if (heap[index].compareTo(heap[bigIndex]) < 0)
{
// swap
T temp = heap[index];
heap[index] = heap[bigIndex];
heap[bigIndex] = temp;
}
else
break;
index = bigIndex;
}
}
public void print()
{
for (int i = 0; i < lastIndex; i++)
{
System.out.println(heap[i]);
}
}
}
| [
"hadleyblalock@gmail.com"
] | hadleyblalock@gmail.com |
ea86e33e0e58a9c99038cce64aff6372b3bcb222 | f9abb45e40220f435630695abc5ae784cb805254 | /src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordArgumentMapper.java | 54be65254430bddb7b491e9fb202d46fcc2cc3c4 | [
"Apache-2.0"
] | permissive | Paramashiva/RED | a05386468e5854235e74f6b8e92c3281c56d72b5 | bc91515284442feb37bd1db374310ccf0d654454 | refs/heads/master | 2020-03-24T17:45:21.659474 | 2018-06-18T13:56:24 | 2018-06-18T13:56:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,103 | java | /*
* Copyright 2015 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.rf.ide.core.testdata.mapping.setting.suite;
import java.util.List;
import java.util.Stack;
import org.rf.ide.core.testdata.mapping.table.ElementsUtility;
import org.rf.ide.core.testdata.mapping.table.IParsingMapper;
import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper;
import org.rf.ide.core.testdata.model.FilePosition;
import org.rf.ide.core.testdata.model.RobotFileOutput;
import org.rf.ide.core.testdata.model.table.SettingTable;
import org.rf.ide.core.testdata.model.table.setting.SuiteSetup;
import org.rf.ide.core.testdata.text.read.IRobotTokenType;
import org.rf.ide.core.testdata.text.read.ParsingState;
import org.rf.ide.core.testdata.text.read.RobotLine;
import org.rf.ide.core.testdata.text.read.recognizer.RobotToken;
import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType;
public class SuiteSetupKeywordArgumentMapper implements IParsingMapper {
private final ElementsUtility utility;
private final ParsingStateHelper stateHelper;
public SuiteSetupKeywordArgumentMapper() {
this.utility = new ElementsUtility();
this.stateHelper = new ParsingStateHelper();
}
@Override
public RobotToken map(final RobotLine currentLine,
final Stack<ParsingState> processingState,
final RobotFileOutput robotFileOutput, final RobotToken rt, final FilePosition fp,
final String text) {
final List<IRobotTokenType> types = rt.getTypes();
types.add(0,
RobotTokenType.SETTING_SUITE_SETUP_KEYWORD_ARGUMENT);
types.remove(RobotTokenType.UNKNOWN);
rt.setText(text);
final SettingTable settings = robotFileOutput.getFileModel()
.getSettingTable();
final List<SuiteSetup> setups = settings.getSuiteSetups();
if (!setups.isEmpty()) {
setups.get(setups.size() - 1).addArgument(rt);
} else {
// FIXME: some error
}
processingState.push(ParsingState.SETTING_SUITE_SETUP_KEYWORD_ARGUMENT);
return rt;
}
@Override
public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput,
final RobotLine currentLine, final RobotToken rt, final String text,
final Stack<ParsingState> processingState) {
boolean result = false;
final ParsingState state = stateHelper.getCurrentStatus(processingState);
if (state == ParsingState.SETTING_SUITE_SETUP) {
final List<SuiteSetup> suiteSetups = robotFileOutput.getFileModel()
.getSettingTable().getSuiteSetups();
result = utility.checkIfHasAlreadyKeywordName(suiteSetups);
} else if (state == ParsingState.SETTING_SUITE_SETUP_KEYWORD
|| state == ParsingState.SETTING_SUITE_SETUP_KEYWORD_ARGUMENT) {
result = true;
}
return result;
}
}
| [
"lwlodarc@users.noreply.github.com"
] | lwlodarc@users.noreply.github.com |
4952e55a7baef414a89c92b79c81da8a0b338aca | 67da9e2234dae8e6288feea94b7fc306c788fcd3 | /Polimorfismo/src/br/fadep/polimorfismo/main/Reptil.java | 370a7d62159ef366a18e9d8a09c2bdf80a958f13 | [] | no_license | Caio3502/Java | ed3304166c916b7fc3c8c2b9236ffad4e1d1eb3e | a65d5997039de87b493903a79a639dcc39839a87 | refs/heads/master | 2020-05-30T18:51:19.586810 | 2019-06-03T00:10:20 | 2019-06-03T00:10:20 | 189,907,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | package br.fadep.polimorfismo.main;
public class Reptil extends Animal{
private String corScama;
@Override
public void locomover() {
System.out.println("Rastejando");
}
@Override
public void alimentar() {
System.out.println("Comendo Vegetais");
}
@Override
public void emitirSom() {
System.out.println("Gritando");
}
public String getCorScama() {
return corScama;
}
public void setCorScama(String corScama) {
this.corScama = corScama;
}
}
| [
"caiovinicius3502@outlook.com"
] | caiovinicius3502@outlook.com |
c6ad3fe8629f6413d0179551ff30e5e96acdd4ae | 55b3651d0cb62c91816dbfb9c14324c01bd64b65 | /20170919/杨修天-151220144/Position.java | b2f0476a2f54514612f9e30be34b64a91b6573b0 | [] | no_license | irishaha/java-2017f-homework | e942688ccc49213ae53c6cee01552cf15c7345f5 | af9b2071de4896eebbb27da43d23e4d8a84c8b5d | refs/heads/master | 2021-09-04T07:54:46.721020 | 2018-01-17T06:51:12 | 2018-01-17T06:51:12 | 103,260,952 | 2 | 0 | null | 2017-10-18T14:50:25 | 2017-09-12T11:17:27 | Java | UTF-8 | Java | false | false | 538 | java | package Huluwa;
public class Position {
private int x;
private int y;
private Huluwa people;
Position(int x)
{ super();
this.x=x;
this.y=0;
}
public void setpeople(Huluwa a)
{
this.people=a;
this.people.setPosition(this);
}
public Huluwa getpeople()
{
return people;
}
public void reportnum()
{
System.out.print(this.x+" ");
}
public void reportpeo()
{
this.people.tellname();
}
public void reportcolor()
{
this.people.tellcolor();
}
public void tellx()
{
System.out.print(x+" ");
}
}
| [
"1071277916@qq.com"
] | 1071277916@qq.com |
c501886f557b00ba4459b3ea6b6c3e6144677511 | 3e103533b057c7a92952f5228582231c14108ccd | /user-service/src/test/java/com/java/learning/user/UserServiceApplicationTests.java | 8f212cfaaf7c717c6b4bff3623e7890fdff7fe3b | [] | no_license | aranjan-git/jdk11_springboot_microservices | 9694afb76e3cbe4da05fa183b3dc3a1d79ca2b11 | 8831b48a6e156150d0fa48342b4b987e756b11b4 | refs/heads/main | 2023-08-14T10:45:48.552471 | 2021-10-07T08:04:36 | 2021-10-07T08:04:36 | 414,278,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 219 | java | package com.java.learning.user;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UserServiceApplicationTests {
@Test
void contextLoads() {
}
}
| [
"91944568+aranjan-git@users.noreply.github.com"
] | 91944568+aranjan-git@users.noreply.github.com |
8ab47e2ca2772f2215347c7cabba08f0cc2a01b6 | 1a005a480e9555e8a14f29a25d10c5963e8168a6 | /src/main/java/creational/singleton/Main.java | 56c6a0cd5c6d79244c81d5d1f0f465086bc5117a | [] | no_license | AndriiRubets/javagda21_wzorce | 38e1cdc85290682ecd625bf2317e604f2abb63c6 | 6aa7ae230e391976ea27d6d1ab3f2d1fdfe53162 | refs/heads/master | 2020-05-01T04:09:26.018741 | 2019-03-24T11:43:06 | 2019-03-24T11:43:06 | 177,265,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,122 | java | package creational.singleton;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Poczta poczta = new Poczta();
boolean isWorking = true;
while (isWorking) {
String line = sc.nextLine().trim().toLowerCase();
if (line.startsWith("quit")) {
break;
} else if (line.startsWith("automat")) {
int numerek = poczta.pobierzTicketZAutomatu();
System.out.println("Automat, ticket: "+numerek);
} else if (line.startsWith("internet")) {
int numerek = poczta.pobierzTicketZeStronyInternetowej();
System.out.println("Internet, ticket: "+numerek);
} else if (line.startsWith("rejestracja")) {
int numerek = poczta.pobierzTicketZRejestracji();
System.out.println("Rejestracja, ticket: "+numerek);
}else {
System.out.println("Wpisz jeden z variantow - automat/internet/rejestracja lub qiut");
}
}
}
}
| [
"rubetsav@gmail.com"
] | rubetsav@gmail.com |
2c8048f56e40104eb4b471acc1810510c07447d0 | 5fa47de449a871667281a53251410a9fc7060723 | /JavaProjects/JavaCollections/src/_04LongestIncreasingSequence.java | 3c6a4060dfdd3e61b7452bf793cedbb73ea50563 | [] | no_license | kishoref22/SoftUni-Homework-Projects | 1d4201c6f7cae5a21d20247324da723aba8d3667 | a252b4e977551f19062cf8cae14ea4b86cad437f | refs/heads/master | 2020-03-21T10:28:37.661552 | 2018-03-24T18:12:56 | 2018-03-24T18:12:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,865 | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Created by Maika on 10/23/2015.
*/
public class _04LongestIncreasingSequence {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
String[] arrayOfStrings = reader.nextLine().split(" ");
int[] themNumbers = new int[arrayOfStrings.length];
for (int i = 0; i < arrayOfStrings.length; i++) {
themNumbers[i] = Integer.parseInt(arrayOfStrings[i]);
}
List<Integer> sequences = new ArrayList<>();
List<List<Integer>> longestSeq = new ArrayList<>();
int lastIndex = Integer.MIN_VALUE;
int maxSize = Integer.MIN_VALUE;
for (int i = 0; i < themNumbers.length; i++) {
int currentNumber = themNumbers[i];
if (i > lastIndex) {
sequences.add(currentNumber);
if (i != themNumbers.length - 1) {
for (int j = Math.min(i + 1, themNumbers.length - 1); j < themNumbers.length; j++) {
if (currentNumber < themNumbers[j]) {
sequences.add(themNumbers[j]);
currentNumber = themNumbers[j];
lastIndex = j;
} else {
break;
}
}
}
if(sequences.size() > maxSize){
maxSize = sequences.size();
longestSeq.clear();
longestSeq.add(sequences);
}
System.out.println(sequences);
sequences = new ArrayList<>();
}
}
for(List<Integer> longestseq : longestSeq){
System.out.println("Longest: " + longestseq);
}
}
}
| [
"jitza_nest@yahoo.com"
] | jitza_nest@yahoo.com |
a119cbe1ae9a9e16af3d125d2b7729579383eea2 | a951f3c5334d81534ca08489264bcdb6eeb32c14 | /src/main/java/com/yapt/demo/design/partterns/strategy/promotion/PromotionActivityTest.java | 728baccdfaaa49ffd5a79da3180edac5ba133ff4 | [] | no_license | Yapt2016/design-patterns | 2e9546e3d06181ce36a417ff932c60891a824e26 | 9df342a6b1cf613175422ff50f5d2be5d4469b5a | refs/heads/master | 2020-12-27T12:20:51.492815 | 2020-10-19T10:35:33 | 2020-10-19T10:35:33 | 237,901,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,205 | java | package com.yapt.demo.design.partterns.strategy.promotion;
/**
* 促销活动
* Created by Tom
*/
public class PromotionActivityTest {
// public static void main(String[] args) {
// PromotionActivity activity618 = new PromotionActivity(new CouponStrategy());
// PromotionActivity activity1111 = new PromotionActivity(new CashbackStrategy());
//
// activity618.execute();
// activity1111.execute();
// }
// public static void main(String[] args) {
// PromotionActivity promotionActivity = null;
//
// String promotionKey = "COUPON";
//
// if(StringUtils.equals(promotionKey,"COUPON")){
// promotionActivity = new PromotionActivity(new CouponStrategy());
// }else if(StringUtils.equals(promotionKey,"CASHBACK")){
// promotionActivity = new PromotionActivity(new CashbackStrategy());
// }//......
// promotionActivity.execute();
// }
public static void main(String[] args) {
String promotionKey = "GROUPBUY";
PromotionActivity promotionActivity = new PromotionActivity(PromotionStrategyFactory.getPromotionStrategy(promotionKey));
promotionActivity.execute();
}
}
| [
"15377130973@163.com"
] | 15377130973@163.com |
593b2167c62b902aa3d6856f4352a570478703b9 | 8f36e7dd45e51ae948c1944b6338d795070c8bc5 | /MovieNotes/src/com/movienotes/GetDevices.java | 82b8e335bfe6bd760b238e3aaeabdd35d9299aa6 | [] | no_license | lokresh88/MovieNotes | 886926ccaf4af04ae901fd5d1163b14a38dafb22 | bcba8316bcdf2268e0250aaa5c020a6f33027736 | refs/heads/master | 2020-05-16T21:38:33.487639 | 2014-04-15T05:42:41 | 2014-04-15T05:42:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,879 | java | package com.movienotes;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.json.simple.JSONObject;
import com.google.appengine.labs.repackaged.org.json.JSONArray;
import com.google.appengine.labs.repackaged.org.json.JSONException;
import com.google.gson.Gson;
@SuppressWarnings("serial")
public class GetDevices extends HttpServlet {
// private static final Logger log =
// Logger.getLogger(GetTasks.class.getName());
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
HttpSession serv = req.getSession();
PrintWriter pout = resp.getWriter();
Long userid = (Long) serv.getAttribute("loggedinUserId");
Gson jsonbjG = new Gson();
com.google.appengine.labs.repackaged.org.json.JSONObject jsonbj = new com.google.appengine.labs.repackaged.org.json.JSONObject();
DBUtil dbutil = new DBUtil();
Boolean isMobile = req.getParameter("isMobile") != null ? (Boolean
.parseBoolean(req.getParameter("isMobile"))) : true;
if (userid == null) {
try {
jsonbj.put("status", false);
jsonbj.put("errorMessage", "username-password not valid :( ");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
pout.print(jsonbj.toString());
return;
}
com.movienotes.User user = dbutil.getUserById(userid);
ArrayList<Movie> devices = new ArrayList<Movie>();
System.out.println("****************SUCCESS" + userid);
HashMap<String, ArrayList<Movie>> devicesListings = new HashMap<String, ArrayList<Movie>>();
try {
// devicesListings = dbutil.getDevicesListing(userid, micAddress);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (devicesListings.size() > 0) {
ArrayList<Movie> activeList = (ArrayList<Movie>) devicesListings
.get("ActiveList");
ArrayList<Movie> inactiveList = (ArrayList<Movie>) devicesListings
.get("InActiveList");
req.setAttribute("ActiveList", activeList);
req.setAttribute("InActiveList", inactiveList);
req.setAttribute("username", user.getName());
System.out.print(inactiveList);
System.out.print(activeList);
try {
jsonbj.put("ActiveList", jsonbjG.toJson(activeList));
jsonbj.put("InActiveList", jsonbjG.toJson(inactiveList));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (isMobile) {
pout.write(jsonbj.toString());
return;
}
// req.setAttribute("devices", jsonbj);
RequestDispatcher rd = req
.getRequestDispatcher("jsps/devicesTasks.jsp");
resp.setHeader("Cache-Control", "no-cahce");
resp.setHeader("Expires", "0");
rd.forward(req, resp);
return;
}
}
| [
"lokresh88@gmail.com"
] | lokresh88@gmail.com |
6890215e4366f3eb40d461cf39cca3201337eddd | 4373f806dbd2ad3465c77f1ca03828b9a589abc1 | /core/src/org/javarosa/core/model/SubmissionProfile.java | b74bedca769c7c1956d5580c676a7748e05e95cf | [
"Apache-2.0"
] | permissive | wpride/javarosa | 18e00154e36cdb18ace3df195c5a79241cc85955 | 4a22fecc295c23a088410d2ca65177fbb1866a6b | refs/heads/master | 2020-04-15T13:49:32.928238 | 2014-07-23T19:11:57 | 2014-07-23T19:11:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | /**
*
*/
package org.javarosa.core.model;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Hashtable;
import org.javarosa.core.util.externalizable.DeserializationException;
import org.javarosa.core.util.externalizable.ExtUtil;
import org.javarosa.core.util.externalizable.ExtWrapMap;
import org.javarosa.core.util.externalizable.ExtWrapTagged;
import org.javarosa.core.util.externalizable.Externalizable;
import org.javarosa.core.util.externalizable.PrototypeFactory;
/**
* A Submission Profile is a class which is responsible for
* holding and processing the details of how a submission
* should be handled.
*
* @author ctsims
*
*/
public class SubmissionProfile implements Externalizable {
IDataReference ref;
String method;
String action;
String mediaType;
Hashtable<String,String> attributeMap;
public SubmissionProfile() {
}
public SubmissionProfile(IDataReference ref, String method, String action, String mediatype) {
this(ref, method, action, mediatype, new Hashtable<String, String>());
}
public SubmissionProfile(IDataReference ref, String method, String action, String mediatype, Hashtable<String,String> attributeMap) {
this.method = method;
this.ref = ref;
this.action = action;
this.mediaType = mediatype;
this.attributeMap = attributeMap;
}
public IDataReference getRef() {
return ref;
}
public String getMethod() {
return method;
}
public String getAction() {
return action;
}
public String getMediaType() {
return mediaType;
}
public String getAttribute(String name) {
return attributeMap.get(name);
}
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
ref = (IDataReference)ExtUtil.read(in, new ExtWrapTagged(IDataReference.class));
method = ExtUtil.readString(in);
action = ExtUtil.readString(in);
mediaType = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
attributeMap = (Hashtable<String, String>)ExtUtil.read(in, new ExtWrapMap(String.class, String.class));
}
public void writeExternal(DataOutputStream out) throws IOException {
ExtUtil.write(out, new ExtWrapTagged(ref));
ExtUtil.writeString(out, method);
ExtUtil.writeString(out, action);
ExtUtil.writeString(out, ExtUtil.emptyIfNull(mediaType));
ExtUtil.write(out, new ExtWrapMap(attributeMap));
}
}
| [
"wpride@dimagi.com"
] | wpride@dimagi.com |
ae20cce96bea043ed152648c4bb082ab195be5b2 | c528bb4f217b9e38014db9b33402d83a30f48c62 | /src/zadaci_6_2_2016/Zadatak2.java | cf7a71e9d7cea09bf36e5834f1d307738fb51a19 | [] | no_license | Kobe929/BILD-IT-zadaci | 49a59427466a476873b8c6cf7462c85d1979485b | 795362888c62a0b4df4970510b878a634dcc51fa | refs/heads/master | 2021-01-10T16:49:24.790880 | 2016-02-26T00:08:10 | 2016-02-26T00:08:10 | 49,772,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package zadaci_6_2_2016;
//Write a client program that tests all methods in the class.
public class Zadatak2 {
public static void main(String[] args) {
//Testiranje metoda
MyInteger broj = new MyInteger(13);
String str = "559";
System.out.println("Broj " +broj.getValue() +", prime: "+ broj.isPrime() +" neparan: "+ broj.isOdd() +" paran: "+ broj.isEven());
System.out.println("String " +str+ " int vrijednost: " +MyInteger.parseInt(str));
}
}
| [
"filipdautovic@yahoo.com"
] | filipdautovic@yahoo.com |
0e3968b794841e89c721bd3fcd1d345f7900298c | 605034302f7d81b1831ce780919e0303c7e31659 | /src/com/javarush/test/level05/lesson07/task03/Dog.java | b5d58ad15811491a68ae8ed56dab554f63a3429a | [] | no_license | SuprunO/JavaRushHomeWork | 0b347f0920ad761c17411bc61971aecd7bd4eb04 | d60d0a44fb630c255a2c3638de5d16e8efbff905 | refs/heads/master | 2020-06-10T08:52:59.637829 | 2017-02-04T14:28:29 | 2017-02-04T14:28:29 | 75,977,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package com.javarush.test.level05.lesson07.task03;
/* Создать класс Dog
Создать класс Dog (собака) с тремя инициализаторами:
- Имя
- Имя, рост
- Имя, рост, цвет
*/
public class Dog
{
private String dog=null;
public void initialize(String name){
this.dog=name;
}
public void initialize(String name, int height){
this.dog=name+height;
}
public void initialize (String name, int height,String color){
this.dog=name+height+color;
}
//напишите тут ваш код
}
| [
"Oleksii Suprun"
] | Oleksii Suprun |
63469459e01389d2f9596b6d4f8c7924c950e0ff | 0a27abd55dace3145186e42080c682ba1e9593af | /app/src/main/java/com/hly/MyApplication.java | ef2115d143d7cbf66838f7a7ac0c0594605b6ce5 | [] | no_license | leon5458/AppFrontBack | b0c88ce461bd1398f1e5ecb3fb3eaa4347a0f7b6 | e1d51041401fe7bd1fb07099888514a906070dff | refs/heads/master | 2020-04-26T23:32:54.665837 | 2019-03-05T08:26:46 | 2019-03-05T08:26:46 | 173,905,527 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package com.hly;
import android.app.Application;
import android.util.Log;
import android.widget.Toast;
/**
* ~~~~~~文件描述:~~~~~~
* ~~~~~~作者:huleiyang~~~~~~
* ~~~~~~创建时间:2019/3/5~~~~~~
* ~~~~~~更改时间:2019/3/5~~~~~~
* ~~~~~~版本号:2.0~~~~~~
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AppFrontBackHelper helper = new AppFrontBackHelper();
helper.register(MyApplication.this, new AppFrontBackHelper.OnAppStatusListener() {
@Override
public void onFront() {
//应用切到前台处理
}
@Override
public void onBack() {
//应用切到后台处理
Toast.makeText(MyApplication.this, "应用切换到后台", Toast.LENGTH_SHORT).show();
Log.d("=========hly=========","切换到后太");
}
});
}
}
| [
"919633712@qq.com"
] | 919633712@qq.com |
057bd6cd3df37603b40f9fbb99a8e2eccf3af2e0 | 51e8f912ecb0f97ac67e3ec0a9459afb48b06c28 | /Item.java | f3d6f1a53200b741b0601356718999fb4043d69e | [] | no_license | Kullaying-P/Java_Game | 7b08bce805305366532a00684b9677902bf43da8 | 5d815d1cea44736440a7194a7052d178ecb76427 | refs/heads/master | 2020-04-24T20:18:16.881405 | 2019-04-25T14:06:48 | 2019-04-25T14:06:48 | 172,239,015 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | import java.io.*;
import java.util.*;
public class Item
{
private String[] item = new String[2];
public Item()
{
item[0] = "Potion";
}
public String getpotion(int i)
{
return item[i];
}
} | [
"6010110039@psu.ac.th"
] | 6010110039@psu.ac.th |
1744a8a9502934d779707c10117608e139edb159 | 37adcb322e2103293c3124dbe6e7e25b405ed1e5 | /src/main/java/com/lanstar/pesaplusdashboard/model/SaccoInfo.java | 556d9c01cc3c14ec860d7f16736e5be7b4f749ea | [] | no_license | sergeTechnologies5/pesaplusdahsboard | bdfba137b96bff05eaa59f392476a39470a2423b | 8669c2ba307b7b397c57efdf69b08f560452aa42 | refs/heads/master | 2022-07-02T23:21:42.309581 | 2020-01-29T14:45:15 | 2020-01-29T14:45:15 | 235,065,332 | 0 | 0 | null | 2022-05-20T21:24:26 | 2020-01-20T09:34:47 | JavaScript | UTF-8 | Java | false | false | 433 | java | package com.lanstar.pesaplusdashboard.model;
public class SaccoInfo {
private Long id;
public SaccoInfo() {
}
public SaccoInfo(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public String toString() {
return "SaccoInfo{" +
"id=" + id +
'}';
}
}
| [
"patrickmutugi5@gmail.com"
] | patrickmutugi5@gmail.com |
1bb0a9bbf721f78389f9c17add20c377be5676e8 | 627b2522124f58803e046d175fd84c34151cfe6c | /BouncyGame/app/src/main/java/com/example/bouncygame/images/ImageCache.java | 42516f517107874e7230829ef1334a9487f553a0 | [] | no_license | bxkrueper/BouncyGame | 159ce76c19eb07bd4d1f95165acb9de5ea05a76f | a98ac11f4158e2460dc8d380e5ee81fb1c694767 | refs/heads/master | 2020-06-06T00:48:13.903080 | 2019-06-18T18:30:37 | 2019-06-18T18:30:37 | 192,592,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,244 | java | package com.example.bouncygame.images;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.Gravity;
import com.example.bouncygame.R;
public class ImageCache {
private static final String CLASS_NAME = "ImageCache";
private static Context context;
public static Drawable missing_image;
public static Drawable stone;
public static Drawable obsidian;
public static Drawable bedrock;
public static Drawable dirt;
public static Drawable iron_ore;
public static Drawable diamond_ore;
public static Drawable crackImage;
public static Drawable iron_ingot;
public static Drawable diamond;
public static Drawable glass;
public static Drawable tnt;
public static Drawable gunpowder;
public static Drawable spikeBall;
public static Drawable bonusSpikeBall;
public static Drawable background;
public static Drawable[] backgroundScrollArray;
public static Drawable[] explosion;
public static AnimationDrawable testAnimation;
public static void initilize(Context imageContext){
context = imageContext;
//.setBounds(0,0,100,100);//set bounds before drawing or nothing gets displayed
missing_image = context.getResources().getDrawable(R.drawable.missing_image);missing_image.setBounds(0,0,missing_image.getIntrinsicWidth(),missing_image.getIntrinsicHeight());
stone = context.getResources().getDrawable(R.drawable.stone);
dirt = context.getResources().getDrawable(R.drawable.dirt);
bedrock = context.getResources().getDrawable(R.drawable.bedrock);
obsidian = context.getResources().getDrawable(R.drawable.obsidian);
iron_ore = context.getResources().getDrawable(R.drawable.iron_ore);
diamond_ore = context.getResources().getDrawable(R.drawable.diamond_ore);
crackImage = context.getResources().getDrawable(R.drawable.crack2);
iron_ingot = context.getResources().getDrawable(R.drawable.iron_ingot);
diamond = context.getResources().getDrawable(R.drawable.diamond);
glass = context.getResources().getDrawable(R.drawable.glass);
tnt = context.getResources().getDrawable(R.drawable.tnt);
gunpowder = context.getResources().getDrawable(R.drawable.gunpowder);
spikeBall = context.getResources().getDrawable(R.drawable.spike_ball);
bonusSpikeBall = context.getResources().getDrawable(R.drawable.bonus_spike_ball);
background = context.getResources().getDrawable(R.drawable.background);
backgroundScrollArray = new Drawable[3];
backgroundScrollArray[0] = context.getResources().getDrawable(R.drawable.background0);
backgroundScrollArray[1] = context.getResources().getDrawable(R.drawable.background1);
backgroundScrollArray[2] = context.getResources().getDrawable(R.drawable.background2);
explosion = new Drawable[14];
explosion[0] = context.getResources().getDrawable(R.drawable.explosion0);explosion[0].setBounds(0,0,explosion[0].getIntrinsicWidth(),explosion[0].getIntrinsicHeight());
explosion[1] = context.getResources().getDrawable(R.drawable.explosion1);explosion[1].setBounds(0,0,explosion[1].getIntrinsicWidth(),explosion[1].getIntrinsicHeight());
explosion[2] = context.getResources().getDrawable(R.drawable.explosion2);explosion[2].setBounds(0,0,explosion[2].getIntrinsicWidth(),explosion[2].getIntrinsicHeight());
explosion[3] = context.getResources().getDrawable(R.drawable.explosion3);explosion[3].setBounds(0,0,explosion[3].getIntrinsicWidth(),explosion[3].getIntrinsicHeight());
explosion[4] = context.getResources().getDrawable(R.drawable.explosion4);explosion[4].setBounds(0,0,explosion[4].getIntrinsicWidth(),explosion[4].getIntrinsicHeight());
explosion[5] = context.getResources().getDrawable(R.drawable.explosion5);explosion[5].setBounds(0,0,explosion[5].getIntrinsicWidth(),explosion[5].getIntrinsicHeight());
explosion[6] = context.getResources().getDrawable(R.drawable.explosion6);explosion[6].setBounds(0,0,explosion[6].getIntrinsicWidth(),explosion[6].getIntrinsicHeight());
explosion[7] = context.getResources().getDrawable(R.drawable.explosion7);explosion[7].setBounds(0,0,explosion[7].getIntrinsicWidth(),explosion[7].getIntrinsicHeight());
explosion[8] = context.getResources().getDrawable(R.drawable.explosion8);explosion[8].setBounds(0,0,explosion[8].getIntrinsicWidth(),explosion[8].getIntrinsicHeight());
explosion[9] = context.getResources().getDrawable(R.drawable.explosion9);explosion[9].setBounds(0,0,explosion[9].getIntrinsicWidth(),explosion[9].getIntrinsicHeight());
explosion[10] = context.getResources().getDrawable(R.drawable.explosion10);explosion[10].setBounds(0,0,explosion[10].getIntrinsicWidth(),explosion[10].getIntrinsicHeight());
explosion[11] = context.getResources().getDrawable(R.drawable.explosion11);explosion[11].setBounds(0,0,explosion[11].getIntrinsicWidth(),explosion[11].getIntrinsicHeight());
explosion[12] = context.getResources().getDrawable(R.drawable.explosion12);explosion[12].setBounds(0,0,explosion[12].getIntrinsicWidth(),explosion[12].getIntrinsicHeight());
explosion[13] = context.getResources().getDrawable(R.drawable.explosion13);explosion[13].setBounds(0,0,explosion[13].getIntrinsicWidth(),explosion[13].getIntrinsicHeight());
//animations
testAnimation = (AnimationDrawable) context.getResources().getDrawable(R.drawable.test_animation);testAnimation.setBounds(0,0,testAnimation.getIntrinsicWidth(),testAnimation.getIntrinsicHeight());
Log.d(CLASS_NAME, "Images initilized");
}
public static void setDimsBasedOnScreenSize(int width,int height){
background.setBounds(0,0,width,height);
}
//opacity between 0 and 1
public static void setOpacity(Drawable image,double opacity){
int alpha = (int) (opacity*256);
if(alpha>255){
alpha = 255;
}
if(alpha<0){
alpha = 0;
}
image.setAlpha(alpha);
}
}
| [
"benkrueper@gmail.com"
] | benkrueper@gmail.com |
b45fa19c106cee6ec36d6322a95d55bb4fc15943 | 94ec5b0b3075044956c067f8e6eea05499d8f24b | /src/test/java/com/ecom/demo/DemoApplicationTests.java | 5a5a81aacffa2b384943e79544f14107e9ca4a04 | [] | no_license | niteshparihar14/demo | d088d35d054302c9ba086f0d6fbadbfa4226dd81 | a4cf32b0c416e03db2152ebf4e9892148cea7cbf | refs/heads/master | 2023-02-03T09:46:44.822772 | 2020-12-27T18:21:47 | 2020-12-27T18:21:47 | 324,780,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | package com.ecom.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"niteshparihar14@gmail.com"
] | niteshparihar14@gmail.com |
e75e3a20d39e0c92613652e6d9ecc2e7be056a6a | 78a0dc1be47877910f61dcbac065b318db389ed7 | /src/main/java/cn/ibdsr/web/modular/platform/cash/transfer/WithdrawalQueryDTO.java | 48decc78a6f4f84d545ba8e957e0cf3c8611b3e3 | [] | no_license | wangdeming/eshop-admin | 1d3f4b5062bafd8a8a3a3349f5768e8e98be1ea0 | d2112ca85236ab812d8f9bbb5e78333db73e99e9 | refs/heads/master | 2022-09-19T16:04:35.420487 | 2020-06-04T03:12:46 | 2020-06-04T03:12:46 | 269,248,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package cn.ibdsr.web.modular.platform.cash.transfer;
/**
* @Description: 提现列表查询DTO
* @Version: V1.0
* @CreateDate: 2019-04-22 16:53:11
*
* Date Author Description
* ----------------------------------------------------------
* 2019-04-22 16:53:11 XuZhipeng 类说明
*
*/
public class WithdrawalQueryDTO extends QueryDTO {
/**
* 提现状态(1-待审核;2-审核通过待打款;3-提现成功;4-审核不通过;)
*/
private Integer wdStatus;
public Integer getWdStatus() {
return wdStatus;
}
public void setWdStatus(Integer wdStatus) {
this.wdStatus = wdStatus;
}
}
| [
"774555916@qq.com"
] | 774555916@qq.com |
6c65318dcc86f58c9945ea728df7a2410b910fde | 04f21a997dd64c882e9ba962f9af937fdd5d0f7e | /Parser.java | 47ac59ba101749cb3d31e618756442518b9244e6 | [] | no_license | coolcodehere/didactic-happiness | 68249556647299f86ef337ddc46aa9bf5d7d07df | 890759247b97a22b6b1c5ab4034a7e62b1725d14 | refs/heads/main | 2023-02-27T03:50:09.494613 | 2021-02-06T05:21:53 | 2021-02-06T05:21:53 | 336,462,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,815 | java |
public class Parser {
String input;
public Parser(String input) {
this.input = input;
}
public int getProdRule(String token, char input) {
switch (token) {
case "E": return E(input);
case "Ep": return Ep(input);
case "T": return T(input);
case "Tp": return Tp(input);
case "F": return F(input);
default:
return 0;
}
}
private int E(char input) {
switch(input) {
case 'n':
case '(':
return 1;
default:
return 0;
}
}
private int Ep(char input) {
switch(input) {
case '+':
return 2;
case '-':
return 3;
case ')':
case '$':
return 4;
default:
return 0;
}
}
private int T(char input) {
switch(input) {
case 'n':
case '(':
return 5;
default:
return 0;
}
}
private int Tp(char input) {
switch(input) {
case '+':
case '-':
case ')':
case '$':
return 8;
case '*':
return 6;
case '/':
return 7;
default:
return 0;
}
}
private int F(char input) {
switch (input) {
case 'n':
return 10;
case '(':
return 9;
default:
return 0;
}
}
public String[] production(int rule) {
switch (rule) {
case 1:
return ["T", "Ep"];
case 2:
return ["+", "T", "Ep"];
case 3:
return ["-", "T", "Ep"];
case 4:
return ["l"];
case 5:
return ["F", "Tp"];
case 6:
return ["*", "F", "Tp"];
case 7:
return ["/", "F", "Tp"];
case 8:
return ["l"];
case 9:
return ["(", "E", ")"];
case 10:
return ["n"];
}
return "";
}
} | [
"Will"
] | Will |
2cf842fd0d07a692a9070b915185373d2ffb0587 | 2d93567adbc079dd765136a788af801ac4ed2d6b | /microservice-taxguide/src/main/java/com/raymon/taxguide/repository/imp/BusinessRepositoryImp.java | 64046c2b756dea2d9dc05725d771bf1b020908f0 | [] | no_license | shaoyuheng1688/cloud_test | 24463c45d4e37ee82631fd40a223e31bb9fa5168 | c4fde6ce868a4675eb380d1ecdf713b7b9ace6d5 | refs/heads/master | 2023-04-29T00:22:42.891095 | 2021-05-13T01:57:08 | 2021-05-13T01:57:15 | 352,845,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | package com.raymon.taxguide.repository.imp;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.raymon.taxguide.mapper.ThemeMapper;
import com.raymon.taxguide.mapper.WorkCalendarMapper;
import com.raymon.taxguide.model.Theme;
import com.raymon.taxguide.model.WorkCalendar;
import com.raymon.taxguide.repository.BusinessRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Component("businessRepository")
public class BusinessRepositoryImp implements BusinessRepository {
@Autowired
private ThemeMapper themeMapper;
@Autowired
private WorkCalendarMapper workCalendarMapper;
@Override
public Theme findThemeByZtbm(String ztbm) {
return themeMapper.selectById(ztbm);
}
@Override
public WorkCalendar findWorkDayByDate(Date dateValue) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(dateValue);
QueryWrapper<WorkCalendar> wrapper = new QueryWrapper<WorkCalendar>();
wrapper.eq("CAL_YEAR",calendar.get(Calendar.YEAR))
.eq("CAL_MONTH",calendar.get(Calendar.MONTH) + 1)
.eq("CAL_DATE",calendar.get(Calendar.DATE));
return workCalendarMapper.selectOne(wrapper);
}
}
| [
"1134588370@qq.com"
] | 1134588370@qq.com |
ed295e887dac4d47d5d1bd9115f365f291d10038 | 8574c7b1899e5f00d62f0809780ca5d319d3cd51 | /src/java/Utility/studyDB.java | 7a04a81cb9cb01956829490e6230494210d57929 | [] | no_license | preetiharkanth/Network-based-App-devlopment | d6e9f9f0b0016774c32c45da57cedeeb1067db91 | e7105d2044935ec7c8215e56bf60390247200f62 | refs/heads/master | 2016-09-13T06:24:39.338861 | 2016-04-11T21:04:12 | 2016-04-11T21:04:12 | 56,007,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,390 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Utility;
import JavaBeans.answer;
import JavaBeans.study;
import JavaBeans.user;
import static java.lang.System.out;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.NoResultException;
import javax.persistence.TypedQuery;
/**
*
* @author Nitin
*/
public class studyDB {
public static void addStudty(study Study) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
EntityTransaction trans = em.getTransaction();
trans.begin();
try {
em.persist(Study);
trans.commit();
} catch (Exception e) {
System.out.println(e);
trans.rollback();
} finally {
em.close();
}
}
public static void updateStudy(study Study) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
EntityTransaction trans = em.getTransaction();
trans.begin();
try {
em.merge(Study);
trans.commit();
} catch (Exception e) {
System.out.println(e);
trans.rollback();
} finally {
em.close();
}
}
public static study getStudy(String SCode) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
String qString = "SELECT s FROM study s "
+ "WHERE s.SCode = :SCode";
TypedQuery<study> q = em.createQuery(qString, study.class);
q.setParameter("SCode", SCode);
try {
study Study = q.getSingleResult();
return Study;
} catch (NoResultException e) {
return null;
} finally {
em.close();
}
}
public static List<study> getStudies(String criteria) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
String qString = "SELECT s FROM study s WHERE s.SStatus LIKE :status ";
TypedQuery<study> q = em.createQuery(qString, study.class);
if (criteria.equals("Open")) {
q.setParameter("status", "Start");
}else if(criteria.equals("Close"))
q.setParameter("status", "Stop");
else if(criteria.equals("All"))
q.setParameter("status", "St%");
try {
List<study> Study = q.getResultList();
if(Study.size()==0)
return null;
return Study;
} catch (NoResultException e) {
return null;
} finally {
em.close();
}
}
public static List<study> getStudiesFor(String email) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
String qString = "SELECT s FROM study s WHERE s.Email= :email";
TypedQuery<study> q = em.createQuery(qString, study.class);
q.setParameter("email", email);
try {
List<study> Study = q.getResultList();
if(Study.size()==0)
return null;
return Study;
} catch (NoResultException e) {
return null;
} finally {
em.close();
}
}
}
| [
"preetiharkanth@gmail.com"
] | preetiharkanth@gmail.com |
7facf448640b70c2386318152b9861ad7395f79c | 9c114bc0532d312e7133fc6aee1bcfcd77f25cb1 | /app/src/main/java/nyc/c4q/huilin/picasso_exam/DisplayImgActivity.java | c9481df2f66dceda6448f696a638c4341aec8c35 | [] | no_license | nuily/Exam_1-11-17 | 6b1deddf53d0d9569e69a039d0371e599322240a | 80be99429cc90c3e32e5940bf1fc86622771f8a5 | refs/heads/master | 2021-01-12T00:14:05.805137 | 2017-01-12T02:16:10 | 2017-01-12T02:16:10 | 78,691,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,027 | java | package nyc.c4q.huilin.picasso_exam;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import nyc.c4q.huilin.picasso_exam.recyclerview.KeyViewHolder;
/**
* Created by huilin on 1/11/17.
*/
public class DisplayImgActivity extends AppCompatActivity {
private Intent intent;
private String imgUrl;
private ImageView keyImgView;
private boolean backPressTwiceExit;
private Handler mHandler;
private Runnable mRunnable;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display);
keyImgView = (ImageView) findViewById(R.id.imgv_key);
getImgFromIntent();
}
private void getImgFromIntent() {
intent = getIntent();
imgUrl = MainFragment.JSJROBOTICS + intent.getStringExtra(KeyViewHolder.IMG_URL);
Picasso.with(getApplicationContext()).load(imgUrl).into(keyImgView);
}
@Override
protected void onStart() {
super.onStart();
backPressTwiceExit = false;
mHandler = new Handler();
mRunnable = new Runnable() {
@Override
public void run() {
backPressTwiceExit = false;
}
};
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mHandler != null) {
mHandler.removeCallbacks(mRunnable);
}
}
@Override
public void onBackPressed() {
if (backPressTwiceExit) {
super.onBackPressed();
return;
}
this.backPressTwiceExit = true;
Toast.makeText(getApplicationContext(), "Press once more to see list", Toast.LENGTH_SHORT).show();
mHandler.postDelayed(mRunnable, 2000);
}
}
| [
"mslinhui@gmail.com"
] | mslinhui@gmail.com |
85907f0cdef6a404603aee1022b308b55ab62f04 | e69df73ac73b5ad0fd7239ef43d5f4188971e60f | /stetho-toolkit/src/androidTest/java/cn/mutils/app/stetho/ExampleInstrumentedTest.java | 19a43122ab7eb19d94d2576653cb6ce3891475d9 | [
"MIT"
] | permissive | wavinsun/StethoToolkit | d6d935d791cc3f046927707c87217df55a05e056 | 092f8ffe5ff8e7667746a201bd792c6c140f01d5 | refs/heads/master | 2021-09-02T14:40:33.575639 | 2018-01-03T08:12:29 | 2018-01-03T08:12:29 | 116,089,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package cn.mutils.app.stetho;
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.*;
/**
* Instrumentation 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("cn.mutils.app.stetho.test", appContext.getPackageName());
}
}
| [
"wenhua.ywh@alibaba-inc.com"
] | wenhua.ywh@alibaba-inc.com |
d7092ef341b62b7b652346ba0d519562c8270c1b | 620c1306f8b7bc3f5943018aea8e273a058a3c32 | /src/main/java/joshie/enchiridion/gui/book/features/recipe/RecipeHandlerFurnace.java | ee632e00b78b8797ba70cf1d9c649c5a0f82334a | [
"MIT"
] | permissive | Searge-DP/Enchiridion | 48f4d74dceb4bc56bd374b9956eddae0561f8eca | 4c8110980b5fed8bf5b350f30707cc38efee2f28 | refs/heads/master | 2021-01-21T19:01:33.848747 | 2016-03-01T23:30:22 | 2016-03-01T23:30:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,514 | java | package joshie.enchiridion.gui.book.features.recipe;
import java.util.List;
import java.util.Map;
import joshie.enchiridion.api.EnchiridionAPI;
import joshie.enchiridion.api.recipe.IRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
public class RecipeHandlerFurnace extends RecipeHandlerBase {
private static WrappedFuelStack fuels;
public RecipeHandlerFurnace() {}
public RecipeHandlerFurnace(ItemStack output, ItemStack input) {
stackList.add(new WrappedStack(output, 110D, 32D, 2.5F));
stackList.add(new WrappedStack(input, 0D, 0D, 2.5F));
if (fuels == null) fuels = new WrappedFuelStack(0D, 65D, 2.5F);
stackList.add(fuels);
addToUnique(Item.itemRegistry.getNameForObject(input.getItem()));
addToUnique(input.getItemDamage());
}
@Override
public void addRecipes(ItemStack output, List<IRecipeHandler> list) {
Map<ItemStack, ItemStack> smeltingList = FurnaceRecipes.instance().getSmeltingList();
for (ItemStack key : smeltingList.keySet()) {
ItemStack stack = smeltingList.get(key);
if (stack == null) continue;
if (stack.isItemEqual(output)) {
list.add(new RecipeHandlerFurnace(stack, key));
}
}
}
@Override
public String getRecipeName() {
return "VanillaFurnace";
}
@Override
public double getHeight(double width) {
return width * 1.1D;
}
@Override
public double getWidth(double width) {
return width;
}
@Override
public float getSize(double width) {
return (float) (width / 110D);
}
private int burnTime = 0;
private int getBurnTimeRemainingScaled(int scale) {
if (burnTime == 0) {
burnTime = 2000;
} else burnTime--;
return burnTime * scale / 2000;
}
private double getHeightForScaled(int i1) {
return i1;
}
protected void drawBackground() {
Minecraft.getMinecraft().getTextureManager().bindTexture(location);
EnchiridionAPI.draw.drawTexturedRectangle(55D, 38D, 1, 63, 20, 14, 1.75F);
int i1 = getBurnTimeRemainingScaled(13);
EnchiridionAPI.draw.drawTexturedReversedRectangle(44D, 56D, 0, 85, 14, 14, 1.75F);
EnchiridionAPI.draw.drawTexturedReversedRectangle(44D, 46D + 12D, 14, 98 - i1, 14, i1 + 1, 1.75F);
}
}
| [
"joshjackwildman@gmail.com"
] | joshjackwildman@gmail.com |
ce7113f34c8f3b4b7e9a6a15d14e8525b8f9eb82 | a34a75a8c1835a395e06d581432281e87dcda6d3 | /app/src/main/gen/com/InvestProfits/jimvickery/investingreturncalculator/Manifest.java | 642e030030e666bd0b1f604d963c81f80ccfc222 | [] | no_license | jimvickery/android_investing_calculator | 6a7cdf973bc6108e97c955c9d3f1a845316a92ac | 113ae4cd16e333826ee3a2beb1571db472018435 | refs/heads/master | 2021-05-09T12:14:37.045097 | 2018-02-12T06:13:32 | 2018-02-12T06:13:32 | 119,007,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | /*___Generated_by_IDEA___*/
package com.InvestProfits.jimvickery.investingreturncalculator;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
} | [
"jimrv8@yahoo.com"
] | jimrv8@yahoo.com |
a6ee559a943dd44fc126257b9370890f12a6936b | b5741eaaf867580b91d0976f7aa51e80ac8a11e0 | /api/src/main/java/com/sift/apis/beans/BaseWrapper.java | 3c0a260562e4d03ad7818ba1a18bb93a771518d9 | [] | no_license | flynaut-piyushj/sift-social | 1b74926a840abb431824725d368d27f4475f62f4 | 89ed80f657685950ebebd13a7f08144f2a3be147 | refs/heads/master | 2021-09-03T10:49:22.178930 | 2018-01-08T12:42:20 | 2018-01-08T12:42:20 | 116,659,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 717 | java | package com.sift.apis.beans;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.annotation.JsonProperty;
@Component
public class BaseWrapper {
@Override
public String toString() {
return "BaseWrapper [responseMessage=" + responseMessage + "]";
}
@JsonProperty("responseMessage")
private ResponseMessage responseMessage;
public BaseWrapper() {}
public BaseWrapper(ResponseMessage responseMessage) {
this.responseMessage = responseMessage;
}
public ResponseMessage getResponseMessage() {
return responseMessage;
}
public void setResponseMessage(ResponseMessage responseMessage) {
this.responseMessage = responseMessage;
}
}
| [
"35219670+flynaut-piyushj@users.noreply.github.com"
] | 35219670+flynaut-piyushj@users.noreply.github.com |
62d038f3d40c5918c33464fa9866a0fdd521940f | 6ffd590dbf461bd5bc68c75ed8357c3bc85a2bea | /dl4j-eclipse/src/deeplearning4j_core/src/test/java/org/deeplearning4j/eval/EvaluationToolsTests.java | ad59c22a1bf0a70afca8dd469d619bff50bc9a65 | [] | no_license | nagyistge/dl4j_for_eclipse | e017fcfd545c879e18f91d36c15d46872fba390f | 8fb1a2d813dd064d7b46e24e8b696c364d84c6b6 | refs/heads/master | 2021-06-14T16:11:23.572374 | 2017-02-13T07:15:41 | 2017-02-13T07:15:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,560 | java | package deeplearning4j_core.src.test.java.org.deeplearning4j.eval;
//import org.deeplearning4j.datasets.iterator.impl.IrisDataSetIterator;
//import org.deeplearning4j.evaluation.EvaluationTools;
//import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
//import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
//import org.deeplearning4j.nn.conf.layers.DenseLayer;
//import org.deeplearning4j.nn.conf.layers.OutputLayer;
//import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
//import org.deeplearning4j.nn.weights.WeightInit;
import java.util.Arrays;
import org.junit.Test;
import org.nd4j.linalg.activations.Activation;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.api.DataSet;
import org.nd4j.linalg.dataset.api.iterator.DataSetIterator;
import org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.lossfunctions.LossFunctions;
import deeplearning4j_core.src.main.java.org.deeplearning4j.datasets.iterator.impl.IrisDataSetIterator;
import deeplearning4j_core.src.main.java.org.deeplearning4j.evaluation.EvaluationTools;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.eval.ROC;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.eval.ROCMultiClass;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.conf.layers.DenseLayer;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.conf.layers.OutputLayer;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import deeplearning4j_nn.src.main.java.org.deeplearning4j.nn.weights.WeightInit;
/**
* Created by Alex on 07/01/2017.
*/
public class EvaluationToolsTests {
@Test
public void testRocHtml() throws Exception {
DataSetIterator iter = new IrisDataSetIterator(150, 150);
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.weightInit(WeightInit.XAVIER)
.list()
.layer(0, new DenseLayer.Builder().nIn(4).nOut(4).activation(Activation.TANH).build())
.layer(1, new OutputLayer.Builder().nIn(4).nOut(2).activation(Activation.SOFTMAX).lossFunction(LossFunctions.LossFunction.MCXENT).build())
.build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
NormalizerStandardize ns = new NormalizerStandardize();
DataSet ds = iter.next();
ns.fit(ds);
ns.transform(ds);
INDArray newLabels = Nd4j.create(150,2);
newLabels.getColumn(0).assign(ds.getLabels().getColumn(0));
newLabels.getColumn(0).addi(ds.getLabels().getColumn(1));
newLabels.getColumn(1).assign(ds.getLabels().getColumn(2));
ds.setLabels(newLabels);
for( int i=0; i<30; i++ ) {
net.fit(ds);
}
ROC roc = new ROC(20);
iter.reset();
INDArray f = ds.getFeatures();
INDArray l = ds.getLabels();
INDArray out = net.output(f);
roc.eval(l, out);
String str = EvaluationTools.rocChartToHtml(roc);
// System.out.println(str);
}
@Test
public void testRocMultiToHtml() throws Exception {
DataSetIterator iter = new IrisDataSetIterator(150, 150);
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.weightInit(WeightInit.XAVIER)
.list()
.layer(0, new DenseLayer.Builder().nIn(4).nOut(4).activation(Activation.TANH).build())
.layer(1, new OutputLayer.Builder().nIn(4).nOut(3).activation(Activation.SOFTMAX).lossFunction(LossFunctions.LossFunction.MCXENT).build())
.build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
NormalizerStandardize ns = new NormalizerStandardize();
DataSet ds = iter.next();
ns.fit(ds);
ns.transform(ds);
for( int i=0; i<30; i++ ) {
net.fit(ds);
}
ROCMultiClass roc = new ROCMultiClass(20);
iter.reset();
INDArray f = ds.getFeatures();
INDArray l = ds.getLabels();
INDArray out = net.output(f);
roc.eval(l, out);
String str = EvaluationTools.rocChartToHtml(roc, Arrays.asList("setosa", "versicolor", "virginica"));
// System.out.println(str);
}
}
| [
"iamlamd@yahoo.co.jp"
] | iamlamd@yahoo.co.jp |
26b814971110bc6759afa4c8ff54c051d0b0da56 | c44fd536201fd53899d9b95f556cee28070dc4c9 | /src/main/java/com/kiritoh/pedidos/entity/entityProducto.java | 04959a4ccf033e7e263e8441d214eeed82405b50 | [] | no_license | Kiritoh-Kun/pedido | 2801057617c5a598eef960c510406cd88667e031 | 720d34c0210c6358e11ffb16e99b077f8090c3b4 | refs/heads/master | 2020-04-05T09:24:10.815411 | 2018-11-15T19:36:55 | 2018-11-15T19:36:55 | 156,754,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,795 | java | package com.kiritoh.pedidos.entity;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Entity
public class entityProducto implements Serializable {
@GeneratedValue
@Id
@Column(name ="id")
private int id;
@Column(name ="name")
private String name;
@Column(name = "price")
private int price;
@JsonBackReference
@ManyToMany
@JoinTable(
name="producto_categoria",
joinColumns = @JoinColumn( name ="producto_id"),
inverseJoinColumns = @JoinColumn ( name = "categoria_id")
)
List<entityCategoria> categorias =new ArrayList<>();
public entityProducto(){
}
public List<entityCategoria> getCategorias() {
return categorias;
}
public void setCategorias(List<entityCategoria> categorias) {
this.categorias = categorias;
}
public entityProducto(String name, int price) {
this.name = name;
this.price = price;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof entityProducto)) return false;
entityProducto that = (entityProducto) o;
return id == that.id;
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
| [
"carlos.dossantos.646@gmail.com"
] | carlos.dossantos.646@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.