blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3002f4d325b45ecfbf527b34e9858495f82a00cf | 35c3d88ca4b919b36f3647890f49b6de19575779 | /AirCleaner_03/src/main/java/cn/sdyk/controller/textController.java | a36c413dd9a104c61983675aeb2588495dfd465b | [] | no_license | jiacheshi/air | c38ae0a9df81cdd4b7cb68c20746e4978fbef36b | aa91c3583b1689683c8f3139c355e79b21664d09 | refs/heads/master | 2022-06-22T13:46:14.944408 | 2020-03-11T06:42:42 | 2020-03-11T06:42:42 | 246,495,272 | 0 | 0 | null | 2022-06-21T02:57:51 | 2020-03-11T06:44:31 | Java | UTF-8 | Java | false | false | 2,585 | java | package cn.sdyk.controller;
import cn.sdyk.config.StrSplit;
import cn.sdyk.mapper.UserMapper;
import cn.sdyk.pojo.Device;
import cn.sdyk.pojo.User;
import cn.sdyk.service.impl.DeviceService;
import cn.sdyk.service.impl.UserService;
import com.alibaba.fastjson.JSON;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Controller
public class textController {
@Autowired
UserService userService;
@Autowired
StrSplit strSplit;
@Autowired
DeviceService deviceService;
@Autowired
Device device;
@PostMapping("/deviceList2")
public void DeviceList(HttpServletRequest request, HttpServletResponse response) {
// String accessToken = (String) redisTemplate.opsForValue().get(sesionid);
// JSONObject jsonObject=JSONObject.parseObject(accessToken);
//获取用户mac列表
String macList = "";
User user = userService.getUserByUname("a");
macList = user.getMac();
System.out.println(user.getMac());
String[] alist = {"76A32CE97907","76A32CE97908"};
List<Device> lists = new ArrayList<Device>();
for (int i = 0; i < alist.length; i++) {
device = deviceService.selByMac(alist[i]);
lists.add(device);
}
String date = JSON.toJSONString(lists);
try {
sendJsonData(response, date);
} catch (Exception e) {
e.printStackTrace();
}
}
protected void sendJsonData(HttpServletResponse response, String data) throws Exception {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println(data);
out.flush();
out.close();
}
@GetMapping("/mianPage")
public String MianPage(){
return "mianPage";
}
@GetMapping("/equipmentPage")
public String EquipmentPage(){
return "equipmentPage";
}
@GetMapping("/pageLogin")
public String PageLogin(){
return "pageLogin";
}
} | [
"1195367249@qq.com"
] | 1195367249@qq.com |
f359331d0641b3063c1f5c583c07469bfb76e068 | d6b5b32f6a50154c4b75af69d51015c0cc000361 | /freeipa-api/src/main/java/com/sequenceiq/freeipa/api/v1/freeipa/stack/model/reboot/RebootInstancesRequest.java | be4ee28c8a0f4a85f30ab4d10a62e9893183f5ea | [
"LicenseRef-scancode-warranty-disclaimer",
"ANTLR-PD",
"CDDL-1.0",
"bzip2-1.0.6",
"Zlib",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-jdbm-1.00",
"Apache-2.0"
] | permissive | subhashjha35/cloudbreak | 19f0ba660e7343d36e1bd840c5f32f3f2310b978 | 28265d0e4681ec9d8bef425e0ad6e339584127ed | refs/heads/master | 2021-04-24T00:22:04.561673 | 2020-03-18T18:30:04 | 2020-03-25T12:02:51 | 250,041,790 | 1 | 0 | Apache-2.0 | 2020-03-25T17:10:58 | 2020-03-25T17:10:58 | null | UTF-8 | Java | false | false | 1,475 | java | package com.sequenceiq.freeipa.api.v1.freeipa.stack.model.reboot;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.sequenceiq.service.api.doc.ModelDescriptions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel("RebootInstancesV1Request")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RebootInstancesRequest {
@NotEmpty
@ApiModelProperty(value = ModelDescriptions.ENVIRONMENT_CRN, required = true)
private String environmentCrn;
@ApiModelProperty(value = ModelDescriptions.FORCE_REBOOT, required = false)
private boolean forceReboot;
@ApiModelProperty(value = ModelDescriptions.INSTANCE_ID, required = false)
private List<String> instanceIds;
public String getEnvironmentCrn() {
return environmentCrn;
}
public void setEnvironmentCrn(String environmentCrn) {
this.environmentCrn = environmentCrn;
}
public boolean isForceReboot() {
return forceReboot;
}
public void setForceReboot(boolean forceReboot) {
this.forceReboot = forceReboot;
}
public List<String> getInstanceIds() {
return instanceIds;
}
public void setInstanceIds(List<String> instanceIds) {
this.instanceIds = instanceIds;
}
}
| [
"akanto@users.noreply.github.com"
] | akanto@users.noreply.github.com |
710d85d7cc44a433b8c95b64d153af600056c218 | b14316d272722ae2be20e552355243998188b1ee | /src/com/zhaopin/models/User.java | 560cf4a6cca7acc24a391db41307c3da75e6c750 | [] | no_license | terryzheng/jFinal | 14362d018ce9f3ee605ca058e0044706f7e2eea5 | f8688566e5c76db8d6d91ef93f5928e131228b53 | refs/heads/master | 2020-05-19T11:49:51.527626 | 2014-02-24T06:03:41 | 2014-02-24T06:03:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 628 | java | package com.zhaopin.models;
import java.util.List;
import com.jfinal.plugin.activerecord.Model;
@SuppressWarnings("serial")
public class User extends Model<User> {
public static final User dao = new User();
public List<Job> get_job_list() {
return Job.dao.find("select * from job_info where user_id=?",
get("usr_id"));
}
public List<User> get_users() {
// return User.dao
// .find("SELECT usr_id,usr_name,usr_email FROM user_info ORDER BY usr_id DESC LIMIT 10");
return User.dao
.findByCache("users", "users1",
"SELECT usr_id,usr_name,usr_email FROM user_info ORDER BY usr_id DESC LIMIT 10");
}
} | [
"zl_terry@126.com"
] | zl_terry@126.com |
672b5eb3fe3abc94a4d0ab5ebc2a049d05d8389d | 96ec89610466731f88d88cda8f166e82f9a79e96 | /src/main/java/com/cfy/interest/model/UserOperationMessage.java | ca9bb35df1a78bb63e06e1e0e48f71263d977b22 | [] | no_license | chenfuyuan/interest-circle | 8bf3216878426e2cf43067f5bc37703e9d4bec15 | 79c3c3329bcf5a108c7a4e1caf56c124041af91c | refs/heads/master | 2022-06-21T05:03:09.368295 | 2020-07-02T17:24:42 | 2020-07-02T17:24:42 | 225,778,875 | 1 | 0 | null | 2022-06-17T02:46:38 | 2019-12-04T04:27:46 | JavaScript | UTF-8 | Java | false | false | 837 | java | package com.cfy.interest.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user_operation_message")
public class UserOperationMessage {
@TableId(type = IdType.AUTO)
private Integer id;
@TableField(exist = false)
private User user;
private Long uid;
private String message;
private Date datetime;
private Integer type;
public static final Integer CREATE = 1;
public static final Integer UPDATE = 2;
public static final Integer CHANGEPASSWORD = 3;
}
| [
"chenfuyuan0713@163.com"
] | chenfuyuan0713@163.com |
438f9bff380589c897c0eed508864fcbc3ec645d | 30620f7010d11255f00df9b4f0c4e9bdda2fa11d | /Module 2/Chapter 11/Windows/xamformsinsights/droid/obj/debug/android/src/mono/android/support/design/widget/SwipeDismissBehavior_OnDismissListenerImplementor.java | d822fec22ecf70d070f22d137272e1f44595afcd | [
"MIT"
] | permissive | PacktPublishing/Xamarin-Cross-Platform-Mobile-Application-Development | 957db5a284c9b590d34d932909724e9eb10ca7a6 | dc83c18f4d4d1720b62f3077b4f53d5a90143304 | refs/heads/master | 2023-02-11T16:07:55.095797 | 2023-01-30T10:24:05 | 2023-01-30T10:24:05 | 66,077,875 | 7 | 17 | MIT | 2022-06-22T17:23:02 | 2016-08-19T11:32:15 | Java | UTF-8 | Java | false | false | 1,937 | java | package mono.android.support.design.widget;
public class SwipeDismissBehavior_OnDismissListenerImplementor
extends java.lang.Object
implements
mono.android.IGCUserPeer,
android.support.design.widget.SwipeDismissBehavior.OnDismissListener
{
static final String __md_methods;
static {
__md_methods =
"n_onDismiss:(Landroid/view/View;)V:GetOnDismiss_Landroid_view_View_Handler:Android.Support.Design.Widget.SwipeDismissBehavior/IOnDismissListenerInvoker, Xamarin.Android.Support.Design\n" +
"n_onDragStateChanged:(I)V:GetOnDragStateChanged_IHandler:Android.Support.Design.Widget.SwipeDismissBehavior/IOnDismissListenerInvoker, Xamarin.Android.Support.Design\n" +
"";
mono.android.Runtime.register ("Android.Support.Design.Widget.SwipeDismissBehavior+IOnDismissListenerImplementor, Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", SwipeDismissBehavior_OnDismissListenerImplementor.class, __md_methods);
}
public SwipeDismissBehavior_OnDismissListenerImplementor () throws java.lang.Throwable
{
super ();
if (getClass () == SwipeDismissBehavior_OnDismissListenerImplementor.class)
mono.android.TypeManager.Activate ("Android.Support.Design.Widget.SwipeDismissBehavior+IOnDismissListenerImplementor, Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}
public void onDismiss (android.view.View p0)
{
n_onDismiss (p0);
}
private native void n_onDismiss (android.view.View p0);
public void onDragStateChanged (int p0)
{
n_onDragStateChanged (p0);
}
private native void n_onDragStateChanged (int p0);
java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
| [
"vishalm@packtpub.com"
] | vishalm@packtpub.com |
7410cd06fd044dbc4361e4c8cff7f27f798c234b | cd476bfd09912c456109c5f6c79d171b7e63d14d | /app/src/main/java/com/you_tube/auto_subscribers/ExtraUtils/HttpHandler.java | bdfa8a75ee9232fa6a8087b09fbcbae6e367b00f | [] | no_license | communicationmantra/OnTubeAutoSubscribers | 4eb5e59920f0c8b60524a1832257a311b58174b1 | 560ec6df4b83aa41ed9d98e06d79bffcb506ce74 | refs/heads/master | 2020-09-06T11:39:03.632236 | 2019-11-08T07:22:09 | 2019-11-08T07:22:09 | 220,413,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,036 | java | package com.you_tube.auto_subscribers.ExtraUtils;
import android.util.Log;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
/**
* Created by Ravi Tamada on 01/09/16.
* www.androidhive.info
*/
public class HttpHandler {
private static final String TAG = HttpHandler.class.getSimpleName();
public HttpHandler() {
}
public String makeServiceCall(String reqUrl) {
String response = null;
try {
URL url = new URL(reqUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
// read the response
InputStream in = new BufferedInputStream(conn.getInputStream());
response = convertStreamToString(in);
} catch (MalformedURLException e) {
Log.e(TAG, "MalformedURLException: " + e.getMessage());
} catch (ProtocolException e) {
Log.e(TAG, "ProtocolException: " + e.getMessage());
} catch (IOException e) {
Log.e(TAG, "IOException: " + e.getMessage());
} catch (Exception e) {
Log.e(TAG, "Exception: " + e.getMessage());
}
return response;
}
private String convertStreamToString(InputStream is) {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line;
try {
while ((line = reader.readLine()) != null) {
sb.append(line).append('\n');
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}
}
| [
"communicationmantra@gmail.com"
] | communicationmantra@gmail.com |
5fa56d0ca90d86c61294f80d26c61eff63e17bf8 | d67188e033759720dbef54c0e66a812b650deeab | /MainActivity.java | 9c0565fdd9c9c5269655892ae38eb902f341c03c | [] | no_license | vijaypalsingh01/CatchAllEggs | 25fc4deafe62a85d7302000373b6b594af539e2c | b69aa9c52a9f00cf8babcc9eebf2d0e53b137437 | refs/heads/master | 2020-05-22T14:28:24.266712 | 2019-07-09T21:46:20 | 2019-07-09T21:46:20 | 186,385,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,274 | java | package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Button play;
private Button highScore;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
play = findViewById(R.id.playNow);
play.setOnClickListener(this);
highScore = findViewById(R.id.highscore);
highScore.setOnClickListener(this);
}
@Override
public void onClick(View view) {
if(view.getId() == play.getId()) {
System.out.println("play");
openActivityPlay();
}
if (view.getId() == highScore.getId()) {
System.out.println("highScore");
openActivityScore();
}
}
public void openActivityPlay(){
Intent intent = new Intent(this, PlayGame.class);
startActivity(intent);
}
public void openActivityScore(){
Intent intent = new Intent(this, HighScore.class);
startActivity(intent);
}
}
| [
"43369161+vijaypalsingh01@users.noreply.github.com"
] | 43369161+vijaypalsingh01@users.noreply.github.com |
e572c9071932e37ce66ddac1dd4b0cc63c361443 | ea329f76eae864b2c75ff82a406bd342ce7dc176 | /dubbo-provider/src/main/java/dubbo/service/impl/MyService.java | 9ca2283209503fe753613caa798c85e77c2ccfde | [] | no_license | wzqinyes/test-projects | edb94632e9ca66d0e747dcdfbdf9c37b70aeec2a | ce87eb3a36abfb3f5ba6563d591e49176aaab4d7 | refs/heads/master | 2022-07-11T06:53:23.070258 | 2020-08-03T00:53:08 | 2020-08-03T00:53:08 | 222,591,307 | 0 | 0 | null | 2022-06-29T17:58:28 | 2019-11-19T02:32:16 | Java | UTF-8 | Java | false | false | 585 | java | package dubbo.service.impl;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Value;
import dubbo.service.BaseService;
@Service(version = "${dubbo.service.version:1.0.0}")
public class MyService implements BaseService {
//The default value of ${dubbo.application.name} is ${spring.application.name}
@Value("${dubbo.application.name}")
private String name;
@Override
public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
}
| [
"wuzeqin@sinobest.cn"
] | wuzeqin@sinobest.cn |
3f0b191318a591c47590943473af779802a86f72 | 9b3de0863d909e528e6470f8c0a0ef006030e21b | /app/src/main/java/com/example/yubo/bluepi/DeviceListActivity.java | 9609f6fb1cb205ffebc77f53a179f28d425ef88b | [
"MIT"
] | permissive | calebmackdavenport/Bluetooth-RPi | 3c1285491a6b3b5f2a3299db51b8984059130b5f | 0ceb089231f77e02dc148d9d87c1ccda71207dbc | refs/heads/master | 2022-12-10T12:49:32.905475 | 2018-01-30T18:54:46 | 2018-01-30T18:54:46 | 120,515,320 | 0 | 0 | null | 2021-11-30T02:01:11 | 2018-02-06T19:53:01 | Java | UTF-8 | Java | false | false | 7,955 | java | /*
* Copyright 2017 The Android Open Source Project, Inc.
*
* 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 com.example.yubo.bluepi;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import java.util.Set;
/**
* Created by yubo on 7/11/17.
*/
public class DeviceListActivity extends Activity {
/**
* Tag for Log
*/
private static final String TAG = "DeviceListActivity";
/**
* Return Intent extra
*/
public static String EXTRA_DEVICE_ADDRESS = "device_address";
/**
* Member fields
*/
private BluetoothAdapter mBtAdapter;
/**
* Newly discovered devices
*/
private ArrayAdapter<String> mNewDevicesArrayAdapter;
@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Setup the window
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_device_list);
// Set result CANCELED in case the user backs out
setResult(Activity.RESULT_CANCELED);
// Initialize the button to perform device discovery
Button scanButton = (Button) findViewById(R.id.button_scan);
scanButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
doDiscovery();
v.setVisibility(View.GONE);
}
});
// Initialize array adapters. One for already paired devices and
// one for newly discovered devices
ArrayAdapter<String> pairedDevicesArrayAdapter =
new ArrayAdapter<String>(this, R.layout.device_name);
mNewDevicesArrayAdapter = new ArrayAdapter<String>(this, R.layout.device_name);
// Find and set up the ListView for paired devices
ListView pairedListView = (ListView) findViewById(R.id.paired_devices);
pairedListView.setAdapter(pairedDevicesArrayAdapter);
pairedListView.setOnItemClickListener(mDeviceClickListener);
// Find and set up the ListView for newly discovered devices
ListView newDevicesListView = (ListView) findViewById(R.id.new_devices);
newDevicesListView.setAdapter(mNewDevicesArrayAdapter);
newDevicesListView.setOnItemClickListener(mDeviceClickListener);
// Register for broadcasts when a device is discovered
IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
this.registerReceiver(mReceiver, filter);
// Register for broadcasts when discovery has finished
filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
this.registerReceiver(mReceiver, filter);
// Get the local Bluetooth adapter
mBtAdapter = BluetoothAdapter.getDefaultAdapter();
// Get a set of currently paired devices
Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();
// If there are paired devices, add each one to the ArrayAdapter
if (pairedDevices.size() > 0) {
findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);
for (BluetoothDevice device : pairedDevices) {
pairedDevicesArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
} else {
String noDevices = getResources().getText(R.string.none_paired).toString();
pairedDevicesArrayAdapter.add(noDevices);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
// Make sure we're not doing discovery anymore
if (mBtAdapter != null) {
mBtAdapter.cancelDiscovery();
}
// Unregister broadcast listeners
this.unregisterReceiver(mReceiver);
}
/**
* Start device discover with the BluetoothAdapter
*/
private void doDiscovery() {
Log.d(TAG, "doDiscovery()");
// Indicate scanning in the title
setProgressBarIndeterminateVisibility(true);
setTitle(R.string.scanning);
// Turn on sub-title for new devices
findViewById(R.id.title_new_devices).setVisibility(View.VISIBLE);
// If we're already discovering, stop it
if (mBtAdapter.isDiscovering()) {
mBtAdapter.cancelDiscovery();
}
// Request discover from BluetoothAdapter
mBtAdapter.startDiscovery();
}
/**
* The on-click listener for all devices in the ListViews
*/
private AdapterView.OnItemClickListener mDeviceClickListener
= new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3) {
// Cancel discovery because it's costly and we're about to connect
mBtAdapter.cancelDiscovery();
// Get the device MAC address, which is the last 17 chars in the View
String info = ((TextView) v).getText().toString();
String address = info.substring(info.length() - 17);
// Create the result Intent and include the MAC address
Intent intent = new Intent();
intent.putExtra(EXTRA_DEVICE_ADDRESS, address);
// Set result and finish this Activity
setResult(Activity.RESULT_OK, intent);
finish();
}
};
/**
* The BroadcastReceiver that listens for discovered devices and changes the title when
* discovery is finished
*/
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// When discovery finds a device
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// Get the BluetoothDevice object from the Intent
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// If it's already paired, skip it, because it's been listed already
if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
mNewDevicesArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
// When discovery is finished, change the Activity title
} else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
setProgressBarIndeterminateVisibility(false);
setTitle(R.string.select_device);
if (mNewDevicesArrayAdapter.getCount() == 0) {
String noDevices = getResources().getText(R.string.none_found).toString();
mNewDevicesArrayAdapter.add(noDevices);
}
}
}
};
}
| [
"r00631026@ntu.edu.tw"
] | r00631026@ntu.edu.tw |
5683fe91b9477a2501a18655dbf0da94964b8f4e | e22d97af78474f898b900306d9c705b0759b858b | /src/Com/Epicos/Diana/RegPlayer.java | e03eebd40470c67f3f9a1d72454e810013e8a0db | [] | no_license | vpanadero/DianaJava | 33432c5f438e42a6b9637e1c26a0918a4cd4dda0 | e91a3dd98c99e7c63f205f177b78937530b6d360 | refs/heads/master | 2023-02-23T23:41:20.336991 | 2021-01-27T15:44:19 | 2021-01-27T15:44:19 | 333,472,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package Com.Epicos.Diana;
public class RegPlayer {
String Nombres;
int Jugada;
public void RegJugada(String Nombres, int Jugada) {
this.Nombres=Nombres;
this.Jugada=Jugada;
}
public String GetJugada() {
return ("La tirada del Jugador ha sido " + " ");
}
} | [
"vpherrer@gmail.com"
] | vpherrer@gmail.com |
c9d709463a27d9e042dd543e539ad55775551416 | cc927b61575e6fe605f597e15e5dc7e37133fcf8 | /TireMusic/tiremusic/src/main/java/com/chinasofti/blc/tiremusic/user/contorller/UserRegisterContorller.java | 4993c53e26e917b19c925c79499892d902b3cb8a | [] | no_license | GuoWenhao1996/PowerfulJavaProject | 981917a59786d345aa70815ac8f7f586d6d9f486 | 080d0e3b4a79a16df20d9f8afcc98b7832822754 | refs/heads/master | 2021-01-16T18:38:15.472057 | 2017-09-30T07:37:47 | 2017-09-30T07:37:47 | 100,102,910 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,928 | java | package com.chinasofti.blc.tiremusic.user.contorller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import com.chinasofti.blc.tiremusic.common.controller.BaseController;
import com.chinasofti.blc.tiremusic.user.entity.User;
import com.chinasofti.blc.tiremusic.user.service.UserRegistService;
@WebServlet("/userRegister/*")
public class UserRegisterContorller extends BaseController{
private static final long serialVersionUID = 1L;
private UserRegistService userRegistService = new UserRegistService();
private StringBuilder stringBuilder ;
/**
* 用户注册
* @param req
* @param resp
* @throws ServletException
* @throws IOException
* @throws ParseException
*/
public void userRegister(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException, ParseException {
req.getSession().invalidate();
req.setCharacterEncoding("utf-8");
resp.setContentType("text/html;charset=utf-8");
resp.setCharacterEncoding("utf-8");
String reg = "";
String uname = "";
String realname = "";
String upassword = "";
String uaddress = "";
String uemail = "";
String utelephone = "";
String uidnumber = "";
String date = "";
String avatar = "";
int usersex = 0;
Date userbirthday = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date logindate = sdf.parse(sdf.format(new Date())); //将字符串转化成util.date
DiskFileItemFactory factory = new DiskFileItemFactory();//文件上传
ServletFileUpload upload = new ServletFileUpload(factory);//文件上传解析器
upload.setHeaderEncoding("utf-8");//防止文件名中文乱码
OutputStream out = null;
try {
//获得文件名
List<FileItem> fileItems = upload.parseRequest(req);
Iterator iter = fileItems.iterator();
String fileName = "";
InputStream in = null;
while(iter.hasNext()) {
FileItem item = (FileItem)iter.next();
// 判断该属性是否是file类型
if (!item.isFormField()) {
in = item.getInputStream();
fileName = item.getName();
if (fileName.equals("")||fileName==null) {
avatar = "http://localhost:8080/img/1.png";
}else {
String[] strings = fileName.split("\\\\");
File file = new File("E:\\project\\img");
if (!file.exists()) {
file.mkdirs();
}
out = new FileOutputStream(new File("E:\\project\\img"+File.separator+strings[strings.length-1]));
avatar = "http://localhost:8080/img/"+strings[strings.length-1];
byte[] b = new byte[1024*1024];
int count = 0;
while((count=in.read(b))!=-1) {
out.write(b, 0, count);
}
resp.setHeader("content-type", "text/html;charset=utf-8");
}
} else {
// 不是file类型的话,就利用getFieldName判断name属性获取相应的值
if("uname".equals(item.getFieldName())) {
uname = item.getString();
}else if ("realname".equals(item.getFieldName())) {
realname = item.getString("UTF-8");
}else if ("upassword".equals(item.getFieldName())) {
upassword = item.getString();
}else if ("uaddress".equals(item.getFieldName())) {
uaddress = item.getString("UTF-8");
}else if ("uemail".equals(item.getFieldName())) {
uemail = item.getString();
}else if ("utelephone".equals(item.getFieldName())) {
utelephone = item.getString();
}else if ("uidnumber".equals(item.getFieldName())) {
uidnumber = item.getString();
}else if ("userbirthday".equals(item.getFieldName())) {
date = item.getString();
userbirthday = sdf.parse(date);
}else if ("usersex".equals(item.getFieldName())) {
usersex = Integer.parseInt(item.getString());
}else if ("reg".equals(item.getFieldName())) {
reg =item.getString();
}
}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
}
User user = null;
if (req.getSession().getAttribute("user")!=null) {
user = (User)req.getSession().getAttribute("user");
if (!user.getUname().equals(uname)&&!user.getUemail().equals(uemail)&&!user.getUtelephone().equals(utelephone)) {
boolean result = userRegistService.addUserDao(uname, realname, upassword, uaddress, uemail, utelephone, uidnumber, avatar, logindate, usersex, userbirthday);
if (result) {
req.getSession().setAttribute("user", user);
resp.setCharacterEncoding("utf-8");
req.getRequestDispatcher("/chahua/signin.jsp").forward(req, resp);
}else {
req.setAttribute("error", "输入的信息有误,注册失败");
}
}else {
req.setAttribute("warm", "用户名已存在!");
}
}else {
boolean result = userRegistService.addUserDao(uname, realname, upassword, uaddress, uemail, utelephone, uidnumber, avatar, logindate, usersex, userbirthday);
if (result) {
user = new User(uname, upassword, realname, uaddress, uemail, utelephone, uidnumber, avatar, 1, logindate, usersex, userbirthday);
req.getSession().setAttribute("user", user);
resp.setCharacterEncoding("utf-8");
req.getRequestDispatcher("/chahua/signin.jsp").forward(req, resp);
}else {
req.setAttribute("error", "输入的信息有误,注册失败");
}
}
}
/**
* 发送验证码到邮箱
* @param req
* @param resp
* @throws ServletException
* @throws IOException
* @throws ParseException
* @throws MessagingException
*/
public void sendMail(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException, ParseException, MessagingException {
String uemail = req.getParameter("uemail");
Properties props = new Properties();
props.setProperty("mail.host", "smtp.sohu.com");
props.setProperty("mail.user", "zqAnonymous@sohu.com");
props.setProperty("mail.from", "zqAnonymous@sohu.com");
props.setProperty("mail.transport.protocol", "smtp");
//获得一个Session
Session session = Session.getInstance(props);
Transport ts = session.getTransport();
//连接
ts.connect("smtp.sohu.com", "zqAnonymous@sohu.com", "zq7108392");
//对一个邮件的封装
MimeMessage message = new MimeMessage(session);
//带有样式的邮件内容
MimeMultipart multipart = new MimeMultipart();
MimeBodyPart text = new MimeBodyPart();
String[] strings = new String[]{"1","2","3","4","5","6","7","8","9","0"};
stringBuilder = new StringBuilder();
for (int i = 0; i < 4; i++) {
stringBuilder.append(strings[(int)(Math.random()*9)]);
}
text.setContent("<h1>欢迎注册TireMusic在线音乐平台</h1><p style='color:#000'>验证码是:"+stringBuilder.toString()+"<p>", "text/html;charset=utf-8");
multipart.addBodyPart(text);
multipart.setSubType("related");
message.setFrom(new InternetAddress("zqAnonymous@sohu.com"));
message.addRecipient(RecipientType.TO,new InternetAddress(uemail));
message.setSubject("这是邮件的主题");
message.setContent(multipart);
//Get all the recipient addresses for the message.
ts.sendMessage(message,message.getAllRecipients());
ts.close();
resp.getWriter().write("true");
}
/**
* 验证验证码
* @param req
* @param resp
* @throws ServletException
* @throws IOException
*/
public void equalsMail(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String reg = req.getParameter("reg");
if (reg.equals(stringBuilder.toString())) {
resp.getWriter().write("true");
}else {
resp.getWriter().write("false");
}
}
/**
* 验证用户名是否唯一
*/
public void reguname(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String uname = req.getParameter("uname");
boolean result = userRegistService.regname(uname);
resp.getWriter().write(result+"");
}
/**
* 验证手机号码是否唯一
*/
public void regutelephone(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String utelephone = req.getParameter("utelephone");
boolean result = userRegistService.regutelephone(utelephone);
resp.getWriter().write(result+"");
}
/**
* 验证身份证是否唯一
*/
public void reguidnumber(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String uidnumber = req.getParameter("uidnumber");
boolean result = userRegistService.reguidnumber(uidnumber);
resp.getWriter().write(result+"");
}
}
| [
"1842297753@qq.com"
] | 1842297753@qq.com |
1e2fc1ece4c951c4af02ea7e25d23576f568e3d8 | 72fd988111fa80369afe4e12b03c25cafc89c713 | /Practices/EPD88/EJ2/src/ej2/Main.java | 5e71f16ca73d11c585b68c53813b3b44436c5788 | [] | no_license | laudisa93/giisi_algorithmic_2 | c414c8398b573362fd9ef14d10043e829d687452 | c7b387b85df3c90637c8b8e93adae80fe739096d | refs/heads/master | 2021-07-01T14:01:23.672699 | 2017-09-23T15:02:21 | 2017-09-23T15:02:21 | 104,506,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | /*
Desarrolle un programa que simule el sorteo y comprobación de boletos premiados de la Lotería Primitiva.
Inicialmente se procederá a rellenar el bombo del sorteo con las 49 bolas necesarias y se extraerán al azar 6 bolas
diferentes que conformarán la combinación ganadora. A continuación el programa solicitará al usuario los 6 números
marcados en su boleto, comprobará los aciertos obtenidos y mostrará por pantalla un resumen con la combinación ganadora,
el boleto del usuario con los aciertos obtenidos.
*/
package ej2;
import edi.io.IO;
import java.util.Random;
import sets.*;
public class Main {
public static void main(String[] args) {
SetADT premio = new ArraySet();
int num = 0;
Random rand = new Random();
for (int i = 0; i < 6; i++) {
num = rand.nextInt(49);
premio.add(num);
}
System.out.println(premio.toString());
boolean bandera = true;
int i = 1;
while(bandera && i<=6){
System.out.println("Inserte el "+ i +" número.");
num = (int) IO.readNumber();
i++;
if(!premio.contains(num)){
bandera = false;
}
}
if(bandera){
System.out.println("Premio.");
}
else{
System.out.println("Otra vez sera.");
}
}
}
| [
"laudisa93@gmail.com"
] | laudisa93@gmail.com |
964027896b4155a6e6c9bfa93ce9f5f5855e3b84 | c9853a1fa4eceba691766f1310195ec55990b4c3 | /demoPostGres/src/main/java/com/example/demoPostGres/repository/UserScoresRepository.java | e6e8e627f5d066765924a25202c236f003a55829 | [] | no_license | avichaljadeja02/quizbay-final | 7d4f495e3293287a4930012629b32443524c63a1 | 4b73fcd1ab42e1f27fe4256548bbcb15aaf6c8ed | refs/heads/master | 2023-02-21T17:27:46.101851 | 2021-01-26T05:46:52 | 2021-01-26T05:46:52 | 332,449,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.example.demoPostGres.repository;
import com.example.demoPostGres.entity.Question;
import com.example.demoPostGres.entity.UserScores;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface UserScoresRepository extends CrudRepository<UserScores, Integer> {
}
| [
"kannurudinesh@Kannurus-MacBook-Pro.local"
] | kannurudinesh@Kannurus-MacBook-Pro.local |
4ffbd83182459149578e68afb853418f1039fca7 | 230360158a080e882a59d236db507dc26f8b31c4 | /src/main/java/com/app/reddit/spring/repository/SubredditRepository.java | 395e07d0275e8d9cf23139df1e99e71b42b4c9f5 | [] | no_license | Mauu98/Reddit-App | cb5edf4f964813ed5cff6ef5555b9cae87c0a5e6 | c5c943ec0366f63ecd56819c08de2f0aac130b92 | refs/heads/master | 2023-07-30T12:22:44.762515 | 2021-09-08T21:41:59 | 2021-09-08T21:41:59 | 404,477,131 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package com.app.reddit.spring.repository;
import com.app.reddit.spring.model.Subreddit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface SubredditRepository extends JpaRepository<Subreddit, Long> {
Optional<Subreddit> findByName(String subredditName);
}
| [
"mauripino1998cat@gmail.com"
] | mauripino1998cat@gmail.com |
44c4a5fecbf8c115a2a0c28627bea70b86bb1e3f | 4958249793608da4caa878ddfc62cbe0dcaf164a | /russellharveylab04/russellharveylab04_creator/app/src/androidTest/java/com/example/russellharveylab04_creator/ExampleInstrumentedTest.java | 001d9700d58f8013ed262e126221cb3b5788fde6 | [] | no_license | rdh1896/csec467 | 9245ad1db93faa645bd03e957ee07871ab644cfb | 6ee6525b0494ed6ac7b91071b10ce3dd2808ec7c | refs/heads/main | 2023-08-23T08:25:36.692663 | 2021-10-21T18:51:30 | 2021-10-21T18:51:30 | 400,571,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package com.example.russellharveylab04_creator;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.russellharveylab04_creator", appContext.getPackageName());
}
} | [
"rdh1896@rit.edu"
] | rdh1896@rit.edu |
8d9cda6c9fb4f9faebcf692e3eb3c074162068c7 | d076c50ad5a9b060122fe9f0e094b309266997fc | /JavaTest/src/kr/co/job/array/ArrayTest02.java | ba83e84a9988557e1c37f56c72f08e3b56313ecf | [] | no_license | oniyuu/JavaTest | e49626fe62eb8074dbfe2f0c80b5fc561bcf822b | f7001ca7a9231d14194772f470eca7e800b0e58f | refs/heads/master | 2023-07-14T22:14:47.081238 | 2021-08-14T11:42:49 | 2021-08-14T11:42:49 | 383,393,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package kr.co.job.array;
import java.util.Arrays;
import java.util.Scanner;
public class ArrayTest02 {
public static void main(String[] args) {
// 문자열 배열 5개를 선언한 후 5명의 이름을 키보드 입력 받으세요
String[] name = new String[5]; //선언
Scanner scan = new Scanner(System.in);
for (int i=0 ; i < name.length ; i++) {
System.out.print("단어를 입력하세요 : ");
name[i] = scan.next();
}
System.out.println(Arrays.toString(name));
}
}
| [
"YONSAI@402-22"
] | YONSAI@402-22 |
55a0c287a0e983c045b41fd921f372de769fc7a1 | cbc1a85aa864150e20428b99370f8b2f3700976e | /Reporter/html/SAME_POSITION/69_stru_declaration.java | 34722d91c3e85a3778c1ecba1492b66bc2c03da2 | [] | no_license | guilhermejccavalcanti/sourcesvj | 965f4d8e88ba25ff102ef54101e9eb3ca53cc8a0 | 9ca14a022dfe91a4a4307a9fa8196d823356b022 | refs/heads/master | 2020-04-24T11:58:01.645560 | 2019-09-07T00:35:06 | 2019-09-07T00:35:06 | 171,941,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,033 | java | @SuppressWarnings(value = {"static-access", }) public static void main(String[] args) throws Exception {
final OmidDelta registrationService = new OmidDelta("ExampleApp");
CommandLineParser cmdLineParser = new ExtendedPosixParser(true);
Options options = new Options();
options.addOption(OptionBuilder.withLongOpt("txs").withDescription("Number of transactions to execute").withType(Number.class).hasArg().withArgName("argname").create());
options.addOption(OptionBuilder.withLongOpt("rows-per-tx").withDescription("Number of rows that each transaction inserts").withType(Number.class).hasArg().withArgName("argname").create());
int txsToExecute = 1;
int rowsPerTx = 1;
try {
CommandLine cmdLine = cmdLineParser.parse(options, args);
if (cmdLine.hasOption("txs")) {
txsToExecute = ((Number)cmdLine.getParsedOptionValue("txs")).intValue();
}
if (cmdLine.hasOption("rows-per-tx")) {
rowsPerTx = ((Number)cmdLine.getParsedOptionValue("rows-per-tx")).intValue();
}
cdl = new CountDownLatch(txsToExecute * rowsPerTx * 2);
}
catch (ParseException e) {
e.printStackTrace();
System.exit(1);
}
<<<<<<< C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_left_d4aa650\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java
Configuration tsoClientHbaseConf = HBaseConfiguration.create();
=======
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
registrationService.close();
logger.info("ooo Omid ooo - Omid\'s Notification Example App Stopped (CTRL+C) - ooo Omid ooo");
}
catch (IOException e) {
}
}
});
>>>>>>> C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_right_fe8d343\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java
tsoClientHbaseConf.set("tso.host", "localhost");
tsoClientHbaseConf.setInt("tso.port", 1234);
logger.info("ooo Omid ooo - STARTING OMID\'S EXAMPLE NOTIFICATION APP. - ooo Omid ooo");
logger.info("ooo Omid ooo -" + " A table called " + Constants.TABLE_1 + " with a column Family " + Constants.COLUMN_FAMILY_1 + " has been already created by the Omid Infrastructure " + "- ooo Omid ooo");
Observer obs1 = new Observer() {
Interest interestObs1 = new Interest(Constants.TABLE_1, Constants.COLUMN_FAMILY_1, Constants.COLUMN_1);
public void onColumnChanged(byte[] column, byte[] columnFamily, byte[] table, byte[] rowKey, TransactionState tx) {
logger.info("ooo Omid ooo -" + "I\'M OBSERVER o1." + " An update has occurred on Table: " + Bytes.toString(table) + " RowKey: " + Bytes.toString(rowKey) + " ColumnFamily: " + Bytes.toString(columnFamily) + " Column: " + Bytes.toString(column) + " !!! - ooo Omid ooo");
logger.info("ooo Omid ooo - OBSERVER o1 INSERTING A NEW ROW ON COLUMN " + Constants.COLUMN_2 + " UNDER TRANSACTIONAL CONTEXT " + tx + " - ooo Omid ooo");
Configuration tsoClientConf = HBaseConfiguration.create();
tsoClientConf.set("tso.host", "localhost");
tsoClientConf.setInt("tso.port", 1234);
try {
TransactionalTable tt = new TransactionalTable(tsoClientConf, Constants.TABLE_1);
doTransactionalPut(tx, tt, rowKey, Bytes.toBytes(Constants.COLUMN_FAMILY_1), Bytes.toBytes(Constants.COLUMN_2), Bytes.toBytes("Data written by OBSERVER o1"));
}
catch (IOException e) {
e.printStackTrace();
}
cdl.countDown();
}
@Override public String getName() {
return "o1";
}
@Override public List<Interest> getInterests() {
return Collections.singletonList(interestObs1);
}
};
Observer obs2 = new Observer() {
Interest interestObs2 = new Interest(Constants.TABLE_1, Constants.COLUMN_FAMILY_1, Constants.COLUMN_2);
public void onColumnChanged(byte[] column, byte[] columnFamily, byte[] table, byte[] rowKey, TransactionState tx) {
logger.info("ooo Omid ooo - " + "I\'M OBSERVER o2." + " An update has occurred on Table: " + Bytes.toString(table) + " RowKey: " + Bytes.toString(rowKey) + " ColumnFamily: " + Bytes.toString(columnFamily) + " Column: " + Bytes.toString(column) + " !!! I\'M NOT GONNA DO ANYTHING ELSE - ooo Omid ooo");
cdl.countDown();
}
@Override public String getName() {
return "o2";
}
@Override public List<Interest> getInterests() {
return Collections.singletonList(interestObs2);
}
};
final IncrementalApplication app = new DeltaOmid.AppBuilder("ExampleApp").addObserver(obs1).addObserver(obs2).build();
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
app.close();
logger.info("ooo Omid ooo - Omid\'s Notification Example App Stopped (CTRL+C) - ooo Omid ooo");
}
catch (IOException e) {
}
}
});
logger.info("ooo Omid ooo - WAITING 5 SECONDS TO ALLOW OBSERVER REGISTRATION - ooo Omid ooo");
Thread.currentThread().sleep(5000);
TransactionManager tm = new TransactionManager(tsoClientHbaseConf);
TransactionalTable tt = new TransactionalTable(tsoClientHbaseConf, Constants.TABLE_1);
logger.info("ooo Omid ooo - STARTING " + txsToExecute + " TRIGGER TXS INSERTING " + rowsPerTx + " ROWS EACH IN COLUMN " + Constants.COLUMN_1 + " - ooo Omid ooo");
for (int i = 0; i < txsToExecute; i++) {
TransactionState tx = tm.beginTransaction();
for (int j = 0; j < rowsPerTx; j++) {
Put row = new Put(Bytes.toBytes("row-" + Integer.toString(i + (j * 10000))));
row.add(Bytes.toBytes(Constants.COLUMN_FAMILY_1), Bytes.toBytes(Constants.COLUMN_1), Bytes.toBytes("testWrite-" + Integer.toString(i + (j * 10000))));
tt.put(tx, row);
}
tm.tryCommit(tx);
}
logger.info("ooo Omid ooo - TRIGGER TXS COMMITTED - ooo Omid ooo");
tt.close();
logger.info("ooo Omid ooo - WAITING TO ALLOW THE 2 OBSERVERS RECEIVING ALL THE NOTIFICATIONS - ooo Omid ooo");
cdl.await();
logger.info("ooo Omid ooo - OBSERVERS HAVE RECEIVED ALL THE NOTIFICATIONS WAITING 30 SECONDS TO ALLOW FINISHING CLEARING STUFF - ooo Omid ooo");
Thread.currentThread().sleep(30000);
app.close();
Thread.currentThread().sleep(10000);
<<<<<<< C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_left_d4aa650\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java
logger.info("ooo Omid ooo - OMID\'S NOTIFICATION APP FINISHED - ooo Omid ooo");
=======
registrationService.close();
>>>>>>> C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_right_fe8d343\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java
}
| [
"gjcc@cin.ufpe.br"
] | gjcc@cin.ufpe.br |
38cc8f4178c736c105e7b696c8a3ab93402d06e5 | 78bd1a510e133ace8dac58bed5891c4c433a0cde | /src/main/java/publicaciones/adopcion/PublicacionParaAdoptar.java | 17a19905ab00031ee7399bad368f8d45320810db | [] | no_license | rociorubio/rescate-patitas | 9ad0947f3c258c159d36cb72d12328f246ed8a79 | 28d5ecf36d7317871c1f91a1f1b0f2853f552b14 | refs/heads/main | 2023-09-02T12:18:18.573340 | 2021-11-23T15:00:00 | 2021-11-23T15:00:00 | 431,142,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | java | package publicaciones.adopcion;
import persona.Persona;
import javax.persistence.*;
import java.util.List;
@Entity
public class PublicacionParaAdoptar {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idPublicacionParaAdoptar;
@OneToOne(cascade = CascadeType.PERSIST)
private Persona persona;
@ManyToMany(cascade = CascadeType.ALL)
private List<Respuesta> respuestas; //No sabemos como se completan, pero se completan
public PublicacionParaAdoptar(List<Respuesta> respuestas, Persona persona) {
this.persona = persona;
this.respuestas = respuestas;
}
public PublicacionParaAdoptar() {
}
public boolean tieneMismaRespuestas(List<Respuesta> otrasRespuestas){ //Las respuestas son las de la publicacion para dar en adopcion, en principio
respuestas.stream().allMatch(respuesta -> {
return respuesta.tieneMismoValor(otrasRespuestas);
});
return true;
}
public Persona getPersona() {
return persona;
}
public List<Respuesta> getRespuestas() {
return respuestas;
}
public void agregarRespuesta(Respuesta respuesta){
respuestas.add(respuesta);
}
}
| [
"ro.rubio95@gmail.com"
] | ro.rubio95@gmail.com |
3efa5de8843a59361ca6ffdaacb3731b048e50f6 | 3597ba12594093aefc8ad50e6e53493b290b5993 | /src/main/java/java8inaction/chap14/Combinators.java | 1667247a8de94926868ef7789433cd79bce18962 | [] | no_license | alininfoiasi/java8 | c8b3b8d4addf3a0cb235903f1251713a0a56a18e | be2b277fc18c2f122d906089e75e2247b26cba05 | refs/heads/master | 2021-09-15T21:05:54.957534 | 2018-06-10T18:14:04 | 2018-06-10T18:14:04 | 100,263,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | package java8inaction.chap14;
import java.util.function.Function;
public class Combinators {
public static void main(String[] args) {
System.out.println(repeat(3, (Integer x) -> 2 * x).apply(10));
}
static <A, B, C> Function<A, C> compose(Function<B, C> g, Function<A, B> f) {
return x -> g.apply(f.apply(x));
}
static <A> Function<A, A> repeat(int n, Function<A, A> f) {
return n == 0 ? x -> x : compose(f, repeat(n - 1, f));
}
}
| [
"alininfoiasi@gmail.com"
] | alininfoiasi@gmail.com |
98a5d915f789e3580853eb54a29c2a7b65c77cb4 | 51a2eeef60ab5d109d512f816e18e61221490e49 | /src/br/com/java/controller/ProdutoControle.java | 6a6b48069ce1d30759f9538d0073e52655f3594a | [] | no_license | diegotpereira/SistemaDeVendasJavaConsole | 1c271ace3e4410818a5b23ad150719ff4dc5be28 | 8d31eab8bd7044e55590b83d7067e613b6bb404a | refs/heads/master | 2023-09-02T21:57:58.418209 | 2021-11-23T13:50:38 | 2021-11-23T13:50:38 | 430,849,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,478 | java | package br.com.java.controller;
import java.util.ArrayList;
import br.com.java.interfaces.IController;
import br.com.java.modelo.Produto;
import br.com.java.utils.Console;
public class ProdutoControle implements IController<Produto> {
static ArrayList<Produto> produtos = new ArrayList<Produto>();
@Override
public void cadastrar(Produto produto) {
// TODO Auto-generated method stub
int i = encontrarProduto(produto);
if (i == -1) {
produtos.add(produto);
Console.MensagemGenericaSucesso();
} else {
Console.MensagemGenericaErro();
}
}
private static int encontrarProduto(Produto produto) {
int i = -1;
for(Produto cadastrado : produtos) {
i++;
if (cadastrado.getNomeProduto().equalsIgnoreCase(produto.getNomeProduto())) {
return i;
}
}
return -1;
}
@Override
public ArrayList<Produto> listar() {
// TODO Auto-generated method stub
return produtos;
}
public boolean validaProduto(String item, int quantidade) {
ArrayList<Produto> produtos = new ArrayList<>();
for(Produto produto : produtos) {
if (item.equalsIgnoreCase(produto.getNomeProduto())) {
if (quantidade <= produto.getQuantidade()) {
return true;
}
}
}
return false;
}
}
| [
"diegoteixeirapereira@hotmail.com"
] | diegoteixeirapereira@hotmail.com |
09bb8741a6604606cc6736714a0ab15c2100f4f4 | 5be236f6e4dc7bf810b2d469b4e0155e02081491 | /labs/Practice-PluralsightFundamentals/src/main/java/com/practice/repository/impl/HibernateSpeakerRepositoryImpl.java | 0b04e3ff5d9cac0e219cfad29e2cdf5d5d4f86f9 | [] | no_license | ahmedasemsery/springCoreLabs | 85d6ef7613ca4dba3d77a2d428ad82b26073dad7 | 2ace50211a59cca8bf84ece271d78c316ae60a4a | refs/heads/main | 2023-04-20T19:19:36.993178 | 2021-05-05T12:43:34 | 2021-05-05T12:43:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | package com.practice.repository.impl;
import com.practice.model.Speaker;
import com.practice.repository.SpeakerRepository;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
@Repository("speakerRepository")
public class HibernateSpeakerRepositoryImpl implements SpeakerRepository {
@Override
public List<Speaker> findAll() {
List<Speaker> speakers = new ArrayList<>();
Speaker speaker = new Speaker();
speaker.setFirstName("Ahmed");
speaker.setLastName("Asim");
speakers.add(speaker);
return speakers;
}
}
| [
"ahmedasemsery@gmail.com"
] | ahmedasemsery@gmail.com |
402107e6b7f8a39886a7b8034ce127fe5d4d8a1b | fae1113575e1dd84738e0e50f019ec823a6f2442 | /account-service/src/main/java/org/trident/account/entity/Role.java | 21ec8105bf8f44cf05867bfa3742cdaa929e3018 | [] | no_license | rishisc/microservices | 9cfb21d211803296701cb03fe53ec3c80a1b9e0e | 57dba72bf4aaaec6868f3ac19aa32f92628f20c7 | refs/heads/master | 2022-04-05T05:44:13.952315 | 2020-02-23T15:12:48 | 2020-02-23T15:12:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,549 | java | package org.trident.account.entity;
import org.trident.account.dto.RoleDTO;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Column;
import javax.persistence.OneToMany;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "wf_role")
public class Role implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "role_id")
private Long roleId;
@Column(name = "role_name")
private String roleName;
@Column(name = "enabled")
private Boolean enabled;
@Column(name = "created_by")
private Long createdBy;
@Column(name = "created_on")
private Date createdOn;
@OneToMany(fetch = FetchType.LAZY)
@JoinTable(name = "wf_role_policy",
joinColumns = @JoinColumn(name = "role_id", referencedColumnName = "role_id"),
inverseJoinColumns = @JoinColumn(name = "policy_id", referencedColumnName = "policy_id")
)
private Set<Policy> policies = new HashSet<>();
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public Set<Policy> getPolicies() {
return policies;
}
public void setPolicies(Set<Policy> policies) {
this.policies = policies;
}
public RoleDTO toDto() {
RoleDTO roleDTO = new RoleDTO();
roleDTO.setRoleId(this.getRoleId());
roleDTO.setRoleName(this.getRoleName());
roleDTO.setCreatedBy(this.getCreatedBy());
roleDTO.setCreatedOn(this.getCreatedOn());
roleDTO.setEnabled(this.getEnabled());
return roleDTO;
}
}
| [
"manishsalian09@gmail.com"
] | manishsalian09@gmail.com |
2e196acaa12d7d01cadd8015c9f3d00df255fe16 | c58014fc08ffdfef6671ec1729f29913e5fe9b79 | /android/app/src/main/gen/com/semillasreactnative/BuildConfig.java | 2e3177eb7eb08cd7d0150a8bc26876497f8d077c | [] | no_license | Semillas/SemillasReactNative | 89ee86400af16190d14aa9e1491662aa22960352 | eaed570f2c8767688ae15ab3bd385e55da3430e7 | refs/heads/master | 2021-01-20T15:23:06.044397 | 2017-11-16T16:16:39 | 2017-11-16T16:16:39 | 82,811,612 | 5 | 4 | null | 2017-11-16T16:17:15 | 2017-02-22T14:08:46 | JavaScript | UTF-8 | Java | false | false | 265 | java | /*___Generated_by_IDEA___*/
package com.semillasreactnative;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
} | [
"ismael@feverup.com"
] | ismael@feverup.com |
3994f5bad073ce9f7722c86846e351ec06bdb7d6 | 8752e984c0871f515ac2ef0a6d53b14176470f38 | /viikko4/MaksukorttiMockito/src/main/java/ohtu/matkakortti/Kassapaate.java | a61696d4e8f42c8dbfeff27bcf82be643ac61425 | [] | no_license | lossitomatossi/ohtu-tehtavat2020 | e4de865dbb0ecdce6343e764e268b55f514aeb59 | 30abd4067adf958dcfbf8d1a3f52b6678d839512 | refs/heads/main | 2023-01-29T00:04:11.679311 | 2020-12-14T21:10:09 | 2020-12-14T21:10:09 | 309,113,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package ohtu.matkakortti;
public class Kassapaate {
private int myytyjaLounaita;
public static final int HINTA = 5;
public Kassapaate() {
this.myytyjaLounaita = 0;
}
public void lataa(Maksukortti kortti, int summa) {
if (summa > 0) {
kortti.lataa(summa);
}
}
public void ostaLounas(Maksukortti kortti) {
if (kortti.getSaldo() > HINTA) {
kortti.osta(HINTA);
myytyjaLounaita++;
}
}
public int getMyytyjaLounaita() {
return myytyjaLounaita;
}
}
| [
"tomas.terala@gmail.com"
] | tomas.terala@gmail.com |
30a13b83c1ae8709310a331bdf6ba814a85d7d6e | 1c99bd0aa7292336c9c3308a269373c13604d050 | /src/main/java/com/imooc/utils/KeyUtil.java | a2d5b218ebfd53c88d8d472a7620d4d3ce000cdc | [] | no_license | wangchao0312/sell | 274ea688afcacdf9469e5b381ce085d97a7ea624 | 9f7832501ac08036b7e32c5107823fe875bb623a | refs/heads/master | 2020-05-24T18:49:13.039343 | 2019-05-19T16:15:56 | 2019-05-19T16:15:56 | 187,417,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | package com.imooc.utils;
import java.util.Random;
/**
* Created by 廖师兄
* 2017-06-11 19:12
*/
public class KeyUtil {
/**
* 生成唯一的主键
* 格式: 时间+随机数
* 多线程条件下 加上关键字保证
* @return
*/
public static synchronized String genUniqueKey() {
Random random = new Random();
Integer number = random.nextInt(900000) + 100000;
return System.currentTimeMillis() + String.valueOf(number);
}
}
| [
"wangchao0312@outlook.com"
] | wangchao0312@outlook.com |
9e3f763b9d3b4c8cb80bf6ce2fed74b3f6f05cf7 | d751dcada479d93dafc28659460eb2beb0f4ed93 | /ForLoops/src/Oef1.java | 3182d71a24bf83fe9fd3f2eeddfbf3738e5be9dc | [] | no_license | DriesDelanghe/JavaPracticeCode | 5d7ba05ba3d2dba1ea09e733127e082d333e4ec0 | 25ef5f4cfdc93cb1702fb02b37cf240c6799d623 | refs/heads/main | 2023-01-30T14:38:16.933414 | 2020-12-17T17:17:03 | 2020-12-17T17:17:03 | 321,605,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | import javax.swing.*;
public class Oef1 {
public static void main(String[] args) {
int getal;
int som = 0;
for(int i = 1; i <= 5; i++){
getal = Integer.parseInt(JOptionPane.showInputDialog("Geef een getal"));
som += getal;
}
System.out.println("De som is " + som);
}
}
| [
"delanghe.dries.1998@gmail.com"
] | delanghe.dries.1998@gmail.com |
0aeec5f386547b2e2563320c8dbd8d4eb7c30379 | 3668a4de48e8576c04306c230fb5d2061c0b802c | /personapi/src/test/java/one/digitalinnovation/personapi/utils/PhoneUtils.java | 976c0b637d3ff10301a20d7b0cdc461da86bcd64 | [] | no_license | fernandOlle/person_api_dio_live_coding | aa0f7e08a8fbfaa7ff137a15d1c2f940dfa03e44 | 6959ea2bd8dddf255b50927f82359933c6ecd2ef | refs/heads/master | 2023-06-17T07:15:51.244253 | 2021-07-18T23:05:15 | 2021-07-18T23:05:15 | 386,996,145 | 0 | 0 | null | 2021-07-18T20:35:43 | 2021-07-17T17:09:02 | Java | UTF-8 | Java | false | false | 819 | java | package one.digitalinnovation.personapi.utils;
import one.digitalinnovation.personapi.dto.request.PhoneDTO;
import one.digitalinnovation.personapi.entities.Phone;
import one.digitalinnovation.personapi.enums.PhoneType;
public class PhoneUtils {
private static final String PHONE_NUMBER = "5399999-9999";
private static final PhoneType PHONE_TYPE = PhoneType.MOBILE;
private static final long PHONE_ID = 1L;
public static PhoneDTO createFakeDTO() {
return PhoneDTO.builder()
.number(PHONE_NUMBER)
.type(PHONE_TYPE)
.build();
}
public static Phone createFakeEntity() {
return Phone.builder()
.id(PHONE_ID)
.number(PHONE_NUMBER)
.type(PHONE_TYPE)
.build();
}
}
| [
"frolle@inf.ufpel.edu.br"
] | frolle@inf.ufpel.edu.br |
ef1eaafa5c4d9fb355e0b80796b9b54fa6fdbe55 | ded2330f5d1589d50fb531a3466a277163a9c5f2 | /meal/jxd-whotel/src/main/java/com/whotel/thirdparty/jxd/mode/MbrCardUpgradeQuery.java | cf3d8b582cc8262bf735c8cdc19d4f7b099b0456 | [] | no_license | hasone/whotel | d106cb85ca0fecfa7a0f631b096c8c396e806b76 | 92ab351d056021f02539262e74c019a6363e9be7 | refs/heads/master | 2021-06-18T01:22:50.462881 | 2017-06-14T12:10:47 | 2017-06-14T12:10:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.whotel.thirdparty.jxd.mode;
import com.whotel.thirdparty.jxd.util.AbstractInputParam;
public class MbrCardUpgradeQuery extends AbstractInputParam {
private String opType = "会员卡升级列表";
private String mbrCardType;
public String getOpType() {
return opType;
}
public void setOpType(String opType) {
this.opType = opType;
}
public String getMbrCardType() {
return mbrCardType;
}
public void setMbrCardType(String mbrCardType) {
this.mbrCardType = mbrCardType;
}
@Override
public String getRoot() {
// TODO Auto-generated method stub
return null;
}
}
| [
"374255041@qq.com"
] | 374255041@qq.com |
bf8c329568ec8c16fb14ecbca7712bb8ce106175 | 2eb5604c0ba311a9a6910576474c747e9ad86313 | /chado-pg-orm/src/org/irri/iric/chado/so/RnapolIiPromoterId.java | 3d1adc4c232ab85b3fa20b1cec4a7e0287502f76 | [] | no_license | iric-irri/portal | 5385c6a4e4fd3e569f5334e541d4b852edc46bc1 | b2d3cd64be8d9d80b52d21566f329eeae46d9749 | refs/heads/master | 2021-01-16T00:28:30.272064 | 2014-05-26T05:46:30 | 2014-05-26T05:46:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,181 | java | package org.irri.iric.chado.so;
// Generated 05 26, 14 1:32:25 PM by Hibernate Tools 3.4.0.CR1
import java.util.Date;
/**
* RnapolIiPromoterId generated by hbm2java
*/
public class RnapolIiPromoterId implements java.io.Serializable {
private Integer rnapolIiPromoterId;
private Integer featureId;
private Integer dbxrefId;
private Integer organismId;
private String name;
private String uniquename;
private String residues;
private Integer seqlen;
private String md5checksum;
private Integer typeId;
private Boolean isAnalysis;
private Boolean isObsolete;
private Date timeaccessioned;
private Date timelastmodified;
public RnapolIiPromoterId() {
}
public RnapolIiPromoterId(Integer rnapolIiPromoterId, Integer featureId,
Integer dbxrefId, Integer organismId, String name,
String uniquename, String residues, Integer seqlen,
String md5checksum, Integer typeId, Boolean isAnalysis,
Boolean isObsolete, Date timeaccessioned, Date timelastmodified) {
this.rnapolIiPromoterId = rnapolIiPromoterId;
this.featureId = featureId;
this.dbxrefId = dbxrefId;
this.organismId = organismId;
this.name = name;
this.uniquename = uniquename;
this.residues = residues;
this.seqlen = seqlen;
this.md5checksum = md5checksum;
this.typeId = typeId;
this.isAnalysis = isAnalysis;
this.isObsolete = isObsolete;
this.timeaccessioned = timeaccessioned;
this.timelastmodified = timelastmodified;
}
public Integer getRnapolIiPromoterId() {
return this.rnapolIiPromoterId;
}
public void setRnapolIiPromoterId(Integer rnapolIiPromoterId) {
this.rnapolIiPromoterId = rnapolIiPromoterId;
}
public Integer getFeatureId() {
return this.featureId;
}
public void setFeatureId(Integer featureId) {
this.featureId = featureId;
}
public Integer getDbxrefId() {
return this.dbxrefId;
}
public void setDbxrefId(Integer dbxrefId) {
this.dbxrefId = dbxrefId;
}
public Integer getOrganismId() {
return this.organismId;
}
public void setOrganismId(Integer organismId) {
this.organismId = organismId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getUniquename() {
return this.uniquename;
}
public void setUniquename(String uniquename) {
this.uniquename = uniquename;
}
public String getResidues() {
return this.residues;
}
public void setResidues(String residues) {
this.residues = residues;
}
public Integer getSeqlen() {
return this.seqlen;
}
public void setSeqlen(Integer seqlen) {
this.seqlen = seqlen;
}
public String getMd5checksum() {
return this.md5checksum;
}
public void setMd5checksum(String md5checksum) {
this.md5checksum = md5checksum;
}
public Integer getTypeId() {
return this.typeId;
}
public void setTypeId(Integer typeId) {
this.typeId = typeId;
}
public Boolean getIsAnalysis() {
return this.isAnalysis;
}
public void setIsAnalysis(Boolean isAnalysis) {
this.isAnalysis = isAnalysis;
}
public Boolean getIsObsolete() {
return this.isObsolete;
}
public void setIsObsolete(Boolean isObsolete) {
this.isObsolete = isObsolete;
}
public Date getTimeaccessioned() {
return this.timeaccessioned;
}
public void setTimeaccessioned(Date timeaccessioned) {
this.timeaccessioned = timeaccessioned;
}
public Date getTimelastmodified() {
return this.timelastmodified;
}
public void setTimelastmodified(Date timelastmodified) {
this.timelastmodified = timelastmodified;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof RnapolIiPromoterId))
return false;
RnapolIiPromoterId castOther = (RnapolIiPromoterId) other;
return ((this.getRnapolIiPromoterId() == castOther
.getRnapolIiPromoterId()) || (this.getRnapolIiPromoterId() != null
&& castOther.getRnapolIiPromoterId() != null && this
.getRnapolIiPromoterId().equals(
castOther.getRnapolIiPromoterId())))
&& ((this.getFeatureId() == castOther.getFeatureId()) || (this
.getFeatureId() != null
&& castOther.getFeatureId() != null && this
.getFeatureId().equals(castOther.getFeatureId())))
&& ((this.getDbxrefId() == castOther.getDbxrefId()) || (this
.getDbxrefId() != null
&& castOther.getDbxrefId() != null && this
.getDbxrefId().equals(castOther.getDbxrefId())))
&& ((this.getOrganismId() == castOther.getOrganismId()) || (this
.getOrganismId() != null
&& castOther.getOrganismId() != null && this
.getOrganismId().equals(castOther.getOrganismId())))
&& ((this.getName() == castOther.getName()) || (this.getName() != null
&& castOther.getName() != null && this.getName()
.equals(castOther.getName())))
&& ((this.getUniquename() == castOther.getUniquename()) || (this
.getUniquename() != null
&& castOther.getUniquename() != null && this
.getUniquename().equals(castOther.getUniquename())))
&& ((this.getResidues() == castOther.getResidues()) || (this
.getResidues() != null
&& castOther.getResidues() != null && this
.getResidues().equals(castOther.getResidues())))
&& ((this.getSeqlen() == castOther.getSeqlen()) || (this
.getSeqlen() != null && castOther.getSeqlen() != null && this
.getSeqlen().equals(castOther.getSeqlen())))
&& ((this.getMd5checksum() == castOther.getMd5checksum()) || (this
.getMd5checksum() != null
&& castOther.getMd5checksum() != null && this
.getMd5checksum().equals(castOther.getMd5checksum())))
&& ((this.getTypeId() == castOther.getTypeId()) || (this
.getTypeId() != null && castOther.getTypeId() != null && this
.getTypeId().equals(castOther.getTypeId())))
&& ((this.getIsAnalysis() == castOther.getIsAnalysis()) || (this
.getIsAnalysis() != null
&& castOther.getIsAnalysis() != null && this
.getIsAnalysis().equals(castOther.getIsAnalysis())))
&& ((this.getIsObsolete() == castOther.getIsObsolete()) || (this
.getIsObsolete() != null
&& castOther.getIsObsolete() != null && this
.getIsObsolete().equals(castOther.getIsObsolete())))
&& ((this.getTimeaccessioned() == castOther
.getTimeaccessioned()) || (this.getTimeaccessioned() != null
&& castOther.getTimeaccessioned() != null && this
.getTimeaccessioned().equals(
castOther.getTimeaccessioned())))
&& ((this.getTimelastmodified() == castOther
.getTimelastmodified()) || (this.getTimelastmodified() != null
&& castOther.getTimelastmodified() != null && this
.getTimelastmodified().equals(
castOther.getTimelastmodified())));
}
public int hashCode() {
int result = 17;
result = 37
* result
+ (getRnapolIiPromoterId() == null ? 0 : this
.getRnapolIiPromoterId().hashCode());
result = 37 * result
+ (getFeatureId() == null ? 0 : this.getFeatureId().hashCode());
result = 37 * result
+ (getDbxrefId() == null ? 0 : this.getDbxrefId().hashCode());
result = 37
* result
+ (getOrganismId() == null ? 0 : this.getOrganismId()
.hashCode());
result = 37 * result
+ (getName() == null ? 0 : this.getName().hashCode());
result = 37
* result
+ (getUniquename() == null ? 0 : this.getUniquename()
.hashCode());
result = 37 * result
+ (getResidues() == null ? 0 : this.getResidues().hashCode());
result = 37 * result
+ (getSeqlen() == null ? 0 : this.getSeqlen().hashCode());
result = 37
* result
+ (getMd5checksum() == null ? 0 : this.getMd5checksum()
.hashCode());
result = 37 * result
+ (getTypeId() == null ? 0 : this.getTypeId().hashCode());
result = 37
* result
+ (getIsAnalysis() == null ? 0 : this.getIsAnalysis()
.hashCode());
result = 37
* result
+ (getIsObsolete() == null ? 0 : this.getIsObsolete()
.hashCode());
result = 37
* result
+ (getTimeaccessioned() == null ? 0 : this.getTimeaccessioned()
.hashCode());
result = 37
* result
+ (getTimelastmodified() == null ? 0 : this
.getTimelastmodified().hashCode());
return result;
}
}
| [
"locem@berting-debian.ourwebserver.no-ip.biz"
] | locem@berting-debian.ourwebserver.no-ip.biz |
16db644738e03f70c92276a91844526e4b581974 | 1f1f5f989063a1a074654a4a1aba9f4cee8386d2 | /ExamEmployeeClient/src/main/java/com/mycompany/examemployee/servlets/TestServlet.java | 16393a73cd650ded3e1feb43737f6380ceb7bdcf | [] | no_license | moheetjari/MicroProfileProject | 5dbe4df3ef0b10ad6f279b59e69f443f610b7feb | 56be9bbe12d27c0624eed0e60e8f0ca315e9f1f6 | refs/heads/main | 2023-02-25T11:32:44.981928 | 2021-01-22T19:06:34 | 2021-01-22T19:06:34 | 320,552,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,670 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.examemployee.servlets;
import com.mycompany.examemployee.entity.EmployeeTB;
import com.mycompany.examemployeeclient.service.EmployeeClient;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.microprofile.rest.client.inject.RestClient;
/**
*
* @author mohit
*/
public class TestServlet extends HttpServlet {
@Inject
@RestClient
EmployeeClient employeeClient;
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet TestServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet TestServlet at " + request.getContextPath() + "</h1>");
out.println("<form method='post'>");
out.println("<label>Department Name</label>");
out.println("<select name='drpdeptid'>");
out.println("<option value='Select Department'>Select Department</option>");
out.println("<option value='IT'>IT</option>");
out.println("<option value='Sales'>Sales</option>");
out.println("</select>");
out.println("<input type='submit' name='btnsubmit' value='Submit' />");
out.println("</form>");
if (!request.getParameter("drpdeptid").equals("Select Department")) {
String deptName = request.getParameter("drpdeptid");
out.println("<table border='1'>");
out.println("<tr><td>Id</td>");
out.println("<td>Name</td>");
out.println("<td>Department Name</td>");
out.println("<td>Salary</td></tr>");
Collection<EmployeeTB> emps = employeeClient.GetEmployees(deptName);
for (EmployeeTB emp : emps) {
out.println("<tr><td>" + emp.getId() + "</td>");
out.println("<td>" + emp.getName() + "</td>");
out.println("<td>" + emp.getDepartmentName() + "</td>");
out.println("<td>" + emp.getSalary() + "</td></tr>");
}
out.println("</table>");
} else {
}
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"moheetjari@gmail.com"
] | moheetjari@gmail.com |
718276ea910fdd3986ea426b7d69aa1bd24b4d04 | eadee5bf1e61b47a6a524bc4f44edc6227727981 | /app/src/main/java/com/example/minim2/UserView.java | 2d2be669117cde2edcbfb9ab77c55cd08f6a0535 | [] | no_license | Jamke-tech/Minim2_Jaume_Tabernero | b03fcfd6a0a2e285d078ea5a1b3667579e238fd3 | dd44a16a8c17eab81d3899119f2e778bf9194721 | refs/heads/master | 2023-02-17T10:01:04.488216 | 2021-01-11T12:43:06 | 2021-01-11T12:43:06 | 328,455,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,522 | java | package com.example.minim2;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.minim2.models.MyAdapter;
import com.example.minim2.models.Repo;
import com.example.minim2.models.User;
import com.example.minim2.service.gitHubService;
import com.squareup.picasso.Picasso;
import java.util.List;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class UserView extends AppCompatActivity {
User infoUser;
private TextView textName;
private TextView textFollowers;
private TextView textFollowing;
private ImageView imagenUser;
private RecyclerView myRecycler;
private MyAdapter myAdapter;
private gitHubService gitHubAPI;
private List<Repo> reposList;
private Loading loadingScreen;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_view);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
textName=findViewById(R.id.textUserName);
textFollowers=findViewById(R.id.textFollowers);
textFollowing=findViewById(R.id.textFollowing);
myRecycler=findViewById(R.id.myRecycler);
imagenUser=(ImageView)findViewById(R.id.imageUser);
infoUser=(User)getIntent().getExtras().getSerializable("User");
loadingScreen = new Loading(UserView.this);
loadingScreen.startLoadingDialog();
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient().newBuilder().addInterceptor(interceptor).build();
Retrofit retrofitinstance = new Retrofit.Builder()
.baseUrl("https://api.github.com/")
.addConverterFactory(GsonConverterFactory.create())
.client(client)
.build();
gitHubAPI = retrofitinstance.create(gitHubService.class);
searchRepos(infoUser.getLogin());
//Ponemos cosas en text i image
textName.setText(infoUser.getLogin());
String followersTextDisplay = textFollowers.getText ().toString() + infoUser.getFollowers();
String followingTextDisplay = textFollowing.getText ().toString() + infoUser.getFollowing();
textFollowing.setText(followingTextDisplay);
textFollowers.setText(followersTextDisplay);
//Ponemos imagen con el Picaso
Picasso.get().load(infoUser.getAvatar_url()).into(imagenUser);//para conseguir la imagen
}
private void searchRepos(String login) {
Call<List<Repo>> call = gitHubAPI.getReposUser(login);
call.enqueue(new Callback<List<Repo>>() {
@Override
public void onResponse(Call<List<Repo>> call, Response<List<Repo>> response) {
if(response.code()==200) {
reposList=response.body();
//Mostramos recycler view
myRecycler.setHasFixedSize(true);
myRecycler.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
myAdapter = new MyAdapter(getApplicationContext(),reposList);
myRecycler.setAdapter(myAdapter);
loadingScreen.dismissDialog();
}
else{
//Mostramos pantalla d'error
loadingScreen.dismissDialog();
Intent intent = new Intent(getApplicationContext(),ErrorView.class);
intent.putExtra("Error",String.valueOf(response.code()));
startActivity(intent);
}
}
@Override
public void onFailure(Call<List<Repo>> call, Throwable t) {
loadingScreen.dismissDialog();
Intent intent = new Intent(getApplicationContext(),ErrorView.class);
intent.putExtra("Error",t.getMessage());
startActivity(intent);
}
});
}
} | [
"jaume_taber10@hotmail.com"
] | jaume_taber10@hotmail.com |
f9dfbdc16d918c8f87b5b7dd2fbb75c4973cbc98 | 399340b8d9b83b4f15c34478b24c62850561971a | /Placement_Admin/src/com/dao/languagesdao.java | e902c4891cd34aae31b9282a4ad1e4cabea95741 | [] | no_license | neel-prajapati/placement-corner | ae5ed81d5260652f5dff72bcd0cd00d2e54a5800 | 5e03e877ac0e19e6a8a973377bae6bbebbb1ac01 | refs/heads/master | 2022-11-28T09:52:26.102428 | 2020-07-30T09:40:45 | 2020-07-30T09:40:45 | 283,730,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,357 | java | package com.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import com.bean.Languagesbean;
import com.util.Projectutil;
public class languagesdao {
public void insertlanguages(Languagesbean b)
{
try
{
Connection conn=Projectutil.createConnection();
String sql="insert into languages(lid,name) values(?,?)";
PreparedStatement pst=conn.prepareStatement(sql);
pst.setInt(1, b.getLid());
pst.setString(2, b.getName());
pst.executeUpdate();
}
catch (Exception e) {
e.printStackTrace();
}
}
public void updatelanguages(Languagesbean b)
{
try
{
Connection conn=Projectutil.createConnection();
String sql="update languages set name=? where lid=? ";
PreparedStatement pst=conn.prepareStatement(sql);
pst.setString(1, b.getName());
pst.setInt(2, b.getLid());
pst.executeUpdate();
}
catch (Exception e) {
e.printStackTrace();
}
}
public void deletelanguages(int lid)
{
try
{
Connection conn=Projectutil.createConnection();
String sql="delete from languages where lid=? ";
PreparedStatement pst=conn.prepareStatement(sql);
pst.setInt(1, lid);
pst.executeUpdate();
}
catch (Exception e) {
e.printStackTrace();
}
}
public Languagesbean getByid(int lid)
{
Languagesbean a=null;
try
{
Connection conn=Projectutil.createConnection();
String sql="select * from languages where lid=? ";
PreparedStatement pst=conn.prepareStatement(sql);
pst.setInt(1, lid);
ResultSet rs=pst.executeQuery();
if(rs.next())
{
a=new Languagesbean();
a.setLid(rs.getInt("lid"));
a.setName(rs.getString("name"));
}
}
catch (Exception e) {
e.printStackTrace();
}
return a;
}
public List<Languagesbean> getAlllanguages()
{
List<Languagesbean> list=new ArrayList<Languagesbean>();
try
{
Connection conn=Projectutil.createConnection();
String sql="select * from languages";
PreparedStatement pst=conn.prepareStatement(sql);
ResultSet rs=pst.executeQuery();
while(rs.next())
{
Languagesbean a=new Languagesbean();
a.setLid(rs.getInt("lid"));
a.setName(rs.getString("name"));
list.add(a);
}
}
catch (Exception e) {
e.printStackTrace();
}
return list;
}
}
| [
"45667399+neel-prajapati@users.noreply.github.com"
] | 45667399+neel-prajapati@users.noreply.github.com |
68e724cfaf4e0e821e5ac9eff007fb1a534eeb14 | c0e211427f347289f46019404b59f83b50aa432d | /WebDevProject/src/java/Beans/Cart.java | 2bf3c853df7e2cb8583d59adec5a2600c7ff221a | [] | no_license | Firehead94/IntegratedSpaghetti | 3f46b9e3624d948d8c273d4e6d65afc426944f3c | 67b12390033ff212c2cf71112a8fa45ae61700e6 | refs/heads/master | 2016-09-15T04:31:38.911391 | 2015-05-03T16:22:37 | 2015-05-03T16:22:37 | 33,279,923 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | 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 Beans;
import java.io.Serializable;
import java.util.TreeSet;
/**
* Needs to be redone once we settle on reg_code shit.
* @author Justin
*/
public class Cart implements Serializable {
private TreeSet<Section> cart;
public Cart() {
cart = new TreeSet<>();
}
public void addToCart(Section section) {
cart.add(section);
}
public void removeFromCart(Section section) {
cart.remove(section);
}
public int size() {
return cart.size();
}
}
| [
"Jjonscott@comcast.net"
] | Jjonscott@comcast.net |
bb6290d38a5692810811168f6922094bee60dbf6 | 6be39fc2c882d0b9269f1530e0650fd3717df493 | /weixin反编译/sources/com/tencent/mm/ui/w.java | 5bfc1a493e55110612d58e2648c84380fb45eb07 | [] | no_license | sir-deng/res | f1819af90b366e8326bf23d1b2f1074dfe33848f | 3cf9b044e1f4744350e5e89648d27247c9dc9877 | refs/heads/master | 2022-06-11T21:54:36.725180 | 2020-05-07T06:03:23 | 2020-05-07T06:03:23 | 155,177,067 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,242 | java | package com.tencent.mm.ui;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.p;
import android.support.v4.view.ViewPager.e;
import android.support.v4.view.u;
import android.view.View;
import android.view.ViewGroup;
import com.tencent.mm.R;
import com.tencent.mm.f.a.an;
import com.tencent.mm.platformtools.t;
import com.tencent.mm.plugin.report.service.g;
import com.tencent.mm.sdk.b.b;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.ui.base.CustomViewPager;
import com.tencent.mm.ui.conversation.j;
import com.tencent.mm.ui.mogic.WxViewPager;
import com.tencent.mm.y.as;
import com.tencent.mm.y.s;
import com.tencent.tmassistantsdk.openSDK.TMQQDownloaderOpenSDKConst;
import java.util.HashMap;
import java.util.HashSet;
public final class w {
private static HashMap<String, Integer> xTl;
private final long hUT = 180000;
private int mGf = -1;
public int msV = -1;
MMFragmentActivity xOh;
public x xTc = new x();
d xTd;
boolean xTe;
private HashSet<l> xTf = new HashSet();
CustomViewPager xTg;
a xTh;
private int xTi = -1;
private int xTj = -1;
c xTk = new c<an>() {
{
this.xmG = an.class.getName().hashCode();
}
public final /* synthetic */ boolean a(b bVar) {
int i = ((an) bVar).fpz.index;
if (i >= 0 && i <= 3) {
switch (i) {
case 0:
w.this.YW("tab_main");
break;
case 1:
w.this.YW("tab_address");
break;
case 2:
w.this.YW("tab_find_friend");
break;
case 3:
w.this.YW("tab_settings");
break;
}
}
return false;
}
};
public HashMap<Integer, u> xTm = new HashMap();
public class a extends p implements e, com.tencent.mm.ui.c.a {
private int rpa = 0;
private com.tencent.mm.ui.contact.AddressUI.a xTo;
private final WxViewPager xTp;
private boolean xTq = false;
boolean[] xTr = new boolean[]{true, false, false, false};
public a(FragmentActivity fragmentActivity, WxViewPager wxViewPager) {
super(fragmentActivity.getSupportFragmentManager());
this.xTp = wxViewPager;
this.xTp.a((u) this);
this.xTp.b((e) this);
}
public final int getCount() {
return 4;
}
public final Fragment R(int i) {
return w.this.Eq(i);
}
public final void a(final int i, float f, int i2) {
x a = w.this.xTc;
if (a.xTu != null) {
a.xTu.h(i, f);
}
if (0.0f != f) {
if (this.xTo == null) {
this.xTo = (com.tencent.mm.ui.contact.AddressUI.a) w.this.Eq(1);
}
this.xTo.nf(false);
} else {
x.v("MicroMsg.LauncherUI.MainTabUI", "onPageScrolled, position = %d, mLastIndex = %d", Integer.valueOf(i), Integer.valueOf(w.this.mGf));
if (-1 == w.this.mGf) {
w.this.eO(w.this.mGf, w.this.msV);
w.this.Eo(i);
} else {
ah.y(new Runnable() {
public final void run() {
w.this.eO(w.this.mGf, w.this.msV);
w.this.Eo(i);
}
});
}
}
if (i2 == 0) {
for (Integer num : w.xTl.values()) {
if (num.intValue() != i) {
eP(num.intValue(), 8);
} else if (!this.xTr[num.intValue()]) {
eP(num.intValue(), 0);
}
}
return;
}
for (Integer num2 : w.xTl.values()) {
if (!(num2.intValue() == i || this.xTr[num2.intValue()])) {
eP(num2.intValue(), 0);
}
}
}
private void eP(int i, int i2) {
if (w.this.Eq(i) != null) {
View findViewById = w.this.Eq(i).findViewById(R.h.ctE);
if (findViewById != null) {
findViewById.setVisibility(i2);
}
}
}
public final void ae(int i) {
x.d("MicroMsg.LauncherUI.MainTabUI", "on page selected changed to %d", Integer.valueOf(i));
x.v("MicroMsg.LauncherUI.MainTabUI", "reportSwitch clickCount:%d, pos:%d", Integer.valueOf(this.rpa), Integer.valueOf(i));
if (this.rpa <= 0) {
switch (i) {
case 0:
g.pWK.k(10957, "5");
break;
case 1:
g.pWK.k(10957, "6");
break;
case 2:
g.pWK.k(10957, "7");
break;
}
}
this.rpa--;
switch (i) {
case 0:
g.pWK.k(10957, "1");
break;
case 1:
g.pWK.k(10957, "2");
break;
case 2:
g.pWK.k(10957, TMQQDownloaderOpenSDKConst.VERIFYTYPE_ALL);
break;
case 3:
g.pWK.k(10957, "4");
break;
}
this.xTq = false;
w.this.mGf = w.this.msV;
w.this.msV = i;
w.this.eO(w.this.mGf, w.this.msV);
w.this.xTc.Es(i);
w.this.xOh.supportInvalidateOptionsMenu();
if (w.this.mGf == 1 && w.this.msV != 1) {
as.Hm();
com.tencent.mm.y.c.Db().set(340226, Long.valueOf(System.currentTimeMillis()));
}
if (w.this.msV == 1) {
long currentTimeMillis = System.currentTimeMillis();
as.Hm();
if (currentTimeMillis - t.d((Long) com.tencent.mm.y.c.Db().get(340226, null)) >= 180000) {
((com.tencent.mm.ui.contact.AddressUI.a) w.this.Eq(w.this.msV)).cwA();
}
}
if (w.this.msV == 0) {
as.getNotification().aW(true);
} else {
as.getNotification().aW(false);
}
}
public final void af(int i) {
x.d("MicroMsg.LauncherUI.MainTabUI", "onPageScrollStateChanged state %d", Integer.valueOf(i));
if (i == 0 && this.xTo != null) {
this.xTo.nf(true);
this.xTo = null;
}
}
public final void po(int i) {
if (i == w.this.msV) {
x.d("MicroMsg.LauncherUI.MainTabUI", "on click same index");
u Eq = w.this.Eq(i);
if (Eq instanceof com.tencent.mm.ui.AbstractTabChildActivity.a) {
((com.tencent.mm.ui.AbstractTabChildActivity.a) Eq).cmo();
return;
}
return;
}
this.xTq = true;
this.rpa++;
x.v("MicroMsg.LauncherUI.MainTabUI", "onTabClick count:%d", Integer.valueOf(this.rpa));
this.xTp.d(i, false);
if (i == 3) {
com.tencent.mm.r.c.Bx().aS(262145, 266241);
com.tencent.mm.r.c.Bx().aS(262156, 266241);
com.tencent.mm.r.c.Bx().aS(262147, 266241);
com.tencent.mm.r.c.Bx().aS(262149, 266241);
com.tencent.mm.r.c.Bx().b(com.tencent.mm.storage.w.a.NEW_BANDAGE_DATASOURCE_DEVICE_PROTECT_STRING_SYNC, 266241);
boolean aR = com.tencent.mm.r.c.Bx().aR(262156, 266241);
g gVar = g.pWK;
Object[] objArr = new Object[5];
objArr[0] = Integer.valueOf(6);
objArr[1] = Integer.valueOf(aR ? 1 : 0);
objArr[2] = "";
objArr[3] = "";
objArr[4] = Integer.valueOf(0);
gVar.h(14872, objArr);
}
}
}
public final u cnU() {
return (u) this.xTm.get(Integer.valueOf(this.msV));
}
public final void cnr() {
j jVar = (j) this.xTm.get(Integer.valueOf(0));
if (jVar != null) {
jVar.cwy();
jVar.cxC();
}
}
public final void cnV() {
j jVar = (j) this.xTm.get(Integer.valueOf(0));
if (jVar != null) {
jVar.cxD();
}
}
public final void eO(int i, int i2) {
if (i != i2) {
u Eq = Eq(i);
if (Eq != null && (Eq instanceof l)) {
((l) Eq).cnh();
}
Eq = Eq(i2);
if (Eq != null && (Eq instanceof l)) {
((l) Eq).cng();
}
k.a(this.xOh, 4, i, "deliverOnTabChange");
k.a(this.xOh, 3, i2, "deliverOnTabChange");
}
}
public final void Eo(int i) {
u Eq = Eq(i);
if (Eq != null) {
if (Eq instanceof l) {
((l) Eq).cmu();
}
this.xTh.xTr[i] = true;
}
}
public final void cnW() {
j jVar = (j) this.xTm.get(Integer.valueOf(0));
ViewGroup viewGroup = (ViewGroup) this.xOh.findViewById(R.h.csD);
if (viewGroup != null) {
viewGroup.setImportantForAccessibility(4);
}
if (jVar != null) {
jVar.onHiddenChanged(true);
}
k.a(this.xOh, 4, this.msV, "prepareStartChatting");
cnV();
this.xTc.cnY();
}
static {
HashMap hashMap = new HashMap();
xTl = hashMap;
hashMap.put("tab_main", Integer.valueOf(0));
xTl.put("tab_address", Integer.valueOf(1));
xTl.put("tab_find_friend", Integer.valueOf(2));
xTl.put("tab_settings", Integer.valueOf(3));
}
public final void YW(String str) {
if (str != null && !str.equals("")) {
Ep(((Integer) xTl.get(str)).intValue());
}
}
public final void Ep(int i) {
String str = "MicroMsg.LauncherUI.MainTabUI";
String str2 = "change tab to %d, cur tab %d, has init tab %B, tab cache size %d";
Object[] objArr = new Object[4];
objArr[0] = Integer.valueOf(i);
objArr[1] = Integer.valueOf(this.msV);
objArr[2] = Boolean.valueOf(this.xTg != null);
objArr[3] = Integer.valueOf(this.xTm.size());
x.i(str, str2, objArr);
if (this.xTg != null && i >= 0) {
if (this.xTh != null && i > this.xTh.getCount() - 1) {
return;
}
if (this.msV != i || this.xTm.size() == 0) {
this.msV = i;
this.xTc.Es(this.msV);
if (this.xTg != null) {
this.xTg.d(this.msV, false);
Eo(this.msV);
}
if (this.msV == 0 && com.tencent.mm.kernel.g.Dp().gRu.foreground) {
as.getNotification().aW(true);
} else {
as.getNotification().aW(false);
}
}
}
}
public final u Eq(int i) {
u uVar = null;
x.d("MicroMsg.LauncherUI.MainTabUI", "get tab %d", Integer.valueOf(i));
if (i < 0) {
return null;
}
if (this.xTm.containsKey(Integer.valueOf(i))) {
return (u) this.xTm.get(Integer.valueOf(i));
}
Bundle bundle = new Bundle();
switch (i) {
case 0:
bundle.putInt(j.class.getName(), 0);
uVar = (u) Fragment.instantiate(this.xOh, j.class.getName(), bundle);
as.getNotification().aW(true);
break;
case 1:
bundle.putInt(com.tencent.mm.ui.contact.AddressUI.a.class.getName(), 1);
bundle.putBoolean("Need_Voice_Search", true);
bundle.putBoolean("favour_include_biz", true);
uVar = (u) Fragment.instantiate(this.xOh, com.tencent.mm.ui.contact.AddressUI.a.class.getName(), bundle);
break;
case 2:
bundle.putInt(h.class.getName(), 2);
uVar = (u) Fragment.instantiate(this.xOh, h.class.getName(), bundle);
break;
case 3:
bundle.putInt(y.class.getName(), 3);
uVar = (u) Fragment.instantiate(this.xOh, y.class.getName(), bundle);
break;
}
x.v("MicroMsg.LauncherUI.MainTabUI", "createFragment index:%d", Integer.valueOf(i));
if (uVar != null) {
uVar.setParent(this.xOh);
}
this.xTm.put(Integer.valueOf(i), uVar);
return uVar;
}
public final int cnX() {
x xVar = this.xTc;
return (xVar.xTu == null || xVar.xTu.cmw() <= 0) ? 0 : xVar.xTu.cmw();
}
protected final void cnY() {
this.xTc.cnY();
}
protected final void cnZ() {
this.xTc.cnZ();
}
protected final void coa() {
this.xTc.coa();
}
public final int cob() {
int a;
x xVar = this.xTc;
long currentTimeMillis = System.currentTimeMillis();
if (as.Hp()) {
a = com.tencent.mm.y.t.a(s.hgU, af.cou());
x.d("MicroMsg.LauncherUI", "getMainTabUnreadCount unread : %d", Integer.valueOf(a));
} else {
x.w("MicroMsg.UnreadCountHelper", "getMainTabUnreadCount, but mmcore not ready");
a = 0;
}
xVar.Er(a);
x.d("MicroMsg.LauncherUI.MainTabUnreadMgr", "unreadcheck setConversationTagUnread last time %d, unread %d", Long.valueOf(System.currentTimeMillis() - currentTimeMillis), Integer.valueOf(a));
return a;
}
}
| [
"denghailong@vargo.com.cn"
] | denghailong@vargo.com.cn |
2cdb2231c8991209ebb1dfa9f6283616fc9a2e06 | ae763250a884de1f59848a44ca39ff49730cfd65 | /src/test/java/com/diallo/zakaria/formation/tp6/UtileTest.java | 5ba6f3553956d7470585a2837deaff0081cac5e2 | [] | no_license | zdiallo/tp6 | 17496bc360b82d156e10632348147d8f9020319d | 9db248bc4791a4002b5d7ccd9c02db1425412d1b | refs/heads/master | 2020-05-30T07:18:20.295474 | 2016-09-23T12:26:46 | 2016-09-23T12:26:46 | 69,006,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package com.diallo.zakaria.formation.tp6;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.Locale;
import junit.framework.TestCase;
public class UtileTest extends TestCase {
public void testToInt() throws ParseException {
Date d = getTestDate();
int i = Utile.toInt(d);
assertEquals(20131221, i);
}
public void testToInt2() {
Date d = new Date();
try {
int i = Utile.toInt(null);
fail("java.lang.NullPointerException not catch");
} catch (NullPointerException e) {
System.err.println(e.getMessage());
}catch (NumberFormatException e) {
System.err.println(e.getMessage());
}catch (IllegalArgumentException e) {
// TODO: handle exception
System.err.println(e.getMessage());
}
}
private Date getTestDate() {
try {
return DateFormat.getDateInstance(
DateFormat.SHORT, Locale.FRENCH).parse("21/12/2013");
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}
} | [
"formation@TOSZ930-PORT-15"
] | formation@TOSZ930-PORT-15 |
255179ae189a473b3b21d91f3b8e78f5c60eb873 | b2f687f8386795e934894ad43a5bf6ef09f4531a | /src/samples/access/modifiers/a/SamePackageClass.java | cca2fedf26f348b662ef6a3f984b702801c3ada9 | [] | no_license | revature-191007/hello-world | db6f93d59329f44e64e44a36ab5bb8fc0eba6ee4 | c47325663e4f795aaff562ce791d25b867f04a0f | refs/heads/master | 2020-08-07T12:21:29.027181 | 2019-10-09T18:15:58 | 2019-10-09T18:15:58 | 213,448,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package samples.access.modifiers.a;
public class SamePackageClass {
// Static initialization block
// a block that will run when
// the classloader loads the class
static {
// not accessible
// private members can't be accessed outside
// the class
// System.out.println(AccessModifiers.a);
System.out.println(AccessModifiers.b);
System.out.println(AccessModifiers.c);
System.out.println(AccessModifiers.d);
}
}
| [
"msgoshorn@gmail.com"
] | msgoshorn@gmail.com |
204cbfedc8d6830e0816d1ed03a995e489ca3b30 | 01f4aa145e8c1929c515c153e102dc7bf6085e91 | /src/com/mitp0sh/jaclaff/attributes/annotation/ElementValuePairs.java | 8002927c885f95e511f1115c6f5c0f2f61519e18 | [] | no_license | mitp0sh/libjaclaff | f8dbdebb6ae447680a12f4dcfe3f3873bc628b53 | 2004347e5b06e02286089af1216ce2396546ca27 | refs/heads/master | 2020-05-18T05:46:41.251305 | 2016-12-01T14:52:35 | 2016-12-01T14:52:35 | 9,622,530 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package com.mitp0sh.jaclaff.attributes.annotation;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import com.mitp0sh.jaclaff.deserialization.DesCtx;
import com.mitp0sh.jaclaff.serialization.SerCtx;
/* complete */
public class ElementValuePairs
{
private ArrayList<ElementValuePairsEntry> elementValuePairs = new ArrayList<ElementValuePairsEntry>();
public ArrayList<ElementValuePairsEntry> getElementValuePairs()
{
return elementValuePairs;
}
public void setElementValuePairs(ArrayList<ElementValuePairsEntry> elementValuePairs)
{
this.elementValuePairs = elementValuePairs;
}
public int getNumElementValuePairs()
{
return elementValuePairs.size();
}
public static ElementValuePairs deserialize(DesCtx ctx, int numElementValuePairs) throws IOException
{
ElementValuePairs elementValuePairs = new ElementValuePairs();
for(int i = 0; i < numElementValuePairs; i++)
{
ElementValuePairsEntry current = ElementValuePairsEntry.deserialize(ctx);
elementValuePairs.getElementValuePairs().add(current);
}
return elementValuePairs;
}
public static byte[] serialize(SerCtx ctx, ElementValuePairs elementValuePairs) throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for(int i = 0; i < elementValuePairs.getNumElementValuePairs(); i++)
{
baos.write(ElementValuePairsEntry.serialize(ctx, elementValuePairs.getElementValuePairs().get(i)));
}
return baos.toByteArray();
}
}
| [
"mitp0sh@mitp0sh.de"
] | mitp0sh@mitp0sh.de |
fe25e912a1fc9a476a6354fa051d698140a03fe4 | 1ca2579c187d57d40062a5401867853dd70b2e32 | /src/main/java/com/elmapigateway/config/CacheConfiguration.java | a4c6101176c5199226f39bf27857e1f879e22181 | [] | no_license | BulkSecurityGeneratorProject/int-api-gateway | 968036b0bf3f28738ff5395fb35daea6d74666db | 5bd77a567c5abd7483cb7809c5ee03e66d118afd | refs/heads/master | 2022-12-15T23:26:24.898998 | 2018-10-29T13:05:26 | 2018-10-29T13:05:26 | 296,597,128 | 0 | 0 | null | 2020-09-18T11:07:47 | 2020-09-18T11:07:47 | null | UTF-8 | Java | false | false | 7,103 | java | package com.elmapigateway.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import com.hazelcast.config.*;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.Hazelcast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.context.annotation.*;
import org.springframework.core.env.Environment;
import javax.annotation.PreDestroy;
@Configuration
@EnableCaching
public class CacheConfiguration {
private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class);
private final Environment env;
private final ServerProperties serverProperties;
private final DiscoveryClient discoveryClient;
private Registration registration;
public CacheConfiguration(Environment env, ServerProperties serverProperties, DiscoveryClient discoveryClient) {
this.env = env;
this.serverProperties = serverProperties;
this.discoveryClient = discoveryClient;
}
@Autowired(required = false)
public void setRegistration(Registration registration) {
this.registration = registration;
}
@PreDestroy
public void destroy() {
log.info("Closing Cache Manager");
Hazelcast.shutdownAll();
}
@Bean
public CacheManager cacheManager(HazelcastInstance hazelcastInstance) {
log.debug("Starting HazelcastCacheManager");
CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance);
return cacheManager;
}
@Bean
public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) {
log.debug("Configuring Hazelcast");
HazelcastInstance hazelCastInstance = Hazelcast.getHazelcastInstanceByName("IntApiGateway");
if (hazelCastInstance != null) {
log.debug("Hazelcast already initialized");
return hazelCastInstance;
}
Config config = new Config();
config.setInstanceName("IntApiGateway");
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
if (this.registration == null) {
log.warn("No discovery service is set up, Hazelcast cannot create a cluster.");
} else {
// The serviceId is by default the application's name,
// see the "spring.application.name" standard Spring property
String serviceId = registration.getServiceId();
log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId);
// In development, everything goes through 127.0.0.1, with a different port
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
log.debug("Application is running with the \"dev\" profile, Hazelcast " +
"cluster will only work with localhost instances");
System.setProperty("hazelcast.local.localAddress", "127.0.0.1");
config.getNetworkConfig().setPort(serverProperties.getPort() + 5701);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);
for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) {
String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701);
log.debug("Adding Hazelcast (dev) cluster member " + clusterMember);
config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember);
}
} else { // Production configuration, one host per instance all using port 5701
config.getNetworkConfig().setPort(5701);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);
for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) {
String clusterMember = instance.getHost() + ":5701";
log.debug("Adding Hazelcast (prod) cluster member " + clusterMember);
config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember);
}
}
}
config.getMapConfigs().put("default", initializeDefaultMapConfig(jHipsterProperties));
// Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html
config.setManagementCenterConfig(initializeDefaultManagementCenterConfig(jHipsterProperties));
config.getMapConfigs().put("com.elmapigateway.domain.*", initializeDomainMapConfig(jHipsterProperties));
return Hazelcast.newHazelcastInstance(config);
}
private ManagementCenterConfig initializeDefaultManagementCenterConfig(JHipsterProperties jHipsterProperties) {
ManagementCenterConfig managementCenterConfig = new ManagementCenterConfig();
managementCenterConfig.setEnabled(jHipsterProperties.getCache().getHazelcast().getManagementCenter().isEnabled());
managementCenterConfig.setUrl(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUrl());
managementCenterConfig.setUpdateInterval(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUpdateInterval());
return managementCenterConfig;
}
private MapConfig initializeDefaultMapConfig(JHipsterProperties jHipsterProperties) {
MapConfig mapConfig = new MapConfig();
/*
Number of backups. If 1 is set as the backup-count for example,
then all entries of the map will be copied to another JVM for
fail-safety. Valid numbers are 0 (no backup), 1, 2, 3.
*/
mapConfig.setBackupCount(jHipsterProperties.getCache().getHazelcast().getBackupCount());
/*
Valid values are:
NONE (no eviction),
LRU (Least Recently Used),
LFU (Least Frequently Used).
NONE is the default.
*/
mapConfig.setEvictionPolicy(EvictionPolicy.LRU);
/*
Maximum size of the map. When max size is reached,
map is evicted based on the policy defined.
Any integer between 0 and Integer.MAX_VALUE. 0 means
Integer.MAX_VALUE. Default is 0.
*/
mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE));
return mapConfig;
}
private MapConfig initializeDomainMapConfig(JHipsterProperties jHipsterProperties) {
MapConfig mapConfig = new MapConfig();
mapConfig.setTimeToLiveSeconds(jHipsterProperties.getCache().getHazelcast().getTimeToLiveSeconds());
return mapConfig;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
b1a0ea1b5c7ee7aa56e65c20b17fc24d12cc0d33 | c8c4b5ff5a5957f988f93c17293d4f693aa21296 | /src/main/java/cn/lianhy/demo/utils/HttpClientUtil.java | 5c0666d7bf4de01c124bd2adb6a8be86f5111cd9 | [] | no_license | lianhy/java-common-utils | b243b482eaad102663596c94c1a2141ae93be7c0 | a16db606dca0ae1ab7ceff4e3bfb07eede363a89 | refs/heads/master | 2022-06-24T14:38:47.613102 | 2020-10-13T07:01:54 | 2020-10-13T07:01:54 | 221,878,539 | 0 | 0 | null | 2022-06-17T02:41:47 | 2019-11-15T08:25:34 | Java | UTF-8 | Java | false | false | 5,755 | java | package cn.lianhy.demo.utils;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 发送http请求的工具类
* 基于
*/
public class HttpClientUtil {
public static String doGetForm(String url, Map<String, String> param) {
// 创建Httpclient对象
CloseableHttpClient httpclient = HttpClients.createDefault();
String resultString = "";
CloseableHttpResponse response = null;
try {
// 创建uri
URIBuilder builder = new URIBuilder(url);
if (param != null) {
for (String key : param.keySet()) {
builder.addParameter(key, param.get(key));
}
}
URI uri = builder.build();
// 创建http GET请求
HttpGet httpGet = new HttpGet(uri);
// 执行请求
response = httpclient.execute(httpGet);
// 判断返回状态是否为200
if (response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (response != null) {
response.close();
}
if(httpclient != null) {
httpclient.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
public static String doGetForm(String url) {
return doGetForm(url, null);
}
public static String doGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
// System.out.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
// System.out.println("发送GET请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
public static String doPostForm(String url, Map<String, String> param) {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
// 创建参数列表
if (param != null) {
List<NameValuePair> paramList = new ArrayList<NameValuePair>();
for (String key : param.keySet()) {
paramList.add(new BasicNameValuePair(key, param.get(key)));
}
// 模拟表单
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
httpPost.setEntity(entity);
}
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if(response != null) {
response.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return resultString;
}
public static String doPostForm(String url) {
return doPostForm(url, null);
}
public static String doPost(String url, String json) {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
// 创建请求内容
StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
httpPost.setEntity(entity);
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if(response != null) {
response.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return resultString;
}
}
| [
"lol_lianhy@163.com"
] | lol_lianhy@163.com |
8a28e7afa75c434a643a931471d3b761268b7e76 | f1b5ee7fb616fc9fd0df7a9179fc7bc9f076433e | /app/src/main/java/com/example/contacts/models/ModelCalls.java | b4198736e33f8735c3b1669dbaefe7f248df069f | [] | no_license | Mustafashahoud/Contacts_App | 0b1ce4323f9b5116c449272d611bc3c2df9f4388 | 820266e45a2ea8c25fab512110072efcac6ed6a5 | refs/heads/master | 2020-05-03T01:05:04.956863 | 2019-03-29T03:45:00 | 2019-03-29T03:45:00 | 178,327,849 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package com.example.contacts.models;
public class ModelCalls {
String name, duration, date;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public ModelCalls(String name, String duration, String date) {
this.name = name;
this.duration = duration;
this.date = date;
}
}
| [
"mustafa.shahoud@gmail.com"
] | mustafa.shahoud@gmail.com |
9552a078589bf55c502ffc9a35e62f925ecb73d2 | 883fe067bb32aca061db7ad91dc5b1b327a5ab34 | /singleton/src/main/java/com/zy/patterns/singleton/SingleTon.java | 8925f3e96b961e13ee018f994073662314cb1daf | [] | no_license | zy966/java-design-patterns | ea24287fa31de88da8a411f07e60d71962415491 | ccd9a42d7e2c609028be4119a734e7573dfcd4d6 | refs/heads/master | 2021-07-05T18:12:42.612524 | 2021-04-05T07:22:15 | 2021-04-05T07:22:15 | 229,413,583 | 1 | 0 | null | 2020-10-13T18:22:45 | 2019-12-21T10:48:09 | Java | UTF-8 | Java | false | false | 223 | java | package com.zy.patterns.singleton;
public class SingleTon {
private static SingleTon instance = new SingleTon();
private SingleTon() {
}
public SingleTon getInstance() {
return instance;
}
}
| [
"zhongyuan966@gmail.com"
] | zhongyuan966@gmail.com |
92a1eea074d31cdc67bb95f4abb3fde137541e76 | f17d4ddff32ba25445e4593dae85b050391ee182 | /src/main/java/com/xuekai/controller/CallabelDemo.java | 841f14fc012e69d15021df8d318e88c8517baff1 | [] | no_license | shixk/javaDemo | 2e607c65eac48215f4c786e95b59491d94aca9d4 | 74a4817be7813b22e88fca4bd2551be42a7cd7f7 | refs/heads/master | 2023-04-13T11:22:37.366361 | 2023-03-29T09:59:53 | 2023-03-29T09:59:53 | 100,478,818 | 2 | 0 | null | 2022-12-16T03:13:01 | 2017-08-16T10:45:30 | Java | UTF-8 | Java | false | false | 1,295 | java | package com.xuekai.controller;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class CallabelDemo {
public static class MyCallable implements Callable{
private int flag;
public MyCallable(int flag){
this.flag=flag;
}
@Override
public String call() throws Exception {
if(flag==1){
return "one";
}
if(flag==2){
return "two";
}
else{
throw new Exception("An error is occured.");
}
}
}
public static void main(String[] args) {
MyCallable c1=new MyCallable(1);
MyCallable c2=new MyCallable(2);
MyCallable c3=new MyCallable(3);
// 创建一个执行任务的服务
ExecutorService es = Executors.newFixedThreadPool(3);
try{
Future future1=es.submit(c1);
System.out.println("c1 completed result:"+future1.get());
Future future2=es.submit(c2);
System.out.println("c2 completed result:"+future2.get());
Future future3=es.submit(c3);
System.out.println("c3 completed result:"+future3.get());
}
catch(Exception e){
System.out.println(e.getMessage());
}
es.shutdown();
}
}
| [
"shixk1@lenovo.com"
] | shixk1@lenovo.com |
6383bd544721c8d24f5912940379903682861d88 | 95ab2422be33da0601198a0cdeeba56cf7ee05cf | /src/basicecommerce/App.java | 50142f9ca7efc1f5d41c5ae7326f833aa033ffd7 | [] | no_license | quocnm0102/BasicECommerce | 2fbfd70d795a6731f8469533d216610b8e4a04bf | 6e5d3984eafa2099c04fb7de7fabf5a4cceee0ac | refs/heads/master | 2023-02-23T09:27:38.556619 | 2019-07-27T07:13:06 | 2019-07-27T07:13:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,081 | 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 basicecommerce;
import basicecommerce.models.Product;
import basicecommerce.models.User;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
/**
*
* @author admin
*/
public class App {
public static void main(String[] args) {
runJar(args);
}
public static void runJar(String[] args) {
for (int i = 0; i < args.length; i++) {
try {
runTest(args[i]);
} catch (IOException ex) {
System.out.println(String.format("File %s invalid", args[i]));
}
}
}
public static void runTest(String path) throws IOException {
File file = new File(path);
BufferedReader br = new BufferedReader(new FileReader(file));
String st;
int countProdInfo = 0;
String username = br.readLine();
String email = br.readLine();
User user = new User(username, email);
String[] prodInfo = new String[3];
while ((st = br.readLine()) != null) {
prodInfo[countProdInfo] = st;
if (countProdInfo == 2) {
Product product = new Product(prodInfo[0], Double.valueOf(prodInfo[1]));
int amount = Integer.parseInt(prodInfo[2]);
if (amount <= 0) {
user.removeProduct(product, Integer.parseInt(prodInfo[2]));
} else {
user.addProduct(product, Integer.parseInt(prodInfo[2]));
}
countProdInfo = 0;
prodInfo = new String[3];
} else {
++countProdInfo;
}
}
System.out.println(String.format("%.2f", user.getTotalPrice()));
}
public static void testCase1() {
User user = new User("John Doe", "john.doe@example.com");
Product apple = new Product("Apple", 4.95);
Product orange = new Product("Orange", 3.99);
user.addProduct(apple, 2);
user.addProduct(orange, 1);
double totalPrice = user.getTotalPrice();
System.out.println(totalPrice);
}
public static void testCase2() {
User user = new User("John Doe", "john.doe@example.com");
Product apple = new Product("Apple", 4.95);
Product apple2 = new Product("Apple", 4.95);
user.addProduct(apple, 3);
user.removeProduct(apple2, 1);
double totalPrice = user.getTotalPrice();
System.out.println(totalPrice);
}
public static void testCase3() {
User user = new User("John Doe", "john.doe@example.com");
Product apple = new Product("Apple", 4.95);
Product apple2 = new Product("Apple", 5);
user.addProduct(apple, 3);
user.removeProduct(apple2, 1);
double totalPrice = user.getTotalPrice();
System.out.println(totalPrice);
}
}
| [
"nguyenminhqoc@gmail.com"
] | nguyenminhqoc@gmail.com |
f92f86261015987d48eab63ea308582c9a02a8e5 | b149e3d7c5a356ddd238f218b487cffebea1da35 | /src/gep/FitnessEnvironment.java | 73a0b61ca517cf371972a7a7c5c6c6c37fd723a3 | [
"Apache-2.0"
] | permissive | JannisW/YAGEPlib | 4ab1037252c105f1756df4edbc64abad99ca46c3 | c2c4312ec1fbe27d7489af8d79059501cc6e6cc4 | refs/heads/master | 2021-01-22T20:44:57.834391 | 2017-04-26T08:38:06 | 2017-04-26T08:38:06 | 85,352,615 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,146 | java | /*
* Copyright 2017 Johannes Wortmann
*
* 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 gep;
import gep.model.Individual;
/**
* This class is the abstract class that has to be inherited from to implement
* the fitness environment used to assess the fitness of individuals in the
* formulation of a GEP problem.
*
* TODO parallelize
*
* @author Johannes Wortmann
*
* @param <T>
* The type parameter of individuals (= return type of expression
* tree nodes) in the population to be assessed.
*/
public abstract class FitnessEnvironment<T> {
/**
* Evaluates the fitness for every individual of the given population and
* returns the index of the best individual.
*
* @param population
* The population to be assessed by this method.
* @return The index in the population array with the best fitness value.
*/
public int evaluateFitness(Individual<T>[] population) {
double maxFitness = Double.MIN_VALUE;
int maxFitnessIdx = 0;
for (int i = 0; i < population.length; i++) {
// TODO parallelize (by adding abstract clone method to this class)
final Individual<T> individual = population[i];
individual.setFitness(evaluateFitness(individual));
if (maxFitness < individual.getFitness()) {
maxFitness = individual.getFitness();
maxFitnessIdx = i;
}
}
return maxFitnessIdx;
}
/**
* Evaluates the fitness of the given individual.
*
* @param individual
* The individual to be evaluated.
* @return The fitness value of the individual
*/
abstract protected double evaluateFitness(Individual<T> individual);
}
| [
"johannes.b.wortmann@campus.tu-berlin.de"
] | johannes.b.wortmann@campus.tu-berlin.de |
f7041eba1bc529054deeb0b664e61062bb1b673b | e8ba3c1f81249644795deb53cd2c3a3375dd6203 | /AlgorithmFactory/src/Algorithms/AbstractAlgorithm.java | 6a3306d370cdfa1369e6b2d64bcb20e8ce4c17b2 | [] | no_license | JasinskiM/Spoj | 8293b0950a51810d4d7cc08d9d7af7a05c470ecc | 739d99ce7930361f5a1a8afdddb44b55ac84bb46 | refs/heads/master | 2021-06-21T15:09:54.683933 | 2017-08-17T11:27:05 | 2017-08-17T11:27:05 | 100,595,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package Algorithms;
public abstract class AbstractAlgorithm {
public AbstractAlgorithm() {
System.out.println("Konstruktor Abstract algoritm");
}
public abstract String getName();
public abstract void runAlgoritm(String[] input);
}
| [
"jasinski.mch@gmail.com"
] | jasinski.mch@gmail.com |
986b8558bf09e5ef0081f9a9142bf3d3b4636719 | 16b7359d118e80b84a87372ae0d1e9c261861091 | /hutool-extra/src/main/java/cn/hutool/extra/tokenizer/engine/analysis/AnalysisEngine.java | 90c03c6a32ec5c64844eaf7991354fdca04a1f6c | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-mulanpsl-1.0-en",
"MulanPSL-1.0"
] | permissive | PlexPt/hutool | 0ddc61f69f186cbf57652c55fcbf063976b58ff9 | dfdcdd2b4452c27807f5bfb55125347237ec3654 | refs/heads/v4-master | 2020-07-11T07:42:07.666829 | 2019-08-31T13:52:40 | 2019-08-31T13:52:40 | 116,757,910 | 0 | 0 | Apache-2.0 | 2019-08-26T13:20:31 | 2018-01-09T02:57:03 | Java | UTF-8 | Java | false | false | 1,065 | java | package cn.hutool.extra.tokenizer.engine.analysis;
import java.io.IOException;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.tokenizer.Result;
import cn.hutool.extra.tokenizer.TokenizerEngine;
import cn.hutool.extra.tokenizer.TokenizerException;
/**
* Lucene-analysis分词抽象封装<br>
* 项目地址:https://github.com/apache/lucene-solr/tree/master/lucene/analysis
*
* @author looly
*
*/
public class AnalysisEngine implements TokenizerEngine {
private Analyzer analyzer;
/**
* 构造
*
* @param analyzer 分析器{@link Analyzer}
*/
public AnalysisEngine(Analyzer analyzer) {
this.analyzer = analyzer;
}
@Override
public Result parse(CharSequence text) {
TokenStream stream;
try {
stream = analyzer.tokenStream("text", StrUtil.str(text));
stream.reset();
} catch (IOException e) {
throw new TokenizerException(e);
}
return new AnalysisResult(stream);
}
}
| [
"loolly@gmail.com"
] | loolly@gmail.com |
531b3929ed99ad7ff190d8e0e6b8632aadb7f441 | d8e32d5abf4fcfa3f847e668cb05a47299d8e75b | /src/java/dao/AreaPesquisaDao.java | c3a64c2316f4a3f606088d5af08d86549ff970e9 | [] | no_license | IftaRodrigues/cadastro_TCC | 7f84ef3a2ba876ecbf8a92eca465e2e4887cabc4 | 0c735694524b7987068cf98c0b4ffb9d768098a0 | refs/heads/master | 2020-05-20T16:07:55.509636 | 2019-08-29T11:46:14 | 2019-08-29T11:46:14 | 185,660,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,005 | java | package dao;
import db.ConnectionFactory;
import dominio.AreaPesquisa;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class AreaPesquisaDao {
private ConnectionFactory cf = new ConnectionFactory();
private Connection conn;
private PreparedStatement pstm = null;
private ResultSet rs = null;
String sql;
public AreaPesquisa getAreaPesquisa(Integer id) throws SQLException {
conn = cf.getConnection();
sql = "select * from areaPesquisa where id_areaPesquisa=?";
pstm = conn.prepareStatement(sql);
pstm.setInt(1, id);
rs = pstm.executeQuery();
AreaPesquisa areaPesquisa = new AreaPesquisa();
while (rs.next()) {
areaPesquisa.setId_areaPesquisa(rs.getInt("id_areaPesquisa"));
areaPesquisa.setNome(rs.getString("nome"));
}
rs.close();
pstm.close();
conn.close();
return areaPesquisa;
}
public List<AreaPesquisa> listaAreaPesquisa() throws SQLException {
List<AreaPesquisa> areaPesquisas = new ArrayList<>();
conn = cf.getConnection();
sql = "select * from areaPesquisa";
pstm = conn.prepareStatement(sql);
rs = pstm.executeQuery();
while (rs.next()) {
AreaPesquisa areaPesquisa = new AreaPesquisa();
areaPesquisa.setId_areaPesquisa(rs.getInt("id_areaPesquisa"));
areaPesquisa.setNome(rs.getString("nome"));
areaPesquisas.add(areaPesquisa);
}
rs.close();
pstm.close();
conn.close();
return areaPesquisas;
}
}
| [
"iftarodrigues@gmail.com"
] | iftarodrigues@gmail.com |
477f1e2bd51e1f87cab2f69934ef7615f2cce7b4 | 28f2a84997afbce25c9c48d2148546b623a94841 | /java的老年大学项目/schoolclass/trunk/schoolclass-service/src/main/java/com/learnyeai/schoolclass/mq/TestingScQueueReceiverConfig.java | 5fdd33fee1d716d01a56cb681784515f0b6ff6f0 | [] | no_license | hanghaifeng1994/java | 8b0d490cfcd4da451fc2636ddb0370a2f79b8924 | bc1fdfdaa428bdcb77ae8b5922444af084bc36d2 | refs/heads/master | 2020-04-18T22:36:25.288605 | 2019-02-11T10:24:57 | 2019-02-11T10:24:57 | 167,798,815 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,179 | java | package com.learnyeai.schoolclass.mq;
import org.springframework.amqp.core.AcknowledgeMode;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.learnyeai.mq.TestingConstans;
@Configuration
public class TestingScQueueReceiverConfig {
@Bean(name = "testingScQueueContainer")
public SimpleMessageListenerContainer testingCourseQueueContainer(ConnectionFactory connectionFactory,
TestingScQueueReceiver testingScQueueContainer) {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
container.setQueueNames(TestingConstans.TESTING_SC_QUEUE);
container.setExposeListenerChannel(true);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
container.setMessageListener(testingScQueueContainer);
/** 设置消费者能处理未应答消息的最大个数 */
container.setPrefetchCount(10);
container.setConcurrentConsumers(1);
container.setMaxConcurrentConsumers(10);
return container;
}
}
| [
"2561836089@qq.com"
] | 2561836089@qq.com |
f6ff4f46b8553e8f6b38b8c2d906e15470002f60 | 98938b4f8970a7d0e7ff3ef0b7bd787aac8f69c6 | /xrecyclerview_swipemenu/src/main/java/com/hks360/library/mtech/progressindicator/indicator/SquareSpinIndicator.java | 6b706dc57ec1118c4921ee07c76d591fe4b21ae6 | [
"Apache-2.0"
] | permissive | xiaote1988/XSwipeMenuRecyclerView | d41169d262a698713c48adb5d3dbb69cb00f58fa | cf8e431b45cc6956b3a075c159a939340e78b66c | refs/heads/master | 2021-01-19T21:01:34.357283 | 2017-04-18T07:19:34 | 2017-04-18T07:19:34 | 88,585,614 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package com.hks360.library.mtech.progressindicator.indicator;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.animation.LinearInterpolator;
import java.util.ArrayList;
import java.util.List;
public class SquareSpinIndicator extends BaseIndicatorController {
@Override
public void draw(Canvas canvas, Paint paint) {
canvas.drawRect(new RectF(getWidth()/5,getHeight()/5,getWidth()*4/5,getHeight()*4/5),paint);
}
@Override
public List<Animator> createAnimation() {
List<Animator> animators=new ArrayList<>();
PropertyValuesHolder rotation5= PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
PropertyValuesHolder rotation6= PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
ObjectAnimator animator= ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
animator.start();
animators.add(animator);
return animators;
}
}
| [
"beianshort@126.com"
] | beianshort@126.com |
11ddd668b3b1e7442b608ded9931648ae76ce7d1 | f2aaa52182fdce6e622630a6036a097238e1f94c | /src/com/pauldavdesign/mineauz/minigames/CTFFlag.java | d4cebe2699a14e9e95685bca5bff930f7493456c | [] | no_license | fensoft/Minigames | c72bb972ff51982b8f89258fb2fb172cf165f31b | 39a3c52146ac5d521c1989e74b38baae2cb4d871 | refs/heads/master | 2021-01-15T11:28:38.835145 | 2014-05-08T10:39:03 | 2014-05-08T10:39:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,957 | java | package com.pauldavdesign.mineauz.minigames;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.material.MaterialData;
import com.pauldavdesign.mineauz.minigames.minigame.Minigame;
public class CTFFlag{
private Location spawnLocation = null;
private Location currentLocation = null;
private MaterialData data = null;
private BlockState spawnData = null;
private BlockState originalBlock = null;
private String[] signText = null;
private boolean atHome = true;
private int team = -1;
private int respawnTime = 60;
private int taskID = -1;
private Minigame minigame = null;
private int cParticleID = -1;
public CTFFlag(Location spawn, int team, Player carrier, Minigame minigame){
spawnLocation = spawn;
data = ((Sign)spawnLocation.getBlock().getState()).getData();
spawnData = spawnLocation.getBlock().getState();
signText = ((Sign)spawnLocation.getBlock().getState()).getLines();
this.team = team;
this.setMinigame(minigame);
respawnTime = Minigames.plugin.getConfig().getInt("multiplayer.ctf.flagrespawntime");
}
public Location getSpawnLocation() {
return spawnLocation;
}
public void setSpawnLocation(Location spawnLocation) {
this.spawnLocation = spawnLocation;
}
public Location getCurrentLocation() {
return currentLocation;
}
public void setCurrentLocation(Location currentLocation) {
this.currentLocation = currentLocation;
}
public boolean isAtHome() {
return atHome;
}
public void setAtHome(boolean atHome) {
this.atHome = atHome;
}
public int getTeam() {
return team;
}
public void setTeam(int team) {
this.team = team;
}
public Location spawnFlag(Location location){
Location blockBelow = location.clone();
Location newLocation = location.clone();
blockBelow.setY(blockBelow.getBlockY() - 1);
if(blockBelow.getBlock().getType() == Material.AIR){
while(blockBelow.getBlock().getType() == Material.AIR){
if(blockBelow.getY() > 1){
blockBelow.setY(blockBelow.getY() - 1);
}
else{
return null;
}
}
}
else if(blockBelow.getBlock().getType() != Material.AIR){
while(blockBelow.getBlock().getType() != Material.AIR){
if(blockBelow.getY() < 255){
blockBelow.setY(blockBelow.getY() + 1);
}
else{
return null;
}
}
blockBelow.setY(blockBelow.getY() - 1);
}
if(blockBelow.getBlock().getType() == Material.FURNACE ||
blockBelow.getBlock().getType() == Material.DISPENSER ||
blockBelow.getBlock().getType() == Material.CHEST ||
blockBelow.getBlock().getType() == Material.BREWING_STAND ||
blockBelow.getBlock().getType() == Material.SIGN_POST ||
blockBelow.getBlock().getType() == Material.WALL_SIGN){
blockBelow.setY(blockBelow.getY() + 1);
}
newLocation = blockBelow.clone();
newLocation.setY(newLocation.getY() + 1);
newLocation.getBlock().setType(Material.SIGN_POST);
Sign sign = (Sign) newLocation.getBlock().getState();
sign.setData(data);
originalBlock = blockBelow.getBlock().getState();
blockBelow.getBlock().setType(Material.BEDROCK);
if(newLocation != null){
atHome = false;
for(int i = 0; i < 4; i++){
sign.setLine(i, signText[i]);
}
sign.update();
currentLocation = newLocation.clone();
}
return newLocation;
}
public void removeFlag(){
if(!atHome){
if(currentLocation != null){
Location blockBelow = currentLocation.clone();
currentLocation.getBlock().setType(Material.AIR);
blockBelow.setY(blockBelow.getY() - 1);
blockBelow.getBlock().setType(originalBlock.getType());
originalBlock.update();
currentLocation = null;
stopTimer();
}
}
else{
spawnLocation.getBlock().setType(Material.AIR);
}
}
public void respawnFlag(){
removeFlag();
spawnLocation.getBlock().setType(spawnData.getType());
spawnData.update();
currentLocation = null;
atHome = true;
Sign sign = (Sign) spawnLocation.getBlock().getState();
for(int i = 0; i < 4; i++){
sign.setLine(i, signText[i]);
}
sign.update();
}
public void stopTimer(){
if(taskID != -1){
Bukkit.getScheduler().cancelTask(taskID);
}
}
public Minigame getMinigame() {
return minigame;
}
public void setMinigame(Minigame minigame) {
this.minigame = minigame;
}
public void startReturnTimer(){
final CTFFlag self = this;
taskID = Bukkit.getScheduler().scheduleSyncDelayedTask(Minigames.plugin, new Runnable() {
@Override
public void run() {
String id = MinigameUtils.createLocationID(currentLocation);
if(minigame.hasDroppedFlag(id)){
minigame.removeDroppedFlag(id);
String newID = MinigameUtils.createLocationID(spawnLocation);
minigame.addDroppedFlag(newID, self);
}
respawnFlag();
for(MinigamePlayer pl : minigame.getPlayers()){
if(getTeam() == 0){
pl.sendMessage(MinigameUtils.formStr("minigame.flag.returnedTeam", ChatColor.RED.toString() + "Red Team's" + ChatColor.WHITE), null);
}else if(getTeam() == 1){
pl.sendMessage(MinigameUtils.formStr("minigame.flag.returnedTeam", ChatColor.BLUE.toString() + "Blue Team's" + ChatColor.WHITE), null);
}
else{
pl.sendMessage(MinigameUtils.getLang("minigame.flag.returnedNeutral"), null);
}
}
taskID = -1;
}
}, respawnTime * 20);
}
public void startCarrierParticleEffect(final Player player){
cParticleID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Minigames.plugin, new Runnable() {
@Override
public void run() {
player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 0);
}
}, 15L, 15L);
}
public void stopCarrierParticleEffect(){
if(cParticleID != -1){
Bukkit.getScheduler().cancelTask(cParticleID);
cParticleID = -1;
}
}
}
| [
"paul.dav.1991@gmail.com"
] | paul.dav.1991@gmail.com |
ffca05e8fcc76352ec0b886d826fb8b69c869903 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/stanfordnlp--CoreNLP/d9c1596c24a8443510501e9c94bea26603b6b8d7/before/UnknownWordModelTrainer.java | 3ad1581049193db3183d1d1ed7a938487b2243b1 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package edu.stanford.nlp.parser.lexparser;
import java.util.Collection;
import edu.stanford.nlp.ling.TaggedWord;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.util.Index;
/**
* An interface for training an UnknownWordModel. Once initialized,
* you can feed it trees and then call finishTraining to get the
* UnknownWordModel.
*
* @author John Bauer
*/
public interface UnknownWordModelTrainer {
/**
* Initialize the trainer with a few of the data structures it needs
* to train. Also, it is necessary to estimate the number of trees
* that it will be given, as many of the UWMs switch training modes
* after seeing a fraction of the trees.
* <br>
* This is an initialization method and not part of the constructor
* because these Trainers are generally loaded by reflection, and
* making this a method instead of a constructor lets the compiler
* catch silly errors.
*/
public void initializeTraining(Options op, Lexicon lex,
Index<String> wordIndex,
Index<String> tagIndex, double totalTrees);
/**
* Tallies statistics for this particular collection of trees. Can
* be called multiple times.
*/
public void train(Collection<Tree> trees);
/**
* Tallies statistics for a weighted collection of trees. Can
* be called multiple times.
*/
public void train(Collection<Tree> trees, double weight);
/**
* Tallies statistics for a single tree.
* Can be called multiple times.
*/
public void train(Tree tree, double weight);
/**
* Tallies statistics for a single word.
* Can be called multiple times.
*/
public void train(TaggedWord tw, int loc, double weight);
public void incrementTreesRead(double weight);
/**
* Returns the trained UWM. Many of the subclasses build exactly
* one classify, and some of the finishTraining methods manipulate the
* data in permanent ways, so this should only be called once
*/
public UnknownWordModel finishTraining();
static public final String unknown = "UNK";
static public final int nullWord = -1;
static public final short nullTag = -1;
static public final IntTaggedWord NULL_ITW =
new IntTaggedWord(nullWord, nullTag);
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
a92a8c186687d1ae51afd48be38053006081fc14 | 2b195fb8e7de3bcc13cd4497f4221e93418be573 | /WorldAR_Java/src/main/java/com/huawei/hiardemo/java/loader/ModelRenderer.java | 8dbda2934d9582694d8d1de59e7963e883728536 | [] | no_license | SilverLin07/ARModelDemo | 92bea0961f27626a1a63c52d75d44241b4c7842c | dcb4447f3c55a4b92a02b47d66db4ff9c8924f7d | refs/heads/master | 2020-04-23T18:53:53.269590 | 2019-02-19T01:05:37 | 2019-02-19T01:27:16 | 171,383,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,209 | java | package com.huawei.hiardemo.java.loader;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.Matrix;
import android.util.Log;
import org.andresoviedo.android_3d_model_engine.animation.Animator;
import org.andresoviedo.android_3d_model_engine.drawer.DrawerFactory;
import org.andresoviedo.android_3d_model_engine.drawer.Object3DImpl;
import org.andresoviedo.android_3d_model_engine.model.AnimatedModel;
import org.andresoviedo.android_3d_model_engine.model.Camera;
import org.andresoviedo.android_3d_model_engine.model.Object3D;
import org.andresoviedo.android_3d_model_engine.model.Object3DData;
import org.andresoviedo.android_3d_model_engine.services.Object3DBuilder;
import org.andresoviedo.util.android.GLUtil;
import java.io.ByteArrayInputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
public class ModelRenderer implements GLSurfaceView.Renderer {
private final static String TAG = ModelRenderer.class.getName();
// 3D window (parent component)
private ModelSurfaceView main;
// width of the screen
private int width;
// height of the screen
private int height;
// frustrum - nearest pixel
private static final float near = 1f;
// frustrum - fartest pixel
private static final float far = 100f;
private DrawerFactory drawer;
// The wireframe associated shape (it should be made of lines only)
private Map<Object3DData, Object3DData> wireframes = new HashMap<Object3DData, Object3DData>();
// The loaded textures
private Map<byte[], Integer> textures = new HashMap<byte[], Integer>();
// The corresponding opengl bounding boxes and drawer
private Map<Object3DData, Object3DData> boundingBoxes = new HashMap<Object3DData, Object3DData>();
// The corresponding opengl bounding boxes
private Map<Object3DData, Object3DData> normals = new HashMap<Object3DData, Object3DData>();
private Map<Object3DData, Object3DData> skeleton = new HashMap<>();
// 3D matrices to project our 3D world
private final float[] modelProjectionMatrix = new float[16];
private final float[] modelViewMatrix = new float[16];
// mvpMatrix is an abbreviation for "Model View Projection Matrix"
private final float[] mvpMatrix = new float[16];
// light position required to render with lighting
private final float[] lightPosInEyeSpace = new float[4];
/**
* Whether the info of the model has been written to console log
*/
private boolean infoLogged = false;
/**
* Skeleton Animator
*/
private Animator animator = new Animator();
/**
* Construct a new renderer for the specified surface view
*
* @param modelSurfaceView
* the 3D window
*/
public ModelRenderer(ModelSurfaceView modelSurfaceView) {
this.main = modelSurfaceView;
}
public float getNear() {
return near;
}
public float getFar() {
return far;
}
@Override
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
// Set the background frame color
float[] backgroundColor = main.getModelActivity().getBackgroundColor();
GLES20.glClearColor(backgroundColor[0], backgroundColor[1], backgroundColor[2], backgroundColor[3]);
// Use culling to remove back faces.
// Don't remove back faces so we can see them
// GLES20.glEnable(GLES20.GL_CULL_FACE);
// Enable depth testing for hidden-surface elimination.
GLES20.glEnable(GLES20.GL_DEPTH_TEST);
// Enable blending for combining colors when there is transparency
GLES20.glEnable(GLES20.GL_BLEND);
GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA);
// This component will draw the actual models using OpenGL
drawer = new DrawerFactory();
}
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
this.width = width;
this.height = height;
// Adjust the viewport based on geometry changes, such as screen rotation
GLES20.glViewport(0, 0, width, height);
// INFO: Set the camera position (View matrix)
// The camera has 3 vectors (the position, the vector where we are looking at, and the up position (sky)
SceneLoader scene = main.getModelActivity().getScene();
Camera camera = scene.getCamera();
Matrix.setLookAtM(modelViewMatrix, 0, camera.xPos, camera.yPos, camera.zPos, camera.xView, camera.yView,
camera.zView, camera.xUp, camera.yUp, camera.zUp);
// the projection matrix is the 3D virtual space (cube) that we want to project
float ratio = (float) width / height;
Log.d(TAG, "projection: [" + -ratio + "," + ratio + ",-1,1]-near/far[1,10]");
Matrix.frustumM(modelProjectionMatrix, 0, -ratio, ratio, -1, 1, getNear(), getFar());
// Calculate the projection and view transformation
Matrix.multiplyMM(mvpMatrix, 0, modelProjectionMatrix, 0, modelViewMatrix, 0);
}
@Override
public void onDrawFrame(GL10 unused) {
// Draw background color
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
SceneLoader scene = main.getModelActivity().getScene();
if (scene == null) {
// scene not ready
return;
}
// animate scene
scene.onDrawFrame();
// recalculate mvp matrix according to where we are looking at now
Camera camera = scene.getCamera();
if (camera.hasChanged()) {
Matrix.setLookAtM(modelViewMatrix, 0, camera.xPos, camera.yPos, camera.zPos, camera.xView, camera.yView,
camera.zView, camera.xUp, camera.yUp, camera.zUp);
// Log.d("Camera", "Changed! :"+camera.ToStringVector());
Matrix.multiplyMM(mvpMatrix, 0, modelProjectionMatrix, 0, modelViewMatrix, 0);
camera.setChanged(false);
}
// draw light
if (scene.isDrawLighting()) {
Object3DImpl lightBulbDrawer = (Object3DImpl) drawer.getPointDrawer();
float[] lightModelViewMatrix = lightBulbDrawer.getMvMatrix(lightBulbDrawer.getMMatrix(scene.getLightBulb()),modelViewMatrix);
// Calculate position of the light in eye space to support lighting
Matrix.multiplyMV(lightPosInEyeSpace, 0, lightModelViewMatrix, 0, scene.getLightPosition(), 0);
// Draw a point that represents the light bulb
lightBulbDrawer.draw(scene.getLightBulb(), modelProjectionMatrix, modelViewMatrix, -1, lightPosInEyeSpace);
}
List<Object3DData> objects = scene.getObjects();
for (int i=0; i<objects.size(); i++) {
Object3DData objData = null;
try {
objData = objects.get(i);
boolean changed = objData.isChanged();
Object3D drawerObject = drawer.getDrawer(objData, scene.isDrawTextures(), scene.isDrawLighting(),
scene.isDrawAnimation());
if (!infoLogged) {
Log.i("ModelRenderer","Using drawer "+drawerObject.getClass());
infoLogged = true;
}
Integer textureId = textures.get(objData.getTextureData());
if (textureId == null && objData.getTextureData() != null) {
Log.i("ModelRenderer","Loading GL Texture...");
ByteArrayInputStream textureIs = new ByteArrayInputStream(objData.getTextureData());
textureId = GLUtil.loadTexture(textureIs);
textureIs.close();
textures.put(objData.getTextureData(), textureId);
}
if (objData.getDrawMode() == GLES20.GL_POINTS){
Object3DImpl lightBulbDrawer = (Object3DImpl) drawer.getPointDrawer();
lightBulbDrawer.draw(objData,modelProjectionMatrix, modelViewMatrix, GLES20.GL_POINTS,lightPosInEyeSpace);
} else if (scene.isAnaglyph()){
// TODO: implement anaglyph
} else if (scene.isDrawWireframe() && objData.getDrawMode() != GLES20.GL_POINTS
&& objData.getDrawMode() != GLES20.GL_LINES && objData.getDrawMode() != GLES20.GL_LINE_STRIP
&& objData.getDrawMode() != GLES20.GL_LINE_LOOP) {
// Log.d("ModelRenderer","Drawing wireframe model...");
try{
// Only draw wireframes for objects having faces (triangles)
Object3DData wireframe = wireframes.get(objData);
if (wireframe == null || changed) {
Log.i("ModelRenderer","Generating wireframe model...");
wireframe = Object3DBuilder.buildWireframe(objData);
wireframes.put(objData, wireframe);
}
drawerObject.draw(wireframe,modelProjectionMatrix,modelViewMatrix,wireframe.getDrawMode(),
wireframe.getDrawSize(),textureId != null? textureId:-1, lightPosInEyeSpace);
}catch(Error e){
Log.e("ModelRenderer",e.getMessage(),e);
}
} else if (scene.isDrawPoints() || objData.getFaces() == null || !objData.getFaces().loaded()){
drawerObject.draw(objData, modelProjectionMatrix, modelViewMatrix
,GLES20.GL_POINTS, objData.getDrawSize(),
textureId != null ? textureId : -1, lightPosInEyeSpace);
} else if (scene.isDrawSkeleton() && objData instanceof AnimatedModel && ((AnimatedModel) objData)
.getAnimation() != null){
Object3DData skeleton = this.skeleton.get(objData);
if (skeleton == null){
skeleton = Object3DBuilder.buildSkeleton((AnimatedModel) objData);
this.skeleton.put(objData, skeleton);
}
animator.update(skeleton);
drawerObject = drawer.getDrawer(skeleton, false, scene.isDrawLighting(), scene
.isDrawAnimation());
drawerObject.draw(skeleton, modelProjectionMatrix, modelViewMatrix,-1, lightPosInEyeSpace);
} else {
drawerObject.draw(objData, modelProjectionMatrix, modelViewMatrix,
textureId != null ? textureId : -1, lightPosInEyeSpace);
}
// Draw bounding box
if (scene.isDrawBoundingBox() || scene.getSelectedObject() == objData) {
Object3DData boundingBoxData = boundingBoxes.get(objData);
if (boundingBoxData == null || changed) {
boundingBoxData = Object3DBuilder.buildBoundingBox(objData);
boundingBoxes.put(objData, boundingBoxData);
}
Object3D boundingBoxDrawer = drawer.getBoundingBoxDrawer();
boundingBoxDrawer.draw(boundingBoxData, modelProjectionMatrix, modelViewMatrix, -1, null);
}
// Draw normals
if (scene.isDrawNormals()) {
Object3DData normalData = normals.get(objData);
if (normalData == null || changed) {
normalData = Object3DBuilder.buildFaceNormals(objData);
if (normalData != null) {
// it can be null if object isnt made of triangles
normals.put(objData, normalData);
}
}
if (normalData != null) {
Object3D normalsDrawer = drawer.getFaceNormalsDrawer();
normalsDrawer.draw(normalData, modelProjectionMatrix, modelViewMatrix, -1, null);
}
}
// TODO: enable this only when user wants it
// obj3D.drawVectorNormals(result, modelViewMatrix);
} catch (Exception ex) {
Log.e("ModelRenderer","There was a problem rendering the object '"+objData.getId()+"':"+ex.getMessage(),ex);
}
}
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public float[] getModelProjectionMatrix() {
return modelProjectionMatrix;
}
public float[] getModelViewMatrix() {
return modelViewMatrix;
}
} | [
"silverlin@SSLS-MacBook-Pro.local"
] | silverlin@SSLS-MacBook-Pro.local |
d4a122287c824dc6d602a7a305e50ce16846f3ea | 3c7537fc579a958a99cac4dceb14fc760d26c9b3 | /src/proyecto/bean/ProvinciaBean.java | 0a2ed382a685a704b2a8a411cc482cae6defbca5 | [] | no_license | rMendozajy/assessmentSoftware | 09341ef3749b5d1c5034cb7f6635ff04b658b959 | 3c464fc6043b092e88781fe7c6f1ac1addd91165 | refs/heads/master | 2021-01-18T13:49:14.107922 | 2013-12-17T02:21:32 | 2013-12-17T02:21:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package proyecto.bean;
public class ProvinciaBean {
String idProvincia;
String nombreProvincia;
String idDepartamento;
public String getIdProvincia() {
return idProvincia;
}
public void setIdProvincia(String idProvincia) {
this.idProvincia = idProvincia;
}
public String getNombreProvincia() {
return nombreProvincia;
}
public void setNombreProvincia(String nombreProvincia) {
this.nombreProvincia = nombreProvincia;
}
public String getIdDepartamento() {
return idDepartamento;
}
public void setIdDepartamento(String idDepartamento) {
this.idDepartamento = idDepartamento;
}
}
| [
"rubnnjayo@gmail.com"
] | rubnnjayo@gmail.com |
489d4eebfbcf1ffdbb597a7745b8548b0bd208dd | 4ac0b511b4b31bf5c93e62fba4945619ceb39f0a | /src/main/java/com/google/codeu/servlets/DatastoreHelper.java | 925f0ebbab285172e93b4a84877e2f313f275678 | [
"Apache-2.0"
] | permissive | easrlh/team-24-codeu | ee9273b42d3ea5ddb52f2fc1fa0928c56224eac2 | ae7fd75d7cac6e4f7eb18b69e86ba082816d62ab | refs/heads/master | 2020-08-04T04:14:15.541579 | 2019-10-01T03:17:43 | 2019-10-01T03:17:43 | 211,999,159 | 1 | 0 | Apache-2.0 | 2019-10-01T02:36:54 | 2019-10-01T02:36:54 | null | UTF-8 | Java | false | false | 910 | java | package com.google.codeu.servlets;
import java.util.HashMap;
import com.google.codeu.data.Datastore;
import com.google.codeu.data.Route;
public class DatastoreHelper {
private Datastore datastore;
public DatastoreHelper(Datastore datastore) {
this.datastore = datastore;
}
public HashMap<String, Double> userToSumDistanceTransportationMap(String userEmail) {
HashMap<String, Double> totalTransp = new HashMap<String, Double>();
for (Route route : this.datastore.getRoutes(userEmail)) {
System.out.println("route.getUser " + route.getUser());
HashMap<String, Double> transpToDist = route.getTotalDistanceByTransportationMode();
for (String key : transpToDist.keySet()) {
double currDist = 0;
if (totalTransp.containsKey(key)) {
currDist = totalTransp.get(key);
}
totalTransp.put(key, currDist + transpToDist.get(key));
}
}
return totalTransp;
}
}
| [
"alexsieu14@gmail.com"
] | alexsieu14@gmail.com |
111cadee65e6a99eee4e3ef66bf9a4e3da52bbb5 | ef68f145f4364da490b6aec4df0ec62c80085ff9 | /src/main/java/com/fisc/gestionotr/client/UserFeignClientInterceptor.java | a49a970a5025b9538bebb7c8100da89e295f739f | [] | no_license | sandalothier/jhipster-gestionotr | 591a50912d0fbd3c8d75590aaa3fac0e4694c0de | 94b5492573302a150bacc04b18c54bdca0ad398a | refs/heads/master | 2022-12-23T03:35:22.925271 | 2020-01-29T14:29:00 | 2020-01-29T14:29:00 | 229,055,686 | 0 | 0 | null | 2022-12-16T06:04:43 | 2019-12-19T13:02:29 | Java | UTF-8 | Java | false | false | 624 | java | package com.fisc.gestionotr.client;
import com.fisc.gestionotr.security.SecurityUtils;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;
@Component
public class UserFeignClientInterceptor implements RequestInterceptor {
private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String BEARER = "Bearer";
@Override
public void apply(RequestTemplate template) {
SecurityUtils.getCurrentUserJWT()
.ifPresent(s -> template.header(AUTHORIZATION_HEADER,String.format("%s %s", BEARER, s)));
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
3a643c8c1acba88a594b3858f2c2863420417845 | 74f37000d6f67755b416190f594ea98342f66f3f | /dhis/src/main/java/org/dhis2/fhir/adapter/dhis/model/DataValue.java | 092ab171144086ac8f9ab267de1f71e68f172e5a | [
"BSD-3-Clause"
] | permissive | gretchiemoran/dhis2-fhir-adapter | 8f03a6fb7eda41aac597f5749a735411b1cf6e6b | ecb05ae2c02a492f95cb1efed85feb928dcee663 | refs/heads/master | 2020-04-02T17:35:39.203280 | 2018-10-24T07:35:16 | 2018-10-24T07:40:00 | 154,663,751 | 1 | 0 | NOASSERTION | 2018-10-25T12:03:18 | 2018-10-25T12:03:18 | null | UTF-8 | Java | false | false | 2,158 | java | package org.dhis2.fhir.adapter.dhis.model;
/*
* Copyright (c) 2004-2018, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project 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.
*/
import org.dhis2.fhir.adapter.Scriptable;
import java.time.ZonedDateTime;
/**
* Contains read-only access to a DHIS2 Data Element Value. Implementations must
* guarantee that in read-only implementations only read-only dependent/includes
* object instances are returned.
*
* @author volsch
*/
@Scriptable
public interface DataValue
{
String getDataElementId();
Object getValue();
boolean isProvidedElsewhere();
ZonedDateTime getLastUpdated();
String getStoredBy();
boolean isModified();
boolean isNewResource();
}
| [
"volker@volsch.eu"
] | volker@volsch.eu |
4f354b985f11afb8c67c4761d0edd043ca2190e9 | 3e8c365557763d021f67ceb20b5bec45ff530552 | /src/DungeonCrawl/Monsters/GoblinWarrior.java | a70b6447ec4de1187661b30cff7c63ca0a5762d6 | [] | no_license | Epasper/DungeonCrawl | 7b2124fb880f90251bc30169d29e7941c1cf95d7 | a106b4d6279bb3e50d277a6da5c75491708787e4 | refs/heads/master | 2023-04-27T21:50:41.785927 | 2019-08-07T07:56:17 | 2019-08-07T07:56:17 | 181,691,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package DungeonCrawl.Monsters;
import javafx.scene.image.Image;
import DungeonCrawl.Model.Monster;
public class GoblinWarrior extends Monster {
public GoblinWarrior() {
this.setLevel(2);
this.setID(103);
this.setHitPoints(29);
this.setCurrentHitPoints(29);
this.setAC(17);
this.setFortitude(13);
this.setReflex(15);
this.setWill(12);
this.setHeroName("Goblin Warrior");
this.setMonsterType("Humanoid");
this.setCreatureIcon(new Image(getClass().getResourceAsStream("MonsterImages\\GoblinWarrior.png")));
this.setXpValue(100);
this.setInitiativeBonus(5);
this.setAttack1Name("Spear");
this.setAttack1Name("Javelin");
this.setAttack1toHitBonus(6);
this.setAttack1toHitBonus(6);
this.setAttack1DamageDiceType(8);
this.setAttack2DamageDiceType(6);
this.setAttack1DamageDiceAmount(1);
this.setAttack2DamageDiceAmount(1);
this.setAttack1DamageBonus(2);
this.setAttack2DamageBonus(2);
this.setAttack1DefenseToBeChecked("AC");
this.setAttack2DefenseToBeChecked("AC");
this.setPassive1Description("If, on its turn, the goblin warrior ends its move at least 4 squares\n" +
"away from its starting point, it deals an extra 1d6 damage on its\n" +
"ranged attacks until the start of its next turn.");
this.setPassive1Description("The goblin warrior can move up to half its speed; at any point\n" +
"during that movement, it makes one ranged attack without\n" +
"provoking an opportunity attack.");
super.updateTheDefensesMap();
}
}
| [
"epasper@gmail.com"
] | epasper@gmail.com |
9cb31e2b40b58016214342f15bd43fb650bb115b | 6c8485ab659a58f7bbc466d51924fd361aa84ebe | /headfirst-designpattern/src/main/java/com/tencent/data/sourcecode/headfirst/designpatterns/iterator/transition/DinerMenu.java | 86cfde4faba0f7c2b5941e63af41bae4fc8c7f4f | [] | no_license | JeremyHwc/JDesignPattern | f5f143270174cd236d3c1086a8a1e20247154fea | e6535b6c475593a297a0bb3724a8e35c3f12e550 | refs/heads/master | 2020-03-19T09:27:50.817445 | 2019-04-18T10:28:15 | 2019-04-18T10:28:15 | 136,290,886 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,519 | java | package com.tencent.data.sourcecode.headfirst.designpatterns.iterator.transition;
import java.util.Iterator;
public class DinerMenu implements Menu {
static final int MAX_ITEMS = 6;
int numberOfItems = 0;
MenuItem[] menuItems;
public DinerMenu() {
menuItems = new MenuItem[MAX_ITEMS];
addItem("Vegetarian BLT",
"(Fakin') Bacon with lettuce & tomato on whole wheat", true, 2.99);
addItem("BLT",
"Bacon with lettuce & tomato on whole wheat", false, 2.99);
addItem("Soup of the day",
"Soup of the day, with a side of potato salad", false, 3.29);
addItem("Hotdog",
"A hot dog, with saurkraut, relish, onions, topped with cheese",
false, 3.05);
addItem("Steamed Veggies and Brown Rice",
"Steamed vegetables over brown rice", true, 3.99);
addItem("Pasta",
"Spaghetti with Marinara Sauce, and a slice of sourdough bread",
true, 3.89);
}
public void addItem(String name, String description,
boolean vegetarian, double price)
{
MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
if (numberOfItems >= MAX_ITEMS) {
System.err.println("Sorry, menu is full! Can't add item to menu");
} else {
menuItems[numberOfItems] = menuItem;
numberOfItems = numberOfItems + 1;
}
}
public MenuItem[] getMenuItems() {
return menuItems;
}
public Iterator<MenuItem> createIterator() {
return new DinerMenuIterator(menuItems);
//return new AlternatingDinerMenuIterator(menuItems);
}
// other menu methods here
}
| [
"jeremy_hwc@163.com"
] | jeremy_hwc@163.com |
70d4892b75b4104c57a254347da1d878fa96eb87 | 00894cda187b189523e6ee4153805c09017702b9 | /jt/jt-web/src/main/java/com/jt/service/ItemServiceImpl.java | 59f4196ec04a4fdc4472f4115f95b2ca365a3c7b | [] | no_license | Coderookie-1/nbs-jt | 78965a283565ed9b485b1a9df5ed232005e8a46b | d5dee0522e381ff385ceb6d6490d1113a4985974 | refs/heads/master | 2023-04-22T14:06:25.266966 | 2021-05-06T14:15:10 | 2021-05-06T14:15:10 | 364,938,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | package com.jt.service;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jt.pojo.Item;
import com.jt.pojo.ItemDesc;
import com.jt.util.HttpClientService;
import com.jt.util.ObjectMapperUtil;
@Service
public class ItemServiceImpl implements ItemService{
@Autowired
private HttpClientService httpClient;
@Override
public Item findItemById(Long itemId) {
String url = "http://manage.jt.com/web/item/findItemById";
//为了满足get请求需求 定义id=xxx
Map<String, String> params = new HashMap<>();
params.put("id", itemId+"");
String result = httpClient.doGet(url,params);
//串转对象
Item item = ObjectMapperUtil.toObject(result, Item.class);
return item;
}
@Override
public ItemDesc findItemDescById(Long itemId) {
String url = "http://manage.jt.com/web/item/findItemDescById";
//为了满足get请求需求 定义id=xxx
Map<String, String> params = new HashMap<>();
params.put("id", itemId+"");
String result = httpClient.doGet(url,params);
//串转对象
ItemDesc itemDesc = ObjectMapperUtil.toObject(result, ItemDesc.class);
return itemDesc;
}
}
| [
"1354351149@qq.com"
] | 1354351149@qq.com |
08f7505f9aca92e667d8ec9f980f6f2963fbd96b | 76643b921613f09ea37e7d71c261ac1078513c9b | /Mystery2.java | 38d3cb8f6253c3e1290713346326e3ba1bd95e83 | [] | no_license | VinayPeace/prp | 5cf73bcf2c7c3226126b7135f19787b9d47c402a | a2a4b797d6bccbeb638dc2d65d68c8eb97c65cff | refs/heads/master | 2020-03-18T23:27:36.833520 | 2018-06-21T06:30:23 | 2018-06-21T06:30:23 | 135,404,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package basics;
public class Mystery2
{
public static void main( String[] args )
{
int count = 1;
while ( count <= 10 )
{
System.out.println( count % 2 == 1 ? "****" : "++++++++" );
++count;
}
}
}
| [
"vinayr173@gmail.com"
] | vinayr173@gmail.com |
416f8114a9f0bc8ace0f946ff3bc165a00e12453 | 64d9615054ff45dd0cc5d4da391feb2948dfec3c | /src/main/java/com/utsc/project_coding_lads/service/impl/EventServiceImpl.java | 8e8ec68d31a1c5c6e648c4e66e0858c14e577ace | [] | no_license | HensonChen/U-impactify | 92c96c291c179124f97cb0fb8e9db38a1b3092ca | 39586719142840a0cceb3b3c947337ea1e781849 | refs/heads/master | 2023-02-12T16:34:31.540808 | 2020-12-23T12:06:33 | 2020-12-23T12:06:33 | 328,420,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,722 | java | package com.utsc.project_coding_lads.service.impl;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.utsc.project_coding_lads.domain.Event;
import com.utsc.project_coding_lads.domain.User;
import com.utsc.project_coding_lads.exception.EntityNotExistException;
import com.utsc.project_coding_lads.exception.MissingInformationException;
import com.utsc.project_coding_lads.exception.ValidationFailedException;
import com.utsc.project_coding_lads.repository.EventRepository;
import com.utsc.project_coding_lads.service.EventService;
import com.utsc.project_coding_lads.service.UserService;
import com.utsc.project_coding_lads.validator.EventValidator;
import com.utsc.project_coding_lads.validator.UserValidator;
@Service
@Transactional
public class EventServiceImpl implements EventService {
@Autowired
EventRepository eventRepo;
@Autowired
UserService userService;
@Autowired
EventValidator eventValidator;
@Autowired
UserValidator userValidator;
final static Logger log = LoggerFactory.getLogger(EventServiceImpl.class);
@Override
public Event saveEvent(Event event) throws ValidationFailedException {
if (event == null)
throw new MissingInformationException("Event body is null");
eventValidator.init(event.getEventName(), event.getEventDesc(), event.getEventCreator(),
event.getEventStartDate(), event.getEventEndDate());
eventValidator.validate();
User user = userService.findUserById(event.getEventCreator().getId());
event.setEventCreator(user);
user.getEvents().add(event);
User savedUser = userService.updateUser(user);
Event saved = savedUser.getEvents().get(user.getEvents().size() - 1);
return saved;
}
@Override
public Event findEventById(Integer eventId) throws ValidationFailedException {
if (!existsById(eventId)) {
throw new EntityNotExistException("That Event does not exist.");
}
return eventRepo.findById(eventId).get();
}
@Override
public void deleteEventById(Integer eventId) throws Exception {
eventRepo.deleteById(eventId);
}
@Override
public Event updateEvent(Event event) throws ValidationFailedException {
if (event == null)
throw new MissingInformationException("Event body is null");
eventValidator.init(event.getEventName(), event.getEventDesc(), event.getEventCreator(),
event.getEventStartDate(), event.getEventEndDate(), event.getId());
eventValidator.validateExists();
User user = userService.findUserById(event.getEventCreator().getId());
event.setEventCreator(user);
return eventRepo.save(event);
}
@Override
public Boolean existsById(Integer eventId) {
return eventRepo.existsById(eventId);
}
@Override
public List<Event> findAllEventsByUserId(Integer userId) throws ValidationFailedException {
User user = userService.findUserById(userId);
userValidator.init(user);
userValidator.validateExists();
user.getEvents().size();
List<Event> events = user.getEvents();
return events;
}
@Override
public List<Event> findAllEventsByUserIdDate(Integer userId, LocalDate date) throws ValidationFailedException {
if (date == null)
throw new ValidationFailedException("Date cannot be null.");
List<Event> eventsByDate = new ArrayList<>();
List<Event> events = findAllEventsByUserId(userId);
for (Event event : events) {
if (event.getEventStartDate().toLocalDate().isEqual(date)) {
eventsByDate.add(event);
}
}
return eventsByDate;
}
}
| [
"simon.ha@mail.utoronto.ca"
] | simon.ha@mail.utoronto.ca |
970415ba3a7fc48edc017fa04db026693d5ee12b | 4c13fbb4feed1a5ada93d794661e3f98888908cc | /app/src/test/java/com/example/marcelo/tkl_game_lister_app/ExampleUnitTest.java | fb7e3358d68ae74e17a5606830b5ecaff765f3b1 | [] | no_license | marcelo-h-h/tkl_game_lister | cd30a3ffc3c799f00f9e82e9d599bd7a588e1efe | 9ed546adbb85880c8562ee3b5cb001dce9737485 | refs/heads/master | 2020-03-30T08:30:58.539437 | 2018-10-03T17:22:04 | 2018-10-03T17:22:04 | 151,021,285 | 0 | 0 | null | 2018-10-03T17:51:59 | 2018-10-01T00:57:56 | Java | UTF-8 | Java | false | false | 400 | java | package com.example.marcelo.tkl_game_lister_app;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"marcelo-h-h@hotmail.com"
] | marcelo-h-h@hotmail.com |
026508c7adc35638a925d995958d21c3d7660e4c | 252580f3b71eb2b191995f0a1f553bb2771a4b0a | /app/src/main/java/com/getbewarned/connectinterpreter/models/ReasonsResponse.java | 0dc4aba1114d09fe864c1b159ac04fbafb312e0c | [] | no_license | Vrungel322/connectinterpreter | 21b0001b513021bb175a934be3d0f3fcb25618b1 | b151d0749fa68ac73ee197eb0cc2ddc13867e4aa | refs/heads/ui | 2023-03-22T19:09:59.814326 | 2021-03-06T13:32:34 | 2021-03-06T13:32:34 | 290,198,521 | 0 | 0 | null | 2020-11-20T18:00:17 | 2020-08-25T11:38:04 | Java | UTF-8 | Java | false | false | 301 | java | package com.getbewarned.connectinterpreter.models;
import com.google.gson.annotations.Expose;
import java.util.List;
public class ReasonsResponse extends ApiResponseBase {
@Expose
List<ReasonResponse> reasons;
public List<ReasonResponse> getReasons() {
return reasons;
}
}
| [
"artycake.work@gmail.com"
] | artycake.work@gmail.com |
12b10b58b77c3c3ac401cefa5bc985027fef98cd | b9567a21a91ef0028d55ffdce9e81e644577f52d | /src/com/yc/bean/ScBean.java | aa2b75fb6dd22d7133f33e1afa000496bfe92f9a | [] | no_license | wuxinjie-JChen/yxjy | 4e7cb112088b7889ac3e9428a09fe917d9ba9f97 | df04d60e015de2b64cf3798e4c025f1b79868096 | refs/heads/master | 2023-04-11T03:45:44.242599 | 2021-04-20T16:29:19 | 2021-04-20T16:29:19 | 359,877,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,734 | java | package com.yc.bean;
import java.io.Serializable;
import java.util.Date;
public class ScBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3027599130682706724L;
private Integer scid;
private Integer cid;
private Integer tid;
private Integer sid;
private String scdaytime;
private String scqtime;
private Date scotime;
private Date scstime;
private Integer scstate;
public Integer getScid() {
return scid;
}
public void setScid(Integer scid) {
this.scid = scid;
}
public Integer getCid() {
return cid;
}
public void setCid(Integer cid) {
this.cid = cid;
}
public Integer getTid() {
return tid;
}
public void setTid(Integer tid) {
this.tid = tid;
}
public Integer getSid() {
return sid;
}
public void setSid(Integer sid) {
this.sid = sid;
}
public String getScdaytime() {
return scdaytime;
}
public void setScdaytime(String scdaytime) {
this.scdaytime = scdaytime;
}
public String getScqtime() {
return scqtime;
}
public void setScqtime(String scqtime) {
this.scqtime = scqtime;
}
public Date getScotime() {
return scotime;
}
public void setScotime(Date scotime) {
this.scotime = scotime;
}
public Date getScstime() {
return scstime;
}
public void setScstime(Date scstime) {
this.scstime = scstime;
}
public Integer getScstate() {
return scstate;
}
public void setScstate(Integer scstate) {
this.scstate = scstate;
}
@Override
public String toString() {
return "ScBean [scid=" + scid + ", cid=" + cid + ", tid=" + tid + ", sid=" + sid + ", scdaytime=" + scdaytime
+ ", scqtime=" + scqtime + ", scotime=" + scotime + ", scstime=" + scstime + ", scstate=" + scstate
+ "]";
}
}
| [
"1226229612@qq.com"
] | 1226229612@qq.com |
6c8fb68488faac01bd516154d54692ed70f71b73 | 47ddc81415d49f20f4871dd494a3464dad745bf1 | /OmnipotentFrame2/app/src/androidTest/java/frame/libin/com/omnipotentframe/ExampleInstrumentedTest.java | 9059d864881c7c1a936db3e371f19a08d83efe16 | [] | no_license | libin7278/OmnipotentFrame | e93a5f682f29332261539bad8e1ec45f62e30546 | 934f6ab620dd5d4b0ec9ff6a6d956fe60c8ec7a9 | refs/heads/master | 2021-01-25T06:30:36.275183 | 2017-06-07T03:26:49 | 2017-06-07T03:26:49 | 93,585,310 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package frame.libin.com.omnipotentframe;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("frame.libin.com.omnipotentframe", appContext.getPackageName());
}
}
| [
"binli@ecarx.com.cn"
] | binli@ecarx.com.cn |
cf4ce5d2a86192be8fa8f90031bf788f29f744b8 | 05042bc17a1b1318c02d455bf95c6d983f70ae44 | /src/main/java/Ada/APIRest/enums/Gender.java | 20d8b449f15ca29eff9fa7212a84110241961913 | [] | no_license | tatiencina/AdaFinalProject | ac43ff0e3cbc8e04487004a812a02f1cd55d3d7b | d9017ec1d1ec72646525e5a6f4b87795d7b4b9dd | refs/heads/main | 2023-06-01T04:30:45.710368 | 2021-06-23T14:04:42 | 2021-06-23T14:04:42 | 346,182,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | package Ada.APIRest.enums;
public enum Gender {
Female,
Male,
TransFemale,
TransMale,
NonBinary,
GenderFluent,
Undisclosed,
}
| [
"tatiencina@hotmail.com"
] | tatiencina@hotmail.com |
5117398ccfdbf94047e0c1d32e992cf5b5c532df | a81c08273d36d59a5f2e313d26fee16eb7b60fc4 | /src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/BrowserFeature.java | d7cb3570d2110fec93e72e0b3fb8cb03f10dd0f7 | [
"Apache-2.0"
] | permissive | edouardswiac/htmlunit | 88cdc4bc2e7807627c5619be5ad721a17117dbe7 | cc9f8e4b341b980ec0bac9cb8b531f4ff958c534 | refs/heads/master | 2016-09-14T13:53:28.461222 | 2016-04-29T21:32:17 | 2016-04-29T21:32:17 | 57,413,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | /*
* Copyright (c) 2002-2016 Gargoyle Software Inc.
*
* 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.gargoylesoftware.htmlunit.javascript.configuration;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* An annotation to mark a feature in {@link com.gargoylesoftware.htmlunit.BrowserVersionFeatures}.
*
* @author Ahmed Ashour
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface BrowserFeature {
/**
* The {@link WebBrowser}s supported by this feature.
* @return the {@link WebBrowser}s
*/
WebBrowser[] value() default {
@WebBrowser(IE),
@WebBrowser(FF),
@WebBrowser(CHROME)
};
}
| [
"eswiac@twitter.com"
] | eswiac@twitter.com |
f98c03a921dbb0b6c6a4cc2e8a0870f1a432a75b | bd1ab76c63dd310d3b95ccafe111cad83a53d6ee | /app/src/androidTest/java/com/example/cc/coolweather/ExampleInstrumentedTest.java | 96c3bd8c546ee73b169d44efa0bf356157c937c3 | [
"Apache-2.0"
] | permissive | 52liulifang/coolweather | c181370cda4e049842d583691ba0ed7828b0b6e1 | bbc847fcc94cbe3b970acb43fa7dbff580713f73 | refs/heads/master | 2020-03-18T21:05:58.799054 | 2018-05-31T14:03:09 | 2018-05-31T14:03:09 | 135,259,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package com.example.cc.coolweather;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.cc.coolweather", appContext.getPackageName());
}
}
| [
"704357815@qq.com"
] | 704357815@qq.com |
d4344162c666ebc77c15b1e93cc0a38c3afae86f | 2e12a696c5409cd0f41470cce71b2d0039f5efb8 | /src/firstPackage/DataTypesPractice.java | 2521ab63f432f4535a296db001956826d7713e3f | [] | no_license | mdaziz07/TestRepo | 64ab75449b0114321719e87c9e0753d069474850 | cf3446a1a230faaa93c2cc4149f3acc531c63710 | refs/heads/master | 2023-07-16T19:43:05.700985 | 2021-08-21T04:17:09 | 2021-08-21T04:17:09 | 392,509,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 606 | java | package firstPackage;
public class DataTypesPractice {
static int a = 40;
static int b = 60;
static int c = a; //initialize c=40;
static int d = b;
static String name = "AZIZ";
public static void main(String[] args) {
System.out.println(a+b);
System.out.println(c+d);
System.out.println(name);
a = 50; // still c=40. it is not changing the value of c
b = 70; // still d=60
name = "Osman"; // initializing name with Osman
System.out.println(a+b);
System.out.println(c+d);
System.out.println(name);
}
}
| [
"mdaziz07@gmail.com"
] | mdaziz07@gmail.com |
e88a5fddb892142bd70607fda9218fdf8462ad32 | 18bc6383ed7040a35572a835cd16e6d83142ea31 | /src/coding/challenge/java/SwapArifmetic.java | 52c678e5cb83889d29f65ff40b3da92cda149c88 | [] | no_license | dimiurg9/Java_coding_challenge | 2d39654426e895b81ef2375c5e034b8a33139acb | 4aa2b803cd0d43d20fbd804f672a8e8785b10b8e | refs/heads/master | 2022-12-14T00:33:03.267844 | 2022-12-12T07:42:30 | 2022-12-12T07:42:30 | 244,696,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package coding.challenge.java;
public class SwapArifmetic {
public static void main(String[] cla){
int x = 5;
int y = 10;
System.out.println("Before swapping x = " + x + ", y = " + y);
x = x + y;
y = x - y;
x = x - y;
System.out.println("After swapping x = " + x + ", y = " + y);
}
}
| [
"dimiurg9@yahoo.com"
] | dimiurg9@yahoo.com |
6f227c61e9cf8589b2fde65b3039d485963b05b7 | 5d2b22cd3ce1fd0e3d13f212ae6ed0da455ff9ac | /java-world/jt-2017/mbritzke/calculator_jetty_tomcat/src/main/java/com/github/matheusbritzke/java/spring4/calculator/Calculator/Calculator.java | f3b9fcbe9c5577c5dd20c5bc789813d926a9edf6 | [
"Unlicense"
] | permissive | nicolasperuch/cloud-native-studies | d9661e5ecc17d274be96f9774f5151782169d282 | 4ab31e973ba35fc97903db933a3aaa69ee31ceea | refs/heads/master | 2020-04-05T12:33:39.183166 | 2017-08-06T19:26:17 | 2017-08-06T19:26:17 | 95,148,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,609 | java | package com.github.matheusbritzke.java.spring4.calculator.Calculator;
import com.github.matheusbritzke.java.spring4.calculator.Maps.HistoryOperations;
import com.github.matheusbritzke.java.spring4.calculator.Maps.MapOperations;
import org.springframework.beans.factory.annotation.Autowired;
import static jdk.nashorn.internal.objects.Global.Infinity;
public class Calculator {
private MapOperations mapOperations;
private HistoryOperations historyOperations;
@Autowired
public Calculator(MapOperations mapOperations, HistoryOperations historyOperations){
this.historyOperations = historyOperations;
this.mapOperations = mapOperations;
}
public String calculate(double firstNumber, double secondNumber, String operation) {
try {
boolean validateOperator = validateOperation(operation);
if(validateOperator){
double ans = mapOperations.getMapOperations().get(operation).calculate(firstNumber, secondNumber);
if (ans == Infinity){
saveOperations(firstNumber, secondNumber, operation, "Error, division by zero");
return "Error, division by zero";
}
saveOperations(firstNumber, secondNumber, operation, String.valueOf(ans));
return String.valueOf(ans);
}
}catch (Exception exception){
saveOperations(firstNumber, secondNumber, "Invalid Operation", "Erro");
}
return "Erro";
}
private boolean validateOperation(String operation) {
String typeOfOperation = "+-*/^";
return typeOfOperation.contains(operation);
}
private void saveOperations(double firstNumber, double secondNumber, String operation, String ans) {
String completeOperation = firstNumber + " "+ operation + " " + secondNumber + " = " + ans;
historyOperations.getHistoryOperations().get(operation).add(completeOperation);
}
public String showHistory(){
StringBuilder ans = new StringBuilder();
for(String aux: historyOperations.getHistoryOperations().keySet())
ans.append(historyOperations.getHistoryOperations().get(aux) + "\n");
return ans.toString();
}
public String showHistoryByOperation(String operation) {
StringBuilder ans = new StringBuilder();
for(String aux: historyOperations.getHistoryOperations().keySet())
if (aux.contains(operation))
ans.append(historyOperations.getHistoryOperations().get(aux) + "\n");
return ans.toString();
}
}
| [
"nicolasperuch.2010@gmail.com"
] | nicolasperuch.2010@gmail.com |
39d2e9cac55e5f89fcda9de9798301b4becc8f7c | 8567438779e6af0754620a25d379c348e4cd5a5d | /chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/StatusCardViewHolder.java | 811d7bc4ec70597fff50f3687c07433ed19e63ff | [
"BSD-3-Clause"
] | permissive | thngkaiyuan/chromium | c389ac4b50ccba28ee077cbf6115c41b547955ae | dab56a4a71f87f64ecc0044e97b4a8f247787a68 | refs/heads/master | 2022-11-10T02:50:29.326119 | 2017-04-08T12:28:57 | 2017-04-08T12:28:57 | 84,073,924 | 0 | 1 | BSD-3-Clause | 2022-10-25T19:47:15 | 2017-03-06T13:04:15 | null | UTF-8 | Java | false | false | 2,691 | java | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.ntp.cards;
import android.content.Context;
import android.support.annotation.IntegerRes;
import android.support.annotation.StringRes;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ntp.ContextMenuManager;
import org.chromium.chrome.browser.widget.displaystyle.UiConfig;
/**
* ViewHolder for Status and Promo cards.
*/
public class StatusCardViewHolder extends CardViewHolder {
private final TextView mTitleView;
private final TextView mBodyView;
private final Button mActionView;
public StatusCardViewHolder(
NewTabPageRecyclerView parent, ContextMenuManager contextMenuManager, UiConfig config) {
super(R.layout.new_tab_page_status_card, parent, config, contextMenuManager);
mTitleView = (TextView) itemView.findViewById(R.id.status_title);
mBodyView = (TextView) itemView.findViewById(R.id.status_body);
mActionView = (Button) itemView.findViewById(R.id.status_action_button);
}
/**
* Interface for data items that will be shown in this card.
*/
public interface DataSource {
/**
* @return Resource ID for the header string.
*/
@StringRes
int getHeader();
/**
* @return Description string.
*/
String getDescription();
/**
* @return Resource ID for the action label string, or 0 if the card does not have a label.
*/
@StringRes
int getActionLabel();
/**
* Called when the user clicks on the action button.
*
* @param context The context to execute the action in.
*/
void performAction(Context context);
}
public void onBindViewHolder(final DataSource item) {
super.onBindViewHolder();
mTitleView.setText(item.getHeader());
mBodyView.setText(item.getDescription());
@IntegerRes
int actionLabel = item.getActionLabel();
if (actionLabel != 0) {
mActionView.setText(actionLabel);
mActionView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
item.performAction(v.getContext());
}
});
mActionView.setVisibility(View.VISIBLE);
} else {
mActionView.setVisibility(View.GONE);
}
}
}
| [
"hedonist.ky@gmail.com"
] | hedonist.ky@gmail.com |
819e5e454ec27b1f7ae7166bd0466ffb4e4b2c38 | 1850d6ca85d3e5774e1216c02c01cc9544113e8b | /app/src/main/java/com/myapp/doctorapp/interfaces/ApiInterface.java | 043127d846e4d18ea146fef0af565c0e33b3964d | [] | no_license | Urmila-m/DoctorApp | be73a916c10d9265d0741f12b270b73086ee9345 | 49370c66b18a50a99fac0d8649b08ce9e140840f | refs/heads/master | 2020-04-25T08:26:11.230335 | 2019-05-08T13:56:41 | 2019-05-08T13:56:41 | 172,647,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,238 | java | package com.myapp.doctorapp.interfaces;
import android.os.Bundle;
import com.myapp.doctorapp.model.AppointmentDetail;
import com.myapp.doctorapp.model.Doctor;
import com.myapp.doctorapp.model.EmailPasswordResponse;
import com.myapp.doctorapp.model.IdModel;
import com.myapp.doctorapp.model.ImageUrlModel;
import com.myapp.doctorapp.model.MedicineDetails;
import com.myapp.doctorapp.model.PostResponse;
import com.myapp.doctorapp.model.User;
import com.myapp.doctorapp.model.VerificationResponse;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
public interface ApiInterface {
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> insertData(@Field("action") String insert,
@Field("name") String name,
@Field("mobile") String mobile,
@Field("id") String id,
@Field("dob") String dob,
@Field("gender") String gender,
@Field("height") String height,
@Field("weight") String weight,
@Field("password") String password,
@Field("image") String image,
@Field("email") String email);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<List<EmailPasswordResponse>> getEmailPasswordList(@Field("action") String getEmailList);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<User> getUser(@Field("action") String getRecordWithEmail,
@Field("email") String email);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<List<Doctor>> getDoctorList(@Field("action") String getDoctorList);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> updateProfile(@Field("action") String editProfile,
@Field("weight") String weight,
@Field("height") String height,
@Field("blood") String bloodGroup,
@Field("email") String email);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<List<IdModel>> getIdList(@Field("action") String getIdList);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<User> getUserUsingId(@Field("action") String getRecordWithId,
@Field("id") String id);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> setAppointment(@Field("action") String setAppointment,
@Field("doctorName") String doctor,
@Field("doctorFee") String doctorFee,
@Field("patient") String patient,
@Field("appointment_time") String time,
@Field("appointment_date") String date);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<List<AppointmentDetail>> getAppointmentDetails(@Field("action") String getAppDetails,
@Field("patientEmail") String patientEmail);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> insertMedicineDetails(@Field("action") String insertMedicineDetails,
@Field("medicine") String medicine,
@Field("doctor") String doctor,
@Field("patient") String patient,
@Field("time") String time,
@Field("morning") boolean morning,
@Field("day") boolean day,
@Field("night") boolean night,
@Field("rating") float rating);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<List<MedicineDetails>> getMyMedicines(@Field("action") String getMyMedicine,
@Field("patient") String patient);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> verifyUser(@Field("action") String verifyUser,
@Field("patientEmail") String patientEmail);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<VerificationResponse> checkVerification(@Field("action") String checkVerification,
@Field("patientEmail") String patientEmail);
@POST("doctorAppAPI.php")
@FormUrlEncoded
Call<PostResponse> resetPassword(@Field("action") String resetPassword,
@Field("patientEmail") String Email,
@Field("newPassword") String newPassword);
@POST("uploadImage.php")
@FormUrlEncoded
Call<List<ImageUrlModel>> getAllImages(@Field("action") String getAllImages,
@Field("email") String email);
}
| [
"urmi.mhrz@gmail.com"
] | urmi.mhrz@gmail.com |
955fb94de2b36a9ba1efc62707ab536d43fac730 | 2b27b52433cff5234505ac36739c218608c8efbe | /DeleteAndEarn.java | 215ae8cd2fd4d0b3182d87c8e7d9f3d4e894643e | [] | no_license | GhadiAkshay/DP-3 | e29704c979c5b6bd0a861574fbc60ed07f74dd88 | 23c0f321a8a4e1b05a3a9e43f46fd966d27f9ebb | refs/heads/master | 2023-05-29T22:06:28.210290 | 2021-06-08T02:45:12 | 2021-06-08T02:45:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,051 | java | // Time Complexity : O(N)
// Space Complexity : O(N)
// Did this code successfully run on Leetcode : Yes
// Any problem you faced while coding this : No
class Solution1 {
public int deleteAndEarn(int[] nums) {
if (nums == null || nums.length == 0)
return 0;
// Create an array from 0 to MAX + 1 to store sum of points
// where MAX is the maximum value in given nums
// Get MAX for the input array
int max = 0;
for (int num : nums) {
max = Math.max(max, num);
}
// Create an array
int[] arr = new int[max + 1];
for (int num : nums) {
arr[num] += num;
}
// Use the skip or take pattern similar to the one used in House Robber Problem
int skip = 0, take = 0;
for (int i = 0; i < arr.length; i++) {
int temp = skip;
skip = Math.max(skip, take);
take = temp + arr[i];
}
return Math.max(skip, take);
}
} | [
"akshay1797@gmail.com"
] | akshay1797@gmail.com |
673a3ee6db794bcfc6caeaedd598cb31ca61a8eb | 2b57e4b9f80112c89fcdf131c096cd695e798d1f | /ChopThatTree! - Minecraft Server Manager/src/com/lewislovesgames/chopthattree/minecraftservermanager/JarFilter.java | e932b9b81b006e23ef71c9dd5cac8480e5370d31 | [] | no_license | lewisakura/ChopThatTree-Official-Repo | ae41391cabf3edbc8e92d627cde36fa92bfe2fd0 | 7d219862d9e2d0842f27d209c5634278433aca86 | refs/heads/master | 2022-11-26T08:13:36.386373 | 2014-12-09T18:13:55 | 2014-12-09T18:13:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.lewislovesgames.chopthattree.minecraftservermanager;
import java.io.File;
import javax.swing.filechooser.FileFilter;
public class JarFilter extends FileFilter {
@Override
public boolean accept(File arg0) {
if (arg0.isDirectory()) {
return true;
}
String extension = utils.getExtension(arg0);
if (extension != null) {
if (extension.equals(utils.jar)) {
return true;
} else {
return false;
}
}
return false;
}
@Override
public String getDescription() {
return "Jar File (*.jar)";
}
}
| [
"lewisminecraft@hotmail.co.uk"
] | lewisminecraft@hotmail.co.uk |
2594fef5a313fa398c2a85faed89a7f388fa5638 | 466f4b042cb88b716cfd43b45cbbb45f0f685ffa | /Entornos Desarrollo/Online03/PruebaPoliedros/src/pruebapoliedros/Octaedro.java | 3962f786784962f8a0356e00d4900fbc23346c7e | [] | no_license | juanmicl/Programacion | dc0ea843aaaecdea58a4e7fad0808216088d025a | f760863b750a07b5e35e3e1d0de3fe8a28f599e3 | refs/heads/master | 2020-03-30T17:20:32.567816 | 2019-05-30T17:36:44 | 2019-05-30T17:36:44 | 151,428,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 767 | 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 pruebapoliedros;
/**
*
* @author 0101001011
*/
public class Octaedro {
private int arista;
/**
*
* @param arista
*/
public Octaedro(int arista) {
this.arista = arista;
}
/**
*
* @return
*/
public double area() {
double resultado = (2 * (Math.pow(arista, 2))) * Math.sqrt(3);
return resultado;
}
/**
*
* @return
*/
public double volumen() {
double resultado = (float)1/3 * Math.sqrt(2) * Math.pow(arista, 3);
return resultado;
}
}
| [
"contacto@juanmi.pw"
] | contacto@juanmi.pw |
fc9de815c7d282f05cde728e9383449fa1f7ea66 | 196c7a790dc64b91d02d0d540e1d049ba1c25603 | /src/com/kpc/eos/core/exception/BaseException.java | 7c930957025cfd53c634501df7c917256d5e3950 | [] | no_license | myhope8729/Java-Spring-B2B | f657174faad9921e9a372a77821fc2e834d3921b | adbbd6c10f6b6bafc6e74ffb62fc97b5be05fda1 | refs/heads/master | 2020-07-12T04:07:31.451204 | 2019-08-27T14:16:13 | 2019-08-27T14:16:13 | 204,713,316 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,874 | java |
package com.kpc.eos.core.exception;
import org.apache.log4j.Logger;
import com.kpc.eos.core.util.MessageUtil;
/**
*
* BaseException
* =================
* Description :
* Methods :
*/
public class BaseException extends RuntimeException {
private static final long serialVersionUID = -4925772626396172013L;
private Logger logger = Logger.getLogger(this.getClass());
private String key;
private Object[] args;
/**
*
* BaseException.java Constructor
*
* @param code
*/
public BaseException(String code) {
this.key = code;
if (logger.isDebugEnabled()) {
logger.debug(getMessage());
}
}
public BaseException(String code, Object[] args) {
this.key = code;
this.args = args;
if (logger.isDebugEnabled()) {
logger.debug(getMessage());
}
}
public BaseException(String code, Throwable causeThrowable) {
super(causeThrowable);
this.key = code;
if (logger.isDebugEnabled()) {
logger.debug(getMessage(), causeThrowable);
}
}
public BaseException(String code, Object[] args, Throwable causeThrowable) {
super(causeThrowable);
this.key = code;
this.args = args;
if (logger.isDebugEnabled()) {
logger.debug(getMessage(), causeThrowable);
}
}
public String getMessage() {
if (this.args != null) {
return MessageUtil.getMessage(this.key, this.args);
}
return MessageUtil.getMessage(this.key);
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Object[] getArgs() {
return args;
}
public void setArgs(Object[] args) {
this.args = args;
}
}
| [
"myhope1227@hotmail.com"
] | myhope1227@hotmail.com |
bc1161c7ecfacef62d186cd441cb430d80913ed7 | 8f7f1a973c80f3b55b5c010564a0d8c7f3088491 | /potato-core/src/main/java/me/vigroid/potato/core/net/RestUrl.java | 398c083062bf7a51d3f132eae4aad79c315fdea7 | [] | no_license | DelphiCoder/PotatoDetector | b104b45a528cd7caf41b1a17f4736049205c57bf | 09614738927b34759a1cbb1eade49ca33b358355 | refs/heads/master | 2020-04-19T09:56:34.600394 | 2017-10-24T21:19:15 | 2017-10-24T21:19:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package me.vigroid.potato.core.net;
/**
* Created by vigroid on 10/18/17.
* avoid hard coded URL
*/
public class RestUrl {
public static final String REST_URL = "getInfo";
}
| [
"yangvigo@gmail.com"
] | yangvigo@gmail.com |
928b7633d9e9e3895062eff967541b86fc70f2e2 | 3927af2ca4ee325fd0fa29cb5db5edfbd5f36e49 | /src/ListNode/cci52/Cci52.java | f86a743b0be9aa1e3f6d0d60dd598a3b82ce9f5a | [] | no_license | ThisisWyatt/LeetCode | fe10730d400e2edf484af5ed5b285a3b5ee1c000 | ff61b97f8c819ec5cc1356f660110d398ddf1292 | refs/heads/master | 2022-04-25T14:51:17.255387 | 2020-05-01T15:34:25 | 2020-05-01T15:34:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,341 | java | package ListNode.cci52;
import ListNode.Node;
/**
* Description TODO LeetCode 面试 52th 寻找两个链表首次出现的结点
* Author Cloudr
* Date 2020/4/11 22:45
**/
public class Cci52 {
private static Node getIntersectionNodes(Node headA, Node headB) {
if (headA == null || headB == null) {
return null;
}
Node node1 = headA;
Node node2 = headB;
while (node1.value != node2.value) {
node1 = node1.next;
node2 = node2.next;
if (node1 == null) {
node1 = headB;
}
if (node2 == null) {
node2 = headA;
}
}
return node1;
}
// 寻找公共后缀的第一次元素
private static int common(int[] a, int[] b) {
int i = 0;
int j = 0;
int[] aa = a;
int[] bb = b;
while (true) {
if (a[i] == b[j])
return a[i];
if(a==bb&b==aa&&i==bb.length-1)
return -1;
i++;
if (a == aa && i == a.length) {
a = bb;
i = 0;
}
j++;
if (b == bb && j == b.length) {
b = aa;
j = 0;
}
}
}
// 寻找公共后缀的第一个字符
private static char commonForString(String str1,String str2){
char[] a=str1.toCharArray();
char[] b=str2.toCharArray();
char[] a1=a;
char[] b1=b;
int i=0;
int j=0;
while (true){
if(a[i]==b[j]){
return a[i];
}
if(a==b1&&b==a1&&i==a.length-1)//如果是第一次交换后都遍历到最后但仍然没有相同 则退出
return '^';
i++;
if(i==a.length-1){
a=b1;
i=0;
}
j++;
if(j==b.length-1){
b=a1;
j=0;
}
}
}
public static void main(String[] args) {
// Node head1 = null;
// Node temp1 = null;
//
// for (int i = 0; i < 7; i++) {
// Node current;
// if (head1 == null) {
// current = new Node(i);
// head1 = current;
// temp1 = head1;
// } else {
// current = new Node(i);
// temp1.next = current;
// temp1 = temp1.next;
// }
// }
//
// Node head2 = null;
// Node temp2 = null;
//
// for (int i = 4; i < 10; i++) {
// Node current;
// if (head2 == null) {
// current = new Node(i);
// head2 = current;
// temp2 = head2;
// } else {
// current = new Node(i);
// temp2.next = current;
// temp2 = temp2.next;
// }
// }
//
// Node x = getIntersectionNodes(head1, head2);
// System.out.println(x.value);
// int[] a = {2,5,6};
// int[] b = {1,2,3,5,6};
// int commonNum = common(a, b);
// System.out.println(commonNum);
String a="ASDHJKL";
String b="QWEHJKL";
char x=commonForString(a,b);
System.out.println(x);
}
}
| [
"cc7722@foxmail.com"
] | cc7722@foxmail.com |
d950c5c406308472a547f830593075aa192cad11 | 64c838f2ca80718248d8a7fa6b44fd02a12c4c5a | /fanyin-web-manage/src/test/java/com/fanyin/test/solr/ItemData.java | 971f89483c0699251f510293866e6f1d47efc01b | [] | no_license | ergehenmeng/fanyin-project | c54c94515120d4d43341aabad723e9c4d4686b6b | f9f6efa6a8a3ae2f072ff6c8de176ff2fdda0f17 | refs/heads/master | 2022-06-30T03:03:59.794132 | 2019-08-08T07:37:12 | 2019-08-08T07:37:12 | 118,566,605 | 0 | 1 | null | 2022-06-17T01:53:43 | 2018-01-23T06:15:45 | Java | UTF-8 | Java | false | false | 2,518 | java | package com.fanyin.test.solr;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrInputDocument;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import java.util.Map;
/**
* @author 二哥很猛
* @date 2018/12/10 10:29
*/
public class ItemData {
private HttpSolrClient httpSolrClient;
@Before
public void before(){
httpSolrClient = new HttpSolrClient.Builder("http://localhost:8888/solr/my_core").withConnectionTimeout(30000).withSocketTimeout(30000).build();
}
@Test
public void addApi(){
}
@Test
public void addData()throws Exception{
Solr solr = new Solr();
solr.setId("199");
solr.setName("大哥很猛");
httpSolrClient.addBean(solr);
httpSolrClient.commit();
}
@Test
public void deleteData()throws Exception{
//httpSolrClient.deleteById("1");
httpSolrClient.deleteByQuery("name:三哥");
httpSolrClient.commit();
}
/**
* 通过document方式添加
*/
@Test
public void addDocument()throws Exception{
SolrInputDocument document = new SolrInputDocument();
document.addField("id","10080");
document.addField("name","中国移动");
httpSolrClient.add(document);
httpSolrClient.commit();
}
@Test
public void query()throws Exception{
SolrQuery query = new SolrQuery();
query.setQuery("name:哥");
query.setSort("id",SolrQuery.ORDER.desc);
query.setStart(0);
query.setRows(2);
query.setHighlight(true);
query.addHighlightField("name");
query.setHighlightSimplePre("<em>");
query.setHighlightSimplePost("</em>");
QueryResponse response = httpSolrClient.query(query);
List<Solr> beans = response.getBeans(Solr.class);
Map<String, Map<String, List<String>>> highlighting = response.getHighlighting();
for (Map.Entry<String,Map<String,List<String>>> entry : highlighting.entrySet()){
for(Solr solr : beans){
if(!entry.getKey().equals(solr.getId())){
continue;
}
solr.setName(entry.getValue().get("name").toString());
break;
}
}
for (Solr bean : beans) {
System.out.println(bean);
}
}
}
| [
"664956140@qq.com"
] | 664956140@qq.com |
a940c03d7b244d68a49af221633f0bdb6e97695e | def4fe8f0df9467d112eacd4b13c86622f1c6c02 | /bookShop-SSM/ebooknet/src/main/java/com/lianshuwang/controller/UploadController.java | 42a952c123c5a39d639cde537396987555f75407 | [] | no_license | ZJiawe/SpringItem | 1829a70d2ff4a57d9ce643dfdbf00ae5f3fc7df9 | 01511c396969acea31372c01a26caec578072f64 | refs/heads/master | 2022-12-24T01:03:16.417304 | 2019-06-24T10:29:22 | 2019-06-24T10:29:22 | 189,006,811 | 0 | 0 | null | 2022-12-16T09:49:08 | 2019-05-28T10:28:27 | Java | UTF-8 | Java | false | false | 5,371 | java | package com.lianshuwang.controller;
import com.lianshuwang.domin.Book;
import com.lianshuwang.helper.BookHelper;
import com.lianshuwang.helper.UserHelper;
import com.lianshuwang.service.BookService;
import com.lianshuwang.service.UserService;
import com.lianshuwang.util.PropertyConfigurer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Random;
/**
* Created by ZhangZijian on 2017/4/17.
*/
@Controller
public class UploadController {
@Autowired
private BookService bookService;
@Autowired
private UserService userService;
private static final Log logger = LogFactory.getLog(UploadController.class);
@RequestMapping(value = "getUploadPage")
public String getUploadPage(HttpSession session) {
UserHelper userHelper = (UserHelper) session.getAttribute("userHelper");
if (null == userHelper) {
return "redirect:index";
}
logger.info("you are visiting uploading page!");
return "upload";
}
@RequestMapping(value = "doUpload", method = RequestMethod.POST)
public String doUpload(@ModelAttribute BookHelper bookHelper, Model model, HttpSession session ) throws IllegalStateException, IOException, ParseException {
logger.info("you are uploading a book! ");
logger.info("This book is " + bookHelper.getTitle() + "!");
String fileName = bookHelper.getBookFile().getOriginalFilename();
String bookCover = bookHelper.getBookCover().getOriginalFilename();
MultipartFile bookFile = bookHelper.getBookFile();
MultipartFile coverFile = bookHelper.getBookCover();
if (bookFile.isEmpty()) {
logger.info("Uploading failed! The book you are uploading is empty!");
return "upload_failed";
} else if (coverFile.isEmpty()) {
logger.info("Uploading failed! The book cover you are uploading is empty!");
return "upload_failed";
} else {
String typeId = "" + bookHelper.getLargeType() + bookHelper.getSmallType();
int type_id = Integer.parseInt(typeId);
String format = fileName.substring(fileName.lastIndexOf('.') + 1);
List<String> typeNames;
typeNames = bookService.getTypeNames(type_id);
String filePath_pre = (String) PropertyConfigurer.getProperty("book_path");
String filePath = filePath_pre + typeNames.get(0) +
"/" + typeNames.get(1) + "/" +
bookHelper.getTitle() + "." + format;
File localBookFile = new File(filePath);
if (localBookFile.exists()) {
logger.info("Uploading failed! The book is existed!");
return "upload_failed2";
}
bookFile.transferTo(localBookFile);
String coverPath_pre = (String) PropertyConfigurer.getProperty("book_cover_path");
// String coverPath = coverPath_pre + typeNames.get(0) +
// "/" + typeNames.get(1) + "/" +
// bookHelper.getTitle() + ".jpg";
String coverPath = coverPath_pre + "/" +
bookHelper.getTitle() + ".jpg";
File localCoverFile = new File(coverPath);
coverFile.transferTo(localCoverFile);
logger.info("The book has uploaded to local path successfully!");
Book book = new Book();
book.setBook_title(bookHelper.getTitle());
book.setBook_author(bookHelper.getAuthor());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
Date date = dateFormat.parse(bookHelper.getPubYear());
book.setBook_pubYear(date);
book.setBook_summary(bookHelper.getSummary());
book.setType_id(type_id);
book.setBook_format(format);
book.setDownload_times(0);
book.setBook_file(filePath);
book.setBook_cover(coverPath);
dateFormat = new SimpleDateFormat("yyMMdd", Locale.CHINESE);
String pubDate = dateFormat.format(date);
String upDate = dateFormat.format(new Date());
int random = new Random().nextInt(900) + 100;
String idStr = "" + typeId + pubDate + upDate + random;
long bookID = Long.parseLong(idStr);
logger.info("The book id you uploaded is " + bookID);
book.setId(bookID);
bookService.uploadBook(book);
UserHelper userHelper = (UserHelper) session.getAttribute("userHelper") ;
bookService.updateRecords(userHelper.getId(),bookID);
userService.updateUserContribution(2,userHelper.getId());
model.addAttribute("bookID",bookID);
logger.info("you are coming to the uploading successful page!");
return "upload_success";
}
}
}
| [
"1048549613@qq.com"
] | 1048549613@qq.com |
78702da9255a0c1872f3247487cce630e94f0a9f | a12851888eec129f7d4aa6b350afbc9ff2aaf147 | /JABXKernel_V2.0/src/main/java/com/syt/jabx/kernel/ZJABXIPAndPortInfo.java | d96a6f0a7be8c76c6ade46cb37aaa5b83a2016f6 | [] | no_license | haojiehuang/space_api | 41f083309bbcb6e7028038efb6438253f9b10d53 | 318a3d44bf382e4ecfc3a431480d78c6c0aaf0c0 | refs/heads/master | 2022-12-03T12:23:51.866142 | 2020-08-16T15:26:31 | 2020-08-16T15:26:31 | 287,971,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 846 | java | package com.syt.jabx.kernel;
/**
* 主機代碼及埠號資訊
* @author Jason
*
*/
final class ZJABXIPAndPortInfo {
/**
* 主機代碼及埠號
*/
private String idAndPort;
/**
* 是否為指定的Server(1.回報主機,2.交易主機或3.GW主機)
*/
private boolean isAssignedServer;
/**
* Constructor
* @param idAndPort - String
* @param isAssignedServer - boolean
*/
public ZJABXIPAndPortInfo(String idAndPort, boolean isAssignedServer) {
this.idAndPort = idAndPort;
this.isAssignedServer = isAssignedServer;
}
/**
* 取得主機代碼及埠號
* @return String
*/
public String getIdAndPort() {
return this.idAndPort;
}
/**
* 是否為指定的Server(1.回報主機,2.交易主機或3.GW主機)
* @return boolean
*/
public boolean isAssignedServer() {
return isAssignedServer;
}
}
| [
"hao.jie@msa.hinet.net"
] | hao.jie@msa.hinet.net |
aaa91a393fd940ddd1fe556bfc90b4ba9a5fa6b8 | 37e7dd04696b15bc09616b5a41a1da081a1fa4ec | /sbasic_test/src/main/java/com/company/service/StepTxService.java | 0347acd0bd6327bffd59a389b40f75a35756a587 | [] | no_license | kimnewbie/spring | b8894775f7a5d81f0cf614f6308d0beef007b470 | 70b4af83ad761534c977e2aad62b465d2260998b | refs/heads/master | 2023-03-18T02:56:31.328170 | 2021-03-11T01:45:05 | 2021-03-11T01:45:05 | 346,535,410 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123 | java | package com.company.service;
public interface StepTxService {
public void addData(String value) throws Exception;
}
| [
"gracecancho@gmail.com"
] | gracecancho@gmail.com |
f06526e3fed6bf8853d47a9f2cfeb98eba36920a | b998472352eb38ed77da39df4e5b1e1471383446 | /cipher_Vigenère/src/main/Vigenere.java | 1b2288d4de41968e334fb446dbe4d691efe2f983 | [] | no_license | yonesko/edoC_2 | f12b13b0b8f471aceedca6be9c30b1f7c9b8304e | f4d677bcdc7f569126bba5c85605b7b5610cf2c1 | refs/heads/master | 2020-04-06T15:00:36.036476 | 2016-10-18T13:09:42 | 2016-10-18T13:09:42 | 46,075,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,369 | java | package main;
/**
* https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
*/
public class Vigenere {
public static void main(String[] args) {
String key = "качерыжка";
String text = "Привет, Люда!";
String ciphertext = encode(key, text);
String decodedText = decode(key, ciphertext);
System.out.println("text=" + text);
System.out.println("ciphertext=" + ciphertext);
System.out.println("decodedText=" + decodedText);
}
public static String decode(String key, String ciphertext) {
return op(key, ciphertext, false);
}
public static String encode(String key, String text) {
return op(key, text, true);
}
private static String op(String key, String text, boolean toEncode) {
StringBuilder result;
if (text == null || text.length() == 0 || key == null || key.length() == 0)
return text;
result = new StringBuilder(text.length());
char[] keyArray = key.toCharArray();
char[] charArray = text.toCharArray();
for (int i = 0; i < charArray.length; i++) {
char c = charArray[i];
result.append((char) (c + (toEncode ? 1 : -1) *
keyArray[i % keyArray.length] % Character.MAX_CODE_POINT));
}
return result.toString();
}
}
| [
"yonesko@gmail.com"
] | yonesko@gmail.com |
71be5b044baa1bcf5ddee9faf89ac470f6d073a9 | 51cf893b29e0025e86efc571a0b20fbbec43f744 | /LuBanOne/app/src/main/java/com/example/administrator/lubanone/fragment/task/ReviewingTaskFragment.java | 3389bd0c5bf7132ccbe6dc6b040d6c25e24631bb | [] | no_license | quyang-xianzaishi/mylib | 1dfc3c141347a8eee5ad831efab5e18fb9d9f726 | 4cabe396090d820a58e6917f16e57a69cc6485b9 | refs/heads/master | 2018-09-29T16:19:05.253246 | 2018-07-15T15:52:46 | 2018-07-15T15:52:46 | 111,664,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,637 | java | package com.example.administrator.lubanone.fragment.task;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import com.example.administrator.lubanone.Config;
import com.example.administrator.lubanone.MyApplication;
import com.example.administrator.lubanone.R;
import com.example.administrator.lubanone.activity.task.TaskDetailsActivity;
import com.example.administrator.lubanone.adapter.task.TaskCommonListAdapter;
import com.example.administrator.lubanone.bean.model.TaskModel;
import com.example.administrator.lubanone.fragment.BaseFragment;
import com.example.administrator.lubanone.rxjava.BaseModelFunc;
import com.example.administrator.lubanone.rxjava.MySubscriber;
import com.example.administrator.lubanone.utils.HouLog;
import com.example.administrator.lubanone.utils.HouToast;
import com.example.qlibrary.utils.SPUtils;
import com.jingchen.pulltorefresh.PullToRefreshLayout;
import com.jingchen.pulltorefresh.PullToRefreshLayout.OnPullListener;
import com.jingchen.pulltorefresh.PullableImageView;
import com.jingchen.pulltorefresh.PullableListView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Created by hou on 2017/8/24.
*/
public class ReviewingTaskFragment extends BaseFragment {
private static final String TAG = "ReviewingTaskFragment";
private PullToRefreshLayout noDataLayout, listLayout;
private PullableImageView noDataImage;
private PullableListView mListView;
private TaskCommonListAdapter mAdapter;
private List<TaskModel.TaskList> datas;
private int pageNo = 1;
@Override
public View initView() {
View view = mInflater.inflate(R.layout.fragment_task_common, null);
noDataImage = (PullableImageView) view.findViewById(R.id.task_common_no_data_image);
noDataLayout = (PullToRefreshLayout) view.findViewById(R.id.task_common_no_data_layout);
listLayout = (PullToRefreshLayout) view.findViewById(R.id.task_common_list_layout);
mListView = (PullableListView) view.findViewById(R.id.task_common_list_view);
MyRefreshListener myRefreshListener = new MyRefreshListener();
noDataLayout.setOnPullListener(myRefreshListener);
noDataLayout.setPullUpEnable(false);
listLayout.setOnPullListener(myRefreshListener);
listLayout.setPullDownEnable(true);
listLayout.setPullUpEnable(true);
datas = new ArrayList<>();
mAdapter = new TaskCommonListAdapter(mActivity, datas);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(getActivity(), TaskDetailsActivity.class);
intent.putExtra("if_id", datas.get(position).getTaskid());
startActivity(intent);
}
});
return view;
}
class MyRefreshListener implements OnPullListener {
@Override
public void onRefresh(PullToRefreshLayout pullToRefreshLayout) {
pageNo = 1;
getDataFromServer(pullToRefreshLayout);
}
@Override
public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) {
pageNo++;
getDataFromServer(pullToRefreshLayout);
}
}
@Override
public void onResume() {
super.onResume();
pageNo = 1;
getDataFromServer(listLayout);
}
private void getDataFromServer(final PullToRefreshLayout refreshLayout) {
Subscriber subscriber = new MySubscriber<TaskModel>(getActivity()) {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
super.onError(e);
noDataLayout.setVisibility(View.VISIBLE);
noDataImage.setImageResource(R.drawable.loading_fail);
refreshLayout.refreshFinish(PullToRefreshLayout.FAIL);
HouLog.d(TAG + "审核中任务列表onError", e.toString());
}
@Override
public void onNext(TaskModel taskModel) {
noDataLayout.setVisibility(View.GONE);
refreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
if (pageNo == 1) {
datas.clear();
}
if (taskModel != null && taskModel.getTasklist() != null
&& taskModel.getTasklist().size() > 0) {
datas.addAll(taskModel.getTasklist());
HouLog.d(TAG, "返回数据个数: " + taskModel.getTasklist().size());
HouLog.d(TAG, "列表数据个数: " + datas.size());
} else {
if (pageNo > 1) {
HouToast.showLongToast(getActivity(), getInfo(R.string.no_more_message));
pageNo--;
} else {
noDataImage.setImageResource(R.drawable.no_data);
noDataLayout.setVisibility(View.VISIBLE);
}
}
mAdapter.notifyDataSetChanged();
HouLog.d(TAG + "页数:", String.valueOf(pageNo));
}
};
Map<String, String> params = new HashMap<>();
params.put("token", SPUtils.getStringValue(mActivity, Config.USER_INFO, Config.TOKEN, ""));
params.put("page", String.valueOf(pageNo));
params.put("type", "1");
HouLog.d(TAG, "任务列表.审核中任务参数:" + params.toString());
MyApplication.rxNetUtils.getTaskService().getTaskListTwo(params)
.map(new BaseModelFunc<TaskModel>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(subscriber);
}
@Override
public void initData() {
}
}
| [
"quyang@xianzaishi.com"
] | quyang@xianzaishi.com |
5d57b3abc446c96ce631bdf15e5a969845637f30 | 6c35be42024264f9dde2ff51d226563512118e25 | /Grunnl.prog/JavaLib/Leksjon 5/Tallanalyse.java | d695f005b3b491336507ef43263548678366a33e | [] | no_license | BertBert0/ForsteAar | e7246c3aaa8a7f009a14fbc2d041b4e76ecfb3f5 | ea9fc7d4ed11d0a6be9e84e399dbfc81b765b04c | refs/heads/master | 2021-09-03T11:11:05.303664 | 2018-01-08T15:19:21 | 2018-01-08T15:19:21 | 112,359,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,476 | java | import static java.lang.System.*;
import static java.lang.Integer.*; //Trenger parseInt
import static java.lang.Double.*; //Trenger parseDouble
import static javax.swing.JOptionPane.*;
public class Tallanalyse {
public static void main(String[] args) {
String aTekstTall = showInputDialog("Gi et antall tall!");
int aTall = parseInt(aTekstTall);
int[] tall = new int[aTall];
for(int i = 0; i<tall.length; i++){
tall[i] = trekkTall(1,10);
}
//int[] tall = {10, 1, 10, 3, 9, 8, 10, 6, 2, 1};
String tallTekst = "Tallene er: ";
for(int i = 0; i<tall.length; i++){
tallTekst+=(tall[i] + " ");
}
out.println(tallTekst);
int sum=0;
for(int i = 0; i<tall.length; i++){
sum += tall[i];
}
int snitt = sum/tall.length;
out.println("Snittet er: " + snitt);
boolean boo = false;
int pos = 0;
while (!boo && pos < tall.length)
if (tall[pos] == snitt)
boo = true;
else pos++;
String svar ="";
if (boo == true)
svar ="Ja.";
else
svar = "Nei.";
/*for(int i = 0; i<tall.length; i++){
if (tall[i] == snitt)
boo = true;
continue;
}*/
out.println("Snittet er en verdi i tallsettet: " + svar);
String små = "Tall mindre enn 6: " ;
for(int i = 0; i<tall.length; i++){
if (tall[i]<6)
små+=(tall[i] + " ");
}
out.println(små);
// Skriv Java-setninger her
}
// Metode for å trekke et tilfeldig heltall i området min - max
private static int trekkTall(int min, int max) {
return min + (int)( Math.random()*(max-min+1) );
}
} | [
"31742102+BertBert0@users.noreply.github.com"
] | 31742102+BertBert0@users.noreply.github.com |
b709954465302cb5e04b345102083699d82862fd | 3e51c0ea341b986e57a00d347c1bbfb55f5fce89 | /src/test/com/demiashkevich/xmlparser/parser/ParserBuilderCheck.java | 010134c26e7b0911689f730037b134a23d6e8020 | [] | no_license | Demiashkevich/Task5.0 | 5856d026c76f5fd2e6622d9f9e03b37cf41b7ac1 | 6a6c9aaecdf5e8c5ec0d81f8db8ae7b768b08913 | refs/heads/master | 2020-07-02T22:06:57.571565 | 2016-11-21T21:28:05 | 2016-11-21T21:28:05 | 74,280,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | package com.demiashkevich.xmlparser.parser;
import org.junit.Test;
public class ParserBuilderCheck {
private static final String pathFileNotExist = "data/old.xml";
@Test(expected = RuntimeException.class)
public void saxBuilderCheck(){
OldCardStAXBuilder saxBuilder = new OldCardStAXBuilder();
saxBuilder.buildSetCards(pathFileNotExist);
}
@Test(expected = RuntimeException.class)
public void domBuilderCheck(){
OldCardDOMBuilder domBuilder = new OldCardDOMBuilder();
domBuilder.buildSetCards(pathFileNotExist);
}
@Test(expected = RuntimeException.class)
public void stAXBuilderCheck(){
OldCardStAXBuilder stAXBuilder = new OldCardStAXBuilder();
stAXBuilder.buildSetCards(pathFileNotExist);
}
}
| [
"demiashkevich@mail.ru"
] | demiashkevich@mail.ru |
ed69fe4e792c4a7e5e6fd271a6d6563a97475f09 | 923397090df54d1c2c99c4ca353a67ec712d8e5a | /scheduler/src/main/java/com/sahm/scheduler/controllers/EventInfoController.java | 4f314dbb64917ae1af213b133efe34e7f3cd1a5f | [] | no_license | bmorris98/Capstone-SAHSchedulingSystem | c4b12753915d72bc7d81f0a55d7fd830bf84927d | 54a7eb0664a72ec8c5677592d838dc9c89207f48 | refs/heads/master | 2021-01-01T07:25:02.155597 | 2020-04-11T22:50:09 | 2020-04-11T22:50:09 | 239,169,568 | 1 | 0 | null | 2020-02-08T17:02:46 | 2020-02-08T17:02:45 | null | UTF-8 | Java | false | false | 438 | java | package com.sahm.scheduler.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class EventInfoController {
@RequestMapping(value="/eventinfo", method=RequestMethod.GET)
public String eventInfoPage(Model model) {
return "eventinfo";
}
}
| [
"adam.publicover@georgebrown.ca"
] | adam.publicover@georgebrown.ca |
d60d5aa9c0192c1b509d246e15e401d1459fd519 | 5c829bbc1a55beca334b65f11fcd737ed647c143 | /src/main/java/ru/myachin/innerclasses/AnonymousInstance.java | a7d2e0d9b594f4db4b91f8ff3732ca1fc3d6831e | [] | no_license | TFhide/ThinkingInJava | 89585f254d97eadf2aad10accd09be171b0650a9 | 3f6a66bf8dc4a43375e9b53bc2cd7a92af65c464 | refs/heads/master | 2023-03-20T02:43:24.437128 | 2019-03-02T00:02:34 | 2019-03-02T00:02:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,088 | java | package ru.myachin.innerclasses;
/**
* 15. Создайте класс, не содержащий конструктор по умолчанию (конструктор без аргументов). При этом класс должен
* содержать конструктор, получающий аргументы. Создайте второй класс с методом, который возвращает ссылку на объект
* первого класса. Возвращаемый объект должен создаваться посредством анонимного внутреннего класса, производного от
* первого.
*/
public class AnonymousInstance {
public static void main(String[] args) {
new Second().getAnonymous();
}
}
class WithOutDefaultConstructor {
public WithOutDefaultConstructor(int i) {
System.out.println("Constructor argument = " + i);
}
}
class Second {
WithOutDefaultConstructor getAnonymous() {
return new WithOutDefaultConstructor(5);
}
} | [
"Konstantin.Myachin@ocrv.ru"
] | Konstantin.Myachin@ocrv.ru |
99b2e5d5d2db80d43cce63ad4d802496c129809e | 837f5b201ad30d4ead883098e3009f3a7324bd34 | /src/main/java/br/com/conductor/pier/api/v2/model/AuthToken.java | 69073df94199332265aa93117f66ca5f2710c0d4 | [] | no_license | rafaelchei/pier-sdk-java | 1c362d869dca233cc6408ae65a149bd8f79d9304 | e0dbe0a58e50d8235724496fd96f2e5781a84bbf | refs/heads/master | 2021-05-15T16:06:35.663445 | 2017-10-18T17:02:51 | 2017-10-18T17:02:51 | 107,436,451 | 0 | 0 | null | 2017-10-18T16:47:12 | 2017-10-18T16:47:12 | null | UTF-8 | Java | false | false | 3,872 | java | package br.com.conductor.pier.api.v2.model;
import java.util.Objects;
import br.com.conductor.pier.api.v2.model.ExtraInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen")
public class AuthToken {
private String code = null;
private ExtraInfo extraInfo = null;
private Integer id = null;
private String owner = null;
public enum StatusEnum {
ACTIVE("ACTIVE"),
REVOKED("REVOKED"),
DELETED("DELETED");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return value;
}
}
private StatusEnum status = null;
/**
**/
public AuthToken code(String code) {
this.code = code;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("code")
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
/**
**/
public AuthToken extraInfo(ExtraInfo extraInfo) {
this.extraInfo = extraInfo;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("extraInfo")
public ExtraInfo getExtraInfo() {
return extraInfo;
}
public void setExtraInfo(ExtraInfo extraInfo) {
this.extraInfo = extraInfo;
}
/**
**/
public AuthToken id(Integer id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
/**
**/
public AuthToken owner(String owner) {
this.owner = owner;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("owner")
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
/**
**/
public AuthToken status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AuthToken authToken = (AuthToken) o;
return Objects.equals(this.code, authToken.code) &&
Objects.equals(this.extraInfo, authToken.extraInfo) &&
Objects.equals(this.id, authToken.id) &&
Objects.equals(this.owner, authToken.owner) &&
Objects.equals(this.status, authToken.status);
}
@Override
public int hashCode() {
return Objects.hash(code, extraInfo, id, owner, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AuthToken {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" extraInfo: ").append(toIndentedString(extraInfo)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"filipe.germano@conductor.com.br"
] | filipe.germano@conductor.com.br |
fb9d92bddc3b389d6199c314169ea5fe31ecf71e | 94243e15cfe9cccdf3638d53527fa58327efac29 | /habeascorpus_tokens/batik-1.7/sources/org/apache/batik/gvt/flow/GlyphGroupInfo.java | d67d5c7e0ad0a820428792fd897ffb091d3d3e4b | [] | no_license | habeascorpus/habeascorpus-data-withComments | 4e0193450273f2d46ea9ef497746aaf93b5fc491 | 3a516954b42b24c93a8d1e292ff0a0907bed97ad | refs/heads/master | 2021-01-20T21:53:35.264690 | 2015-05-22T14:59:36 | 2015-05-22T14:59:36 | 18,139,450 | 3 | 1 | null | 2023-03-20T11:51:26 | 2014-03-26T13:45:05 | Java | UTF-8 | Java | false | false | 14,469 | 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. */ TokenNameCOMMENT_BLOCK 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 TokenNamepackage
org TokenNameIdentifier org
. TokenNameDOT
apache TokenNameIdentifier apache
. TokenNameDOT
batik TokenNameIdentifier batik
. TokenNameDOT
gvt TokenNameIdentifier gvt
. TokenNameDOT
flow TokenNameIdentifier flow
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier org
. TokenNameDOT
apache TokenNameIdentifier apache
. TokenNameDOT
batik TokenNameIdentifier batik
. TokenNameDOT
gvt TokenNameIdentifier gvt
. TokenNameDOT
font TokenNameIdentifier font
. TokenNameDOT
GVTGlyphVector TokenNameIdentifier GVT Glyph Vector
; TokenNameSEMICOLON
/** * One line Class Desc * * Complete Class Desc * * @author <a href="mailto:deweese@apache.org">deweese</a> * @version $Id: GlyphGroupInfo.java 475477 2006-11-15 22:44:28Z cam $ */ TokenNameCOMMENT_JAVADOC One line Class Desc * Complete Class Desc * @author <a href="mailto:deweese@apache.org">deweese</a> @version $Id: GlyphGroupInfo.java 475477 2006-11-15 22:44:28Z cam $
class TokenNameclass
GlyphGroupInfo TokenNameIdentifier Glyph Group Info
{ TokenNameLBRACE
int TokenNameint
start TokenNameIdentifier start
, TokenNameCOMMA
end TokenNameIdentifier end
; TokenNameSEMICOLON
int TokenNameint
glyphCount TokenNameIdentifier glyph Count
, TokenNameCOMMA
lastGlyphCount TokenNameIdentifier last Glyph Count
; TokenNameSEMICOLON
boolean TokenNameboolean
hideLast TokenNameIdentifier hide Last
; TokenNameSEMICOLON
float TokenNamefloat
advance TokenNameIdentifier advance
, TokenNameCOMMA
lastAdvance TokenNameIdentifier last Advance
; TokenNameSEMICOLON
int TokenNameint
range TokenNameIdentifier range
; TokenNameSEMICOLON
GVTGlyphVector TokenNameIdentifier GVT Glyph Vector
gv TokenNameIdentifier gv
; TokenNameSEMICOLON
boolean TokenNameboolean
[ TokenNameLBRACKET
] TokenNameRBRACKET
hide TokenNameIdentifier hide
; TokenNameSEMICOLON
public TokenNamepublic
GlyphGroupInfo TokenNameIdentifier Glyph Group Info
( TokenNameLPAREN
GVTGlyphVector TokenNameIdentifier GVT Glyph Vector
gv TokenNameIdentifier gv
, TokenNameCOMMA
int TokenNameint
start TokenNameIdentifier start
, TokenNameCOMMA
int TokenNameint
end TokenNameIdentifier end
, TokenNameCOMMA
boolean TokenNameboolean
[ TokenNameLBRACKET
] TokenNameRBRACKET
glyphHide TokenNameIdentifier glyph Hide
, TokenNameCOMMA
boolean TokenNameboolean
glyphGroupHideLast TokenNameIdentifier glyph Group Hide Last
, TokenNameCOMMA
float TokenNamefloat
[ TokenNameLBRACKET
] TokenNameRBRACKET
glyphPos TokenNameIdentifier glyph Pos
, TokenNameCOMMA
float TokenNamefloat
[ TokenNameLBRACKET
] TokenNameRBRACKET
advAdj TokenNameIdentifier adv Adj
, TokenNameCOMMA
float TokenNamefloat
[ TokenNameLBRACKET
] TokenNameRBRACKET
lastAdvAdj TokenNameIdentifier last Adv Adj
, TokenNameCOMMA
boolean TokenNameboolean
[ TokenNameLBRACKET
] TokenNameRBRACKET
space TokenNameIdentifier space
) TokenNameRPAREN
{ TokenNameLBRACE
this TokenNamethis
. TokenNameDOT
gv TokenNameIdentifier gv
= TokenNameEQUAL
gv TokenNameIdentifier gv
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
start TokenNameIdentifier start
= TokenNameEQUAL
start TokenNameIdentifier start
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
end TokenNameIdentifier end
= TokenNameEQUAL
end TokenNameIdentifier end
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
hide TokenNameIdentifier hide
= TokenNameEQUAL
new TokenNamenew
boolean TokenNameboolean
[ TokenNameLBRACKET
this TokenNamethis
. TokenNameDOT
end TokenNameIdentifier end
- TokenNameMINUS
this TokenNamethis
. TokenNameDOT
start TokenNameIdentifier start
+ TokenNamePLUS
1 TokenNameIntegerLiteral
] TokenNameRBRACKET
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
hideLast TokenNameIdentifier hide Last
= TokenNameEQUAL
glyphGroupHideLast TokenNameIdentifier glyph Group Hide Last
; TokenNameSEMICOLON
System TokenNameIdentifier System
. TokenNameDOT
arraycopy TokenNameIdentifier arraycopy
( TokenNameLPAREN
glyphHide TokenNameIdentifier glyph Hide
, TokenNameCOMMA
this TokenNamethis
. TokenNameDOT
start TokenNameIdentifier start
, TokenNameCOMMA
this TokenNamethis
. TokenNameDOT
hide TokenNameIdentifier hide
, TokenNameCOMMA
0 TokenNameIntegerLiteral
, TokenNameCOMMA
this TokenNamethis
. TokenNameDOT
hide TokenNameIdentifier hide
. TokenNameDOT
length TokenNameIdentifier length
) TokenNameRPAREN
; TokenNameSEMICOLON
float TokenNamefloat
adv TokenNameIdentifier adv
= TokenNameEQUAL
glyphPos TokenNameIdentifier glyph Pos
[ TokenNameLBRACKET
2 TokenNameIntegerLiteral
* TokenNameMULTIPLY
end TokenNameIdentifier end
+ TokenNamePLUS
2 TokenNameIntegerLiteral
] TokenNameRBRACKET
- TokenNameMINUS
glyphPos TokenNameIdentifier glyph Pos
[ TokenNameLBRACKET
2 TokenNameIntegerLiteral
* TokenNameMULTIPLY
start TokenNameIdentifier start
] TokenNameRBRACKET
; TokenNameSEMICOLON
float TokenNamefloat
ladv TokenNameIdentifier ladv
= TokenNameEQUAL
adv TokenNameIdentifier adv
; TokenNameSEMICOLON
adv TokenNameIdentifier adv
+= TokenNamePLUS_EQUAL
advAdj TokenNameIdentifier adv Adj
[ TokenNameLBRACKET
end TokenNameIdentifier end
] TokenNameRBRACKET
; TokenNameSEMICOLON
int TokenNameint
glyphCount TokenNameIdentifier glyph Count
= TokenNameEQUAL
end TokenNameIdentifier end
- TokenNameMINUS
start TokenNameIdentifier start
+ TokenNamePLUS
1 TokenNameIntegerLiteral
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
g TokenNameIdentifier g
= TokenNameEQUAL
start TokenNameIdentifier start
; TokenNameSEMICOLON
g TokenNameIdentifier g
< TokenNameLESS
end TokenNameIdentifier end
; TokenNameSEMICOLON
g TokenNameIdentifier g
++ TokenNamePLUS_PLUS
) TokenNameRPAREN
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
glyphHide TokenNameIdentifier glyph Hide
[ TokenNameLBRACKET
g TokenNameIdentifier g
] TokenNameRBRACKET
) TokenNameRPAREN
glyphCount TokenNameIdentifier glyph Count
-- TokenNameMINUS_MINUS
; TokenNameSEMICOLON
} TokenNameRBRACE
int TokenNameint
lastGlyphCount TokenNameIdentifier last Glyph Count
= TokenNameEQUAL
glyphCount TokenNameIdentifier glyph Count
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
g TokenNameIdentifier g
= TokenNameEQUAL
end TokenNameIdentifier end
; TokenNameSEMICOLON
g TokenNameIdentifier g
>= TokenNameGREATER_EQUAL
start TokenNameIdentifier start
; TokenNameSEMICOLON
g TokenNameIdentifier g
-- TokenNameMINUS_MINUS
) TokenNameRPAREN
{ TokenNameLBRACE
ladv TokenNameIdentifier ladv
+= TokenNamePLUS_EQUAL
lastAdvAdj TokenNameIdentifier last Adv Adj
[ TokenNameLBRACKET
g TokenNameIdentifier g
] TokenNameRBRACKET
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
! TokenNameNOT
space TokenNameIdentifier space
[ TokenNameLBRACKET
g TokenNameIdentifier g
] TokenNameRBRACKET
) TokenNameRPAREN
break TokenNamebreak
; TokenNameSEMICOLON
lastGlyphCount TokenNameIdentifier last Glyph Count
-- TokenNameMINUS_MINUS
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
hideLast TokenNameIdentifier hide Last
) TokenNameRPAREN
lastGlyphCount TokenNameIdentifier last Glyph Count
-- TokenNameMINUS_MINUS
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
glyphCount TokenNameIdentifier glyph Count
= TokenNameEQUAL
glyphCount TokenNameIdentifier glyph Count
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
lastGlyphCount TokenNameIdentifier last Glyph Count
= TokenNameEQUAL
lastGlyphCount TokenNameIdentifier last Glyph Count
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
advance TokenNameIdentifier advance
= TokenNameEQUAL
adv TokenNameIdentifier adv
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
lastAdvance TokenNameIdentifier last Advance
= TokenNameEQUAL
ladv TokenNameIdentifier ladv
; TokenNameSEMICOLON
} TokenNameRBRACE
/** * Get the GlyphVector for this GlyphGroup. */ TokenNameCOMMENT_JAVADOC Get the GlyphVector for this GlyphGroup.
public TokenNamepublic
GVTGlyphVector TokenNameIdentifier GVT Glyph Vector
getGlyphVector TokenNameIdentifier get Glyph Vector
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
gv TokenNameIdentifier gv
; TokenNameSEMICOLON
} TokenNameRBRACE
/** get the start glyph index for this glyph group. */ TokenNameCOMMENT_JAVADOC get the start glyph index for this glyph group.
public TokenNamepublic
int TokenNameint
getStart TokenNameIdentifier get Start
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
start TokenNameIdentifier start
; TokenNameSEMICOLON
} TokenNameRBRACE
/** get the end glyph index for this glyph group. */ TokenNameCOMMENT_JAVADOC get the end glyph index for this glyph group.
public TokenNamepublic
int TokenNameint
getEnd TokenNameIdentifier get End
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
end TokenNameIdentifier end
; TokenNameSEMICOLON
} TokenNameRBRACE
/** get the number of glyphs that count when it's not the * last in the line (basically end-start+1-sum(hide) ). */ TokenNameCOMMENT_JAVADOC get the number of glyphs that count when it's not the last in the line (basically end-start+1-sum(hide) ).
public TokenNamepublic
int TokenNameint
getGlyphCount TokenNameIdentifier get Glyph Count
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
glyphCount TokenNameIdentifier glyph Count
; TokenNameSEMICOLON
} TokenNameRBRACE
/** get the number of glyphs that 'cout' when it is the * last in the line. This is glyphCount minus any * trailing spaces, and minus the last glyph if hideLast * is true. */ TokenNameCOMMENT_JAVADOC get the number of glyphs that 'cout' when it is the last in the line. This is glyphCount minus any trailing spaces, and minus the last glyph if hideLast is true.
public TokenNamepublic
int TokenNameint
getLastGlyphCount TokenNameIdentifier get Last Glyph Count
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
lastGlyphCount TokenNameIdentifier last Glyph Count
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
boolean TokenNameboolean
[ TokenNameLBRACKET
] TokenNameRBRACKET
getHide TokenNameIdentifier get Hide
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
hide TokenNameIdentifier hide
; TokenNameSEMICOLON
} TokenNameRBRACE
/** return true if 'end' glyph should be hidden in cases * where this is not the last glyph group in a span */ TokenNameCOMMENT_JAVADOC return true if 'end' glyph should be hidden in cases where this is not the last glyph group in a span
public TokenNamepublic
boolean TokenNameboolean
getHideLast TokenNameIdentifier get Hide Last
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
hideLast TokenNameIdentifier hide Last
; TokenNameSEMICOLON
} TokenNameRBRACE
/** * returns the advance to use when this glyphGroup is * not the last glyph group in a span. */ TokenNameCOMMENT_JAVADOC returns the advance to use when this glyphGroup is not the last glyph group in a span.
public TokenNamepublic
float TokenNamefloat
getAdvance TokenNameIdentifier get Advance
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
advance TokenNameIdentifier advance
; TokenNameSEMICOLON
} TokenNameRBRACE
/** * returns the advance to use when this glyphGroup is * the last glyph group in a span. This generally includes * the width of the last glyph if 'HideLast' is true. Also * in Japanese some glyphs should not be counted for line * width (they may go outside the flow area). */ TokenNameCOMMENT_JAVADOC returns the advance to use when this glyphGroup is the last glyph group in a span. This generally includes the width of the last glyph if 'HideLast' is true. Also in Japanese some glyphs should not be counted for line width (they may go outside the flow area).
public TokenNamepublic
float TokenNamefloat
getLastAdvance TokenNameIdentifier get Last Advance
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
lastAdvance TokenNameIdentifier last Advance
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
void TokenNamevoid
setRange TokenNameIdentifier set Range
( TokenNameLPAREN
int TokenNameint
range TokenNameIdentifier range
) TokenNameRPAREN
{ TokenNameLBRACE
this TokenNamethis
. TokenNameDOT
range TokenNameIdentifier range
= TokenNameEQUAL
range TokenNameIdentifier range
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
int TokenNameint
getRange TokenNameIdentifier get Range
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
this TokenNamethis
. TokenNameDOT
range TokenNameIdentifier range
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
| [
"dma@cs.cmu.edu"
] | dma@cs.cmu.edu |
998557504feea82be8e1df67a318353b6f70609a | 7e6efae7440f187278aecc368a066751923b04d9 | /Ejercicios/Tema5/E40/Ejercicio40.java | e6dae47a12abb9c5a24f144721c2100344cae736 | [] | no_license | NachoEspejo/ejercicios-programacion | fa94f54383cf6e0527e2135292efbc3eb17731e7 | e5de8bbc6491bde354b3b2a7d50655f24878acca | refs/heads/master | 2021-09-06T22:02:55.235684 | 2018-02-12T09:44:14 | 2018-02-12T09:44:14 | 105,648,536 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,115 | java | /**
*Ejercicio 40
*Realiza un programa que pinte por pantalla un rombo hueco hecho con
*asteriscos. El programa debe pedir la altura. Se debe comprobar que la altura
*sea un número impar mayor o igual a 3, en caso contrario se debe mostrar un
*mensaje de error.
*Ejemplo:
*Por favor, introduzca la altura del rombo: 5
*/
public class Ejercicio40 {
public static void main(String[] args) {
System.out.print("Introduce la altura del rombo: ");
int alturaIntroducida = Integer.parseInt(System.console().readLine());
int espaciosInternos = 0;
int espaciosPorDelante = alturaIntroducida / 2;
if ((alturaIntroducida < 3) || (alturaIntroducida % 2 == 0)) {
System.out.print("Parece ser que tu compresión lectrora está fallando, la altura introducida deber ser un número impar mayor o igual a 3");
} else {
int altura = 1;
while (altura <= alturaIntroducida / 2 + 1) {
// inserta espacios delante
for (int i = 1; i <= espaciosPorDelante; i++) {
System.out.print(" ");
}
// pinta la línea
System.out.print("*");
for (int i = 1; i < espaciosInternos; i++) {
System.out.print(" ");
}
if (altura>1) {
System.out.print("*");
}
System.out.println();
altura++;
espaciosPorDelante--;
espaciosInternos+=2;
}
espaciosInternos = alturaIntroducida - 3;
espaciosPorDelante = 1;
altura = 0;
while (altura < alturaIntroducida / 2) {
// inserta espacios delante
for (int i = 1; i <= espaciosPorDelante; i++) {
System.out.print(" ");
}
// pinta la línea
System.out.print("*");
for (int i = 1; i < espaciosInternos; i++) {
System.out.print(" ");
}
if(altura < alturaIntroducida / 2 - 1) {
System.out.print("*");
}
System.out.println();
altura++;
espaciosPorDelante++;
espaciosInternos -= 2;
}
}
}
}
| [
"neg1999@hotmail.com"
] | neg1999@hotmail.com |
27ecb2ea62e5d6a9d2dfbc69f758c71775a8a6c5 | 3a2772984fe006db61f66217429922c1dd64f8a2 | /src/ex5/MatchParenthesis.java | 3091f2b92409c67971a6c01d9ee2b5be0eabe785 | [] | no_license | liziwl/Data-Structure | bfa57b7cc8c86270bf5ef4029dfdc3b370ddba7c | 67374c6c94c984c0eb4b5cad2f9962e1fb5a419d | refs/heads/master | 2021-09-01T12:30:22.053114 | 2017-12-27T01:38:57 | 2017-12-27T01:38:57 | 96,849,444 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 75 | java | package ex5;
public class MatchParenthesis {
public StackofList par;
}
| [
"lizisy@hotmail.com"
] | lizisy@hotmail.com |
7123ba82613b4fb3203b84335c36b77bcf459265 | 6712042818973220342b33df2b47f206b1ff3484 | /sample/src/main/java/example/reamp/lifecycle/LongRunningPresenter.java | 21bda8dbf16a3d887f1d06159e66a6d8dcbff5f6 | [
"MIT"
] | permissive | eastbanctechru/Reamp | aa9389da2d037488b8eb73b463162e8ac3aa06fc | 5559104d33fb6f97ec66a45db7f474bb6a04b2c9 | refs/heads/master | 2021-01-16T21:29:45.799827 | 2018-04-27T17:55:23 | 2018-04-27T17:55:23 | 100,231,191 | 56 | 11 | null | 2020-04-28T02:46:01 | 2017-08-14T05:27:35 | Java | UTF-8 | Java | false | false | 1,272 | java | package example.reamp.lifecycle;
import android.util.Log;
import java.util.concurrent.TimeUnit;
import etr.android.reamp.mvp.ReampPresenter;
import rx.Observable;
import rx.Subscription;
import rx.functions.Action1;
public class LongRunningPresenter extends ReampPresenter<RunningState> {
private final int intervalMs;
private final String tag;
private Subscription subscription;
public LongRunningPresenter(int intervalMs, String tag) {
this.intervalMs = intervalMs;
this.tag = tag;
}
@Override
public void onPresenterCreated() {
super.onPresenterCreated();
subscription = Observable.interval(intervalMs, TimeUnit.MILLISECONDS)
.subscribe(new Action1<Long>() {
@Override
public void call(Long aLong) {
Log.d(tag, "call: " + aLong);
getStateModel().times = aLong;
sendStateModel();
}
});
}
//this is called when the user completely leaves the screen
//for instance, by pressing the back button
@Override
public void onDestroyPresenter() {
super.onDestroyPresenter();
subscription.unsubscribe();
}
}
| [
"forcelain@gmail.com"
] | forcelain@gmail.com |
87e733ef5febc233d255df31cc9d1db02a96fec1 | b2df4e06bc1c2562fa9806b6536edbda5a01ab9f | /src/com/android/kit/contacttypes/ContactTypeRegistry.java | dc4962fffe8b87f6e7209b7ee0b71d387ecd3020 | [] | no_license | roblim10/kit | b628af7ab2b84f9fbacc97bc0c55c7038e19fe43 | f2c1463d6dc857c8af77807c405f785f9bd2ae54 | refs/heads/master | 2021-01-10T21:07:16.176936 | 2014-11-03T01:12:18 | 2014-11-03T01:12:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 966 | java | package com.android.kit.contacttypes;
import java.util.Collections;
import java.util.List;
import android.content.Context;
import com.google.common.collect.Lists;
public class ContactTypeRegistry {
private final List<ContactType> contactTypes;
private final int defaultFlag;
public ContactTypeRegistry(Context context, List<ContactType> contactTypes) {
this.contactTypes = Lists.newArrayList(contactTypes);
this.defaultFlag = calculateDefaultFlag();
registerReceivers(context);
}
private int calculateDefaultFlag() {
int flag = 0;
for (ContactType type : contactTypes) {
flag |= type.isDefaultSelected() ? type.getFlag() : 0;
}
return flag;
}
private void registerReceivers(Context context) {
for (final ContactType type : contactTypes) {
type.register();
}
}
public List<ContactType> getTypes() {
return Collections.unmodifiableList(contactTypes);
}
public int getDefaultFlag() {
return defaultFlag;
}
}
| [
"rlim@palantir.com"
] | rlim@palantir.com |
0b10165a1801b0343442fc6af295b583b0dd10bd | 4b849c733d0d5700c236993e1e5f5717d352f8d8 | /com/syntax/class06/HandlingAlert1.java | 7a012ef5adb64110bf5be931def8a4b07d9fa63d | [] | no_license | SlimemobX/Selenium | ae1eea5cbd458cc28ff4bf2e609d1291333da8c1 | e1634e30f91dbf9f61ebd06e96e8eeffee0f6071 | refs/heads/master | 2022-12-15T10:03:44.639942 | 2020-09-02T01:43:19 | 2020-09-02T01:43:19 | 283,355,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package com.syntax.class06;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class HandlingAlert1 {
public static String url = "http://www.uitestpractice.com/Students/Switchto";
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get(url);
WebElement confirmationAlertButton = driver.findElement(By.id("confirm"));
confirmationAlertButton.click();
Thread.sleep(5000);
// Alert confirmAlert = driver.switchTo().alert();
// confirmAlert.dismiss();
Alert alert = driver.switchTo().alert();
String confirmAlertText = alert.getText();
System.out.println(confirmAlertText);
// handling confirmation alert
alert.dismiss();
WebElement promptAlertButton = driver.findElement(By.id("prompt"));
promptAlertButton.click();
Thread.sleep(5000);
alert.sendKeys("Syntax");
Thread.sleep(5000);
alert.accept();
}
}
| [
"ferrufino2@gmail.com"
] | ferrufino2@gmail.com |
635afc9464a972bbffefea7eb86656eb46d5d11b | 583f356b4b57fa8358f9efbb9476677d54dfc504 | /src/uts/wsd/soap/client/Team23SoapProxy.java | 946057874e7715540521204a7689822d117a6ab8 | [] | no_license | juan871003/UTS_WSD_team23 | 39cfe4f17f1def34b0f722cd2d199f30e6649407 | 8b1ca4f3afb00095287561c80e24b81a03413a65 | refs/heads/master | 2020-12-24T18:42:12.081357 | 2016-05-30T05:15:17 | 2016-05-30T05:15:17 | 58,357,955 | 0 | 0 | null | 2016-05-30T08:56:10 | 2016-05-09T07:41:16 | Java | UTF-8 | Java | false | false | 2,226 | java | package uts.wsd.soap.client;
public class Team23SoapProxy implements uts.wsd.soap.client.Team23Soap {
private String _endpoint = null;
private uts.wsd.soap.client.Team23Soap team23Soap = null;
public Team23SoapProxy() {
_initTeam23SoapProxy();
}
public Team23SoapProxy(String endpoint) {
_endpoint = endpoint;
_initTeam23SoapProxy();
}
private void _initTeam23SoapProxy() {
try {
team23Soap = (new uts.wsd.soap.client.Team23SoapServiceLocator()).getTeam23SoapPort();
if (team23Soap != null) {
if (_endpoint != null)
((javax.xml.rpc.Stub)team23Soap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
else
_endpoint = (String)((javax.xml.rpc.Stub)team23Soap)._getProperty("javax.xml.rpc.service.endpoint.address");
}
}
catch (javax.xml.rpc.ServiceException serviceException) {}
}
public String getEndpoint() {
return _endpoint;
}
public void setEndpoint(String endpoint) {
_endpoint = endpoint;
if (team23Soap != null)
((javax.xml.rpc.Stub)team23Soap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
}
public uts.wsd.soap.client.Team23Soap getTeam23Soap() {
if (team23Soap == null)
_initTeam23SoapProxy();
return team23Soap;
}
public uts.wsd.soap.client.Poll[] getPolls(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, int arg4) throws java.rmi.RemoteException{
if (team23Soap == null)
_initTeam23SoapProxy();
return team23Soap.getPolls(arg0, arg1, arg2, arg3, arg4);
}
public java.lang.String createPoll(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.util.Calendar[] arg5) throws java.rmi.RemoteException{
if (team23Soap == null)
_initTeam23SoapProxy();
return team23Soap.createPoll(arg0, arg1, arg2, arg3, arg4, arg5);
}
public void closePoll(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException{
if (team23Soap == null)
_initTeam23SoapProxy();
team23Soap.closePoll(arg0, arg1, arg2);
}
} | [
"juan871003@gmail.com"
] | juan871003@gmail.com |
9d134c5a6f5071209808235b39e036cabb814c45 | 5fb9d5cd069f9df099aed99516092346ee3cf91a | /perf/src/main/java/org/teiid/test/teiid4201/TestSqlQuery.java | ffc45301d647deb4308fbd832ec56c8dec590c72 | [] | no_license | kylinsoong/teiid-test | 862e238e055481dfb14fb84694b316ae74174467 | ea5250fa372c7153ad6e9a0c344fdcfcf10800cc | refs/heads/master | 2021-04-19T00:31:41.173819 | 2017-10-09T06:41:00 | 2017-10-09T06:41:00 | 35,716,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,930 | java | package org.teiid.test.teiid4201;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class TestSqlQuery {
String username="user";
String pwd="";
public void execute(String query) {
System.out.println("Query:"+query);
String url = "jdbc:teiid:apm_public@mm://localhost:54321";
Connection connection=null;
Properties prop = new Properties();
prop.setProperty("FetchSize", "1");
prop.setProperty("user", username);
prop.setProperty("Password", pwd);
try{
Class.forName("org.teiid.jdbc.TeiidDriver");
connection = DriverManager.getConnection(url, prop);
System.out.println("Connection ="+connection);
Statement statement = connection.createStatement();
ResultSet results = statement.executeQuery(query);
long n=0;
while(results.next()) {
++n;
}
results.close();
statement.close();
System.out.println("Total number of record is :"+n);
} catch (Exception e){
e.printStackTrace();
} finally {
try{
connection.close();
}catch(SQLException e1){
// ignore
}
}
}
public static void main(String as[]){
new TestSqlQuery().execute("select * from public.share_market_data where frequency=5000 and ts between {ts '2016-04-08 01:00:00.0'} and {ts '2016-04-09 13:00:00.0'}");
}
}
| [
"kylinsoong.1214@gmail.com"
] | kylinsoong.1214@gmail.com |
549890e2a627f18a541228da1f08a646967b90b9 | 4bbb3ece3857c7ac905091c2c01e5439e6a99780 | /framework-payment/src/main/java/net/frank/framework/payment/alipay/AlipayUtil.java | e2dfc8bae2c1251c8e052ae3ac5ee51db711ac28 | [] | no_license | frankzhf/dream | b98d77de2ea13209aed52a0499cced0be7b99d3c | c90edbdd8dcdb4b0e7c8c22c1fccdefadeb85791 | refs/heads/master | 2022-12-22T12:20:29.710989 | 2020-10-13T02:41:37 | 2020-10-13T02:41:37 | 38,374,538 | 0 | 1 | null | 2022-12-16T01:03:37 | 2015-07-01T14:06:19 | JavaScript | UTF-8 | Java | false | false | 2,757 | java | package net.frank.framework.payment.alipay;
import java.math.BigDecimal;
import java.util.List;
import net.frank.commons.util.StringUtil;
public final class AlipayUtil {
/**
* 获取批量退款单笔数据集
* @param items
* @return
*/
public static String getRefundDetailDatas(List<RefundItem> items){
if(!items.isEmpty()){
StringBuilder sb = new StringBuilder();
for (RefundItem item : items) {
sb.append("#").append(getRefundDetailData(item));
}
return sb.substring(1);
}
return null;
}
/**
* 获取退款单笔数据集
* @param item
* @return
*/
public static String getRefundDetailData(RefundItem item){
if(StringUtil.isNotEmpty(item.getOriginAlipayTradeNo())&&null!=item.getRefundAmount()&&StringUtil.isNotEmpty(item.getRefundDesc())){
return item.getOriginAlipayTradeNo()+"^"+item.getRefundAmount().toString()+"^"+item.getRefundDesc();
}
return null;
}
/**
* 退款项信息
* 单笔交易退款次数不应该超过99次
*/
public static class RefundItem{
//原支付宝交易号
private String originAlipayTradeNo;
//退款金额 ,退款总金额不大于原交易付款金额
private BigDecimal refundAmount;
//退款理由 ,剔除 ^ | $ # 字符,长度不应该超过256个字符
private String refundDesc;
public RefundItem(String originAlipayTradeNo, BigDecimal refundAmount, String refundDesc) {
this.originAlipayTradeNo = originAlipayTradeNo;
this.refundAmount = refundAmount;
if(StringUtil.isNotEmpty(refundDesc)){
refundDesc = refundDesc.replaceAll("[\\^\\|\\$#]","*");
}
this.refundDesc = refundDesc;
}
public String getOriginAlipayTradeNo() {
return originAlipayTradeNo;
}
public void setOriginAlipayTradeNo(String originAlipayTradeNo) {
this.originAlipayTradeNo = originAlipayTradeNo;
}
public BigDecimal getRefundAmount() {
return refundAmount;
}
public void setRefundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
}
public String getRefundDesc() {
return refundDesc;
}
public void setRefundDesc(String refundDesc) {
if(StringUtil.isNotEmpty(refundDesc)){
refundDesc = refundDesc.replaceAll("[\\^\\|\\$#]","*");
}
this.refundDesc = refundDesc;
}
}
}
| [
"zhaofeng@ilinong.com"
] | zhaofeng@ilinong.com |
88659531e0595d678f3a01fe45a3f83722b9fe3c | ca29cac293d42090b2137044f13504f91b63a0e1 | /publicmodule/src/main/java/programs/publicmodule/core/db/dbservice/DbService.java | 3f7cae8e9538e8343c4b9c24314f1dd60e39609d | [] | no_license | jiangforgit/ProgramsProject | aa7d4afd3ef9d4a9b061129f3640ca6aba77ab96 | 789fac9dcfc1fb257861437537ee9338ec6993a8 | refs/heads/master | 2021-05-04T19:41:09.867375 | 2018-04-09T15:18:01 | 2018-04-09T15:18:01 | 106,796,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package programs.publicmodule.core.db.dbservice;
import programs.publicmodule.core.appconstant.ProgramsApplication;
import programs.publicmodule.core.db.helper.DatabaseHelper;
/**
* Created by Administrator on 2017/11/1 0001.
*/
public abstract class DbService {
protected DatabaseHelper getDbHelper(){
return DatabaseHelper.getDatabaseHelper(ProgramsApplication.getInstant());
}
}
| [
"ccj090810123@163.com"
] | ccj090810123@163.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.