blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ebc6c894ced82082c131a30af639b120d0f27b82 | 18a82c8ee9332dc05390f0e01419fc1d6a056e0b | /LibZxing/src/com/google/zxing/client/result/ResultParser.java | 3b0e1992e943ce017a21f5193bc20757a6aadcd0 | [] | no_license | ELEVENEV/zxing_w | de56c0483c7bc57b7e9d021431cd52c8d857ebf2 | af21ace9d317addd7dda55582c3dff698cb711b0 | refs/heads/master | 2022-01-11T10:02:02.949878 | 2019-04-29T09:33:53 | 2019-04-29T09:33:53 | 112,433,282 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,467 | java | /*
* Copyright 2007 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
* <p>Abstract class representing the result of decoding a barcode, as more than
* a String -- as some type of structured data. This might be a subclass which represents
* a URL, or an e-mail address. {@link #parseResult(Result)} will turn a raw
* decoded string into the most appropriate type of structured representation.</p>
*
* <p>Thanks to Jeff Griffin for proposing rewrite of these classes that relies less
* on exception-based mechanisms during parsing.</p>
*
* @author Sean Owen
*/
public abstract class ResultParser {
private static final ResultParser[] PARSERS = {
new BookmarkDoCoMoResultParser(),
new AddressBookDoCoMoResultParser(),
new EmailDoCoMoResultParser(),
new AddressBookAUResultParser(),
new VCardResultParser(),
new BizcardResultParser(),
new VEventResultParser(),
new EmailAddressResultParser(),
new SMTPResultParser(),
new TelResultParser(),
new SMSMMSResultParser(),
new SMSTOMMSTOResultParser(),
new GeoResultParser(),
new WifiResultParser(),
new URLTOResultParser(),
new URIResultParser(),
new ISBNResultParser(),
new ProductResultParser(),
new ExpandedProductResultParser(),
};
private static final Pattern DIGITS = Pattern.compile("\\d*");
private static final Pattern ALPHANUM = Pattern.compile("[a-zA-Z0-9]*");
private static final Pattern AMPERSAND = Pattern.compile("&");
private static final Pattern EQUALS = Pattern.compile("=");
/**
* Attempts to parse the raw {@link Result}'s contents as a particular type
* of information (email, URL, etc.) and return a {@link ParsedResult} encapsulating
* the result of parsing.
*/
public abstract ParsedResult parse(Result theResult);
public static ParsedResult parseResult(Result theResult) {
for (ResultParser parser : PARSERS) {
ParsedResult result = parser.parse(theResult);
if (result != null) {
return result;
}
}
return new TextParsedResult(theResult.getText(), null);
}
protected static void maybeAppend(String value, StringBuilder result) {
if (value != null) {
result.append('\n');
result.append(value);
}
}
protected static void maybeAppend(String[] value, StringBuilder result) {
if (value != null) {
for (String s : value) {
result.append('\n');
result.append(s);
}
}
}
protected static String[] maybeWrap(String value) {
return value == null ? null : new String[] { value };
}
protected static String unescapeBackslash(String escaped) {
int backslash = escaped.indexOf((int) '\\');
if (backslash < 0) {
return escaped;
}
int max = escaped.length();
StringBuilder unescaped = new StringBuilder(max - 1);
unescaped.append(escaped.toCharArray(), 0, backslash);
boolean nextIsEscaped = false;
for (int i = backslash; i < max; i++) {
char c = escaped.charAt(i);
if (nextIsEscaped || c != '\\') {
unescaped.append(c);
nextIsEscaped = false;
} else {
nextIsEscaped = true;
}
}
return unescaped.toString();
}
protected static int parseHexDigit(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'a' && c <= 'f') {
return 10 + (c - 'a');
}
if (c >= 'A' && c <= 'F') {
return 10 + (c - 'A');
}
return -1;
}
protected static boolean isStringOfDigits(CharSequence value, int length) {
return value != null && length == value.length() && DIGITS.matcher(value).matches();
}
protected static boolean isSubstringOfDigits(CharSequence value, int offset, int length) {
if (value == null) {
return false;
}
int max = offset + length;
return value.length() >= max && DIGITS.matcher(value.subSequence(offset, max)).matches();
}
protected static boolean isSubstringOfAlphaNumeric(CharSequence value, int offset, int length) {
if (value == null) {
return false;
}
int max = offset + length;
return value.length() >= max && ALPHANUM.matcher(value.subSequence(offset, max)).matches();
}
static Map<String,String> parseNameValuePairs(String uri) {
int paramStart = uri.indexOf('?');
if (paramStart < 0) {
return null;
}
Map<String,String> result = new HashMap<String,String>(3);
for (String keyValue : AMPERSAND.split(uri.substring(paramStart + 1))) {
appendKeyValue(keyValue, result);
}
return result;
}
private static void appendKeyValue(CharSequence keyValue,
Map<String,String> result) {
String[] keyValueTokens = EQUALS.split(keyValue, 2);
if (keyValueTokens.length == 2) {
String key = keyValueTokens[0];
String value = keyValueTokens[1];
try {
value = URLDecoder.decode(value, "UTF-8");
} catch (UnsupportedEncodingException uee) {
throw new IllegalStateException(uee); // can't happen
}
result.put(key, value);
}
}
static String[] matchPrefixedField(String prefix, String rawText, char endChar, boolean trim) {
List<String> matches = null;
int i = 0;
int max = rawText.length();
while (i < max) {
i = rawText.indexOf(prefix, i);
if (i < 0) {
break;
}
i += prefix.length(); // Skip past this prefix we found to start
int start = i; // Found the start of a match here
boolean more = true;
while (more) {
i = rawText.indexOf((int) endChar, i);
if (i < 0) {
// No terminating end character? uh, done. Set i such that loop terminates and break
i = rawText.length();
more = false;
} else if (rawText.charAt(i - 1) == '\\') {
// semicolon was escaped so continue
i++;
} else {
// found a match
if (matches == null) {
matches = new ArrayList<String>(3); // lazy init
}
String element = unescapeBackslash(rawText.substring(start, i));
if (trim) {
element = element.trim();
}
matches.add(element);
i++;
more = false;
}
}
}
if (matches == null || matches.isEmpty()) {
return null;
}
return matches.toArray(new String[matches.size()]);
}
static String matchSinglePrefixedField(String prefix, String rawText, char endChar, boolean trim) {
String[] matches = matchPrefixedField(prefix, rawText, endChar, trim);
return matches == null ? null : matches[0];
}
}
| [
"xxx"
] | xxx |
8d58ffd7c5d43d6bbbd795c9fdd0462082a2a35d | 9abd00ddd6e39c2d9abf2e636ab1114ff6184ebc | /src/icehs/science/ch05/WhileEx.java | d4f0e2e19318d59b1205d49ddde54a22cc575b26 | [] | no_license | kcyoow/JAVA_STUDY1 | 6164567851537be069933f6186250d68654b3095 | 9a974f122d0e91f25f59223cdd09bfa14dd06576 | refs/heads/master | 2020-04-15T10:15:27.033946 | 2019-01-18T06:54:17 | 2019-01-18T06:54:17 | 164,588,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package icehs.science.ch05;
public class WhileEx {
public static void main(String[] args) {
int sum = 0;
int index = 1;
while ( sum < 10 ) {
sum += index;
System.out.println(index++ + " : " + sum);
}
}
}
| [
"kcy021012@gmail.com"
] | kcy021012@gmail.com |
f1e5e46a3db5b5b699c121e12b718388f9143dea | 6c8c146572bd3bc1ac867c64d194fe686d2a1671 | /src/main/java/com/java456/shiro/MyRealm.java | 3a8141881c18076e9ab2a9d6d8b7e604945d84d1 | [] | no_license | Kyazure/BookSystem | 64ce260836f963cd9ae581feba3846ef54063225 | ce8291569cfd83d57f831b53bc7fa3591c0b11ee | refs/heads/master | 2022-10-25T19:37:58.169175 | 2019-12-25T01:43:57 | 2019-12-25T01:43:57 | 230,024,164 | 0 | 0 | null | 2022-10-12T20:35:20 | 2019-12-25T01:43:20 | Java | UTF-8 | Java | false | false | 2,336 | java | package com.java456.shiro;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import com.java456.dao.RoleMenuDao;
import com.java456.dao.UserDao;
import com.java456.entity.Menu;
import com.java456.entity.RoleMenu;
import com.java456.entity.User;
/**
* 自定义Realm
*
*/
public class MyRealm extends AuthorizingRealm{
@Resource
private UserDao userDao;
@Resource
private RoleMenuDao roleMenuDao;
/**
* #授权--权限url
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
String name=(String) SecurityUtils.getSubject().getPrincipal();
User user=userDao.findByName(name);
//有了用户可以拿到,角色, 有角色,就有对应的菜单 list集合。 --- permissions
//这个角色对应 的菜单
List<RoleMenu> roleMenuList= roleMenuDao.findByRole(user.getRole());
SimpleAuthorizationInfo info=new SimpleAuthorizationInfo();
for(RoleMenu roleMenu:roleMenuList) {
info.addStringPermission(roleMenu.getMenu().getPermissions());//添加权限 permissions
}
//这个角色对应 的菜单
//设置角色
Set<String> roles=new HashSet<String>();
roles.add(user.getRole().getName());
info.setRoles(roles);
//设置角色
return info;
}
/**
* 权限认证--登录
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String name=(String)token.getPrincipal();//用户名 UsernamePasswordTokenr的第一个参数 name
User user=userDao.findByName(name);
if(user!=null){
AuthenticationInfo authcInfo=new SimpleAuthenticationInfo(user.getName(),user.getPwd(),"xxx");
return authcInfo;
}else{
return null;
}
}
}
| [
"1043061279@qq.com"
] | 1043061279@qq.com |
439b955a835ee44374f58fe18e3de5e33183b820 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/thinkaurelius--titan/ac42df773fdcd4ecbfd4de68455dc989b3d7adb2/after/PermanentLockingException.java | d3616091b791294d7e3523d6b51097b1f53499dd | [] | 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 | 1,013 | java | package com.thinkaurelius.titan.diskstorage;
/**
* This exception signifies a permanent exception while attempting to acquire a lock
* in the titan storage backend, such as another lock taking presedence.
*
* (c) Matthias Broecheler (me@matthiasb.com)
*/
public class PermanentLockingException extends PermanentStorageException implements LockingException {
private static final long serialVersionUID = 482890657293484420L;
/**
*
* @param msg Exception message
*/
public PermanentLockingException(String msg) {
super(msg);
}
/**
*
* @param msg Exception message
* @param cause Cause of the exception
*/
public PermanentLockingException(String msg, Throwable cause) {
super(msg,cause);
}
/**
* Constructs an exception with a generic message
*
* @param cause Cause of the exception
*/
public PermanentLockingException(Throwable cause) {
this("Permanent locking failure",cause);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
9d6f6c586b4b17d4cca5aa932bbb9ff0d041af51 | 6d911af01bd543a38271ee504aad7c2c93a1adf6 | /FledWar/server-v0.8/FledCommons/src/com/fledwar/util/Equation.java | c3dbad0114f00f1ab63d0fc2e0b73220ea1753de | [] | no_license | rexfleischer/misc-projs | 94b9a85c0a149de64228c6406b73a0f15ca23477 | ce47a1392b6192ba8fc5400da63841f3bf26a883 | refs/heads/master | 2021-07-08T05:43:20.337938 | 2020-07-28T14:49:47 | 2020-07-28T14:49:47 | 1,376,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,433 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.fledwar.util;
/**
*
* @author REx
*/
public abstract class Equation
{
public static Equation linear(double min, double max)
{
return new Equation(min, max)
{
@Override
protected double equate(double percent)
{
return (range * percent) + start;
}
};
}
public static Equation square(double min, double max)
{
return new Equation(min, max)
{
@Override
protected double equate(double percent)
{
return (range * percent * percent) + start;
}
};
}
public static Equation root(double min, double max)
{
return new Equation(min, max)
{
@Override
protected double equate(double percent)
{
return (range * Math.sqrt(percent)) + start;
}
};
}
public static Equation power(double min, double max, double power)
{
return new Equation(min, max)
{
private double power;
protected Equation placePower(double power)
{
this.power = power;
return this;
}
@Override
protected double equate(double percent)
{
return (range * Math.pow(percent, power)) + start;
}
}.placePower(power);
}
protected abstract double equate(double percent);
protected final double start;
protected final double end;
protected final double range;
public Equation(double start, double end)
{
this.start = start;
this.end = end;
this.range = (end - start);
}
public double getStart()
{
return start;
}
public double getEnd()
{
return end;
}
public double getRange()
{
return range;
}
public double find(double percent)
{
if (percent < 0.0 || 1.0 < percent)
{
throw new IllegalArgumentException(String.format(
"percent must be within [0.0, 1.0]: %s",
percent));
}
return equate(percent);
}
}
| [
"rexfleischer@gmail.com"
] | rexfleischer@gmail.com |
61e4d261a673c7b408fab8a8f96ab797775c778d | 769de333de73a36401f7170639f165ce0c8ecd12 | /IpLocationFinder/src/org/soap/abdelrahman/IplocatorFinder.java | bd7c9c4b8797a4ec1bab3bd7482a80d4bd27f4e5 | [] | no_license | AbdelrahmanSayed155/Java-Network | b14d35eb8f32d7ebdc11ea84c233c6cad56198ce | af8feb2b8de977e1ad39cc12e197ef6f386acfd8 | refs/heads/master | 2021-04-27T15:48:25.537424 | 2018-03-22T09:55:24 | 2018-03-22T09:55:33 | 122,476,307 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package org.soap.abdelrahman;
import java.rmi.RemoteException;
import net.webservicex.www.GeoIP;
import net.webservicex.www.GeoIPServiceSoapProxy;
public class IplocatorFinder {
public static void main(String[] args) {
///// 82.129.130.245
///74.125.239.142
// if(args.length<1){
// System.out.println("You must pass only one IP");
// }else{
String ipAddress = "74.125.239.142";//"82.129.130.245";//args[0];
GeoIPServiceSoapProxy geoProxy = new GeoIPServiceSoapProxy() ;
try {
GeoIP ip = geoProxy.getGeoIP(ipAddress);
System.out.println("Country Name:" + ip.getCountryName()+"/n Country Code:"+ip.getCountryCode());
} catch (RemoteException e) {
e.printStackTrace();
System.out.println("Exception is "+e.getMessage());
}
//}
}
}
| [
"abdelrahman.sayid@asset.com.eg"
] | abdelrahman.sayid@asset.com.eg |
ce1fd165969ff5b0befd69b2731bed0a388f8ef0 | b3418633bf03a546a5254ea422e40de17489980c | /src/main/java/com/fhd/risk/dao/ScoreInstanceDAO.java | aa21e20329dfc1d40b88d6f88f376ba387468b74 | [] | no_license | vincent-dixin/Financial-Street-ERMIS | d819fd319293e55578e3067c9a5de0cd33c56a93 | 87d6bc6a4ddc52abca2c341eb476c1ea283d70e7 | refs/heads/master | 2016-09-06T13:56:46.197326 | 2015-03-30T02:47:46 | 2015-03-30T02:47:46 | 33,099,786 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package com.fhd.risk.dao;
import org.springframework.stereotype.Repository;
import com.fhd.core.dao.hibernate.HibernateDao;
import com.fhd.risk.entity.ScoreInstance;
/**
* @author 张 雷
* @version
* @since Ver 1.1
* @Date 2012 2012-11-13 下午3:47:54
*
* @see
*/
@Repository
public class ScoreInstanceDAO extends HibernateDao<ScoreInstance, String> {
}
| [
"cashhu@126.com"
] | cashhu@126.com |
3be9ff63e4cb3e473484821bb125c7cea30bd3cb | ef739016b7f93c2db6e3ede01717ad3621eafe5e | /Misc/sftpPollingAdapter/src/main/java/com/cts/tib/util/SftpAdapterConstants.java | 4cdb2ac626ad2a3336d844fa3701e83a32235344 | [] | no_license | sivasankkar091/PepRepo | 7cbed311832b560f233408b071eb5e9654dc575c | 52d639445c23d7d95361d3991fc54ccfd880171c | refs/heads/master | 2023-04-30T23:53:38.596309 | 2019-10-03T14:29:33 | 2019-10-03T14:29:33 | 212,603,072 | 0 | 0 | null | 2023-04-14T17:43:07 | 2019-10-03T14:38:51 | Java | UTF-8 | Java | false | false | 256 | java | package com.cts.tib.util;
public class SftpAdapterConstants {
public static final String INBOUND_SFTP_CHANNEL="InboundSftpChannel";
public static final String POLLER_TIME_OUT="0/5 * * * * *";
public static final String FILE_PATTEN_SUFFIX="*.ready";
}
| [
"sksameer.nuz@gmail.com"
] | sksameer.nuz@gmail.com |
ed1cded6bdc9227f52fde94bb469d3b5cd8bee3e | d88c4951278c0b9cb1995ddf56a9657099f31f19 | /longfor-core/src/main/java/com/longfor/core/delegates/PermissionCheckerDelegate.java | 1aa8c6310c1489815842aefc81feeb70066873de | [] | no_license | zhtaosd/LFTest | ebefa86ad7a55c2ad8f88618bf6e1059b9094ca0 | dded4f92fdf2aa91bcf3292e56ff5c8ba6ad33ff | refs/heads/master | 2021-09-05T07:38:56.665518 | 2018-01-25T09:35:44 | 2018-01-25T09:35:44 | 113,002,456 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,310 | java | package com.longfor.core.delegates;
import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;
import com.longfor.core.ui.camera.CameraImageBean;
import com.longfor.core.ui.camera.LongForCamera;
import com.longfor.core.ui.camera.RequestCodes;
import com.yalantis.ucrop.UCrop;
import permissions.dispatcher.NeedsPermission;
import permissions.dispatcher.OnNeverAskAgain;
import permissions.dispatcher.OnPermissionDenied;
import permissions.dispatcher.OnShowRationale;
import permissions.dispatcher.PermissionRequest;
import permissions.dispatcher.RuntimePermissions;
/**
* Created by zhanghaitao1 on 2017/12/4.
*/
@RuntimePermissions
public abstract class PermissionCheckerDelegate extends BaseDelegate {
@NeedsPermission(Manifest.permission.CAMERA)
void startCamera() {
LongForCamera.start(this);
}
public void startCameraWithCheck() {
PermissionCheckerDelegatePermissionsDispatcher.startCameraWithPermissionCheck(this);
}
@OnPermissionDenied(Manifest.permission.CAMERA)
void onCameraDenied() {
Toast.makeText(getContext(), "不允许拍照", Toast.LENGTH_LONG).show();
}
@OnNeverAskAgain(Manifest.permission.CAMERA)
void onCameraNever() {
Toast.makeText(getContext(), "永久拒绝权限", Toast.LENGTH_LONG).show();
}
@OnShowRationale(Manifest.permission.CAMERA)
void onCameraRationale(PermissionRequest request) {
showRationaleDialog(request);
}
private void showRationaleDialog(final PermissionRequest request) {
if (getContext() != null) {
new AlertDialog.Builder(getContext())
.setPositiveButton("同意使用", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
request.proceed();
}
})
.setNegativeButton("拒绝使用", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
request.cancel();
}
})
.setCancelable(false)
.setMessage("权限管理")
.show();
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
PermissionCheckerDelegatePermissionsDispatcher.onRequestPermissionsResult(this, requestCode, grantResults);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case RequestCodes.TAKE_PHOTO:
final Uri resultUri = CameraImageBean.getInstance().getPath();
if(getContext()!=null){
UCrop.of(resultUri,resultUri)
.withMaxResultSize(400,400)
.start(getContext(),this);
}
break;
case RequestCodes.PICK_PHOTO:
if(data!=null){
final Uri pickPath = data.getData();
final String pickCropPath = LongForCamera.createCropFile().getPath();
if(pickPath!=null&&getContext()!=null){
UCrop.of(pickPath,Uri.parse(pickCropPath))
.withMaxResultSize(400,400)
.start(getContext(),this);
}
}
break;
case RequestCodes.CROP_PHOTO:
break;
case RequestCodes.CROP_ERROR:
break;
default:
break;
}
}
}
}
| [
"zhanghaitao1@longfor.com"
] | zhanghaitao1@longfor.com |
02d66f25cba72b237b5700a70d414ab9427271cf | f45783104c7f82b2ed6ca47bf573e4b51e6891a0 | /src/main/java/store/zabbix/pojo/Apply.java | 8ead8a499990a9e2e1bbd2e47bab4602e5dcf95e | [] | no_license | dlm101/house | f61635a4ef0f2094c5c4b279124481fad81accda | 853156c777063fe6e54f8a237452470b197c6c15 | refs/heads/master | 2020-11-28T07:00:58.378405 | 2019-12-21T04:44:12 | 2019-12-21T04:44:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,721 | java | package store.zabbix.pojo;
public class Apply {
private Integer id;
private String house_id;
private String address;
private double area;
private double price;
private Integer userlist_id;
private String status;
private Userlist userlist;
public Userlist getUserlist() {
return userlist;
}
public void setUserlist(Userlist userlist) {
this.userlist = userlist;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getHouse_id() {
return house_id;
}
public void setHouse_id(String house_id) {
this.house_id = house_id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public double getArea() {
return area;
}
public void setArea(double area) {
this.area = area;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public Integer getUserlist_id() {
return userlist_id;
}
public void setUserlist_id(Integer userlist_id) {
this.userlist_id = userlist_id;
}
@Override
public String toString() {
return "Apply [id=" + id + ", house_id=" + house_id + ", address=" + address + ", area=" + area + ", price=" + price
+ ", userlist_id=" + userlist_id + ", status=" + status + ", userlist=" + userlist + "]";
}
}
| [
"eyck.cui@foxmail.com"
] | eyck.cui@foxmail.com |
80fb15986e1ca448cbd051f588bef1219d2b2091 | 45bf1837b2d4329e2cc5e408545f1289f04e983e | /src/main/java/cn/study/concurrent/art/chapter04/defined/TwinsLock.java | 37db555d3063144414f2d83c7e6de294873bc8d1 | [] | no_license | xueshun/word | 0948f885b69f78ced58bbed1854ccc0abee7e28a | 5f50bd369a9e4b60cdfe599ace5ef2baea164b2d | refs/heads/master | 2021-08-08T03:52:47.907397 | 2018-11-30T11:51:12 | 2018-11-30T11:51:12 | 146,680,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,265 | java | package cn.study.concurrent.art.chapter04.defined;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
/**
* <pre>类名: TwinsLock</pre>
* <pre>描述: 该同步工具在同一时刻,只允许至多两个线程同时访问,超过两个线程的访问将会被阻塞
* 思路:这是共享模式访问,需要使用同步器提供acquireShared(int args)等相关方法
* 方法:必须要重写tryAcquiredShared(int args)和tryReleaseShared(int args)方法</pre>
* <pre>日期: 2018/11/20 14:50</pre>
* <pre>作者: xueshun</pre>
*/
public class TwinsLock implements Lock {
private final Sync sync = new Sync(2);
private static final class Sync extends AbstractQueuedSynchronizer{
Sync(int count) {
if(count <= 0){
throw new IllegalArgumentException("count must large than zero.");
}
setState(count);
}
@Override
protected int tryAcquireShared(int reduceCount) {
for (;;){
int current = getState();
int newCount = current - reduceCount;
if(newCount < 0 || compareAndSetState(current,newCount)){
return newCount;
}
}
}
@Override
protected boolean tryReleaseShared(int returnCount) {
for (;;){
int current = getState();
int newCount = current + returnCount;
if(compareAndSetState(current,newCount)){
return true;
}
}
}
}
@Override
public void lock() {
sync.acquireShared(1);
}
@Override
public void lockInterruptibly() throws InterruptedException {
}
@Override
public boolean tryLock() {
return false;
}
@Override
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
return false;
}
@Override
public void unlock() {
sync.releaseShared(1);
}
@Override
public Condition newCondition() {
return null;
}
}
| [
"xueshun1211@163.com"
] | xueshun1211@163.com |
727f4f0c4996ef230cbcd3f62f702ecc4ce1b0e0 | d12d79010e1c58371ca5c4e113cffb42cafc2115 | /src/main/java/io/github/jhipster/application/service/dto/CommentCriteria.java | 8da09d131c56363ae0dbc7be28fe33aa0be8836b | [] | no_license | rhoiyds/OSRS-Names | 7b05b1bed62b57f948bd340eef1eaf66ec3f216b | 4428bbcf6793fbfdfde1aea44ef75b8dfc5de8d5 | refs/heads/master | 2023-02-28T19:12:45.436351 | 2021-02-12T01:13:59 | 2021-02-12T01:13:59 | 197,471,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,885 | java | package io.github.jhipster.application.service.dto;
import java.io.Serializable;
import java.util.Objects;
import io.github.jhipster.service.Criteria;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
import io.github.jhipster.service.filter.InstantFilter;
/**
* Criteria class for the {@link io.github.jhipster.application.domain.Comment} entity. This class is used
* in {@link io.github.jhipster.application.web.rest.CommentResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /comments?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class CommentCriteria implements Serializable, Criteria {
private static final long serialVersionUID = 1L;
private LongFilter id;
private InstantFilter timestamp;
private StringFilter text;
private LongFilter offerId;
private LongFilter ownerId;
public CommentCriteria(){
}
public CommentCriteria(CommentCriteria other){
this.id = other.id == null ? null : other.id.copy();
this.timestamp = other.timestamp == null ? null : other.timestamp.copy();
this.text = other.text == null ? null : other.text.copy();
this.offerId = other.offerId == null ? null : other.offerId.copy();
this.ownerId = other.ownerId == null ? null : other.ownerId.copy();
}
@Override
public CommentCriteria copy() {
return new CommentCriteria(this);
}
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public InstantFilter getTimestamp() {
return timestamp;
}
public void setTimestamp(InstantFilter timestamp) {
this.timestamp = timestamp;
}
public StringFilter getText() {
return text;
}
public void setText(StringFilter text) {
this.text = text;
}
public LongFilter getOfferId() {
return offerId;
}
public void setOfferId(LongFilter offerId) {
this.offerId = offerId;
}
public LongFilter getOwnerId() {
return ownerId;
}
public void setOwnerId(LongFilter ownerId) {
this.ownerId = ownerId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CommentCriteria that = (CommentCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(timestamp, that.timestamp) &&
Objects.equals(text, that.text) &&
Objects.equals(offerId, that.offerId) &&
Objects.equals(ownerId, that.ownerId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
timestamp,
text,
offerId,
ownerId
);
}
@Override
public String toString() {
return "CommentCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(timestamp != null ? "timestamp=" + timestamp + ", " : "") +
(text != null ? "text=" + text + ", " : "") +
(offerId != null ? "offerId=" + offerId + ", " : "") +
(ownerId != null ? "ownerId=" + ownerId + ", " : "") +
"}";
}
}
| [
"royporter7@gmail.com"
] | royporter7@gmail.com |
6d283683719e072e41502faf78577ee93b565b95 | ec19921cfecdcb7f5a844274ef7510b6fb5b82f9 | /thuchanh_sosanhcaclophinhhoc/CircleComparator.java | 22a4ba28a7fb29e01960270cb053c899b2d9dbc1 | [] | no_license | baophuc1694/module222 | 10c9c479d59226114c5337aa0dffc973f8ee3582 | 2e315d4a9a59d511332b35b9c07bb65210137944 | refs/heads/master | 2022-12-05T19:22:02.260643 | 2020-08-28T01:30:38 | 2020-08-28T01:30:38 | 284,903,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | package thuchanh_sosanhcaclophinhhoc;
import thuchanh_combarable_interface_caclophinhhoc.Circle;
import java.util.Comparator;
public class CircleComparator implements Comparator<Circle> {
@Override
public int compare(Circle c1, Circle c2){
if (c1.getRadius() > c2.getRadius())
return 1;
else if (c1.getRadius() < c2.getRadius())
return -1;
else
return 0;
}
}
| [
"phucnguyenty1694@gmail.com"
] | phucnguyenty1694@gmail.com |
35e244260a20e7c516dc0b12a9b611050cc7de65 | abb04ff0303e7b2c04df4712967cce6c88d36eb2 | /app/src/main/java/com/example/sunarto1library/TentangSaya.java | 19016f4b4e99e4c1c05f83d0f47a1551b70e8413 | [] | no_license | soenarto07/SunartoLib | 569196b94e7d4925528b7f1fe1cd05c2afcfa020 | 75159abcbbeb81e52387afdc3e0bb84922769be6 | refs/heads/main | 2023-02-17T10:09:42.490168 | 2021-01-15T11:02:22 | 2021-01-15T11:02:22 | 329,886,042 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.example.sunarto1library;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class TentangSaya extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tentang_saya);
}
} | [
"noreply@github.com"
] | soenarto07.noreply@github.com |
60a0c225259184c97c3f0417922c2ff1a9ac1d51 | 1922778366108e4558791f1a98c6bf5e23f80b9a | /JAVA高级编程/java高级编程学习/IODemo/src/com/cdxy/iodemo/com/cdxy/iodemo/FileIODemo.java | 609097e239b06422fa192554a1d2cd8b5ac3ed9f | [] | no_license | jiuduweiliangeer/JavaWeb | 9f0db11c5d865c39b96f48f9be175432f7943be0 | 4e8e7c267f1578b3dda215e7a83cedc23a4d0d0b | refs/heads/master | 2020-08-13T23:59:47.263146 | 2019-10-23T11:53:03 | 2019-10-23T11:53:03 | 215,059,602 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,298 | java | package com.cdxy.iodemo;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.Reader;
import java.io.Writer;
public class FileIODemo {
public static void main(String[] args) throws Exception{
File f = new File("C:/Users/my/Desktop/login.jsp");
File f1 = new File("C:/Users/my/Desktop/login1.jsp");
if (f.exists()) {
FileInputStream fin = new FileInputStream(f);
BufferedReader bReader = new BufferedReader(new InputStreamReader(fin,"utf-8"));
StringBuffer sbuff = new StringBuffer();
String str;
while((str=bReader.readLine())!=null){
//System.out.println(str);
sbuff.append(str);
sbuff.append("\n");
}
System.out.println(sbuff.toString());
String alls = sbuff.toString();
long startindex = alls.indexOf("<table");
long endindex = alls.indexOf("</table>");
System.out.println(alls.substring((int)startindex,(int)endindex));
FileOutputStream fos = new FileOutputStream(f1);
fos.write(sbuff.toString().getBytes("utf-8"));
}
}
}
| [
"56549671+jiuduweiliangeer@users.noreply.github.com"
] | 56549671+jiuduweiliangeer@users.noreply.github.com |
bd1364e52e37769a227cd3889d1c819ce49b4ebf | 2ad91c2e6d391f5ab0bfadbb0b977931d9d373e8 | /src/test/java/com/configuration/BaseUITestConstants.java | a0bf98ee151d31687c3fce8c9a07250fc184149a | [] | no_license | mullaimalar/AutomationAddition | 6de786fbe59ba048969369cf1cfa8cdcdbc9b339 | d416f084e64ab8196eeaa8eab1a415c3ed6fb296 | refs/heads/master | 2021-01-23T18:45:06.974402 | 2017-09-08T03:24:19 | 2017-09-08T03:24:19 | 102,806,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.configuration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class BaseUITestConstants {
public static WebDriver DRIVER;
public static String URL = "https://www.miniwebtool.com/sum-calculator";
}
| [
"mullai.malar@PF-DEV03.internal.private-flight.com"
] | mullai.malar@PF-DEV03.internal.private-flight.com |
f589149db80e7574dbf1f3dff9241533680bd3d7 | caf8ccd0eeb4d209f6e2647df07d33094875a056 | /platform/web/gwt-plugins/ua.gradsoft.jungle.gwt.util/src/ua/gradsoft/jungle/gwt/util/client/gxt/BeanModelSelectionWidget.java | 92fb20f8a29a93e8f3c1812d712fbdc1eb6dfa6f | [] | no_license | rssh/jungle.public | 3de10d7a5d8d4ab1eb283d82efee8075d4857da0 | 6de2af138e3263d8b8e42fc3e56d0a3ebeab14ce | refs/heads/master | 2020-05-21T00:29:11.989209 | 2013-11-19T14:48:39 | 2013-11-19T14:48:39 | 1,886,656 | 0 | 0 | null | 2013-11-19T14:48:39 | 2011-06-13T00:27:01 | Java | UTF-8 | Java | false | false | 433 | java |
package ua.gradsoft.jungle.gwt.util.client.gxt;
import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.widget.selection.StoreSelectionModel;
/**
*Interface, which can be used by componend
* @author rssh
*/
public interface BeanModelSelectionWidget {
public StoreSelectionModel<BeanModel> getSelectionModel();
public Store<BeanModel> getStore();
}
| [
"rssh@e6263924-d73c-0410-abf9-b8ad5fbdd136"
] | rssh@e6263924-d73c-0410-abf9-b8ad5fbdd136 |
9616b296d4a4ab19edae484ec48440add177e0c1 | b49606f54ba02a1ab6803f00998d369abe3cb9f5 | /app/src/main/java/com/vk/ecoach/model/Job.java | 84d3b426f28b27ceef1bd91eb6ee267963ca5f03 | [] | no_license | vaskaur/ECoach | 60b6e23aa41cf032b0c6a174fe550bb14365025d | 769abafcb13b34e6a91202e00af179ea13269af4 | refs/heads/master | 2022-01-12T07:20:41.266090 | 2019-05-10T11:05:09 | 2019-05-10T11:05:09 | 185,970,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package com.vk.ecoach.model;
import java.io.Serializable;
public class Job implements Serializable {
public String busnojob;
public String date;
public String comments;
public String docId;
public Job(String busnojob, String date, String comments) {
this.busnojob = busnojob;
this.date = date;
this.comments = comments;
}
public Job(String busnojob, String date, String comments, String docId) {
this.busnojob = busnojob;
this.date = date;
this.comments = comments;
this.docId = docId;
}
public Job() {
}
@Override
public String toString() {
// return " Comments:'" + comments + '\'';
String message = "Comments: "+comments;
return message;
}
/* @Override
public String toStringj() {
String message = "Bus No.:"+busnojob+"\nComments:"+comments;
return message;
}*/
}
| [
"vasmankaur21@gmail.com"
] | vasmankaur21@gmail.com |
1a77786e6eb624a54bd5d20a48666f2f2ada5e6e | 15ba795d61734fa16bfc8e013aab4294a30e07ef | /branches/guse-3.6.1_update/portlets/remd/src/de/mosgrid/remd/ui/tempdist/TemperatureDistributionCalculator.java | e81cb3a0da503e5d7d88347841864b7f2629db83 | [] | no_license | BackupTheBerlios/mosgrid-svn | 0f73faa9805d86d32b7a58059647755200b37b33 | 5c7f25d8fbd6afceedf1e75ab97cd498401e85af | refs/heads/master | 2016-09-05T15:06:29.520123 | 2013-12-11T15:54:04 | 2013-12-11T15:54:04 | 40,772,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,763 | java | package de.mosgrid.remd.ui.tempdist;
import java.io.BufferedReader;
import java.math.BigInteger;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.Validator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.ProgressIndicator;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
import de.mosgrid.gui.inputmask.AbstractInputMask;
import de.mosgrid.gui.inputmask.AbstractJobForm;
import de.mosgrid.gui.inputmask.IInputMaskComponent;
import de.mosgrid.gui.inputmask.uploads.IUploadComponent;
import de.mosgrid.gui.inputmask.uploads.IUploadListener;
import de.mosgrid.msml.editors.MSMLTemplate;
import de.mosgrid.msml.jaxb.bindings.ArrayType;
import de.mosgrid.msml.jaxb.bindings.ParameterType;
import de.mosgrid.msml.util.wrapper.Job;
import de.mosgrid.portlet.DomainPortlet;
import de.mosgrid.portlet.ImportedWorkflow;
import de.mosgrid.remd.properties.RemdProperties;
import de.mosgrid.remd.util.ProteinParser;
import de.mosgrid.remd.util.ProteinParser.Result;
import de.mosgrid.remd.util.TemperaturePredictor;
import de.mosgrid.remd.util.TemperaturePredictor.HydrogensInProtein;
import de.mosgrid.remd.util.TemperaturePredictor.IReplica;
import de.mosgrid.remd.util.TemperaturePredictor.ProteinConstraints;
import de.mosgrid.remd.util.TemperaturePredictor.VirtualSites;
import de.mosgrid.remd.util.TemperaturePredictor.WaterConstraints;
import de.mosgrid.util.UploadCollector;
/**
* Enables the calculation of the perfect temperature distribution
*
* @author Andreas Zink
*
*/
public class TemperatureDistributionCalculator extends AbstractJobForm implements IInputMaskComponent,
ValueChangeListener, IUploadListener {
private static final long serialVersionUID = -4372039182915499541L;
private final Logger LOGGER = LoggerFactory.getLogger(TemperatureDistributionCalculator.class);
private static final String CAPTION_TF_NOPA = "Number of Atoms in Protein";
private static final String TOOLTIP_TF_NOPA = "The number of protein atoms found in uploaded file.";
private static final String CAPTION_TF_NOWM = "Number of Water Molecules";
private static final String TOOLTIP_TF_NOWM = "The number of water molecules found in uploaded file.";
private static final String CAPTION_TF_PEX = "Exchange Probability";
private static final String TOOLTIP_TF_PEX = "The desired exchange probability between two replicas.";
private static final String CAPTION_TF_MAX_REPLICAS = "Max. Replicas";
private static final String TOOLTIP_TF_MAX_REPLICAS = "The maximum number of replicas.";
private static final String CAPTION_TF_TEMP_MIN = "Min. Temperature (K)";
private static final String TOOLTIP_TF_TEMP_MIN = "The lower temperature limit for replicas in Kelvin.";
private static final String CAPTION_TF_TEMP_MAX = "Max. Temperature (K)";
private static final String TOOLTIP_TF_TEMP_MAX = "The upper temperature limit for replicas in Kelvin.";
private static final String CAPTION_BTN_PARSE = "Parse Protein";
private static final String TOOLTIP_BTN_PARSE = "Reads the protein file from previous step to parse the number of protein atoms and solvent molecules.";
private static final String CAPTION_BTN_COMPUTE = "Compute Distribution";
private static final String TOOLTIP_BTN_COMPUTE = "Starts the computation of a temperature distribution. The results will be shown in a subwindow.";
private static final String CAPTION_LABEL_TEMPS = "Temperatures:";
private DomainPortlet portlet;
private ImportedWorkflow wkfImport;
private TemperaturePredictor predictor;
private BufferedReader proteinFileReader;
private List<IReplica> replicas;
/* ui components */
private GridLayout gridLayout;
private TextField pExTextField;
private TextField maxReplicasTextField;
private TextField minTempTextField;
private TextField maxTempTextField;
private TextField numberOfProteinAtomsTextField;
private TextField numberOfWaterMoleculesTextField;
private Button parseProteinButton;
private Button computeDistButton;
private Label tempResultsLabel;
private ProgressIndicator progressIndicator;
public TemperatureDistributionCalculator(DomainPortlet portlet, ImportedWorkflow wkfImport, Job job) {
super(job);
this.portlet = portlet;
this.wkfImport = wkfImport;
initTemperaturePredictor();
fillLeftColumn();
}
private void initTemperaturePredictor() {
predictor = new TemperaturePredictor();
predictor.setProteinConstraints(ProteinConstraints.ALL_BONDS);
predictor.setProteinHydrogens(HydrogensInProtein.ALL_H);
predictor.setVirtualSites(VirtualSites.NONE);
predictor.setWaterConstraints(WaterConstraints.RIGID);
}
@Override
public void fileArrived(IUploadComponent component, BufferedReader fileReader) {
reset(false);
this.proteinFileReader = fileReader;
}
@Override
public void valueChange(ValueChangeEvent event) {
// called if upload origin of protein upload changed
reset(true);
}
/**
* Resets this component
*/
public void reset(boolean fullReset) {
// delete previous results
replicas = null;
numberOfProteinAtomsTextField.setValue(Integer.valueOf(0));
numberOfWaterMoleculesTextField.setValue(Integer.valueOf(0));
// update gui
if (fullReset) {
// disable parse button on full reset
if (parseProteinButton.isEnabled()) {
parseProteinButton.setEnabled(false);
}
} else {
if (!parseProteinButton.isEnabled()) {
parseProteinButton.setEnabled(true);
}
}
if (computeDistButton.isEnabled()) {
computeDistButton.setEnabled(false);
}
if (tempResultsLabel != null) {
removeComponent(tempResultsLabel);
tempResultsLabel = null;
}
}
/**
* Called when parse button is clicked
*/
protected void parseProtein() {
Runnable parseTask = new Runnable() {
@Override
public void run() {
LOGGER.trace(portlet.getUser() + " Parsing protein file...");
// parse protein
ProteinParser proteinParser = new ProteinParser();
Result parsingResults = proteinParser.parse(proteinFileReader);
// update predictor
predictor.setNumberOfProteinAtoms(parsingResults.getProteinAtoms());
predictor.setNumberOfWaterMolecues(parsingResults.getWaterMolecules());
// update textfields
numberOfProteinAtomsTextField.setValue(parsingResults.getProteinAtoms());
numberOfWaterMoleculesTextField.setValue(parsingResults.getWaterMolecules());
// gui updates
computeDistButton.setEnabled(true);
parseProteinButton.setEnabled(false);
toggleProgressIndicator();
requestRepaint();
LOGGER.trace(portlet.getUser() + " Found " + predictor.getNumberOfProteinAtoms()
+ " protein atoms and " + predictor.getNumberOfWaterMolecues() + " water molecules.");
}
};
portlet.getExecutorService().execute(parseTask);
}
/**
* Called when compute button is clicked and input fields are valid.
*/
protected void computeTempDist() {
Runnable compTaks = new Runnable() {
@Override
public void run() {
replicas = predictor.start();
TemperatureDistributionResults resultComponent = new TemperatureDistributionResults(replicas);
Window subWindow = new Window("Results");
subWindow.setImmediate(true);
subWindow.setContent(resultComponent);
subWindow.getContent().setSizeUndefined();
subWindow.center();
getWindow().addWindow(subWindow);
// gui updates
if (tempResultsLabel != null) {
removeComponent(tempResultsLabel);
}
tempResultsLabel = new Label(createPrettyTempString(replicas, ", "));
tempResultsLabel.setCaption(CAPTION_LABEL_TEMPS);
addComponent(tempResultsLabel);
toggleProgressIndicator();
requestRepaint();
}
};
portlet.getExecutorService().execute(compTaks);
}
/**
* Creates a string list of temperature values, separated by given separator
*/
private String createPrettyTempString(List<IReplica> replicas, String separator) {
StringBuilder tempBuilder = new StringBuilder();
for (IReplica r : replicas) {
if (tempBuilder.length() > 0) {
tempBuilder.append(separator);
}
tempBuilder.append(r.getTemperatureAsString());
}
return tempBuilder.toString();
}
private void fillLeftColumn() {
gridLayout = new GridLayout(2, 4);
gridLayout.setSpacing(true);
createExchangeTextField();
createMaxReplicasTextField();
createTempTextFields();
createAtomCountTextFields();
addComponent(gridLayout);
createButtonContainer();
}
private void createExchangeTextField() {
pExTextField = new TextField(CAPTION_TF_PEX);
pExTextField.setDescription(TOOLTIP_TF_PEX);
pExTextField.setRequired(true);
pExTextField.setValue(new Double(0.15d));
pExTextField.addValidator(new ExchangeProbValidator());
gridLayout.addComponent(pExTextField, 0, 0);
}
private void createMaxReplicasTextField() {
maxReplicasTextField = new TextField(CAPTION_TF_MAX_REPLICAS);
maxReplicasTextField.setDescription(TOOLTIP_TF_MAX_REPLICAS);
maxReplicasTextField.setRequired(true);
maxReplicasTextField.setValue(30);
maxReplicasTextField.addValidator(new MaxReplicasValidator());
gridLayout.addComponent(maxReplicasTextField, 0, 1);
}
private void createTempTextFields() {
maxTempTextField = new TextField(CAPTION_TF_TEMP_MAX);
maxTempTextField.setDescription(TOOLTIP_TF_TEMP_MAX);
maxTempTextField.setRequired(true);
maxTempTextField.setValue(350);
maxTempTextField.addValidator(new TempMaxValidator());
minTempTextField = new TextField(CAPTION_TF_TEMP_MIN);
minTempTextField.setDescription(TOOLTIP_TF_TEMP_MIN);
minTempTextField.setRequired(true);
minTempTextField.setValue(300);
minTempTextField.addValidator(new TempMinValidator(maxTempTextField));
gridLayout.addComponent(minTempTextField, 0, 2);
gridLayout.addComponent(maxTempTextField, 1, 2);
}
private void createAtomCountTextFields() {
numberOfProteinAtomsTextField = new TextField(CAPTION_TF_NOPA);
numberOfProteinAtomsTextField.setDescription(TOOLTIP_TF_NOPA);
numberOfProteinAtomsTextField.setEnabled(false);
numberOfProteinAtomsTextField.setRequired(true);
numberOfProteinAtomsTextField.addValidator(new AtomCountValidator());
gridLayout.addComponent(numberOfProteinAtomsTextField, 0, 3);
numberOfWaterMoleculesTextField = new TextField(CAPTION_TF_NOWM);
numberOfWaterMoleculesTextField.setDescription(TOOLTIP_TF_NOWM);
numberOfWaterMoleculesTextField.setEnabled(false);
numberOfWaterMoleculesTextField.setRequired(true);
numberOfWaterMoleculesTextField.addValidator(new AtomCountValidator());
gridLayout.addComponent(numberOfWaterMoleculesTextField, 1, 3);
}
private void createButtonContainer() {
HorizontalLayout buttonContainer = new HorizontalLayout();
buttonContainer.setImmediate(true);
buttonContainer.setSpacing(true);
parseProteinButton = new Button(CAPTION_BTN_PARSE);
parseProteinButton.setImmediate(true);
parseProteinButton.setDescription(TOOLTIP_BTN_PARSE);
parseProteinButton.setEnabled(false);
parseProteinButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = -770778073112054729L;
@Override
public void buttonClick(ClickEvent event) {
toggleProgressIndicator();
parseProtein();
}
});
buttonContainer.addComponent(parseProteinButton);
computeDistButton = new Button(CAPTION_BTN_COMPUTE);
computeDistButton.setImmediate(true);
computeDistButton.setDescription(TOOLTIP_BTN_COMPUTE);
computeDistButton.setEnabled(false);
computeDistButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = -3049772021568233320L;
@Override
public void buttonClick(ClickEvent event) {
try {
pExTextField.validate();
predictor.setDesiredExchangeProbability(Double.valueOf(pExTextField.getValue().toString()));
maxReplicasTextField.validate();
predictor.setMaxNumberOfReplicas(Integer.valueOf(maxReplicasTextField.getValue().toString()));
maxTempTextField.validate();
predictor.setUpperTemperatureLimit(Double.valueOf(maxTempTextField.getValue().toString()));
minTempTextField.validate();
predictor.setLowerTemperatureLimit(Double.valueOf(minTempTextField.getValue().toString()));
numberOfProteinAtomsTextField.validate();
numberOfWaterMoleculesTextField.validate();
toggleProgressIndicator();
computeTempDist();
} catch (Exception e) {
}
}
});
buttonContainer.addComponent(computeDistButton);
progressIndicator = new ProgressIndicator();
progressIndicator.setIndeterminate(true);
progressIndicator.setVisible(false);
progressIndicator.setEnabled(false);
buttonContainer.addComponent(progressIndicator);
addComponent(buttonContainer);
}
private void toggleProgressIndicator() {
if (progressIndicator.isEnabled()) {
progressIndicator.setEnabled(false);
progressIndicator.setVisible(false);
} else {
progressIndicator.setEnabled(true);
progressIndicator.setVisible(true);
}
}
@Override
public boolean commitAndValidate() {
return replicas != null;
}
@Override
public void afterCommitAndValidate(AbstractInputMask parent) {
setTemperaturesInTemplate();
setNumberOfExecutions();
}
/**
* Creates a temperature string (for array representation) and adds it as parameter to jobs pc1 and pc2
*/
private void setTemperaturesInTemplate() {
// compute temperature string
String tempValues = createPrettyTempString(replicas, " ");
LOGGER.trace(portlet.getUser() + tempValues);
MSMLTemplate template = wkfImport.getTemplate();
String precompiler1 = RemdProperties.get(RemdProperties.REMD_PRECOMPILER1);
setTemperatures(tempValues, replicas.size(), template.getJobWithID(precompiler1));
String precompiler2 = RemdProperties.get(RemdProperties.REMD_PRECOMPILER2);
setTemperatures(tempValues, replicas.size(), template.getJobWithID(precompiler2));
}
/**
* Creates and adds a new parameter element with temperature array to parameterlist of job
*/
private void setTemperatures(String tempValues, int values, Job job) {
ArrayType arrayElement = new ArrayType();
arrayElement.setValue(tempValues);
arrayElement.setDataType("xsd:double");
arrayElement.setSize(new BigInteger(String.valueOf(values)));
ParameterType parameterElement = new ParameterType();
String tempParamRef = RemdProperties.get(RemdProperties.DICT_ENTRY_TEMP);
parameterElement.setDictRef(tempParamRef);
parameterElement.setArray(arrayElement);
job.getInitialization().getParamList().getParameter().add(parameterElement);
}
/**
* Sets the number of executions to the number of replicas
*/
private void setNumberOfExecutions() {
int number = replicas.size();
// set ports
setNumberOfInputFiles(number, RemdProperties.get(RemdProperties.REMD_PRECOMPILER1),
RemdProperties.get(RemdProperties.REMD_PRECOMPILER1_MDP_PORT));
setNumberOfInputFiles(number, RemdProperties.get(RemdProperties.REMD_PRECOMPILER2),
RemdProperties.get(RemdProperties.REMD_PRECOMPILER2_MDP_PORT));
// set mdrun param
String mdrunId = RemdProperties.get(RemdProperties.REMD_MAIN_JOB_ID);
String multiDictId = RemdProperties.get(RemdProperties.DICT_ENTRY_MULTI);
Job mdrun = wkfImport.getTemplate().getJobWithID(mdrunId);
for (ParameterType parameter : mdrun.getInitialization().getParamList().getParameter()) {
if (parameter.getDictRef().endsWith(multiDictId)) {
parameter.getScalar().setValue(Integer.valueOf(number).toString());
}
}
}
private void setNumberOfInputFiles(int number, String jobId, String portId) {
portlet.setNumberOfInputFiles(portlet.getUser().getUserID(),
wkfImport.getAsmInstance().getWorkflowName(), jobId, portId, number);
}
@Override
public void beforeSubmit(AbstractInputMask parent) {
// TODO Auto-generated method stub
}
@Override
public void beforeRemove(AbstractInputMask parent) {
// TODO Auto-generated method stub
}
@Override
public void collectUploads(UploadCollector collector) {
// TODO Auto-generated method stub
}
/* ------------------ VALIDATORS --------------------- */
/**
* Validator for exchange probability
*/
private class ExchangeProbValidator implements Validator {
private static final long serialVersionUID = 1449506506223013250L;
@Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException(
"The probability value must be numerical, greater than zero and less than one.");
}
}
@Override
public boolean isValid(Object value) {
try {
Double pExValue = Double.valueOf(value.toString());
if (pExValue > 0 && pExValue < 1) {
return true;
}
} catch (Exception e) {
// conversion error, wrong input
}
return false;
}
}
/**
* Validator of min. temperature
*/
private class TempMinValidator implements Validator {
private static final long serialVersionUID = -5315368614695447427L;
private TextField maxTf;
protected TempMinValidator(TextField maxTf) {
super();
this.maxTf = maxTf;
}
@Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException(
"The min. temperature must be numerical, greater than 0 K and smaller than the max. temperature!");
}
}
@Override
public boolean isValid(Object value) {
try {
Double minValue = Double.valueOf(value.toString());
Double maxValue = Double.valueOf(maxTf.getValue().toString());
if (minValue > 0 && minValue < maxValue) {
return true;
}
} catch (Exception e) {
// conversion error, wrong input
}
return false;
}
}
/**
* Validator of max. temperature
*/
private class TempMaxValidator implements Validator {
private static final long serialVersionUID = 1609550488273398836L;
@Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException("The max. temperature must be numerical and greater than 0 K!");
}
}
@Override
public boolean isValid(Object value) {
try {
Double maxValue = Double.valueOf(value.toString());
if (maxValue > 0) {
return true;
}
} catch (Exception e) {
// conversion error, wrong input
}
return false;
}
}
/**
* Validator of max. replicas
*/
private class MaxReplicasValidator implements Validator {
private static final long serialVersionUID = 9121439758032019463L;
@Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException("The max. number of replicas must be numerical and greater than zero!");
}
}
@Override
public boolean isValid(Object value) {
try {
Integer maxValue = Integer.valueOf(value.toString());
if (maxValue > 0) {
return true;
}
} catch (Exception e) {
// conversion error, wrong input
}
return false;
}
}
/**
* Validator for number of atoms
*/
private class AtomCountValidator implements Validator {
private static final long serialVersionUID = -4833655162718552657L;
@Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException("Must be greater or equal zero!");
}
}
@Override
public boolean isValid(Object value) {
try {
Integer count = Integer.valueOf(value.toString());
if (count >= 0) {
return true;
}
} catch (Exception e) {
// conversion error, wrong input
}
return false;
}
}
}
| [
"delagarza@9cd866b7-1dfa-4da9-9e5e-319d10d59853"
] | delagarza@9cd866b7-1dfa-4da9-9e5e-319d10d59853 |
b970920c783d19501ca2417b388c5bf861762dce | bbf996f838234477b2fc62f9b8b64f96bd1a69dc | /app/src/main/java/com/example/assignment/Dao/CourseDao.java | f73630b6e623cd9345095c72d5db73bccac58b29 | [] | no_license | tien226/HoTroHocTap | 3642ede2b633132a2e406e22eee7e88ccd6c6223 | d1fe439dd615653a4293481b9768f295e5c3c29e | refs/heads/master | 2023-05-05T15:23:02.290109 | 2021-01-06T05:05:30 | 2021-01-06T05:05:30 | 327,197,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,544 | java | package com.example.assignment.Dao;
import android.app.ActionBar;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.example.assignment.Database.DatabaseHelper;
import com.example.assignment.Model.Course;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CourseDao {
private DatabaseHelper databaseHelper;
private SQLiteDatabase sqLiteDatabase;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy");
public static final String Table_Course = "Course";
public static final String Sql_Course = "create table Course"+"(Makhoahoc text primary key, Tenkhoahoc text, Tengiangvienkhoahoc text, Ngaybatdaukhoahoc date, Ngayketthuckhoahoc date)";
public CourseDao(Context context) {
databaseHelper = new DatabaseHelper(context);
sqLiteDatabase = databaseHelper.getWritableDatabase();
}
public long insertCourse(Course course){
ContentValues contentValues = new ContentValues();
contentValues.put("Makhoahoc", course.getMakhoahoc());
contentValues.put("Tenkhoahoc", course.getTenkhoahoc());
contentValues.put("Tengiangvienkhoahoc", course.getTengiangvienkhoahoc());
contentValues.put("Ngaybatdaukhoahoc", simpleDateFormat.format(course.getNgaybatdaukhoahoc()));
contentValues.put("Ngayketthuckhoahoc", simpleDateFormat.format(course.getNgayketthuckhoahoc()));
return sqLiteDatabase.insert(Table_Course,null,contentValues);
}
public int updateCourse(Course course){
ContentValues contentValues = new ContentValues();
contentValues.put("Makhoahoc", course.getMakhoahoc());
contentValues.put("Tenkhoahoc", course.getTenkhoahoc());
contentValues.put("Tengiangvienkhoahoc", course.getTengiangvienkhoahoc());
contentValues.put("Ngaybatdaukhoahoc", simpleDateFormat.format(course.getNgaybatdaukhoahoc()));
contentValues.put("Ngayketthuckhoahoc", simpleDateFormat.format(course.getNgayketthuckhoahoc()));
return sqLiteDatabase.update(Table_Course,contentValues,"Makhoahoc=?",new String[]{course.getMakhoahoc()});
}
public int delCourse(String Makhoahoc){
return sqLiteDatabase.delete(Table_Course,"Makhoahoc=?",new String[]{Makhoahoc});
}
public List<Course> getAllCourse(){
List<Course> courseList = new ArrayList<>();
String truyvancourse = "select * from " + Table_Course;
Cursor cursor = sqLiteDatabase.rawQuery(truyvancourse,null);
if (cursor != null && cursor.getCount() > 0){
cursor.moveToFirst();
while (cursor.isAfterLast() == false){
Course course = new Course();
course.setMakhoahoc(cursor.getString(0));
course.setTenkhoahoc(cursor.getString(1));
course.setTengiangvienkhoahoc(cursor.getString(2));
try {
course.setNgaybatdaukhoahoc((Date) simpleDateFormat.parse(cursor.getString(3)));
course.setNgayketthuckhoahoc((Date) simpleDateFormat.parse(cursor.getString(4)));
} catch (ParseException e) {
e.printStackTrace();
}
courseList.add(course);
cursor.moveToNext();
}
cursor.close();
}
return courseList;
}
}
| [
"tien171196@gmail.com"
] | tien171196@gmail.com |
756dfafd734b8053e62abfc4df4b0af67b1acb0a | 78dd69b2d274d2aca00fdda2cdced1bdb9fbfb47 | /src/test/java/com/fasterxml/jackson/dataformat/xml/stream/StreamCapabilitiesTest.java | f152ca6ffbef5402d940a239d612d23008ba7e56 | [
"Apache-2.0"
] | permissive | FasterXML/jackson-dataformat-xml | c2f6a4950fcda9f21f7e8740028d695c6b432109 | 1320f003e7f7de8f06e77de76345dd8031712b2a | refs/heads/2.16 | 2023-08-28T12:53:15.207406 | 2023-07-11T20:55:54 | 2023-07-11T20:55:54 | 1,210,290 | 499 | 229 | Apache-2.0 | 2023-09-05T00:14:50 | 2010-12-31T05:00:50 | Java | UTF-8 | Java | false | false | 821 | java | package com.fasterxml.jackson.dataformat.xml.stream;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.StreamReadCapability;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
public class StreamCapabilitiesTest extends XmlTestBase
{
private final XmlMapper MAPPER = newMapper();
public void testReadCapabilities() throws Exception
{
try (JsonParser p = MAPPER.createParser("<root />")) {
assertTrue(p.getReadCapabilities().isEnabled(StreamReadCapability.DUPLICATE_PROPERTIES));
assertTrue(p.getReadCapabilities().isEnabled(StreamReadCapability.SCALARS_AS_OBJECTS));
assertTrue(p.getReadCapabilities().isEnabled(StreamReadCapability.UNTYPED_SCALARS));
}
}
}
| [
"tatu.saloranta@iki.fi"
] | tatu.saloranta@iki.fi |
edb19b5d74cb9c743fdc333627282852bf8ba7a0 | 91f1445799f8b53342fd8774fad9c66ef479871c | /src/main/java/org/apache/storm/trident/DiagnosisEventSpout.java | 65d8409b49a77e2caf35dae7359c36643de25762 | [] | no_license | alcret/Storm_Learn_IDEA | a2bcfae7afcb21416e7ed3a638cfa355181607b8 | a53d32d3e0cb2bd9da1c37f7692e1ce788b8cc29 | refs/heads/master | 2021-01-01T16:43:16.240724 | 2017-07-26T03:00:23 | 2017-07-26T03:00:23 | 97,809,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package org.apache.storm.trident;
import java.util.Map;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.tuple.Fields;
import storm.trident.spout.ITridentSpout;
public class DiagnosisEventSpout implements ITridentSpout<Long>{
private SpoutOutputCollector collector;
private BatchCoordinator<Long> coordinator = new DefaultCoordinator();
private Emitter<Long> emitter = new DiagnosisEventEmmiter();
public Map getComponentConfiguration() {
return null;
}
public BatchCoordinator<Long> getCoordinator(String txStateId, Map conf, TopologyContext context) {
return coordinator;
}
public Emitter<Long> getEmitter(String txStateId, Map conf, TopologyContext context) {
return emitter;
}
public Fields getOutputFields() {
return new Fields("event");
}
}
| [
"alcret@163.com"
] | alcret@163.com |
8e46048f0807ada48f465f5bb424b23cf070a99b | c672188870d2d239611e3eae0a3ede4cf0b41393 | /app/src/main/java/com/example/guerson/top/ArtistaAdapter.java | c243ed081b8d0853563dcfa285d0e6df8dd6d05d | [] | no_license | guerson9112/Top | 63f12deb89ba67b0fc2e267677c588b50c7cf1a7 | 083a9d43cc7fcec9de885138e55591ab6cf4c78c | refs/heads/master | 2020-06-11T14:44:36.570862 | 2019-06-27T01:33:49 | 2019-06-27T01:33:49 | 194,001,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,815 | java | package com.example.guerson.top;
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ArtistaAdapter extends RecyclerView.Adapter<ArtistaAdapter.ViewHolder> {
private List<Artista> artistas;
private Context context;
private OnItemClickListener listener;
public ArtistaAdapter(List<Artista> artistas, OnItemClickListener listener) {
this.artistas = artistas;
this.listener = listener;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_artist, parent,
false);
this.context = parent.getContext();
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final Artista artista = artistas.get(position);
holder.setListener(artista, listener);
holder.tvNombre.setText(artista.getNombreCompleto());
holder.tvOrder.setText(String.valueOf(artista.getOrden()));
if (artista.getFotoUrl() != null){
RequestOptions options = new RequestOptions();
options.diskCacheStrategy(DiskCacheStrategy.ALL);
options.centerCrop();
options.placeholder(R.drawable.ic_sentiment_satisfied);
Glide.with(context)
.load(artista.getFotoUrl())
.apply(options)
.into(holder.imgFoto);
}else{
holder.imgFoto.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_account_box));
}
}
@Override
public int getItemCount() {
return this.artistas.size();
}
public void add(Artista artista){
if (!artistas.contains(artista)) {
artistas.add(artista);
notifyDataSetChanged();
}
}
public void setList(List<Artista> list) {
this.artistas = list;
notifyDataSetChanged();
}
public void remove(Artista artista) {
if (artistas.contains(artista)){
artistas.remove(artista);
notifyDataSetChanged();
}
}
class ViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.imgFoto)
AppCompatImageView imgFoto;
@BindView(R.id.tvNombre)
AppCompatTextView tvNombre;
@BindView(R.id.tvOrder)
AppCompatTextView tvOrder;
@BindView(R.id.containerMain)
RelativeLayout containerMain;
ViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
void setListener(final Artista artista, final OnItemClickListener listener){
containerMain.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClick(artista);
}
});
containerMain.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
listener.onLongItemClick(artista);
return true;
}
});
}
}
}
| [
"guerson.maldonado@epn.edu.ec"
] | guerson.maldonado@epn.edu.ec |
d58c965d1fbef33df18f32109e9563566913410e | ef48f431e966d8581c90c682d57cbe4be372ec7a | /app/src/main/java/sg/edu/nus/gps/MapsActivity.java | ea86e21bde47de89bd3df752c511b8430bd99374 | [] | no_license | DavidGoodfellow/MultimodalGPSTracker | 4cbd506e700f9b5152c2bf2e390504cd5291d075 | 9a20f47175ff09957520d0a303576ca37c609586 | refs/heads/master | 2021-04-27T04:30:29.247741 | 2018-02-23T06:06:04 | 2018-02-23T06:06:04 | 122,579,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,554 | java | package sg.edu.nus.gps;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.location.LocationServices;
import com.jjoe64.graphview.series.DataPoint;
import java.text.DecimalFormat;
import java.util.Vector;
import static sg.edu.nus.gps.R.id.coordinates;
import static sg.edu.nus.gps.R.id.readingNumber1;
public class MapsActivity extends Activity implements ConnectionCallbacks,
OnConnectionFailedListener, LocationListener {
//----------------
//VARIABLES
//----------------
// LogCat tag
private static final String TAG = MapsActivity.class.getSimpleName();
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
private Location mLastLocation;
// Google client to interact with Google API
private GoogleApiClient mGoogleApiClient;
//my variables
private Vector<DataPoint> locations;
private TextView lat_lng;
private TextView number_of_loc;
private Button show_location;
private Intent myIntent;
private TableLayout tableLayout;
private DataPoint center;
double[] new_point;
private LocationListener locationListener;
private LocationManager locationManager;
//---------------------
//ONCREATE
//instantiates objects and checks permissions
//---------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
//my variables
lat_lng = (TextView) findViewById(coordinates);
number_of_loc = (TextView) findViewById(readingNumber1);
tableLayout = (TableLayout) findViewById(R.id.tableLayout1);
locations = new Vector<>();
show_location = (Button) findViewById(R.id.button);
number_of_loc.setText("0");
center = new DataPoint(1.298732, 103.778344);
// First we need to check availability of play services
if (checkPlayServices()) {
// Building the GoogleApi client
buildGoogleApiClient();
}
// Show location button click listener
show_location.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
displayLocation();
}
});
//setting up location manager
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 200, 1, this);
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 200, 1, this);
}
//------------------------------------
//set up location listener & helpers
//------------------------------------
@Override
public void onLocationChanged(Location location) {
System.out.println("onLocationChanged!!!");
mLastLocation = location;
}
@Override
public void onStatusChanged(String s, int i, Bundle bundle) {
}
@Override
public void onProviderEnabled(String s) {
}
@Override
public void onProviderDisabled(String s) {
}
//---------------------------------------
//OnClick Functions
//---------------------------------------
//display location on the UI once the button is clicked
private void displayLocation() {
if (mLastLocation != null) {
double latitude = mLastLocation.getLatitude();
double longitude = mLastLocation.getLongitude();
new_point = new double[2];
new_point = ll_to_xy(center.getX(),center.getY(),latitude,longitude);
lat_lng.setText("X: " + Double.parseDouble(new DecimalFormat("##.###").format(new_point[0]))
+ "m, Y: " + Double.parseDouble(new DecimalFormat("##.###").format(new_point[1])) + "m");
TableRow row = new TableRow(this);
TextView rowText = new TextView(this);
rowText.setText("X: " + Double.parseDouble(new DecimalFormat("##.###").format(new_point[0]))
+ "m, Y: " + Double.parseDouble(new DecimalFormat("##.###").format(new_point[1])) + "m");
row.addView(rowText);
tableLayout.addView(row);
//add to the location vector
locations.add(new DataPoint(new_point[0],new_point[1]));
//change the number of locations to +1
String number_loc_string = number_of_loc.getText().toString();
int number_loc_int = Integer.parseInt(number_loc_string);
number_loc_int++;
number_loc_string = Integer.toString(number_loc_int);
number_of_loc.setText(number_loc_string);
} else {
lat_lng.setText("Error. Please Reset.");
}
}
public void onClick_get_mean(View view){
//new activity to display
myIntent = new Intent(this, GPSMapActivity.class);
myIntent.putExtra("vector", locations);
startActivity(myIntent);
}
public void onClick_clear_history(View view){
//delete the data within the vector and table
locations.clear();
tableLayout.removeAllViews();
number_of_loc.setText("0");
lat_lng.setText("");
}
//----------------------------------------------
//LatLng to XY Converter Helper Functions
//----------------------------------------------
public double[] ll_to_xy(double orig_long,double orig_lat,double new_long,double new_lat){
double rotation_angle = 0;
double xx,yy,r,ct,st,angle;
angle = degree_to_rad(rotation_angle);
xx = (new_long-orig_long)*meters_deg_long(orig_lat);
yy = (new_lat-orig_lat)*meters_deg_lat(orig_lat);
r = Math.sqrt(xx*xx + yy*yy);
if(r != 0){
ct = xx/r;
st = yy/r;
xx = r * (ct*Math.cos(angle) + st*Math.cos(angle));
yy = r * (st*Math.cos(angle) - ct*Math.cos(angle));
}
double[] vals = new double[2];
vals[0] = xx;
vals[1] = yy;
return vals;
}
double degree_to_rad(double deg1){
return deg1/57.2957795;
}
double meters_deg_long(double d){
double d2r = degree_to_rad(d);
return ((111415.13 * Math.cos(d2r)) - (94.55 * Math.cos(3.0*d2r))
+ (0.12 * Math.cos(5.0*d2r)));
}
double meters_deg_lat(double d){
double d2r = degree_to_rad(d);
return (111132.09 - (566.05 * Math.cos(2.0*d2r)) + (1.20 * Math.cos(4.0*d2r))
- (0.002 * Math.cos(6.0 * d2r)));
}
//-----------------------------------------------
//FOR THE DIFFERENT STAGES IN ACTIVITY LIFECYCLE
//-----------------------------------------------
@Override
protected void onStart() {
super.onStart();
if (mGoogleApiClient != null) {
mGoogleApiClient.connect();
}
}
@Override
protected void onResume() {
super.onResume();
checkPlayServices();
}
public void goToMainActivity(View view) {
// please fill in your code here. Remember to stop drawing before you return to the MainActivity.
finish();
}
//--------------------------------
//CHECKING GOOGLE PLAY SERVICES
//--------------------------------
//creating google api client
protected synchronized void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API).build();
}
// Method to verify google play services on the device
private boolean checkPlayServices() {
int resultCode = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Toast.makeText(getApplicationContext(),
"This device is not supported.", Toast.LENGTH_LONG)
.show();
finish();
}
return false;
}
return true;
}
@Override
public void onConnectionFailed(ConnectionResult result) {
Log.i(TAG, "Connection failed: ConnectionResult.getErrorCode() = "
+ result.getErrorCode());
}
@Override
public void onConnected(Bundle arg0) {
// Once connected with google api, get the location
//displayLocation();
}
@Override
public void onConnectionSuspended(int arg0) {
mGoogleApiClient.connect();
}
}
| [
"dgoodfel@usc.edu"
] | dgoodfel@usc.edu |
da1858004bd3b5a6e1d6001c52d378fa3003a3c5 | d3cb5b8a2902b5af0210fd195015c80a488f6c3d | /src/main/java/com/veera/secondarysort/demo2/StockKey.java | 60bd282b760174b2a6465f85d1ba13e1c758ceb5 | [] | no_license | luckyakhi/BigDataTraining | c2130b104b181567d8928a31c599e24dbdbea103 | 8dbe84dd3b4e4703af3e36a5600d0e744e7cf8e0 | refs/heads/master | 2020-02-26T16:50:13.605329 | 2017-04-16T14:48:27 | 2017-04-16T14:48:27 | 71,615,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,522 | java | /**
* Copyright 2012 Jee Vang
*
* 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.veera.secondarysort.demo2;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableUtils;
/**
* Stock key. This key is a composite key. The "natural"
* key is the symbol. The secondary sort will be performed
* against the timestamp.
* @author Jee Vang
*
*/
public class StockKey implements WritableComparable<StockKey> {
private String symbol;
private Long timestamp;
/**
* Constructor.
*/
public StockKey() { }
/**
* Constructor.
* @param symbol Stock symbol. i.e. APPL
* @param timestamp Timestamp. i.e. the number of milliseconds since January 1, 1970, 00:00:00 GMT
*/
public StockKey(String symbol, Long timestamp) {
this.symbol = symbol;
this.timestamp = timestamp;
}
@Override
public String toString() {
return (new StringBuilder())
.append('{')
.append(symbol)
.append(',')
.append(timestamp)
.append('}')
.toString();
}
@Override
public void readFields(DataInput in) throws IOException {
symbol = WritableUtils.readString(in);
timestamp = in.readLong();
}
@Override
public void write(DataOutput out) throws IOException {
WritableUtils.writeString(out, symbol);
out.writeLong(timestamp);
}
@Override
public int compareTo(StockKey o) {
int result = symbol.compareTo(o.symbol);
if(0 == result) {
result = timestamp.compareTo(o.timestamp);
}
return result;
}
/**
* Gets the symbol.
* @return Symbol.
*/
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
/**
* Gets the timestamp.
* @return Timestamp. i.e. the number of milliseconds since January 1, 1970, 00:00:00 GMT
*/
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
}
| [
"asi304@sapient.com"
] | asi304@sapient.com |
358bd69ec61f64b85d7504371429f8b2a497bd30 | cef995552d1a95a7158db94fb56b431d056eb965 | /Workshop-MAY-2016/webapp/src/main/java/com/server/model/DataProvider.java | a2c384179eeaa34582b7c2d5041aebe6aae3f68b | [] | no_license | sunxr0119/cdqa-community | 18fab45068fe6b7351c18be7a016243007d1b80c | ea90731e4ff168093f7f48a17227ae4bfe9e4028 | refs/heads/master | 2020-04-15T01:40:02.421498 | 2018-12-11T10:11:19 | 2018-12-11T10:11:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java | package com.server.model;
import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Created by xiaoxu on 4/19/16.
*/
abstract class DataProvider {
@Autowired
protected SourceProperty sourceProperty;
public DataProvider() {
}
public JsonNode GetSource(SourceEnum sourceEnum, String para, String value) {
return null;
}
public Data PickupItemViaBrand(SourceEnum sourceEnum, String para, String value) {
Data data = new Data();
String brand;
String model;
String provider;
Double price;
JsonNode root = GetSource(sourceEnum,para,value).path("Data");
// 遍历 products 内的 array
for (JsonNode objNode : root) {
brand = objNode.get("brand").toString();
model = objNode.get("model").toString();
price = objNode.get("price").asDouble();
provider = objNode.get("provider").toString();
if (para == "mod"){
if (model.contains(value) && PriceIsCheaperThanLastOne(price, data.getPrice())) {
data.setBrand(brand);
data.setModel(model);
data.setPrice(price);
data.setProvider(provider);
}
}else {
if (brand.contains(value) && PriceIsCheaperThanLastOne(price, data.getPrice())) {
data.setBrand(brand);
data.setModel(model);
data.setPrice(price);
data.setProvider(provider);
}
}
}
return data;
}
private Boolean PriceIsCheaperThanLastOne(Double price, Double current_price) {
if (price - current_price < 0) {
return true;
}
return false;
}
}
| [
"xiaoxu@thoughtworks.com"
] | xiaoxu@thoughtworks.com |
55667d57c19d24cd9ce26be3dfc9185cdd61c68b | 903ae1e68a3c1df23a2ac93f23c6d80ae09ceee4 | /myshop-pojo/src/main/java/com/myshop/pojo/TbItemCatExample.java | 0bb9b70a08864069e449518b6e42ea8a8b204134 | [] | no_license | LostViper/myshop-parent | b1c2f5ae9d9d1199cb1d0deeb0aa639f087aa9be | 3f631cb0fa3e1ec15f6bc8dd62fd84f7dcf2d1bf | refs/heads/master | 2020-03-28T11:29:22.011724 | 2018-09-10T21:08:20 | 2018-09-10T21:08:20 | 148,219,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,608 | java | package com.myshop.pojo;
import java.util.ArrayList;
import java.util.List;
public class TbItemCatExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TbItemCatExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(Long value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(Long value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(Long value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(Long value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<Long> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<Long> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(Long value1, Long value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTypeIdIsNull() {
addCriterion("type_id is null");
return (Criteria) this;
}
public Criteria andTypeIdIsNotNull() {
addCriterion("type_id is not null");
return (Criteria) this;
}
public Criteria andTypeIdEqualTo(Long value) {
addCriterion("type_id =", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotEqualTo(Long value) {
addCriterion("type_id <>", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdGreaterThan(Long value) {
addCriterion("type_id >", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdGreaterThanOrEqualTo(Long value) {
addCriterion("type_id >=", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdLessThan(Long value) {
addCriterion("type_id <", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdLessThanOrEqualTo(Long value) {
addCriterion("type_id <=", value, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdIn(List<Long> values) {
addCriterion("type_id in", values, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotIn(List<Long> values) {
addCriterion("type_id not in", values, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdBetween(Long value1, Long value2) {
addCriterion("type_id between", value1, value2, "typeId");
return (Criteria) this;
}
public Criteria andTypeIdNotBetween(Long value1, Long value2) {
addCriterion("type_id not between", value1, value2, "typeId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"zzusutao@126.com"
] | zzusutao@126.com |
e696476b0be8b5f88bd20d3b6526cac53db22f63 | 34f4b13acf9b05e53ffd37943cb57f57ca27b9a6 | /src/main/java/com/huucong/service/EmployeeService.java | fb6fa1f21444b900cabb5bb717f1086c2a01c6ad | [] | no_license | thedevil94/Employee-Management | d81b8409ebf36d122df1735a9b2fcab19e3107f8 | 1195a01b5bb9ebab4de5665ef4d55eec8816ab2e | refs/heads/master | 2020-09-13T05:35:32.386859 | 2019-11-20T08:09:14 | 2019-11-20T08:09:14 | 222,668,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | package com.huucong.service;
import com.huucong.model.Department;
import com.huucong.model.Employee;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface EmployeeService {
Page<Employee> findAll(Pageable pageable);
Employee findById(int id);
void save(Employee employee);
void remove(int id);
Iterable<Employee> findAllByDepartment(Department department);
Page<Employee> findAllByDepartment(Department department, Pageable pageable);
Page<Employee> findAllByOrderBySalaryAsc(Pageable pageable);
Page<Employee> findAllByOrderBySalaryDesc(Pageable pageable);
}
| [
"congphamhuu1994@gmail.com"
] | congphamhuu1994@gmail.com |
b909fb555182fa2728e69fe83b0a69eb559a80cb | 43c05e3a35e971032d994bc35ad8bb06fd7a6154 | /app/src/main/java/com/brijesh/musicplayer/Util/widget/IndexScroller.java | 16cba0dee180da95f64142e20ea992c533571939 | [] | no_license | brijeshambitious/MusicPlayer | e36bd8942c34e3630b9d69528796933f72ff6813 | 1c308b6fecae79eb483636422df6bd1a9f6c052a | refs/heads/master | 2021-04-15T15:34:41.822896 | 2018-03-24T20:22:03 | 2018-03-24T20:22:03 | 124,648,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,130 | java | /*
* Copyright 2011 woozzu
*
* 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.brijesh.musicplayer.Util.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.view.MotionEvent;
import android.widget.Adapter;
import android.widget.ListView;
import android.widget.SectionIndexer;
public class IndexScroller {
private float mIndexbarWidth;
private float mIndexbarMargin;
private float mPreviewPadding;
private float mDensity;
private float mScaledDensity;
private float mAlphaRate;
private int mState = STATE_HIDDEN;
private int mListViewWidth;
private int mListViewHeight;
private int mCurrentSection = -1;
private boolean mIsIndexing = false;
private ListView mListView = null;
private SectionIndexer mIndexer = null;
private String[] mSections = null;
private RectF mIndexbarRect;
private static final int STATE_HIDDEN = 0;
private static final int STATE_SHOWING = 1;
private static final int STATE_SHOWN = 2;
private static final int STATE_HIDING = 3;
public IndexScroller(Context context, ListView lv) {
mDensity = context.getResources().getDisplayMetrics().density;
mScaledDensity = context.getResources().getDisplayMetrics().scaledDensity;
mListView = lv;
setAdapter(mListView.getAdapter());
mIndexbarWidth = 20 * mDensity;
mIndexbarMargin = 2 * mDensity;
mPreviewPadding = 0 * mDensity;
}
public void draw(Canvas canvas) {
if (mState == STATE_HIDDEN)
return;
// mAlphaRate determines the rate of opacity
Paint indexbarPaint = new Paint();
indexbarPaint.setColor(Color.TRANSPARENT);
indexbarPaint.setAlpha((int) (0 * mAlphaRate));
indexbarPaint.setAntiAlias(true);
canvas.drawRoundRect(mIndexbarRect, 5 * mDensity, 5 * mDensity, indexbarPaint);
if (mSections != null && mSections.length > 0) {
Paint indexPaint = new Paint();
indexPaint.setColor(Color.argb(100, 255, 44, 85));
indexPaint.setAlpha((int) (255 * mAlphaRate));
indexPaint.setAntiAlias(true);
indexPaint.setFakeBoldText(true);
indexPaint.setTextSize(12 * mScaledDensity);
float sectionHeight = (mIndexbarRect.height() - 2 * mIndexbarMargin) / mSections.length;
float paddingTop = (sectionHeight - (indexPaint.descent() - indexPaint.ascent())) / 2;
for (int i = 0; i < mSections.length; i++) {
float paddingLeft = (mIndexbarWidth - indexPaint.measureText(mSections[i])) / 2;
canvas.drawText(mSections[i], mIndexbarRect.left + paddingLeft
, mIndexbarRect.top + mIndexbarMargin + sectionHeight * i + paddingTop - indexPaint.ascent(), indexPaint);
}
}
}
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
// If down event occurs inside index bar region, start indexing
if (mState != STATE_HIDDEN && contains(ev.getX(), ev.getY())) {
setState(STATE_SHOWN);
// It demonstrates that the motion event started from index bar
mIsIndexing = true;
// Determine which section the point is in, and move the list to that section
mCurrentSection = getSectionByPoint(ev.getY());
mListView.setSelection(mIndexer.getPositionForSection(mCurrentSection));
return true;
}
break;
case MotionEvent.ACTION_MOVE:
if (mIsIndexing) {
// If this event moves inside index bar
if (contains(ev.getX(), ev.getY())) {
// Determine which section the point is in, and move the list to that section
mCurrentSection = getSectionByPoint(ev.getY());
mListView.setSelection(mIndexer.getPositionForSection(mCurrentSection));
}
return true;
}
break;
case MotionEvent.ACTION_UP:
if (mIsIndexing) {
mIsIndexing = false;
mCurrentSection = -1;
}
if (mState == STATE_SHOWN)
setState(STATE_HIDING);
break;
}
return false;
}
public void onSizeChanged(int w, int h, int oldw, int oldh) {
mListViewWidth = w;
mListViewHeight = h;
mIndexbarRect = new RectF(w - mIndexbarMargin - mIndexbarWidth
, 20*mIndexbarMargin
, w - 4*mIndexbarMargin
, h - 20*mIndexbarMargin);
}
public void show() {
if (mState == STATE_HIDDEN)
setState(STATE_SHOWING);
else if (mState == STATE_HIDING)
setState(STATE_HIDING);
}
public void setAdapter(Adapter adapter) {
if (adapter instanceof SectionIndexer) {
mIndexer = (SectionIndexer) adapter;
mSections = (String[]) mIndexer.getSections();
}
}
private void setState(int state) {
if (state < STATE_HIDDEN || state > STATE_HIDING)
return;
mState = state;
switch (mState) {
case STATE_HIDDEN:
// Cancel any fade effect
mHandler.removeMessages(0);
break;
case STATE_SHOWING:
// Start to fade in
mAlphaRate = 0;
fade(0);
break;
case STATE_SHOWN:
// Cancel any fade effect
mHandler.removeMessages(0);
break;
case STATE_HIDING:
// Start to fade out after three seconds
mAlphaRate = 1;
fade(3000);
break;
}
}
public boolean contains(float x, float y) {
// Determine if the point is in index bar region, which includes the right margin of the bar
return (x >= mIndexbarRect.left && y >= mIndexbarRect.top && y <= mIndexbarRect.top + mIndexbarRect.height());
}
private int getSectionByPoint(float y) {
if (mSections == null || mSections.length == 0)
return 0;
if (y < mIndexbarRect.top + mIndexbarMargin)
return 0;
if (y >= mIndexbarRect.top + mIndexbarRect.height() - mIndexbarMargin)
return mSections.length - 1;
return (int) ((y - mIndexbarRect.top - mIndexbarMargin) / ((mIndexbarRect.height() - 2 * mIndexbarMargin) / mSections.length));
}
private void fade(long delay) {
mHandler.removeMessages(0);
mHandler.sendEmptyMessageAtTime(0, SystemClock.uptimeMillis() + delay);
}
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (mState) {
case STATE_SHOWING:
// Fade in effect
mAlphaRate += (1 - mAlphaRate) * 0.2;
if (mAlphaRate > 0.9) {
mAlphaRate = 1;
setState(STATE_SHOWN);
}
mListView.invalidate();
fade(10);
break;
case STATE_SHOWN:
// If no action, hide automatically
setState(STATE_HIDING);
break;
case STATE_HIDING:
// Fade out effect
mAlphaRate -= mAlphaRate * 0.2;
if (mAlphaRate < 0.1) {
mAlphaRate = 0;
setState(STATE_HIDDEN);
}
mListView.invalidate();
fade(10);
break;
}
}
};
}
| [
"hitesh56103@gmail.com"
] | hitesh56103@gmail.com |
c57c246ed7649c413b26332465bc9434ed517d98 | 22c5c21eb1477a756133dd80408f7bbd8bb04287 | /cuidebemsvc/src/main/java/br/com/cuidebem/rs/email/Desbloqueio.java | 557072f3ad7fcef5c1779c5da58022bfb686894f | [] | no_license | alecindro/cuidebemrs | 9b3aabdc822c459ae0cd6ff05ef42a6638d93a81 | 5e1c231f36b896fd84a99509f5971475f531855d | refs/heads/master | 2021-01-16T18:22:07.468205 | 2018-11-08T03:07:00 | 2018-11-08T03:07:00 | 100,064,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package br.com.cuidebem.rs.email;
import javax.ejb.EJB;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import br.com.cuidebem.controller.UsersFacade;
import br.com.cuidebem.controller.exception.ControllerException;
@Path("/desbloqueio/{email}/{app}")
public class Desbloqueio {
@EJB
private UsersFacade usersFacade;
@GET
@Produces("text/html")
public String aceite(@PathParam("email") String email,@PathParam("app") String app) {
try {
usersFacade.confirmaAceite(email);
return PagesHTML.desbloqueio(app);
} catch (ControllerException e) {
return PagesHTML.return_oops_desbloqueio.replace(PagesHTML.message, e.getMessage());
}
}
}
| [
"alecindrocastilho@DESKTOP-N1PNR9H"
] | alecindrocastilho@DESKTOP-N1PNR9H |
a6d7efec1bef585a702a2e92776adbc235020113 | 98629cbad7b03acc638725e3288cf3e3aa68f517 | /ssm/hungry/src/main/java/com/qxt/service/MergantService.java | 836e4befb54df2e1e1d701c1afa837fa850440a6 | [] | no_license | jacklon/HungryCMS | 078fe02d685de822781e5f7d76458c2f1f0356b6 | 5b54f6e997b9cf028f31dd92effc2156a47b2bdc | refs/heads/master | 2022-01-13T02:27:18.346047 | 2018-07-17T18:32:01 | 2018-07-17T18:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,111 | java | package com.qxt.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qxt.Constants;
import com.qxt.dao.AccountMapper;
import com.qxt.dao.MergantMapper;
import com.qxt.pojo.Mergant;
@Service
public class MergantService {
@Autowired
MergantMapper MergantDao;
@Autowired
AccountMapper accountDao;
public PageInfo<Mergant> selectAllMergant(int pageNum, Mergant bean) {
PageHelper.startPage(pageNum, Constants.PAGE_SIZE);
// System.out.println(MergantDao.selectAll(bean));
return new PageInfo<Mergant>(MergantDao.selectAll(bean));
}
public Mergant getMergantById(Long id) {
return MergantDao.selectByPrimaryKey(id);
}
@Transactional
public int insertMergant(Mergant bean) {
System.out.println(bean);
return MergantDao.insert(bean);
}
@Transactional
public int updateMergant(Mergant bean) {
return MergantDao.updateByPrimaryKey(bean);
}
@Transactional
public Boolean deleteMergant(Long id) {
if(id == null) {
return false;
}else {
accountDao.deleteByPrimaryKey(id);
return true;
}
}
/**
* 验证 Mergant类型数据合法
* @param bean
* @param errMsg
* @return
*/
public boolean isVaildMergant(Mergant bean,StringBuffer errMsg) {
if(bean == null) {
errMsg.append("该Mergant信息构建异常!");return false;
}
if(bean.getmName() == null || bean.getmName().isEmpty()) {
errMsg.append("昵称不能为空!");return false;
}else if(bean.getmName().length() < 2 || bean.getmName().length() >20){
errMsg.append("昵称长度为2-20字符!");return false;
}
if(bean.getLocation()== null) {
errMsg.append("地址不能为空!");return false;
}
if(bean.getmTel() != null && !bean.getmTel().isEmpty()) {
if(!bean.getmTel().matches("^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$")) {
errMsg.append("手机号不正确!");return false;
}
}
return true;
}
}
| [
"dy_wd@qq.com"
] | dy_wd@qq.com |
1874742ddfbefe40b7103f8ae9911cec90f6990c | cc058862470876fdcd5b86bc64572e7c1c9b8cfe | /app/src/main/java/com/lenny/framedemo/compent/cdi/CDI.java | 26fa254bb1a65b73768551e3deb2806e0edaa824 | [] | no_license | LiuLei0571/frameDemo | e992cba242f6003edff32f1a8966f628ef3c3c1f | db5e8d851d508cac165109d0fe8f8fe07e1307e9 | refs/heads/master | 2021-01-19T16:11:17.294829 | 2017-05-09T02:16:44 | 2017-05-09T02:16:44 | 88,254,599 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,039 | java | package com.lenny.framedemo.compent.cdi;
import android.content.Context;
import com.lenny.framedemo.compent.base.BaseActivity;
import com.lenny.framedemo.compent.base.BaseDialog;
import com.lenny.framedemo.compent.base.IFragment;
import com.lenny.framedemo.compent.cdi.cmp.ActivityComponent;
import com.lenny.framedemo.compent.cdi.cmp.ActivityModule;
import com.lenny.framedemo.compent.cdi.cmp.AppComponent;
import com.lenny.framedemo.compent.cdi.cmp.AppModule;
import com.lenny.framedemo.compent.cdi.cmp.DaggerAppComponent;
import com.lenny.framedemo.compent.cdi.cmp.DialogComponent;
import com.lenny.framedemo.compent.cdi.cmp.DialogModule;
import com.lenny.framedemo.compent.cdi.cmp.FragmentComponent;
import com.lenny.framedemo.compent.cdi.cmp.FragmentModule;
import com.lenny.framedemo.compent.cdi.cmp.ManagerModule;
/**
* 用途:
* Created by milk on 17/4/17.
* 邮箱:649444395@qq.com
*/
public class CDI {
private static AppComponent sAppComponent;
public static AppComponent getAppComponent() {
return sAppComponent;
}
public static void init(Context context) {
AppModule appModule = new AppModule(context);
ManagerModule managerModule = new ManagerModule();
sAppComponent = DaggerAppComponent.builder()
.appModule(appModule)
.managerModule(managerModule)
.build();
}
public static ActivityComponent createActivityComponent(BaseActivity activity) {
ActivityComponent activityComponent = sAppComponent.plus(new ActivityModule(activity));
return activityComponent;
}
public static FragmentComponent createFragmentComponent(IFragment iFragment) {
FragmentComponent fragmentComponent = sAppComponent.plus(new FragmentModule(iFragment));
return fragmentComponent;
}
public static DialogComponent createDialogComponent(BaseDialog dialog) {
DialogComponent dialogComponent = sAppComponent.plus(new DialogModule(dialog));
return dialogComponent;
}
}
| [
"liulei2@aixuedai.com"
] | liulei2@aixuedai.com |
479892feea87d8a340bb103ca5992ca6bc059212 | 82b174612a480d4cab4049b082199c0410741432 | /IOCProjAnno53-Component/src/main/java/com/nt/beans/Student.java | 4e0798f7b3fead0f0161683e5b2fd8ac5a694431 | [] | no_license | pratikrohokale/SPRINGREFCORE | 7d5df0c6988226eefc57fdc74222a9cb80bfd92c | aedb550265ac1aa7a945062d7f0dad6425440bb7 | refs/heads/master | 2021-07-05T09:01:44.943257 | 2019-06-20T05:03:08 | 2019-06-20T05:03:08 | 192,851,623 | 0 | 0 | null | 2020-10-13T14:02:16 | 2019-06-20T05:01:43 | Java | UTF-8 | Java | false | false | 498 | java | package com.nt.beans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component("st")
@Scope("prototype")
public class Student {
@Autowired(required=true)
private Course course;
public Student() {
System.out.println("Student:0-param constructor");
}
@Override
public String toString() {
return "Student [course=" + course + "]";
}
}//class
| [
"prohokale01@gmail.com"
] | prohokale01@gmail.com |
1746ba37781b5c3823214d7e41301c0ca5aab58c | 093f97eeda83ddde5dd7425af6f3b918d7bdfb13 | /experimental/lod/src/test/java/harmony/lod/operator/SizeTest.java | 090ea62d2e63addce1ae28efc8cbb8c63aa4c1fa | [] | no_license | enridaga/harmony | 816f599c058895c0b628b33a0da226864d7341f6 | 96fcafbe4d298bdf234867315e879e88196b7c9f | refs/heads/master | 2022-11-26T13:22:11.179280 | 2022-11-20T17:28:00 | 2022-11-20T17:28:00 | 53,848,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,692 | java | package harmony.lod.operator;
import harmony.core.api.fact.Fact;
import harmony.core.api.goal.Goal;
import harmony.core.api.operator.Action;
import harmony.core.api.operator.Operator;
import harmony.core.api.plan.Plan;
import harmony.core.api.property.Property;
import harmony.core.api.renderer.Renderer;
import harmony.core.api.thing.Thing;
import harmony.core.impl.fact.BasicFact;
import harmony.core.impl.goal.GoalImpl;
import harmony.core.impl.renderer.RendererImpl;
import harmony.core.impl.state.InitialState;
import harmony.lod.model.api.dataset.TempDataset;
import harmony.lod.model.api.slice.StatementTemplate;
import harmony.lod.model.api.symbol.IRI;
import harmony.lod.model.impl.dataset.TempDatasetImpl;
import harmony.lod.model.impl.slice.PathException;
import harmony.lod.model.impl.slice.StatementTemplateImpl;
import harmony.lod.model.impl.symbol.DatatypeImpl;
import harmony.lod.model.impl.symbol.IRIImpl;
import harmony.lod.property.Extracted;
import harmony.lod.property.HasSlice;
import harmony.lod.property.IsSizable;
import harmony.lod.property.Linked;
import harmony.lod.property.Renewed;
import harmony.planner.NoSolutionException;
import harmony.planner.PlannerInput;
import harmony.planner.bestfirst.BestFirstPlanner;
import harmony.planner.bestfirst.BestFirstSearchReport;
import harmony.planner.bestfirst.Node;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SizeTest {
TempDataset tmp = null;
StatementTemplate friend = null;
IRI predicate = null;
IRI sized = null;
PlannerInput input = null;
Renderer rendy = new RendererImpl();
Logger log = LoggerFactory.getLogger(getClass());
@Before
public void setup() throws PathException {
tmp = new TempDatasetImpl();
friend = new StatementTemplateImpl(null, new IRIImpl("hasFriend"));
predicate = new IRIImpl("hasFriend");
sized = new IRIImpl("numberOfFriends");
final StatementTemplate sizeOfFriends = new StatementTemplateImpl(null,
new IRIImpl("numberOfFriends"), new DatatypeImpl(new IRIImpl(
"http://www.w3.org/2001/XMLSchema#int")));
input = new PlannerInput() {
@Override
public Thing[] getObjects() {
return new Thing[] { tmp, predicate, sized };
}
@Override
public InitialState getInitialState() {
Fact[] initial = new Fact[] {
new BasicFact(new HasSlice(), tmp, friend),
new BasicFact(new Extracted(), friend),
new BasicFact(new IsSizable(), predicate, sized) };
return new InitialState(initial, new Thing[]{});
}
@Override
public Goal getGoal() {
Fact[] facts = new Fact[] { new BasicFact(new HasSlice(), tmp,
sizeOfFriends) };
return new GoalImpl(facts);
}
@Override
public Property[] getProperty() {
return new Property[] { new HasSlice(), new IsSizable(),
new Renewed(), new Linked() };
}
@Override
public Operator[] getOperators() {
return new Operator[] { new Size(), new Link(), new Renew() };
}
};
}
@Test
public void test() {
BestFirstPlanner p = new BestFirstPlanner(input);
Plan pl;
try {
pl = p.search();
for (Action a : pl.getActions()) {
log.info(rendy.append(a).toString());
}
} catch (NoSolutionException e) {
e.printStackTrace();
log.error("Closed");
for (Node d : ((BestFirstSearchReport) e.getSearchReport()).closedNodes()) {
rendy.append(d);
}
log.error(rendy.toString());
log.error("Open");
for (Node d : ((BestFirstSearchReport) e.getSearchReport()).openNodes()) {
rendy.append(d);
}
log.error(rendy.toString());
Assert.assertTrue(false);
}
Assert.assertTrue(true);
}
}
| [
"enricodaga@gmail.com"
] | enricodaga@gmail.com |
38aa3c060355fbd4489942e307ca2b7f3b27a8ff | 293b7c276d768c938868469a1a0a501ff7a3e92e | /edu/princeton/cs/myalg/u2/u2_1/Ex_2_1_12.java | 27706eb09e738a4c5e4f384cc215dccdbeaf0ebd | [] | no_license | gdhucoder/Algorithms4 | 54ab8d60e51fc28723e7b92b3e33fec1125ecb01 | f2a03421b91d1176e3a770227878eb713853aa69 | refs/heads/master | 2022-06-16T01:31:53.913127 | 2022-03-14T01:02:45 | 2022-03-14T01:02:45 | 154,414,016 | 392 | 168 | null | 2021-12-04T02:50:41 | 2018-10-24T00:23:32 | Java | UTF-8 | Java | false | false | 1,925 | java | package edu.princeton.cs.myalg.u2.u2_1;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdRandom;
import java.util.ArrayList;
/**
* Created by HuGuodong on 2018/8/6.
*/
public class Ex_2_1_12 {
static int count = 0;
public static void sort(Comparable[] a) {
int N = a.length;
int h = 1;
ArrayList<Integer> hlist = new ArrayList<>();
hlist.add(h);
while (h < N / 3) {
h = 3 * h + 1;
hlist.add(h);
}
StdOut.printf("For array length = %10d, N^(1/5): %.2f \n",N, Math.pow(N,0.2));
for (int k = hlist.size() - 1; k >= 0; k--) {
count = 0;
int H = hlist.get(k);
// 比较次数
int arraySize = 0;
for (int i = H; i < N; i++) {
arraySize++;
for (int j = i; j >= H && less(a[j], a[j - H]); j -= H) {
exch(a, j, j - H);
}
}
StdOut.printf("h: %10d \t %10.2f \n",H, (double) count /N);
}
StdOut.println();
}
private static boolean less(Comparable v, Comparable w) {
count ++ ;
return v.compareTo(w) < 0;
}
private static void exch(Object[] a, int i, int j) {
Object t = a[i];
a[i] = a[j];
a[j] = t;
}
private static void show(Comparable[] a) {
for (int i = 0; i < a.length; i++) {
StdOut.print(a[i] + " ");
}
StdOut.println();
}
public static boolean isSorted(Comparable[] a) {
for (int i = 1; i < a.length; i++) {
if (less(a[i], a[i - 1])) {
return false;
}
}
return true;
}
public static Comparable[] randomInput(int N) {
// Use alg to sort T random arrays of length N
Double[] a = new Double[N];
for (int i = 0; i < N; i++) {
a[i] = StdRandom.uniform();
}
return a;
}
public static void main(String[] args) {
int size = 100;
int MAX = 5;
for(int i=1; i<=MAX; i++){
size *= 10;
sort(randomInput(size));
}
}
}
| [
"guodong_hu@126.com"
] | guodong_hu@126.com |
c8fe40785ba897c86004eed18cad3562771905f0 | 81ebfe8e8852a16e4c39bc21d13eb7dd136904cf | /APCS-A-2020/src/Unit13/FancyWordsRunner.java | 594a55fcc6bdf0d36b75aace12099bba8fc212ed | [] | no_license | mremington/APCSA2020 | c51277688fae893568ffab4d90a37c654946b46d | bf50815abbb5b80e2d054f41a7766b1fb3fb5433 | refs/heads/master | 2020-12-23T11:37:11.753608 | 2020-04-19T14:27:45 | 2020-04-19T14:27:45 | 237,139,014 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 628 | java | package Unit13;
//(c) A+ Computer Science
//www.apluscompsci.com
//Name -
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;
import java.io.File;
import java.io.IOException;
import static java.lang.System.*;
public class FancyWordsRunner
{
public static void main( String args[] ) throws IOException
{
Scanner file = new Scanner(new File("src/fancywords.dat"));
int size = file.nextInt();
file.nextLine();
for(int i = 0; i<size; i++)
{
String sentence = file.nextLine();
FancyWords fw = new FancyWords( sentence );
System.out.println( fw );
}
}
} | [
"mike@192.168.0.16"
] | mike@192.168.0.16 |
0f30763981d1b3af1bf74f16fa70b72422bb6aa5 | d0c4f0e5d529c03b0e456f426b75b537d38f5783 | /VMS-sprint2/src/test/java/com/cg/vms/AccountControllerIntegrationTest.java | 1e9d282c7c9831919e64ae53a6a01df489fee2ad | [] | no_license | suriya-s2016/onlinevisa | aa67c2cb8b52c9e9f694df59e27b089606b03ef3 | d869d6a9ab7591e424a0cea062e69c3a9e3e59a7 | refs/heads/main | 2023-01-23T08:17:38.635934 | 2020-12-10T17:06:27 | 2020-12-10T17:06:27 | 320,317,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,255 | java | package com.cg.vms;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import com.cg.vms.model.Account;
@SpringBootTest(classes=VmsSprint2Application.class,webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT)
public class AccountControllerIntegrationTest {
@Autowired
private TestRestTemplate restTemplate;
@LocalServerPort
private int port;
private String getRootUrl() {
return "http://localhost:"+port;
}
@Test
public void testInserData() {
Account acc=new Account((long) 110,"NetBanking",3500.0,"Pending");
ResponseEntity<Account> postResponse=restTemplate.postForEntity(getRootUrl()+"/account/add", acc, Account.class);
assertNotNull(postResponse);
assertNotNull(postResponse.getBody());
}
@Test
public void testViewAllAccounts() {
HttpHeaders header=new HttpHeaders();
HttpEntity<String> entity=new HttpEntity<String>(null,header);
ResponseEntity<String> response=restTemplate.exchange(getRootUrl()+"/account/all",HttpMethod.GET,entity,String.class);
assertNotNull(response.getBody());
}
@Test
public void testViewAccount() {
Account acc=restTemplate.getForObject(getRootUrl()+"/account/110", Account.class);
assertNotNull(acc);
}
@Test
public void testDeleteAccount() {
Account acc = restTemplate.getForObject(getRootUrl()+"/account/110", Account.class);
assertNotNull(acc);
restTemplate.delete(getRootUrl()+"/account/110");
try {
acc = restTemplate.getForObject(getRootUrl()+"/account/110",Account.class);
}
catch(final HttpClientErrorException ex) {
assertEquals(ex.getStatusCode(),HttpStatus.NOT_FOUND);
}
}
}
| [
"suriyas@DESKTOP-COA3J2D"
] | suriyas@DESKTOP-COA3J2D |
bd62d6eef76c74c8ac37e5241e655ba5be607b91 | abd08f8b8e4e934cb480f21782d57fc766572a27 | /Learning/HouseNumber.java | 24b6bccfd7707e975238fa30ad204fd7cd8c5364 | [] | no_license | nitingoyal445/DS-and-Algo-practice | 1ec447f496e0d785348d17ba27ef871177260793 | 324a43358ebbc8212950b77a03ff5e061f89cbdd | refs/heads/main | 2023-04-14T06:09:24.788713 | 2021-04-18T16:30:39 | 2021-04-18T16:30:39 | 359,195,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.Learning;
import java.util.Scanner;
public class HouseNumber {
public static void main(String[] args) {
long t,n,digit;
Scanner sc=new Scanner(System.in);
t=sc.nextInt();
while(t-->0){
digit=0;
n=sc.nextInt();
while(n-->0) {
String s=String.valueOf(n);
digit+=s.length();
}
System.out.println(digit+1);
}
}
}
| [
"noreply@github.com"
] | nitingoyal445.noreply@github.com |
93584ccb4d83b0408545e09c151f4a541ed35edb | eace11a5735cfec1f9560e41a9ee30a1a133c5a9 | /AMT/experiment/lab/eayilykilledmutants/MOS/AORB_24/MealOrderingSystem.java | 8cf0e5a97edb4b09540e41216f5b67d43d00b27b | [] | no_license | phantomDai/mypapers | eb2fc0fac5945c5efd303e0206aa93d6ac0624d0 | e1aa1236bbad5d6d3b634a846cb8076a1951485a | refs/heads/master | 2021-07-06T18:27:48.620826 | 2020-08-19T12:17:03 | 2020-08-19T12:17:03 | 162,563,422 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,780 | java | package labprograms.MOS.mutants.AORB_24;
import labprograms.MOS.sourceCode.MSR;
import java.util.Scanner;
public class MealOrderingSystem
{
private int numberOfRequestedBundlesOfFlowers;
private int numberOfChildPassengers;
private int numberOfFirstClassSeats;
private int numberOfBusinessClassSeats;
private int numberOfEconomicClassSeats;
private int numberOfCrewMembers;
private int numberOfPilots;
public MSR msr;
public MSR generateMSR( java.lang.String aircraftmodel, java.lang.String changeinthenumberofcrewmembers, int newnumberofcrewmembers, java.lang.String changeinthenumberofpilots, int newnumberofpilots, int numberofchildpassengers, int numberofrequestedbundlesofflowers )
{
this.msr = new MSR();
if (aircraftmodel.equals( "747200" )) {
numberOfFirstClassSeats = 0;
numberOfBusinessClassSeats = 20;
numberOfEconomicClassSeats = 150;
numberOfCrewMembers = 10;
numberOfPilots = 2;
numberOfChildPassengers = numberofchildpassengers;
numberOfRequestedBundlesOfFlowers = numberofrequestedbundlesofflowers;
} else {
if (aircraftmodel.equals( "747300" )) {
numberOfFirstClassSeats = 5;
numberOfBusinessClassSeats = 25;
numberOfEconomicClassSeats = 200;
numberOfCrewMembers = 12;
numberOfPilots = 3;
numberOfChildPassengers = numberofchildpassengers;
numberOfRequestedBundlesOfFlowers = numberofrequestedbundlesofflowers;
} else {
if (aircraftmodel.equals( "747400" )) {
numberOfFirstClassSeats = 10;
numberOfBusinessClassSeats = 30;
numberOfEconomicClassSeats = 240;
numberOfCrewMembers = 14;
numberOfPilots = 3;
numberOfChildPassengers = numberofchildpassengers;
numberOfRequestedBundlesOfFlowers = numberofrequestedbundlesofflowers;
} else {
if (aircraftmodel.equals( "000200" )) {
numberOfFirstClassSeats = 0;
numberOfBusinessClassSeats = 35;
numberOfEconomicClassSeats = 210;
numberOfCrewMembers = 13;
numberOfPilots = 2;
numberOfChildPassengers = numberofchildpassengers;
numberOfRequestedBundlesOfFlowers = numberofrequestedbundlesofflowers;
} else {
if (aircraftmodel.equals( "000300" )) {
numberOfFirstClassSeats = 10;
numberOfBusinessClassSeats = 40;
numberOfEconomicClassSeats = 215;
numberOfCrewMembers = 14;
numberOfPilots = 3;
numberOfChildPassengers = numberofchildpassengers;
numberOfRequestedBundlesOfFlowers = numberofrequestedbundlesofflowers;
} else {
new java.io.IOException( "Invalid stafflevel" );
}
}
}
}
}
if (changeinthenumberofcrewmembers.equals( "y" )) {
numberOfCrewMembers = newnumberofcrewmembers;
}
if (changeinthenumberofpilots.equals( "y" )) {
numberOfPilots = newnumberofpilots;
}
this.msr.numberOfFirstClassMeals = this.numberOfFirstClassSeats * 2;
this.msr.numberOfBusinessClassMeals = this.numberOfBusinessClassSeats * 2;
this.msr.numberOfEconomicClassMeals = this.numberOfEconomicClassSeats * 2;
this.msr.numberOfMealsForCrewMembers = this.numberOfCrewMembers * 2;
this.msr.numberOfMealsForPilots = this.numberOfPilots * 2;
this.msr.numberOfChildMeals = this.numberOfChildPassengers - 2;
this.msr.numberOfBundlesOfFlowers = this.numberOfRequestedBundlesOfFlowers;
return this.msr;
}
public static void main( java.lang.String[] args )
{
java.util.Scanner s = new java.util.Scanner( System.in );
java.lang.String aircraftmodel = null;
System.out.println( "please enter aircraft model:\n" );
aircraftmodel = s.next();
System.out.println( "if there is a change in the number of crew members, enter\"y\". Otherwise, enter\"n\"\n" );
java.lang.String changeInTheNumberOfCrewMembers = s.next();
int numberofcrewmembers;
if (changeInTheNumberOfCrewMembers.equals( "y" )) {
System.out.println( "please enter new number of crew memebers:\n" );
numberofcrewmembers = s.nextInt();
} else {
numberofcrewmembers = 0;
}
System.out.println( "if there is a change in the number of pilots, enter\"y\". Otherwise, enter\"n\"\n" );
java.lang.String changeInTheNumberOfPilots = s.next();
int numberofpilots;
if (changeInTheNumberOfPilots.equals( "y" )) {
System.out.println( "please enter new number of crew memebers:\n" );
numberofpilots = s.nextInt();
} else {
numberofpilots = 0;
}
System.out.println( "please enter number of child passengers:\n" );
int numberOfChildPassengers = s.nextInt();
System.out.println( "please enter number of requested bundles of flowers:\n" );
int numberOfRequestedBundlesOfFlowers = s.nextInt();
MealOrderingSystem sys = new MealOrderingSystem();
MSR order = sys.generateMSR( aircraftmodel, changeInTheNumberOfCrewMembers, numberofcrewmembers, changeInTheNumberOfPilots, numberofpilots, numberOfChildPassengers, numberOfRequestedBundlesOfFlowers );
System.out.println( "Number of first-class meals: " + String.valueOf( order.numberOfFirstClassMeals + "\n" ) );
System.out.println( "Number of business-class meals: " + String.valueOf( order.numberOfBusinessClassMeals + "\n" ) );
System.out.println( "Number of economic-class meals: " + String.valueOf( order.numberOfEconomicClassMeals + "\n" ) );
System.out.println( "Number of meals for crew members : " + String.valueOf( order.numberOfMealsForCrewMembers + "\n" ) );
System.out.println( "Number of meals for pilots : " + String.valueOf( order.numberOfMealsForPilots + "\n" ) );
System.out.println( "Number of child meals : " + String.valueOf( order.numberOfChildMeals + "\n" ) );
System.out.println( "Number of bundles of flowers : " + String.valueOf( order.numberOfBundlesOfFlowers + "\n" ) );
}
}
| [
"daihepeng@sina.cn"
] | daihepeng@sina.cn |
5714d9d16f5f607e34f3f3eba21203720b80445e | 6088a8606ada4be5d5216ae4143380f34c647253 | /projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/routing_policy/expr/Uint32HighLowExprTest.java | 3166915ca4fe722287c6a0573d33c8fdf54aca69 | [
"Apache-2.0"
] | permissive | adrianliaw/batfish | 6898fd9f42ad5b68f3890aea1c0dcd590423f29f | 45d1e092b889d7606cb5ae4ff0eecbe894485b54 | refs/heads/master | 2021-07-02T21:13:17.847636 | 2019-12-11T22:41:46 | 2019-12-11T22:41:46 | 227,485,749 | 1 | 0 | Apache-2.0 | 2019-12-12T00:21:05 | 2019-12-12T00:21:04 | null | UTF-8 | Java | false | false | 1,221 | java | package org.batfish.datamodel.routing_policy.expr;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import com.google.common.testing.EqualsTester;
import java.io.IOException;
import org.apache.commons.lang3.SerializationUtils;
import org.batfish.common.util.BatfishObjectMapper;
import org.junit.Test;
/** Test of {@link Uint32HighLowExpr}. */
public final class Uint32HighLowExprTest {
private static final Uint32HighLowExpr OBJ =
new Uint32HighLowExpr(new LiteralInt(1), new LiteralInt(1));
@Test
public void testJacksonSerialization() throws IOException {
assertThat(BatfishObjectMapper.clone(OBJ, Uint32HighLowExpr.class), equalTo(OBJ));
}
@Test
public void testJavaSerialization() {
assertThat(SerializationUtils.clone(OBJ), equalTo(OBJ));
}
@Test
public void testEquals() {
new EqualsTester()
.addEqualityGroup(new Object())
.addEqualityGroup(OBJ, OBJ, new Uint32HighLowExpr(new LiteralInt(1), new LiteralInt(1)))
.addEqualityGroup(new Uint32HighLowExpr(new LiteralInt(1), new LiteralInt(2)))
.addEqualityGroup(new Uint32HighLowExpr(new LiteralInt(2), new LiteralInt(2)))
.testEquals();
}
}
| [
"dhalperi@users.noreply.github.com"
] | dhalperi@users.noreply.github.com |
aab8999f60c6043a4886489688567083c2487a95 | 3aa1108607bf6a6a0ba48b769608431cc35af657 | /SumOf1dArray.java | 511bdd84f4af29d4296df4ae218d83d506a5c16c | [] | no_license | elt-abdel/leet-code-practice | 8f837f75315d15ce24ed9eefa82a76c3c6192060 | f4d410f96528e459aa66a7173b1ac04b72cab8db | refs/heads/master | 2023-04-06T23:12:40.564571 | 2021-04-24T23:30:07 | 2021-04-24T23:30:07 | 314,353,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 961 | java | import java.util.*;
/**
* 1480. Running Sum of 1d Array
* Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums.
*/
/*
Example 1:
Input: nums = [1,2,3,4]
Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
*/
public class SumOf1dArray {
public static void main(String[] args) {
int[] one = {3,1,2,10,1};
System.out.println(Arrays.toString(one));
System.out.println(Arrays.toString(runningSum(one)));
}
public static int[] runningSum(int[] nums) {
// creating return array
int[] returnArr = new int[nums.length];
// total
int total = 0;
// for loop
for (int i = 0; i < nums.length; i++) {
total = total + nums[i]; // add total to current
returnArr[i] = total;
}
return returnArr;
}
}
| [
"52611456+elt-abdel@users.noreply.github.com"
] | 52611456+elt-abdel@users.noreply.github.com |
f822d81efa1191d30845513695ead53a4f29d81a | 4f3d431491d35f9b13e0673f02c142b516ed8ed9 | /appmt00CORE/appmt00COREClasses/src/main/java/aa14b/db/crud/AA14DBCRUDForOrgDivision.java | d1a98357f946252380a7b077874a42ce406c42c4 | [] | no_license | opendata-euskadi/appointments-appmt00 | 5c0d4cd92cfdceb0e07168e8a463ca173f4d312b | 621538bfbc66ca47b2d34b3c36b55c57fd27573e | refs/heads/master | 2022-10-25T23:47:47.002573 | 2020-06-15T22:49:05 | 2020-06-15T22:49:05 | 262,896,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,501 | java | package aa14b.db.crud;
import javax.persistence.EntityManager;
import aa14b.db.entities.AA14DBEntityForOrgDivision;
import aa14b.db.entities.AA14DBEntityForOrganization;
import aa14f.api.interfaces.AA14CRUDServicesForOrgDivision;
import aa14f.model.config.AA14OrgDivision;
import aa14f.model.oids.AA14IDs.AA14OrgDivisionID;
import aa14f.model.oids.AA14OIDs.AA14OrgDivisionOID;
import r01f.model.persistence.PersistencePerformedOperation;
import r01f.objectstreamer.Marshaller;
import r01f.persistence.db.config.DBModuleConfig;
import r01f.persistence.db.entities.primarykeys.DBPrimaryKeyForModelObjectImpl;
import r01f.securitycontext.SecurityContext;
/**
* Persistence layer
*/
public class AA14DBCRUDForOrgDivision
extends AA14DBCRUDForOrganizationalEntityBase<AA14OrgDivisionOID,AA14OrgDivisionID,AA14OrgDivision,
AA14DBEntityForOrgDivision>
implements AA14CRUDServicesForOrgDivision {
/////////////////////////////////////////////////////////////////////////////////////////
// CONSTRUCTOR
/////////////////////////////////////////////////////////////////////////////////////////
public AA14DBCRUDForOrgDivision(final DBModuleConfig dbCfg,
final EntityManager entityManager,
final Marshaller marshaller) {
super(dbCfg,
AA14OrgDivision.class,AA14DBEntityForOrgDivision.class,
entityManager,
marshaller);
}
/////////////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////////////
@Override
public void setDBEntityFieldsFromModelObject(final SecurityContext securityContext,
final AA14OrgDivision div,final AA14DBEntityForOrgDivision dbEntity) {
super.setDBEntityFieldsFromModelObject(securityContext,
div,dbEntity);
// Organization reference
dbEntity.setOrganizationOid(div.getOrgRef().getOid().asString());
dbEntity.setOrganizationId(div.getOrgRef().getId().asString());
// hierarchy level
dbEntity.setHierarchyLevel(2); // used to return ordered results when searching (see AA14DBSearcherForEntityModelObject)
}
/////////////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////////////
@Override
public void completeDBEntityBeforeCreateOrUpdate(final SecurityContext securityContext,
final PersistencePerformedOperation performedOp,
final AA14OrgDivision ordDiv,final AA14DBEntityForOrgDivision dbDivision) {
// load the organization entity
AA14DBEntityForOrganization dbOrg = this.getEntityManager().find(AA14DBEntityForOrganization.class,
new DBPrimaryKeyForModelObjectImpl(dbDivision.getOrganizationOid()));
// set the dependency
dbDivision.setOrganizationOid(dbOrg.getOid());
dbDivision.setOrganizationId(dbOrg.getOrganizationId());
// dbDivision.setOrganization(dbOrg);
// setting the division's dependent objects (org), also modifies the later since it's a BI-DIRECTIONAL relation
// ... so the entity manager MUST be refreshed in order to avoid an optimistic locking exception
this.getEntityManager().refresh(dbOrg);
}
}
| [
"pci@ejie.eus"
] | pci@ejie.eus |
17d1c7cacf3c0b6fa325c04cd4f79bdf3db26052 | 8028e09cc515c39dd43a7d82b8202fc6b4c68460 | /src/Main/Object_Assets.java | 63e14f5f9523c125f474baac025231a6eec526ee | [] | no_license | Danielius123/My_Java_CodeAcademy_Codes | 4cb9192e4e60d549cc98822843df504329529f3c | 7f84ca20a423638cbc48038c0d1cef9d736e3fd8 | refs/heads/master | 2020-03-11T19:53:36.214020 | 2018-04-19T13:41:43 | 2018-04-19T13:41:43 | 130,220,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 91 | java | package Main;
public class Object_Assets
{
public int mass = 0;
public boolean worms;
}
| [
"danielius.simaitis1@gmail.com"
] | danielius.simaitis1@gmail.com |
5903d2cec47cdaebb68291fa82358f0a69e8cc58 | cf575a418b0d0b05ea31927d1fa4cc17a3590b2a | /currentlocation/src/main/java/com/inception/software/currentlocation/LocationApiInterface.java | 4844025a190cd18412533659256c9347a1aa8ef3 | [] | no_license | anuragkachhala/CurrentLocationSample | 76d50517dd77a1dff4d808f925774bfad7a53b16 | 46ef35eb0b9bdb414dd644eac46f56f88bdf2c14 | refs/heads/master | 2020-09-21T10:14:49.790961 | 2019-11-29T02:33:08 | 2019-11-29T02:33:08 | 224,762,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.inception.software.currentlocation;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
import static com.inception.software.currentlocation.LocationConstant.END_POINT_GEO_CODE;
public interface LocationApiInterface {
@GET(END_POINT_GEO_CODE)
Call<String> getAddressDataFromAPICall(@Query("latlng") String latLong, @Query("sensor") boolean sensor, @Query("key") String key);
}
| [
"kachhalaanurag@gmail.com"
] | kachhalaanurag@gmail.com |
feb64a7f8a1a6308e8822983dd5cda1e0bf832e5 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/google/android/gms/common/internal/BinderWrapper.java | 98a1a5ed24e8718776b6c63427b926374788fd7f | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 1,484 | java | package com.google.android.gms.common.internal;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.tencent.matrix.trace.core.AppMethodBeat;
public final class BinderWrapper
implements Parcelable
{
public static final Parcelable.Creator<BinderWrapper> CREATOR;
private IBinder zzry;
static
{
AppMethodBeat.i(4606);
CREATOR = new zza();
AppMethodBeat.o(4606);
}
public BinderWrapper()
{
this.zzry = null;
}
public BinderWrapper(IBinder paramIBinder)
{
this.zzry = null;
this.zzry = paramIBinder;
}
private BinderWrapper(Parcel paramParcel)
{
AppMethodBeat.i(4604);
this.zzry = null;
this.zzry = paramParcel.readStrongBinder();
AppMethodBeat.o(4604);
}
public final int describeContents()
{
return 0;
}
public final IBinder getBinder()
{
return this.zzry;
}
public final void setBinder(IBinder paramIBinder)
{
this.zzry = paramIBinder;
}
public final void writeToParcel(Parcel paramParcel, int paramInt)
{
AppMethodBeat.i(4605);
paramParcel.writeStrongBinder(this.zzry);
AppMethodBeat.o(4605);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar
* Qualified Name: com.google.android.gms.common.internal.BinderWrapper
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
efd4150929c02eff5884e7de9b6d0f751820609b | e873994f51b6837610216a127d7d365b526a676e | /examples/java/src/main/java/com/aliyun/cloudevents/sample/SampleBinaryHTTPClient.java | 7d4aa9d1f2ffa987c6b33e4a326b2f219a07a017 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-eventbridge-sdk | 520ba864b8ec936386a4ec5a99549f5d638b6e1d | b8683bd739d39e6a2fe23eacd45c907fe3cb4820 | refs/heads/master | 2023-07-05T15:31:01.576624 | 2023-04-26T01:53:02 | 2023-04-26T10:03:06 | 294,324,589 | 7 | 16 | null | 2023-04-26T10:03:08 | 2020-09-10T06:37:25 | Java | UTF-8 | Java | false | false | 2,293 | java | package com.aliyun.cloudevents.sample;
import java.net.URI;
import java.util.UUID;
import io.cloudevents.CloudEvent;
import io.cloudevents.core.builder.CloudEventBuilder;
import io.cloudevents.http.vertx.VertxMessageFactory;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
public class SampleBinaryHTTPClient{
private static String accessKeyId = "{accessKeyId}";
private static String accessKeySecret = "{accessKeySecret}";
private static String endpoint = "http://{endpoint}/openapi/putEvents";
public static void main(String[] args) throws Exception {
final Vertx vertx = Vertx.vertx();
final HttpClient httpClient = vertx.createHttpClient();
// Create an event template to set basic CloudEvent attributes.
CloudEventBuilder eventTemplate = CloudEventBuilder.v1()
.withSource(URI.create("https://github.com/cloudevents/sdk-java/tree/master/examples/vertx"))
.withType("vertx.example");
// create HTTP request.
final HttpClientRequest request = httpClient.postAbs(endpoint)
.handler(response -> {
System.out.println(response.statusMessage());
})
.exceptionHandler(System.err::println);
String id = UUID.randomUUID()
.toString();
String data = "{\"name\":\"EventBridge\",\"scope\":100}";
// Create the event starting from the template
final CloudEvent event = eventTemplate.newBuilder()
.withId(id)
.withData("application/json", data.getBytes())
.withExtension("aliyuneventbusname", "demo-bus")
.withSource(URI.create("https://github.com/cloudevents/sdk-java/tree/master/examples/vertx"))
.withType("vertx.example")
.withSubject("acs:oss:cn-hangzhou:1234567:xls-papk/game_apk/123.jpg")
.build();
request.putHeader("content-type", "application/json");
request.putHeader("authorization",
"acs" + ":" + accessKeyId + ":" + SignatureHelper.getSignature(SignatureHelper.getStringToSign(request),
accessKeySecret) + "");
VertxMessageFactory.createWriter(request)
.writeBinary(event);
}
}
| [
"jingluo.sl@alibaba-inc.com"
] | jingluo.sl@alibaba-inc.com |
9273f7ee6b70646a744876d10dfe40a08b9e2902 | 257994bc5507831afe9017d0fb9a1058f849d49d | /SoftwareArchitecturePracticals/src/Practical5/Connection.java | 29c0736a9eba346ab5f615b0d80e9c158226bd58 | [] | no_license | jonny-binns/SoftwareArchitecturePracticals | a0066d6f73e87d49a4b338654110e86753c69519 | 026824067fa9c410edd6c36a99bd547744f511b4 | refs/heads/master | 2023-06-03T00:15:58.216747 | 2021-06-13T12:52:22 | 2021-06-13T12:52:22 | 296,585,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 929 | java | package Practical5;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
public class Connection extends Thread {
DataInputStream in;
DataOutputStream out;
Socket clientSocket;
public Connection (Socket aClientSocket)
{
try
{
clientSocket = aClientSocket;
in = new DataInputStream(clientSocket.getInputStream());
out = new DataOutputStream(clientSocket.getOutputStream());
this.start();
}
catch (IOException e)
{
System.out.println("Connection: " + e.getMessage());
}
}
public void run()
{
try
{
String data = in.readUTF();
System.out.println("Received: " + data);
out.writeUTF(data);
}
catch (Exception e)
{
try
{
clientSocket.close();
}
catch (IOException ioe)
{
System.out.println("Error: " + ioe.getMessage());
}
System.out.println("Error: " + e.getMessage());
}
}
}
| [
"jonny.binns1@gmail.com"
] | jonny.binns1@gmail.com |
139ad4e0f151ed36632b07080fcf9ec70ab9e8e3 | dddc3c76abf9077e93c4b46efac81e4bd1ad2bd4 | /SpringBootTutorial/firstspringboot/src/main/java/com/springexample/firstspringboot/controllers/BooksController.java | 9e3e163c6676e85d068a214dc78290921f486b4b | [] | no_license | sjvec14/MyPerosnalLearning | 818c23a2376d4fa5b3a61a335f932e7a726569af | 88fa1cf87ba819da1f0dee6643820ba20bb146be | refs/heads/master | 2021-05-18T15:08:04.076284 | 2020-04-24T12:07:16 | 2020-04-24T12:07:16 | 251,292,131 | 0 | 0 | null | 2020-10-13T21:22:08 | 2020-03-30T12:03:01 | Java | UTF-8 | Java | false | false | 1,221 | java | package com.springexample.firstspringboot.controllers;
import com.springexample.firstspringboot.Model.Book;
import com.springexample.firstspringboot.Services.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
@RestController
public class BooksController {
@Autowired
private BookService bookService;
@RequestMapping("/books")
public List<Book> getBooks() {
return bookService.getBookList();
}
@RequestMapping("/books/{id}")
public Book getBook(@PathVariable Long id) {
return bookService.getBook(id);
}
@RequestMapping(method = RequestMethod.POST , value ="/books")
public void addBook(@RequestBody Book book) {
bookService.addBook(book);
}
@RequestMapping(method = RequestMethod.PUT , value ="/books/{id}")
public void updateBook(@RequestBody Book book,@PathVariable Long id) {
bookService.updateBookDetails(book, id);
}
@RequestMapping(method = RequestMethod.DELETE , value ="/books/{id}")
public void deleteBook(@PathVariable Long id) {
bookService.deleteBookDetails(id);
}
}
| [
"jawaharvec@gmail.com"
] | jawaharvec@gmail.com |
5ea93a537670c417827187d9a4256e544c9eccc2 | 945da48466337c272e0ecc6a4da9c56a2d7b4ee6 | /src/main/java/goldenaid/web/rest/UserResource.java | c5e6d9aa0e225d55abc43590c9c42b827051fa71 | [] | no_license | eliasrdrgz/tst-jhipster | dd9859ea4898ff8397b5fd596e90e836e3457337 | 005e80e4878ebe33cc0d263de6d71edea17420e2 | refs/heads/master | 2020-05-07T20:37:19.302591 | 2019-04-11T21:22:56 | 2019-04-11T21:22:56 | 180,869,171 | 0 | 0 | null | 2019-04-11T21:22:57 | 2019-04-11T20:04:38 | Java | UTF-8 | Java | false | false | 8,175 | java | package goldenaid.web.rest;
import goldenaid.config.Constants;
import goldenaid.domain.User;
import goldenaid.repository.UserRepository;
import goldenaid.security.AuthoritiesConstants;
import goldenaid.service.MailService;
import goldenaid.service.UserService;
import goldenaid.service.dto.UserDTO;
import goldenaid.web.rest.errors.BadRequestAlertException;
import goldenaid.web.rest.errors.EmailAlreadyUsedException;
import goldenaid.web.rest.errors.LoginAlreadyUsedException;
import goldenaid.web.rest.util.HeaderUtil;
import goldenaid.web.rest.util.PaginationUtil;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
/**
* REST controller for managing users.
* <p>
* This class accesses the User entity, and needs to fetch its collection of authorities.
* <p>
* For a normal use-case, it would be better to have an eager relationship between User and Authority,
* and send everything to the client side: there would be no View Model and DTO, a lot less code, and an outer-join
* which would be good for performance.
* <p>
* We use a View Model and a DTO for 3 reasons:
* <ul>
* <li>We want to keep a lazy association between the user and the authorities, because people will
* quite often do relationships with the user, and we don't want them to get the authorities all
* the time for nothing (for performance reasons). This is the #1 goal: we should not impact our users'
* application because of this use-case.</li>
* <li> Not having an outer join causes n+1 requests to the database. This is not a real issue as
* we have by default a second-level cache. This means on the first HTTP call we do the n+1 requests,
* but then all authorities come from the cache, so in fact it's much better than doing an outer join
* (which will get lots of data from the database, for each HTTP call).</li>
* <li> As this manages users, for security reasons, we'd rather have a DTO layer.</li>
* </ul>
* <p>
* Another option would be to have a specific JPA entity graph to handle this case.
*/
@RestController
@RequestMapping("/api")
public class UserResource {
private final Logger log = LoggerFactory.getLogger(UserResource.class);
private final UserService userService;
private final UserRepository userRepository;
private final MailService mailService;
public UserResource(UserService userService, UserRepository userRepository, MailService mailService) {
this.userService = userService;
this.userRepository = userRepository;
this.mailService = mailService;
}
/**
* POST /users : Creates a new user.
* <p>
* Creates a new user if the login and email are not already used, and sends an
* mail with an activation link.
* The user needs to be activated on creation.
*
* @param userDTO the user to create
* @return the ResponseEntity with status 201 (Created) and with body the new user, or with status 400 (Bad Request) if the login or email is already in use
* @throws URISyntaxException if the Location URI syntax is incorrect
* @throws BadRequestAlertException 400 (Bad Request) if the login or email is already in use
*/
@PostMapping("/users")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<User> createUser(@Valid @RequestBody UserDTO userDTO) throws URISyntaxException {
log.debug("REST request to save User : {}", userDTO);
if (userDTO.getId() != null) {
throw new BadRequestAlertException("A new user cannot already have an ID", "userManagement", "idexists");
// Lowercase the user login before comparing with database
} else if (userRepository.findOneByLogin(userDTO.getLogin().toLowerCase()).isPresent()) {
throw new LoginAlreadyUsedException();
} else if (userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()).isPresent()) {
throw new EmailAlreadyUsedException();
} else {
User newUser = userService.createUser(userDTO);
mailService.sendCreationEmail(newUser);
return ResponseEntity.created(new URI("/api/users/" + newUser.getLogin()))
.headers(HeaderUtil.createAlert( "userManagement.created", newUser.getLogin()))
.body(newUser);
}
}
/**
* PUT /users : Updates an existing User.
*
* @param userDTO the user to update
* @return the ResponseEntity with status 200 (OK) and with body the updated user
* @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already in use
* @throws LoginAlreadyUsedException 400 (Bad Request) if the login is already in use
*/
@PutMapping("/users")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<UserDTO> updateUser(@Valid @RequestBody UserDTO userDTO) {
log.debug("REST request to update User : {}", userDTO);
Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) {
throw new EmailAlreadyUsedException();
}
existingUser = userRepository.findOneByLogin(userDTO.getLogin().toLowerCase());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) {
throw new LoginAlreadyUsedException();
}
Optional<UserDTO> updatedUser = userService.updateUser(userDTO);
return ResponseUtil.wrapOrNotFound(updatedUser,
HeaderUtil.createAlert("userManagement.updated", userDTO.getLogin()));
}
/**
* GET /users : get all users.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and with body all users
*/
@GetMapping("/users")
public ResponseEntity<List<UserDTO>> getAllUsers(Pageable pageable) {
final Page<UserDTO> page = userService.getAllManagedUsers(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/users");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* @return a string list of the all of the roles
*/
@GetMapping("/users/authorities")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public List<String> getAuthorities() {
return userService.getAuthorities();
}
/**
* GET /users/:login : get the "login" user.
*
* @param login the login of the user to find
* @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found)
*/
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
public ResponseEntity<UserDTO> getUser(@PathVariable String login) {
log.debug("REST request to get User : {}", login);
return ResponseUtil.wrapOrNotFound(
userService.getUserWithAuthoritiesByLogin(login)
.map(UserDTO::new));
}
/**
* DELETE /users/:login : delete the "login" User.
*
* @param login the login of the user to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<Void> deleteUser(@PathVariable String login) {
log.debug("REST request to delete User: {}", login);
userService.deleteUser(login);
return ResponseEntity.ok().headers(HeaderUtil.createAlert( "userManagement.deleted", login)).build();
}
}
| [
"eliasrdrgz@gmail.com"
] | eliasrdrgz@gmail.com |
4a728b2c59e97da48f9549e8e6a572c7f2204acd | d41e1624e091563a48db71f03b054f0c2e3d808e | /src/main/java/dbpedia2Neo4J/DBpediaCategories2TargetVectors.java | 5a88f1f864e9bd82304140fc4f553edf70b1b5b9 | [] | no_license | rparundekar/DBpedia2Neo4J | 467169a1c8310b999f6a7e59764d7415a595e00f | 19e7562b3d19838c749df4860c09467c8c1aae44 | refs/heads/master | 2021-01-19T13:09:10.499727 | 2017-05-14T19:14:32 | 2017-05-14T19:14:32 | 82,366,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,867 | java | package dbpedia2Neo4J;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.LineNumberReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import org.apache.jena.datatypes.DatatypeFormatException;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.Triple;
import org.apache.jena.riot.Lang;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.riot.RiotException;
import org.apache.jena.riot.system.StreamRDF;
import org.apache.jena.sparql.core.Quad;
import org.neo4j.driver.v1.AuthTokens;
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.exceptions.ClientException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.opencsv.CSVWriter;
/**
* Target vector generation from the DBpedia-Categories
* @author rparundekar
*/
public class DBpediaCategories2TargetVectors implements StreamRDF{
// SLF4J Logger bound to Log4J
private static final Logger logger=LoggerFactory.getLogger(DBpediaTypes2TargetVectors.class);
//Data for the target vectors
private int targetVectorCount = 0;
private final Map<String, Integer> targetVectorPosition;
private Map<String, Set<String>> types;
private int notFoundCount=0;
private final Map<String, Integer> instanceCount;
private int skipCount=0;
public DBpediaCategories2TargetVectors(){
targetVectorPosition=new HashMap<>();
instanceCount=new HashMap<>();
}
/**
* Load the RDF data from the DBPedia turtle (.ttl) file,
* by taking an inner join on the Semantic Graph file.
* @param semanticGraphFile The file for the Semantic Graph e.g. infobox_properties.en.ttl
* @param turtleFile The DBPedia turtle file e.g. instance_types.en.ttl
*/
public void load(File semanticGraphFile, File turtleFile){
logger.info("Loading instance sets from the semantic graph file for inner join");
InMemoryInstanceMapLoader inMemoryInstanceSetLoader=new InMemoryInstanceMapLoader();
inMemoryInstanceSetLoader.load(semanticGraphFile);
types=inMemoryInstanceSetLoader.getInstances();
logger.info("...Done");
try{
// Step 1: Find the different types by iterating once through the instances
// Since the turtle file might contain errors (e.g. in the properties
// there is a value 'Infinity', with datatype xsd:double), we need to read each line
// and then call the RDFDataMgr on that.
// It sucks, since it's slow. But hey 'Infinity' cant be parsed as a double.
LineNumberReader lnr=new LineNumberReader(new FileReader(turtleFile));
String line=null;
long start=System.currentTimeMillis();
while((line=lnr.readLine())!=null){
// Print progress
if(lnr.getLineNumber()%1000==0){
logger.info("{} lines parsed in {} ms. {} lines with no instances. {} lines skipped with wikicat", lnr.getLineNumber(), (System.currentTimeMillis()-start), notFoundCount, skipCount);
start=System.currentTimeMillis();
}
// Parse the line read using the stream API. Make sure we catch parsing errors.
try{
RDFDataMgr.parse(this, new StringReader(line), Lang.TURTLE);
}catch(DatatypeFormatException|RiotException de){
logger.error("Illegal data format in line : " +line);
}
}
// Close IO
lnr.close();
}catch(IOException e){
// Something went wrong with the files.
logger.error("Cannot load the data from the file due to file issue:" + e.getMessage());
}
//We add additional step to only consider types with a support of atleast 200 instances since
// otherwise there are too many
try{
PrintWriter pw = new PrintWriter(new File(turtleFile.getParentFile(), "yagoCounts.csv"));
for(String type:instanceCount.keySet()){
int count = instanceCount.get(type);
pw.println(type +","+ count);
pw.flush();
if(count>=200)
makeTarget(type);
}
pw.close();
}catch(IOException e){
e.printStackTrace();
}
logger.info("{} possible types present.", targetVectorCount);
try{
// Step 2: Create the csv with the target vectors types;
File outputCsv = new File(turtleFile.getParentFile(), "yagoOneHot.csv");
CSVWriter csvWriter = new CSVWriter(new FileWriter(outputCsv), ',', CSVWriter.NO_QUOTE_CHARACTER);
//Write the header
String[] header = new String[targetVectorCount+1];
header[0]="id";
for(String id:targetVectorPosition.keySet()){
header[targetVectorPosition.get(id)+1]=DBpediaHelper.stripClean(id);
}
csvWriter.writeNext(header);
logger.info("Writing to targetVectorFile... (Sit back & go grab a coffee. This may take a while.)");
for(String subject:types.keySet()){
Set<String> typeOf=types.get(subject);
if(typeOf.isEmpty())
continue;
int count=0;
for(String id:targetVectorPosition.keySet()){
if(typeOf.contains(id))
{
count++;
}
}
String[] row = new String[count+1];
row[0]=subject;
int i=1;
for(String id:targetVectorPosition.keySet()){
if(typeOf.contains(id))
{
row[i]=""+(targetVectorPosition.get(id)+1);
i++;
}
}
csvWriter.writeNext(row);
csvWriter.flush();
}
csvWriter.close();
}catch(IOException e){
// Something went wrong with the files.
logger.error("Cannot write the data to the file due to file issue:" + e.getMessage());
}
}
/**
* Get stuff running.
*/
public static void main(String[] args){
DBpediaCategories2TargetVectors loadFile = new DBpediaCategories2TargetVectors();
loadFile.load(new File("/Users/rparundekar/dataspace/dbpedia2016/infobox_properties_en.ttl"), new File("/Users/rparundekar/dataspace/dbpedia2016/article_categories_en.ttl"));
}
@Override
public void base(String base) {
// Do Nothing
// That's the base. DBpedia doesn't use this it seems.
}
@Override
public void finish() {
// Do Nothing
}
@Override
public void prefix(String prefix, String iri) {
// Do Nothing
}
@Override
public void quad(Quad arg0) {
// Do Nothing
}
@Override
public void start() {
// Do Nothing
}
@Override
public void triple(Triple triple) {
// Handle the triple
Node object = triple.getMatchObject();
if(object.isURI()){
// Get and clean the object URI (There are no blank nodes in DBpedia)
String o=object.getURI();
if(o.toLowerCase().contains("wikicat")){
skipCount++;
return;
}
}
// Get and clean the subject URI (There are no blank nodes in DBpedia)
String subject = triple.getMatchSubject().getURI();
subject=DBpediaHelper.stripClean(subject);
if(types.containsKey(subject)){
// Get the object. It can be a URI or a literal (There are no blank nodes in the DBpedia)
if(object.isURI()){
// Get and clean the object URI (There are no blank nodes in DBpedia)
String o=object.getURI();
o=DBpediaHelper.stripClean(o);
Integer c = instanceCount.get(o);
if(c==null)
instanceCount.put(o, 1);
else
instanceCount.put(o, c+1);
putTypes(subject,o);
}
else{
logger.error("Value of type is not a URI");
}
}else{
notFoundCount++;
}
}
/**
* Function to keep track of the types for an instance
* @param individual The individual for which we want to track the type
* @param type The type
*/
private void putTypes(String individual, String type) {
Set<String> typeOf = types.get(individual);
if(typeOf==null)
{
typeOf=new TreeSet<>();
types.put(individual, typeOf);
}
typeOf.add(type);
}
/**
* Make the target and increment the count
* @param type The type
*/
private void makeTarget(String type) {
if(!targetVectorPosition.containsKey(type))
{
targetVectorPosition.put(type, targetVectorCount++);
}
}
}
| [
"rparundekar@us.toyota-itc.com"
] | rparundekar@us.toyota-itc.com |
a0f9369a3df2ed2358b3f337aae3568f81cb266e | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12798-109-4-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest.java | fa13c765276266370557c7d246e8539fb3bdafcb | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 19:37:47 UTC 2020
*/
package org.xwiki.velocity.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DefaultVelocityEngine_ESTest extends DefaultVelocityEngine_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
70b00578602d13f4d571383695da8b2e6be5d6c6 | c7fa5fe016320ff819a78c2657bec97227f210be | /src/topicMessage/TopicMessage.java | 78cb8c7f21e34719956f5ec952bb0bcc28e505d0 | [] | no_license | alexaalex70/FinalVersionSocket | 01d7343d686f4c0c43d18d4eeb74fdac8ba3a1c4 | 5ca421f34a1280a46f2aecbf464d5401ed072d81 | refs/heads/master | 2020-09-18T15:46:49.056571 | 2019-11-26T09:43:15 | 2019-11-26T09:43:15 | 224,155,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,642 | java | package topicMessage;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import message.Message;
public class TopicMessage<Message> extends Thread{
private ArrayList<Message> topicQueue = new ArrayList<Message>();
public synchronized void enqueue(Message msg) {
System.out.println("Enqueued the message in topicQueue");
this.topicQueue.add(msg);
notify();
}
public int getSize() {
return topicQueue.size();
}
public synchronized Message dequeue() {
while (this.topicQueue.isEmpty()) {
try {
System.out.println("Inside Dequeue -- Waiting");
wait();
} catch (Exception ex) {
System.out.println("Exception occured in Dequeue");
}
}
System.out.println("Dequeue -- Completed");
return this.topicQueue.remove(0);
}
public ArrayList<Message> getTq() {
return this.topicQueue;
}
// @Override
// public void run () {
// while(true) {
//
// if(this.topicQueue.isEmpty() == false) {
// for (int i=0; i<= this.topicQueue.size(); i++) {
// Message msg = this.topicQueue.get(i);
//
// if (msg.getTimeToDelete() > Server.timeout) {
// if(System.currentTimeMillis() - msg.getCreatedTime() >= Server.timeout) {
// this.topicQueue.remove(i);
// }
// } else {
// if(System.currentTimeMillis() - msg.getCreatedTime() >= msg.getTimeToDelete()) {
// this.topicQueue.remove(i);
// }
// }
// }
// }
// }
// }
} | [
"noreply@github.com"
] | alexaalex70.noreply@github.com |
989ced72852c5978c381ce4731e0c23ddf3ac191 | c59bb710f70d6072fc79fb2538a24c6871196b9e | /ThreadedHardware/src/main/java/threadedhardware/Active.java | 7c1f05fe67f088342e86113412db65e9b7d6cd7b | [] | no_license | AtticFanatics14079/ThreadedHardware | 52d1fdef6e75413e2730cbd4df15cce571f7b27d | 641caf38c5df83b405c8a0ab104dcb70404822f9 | refs/heads/master | 2023-08-24T16:47:56.569029 | 2021-10-24T15:02:42 | 2021-10-24T15:02:42 | 393,703,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package threadedhardware;
public interface Active extends ThreadedHardware {
void set(double value);
void setHardware();
double getRunVal();
}
| [
"22coombs2@lexingtonma.org"
] | 22coombs2@lexingtonma.org |
c57965bc8ad5fd4d3a4e45133fe1ba4d5ba2ee8a | 48228de1a805f90aa5ae1cce7b7b87d435d2ef23 | /inso-collect-portal/src/main/java/com/goldcard/iot/collect/rule/ProtocolRule.java | 3ac94f0c756e79fd6124faa2f98169ad52074098 | [] | no_license | ch522/iot-collect | 09dca9de9c3ca8cbbf8541abc9040a9bed5bb9c4 | 45d62ba827f8624729ae63fdd96ca05ed66cc686 | refs/heads/master | 2022-06-26T20:36:57.519910 | 2020-04-23T14:28:23 | 2020-04-23T14:28:23 | 246,806,555 | 0 | 0 | null | 2022-06-17T22:20:28 | 2020-03-12T10:30:06 | Java | UTF-8 | Java | false | false | 1,961 | java | package com.goldcard.iot.collect.rule;
import java.io.Serializable;
public class ProtocolRule implements Serializable {
private byte[] data;
private Integer size;
private String protocolCode;
private String hexStr;
private Boolean hasRegister = Boolean.FALSE;
private String regResponse;
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public String getProtocolCode() {
return protocolCode;
}
public void setProtocolCode(String protocolCode) {
this.protocolCode = protocolCode;
}
public String getHexStr() {
return hexStr;
}
public void setHexStr(String hexStr) {
this.hexStr = hexStr;
}
public Boolean getHasRegister() {
return hasRegister;
}
public void setHasRegister(Boolean hasRegister) {
this.hasRegister = hasRegister;
}
public String getRegResponse() {
return regResponse;
}
public void setRegResponse(String regResponse) {
this.regResponse = regResponse;
}
public static class Builder {
private byte[] data;
private String hexStr;
private Integer size;
public Builder data(byte[] data) {
this.data = data;
return this;
}
public Builder hexStr(String hexStr) {
this.hexStr = hexStr;
return this;
}
public Builder size(Integer size) {
this.size = size;
return this;
}
public ProtocolRule build() {
return new ProtocolRule(this);
}
}
private ProtocolRule(Builder builder) {
this.data = builder.data;
this.hexStr = builder.hexStr;
this.size = builder.size;
}
}
| [
"2019Visu@l"
] | 2019Visu@l |
766d6e597de1a2e91f297df8db2599d534597f19 | 2cf50d23eeac6d2f295a6bd5539167ba92b45c1e | /app/src/main/java/com/example/cgmarketplace/model/ProductModel.java | 1d3df68d6d5e8b1401f21ab9198da56808a97546 | [] | no_license | tangguhtriprasetyo/CGMarketPlace | 2b4387937892fe6b590b22d0c327701d9d334717 | 3ab27edbd132d70fc6fb671597bbc996687992ba | refs/heads/master | 2020-12-04T04:03:59.144554 | 2020-02-12T15:52:55 | 2020-02-12T15:52:55 | 231,601,068 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,653 | java | package com.example.cgmarketplace.model;
public class ProductModel {
private String desc, details1, details2, details3, details4, finish, image1, image2, image3, material, name, width, height, dense, category, codeProduct;
private int price, stock;
public ProductModel(){}
public ProductModel(String desc, String details1, String details2, String details3, String details4, String finish, String image1, String image2, String image3, String material, String name, String width, String height, String dense, String category, String codeProduct, int price, int stock) {
this.desc = desc;
this.details1 = details1;
this.details2 = details2;
this.details3 = details3;
this.details4 = details4;
this.finish = finish;
this.image1 = image1;
this.image2 = image2;
this.image3 = image3;
this.material = material;
this.name = name;
this.width = width;
this.height = height;
this.dense = dense;
this.category = category;
this.price = price;
this.stock = stock;
this.codeProduct = codeProduct;
}
public String getCodeProduct() {
return codeProduct;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getDetails1() {
return details1;
}
public void setDetails1(String details1) {
this.details1 = details1;
}
public String getDetails2() {
return details2;
}
public void setDetails2(String details2) {
this.details2 = details2;
}
public String getDetails3() {
return details3;
}
public void setDetails3(String details3) {
this.details3 = details3;
}
public String getDetails4() {
return details4;
}
public void setDetails4(String details4) {
this.details4 = details4;
}
public String getFinish() {
return finish;
}
public void setFinish(String finish) {
this.finish = finish;
}
public String getImage1() {
return image1;
}
public void setImage1(String image1) {
this.image1 = image1;
}
public String getImage2() {
return image2;
}
public void setImage2(String image2) {
this.image2 = image2;
}
public String getImage3() {
return image3;
}
public void setImage3(String image3) {
this.image3 = image3;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
public String getDense() {
return dense;
}
public void setDense(String dense) {
this.dense = dense;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
}
| [
"tangguhtriprasetyo@gmail.com"
] | tangguhtriprasetyo@gmail.com |
eb1cf32ae9575c6545a651892c14380c6de395b8 | 150d270bb207198b4937ed7e27d305510daab783 | /src/com/WebXemPhim/Controler/delete.java | 508a9b3dea51101ad78e37e620fa0e2d62ed0f3f | [] | no_license | dattran01477/WebXemPhim | 840419ca2fe36c572636375f018aa070d5bfcb76 | cd873a6578ac69b1f0eb00583eb9d38d604ce8bb | refs/heads/master | 2020-04-04T23:22:37.485596 | 2018-12-11T03:54:23 | 2018-12-11T03:54:23 | 156,356,507 | 0 | 0 | null | 2020-02-11T07:00:52 | 2018-11-06T09:11:29 | CSS | UTF-8 | Java | false | false | 1,430 | java | package com.WebXemPhim.Controler;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.WebXemPhim.Dao.FilmDao;
/**
* Servlet implementation class delete
*/
@WebServlet("/delete")
public class delete extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public delete() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int id=Integer.parseInt(request.getParameter("id"));
FilmDao.deleteFilm(id);
RequestDispatcher dispatcher //
= this.getServletContext()//
.getRequestDispatcher("/Views/Index.jsp");
dispatcher.forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"dattran01477@gmail.com"
] | dattran01477@gmail.com |
26880e719049d2a0fed19f8ee139bbdff132b4e8 | 885f351c1474d740d8c0a75bf95374362d7dead6 | /src/main/java/com/envmgr/labelservice/GetUrlXMLResponse.java | 51fc5a9517ec56c63ef1f3ce8f1910810538bf81 | [
"Apache-2.0"
] | permissive | slingr-stack/endicia-endpoint | ab91d0dbb9152e6af97b682bbcc279fcfe20330e | 4403241c5204c5f33aac3e53002401b1fdc3632f | refs/heads/master | 2021-11-24T11:49:53.238202 | 2021-11-12T18:27:08 | 2021-11-12T18:27:08 | 218,134,294 | 1 | 0 | Apache-2.0 | 2020-10-13T17:03:30 | 2019-10-28T20:00:12 | Java | UTF-8 | Java | false | false | 1,624 | java |
package com.envmgr.labelservice;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Clase Java para anonymous complex type.
*
* <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="GetUrlResponse" type="{www.envmgr.com/LabelService}GetUrlResult" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getUrlResponse"
})
@XmlRootElement(name = "GetUrlXMLResponse")
public class GetUrlXMLResponse {
@XmlElement(name = "GetUrlResponse")
protected GetUrlResult getUrlResponse;
/**
* Obtiene el valor de la propiedad getUrlResponse.
*
* @return
* possible object is
* {@link GetUrlResult }
*
*/
public GetUrlResult getGetUrlResponse() {
return getUrlResponse;
}
/**
* Define el valor de la propiedad getUrlResponse.
*
* @param value
* allowed object is
* {@link GetUrlResult }
*
*/
public void setGetUrlResponse(GetUrlResult value) {
this.getUrlResponse = value;
}
}
| [
"nicolas_marquez10@hotmail.com"
] | nicolas_marquez10@hotmail.com |
5d171e72a43df53e39cba448b5fc58ca59651864 | 2986ce90e841adc31074685d99f2fbf92619c397 | /Workspace/SpellCheckLab/src/SimpleWordPreparer.java | f18e493e3fa36129cf88ab814ac0b609d66f7af8 | [] | no_license | clairegarza2012/Algorithms | 23f2ed1d989c5e3ef04b806554ec38afdb9bf9fd | af601d3ca2b1951f27857b29c5c3b4866280044b | refs/heads/master | 2021-01-18T14:53:23.742887 | 2014-10-23T22:40:27 | 2014-10-23T22:40:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | import java.util.HashSet;
import java.util.Set;
public class SimpleWordPreparer implements WordPreparer, WordComparer {
@Override
public Word prepare(String word) {
return new Word(word);
}
@Override
public Set<Word> getRelatedWords(String word) {
return new HashSet<Word>();
}
}
| [
"badG_22@yahoo.com"
] | badG_22@yahoo.com |
75860f50973624e46e0f886b8b3dd5e4bae27679 | b9295e6c9f13de75713fb13bcb0e06ca32f53ed6 | /src/selfReviewExercises/BodyMass.java | b40fc1725103a0f2c05f4a3a714689d266c75050 | [] | no_license | lkovalch/JavaWithGene | 15bd0556b84de4fed920704833d01972b78d0935 | e5de90d47d7f7b43a9448f712522704076054eec | refs/heads/master | 2020-09-03T22:01:57.193587 | 2019-11-04T19:49:48 | 2019-11-04T19:49:48 | 219,583,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,148 | java | package selfReviewExercises;
import java.util.Scanner;
public class BodyMass {
public static void CalculateBodyMass () {
Scanner input = new Scanner (System.in);
//Prompt user to enter weight in kg
System.out.print("Enter your weight in kilos" + ": ");
double weight =input.nextInt();
//Prompt user to enter height in sm
System.out.print("Enter your height in santimeter: ");
double height = input.nextInt();
// Calculate body mass
double result=(weight/(height * height/1000)*10);
//System.out.print ("Your BMI is: " + bm.CalculateBodyMass( weight, height));
System.out.println ("Your BMI is: " + Math.round(result));
if (result<18.5) {
System.out.println("You are underweight! ");
}
else if (result >=18.5 && result <=24.9) {
System.out.println("Your weight is normal ");
}
else if (result >=25 && result <=29.0) {
System.out.println("You are little overweight ");
}
else if (result >=30) {
System.out.println("You should STOP eat - you are FAT ");
}
else System.out.println("Somethingis not correct...");
input.close();
}
} | [
"lyailya.kovalchuk@coxautoinc.com"
] | lyailya.kovalchuk@coxautoinc.com |
fd05416cb067422a21fbc4af2e97afcd78496566 | 3beaae25a4d15a025b3b1e4284be7f95c390747c | /app/src/main/java/cn/mucang/property/McPropertiesAdapter.java | af176c96d717d11c0951fcd1fd8cc39eb0438f4a | [] | no_license | nanhuaqq/McPropertiesView | a95e873f4544c3df37dea5288c8ffcd6199e5380 | e07b114603c223f182aaf8d2155d431a795228f5 | refs/heads/master | 2021-01-17T18:07:48.940261 | 2016-06-17T11:15:40 | 2016-06-17T11:15:40 | 61,000,695 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,867 | java | package cn.mucang.property;
import android.database.DataSetObserver;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by nanhuaqq on 2016/5/12.
*/
public interface McPropertiesAdapter {
/**
* 区域数目 (顶部的 tableHeader算一个section 这里需要注意 要特殊处理)
* @return
*/
int getSectionCount();
int getRowCount(int section);
int getTotalRowCount();
int getSectionIndex(int rowIndex);
boolean isSectionTitle(int rowIndex);
int getRowIndexInSection(int rowIndex);
int getColumnCount();
void registerDataSetObserver(DataSetObserver observer);
void unregisterDataSetObserver(DataSetObserver observer);
/**
* @param section
* @param row
* @param column
* @param convertView
* @param parent
* @return
*/
public View getCellView(int section, int row, int column, View convertView, ViewGroup parent);
public View getCellTitleView(int section, int row, View convertView, ViewGroup parent);
public View getTableHeaderView(int column, View convertView, ViewGroup parent);
public View getSectionHeaderView(int section, View convertView, ViewGroup parent);
public View getLeftCornerView(View convertView, ViewGroup parent);
/**
* 支持额外头部
* @param column
* @param convertView
* @param parent
* @return
*/
public View getExtraTableHeaderView(int column,View convertView,ViewGroup parent);
/**
* 支持额外cell
* @param section
* @param row
* @param column
* @param convertView
* @param parent
* @return
*/
public View getExtraCellView(int section,int row,int column,View convertView,ViewGroup parent);
public int getItemViewType(int section, int row, int column);
public int getViewTypeCount();
}
| [
"qinqun@mucang.cn"
] | qinqun@mucang.cn |
96017eb11ce92ebb7ae7c188179b43167661804d | ce1a693343bda16dc75fd64f1688bbfa5d27ac07 | /system/src/main/org/jboss/system/server/profileservice/repository/HotDeploymentRepository.java | 09c618085824d65bf4a1a7b4f0a87f722ac56892 | [] | no_license | JavaQualitasCorpus/jboss-5.1.0 | 641c412b1e4f5f75bb650cecdbb2a56de2f6a321 | 9307e841b1edc37cc97c732e4b87125530d8ae49 | refs/heads/master | 2023-08-12T08:39:55.319337 | 2020-06-02T17:48:09 | 2020-06-02T17:48:09 | 167,004,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,568 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.system.server.profileservice.repository;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
import org.jboss.profileservice.spi.DeploymentContentFlags;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ModificationInfo.ModifyStatus;
import org.jboss.virtual.VirtualFile;
/**
* A deployment repository, with hot deployment capabilities.
*
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
* @version $Revision: 87159 $
*/
public class HotDeploymentRepository extends BasicDeploymentRepository
{
/** The structure modification checker */
private StructureModificationChecker checker;
public HotDeploymentRepository(ProfileKey key, URI[] uris)
{
super(key, uris);
}
/**
* Get the structure modified checker.
*
* @return the checker
*/
protected StructureModificationChecker getChecker()
{
if (checker == null)
throw new IllegalArgumentException("Checker must be set");
return checker;
}
/**
* Set the checker.
*
* @param checker the checker
*/
public void setChecker(StructureModificationChecker checker)
{
this.checker = checker;
}
@Override
public synchronized Collection<ModificationInfo> getModifiedDeployments() throws Exception
{
boolean trace = log.isTraceEnabled();
Collection<ProfileDeployment> apps = getDeployments();
List<ModificationInfo> modified = new ArrayList<ModificationInfo>();
if (trace)
log.trace("Checking applications for modifications");
if (trace)
log.trace("Aquiring content read lock");
lockRead();
try
{
if (apps != null)
{
Iterator<ProfileDeployment> iter = apps.iterator();
while (iter.hasNext())
{
ProfileDeployment ctx = iter.next();
VirtualFile root = ctx.getRoot();
String pathName = ctx.getName();
// Ignore locked or disabled applications
if (this.hasDeploymentContentFlags(pathName, ignoreFlags))
{
if (trace)
log.trace("Ignoring locked application: " + root);
continue;
}
// Check for removal
if (root.exists() == false)
{
long rootLastModified = root.getLastModified();
ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.REMOVED);
modified.add(info);
iter.remove();
// Remove last modified cache
cleanUpRoot(root);
if (trace)
log.trace(pathName + " was removed");
}
// Check for modification
else if (hasDeploymentContentFlags(pathName, DeploymentContentFlags.MODIFIED)
|| getChecker().hasStructureBeenModified(root))
{
long rootLastModified = root.getLastModified();
if (trace)
log.trace(pathName + " was modified: " + rootLastModified);
// Create the modification info
ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.MODIFIED);
modified.add(info);
}
}
// Now check for additions
checkForAdditions(modified);
}
}
finally
{
unlockRead();
if (trace)
log.trace("Released content read lock");
}
if (modified.size() > 0)
updateLastModfied();
return modified;
}
/**
* Check for additions.
*
* @param modified the modified list
* @throws Exception for any error
*/
protected void checkForAdditions(List<ModificationInfo> modified) throws Exception
{
for (URI applicationDir : getRepositoryURIs())
{
VirtualFile deployDir = getCachedVirtualFile(applicationDir);
List<VirtualFile> added = new ArrayList<VirtualFile>();
addedDeployments(added, deployDir);
applyAddedDeployments(applicationDir, modified, added);
}
}
/**
* Apply added deployments.
*
* @param applicationDir the app dir
* @param modified the modifed list
* @param added the added deployments
* @throws Exception for any error
*/
protected void applyAddedDeployments(URI applicationDir, List<ModificationInfo> modified, List<VirtualFile> added) throws Exception
{
for (VirtualFile vf : added)
{
// Create deployment
ProfileDeployment ctx = createDeployment(vf);
// Create modification info
ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
// Add
modified.add(info);
internalAddDeployment(ctx.getName(), ctx);
getChecker().addStructureRoot(vf);
}
}
@Override
protected void cleanUpRoot(VirtualFile vf)
{
getChecker().removeStructureRoot(vf);
}
}
| [
"taibi@sonar-scheduler.rd.tut.fi"
] | taibi@sonar-scheduler.rd.tut.fi |
c9bd5d3d267323354891aba6e47033ab6ce9001e | 66947b153c57033943a456a774229817362979d9 | /src/com/rcs/Classwork/Day17/Main.java | 6060ebb4af289ec0c369790ae0d94b435bd2cd93 | [] | no_license | Losstarot09/Java-Classwork | e218ba527fb8c15823df7bcb88ec088d84119d6a | 543dd5b008dc3fd84c10e9c08611d950c50dc62b | refs/heads/master | 2023-04-03T11:30:19.700376 | 2021-04-17T08:55:39 | 2021-04-17T08:55:39 | 342,784,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package com.rcs.Classwork.Day17;
public class Main {
public static void main(String[] args) {
System.out.println("Uzdevums 1");
Circle redCircle = new Circle(6.4, "Red");
Circle blueCircle = new Circle(2.0, "Blue");
Circle blackCircle = new Circle(3.2);
System.out.printf("Color = %s, Area = %.8f, Circle Length = %.8f\n",redCircle.color, redCircle.getArea(),
redCircle.getCircleLength());
System.out.printf("Color = %s, Area = %.8f, Circle Length = %.8f\n",blueCircle.color, blueCircle.getArea(),
blueCircle.getCircleLength());
System.out.printf("Color = %s, Area = %.8f, Circle Length = %.8f\n",blackCircle.color, blackCircle.getArea(),
blackCircle.getCircleLength());
}
}
| [
"lobanovs.arturs@gmail.com"
] | lobanovs.arturs@gmail.com |
0c3ef7cb26a1dbf3ba7dd0f3a490db4084dba1d6 | ce27c995912d4f947654f9d6d6bced224d6e9f8b | /DATA/CODE/smyle/cvs/smyle/src/drjava/smyle/tests/ScalablePoolTest.java | f01161fb2457f404a37441aad6ffbd832d6b9a7d | [] | no_license | gautamkshitij/SEMIT_MAIN | 26fd5fa43548c76105a342a8edc4b179875c4d8b | 0e39d8933a97d3ce569a955eb6d6dc8cb6ccb5e0 | refs/heads/master | 2020-04-02T00:59:50.298105 | 2016-08-17T04:28:16 | 2016-08-17T04:28:16 | 39,314,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,347 | java | /*
This source file is part of Smyle, a database library.
For up-to-date information, see http://www.drjava.de/smyle
Copyright (C) 2001 Stefan Reich (doc@drjava.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For full license text, see doc/license/lgpl.txt in this distribution
*/
package drjava.smyle.tests;
import java.util.*;
import junit.framework.*;
import org.artsProject.mcop.*;
import drjava.smyle.core.*;
public class ScalablePoolTest extends TestCase {
public ScalablePoolTest(String name) { super(name); }
ChunkManager cm;
ScalablePool<String> pool;
int id1, id2;
public void setUp() throws Exception {
cm = new DefaultChunkManager(new MemoryDisk(), DiskStore.VERSION);
pool = new ScalablePool<String>(new StringMarDemar(), cm, null);
}
public void testAddGetReplace() throws Exception {
for (int i = 0; i < 128; i++)
assertEquals(i, pool.insert(String.valueOf(i)));
for (int i = 0; i < 128; i++)
assertEquals(String.valueOf(i), pool.get(i));
for (int i = 0; i < 128; i++)
if ((i & 1) == 0)
pool.replace(i, String.valueOf(i*2));
else
pool.release(i);
checkAfterAddGetReplace();
}
void checkAfterAddGetReplace() throws Exception {
for (int i = 0; i < 128; i++)
assertEquals((i & 1) == 0 ? String.valueOf(i*2) : null, pool.get(i));
assertEquals(128, pool.size());
// test get with a very high, not-existing index
assertEquals(null, pool.get(123456));
pool.checkConsistency();
}
public void testReleaseWholeBlock() throws Exception {
for (int i = 0; i < 128; i++)
assertEquals(i, pool.insert(String.valueOf(i)));
for (int i = 31; i >= 0; i--)
pool.release(i);
assertEquals(null, pool.get(0));
for (int i = 0; i < 32; i++)
assertEquals(i, pool.insert(String.valueOf(i)));
}
public void testNonExtantIds() {
for (int i = -10; i < 10; i++)
assertNull(pool.get(i));
}
public void testInsert() {
int id = pool.insert("apple");
assertEquals("apple", pool.get(id));
}
public void testInsertTwoObjects() {
id1 = pool.insert("apple");
id2 = pool.insert("pear");
assertEquals("apple", pool.get(id1));
assertEquals("pear", pool.get(id2));
}
public void testGetIsRepeatable() {
testInsertTwoObjects();
assertEquals("apple", pool.get(id1));
assertEquals("pear", pool.get(id2));
}
public void testReleasedSlotsContainNull() {
int id = pool.insert("banana");
pool.release(id);
assertNull(pool.get(id));
}
public void testIdRecycling() {
int id = pool.insert("banana");
pool.release(id);
int id2 = pool.insert("pineapple");
assertEquals("ID", id, id2);
}
/** more complicated recycling test
(fails if ids can only be recycled from the end) */
public void testIdRecycling2() {
testInsertTwoObjects();
pool.release(id1);
pool.release(id2);
int id3 = pool.insert("orange");
int id4 = pool.insert("grapefruit");
assertEquals("ID 1", id1, id3);
assertEquals("ID 2", id2, id4);
}
/** this is needed for DispatcherTest */
public void testFirstIdIsZero() {
assertEquals(0, pool.insert("something"));
}
public void testReplace() {
testInsertTwoObjects();
pool.replace(id1, "papaya");
assertEquals("papaya", pool.get(id1));
assertEquals("pear", pool.get(id2));
}
public void testSaveAndLoad() throws Exception {
testAddGetReplace();
rotate();
checkAfterAddGetReplace();
}
void rotate() throws Exception {
ChunkRef master = pool.flush();
pool = new ScalablePool<String>(new StringMarDemar(), cm, master);
}
}
| [
"gautamkshitij@gmail.com"
] | gautamkshitij@gmail.com |
e0e841f254c3443081cb0e39e254ecfb20f945bb | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/reloZid_android-anuto/app/src/main/java/ch/logixisland/anuto/util/container/SafeCollection.java | 046085268ead3609af40b38254da6be5f66c09c4 | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,759 | java | // isComment
package ch.logixisland.anuto.util.container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import ch.logixisland.anuto.util.iterator.LazyIterator;
import ch.logixisland.anuto.util.iterator.StreamIterable;
import ch.logixisland.anuto.util.iterator.StreamIterator;
public class isClassOrIsInterface<T> implements Collection<T>, StreamIterable<T> {
private class isClassOrIsInterface extends LazyIterator<T> {
private int isVariable = isIntegerConstant;
private isConstructor() {
isNameExpr.isMethod(this);
}
@Override
public T isMethod() {
T isVariable = null;
if (isNameExpr < isNameExpr.isMethod()) {
isNameExpr = isNameExpr.isMethod(isNameExpr++);
} else {
isMethod();
}
return isNameExpr;
}
@Override
public void isMethod() {
isNameExpr.isMethod(this);
}
@Override
public void isMethod() {
isNameExpr.this.isMethod(isNameExpr - isIntegerConstant);
}
}
private final List<T> isVariable;
private final Collection<SafeIterator> isVariable = new ArrayList<>();
public isConstructor() {
isNameExpr = new ArrayList<>();
}
@Override
public boolean isMethod(T isParameter) {
return isNameExpr.isMethod(isNameExpr);
}
@Override
public boolean isMethod(Collection<? extends T> isParameter) {
return isNameExpr.isMethod(isNameExpr);
}
@Override
public void isMethod() {
isNameExpr.isMethod();
for (SafeIterator isVariable : isNameExpr) {
isNameExpr.isFieldAccessExpr = isIntegerConstant;
}
}
@Override
public boolean isMethod(Object isParameter) {
return isNameExpr.isMethod(isNameExpr);
}
@Override
public boolean isMethod(Collection<?> isParameter) {
return isNameExpr.isMethod(isNameExpr);
}
@Override
public boolean isMethod() {
return isNameExpr.isMethod();
}
@Override
public StreamIterator<T> isMethod() {
return new SafeIterator();
}
@Override
public boolean isMethod(Object isParameter) {
// isComment
int isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr >= isIntegerConstant) {
isMethod(isNameExpr);
return true;
}
return true;
}
@Override
public boolean isMethod(Collection<?> isParameter) {
boolean isVariable = true;
for (Object isVariable : isNameExpr) {
if (isMethod(isNameExpr)) {
isNameExpr = true;
}
}
return isNameExpr;
}
@Override
public boolean isMethod(Collection<?> isParameter) {
boolean isVariable = true;
for (T isVariable : this) {
if (!isNameExpr.isMethod(isNameExpr)) {
isMethod(isNameExpr);
isNameExpr = true;
}
}
return isNameExpr;
}
@Override
public int isMethod() {
return isNameExpr.isMethod();
}
@Override
public Object[] isMethod() {
return isNameExpr.isMethod();
}
@Override
public <T1> T1[] isMethod(T1[] isParameter) {
// isComment
return isNameExpr.isMethod(isNameExpr);
}
private T isMethod(int isParameter) {
T isVariable = isNameExpr.isMethod(isNameExpr);
for (SafeIterator isVariable : isNameExpr) {
if (isNameExpr.isFieldAccessExpr > isNameExpr) {
isNameExpr.isFieldAccessExpr--;
}
}
return isNameExpr;
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
89f3394abc389e3ec646717e7e170468cd19741d | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/realm-java/2015/12/RealmSchema.java | 0f83fd043d8b3ba9f82205e624dc10664ecbe6b5 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 10,349 | java | /*
* Copyright 2015 Realm 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 io.realm;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import io.realm.internal.ColumnIndices;
import io.realm.internal.ColumnInfo;
import io.realm.internal.ImplicitTransaction;
import io.realm.internal.Table;
import io.realm.internal.Util;
/**
* Class for interacting with the Realm schema using a dynamic API. This makes it possible
* to add, delete and change the classes in the Realm.
*
* All changes must happen inside a write transaction for that Realm.
*
* @see io.realm.RealmMigration
*/
public final class RealmSchema {
private static final String TABLE_PREFIX = Table.TABLE_PREFIX;
private static final String EMPTY_STRING_MSG = "Null or empty class names are not allowed";
// Caches Dynamic Class objects given as Strings (both model classes and proxy classes) to Realm Tables
private final Map<String, Table> dynamicClassToTable = new HashMap<String, Table>();
// Caches Class objects (both model classes and proxy classes) to Realm Tables
private final Map<Class<? extends RealmObject>, Table> classToTable = new HashMap<Class<? extends RealmObject>, Table>();
// Caches Class objects (both model classes and proxy classes) to their Schema object
private final Map<Class<? extends RealmObject>, RealmObjectSchema> classToSchema = new HashMap<Class<? extends RealmObject>, RealmObjectSchema>();
// Caches Class Strings (both model classes and proxy classes) to their Schema object
private final Map<String, RealmObjectSchema> dynamicClassToSchema = new HashMap<String, RealmObjectSchema>();
private final ImplicitTransaction transaction;
private final BaseRealm realm;
ColumnIndices columnIndices; // Cached field look up
/**
* Creates a wrapper to easily manipulate the current schema of a Realm.
*/
RealmSchema(BaseRealm realm, ImplicitTransaction transaction) {
this.realm = realm;
this.transaction = transaction;
}
/**
* Returns the Realm schema for a given class.
*
* @param className name of the class
* @return schema object for that class or {@code null} if the class doesn't exists.
*
*/
public RealmObjectSchema get(String className) {
checkEmpty(className, EMPTY_STRING_MSG);
String internalClassName = TABLE_PREFIX + className;
if (transaction.hasTable(internalClassName)) {
Table table = transaction.getTable(internalClassName);
RealmObjectSchema.DynamicColumnMap columnIndices = new RealmObjectSchema.DynamicColumnMap(table);
return new RealmObjectSchema(realm, table, columnIndices);
} else {
return null;
}
}
/**
* Returns the {@link RealmObjectSchema} for all RealmObject classes that can be saved in this Realm.
*
* @return the set of all classes in this Realm or no RealmObject classes can be saved in the Realm.
*/
public Set<RealmObjectSchema> getAll() {
int tableCount = (int) transaction.size();
Set<RealmObjectSchema> schemas = new LinkedHashSet<>(tableCount);
for (int i = 0; i < tableCount; i++) {
String tableName = transaction.getTableName(i);
if (Table.isMetaTable(tableName)) {
continue;
}
Table table = transaction.getTable(tableName);
RealmObjectSchema.DynamicColumnMap columnIndices = new RealmObjectSchema.DynamicColumnMap(table);
schemas.add(new RealmObjectSchema(realm, table, columnIndices));
}
return schemas;
}
/**
* Adds a new class to the Realm.
*
* @param className name of the class.
* @return a Realm schema object for that class.
*/
public RealmObjectSchema create(String className) {
checkEmpty(className, EMPTY_STRING_MSG);
String internalTableName = TABLE_PREFIX + className;
if (internalTableName.length() > Table.TABLE_MAX_LENGTH) {
throw new IllegalArgumentException("Class name is to long. Limit is 57 characters: " + className.length());
}
if (transaction.hasTable(internalTableName)) {
throw new IllegalArgumentException("Class already exists: " + className);
}
Table table = transaction.getTable(internalTableName);
RealmObjectSchema.DynamicColumnMap columnIndices = new RealmObjectSchema.DynamicColumnMap(table);
return new RealmObjectSchema(realm, table, columnIndices);
}
/**
* Removes a class from the Realm. All data will be removed. Removing a class while other classes point
* to it will throw an {@link IllegalStateException}. Remove those classes or fields first.
*
* @param className name of the class to remove.
*/
public void remove(String className) {
checkEmpty(className, EMPTY_STRING_MSG);
String internalTableName = TABLE_PREFIX + className;
checkHasTable(className, "Cannot remove class because it is not in this Realm: " + className);
transaction.removeTable(internalTableName);
}
/**
* Renames a class already in the Realm.
*
* @param oldClassName old class name.
* @param newClassName new class name.
* @return a schema object for renamed class.
*/
public RealmObjectSchema rename(String oldClassName, String newClassName) {
checkEmpty(oldClassName, "Class names cannot be empty or null");
checkEmpty(newClassName, "Class names cannot be empty or null");
String oldInternalName = TABLE_PREFIX + oldClassName;
String newInternalName = TABLE_PREFIX + newClassName;
checkHasTable(oldClassName, "Cannot rename class because it doesn't exist in this Realm: " + oldClassName);
if (transaction.hasTable(newInternalName)) {
throw new IllegalArgumentException(oldClassName + " cannot be renamed because the new class already exists: " + newClassName);
}
transaction.renameTable(oldInternalName, newInternalName);
Table table = transaction.getTable(newInternalName);
RealmObjectSchema.DynamicColumnMap columnIndices = new RealmObjectSchema.DynamicColumnMap(table);
return new RealmObjectSchema(realm, table, columnIndices);
}
/**
* Checks if a given class already exists in the schema.
*
* @param className class name to check.
* @return {@code true} if the class already exists. {@code false} otherwise.
*/
public boolean contains(String className) {
return transaction.hasTable(Table.TABLE_PREFIX + className);
}
private void checkEmpty(String str, String error) {
if (str == null || str.isEmpty()) {
throw new IllegalArgumentException(error);
}
}
private void checkHasTable(String className, String errorMsg) {
String internalTableName = TABLE_PREFIX + className;
if (!transaction.hasTable(internalTableName)) {
throw new IllegalArgumentException(errorMsg);
}
}
ColumnInfo getColumnInfo(Class<? extends RealmObject> clazz) {
final ColumnInfo columnInfo = columnIndices.getColumnInfo(clazz);
if (columnInfo == null) {
throw new IllegalStateException("No validated schema information found for " + realm.configuration.getSchemaMediator().getTableName(clazz));
}
return columnInfo;
}
Table getTable(String className) {
className = Table.TABLE_PREFIX + className;
Table table = dynamicClassToTable.get(className);
if (table == null) {
if (!transaction.hasTable(className)) {
throw new IllegalArgumentException("The class " + className + " doesn't exist in this Realm.");
}
table = transaction.getTable(className);
dynamicClassToTable.put(className, table);
}
return table;
}
Table getTable(Class<? extends RealmObject> clazz) {
Table table = classToTable.get(clazz);
if (table == null) {
clazz = Util.getOriginalModelClass(clazz);
table = transaction.getTable(realm.configuration.getSchemaMediator().getTableName(clazz));
classToTable.put(clazz, table);
}
return table;
}
RealmObjectSchema getSchemaForClass(Class<? extends RealmObject> clazz) {
RealmObjectSchema classSchema = classToSchema.get(clazz);
if (classSchema == null) {
clazz = Util.getOriginalModelClass(clazz);
Table table = transaction.getTable(realm.configuration.getSchemaMediator().getTableName(clazz));
classSchema = new RealmObjectSchema(realm, table, columnIndices.getColumnInfo(clazz).getIndicesMap());
classToSchema.put(clazz, classSchema);
}
return classSchema;
}
RealmObjectSchema getSchemaForClass(String className) {
className = Table.TABLE_PREFIX + className;
RealmObjectSchema dynamicSchema = dynamicClassToSchema.get(className);
if (dynamicSchema == null) {
if (!transaction.hasTable(className)) {
throw new IllegalArgumentException("The class " + className + " doesn't exist in this Realm.");
}
Table table = transaction.getTable(className);
RealmObjectSchema.DynamicColumnMap columnIndices = new RealmObjectSchema.DynamicColumnMap(table);
dynamicSchema = new RealmObjectSchema(realm, table, columnIndices);
dynamicClassToSchema.put(className, dynamicSchema);
}
return dynamicSchema;
}
void setColumnIndices(ColumnIndices columnIndices) {
this.columnIndices = columnIndices;
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
4268e62a4c935e3b10495680abddea927aeb95d2 | d8bdb09733ee42973ff29e4cb27c612fb48661dd | /app/src/test/java/admin/maarula/admin/maarula/ExampleUnitTest.java | b508e5b8e53831917062abc5b6c39a443bf4acd2 | [] | no_license | CamelCoders/MaarulaClasses | c112137600029b3c41f738de3c7164a746cde6bb | 7269183b49b82f9378f087bc3f0afe1a7df1d880 | refs/heads/master | 2023-06-26T09:01:26.470244 | 2021-07-22T14:51:37 | 2021-07-22T14:51:37 | 388,498,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package admin.maarula.admin.maarula;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* 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);
}
} | [
"shivamtiwari.1527@gmail.com"
] | shivamtiwari.1527@gmail.com |
982f11d466a1e60882787744e8e9c23791ae3e43 | f1350901de07b4c69c9c399f54e0c199cde771b2 | /crawler/src/main/java/com/jdev/crawler/core/IStepBuilder.java | f9e1ec0321c1d0cb909b06d4922575378b45168e | [] | no_license | AlehGalo/site-processing-engine | ebfa58cb3aacc92b05d840e8ffd09529f44a4ff7 | 52e38890f425f7e2ab8fe370981906e6e982efc9 | refs/heads/master | 2021-01-19T08:20:55.513099 | 2014-03-25T08:12:40 | 2014-03-25T08:12:40 | 15,226,262 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | /**
*
*/
package com.jdev.crawler.core;
import com.jdev.crawler.core.process.IProcess;
import com.jdev.crawler.core.user.IUserData;
/**
* @author Aleh
*/
public interface IStepBuilder {
/**
* @param userData
* @return
*/
IProcess buildSteps(IUserData userData);
}
| [
"a.bahatyrou@a-bahatyrou.godeltech.com"
] | a.bahatyrou@a-bahatyrou.godeltech.com |
56affefbc7344629c86543b521ff02d7d8e75edc | b71621612c0d580c3caea694a52da51f7d0292e9 | /src/main/java/com/yandex/money/api/exceptions/InvalidTokenException.java | dc368bc52d5b6567f1ddd2f01c46a9745bbb5d26 | [
"MIT"
] | permissive | raqeta/yandex-money-sdk-java | 5b1752fc34194f8c4a24b7121a08cfabd5d9e6f4 | e0a74c77495eebbb97979bf37f0fa2b9a57acb82 | refs/heads/master | 2021-01-22T01:51:30.426259 | 2015-01-20T18:01:09 | 2015-01-20T18:01:09 | 29,522,781 | 0 | 1 | null | 2015-01-20T09:49:28 | 2015-01-20T09:49:27 | Java | UTF-8 | Java | false | false | 568 | java | package com.yandex.money.api.exceptions;
/**
* Token is invalid.
* <p/>
* Possible causes:
* <ul>
* <li>token does not exist;</li>
* <li>token is overdue;</li>
* <li>token has been revoked.</li>
* </ul>
* <p/>
* The app should ask for a new token.
*
* @author Roman Tsirulnikov (romanvt@yamoney.ru)
* @see com.yandex.money.api.net.OAuth2Authorization
* @see com.yandex.money.api.net.OAuth2Session
*/
public final class InvalidTokenException extends Exception {
public InvalidTokenException(String error) {
super(error);
}
}
| [
"vyasevich@yamoney.ru"
] | vyasevich@yamoney.ru |
0214fb5513abd001b8c1f972991e3cc828792e07 | 71071f98d05549b67d4d6741e8202afdf6c87d45 | /files/Spring_Data_for_Apache_Cassandra/DATACASS-146/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/SimpleReactiveCassandraRepository.java | 14f73dd02ed97bcbc56f7e01f75235cec99c080a | [] | no_license | Sun940201/SpringSpider | 0adcdff1ccfe9ce37ba27e31b22ca438f08937ad | ff2fc7cea41e8707389cb62eae33439ba033282d | refs/heads/master | 2022-12-22T09:01:54.550976 | 2018-06-01T06:31:03 | 2018-06-01T06:31:03 | 128,649,779 | 1 | 0 | null | 2022-12-16T00:51:27 | 2018-04-08T14:30:30 | Java | UTF-8 | Java | false | false | 9,628 | java | /*
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.cassandra.repository.support;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.data.cassandra.core.ReactiveCassandraOperations;
import org.springframework.data.cassandra.core.convert.CassandraConverter;
import org.springframework.data.cassandra.core.mapping.CassandraPersistentEntity;
import org.springframework.data.cassandra.repository.ReactiveCassandraRepository;
import org.springframework.data.cassandra.repository.query.CassandraEntityInformation;
import org.springframework.util.Assert;
import org.reactivestreams.Publisher;
import com.datastax.driver.core.querybuilder.Insert;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.core.querybuilder.Select;
/**
* Reactive repository base implementation for Cassandra.
*
* @author Mark Paluch
* @author Christoph Strobl
* @since 2.0
*/
public class SimpleReactiveCassandraRepository<T, ID> implements ReactiveCassandraRepository<T, ID> {
private final CassandraEntityInformation<T, ID> entityInformation;
private final ReactiveCassandraOperations operations;
/**
* Create a new {@link SimpleReactiveCassandraRepository} for the given {@link CassandraEntityInformation} and
* {@link ReactiveCassandraOperations}.
*
* @param metadata must not be {@literal null}.
* @param operations must not be {@literal null}.
*/
public SimpleReactiveCassandraRepository(CassandraEntityInformation<T, ID> metadata,
ReactiveCassandraOperations operations) {
Assert.notNull(metadata, "CassandraEntityInformation must not be null");
Assert.notNull(operations, "ReactiveCassandraOperations must not be null");
this.entityInformation = metadata;
this.operations = operations;
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#save(S)
*/
@Override
public <S extends T> Mono<S> save(S entity) {
Assert.notNull(entity, "Entity must not be null");
return operations.getReactiveCqlOperations().execute(createFullInsert(entity)).map(it -> entity);
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#save(java.lang.Iterable)
*/
@Override
public <S extends T> Flux<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null");
return saveAll(Flux.fromIterable(entities));
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#save(org.reactivestreams.Publisher)
*/
@Override
public <S extends T> Flux<S> saveAll(Publisher<S> entityStream) {
Assert.notNull(entityStream, "The given Publisher of entities must not be null");
return Flux.from(entityStream)
.flatMap(entity -> operations.getReactiveCqlOperations().execute(createFullInsert(entity)).map(it -> entity));
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.repository.ReactiveCassandraRepository#insert(java.lang.Object)
*/
@Override
public <S extends T> Mono<S> insert(S entity) {
Assert.notNull(entity, "Entity must not be null");
return operations.insert(entity);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.repository.ReactiveCassandraRepository#insert(java.lang.Iterable)
*/
@Override
public <S extends T> Flux<S> insert(Iterable<S> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null");
return Flux.fromIterable(entities).flatMap(operations::insert);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.repository.ReactiveCassandraRepository#insert(org.reactivestreams.Publisher)
*/
@Override
public <S extends T> Flux<S> insert(Publisher<S> entityStream) {
Assert.notNull(entityStream, "The given Publisher of entities must not be null");
return Flux.from(entityStream).flatMap(operations::insert);
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#count()
*/
@Override
public Mono<Long> count() {
return operations.count(entityInformation.getJavaType());
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#existsById(java.lang.Object)
*/
@Override
public Mono<Boolean> existsById(ID id) {
Assert.notNull(id, "The given id must not be null");
return operations.exists(id, entityInformation.getJavaType());
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#existsById(org.reactivestreams.Publisher)
*/
@Override
public Mono<Boolean> existsById(Publisher<ID> publisher) {
Assert.notNull(publisher, "The Publisher of ids must not be null");
return Mono.from(publisher).flatMap(this::existsById);
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#findById(java.lang.Object)
*/
@Override
public Mono<T> findById(ID id) {
Assert.notNull(id, "The given id must not be null");
return operations.selectOneById(id, entityInformation.getJavaType());
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#findById(org.reactivestreams.Publisher)
*/
@Override
public Mono<T> findById(Publisher<ID> publisher) {
Assert.notNull(publisher, "The Publisher of ids must not be null");
return Mono.from(publisher).flatMap(this::findById);
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#findAll()
*/
@Override
public Flux<T> findAll() {
Select select = QueryBuilder.select().from(entityInformation.getTableName().toCql());
return operations.select(select, entityInformation.getJavaType());
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#findAllById(java.lang.Iterable)
*/
@Override
public Flux<T> findAllById(Iterable<ID> iterable) {
Assert.notNull(iterable, "The given Iterable of ids must not be null");
return findAllById(Flux.fromIterable(iterable));
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#findAllById(org.reactivestreams.Publisher)
*/
@Override
public Flux<T> findAllById(Publisher<ID> idStream) {
Assert.notNull(idStream, "The given Publisher of ids must not be null");
return Flux.from(idStream).flatMap(this::findById);
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#delete(java.lang.Object)
*/
@Override
public Mono<Void> delete(T entity) {
Assert.notNull(entity, "The given entity must not be null");
return operations.delete(entity).then();
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteById(java.lang.Object)
*/
@Override
public Mono<Void> deleteById(ID id) {
Assert.notNull(id, "The given id must not be null");
return operations.deleteById(id, entityInformation.getJavaType()).then();
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteById(org.reactivestreams.Publisher)
*/
@Override
public Mono<Void> deleteById(Publisher<ID> publisher) {
Assert.notNull(publisher, "The Publisher of ids must not be null");
return Mono.from(publisher).flatMap(this::deleteById).then();
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteAll()
*/
@Override
public Mono<Void> deleteAll() {
return operations.truncate(entityInformation.getJavaType());
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteAll(java.lang.Iterable)
*/
@Override
public Mono<Void> deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null");
return Flux.fromIterable(entities).flatMap(operations::delete).then();
}
/* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteAll(org.reactivestreams.Publisher)
*/
@Override
public Mono<Void> deleteAll(Publisher<? extends T> entityStream) {
Assert.notNull(entityStream, "The given Publisher of entities must not be null");
return Flux.from(entityStream).flatMap(operations::delete).then();
}
private <S extends T> Insert createFullInsert(S entity) {
CassandraConverter converter = operations.getConverter();
CassandraPersistentEntity<?> persistentEntity =
converter.getMappingContext().getRequiredPersistentEntity(entity.getClass());
Map<String, Object> toInsert = new LinkedHashMap<>();
converter.write(entity, toInsert, persistentEntity);
Insert insert = QueryBuilder.insertInto(persistentEntity.getTableName().toCql());
for (Entry<String, Object> entry : toInsert.entrySet()) {
insert.value(entry.getKey(), entry.getValue());
}
return insert;
}
} | [
"527474541@qq.com"
] | 527474541@qq.com |
699ec5e471827ab5f8c572ee80bb77e3b44572f1 | 32d5a2cde755d4d99ff48f2b32367a8c7727753a | /src/main/java/com/lrw/algorithm/array/middle/FourSum.java | f4d916c371af5875ef397bf244c8b683b95e4a28 | [] | no_license | lrwlovegirl/leecodetest | d49ca296efde83a235f30cafc72591ef12f9ac45 | 847170ff2b38e476550f498bc524cded565b97da | refs/heads/master | 2022-07-04T01:36:07.549301 | 2021-11-29T15:35:05 | 2021-11-29T15:35:05 | 251,477,284 | 2 | 1 | null | 2022-06-17T03:26:27 | 2020-03-31T02:11:23 | Java | UTF-8 | Java | false | false | 1,104 | java | package com.lrw.algorithm.array.middle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 target 相等?找出所有满足条件且不重复的四元组。
* 链接:https://leetcode-cn.com/problems/4sum
*/
public class FourSum {
public List<List<Integer>> fourSum(int[] nums, int target) {
//先给数组排序
Arrays.sort(nums);
//数组为null 或者第一个元素都比目标值大
if (nums==null||nums[0]>target){
return null;
}
//结果集
List<List<Integer>> result = new ArrayList<>();
for (int x = 0;x<nums.length;x++){
//定住第一个,让后三个动
int first = nums[x];
//防止重复
if (x>0&&nums[x]==nums[x-1]){
continue;
}
int last = nums[nums.length-1];
}
return result;
}
}
| [
"lrwemail@163.com"
] | lrwemail@163.com |
ea87bb583ef1db1198a58b0d027e8e995e78a1a3 | ef12aca160a00b10c44cf28d814cb15ad65566dd | /hotel-channel-api/src/main/java/com/happyeasygo/channel/aspect/LogRecordAspect.java | 6d21828323c2aa64d5dd08048b281ecfe7bf42ce | [] | no_license | 837414750/springcloud-dubbo-nacos-zipkin- | 962da00f76435916a0fe80b5a734fad709e2348b | 37f0524f5a1d8a454f3f54b2a2ffe09ba0617872 | refs/heads/master | 2023-03-28T08:58:04.116558 | 2021-03-29T03:24:04 | 2021-03-29T03:24:04 | 352,494,529 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,740 | java | package com.happyeasygo.channel.aspect;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* 定义一个全局切面
*/
@Aspect
@Configuration
@Slf4j
public class LogRecordAspect {
//定义切点Pointcut(使用类路径)
@Pointcut("execution(* com.happyeasygo.*.controller.*.*Controller.*(..))")
public void excudeService(){}
@Around("excudeService()")
public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
String url = request.getRequestURL().toString();
String method = request.getMethod();
String uri = request.getRequestURI();
String queryString = request.getQueryString();
// log.info("Start of request, various parameters, url: {}, method: {}, uri: {}, params: {}", url, method, uri, queryString);
// result的值就是被拦截方法的返回值
Object result = pjp.proceed();
// Gson gson = new Gson();
// log.info("At the end of the request, the return value of the controller is: {}" , gson.toJson(result));
return result;
}
}
| [
"lemon.lu@happyeasygo.com"
] | lemon.lu@happyeasygo.com |
d1249a02b6ed36e65958068c198e021b49041006 | 239176d2a78015ce766ff9a298a3c6b465877305 | /src/Orders/RomashkaFlower.java | 22ef999f7ff972c488566d2306d9537d5177d95c | [] | no_license | programmingGirl/Flowers | 763b724f45839ce23ef99deafc984b31741efdda | f4ef2a521250506c02dda6d9a2791c048997d448 | refs/heads/master | 2020-07-24T15:44:00.440455 | 2016-11-15T20:04:00 | 2016-11-15T20:04:00 | 73,787,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package Orders;
import flowers.Flower;
import flowers.FlowerSpec;
/**
* Created by Mariya on 15.11.2016.
*/
public class RomashkaFlower extends Flower {
public RomashkaFlower(FlowerSpec specs, int fresh){
//super(specs, fresh);
}
public FlowerSpec getSpecs() {
//return (FlowerSpec) specs;
return null;
}
}
| [
"dobko_m@ucu.edu.ua"
] | dobko_m@ucu.edu.ua |
b9211e50a0371e4ced1ca1af4d06aebcb9f5b074 | 0e6b9f9403cae53bb8e2f13d17868dd881be0816 | /eil-project-dev/src/main/java/com/shencai/eil/grading/mapper/CategoryEnterpriseDefaultMapper.java | d80fe77f6c0e4c8aed89af6d0ef848eba06af6eb | [] | no_license | fujialong/eil-project | 2f68c33e832a4ee9a3f367aaa6e9ed58ee77e042 | 01f7def3ef0c85f5c3187ad03a9b2da82c9aff09 | refs/heads/master | 2020-03-29T21:06:13.421701 | 2018-10-30T08:48:28 | 2018-10-30T08:48:28 | 148,478,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package com.shencai.eil.grading.mapper;
import com.shencai.eil.grading.entity.CategoryEnterpriseDefault;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author fujl
* @since 2018-09-20
*/
public interface CategoryEnterpriseDefaultMapper extends BaseMapper<CategoryEnterpriseDefault> {
}
| [
"fujl1991@sina.com"
] | fujl1991@sina.com |
2acd7c1090d71ac95f35ff351927e45def0a5902 | ae85f583051a0220fc1231965834636302c5f860 | /eventos/src/test/java/com/patriciadelgado/eventos/EventosApplicationTests.java | ed352b76dd6e6a48f8b066b012a75e077636e19e | [] | no_license | pattsunade/belt- | 97e6dd59be50c65e173da7e62e09eec3821dd4cd | 43ee1bf6e95bb06fae6e9fdb27591d6773bdeea0 | refs/heads/master | 2023-06-28T10:04:35.457495 | 2021-07-21T22:55:26 | 2021-07-21T22:55:26 | 388,265,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.patriciadelgado.eventos;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class EventosApplicationTests {
@Test
void contextLoads() {
}
}
| [
"patricia.stylesh@gmail.com"
] | patricia.stylesh@gmail.com |
ca0090abd03267f0f33f80bce077332002b7b28a | 97e3b3bdbd73abe9ba01b5abe211d8b694301f34 | /源码分析/spring/spring-framework-5.1.5.RELEASE/spring-core/src/main/java/org/springframework/core/env/Environment.java | 167fc76c65a9f7239aaef36021dda5cd72449bda | [
"Apache-2.0",
"MIT"
] | permissive | yuaotian/java-technology-stack | dfbbef72aeeca0aeab91bc309fcce1fb93fdabf0 | f060fea0f2968c2a527e8dd12b1ccf1d684c5d83 | refs/heads/master | 2020-08-26T12:37:30.573398 | 2019-05-27T14:10:07 | 2019-05-27T14:10:07 | 217,011,246 | 1 | 0 | MIT | 2019-10-23T08:49:43 | 2019-10-23T08:49:42 | null | UTF-8 | Java | false | false | 5,913 | java | /*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env;
/**
* Interface representing the environment in which the current application is running.
* Models two key aspects of the application environment: <em>profiles</em> and
* <em>properties</em>. Methods related to property access are exposed via the
* {@link PropertyResolver} superinterface.
*
* <p>A <em>profile</em> is a named, logical group of bean definitions to be registered
* with the container only if the given profile is <em>active</em>. Beans may be assigned
* to a profile whether defined in XML or via annotations; see the spring-beans 3.1 schema
* or the {@link org.springframework.context.annotation.Profile @Profile} annotation for
* syntax details. The role of the {@code Environment} object with relation to profiles is
* in determining which profiles (if any) are currently {@linkplain #getActiveProfiles
* active}, and which profiles (if any) should be {@linkplain #getDefaultProfiles active
* by default}.
*
* <p><em>Properties</em> play an important role in almost all applications, and may
* originate from a variety of sources: properties files, JVM system properties, system
* environment variables, JNDI, servlet context parameters, ad-hoc Properties objects,
* Maps, and so on. The role of the environment object with relation to properties is to
* provide the user with a convenient service interface for configuring property sources
* and resolving properties from them.
*
* <p>Beans managed within an {@code ApplicationContext} may register to be {@link
* org.springframework.context.EnvironmentAware EnvironmentAware} or {@code @Inject} the
* {@code Environment} in order to query profile state or resolve properties directly.
*
* <p>In most cases, however, application-level beans should not need to interact with the
* {@code Environment} directly but instead may have to have {@code ${...}} property
* values replaced by a property placeholder configurer such as
* {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
* PropertySourcesPlaceholderConfigurer}, which itself is {@code EnvironmentAware} and
* as of Spring 3.1 is registered by default when using
* {@code <context:property-placeholder/>}.
*
* <p>Configuration of the environment object must be done through the
* {@code ConfigurableEnvironment} interface, returned from all
* {@code AbstractApplicationContext} subclass {@code getEnvironment()} methods. See
* {@link ConfigurableEnvironment} Javadoc for usage examples demonstrating manipulation
* of property sources prior to application context {@code refresh()}.
*
* @author Chris Beams
* @since 3.1
* @see PropertyResolver
* @see EnvironmentCapable
* @see ConfigurableEnvironment
* @see AbstractEnvironment
* @see StandardEnvironment
* @see org.springframework.context.EnvironmentAware
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment
* @see org.springframework.context.ConfigurableApplicationContext#setEnvironment
* @see org.springframework.context.support.AbstractApplicationContext#createEnvironment
*/
public interface Environment extends PropertyResolver {
/**
* Return the set of profiles explicitly made active for this environment. Profiles
* are used for creating logical groupings of bean definitions to be registered
* conditionally, for example based on deployment environment. Profiles can be
* activated by setting {@linkplain AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME
* "spring.profiles.active"} as a system property or by calling
* {@link ConfigurableEnvironment#setActiveProfiles(String...)}.
* <p>If no profiles have explicitly been specified as active, then any
* {@linkplain #getDefaultProfiles() default profiles} will automatically be activated.
* @see #getDefaultProfiles
* @see ConfigurableEnvironment#setActiveProfiles
* @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME
*/
String[] getActiveProfiles();
/**
* Return the set of profiles to be active by default when no active profiles have
* been set explicitly.
* @see #getActiveProfiles
* @see ConfigurableEnvironment#setDefaultProfiles
* @see AbstractEnvironment#DEFAULT_PROFILES_PROPERTY_NAME
*/
String[] getDefaultProfiles();
/**
* Return whether one or more of the given profiles is active or, in the case of no
* explicit active profiles, whether one or more of the given profiles is included in
* the set of default profiles. If a profile begins with '!' the logic is inverted,
* i.e. the method will return {@code true} if the given profile is <em>not</em> active.
* For example, {@code env.acceptsProfiles("p1", "!p2")} will return {@code true} if
* profile 'p1' is active or 'p2' is not active.
* @throws IllegalArgumentException if called with zero arguments
* or if any profile is {@code null}, empty, or whitespace only
* @see #getActiveProfiles
* @see #getDefaultProfiles
* @see #acceptsProfiles(Profiles)
* @deprecated as of 5.1 in favor of {@link #acceptsProfiles(Profiles)}
*/
@Deprecated
boolean acceptsProfiles(String... profiles);
/**
* Return whether the {@linkplain #getActiveProfiles() active profiles}
* match the given {@link Profiles} predicate.
*/
boolean acceptsProfiles(Profiles profiles);
}
| [
"626984947@qq.com"
] | 626984947@qq.com |
e31808d2cef6944b2b59a4bc368db592f0c9e83b | 76943449993b9a7aef4a1773f866b35c3a9dffe2 | /projects/Java/src/proto/proto/fbe/OrderTypeJson.java | 1e32f95f648a32499998d8eb169f52a81b9b30de | [
"MIT"
] | permissive | ismiyati/FastBinaryEncoding | 0a17ee4bf6e44c76b05835c54d44343fc9c5add2 | e961feeb1ed897a8237f13f7fe3ef33828e5e56e | refs/heads/master | 2020-05-31T14:40:55.525775 | 2019-05-31T11:06:24 | 2019-05-31T11:06:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 929 | java | // Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: proto.fbe
// Version: 1.3.0.0
package proto.fbe;;
import java.io.*;
import java.lang.*;
import java.lang.reflect.*;
import java.math.*;
import java.nio.ByteBuffer;
import java.nio.charset.*;
import java.time.*;
import java.util.*;
import fbe.*;
import proto.*;
import com.google.gson.*;
public final class OrderTypeJson implements JsonSerializer<OrderType>, JsonDeserializer<OrderType>
{
@Override
public JsonElement serialize(OrderType src, Type typeOfSrc, JsonSerializationContext context)
{
return new JsonPrimitive(src.getRaw());
}
@Override
public OrderType deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException
{
return new OrderType(json.getAsJsonPrimitive().getAsByte());
}
}
| [
"chronoxor@gmail.com"
] | chronoxor@gmail.com |
623de11d607c9f34f4c3e89eee7628026287e5be | 150da95189e3ea2a400c3e73944fa3c01e134191 | /app/src/androidTest/java/com/infy/esurio/ExampleInstrumentedTest.java | 4d9058612a0d22b076a8ff2362bea0026181ca1f | [] | no_license | uniquetrij/esurio-vendor | 756f0c63c5483c35cf3dba02df2532b9958a31de | 9b01fc0aeeb35a8ae577db2e3d055db79f3c1e11 | refs/heads/master | 2020-06-18T20:47:07.382906 | 2019-07-18T07:14:43 | 2019-07-18T07:14:43 | 196,441,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package com.infy.esurio;
import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.infy.esurio", appContext.getPackageName());
}
}
| [
"jainhitesh9998@gmail.com"
] | jainhitesh9998@gmail.com |
50662e7b88484d66013d3f4f2758b2da3ede29e3 | 5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab | /app/src/main/wechat6.5.3/com/tencent/mm/pluginsdk/ui/d.java | e4ef770d682c5ce0956f58098a1c7c129ba16e17 | [] | no_license | newtonker/wechat6.5.3 | 8af53a870a752bb9e3c92ec92a63c1252cb81c10 | 637a69732afa3a936afc9f4679994b79a9222680 | refs/heads/master | 2020-04-16T03:32:32.230996 | 2017-06-15T09:54:10 | 2017-06-15T09:54:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,634 | java | package com.tencent.mm.pluginsdk.ui;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
public final class d implements OnScrollListener {
private OnScrollListener lGc;
private ArrayList<WeakReference<a>> lGd;
public interface a {
void onScrollStateChanged(boolean z);
}
public d() {
this(null);
}
public d(OnScrollListener onScrollListener) {
this.lGd = new ArrayList();
this.lGc = onScrollListener;
}
public final void onScroll(AbsListView absListView, int i, int i2, int i3) {
if (this.lGc != null) {
this.lGc.onScroll(absListView, i, i2, i3);
}
}
public final void onScrollStateChanged(AbsListView absListView, int i) {
if (i == 2) {
hR(true);
} else {
hR(false);
}
if (this.lGc != null) {
this.lGc.onScrollStateChanged(absListView, i);
}
}
public final void a(a aVar) {
this.lGd.add(new WeakReference(aVar));
}
private void hR(boolean z) {
for (int i = 0; i < this.lGd.size(); i++) {
WeakReference weakReference = (WeakReference) this.lGd.get(i);
if (weakReference != null) {
a aVar = (a) weakReference.get();
if (aVar != null) {
aVar.onScrollStateChanged(z);
} else {
this.lGd.remove(i);
}
} else {
this.lGd.remove(i);
}
}
}
}
| [
"zhangxhbeta@gmail.com"
] | zhangxhbeta@gmail.com |
72c990342660c5633d27a7972416fd644eb542b1 | 7f6a566fd90860b5fa9574b88beb6c482e69763f | /SPUKMK2meAnimation/src/com/spukmk2me/animation/ICommandProcessor.java | b582e65d21352910ed0f240ef2aec7acaa044d7b | [] | no_license | cmuths/spukmk2me | 8fbc799cb13e015bb6ce72baa6b7210a8dc7f199 | 9352027804a151f6e405820f5916c3c8c8d21e1e | refs/heads/master | 2021-01-01T19:24:47.553339 | 2012-07-30T11:44:35 | 2012-07-30T11:44:35 | 35,462,536 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | package com.spukmk2me.animation;
public interface ICommandProcessor
{
public boolean IsSupported( int commandCode );
public int Process( Command command );
public void Execute( int deltaTime );
}
| [
"nguyen.tuan021290@684c3dc2-dbb5-df26-59c1-143693d0bbd9"
] | nguyen.tuan021290@684c3dc2-dbb5-df26-59c1-143693d0bbd9 |
dedc6ee990936f0e70f6229f01d3b31360ff2a00 | 254292bbb95222cd6a97eae493e28b5a63c14a9d | /spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java | 13e23ae1f0c8727056d6d9c5cff0e9ffc1a139e6 | [
"Apache-2.0"
] | permissive | pikefeier/springboot | 0e881a59ceefd3ae1991e83a0ad4a4d787831097 | 2fb23ab250f095dec39bf5e4d114c26d51467142 | refs/heads/master | 2023-01-09T02:51:23.939848 | 2019-12-30T12:19:14 | 2019-12-30T12:19:14 | 230,909,567 | 0 | 0 | Apache-2.0 | 2022-12-27T14:51:00 | 2019-12-30T12:10:46 | Java | UTF-8 | Java | false | false | 5,204 | java | /*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.ansi.AnsiPropertySource;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertyResolver;
import org.springframework.core.env.PropertySourcesPropertyResolver;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.StreamUtils;
/**
* Banner implementation that prints from a source text {@link Resource}.
*
* @author Phillip Webb
* @author Vedran Pavic
* @since 1.2.0
*/
public class ResourceBanner implements Banner {
private static final Log logger = LogFactory.getLog(ResourceBanner.class);
private Resource resource;
public ResourceBanner(Resource resource) {
Assert.notNull(resource, "Resource must not be null");
Assert.isTrue(resource.exists(), "Resource must exist");
this.resource = resource;
}
@Override
public void printBanner(Environment environment, Class<?> sourceClass,
PrintStream out) {
try {
String banner = StreamUtils.copyToString(this.resource.getInputStream(),
environment.getProperty("banner.charset", Charset.class,
Charset.forName("UTF-8")));
for (PropertyResolver resolver : getPropertyResolvers(environment,
sourceClass)) {
banner = resolver.resolvePlaceholders(banner);
}
out.println(banner);
} catch (Exception ex) {
logger.warn("Banner not printable: " + this.resource + " (" + ex.getClass()
+ ": '" + ex.getMessage() + "')", ex);
}
}
protected List<PropertyResolver> getPropertyResolvers(Environment environment,
Class<?> sourceClass) {
List<PropertyResolver> resolvers = new ArrayList<PropertyResolver>();
resolvers.add(environment);
resolvers.add(getVersionResolver(sourceClass));
resolvers.add(getAnsiResolver());
resolvers.add(getTitleResolver(sourceClass));
return resolvers;
}
private PropertyResolver getVersionResolver(Class<?> sourceClass) {
MutablePropertySources propertySources = new MutablePropertySources();
propertySources
.addLast(new MapPropertySource("version", getVersionsMap(sourceClass)));
return new PropertySourcesPropertyResolver(propertySources);
}
private Map<String, Object> getVersionsMap(Class<?> sourceClass) {
String appVersion = getApplicationVersion(sourceClass);
String bootVersion = getBootVersion();
Map<String, Object> versions = new HashMap<String, Object>();
versions.put("application.version", getVersionString(appVersion, false));
versions.put("spring-boot.version", getVersionString(bootVersion, false));
versions.put("application.formatted-version", getVersionString(appVersion, true));
versions.put("spring-boot.formatted-version",
getVersionString(bootVersion, true));
return versions;
}
protected String getApplicationVersion(Class<?> sourceClass) {
Package sourcePackage = (sourceClass == null ? null : sourceClass.getPackage());
return (sourcePackage == null ? null : sourcePackage.getImplementationVersion());
}
protected String getBootVersion() {
return SpringBootVersion.getVersion();
}
private String getVersionString(String version, boolean format) {
if (version == null) {
return "";
}
return (format ? " (v" + version + ")" : version);
}
private PropertyResolver getAnsiResolver() {
MutablePropertySources sources = new MutablePropertySources();
sources.addFirst(new AnsiPropertySource("ansi", true));
return new PropertySourcesPropertyResolver(sources);
}
private PropertyResolver getTitleResolver(Class<?> sourceClass) {
MutablePropertySources sources = new MutablePropertySources();
String applicationTitle = getApplicationTitle(sourceClass);
Map<String, Object> titleMap = Collections.<String, Object>singletonMap(
"application.title", (applicationTitle == null ? "" : applicationTitle));
sources.addFirst(new MapPropertySource("title", titleMap));
return new PropertySourcesPropertyResolver(sources);
}
protected String getApplicationTitle(Class<?> sourceClass) {
Package sourcePackage = (sourceClass == null ? null : sourceClass.getPackage());
return (sourcePackage == null ? null : sourcePackage.getImplementationTitle());
}
}
| [
"945302777@qq.com"
] | 945302777@qq.com |
f0b37f0aa212994b1111b9c92ae49f016fb0fb77 | e4ebd063857a10bd0b5529b59662e13069652c90 | /src/main/java/com/aorun/epoint/service/WorkerServiceSiteService.java | b53ef5582973141d8d4278ae9b4647e5173e3913 | [] | no_license | duxihu2014/aorun-epoint | 15135b735aae438314cd236a1fcaf7511ae27823 | 00f110212425c9c09ae195ad2f0d9d17843225a5 | refs/heads/master | 2022-06-26T01:28:24.390039 | 2019-11-02T05:02:28 | 2019-11-02T05:02:28 | 189,548,167 | 0 | 0 | null | 2022-06-21T01:12:12 | 2019-05-31T07:25:07 | Java | UTF-8 | Java | false | false | 798 | java | package com.aorun.epoint.service;
import com.aorun.epoint.model.WorkerServiceSite;
import java.util.List;
/**
* 服务站点
*/
public interface WorkerServiceSiteService {
/**
* 新增信息
*
* @param workerServiceSite
* @return
*/
int saveWorkerServiceSite(WorkerServiceSite workerServiceSite);
/**
* 更新信息
*
* @param workerServiceSite
* @return
*/
int updateWorkerServiceSite(WorkerServiceSite workerServiceSite);
/**
* 根据 ID,删除信息
*
* @param id
* @return
*/
int deleteWorkerServiceSite(Long id);
List<WorkerServiceSite> getParentSiteList();
List<WorkerServiceSite> getWorkerServiceSiteListByParentId(Long parentId);
int totalWorkerServiceSite();
}
| [
"duxihu520@163.com"
] | duxihu520@163.com |
9a02d14812ed79717a697aa1e301daa6e3e48866 | 052aac62464da8d459fc1bc382441bffcc210893 | /SocketService/app/src/main/java/scionoftech/socketservice/Message/CallNotificationBroad.java | 85f4093f6220345e6c6b2ae010165e1e2a4df392 | [
"Apache-2.0"
] | permissive | scionoftech/PushNotification-using-Socket.io | 64cc98ab7cc01d18fccbb78494e5f909f500bc3f | f897d94cfffbadf92e280de3809e0ba4e138ad29 | refs/heads/master | 2021-01-10T04:08:20.352953 | 2016-02-23T18:27:04 | 2016-02-23T18:27:04 | 52,381,651 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package scionoftech.socketservice.Message;
import android.content.Context;
import android.content.Intent;
/**
* Created by sky on 9/2/16.
*/
public class CallNotificationBroad {
public CallNotificationBroad(Context context, String data) {
Intent intent = new Intent();
intent.putExtra("message", data);
intent.setAction("com.kshediv.playforever.NOTIFICATION");
context.sendBroadcast(intent);
}
}
| [
"saikumar.geek@gmail.com"
] | saikumar.geek@gmail.com |
05e07e1a79986b1446d2ad4fc8a07ebe7f495882 | bae5ccedc208ae9ffe0aee652cef5bd699cc42ae | /src/com/epic/score_app/serviceslayer/GlobalService.java | 2409e1a8ef0aa6a5530df748593572b9911a3bc8 | [] | no_license | reuben313/Score_app | 0844699e7e434d47a89ad47c98bf0901993dc7d3 | 5916a3a5bdf226926979e6693ddd72d6830a81ea | refs/heads/master | 2021-01-19T00:11:38.821110 | 2014-06-24T09:04:36 | 2014-06-24T09:04:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,976 | java | package com.epic.score_app.serviceslayer;
import java.util.ArrayList;
import android.os.Bundle;
import android.os.Message;
import com.epic.score_app.datalayer.GlobalGateway;
import domainmodel.News;
import domainmodel.Wallof;
public class GlobalService extends RequestService{
@Override
protected void executeRequest(Bundle receivedBundle) {
GlobalGateway gateway = new GlobalGateway(handler);
int requestCode= receivedBundle.getInt("requestcode");
switch (requestCode) {
case ServiceProvider.getNews:
ArrayList<News> news = new ArrayList<News>();
news=gateway.getNews();
Message msg = new Message();
msg.what= ServiceProvider.getNews_response;
msg.obj=news;
handler.sendMessage(msg);
break;
case ServiceProvider.getNewsDescription:
News news_desc =new News();
long nid= receivedBundle.getLong("news_id");
news_desc=gateway.getNewsDescription(nid);
Message msgNewsDescription = new Message();
msgNewsDescription.what= ServiceProvider.getNewsDescription_response;
msgNewsDescription.obj=news_desc;
handler.sendMessage(msgNewsDescription);
break;
case ServiceProvider.getWallOf:
ArrayList<Wallof> wallofs= gateway.getWallofs(receivedBundle);
Message msgwallof = new Message();
msgwallof.what= ServiceProvider.getWallOf_response;
msgwallof.obj=wallofs;
handler.sendMessage(msgwallof);
break;
case ServiceProvider.getWallof_action:
Wallof wallof;
long wallid = receivedBundle.getLong("wall_id");
boolean hit = receivedBundle.getBoolean("hit");
wallof= gateway.update_Wallof(wallid, hit);
Message msg_wallof = new Message();
msg_wallof.what= ServiceProvider.getWallof_action_response;
msg_wallof.obj=wallof;
handler.sendMessage(msg_wallof);
break;
default:
break;
}
}
}
| [
"rebs313@gmail.com"
] | rebs313@gmail.com |
2bcc289ce23732e00b83487a842c0ad704d79364 | f13a0d9e11c5fd37dd37be15e8919b8b24540211 | /src/test/java/com/deepak/dp/inter/geeks/VerticalOrderTraversalTest.java | a1596186e1fa8f638a271d83a04ed6a9135278bb | [] | no_license | 233deepak/AmazonSpecificProblems | 369cce17eb3ceca66e0765eaf0bb0a81fa39bc4f | 81fa0c1d4b3fc1bcb663d2b3e0cd498dd0de356b | refs/heads/master | 2021-05-07T01:44:19.379075 | 2017-11-11T07:41:10 | 2017-11-11T07:41:10 | 110,327,518 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | package com.deepak.dp.inter.geeks;
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
import com.deepak.dp.inter.TreeNode;
import com.deepak.dp.inter.geeks.tree.VerticalTraversal;
public class VerticalOrderTraversalTest {
@Test
public void _7_node_tree() throws Exception {
TreeNode node1 = new TreeNode(1);
TreeNode node2 = new TreeNode(2);
TreeNode node3 = new TreeNode(3);
node1.right = node3;
node1.left = node2;
TreeNode node4 = new TreeNode(4);
TreeNode node5 = new TreeNode(5);
node2.left = node4;
node2.right = node5;
TreeNode node6 = new TreeNode(6);
TreeNode node7 = new TreeNode(7);
node3.left = node6;
node3.right = node7;
TreeNode node8 = new TreeNode(8);
TreeNode node9 = new TreeNode(9);
node6.right = node8;
node7.right = node9;
VerticalTraversal traversal =new VerticalTraversal();
List<List<TreeNode>> nodes = traversal.traverse(node1);
assertEquals(4, nodes.get(0).get(0).val);
assertEquals( 2,nodes.get(1).get(0).val);
/*assertEquals(nodes.get(2).get(0), 1);
assertEquals(nodes.get(2).get(1), 5);
assertEquals(nodes.get(2).get(2), 6);*/
}
}
| [
"233deepak@gmail.com"
] | 233deepak@gmail.com |
c43910e42d487af9f7747a86ff83bcf5e44ce62e | 2c319d505e8f6a21708be831e9b5426aaa86d61e | /web/core/src/main/java/leap/web/action/RunnableAction.java | 400398750ada1e428919f69dd76cc11d73e7fa03 | [
"Apache-2.0"
] | permissive | leapframework/framework | ed0584a1468288b3a6af83c1923fad2fd228a952 | 0703acbc0e246519ee50aa9957f68d931fab10c5 | refs/heads/dev | 2023-08-17T02:14:02.236354 | 2023-08-01T09:39:07 | 2023-08-01T09:39:07 | 48,562,236 | 47 | 23 | Apache-2.0 | 2022-12-14T20:36:57 | 2015-12-25T01:54:52 | Java | UTF-8 | Java | false | false | 1,124 | java | /*
* Copyright 2015 the original author or authors.
*
* 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 leap.web.action;
import leap.web.Request;
import leap.web.Response;
public class RunnableAction extends AbstractAction {
protected final Runnable runnable;
public RunnableAction(Runnable runnable) {
this.runnable = runnable;
}
@Override
protected Object doExecute(ActionContext context, Object[] args, Request req, Response resp) throws Throwable {
runnable.run();
return null;
}
@Override
public String toString() {
return runnable.getClass().getSimpleName();
}
} | [
"live.evan@gmail.com"
] | live.evan@gmail.com |
95560863fe01c4dcb973082a7c1b836f016386cf | af55f2e3126d3a95a124315aea6417607b44b396 | /I_D.java | ecc8f3083cff6437e107abdbfea6e18a59d8665f | [] | no_license | ruicarvoeiro/Initial-Java | c7aa2255ab6b0249e611028a1eb4946b81042aa1 | 93816ab13506d35663d846babf5486ef24642be2 | refs/heads/master | 2020-03-18T14:16:22.561089 | 2018-05-25T08:48:36 | 2018-05-25T08:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 276 | java |
public class I_D {
public static void main(String[] args) {
int number = 1;
//number++;
//number--
System.out.println(number);
//System.out.println(number++);
//System.out.println(number--);
//System.out.println(++number);
System.out.println(--number);
}
}
| [
"rui_carvoeiro@hotmail.com"
] | rui_carvoeiro@hotmail.com |
f514d392a3b2f1c34c42ce819e652704eb3e4237 | 52349a56924e127c783d70cceaefe6cf9e46f46b | /ews-api/src/main/java/com/microsoft/schemas/exchange/services/_2006/types/RecurrenceType.java | acf437e8421daf19bf608bf5db0d0699caefcea0 | [] | no_license | floriankammermann/java-microsoft-exchange-webservice-access | 0f6eee1214689be4e1f421414d5592c5ea017080 | f4f0c94caf29e8bd38e068282414ac20af70cdcd | refs/heads/master | 2016-09-05T23:48:28.635612 | 2011-10-04T07:12:54 | 2011-10-04T07:12:54 | 2,326,818 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,286 | java |
package com.microsoft.schemas.exchange.services._2006.types;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for RecurrenceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="RecurrenceType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <group ref="{http://schemas.microsoft.com/exchange/services/2006/types}RecurrencePatternTypes"/>
* <group ref="{http://schemas.microsoft.com/exchange/services/2006/types}RecurrenceRangeTypes"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RecurrenceType", propOrder = {
"relativeYearlyRecurrence",
"absoluteYearlyRecurrence",
"relativeMonthlyRecurrence",
"absoluteMonthlyRecurrence",
"weeklyRecurrence",
"dailyRecurrence",
"noEndRecurrence",
"endDateRecurrence",
"numberedRecurrence"
})
public class RecurrenceType {
@XmlElement(name = "RelativeYearlyRecurrence")
protected RelativeYearlyRecurrencePatternType relativeYearlyRecurrence;
@XmlElement(name = "AbsoluteYearlyRecurrence")
protected AbsoluteYearlyRecurrencePatternType absoluteYearlyRecurrence;
@XmlElement(name = "RelativeMonthlyRecurrence")
protected RelativeMonthlyRecurrencePatternType relativeMonthlyRecurrence;
@XmlElement(name = "AbsoluteMonthlyRecurrence")
protected AbsoluteMonthlyRecurrencePatternType absoluteMonthlyRecurrence;
@XmlElement(name = "WeeklyRecurrence")
protected WeeklyRecurrencePatternType weeklyRecurrence;
@XmlElement(name = "DailyRecurrence")
protected DailyRecurrencePatternType dailyRecurrence;
@XmlElement(name = "NoEndRecurrence")
protected NoEndRecurrenceRangeType noEndRecurrence;
@XmlElement(name = "EndDateRecurrence")
protected EndDateRecurrenceRangeType endDateRecurrence;
@XmlElement(name = "NumberedRecurrence")
protected NumberedRecurrenceRangeType numberedRecurrence;
/**
* Gets the value of the relativeYearlyRecurrence property.
*
* @return
* possible object is
* {@link RelativeYearlyRecurrencePatternType }
*
*/
public RelativeYearlyRecurrencePatternType getRelativeYearlyRecurrence() {
return relativeYearlyRecurrence;
}
/**
* Sets the value of the relativeYearlyRecurrence property.
*
* @param value
* allowed object is
* {@link RelativeYearlyRecurrencePatternType }
*
*/
public void setRelativeYearlyRecurrence(RelativeYearlyRecurrencePatternType value) {
this.relativeYearlyRecurrence = value;
}
/**
* Gets the value of the absoluteYearlyRecurrence property.
*
* @return
* possible object is
* {@link AbsoluteYearlyRecurrencePatternType }
*
*/
public AbsoluteYearlyRecurrencePatternType getAbsoluteYearlyRecurrence() {
return absoluteYearlyRecurrence;
}
/**
* Sets the value of the absoluteYearlyRecurrence property.
*
* @param value
* allowed object is
* {@link AbsoluteYearlyRecurrencePatternType }
*
*/
public void setAbsoluteYearlyRecurrence(AbsoluteYearlyRecurrencePatternType value) {
this.absoluteYearlyRecurrence = value;
}
/**
* Gets the value of the relativeMonthlyRecurrence property.
*
* @return
* possible object is
* {@link RelativeMonthlyRecurrencePatternType }
*
*/
public RelativeMonthlyRecurrencePatternType getRelativeMonthlyRecurrence() {
return relativeMonthlyRecurrence;
}
/**
* Sets the value of the relativeMonthlyRecurrence property.
*
* @param value
* allowed object is
* {@link RelativeMonthlyRecurrencePatternType }
*
*/
public void setRelativeMonthlyRecurrence(RelativeMonthlyRecurrencePatternType value) {
this.relativeMonthlyRecurrence = value;
}
/**
* Gets the value of the absoluteMonthlyRecurrence property.
*
* @return
* possible object is
* {@link AbsoluteMonthlyRecurrencePatternType }
*
*/
public AbsoluteMonthlyRecurrencePatternType getAbsoluteMonthlyRecurrence() {
return absoluteMonthlyRecurrence;
}
/**
* Sets the value of the absoluteMonthlyRecurrence property.
*
* @param value
* allowed object is
* {@link AbsoluteMonthlyRecurrencePatternType }
*
*/
public void setAbsoluteMonthlyRecurrence(AbsoluteMonthlyRecurrencePatternType value) {
this.absoluteMonthlyRecurrence = value;
}
/**
* Gets the value of the weeklyRecurrence property.
*
* @return
* possible object is
* {@link WeeklyRecurrencePatternType }
*
*/
public WeeklyRecurrencePatternType getWeeklyRecurrence() {
return weeklyRecurrence;
}
/**
* Sets the value of the weeklyRecurrence property.
*
* @param value
* allowed object is
* {@link WeeklyRecurrencePatternType }
*
*/
public void setWeeklyRecurrence(WeeklyRecurrencePatternType value) {
this.weeklyRecurrence = value;
}
/**
* Gets the value of the dailyRecurrence property.
*
* @return
* possible object is
* {@link DailyRecurrencePatternType }
*
*/
public DailyRecurrencePatternType getDailyRecurrence() {
return dailyRecurrence;
}
/**
* Sets the value of the dailyRecurrence property.
*
* @param value
* allowed object is
* {@link DailyRecurrencePatternType }
*
*/
public void setDailyRecurrence(DailyRecurrencePatternType value) {
this.dailyRecurrence = value;
}
/**
* Gets the value of the noEndRecurrence property.
*
* @return
* possible object is
* {@link NoEndRecurrenceRangeType }
*
*/
public NoEndRecurrenceRangeType getNoEndRecurrence() {
return noEndRecurrence;
}
/**
* Sets the value of the noEndRecurrence property.
*
* @param value
* allowed object is
* {@link NoEndRecurrenceRangeType }
*
*/
public void setNoEndRecurrence(NoEndRecurrenceRangeType value) {
this.noEndRecurrence = value;
}
/**
* Gets the value of the endDateRecurrence property.
*
* @return
* possible object is
* {@link EndDateRecurrenceRangeType }
*
*/
public EndDateRecurrenceRangeType getEndDateRecurrence() {
return endDateRecurrence;
}
/**
* Sets the value of the endDateRecurrence property.
*
* @param value
* allowed object is
* {@link EndDateRecurrenceRangeType }
*
*/
public void setEndDateRecurrence(EndDateRecurrenceRangeType value) {
this.endDateRecurrence = value;
}
/**
* Gets the value of the numberedRecurrence property.
*
* @return
* possible object is
* {@link NumberedRecurrenceRangeType }
*
*/
public NumberedRecurrenceRangeType getNumberedRecurrence() {
return numberedRecurrence;
}
/**
* Sets the value of the numberedRecurrence property.
*
* @param value
* allowed object is
* {@link NumberedRecurrenceRangeType }
*
*/
public void setNumberedRecurrence(NumberedRecurrenceRangeType value) {
this.numberedRecurrence = value;
}
}
| [
"florian.kammermann@gmail.com"
] | florian.kammermann@gmail.com |
139a664761ac191ee37b36ead7ac81f094c340d4 | 1feb96fa49214153e9c844a07ebd9fe88d712861 | /l567.java | 78bb90428b77602ef200402a6dd71c8a34a59c42 | [] | no_license | minging234/LeetCode_ming | f9eae748ea8e3eb01916f8aa61f76f62ef25d36f | 8790abadd5289024794cd95529187c96111c2bd6 | refs/heads/master | 2021-09-19T05:21:04.778665 | 2018-07-23T20:48:32 | 2018-07-23T20:48:32 | 108,206,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 95 | java | class Solution {
public boolean checkInclusion(String s1, String s2) {
}
} | [
"825876887@qq.com"
] | 825876887@qq.com |
445bd93236ec2edf26cde11e19e7ecc9169cbd4a | 5afc16e6e468295017840b4c86f4e14f69018e6a | /app/src/main/java/com/cnergee/mypage/SOAP/GetUsernamePwdSOAP.java | d02c4591c78fb7c2ab95503f11adf026f3a1f4c2 | [] | no_license | ashwini-cnergee/Sikka | f15d48770169e5501ea77d094b541e495bd7ccc8 | 8a1128243d1b2a9af5e560207718e96649e2e84d | refs/heads/master | 2021-07-24T10:13:47.248154 | 2021-05-10T12:01:34 | 2021-05-10T12:01:34 | 249,628,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,420 | java | package com.cnergee.mypage.SOAP;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.SoapFault;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import com.cnergee.mypage.obj.AuthenticationMobile;
public class GetUsernamePwdSOAP {
private String WSDL_TARGET_NAMESPACE;
private String SOAP_URL;
private String METHOD_NAME;
private static final String TAG = "GetUsernamePwdSOAP";
private String Username;
private String Password;
public GetUsernamePwdSOAP(String WSDL_TARGET_NAMESPACE, String SOAP_URL,
String METHOD_NAME) {
this.WSDL_TARGET_NAMESPACE = WSDL_TARGET_NAMESPACE;
this.SOAP_URL = SOAP_URL;
this.METHOD_NAME = METHOD_NAME;
}
public String getUsernamePwd(String MemberId)throws SocketException,SocketTimeoutException,Exception,SoapFault{
String str_msg = "ok";
try{
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, METHOD_NAME);
PropertyInfo pi = new PropertyInfo();
pi.setName("MemberId");
pi.setValue(MemberId);
pi.setType(Long.class);
request.addProperty(pi);
pi = new PropertyInfo();
pi.setName(AuthenticationMobile.CliectAccessName);
pi.setValue(AuthenticationMobile.CliectAccessId);
pi.setType(String.class);
request.addProperty(pi);
//Log.i(">>>>>Request<<<<<", request.toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.implicitTypes = true;
envelope.addMapping(WSDL_TARGET_NAMESPACE, "",
this.getClass());
HttpTransportSE androidHttpTransport = new HttpTransportSE(SOAP_URL);
androidHttpTransport.debug = true;
androidHttpTransport.call(WSDL_TARGET_NAMESPACE + METHOD_NAME,envelope);
/*Utils.log(TAG ,"request: "+androidHttpTransport.requestDump);
Utils.log(TAG,"response :"+androidHttpTransport.responseDump);*/
str_msg="ok";
if (envelope.bodyIn instanceof SoapObject) {
try{
// SoapObject = SUCCESS
SoapObject response = (SoapObject) envelope.getResponse();
if (response != null) {
//Log.i(" RESPONSE ", response.toString());
response = (SoapObject) response.getProperty("NewDataSet");
if (response.getPropertyCount() > 0) {
for (int i = 0; i < response.getPropertyCount(); i++)
{
SoapObject tableObj = (SoapObject) response.getProperty(i);
Username=tableObj.getPropertyAsString("MemberLoginID");
Password=tableObj.getPropertyAsString("LoginPassword");
/*Log.i(" Username ", tableObj.getPropertyAsString("MemberLoginID"));
Log.i(" Password ", tableObj.getPropertyAsString("LoginPassword"));*/
}
}
}
}catch (Exception e) {
// TODO: handle exception
return str_msg="not";
}
}
else if (envelope.bodyIn instanceof SoapFault) { // SoapFault =
// FAILURE
SoapFault soapFault = (SoapFault) envelope.bodyIn;
return str_msg="not";
}
//Log.i(" Message ", "s "+str_msg);
return str_msg;
}
catch (Exception e) {
str_msg="not";
return str_msg;
}
}
public String getUsername(){
return Username;
}
public String getPassword(){
return Password;
}
}
| [
"jyoti@cnergee.com"
] | jyoti@cnergee.com |
aca0e340f711aa02342794c0d68c3bce61c2c8de | 03cc00cb8c66ad49be678ecf58932ae828b50489 | /src/test/java/com/sqa/aa/util/helpers/math/MyMathTestSuite.java | bbb64a5177233966ff647a9d4965bfb9c04ffe1e | [] | no_license | Annasqa/properties-project | 849f13d87e16c48d9b2ab8b3971355a90c70020d | eacccd43747b67b8a5ebdfb5b07742dc1d6754e0 | refs/heads/master | 2016-09-13T01:44:14.006899 | 2016-04-30T16:44:12 | 2016-04-30T16:44:12 | 57,261,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | /**
* File Name: MyMathTestSuite.java<br>
*
* LastName, FirstName<br>
* Java Boot Camp Exercise<br>
* Instructor: Jean-francois Nepton<br>
* Created: Apr 14, 2016
*
*/
package com.sqa.aa.util.helpers.math;
import org.junit.runner.*;
import org.junit.runners.*;
import org.junit.runners.Suite.*;
/**
* MyMathTestSuite //ADDD (description of class)
* <p>
* //ADDD (description of core fields)
* <p>
* //ADDD (description of core methods)
*
* @author LastName, FirstName
* @version 1.0.0
* @since 1.0
*
*/
@RunWith(Suite.class)
@SuiteClasses({ MultiplicationTests.class, MyMathTest.class })
public class MyMathTestSuite {
}
| [
"="
] | = |
f30817027b2a001d05dc7efb54fb9f8783dc163c | fd3eb2a0e8c1ce6722b3e071dc98314fed0d4daa | /Aulas/05 - Teste de Sistema e Aceitação/ExemploSelenium/src/edu/br/ifmt/Principal.java | 7edbcc83db0f4600b1ac31c447c4bea5d530af00 | [] | no_license | rafaelalvesmartins/teste_de_software_ifmt_2021 | de2bbb7534572a1c506d63cc5e909fba2f42d10a | 12024e106a87bfb6fca943acc406101b4e7ab156 | refs/heads/master | 2023-08-17T21:35:47.143635 | 2021-10-25T12:37:02 | 2021-10-25T12:37:02 | 414,695,070 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package edu.br.ifmt;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Principal {
public static void main(String[] args) {
// TODO Auto-generated method stub
chamadaIFMTGoogle();
}
public static void chamadaIFMTGoogle() {
// abre firefox
WebDriver driver = new FirefoxDriver();
// acessa o site do google
driver.get("http://www.google.com.br/");
// digita no campo com nome "q" do google
WebElement campoDeTexto =
driver.findElement(By.name("q"));
campoDeTexto.sendKeys("IFMT");
// submete o form
campoDeTexto.submit();
}
}
| [
"rafaelmartinsalves@gmail.com"
] | rafaelmartinsalves@gmail.com |
b974de2d40be94bcdee1fbc3f28fa958bf2bcabb | 67121a3c1c0b03d3ce96808bd029a41f79dd4674 | /microservicecloud-eureka-7003/src/main/java/com/bingo/springcloud/EurekaServer7003_App.java | 0f84cf9150baa889b06e07df22ba7a7d714121df | [] | no_license | bingo906/microservicecloud | da154de4e1d51b7a64e560a69fedc1ab100adfb4 | 9885cf4bccda6deffeefe990d4aa87c441615503 | refs/heads/master | 2020-03-22T10:52:22.726137 | 2018-07-06T04:22:25 | 2018-07-06T04:22:25 | 139,932,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package com.bingo.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer // EurekaServer服务器端启动类,接受其它微服务注册进来
public class EurekaServer7003_App
{
public static void main(String[] args)
{
SpringApplication.run(EurekaServer7003_App.class, args);
}
}
| [
"eclipse906@qq.com"
] | eclipse906@qq.com |
f7cd026de8d5d43100b71de885d1dfce0b676ced | 6bb24530476224001cc6c17989bcc76749098f89 | /flyme-common/src/main/java/com/goldencis/flyme/common/exception/file/FileSizeLimitExceededException.java | 854f0e811d8d6eee69f197f6b3b3787847fbeae1 | [
"MIT"
] | permissive | UniqueSuccess/Flyme-Vue | 366218bc9981437c4272aae6a3b745aa55fba813 | 15eae94e833a77a458fa963ad7d756ee3fac3d7f | refs/heads/master | 2023-01-07T23:22:48.459319 | 2020-10-29T02:53:40 | 2020-10-29T02:55:24 | 302,863,885 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.goldencis.flyme.common.exception.file;
/**
* 文件名大小限制异常类
*
* @author flyme
*/
public class FileSizeLimitExceededException extends FileException
{
private static final long serialVersionUID = 1L;
public FileSizeLimitExceededException(long defaultMaxSize)
{
super("upload.exceed.maxSize", new Object[] { defaultMaxSize });
}
}
| [
"296894988@qq.com"
] | 296894988@qq.com |
e1c6ff8e2f13a2b065e65c49aaf2ffe7e46fcb1d | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/CHART-4b-1-7-NSGA_II-WeightedSum:TestLen:CallDiversity/org/jfree/chart/plot/XYPlot_ESTest_scaffolding.java | 37712107d7dce0a37cf5f4b21622f676ead14a67 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,903 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Apr 01 09:55:26 UTC 2020
*/
package org.jfree.chart.plot;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XYPlot_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.jfree.chart.plot.XYPlot";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(XYPlot_ESTest_scaffolding.class.getClassLoader() ,
"org.jfree.chart.entity.AxisEntity",
"org.jfree.chart.text.TextMeasurer",
"org.jfree.chart.axis.TickUnit",
"org.jfree.chart.plot.PlotState",
"org.jfree.chart.plot.CrosshairState",
"org.jfree.chart.LegendItemSource",
"org.jfree.chart.ChartColor",
"org.jfree.data.DomainOrder",
"org.jfree.chart.axis.AxisState",
"org.jfree.data.general.DatasetChangeListener",
"org.jfree.data.general.AbstractDataset",
"org.jfree.chart.plot.Zoomable",
"org.jfree.chart.axis.MarkerAxisBand",
"org.jfree.data.general.AbstractSeriesDataset",
"org.jfree.chart.LegendItemCollection",
"org.jfree.chart.renderer.xy.XYItemRenderer",
"org.jfree.chart.axis.AxisSpace",
"org.jfree.data.RangeInfo",
"org.jfree.chart.RenderingSource",
"org.jfree.data.xy.AbstractIntervalXYDataset",
"org.jfree.data.ComparableObjectSeries",
"org.jfree.chart.util.ObjectList",
"org.jfree.chart.axis.TickUnitSource",
"org.jfree.data.general.DatasetGroup",
"org.jfree.chart.plot.XYPlot",
"org.jfree.chart.event.ChartChangeEventType",
"org.jfree.data.general.DatasetSelectionState",
"org.jfree.data.xy.OHLCDataset",
"org.jfree.data.xy.AbstractXYDataset",
"org.jfree.chart.entity.ChartEntity",
"org.jfree.data.general.SeriesDataset",
"org.jfree.chart.plot.Pannable",
"org.jfree.chart.event.MarkerChangeListener",
"org.jfree.data.xy.XYDataset",
"org.jfree.data.Values2D",
"org.jfree.data.general.SeriesChangeEvent",
"org.jfree.chart.plot.Plot",
"org.jfree.chart.event.PlotChangeEvent",
"org.jfree.chart.plot.ValueAxisPlot",
"org.jfree.data.RangeType",
"org.jfree.data.general.DatasetChangeEvent",
"org.jfree.chart.axis.TickUnits",
"org.jfree.data.general.SeriesChangeListener",
"org.jfree.chart.event.AxisChangeEvent",
"org.jfree.data.xy.XYDatasetSelectionState",
"org.jfree.chart.event.RendererChangeEvent",
"org.jfree.data.general.Dataset",
"org.jfree.chart.plot.SeriesRenderingOrder",
"org.jfree.chart.plot.PlotRenderingInfo",
"org.jfree.chart.plot.PlotOrientation",
"org.jfree.chart.axis.NumberAxis",
"org.jfree.chart.util.Layer",
"org.jfree.chart.axis.SymbolAxis",
"org.jfree.chart.event.PlotChangeListener",
"org.jfree.chart.axis.Axis",
"org.jfree.data.general.Series",
"org.jfree.chart.axis.NumberTickUnit",
"org.jfree.data.general.PieDataset",
"org.jfree.chart.plot.Marker",
"org.jfree.chart.plot.DrawingSupplier",
"org.jfree.data.statistics.BoxAndWhiskerCategoryDataset",
"org.jfree.chart.entity.AxisLabelEntity",
"org.jfree.data.general.DatasetUtilities",
"org.jfree.chart.util.UnitType",
"org.jfree.chart.util.AbstractObjectList",
"org.jfree.chart.axis.AxisLocation",
"org.jfree.data.xy.IntervalXYDataset",
"org.jfree.chart.annotations.XYAnnotation",
"org.jfree.chart.axis.ValueAxis",
"org.jfree.chart.util.PublicCloneable",
"org.jfree.chart.util.RectangleEdge",
"org.jfree.chart.plot.Selectable",
"org.jfree.chart.event.ChartChangeEvent",
"org.jfree.chart.plot.DefaultDrawingSupplier",
"org.jfree.chart.event.MarkerChangeEvent",
"org.jfree.data.xy.XYIntervalSeriesCollection",
"org.jfree.data.Values",
"org.jfree.data.KeyedValues2D",
"org.jfree.chart.event.AxisChangeListener",
"org.jfree.chart.annotations.XYAnnotationBoundsInfo",
"org.jfree.data.category.CategoryDataset",
"org.jfree.data.Range",
"org.jfree.chart.plot.DatasetRenderingOrder",
"org.jfree.chart.event.RendererChangeListener",
"org.jfree.chart.util.LogFormat",
"org.jfree.data.xy.XYIntervalSeries",
"org.jfree.data.KeyedValues",
"org.jfree.chart.util.RectangleInsets",
"org.jfree.chart.util.ResourceBundleWrapper",
"org.jfree.chart.entity.PlotEntity",
"org.jfree.chart.axis.LogAxis"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
eff3dbea1c1cdfce32f7d717c067ac9b3951ffb9 | 0a2c37522a63e7a16d8dfef674278aa22ae0c96c | /src/ylysov/MathOperations.java | c127d72d17163c70b0c3955b202bf65bb724fd16 | [] | no_license | Nhrytsko/NewJavaProject | 144e7a718889942e808de94983cdec83d7109dc2 | c2bc185480b4c24c5665f7d71b35a8f3c57b7e4a | refs/heads/master | 2021-01-11T02:46:38.678511 | 2016-10-14T11:01:23 | 2016-10-14T11:01:23 | 70,902,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package ylysov;
public class MathOperations {
public static double divideValues(Double d1, Double d2) {
double result = d1 / d2;
return result;
}
public static double multiplyValues(Double d1, Double d2) {
double result = d1 * d2;
return result;
}
public static double subtractValues(Double d1, Double d2) {
double result = d1 - d2;
return result;
}
public static double addValues(Double d1, Double d2) {
double result = d1 + d2;
return result;
}
}
| [
"Nazar Hrytsko"
] | Nazar Hrytsko |
15331d70b9a044c412fc857cd3120d94e814b407 | 74b0f12cf4ce1ef43b38d20c9c44b3bae5ab18ff | /src/com/amarinfingroup/net/external/handler/ExternalDataHandlerBase.java | 8c4009c2379bf4a483dbc91b01d812c56f408031 | [] | no_license | Achaz/AmarinGroupODKProject | bebd074388d8f40fd0cb6368937b7203340cb27e | 90bbb4e5432836b46293251df61bf7caa9d364b2 | refs/heads/master | 2021-01-20T05:28:59.582857 | 2015-03-18T15:38:30 | 2015-03-18T15:38:30 | 32,467,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | /*
* Copyright (C) 2014 University of Washington
*
* Originally developed by Dobility, Inc. (as part of SurveyCTO)
*
* 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.amarinfingroup.net.external.handler;
import com.amarinfingroup.net.external.ExternalDataHandler;
import com.amarinfingroup.net.external.ExternalDataManager;
/**
* Author: Meletis Margaritis
* Date: 16/05/13
* Time: 10:42
*/
public abstract class ExternalDataHandlerBase implements ExternalDataHandler {
private ExternalDataManager externalDataManager;
public ExternalDataManager getExternalDataManager() {
return externalDataManager;
}
public void setExternalDataManager(ExternalDataManager externalDataManager) {
this.externalDataManager = externalDataManager;
}
protected ExternalDataHandlerBase(ExternalDataManager externalDataManager) {
this.setExternalDataManager(externalDataManager);
}
/**
* SCTO-545
*
* @param dataSetName the user-supplied data-set in the function
* @return the normalized data-set name.
*/
protected String normalize(String dataSetName) {
dataSetName = dataSetName.toLowerCase();
if (dataSetName.endsWith(".csv")) {
dataSetName = dataSetName.substring(0, dataSetName.lastIndexOf(".csv"));
}
return dataSetName;
}
}
| [
"jtugume123@gmail.com"
] | jtugume123@gmail.com |
9ee144d98efe08eafbf88deb3cc8bc811a45d612 | 8c631fb4e976c45763b4903a4dbb9eb0fc0a21d9 | /selenium/src/Code/CodeClass.java | 5e7347ad60925ca6a9e442a49cd883400283d716 | [] | no_license | HadiAbu/Selenium | 008d8e6031c49eb06f63eff0641cf795a9823f5a | 6648225eb30d36020a4c3f23b3cb3b21b47fe80c | refs/heads/master | 2021-01-10T17:42:25.221317 | 2015-10-25T14:34:53 | 2015-10-25T14:34:53 | 44,733,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 48 | java | package Code;
public class CodeClass {
}
| [
"hadi.abuhamed@galilsoftware.com"
] | hadi.abuhamed@galilsoftware.com |
166dabf7426164ae15609f72e37b4deff7f0d689 | bc138d0c9938f99fa6283c584634889f810571e7 | /pluginHostSdkLib/src/androidTest/java/com/twofortyfouram/locale/sdk/host/test/fixture/PluginConfigurationFixture.java | 079af4f18afbb97144db67da89d218b3f4d72609 | [
"Apache-2.0"
] | permissive | twofortyfouram/android-plugin-host-sdk-for-locale | 9291f4af09d0d2efdd78aff9b2c3d28a37ac622d | afaec462247a3ec80ad6f2b425f259ac06c5081e | refs/heads/master | 2021-07-22T07:01:18.984597 | 2021-07-17T17:08:50 | 2021-07-17T17:08:50 | 15,828,000 | 5 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | /*
* android-plugin-host-sdk-for-locale https://github.com/twofortyfouram/android-plugin-host-sdk-for-locale
* Copyright 2015-2016 two forty four a.m. LLC
*
* 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.twofortyfouram.locale.sdk.host.test.fixture;
import android.support.annotation.NonNull;
import com.twofortyfouram.locale.sdk.host.model.PluginConfiguration;
import net.jcip.annotations.ThreadSafe;
import java.util.LinkedList;
@ThreadSafe
public final class PluginConfigurationFixture {
/**
* Fixture to obtain a new plug-in configuration.
*/
@NonNull
public static PluginConfiguration newPluginConfiguration() {
return new PluginConfiguration(false, false, false, false, false, false,
new LinkedList<String>());
}
/**
* Private constructor prevents instantiation.
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private PluginConfigurationFixture() {
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
}
| [
"git@carterjernigan.com"
] | git@carterjernigan.com |
4988b61682bf264fa2c50d75b8b6254a1805006b | c8ac0c596f60f756899e19b0ed633be2dad114de | /StudentApp/src/cs4300/example/student/persistlayer/DatabaseAccess.java | 3cfed1376dc85c1fcec5abb87acf96407c01c409 | [] | no_license | mxd369/webprogramming2 | 9358590f4c5b58a8e937ae62aacaea15d01691df | bae7925ad9471fa7a2fd95fc6bfb6fb8c3e966a2 | refs/heads/master | 2021-01-19T10:32:33.518011 | 2017-03-08T00:57:17 | 2017-03-08T00:57:17 | 82,189,677 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,626 | java | /**
*
*/
package cs4300.example.student.persistlayer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* @author Mehdi
*
*/
public class DatabaseAccess {
static final String DRIVE_NAME = "com.mysql.jdbc.Driver";
static final String CONNECTION_URL = "jdbc:mysql://localhost:3306/studentdb";
static final String DB_CONNECTION_USERNAME = "root";
static final String DB_CONNECTION_PASSWORD = "root";
public static Connection connect() {
Connection con = null;
try {
Class.forName(DRIVE_NAME);
con = DriverManager.getConnection(CONNECTION_URL, DB_CONNECTION_USERNAME, DB_CONNECTION_PASSWORD);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return con;
} // end of connect
public static ResultSet retrieve (Connection con, String query) {
ResultSet rset = null;
try {
Statement stmt = con.createStatement();
rset = stmt.executeQuery(query);
return rset;
} catch (SQLException e) {
e.printStackTrace();
}
return rset;
}// end of retrieve
public static void closeConnection(Connection con) {
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
} // end of closeConnection
public static int insert(String sql) {
Connection c = connect();
int r = 0;
try {
Statement s = c.createStatement();
r = s.executeUpdate(sql);
} catch (SQLException e) {
e.printStackTrace();
}finally {
closeConnection(c);
}
return r;
}
}
| [
"MXD789@GMAIL.COM"
] | MXD789@GMAIL.COM |
b293b77d7092ab2bb96e3590129b2d0ee39a60b4 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_38962.java | 996bbd53afebc81b41f474703fe1333bc28c1535 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | @Override public boolean nameEquals(final CharSequence charSequence){
return caseSensitive ? CharSequenceUtil.equals(name,charSequence) : CharSequenceUtil.equalsIgnoreCase(name,charSequence);
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.