blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a6ea10f95dc69c8959324647a14843cd9d7d961f | 5796cdd5895caba28186887817dbdcb8371e192d | /src/main/java/br/com/ama/cdp/Estado.java | d983e38e90458d013c005cacd2f221a4c726ce27 | [] | no_license | tarcisiobruni/AMA_projeto_integrado | c785fabe2256c49fceae7c0f8505fff53d514c67 | 6e6dfe8fdc7f222f178d0b5e843a0f1b56d1ed53 | refs/heads/master | 2020-03-18T23:51:40.807668 | 2018-05-29T11:37:08 | 2018-05-29T11:37:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | package br.com.ama.cdp;
public class Estado {
private int id;
private String nome;
//Construtor
public Estado(int _id, String _nome) {
this.id = _id;
this.nome = _nome;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
| [
"[email protected]"
] | |
09be07dde157ad64b7228618a8dc89db34381888 | 45ec89f5bbf3699f591516710757726d6417c308 | /android/app/src/main/java/com/xsxt/MainApplication.java | 7ecac9c35ee62e7a84f4c5940e9c06657b00b224 | [] | no_license | yrjwcharm/RNSalesSystem | 5bb586d1f567440183041281d8ab21f502266b30 | 0d8b31c69aea30fc76775cf2c578223445662703 | refs/heads/master | 2022-10-26T07:48:28.407169 | 2019-12-04T09:50:03 | 2019-12-04T09:50:03 | 225,828,133 | 0 | 0 | null | 2021-07-20T19:35:41 | 2019-12-04T09:25:21 | JavaScript | UTF-8 | Java | false | false | 2,874 | java | package com.xsxt;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.beefe.picker.PickerViewPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.rnfs.RNFSPackage;
import com.reactlibrary.RNReactNativeDocViewerPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import org.wonday.pdf.RCTPdfView;
import com.swmansion.reanimated.ReanimatedPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.microsoft.codepush.react.CodePush;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.avishayil.rnrestart.ReactNativeRestartPackage;
import com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new PickerViewPackage(),
new SplashScreenReactPackage(),
new RNFSPackage(),
new RNReactNativeDocViewerPackage(),
new RNFetchBlobPackage(),
new RCTPdfView(),
new ExReactPackage(),
new ReanimatedPackage(),
new AsyncStoragePackage(),
new RNGestureHandlerPackage(),
new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG),
new PickerPackage(),
new LinearGradientPackage(),
new ReactNativeRestartPackage(),
new ReactNativeExceptionHandlerPackage(),
new RNDeviceInfo()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"[email protected]"
] | |
d9a656fe262b5b9c7e1e2fe90d8dbe77968ce48c | 7b17844e4f737e2fbcc96edfc9261e3048d9833a | /app/src/main/java/com/the/dionisio/apk/client/model/view/maskForField/MaskForField.java | ff95da38ad89bd8220a1644ae4bfba5a50c9c2d3 | [] | no_license | igor-nm/the-dionisio-android | 04353290f89c280d6da44f83884dadc5bb9ba461 | 9be2609236573c1256c3d28753341318215734da | refs/heads/master | 2021-07-02T01:33:06.082440 | 2017-09-19T12:41:56 | 2017-09-19T12:41:56 | 104,072,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,237 | java | package com.the.dionisio.apk.client.model.view.maskForField;
/**
* Created by igorm on 06/05/2017.
*/
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import java.util.HashSet;
import java.util.Set;
public class MaskForField implements TextWatcher
{
private String mMask;
private EditText mEditText;
private Set<String> symbolMask = new HashSet<>();
private boolean isUpdating;
private String old = "";
public MaskForField(String mask, EditText editText)
{
mMask = mask;
mEditText = editText;
initSymbolMask();
}
private void initSymbolMask()
{
for (int i=0; i < mMask.length(); i++)
{
char ch = mMask.charAt(i);
if (ch != '#')
symbolMask.add(String.valueOf(ch));
}
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count)
{
String str = unmask(s.toString(), symbolMask);
String mascara = "";
if (isUpdating)
{
old = str;
isUpdating = false;
return;
}
if(str.length() > old.length())
mascara = mask(mMask,str);
else
mascara = s.toString();
isUpdating = true;
mEditText.setText(mascara);
mEditText.setSelection(mascara.length());
}
public static String unmask(String s, Set<String> replaceSymbols) {
for (String symbol : replaceSymbols)
s = s.replaceAll("["+symbol+"]","");
return s;
}
public static String mask(String format, String text){
String maskedText="";
int i =0;
for (char m : format.toCharArray()) {
if (m != '#') {
maskedText += m;
continue;
}
try {
maskedText += text.charAt(i);
} catch (Exception e) {
break;
}
i++;
}
return maskedText;
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after)
{
}
@Override
public void afterTextChanged(Editable s)
{
}
} | [
"[email protected]"
] | |
74e6b8248aeb83687f8895af75ca416a50cc6ac2 | 0ecf986522bb97bf559f07827dc3d8c691cc9af4 | /src/main/java/com/mentor/budget/controller/SpendController.java | dd6fcb14ba23e239a9b5188c0a19102b7e1046bc | [] | no_license | santoshmalie/springboot-shutdown-with-time | cd7578bd917b5d9d96961188063aa3757d531a4e | cb3d996d11e0bc84dcc20686830a57e4f8b2f624 | refs/heads/master | 2022-11-27T20:31:21.738214 | 2020-07-28T05:21:41 | 2020-07-28T05:21:41 | 283,125,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,271 | java | package com.mentor.budget.controller;
import com.mentor.budget.model.SpendRequest;
import com.mentor.budget.model.SpendResponse;
import com.mentor.budget.service.SpendService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Slf4j
@RestController
@RequestMapping("/budget")
/**
* SpendController :: this class intercepts the /budget URL request endpoint.
*/
public class SpendController {
@Autowired
private SpendService spendService;
@PostMapping("/spend")
/**
* This method approves/denies the spend request
*/
public ResponseEntity<SpendResponse> processSpendRequest(@Valid @RequestBody SpendRequest spendRequest) throws Exception {
log.debug("Processing spend request with :: " + spendRequest);
return new ResponseEntity<>(spendService.processSpendRequest(spendRequest), HttpStatus.OK);
}
}
| [
"[email protected]"
] | |
92895b9b08013f9a036fbe9fbe0f694ddbcd611a | a3c5f647035760207e2c38a6b7b59def00f4b952 | /app/src/main/java/com/smallgroup/swapbook/presentation/view/activities/AppActivity.java | 3013b99896232067e6545a4ce6eee53cc2c05d4e | [] | no_license | sorphel/SwapBook | cd059532e2f209b189477e3c2ea2c2a367d9f31a | 819b873d6a8abe78ce086eb3e117974474cc60aa | refs/heads/master | 2021-05-25T15:31:28.761282 | 2020-09-22T16:48:28 | 2020-09-22T16:48:28 | 253,809,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,249 | java | package com.smallgroup.swapbook.presentation.view.activities;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.smallgroup.swapbook.R;
public class AppActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app);
getSupportActionBar().hide();
BottomNavigationView navView = findViewById(R.id.nav_view);
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_shelve, R.id.navigation_search, R.id.navigation_notifications, R.id.navigation_profile)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
}
}
| [
"[email protected]"
] | |
92e2e7b73001ff567dffa15a8a90c15dcb827246 | 94b86eb2e0dd35bb7f817fe74031f9923aaeec75 | /textGetDemo/src/main/java/com/example/tool/MyOpenSQHelper.java | de15e7ff7ba1725929c1a6e296d7dbe933c49c3a | [] | no_license | zhangjingfeng520/test | 93a79e70592c835c881c2c000b10aa2ebf1d2fb2 | a5e4dadacee6ea63d6f262f35df4ff0852ba8395 | refs/heads/master | 2021-09-03T19:08:40.611317 | 2018-01-11T09:23:49 | 2018-01-11T09:23:49 | 111,866,571 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,516 | java | package com.example.tool;
import java.util.ArrayList;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.example.domain.Record;
/**
*
* @author DYL
*
*/
public class MyOpenSQHelper {
/*
* 替换字符串中的单引号
*/
String parse(String str) {
if (str != null) {
if (str.indexOf("'") != -1)
return str.replaceAll("'", "''");
}
return str;
}
private SQLiteDatabase sdb;
private final MyOpenHelper mHelper;
private static final String DB_NAME = "MyRead.db";
private static final int DATABASE_VERSION = 3;// 数据库版本 如果更改了安装的时候会执行
// onUpgrade方法
public MyOpenSQHelper(Context context) {
mHelper = new MyOpenHelper(context.getApplicationContext(), DB_NAME,
null, DATABASE_VERSION);
open();
}
private void open() {
try {
sdb = mHelper.getWritableDatabase();
} catch (Exception e) {
e.printStackTrace();
return;
}
}
public void close() {
if (mHelper != null) {
mHelper.close();
}
if (sdb != null) {
sdb.close();
sdb = null;
}
}
static final String TAG = "MyOpenSQHelper";
/**
* 得到自增ID 的最大值
*/
public int getMaxId() {
int maxId = 0;
String sql = "select max(_id) from books";
Cursor cursor = sdb.rawQuery(sql, null);
if (cursor != null) {
cursor.moveToFirst();
maxId = cursor.getInt(0);
cursor.close();
}
return maxId;
}
/*
* 得到数据库记录总数
*/
public long getDataCount() {
long count = 0l;
Cursor cursor = sdb.rawQuery("select count(*) from books", null);
if (cursor != null) {
cursor.moveToFirst();
count = cursor.getLong(0);
cursor.close();
}
return count;
}
public void insertData(Record info) {
String instr = "insert into books (bookname,autor,url,icon,path) values("
+ "'"
+ parse(info.name)
+ "'"
+ ","
+ "'"
+ parse(info.autor)
+ "'"
+ ","
+ "'"
+ parse(info.url)
+ "'"
+ ","
+ "'"
+ parse(info.src)
+ "'"
+ ","
+ "'"
+ parse(info.path)
+ "'"
+ ")";
try {
sdb.execSQL(instr);
} catch (Exception e) {
}
}
// 查询数据
// 搞了半天是查询的问题,在这里我犯了很低级的错误。
public ArrayList<Record> inquiryData() {
ArrayList<Record> list = new ArrayList<Record>();
if (sdb != null) {
Cursor cursor = sdb.query("books", null, null, null, null, null,
null);
quiry(list, cursor);
} else
Log.e(TAG, "null SQLiteBase");
return list;
}
public void quiry(ArrayList<Record> list, Cursor cursor) {
if (cursor == null)
Log.e(TAG, "cursor is null");
else if (cursor.moveToFirst()) {
do {
Record info = new Record(); // 注意这句不要放在do{}while之外
String bookname = cursor.getString(cursor
.getColumnIndex("bookname"));
String autor = cursor.getString(cursor.getColumnIndex("autor"));
String icon = cursor.getString(cursor.getColumnIndex("icon"));
String url = cursor.getString(cursor.getColumnIndex("url"));
String path = cursor.getString(cursor.getColumnIndex("path"));
info.name = bookname;
info.autor = autor;
info.src = icon;
info.url = url;
info.path = path;
list.add(info);
} while (cursor.moveToNext());
}
if (cursor != null)
cursor.close();
}
// 删除记录
public int deleteData(String where, String[] whereAgs) {
return sdb.delete("books", where, whereAgs);
}
private static final class MyOpenHelper extends SQLiteOpenHelper {
private static final String DATABASE_CREATE = "create table books ("
+ "bookname text primary key, autor text not null, "
+ "icon text not null," + "url text not null,"
+ "path text not null" + ")";
private static final String DATABASE_DELETE = "DROP TABLE IF EXISTS history";
public MyOpenHelper(Context context, String name,
CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w("onUpgrade", "Upgrading database from version " + oldVersion
+ " to " + newVersion + ", which will destroy all old data");
db.execSQL(DATABASE_DELETE);
onCreate(db);
}
}
}
| [
"[email protected]"
] | |
5d46cee6496fa9ce3047ff06b619fe2c80425ba9 | fa3593ab382e9d3cedb702e29da91301446996a4 | /mahout/core/src/main/java/org/apache/mahout/classifier/df/data/conditions/Lesser.java | 4e49eb791464ae12dc7c32acaf47833d831f55a6 | [
"MIT",
"BSD-3-Clause",
"CPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-indiana-extreme",
"LicenseRef-scancode-mit-old-style",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Programming-Systems-Lab/kabu | bbf75615779b1205f2951e162e99d546312900da | 652815e7b003d9899d68807632207147a1fd743f | refs/heads/master | 2022-03-09T06:06:16.972245 | 2020-02-27T00:20:39 | 2020-02-27T00:20:39 | 15,849,390 | 0 | 1 | MIT | 2022-02-26T00:50:52 | 2014-01-12T19:48:03 | Java | UTF-8 | Java | false | false | 1,302 | 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.mahout.classifier.df.data.conditions;
import org.apache.mahout.classifier.df.data.Instance;
/**
* True if a given attribute has a value "lesser" than a given value
*/
public class Lesser extends Condition {
private final int attr;
private final double value;
public Lesser(int attr, double value) {
this.attr = attr;
this.value = value;
}
@Override
public boolean isTrueFor(Instance instance) {
return instance.get(attr) < value;
}
}
| [
"[email protected]"
] | |
75f306156009ff0e0888ed565ffad7286aea29d8 | aaea3945b106a3f4bd5c6ceb692ea3e1a799ff20 | /src/main/java/ch/furthermore/gae/proof/crypto/rsa/RSAKeyGenerator.java | a9d6fcefb3551c205b32ebbf7df20349a052d7e9 | [
"Apache-2.0"
] | permissive | chtz/proof | a9bbf62b9b6a5ff542946f575f9da352635d3dc5 | 28a03e7ecaba64a8e080dd53b22e39aef805ec88 | refs/heads/master | 2021-01-01T15:53:48.566932 | 2017-08-20T19:52:29 | 2017-08-20T19:52:29 | 97,727,293 | 0 | 0 | null | 2017-07-19T15:17:38 | 2017-07-19T14:39:44 | Java | UTF-8 | Java | false | false | 1,040 | java | package ch.furthermore.gae.proof.crypto.rsa;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public class RSAKeyGenerator {
private static final int RSA_KEY_SIZE = 4096;
private static final String SHA1PRNG = "SHA1PRNG";
private static final String RSA = "RSA";
public static KeyPair createKeyPair() {
try {
KeyPairGenerator keyPairGenerator = keyPairGenerator(RSA);
keyPairGenerator.initialize(RSA_KEY_SIZE, secureRandom(SHA1PRNG));
return keyPairGenerator.generateKeyPair();
}
catch (Exception e) {
throw new RuntimeException("crypto: cannot create key", e);
}
}
private static KeyPairGenerator keyPairGenerator(String keyAlgorithm) throws NoSuchAlgorithmException {
return KeyPairGenerator.getInstance(keyAlgorithm);
}
private static SecureRandom secureRandom(String secRandomAlgorithm) throws NoSuchAlgorithmException {
return SecureRandom.getInstance(secRandomAlgorithm);
}
}
| [
"[email protected]"
] | |
1a56e7b61581adfcef652d764890213ee8de9c72 | 3002d3954d2a05c5ee360831dc4a4d8cd62e76fa | /vxms-rest/src/main/java/org/jacpfx/vxms/rest/interfaces/blocking/ExecuteEventbusStringCall.java | 372ae48b84c4b62bd600ed710d3ccb817891ca55 | [
"Apache-2.0"
] | permissive | hyowong/vxms | 1f2fa0e3cf362142ef5d69a8b2ec636ebbea6858 | e13d17b86636b35f7f47e1366dfc3c0506a3d60d | refs/heads/master | 2020-07-27T00:28:29.644251 | 2018-10-31T21:00:01 | 2018-10-31T21:00:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,720 | java | /*
* Copyright [2018] [Andy Moncsek]
*
* 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.jacpfx.vxms.rest.interfaces.blocking;
import io.vertx.ext.web.RoutingContext;
import java.util.Map;
import java.util.function.Consumer;
import org.jacpfx.vxms.common.VxmsShared;
import org.jacpfx.vxms.common.encoder.Encoder;
import org.jacpfx.vxms.common.throwable.ThrowableFunction;
/**
* Created by Andy Moncsek on 21.03.16. Typed functional interface called on event-bus response. The
* execution will be handled as blocking code.
*/
@FunctionalInterface
public interface ExecuteEventbusStringCall {
/**
* Execute chain when event-bus response handler is executed
*
* @param vxmsShared the vxmsShared instance, containing the Vertx instance and other shared
* objects per instance
* @param failure the failure thrown while task execution or messaging
* @param errorMethodHandler the error-method handler
* @param context the vertx routing context
* @param headers the headers to pass to the response
* @param encoder the encoder to encode your objects
* @param errorHandler the error handler
* @param onFailureRespond the consumer that takes a Future with the alternate response value in
* case of failure
* @param httpStatusCode the http status code to set for response
* @param httpErrorCode the http error code to set in case of failure handling
* @param retryCount the amount of retries before failure execution is triggered
* @param timeout the delay time in ms between an execution error and the retry
* @param delay the delay time in ms between an execution error and the retry
* @param circuitBreakerTimeout the amount of time before the circuit breaker closed again
*/
void execute(
VxmsShared vxmsShared,
Throwable failure,
Consumer<Throwable> errorMethodHandler,
RoutingContext context,
Map<String, String> headers,
Encoder encoder,
Consumer<Throwable> errorHandler,
ThrowableFunction<Throwable, String> onFailureRespond,
int httpStatusCode,
int httpErrorCode,
int retryCount,
long timeout,
long delay,
long circuitBreakerTimeout);
}
| [
"[email protected]"
] | |
7e7e8de81f2d5d01ba3a838834ffef00f1d86a73 | 1c931494fafca7505a7df68d19542ba4ef05cce2 | /src/main/java/com/liuyun/site/dao/jdbc/mapper/UserinfoMapper.java | 16145bc6f2aaaaf86c56a7193c130a8378a49388 | [] | no_license | liuyun073/wzd | 3cc9ccbfdda2c5f93d64af86681dcd1870759bb5 | 24497c148040bada8ed48a29c7079ae347787cc9 | refs/heads/master | 2020-05-31T21:12:25.874657 | 2014-09-19T13:47:26 | 2014-09-19T13:47:26 | 24,152,224 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package com.liuyun.site.dao.jdbc.mapper;
import com.liuyun.site.dao.jdbc.mapper.base.AbstractUserinfoMapper;
import com.liuyun.site.domain.Userinfo;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
public class UserinfoMapper extends AbstractUserinfoMapper implements
RowMapper<Userinfo> {
public Userinfo mapRow(ResultSet rs, int rowNum) throws SQLException {
Userinfo info = new Userinfo();
setProperty(rs, info);
return info;
}
} | [
"[email protected]"
] | |
c4b7b407f586f333d2d6df25af2197d464cd2833 | 5b82e2f7c720c49dff236970aacd610e7c41a077 | /QueryReformulation-master 2/data/processed/IViewerObservable.java | 80143cad5760eb9b23cdb471603f9b7844343c5e | [] | no_license | shy942/EGITrepoOnlineVersion | 4b157da0f76dc5bbf179437242d2224d782dd267 | f88fb20497dcc30ff1add5fe359cbca772142b09 | refs/heads/master | 2021-01-20T16:04:23.509863 | 2016-07-21T20:43:22 | 2016-07-21T20:43:22 | 63,737,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | /***/
package org.eclipse.jface.databinding.viewers;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.jface.viewers.Viewer;
/**
* {@link IObservable} observing a JFace Viewer.
*
* @since 1.2
*
*/
public interface IViewerObservable extends IObservable {
/**
* Returns the underlying viewer for this observable.
*
* @return the viewer.
*/
public Viewer getViewer();
}
| [
"[email protected]"
] | |
74b693d7ded133c6fcc9bbc10f57237f110242ee | 977a47a716021433010f23db61371dc4e49f56ea | /onepagediff/src/org/outerj/daisy/diff/html/modification/ModificationType.java | 17f2ef728dd797e0de920fcb4f447f539eea528f | [] | no_license | bhochhi/Sandbox | 22aa7eb44712bfe7f0bcd8ca341384249fd1ef9a | 6edd957f6706482f9a7ce60cd136243f9e3e2604 | refs/heads/master | 2021-01-17T13:34:59.826222 | 2017-01-30T04:05:39 | 2017-01-30T04:05:39 | 1,857,217 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | /*
* Copyright 2007 Guy Van den Broeck
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.outerj.daisy.diff.html.modification;
public enum ModificationType {
CHANGED {
@Override
public String toString() {
return "changed";
}
},
REMOVED {
@Override
public String toString() {
return "removed";
}
},
ADDED {
@Override
public String toString() {
return "added";
}
},
NONE {
@Override
public String toString() {
return "none";
}
};
}
| [
"[email protected]"
] | |
fb1a0eaa32000088e61cc86a5f0b9c885ac6ec94 | 2fa0ffff3c8c023688754e71d0c820c586dc107f | /zupapi/src/main/java/br/com/zup/zupapi/repository/EnderecoRepository.java | 6a520bd68c491d46989a3fa1d6e8280b0619e007 | [] | no_license | VictorJuzwiak/Processo-Zup | ae03360b89582e6208c32d9deb7b38113ada72b7 | e4c2396c7061755f49d31b0e6b3b144309a93f74 | refs/heads/master | 2023-04-17T12:27:07.731413 | 2021-04-30T01:03:23 | 2021-04-30T01:03:23 | 362,979,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package br.com.zup.zupapi.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import br.com.zup.zupapi.modelo.Endereco;
public interface EnderecoRepository extends JpaRepository<Endereco, Long> {
List<Endereco> findByUsuarioId(Long idUsuario);
}
| [
"[email protected]"
] | |
e6a8e67146d171359496dd6963bd180eb8df6f06 | 8268d4dc2291d4a913964406fa0762e00f2e453e | /src/main/java/com/navtech/dao/StudentDAO.java | 996383c6a826634cf8582ee4ba66e6401cfb9010 | [] | no_license | JainNaveen94/Spring-Hiberbnate-Practise-Project | a37b159ba929b8602076ed26b0b1bd5bf8b06736 | f09bc50481d71f0a1c0e96afb9275d7a474ebe5f | refs/heads/master | 2021-01-03T01:22:10.978082 | 2020-02-14T20:35:18 | 2020-02-14T20:35:18 | 239,853,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.navtech.dao;
import java.util.List;
import com.navtech.models.Student;
public interface StudentDAO {
Student addStudent(Student student);
List<Student> getAllTheStudents();
boolean updateStudent(Student student);
}
| [
"[email protected]"
] | |
0245fb11d71d759763d41e54aa6aaf08dfb3c5ee | 6ef5efec12852cc40e4f42b186e4ee1555a3f46a | /app/src/main/java/com/hackerfj/loansupermarket/model/ContactsInfo.java | 733baa231ee8d2cfebffeb336428345411c4afed | [] | no_license | CQ173/LoanSupermarket | b3dd62bf458509c90153a796ac6678a6877d3ea7 | cb7cc5d85cd81320e33fbb842a3b6e5a7823e4f1 | refs/heads/master | 2020-04-04T01:47:35.182264 | 2018-11-01T07:25:13 | 2018-11-01T07:25:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.hackerfj.loansupermarket.model;
public class ContactsInfo {
private String name; //联系人姓名
private String telPhone; //电话号码
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelPhone() {
return telPhone;
}
public void setTelPhone(String telPhone) {
this.telPhone = telPhone;
}
public ContactsInfo() {
}
public ContactsInfo(String name, String telPhone) {
this.name = name;
this.telPhone = telPhone;
}
}
| [
"[email protected]"
] | |
5d6c426ee945729d71ab9af76d520b4f7af5b7ed | 1eba7206a7a53bf1f8e501ac2017c18e6937d7fd | /Project5/Car.java | eedce18d7698da048272cc536909c83617a98e03 | [] | no_license | vincentcvr6/JAVA-I | ed220472fb26148570793b7b6ffbdf42d16b194a | dcb140d6657497ce5727aa2b69d2fa0484277886 | refs/heads/master | 2020-05-18T21:48:06.798324 | 2019-05-06T22:40:44 | 2019-05-06T22:40:44 | 184,672,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,569 | java | public class Car {
/*
* This program defines a class named Car to store information about a car
*/
// variables of the class
private String model; //the type of the car
private int location; //the location of the car
private int currentSpeed; //the current speed of the car
private boolean movingForward; //add or subtract the current speed of the car
private int maxSpeed; //the max speed of the car
private boolean win=false; //the status of winning
private boolean crashed=false; //the status of crashed
public Car(String model, int location, int maxSpeed) //the default constructor that takes three
{
this.model = model;
this.maxSpeed = maxSpeed;
this.location = location;
movingForward = true;
currentSpeed = 0;
}
public Car(String model, int maxSpeed) //the constructor that takes only two parameters
{
this.model = model;
this.maxSpeed = maxSpeed;
location = 0;
movingForward = true;
currentSpeed = 0;
}
public String getModel() //the accessor method to return model
{
return model;
}
public boolean getDirection() //the accessor method to return movingForward
{
return movingForward;
}
public int getLocation() //the accessor method to return location
{
return location;
}
public int getSpeed() //the accessor method to return current speed
{
return currentSpeed;
}
public boolean getWin() //the accessor method to return the status of winning
{
return win;
}
public void setWin(boolean win) //the mutator method to set the status of winning
{
this.win=win;
}
public boolean getCrashed() //the accessor method to return the status of crashed
{
return crashed;
}
public void setCrashed(boolean crashed) //the mutator method to set the status of crashed
{
this.crashed=crashed;
}
public void go() //set the currentSpeed of the object to be the object’s maxSpeed
{
currentSpeed = maxSpeed;
}
public void stop() //set the currentSpeed of the Car object to be 0
{
currentSpeed = 0;
}
public void turnAround()
{
movingForward = !movingForward; //change the boolean variable movingForward
}
public void move() //the move method to change the location property according to direction
{
if(movingForward)
location += currentSpeed;
else
location -= currentSpeed;
}
public String toString() //the method toString() which return a string representation of a Car object
{
if(movingForward)
{
if(currentSpeed>0)
return(model+" Located at: "+location+", facing forward and moving at "+currentSpeed+" speed");
else
return(model+" Located at: "+location+", facing forwards, not moving");
}
else
{
if(currentSpeed>0)
return(model+" Located at: "+location+", facing backward and moving at "+currentSpeed+" speed");
else
return(model+" Located at: "+location+", facing backward, not moving");
}
}
public void accelerate() //the method to increase speed
{
if(currentSpeed == maxSpeed);
else
currentSpeed++;
}
public void brake() //the method to decrease speed
{
if(currentSpeed == 0);
else
currentSpeed--;
}
public void changeTo(Car another) //the method to swap two objects
{
this.model = another.model;
this.maxSpeed = another.maxSpeed;
this.location = another.location;
this.movingForward = another.movingForward;
this.currentSpeed = another.currentSpeed;
}
}
| [
"[email protected]"
] | |
73efc686d0ded8a8041c823918b741c125318a15 | 7c01f1af40e5af0cd500d9f0c263861dc7daaa99 | /code/src/test/wsdl/SchemaTest.java | d92e343847c921a577456f695a1a98ece35cd22a | [] | no_license | peterconair/wsssoapbox | aad75395a7508bd63303ba867706a5147284bec6 | ad8fd84457e096641d21552a07384ff9d6a5f24f | refs/heads/master | 2020-05-31T02:51:39.546330 | 2016-10-10T10:58:39 | 2016-10-10T10:58:39 | 3,654,871 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,020 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package wsdl;
import org.ow2.easywsdl.schema.api.Attribute;
import org.ow2.easywsdl.schema.api.Restriction;
import java.util.ArrayList;
import org.wsssoapbox.bean.model.soap.SoapParameterBean;
import org.ow2.easywsdl.schema.api.SimpleType;
import org.wsssoapbox.soap.support.SoapConstants;
import java.util.List;
import org.ow2.easywsdl.schema.api.Sequence;
import org.ow2.easywsdl.schema.api.Choice;
import org.ow2.easywsdl.schema.api.All;
import org.ow2.easywsdl.schema.api.ComplexType;
import org.ow2.easywsdl.wsdl.api.Part;
import org.ow2.easywsdl.wsdl.api.Input;
import org.ow2.easywsdl.schema.api.Element;
import javax.xml.namespace.QName;
import org.ow2.easywsdl.schema.api.Type;
import java.util.Iterator;
import org.ow2.easywsdl.schema.api.XmlException;
import org.ow2.easywsdl.wsdl.api.Description;
import org.ow2.easywsdl.schema.api.Schema;
import javax.xml.bind.JAXBElement;
import org.ow2.easywsdl.schema.org.w3._2001.xmlschema.ExplicitGroup;
import org.ow2.easywsdl.schema.org.w3._2001.xmlschema.LocalComplexType;
import org.ow2.easywsdl.schema.org.w3._2001.xmlschema.TopLevelElement;
import org.wsssoapbox.datasource.wsdl.WSDLDataSource;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Peter
*/
public class SchemaTest {
private static Description desc;
private static String url;
private static WSDLDataSource wsdlDocumentDataSource;
TopLevelElement topLevel;
LocalComplexType localComplexType;
ExplicitGroup explicitGroup;
JAXBElement jaxbElement;
Schema schema;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
wsdlDocumentDataSource = new WSDLDataSource(WSDLList.url);
desc = WSDLDataSource.getDesc(WSDLList.url);
}
public SchemaTest() {
}
// @Test
public void testGetSchemas() throws XmlException {
Iterator<Schema> itSchemas = desc.getTypes().getSchemas().iterator();
System.out.println("***************** Schemas testGetSchemas()**********************");
while (itSchemas.hasNext()) {
Schema s = itSchemas.next();
System.out.println(" Namespaces : " + s.getAllNamespaces());
System.out.println(" Attribute Form Default : " + s.getAttributeFormDefault());
System.out.println(" Attributes : " + s.getAttributes());
System.out.println(" BlockDefault : " + s.getBlockDefault());
System.out.println(" Documentation : " + s.getDocumentation());
System.out.println(" Element Form Default : " + s.getElementFormDefault());
System.out.println(" Elements : " + s.getElements());
System.out.println(" Final Default : " + s.getFinalDefault());
System.out.println(" Imports : " + s.getImports());
System.out.println(" Includes : " + s.getIncludes());
System.out.println(" Namespaces : " + s.getLang());
System.out.println(" Lang : " + s.getOtherAttributes());
System.out.println(" Target Namespace : " + s.getTargetNamespace());
System.out.println(" Types : " + s.getTypes());
System.out.println(" Version : " + s.getVersion());
}
}
// @Test
public void testGetSchemasTypes() throws XmlException {
Iterator<Schema> itSchema = desc.getTypes().getSchemas().iterator();
while (itSchema.hasNext()) {
Schema schemas = itSchema.next();
Iterator<Type> itType = schemas.getTypes().iterator();
while (itType.hasNext()) {
Type type = itType.next();
System.out.println("Types :" + type.getQName());
System.out.println("Element :");
schemas.getElement(type.getQName());
}
}
}
@Test
public void testGetParameter() throws XmlException {
QName bindingQName = desc.getBindings().get(0).getQName();
QName interfaceQName = desc.getBindings().get(0).getInterface().getQName();
QName operationQName = desc.getBindings().get(0).getBindingOperations().get(0).getQName();
testFullLoop(desc, bindingQName, interfaceQName, operationQName);
}
private void testFullLoop(Description desc, QName bindingQName, QName interfaceQName, QName operationQName)
throws XmlException {
List<SoapParameterBean> parameters = new ArrayList<SoapParameterBean>();
String operationName = operationQName.getLocalPart();
String soapVersion = desc.getBinding(bindingQName).getVersion();
String soapAction = desc.getBinding(bindingQName).getBindingOperation(operationName).getSoapAction();
System.out.println("wsld url : " + desc.getDocumentBaseURI());
System.out.println("Interface QName : " + interfaceQName);
System.out.println("Operation QName : " + operationQName);
System.out.println("Operation Name : " + operationName);
System.out.println("Soap Vesion : " + soapVersion);
System.out.println("Soap Action : " + soapAction);
// get Element correspond that Operation and Interface
Input input = desc.getInterface(interfaceQName).getOperation(operationQName).getInput();
Iterator<Part> itoratorParts = input.getParts().iterator();
while (itoratorParts.hasNext()) {
Part part = itoratorParts.next();
System.out.println("Element : " + part.getElement());
System.out.println("Part QName : " + part.getPartQName());
System.out.println("Type : " + part.getType());
System.out.println("Other Attributes : " + part.getOtherAttributes());
System.out.println("Other Elements : " + part.getOtherElements());
System.out.println("Schema Size : " + desc.getTypes().getSchemas().size() + " Scheamas");
Element element = null;
Type type = null;
QName inputPartQName = part.getType().getQName();
System.out.println("Input Part QName : " + inputPartQName);
System.out.println("Schema Size : " + desc.getTypes().getSchemas().size() + " Scheamas");
// find elements reponsible with Input of opration
Iterator<Schema> itSchemas = desc.getTypes().getSchemas().iterator();
while (itSchemas.hasNext()) {
Schema schema = itSchemas.next();
System.out.println("Schema Elements : " + schema.getElements());
System.out.println("Schema Types : " + schema.getTypes());
element = schema.getElement(inputPartQName);
type = schema.getType(inputPartQName);
Type paramType = null;
if (element != null) {
System.out.println("Input Element QName for Input : " + element.getQName());
System.out.println("Input Element Min for Input : " + element.getMinOccurs());
System.out.println("Input Element Max for Input : " + element.getMaxOccurs());
System.out.println("Input Element Form for Input : " + element.getForm());
System.out.println("Input Element Ref for Input : " + element.getRef());
System.out.println("Input Element getOtherAttributes for Input : " + element.getOtherAttributes());
System.out.println("***************************************************");
System.out.println("Element Type : " + element.getType());
System.out.println("***************************************************");
paramType = element.getType();
}
if (type != null) {
System.out.println("Type QName: " + type.getQName());
paramType = type;
}
if (paramType instanceof ComplexType) {
final ComplexType elementComplexType = (ComplexType) paramType;
final All elementALL = elementComplexType.getAll();
final Choice elementChoice = elementComplexType.getChoice();
final Sequence elementSeq = elementComplexType.getSequence();
final List<Attribute> attributes = elementComplexType.getAttributes();
System.out.println("******: " + "ComplexType ************** ");
System.out.println("Complex Type :" + elementComplexType);
System.out.println("All Type :" + elementALL);
System.out.println("Choice Type :" + elementChoice);
System.out.println("Sequence :" + elementSeq);
if (elementSeq instanceof Sequence) {
final List<Element> elementSeqList = elementSeq.getElements();
System.out.println("***********Element Sequence ************** ");
System.out.println("Amount of Element :" + elementSeqList.size());
Iterator<Element> iTElemnt = elementSeqList.iterator();
while (iTElemnt.hasNext()) {
Element e = iTElemnt.next();
int minOccure = SoapConstants.PARA_DEFAULT_MIN_OCCURE;
String defaultValue = SoapConstants.PARA_DEFAULT_VALUE;
String maxOccure = SoapConstants.PARA_DEFAULT_MAX_OCCURE;
String seqType = "";
String name = "";
String paraNamespaceURI = "";
String paralocalPart = "";
String paraPrefix = "";
Type eType = e.getType();
if (e.getType() != null && e.getQName() != null) {
if (eType instanceof SimpleType) {
System.out.println("**************************" + "Simple Type ************** ");
minOccure = e.getMinOccurs();
maxOccure = e.getMaxOccurs();
seqType = e.getType().getQName().getLocalPart();
name = e.getQName().getLocalPart();
paraNamespaceURI = e.getQName().getNamespaceURI();
paralocalPart = e.getQName().getLocalPart();
paraPrefix = e.getQName().getPrefix();
}
if (eType instanceof ComplexType) {
System.out.println("**************************" + "Complex Type ************** ");
final ComplexType subElementComplexType = (ComplexType) eType;
final Sequence subElementSequence = subElementComplexType.getSequence();
Iterator<Element> it = subElementSequence.getElements().iterator();
while (it.hasNext()) {
Element et = it.next();
minOccure = et.getMinOccurs();
maxOccure = et.getMaxOccurs();
seqType = et.getType().getQName().getLocalPart();
name = et.getQName().getLocalPart();
paraNamespaceURI = et.getQName().getNamespaceURI();
paralocalPart = et.getQName().getLocalPart();
paraPrefix = et.getQName().getPrefix();
}
}
}
System.out.println(" ************************************************");
System.out.println(" Element Name :" + name);
System.out.println(" Element Type :" + seqType + "");
System.out.println(" Element localPart :" + paralocalPart);
System.out.println(" Element Prefix :" + paraPrefix);
System.out.println(" Element Min Occure :" + minOccure);
System.out.println(" Element Max Occure :" + maxOccure);
System.out.println(" Element DefaultValue :" + defaultValue);
System.out.println(" Element paraNamespaceURI :" + paraNamespaceURI);
System.out.println(" Element Other Attributes :" + e.getOtherAttributes());
QName paraQName = new QName(paraNamespaceURI, paralocalPart, paraPrefix);
SoapParameterBean p1 = new SoapParameterBean(name, seqType, minOccure, maxOccure, paraQName,
defaultValue);
parameters.add(p1);
}
}
if (elementALL instanceof All) {
final List<Element> elementAllList = elementALL.getElements();
System.out.println("*********** " + "Element ALL ************** ");
System.out.println("Amount of Element :" + elementAllList.size());
Iterator<Element> iTElemnt = elementAllList.iterator();
while (iTElemnt.hasNext()) {
Element e = iTElemnt.next();
int minOccure = SoapConstants.PARA_DEFAULT_MIN_OCCURE;
String defaultValue = SoapConstants.PARA_DEFAULT_VALUE;
String maxOccure = SoapConstants.PARA_DEFAULT_MAX_OCCURE;
String allType = "";
String name = "";
String paraNamespaceURI = "";
String paralocalPart = "";
String paraPrefix = "";
Type eType = e.getType();
if (e.getType() != null && e.getQName() != null) {
if (eType instanceof SimpleType) {
System.out.println("**************************" + "SimpleType ************** ");
minOccure = e.getMinOccurs();
maxOccure = e.getMaxOccurs();
allType = e.getType().getQName().getLocalPart();
name = e.getQName().getLocalPart();
paraNamespaceURI = e.getQName().getNamespaceURI();
paralocalPart = e.getQName().getLocalPart();
paraPrefix = e.getQName().getPrefix();
}
}
System.out.println(" ************************************************");
System.out.println(" Element Name :" + name);
System.out.println(" Element Type :" + type + "");
System.out.println(" Element localPart :" + paralocalPart);
System.out.println(" Element Prefix :" + paraPrefix);
System.out.println(" Element Min Occure :" + minOccure);
System.out.println(" Element Max Occure :" + maxOccure);
System.out.println(" Element DefaultValue :" + defaultValue);
System.out.println(" Element paraNamespaceURI :" + paraNamespaceURI);
System.out.println(" Element Other Attributes :" + e.getOtherAttributes());
QName paraQName = new QName(paraNamespaceURI, paralocalPart, paraPrefix);
SoapParameterBean param = new SoapParameterBean(name, allType, minOccure, maxOccure, paraQName,
defaultValue);
parameters.add(param);
}
}
if (elementChoice instanceof Choice) {
final List<Element> elementChoiceList = elementChoice.getElements();
System.out.println("*********** " + "Element Choice ************** ");
System.out.println("Amount of Element :" + elementChoiceList.size());
Iterator<Element> iTElemnt = elementChoiceList.iterator();
while (iTElemnt.hasNext()) {
Element e = iTElemnt.next();
int minOccure = SoapConstants.PARA_DEFAULT_MIN_OCCURE;
String defaultValue = SoapConstants.PARA_DEFAULT_VALUE;
String maxOccure = SoapConstants.PARA_DEFAULT_MAX_OCCURE;
String choiceType = "";
String name = "";
String paraNamespaceURI = "";
String paralocalPart = "";
String paraPrefix = "";
Type eType = e.getType();
if (e.getType() != null && e.getQName() != null) {
if (eType instanceof SimpleType) {
System.out.println("**************************" + "SimpleType ************** ");
minOccure = e.getMinOccurs();
maxOccure = e.getMaxOccurs();
choiceType = e.getType().getQName().getLocalPart();
name = e.getQName().getLocalPart();
paraNamespaceURI = e.getQName().getNamespaceURI();
paralocalPart = e.getQName().getLocalPart();
paraPrefix = e.getQName().getPrefix();
}
}
System.out.println(" ************************************************");
System.out.println(" Element Name :" + name);
System.out.println(" Element Type :" + type + "");
System.out.println(" Element localPart :" + paralocalPart);
System.out.println(" Element Prefix :" + paraPrefix);
System.out.println(" Element Min Occure :" + minOccure);
System.out.println(" Element Max Occure :" + maxOccure);
System.out.println(" Element DefaultValue :" + defaultValue);
System.out.println(" Element paraNamespaceURI :" + paraNamespaceURI);
System.out.println(" Element Other Attributes :" + e.getOtherAttributes());
QName paraQName = new QName(paraNamespaceURI, paralocalPart, paraPrefix);
SoapParameterBean param = new SoapParameterBean(name, choiceType, minOccure, maxOccure, paraQName,
defaultValue);
parameters.add(param);
}
}
} else if (paramType instanceof SimpleType) {
final SimpleType simpleType = (SimpleType) paramType;
final Restriction res = simpleType.getRestriction();
System.out.println("***********: " + "Simple Type ************** ");
System.out.println("SimpleType Element :" + simpleType);
System.out.println("Restriction Element :" + res.getBase());
System.out.println("Restriction Element :" + res.getEnumerations());
}
}// end loop Messages
} // end loop parts
}
}
| [
"[email protected]"
] | |
acb2087c4065aa0dea898f0a6db8077501316b3e | b8de6588c71f0dcf4673823166a9af62b2bff2e6 | /key-generation/src/main/java/com/quorum/tessera/key/generation/DefaultKeyGeneratorFactory.java | bb00a1721abe3fae3d629c90026ce617ec74442f | [
"Apache-2.0"
] | permissive | onecool2/tessera | 69cfd67fef7006ab560ec1d37c7435bcbe854242 | b637406e279d0c432425aea1c189265a4c20ecca | refs/heads/master | 2020-04-09T22:49:18.218909 | 2018-12-04T18:57:04 | 2018-12-04T18:57:04 | 160,639,716 | 0 | 0 | NOASSERTION | 2018-12-06T07:58:03 | 2018-12-06T07:58:02 | null | UTF-8 | Java | false | false | 1,593 | java | package com.quorum.tessera.key.generation;
import com.quorum.tessera.config.AzureKeyVaultConfig;
import com.quorum.tessera.config.Config;
import com.quorum.tessera.config.KeyConfiguration;
import com.quorum.tessera.config.KeyVaultConfig;
import com.quorum.tessera.config.keys.KeyEncryptorFactory;
import com.quorum.tessera.config.util.EnvironmentVariableProvider;
import com.quorum.tessera.config.util.PasswordReaderFactory;
import com.quorum.tessera.key.vault.KeyVaultService;
import com.quorum.tessera.key.vault.KeyVaultServiceFactory;
import com.quorum.tessera.nacl.NaclFacadeFactory;
public class DefaultKeyGeneratorFactory implements KeyGeneratorFactory {
@Override
public KeyGenerator create(KeyVaultConfig keyVaultConfig) {
if(keyVaultConfig != null) {
final KeyVaultServiceFactory keyVaultServiceFactory = KeyVaultServiceFactory.getInstance(keyVaultConfig.getKeyVaultType());
final Config config = new Config();
final KeyConfiguration keyConfiguration = new KeyConfiguration();
keyConfiguration.setAzureKeyVaultConfig((AzureKeyVaultConfig)keyVaultConfig);
config.setKeys(keyConfiguration);
final KeyVaultService keyVaultService = keyVaultServiceFactory.create(config, new EnvironmentVariableProvider());
return new AzureVaultKeyGenerator(NaclFacadeFactory.newFactory().create(), keyVaultService);
}
return new FileKeyGenerator(
NaclFacadeFactory.newFactory().create(), KeyEncryptorFactory.create(), PasswordReaderFactory.create()
);
}
}
| [
"[email protected]"
] | |
413e87d603f4fa0e864fcaae373b6f1427db646b | e6091d0e41479f7b1426d1fcb897d08314f8398b | /inventi-wicket-bootstrap/src/main/java/de/agilecoders/wicket/markup/html/bootstrap/behavior/BootstrapBaseBehavior.java | 0350bb5919562d1f3cdcb09a3526a625852a19cf | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | talkvip/inventi-wicket | 6acaaffea101e0a5357c2444b03a5a978186ef8e | ff4089def7b67c9e1c121c9a193782c037903697 | refs/heads/master | 2021-01-18T10:55:40.288538 | 2013-05-29T13:21:03 | 2013-05-29T13:21:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 286 | java | package de.agilecoders.wicket.markup.html.bootstrap.behavior;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
public class BootstrapBaseBehavior extends Behavior {
public static void addTo(final Component component) {
// do nothing
}
}
| [
"[email protected]"
] | |
5dc32a326710804bdadf9645b6416642af99472e | b2174c0bbea765f78a7836785a573ebafa99843d | /src/main/java/co/tripp/farrapp/api/data/service/UserServiceImpl.java | 81a5792322ea93b923d3c19efa957a323d5379c3 | [] | no_license | CAPJackie/farrapp-api | 8671d453222f68d9bdead6da6b8ebe4ba0b9c874 | aa91f32af89206de1ebc3e2cda715d6aceb8f2cd | refs/heads/master | 2020-03-29T16:52:19.842569 | 2018-10-19T02:55:53 | 2018-10-19T02:55:53 | 150,131,419 | 0 | 0 | null | 2018-09-24T16:13:01 | 2018-09-24T16:13:01 | null | UTF-8 | Java | false | false | 2,005 | java | package co.tripp.farrapp.api.data.service;
import co.tripp.farrapp.api.data.model.User;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.concurrent.ConcurrentHashMap;
@Service
public class UserServiceImpl implements UserService {
private ConcurrentHashMap<String, User> users;
public UserServiceImpl(){
users = new ConcurrentHashMap<>();
}
@PostConstruct
public void populateData(){
users.put("[email protected]", new User(
"Juan David",
"Ramirez Mendoza",
"[email protected]",
"qwerty1",
1019139950
));
users.put("[email protected]", new User(
"Kevin Jeffrey",
"Mendieta Perez",
"[email protected]",
"qwerty2",
1020456768
));
users.put("[email protected]", new User(
"Nicolas",
"Osorio Arias",
"[email protected]",
"qwerty3",
234542311
));
}
@Override
public void addNewUser (User user){
users.put(user.getEmail(), user);
}
@Override
public void modifyUserInfo (String emailUser, String newName, String newLastName, int newId, String newEmail){
String password = users.get(emailUser).getPassword();
users.remove(emailUser);
users.put(newEmail, new User(newName, newLastName, newEmail, password, newId));
}
@Override
public void modifyUserPassword (String emailUser, String newPassword){
users.get(emailUser).setPassword(newPassword);
}
@Override
public ConcurrentHashMap<String, User> getUsers() {
return users;
}
@Override
public User getUserByEmail(String email) {
return users.get(email);
}
}
| [
"[email protected]"
] | |
edb0fe83a2846d10051cb11b0e7d4fddcb8644e4 | afd8c45ef620259ee8924d025a1fa2a25d3cef72 | /Cooventure/src/com/example/cooventure/entity/User.java | a9b2f3ec288c249ff47b38fde16858351e69d670 | [] | no_license | CliuGeek9229/Cooventure | 97467e52f04965c640e954d6786e786523d8bc8f | dda3f7c3be09512c90084809626fc681f628f690 | refs/heads/master | 2021-04-06T07:33:25.507766 | 2018-03-14T03:04:30 | 2018-03-14T03:04:30 | 125,146,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | package com.example.cooventure.entity;
public class User {
private int _id;
private String name;
private String pwd;
private String realname;
private String sex;
private String school;
private String profession;
public int get_id() {
return _id;
}
public void set_id(int _id) {
this._id = _id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getSchool() {
return school;
}
public void setSchool(String school) {
this.school = school;
}
public String getProfession() {
return profession;
}
public void setProfession(String profession) {
this.profession = profession;
}
}
| [
"[email protected]"
] | |
77252ef75cc780a0f03d9cefcdf2aec7b679579e | 01a9032fd7e4b315852cf3d724b0b4b32535eaf7 | /app/src/main/java/com/nemesiss/dev/piaprobox/Bindings/IllustratorViewBindings.java | f7d72c299f466eddd4ee39b0b442b586c1a5ae0f | [] | no_license | LinZong/Piaprobox | e1dca4ea6fc1c2a60a2c20f6d76b80e33f188969 | 8f55529371b3d090c94aee07ebbfc3756ca30667 | refs/heads/master | 2023-04-13T10:43:35.362180 | 2021-04-29T17:42:51 | 2021-04-29T17:42:51 | 236,200,105 | 13 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,108 | java | package com.nemesiss.dev.piaprobox.Bindings;
import android.databinding.BindingAdapter;
import android.text.TextUtils;
import android.util.Log;
import android.widget.ImageView;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.nemesiss.dev.piaprobox.model.resources.StaticResourcesMap;
import com.nemesiss.dev.piaprobox.R;
import com.nemesiss.dev.piaprobox.Service.GlideApp;
import com.nemesiss.dev.piaprobox.Service.HTMLParser;
public class IllustratorViewBindings {
private static boolean fixThumbReference(ImageView imageView, String url) {
if (url.matches("^th-.*")) {
Integer resId;
if ((resId = StaticResourcesMap.getDefaultThumbMaps().get(url)) != null) {
imageView.setImageResource(resId);
Log.d("IllustratorViewBindings", "已修正" + url + "到资源ID: " + resId);
} else {
imageView.setImageResource(R.drawable.thumb_empty);
Log.d("IllustratorViewBindings", "修正失败: " + url + ", 重置到th-empty.");
}
return true;
}
return false;
}
@BindingAdapter({"bind:imageUrlWithPrefix"})
public static void loadImage(ImageView imageView, String url) {
if (null != url && !TextUtils.isEmpty(url) && !fixThumbReference(imageView, url)) {
GlideApp.with(imageView.getContext())
.load(url)
.transition(DrawableTransitionOptions.withCrossFade(500))
.priority(Priority.HIGH)
.apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.ALL))
.into(imageView);
}
}
@BindingAdapter({"bind:imageUrlNoPrefix"})
public static void loadImageNoPrefix(ImageView imageView, String url) {
if (null != url && !TextUtils.isEmpty(url) && !fixThumbReference(imageView, url)) {
GlideApp.with(imageView.getContext())
.load(HTMLParser.GetAlbumThumb(url))
.transition(DrawableTransitionOptions.withCrossFade(500))
.priority(Priority.HIGH)
.apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.ALL))
.into(imageView);
}
}
@BindingAdapter({"bind:imageArtistAvatar"})
public static void loadImageArtistAvatar(ImageView imageView, String url) {
if (null != url && !TextUtils.isEmpty(url) && !fixThumbReference(imageView, url)) {
imageView.post(() -> GlideApp.with(imageView.getContext())
.load(HTMLParser.GetAlbumThumb(url))
.transform(new RoundedCorners(imageView.getWidth() / 2))
.apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.ALL))
.priority(Priority.HIGH)
.into(imageView));
}
}
} | [
"[email protected]"
] | |
5c82c013b91bc48b8555aaeae968cd01e5f22293 | 7143f531866c45a42b95f36dd1f523e2bd756b44 | /fos/FOS/src/main/java/com/hitisoft/fos/tran/entity/TTransType.java | f520c5021175fa825eff6a61f32138b7dc469218 | [] | no_license | golden-hu/tos | 25106e98adddd92e037631595efb028485146f25 | 0bb2aa3303906f0bd8c38757b532df9b2fbcb0fa | refs/heads/master | 2021-01-22T21:17:04.257501 | 2013-04-06T14:02:24 | 2013-04-06T14:02:24 | 9,260,682 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package com.hitisoft.fos.tran.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.hitisoft.fw.orm.jpa.BaseDomain;
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true)
@Table(name = "T_TRANS_TYPE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class TTransType extends BaseDomain implements Serializable {
private static final long serialVersionUID = -8133703062971286217L;
private String transTypeName;
public TTransType() {
}
@Column(name = "TRANS_TYPE_NAME")
public String getTransTypeName() {
return this.transTypeName;
}
public void setTransTypeName(String transTypeName) {
this.transTypeName = transTypeName;
}
}
| [
"[email protected]"
] | |
9141a8233c62f90ea2a6b267730ed8809dbc398f | e5b25d8e1dffab5db260b966c75490ae3ce9244b | /src/java/com/adyen/services/recurring/InitialiseRecurring.java | 5e132db9ad9c372459909db9a3c90c252cde816a | [] | no_license | ajfcarlos/cxf-client-hutter | 5cf409869fd2518134285bce89cb445dfe64bda2 | e199d26e7e3041986add9e2b0ed1b69221bf5c3c | refs/heads/master | 2021-01-13T07:28:48.579972 | 2013-03-28T15:00:16 | 2013-03-28T15:00:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,705 | java |
package com.adyen.services.recurring;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="recurringRequest" type="{http://recurring.services.adyen.com}RecurringRequest"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"recurringRequest"
})
@XmlRootElement(name = "initialiseRecurring")
public class InitialiseRecurring {
@XmlElement(required = true, nillable = true)
protected RecurringRequest recurringRequest;
/**
* Gets the value of the recurringRequest property.
*
* @return
* possible object is
* {@link RecurringRequest }
*
*/
public RecurringRequest getRecurringRequest() {
return recurringRequest;
}
/**
* Sets the value of the recurringRequest property.
*
* @param value
* allowed object is
* {@link RecurringRequest }
*
*/
public void setRecurringRequest(RecurringRequest value) {
this.recurringRequest = value;
}
}
| [
"[email protected]"
] | |
0bf12ba82c6e5c96c817b93ac168f12147744d9c | d4ed6250295bf8fe5f31ad8aeb8dbcab599e199f | /SistemaNatacao/src/br/edu/utfpr/cm/tsi/projetointegrador/gui/Horario/JDialogVisualizarHorario.java | a02689dc34552037e948f57ff7e676be515c0f23 | [] | no_license | Dosantiago/grupo1_ne3a_2012_2 | b157fea797027bfc4fc090d77dd90780fcf964e8 | a5b1093debece778bacb040179686e8ccbd143c9 | refs/heads/master | 2021-01-18T06:27:16.868351 | 2013-04-08T02:16:52 | 2013-04-08T02:16:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,956 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package br.edu.utfpr.cm.tsi.projetointegrador.gui.Horario;
import br.edu.utfpr.cm.tsi.projetointegrador.gui.Cliente.JDialogVisualizarCliente;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
*
* @author Daniele
*/
public class JDialogVisualizarHorario extends javax.swing.JDialog {
JDialogCadastrodeHorarios cd = new JDialogCadastrodeHorarios();
/**
* Creates new form JDialogVisualizarVisualizarHorario
*/
public JDialogVisualizarHorario(){
setLocation(250,110);
this.setLocationRelativeTo(null);
//initComponents();
}
public void horario(Horario horario){
jTextNome.setText(horario.getNome());
jFormattedHorario.setText(horario.getHorario());
}
// JDialogVisualizarHorario() {
// throw new UnsupportedOperationException("Not yet implemented");
// private void initComponents() {
// throw new UnsupportedOperationException("Not yet implemented");
//}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextNome = new javax.swing.JTextField();
jFormattedHorario = new javax.swing.JFormattedTextField();
jButtonEditar = new javax.swing.JButton();
jButtonExcluir = new javax.swing.JButton();
jButtonCancelar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(51, 0, 204));
jLabel1.setText("Visualiza Horários:");
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel2.setText("Nome:");
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel3.setText("Horário:");
try {
jFormattedHorario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##:##")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
jButtonEditar.setText("Editar");
jButtonEditar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonEditarActionPerformed(evt);
}
});
jButtonExcluir.setText("Excluir");
jButtonExcluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonExcluirActionPerformed(evt);
}
});
jButtonCancelar.setText("Cancelar");
jButtonCancelar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCancelarActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jFormattedHorario, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextNome, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jButtonEditar)
.addGap(42, 42, 42)
.addComponent(jButtonExcluir)
.addGap(32, 32, 32)
.addComponent(jButtonCancelar)))))
.addContainerGap(108, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(46, 46, 46)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(50, 50, 50)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(jFormattedHorario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonEditar)
.addComponent(jButtonExcluir)
.addComponent(jButtonCancelar))
.addGap(48, 48, 48))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButtonEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarActionPerformed
// TODO add your handling code here:
int n=JOptionPane.showConfirmDialog(rootPane,"Deseja editar o horario do Cliente? ");
if(n==0){
dispose();
}
}//GEN-LAST:event_jButtonEditarActionPerformed
private void jButtonExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExcluirActionPerformed
// TODO add your handling code here:
int n = JOptionPane.showConfirmDialog(rootPane, "Deseja realmente excluir Cliente "+jTextNome.getText());
if(n==0){
try {
Sql.excluirHorario(jTextNome.getText());
} catch (Exception ex) {
Logger.getLogger(JDialogCadastrodeHorarios.class.getName()).log(Level.SEVERE, null, ex);
}
JOptionPane.showMessageDialog(rootPane, "Cliente " + jTextNome.getText() + "Foi excluido com sucesso!");
dispose();
}
}//GEN-LAST:event_jButtonExcluirActionPerformed
private void jButtonCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelarActionPerformed
// TODO add your handling code here:
dispose();
}//GEN-LAST:event_jButtonCancelarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(JDialogVisualizarHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(JDialogVisualizarHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(JDialogVisualizarHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JDialogVisualizarHorario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
JDialogVisualizarHorario dialog = new JDialogVisualizarHorario();
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonCancelar;
private javax.swing.JButton jButtonEditar;
private javax.swing.JButton jButtonExcluir;
private javax.swing.JFormattedTextField jFormattedHorario;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField jTextNome;
// End of variables declaration//GEN-END:variables
// void horario(Horario horario) {
// throw new UnsupportedOperationException("Not yet implemented");
// }
}
| [
"[email protected]"
] | |
159eca789ef9435ffa7ab7dcd80c25080444139e | a6297cd820f7a83d624b43921746ad2e70b587d4 | /src/main/java/com/myretail/productservice/ProductServiceApplication.java | 91b28276ce8f2703a165c33ccba7766de936d78a | [] | no_license | smit5906/product-service | 2ba4c759fdb5faa2572b09100cbca3d71d08d812 | 22a462e52c2e60804c022e64145266a37bdfde51 | refs/heads/master | 2020-04-30T13:14:57.151008 | 2019-03-21T11:18:40 | 2019-03-21T11:18:40 | 176,851,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package com.myretail.productservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import com.myretail.productservice.repository.ProductRepository;
@SpringBootApplication
@EnableMongoRepositories
@ComponentScan
public class ProductServiceApplication {
@Autowired
ProductRepository productRepository;
public static void main(String[] args) {
SpringApplication.run(ProductServiceApplication.class, args);
}
} | [
"[email protected]"
] | |
8d8983a6d634d15d342228469beeb654c2492acb | 8e4dcc621e2277fd7a5e9f0a582df3283267bb98 | /app/src/main/java/com/zju/biomedit/copdmanager/model/PefTask.java | 2f30cfb0555c0acd2bd54ce5e0e64f07319176a4 | [] | no_license | linhui675927474/COPDManager | a2efc7994ed49b9a0f14f13550e7807925da72a6 | 22db6f8b17c31339815265f578e84f7b70802636 | refs/heads/master | 2020-03-07T21:21:05.181119 | 2018-04-02T07:53:45 | 2018-04-02T07:53:45 | 127,724,013 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.zju.biomedit.copdmanager.model;
/**
* Created by wangzheyu on 2017/7/17.
*/
public class PefTask {
private long id;
private int value = -1;
private String measureTime;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getMeasureTime() {
return measureTime;
}
public void setMeasureTime(String measureTime) {
this.measureTime = measureTime;
}
}
| [
"[email protected]"
] | |
4e0b4cb43cae97224c7aaa74298a6f7de642d0ce | c7a5ac8c8b5b443f22bea918b338e80826dd3768 | /String-Array-Lists/MyArrayList.java | 34585bdcd3c22619e0a8738b6c983409240f5738 | [] | no_license | Shane-Van-Winkle/Data-Structures | edd205c2051dacedf3f334502a5fceaa575520b4 | 17dd742210db3bc84eb305809dbd97ff5aea020f | refs/heads/main | 2023-04-05T22:08:41.042751 | 2021-04-12T18:34:05 | 2021-04-12T18:34:05 | 357,292,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,908 | java | // java version 1.8.1
// Shane Van Winkle
// csc302.001
// 17-September-2019
// This creates the MyArrayList object
import java.io.*;
import java.util.*;
public class MyArrayList {
//java variables can't start with a number so 1stArray is now a lstArray (I changed the'1'
//into an 'l'.
// private attributes.
private String[] lstArray;
private int size;
// MyArrayList Constructor
public MyArrayList(){
this.lstArray = new String[2];
this.size = 0;
}// end MyArrayList Constructor
//isEmpty returns true if the size is zero.
public boolean isEmpty(){
if(this.size == 0){
return true;
}// end if
else{
return false;
}// end else
}// end isEmpty
public int size(){
return this.size;
}// end size
// add appends the String item to the lstArray
// increase the array as soon as the size is equal to the length of the array.
public void add(String item){
lstArray[size] = item;
this.size++;
// checks at the end otherwise if we try to remove anything when the array is full.
// the method will try to grab something to the right of the end which will call an
// IndexOutOfBoundsException.
// we cannot wait until the we need to add another item to boost lstArray.
if(size == lstArray.length){
String[] tempArray = new String[(lstArray.length)* 2];
System.arraycopy(lstArray, 0, tempArray, 0, size);
lstArray = tempArray;
}// end if
}// end add
//remove removes an item specified at an integer index. returns the string that was removed.
public String remove(int index) throws MyArrayListException{
String tempString = lstArray[index];
if(size == 0){//makes sure that size can't go negative.
removeAll();
return "";
}// end if
//checks the input index if it's valid.
if((index < 0) || (index >= this.size) || size < 0){
throw new MyArrayListException("Error: bad index: " + index);
}// end if
else{
// start the checks.
//first removes half of the array if it needs to.
if(size == ((lstArray.length) / 4)){
String[] b = new String[(lstArray.length) / 2];
System.arraycopy(lstArray, 0, b, 0, size);
lstArray = b;
}// end if
// the recursive call has reached the "base case" which is the edge.
// all of the items are shifted left so decrease the size and return the
//temp String. and ignore the item at end.
if(index == this.size - 1){
--size;
return tempString;
}// end if
//recursive call that shifts numbers until it reaches the end.
else{
lstArray[index] = lstArray[index + 1];
remove(index + 1);
}// end else
}// end else
return tempString;
}// end remove (At index);
//remove removes a string from lstArray using iteration
public void remove(String item){
//removes half of the lstArray if needed.
if(size ==((this.lstArray.length / 4))){
String[] tempArray = new String[(lstArray.length) / 2];
System.arraycopy(this.lstArray, 0, tempArray, 0, this.size);
this.lstArray = tempArray;
}// end if
// goes through the lstArray until it finds a match, then shifts it and decreases the
//size at the end
for(int i = 0; i < this.size; i++){
//check the array for the string.
if(this.lstArray[i].equals(item)){
for(int j = i; j < this.size; j++){
lstArray[j] = lstArray[j + 1];
}// end for
size--;
}// end if
}// end for
}// end remove (at String)
// removeAll resets the array back to the default conditions.
public void removeAll(){
this.lstArray = new String[2];
this.size = 0;
}// end removeAll
// get returns a value at an index and throws a
public String get(int index)throws MyArrayListException{
if((index < 0) || (index >= this.size)){
throw new MyArrayListException("Error: Invalid index: " + index + "!");
}// end if
else{
return lstArray[index];
}// end else
}// end get
} // End class MyArrayList
| [
"[email protected]"
] | |
2d092efa6011acd86f31702919d823fa7fdf86b0 | 44a36185f55ac18c5fe4c0b1c4a6a6632a26ad79 | /src/main/java/com/tcrl/controller/UserRoleController.java | 6c0f95e0d82721ac59b4f9a6523b9a80438863df | [] | no_license | taoxia2019/rlzyjx | 72f847b569f330f7356a5de5f6e6db9f3de0f70f | f836d8c6f3f9f7c9b47fba49919b19f75f5d516d | refs/heads/master | 2022-07-17T07:25:23.944707 | 2020-04-16T02:41:47 | 2020-04-16T02:41:47 | 216,684,938 | 0 | 0 | null | 2022-06-29T17:43:26 | 2019-10-21T23:43:06 | Roff | UTF-8 | Java | false | false | 650 | java | package com.tcrl.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tcrl.base.result.Results;
import com.tcrl.entity.UserRole;
import com.tcrl.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.xml.transform.Result;
/**
* <p>
* 前端控制器
* </p>
*
* @author taoxia
* @since 2019-09-30
*/
@Controller
@RequestMapping("/userrole")
public class UserRoleController {
}
| [
"[email protected]"
] | |
8d80b90f212bffceb593ab35173b175e7d6de925 | 5a62ee2e9994694f34e6c84564ea97a783372303 | /XHB_Tech-Service/src/main/java/xuechuxin/practice/Service/UserService.java | 9be82468e006dbaa6b2b3b7b27a7b4c01ed7394b | [] | no_license | milkoto/XiaoHBTech | e9a79d40de2adc098d641821f24a796e17891899 | 499874459e3f8e210d36d94659625e248f4d4d59 | refs/heads/master | 2021-03-30T20:27:11.429237 | 2018-03-12T18:16:26 | 2018-03-12T18:16:26 | 124,931,796 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package xuechuxin.practice.Service;
import xuechuxin.practice.pojo.xhb_User;
import xuechuxin.pratice.Utils.xhb_Result;
public interface UserService {
public xhb_Result Userlogin(String username, String password);
public xhb_Result CheckUsername(String user_name);
public xhb_Result Checkphone(String user_name);
public xhb_Result Adduser(xhb_User user);
}
| [
"[email protected]"
] | |
c733a59598ebf6c4579db51e0572f9693d0ad8fa | 92f2bcc9bc0833d4b258d0cee319ff2870ddae4c | /src/action/EspressoTestCreatorAction.java | a7ac0574d4513601f8685b85d08f946796cf2b2e | [] | no_license | boredream/EspressoTestCodeCreatorPlugin | c27edad9ac92184eb2c0ea53bb40cf5945f1d28f | 29fc6ba3aa73f578c85e06013711447929cbff01 | refs/heads/master | 2021-01-10T14:19:40.869023 | 2015-12-24T07:18:23 | 2015-12-24T07:18:23 | 48,472,494 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,045 | java | package action;
import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.generation.actions.BaseGenerateAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiUtilBase;
import entity.Element;
import entity.EspressoAction;
import entity.EspressoAssertion;
import form.CustomTestDialog;
import listener.IConfirmListener;
import utils.ProjectHelper;
import utils.Utils;
import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class EspressoTestCreatorAction extends BaseGenerateAction implements IConfirmListener {
private CustomTestDialog dialog;
private Project project;
private Editor editor;
private PsiFile file;
private PsiFile layout;
@SuppressWarnings("unused")
public EspressoTestCreatorAction() {
super(null);
}
@SuppressWarnings("unused")
public EspressoTestCreatorAction(CodeInsightActionHandler handler) {
super(handler);
}
@Override
public void actionPerformed(AnActionEvent event) {
project = event.getData(PlatformDataKeys.PROJECT);
editor = event.getData(PlatformDataKeys.EDITOR);
actionPerformedImpl(project, editor);
}
@Override
public void actionPerformedImpl(Project project, Editor editor) {
file = PsiUtilBase.getPsiFileInEditor(editor, project);
layout = Utils.getLayoutFileFromCaret(editor, file);
if (layout == null) {
Utils.showErrorNotification(project, "No layout found");
return; // no layout found
}
ArrayList<Element> elements = Utils.getIDsFromLayout(layout);
if (!elements.isEmpty()) {
showDialog(elements);
} else {
Utils.showErrorNotification(project, "No IDs found in layout");
}
}
private void showDialog(ArrayList<Element> elements) {
dialog = new CustomTestDialog(elements, this);
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dialog.pack();
dialog.setLocationRelativeTo(null);
dialog.setVisible(true);
}
@Override
public void onConfirm(List<EspressoAction> actions, List<EspressoAssertion> assertions) {
if (actions.size() == 0 && assertions.size() == 0) { // generate injections
Utils.showInfoNotification(project, "No actions and assertions");
return;
}
// 先创建测试基础路径
String androidTestRootPath = "app/src/androidTest/java";
// 代码基础路径
String fileRootPath = "app/src/main/java";
String fileParentPath = file.getVirtualFile().getParent().getPath();
// 将代码基础路径替换为测试基础路径,创建测试路径中对应的文件测试类
String testFilePath = androidTestRootPath + fileParentPath.split(fileRootPath)[1];
String activityContent = file.getText();
String activityClassName = Utils.getFileNameWithoutSuffix(file);
String testClassName = activityClassName + "Test";
// package
StringBuilder sbPackage = new StringBuilder();
String packageStr = file.getFirstChild().getText();
sbPackage.append(Utils.formatSingleLine(0, packageStr));
sbPackage.append("\n");
// import
StringBuilder sbImport = new StringBuilder();
sbImport.append(Utils.formatSingleLine(0, "import android.content.Intent;"));
sbImport.append(Utils.formatSingleLine(0, "import android.support.test.rule.ActivityTestRule;"));
sbImport.append(Utils.formatSingleLine(0, "import android.support.test.runner.AndroidJUnit4;"));
String comPackageName = ProjectHelper.getComPackageName(project);
sbImport.append(Utils.formatSingleLine(0, "import " + comPackageName + ".R;"));
sbImport.append("\n");
sbImport.append(Utils.formatSingleLine(0, "import org.junit.Rule;"));
sbImport.append(Utils.formatSingleLine(0, "import org.junit.Test;"));
sbImport.append(Utils.formatSingleLine(0, "import org.junit.runner.RunWith;"));
sbImport.append("\n");
sbImport.append(Utils.formatSingleLine(0, "import static android.support.test.espresso.Espresso.onView;"));
sbImport.append(Utils.formatSingleLine(0, "import static android.support.test.espresso.matcher.ViewMatchers.withId;"));
// class
StringBuilder sbClass = new StringBuilder();
sbClass.append(Utils.formatSingleLine(0, "@RunWith(AndroidJUnit4.class)"));
sbClass.append(Utils.formatSingleLine(0, "public class " + testClassName + " {"));
sbClass.append("\n");
sbClass.append(Utils.formatSingleLine(1, "@Rule"));
sbClass.append(Utils.formatSingleLine(1, "public ActivityTestRule<" + activityClassName +
"> mActivityRule = new ActivityTestRule<>(" + activityClassName + ".class, true, false);"));
sbClass.append("\n");
sbClass.append(Utils.formatSingleLine(1, "@Test"));
sbClass.append(Utils.formatSingleLine(1, "public void test() {"));
sbClass.append(Utils.formatSingleLine(2, "Intent intent = new Intent();"));
// 判断页面初始化时是否有getExtra,如果有需要在测试代码中putExtra
String getExtraRegex = ".get([\\w]+)Extra\\(\"([\\w_]+)\"";
Pattern getExtraPattern = Pattern.compile(getExtraRegex);
Matcher getExtraMatcher = getExtraPattern.matcher(activityContent);
if (getExtraMatcher.find()) {
sbClass.append(Utils.formatSingleLine(2, "// 待测试页面需要Extra数据如下"));
String type = getExtraMatcher.group(1);
String key = getExtraMatcher.group(2);
sbClass.append(Utils.formatSingleLine(2, "intent.putExtra(\"" + key + "\", 添加" + type + "类型的值);"));
}
sbClass.append(Utils.formatSingleLine(2, "mActivityRule.launchActivity(intent);"));
sbClass.append("\n");
sbClass.append(Utils.formatSingleLine(2, "// actions"));
// 用onView定位控件,并执行动作
for (EspressoAction ea : actions) {
String action = "";
if (ea.getActionName().equals(EspressoAction.TYPE_TYPE_TEXT)) {
action = ".perform(typeText(\"" + ea.getTypeText() + "\"), closeSoftKeyboard())";
appendImport(sbImport, "import static android.support.test.espresso.action.ViewActions.typeText;");
appendImport(sbImport, "import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;");
} else if (ea.getActionName().equals(EspressoAction.TYPE_CLICK)) {
action = ".perform(click())";
appendImport(sbImport, "import static android.support.test.espresso.action.ViewActions.click;");
} else if (ea.getActionName().equals(EspressoAction.TYPE_DOUBLE_CLICK)) {
action = ".perform(doubleClick())";
appendImport(sbImport, "import static android.support.test.espresso.action.ViewActions.doubleClick;");
} else if (ea.getActionName().equals(EspressoAction.TYPE_LONG_CLICK)) {
action = ".perform(longClick())";
appendImport(sbImport, "import static android.support.test.espresso.action.ViewActions.longClick;");
}
sbClass.append(Utils.formatSingleLine(2, "onView(withId(" + ea.getTargetElement().getFullID() + "))" + action + ";"));
}
sbClass.append("\n");
// 断言结果
sbClass.append(Utils.formatSingleLine(2, "// assertions"));
for (EspressoAssertion ea : assertions) {
String assertion = "";
if (ea.getAssertionName().equals(EspressoAssertion.TYPE_IS_DISPLAYED)) {
assertion = appendIsNotAssertionCode(ea, "isDisplayed()", sbImport);
appendImport(sbImport, "import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;");
} else if (ea.getAssertionName().equals(EspressoAssertion.TYPE_IS_CHECKED)) {
assertion = appendIsNotAssertionCode(ea, "isChecked()", sbImport);
appendImport(sbImport, "import static android.support.test.espresso.matcher.ViewMatchers.isChecked;");
} else if (ea.getAssertionName().equals(EspressoAssertion.TYPE_IS_SELECTED)) {
assertion = appendIsNotAssertionCode(ea, "isSelected()", sbImport);
appendImport(sbImport, "import static android.support.test.espresso.matcher.ViewMatchers.isSelected;");
} else if (ea.getAssertionName().equals(EspressoAssertion.TYPE_WITH_TEXT)) {
assertion = "withText(\"" + ea.getAssertionText() + "\")";
}
assertion = ".check(matches(" + appendIsNotAssertionCode(ea, assertion, sbImport) + "));";
appendImport(sbImport, "import static android.support.test.espresso.assertion.ViewAssertions.matches;");
appendImport(sbImport, "import static android.support.test.espresso.matcher.ViewMatchers.withText;");
sbClass.append(Utils.formatSingleLine(2, "onView(withId(" + ea.getTargetElement().getFullID() + "))"));
if (ea.getTargetElement().name.equals("Toast")) {
String inRoot = ".inRoot(withDecorView(not(is(mActivityRule.getActivity().getWindow().getDecorView()))))";
sbClass.append(Utils.formatSingleLine(3, inRoot));
appendImport(sbImport, "import static android.support.test.espresso.matcher.RootMatchers.withDecorView;");
appendImport(sbImport, "import static org.hamcrest.core.IsNot.not;");
appendImport(sbImport, "import static org.hamcrest.core.Is.is;");
}
sbClass.append(Utils.formatSingleLine(3, assertion));
}
sbImport.append("\n");
sbClass.append(Utils.formatSingleLine(1, "}"));
sbClass.append(Utils.formatSingleLine(0, "}"));
StringBuilder sb = new StringBuilder();
sb.append(sbPackage);
sb.append(sbImport);
sb.append(sbClass);
// create
ProjectHelper.createFileWithGeneratedCode(sb.toString(), project, testFilePath, testClassName + ".java");
}
private void appendImport(StringBuilder sbImport, String im) {
if (sbImport.indexOf(im) == -1) {
sbImport.append(Utils.formatSingleLine(0, im));
}
}
private String appendIsNotAssertionCode(EspressoAssertion ea, String oldAssertion, StringBuilder sbImport) {
if (ea.isNot()) {
appendImport(sbImport, "import static org.hamcrest.core.IsNot.not;");
return "not(" + oldAssertion + ")";
} else {
return oldAssertion;
}
}
}
| [
"[email protected]"
] | |
4df99f683f969111d34a4783083ca880832a41f4 | 5277cbc4572b0171e49226aa9727c5b8155cbb9a | /src/main/java/rpckids/client/RPCClient.java | ecc32b3e6d308b9bc834aa777b5805035f664c20 | [] | no_license | shane-hx/rpckids2 | dc29f6345e818d2548896827a3db9ec3d3d52ada | 94ac4dd04ed837a18ef7a65b7d181d87b6b27e0c | refs/heads/master | 2020-03-29T13:12:52.542695 | 2018-09-23T03:46:49 | 2018-09-23T03:46:49 | 149,946,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,736 | java | package rpckids.client;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import com.alibaba.fastjson.JSON;
import rpckids.common.Charsets;
public class RPCClient {
private String ip;
private int port;
private Socket sock;
private DataInputStream input;
private OutputStream output;
public RPCClient(String ip, int port) {
this.ip = ip;
this.port = port;
}
public void connect() throws IOException {
SocketAddress addr = new InetSocketAddress(ip, port);
sock = new Socket();
sock.connect(addr, 5000);
input = new DataInputStream(sock.getInputStream());
output = sock.getOutputStream();
}
public void close() {
try {
sock.close();
sock = null;
input = null;
output = null;
} catch (IOException e) {
}
}
public Object send(String type, Object payload) {
try {
return this.sendInternal(type, payload, false);
} catch (IOException e) {
throw new RPCException(e);
}
}
public RPCClient rpc(String type, Class<?> clazz) {
ResponseRegistry.register(type, clazz);
return this;
}
public void cast(String type, Object payload) {
try {
this.sendInternal(type, payload, true);
} catch (IOException e) {
throw new RPCException(e);
}
}
private Object sendInternal(String type, Object payload, boolean cast) throws IOException {
if (output == null) {
connect();
}
String requestId = RequestId.next();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream buf = new DataOutputStream(bytes);
writeStr(buf, requestId);
writeStr(buf, type);
writeStr(buf, JSON.toJSONString(payload));
buf.flush();
byte[] fullLoad = bytes.toByteArray();
try {
output.write(fullLoad);
} catch (IOException e) {
close();
connect();
output.write(fullLoad);
}
if (!cast) {
String reqId = readStr();
if (!requestId.equals(reqId)) {
close();
throw new RPCException("request id mismatch");
}
String typ = readStr();
Class<?> clazz = ResponseRegistry.get(typ);
if (clazz == null) {
throw new RPCException("unrecognized rpc response type=" + typ);
}
String payld = readStr();
Object res = JSON.parseObject(payld, clazz);
return res;
}
return null;
}
private String readStr() throws IOException {
int len = input.readInt();
byte[] bytes = new byte[len];
input.readFully(bytes);
return new String(bytes, Charsets.UTF8);
}
private void writeStr(DataOutputStream out, String s) throws IOException {
out.writeInt(s.length());
out.write(s.getBytes(Charsets.UTF8));
}
}
| [
"[email protected]"
] | |
55c821cf3ad8f53920688cfeca2ae8378918d3f1 | 816c80039be5a8996a8eec276964471e7bcc899e | /src/Routage_Algorithme/Send.java | 945ca01a3747d4fbc5561ec736b90bd27ce847db | [] | no_license | LAPECI-et-CRISTAL/DynMapNoCSIM | 34200f94501fbe542b35fe3e9bd333e89ddae239 | 267d8ef2c449864626271f1a0594798951942218 | refs/heads/master | 2020-04-02T13:27:13.054294 | 2019-10-05T19:38:45 | 2019-10-05T19:38:45 | 154,481,694 | 2 | 1 | null | 2019-10-05T19:38:47 | 2018-10-24T10:24:10 | Java | UTF-8 | Java | false | false | 1,754 | java | package Routage_Algorithme;
import Architecture.Paquet;
import Simulation.Simulator;
import Simulation.StaticParametre;
/**
* Cette classe represente l'entite qui charge de d'effectue le routage entre les teches
*/
public class Send {
private int x_source;
private int y_source;
private int x_destination;
private int y_destination;
private MORA_Algorithme mora;
private Paquet p;
public Send(Paquet p) throws InterruptedException {
this.x_destination = p.x_destination;
this.y_destination = p.y_destination;
this.x_source = p.x_inter;
this.y_source = p.y_inter;
this.p = p;
if (x_source == x_destination && y_source == y_destination) // dans le cas du multi pas besoin de lancer le routage
{
p.set_Tdebut(Simulator.Tnow);
p.set_Tfin(Simulator.Tnow + 2);
Simulator.Add_Event(Simulator.Tnow + 2);
} else {
/////////////////
/// MONO
this.run();
/////////////////
}
}
/*********************************************/ // Send packet
public void run() {
if (StaticParametre.ALGORITHME_ROUTAGE.equals("XY")) {
XY_Algorithme rout = new XY_Algorithme(p);
rout.start();
} else {
if (StaticParametre.ALGORITHME_ROUTAGE.equals("MORA")) {
mora = new MORA_Algorithme(p);
mora.start();
} else {
System.out.println("Veuillez saisir correctement le nom d'un des algorithmes de routage XY ou MORA ");
System.exit(0);
}
}
}
}
| [
"[email protected]"
] | |
3360691aec71d1356731a7eb7c88512eeafc9b63 | 2e1540b77d7b53225b61fe049f9b923f9f8bbf94 | /Backend/src/main/java/com/ms/main/controller/InstitutionController.java | 34e04e9a560f4c127de3533caf40767fe8925f15 | [] | no_license | ajaysr047/MSCandidateMgmnt | 280c23841e84a988e402122637954821335c3d24 | cb346e233706045a73e2e4ff771debb87e022da7 | refs/heads/master | 2023-03-19T18:11:47.158662 | 2021-03-12T16:24:19 | 2021-03-12T16:24:19 | 344,876,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package com.ms.main.controller;
import com.ms.main.request.AddInstitution;
import com.ms.main.response.AddInstitutionResponse;
import com.ms.main.response.GetAllInstitutionResponse;
import com.ms.main.service.InstitutionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@RestController
@RequestMapping("/api/institution")
public class InstitutionController {
@Autowired
InstitutionService institutionService;
@PostMapping("/add")
public ResponseEntity<AddInstitutionResponse> addInstitution(@Valid @RequestBody AddInstitution institution){
AddInstitutionResponse response = institutionService.addInstitution(institution);
if(response.isSuccess()){
return ResponseEntity.ok(response);
}
return new ResponseEntity<>(response, HttpStatus.CONFLICT);
}
@GetMapping("/getAll")
public ResponseEntity<GetAllInstitutionResponse> getAllInstitutions(){
GetAllInstitutionResponse response = institutionService.getAllInstitution();
if(response.isSuccess()){
return ResponseEntity.ok(response);
}
return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
}
}
| [
"[email protected]"
] | |
570c49ae6e241cbab621e7de27e0e572ffbf07ee | 8461b2927da6156ae0577a7a6d1bc8810a5f9579 | /punpun_demo_final/src/java/model/Tags.java | 4113d7b0705be94221be0067a7dc9bac9e2eadc6 | [] | no_license | littlekloy/punpun_ | c0fcc5d426fbf72cb68ffc945017c3377e6a7e16 | 4dbb43233518ec81315a6b775f5c79617f26d2dd | refs/heads/master | 2021-01-22T08:28:43.570495 | 2017-05-31T01:51:34 | 2017-05-31T01:51:34 | 92,618,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,783 | 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 model;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author kanok
*/
@Entity
@Table(name = "tags")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Tags.findAll", query = "SELECT t FROM Tags t"),
@NamedQuery(name = "Tags.findByTagId", query = "SELECT t FROM Tags t WHERE t.tagId = :tagId"),
@NamedQuery(name = "Tags.findByName", query = "SELECT t FROM Tags t WHERE t.name = :name")})
public class Tags implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "tag_id")
private Integer tagId;
@Column(name = "name")
private String name;
@ManyToMany(mappedBy = "tagsCollection")
private Collection<Projects> projectsCollection;
public Tags() {
}
public Tags(Integer tagId) {
this.tagId = tagId;
}
public Integer getTagId() {
return tagId;
}
public void setTagId(Integer tagId) {
this.tagId = tagId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@XmlTransient
public Collection<Projects> getProjectsCollection() {
return projectsCollection;
}
public void setProjectsCollection(Collection<Projects> projectsCollection) {
this.projectsCollection = projectsCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (tagId != null ? tagId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Tags)) {
return false;
}
Tags other = (Tags) object;
if ((this.tagId == null && other.tagId != null) || (this.tagId != null && !this.tagId.equals(other.tagId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "model.Tags[ tagId=" + tagId + " ]";
}
}
| [
"[email protected]"
] | |
60e7fd0a9de420e64460ab58d01a0f73eb21b45f | 4fe2c53331821145967b4c4f005f571f2652ae36 | /app/src/main/java/com/jfkj/im/TIM/redpack/ice/IceUtils.java | 8b6c4d283408cfa9826a74310e507a830298b1e9 | [] | no_license | woyl/iyouVipAndroid | 9fbb7145c61e7bba3a4e4a891058b51df1d8fee6 | 8e8b7746dd828e2438e35ad221a1b2af8eb66ad3 | refs/heads/master | 2022-11-24T23:16:57.952701 | 2020-07-30T06:15:42 | 2020-07-30T06:15:42 | 283,685,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,529 | java | package com.jfkj.im.TIM.redpack.ice;
import com.alibaba.fastjson.JSON;
import com.jfkj.im.App;
import com.jfkj.im.Bean.IceSubmitBean;
import com.jfkj.im.R;
import com.jfkj.im.TIM.utils.MD5Utils;
import com.jfkj.im.retrofit.ApiStores;
import com.jfkj.im.utils.AppUtils;
import com.jfkj.im.utils.SPUtils;
import com.jfkj.im.utils.ToastUtils;
import com.jfkj.im.utils.Utils;
import com.tencent.imsdk.TIMValueCallBack;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import okhttp3.Call;
public class IceUtils {
public static void giveTask(String taskId, String userId, TIMValueCallBack<GiveThumbsUpBean> callBack,TIMValueCallBack<Boolean> callBack2){
HashMap<String, String> map = new HashMap<>();
map.put(Utils.APPVERSION, Utils.getVersionCode() + "");
map.put(Utils.OSNAME, Utils.ANDROID);
map.put(Utils.CHANNEL, Utils.ANDROID);
map.put(Utils.DEVICENAME, Utils.getdeviceName());
map.put(Utils.DEVICEID, Utils.ANDROID);
map.put(Utils.REQ_TIME, AppUtils.getReqTime());
map.put(Utils.TASK_ID,taskId);
map.put(Utils.USERID,userId);
if (Utils.netWork()) {
OkHttpUtils.post()
.tag(App.getAppContext())
.url(ApiStores.base_url + "/task/taskAdmire")
.addHeader(Utils.TOKEN, SPUtils.getInstance(App.getAppContext()).getString(Utils.TOKEN))
.addHeader(Utils.SIGN, MD5Utils.getMD5String(Utils.KEY + AppUtils.getReqTime()))
.params(map)
.build()
.execute(new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
callBack.onError(id,"");
callBack2.onError(id,"");
}
@Override
public void onResponse(String response, int id) {
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getString("code").equals("200")) {
GiveThumbsUpBean giveThumbsUpBean = JSON.parseObject(jsonObject.getString("data"),GiveThumbsUpBean.class);
callBack.onSuccess(giveThumbsUpBean);
} else if (jsonObject.getString("code").equals("50000")) {
callBack2.onSuccess(true);
}
else {
callBack.onSuccess(null);
ToastUtils.showLongToast(jsonObject.getString("message"));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} else {
ToastUtils.showLongToast(R.string.nonetwork);
}
}
public static void submitTask(String url,String taskId, String userId, TIMValueCallBack<IceSubmitBean> callBack){
HashMap<String, String> map = new HashMap<>();
map.put(Utils.OSNAME, Utils.ANDROID);
map.put(Utils.APPVERSION, Utils.getVersionCode() + "");
map.put(Utils.CHANNEL, Utils.ANDROID);
map.put(Utils.DEVICENAME,Utils.getdeviceName());
map.put(Utils.DEVICEID, Utils.ANDROID);
map.put(Utils.REQTIME, AppUtils.getReqTime());
map.put(Utils.TASK_ID,taskId);
map.put(Utils.USERID,userId);
map.put(Utils.URL,url);
if (Utils.netWork()) {
OkHttpUtils.post()
.tag(App.getAppContext())
.url(ApiStores.base_url + "/task/confirmTask")
.addHeader(Utils.TOKEN, SPUtils.getInstance(App.getAppContext()).getString(Utils.TOKEN))
.addHeader(Utils.SIGN, MD5Utils.getMD5String(Utils.KEY + AppUtils.getReqTime()))
.params(map)
.build()
.execute(new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
callBack.onError(id,"");
}
@Override
public void onResponse(String response, int id) {
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getString("code").equals("200")) {
IceSubmitBean giveThumbsUpBean = JSON.parseObject(jsonObject.getString("data"),IceSubmitBean.class);
callBack.onSuccess(giveThumbsUpBean);
} else {
// ToastUtils.showLongToast(jsonObject.getString("message"));
callBack.onSuccess(null);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
} else {
ToastUtils.showLongToast(R.string.nonetwork);
}
}
}
| [
"[email protected]"
] | |
8499035266969d3c2ea0cc3f4b026b5a4956d402 | 9fbf59936537b9c3d6f79de6f8fba7cf7b683de8 | /src/main/java/havis/net/ui/shared/client/widgets/IntegerTextBox.java | 099c2d50c36e672e76b9ddbed060a3a067afb8a8 | [
"Apache-2.0"
] | permissive | menucha-de/Shared.UI | ad639036a3d8c39cd86ea0a41f0a587b7f52e189 | 3da1bdb6f4eecee92fbb88d4baab09ea525f59ec | refs/heads/main | 2023-03-21T15:36:34.999801 | 2021-03-16T12:49:24 | 2021-03-16T12:49:24 | 348,345,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | package havis.net.ui.shared.client.widgets;
import java.text.ParseException;
import com.google.gwt.text.shared.Parser;
public class IntegerTextBox extends NumberTextBox<Integer> {
@Override
protected Parser<Integer> getParser() {
return new Parser<Integer>() {
@Override
public Integer parse(CharSequence text) throws ParseException {
if (text == null && isNullable()) {
return null;
} else {
try {
Integer value = new Integer(text + "");
if (min != null && value < min) {
throw new NumberFormatException("Invalid number " + value + ". Minimum value is " + min);
}
if (max != null && value > max) {
throw new NumberFormatException("Invalid number " + value + ". Maxmimum value is " + max);
}
return value;
} catch (NumberFormatException e) {
throw new ParseException(e.getMessage(), 0);
}
}
}
};
}
}
| [
"[email protected]"
] | |
300c2de63bfb40be8c922cbd6cb984699e42574d | f052a95aefcf24f698ad455c23ce9c35ee5ea7da | /src/main/java/com/tvestergaard/start/data/repositories/base/queries/RepositoryQueryCompileException.java | e2e27e73d13cb25984f82f72206c69b9b19f92b7 | [] | no_license | Thomas-Rosenkrans-Vestergaard/rest-start | b5fa811c3afe24279f7fd93c7c9dfa4062c235e2 | 826348d683c05f611896e6ba89e6434da4e83cf1 | refs/heads/master | 2020-04-12T04:08:20.762580 | 2019-01-15T15:04:58 | 2019-01-15T15:04:58 | 162,286,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.tvestergaard.start.data.repositories.base.queries;
public class RepositoryQueryCompileException extends RepositoryQueryException
{
public RepositoryQueryCompileException(String message)
{
super(message);
}
public RepositoryQueryCompileException(String message, Throwable cause)
{
super(message, cause);
}
}
| [
"[email protected]"
] | |
f44d67aa74a7c872cea1e6a7b1f82a1bab3ea0eb | 1abcba256f1f183206cac7732374d3861eaecf75 | /src/main/java/org/HDH/jdbc/spring/Greeter.java | 3dd13cf6802464e2df9db4dfc5f55f1a38aceef1 | [] | no_license | DylanHong1353/HDH-Spring | b761bf6557707b60affd53b734bd9146b3cdbc57 | 7d5691d160baf056ef5120c87d1c9a94f5e0b134 | refs/heads/master | 2020-05-03T08:42:02.091808 | 2019-03-31T05:25:43 | 2019-03-31T05:25:43 | 178,533,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package org.HDH.jdbc.spring;
public class Greeter {
public Greeter() {
System.out.println("Greeter instance created!");
}
public String greet() {
return "Hello, Spring!";
}
}
| [
"[email protected]"
] | |
1c5b3e40d0415b43126ed6cf22cfb715489cc923 | 3e45be61efccc78bf0a4573699f346db24ac800b | /IDrawable.java | bc0ee1085334582e94f74eeff99eb492b0b3f2c5 | [] | no_license | kesemev/Java-Projects | 021023dd95f32a41ea7a2ae4bfa079098442fd86 | 99817df27794659838db330a87e1647439f00e9c | refs/heads/master | 2020-06-19T12:13:08.554440 | 2019-07-14T09:32:59 | 2019-07-14T09:32:59 | 196,702,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package graphics;
import java.awt.*;
public interface IDrawable {
public final static String PICTURE_PATH = "..\\src\\Pictures\\";
public void loadImages();
public void drawObject (Graphics g);
public String getColor();
}
| [
"[email protected]"
] | |
2c2164dfc0b3d18977955710b7d2fb4be52e334a | a31ebddecb8d2b70c81dfd2b1dbee91a044f0b6f | /PCBangData/app/src/main/java/com/ypunval/pcbangdata/MyApplication.java | b6844dc9509db4af92342718a3a6598493f7ba38 | [] | no_license | UnCheon/kingame_data | 2baa78c45f8d281c5679772e031556585111611b | e0ac2b00ff6fdc6fe6f6c3b4a54c5edaec790a88 | refs/heads/master | 2021-01-17T13:18:53.916972 | 2016-12-05T08:40:20 | 2016-12-05T08:40:20 | 59,122,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,111 | java | package com.ypunval.pcbangdata;
import android.app.Application;
import android.content.res.AssetManager;
import com.facebook.stetho.Stetho;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import io.realm.Realm;
import io.realm.RealmConfiguration;
/**
* Created by uncheon on 16. 4. 13..
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
RealmConfiguration pcBangConfig = new RealmConfiguration.Builder(this)
.name("pcbang.realm")
.setModules(new PCBangRealmModule())
.deleteRealmIfMigrationNeeded()
.build();
Realm.setDefaultConfiguration(pcBangConfig);
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
}
}
| [
"[email protected]"
] | |
e1024cf77252fadd61866a53eb734d79a046babb | 583006aec697e91e0c7b066c22dd5de922943577 | /Java/ws3/Invoice.java | 942dd2a42c7ee8c3db9f99db24f3eac82e2301cc | [] | no_license | MadeehaShahzadi94/CPD-program | 95bbf6ca45d3ba47a3129f50d26f7f6b43be5497 | 922dfa266b16713261da5df5955aa12008b37e83 | refs/heads/main | 2023-03-30T07:37:48.488504 | 2021-04-05T01:30:54 | 2021-04-05T01:30:54 | 354,631,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,703 | java | /**********************************************
Workshop # 3
Course:<JAC444> - Semester
Last Name:<Shahzadi>
First Name:<Madeeha>
ID:<130638182>
Section:<NDD>
This assignment represents my own work in accordance with Seneca Academic Policy.
Signature
Date:<Oct 09,2020>
**********************************************/
package work_shop3;
public class Invoice implements Payable {
private String partNumber;
private String partDescription;
private int quantity;
private double pricePerItem;
//Construtor
public Invoice(String part, String description, int count, double price) {
setPartNumber(part);
setPartDescription(description);
setQuantity(count);
setPricePerItem(price);
}
//setter
public void setPartNumber(String part) {
partNumber = part;
}
public void setPartDescription(String description) {
partDescription= description;
}
public void setQuantity(int count)
{
if(count <0)
{
quantity =count;
}
}
public void setPricePerItem(double price)
{
if(price <0.0)
{
pricePerItem = price;
}
}
//getter
public String getPartNumber()
{
return partNumber;
}
public String getPartDescription()
{
return partDescription;
}
public int getQuantity()
{
return quantity;
}
public double getPricePerItem()
{
return pricePerItem;
}
public String toString() {
return String.format( "%s: \n%s: %s (%s) \n%s: %d \n%s: $%,.2f","invoice", "part number", getPartNumber(), getPartDescription(),"quantity", getQuantity(), "price per item", getPricePerItem() );
}
public double getPaymentAmount() {
return getQuantity() * getPricePerItem();
}
}
| [
"[email protected]"
] | |
aeb279095098b3239bf8d0b67d018a4ce23058e5 | 3e4edd2487be66de8d64028af1f2f7b8642acd9c | /transactions/src/main/java/ru/sld/transactions/service/AccountService.java | deadcb58e21bd3f00e23af02731205cca6d1f70f | [] | no_license | soldaria/Accounts_CRUD | c0cc71dff1aa65f9fbe0a2d9cf3997ad79880a7e | 6f89b2993e75b953de22b868f5db67842fece85b | refs/heads/master | 2020-05-22T21:48:03.110674 | 2019-05-14T03:10:58 | 2019-05-14T03:10:58 | 186,534,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 606 | java | package ru.sld.transactions.service;
import java.util.List;
import ru.sld.transactions.model.Account;
public interface AccountService {
public void addAccount(Account acc);
public Account getAccountById(Integer id);
Account getAccountByNum(String num);
public void updateAccount(Account acc);
public List<Account> listAccount();
public void removeAccount(Integer id);
void deposit(Account acc, Integer amount);
void withdraw(Account acc, Integer amount) throws RuntimeException;
void transaction(Account debitedAcc, Account proceedsAcc, Integer amount);
} | [
"[email protected]"
] | |
59f538f89c7dae002a73fdd8791275963c3ed815 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes2.dex_source_from_JADX/com/facebook/telephony/FbTelephonyManager.java | 07978241fe5a9197deb639b5d230c618836f1b24 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,722 | java | package com.facebook.telephony;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources.NotFoundException;
import android.os.Build.VERSION;
import android.os.SystemProperties;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import com.facebook.common.android.TelephonyManagerMethodAutoProvider;
import com.facebook.common.util.StringUtil;
import com.facebook.debug.log.BLog;
import com.facebook.inject.IdBasedProvider;
import com.facebook.inject.InjectorLike;
import com.facebook.inject.Lazy;
import com.facebook.runtimepermissions.RuntimePermissionsUtil;
import com.mediatek.telephony.TelephonyManagerEx;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Provider;
/* compiled from: foreground_fetch_interval */
public class FbTelephonyManager {
private static final Class<?> f23451a = FbTelephonyManager.class;
public final Context f23452b;
private final TelephonyManager f23453c;
private final Provider<Boolean> f23454d;
private final RuntimePermissionsUtil f23455e;
private final FbMultiSimTelephonyManager f23456f;
private final Lazy<SubscriptionManager> f23457g = new C09511(this);
/* compiled from: foreground_fetch_interval */
class C09511 implements Lazy<SubscriptionManager> {
final /* synthetic */ FbTelephonyManager f23461a;
C09511(FbTelephonyManager fbTelephonyManager) {
this.f23461a = fbTelephonyManager;
}
@TargetApi(22)
public Object get() {
return SubscriptionManager.from(this.f23461a.f23452b);
}
}
public static FbTelephonyManager m31732b(InjectorLike injectorLike) {
return new FbTelephonyManager((Context) injectorLike.getInstance(Context.class), TelephonyManagerMethodAutoProvider.m3851b(injectorLike), IdBasedProvider.m1811a(injectorLike, 4350), RuntimePermissionsUtil.m13589b(injectorLike), new FbMultiSimTelephonyManager((Context) injectorLike.getInstance(Context.class)));
}
public static FbTelephonyManager m31730a(InjectorLike injectorLike) {
return m31732b(injectorLike);
}
@Inject
public FbTelephonyManager(Context context, TelephonyManager telephonyManager, Provider<Boolean> provider, RuntimePermissionsUtil runtimePermissionsUtil, FbMultiSimTelephonyManager fbMultiSimTelephonyManager) {
this.f23452b = context.getApplicationContext();
this.f23453c = telephonyManager;
this.f23454d = provider;
this.f23455e = runtimePermissionsUtil;
this.f23456f = fbMultiSimTelephonyManager;
}
@Nullable
public final String m31741a(int i) {
Throwable e;
CharSequence l;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31760b();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get network operator name from MediaTek API.", e);
l = m31735l(i);
if (StringUtil.m3589a(l)) {
return l;
}
if (this.f23453c == null) {
}
return null;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get network operator name from MediaTek API.", e);
l = m31735l(i);
if (StringUtil.m3589a(l)) {
return l;
}
if (this.f23453c == null) {
}
return null;
}
}
l = m31735l(i);
if (StringUtil.m3589a(l)) {
return l;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getNetworkOperatorName();
}
return null;
}
@Nullable
public final String m31742b(int i) {
Throwable e;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31761c();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get network country iso from MediaTek API.", e);
if (this.f23453c == null) {
}
return null;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get network country iso from MediaTek API.", e);
if (this.f23453c == null) {
}
return null;
}
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getNetworkCountryIso();
}
return null;
}
public final int m31743c(int i) {
Throwable e;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31762d();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get network type from MediaTek API.", e);
if (this.f23453c == null) {
}
return -1;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get network type from MediaTek API.", e);
if (this.f23453c == null) {
}
return -1;
}
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getNetworkType();
}
return -1;
}
public final int m31744d(int i) {
Throwable e;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31759a();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get phone type from MediaTek API.", e);
if (this.f23453c != null) {
}
return -1;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get phone type from MediaTek API.", e);
if (this.f23453c != null) {
}
return -1;
}
}
if (this.f23453c != null || i != 0) {
return -1;
}
try {
return this.f23453c.getPhoneType();
} catch (NotFoundException e4) {
return -1;
}
}
@Nullable
public final String m31745e(int i) {
Throwable e;
CharSequence p;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31765g();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get sim country iso from MediaTek API.", e);
p = m31739p(i);
if (StringUtil.m3589a(p)) {
return p;
}
if (this.f23453c == null) {
}
return null;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get sim country iso from MediaTek API.", e);
p = m31739p(i);
if (StringUtil.m3589a(p)) {
return p;
}
if (this.f23453c == null) {
}
return null;
}
}
p = m31739p(i);
if (StringUtil.m3589a(p)) {
return p;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getSimCountryIso();
}
return null;
}
@Nullable
public final String m31746f(int i) {
Throwable e;
CharSequence o;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31764f();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get sim operator from MediaTek API.", e);
o = m31738o(i);
if (StringUtil.m3589a(o)) {
return o;
}
if (this.f23453c == null) {
}
return null;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get sim operator from MediaTek API.", e);
o = m31738o(i);
if (StringUtil.m3589a(o)) {
return o;
}
if (this.f23453c == null) {
}
return null;
}
}
o = m31738o(i);
if (StringUtil.m3589a(o)) {
return o;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getSimOperator();
}
return null;
}
@Nullable
public final String m31747g(int i) {
Throwable e;
if (!m31733b() && !m31734c()) {
return null;
}
CharSequence n;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31768j();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get phone number from MediaTek API.", e);
n = m31737n(i);
if (StringUtil.m3589a(n)) {
return n;
}
if (this.f23453c == null) {
}
return this.f23456f.m31755a(i);
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get phone number from MediaTek API.", e);
n = m31737n(i);
if (StringUtil.m3589a(n)) {
return n;
}
if (this.f23453c == null) {
}
return this.f23456f.m31755a(i);
}
}
n = m31737n(i);
if (StringUtil.m3589a(n)) {
return n;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getLine1Number();
}
return this.f23456f.m31755a(i);
}
@Nullable
public final Map<String, String> m31748h(int i) {
Object n;
String str;
Throwable e;
Object obj;
Object obj2;
Object a;
String str2 = null;
Map<String, String> hashMap = new HashMap();
if (m31733b() || m31734c()) {
n = m31737n(i);
if (this.f23453c == null || i != 0) {
str = str2;
} else {
str = this.f23453c.getLine1Number();
}
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
str2 = TelephonyManagerEx.m31768j();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get phone number from MediaTek API.", e);
obj = str;
obj2 = str2;
a = this.f23456f.m31755a(i);
hashMap.put("android_subscription_manager", n);
hashMap.put("android_telephony_manager", obj);
hashMap.put("mediatek", obj2);
hashMap.put("java_reflection", a);
return hashMap;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get phone number from MediaTek API.", e);
obj = str;
obj2 = str2;
a = this.f23456f.m31755a(i);
hashMap.put("android_subscription_manager", n);
hashMap.put("android_telephony_manager", obj);
hashMap.put("mediatek", obj2);
hashMap.put("java_reflection", a);
return hashMap;
}
}
obj = str;
obj2 = str2;
a = this.f23456f.m31755a(i);
} else {
str = str2;
String str3 = str2;
String str4 = str2;
}
hashMap.put("android_subscription_manager", n);
hashMap.put("android_telephony_manager", obj);
hashMap.put("mediatek", obj2);
hashMap.put("java_reflection", a);
return hashMap;
}
public final int m31749i(int i) {
Throwable e;
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31763e();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get SIM card state from MediaTek API.", e);
if (m31740q(i) == null) {
return 0;
}
if (this.f23453c == null) {
}
if (this.f23456f == null) {
}
return -1;
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get SIM card state from MediaTek API.", e);
if (m31740q(i) == null) {
return 0;
}
if (this.f23453c == null) {
}
if (this.f23456f == null) {
}
return -1;
}
}
if (m31740q(i) == null) {
return 0;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getSimState();
}
if (this.f23456f == null && this.f23456f.m31756a()) {
return 0;
}
return -1;
}
@Nullable
public final String m31750j(int i) {
Throwable e;
CharSequence m;
if (!m31733b()) {
return null;
}
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31766h();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get SIM card serial number from MediaTek API.", e);
m = m31736m(i);
if (StringUtil.m3589a(m)) {
return m;
}
if (this.f23453c == null) {
}
return this.f23456f.m31757b(i);
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get SIM card serial number from MediaTek API.", e);
m = m31736m(i);
if (StringUtil.m3589a(m)) {
return m;
}
if (this.f23453c == null) {
}
return this.f23456f.m31757b(i);
}
}
m = m31736m(i);
if (StringUtil.m3589a(m)) {
return m;
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getSimSerialNumber();
}
return this.f23456f.m31757b(i);
}
@Nullable
public final String m31751k(int i) {
Throwable e;
if (!m31733b()) {
return null;
}
if (m31731a()) {
try {
TelephonyManagerEx telephonyManagerEx = new TelephonyManagerEx();
return TelephonyManagerEx.m31767i();
} catch (RuntimeException e2) {
e = e2;
BLog.b(f23451a, "Error attempting to get subscriber ID from MediaTek API.", e);
if (this.f23453c == null) {
}
return this.f23456f.m31758c(i);
} catch (IllegalAccessError e3) {
e = e3;
BLog.b(f23451a, "Error attempting to get subscriber ID from MediaTek API.", e);
if (this.f23453c == null) {
}
return this.f23456f.m31758c(i);
}
}
if (this.f23453c == null && i == 0) {
return this.f23453c.getSubscriberId();
}
return this.f23456f.m31758c(i);
}
private boolean m31731a() {
return ((Boolean) this.f23454d.get()).booleanValue() && "true".equals(SystemProperties.get("ro.mediatek.gemini_support"));
}
private boolean m31733b() {
return this.f23455e.m13593a("android.permission.READ_PHONE_STATE");
}
private boolean m31734c() {
return this.f23455e.m13593a("android.permission.READ_SMS");
}
@TargetApi(22)
@Nullable
private String m31735l(int i) {
SubscriptionInfo q = m31740q(i);
if (q == null || q.getCarrierName() == null) {
return null;
}
return q.getCarrierName().toString();
}
@TargetApi(22)
@Nullable
private String m31736m(int i) {
SubscriptionInfo q = m31740q(i);
return q != null ? q.getIccId() : null;
}
@TargetApi(22)
@Nullable
private String m31737n(int i) {
SubscriptionInfo q = m31740q(i);
return q != null ? q.getNumber() : null;
}
@TargetApi(22)
@Nullable
private String m31738o(int i) {
SubscriptionInfo q = m31740q(i);
return q != null ? String.valueOf(q.getMcc()) + String.valueOf(q.getMnc()) : null;
}
@TargetApi(22)
@Nullable
private String m31739p(int i) {
SubscriptionInfo q = m31740q(i);
return q != null ? q.getCountryIso() : null;
}
@TargetApi(22)
@Nullable
private SubscriptionInfo m31740q(int i) {
if (VERSION.SDK_INT < 22 || !m31733b()) {
return null;
}
SubscriptionManager subscriptionManager = (SubscriptionManager) this.f23457g.get();
return subscriptionManager != null ? subscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(i) : null;
}
}
| [
"[email protected]"
] | |
16bd7b2dcd743bea43c3361212710a266b2a0829 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_663e37ac20da5aa3b1e4834a44faa8cbe5988fdb/UrlHyperlink/11_663e37ac20da5aa3b1e4834a44faa8cbe5988fdb_UrlHyperlink_s.java | 45adb3cab5becf703d00a0c2178566ffb7dcc6de | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,968 | java | /*******************************************************************************
* Copyright (c) 2012 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.commons.workbench.browser;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.URLHyperlink;
import org.eclipse.osgi.util.NLS;
/**
* A link to a url that opens in a rich editor, if available, or browser, otherwise.
*
* @author Steffen Pingel
* @see BrowserUtil#openUrl(String)
*/
public class UrlHyperlink extends URLHyperlink {
private final String tooltip;
/**
* Constructs a hyperlink with a custom tooltip.
*
* @param region
* the region to highlight
* @param url
* the URL to open
* @param tooltip
* a tooltip, maybe <code>null</code>
* @see URLHyperlink#URLHyperlink(IRegion, String)
*/
public UrlHyperlink(IRegion region, String url, String tooltip) {
super(region, url);
this.tooltip = tooltip;
}
/**
* Constructs a hyperlink
*
* @param region
* the region to highlight
* @param url
* the URL to open
* @see URLHyperlink#URLHyperlink(IRegion, String)
*/
public UrlHyperlink(IRegion region, String url) {
this(region, url, null);
}
@Override
public void open() {
BrowserUtil.openUrl(getURLString());
}
@Override
public String getHyperlinkText() {
if (tooltip != null) {
return tooltip;
}
return NLS.bind("Open ''{0}''", getURLString()); //$NON-NLS-1$
}
}
| [
"[email protected]"
] | |
fd10e81a8d99e5b1cae9923ffe5631f8bf94ac1e | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/com/google/android/gms/internal/jo$a$a.java | 30353dca77d822686dcb64a489d84381c4a58352 | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 948 | java | package com.google.android.gms.internal;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
class jo$a$a
implements jo
{
private IBinder a;
jo$a$a(IBinder paramIBinder)
{
a = paramIBinder;
}
public void a(jn paramjn)
throws RemoteException
{
IBinder localIBinder = null;
Parcel localParcel = Parcel.obtain();
try
{
localParcel.writeInterfaceToken("com.google.android.gms.common.internal.service.ICommonService");
if (paramjn != null) {
localIBinder = paramjn.asBinder();
}
localParcel.writeStrongBinder(localIBinder);
a.transact(1, localParcel, null, 1);
return;
}
finally
{
localParcel.recycle();
}
}
public IBinder asBinder()
{
return a;
}
}
/* Location:
* Qualified Name: com.google.android.gms.internal.jo.a.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
4479980aabf3660c9c048500b42f26c1a9c80fff | 0b577b923c9e46cf072cd3d54e8af7f084c57f10 | /Gloria/GloriaUtil/target/generated-sources/jaxb/com/volvo/group/processrequisition/components/_1_0/TemperatureRangeABIEType.java | b1f2bc1a7d3f775db403664e3109697d8d14069e | [] | no_license | perlovdinger/gloria1 | b0a9ea0e391f78f871b058a07ff8c3219ea7978f | b6a220f3c712a29289fe42be3736796a7b7a4065 | refs/heads/master | 2020-12-25T21:12:55.874655 | 2016-09-18T09:11:30 | 2016-09-18T09:11:30 | 68,508,862 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,128 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.3-b01-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.09 at 04:05:29 em CEST
//
package com.volvo.group.processrequisition.components._1_0;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Provides the minumum and maximum temperature that the assoicated element can be kept.
*
* TemperatureRangeABIEType is logically derived from UN/CEFACT TBG17 ABIE TemperatureRangeType as defined in the Reusable Aggregate Business Information Entity (RUABIE) XML Schema file.
*
* <p>Java class for TemperatureRangeABIEType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="TemperatureRangeABIEType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.openapplications.org/oagis/9}MinimumTemperature" minOccurs="0"/>
* <element ref="{http://www.openapplications.org/oagis/9}MaximumTemperature" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TemperatureRangeABIEType", propOrder = {
"minimumTemperature",
"maximumTemperature"
})
public class TemperatureRangeABIEType {
@XmlElement(name = "MinimumTemperature")
protected TemperatureMeasureType minimumTemperature;
@XmlElement(name = "MaximumTemperature")
protected TemperatureMeasureType maximumTemperature;
/**
* Gets the value of the minimumTemperature property.
*
* @return
* possible object is
* {@link TemperatureMeasureType }
*
*/
public TemperatureMeasureType getMinimumTemperature() {
return minimumTemperature;
}
/**
* Sets the value of the minimumTemperature property.
*
* @param value
* allowed object is
* {@link TemperatureMeasureType }
*
*/
public void setMinimumTemperature(TemperatureMeasureType value) {
this.minimumTemperature = value;
}
/**
* Gets the value of the maximumTemperature property.
*
* @return
* possible object is
* {@link TemperatureMeasureType }
*
*/
public TemperatureMeasureType getMaximumTemperature() {
return maximumTemperature;
}
/**
* Sets the value of the maximumTemperature property.
*
* @param value
* allowed object is
* {@link TemperatureMeasureType }
*
*/
public void setMaximumTemperature(TemperatureMeasureType value) {
this.maximumTemperature = value;
}
}
| [
"[email protected]"
] | |
382ea1ef5b432a27394041ca2eee6b31bbc2f08b | fc127c0291d13eb009d389989b3d88f53a3e524e | /JerseySample/src/main/java/restful/restserver/resource/util/MyConvertor.java | 3c3d4495bc1daba5759a1c5a08f93db8f06b7bf3 | [] | no_license | JasonChen90/sample | 10d368bb432e9bc133c72a9254bf8717e4632d5b | fe9a41b54716726f6985b155c83f50773ff44f0b | refs/heads/master | 2021-01-21T04:32:41.475175 | 2016-07-01T08:41:54 | 2016-07-01T08:41:54 | 55,757,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,345 | java | package restful.restserver.resource.util;
import java.io.IOException;
import org.apache.log4j.Logger;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
/**
*
* @author JasonChen1
*
*/
public class MyConvertor {
private static Logger logger = Logger.getLogger(MyConvertor.class);
/**
* Invoke jackson api for converting string to object
* @param content
* @param returnValue
* @return
*/
public static <T> T parseContent2Object(String content,Class<T> returnValue){
ObjectMapper om = new ObjectMapper();
T obj = null;
try {
obj = (T) om.readValue(content, returnValue);
} catch (JsonParseException e) {
logger.error(e.getMessage());
} catch (JsonMappingException e) {
logger.error(e.getMessage());
} catch (IOException e) {
logger.error(e.getMessage());
}
return obj;
}
public static <T> String parseObject2Content(T obj){
ObjectMapper om = new ObjectMapper();
try {
return om.writeValueAsString(obj);
} catch (JsonGenerationException e) {
logger.error(e.getMessage());
} catch (JsonMappingException e) {
logger.error(e.getMessage());
} catch (IOException e) {
logger.error(e.getMessage());
}
return "";
}
}
| [
"[email protected]"
] | |
4fa92f95a21d142ff8b94ffced1d477d65ef22e7 | c5e6c9fc7942572ddbdfb0c087505254d2a4ffc4 | /game6/xxkg/src/main/java/com/tumei/modelconf/LeheupConf.java | 77308af7a78f9fda664a135b3240ee0ddcae3e64 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | zhangwei9757/xiaocaibao | 60074b00651ae41506c4eabb2636dfaae7947d7c | 9e2ad2669af0b0453ea9149f8732953c57c2bb7e | refs/heads/master | 2020-03-25T01:26:04.975319 | 2018-10-15T09:30:17 | 2018-10-15T09:30:17 | 143,237,486 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package com.tumei.modelconf;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* Created by zw on 2018/09/26
*/
@Document(collection = "Leheup")
public class LeheupConf {
@Id
public String objectId;
public int key;
// 金币
public int cost1;
// 圣物碎片
public int cost2;
// 圣灵石
public int cost3;
// 钻石消耗
public int cost4;
// 升级几率
public int rate;
}
| [
"[email protected]"
] | |
049db6a3b1593e3cf485668502767b5cb5162d46 | eccfbc4380fc45154fb7dd95634e649d1ebb5bed | /src/main/java/com/ch6/heap/Heap.java | ba53b34e8d0ea3e1edc75b64696184d0d7673df0 | [] | no_license | liuzhengyang/algorithm | b349c673397554a11eec92f5c655ba9e515d8ec1 | b5bde1f00d2b61d1f8f324352ced597b970e514e | refs/heads/master | 2021-04-15T18:01:20.618844 | 2018-03-28T13:11:29 | 2018-03-28T13:11:29 | 126,848,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,467 | java | package com.ch6.heap;
/**
* 树的跟为A[1]
* 堆数据结构,完全二叉树, 树的每一层都是填满的,最后一层可能除外
* 可以看做一颗二叉树和一个数组
* 最大堆、最小堆
* 最大堆: 除了根节点意外的每个节点i, 有A[parent(i)] >= A[i]
* @author liuzhengyang
*/
public class Heap<T extends Comparable<T>> {
private T[] array;
private int heapSize;
public Heap(T[] array) {
this.array = array;
}
private int parent(int i) {
return i/2;
}
private int left(int i) {
return 2 * i;
}
private int right(int i) {
return 2 * i + 1;
}
private int heapSize() {
return heapSize;
}
private void minHeapify(int i) {
int left = left(i);
int right = right(i);
int smallest;
if (left <= heapSize() && array[left].compareTo(array[i]) < 0) {
smallest = left;
} else {
smallest = i;
}
if (right <= heapSize() && array[right].compareTo(array[i]) < 0) {
smallest = right;
}
if (smallest != i) {
T temp = array[i];
array[i] = array[smallest];
array[smallest] = temp;
minHeapify(i);
}
}
private void maxHeapify(T[] array, int i) {
int left = left(i);
int right = right(i);
int largest = 0;
if (left <= heapSize() && array[left].compareTo(array[i]) > 0) {
largest = left;
} else {
largest = i;
}
if (right <= heapSize() && array[right].compareTo(array[largest]) > 0) {
largest = right;
}
if (largest != i) {
T temp = array[i];
array[i] = array[largest];
array[largest] = temp;
maxHeapify(array, largest);
}
}
private void buildMaxHeap() {
heapSize = array.length;
for (int i = array.length/2; i >= 1; i--) {
maxHeapify(array, i);
}
}
private static <T extends Comparable<T>> void heapSort(T[] array) {
Heap<T> heap = new Heap<T>(array);
heap.buildMaxHeap();
for (int i = array.length; i >= 2 ; i++) {
T temp = array[1];
array[1] = array[i];
array[i] = temp;
heap.heapSize -= 1;
heap.maxHeapify(array, 1);
}
}
private class Node<T> {
}
}
| [
"[email protected]"
] | |
13210c5ec639f6caadc70487e331f68df17513a8 | 743a39c37bc2add9cdeb9b332e2ecf399024824b | /track-ssis/tob-common/src/main/java/com/ifchange/tob/common/helper/NetworkHelper.java | da1ff9b002fb50973d3da62543e39626e0cdc675 | [] | no_license | PoisonMiao/project2 | 4826cfa95d3a4f1de6d804390bb85cbcb3dc8303 | 635f273dfc21866758cc81176a035d180bae1e34 | refs/heads/master | 2022-12-21T10:23:01.109920 | 2019-09-02T08:47:57 | 2019-09-02T08:47:57 | 205,799,501 | 0 | 0 | null | 2022-12-16T00:01:51 | 2019-09-02T07:22:39 | Java | UTF-8 | Java | false | false | 8,277 | java | package com.ifchange.tob.common.helper;
import com.google.common.collect.Lists;
import com.ifchange.tob.common.support.IConstant;
import com.ifchange.tob.common.view.parser.RequestHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
/** 网络信息工具类 **/
public final class NetworkHelper {
private static final Logger LOG = LoggerFactory.getLogger(NetworkHelper.class);
private NetworkHelper() {
}
private static final List<InetAddress> LOCAL_IPS = Lists.newArrayList();
private static final List<InetAddress> INNER_IPS = Lists.newArrayList();
private static final List<InetAddress> OUTER_IPS = Lists.newArrayList();
static {
try {
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
NetworkInterface networkInterface = networkInterfaces.nextElement();
if(isFictitious(networkInterface.getName())){
continue;
}
Enumeration<InetAddress> inAddresses = networkInterface.getInetAddresses();
while (inAddresses.hasMoreElements()) {
InetAddress inetAddress = inAddresses.nextElement();
if(inetAddress instanceof Inet4Address && !StringHelper.isBlank(inetAddress.getHostAddress())) {
//本机的地址,以127开头的IP地址
if (inetAddress.isLoopbackAddress()) {
LOCAL_IPS.add(inetAddress);
}
//地区本地地址,内网地址以10,172,192开头的IP地址
else if (inetAddress.isSiteLocalAddress() && !inetAddress.isAnyLocalAddress()) {
INNER_IPS.add(inetAddress);
}
//其他地址可认为外网地址
if(!inetAddress.isAnyLocalAddress()
&& !inetAddress.isLoopbackAddress()
&& !inetAddress.isLinkLocalAddress()
&& !inetAddress.isSiteLocalAddress()) {
OUTER_IPS.add(inetAddress);
}
}
}
}
} catch (Exception e) {
throw new RuntimeException("To find device all address error.....", e);
}
}
@SuppressWarnings("unused") //以网卡顺序排序
private static String MIN_LB_IP, MAX_LB_IP, MIN_INNER_IP, MAX_INNER_IP, MIN_OUTER_IP, MAX_OUTER_IP;
/** 最小本地IP **/
public static String minLocalIp(){
return machineIP(MIN_LB_IP, () -> CollectsHelper.head(LOCAL_IPS));
}
/** 最大本地IP **/
public static String maxLocalIp(){
return machineIP(MAX_LB_IP, () -> CollectsHelper.head(LOCAL_IPS));
}
/** 最小内网IP **/
public static String minInnerIp(){
return machineIP(MIN_INNER_IP, () -> CollectsHelper.head(INNER_IPS));
}
/** 最大内网IP **/
public static String maxInnerIp(){
return machineIP(MAX_INNER_IP, () -> CollectsHelper.end(INNER_IPS));
}
/** 最小外网IP **/
public static String minOuterIp() {
return machineIP(MIN_OUTER_IP, () -> CollectsHelper.head(OUTER_IPS));
}
/** 最大外网IP **/
public static String maxOuterIp() {
return machineIP(MAX_OUTER_IP, () -> CollectsHelper.end(OUTER_IPS));
}
/** 获取本机网卡IP **/
public static String machineIP() {
String ip = NetworkHelper.maxInnerIp();
if(StringHelper.isBlank(ip)) {
ip = NetworkHelper.minInnerIp();
}
if(StringHelper.isBlank(ip)) {
ip = NetworkHelper.maxOuterIp();
}
if(StringHelper.isBlank(ip)) {
ip = NetworkHelper.minOuterIp();
}
if(StringHelper.isBlank(ip)) {
ip = NetworkHelper.maxLocalIp();
}
if(StringHelper.isBlank(ip)) {
ip = NetworkHelper.minLocalIp();
}
if(StringHelper.isBlank(ip)) {
LOG.warn("can not find the machine ip.....");
return StringHelper.EMPTY;
}
return ip;
}
/** IPv4转换成十进制数 **/
public static long ip2long(String ip) {
String[] p = StringHelper.defaultString(ip).split("\\.");
if (p.length == 4) {
int p1 = ((Integer.valueOf(p[0]) << 24) & 0xFF000000);
int p2 = ((Integer.valueOf(p[1]) << 16) & 0x00FF0000);
int p3 = ((Integer.valueOf(p[2]) << 8) & 0x0000FF00);
int p4 = ((Integer.valueOf(p[3]) << 0) & 0x000000FF);
return ((p1 | p2 | p3 | p4) & 0xFFFFFFFFL);
}
return 0;
}
/** 十进制数转换成IPv4 **/
public static String long2ip(long ip) {
StringBuilder sb = new StringBuilder();
sb.append((ip >> 24) & 0xFF).append('.')
.append((ip >> 16) & 0xFF).append('.')
.append((ip >> 8) & 0xFF).append('.')
.append((ip >> 0) & 0xFF);
return sb.toString();
}
/** 获取客户端真实IP **/
public static String ofClientIp(HttpServletRequest request) {
String fromSource = "X-Forwarded-For";
String ip = request.getHeader("X-Forwarded-For");
if (noMappingIp(ip)) {
fromSource = "Proxy-Client-IP";
ip = request.getHeader("Proxy-Client-IP");
}
if (noMappingIp(ip)) {
fromSource = "WL-Proxy-Client-IP";
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (noMappingIp(ip)) {
fromSource = "X-Real-IP";
ip = request.getHeader("X-Real-IP");
}
if (noMappingIp(ip)) {
ip = request.getRemoteAddr();
fromSource = "request.getRemoteAddr";
}
LOG.debug("GET Client IP: {}, fromSource: {}", ip, fromSource);
return ip.equals("0:0:0:0:0:0:0:1") ? machineIP() : ip.split(",")[0].trim();
}
/** 获取本地 HOST NAME **/
public static String localHostName() {
String cn = System.getenv("COMPUTERNAME");
if (!StringHelper.isBlank(cn)) {
return cn;
} else {
try {
return (InetAddress.getLocalHost()).getHostName();
} catch (UnknownHostException uhe) {
// host = "hostname: hostname"
String host = uhe.getMessage();
if (!StringHelper.isBlank(host)) {
int colon = host.indexOf(':');
if (colon > 0) {
return host.substring(0, colon);
}
}
return "UnknownHost";
}
}
}
/** 需要返回JSON数据 **/
public static boolean needReplyJson(HttpServletRequest request) {
String reply = request.getHeader(RequestHeader.ReplyFormat.name());
//return StringHelper.isBlank(reply) || IConstant.HTTP_REPLY_JSON.equalsIgnoreCase(reply);
return IConstant.HTTP_REPLY_JSON.equalsIgnoreCase(reply);
}
/** JSONP请求 **/
public static boolean isJsonp(HttpServletRequest request) {
return !StringHelper.isBlank(request.getParameter(IConstant.JSONP_CB));
}
private static boolean noMappingIp(String ip) {return StringHelper.isBlank(ip) || "unknown".equalsIgnoreCase(ip);}
private static boolean isFictitious(String name) {
return StringHelper.defaultString(name).startsWith("docker");
}
private static String machineIP(String rs, Supplier<Optional<InetAddress>> supplier) {
if(StringHelper.isBlank(rs)) {
Optional<InetAddress> itOpt = supplier.get();
if (itOpt.isPresent()) {
rs = itOpt.get().getHostAddress();
}
}
return StringHelper.defaultString(rs);
}
}
| [
"[email protected]"
] | |
65b1bb3a9cdba72118d1b56361d2d3751c6f9747 | bb8a2e03a863dfdf42912becac2dc61dafda44bd | /Tree/124. Binary Tree Maximum Path Sum.java | 5e1ace8c45b2075da6033887f7133ad91aa40977 | [
"MIT"
] | permissive | aspineon/Algorithms-in-Java-Swift-CPP | ce58058bc6a6735c2c4b1b7f78081e8c46f94ef8 | da3e776db08c386cc6b593e8a6f9c28519fa6181 | refs/heads/master | 2021-06-12T07:40:58.725251 | 2017-03-08T05:50:19 | 2017-03-08T05:50:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | public class Solution {
int max = Integer.MIN_VALUE;
public int maxPathSum(TreeNode root) {
helper(root);
return max;
}
private int helper(TreeNode root) {
if (root == null) return 0;
int left = Math.max(0, helper(root.left));
int right = Math.max(0, helper(root.right));
max = Math.max(left + right + root.val, max);
return Math.max(left, right) + root.val;
}
}
| [
"[email protected]"
] | |
71d9f8e2e53404fc3f10229ac6fbd9b38d305cd6 | ee568f73face604fd98c28e53f138351cb13d74d | /springsongs-activiti-service/src/main/java/io/github/springsongs/editor/ModelSaveRestResource.java | 2646a533c9ae92772b14bded860a3f28c5b254fe | [] | no_license | mawenyu-gh/SpringSongs-Cloud | 138fe2ec16b3fe97a54d7c82a6e19a2d3f210855 | 261456c3c8c6ac6335b9c81a40ccc6f3df501e79 | refs/heads/master | 2023-03-27T00:36:40.477905 | 2021-03-29T04:30:59 | 2021-03-29T04:30:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,299 | java | package io.github.springsongs.editor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.activiti.editor.constants.ModelDataJsonConstants;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Model;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.PNGTranscoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@Api(tags = "流程XML管理")
@RestController
@RequestMapping("service")
public class ModelSaveRestResource implements ModelDataJsonConstants {
protected static final Logger LOGGER = LoggerFactory.getLogger(ModelSaveRestResource.class);
@Autowired
private RepositoryService repositoryService;
@Autowired
private ObjectMapper objectMapper;
/**
* 保存流程
*
* @param modelId 模型ID
* @param name 流程模型名称
* @param description
* @param json_xml 流程文件
* @param svg_xml 图片
*/
@ApiOperation(value = "保存流程XML", notes = "保存流程XML")
@ApiImplicitParams({ @ApiImplicitParam(name = "modelId", dataType = "String"),
@ApiImplicitParam(name = "name", dataType = "String"),
@ApiImplicitParam(name = "description", dataType = "String"),
@ApiImplicitParam(name = "json_xml", dataType = "String"),
@ApiImplicitParam(name = "svg_xml", dataType = "String") })
@RequestMapping(value = "/model/{modelId}/save", method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.OK)
public void saveModel(@PathVariable String modelId, String name, String description, String json_xml,
String svg_xml) {
try {
Model model = repositoryService.getModel(modelId);
ObjectNode modelJson = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
modelJson.put(MODEL_NAME, name);
modelJson.put(MODEL_DESCRIPTION, description);
model.setMetaInfo(modelJson.toString());
model.setName(name);
repositoryService.saveModel(model);
repositoryService.addModelEditorSource(model.getId(), json_xml.getBytes("utf-8"));
InputStream svgStream = new ByteArrayInputStream(svg_xml.getBytes("utf-8"));
TranscoderInput input = new TranscoderInput(svgStream);
PNGTranscoder transcoder = new PNGTranscoder();
// Setup output
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(outStream);
// Do the transformation
transcoder.transcode(input, output);
final byte[] result = outStream.toByteArray();
repositoryService.addModelEditorSourceExtra(model.getId(), result);
outStream.close();
} catch (Exception e) {
LOGGER.error("Error saving model", e);
throw new ActivitiException("Error saving model", e);
}
}
}
| [
"[email protected]"
] | |
b9d8d75534e0e75e5568fa0cd59773e8c194ed47 | 50f946bf3c6406c042122e008de3aebb25c59c48 | /src/vk/thread/ThreadLook.java | 1896a59744475bd0b36eb93eb7fa606425d9186c | [] | no_license | vinniipooh/Vk | 707a95a95679934e7aaac3a2fd8277c86ea221b8 | 23c55ee3959273fdb5d8543f7752cec1affdd456 | refs/heads/master | 2021-01-20T05:34:21.522419 | 2017-05-05T16:38:30 | 2017-05-05T16:38:30 | 89,793,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | package vk.thread;
import javafx.scene.control.Label;
import vk.interfaces.impl.SearchForData;
import javax.swing.*;
import java.awt.*;
public class ThreadLook implements Runnable {
private SearchForData sfd = new SearchForData();
private String id;
public ThreadLook(String id) {
this.id = id;
}
@Override
public void run() {
while (true) {
if (sfd.isOnline(id)) {
JOptionPane.showMessageDialog(null, sfd.getFullName(id)+ " появился в сети!");
while (sfd.isOnline(id)) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} else {
while (!sfd.isOnline(id)) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
}
| [
"[email protected]"
] | |
bf6c872f0cdcc02f0c7cf5b917898c666cb72b16 | d32cc0dd67b4beb19603eb509b12d227c55e3beb | /FZBox/src/com/fzbox/component/db/dao/StandardConverter.java | 36dfbc041c2822d071daaa9a9fcab1ba5ab2a687 | [] | no_license | Xu-Fz/origin | c6b496643e6aa6bf007fb3602ed0bfbccc1d0ee2 | ade4370c85ad0c733fcfa83becdf386095cd56a0 | refs/heads/master | 2016-09-06T07:26:54.668516 | 2014-11-10T05:11:22 | 2014-11-10T05:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,922 | java | package com.fzbox.component.db.dao;
import java.io.Serializable;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import android.database.Cursor;
import com.fzbox.common.util.ClassUtil;
import com.fzbox.component.db.config.Column;
import com.fzbox.component.db.config.Mapping;
import com.fzbox.component.db.connection.IDatasource;
import com.fzbox.component.db.dao.mapping.ColumnMapping;
import com.fzbox.component.db.dao.mapping.TableMapping;
import com.fzbox.component.logger.Logger;
abstract public class StandardConverter extends Converter implements IConverter {
private static final String TAG = "StandardConverter";
private static final String TOKEN = "_";
private Map<String, TableMapping> tableMappings = new HashMap<String, TableMapping>();
public void init(IDatasource datasource) {
for (Mapping mapping : datasource.getMappings()) {
try {
registerObject(mapping);
} catch (SecurityException e) {
Logger.e(TAG, e.getMessage(), e);
} catch (ClassNotFoundException e) {
Logger.e(TAG, e.getMessage(), e);
}
}
}
private void registerObject(Mapping mapping) throws SecurityException, ClassNotFoundException {
String primaryKey = mapping.getPrimaryKey();
String className = mapping.getClassName();
String tableName = mapping.getTableName();
tableName = tableName == null ? ClassUtil.getTagName(className, TOKEN) : tableName;
String generator = mapping.getGenerator();
TableMapping tm = new TableMapping(className, tableName, generator);
java.lang.reflect.Field[] fields = Class.forName(className).getDeclaredFields();
for (java.lang.reflect.Field field : fields) {
String propertyName = field.getName();
boolean isPrimaryKey = propertyName.equals(primaryKey);
Column column = mapping.findColumnByPropertyName(propertyName);
String columnName = null;
String columnType = null;
String columnLimit = null;
boolean isIgnore = false;
if (column != null) {
isIgnore =
column.getIsIgnore() != null ? column.getIsIgnore()
.equalsIgnoreCase("TRUE") : false;
if (!isPrimaryKey && isIgnore) {
continue;
}
columnType = column.getColumnType();
columnName = column.getColumnName();
if (!isPrimaryKey) {
columnLimit = column.getColumnLimit();
}
}
Class<?> propertyClass = field.getType();
if (columnName == null) {
columnName = ClassUtil.getColumnName(propertyName, "_");
}
if (columnType == null) {
columnType = getDataType(propertyClass);
}
if (columnLimit == null) {
columnLimit = getDataLimit(isPrimaryKey, columnLimit);
}
ColumnMapping columnMapping =
new ColumnMapping(propertyName, propertyClass, columnName, columnType,
columnLimit, isPrimaryKey);
tm.addColumnMapping(columnMapping);
}
tableMappings.put(className, tm);
}
@Override
public List<String> getClassNames() {
return new ArrayList<String>(tableMappings.keySet());
}
@Override
public String getGeneratorByClassName(String className) {
return tableMappings.get(className).getGenerator();
}
@Override
public String getTableNameByClassName(String className) {
return tableMappings.get(className).getTableName();
}
@Override
public String getPrimaryKeyByClassName(String className) {
return tableMappings.get(className).getPrimaryKeyColumn().getColumnName();
}
public String getCreateTableSql(String className) {
TableMapping tm = tableMappings.get(className);
String createTableSql = tm.getCreateTableSql();
if (createTableSql == null) {
StringBuffer buffer = new StringBuffer();
for (ColumnMapping column : tm.getColumnMappings()) {
buffer.append(",").append(column.getColumnName()).append(" ")
.append(column.getColumnType()).append(" ").append(column.getColumnLimit());
if (column.isPrimaryKey()) {
buffer.append(" PRIMARY KEY");
}
}
StringBuffer sql = new StringBuffer();
sql.append("CREATE TABLE IF NOT EXISTS ").append(tm.getTableName()).append(" (")
.append(buffer.toString().substring(1)).append(");");
createTableSql = sql.toString();
tm.setCreateTableSql(createTableSql);
}
Logger.i(TAG, "CREATE TABLE SQL:" + createTableSql);
return createTableSql;
}
public ArrayList<String> getUpdateTableSqls(String className) {
TableMapping tm = tableMappings.get(className);
ArrayList<String> updateTableSqls = tm.getUpdateTableSqls();
if (updateTableSqls == null) {
updateTableSqls = new ArrayList<String>();
// StringBuffer sql = new StringBuffer();
// 1, Rename table.
String tableName = tm.getTableName();
String tempTableName = tableName + "_temp";
updateTableSqls.add("ALTER TABLE " + tableName + " RENAME TO " + tempTableName + ";");
// sql.append("ALTER TABLE " + tableName + " RENAME TO " + tempTableName + ";");
// 2, Create table.
StringBuffer createBuffer = new StringBuffer();
for (ColumnMapping column : tm.getColumnMappings()) {
createBuffer.append(",").append(column.getColumnName()).append(" ")
.append(column.getColumnType()).append(" ").append(column.getColumnLimit());
if (column.isPrimaryKey()) {
createBuffer.append(" PRIMARY KEY");
}
}
updateTableSqls.add("CREATE TABLE IF NOT EXISTS " + tableName + " ("
+ createBuffer.toString().substring(1) + ");");
// sql.append("CREATE TABLE IF NOT EXISTS ").append(tableName).append(" (")
// .append(createBuffer.toString().substring(1)).append(");");
// 3, Load data
StringBuffer columnsBuffer = new StringBuffer();
for (ColumnMapping column : tm.getColumnMappings()) {
columnsBuffer.append(",").append(column.getColumnName()).append(" ");
}
String columns = columnsBuffer.toString().substring(1);
updateTableSqls.add("INSERT INTO " + tableName
+ " (SELECT name FROM PRAGMA table_info(" + tempTableName + ")) "
+ " SELECT name FROM " + tempTableName + ";");
// updateTableSqls.add("INSERT INTO " + tableName
// + " (SELECT name FROM PRAGMA table_info(" + tempTableName + "))"
// + " SELECT * FROM " + tempTableName + ";");
// updateTableSqls.add("INSERT INTO " + tableName + " (" + columns + ") "
// + " SELECT * FROM " + tempTableName + ";");
// sql.append("INSERT INTO " + tableName + " (" + columns + ") " + " SELECT " + columns
// + " FROM " + tempTableName + ";");
// 4, Drop the temporary table.
updateTableSqls.add("DROP TABLE IF EXISTS " + tempTableName + ";");
// sql.append("DROP TABLE IF EXISTS " + tempTableName + ";");
tm.setUpdateTableSqls(updateTableSqls);
}
Logger.i(TAG, "UPDATE TABLE SQL:" + updateTableSqls);
return updateTableSqls;
}
private static String getColumnString(boolean havePrimary, List<ColumnMapping> columsMappings) {
StringBuffer buffer = new StringBuffer();
for (ColumnMapping column : columsMappings) {
if ((havePrimary && column.isPrimaryKey()) || !column.isPrimaryKey()) {
buffer.append(",").append(column.getColumnName());
}
}
return buffer.toString().substring(1);
}
public String getLoadSql(String className) {
TableMapping tm = tableMappings.get(className);
String loadSql = tm.getLoadSql();
if (loadSql == null) {
StringBuffer sql = new StringBuffer();
sql.append("SELECT T.* FROM ").append(tm.getTableName()).append(" T where T.")
.append(tm.getPrimaryKeyColumn().getColumnName()).append(" = ?;");
loadSql = sql.toString();
tm.setLoadSql(loadSql);
}
Logger.i(TAG, "LOAD SQL:" + loadSql);
return loadSql;
}
public String getInsertSql(String className) {
TableMapping tm = tableMappings.get(className);
String insertSql = tm.getInsertSql();
if (insertSql == null) {
boolean isIdentity = IConverter.GENERATOR.IDENTITY.equalsIgnoreCase(tm.getGenerator());
String columnString = getColumnString(!isIdentity, tm.getColumnMappings());
StringBuffer sql = new StringBuffer();
sql.append("INSERT INTO ").append(tm.getTableName()).append(" (").append(columnString)
.append(") VALUES (");
StringBuffer buffer = new StringBuffer();
if (!isIdentity) {
buffer.append(",?");
}
for (int i = 1; i < tm.getColumnSize(); i++) {
buffer.append(",?");
}
if (!buffer.toString().equals("")) {
sql.append(buffer.toString().substring(1));
}
sql.append(");");
insertSql = sql.toString();
tm.setInsertSql(insertSql);
}
Logger.i(TAG, "INSERT SQL:" + insertSql);
return insertSql;
}
public String getUpdateSql(String className) {
TableMapping tm = tableMappings.get(className);
String updateSql = tm.getUpdateSql();
if (updateSql == null) {
StringBuffer sql = new StringBuffer();
sql.append("UPDATE ").append(tm.getTableName()).append(" SET ");
StringBuffer buffer = new StringBuffer();
for (ColumnMapping cm : tm.getColumnMappings()) {
if (!cm.isPrimaryKey()) {
buffer.append(",").append(cm.getColumnName()).append(" = ?");
}
}
sql.append(buffer.toString().substring(1)).append(" WHERE ")
.append(tm.getPrimaryKeyColumn().getColumnName()).append(" = ?;");
updateSql = sql.toString();
tm.setUpdateSql(updateSql);
}
Logger.i(TAG, "UPDATE SQL:" + updateSql);
return updateSql;
}
public String getDeleteSql(String className) {
TableMapping tm = tableMappings.get(className);
String deleteSql = tm.getDeleteSql();
if (deleteSql == null) {
StringBuffer sql = new StringBuffer();
sql.append("DELETE FROM ").append(tm.getTableName()).append(" WHERE ")
.append(tm.getPrimaryKeyColumn().getColumnName()).append(" = ?;");
deleteSql = sql.toString();
tm.setDeleteSql(deleteSql);
}
Logger.i(TAG, "DELETE SQL:" + deleteSql);
return deleteSql;
}
public String getFindAllSql(String className) {
TableMapping tm = tableMappings.get(className);
String findSql = tm.getFindSql();
if (findSql == null) {
StringBuffer sql = new StringBuffer();
sql.append("SELECT T.* FROM ").append(tm.getTableName()).append(" T;");
findSql = sql.toString();
tm.setFindSql(findSql);
}
Logger.i(TAG, "FIND ALL SQL:" + findSql);
return findSql;
}
public Object[] getInsertValues(Object instance) throws Exception {
TableMapping tm = tableMappings.get(instance.getClass().getName());
int size = tm.getColumnMappings().size();
boolean isIdentity = IConverter.GENERATOR.IDENTITY.equalsIgnoreCase(tm.getGenerator());
Object[] objects = new Object[isIdentity ? size - 1 : size];
int i = 0;
for (ColumnMapping cm : tm.getColumnMappings()) {
if (!(cm.isPrimaryKey() && isIdentity)) {
String propertyName = cm.getPropertyName();
Object value = ClassUtil.getValueByProperty(propertyName, instance);
if (value instanceof Date) {
SimpleDateFormat format =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault());
value = format.format((Date) value);
}
objects[i] = value;
i++;
}
}
return objects;
}
public Object[] getUpdateValues(Object instance) throws Exception {
TableMapping tm = tableMappings.get(instance.getClass().getName());
int size = tm.getColumnMappings().size();
Object[] objects = new Object[size];
int i = 0;
for (ColumnMapping cm : tm.getColumnMappings()) {
if (!cm.isPrimaryKey()) {
String propertyName = cm.getPropertyName();
Object value = ClassUtil.getValueByProperty(propertyName, instance);
if (value instanceof Date) {
value = changeDateToString((Date) value);
}
objects[i] = value;
i++;
}
}
String primaryPropertyName = tm.getPrimaryKeyColumn().getPropertyName();
Object value = ClassUtil.getValueByProperty(primaryPropertyName, instance);
objects[i] = value;
return objects;
}
public Serializable setIdValue(Object instance, IdBuilder idBuilder) throws Exception {
TableMapping tableMapping = tableMappings.get(instance.getClass().getName());
String generator = tableMapping.getGenerator();
if (IConverter.GENERATOR.INCREMENT.equalsIgnoreCase(generator) && idBuilder != null) {
long idValue = idBuilder.nextValue();
ClassUtil.copyValueToProperty(instance, tableMapping.getPrimaryKeyColumn()
.getColumnName(), idValue);
return idValue;
}
return null;
}
public Object readObject(Cursor cursor, String className) throws Exception {
if (!cursor.moveToFirst()) {
return null;
}
TableMapping tableMapping = tableMappings.get(className);
Object instance = ClassUtil.createInstance(className);
for (ColumnMapping cm : tableMapping.getColumnMappings()) {
String columnName = cm.getColumnName();
String property = cm.getPropertyName();
Class<?> propertyClass = cm.getPropertyType();
Object value = readValue(cursor, propertyClass, columnName);
ClassUtil.copyValueToProperty(instance, property, value);
}
return instance;
}
public List<Object> readResultList(Cursor cursor, String className) throws Exception {
if (!cursor.moveToFirst()) {
return null;
}
TableMapping tableMapping = tableMappings.get(className);
List<Object> list = new ArrayList<Object>();
do {
Object instance = ClassUtil.createInstance(className);
for (ColumnMapping cm : tableMapping.getColumnMappings()) {
String columnName = cm.getColumnName();
String property = cm.getPropertyName();
Class<?> propertyClass = cm.getPropertyType();
Object value = readValue(cursor, propertyClass, columnName);
ClassUtil.copyValueToProperty(instance, property, value);
}
list.add(instance);
} while (cursor.moveToNext());
return list;
}
protected String getDataLimit(boolean isPrimaryKey, String dataLimit) {
return isPrimaryKey ? "not null" : dataLimit == null ? "null" : dataLimit;
}
public Map<String, TableMapping> getTableMappings() {
return tableMappings;
}
public void setTableMappings(Map<String, TableMapping> tableMappings) {
this.tableMappings = tableMappings;
}
protected Object readValue(Cursor cursor, Class<?> propertyClass, String columnName) {
Object value = null;
int index = cursor.getColumnIndex(columnName);
if (long.class.equals(propertyClass) || Long.class.equals(propertyClass)) {
value = cursor.getLong(index);
} else if (int.class.equals(propertyClass) || Integer.class.equals(propertyClass)) {
value = cursor.getInt(index);
} else if (String.class.equals(propertyClass)) {
value = cursor.getString(index);
} else if (float.class.equals(propertyClass) || Float.class.equals(propertyClass)) {
value = cursor.getFloat(index);
} else if (double.class.equals(propertyClass) || Double.class.equals(propertyClass)) {
value = cursor.getDouble(index);
} else if (boolean.class.equals(propertyClass) || Boolean.class.equals(propertyClass)) {
value = cursor.getInt(index) != 0;
} else if (Date.class.equals(propertyClass)) {
String date = cursor.getString(index);
if (date != null) {
value = changeStringToDate(date);
}
} else if (Timestamp.class.equals(propertyClass)) {
String time = cursor.getString(index);
if (time != null) {
value = changeStringToTimestamp(time);
}
} else if (byte[].class.equals(propertyClass)) {
value = cursor.getBlob(index);
}
return value;
}
protected String getDataType(Class<?> propertyClass) {
if (String.class.equals(propertyClass)) {
return getColumnTypeForString();
} else if (Integer.class.equals(propertyClass) || int.class.equals(propertyClass)) {
return getColumnTypeForInteger();
} else if (Long.class.equals(propertyClass) || long.class.equals(propertyClass)) {
return getColumnTypeForLong();
} else if (Double.class.equals(propertyClass) || double.class.equals(propertyClass)) {
return getColumnTypeForDouble();
} else if (Float.class.equals(propertyClass) || float.class.equals(propertyClass)) {
return getColumnTypeForFloat();
} else if (Boolean.class.equals(propertyClass) || boolean.class.equals(propertyClass)) {
return getColumnTypeForBoolean();
} else if (byte[].class.equals(propertyClass)) {
return getColumnTypeForBytes();
} else if (java.sql.Date.class.equals(propertyClass)
|| java.util.Date.class.equals(propertyClass)) {
return getColumnTypeForDate();
} else if (Timestamp.class.equals(propertyClass)) {
return getColumnTypeForTimestamp();
}
return null;
}
abstract protected String getColumnTypeForBoolean();
abstract protected String getColumnTypeForString();
abstract protected String getColumnTypeForInteger();
abstract protected String getColumnTypeForLong();
abstract protected String getColumnTypeForDouble();
abstract protected String getColumnTypeForFloat();
abstract protected String getColumnTypeForBytes();
abstract protected String getColumnTypeForDate();
abstract protected String getColumnTypeForTimestamp();
}
| [
"[email protected]"
] | |
4370fde6ccdf84576038ba2f36e6b3b99f0141c5 | 36bbde826ff3e123716dce821020cf2a931abf6e | /plugin/core/src/main/gen/com/perl5/lang/perl/psi/PsiPerlNyiStatement.java | 0b3431a57c094764f75d5ace2ad2e1bc91eab594 | [
"Apache-2.0"
] | permissive | Camelcade/Perl5-IDEA | 0332dd4794aab5ed91126a2c1ecd608f9c801447 | deecc3c4fcdf93b4ff35dd31b4c7045dd7285407 | refs/heads/master | 2023-08-08T07:47:31.489233 | 2023-07-27T05:18:40 | 2023-07-27T06:17:04 | 33,823,684 | 323 | 79 | NOASSERTION | 2023-09-13T04:36:15 | 2015-04-12T16:09:15 | Java | UTF-8 | Java | false | true | 253 | java | // This is a generated file. Not intended for manual editing.
package com.perl5.lang.perl.psi;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
public interface PsiPerlNyiStatement extends PsiElement {
}
| [
"[email protected]"
] | |
abbc420b859e91d2411a4d228e5c2092e26e03cf | f1f4ac96bd32ac3460b2c7bc228b06cd94282594 | /src/main/java/com/alexbobryshev/music_albums/MusicAlbumsApplication.java | ccc497266337a19c7b0bcdd2b3a246b82829bab2 | [] | no_license | AlexBobryshev93/Music-Albums | dca43266a4588a904566a42bd7cb56517deaf61e | fdbf27b8b24c8e122bf00e22812c6931fb241d4d | refs/heads/master | 2022-02-03T21:08:02.748260 | 2019-12-22T21:53:07 | 2019-12-22T21:53:07 | 203,438,317 | 0 | 1 | null | 2022-01-21T23:29:14 | 2019-08-20T19:08:21 | Java | UTF-8 | Java | false | false | 345 | java | package com.alexbobryshev.music_albums;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MusicAlbumsApplication {
public static void main(String[] args) {
SpringApplication.run(MusicAlbumsApplication.class, args);
}
}
| [
"[email protected]"
] | |
ec74a5540c046982c05ccee04451b5bbdda607af | 709e240e4dcdfc70fbb74e920c4997ef578db8c9 | /Appliance.java | a1f2c5fef393bf7a0345cdf866135868d2172ea9 | [] | no_license | dt-mtl/assigns | c36d7106a5acb8665947d9b40862445db889c209 | 0d04876cf22806b023113fd75fd4abdf7a97766a | refs/heads/master | 2020-12-18T13:22:48.738095 | 2020-01-31T21:06:32 | 2020-01-31T21:06:32 | 235,398,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,739 | java |
import java.util.Scanner;
// -----------------------------------------------------
// Assignment 1
// This particular program creates an appliance item which will then be used and integrated
// Written by: Daniel Torres 40101143
// -----------------------------------------------------
public class Appliance {
//object attributes
private String type;
private String brand;
private static int numAppliances=0;
private long serialNum=1000000;
//private static long serialNum=1000000+(long)numAppliances;
private double price;
private final String[] types= {"Microwave","Fridge","Washer","Dryer","Freezer","Stove",
"Dishwasher","Water Heaters","Air Conditioner"};
//serial number counter
{
//serialNum++;
numAppliances +=1;
}
//constructors
//default
Appliance(){
this.type=types[0];
this.brand="Samsung";
this.price=1.00;
serialNum+=(long)numAppliances;
}
//copy Constructor
Appliance(Appliance copy){
serialNum+=(long) numAppliances;
this.type=copy.getType();
this.brand=copy.getBrand();
this.price=copy.getPrice();
}
//accessors
public String getType() {
return this.type;
}
public String getBrand() {
return this.brand;
}
public long getSerial() {
return serialNum;
}
public double getPrice() {
return this.price;
}
//mutators
public void setType(String given) {
int c=0;
boolean isit=false;
Scanner input=new Scanner(System.in);
//check the type is correct
do{
for (int w = 0; w < types.length; w++) {
if (given.equals(types[w])) {
System.out.println(types[w]);
isit = true;
}
}
if(!isit) {
System.out.print("Give an appropriate Appliance type otherwise type q to leave the default Appliance type ");
given=input.nextLine();
c++;
System.out.println(c);
}
}while(!isit && !given.equals("q"));
this.type=given;
}
public void setBrand(String brand) {
this.brand=brand;
}
public void setPrice(double price) {
this.price=price;
}
//methods
//method that tells how many appliances have been created
public static int findNumberOfCreatedAppliances(){
return numAppliances;
}
//method that overrides the to string method
public String toString() {
String info;
info="\n\tAppliance Serial #: "+getSerial()+"\n\tBrand: "+getBrand()+"\n\tType: "+getType()+"\n\tPrice: "+getPrice();
return info;
}
//method that overrides the equals method and checks for equality
public boolean equals(Appliance other){
if(other.getBrand().equals(this.brand) && other.getPrice()==this.price && other.getType().equals(this.type))
return true;
else
return false;
}
}
| [
"[email protected]"
] | |
26f1acac9428bae5e24dd1ed96ce28604112b1ea | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12798-62-23-PESA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/internal/template/InternalTemplateManager_ESTest_scaffolding.java | dadb6907fde6acafbb996533c837b21fe825c68a | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Apr 03 23:10:21 UTC 2020
*/
package com.xpn.xwiki.internal.template;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class InternalTemplateManager_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"[email protected]"
] | |
abcc05af8414bf8e6b3bf4a8f20083b603345b06 | 632d37ba44ced65e264899b8750965211891a32e | /src/main/java/com/example/xiaochun/XiaochunApplication.java | 1609c6e7a9f2d1383ac3c41b39230a7dd16cb196 | [] | no_license | Liuany/supper_manager_backend | b92dcccebd73d6ae78e9a56b7b467746b48c1cd1 | ed950ee9677d68b6637ce49d4d865d2b5f674a5f | refs/heads/main | 2023-07-13T19:40:44.224241 | 2021-08-27T01:17:10 | 2021-08-27T01:17:10 | 353,975,550 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package com.example.xiaochun;
import com.example.xiaochun.jwt.JwtAuthenticationFilter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
@MapperScan("com.example.xiaochun.mapper") //扫描mapper包,实现mapper依赖注入
@SpringBootApplication
public class XiaochunApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(XiaochunApplication.class, args);
}
@Bean
public FilterRegistrationBean jwtFilter () {
final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
JwtAuthenticationFilter filter = new JwtAuthenticationFilter();
registrationBean.setFilter(filter);
return registrationBean;
}
@Override
protected SpringApplicationBuilder configure (SpringApplicationBuilder builder) {
return builder.sources(XiaochunApplication.class);
}
}
| [
"[email protected]"
] | |
410947eb57a6a8603e5030b7eda969e5bc950b62 | 86e4434403fdafb52c66dde6f211ac5b648e84b1 | /src/main/java/com/jsoniter/output/CodegenImplArray.java | 76108906bc872cf45d4359ec18a7d7044bb38750 | [
"MIT"
] | permissive | ricardoletgo/java | 1d35213409d97f20eb3a81c29cb08277127324e6 | 059da6a921a9eac8671fb59f2dd0c1a94709f807 | refs/heads/master | 2021-01-23T00:52:41.156284 | 2017-05-23T03:32:50 | 2017-05-23T03:32:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,934 | java | package com.jsoniter.output;
import java.lang.reflect.Type;
import java.util.*;
class CodegenImplArray {
public static CodegenResult genArray(String cacheKey, Class clazz) {
Class compType = clazz.getComponentType();
if (compType.isArray()) {
throw new IllegalArgumentException("nested array not supported: " + clazz.getCanonicalName());
}
boolean isCollectionValueNullable = true;
if (cacheKey.endsWith("__value_not_nullable")) {
isCollectionValueNullable = false;
}
if (compType.isPrimitive()) {
isCollectionValueNullable = false;
}
CodegenResult ctx = new CodegenResult();
ctx.append("public static void encode_(java.lang.Object obj, com.jsoniter.output.JsonStream stream) throws java.io.IOException {");
ctx.append(String.format("%s[] arr = (%s[])obj;", compType.getCanonicalName(), compType.getCanonicalName()));
ctx.append("if (arr.length == 0) { return; }");
ctx.buffer('[');
ctx.append("int i = 0;");
ctx.append(String.format("%s e = arr[i++];", compType.getCanonicalName()));
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("while (i < arr.length) {");
ctx.append("stream.write(',');");
ctx.append("e = arr[i++];");
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("}");
ctx.buffer(']');
ctx.append("}");
return ctx;
}
public static CodegenResult genCollection(String cacheKey, Class clazz, Type[] typeArgs) {
Type compType = Object.class;
if (typeArgs.length == 0) {
// default to List<Object>
} else if (typeArgs.length == 1) {
compType = typeArgs[0];
} else {
throw new IllegalArgumentException(
"can not bind to generic collection without argument types, " +
"try syntax like TypeLiteral<List<Integer>>{}");
}
if (clazz == List.class) {
clazz = ArrayList.class;
} else if (clazz == Set.class) {
clazz = HashSet.class;
}
if (List.class.isAssignableFrom(clazz)) {
return genList(cacheKey, clazz, compType);
} else {
return genCollection(cacheKey, clazz, compType);
}
}
private static CodegenResult genList(String cacheKey, Class clazz, Type compType) {
boolean isCollectionValueNullable = true;
if (cacheKey.endsWith("__value_not_nullable")) {
isCollectionValueNullable = false;
}
CodegenResult ctx = new CodegenResult();
ctx.append("public static void encode_(java.lang.Object obj, com.jsoniter.output.JsonStream stream) throws java.io.IOException {");
ctx.append("java.util.List list = (java.util.List)obj;");
ctx.append("int size = list.size();");
ctx.append("if (size == 0) { return; }");
ctx.buffer('[');
ctx.append("java.lang.Object e = list.get(0);");
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("for (int i = 1; i < size; i++) {");
ctx.append("stream.write(',');");
ctx.append("e = list.get(i);");
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("}");
ctx.buffer(']');
ctx.append("}");
return ctx;
}
private static CodegenResult genCollection(String cacheKey, Class clazz, Type compType) {
boolean isCollectionValueNullable = true;
if (cacheKey.endsWith("__value_not_nullable")) {
isCollectionValueNullable = false;
}
CodegenResult ctx = new CodegenResult();
ctx.append("public static void encode_(java.lang.Object obj, com.jsoniter.output.JsonStream stream) throws java.io.IOException {");
ctx.append("java.util.Iterator iter = ((java.util.Collection)obj).iterator();");
ctx.append("if (!iter.hasNext()) { return; }");
ctx.buffer('[');
ctx.append("java.lang.Object e = iter.next();");
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("while (iter.hasNext()) {");
ctx.append("stream.write(',');");
ctx.append("e = iter.next();");
if (isCollectionValueNullable) {
ctx.append("if (e == null) { stream.writeNull(); } else {");
CodegenImplNative.genWriteOp(ctx, "e", compType, true);
ctx.append("}");
} else {
CodegenImplNative.genWriteOp(ctx, "e", compType, false);
}
ctx.append("}");
ctx.buffer(']');
ctx.append("}");
return ctx;
}
}
| [
"[email protected]"
] | |
4fe80718e85f3131d99b8204191d774e38ab9a9c | 29a4875fbf7f60ebd6bb99cf1245a19f4c0c7a13 | /src/main/java/com/definex/liquibasehibernate/LiquibasehibernateApplication.java | 7946898c5e996140d4f80378312e775906f8fa4a | [] | no_license | cambazoguzcan/hbmliquibase | c37b97a02ef3ea6280d7647353d278055874704f | bc47c625275cf9122d335a1c35f448bcc38ab9f1 | refs/heads/main | 2023-07-11T19:35:57.916682 | 2021-08-24T13:06:00 | 2021-08-24T13:06:00 | 399,453,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.definex.liquibasehibernate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class LiquibasehibernateApplication {
public static void main(String[] args) {
SpringApplication.run(LiquibasehibernateApplication.class, args);
}
}
| [
"[email protected]"
] | |
d09cf6576119d5145a43738e4baf2742c51d7976 | 70a1761fe3733fbd20391253434fe0dd64654544 | /app/src/main/java/com/firsteconomy/nytapp/db/BookDao.java | 878e31bebfd79b760f1fd0eb75b81908538e7810 | [] | no_license | raig4359/Nytpp | f237aa68dc4a91004ad1f33f75fbba8d5bab1c04 | c922ef994f3531ad40a49a35f6b8e6550642a5ef | refs/heads/master | 2020-03-25T23:40:41.222471 | 2019-05-14T14:09:57 | 2019-05-14T14:09:57 | 144,287,026 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,047 | java | package com.firsteconomy.nytapp.db;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import com.firsteconomy.nytapp.model.Book;
import com.firsteconomy.nytapp.model.BookCategory;
import com.firsteconomy.nytapp.model.CategorisedBooks;
import java.util.List;
/**
* Created by Gaurav on 07-09-2018.
*/
@Dao
public interface BookDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
long[] insertCategories(BookCategory... categories);
@Insert(onConflict = OnConflictStrategy.REPLACE)
long[] insertBooks(List<Book> books);
@Query("SELECT * FROM Book")
List<Book> getBooks();
@Query("SELECT * FROM Book")
LiveData<List<Book>> getBooksAsLiveData();
@Query("SELECT * FROM BookCategory")
List<BookCategory> getBookCategories();
@Query("SELECT * FROM BookCategory")
List<CategorisedBooks> getCategorisedBooks();
}
| [
"[email protected]"
] | |
86d59ddccfb3574733213884406de957e4ccac7b | bd1cba2a438ce47eb64eba26ce6b617c3bf4ac0f | /Documents/workspace-sts-3.9.8.RELEASE/DI/src/main/java/com/example/demo/sevice/MailSenderInterface.java | 967aa12fd8b53d62cf7233896c1dbf37eeb1afe3 | [] | no_license | TejasviJain/springdemo | 8567add435362ec0c5be1027bed9a4d4cb085881 | a6b6df14b2e03f968f2b316b4595af48a352e551 | refs/heads/master | 2020-05-09T21:21:16.952637 | 2019-04-29T07:04:10 | 2019-04-29T07:04:10 | 181,440,694 | 0 | 0 | null | 2019-04-29T07:18:44 | 2019-04-15T08:04:51 | Java | UTF-8 | Java | false | false | 105 | java | package com.example.demo.sevice;
public interface MailSenderInterface {
public String sendMail();
}
| [
"[email protected]"
] | |
c259ff3ddfd6bea5207b4051e2664e5751ede073 | 73cee787f7365cd659b33d14eeb40de4ea3d9e67 | /core/src/main/java/demo/java/v2c07/RasterImageTest/RasterImageTest.java | f9b8642db8cf3b0d85a0e4bfdeb0eb305a3a2eef | [
"MIT"
] | permissive | myid999/javademo | ada3bbaebdf070f62db47f16481eca2994a55f56 | c583566d2e00011575ad8252791119bc2693e05b | refs/heads/master | 2021-01-10T06:54:18.755809 | 2016-02-25T15:05:12 | 2016-02-25T15:05:12 | 50,890,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,612 | java | package demo.java.v2c07.RasterImageTest;
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
/**
* This program demonstrates how to build up an image from individual pixels.
* @version 1.13 2007-08-16
* @author Cay Horstmann
*/
public class RasterImageTest
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
JFrame frame = new RasterImageFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}
/**
* This frame shows an image with a Mandelbrot set.
*/
class RasterImageFrame extends JFrame
{
public RasterImageFrame()
{
setTitle("RasterImageTest");
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
BufferedImage image = makeMandelbrot(DEFAULT_WIDTH, DEFAULT_HEIGHT);
add(new JLabel(new ImageIcon(image)));
}
/**
* Makes the Mandelbrot image.
* @param width the width
* @parah height the height
* @return the image
*/
public BufferedImage makeMandelbrot(int width, int height)
{
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
WritableRaster raster = image.getRaster();
ColorModel model = image.getColorModel();
Color fractalColor = Color.red;
int argb = fractalColor.getRGB();
Object colorData = model.getDataElements(argb, null);
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
{
double a = XMIN + i * (XMAX - XMIN) / width;
double b = YMIN + j * (YMAX - YMIN) / height;
if (!escapesToInfinity(a, b)) raster.setDataElements(i, j, colorData);
}
return image;
}
private boolean escapesToInfinity(double a, double b)
{
double x = 0.0;
double y = 0.0;
int iterations = 0;
while (x <= 2 && y <= 2 && iterations < MAX_ITERATIONS)
{
double xnew = x * x - y * y + a;
double ynew = 2 * x * y + b;
x = xnew;
y = ynew;
iterations++;
}
return x > 2 || y > 2;
}
private static final double XMIN = -2;
private static final double XMAX = 2;
private static final double YMIN = -2;
private static final double YMAX = 2;
private static final int MAX_ITERATIONS = 16;
private static final int DEFAULT_WIDTH = 400;
private static final int DEFAULT_HEIGHT = 400;
}
| [
"zhou@zhou-PC"
] | zhou@zhou-PC |
789d97314631fbaa15524c0e16d63c745758cdc2 | c9f9ecec7b687e41d0dd491b9c6a9b0bbd4b9167 | /gy_assignment/1/Monopoly/src/assignment1/Main.java | 32139e38d68b29d3ac4594453f18cf48b6ff8780 | [] | no_license | nghiaxlee/practical-sw-1 | d309b5dccfcae8aa2e17f3da01cf906c61c19f55 | 840b43386a8e078b02d0733ee273c37ac33c5a70 | refs/heads/master | 2020-05-30T17:34:41.746323 | 2019-06-02T17:32:46 | 2019-06-02T17:32:46 | 189,876,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,150 | java | // Le Minh Nghia
//
// AAOGMU
//
// First assignment - exercise number 4
//
// 2018/10/10 18:17:37
//
// This solution was submitted and prepared by Le Minh Nghia, AAOGMU for the
// First assignment - exercise number 4 assignment of the Practical software engineering I. course.
//
// I declare that this solution is my own work.
//
// I have not copied or used third party solutions.
//
// I have not passed my solution to my classmates, neither made it public.
//
// Students’ regulation of Eötvös Loránd University (ELTE Regulations
// Vol. II. 74/C. § ) states that as long as a student presents another
// student’s work - or at least the significant part of it - as his/her own
// performance, it will count as a disciplinary fault. The most serious
// consequence of a disciplinary fault can be dismissal of the student from
// the University.
package assignment1;
import java.io.FileNotFoundException;
import java.util.NoSuchElementException;
public class Main {
public static void main(String[] args) {
// TODO: Write out the history of the game;
Monopoly game = new Monopoly();
try {
game.read("assignments-1-input.txt");
} catch (FileNotFoundException e) {
System.out.println("File not found!");
System.exit(-1);
} catch (InvalidInputException e) {
System.out.println("Invalid input!");
System.exit(-1);
} catch (NoSuchElementException e) {
System.out.println("Not enough elements or invalid input!");
System.exit(-1);
} catch (InfiniteLoopGameException e) {
System.out.println("This input will cause infinite loop game!");
System.exit(-1);
} catch (NegativeInputException e) {
System.out.println("The input should not have negative numbers!");
System.exit(-1);
}
try {
game.start();
} catch (NotEnoughRollException e) {
System.out.println("Error in testing: Not enough turns to find the winner");
System.exit(-1);
}
}
}
| [
"[email protected]"
] | |
20059269cd3d9706a028cc99789a96529570201a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_c9ff8eab6c641babc74728a8381ab28617c0a4f5/ErrorHandlingTab/2_c9ff8eab6c641babc74728a8381ab28617c0a4f5_ErrorHandlingTab_t.java | 2653e7dbbca713ad37c215efb7a6a13b75586b1a | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,770 | java | /*******************************************************************************
* Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Innoopract Informationssysteme GmbH - initial API and implementation
******************************************************************************/
package org.eclipse.rap.demo.controls;
import javax.servlet.http.HttpSession;
import org.eclipse.rwt.RWT;
import org.eclipse.rwt.internal.lifecycle.HtmlResponseWriter;
import org.eclipse.rwt.internal.service.ContextProvider;
import org.eclipse.rwt.internal.service.IServiceStateInfo;
import org.eclipse.rwt.lifecycle.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
public class ErrorHandlingTab extends ExampleTab {
private static final int DELAY = 2000;
public ErrorHandlingTab( final CTabFolder topFolder ) {
super( topFolder, "Error Handling" );
}
protected void createStyleControls( final Composite parent ) {
}
protected void createExampleControls( final Composite parent ) {
parent.setLayout( new GridLayout( 1, false ) );
Label lblInfo = new Label( parent, SWT.WRAP );
lblInfo.setLayoutData( new GridData( SWT.FILL, SWT.DEFAULT, true, false ) );
String info
= "Simulate a server-side session timeout.\n"
+ "Click the 'Invalidate Session' button that will invalidate the "
+ "session after a short delay.\n"
+ "Thereafter, try to proceed using the application. With the next "
+ "request, a new session is created. You are informed about that and "
+ "can start working with the new session";
lblInfo.setText( info );
Button btnInvalidateSession = new Button( parent, SWT.PUSH );
String msg = "Invalidate Session";
btnInvalidateSession.setText( msg );
final Label lblFeedback = new Label( parent, SWT.NONE );
btnInvalidateSession.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( final SelectionEvent event ) {
lblFeedback.setText( "The session will be invalidated shortly." );
lblFeedback.getParent().layout();
final HttpSession session = RWT.getSessionStore().getHttpSession();
Thread thread = new Thread( new Runnable() {
public void run() {
try {
Thread.sleep( DELAY );
session.invalidate();
} catch( InterruptedException e ) {
// ignore, invalidate won't be executed
}
}
} );
thread.start();
}
} );
Button btnErrorResponse = new Button( parent, SWT.PUSH );
btnErrorResponse.setText( "Deliver response with JavaScript error" );
btnErrorResponse.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( final SelectionEvent event ) {
RWT.getLifeCycle().addPhaseListener( new PhaseListener() {
private static final long serialVersionUID = 1L;
public void beforePhase( final PhaseEvent event ) {
}
public void afterPhase( final PhaseEvent event ) {
IServiceStateInfo stateInfo = ContextProvider.getStateInfo();
HtmlResponseWriter writer = stateInfo.getResponseWriter();
writer.append( "this is no valid JavaScript!" );
RWT.getLifeCycle().removePhaseListener( this );
}
public PhaseId getPhaseId() {
return PhaseId.RENDER;
}
} );
}
} );
Button btnServerException = new Button( parent, SWT.PUSH );
btnServerException.setText( "Throw uncaught server-side exeption" );
btnServerException.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( final SelectionEvent event ) {
throw new RuntimeException( "Shit happens, rama rama ding ding" );
}
} );
Button btnServerError = new Button( parent, SWT.PUSH );
btnServerError.setText( "Throw uncaught server-side error" );
btnServerError.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( final SelectionEvent event ) {
throw new SWTError( "Some error occured" );
}
} );
}
}
| [
"[email protected]"
] | |
20bb7d96c062d2c625b8e4998ad20c329c1484a8 | ffad2bcba08443bae8770749edbe8106d379eaa3 | /structure/stack/ArrayStack.java | da5dd25d228e780907502edea9cd9099e6c51c5c | [] | no_license | nanluojuexing/structure-algorithm | 7aa4ae98b238c048e75050238c9b6416c7f9c971 | 7cb2664e7d7b495702c1ae10379d2c455d2ed564 | refs/heads/master | 2023-06-24T06:29:55.771224 | 2021-12-01T15:40:56 | 2021-12-01T15:40:56 | 235,014,928 | 0 | 0 | null | 2023-06-14T22:22:54 | 2020-01-20T03:57:37 | Java | UTF-8 | Java | false | false | 1,522 | java | package structure.stack;
import structure.array.Array;
/**
* 基于数组实现的栈
*/
public class ArrayStack<E> implements Stack<E> {
private Array<E> array;
// 初始容量设置
public ArrayStack(int capacity) {
array = new Array<E>(capacity);
}
public ArrayStack() {
array = new Array<>();
}
@Override
public int getSize() {
return array.getSize();
}
@Override
public boolean isEmpty() {
return array.isEmpty();
}
/**
* 元素入栈
* @param e
*/
@Override
public void push(E e) {
// 栈是先入后出的数据结构,基于数组实现,默认将添加的元素添加到后面的位置
array.addLast(e);
}
/**
* 从栈中弹出一个元素
* @return
*/
@Override
public E pop() {
// 栈是先入后出的数据结构,基于数组实现,移除的的元素是从后面到前面开始移除
return array.removeLast();
}
/**
* 获得栈顶的元素
* @return
*/
@Override
public E peek() {
return array.getLast();
}
@Override
public String toString() {
StringBuilder res = new StringBuilder();
res.append("stack , [");
for (int i = 0; i < array.getSize(); i++) {
res.append(array.get(i));
if(i != array.getSize()-1)
res.append(",");
}
res.append("] , top");
return res.toString();
}
}
| [
"[email protected]"
] | |
41c8ce22196e2c6666108e4584af42a0b4630256 | 9d5ec959a7be2472558cff93a0282270cfecc325 | /app/src/main/java/com/farid/framework/framework_repository/core/SQLitesListSingleton.java | 9fcbbaa29531618384fd69860942f4c0e587f92f | [] | no_license | FaridBen95/SimpleFrameWork | d4301dbb22953e8bcafb784ef8d56e00376919a3 | 78b73bc1affbb28d628c23c8f7856b9746656ee3 | refs/heads/master | 2021-06-23T08:12:30.539950 | 2020-01-31T21:56:15 | 2020-01-31T21:56:15 | 219,148,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package com.farid.framework.framework_repository.core;
import java.util.HashMap;
public class SQLitesListSingleton {
public HashMap<String, MySqlite> sqlites = new HashMap<String, MySqlite>();
private static SQLitesListSingleton sqLitesListSingleton;
private SQLitesListSingleton(){
}
public static SQLitesListSingleton getSQLiteList(){
if(sqLitesListSingleton == null){
sqLitesListSingleton = new SQLitesListSingleton();
}
return sqLitesListSingleton;
}
}
| [
"[email protected]"
] | |
02ae743bbc1b9990680871bb2c30c4542e7506a9 | 1cb3bb19fa4a87dd6a655a930e343280b8cd4fd1 | /cp-ddd-test/src/test/java/org/cdf/ddd/runtime/registry/mock/ext/IProjectExt.java | 621b63ca2496772be7651341663256358a95f0cb | [
"Apache-2.0"
] | permissive | draco1023/cp-ddd-framework | e6150fa1cc0f0b71e83dd3fa873ccb0ad985f2ad | bb9437f1b1bd128bb2dc81c8690c0c68751fbc3f | refs/heads/master | 2022-12-27T12:21:50.124542 | 2020-10-10T16:38:33 | 2020-10-10T16:38:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | package org.cdf.ddd.runtime.registry.mock.ext;
import org.cdf.ddd.ext.IDomainExtension;
import org.cdf.ddd.runtime.registry.mock.model.FooModel;
public interface IProjectExt extends IDomainExtension {
Integer execute(FooModel model);
}
| [
"[email protected]"
] | |
be442069c6197634434509e4c7b32dcb8d7354f1 | 9df983c95d6b60124527c2f12edad076a5febd7e | /lesson5-hibernate-intro/src/main/java/com/example/entity/Employee.java | b1e717a3cea1200a73a08a7ecb8e435e65a20e91 | [] | no_license | 2apl/JD-2 | 3af0ef6ddc29f081999b2c55388cd6ff8a368769 | aeeef92aef610dfdd1155625ba10a1b4bbc311d1 | refs/heads/master | 2022-09-28T12:43:57.666443 | 2019-08-16T09:36:39 | 2019-08-16T09:36:39 | 196,144,143 | 0 | 0 | null | 2022-09-08T01:02:02 | 2019-07-10T06:21:54 | Java | UTF-8 | Java | false | false | 1,252 | java | package com.example.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* This class is appropriate to entity in DB
*/
@Entity
/**
* Appropriate table in DB, name and schema are not required, but good practice, name is taking from class name
* */
@Table(name = "employee", schema = "employee_storage")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class Employee {
@Id
/**
* AUTO - Hibernate defines one of the following 3 strategies (default IDENTITY)
* IDENTITY - Id provided by DB table, if Id column is serial
* SEQUENCE - sequence by DB table
* TABLE - another separate table from DB provided ID
*/
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* appropriate column in DB, not required, but good practice, name taking from field name
*/
@Column(name = "name")
private String name;
public Employee(String name) {
this.name = name;
}
}
| [
"[email protected]"
] | |
6c044462c68bf5ac5efd803888e73cfec2b77cf0 | 2573df4eebce0127935edcee4a786b078a7ecf87 | /src/main/java/org/brylex/javabin/db/FluffyStatement.java | ab56af41034206468fbf2155f29ab09ca5bc99de | [] | no_license | runepeter/javabin-juleavslutning | 85272201c49fd04419a4dacbc3db3278ba4e976a | 24947c7794822b6590d80be0c837f83549775258 | refs/heads/master | 2021-01-10T19:43:43.879686 | 2012-12-05T20:57:20 | 2012-12-05T20:57:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,132 | java | package org.brylex.javabin.db;
import java.sql.*;
public class FluffyStatement implements Statement {
private final Statement statement;
public FluffyStatement(final Statement statement) {
this.statement = statement;
}
@Override
public ResultSet executeQuery(String sql) throws SQLException {
try {
System.out.println("Sover i 10 sekunder...");
Thread.sleep(10000);
System.out.println("Ferdig med sovingen, nå skal det spørres.");
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return statement.executeQuery(sql);
}
@Override
public int executeUpdate(String sql) throws SQLException {
return statement.executeUpdate(sql);
}
@Override
public void close() throws SQLException {
statement.close();
}
@Override
public int getMaxFieldSize() throws SQLException {
return statement.getMaxFieldSize();
}
@Override
public void setMaxFieldSize(int max) throws SQLException {
statement.setMaxFieldSize(max);
}
@Override
public int getMaxRows() throws SQLException {
return statement.getMaxRows();
}
@Override
public void setMaxRows(int max) throws SQLException {
statement.setMaxRows(max);
}
@Override
public void setEscapeProcessing(boolean enable) throws SQLException {
statement.setEscapeProcessing(enable);
}
@Override
public int getQueryTimeout() throws SQLException {
return statement.getQueryTimeout();
}
@Override
public void setQueryTimeout(int seconds) throws SQLException {
statement.setQueryTimeout(seconds);
}
@Override
public void cancel() throws SQLException {
statement.cancel();
}
@Override
public SQLWarning getWarnings() throws SQLException {
return statement.getWarnings();
}
@Override
public void clearWarnings() throws SQLException {
statement.clearWarnings();
}
@Override
public void setCursorName(String name) throws SQLException {
statement.setCursorName(name);
}
@Override
public boolean execute(String sql) throws SQLException {
return statement.execute(sql);
}
@Override
public ResultSet getResultSet() throws SQLException {
return statement.getResultSet();
}
@Override
public int getUpdateCount() throws SQLException {
return statement.getUpdateCount();
}
@Override
public boolean getMoreResults() throws SQLException {
return statement.getMoreResults();
}
@Override
public void setFetchDirection(int direction) throws SQLException {
statement.setFetchDirection(direction);
}
@Override
public int getFetchDirection() throws SQLException {
return statement.getFetchDirection();
}
@Override
public void setFetchSize(int rows) throws SQLException {
statement.setFetchSize(rows);
}
@Override
public int getFetchSize() throws SQLException {
return statement.getFetchSize();
}
@Override
public int getResultSetConcurrency() throws SQLException {
return statement.getResultSetConcurrency();
}
@Override
public int getResultSetType() throws SQLException {
return statement.getResultSetType();
}
@Override
public void addBatch(String sql) throws SQLException {
statement.addBatch(sql);
}
@Override
public void clearBatch() throws SQLException {
statement.clearBatch();
}
@Override
public int[] executeBatch() throws SQLException {
return statement.executeBatch();
}
@Override
public Connection getConnection() throws SQLException {
return statement.getConnection();
}
@Override
public boolean getMoreResults(int current) throws SQLException {
return statement.getMoreResults(current);
}
@Override
public ResultSet getGeneratedKeys() throws SQLException {
return statement.getGeneratedKeys();
}
@Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
return statement.executeUpdate(sql, autoGeneratedKeys);
}
@Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
return statement.executeUpdate(sql, columnIndexes);
}
@Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException {
return statement.executeUpdate(sql, columnNames);
}
@Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
return statement.execute(sql, autoGeneratedKeys);
}
@Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException {
return statement.execute(sql, columnIndexes);
}
@Override
public boolean execute(String sql, String[] columnNames) throws SQLException {
return statement.execute(sql, columnNames);
}
@Override
public int getResultSetHoldability() throws SQLException {
return statement.getResultSetHoldability();
}
@Override
public boolean isClosed() throws SQLException {
return statement.isClosed();
}
@Override
public void setPoolable(boolean poolable) throws SQLException {
statement.setPoolable(poolable);
}
@Override
public boolean isPoolable() throws SQLException {
return statement.isPoolable();
}
@Override
public void closeOnCompletion() throws SQLException {
statement.closeOnCompletion();
}
@Override
public boolean isCloseOnCompletion() throws SQLException {
return statement.isCloseOnCompletion();
}
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return statement.unwrap(iface);
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return statement.isWrapperFor(iface);
}
}
| [
"[email protected]"
] | |
bad4e890fe9bf3628797f60add973593bc207769 | db97ce70bd53e5c258ecda4c34a5ec641e12d488 | /src/main/java/com/alipay/api/domain/AlipayAccount.java | 8bf9a8a4dcbbde8e2b8dd2660ff79636a50bdab3 | [
"Apache-2.0"
] | permissive | smitzhang/alipay-sdk-java-all | dccc7493c03b3c937f93e7e2be750619f9bed068 | a835a9c91e800e7c9350d479e84f9a74b211f0c4 | refs/heads/master | 2022-11-23T20:32:27.041116 | 2020-08-03T13:03:02 | 2020-08-03T13:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,409 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 支付宝用户账户信息
*
* @author auto create
* @since 1.0, 2016-10-26 17:43:39
*/
public class AlipayAccount extends AlipayObject {
private static final long serialVersionUID = 6811443188589926135L;
/**
* 支付宝用户ID
*/
@ApiField("alipay_user_id")
private String alipayUserId;
/**
* 可用余额
*/
@ApiField("available_amount")
private String availableAmount;
/**
* 不可用余额
*/
@ApiField("freeze_amount")
private String freezeAmount;
/**
* 余额总额
*/
@ApiField("total_amount")
private String totalAmount;
public String getAlipayUserId() {
return this.alipayUserId;
}
public void setAlipayUserId(String alipayUserId) {
this.alipayUserId = alipayUserId;
}
public String getAvailableAmount() {
return this.availableAmount;
}
public void setAvailableAmount(String availableAmount) {
this.availableAmount = availableAmount;
}
public String getFreezeAmount() {
return this.freezeAmount;
}
public void setFreezeAmount(String freezeAmount) {
this.freezeAmount = freezeAmount;
}
public String getTotalAmount() {
return this.totalAmount;
}
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount;
}
}
| [
"[email protected]"
] | |
5584ed760cc441bd7a29ccd8232bc69904676961 | 188e4e637fd187941df20ed1465c436cd8ce8e9b | /platforms/android/src/net/drshoggoth/SuperGemCrusherDeluxe/MainActivity.java | 7220c1a3d20a76a240d1a66b2b972bbe852f9239 | [] | no_license | jeremy-brenner/jewel-clone | cf4e8f8206ad0ca7c018426e1e9d60ad7910e468 | 007fb800ede71528fe99e1203780a45c63315364 | refs/heads/master | 2021-01-10T20:30:04.259197 | 2015-05-23T23:55:45 | 2015-05-23T23:55:45 | 31,134,770 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,229 | 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 net.drshoggoth.SuperGemCrusherDeluxe;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
| [
"[email protected]"
] | |
3ab47e60b9f0e13f2db4ba8b616c0f9e0d53fcc8 | e64b3a6931532091a48337d39d326ce0df7b27a4 | /traverson4j-hc4/src/main/java/uk/co/autotrader/traverson/http/entity/FormDataEntityConverter.java | 2d990ddec31444b53f8e4252d34042683ccdce49 | [
"Apache-2.0"
] | permissive | MojoJojo86/traverson4j | 79311759d12d0cb4f8473631fa08c62523004297 | 319400a7b948157061b96a11477cf06c6c75b672 | refs/heads/master | 2021-01-01T21:21:12.556781 | 2020-03-06T12:23:19 | 2020-03-06T12:23:19 | 239,344,428 | 0 | 0 | Apache-2.0 | 2020-02-09T17:29:00 | 2020-02-09T17:28:59 | null | UTF-8 | Java | false | false | 783 | java | package uk.co.autotrader.traverson.http.entity;
import org.apache.http.HttpEntity;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import uk.co.autotrader.traverson.http.Body;
import uk.co.autotrader.traverson.http.FormDataBody;
import java.util.Arrays;
import java.util.stream.Collectors;
class FormDataEntityConverter implements HttpEntityConverter {
@Override
public HttpEntity toEntity(Body body) {
FormDataBody formDataBody = (FormDataBody) body;
return new UrlEncodedFormEntity(
Arrays.stream(formDataBody.getContent()).map(pair -> new BasicNameValuePair(pair.getName(), pair.getValue())).collect(Collectors.toList()),
formDataBody.getCharset());
}
} | [
"[email protected]"
] | |
dfd6b62a3f26d7fbdcb371bc8f94511339fac64e | e75db4ad5cc1669872d761b60dbbf9bc6d0b7116 | /src/Auth/security/Authenticator.java | 14d5ce4cefe17f51496cd07d2e6d46f871f39e93 | [] | no_license | salimaouali/tpCinq | 97377f3e46369db1e4fe1f254f4d3e18d68868a5 | b55e89ccd60971865303559a0c830363fa89be42 | refs/heads/master | 2020-03-10T21:59:43.445487 | 2018-04-15T12:43:08 | 2018-04-15T12:43:08 | 129,608,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | /*
* Copyright (c) 2008, 2012 Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
* - Neither the name of Oracle Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package Auth.security;
import java.util.HashMap;
import java.util.Map;
public class Authenticator {
private static final Map<String, String> USERS = new HashMap<String, String>();
static {
USERS.put("demo", "demo");
USERS.put("test", "test");
USERS.put("Ouadie", "Ouadie");
}
public static boolean validate(String user, String password){
String validUserPassword = USERS.get(user);
return validUserPassword != null && validUserPassword.equals(password);
}
} | [
"[email protected]"
] | |
16b657487d80965c440b0fa64b1f326604c97692 | a0df61603cb0cccd5fc533aed687d9caaa95f230 | /app/src/main/java/com/justcode/hxl/viewutil/recycleview_util/layoutmanager/hiveLayoutmanager/HiveBucket.java | bebdf6030d2ceb86d6b76e69d819856125bf23be | [] | no_license | LuckyCode1992/ViewUtils | 45db5e43f667038cef955178f2192332081ef22b | e0dfb7571007a923a93d4ea81fdab5d1bf17026d | refs/heads/master | 2021-06-28T06:43:02.517264 | 2020-12-21T10:10:33 | 2020-12-21T10:10:33 | 202,108,835 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,299 | java | package com.justcode.hxl.viewutil.recycleview_util.layoutmanager.hiveLayoutmanager;
/**
* Bit set implementation that provides methods to offset indices.
*/
class HiveBucket {
final static int BITS_PER_WORD = Long.SIZE;
final static long LAST_BIT = 1L << (Long.SIZE - 1);
long mData = 0;
HiveBucket mNext;
void set(int index) {
if (index >= BITS_PER_WORD) {
ensureNext();
mNext.set(index - BITS_PER_WORD);
} else {
mData |= 1L << index;
}
}
private void ensureNext() {
if (mNext == null) {
mNext = new HiveBucket();
}
}
void clear(int index) {
if (index >= BITS_PER_WORD) {
if (mNext != null) {
mNext.clear(index - BITS_PER_WORD);
}
} else {
mData &= ~(1L << index);
}
}
boolean get(int index) {
if (index >= BITS_PER_WORD) {
ensureNext();
return mNext.get(index - BITS_PER_WORD);
} else {
return (mData & (1L << index)) != 0;
}
}
void reset() {
mData = 0;
if (mNext != null) {
mNext.reset();
}
}
void insert(int index, boolean value) {
if (index >= BITS_PER_WORD) {
ensureNext();
mNext.insert(index - BITS_PER_WORD, value);
} else {
final boolean lastBit = (mData & LAST_BIT) != 0;
long mask = (1L << index) - 1;
final long before = mData & mask;
final long after = ((mData & ~mask)) << 1;
mData = before | after;
if (value) {
set(index);
} else {
clear(index);
}
if (lastBit || mNext != null) {
ensureNext();
mNext.insert(0, lastBit);
}
}
}
boolean remove(int index) {
if (index >= BITS_PER_WORD) {
ensureNext();
return mNext.remove(index - BITS_PER_WORD);
} else {
long mask = (1L << index);
final boolean value = (mData & mask) != 0;
mData &= ~mask;
mask = mask - 1;
final long before = mData & mask;
// cannot use >> because it adds one.
final long after = Long.rotateRight(mData & ~mask, 1);
mData = before | after;
if (mNext != null) {
if (mNext.get(0)) {
set(BITS_PER_WORD - 1);
}
mNext.remove(0);
}
return value;
}
}
int countOnesBefore(int index) {
if (mNext == null) {
if (index >= BITS_PER_WORD) {
return Long.bitCount(mData);
}
return Long.bitCount(mData & ((1L << index) - 1));
}
if (index < BITS_PER_WORD) {
return Long.bitCount(mData & ((1L << index) - 1));
} else {
return mNext.countOnesBefore(index - BITS_PER_WORD) + Long.bitCount(mData);
}
}
@Override
public String toString() {
return mNext == null ? Long.toBinaryString(mData)
: mNext.toString() + "xx" + Long.toBinaryString(mData);
}
}
| [
"hxl19920401"
] | hxl19920401 |
99ef9aa598fe6391ed573d9764a060b95cf45ec8 | 8277751dc9862b5c463ed52db813c98574cfd82a | /src/org/usfirst/frc6349/RoboChiefs/commands/ShootBackwards.java | 1913c0f9a5d011d212ea31bf9b7186548c43b5ce | [] | no_license | xKIAxMaDDoG/RoboChiefs | aee6c7151885a563d7fe4515067cd827aaba9015 | 308371f75c333c05ad6e8ac360fa8bb32fab4d81 | refs/heads/master | 2020-03-08T01:30:27.470293 | 2018-04-03T01:21:32 | 2018-04-03T01:21:32 | 127,832,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,996 | java | // RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.
package org.usfirst.frc6349.RoboChiefs.commands;
import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc6349.RoboChiefs.Robot;
/**
*
*/
public class ShootBackwards extends Command {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
public ShootBackwards() {
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
requires(Robot.shooter);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
}
// Called just before this Command runs the first time
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.shooter.shootbackwards();
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
protected void end() {
Robot.shooter.shooterstop();
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
| [
"[email protected]"
] | |
c910dc5e1e2798f45714ad2b7a442c7c7eba1b4a | 4a835d2c6ae2c2259b24d1bbac8e8099957ac2a4 | /Java-Concurrency-Learning/src/main/java/cc/seiya/java/concurrency/thread/base/ThreadMain.java | 6dc1da97843242ac57a7defc0c0c6b6e89aa29a7 | [
"Apache-2.0"
] | permissive | useiya/tech-learning | e73b1a38bd40cc08bb212149c91228124e28ff08 | 6e03275d800bdac4a110c619ad6826e91f507a49 | refs/heads/master | 2021-05-08T20:57:06.351734 | 2018-02-06T13:44:49 | 2018-02-06T13:44:49 | 119,624,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,528 | java | package cc.seiya.java.concurrency.thread.base;
import java.util.concurrent.*;
/**
* @author: libo
* @date: 2018/1/31 14:23
*/
public class ThreadMain {
public static void main(String[] args) throws ExecutionException, InterruptedException {
// extendsThread();
// implemntsRunnable();
callable();
}
private static void extendsThread() {
for (int i = 0; i < 10; i++) {
MyThreadByThread thread = new MyThreadByThread(i);
thread.start();
System.out.println("thread info :" + thread.getName() + "," + thread.getId());
}
}
private static void implemntsRunnable() {
for (int i = 0; i < 10; i++) {
MyRunnable runnable = new MyRunnable(i);
Thread thread = new Thread(runnable);
thread.start();
System.out.println("thread info :" + thread.getName() + "," + thread.getId());
}
}
private static void callable() throws ExecutionException, InterruptedException {
int cpuNum = Runtime.getRuntime().availableProcessors();
ExecutorService pool = new ThreadPoolExecutor(cpuNum, cpuNum,
0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
for (int i = 0; i < 10; i++) {
String threadName = "t" + i;
Future<String> future = pool.submit(new MyCallable(threadName));
System.out.println(threadName + ",return value is :" + future.get());
}
pool.shutdown();
}
}
| [
"[email protected]"
] | |
cbc14cb3554febe1971dd5032e5bcbdbed83682b | 5f05039a6296037684b9b38a928dd1106118817f | /src/main/java/org/hubson404/carrentalapp/model/CarDto.java | bd0cf1cd0be52995fa5c055fca9c04890862c2c3 | [] | no_license | Hubson404/car-rental-app | a821922bba40cb17c5a591650bfce7e69a67b845 | d013f31d2637eba99c2ee701d5fcb953790dbcd4 | refs/heads/main | 2023-02-28T23:17:22.989020 | 2021-02-11T17:22:18 | 2021-02-11T17:22:18 | 322,823,577 | 0 | 0 | null | 2021-02-11T17:22:21 | 2020-12-19T10:43:16 | Java | UTF-8 | Java | false | false | 1,909 | java | package org.hubson404.carrentalapp.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hubson404.carrentalapp.domain.enums.CarBodyColor;
import org.hubson404.carrentalapp.domain.enums.CarBodyType;
import org.hubson404.carrentalapp.domain.enums.CarStatus;
import org.hubson404.carrentalapp.model.validators.EnumValue;
import org.hubson404.carrentalapp.model.validators.UpperCase;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CarDto {
private Long id;
@NotNull(message = "Value is mandatory")
@Length(min = 1, message = "Input must be 1 characters or longer")
private String model;
@NotNull(message = "Value is mandatory")
@Length(min = 2, message = "Input must be 2 characters or longer")
private String brand;
@NotNull(message = "Value is mandatory")
@UpperCase
@EnumValue(
enumClass = CarBodyType.class
)
private String carBodyType;
@NotNull(message = "Value is mandatory")
@Min(value = 1950, message = "Production year must be later than 1950")
private Integer productionYear;
@NotNull(message = "Value is mandatory")
@UpperCase
@EnumValue(
enumClass = CarBodyColor.class
)
private String color;
@Min(value = 0, message = "Value must be 0 or greater")
private Long mileage;
@NotNull(message = "Value is mandatory")
@UpperCase
@EnumValue(
enumClass = CarStatus.class
)
private String carStatus;
@NotNull(message = "Value is mandatory")
@Min(value = 0, message = "Value must be 0 or greater")
private Double costPerDay;
@NotNull(message = "Value is mandatory")
private DepartmentDto department;
}
| [
"[email protected]"
] | |
f1943ce6e33aaee312328196e7d60e255e81029d | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/dataset/x/545_frag1.java | 055e1cad20a2cc066aafbac68c6d5dfe14dfee19 | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 289 | java | EntityManagerHelper.beginTransaction();
EntityDataAccess.persist(element);
EntityManagerHelper.commit();
element.setName("Updated");
EntityManagerHelper.beginTransaction();
final Element mergedElement = EntityDataAccess.merge(element);
| [
"[email protected]"
] | |
606da38b55416c434ef94a868a86546e348f92b1 | 97f5a3521386fdb633f4087f118e9c7d47d61154 | /n-wjms/src/main/java/com/nds/nwjms/ResController.java | 4c8c5ed019a23bd023faca6bca726daf9dbbf5af | [] | no_license | bbizimtot/N-WJMS | 2151e04894046c1218207350873461a43bcf0714 | 2937ceada9171f7cab312fff3673262faf120097 | refs/heads/master | 2020-05-16T23:17:23.857516 | 2019-05-07T09:02:19 | 2019-05-07T09:02:19 | 183,359,229 | 1 | 0 | null | 2019-05-07T09:02:21 | 2019-04-25T04:58:35 | Java | UTF-8 | Java | false | false | 1,108 | java | package com.nds.nwjms;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.nds.nwjms.service.Rstrnt_infoService;
/**
* Handles requests for the application home page.
*/
@Controller
@RequestMapping("res")
public class ResController {
private static final Logger logger = LoggerFactory.getLogger(AdminController.class);
@Resource(name="rstrnt_infoService")
private Rstrnt_infoService rstrnt_infoSerivce;
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/resmain", method = RequestMethod.GET)
public String empmain(Model model) throws Exception {
return "restaurant/ResMain";
}
@RequestMapping(value = "/empmypage", method = RequestMethod.GET)
public String empmypage() throws Exception {
return "employee/EmpMypage";
}
}
| [
"[email protected]"
] | |
d2d2c75a5ce7e4ff81e9969e456ff262d49f076d | 9759ddaf6d64d3910eb321ec6676cc1c0653150f | /src/main/java/com/pwk/springboot/study/design_pattern/abstract_factory/Shape.java | 2541252b3caeb56f5aa65c9b0e68db0fcc7e312c | [] | no_license | kelvinpang90/springboot | 562d94c0a57f0e6ba031e5680b51e203fdcc234f | 86061b8950319064cf895ea512b5ed1c80a7c5b6 | refs/heads/master | 2020-04-26T03:00:28.825910 | 2019-05-26T13:11:11 | 2019-05-26T13:11:11 | 173,252,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 115 | java | package com.pwk.springboot.study.design_pattern.abstract_factory;
public interface Shape {
void getShape();
}
| [
"[email protected]"
] | |
e9a82c7e69ea732ca76669459517b40f6dbeea4e | 9de5b9f55809c6c837c3d79083b74bf487528f50 | /trustie/Bench4Q/tag/Bench4Q_1.2.1/src/org/bench4Q/agent/rbe/RBE.java | 2545c7acdf87062bfcc41df68a09d25b7112e4e2 | [] | no_license | flaviol-souza/bench4q | 008af81baf7f6755ff668ad7bf726b9743439758 | 9a5d802d2230beb53c32159849cd17a84108d623 | refs/heads/master | 2020-06-01T04:40:14.980152 | 2019-09-26T19:01:30 | 2019-09-26T19:01:30 | 190,640,122 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,539 | java | /**
* =========================================================================
* Bench4Q version 1.2.1
* =========================================================================
*
* Bench4Q is available on the Internet at http://forge.ow2.org/projects/jaspte
* You can find latest version there.
*
* Distributed according to the GNU Lesser General Public Licence.
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or any
* later version.
*
* SEE Copyright.txt FOR FULL COPYRIGHT INFORMATION.
*
* This source code is distributed "as is" in the hope that it will be
* useful. It comes with no warranty, and no author or distributor
* accepts any responsibility for the consequences of its use.
*
*
* This version is a based on the implementation of TPC-W from University of Wisconsin.
* This version used some source code of The Grinder.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * Initial developer(s): Zhiquan Duan.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
*/
package org.bench4Q.agent.rbe;
import java.util.ArrayList;
import org.bench4Q.agent.rbe.communication.Args;
import org.bench4Q.agent.rbe.communication.EBStats;
import org.bench4Q.agent.rbe.communication.TestPhase;
/**
* @author duanzhiquan
*
*/
public class RBE {
private Args m_args;
private ArrayList<Workers> m_workers;
private long TestInterval;
/**
*
*/
public RBE() {
m_workers = new ArrayList<Workers>();
TestInterval = 0;
}
/**
* @param arg
*/
public RBE(Args arg) {
this();
m_args = arg;
}
/**
*
*/
public void startWorkers() {
long startTime = System.currentTimeMillis();
long prepairTime = m_args.getPrepair();
long cooldown = m_args.getCooldown();
long testInterval = 0;
int testPhaseEndTime;
for (TestPhase testPhase : m_args.getEbs()) {
testPhaseEndTime = testPhase.getTriggerTime() + testPhase.getStdyTime();
if (testPhaseEndTime > testInterval) {
testInterval = testPhaseEndTime;
}
}
EBStats.getEBStats().init(startTime, prepairTime, testInterval, cooldown);
HttpClientFactory.setRetryCount(m_args.getRetry());
if (m_args.getRbetype().equalsIgnoreCase("closed")) {
for (TestPhase testPhase : m_args.getEbs()) {
m_workers.add(new WorkersClosed(startTime, testPhase.getTriggerTime(), testPhase
.getStdyTime(), testPhase.getBaseLoad(), testPhase.getRandomLoad(),
testPhase.getRate(), m_args));
}
} else if (m_args.getRbetype().equalsIgnoreCase("open")) {
for (TestPhase testPhase : m_args.getEbs()) {
m_workers.add(new WorkersOpen(startTime, testPhase.getTriggerTime(), testPhase
.getStdyTime(), testPhase.getBaseLoad(), testPhase.getRandomLoad(),
testPhase.getRate(), m_args));
}
} else {
System.out.println("Error parameter.");
System.out.println("Start closed as default.");
for (TestPhase testPhase : m_args.getEbs()) {
m_workers.add(new WorkersClosed(startTime, testPhase.getTriggerTime(), testPhase
.getStdyTime(), testPhase.getBaseLoad(), testPhase.getRandomLoad(),
testPhase.getRate(), m_args));
}
}
for (Workers worker : m_workers) {
worker.setDaemon(true);
worker.start();
}
TestInterval = calculateTestInterval();
long endTime = startTime + TestInterval * 1000L;
try {
Thread.sleep(TestInterval * 1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
boolean flag = true;
while (((System.currentTimeMillis() - endTime) < 0) && flag) {
flag = false;
for (Workers worker : m_workers) {
if (worker.isAlive()) {
flag = true;
worker.stop();
}
}
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
clear();
}
private void clear() {
m_workers = null;
}
private long calculateTestInterval() {
int max = 0;
int workerEndTime;
for (TestPhase testPhase : m_args.getEbs()) {
workerEndTime = testPhase.getStdyTime() + testPhase.getTriggerTime();
if (workerEndTime > max) {
max = workerEndTime;
}
}
return max;
}
/**
* @return args
*/
public Args getArgs() {
return m_args;
}
}
| [
"[email protected]"
] | |
484e88148ef4f923c0dc93000b155413704a26df | 38cf105f072382ef78e1e3ffcd04049c2e00317d | /app/src/main/java/com/example/jahanveenarang/smyle/Gallery.java | 812438a6a36b9f96626373f939292162e4c7f114 | [] | no_license | jahanvee-narang/SmyleApp | fdd98b345c332c2a2fa466d562ad6508a0a418af | 08d4c4fba711ca2b988657bfcb40b6c3821f240f | refs/heads/master | 2020-04-15T17:20:40.994352 | 2019-02-06T20:34:22 | 2019-02-06T20:34:22 | 164,871,046 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package com.example.jahanveenarang.smyle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
public class Gallery extends AppCompatActivity {
android.widget.Gallery simpleGallery;
CustomGalleryAdapter customGalleryAdapter;
ImageView selectedImageView;
int[] images = {R.drawable.pic1, R.drawable.pic2, R.drawable.pic3, R.drawable.pic4, R.drawable.pic5,
R.drawable.pic6, R.drawable.pic7, R.drawable.pic8, R.drawable.pic9,R.drawable.pic10,R.drawable.pic11,
R.drawable.pic12,R.drawable.pic13};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery);
simpleGallery = (android.widget.Gallery) findViewById(R.id.simpleGallery);
selectedImageView = (ImageView) findViewById(R.id.selectedImageView);
customGalleryAdapter = new CustomGalleryAdapter(getApplicationContext(), images);
simpleGallery.setAdapter(customGalleryAdapter);
simpleGallery.setSpacing(10);
simpleGallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//selectedImageView.setImageResource(images[position]);
Picasso.get().load(images[position]).resize(900,500).centerCrop().into(selectedImageView);
}
});
}
}
| [
"[email protected]"
] | |
d0fbbafa30578f81b61c44c7513e855ebab21af8 | 958f817baecf0574b650d47db8ce16167b42a0ab | /uploads/qqpression/src/test/java/com/zephyr/stepdefinition/Defect_Tracking_131.java | 0ac7d0be9570b3abb103b5104dfa467384f7d5b2 | [] | no_license | 7259090051/intFlatform | bcc4659c25bfc222ba689b4321594195f23fe67a | 88a215192fe31d6e3c588f6d130ac2f843ed3f30 | refs/heads/master | 2020-03-26T13:25:34.615343 | 2018-08-16T04:58:23 | 2018-08-16T04:58:23 | 144,938,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,840 | java | package com.zephyr.stepdefinition;
import org.testng.asserts.SoftAssert;
import com.zephyr.common.LaunchBrowser;
import com.zephyr.generic.Excel_Lib;
import com.zephyr.generic.Property_Lib;
import com.zephyr.reusablemethods.BasePage;
import com.zephyr.reusablemethods.DefectTracking;
import com.zephyr.reusablemethods.ExecutionPage;
import com.zephyr.reusablemethods.LoginPage;
import com.zephyr.reusablemethods.ProjectPage;
import com.zephyr.reusablemethods.ReleasePage;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class Defect_Tracking_131 extends LaunchBrowser{
LaunchBrowser lb;
ProjectPage pp;
LoginPage lp;
ReleasePage rp;
BasePage bp;
DefectTracking dt;
ExecutionPage exep;
String fileName="Defect_Tracking_131";
boolean[] actual=new boolean[26];
SoftAssert soft=new SoftAssert();
String[] defectNo=new String[16];
{
for(int i=0;i<=defectNo.length-1;i++)
{
defectNo[i]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",i+1,16));
}
// defectNo[0]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",1,16));
// defectNo[1]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",2,16));
// defectNo[2]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",3,16));
// defectNo[3]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",4,16));
// defectNo[4]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",5,16));
// defectNo[5]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",6,16));
// defectNo[6]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",7,16));
// defectNo[7]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",8,16));
// defectNo[8]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",9,16));
// defectNo[9]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",10,16));
// defectNo[10]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",11,16));
// defectNo[11]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",12,16));
// defectNo[12]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",13,16));
// defectNo[13]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",14,16));
// defectNo[14]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",15,16));
// defectNo[15]=Integer.toString(Excel_Lib.getNumberData(INPUT_PATH_3, "Defect Tracking",16,16));
}
@Given("^User is in a Defect_Tracking Page$")
public void user_is_in_a_Defect_Tracking_Page() throws Throwable {
try
{
String projectName=Property_Lib.getPropertyValue(CONFIG_PATH+CONFIG_FILE_TPE,"Normal_Project_1");
String releaseName=Property_Lib.getPropertyValue(CONFIG_PATH+CONFIG_FILE_TPE,"Release_1");
pp=new ProjectPage(driver);
bp=new BasePage();
rp=new ReleasePage(driver);
dt=new DefectTracking(driver);
exep=new ExecutionPage(driver);
pp.selectProject(projectName);
pp.selectRelease(releaseName);
actual[0]=pp.clickOnDefectTracking();
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^User search the defects by filter$")
public void user_search_the_defects_by_filter() throws Throwable {
try
{
String selectSearch=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,9);
String value=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",1,38);
dt.clickOnDefectAdvancedSearchButton();
actual[1]=exep.defectSearch(selectSearch, value);
dt.clickOnDefectSearchButton();
actual[2]=dt.selectAllDefects();
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select the multiple defects and click on change multiple button$")
public void select_the_multiple_defects_and_click_on_change_multiple_button() throws Throwable {
try
{
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 1,19);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,19);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
actual[3]=dt.defectsOperation(defectValue);
actual[4]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue,status,resolution,priority,assignee);
bp.waitForElement();
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of Component$")
public void should_be_able_to_Change_values_of_Component() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 9,16);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",8,19);
actual[5]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select change multiple to Change Version value$")
public void select_change_multiple_to_Change_Version_value() throws Throwable {
try
{
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 1,20);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,20);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
actual[6]=dt.selectAllDefects();
actual[7]=dt.defectsOperation(defectValue);
actual[8]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue, status, resolution, priority, assignee);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of Version$")
public void should_be_able_to_Change_values_of_Version() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 9,16);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",7,20);
actual[9]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select Change multiple to change Status$")
public void select_Change_multiple_to_change_Status() throws Throwable {
try
{
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,3);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
actual[10]=dt.selectAllDefects();
actual[11]=dt.defectsOperation(defectValue);
actual[12]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue, status, resolution, priority, assignee);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of Status$")
public void should_be_able_to_Change_values_of_Status() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 3,1);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,3);
actual[13]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select Change multiple to change the FixVersion$")
public void select_Change_multiple_to_change_the_FixVersion() throws Throwable {
try
{
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",1,20);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,20);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
actual[14]=dt.selectAllDefects();
actual[15]=dt.defectsOperation(defectValue);
actual[16]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue, status, resolution, priority, assignee);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of the FixVersion$")
public void should_be_able_to_Change_values_of_the_FixVersion() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 9,1);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",7,20);
actual[17]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select Change multiple to change the Priority$")
public void select_Change_multiple_to_change_the_Priority() throws Throwable {
try
{
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 1,6);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
actual[18]=dt.selectAllDefects();
actual[19]=dt.defectsOperation(defectValue);
actual[20]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue, status, resolution, priority, assignee);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of the Priority$")
public void should_be_able_to_Change_values_of_the_Priority() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",6,1);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",1,6);
actual[21]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@When("^select Change multiple to change Assignee value$")
public void select_Change_multiple_to_change_Assignee_value() throws Throwable {
try
{
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 2,14);
String[] componentValue=new String[2];
componentValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
componentValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String[] versionValue=new String[2];
versionValue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
versionValue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String[] fixversionvalue=new String[2];
fixversionvalue[0]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
fixversionvalue[1]=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String status=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",100,100);
String resolution=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String priority=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 100,100);
String assignee=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,4);
actual[22]=dt.selectAllDefects();
actual[23]=dt.defectsOperation(defectValue);
actual[24]=dt.changeMultipleDefect(componentValue, versionValue, fixversionvalue, status, resolution, priority, assignee);
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
@Then("^Should be able to Change values of the Assignee$")
public void should_be_able_to_Change_values_of_the_Assignee() throws Throwable {
try
{
String defectType=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking", 7,1);
String defectValue=Excel_Lib.getData(INPUT_PATH_3, "Defect Tracking",2,4);
actual[25]=dt.validateMultiEditDefect(defectNo, defectType, defectValue);
for(int k=0;k<=actual.length-1;k++)
{
System.out.println("Actual["+k+"]="+actual[k]);
soft.assertEquals(actual[k], true);
}
soft.assertAll();
}
catch(Exception e)
{
lb=new LaunchBrowser();
lb.getScreenShot(fileName);
e.printStackTrace();
driver.close();
Relogin_TPE rl=new Relogin_TPE();
rl.reLogin();
throw e;
}
}
}
| [
"charan"
] | charan |
68369c6f0d2f721a33cd6153c2921575ee55078f | b6c0c5b2811b923a74ea97e1b9731f7ffa421f40 | /airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplicationsUtils.java | 59e0f798e6f13e90342a04c158328f7decf538cc | [
"Apache-2.0"
] | permissive | glahiru/airavata | b1ae8dc98af27933ee303ff7300351c070de262d | 9e7ed4ba8336091717ff1dc823d084f6b349ae08 | refs/heads/master | 2021-01-23T18:08:23.120559 | 2014-10-24T05:38:39 | 2014-10-24T05:40:30 | 23,710,309 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,425 | 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.airavata.client.tools;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationParallelismType;
import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
import org.apache.airavata.model.appcatalog.appinterface.DataType;
import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.appcatalog.computeresource.*;
import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class RegisterSampleApplicationsUtils {
public static ComputeResourcePreference
createComputeResourcePreference(String computeResourceId, String allocationProjectNumber,
boolean overridebyAiravata, String preferredBatchQueue,
String preferredJobSubmissionProtocol,String preferredDataMovementProtocol,
String scratchLocation) {
ComputeResourcePreference computeResourcePreference = new ComputeResourcePreference();
computeResourcePreference.setComputeResourceId(computeResourceId);
computeResourcePreference.setOverridebyAiravata(overridebyAiravata);
computeResourcePreference.setAllocationProjectNumber(allocationProjectNumber);
computeResourcePreference.setPreferredBatchQueue(preferredBatchQueue);
computeResourcePreference.setPreferredDataMovementProtocol(preferredDataMovementProtocol);
computeResourcePreference.setPreferredJobSubmissionProtocol(preferredJobSubmissionProtocol);
computeResourcePreference.setScratchLocation(scratchLocation);
return computeResourcePreference;
}
public static ApplicationDeploymentDescription createApplicationDeployment(
String appModuleId, String computeResourceId, String executablePath,
ApplicationParallelismType parallelism, String appDeploymentDescription) {
ApplicationDeploymentDescription deployment = new ApplicationDeploymentDescription();
// deployment.setIsEmpty(false);
deployment.setAppDeploymentDescription(appDeploymentDescription);
deployment.setAppModuleId(appModuleId);
deployment.setComputeHostId(computeResourceId);
deployment.setExecutablePath(executablePath);
deployment.setParallelism(parallelism);
return deployment;
}
public static ApplicationModule createApplicationModule(String appModuleName,
String appModuleVersion, String appModuleDescription) {
ApplicationModule module = new ApplicationModule();
module.setAppModuleDescription(appModuleDescription);
module.setAppModuleName(appModuleName);
module.setAppModuleVersion(appModuleVersion);
return module;
}
public static DataMovementInterface createDataMovementInterface(
String dataMovementInterfaceId,
DataMovementProtocol dataMovementProtocolType, int priorityOrder) {
DataMovementInterface dataMovementInterface = new DataMovementInterface();
dataMovementInterface.setDataMovementInterfaceId(dataMovementInterfaceId);
dataMovementInterface.setDataMovementProtocol(dataMovementProtocolType);
dataMovementInterface.setPriorityOrder(priorityOrder);
return dataMovementInterface;
}
public static JobSubmissionInterface createJobSubmissionInterface(
String jobSubmissionInterfaceId,
JobSubmissionProtocol jobSubmissionProtocolType, int priorityOrder) {
JobSubmissionInterface jobSubmissionInterface = new JobSubmissionInterface();
jobSubmissionInterface.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
jobSubmissionInterface.setJobSubmissionProtocol(jobSubmissionProtocolType);
jobSubmissionInterface.setPriorityOrder(priorityOrder);
return jobSubmissionInterface;
}
public static ComputeResourceDescription createComputeResourceDescription(
String hostName, String hostDesc, Set<String> hostAliases, Set<String> ipAddresses) {
ComputeResourceDescription host = new ComputeResourceDescription();
host.setHostName(hostName);
host.setResourceDescription(hostDesc);
host.setIpAddresses(ipAddresses);
host.setHostAliases(hostAliases);
return host;
}
public static ResourceJobManager createResourceJobManager(
ResourceJobManagerType resourceJobManagerType, String pushMonitoringEndpoint, String jobManagerBinPath,
Map<JobManagerCommand, String> jobManagerCommands) {
ResourceJobManager resourceJobManager = new ResourceJobManager();
resourceJobManager.setResourceJobManagerType(resourceJobManagerType);
resourceJobManager.setPushMonitoringEndpoint(pushMonitoringEndpoint);
resourceJobManager.setJobManagerBinPath(jobManagerBinPath);
resourceJobManager.setJobManagerCommands(jobManagerCommands);
return resourceJobManager;
}
public static InputDataObjectType createAppInput
(String inputName, String value, DataType type,
String applicationArgument, boolean stdIn, String description, String metadata) {
InputDataObjectType input = new InputDataObjectType();
// input.setIsEmpty(false);
if (inputName != null) input.setName(inputName);
if (value != null) input.setValue(value);
if (type != null) input.setType(type);
if (applicationArgument != null) input.setApplicationArgument(applicationArgument);
if (description != null) input.setUserFriendlyDescription(description);
input.setStandardInput(stdIn);
if (metadata != null) input.setMetaData(metadata);
return input;
}
public static OutputDataObjectType createAppOutput(String inputName, String value, DataType type) {
OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
// outputDataObjectType.setIsEmpty(false);
if (inputName != null) outputDataObjectType.setName(inputName);
if (value != null) outputDataObjectType.setValue(value);
if (type != null) outputDataObjectType.setType(type);
return outputDataObjectType;
}
public static ApplicationInterfaceDescription createApplicationInterfaceDescription
(String applicationName, String applicationDesription, List<String> applicationModules,
List<InputDataObjectType> applicationInputs, List<OutputDataObjectType>applicationOutputs) {
ApplicationInterfaceDescription applicationInterfaceDescription = new ApplicationInterfaceDescription();
applicationInterfaceDescription.setApplicationName(applicationName);
if (applicationDesription != null) applicationInterfaceDescription.setApplicationDesription(applicationDesription);
if (applicationModules != null) applicationInterfaceDescription.setApplicationModules(applicationModules);
if (applicationInputs != null) applicationInterfaceDescription.setApplicationInputs(applicationInputs);
if (applicationOutputs != null) applicationInterfaceDescription.setApplicationOutputs(applicationOutputs);
return applicationInterfaceDescription;
}
} | [
"[email protected]"
] | |
82348d7a1a654da07fbc94ab67d1fa44601a2d4a | 246d859cc3bf16d404a0d36af96a9c35130924ef | /WORKSPACE_JEE7_WEB/InsuranceMotor/src/com/dao/CustomerDAO.java | 799b3ca062fe659841de3ac668ecf4add19abcc3 | [] | no_license | giterahul/Traning-Project | aa4f47adda53defe23752a9aada6f02f266f9a2e | dd3f33f4f105149d7e1df160b35b7434c31b9443 | refs/heads/master | 2020-09-30T11:28:47.228408 | 2019-12-11T04:51:42 | 2019-12-11T04:51:42 | 227,278,919 | 0 | 0 | null | 2019-12-11T04:58:53 | 2019-12-11T04:48:46 | HTML | UTF-8 | Java | false | false | 251 | java | package com.dao;
import com.model.Customer;
public interface CustomerDAO {
public Customer getCustomerByCustomerId(Integer customerId);
public boolean registration(Customer customer);
public boolean validate(String userName, String password);
}
| [
"[email protected]"
] | |
af4e756cee5ffae011ce05f096bd7a469b7ffd1c | 72003cab6711efe96e7080599376d758e065fc33 | /PCLApp/JavaSource/com/citibank/ods/modules/client/curacctprmntinstr/functionality/CurAcctPrmntInstrHistoryDetailFnc.java | 81f8cb7f47e8e8360c80d438ee5a7259f5b97b85 | [] | no_license | mv58799/PCLApp | 39390b8ff5ccaf95c654f394e32ed03b7713e8ad | 2f8772a60fee035104586bbbf2827567247459c4 | refs/heads/master | 2020-03-19T09:06:30.870074 | 2018-06-06T03:10:07 | 2018-06-06T03:10:07 | 136,260,531 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 12,316 | java | package com.citibank.ods.modules.client.curacctprmntinstr.functionality;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import org.apache.struts.action.ActionForm;
import com.citibank.ods.Globals.FuncionalityFormatKeys;
import com.citibank.ods.common.functionality.ODSHistoryDetailFnc;
import com.citibank.ods.common.functionality.valueobject.BaseFncVO;
import com.citibank.ods.common.util.ODSConstraintDecoder;
import com.citibank.ods.entity.bg.TbgPointAcctInvstEntity;
import com.citibank.ods.entity.pl.BaseTplIpDocPrvtEntity;
import com.citibank.ods.entity.pl.TplCurAcctPrmntInstrHistEntity;
import com.citibank.ods.entity.pl.TplIpDocPrvtEntity;
import com.citibank.ods.entity.pl.valueobject.TplCurAcctPrmntInstrHistEntityVO;
import com.citibank.ods.modules.client.curacctprmntinstr.form.CurAcctPrmntInstrHistoryDetailForm;
import com.citibank.ods.modules.client.curacctprmntinstr.functionality.valueobject.CurAcctPrmntInstrHistoryDetailFncVO;
import com.citibank.ods.persistence.bg.dao.TbgPointAcctInvstDAO;
import com.citibank.ods.persistence.pl.dao.TplCurAcctPrmntInstrHistDAO;
import com.citibank.ods.persistence.pl.dao.TplIpDocPrvtDAO;
import com.citibank.ods.persistence.pl.dao.factory.ODSDAOFactory;
//
//©2002-2007 Accenture. All rights reserved.
//
/**
*
* @see package com.citibank.ods.modules.client.curacctprmntinstr.functionality;
* @version 1.0
* @author michele.monteiro,20/06/2007
*
*/
public class CurAcctPrmntInstrHistoryDetailFnc extends
BaseCurAcctPrmntInstrDetailFnc implements ODSHistoryDetailFnc
{
public void loadForConsult( BaseFncVO fncVO_ )
{
super.load( fncVO_ );
CurAcctPrmntInstrHistoryDetailFncVO fncVO = ( CurAcctPrmntInstrHistoryDetailFncVO ) fncVO_;
TplCurAcctPrmntInstrHistEntity tplCurAcctPrmntInstrHistEntity;
BaseTplIpDocPrvtEntity tplIpDocPrvtEntity;
TplIpDocPrvtDAO ipDocPrvtDAO = ODSDAOFactory.getInstance().getTplIpDocPrvtDAO();
tplIpDocPrvtEntity = new TplIpDocPrvtEntity();
TplCurAcctPrmntInstrHistDAO curAcctPrmntInstrDAO = ODSDAOFactory.getInstance().getTplCurAcctPrmntInstrHistDAO();
ArrayList listAssoc = curAcctPrmntInstrDAO.selectByPK(
fncVO.getCustNbr(),
fncVO.getProdAcctCode(),
fncVO.getProdUnderAcctCode(),
fncVO.getCurAcctPrmntInstrRefDate() );
fncVO.setBaseTplIpDocPrvtEntityList( listAssoc );
if ( listAssoc != null && listAssoc.size() > 0 )
{
for ( int i = 0; i < listAssoc.size(); i++ )
{
tplCurAcctPrmntInstrHistEntity = ( TplCurAcctPrmntInstrHistEntity ) listAssoc.get( i );
tplIpDocPrvtEntity.getData().setIpDocCode(
tplCurAcctPrmntInstrHistEntity.getData().getPrmntInstrCode() );
tplIpDocPrvtEntity.getData().setCustNbr(
tplCurAcctPrmntInstrHistEntity.getData().getCustNbr() );
tplIpDocPrvtEntity = ipDocPrvtDAO.find( tplIpDocPrvtEntity );
tplCurAcctPrmntInstrHistEntity.getDataIP().setIpDocText(
tplIpDocPrvtEntity.getData().getIpDocText() );
tplCurAcctPrmntInstrHistEntity.getDataIP().setIpInvstCurAcctInd(
tplIpDocPrvtEntity.getData().getIpInvstCurAcctInd() );
if ( tplCurAcctPrmntInstrHistEntity.getDataIP().getIpInvstCurAcctInd().equals(
"S" ) )
{
TbgPointAcctInvstDAO tbgPointAcctInvstDAO = ODSDAOFactory.getInstance().getTbgPointAcctInvstDAO();
TbgPointAcctInvstEntity tbgPointAcctInvstEntity = new TbgPointAcctInvstEntity();
tbgPointAcctInvstEntity.getData().setCurAcctNbr(
fncVO.getCurAcctNbr().toString() );
if ( tbgPointAcctInvstDAO.exists( tbgPointAcctInvstEntity ) )
{
tbgPointAcctInvstEntity = tbgPointAcctInvstDAO.find( tbgPointAcctInvstEntity );
tplCurAcctPrmntInstrHistEntity.getDataPoint().setInvstCurAcctNbr(
tbgPointAcctInvstEntity.getData().getInvstCurAcctNbr() );
}
else
{
tplCurAcctPrmntInstrHistEntity.getDataPoint().setInvstCurAcctNbr(
"" );
}
}
}
}
}
public BaseFncVO createFncVO()
{
return new CurAcctPrmntInstrHistoryDetailFncVO();
}
public void updateFormFromFncVO( ActionForm form_, BaseFncVO fncVO_ )
{
super.updateFormFromFncVO( form_, fncVO_ );
CurAcctPrmntInstrHistoryDetailFncVO fncVO = ( CurAcctPrmntInstrHistoryDetailFncVO ) fncVO_;
CurAcctPrmntInstrHistoryDetailForm form = ( CurAcctPrmntInstrHistoryDetailForm ) form_;
TplCurAcctPrmntInstrHistEntity curAcctPrmntInstrHistEntity = null;
TplIpDocPrvtEntity tplIpDocPrvtEntity;
BigInteger prmntCode;
String prmntText;
String prmntIndCCI;
String prmntCodeString;
String invstCur;
String[] row;
String[][] showList = null;
ArrayList listCurPrmntInstr = fncVO.getBaseTplIpDocPrvtEntityList();
if ( listCurPrmntInstr != null && listCurPrmntInstr.size() > 0 )
{
showList = new String[ listCurPrmntInstr.size() ][];
int rowIndex = 0;
for ( Iterator ite = listCurPrmntInstr.iterator(); ite.hasNext(); rowIndex++ )
{
curAcctPrmntInstrHistEntity = ( TplCurAcctPrmntInstrHistEntity ) ite.next();
prmntCode = curAcctPrmntInstrHistEntity.getData().getPrmntInstrCode();
prmntCodeString = prmntCode != null ? prmntCode.toString() : "";
prmntText = curAcctPrmntInstrHistEntity.getDataIP().getIpDocText();
prmntIndCCI = ODSConstraintDecoder.decodeIndicator( curAcctPrmntInstrHistEntity.getDataIP().getIpInvstCurAcctInd() );
invstCur = curAcctPrmntInstrHistEntity.getDataPoint().getInvstCurAcctNbr() != null
? curAcctPrmntInstrHistEntity.getDataPoint().getInvstCurAcctNbr()
: "";
row = new String[] { prmntCodeString, prmntText, prmntIndCCI, invstCur };
showList[ rowIndex ] = row;
}
form.setIpDocDomains( showList );
form.setLastAuthUserId( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastAuthUserId() );
form.setLastUpdUserId( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastUpdUserId() );
if ( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastAuthDate() != null )
{
form.setLastAuthDate( formatDateTime( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastAuthDate() ) );
}
if ( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastUpdDate() != null )
{
form.setLastUpdDate( formatDateTime( ( ( TplCurAcctPrmntInstrHistEntityVO ) curAcctPrmntInstrHistEntity.getData() ).getLastUpdDate() ) );
}
}
else
{
form.setIpDocDomains( null );
}
}
public void updateFncVOFromForm( ActionForm form_, BaseFncVO fncVO_ )
{
CurAcctPrmntInstrHistoryDetailFncVO fncVO = ( CurAcctPrmntInstrHistoryDetailFncVO ) fncVO_;
CurAcctPrmntInstrHistoryDetailForm form = ( CurAcctPrmntInstrHistoryDetailForm ) form_;
super.updateFncVOFromForm( form_, fncVO_ );
//Obtem os dados da tela que serão inseridos no grid
TplCurAcctPrmntInstrHistEntity tplCurAcctPrmntInstrHistEntityInsert = new TplCurAcctPrmntInstrHistEntity();
TplCurAcctPrmntInstrHistEntityVO histEntityVO = ( TplCurAcctPrmntInstrHistEntityVO ) tplCurAcctPrmntInstrHistEntityInsert.getData();
if ( form.getPrmntInstrCodeSrc() != null
&& form.getPrmntInstrCodeSrc().length() > 0 )
{
histEntityVO.setPrmntInstrCode( new BigInteger(
form.getPrmntInstrCodeSrc() ) );
}
if ( form.getPrmntInstrText() != null
&& form.getPrmntInstrText().length() > 0 )
{
tplCurAcctPrmntInstrHistEntityInsert.getDataIP().setIpDocText(
form.getPrmntInstrText() );
}
if ( form.getPrmntInstrInvstCurAcctInd() != null
&& form.getPrmntInstrInvstCurAcctInd().length() > 0 )
{
tplCurAcctPrmntInstrHistEntityInsert.getDataIP().setIpInvstCurAcctInd(
form.getPrmntInstrInvstCurAcctInd() );
}
if ( form.getCustNbrSrc() != null && form.getCustNbrSrc().length() > 0 )
{
histEntityVO.setCustNbr( new BigInteger( form.getCustNbrSrc() ) );
}
SimpleDateFormat formatter = new SimpleDateFormat(
FuncionalityFormatKeys.C_FORMAT_TIMESTAMP );
Date curAcctPrmntInstrRefDate;
try
{
curAcctPrmntInstrRefDate = ( form.getCurAcctPrmntInstrRefDate() != null
&& form.getCurAcctPrmntInstrRefDate().length() > 0
? formatter.parse( form.getCurAcctPrmntInstrRefDate() )
: null );
}
catch ( ParseException e_ )
{
curAcctPrmntInstrRefDate = null;
}
fncVO.setCurAcctPrmntInstrRefDate( curAcctPrmntInstrRefDate );
if ( form.getInvstAcctCurNbr() != null
&& form.getInvstAcctCurNbr().length() > 0 )
{
tplCurAcctPrmntInstrHistEntityInsert.getDataPoint().setInvstCurAcctNbr(
form.getInvstAcctCurNbr() );
}
histEntityVO.setProdAcctCode( new BigInteger( form.getProdAcctCode() ) );
histEntityVO.setProdUnderAcctCode( new BigInteger(
form.getProdUnderAcctCode() ) );
fncVO.setInsertIP( tplCurAcctPrmntInstrHistEntityInsert );
//Setando as informações do Produto a ser deletado
String delPrmnt = form.getSelectedIpGrid();
String delIpDesc = form.getSelectedIpDescGrid();
String delIndicatorGrid = form.getSelectedIpIndGrid();
String delInvstCurAcct = form.getSelectedInvstCurAcctGrid();
if ( !delPrmnt.equals( "" ) && !delInvstCurAcct.equals( "" )
&& !delIndicatorGrid.equals( "" ) && !delIpDesc.equals( "" ) )
{
TplCurAcctPrmntInstrHistEntity tplCurAcctPrmntInstrHistEntityDelete = new TplCurAcctPrmntInstrHistEntity();
TplCurAcctPrmntInstrHistEntityVO tplCurAcctPrmntInstrHistEntityVO = ( TplCurAcctPrmntInstrHistEntityVO ) tplCurAcctPrmntInstrHistEntityDelete.getData();
tplCurAcctPrmntInstrHistEntityVO.setPrmntInstrCode( new BigInteger(
form.getPrmntInstrCodeSrc() ) );
tplCurAcctPrmntInstrHistEntityDelete.getDataIP().setIpDocText( delIpDesc );
tplCurAcctPrmntInstrHistEntityDelete.getDataIP().setIpInvstCurAcctInd(
delIndicatorGrid );
tplCurAcctPrmntInstrHistEntityDelete.getDataPoint().setInvstCurAcctNbr(
delInvstCurAcct );
fncVO.setDeleteIP( tplCurAcctPrmntInstrHistEntityDelete );
}
}
} | [
"[email protected]"
] | |
eb20b07ae718898b0068773f1b806781b030a295 | 6a6c9682957da23f14488f2de55e529cfb5bdd14 | /ACom/common/src/main/java/com/test/common/ContextUtil.java | 1f30b4fdcd236422711d7926b4ddeb8279ebbf46 | [] | no_license | chenhao1041661180/androidComponentProject | 1779ae1796c9b43e56ea4d337c8b2297bf8efcb0 | be93e8ff9d4ead7fda03d05482d54db070332c67 | refs/heads/master | 2020-03-26T07:34:33.989063 | 2017-09-28T10:10:51 | 2017-09-28T10:10:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.test.common;
import android.content.Context;
/**
* Created by 郝新磊 on 2017/9/28.
*/
public class ContextUtil {
private static Context context;
public static void init(Context ctx){
context = ctx;
}
public static Context getContext(){
return context;
}
}
| [
"[email protected]"
] | |
db026049f1fabf01230704806ce79d0fd0dac29d | be5fa260434ae78ee709ea6064362aaeab477b79 | /src/main/java/com/yeeter/web/YeeterWebBackend/config/RestConfig.java | caad5e0f4142e6db51e860892c862b1346b836ba | [] | no_license | Martin-52/YeeterBackend | 20a0edcacba9f40b5b1920e14cda859ec47c6a3b | 8219839c2cb5793f177f27fde974a498c0dab5a7 | refs/heads/master | 2020-09-15T13:44:22.304354 | 2019-12-12T23:26:44 | 2019-12-12T23:26:44 | 223,464,043 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,000 | java | package com.yeeter.web.YeeterWebBackend.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
@Configuration
public class RestConfig {
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("*");
config.addAllowedHeader("*");
config.addAllowedMethod("OPTIONS");
config.addAllowedMethod("GET");
config.addAllowedMethod("POST");
config.addAllowedMethod("PUT");
config.addAllowedMethod("DELETE");
source.registerCorsConfiguration("/**", config);
return new CorsFilter(source);
}
} | [
"[email protected]"
] | |
d9404bd59d4e292da85349a5e7d491df46a407ae | 5b802cff0ccef28177f1b5eb032da0f7fccbe520 | /app/src/main/java/com/zyascend/JLUZone/photo/PhotoPresenter.java | 19289eb282bb551e2ca0c4f7bb1e851b2cb58612 | [] | no_license | zyascend/JLUZone | 72c00d4e584290be35321cd334b8dbe6b0dd89d1 | d8bc8da7e5f7a9c78e0d9509363238e025ff59c4 | refs/heads/master | 2020-12-24T12:33:57.254639 | 2017-04-13T15:01:09 | 2017-04-13T15:01:09 | 72,979,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package com.zyascend.JLUZone.photo;
import com.zyascend.JLUZone.base.BasePresenter;
/**
*
* Created by Administrator on 2016/8/6.
*/
public class PhotoPresenter extends BasePresenter<PhotoContract.View> {
}
| [
"[email protected]"
] | |
1cdd0b077bbce1f6143068ee4587563280c9a133 | 33b45c51212fca5a92d4fde0181a41b7b66d145f | /src/main/java/edu/ben/classconnect/config/ClassConnectSecurityConfig.java | 36aed7644114e4474a7492c0af19cf3744194731 | [] | no_license | Savaman/clubudeployment | 92c99dc7e562bf92f31b2ea9385d9b7714a37656 | 3b25b14b81723581c88a06cfacedeec7c5b268c8 | refs/heads/master | 2021-09-05T18:10:55.063785 | 2018-01-30T05:51:20 | 2018-01-30T05:51:20 | 119,413,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,184 | java | package edu.ben.classconnect.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import edu.ben.classconnect.services.MyUserDetailsService;
@Configuration
@EnableWebSecurity
public class ClassConnectSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsServiceBean());
auth.authenticationProvider(authenticationProvider());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/resources/**","/register/**").permitAll().anyRequest().authenticated().and().formLogin()
.loginPage("/login").loginProcessingUrl("/authenticateTheUser").permitAll();
}
@Bean
public DaoAuthenticationProvider authenticationProvider() throws Exception {
DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
authenticationProvider.setUserDetailsService(userDetailsServiceBean());
authenticationProvider.setPasswordEncoder(passwordEncoder());
return authenticationProvider;
}
@Bean
public PasswordEncoder passwordEncoder() {
PasswordEncoder encoder = new BCryptPasswordEncoder();
return encoder;
}
@Override
@Bean
public UserDetailsService userDetailsServiceBean() throws Exception {
return new MyUserDetailsService();
}
}
| [
"[email protected]"
] | |
c488d131db16cb72ad6ef0142330560eb378704e | f8db42c5808b23b2900a7fa30876ec1c46cfcd4b | /src/main/com/google/errorprone/refaster/UNewClass.java | a1509ecf8484cd64642eae22c6dce0ad29e94c1e | [
"Apache-2.0"
] | permissive | sivakumar-kailasam/refactor-faster | 0a46639e50d81c49b02f836d658b1ee7b4e9c6fe | aeac2b1942c621e6e968b8fac6ff3d6fd6d282b9 | refs/heads/master | 2016-09-10T19:39:02.132530 | 2015-08-04T19:00:32 | 2015-08-04T19:00:32 | 40,143,432 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,863 | java | /*
* Copyright 2013 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.errorprone.refaster;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import com.sun.source.tree.NewClassTree;
import com.sun.source.tree.TreeVisitor;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCNewClass;
import java.util.List;
import javax.annotation.Nullable;
/**
* {@link UTree} version of {@link NewClassTree}, which represents a constructor invocation.
*
* @author [email protected] (Louis Wasserman)
*/
@AutoValue
abstract class UNewClass extends UExpression implements NewClassTree {
public static UNewClass create(UExpression enclosingExpression,
List<? extends UExpression> typeArguments, UExpression identifier,
List<UExpression> arguments, @Nullable UClassDecl classBody) {
return new AutoValue_UNewClass(
enclosingExpression, ImmutableList.copyOf(typeArguments), identifier,
ImmutableList.copyOf(arguments), classBody);
}
public static UNewClass create(
List<? extends UExpression> typeArguments, UExpression identifier,
UExpression... arguments) {
return create(null, typeArguments, identifier, ImmutableList.copyOf(arguments), null);
}
public static UNewClass create(UExpression identifier, UExpression... arguments) {
return create(ImmutableList.<UExpression>of(), identifier, arguments);
}
@Override
@Nullable
public abstract UExpression getEnclosingExpression();
/**
* Note: these are not the type arguments to the class, but to the constructor, for
* those extremely rare constructors that look like e.g. {@code <E> Foo(E e)}, where
* the type parameter is for the constructor alone and not the class.
*/
@Override
public abstract List<UExpression> getTypeArguments();
@Override
public abstract UExpression getIdentifier();
@Override
public abstract List<UExpression> getArguments();
@Override
@Nullable
public abstract UClassDecl getClassBody();
@Override
@Nullable
public Unifier visitNewClass(NewClassTree newClass, @Nullable Unifier unifier) {
unifier = Unifier.unifyNullable(
unifier, getEnclosingExpression(), newClass.getEnclosingExpression());
unifier = Unifier.unifyList(unifier, getTypeArguments(), newClass.getTypeArguments());
unifier = getIdentifier().unify(newClass.getIdentifier(), unifier);
unifier = Unifier.unifyNullable(unifier, getClassBody(), newClass.getClassBody());
return Unifier.unifyList(unifier, getArguments(), newClass.getArguments());
}
@Override
public Kind getKind() {
return Kind.NEW_CLASS;
}
@Override
public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {
return visitor.visitNewClass(this, data);
}
@Override
public JCNewClass inline(Inliner inliner) throws CouldNotResolveImportException {
return inliner.maker().NewClass(
(getEnclosingExpression() == null) ? null : getEnclosingExpression().inline(inliner),
inliner.<JCExpression, UExpression>inlineList(getTypeArguments()),
getIdentifier().inline(inliner),
inliner.<JCExpression, UExpression>inlineList(getArguments()),
(getClassBody() == null) ? null : getClassBody().inline(inliner));
}
}
| [
"[email protected]"
] | |
8a1e7cc3d0aff9d989a6dc18ae824ad1d274db06 | d9365f606794490d534699a42bc0ea4f15bda3f8 | /src/main/java/Ahorcado/APuntajes.java | 9fe577f212e457940022a15534af95f2b0e5d1aa | [] | no_license | guerreroandrey5/FP-ISW-211 | dd2936fa9af2418ad777aa7becd2985c11390c29 | 4d7be10d95b769526645ae4b9228f60d9ea1f208 | refs/heads/master | 2023-07-25T22:35:47.099323 | 2021-08-17T02:18:47 | 2021-08-17T02:18:47 | 392,385,750 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,044 | 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 Ahorcado;
import java.awt.Color;
import java.io.*;
import javax.swing.JOptionPane;
import javax.swing.table.*;
/**
*
* @author guerreroandrey5
*/
public class APuntajes extends javax.swing.JFrame {
/**
* Creates new form APuntajes
*/
private String ruta = System.getProperties().getProperty("user.dir");
public APuntajes() {
initComponents();
THistoryLoad();
}
/*Loads the data from a TXT in the project, the files has the Scores*/
void THistoryLoad(){
DefaultTableCellRenderer MyHeaderRender = new DefaultTableCellRenderer();
MyHeaderRender.setBackground(Color.decode("#5A5A5A"));
File archivo = null;
FileReader FileR = null;
BufferedReader BufferedR = null;
try{
archivo = new File(ruta + "//HistorialHanged.txt");
FileR = new FileReader(archivo);
BufferedR = new BufferedReader(FileR);
String data;
DefaultTableModel HistoryTablez = new DefaultTableModel();
HistoryTablez.addColumn("Historial de Ahorcado");
while((data = BufferedR.readLine()) != null){
System.out.println(data);
HistoryTablez.addRow(new String []{data});
}
HistoryTable.setModel(HistoryTablez);
HistoryTable.getTableHeader().getColumnModel().getColumn(0).setHeaderRenderer(MyHeaderRender);
}catch (Exception e){JOptionPane.showMessageDialog(null, "No hay datos registrados sobre Records, el registro se mostrará en blanco");}finally{try{if(null!=FileR) {FileR.close();}}catch(IOException e2){
}
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
PlnScores = new javax.swing.JPanel();
LblHistory = new javax.swing.JLabel();
BtnMenu = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
HistoryTable = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Historial de Ahorcado");
setName("FScores"); // NOI18N
setResizable(false);
PlnScores.setBackground(new java.awt.Color(63, 63, 63));
LblHistory.setForeground(new java.awt.Color(204, 204, 204));
LblHistory.setText("Historial de Partidas");
BtnMenu.setBackground(new java.awt.Color(63, 63, 63));
BtnMenu.setForeground(new java.awt.Color(204, 204, 204));
BtnMenu.setText("Volver al Menu");
BtnMenu.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnMenuActionPerformed(evt);
}
});
HistoryTable.setBackground(new java.awt.Color(63, 63, 63));
HistoryTable.setForeground(new java.awt.Color(204, 204, 204));
HistoryTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{},
{},
{},
{}
},
new String [] {
}
));
HistoryTable.setEnabled(false);
HistoryTable.setGridColor(new java.awt.Color(63, 63, 63));
HistoryTable.setSelectionBackground(new java.awt.Color(63, 63, 63));
HistoryTable.setSelectionForeground(new java.awt.Color(63, 63, 63));
HistoryTable.setShowGrid(true);
HistoryTable.getTableHeader().setReorderingAllowed(false);
jScrollPane1.setViewportView(HistoryTable);
javax.swing.GroupLayout PlnScoresLayout = new javax.swing.GroupLayout(PlnScores);
PlnScores.setLayout(PlnScoresLayout);
PlnScoresLayout.setHorizontalGroup(
PlnScoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PlnScoresLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PlnScoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 652, Short.MAX_VALUE)
.addGroup(PlnScoresLayout.createSequentialGroup()
.addComponent(LblHistory)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(BtnMenu)))
.addContainerGap())
);
PlnScoresLayout.setVerticalGroup(
PlnScoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PlnScoresLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PlnScoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(BtnMenu)
.addComponent(LblHistory))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(PlnScores, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(PlnScores, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void BtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnMenuActionPerformed
int respuesta = JOptionPane.showConfirmDialog(null, "Realmente desea regresar al menú?", "Está seguro?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (respuesta == 0){
dispose();
AMenu AhoMenu = new AMenu();
AhoMenu.setVisible(true);
}
}//GEN-LAST:event_BtnMenuActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(APuntajes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(APuntajes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(APuntajes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(APuntajes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new APuntajes().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton BtnMenu;
private javax.swing.JTable HistoryTable;
private javax.swing.JLabel LblHistory;
private javax.swing.JPanel PlnScores;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
a0cfd5dd5f0c4e7cd2cade46750633612ada1868 | 66daaa776562c001f6504086ca97f74a30e018e6 | /app/src/test/java/com/jonathenchen/paintracker/ExampleUnitTest.java | 6c4f3bbb7581931a70ff0afcd83f5e6d93a91713 | [] | no_license | ohthejon/PainTrackerApp | 5aea1955186e776af5ca2e3b3159d230bebe544f | 752f191a8711ddea8d2cb81fa562d5f332a863ea | refs/heads/master | 2021-01-17T05:58:14.710837 | 2016-07-21T06:56:51 | 2016-07-21T06:56:51 | 65,565,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.jonathenchen.paintracker;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
e4e7d77de68106a4fb4de19ca70d664d23c4a822 | a1995ba5a4aa0c8997b0a0095d28c10521ddf419 | /ViewProject/src/main/java/org/liferayasif/front/dto/NavigationDto.java | f13f755375c388c6eb20f9e04180a7284438bcf9 | [] | no_license | asifaftab87/SpringPersistenceHibernate | 0494a2800854d9dffa19e719eac1083800c7d39e | 7a297b420c580bea564b6b4f00afa4f634b8e555 | refs/heads/master | 2022-12-22T10:56:08.775322 | 2019-07-13T11:09:32 | 2019-07-13T11:09:32 | 134,027,545 | 2 | 3 | null | 2022-12-16T08:44:53 | 2018-05-19T03:52:59 | Java | UTF-8 | Java | false | false | 1,283 | java | package org.liferayasif.front.dto;
public class NavigationDto {
private Long id;
private String pageCode;
private String pageName;
private String pageDescription;
private String parentCode;
private String url;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPageCode() {
return pageCode;
}
public void setPageCode(String pageCode) {
this.pageCode = pageCode;
}
public String getPageName() {
return pageName;
}
public void setPageName(String pageName) {
this.pageName = pageName;
}
public String getPageDescription() {
return pageDescription;
}
public void setPageDescription(String pageDescription) {
this.pageDescription = pageDescription;
}
public String getParentCode() {
return parentCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public String toString() {
return "NavigationDto [id=" + id + ", pageCode=" + pageCode + ", pageName=" + pageName + ", pageDescription="
+ pageDescription + ", parentCode=" + parentCode + ", url=" + url + "]";
}
}
| [
"[email protected]"
] | |
d08e36c1171e5ea2572e3811e0213e2d2fa88990 | 61c4858477b6fccf58665cc7807bb14032c44a36 | /core/src/com/sawyerharris/capstone/simulation/PendulumCartSimulation.java | 6b633364906818c4108ee7429f5d59676d33fe34 | [] | no_license | Sawrr/capstone-app | db9f0f126d13b1751854ef6c56fcd43bf18e9c9e | 761080212d464c685818acdb7f92aef5de20dc20 | refs/heads/master | 2021-06-23T06:15:44.648188 | 2017-04-12T15:41:40 | 2017-04-12T15:41:40 | 57,169,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,437 | java | package com.sawyerharris.capstone.simulation;
import com.sawyerharris.capstone.demo.Demo;
public class PendulumCartSimulation extends Simulation {
private double cartX;
private double cartV;
private double cartMass;
private double forceX;
@Override
public void update(double dt) {
super.update(dt);
double omegaa = omega1 + dt / 2 * omegadot(psi1, omega1);
double psia = psi1 + dt / 2 * omega1;
double va = cartV + dt / 2 * vdot(psi1, omega1);
double xa = cartX + dt / 2 * cartV;
double omegab = omega1 + dt / 2 * omegadot(psia, omegaa);
double psib = psi1 + dt / 2 * omegaa;
double vb = cartV + dt / 2 * vdot(psia, omegaa);
double xb = cartX + dt / 2 * va;
double omegac = omega1 + dt * omegadot(psib, omegab);
double psic = psi1 + dt * omegab;
double vc = cartV + dt * vdot(psib, omegab);
double xc = cartX + dt * vb;
double omegad = omega1 + dt * omegadot(psic, omegac);
double psid = psi1 + dt * omegac;
double vd = cartV + dt * vdot(psic, omegac);
double xd = cartX + dt * vc;
omega1 = (omegaa + 2 * omegab + omegac + omegad / 2) / 3 - omega1 / 2;
psi1 = (psia + 2 * psib + psic + psid / 2) / 3 - psi1 / 2;
cartV = (va + 2 * vb + vc + vd / 2) / 3 - cartV / 2;
cartX = (xa + 2 * xb + xc + xd / 2) / 3 - cartX / 2;
float maxCartX = Demo.SIMULATION_WIDTH / Demo.LENGTH_SCALE;
if (cartX > maxCartX) cartX %= maxCartX;
if (cartX < 0) cartX += maxCartX;
}
private double omegadot(double psi, double omega) {
return -(forceX*Math.cos(psi) + (cartMass + mass1)*gravity*Math.sin(psi) + mass1*length1*omega*omega*Math.cos(psi)*Math.sin(psi))/(length1*(cartMass + mass1*Math.sin(psi)*Math.sin(psi)));
}
private double vdot(double psi, double omega) {
return (forceX + mass1*gravity*Math.cos(psi)*Math.sin(psi) + mass1*length1*omega*omega*Math.sin(psi))/(cartMass + mass1*Math.sin(psi)*Math.sin(psi));
}
@Override
protected void updateParameter(String param, double value) {
super.updateParameter(param, value);
if (param.equals("cartX")) {
cartX = value;
} else if (param.equals("cartV")) {
cartV = value;
} else if (param.equals("cartMass")) {
cartMass = value;
} else if (param.equals("forceX")) {
forceX = value;
}
}
public double getCartX() {
return cartX;
}
public double getCartV() {
return cartV;
}
public double getCartMass() {
return cartMass;
}
public double getForceX() {
return forceX;
}
}
| [
"[email protected]"
] | |
ac321645f2ff0997d1ebc199f5e043dd71265388 | 4c076f94ab695a23aa342a9b12eefdcd8515b61d | /src/test/java/net/lliira/leetcode/r051/P083RemoveDupsTest.java | 00f4c3e653ae35f08988c929b6ad2136ab911895 | [] | no_license | jerric/lliira-leetcode | 091948f753a7b9cd443748544a166ade49ee5071 | ce79c2bd6521886d36bd5b82ef6092572a74c2c8 | refs/heads/master | 2021-01-13T11:40:58.775775 | 2017-03-05T23:02:55 | 2017-03-05T23:02:55 | 77,765,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package net.lliira.leetcode.r051;
import net.lliira.leetcode.ListNode;
import org.testng.annotations.Test;
import static net.lliira.leetcode.TestHelper.*;
/**
* Created by Jerric on 1/23/2017.
*/
public class P083RemoveDupsTest {
private final P083RemoveDups solution = new P083RemoveDups();
@Test
public void tests() {
test(link(1, 1, 2), link(1, 2));
test(link(1, 1, 2, 3, 3), link(1, 2, 3));
}
private void test(final ListNode head, final ListNode expected) {
final ListNode result = this.solution.deleteDuplicates(head);
assertEquals(result, expected);
}
}
| [
"[email protected]"
] | |
7eda201666339f5d2227cc7d454cf2787f31a782 | d7bb11ea6fdb10461846e9883a7d49a88407c641 | /practica2/src/aed/actasnotas/MatriculaComparator.java | 5dc8e7eb9350abb5956e6ff549cb675a69fd78b6 | [] | no_license | onmax/Algoritmos-y-estructura-de-datos | 26f3854e3b320e1f3da1a085d7812d7f03c48f49 | 7e7b494f7a4f1bb3d1c988bd54951f4fe8132c3f | refs/heads/master | 2021-08-30T15:08:19.130552 | 2017-12-18T11:37:58 | 2017-12-18T11:37:58 | 103,954,777 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | package aed.actasnotas;
import java.util.Comparator;
public class MatriculaComparator implements Comparator<Calificacion> {
public int compare(Calificacion c1, Calificacion c2) {
return c1.getMatricula().compareTo(c2.getMatricula());
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.