blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
f3dab9070680d9ae562673c4d2a860e66bc08f2d
b5c485493f675bcc19dcadfecf9e775b7bb700ed
/jee-utility-__kernel__/src/test/java/org/cyk/utility/__kernel__/persistence/query/EntityManagerNotCachableUnitTestBenchmark.java
a2622afd98cf7da36919f138239f2c998668c2f2
[]
no_license
devlopper/org.cyk.utility
148a1aafccfc4af23a941585cae61229630b96ec
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
refs/heads/master
2023-03-05T23:45:40.165701
2021-04-03T16:34:06
2021-04-03T16:34:06
16,252,993
1
0
null
2022-10-12T20:09:48
2014-01-26T12:52:24
Java
UTF-8
Java
false
false
388
java
package org.cyk.utility.__kernel__.persistence.query; public class EntityManagerNotCachableUnitTestBenchmark extends AbstractEntityManagerUnitTestBenchmark { private static final long serialVersionUID = 1L; @Override protected String __getPersistenceUnitName__() { return "pu"; } @Override protected Boolean __isResultCachable__() { return Boolean.FALSE; } }
[ "kycdev@gmail.com" ]
kycdev@gmail.com
923daab274b5ef6c0d8af860698d74e672b951f6
995f73d30450a6dce6bc7145d89344b4ad6e0622
/Mate20-9.0/src/main/java/com/android/server/fingerprint/InternalEnumerateClient.java
d34f722774c6fb0db9c7b4f477389afd02fb4aee
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,585
java
package com.android.server.fingerprint; import android.content.Context; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.os.IBinder; import android.util.Slog; import java.util.ArrayList; import java.util.List; public abstract class InternalEnumerateClient extends EnumerateClient { private List<Fingerprint> mEnrolledList; private List<Fingerprint> mUnknownFingerprints = new ArrayList(); /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public InternalEnumerateClient(Context context, long halDeviceId, IBinder token, IFingerprintServiceReceiver receiver, int groupId, int userId, boolean restricted, String owner, List<Fingerprint> enrolledList) { super(context, halDeviceId, token, receiver, userId, groupId, restricted, owner); this.mEnrolledList = enrolledList; } private void handleEnumeratedFingerprint(int fingerId, int groupId, int remaining) { boolean matched = false; int i = 0; while (true) { if (i >= this.mEnrolledList.size()) { break; } else if (this.mEnrolledList.get(i).getFingerId() == fingerId) { this.mEnrolledList.remove(i); matched = true; break; } else { i++; } } if (!matched && fingerId != 0) { Fingerprint fingerprint = new Fingerprint(BackupManagerConstants.DEFAULT_BACKUP_FINISHED_NOTIFICATION_RECEIVERS, groupId, fingerId, getHalDeviceId()); this.mUnknownFingerprints.add(fingerprint); } } private void doFingerprintCleanup() { if (this.mEnrolledList != null) { for (Fingerprint f : this.mEnrolledList) { Slog.e("FingerprintService", "Internal Enumerate: Removing dangling enrolled fingerprint: " + f.getName() + " " + f.getFingerId() + " " + f.getGroupId() + " " + f.getDeviceId()); FingerprintUtils.getInstance().removeFingerprintIdForUser(getContext(), f.getFingerId(), getTargetUserId()); } this.mEnrolledList.clear(); } } public List<Fingerprint> getUnknownFingerprints() { return this.mUnknownFingerprints; } public boolean onEnumerationResult(int fingerId, int groupId, int remaining) { handleEnumeratedFingerprint(fingerId, groupId, remaining); if (remaining == 0) { doFingerprintCleanup(); } return remaining == 0; } }
[ "dstmath@163.com" ]
dstmath@163.com
5285122cca92c60d401979f30d8d060a1c6508fe
729097f21fc4fdceda6bae0421308797c06b59bb
/src/cn/clickvalue/cv2/pages/affiliate/AffiliateBankAccontViewPage.java
3dc8c01ea43e8da8a9e91a067378e96db5c6927d
[]
no_license
qxev/cv2
e1c32f666d016cd56ff79c56f1f9bcf9b4ba47bc
f7215337347fb4afa552987dbd79304debf6ecef
refs/heads/master
2021-01-10T04:50:58.216626
2016-03-16T10:13:10
2016-03-16T10:13:10
54,020,600
0
0
null
null
null
null
UTF-8
Java
false
false
2,086
java
package cn.clickvalue.cv2.pages.affiliate; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.annotations.SetupRender; import org.apache.tapestry5.ioc.annotations.Inject; import cn.clickvalue.cv2.common.constants.Constants; import cn.clickvalue.cv2.components.affiliate.BasePage; import cn.clickvalue.cv2.model.Account; import cn.clickvalue.cv2.pages.MessagePage; import cn.clickvalue.cv2.services.logic.AccountService; public class AffiliateBankAccontViewPage extends BasePage { private Integer id; @Property @Persist private Account account; @Inject private AccountService accountService; @InjectPage private MessagePage messagePage; @SetupRender public void setupRender() { account = (Account) accountService.findAccount(id, getClientSession() .getId()); if (account == null) { addInfo("账号不存在!", false); } } public Object onClicked() { return BankAccontListPage.class; } /** * 进入审核期 * @return */ public Object onAudio() { account.setVerified(Integer.valueOf(1)); this.accountService.save(account); messagePage.setMessage(getMessages().get("action_success")); messagePage.setNextPage("affiliate/BankAccontListPage"); return messagePage; } public Object onDelete() { account.setDeleted(1); accountService.save(account); messagePage.setMessage(getMessages().get("Deletes_successful")); messagePage.setNextPage("affiliate/BankAccontListPage"); return messagePage; } public String getVerifiedState(Integer index) { return Constants.getVerifiedState(getMessages(), index); } public String getDefaultState(Integer index) { return Constants.getDEFAULT_STATE(getMessages(), index); } public boolean isDelete() { return account.getVerified() == 0 ? true : false; } public boolean isAudio() { return account.getVerified() == 0 ? true : false; } public void onActivate(Integer id) { this.id = id; } public Integer onPassivate() { return id; } }
[ "qqxev@hotmail.com" ]
qqxev@hotmail.com
7b53ba39eb5d05cc6d2516d9a81a79a4df7d38f9
d6ead9a0193d4b7a8b01562d05a02126f6b8efa3
/SpringFrameworkProgramming/spring4_testing_unit/homework_spring4_testing_unit/src/test/java/com/javapassion/examples/bank/controller/WithdrawControllerTests.java
19b443c19c84098b179400772813f06d7e2390e7
[]
no_license
SasirekhaPV/JPassionHomework
06271ad0c3f1bb99801fccc8825751b75cd6d946
82539522e7ccb60eda8f0c7a57837c7a2c223e8e
refs/heads/master
2021-12-15T15:48:35.746276
2017-08-29T18:03:13
2017-08-29T18:03:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,230
java
package com.javapassion.examples.bank.controller; import static org.junit.Assert.*; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.ui.ModelMap; import com.javapassion.examples.bank.services.AccountService; public class WithdrawControllerTests { private static final int TEST_ACCOUNT_NO = 1234; private static final double TEST_AMOUNT = 50; private static final double RESULT_AMOUNT = 150; @Mock private AccountService accountServiceMock; @InjectMocks private WithdrawController withdrawController; @Before public void setUp() { MockitoAnnotations.initMocks(this); } @Test public void testWithdraw(){ when(accountServiceMock.getBalance(TEST_ACCOUNT_NO)).thenReturn(RESULT_AMOUNT); ModelMap model = new ModelMap(); String viewName = withdrawController.withdraw(TEST_ACCOUNT_NO, TEST_AMOUNT, model); verify(accountServiceMock); assertEquals(viewName, "success"); assertEquals(TEST_ACCOUNT_NO, model.get("accountNo")); assertEquals(RESULT_AMOUNT, model.get("balance")); } }
[ "Henry.Fender@hennepin.us" ]
Henry.Fender@hennepin.us
424024175a992bdbb2881559189022d523efe85b
03f9caaefecfc046eca460eaf29bc450c78c4219
/src/com/symbol/xmlaprocessor/request/Property.java
5d0eec7eee0ab849fe79e3cd623b71d7b91a775b
[]
no_license
amirsaleh-salehzadeh/NIOPDC-BI
27829673da5114733ee25be21e5373abcebf4ed8
173ea89c1983d1e20551cb1254e891eefac24c4c
refs/heads/master
2021-01-22T22:44:21.963921
2017-03-20T12:33:18
2017-03-20T12:33:18
85,563,246
0
0
null
null
null
null
UTF-8
Java
false
false
1,128
java
/* XMLA Processor is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. XMLA Processor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with XMLA Processor; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA XMLA Processor was funded by Symbol Corporation. Please support the Symbol Corporation whenever possible. . Author: Sloan Seaman Email : sloan@sgi.net */ package com.symbol.xmlaprocessor.request; import javax.xml.soap.SOAPException; public class Property extends Request { public Property(String _localName, String _value) throws SOAPException { super(_localName, _value); } }
[ "salehzadeh@gmail.com" ]
salehzadeh@gmail.com
e3b12f2f98f6e4c5c6246d45c5de1f24db5a0ebc
d24224ee16c4a533d4fa1957a0ef2137d79d5b31
/app/src/main/java/com/xl/spriteeditor/MainActivity.java
b64fd71a17e82a2bafa54ec0aa0296f6bbe940ce
[]
no_license
fengdeyingzi/SpriteEditor
c5b753bcb19376088fca63954c282809bcc606b3
ef8857e88edf09caf46dbeeb6003b5033ef234b0
refs/heads/master
2020-06-25T23:59:58.166016
2020-05-30T09:31:27
2020-05-30T09:31:27
199,461,115
2
1
null
null
null
null
UTF-8
Java
false
false
1,774
java
package com.xl.spriteeditor; import android.os.Bundle; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "2541012655@qq.com" ]
2541012655@qq.com
8c8382fa78e0b0b515a9b19f3b1672bf9ee5ca90
732863b9b59e125172d7a1bec0f3f36674d61e15
/src/main/java/com/techmaster/sparrow/config/SparrowConfigs.java
51f1a90fb6501c45773df4e5dc4930c5770ffa8e
[]
no_license
hillangat/sparrow
e5f74b943f3db0820b9639892845e329deea3cbe
a09f794988bdcd46598edde9a84907d5d37ddbce
refs/heads/master
2020-04-08T06:01:44.528453
2018-12-11T04:40:51
2018-12-11T04:40:51
159,065,016
0
0
null
null
null
null
UTF-8
Java
false
false
4,293
java
package com.techmaster.sparrow.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.thymeleaf.spring5.SpringTemplateEngine; import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.spring5.view.ThymeleafViewResolver; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import java.util.Properties; @Configuration @EnableJpaRepositories("com.techmaster.sparrow") @EnableTransactionManagement public class SparrowConfigs { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") .allowedMethods("GET", "POST", "PUT", "DELETE") .allowedOrigins("*") .allowedHeaders("*"); } }; } @Bean public SpringResourceTemplateResolver templateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setCacheable(false); templateResolver.setPrefix("classpath:/templates/"); templateResolver.setSuffix(".html"); return templateResolver; } @Bean public SpringTemplateEngine templateEngine() { SpringTemplateEngine springTemplateEngine = new SpringTemplateEngine(); springTemplateEngine.addTemplateResolver(templateResolver()); return springTemplateEngine; } @Bean public ThymeleafViewResolver viewResolver() { ThymeleafViewResolver viewResolver = new ThymeleafViewResolver(); viewResolver.setTemplateEngine(templateEngine()); viewResolver.setOrder(1); return viewResolver; } @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.setPackagesToScan(new String[] { "com.techmaster.sparrow" }); JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); em.setJpaProperties(additionalProperties()); return em; } @Bean public DataSource dataSource(){ DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); dataSource.setUrl("jdbc:mysql://localhost:3306/sparrow_db"); dataSource.setUsername( "system" ); dataSource.setPassword( "Kendo.1900" ); return dataSource; } @Bean public PlatformTransactionManager transactionManager( EntityManagerFactory emf){ JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; } @Bean public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){ return new PersistenceExceptionTranslationPostProcessor(); } Properties additionalProperties() { Properties properties = new Properties(); properties.setProperty("hibernate.hbm2ddl.auto", "create-drop"); properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); return properties; } }
[ "hillangat@gmail.com" ]
hillangat@gmail.com
67d46177f61905f823e11c84897c9ea1dc47d8de
668496e4beee69591f98c5738a75f972093b805d
/carnival-spring-boot-starter-restful-security/src/main/java/com/github/yingzhuo/carnival/restful/security/exception/InvalidClaimException.java
b972289bd50f722ff5ea312469e861fba2e96b35
[ "Apache-2.0" ]
permissive
floodboad/carnival
ca1e4b181746f47248b0f3d82a54f6fe4c31b41f
9e18d5ce4dbc1e518102bc60ac13954156d93bd2
refs/heads/master
2023-01-04T07:18:35.514865
2020-10-28T04:15:31
2020-10-28T04:15:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
796
java
/* * ____ _ ____ _ _ _____ ___ _ * / ___| / \ | _ \| \ | |_ _\ \ / / \ | | * | | / _ \ | |_) | \| || | \ \ / / _ \ | | * | |___/ ___ \| _ <| |\ || | \ V / ___ \| |___ * \____/_/ \_\_| \_\_| \_|___| \_/_/ \_\_____| * * https://github.com/yingzhuo/carnival */ package com.github.yingzhuo.carnival.restful.security.exception; import javax.servlet.http.HttpServletRequest; /** * Claim非法 * * @author 应卓 * @see com.auth0.jwt.exceptions.InvalidClaimException */ public class InvalidClaimException extends InvalidTokenException { public InvalidClaimException(HttpServletRequest request) { super(request); } public InvalidClaimException(String message, HttpServletRequest request) { super(message, request); } }
[ "yingzhor@gmail.com" ]
yingzhor@gmail.com
ff69ce73b29a065608641bc06551484a84d7593d
443c594fdb7365095ff16c112398259e64550565
/src/practice/FirstJavaProject.java
35aad5a8e598da62b2c10097b919a0719ca739db
[]
no_license
NoobishNoob/RadioApp
cfd73db1faaad7039688dd1f267770f80261bd69
335b121e9bc4b6068d3cd6944d9fa47aa2dfaced
refs/heads/master
2021-07-24T08:10:39.064580
2017-11-07T02:16:48
2017-11-07T02:16:48
109,774,801
0
1
null
null
null
null
UTF-8
Java
false
false
1,032
java
package practice; import java.io.*; import java.net.*; import java.util.*; public class FirstJavaProject { public static void main(String []args) throws IOException{ URL url = new URL("http://vernonfm.org/playingnow.txt"); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String inputLine = null; List firstSong = null; List songList = null; int x = 0; int l = 0; String currentSong = null; for(int i = 0; i < 10; ++i) inputLine = in.readLine(); songList.add(1 , inputLine); l += 1; /*while ((inputLine = in.readLine()) != null) System.out.println(inputLine); songList.add(x, inputLine); x += 1; in.close(); */ System.out.println(songList); //List<String> splitList = Arrays.asList(songList.split(",")); //firstSong = split(songList); //currentSong = (String) firstSong.get(0); //System.out.println(currentSong); } private static List split(String songList) { // TODO Auto-generated method stub return null; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
10808c04feec2a91647155d6bae7bf44f18f3f17
2eb5604c0ba311a9a6910576474c747e9ad86313
/chado-pg-orm/src/org/irri/iric/chado/so/TrnaIntron.java
27e36c4ce57111e6600e7fb817eed4148796c4c0
[]
no_license
iric-irri/portal
5385c6a4e4fd3e569f5334e541d4b852edc46bc1
b2d3cd64be8d9d80b52d21566f329eeae46d9749
refs/heads/master
2021-01-16T00:28:30.272064
2014-05-26T05:46:30
2014-05-26T05:46:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
package org.irri.iric.chado.so; // Generated 05 26, 14 1:32:25 PM by Hibernate Tools 3.4.0.CR1 /** * TrnaIntron generated by hbm2java */ public class TrnaIntron implements java.io.Serializable { private TrnaIntronId id; public TrnaIntron() { } public TrnaIntron(TrnaIntronId id) { this.id = id; } public TrnaIntronId getId() { return this.id; } public void setId(TrnaIntronId id) { this.id = id; } }
[ "locem@berting-debian.ourwebserver.no-ip.biz" ]
locem@berting-debian.ourwebserver.no-ip.biz
aff55f239c2455fff404e924f94554706b756154
3343050b340a8594d802598cddfd0d8709ccc45a
/src/share/classes/sun/text/resources/no/FormatData_no_NO_NY.java
3cf98aeb763c014afc361c48e1d974c51f447a22
[ "Apache-2.0" ]
permissive
lcyanxi/jdk8
be07ce687ca610c9e543bf3c1168be8228c1f2b3
4f4c2d72670a30dafaf9bb09b908d4da79119cf6
refs/heads/master
2022-05-25T18:11:28.236578
2022-05-03T15:28:01
2022-05-03T15:28:01
228,209,646
0
0
Apache-2.0
2022-05-03T15:28:03
2019-12-15T15:49:24
Java
UTF-8
Java
false
false
5,564
java
/* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved * * The original version of this source code and documentation * is copyrighted and owned by Taligent, Inc., a wholly-owned * subsidiary of IBM. These materials are provided under terms * of a License Agreement between Taligent and Sun. This technology * is protected by multiple US and International patents. * * This notice and attribution to Taligent may not be removed. * Taligent is a registered trademark of Taligent, Inc. * */ package sun.text.resources.no; import sun.util.resources.ParallelListResourceBundle; public class FormatData_no_NO_NY extends ParallelListResourceBundle { /** * Overrides ParallelListResourceBundle */ protected final Object[][] getContents() { return new Object[][] { { "MonthNames", new String[] { "januar", // january "februar", // february "mars", // march "april", // april "mai", // may "juni", // june "juli", // july "august", // august "september", // september "oktober", // october "november", // november "desember", // december "" // month 13 if applicable } }, { "MonthAbbreviations", new String[] { "jan", // abb january "feb", // abb february "mar", // abb march "apr", // abb april "mai", // abb may "jun", // abb june "jul", // abb july "aug", // abb august "sep", // abb september "okt", // abb october "nov", // abb november "des", // abb december "" // abb month 13 if applicable } }, { "DayNames", new String[] { "sundag", // Sunday "m\u00e5ndag", // Monday "tysdag", // Tuesday "onsdag", // Wednesday "torsdag", // Thursday "fredag", // Friday "laurdag" // Saturday } }, { "DayAbbreviations", new String[] { "su", // abb Sunday "m\u00e5", // abb Monday "ty", // abb Tuesday "on", // abb Wednesday "to", // abb Thursday "fr", // abb Friday "lau" // abb Saturday } }, { "NumberElements", new String[] { ",", // decimal separator "\u00a0", // group (thousands) separator ";", // list separator "%", // percent sign "0", // native 0 digit "#", // pattern digit "-", // minus sign "E", // exponential "\u2030", // per mille "\u221e", // infinity "\ufffd" // NaN } }, { "TimePatterns", new String[] { "'kl 'HH.mm z", // full time pattern "HH:mm:ss z", // long time pattern "HH:mm:ss", // medium time pattern "HH:mm", // short time pattern } }, { "DatePatterns", new String[] { "d. MMMM yyyy", // full date pattern "d. MMMM yyyy", // long date pattern "dd.MMM.yyyy", // medium date pattern "dd.MM.yy", // short date pattern } }, { "DateTimePatterns", new String[] { "{1} {0}" // date-time pattern } }, { "DateTimePatternChars", "GyMdkHmsSEDFwWahKzZ" }, }; } }
[ "2757710657@qq.com" ]
2757710657@qq.com
655a74b5c6742aca90a6c2d51010692fffd6de2c
a59e7126b1b89aa53b73db840628d9672856f58a
/src/test/java/org/scijava/download/DownloadServiceTest.java
722a3325c285d623102617b27cd8761f0c6176c0
[ "BSD-2-Clause", "Apache-2.0" ]
permissive
scijava/scijava-common
8ad76a5b3a666a01718764a27a48126ab2c09635
9abafb2d50ec2df75edd90811ead26e47b25f0fa
refs/heads/master
2023-08-31T15:00:21.565803
2023-08-06T20:55:33
2023-08-06T20:55:33
3,594,497
76
57
BSD-2-Clause
2023-07-12T19:37:56
2012-03-01T18:06:45
Java
UTF-8
Java
false
false
5,792
java
/*- * #%L * SciJava Common shared library for SciJava software. * %% * Copyright (C) 2009 - 2023 SciJava developers. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * #L% */ package org.scijava.download; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.concurrent.ExecutionException; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.scijava.Context; import org.scijava.io.ByteBank; import org.scijava.io.location.BytesLocation; import org.scijava.io.location.FileLocation; import org.scijava.io.location.Location; import org.scijava.test.TestUtils; import org.scijava.util.FileUtils; import org.scijava.util.MersenneTwisterFast; /** * Tests {@link DownloadService}. * * @author Curtis Rueden */ public class DownloadServiceTest { private DownloadService downloadService; @Before public void setUp() { final Context ctx = new Context(DownloadService.class); downloadService = ctx.service(DownloadService.class); } @After public void tearDown() { downloadService.context().dispose(); } @Test public void testDownload() throws IOException, InterruptedException, ExecutionException { final byte[] data = randomBytes(0xbabebabe); final String prefix = getClass().getName(); final File inFile = File.createTempFile(prefix, "testDownloadIn"); final File outFile = File.createTempFile(prefix, "testDownloadOut"); try { FileUtils.writeFile(inFile, data); final Location src = new FileLocation(inFile); final Location dest = new FileLocation(outFile); final Download download = downloadService.download(src, dest); download.task().waitFor(); final byte[] result = FileUtils.readFile(outFile); assertArrayEquals(data, result); } finally { inFile.delete(); outFile.delete(); } } @Test public void testDownloadCache() throws IOException, InterruptedException, ExecutionException { // Create some data. final byte[] data = randomBytes(0xcafecafe); // Create source location. final String prefix = getClass().getName(); final File inFile = File.createTempFile(prefix, "testDownloadCacheIn"); final Location src = new FileLocation(inFile); // Create destination location. final BytesLocation dest = new BytesLocation(data.length); // Create a disk cache. final File cacheDir = TestUtils.createTemporaryDirectory( "testDownloadCacheBase", getClass()); final DiskLocationCache cache = new DiskLocationCache(); cache.setBaseDirectory(cacheDir); cache.setFileLocationCachingEnabled(true); try { // Write the data to the source location. FileUtils.writeFile(inFile, data); // Sanity check: the cache should be empty. assertNull(cache.loadChecksum(src)); final Location cachedSource = cache.cachedLocation(src); assertTrue(cachedSource instanceof FileLocation); final FileLocation cachedFile = (FileLocation) cachedSource; assertFalse(cachedFile.getFile().exists()); // Download + cache the source. final Download download = downloadService.download(src, dest, cache); download.task().waitFor(); // Check that the data was read. assertBytesEqual(data, dest.getByteBank()); // Check that the data was cached. assertEquals(cachedSource, cache.cachedLocation(src)); assertTrue(cachedFile.getFile().exists()); final byte[] cachedData = FileUtils.readFile(cachedFile.getFile()); assertArrayEquals(data, cachedData); // Check that the cache works, even after the source file is deleted. inFile.delete(); assertFalse(inFile.exists()); final BytesLocation dest2 = new BytesLocation(data.length); final Download download2 = downloadService.download(src, dest2, cache); download2.task().waitFor(); assertBytesEqual(data, dest2.getByteBank()); } finally { if (inFile.exists()) inFile.delete(); FileUtils.deleteRecursively(cacheDir); } } // -- Helper methods -- private byte[] randomBytes(final long seed) { final MersenneTwisterFast r = new MersenneTwisterFast(seed); final byte[] data = new byte[2938740]; for (int i = 0; i < data.length; i++) { data[i] = r.nextByte(); } return data; } private void assertBytesEqual(byte[] data, ByteBank byteBank) { for (int i=0; i<data.length; i++) { assertEquals(data[i], byteBank.getByte(i)); } } }
[ "ctrueden@wisc.edu" ]
ctrueden@wisc.edu
c0c10e6f0ef51de5397c537db27192fdcca9e268
0207203c7c4790c35bcb7b5c21d3d66757f658d8
/docroot/WEB-INF/src/vn/dtt/duongbien/dao/vrcb/service/persistence/LogMessageValidationActionableDynamicQuery.java
448e312f5cc300d086a914c257b7cdec5d8016f3
[]
no_license
longdm10/DuongBoDoanhNghiepApp-portlet
930a0628a34a76dbd9e7e96febcd13206366b954
512b03be6cd6d7e2aa9043ab0a9480de5518ce84
refs/heads/master
2021-01-21T13:44:15.439969
2016-04-28T17:39:15
2016-04-28T17:39:15
54,985,320
0
0
null
null
null
null
UTF-8
Java
false
false
1,385
java
/** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * * 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. */ package vn.dtt.duongbien.dao.vrcb.service.persistence; import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery; import com.liferay.portal.kernel.exception.SystemException; import vn.dtt.duongbien.dao.vrcb.model.LogMessageValidation; import vn.dtt.duongbien.dao.vrcb.service.LogMessageValidationLocalServiceUtil; /** * @author longdm * @generated */ public abstract class LogMessageValidationActionableDynamicQuery extends BaseActionableDynamicQuery { public LogMessageValidationActionableDynamicQuery() throws SystemException { setBaseLocalService(LogMessageValidationLocalServiceUtil.getService()); setClass(LogMessageValidation.class); setClassLoader(vn.dtt.duongbien.dao.vrcb.service.ClpSerializer.class.getClassLoader()); setPrimaryKeyPropertyName("id"); } }
[ "longdm10@gmail.com" ]
longdm10@gmail.com
c17c9b483ce73a3ef240bb0520f6eb98c52df07d
ab59063ff2ae941b876324070d8f8e8165cef960
/chunking_text_file/40authors/emigonza/master/POSPowerService17.java
f21de89a9eb347c319ff72c5acd91142119bcc6a
[]
no_license
gpoorvi92/author_class
f7c26f46f1ca9608a8c98fb18fc74a544cf99c36
b079ef0a477a2868140d77c4b32c317d4492725e
refs/heads/master
2020-04-01T18:01:54.665333
2018-12-10T14:55:11
2018-12-10T14:55:11
153,466,983
1
0
null
2018-10-17T14:44:56
2018-10-17T14:03:04
Java
UTF-8
Java
false
false
1,327
java
///////////////////////////////////////////////////////////////////// // // This software is provided "AS IS". The JavaPOS working group (including // each of the Corporate members, contributors and individuals) MAKES NO // REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, // EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NON-INFRINGEMENT. The JavaPOS working group shall not be liable for // any damages suffered as a result of using, modifying or distributing this // software or its derivatives.Permission to use, copy, modify, and distribute // the software and its documentation for any purpose is hereby granted. // // POSPowerService17 // // Interface definining all new capabilities, properties and // methods that are specific to POSPower for release 1.7. // // Modification history // ------------------------------------------------------------------ // 01-Jul-2002 JavaPOS Release 1.7 BS // ///////////////////////////////////////////////////////////////////// package jpos.services; import jpos.*; import jpos.loader.*; public interface POSPowerService17 extends POSPowerService16 { // Nothing new added for release 1.7 }
[ "gpoorvi92@gmail.com" ]
gpoorvi92@gmail.com
d1b8c3ed6ac90fa301f7daaf56d4a30646f08421
b34654bd96750be62556ed368ef4db1043521ff2
/billing_cost_services/tags/version/src/java/tests/com/topcoder/accounting/entities/dao/IdentifiableEntityTest.java
019304440db29f34827823c5ebad3fd61f677e8f
[]
no_license
topcoder-platform/tcs-cronos
81fed1e4f19ef60cdc5e5632084695d67275c415
c4ad087bb56bdaa19f9890e6580fcc5a3121b6c6
refs/heads/master
2023-08-03T22:21:52.216762
2019-03-19T08:53:31
2019-03-19T08:53:31
89,589,444
0
1
null
2019-03-19T08:53:32
2017-04-27T11:19:01
null
UTF-8
Java
false
false
4,417
java
/* * Copyright (C) 2011 TopCoder Inc., All Rights Reserved. */ package com.topcoder.accounting.entities.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.Serializable; import junit.framework.JUnit4TestAdapter; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.topcoder.accounting.entities.JsonPrintable; /** * <p> * Unit tests for class <code>IdentifiableEntity</code>. * </p> * * @author stevenfrog * @version 1.0 */ public class IdentifiableEntityTest { /** * <p> * Represents the <code>IdentifiableEntity</code> instance used to test against. * </p> */ private IdentifiableEntity impl; /** * <p> * Creates a test suite for the tests in this test case. * </p> * * @return a Test suite for this test case. */ public static junit.framework.Test suite() { return new JUnit4TestAdapter(IdentifiableEntityTest.class); } /** * <p> * Set up the test environment. * </p> * * @throws Exception * to JUnit */ @Before public void setUp() throws Exception { impl = new PaymentArea(); } /** * <p> * Tear down the test environment. * </p> * * @throws Exception * to JUnit */ @After public void tearDown() throws Exception { impl = null; } /** * <p> * Inheritance test, verifies <code>IdentifiableEntity</code> subclasses should be correct. * </p> */ @SuppressWarnings("cast") @Test public void testInheritance() { assertTrue("The instance's subclass is not correct.", impl instanceof Serializable); assertTrue("The instance's subclass is not correct.", impl instanceof JsonPrintable); } /** * <p> * Accuracy test for the constructor <code>IdentifiableEntity()</code>.<br> * Instance should be created successfully. * </p> */ @Test public void testCtor() { assertNotNull("Instance should be created", impl); } /** * <p> * Accuracy test for the method <code>getId()</code> .<br> * Expects no error occurs. * </p> */ @Test public void testGetId() { assertEquals("The initial id should be same as", 0, impl.getId()); long expect = 7; impl.setId(expect); assertEquals("The id should be same as", expect, impl.getId()); } /** * <p> * Accuracy test for the method <code>setId(long)</code> .<br> * Expects no error occurs. * </p> */ @Test public void testSetId() { assertEquals("The initial id should be same as", 0, impl.getId()); long expect = 7; impl.setId(expect); assertEquals("The id should be same as", expect, impl.getId()); } /** * <p> * Accuracy test for the method <code>equals(Object)</code> .<br> * Expects no error occurs. * </p> */ @Test public void testEquals() { impl.setId(9); PaymentArea obj = new PaymentArea(); obj.setId(9); obj.setName("name"); assertTrue("The two object should be same", impl.equals(obj)); obj.setId(8); assertFalse("The two object should be different", impl.equals(obj)); assertFalse("The two object should be different", impl.equals(new PaymentArea())); BillingCostExport obj2 = new BillingCostExport(); obj2.setId(9); assertFalse("The two object should be different", impl.equals(obj2)); assertFalse("The two object should be different", impl.equals(null)); assertFalse("The two object should be different", impl.equals(new Object())); } /** * <p> * Accuracy test for the method <code>hashCode()</code> .<br> * Expects no error occurs. * </p> */ @Test public void testHashCode() { assertEquals("The hash code should be same as", 0, impl.hashCode()); impl.setId(6); assertEquals("The hash code should be same as", 6, impl.hashCode()); } }
[ "victorsam@fb370eea-3af6-4597-97f7-f7400a59c12a" ]
victorsam@fb370eea-3af6-4597-97f7-f7400a59c12a
aaec9dc4d53aee996936dd44053ffb453ee57297
0d681cc3e93e75b713937beb409b48ecf423e137
/hw04-0036479615/src/main/java/hr/fer/zemris/optjava/dz4/part1/GeneticAlgorithm.java
aeddabdfaae75cc2973e9e14700b5f559af7029f
[]
no_license
svennjegac/FER-java-optjava
fe86ead9bd80b4ef23944ef9234909353673eaab
89d9aa124e2e2e32b0f8f1ba09157f03ecd117c6
refs/heads/master
2020-03-29T04:17:20.952593
2018-09-20T08:59:01
2018-09-20T08:59:01
149,524,350
0
0
null
null
null
null
UTF-8
Java
false
false
3,042
java
package hr.fer.zemris.optjava.dz4.part1; import java.util.List; import hr.fer.zemris.optjava.dz4.algorithms.genetic.GenerationElitisticGA; import hr.fer.zemris.optjava.dz4.algorithms.genetic.IOptAlgorithm; import hr.fer.zemris.optjava.dz4.algorithms.genetic.ISelectionOperator; import hr.fer.zemris.optjava.dz4.algorithms.genetic.ISolution; import hr.fer.zemris.optjava.dz4.algorithms.genetic.RouletteWheelSelOp; import hr.fer.zemris.optjava.dz4.algorithms.genetic.TournamentSelOp; public class GeneticAlgorithm { private static final String FILE_NAME = "02-zad-prijenosna.txt"; private static final String ROULETTE_WHEEL = "rouletteWheel"; private static final String TOURNAMENT_N = "tournament:[0-9]+"; public static void main(String[] args) { if (args.length != 5) { System.out.println("Krivi broj argumenata."); return; } int populationSize; double fitnessThreshold; int maxGenerations; String selectionType; double sigma; try { populationSize = Integer.parseInt(args[0]); fitnessThreshold = Double.parseDouble(args[1]); maxGenerations = Integer.parseInt(args[2]); selectionType = args[3]; sigma = Double.parseDouble(args[4]); } catch (NumberFormatException | NullPointerException e) { System.out.println("Greška pri parsiranju parametara."); return; } ISelectionOperator<double[]> selectionOperator = parseSelectionType(selectionType); if (selectionOperator == null) { System.out.println("Nepostojeći operator selekcije."); return; } List<double[]> problemRows = Util.parseProblem(FILE_NAME); if (problemRows == null) { System.out.println("Pogreška pri čitanju problema sa diska."); return; } IOptAlgorithm<double[]> optAlgoritm = new GenerationElitisticGA<>( populationSize, selectionOperator, new BLXAlphaCrossover(0.5), new DecimalMutationOperator(sigma, 0.2), new FunctionFour(problemRows), -fitnessThreshold, maxGenerations ); ISolution<double[]> solution = optAlgoritm.run(); printSolution(solution); } private static ISelectionOperator<double[]> parseSelectionType(String selectionType) { if (selectionType.equals(ROULETTE_WHEEL)) { return new RouletteWheelSelOp<>(); } if (selectionType.matches(TOURNAMENT_N)) { int tournamentSize; try { tournamentSize = Integer.parseInt(selectionType.substring(selectionType.indexOf(":") + 1)); } catch (NumberFormatException e) { return null; } return new TournamentSelOp<>(tournamentSize, true); } return null; } private static void printSolution(ISolution<double[]> solution) { StringBuilder sb = new StringBuilder(); sb.append("Function value: " + solution.getValue() + System.lineSeparator()); sb.append("FunctionFitness: " + solution.getFitness() + System.lineSeparator()); for (int i = 0, size = solution.getRepresentation().length; i < size; i++) { sb.append(solution.getRepresentation()[i] + " ### "); } System.out.println(sb.toString()); } }
[ "sven.njegac@fer.hr" ]
sven.njegac@fer.hr
8a97849b6f56c0f79a4361c6d85047d21a1e0e1f
f73201e5822fb3a5a3fac8a7aec019cee12c630e
/exercise/src/hong/练习的包/Day10_io流/ReadAndWriteDemo.java
bf5610c109a58c5bcc5279bbf4394484bcafd736
[]
no_license
zhangkangmu/javacommon
5227f319bdf90834d5ff08fa45db10e76cbdbd32
6f8a900f70838a4cf21bb18f34ac19ac14ed046f
refs/heads/master
2021-07-23T11:04:09.388317
2020-01-06T13:12:32
2020-01-06T13:12:32
230,770,547
0
0
null
null
null
null
UTF-8
Java
false
false
929
java
package hong.练习的包.Day10_io流; import java.io.*; /** * Created by zhangyuhong * Date:2017/12/28 */ public class ReadAndWriteDemo { public static void main(String[] args) throws IOException { FileReader fileReader = new FileReader("exercise\\src\\hong\\练习的包\\Day10_io流\\file\\char.txt"); FileWriter fileWriter = new FileWriter("exercise\\src\\hong\\练习的包\\Day10_io流\\file\\charCopy.txt"); int len; char[] chars=new char[1024]; while ((len=fileReader.read(chars))!=-1){ fileWriter.write(chars,0,len); } fileWriter.write("zhangyuhong",0,5); fileWriter.close(); fileReader.close(); BufferedReader bufferedReader1 = new BufferedReader(new FileReader("exercise\\src\\hong\\练习的包\\Day10_io流\\file\\char.txt")); String s = bufferedReader1.readLine(); System.out.println(s); } }
[ "289590351@qq.com" ]
289590351@qq.com
955b61ea4bd21e44bfc111e612e2cc5e510b1d26
f1a85ae8b9d5d9d9a848c4c8d9c2410b9726e194
/company_shipper/app_company/src/main/java/com/yaoguang/company/businessorder2/common/businessmain/BaseBusinessMainFragment.java
6479534b8af5290cc559205b0d43acebf5a1f102
[]
no_license
P79N6A/as
45dc7c76d58cdc62e3e403c9da4a1c16c4234568
a57ee2a3eb2c73cc97c3fb130b8e389899b19d99
refs/heads/master
2020-04-20T05:55:10.175425
2019-02-01T08:49:15
2019-02-01T08:49:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,139
java
package com.yaoguang.company.businessorder2.common.businessmain; import android.os.Bundle; import android.os.Parcelable; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.view.View; import android.view.WindowManager; import com.yaoguang.company.R; import com.yaoguang.company.businessorder2.common.businessmain.adapter.BaseBusinessMainAdapter; import com.yaoguang.company.businessorder2.common.businessmain.business.event.BusinessFragmentResultEvent; import com.yaoguang.company.businessorder2.forwarder.businessmain.business.BusinessOrderFragment; import com.yaoguang.company.databinding.FragmentBusinessMainBinding; import com.yaoguang.datasource.company.CompanyOrderDataSource; import com.yaoguang.lib.appcommon.dialog.DialogHelper; import com.yaoguang.lib.appcommon.dialog.helper.CommonDialog; import com.yaoguang.lib.base.BaseFragmentDataBind; import com.yaoguang.lib.base.interfaces.BasePresenter; import com.yaoguang.lib.net.BaseObserver; import com.yaoguang.lib.net.bean.BaseResponse; import org.greenrobot.eventbus.EventBus; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.schedulers.Schedulers; /** * Created by zhongjh on 2018/11/14. */ public abstract class BaseBusinessMainFragment<T> extends BaseFragmentDataBind<FragmentBusinessMainBinding> implements Toolbar.OnMenuItemClickListener { protected CompanyOrderDataSource mCompanyOrderDataSource = new CompanyOrderDataSource(); protected CompositeDisposable mCompositeDisposable = new CompositeDisposable(); protected T t; /** * 从列表传递过来的对象(用于进行修改或者查看) */ public static final String BUNDLE_ID = "ID"; public String mID; private int mType; protected String mServiceType; // 0 货代 1 拖车 protected String mOtherService; // 0 装箱,1拆箱 public BaseBusinessMainAdapter mBaseBusinessMainAdapter; public abstract Observable<BaseResponse<T>> detail(String id); protected DialogHelper mDialogHelperPop; @Override public void onCreate(@Nullable Bundle savedInstanceState) { Bundle args = getArguments(); if (args != null) { mID = args.getString(BUNDLE_ID); mType = args.getInt("type"); mServiceType = args.getString("serviceType"); t = args.getParcelable("t"); mOtherService = args.getString("otherService"); } _mActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); super.onCreate(savedInstanceState); } /** * 通过列表传递id进去 * * @param serviceType 0-货代,1-拖车 * @param id id * @param otherService 装箱 拆箱 */ public BaseBusinessMainFragment(String id, String serviceType, String otherService) { Bundle bundle = new Bundle(); bundle.putString(BUNDLE_ID, id); if (TextUtils.isEmpty(id)) { bundle.putInt("type", BusinessOrderFragment.TYPE_MODEL_ADD); } else { bundle.putInt("type", BusinessOrderFragment.TYPE_MODEL_UPDATE); } bundle.putString("serviceType", serviceType); bundle.putString("otherService", otherService); this.setArguments(bundle); } /** * @param t 通过拷贝或者模板传递的ViewForwardOrder * @param serviceType 0-货代,1-拖车 * @param otherService 装箱 拆箱 */ public BaseBusinessMainFragment(T t, String serviceType, String otherService) { Bundle bundle = new Bundle(); bundle.putParcelable("t", (Parcelable) t); bundle.putInt("type", BusinessOrderFragment.TYPE_MODEL_COPY_OR_TEMP); bundle.putString("serviceType", serviceType); bundle.putString("otherService", otherService); this.setArguments(bundle); } @Override public void onDestroy() { super.onDestroy(); mCompositeDisposable.clear(); } @Override public int getLayoutId() { return R.layout.fragment_business_main; } @Override public void init() { if (mType == BusinessOrderFragment.TYPE_MODEL_UPDATE) { if (mServiceType.equals("0")) initToolbarNav(mToolbarCommonBinding.toolbar, "编辑货代工作单", R.menu.menu_business_main, this); else initToolbarNav(mToolbarCommonBinding.toolbar, "编辑拖车工作单", R.menu.menu_business_main, this); // 如果是编辑的,就有两个tab mDataBinding.tabLayout.addTab(mDataBinding.tabLayout.newTab().setText("基本信息")); mDataBinding.tabLayout.addTab(mDataBinding.tabLayout.newTab().setText("动态")); detail(mID) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseObserver<BaseResponse<T>>(mCompositeDisposable, this) { @Override public void onSuccess(BaseResponse<T> response) { t = response.getResult(); mBaseBusinessMainAdapter = new BaseBusinessMainAdapter(getChildFragmentManager(), mType, mServiceType, mOtherService, response.getResult(), 2); mDataBinding.viewPager.setAdapter(mBaseBusinessMainAdapter); mDataBinding.viewPager.setOffscreenPageLimit(3); mDataBinding.tabLayout.setupWithViewPager(mDataBinding.viewPager); } }); } else if (mType == BusinessOrderFragment.TYPE_MODEL_ADD || mType == BusinessOrderFragment.TYPE_MODEL_COPY_OR_TEMP) { if (mServiceType.equals("0")) initToolbarNav(mToolbarCommonBinding.toolbar, "新建货代工作单", -1, null); else initToolbarNav(mToolbarCommonBinding.toolbar, "新建拖车工作单", -1, null); // 直接隐藏tab mDataBinding.flTab.setVisibility(View.GONE); // 如果是模板,直接赋值 if (mType == BusinessOrderFragment.TYPE_MODEL_COPY_OR_TEMP) mBaseBusinessMainAdapter = new BaseBusinessMainAdapter(getChildFragmentManager(), mType, mServiceType, mOtherService, t, 1); else mBaseBusinessMainAdapter = new BaseBusinessMainAdapter(getChildFragmentManager(), mType, mServiceType, mOtherService, null, 1); mDataBinding.viewPager.setAdapter(mBaseBusinessMainAdapter); mDataBinding.viewPager.setOffscreenPageLimit(2); } } @Override public void initListener() { //返回事件 mToolbarCommonBinding.imgReturn.setOnClickListener(v -> backPressedSupport()); } @Override public BasePresenter getPresenter() { return null; } @Override public void onFragmentResult(int requestCode, int resultCode, Bundle data) { super.onFragmentResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { EventBus.getDefault().post(new BusinessFragmentResultEvent(requestCode, data)); } } @Override public boolean onBackPressedSupport() { backPressedSupport(); return true; } /** * 返回之前提示是否需要确认返回,新增和编辑都是不同的提示 */ private void backPressedSupport() { if (mDialogHelperPop == null) mDialogHelperPop = new DialogHelper(getContext(), "提示", "这将不保存工作单数据,确定退出?","确定","取消", new CommonDialog.Listener() { @Override public void ok(String msg) { mDialogHelperPop.hideDialog(); pop(); } @Override public void cancel() { } }); mDialogHelperPop.show(); } }
[ "254191389@qq.com" ]
254191389@qq.com
2f6d8e05f9c28f460b9be2b02288dea4f84311fc
b31120cefe3991a960833a21ed54d4e10770bc53
/modules/org.clang.sema/src/org/clang/sema/impl/DFIParamWithArguments.java
386ded9a8005be8a52f18db7eb2b08e0f6ce78ae
[]
no_license
JianpingZeng/clank
94581710bd89caffcdba6ecb502e4fdb0098caaa
bcdf3389cd57185995f9ee9c101a4dfd97145442
refs/heads/master
2020-11-30T05:36:06.401287
2017-10-26T14:15:27
2017-10-26T14:15:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,584
java
/** * This file was converted to Java from the original LLVM source file. The original * source file follows the LLVM Release License, outlined below. * * ============================================================================== * LLVM Release License * ============================================================================== * University of Illinois/NCSA * Open Source License * * Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. * All rights reserved. * * Developed by: * * LLVM Team * * University of Illinois at Urbana-Champaign * * http://llvm.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal with * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimers. * * * Redistributions in binary form must reproduce the above copyright notice * this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * * * Neither the names of the LLVM Team, University of Illinois at * Urbana-Champaign, nor the names of its contributors may be used to * endorse or promote products derived from this Software without specific * prior written permission. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE * SOFTWARE. * * ============================================================================== * Copyrights and Licenses for Third Party Software Distributed with LLVM: * ============================================================================== * The LLVM software contains code written by third parties. Such software will * have its own individual LICENSE.TXT file in the directory in which it appears. * This file will describe the copyrights, license, and restrictions which apply * to that code. * * The disclaimer of warranty in the University of Illinois Open Source License * applies to all code in the LLVM Distribution, and nothing in any of the * other licenses gives permission to use the names of the LLVM Team or the * University of Illinois to endorse or promote products derived from this * Software. * * The following pieces of software have additional or alternate copyrights, * licenses, and/or restrictions: * * Program Directory * ------- --------- * Autoconf llvm/autoconf * llvm/projects/ModuleMaker/autoconf * Google Test llvm/utils/unittest/googletest * OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} * pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} * ARM contributions llvm/lib/Target/ARM/LICENSE.TXT * md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h */ package org.clang.sema.impl; import org.clank.support.*; import org.llvm.adt.*; import org.clang.ast.*; // Structure used by DeductionFailureInfo to store // template parameter and template argument information. //<editor-fold defaultstate="collapsed" desc="(anonymous namespace)::DFIParamWithArguments"> @Converted(kind = Converted.Kind.AUTO, source = "${LLVM_SRC}/llvm/tools/clang/lib/Sema/SemaOverload.cpp", line = 551, FQN="(anonymous namespace)::DFIParamWithArguments", NM="_ZN12_GLOBAL__N_121DFIParamWithArgumentsE", cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.clang.sema/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/Sema/SemaOverload.cpp -nm=_ZN12_GLOBAL__N_121DFIParamWithArgumentsE") //</editor-fold> public class/*struct*/ DFIParamWithArguments extends /**/ DFIArguments { public PointerUnion3<TemplateTypeParmDecl /*P*/ , NonTypeTemplateParmDecl /*P*/ , TemplateTemplateParmDecl /*P*/ > Param; //<editor-fold defaultstate="collapsed" desc="(anonymous namespace)::DFIParamWithArguments::DFIParamWithArguments"> @Converted(kind = Converted.Kind.AUTO, source = "${LLVM_SRC}/llvm/tools/clang/lib/Sema/SemaOverload.cpp", line = 551, FQN="(anonymous namespace)::DFIParamWithArguments::DFIParamWithArguments", NM="_ZN12_GLOBAL__N_121DFIParamWithArgumentsC1Ev", cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.clang.sema/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/Sema/SemaOverload.cpp -nm=_ZN12_GLOBAL__N_121DFIParamWithArgumentsC1Ev") //</editor-fold> public /*inline*/ DFIParamWithArguments() { // : DFIArguments(), Param() //START JInit super(); this.Param = new PointerUnion3<TemplateTypeParmDecl /*P*/ , NonTypeTemplateParmDecl /*P*/ , TemplateTemplateParmDecl /*P*/ >(TemplateTypeParmDecl /*P*/.class); //END JInit } @Override public String toString() { return "" + "Param=" + Param // NOI18N + super.toString(); // NOI18N } }
[ "voskresensky.vladimir@gmail.com" ]
voskresensky.vladimir@gmail.com
802fe2e9cf9894b9587c015fa1791b23780cb755
99e44fc1db97c67c7ae8bde1c76d4612636a2319
/app/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
a8f2589fbc8ed6a6313fb67fe4a497d531fc0a3d
[ "MIT" ]
permissive
wossoneri/AOSPGallery4AS
add7c34b2901e3650d9b8518a02dd5953ba48cef
0be2c89f87e3d5bd0071036fe89d0a1d0d9db6df
refs/heads/master
2022-03-21T04:42:57.965745
2022-02-23T08:44:51
2022-02-23T08:44:51
113,425,141
3
2
MIT
2022-02-23T08:44:52
2017-12-07T08:45:41
Java
UTF-8
Java
false
false
6,070
java
/* * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java $ * $Revision: 658775 $ * $Date: 2008-05-21 10:30:45 -0700 (Wed, 21 May 2008) $ * * ==================================================================== * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.http.impl.conn; import java.io.IOException; import org.apache.http.HttpHost; import org.apache.http.params.HttpParams; import org.apache.http.protocol.HttpContext; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.OperatedClientConnection; /** * Abstract adapter from pool {@link AbstractPoolEntry entries} to * {@link org.apache.http.conn.ManagedClientConnection managed} * client connections. * The connection in the pool entry is used to initialize the base class. * In addition, methods to establish a route are delegated to the * pool entry. {@link #shutdown shutdown} and {@link #close close} * will clear the tracked route in the pool entry and call the * respective method of the wrapped connection. * * @author <a href="mailto:rolandw at apache.org">Roland Weber</a> * * * <!-- empty lines to avoid svn diff problems --> * @version $Revision: 658775 $ $Date: 2008-05-21 10:30:45 -0700 (Wed, 21 May 2008) $ * * @since 4.0 * * @deprecated Please use {@link java.net.URL#openConnection} instead. * Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a> * for further details. */ @Deprecated public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapter { /** The wrapped pool entry. */ protected volatile AbstractPoolEntry poolEntry; /** * Creates a new connection adapter. * * @param manager the connection manager * @param entry the pool entry for the connection being wrapped */ protected AbstractPooledConnAdapter(ClientConnectionManager manager, AbstractPoolEntry entry) { super(manager, entry.connection); this.poolEntry = entry; } /** * Asserts that this adapter is still attached. * * @throws IllegalStateException * if it is {@link #detach detach}ed */ protected final void assertAttached() { if (poolEntry == null) { throw new IllegalStateException("Adapter is detached."); } } /** * Detaches this adapter from the wrapped connection. * This adapter becomes useless. */ @Override protected void detach() { super.detach(); poolEntry = null; } // non-javadoc, see interface ManagedHttpConnection public HttpRoute getRoute() { assertAttached(); return (poolEntry.tracker == null) ? null : poolEntry.tracker.toRoute(); } // non-javadoc, see interface ManagedHttpConnection public void open(HttpRoute route, HttpContext context, HttpParams params) throws IOException { assertAttached(); poolEntry.open(route, context, params); } // non-javadoc, see interface ManagedHttpConnection public void tunnelTarget(boolean secure, HttpParams params) throws IOException { assertAttached(); poolEntry.tunnelTarget(secure, params); } // non-javadoc, see interface ManagedHttpConnection public void tunnelProxy(HttpHost next, boolean secure, HttpParams params) throws IOException { assertAttached(); poolEntry.tunnelProxy(next, secure, params); } // non-javadoc, see interface ManagedHttpConnection public void layerProtocol(HttpContext context, HttpParams params) throws IOException { assertAttached(); poolEntry.layerProtocol(context, params); } // non-javadoc, see interface HttpConnection public void close() throws IOException { if (poolEntry != null) poolEntry.shutdownEntry(); OperatedClientConnection conn = getWrappedConnection(); if (conn != null) { conn.close(); } } // non-javadoc, see interface HttpConnection public void shutdown() throws IOException { if (poolEntry != null) poolEntry.shutdownEntry(); OperatedClientConnection conn = getWrappedConnection(); if (conn != null) { conn.shutdown(); } } // non-javadoc, see interface ManagedClientConnection public Object getState() { assertAttached(); return poolEntry.getState(); } // non-javadoc, see interface ManagedClientConnection public void setState(final Object state) { assertAttached(); poolEntry.setState(state); } } // class AbstractPooledConnAdapter
[ "siyolatte@gmail.com" ]
siyolatte@gmail.com
e556e1d95d59f62cfaf660418eb6fc9d33c5fb30
13e4e5f56dc4421448ec19a2d142169fdd8f0328
/src/main/java/org/sikuli/ui/SlideEditView.java
5097f0f7900522507d468c9fe765bfb9285026b3
[]
no_license
doubleshow/sikuliguide
97a4f2b7c69b10c59e398b3de67f2150b809346a
1539bd2ac8f1fbee867d8494ed71490d9ee5a329
refs/heads/master
2021-01-23T13:44:05.617259
2011-08-09T03:16:59
2011-08-09T03:16:59
2,033,738
0
0
null
null
null
null
UTF-8
Java
false
false
649
java
package org.sikuli.ui; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class SlideEditView extends JPanel implements ChangeListener { protected SlideEditView(){ } private Slide slide; public Slide getSlide() { return slide; } public void setSlide(final Slide slide){ this.slide = slide; if (slide != null){ slide.addChangeListener(this); } refresh(); repaint(); } public void refresh(){ } public void stateChanged(ChangeEvent e) { refresh(); repaint(); validate(); } }
[ "doubleshow@gmail.com" ]
doubleshow@gmail.com
43972df7cb78ec9c6fb4a3689d2253b92e09e2e0
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_37560.java
f1f72f36e318f0d4d63b6654f0deeb89a71ad82e
[]
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
145
java
@Override protected InExRules<String,String,String> createRulesEngine(){ return new InExRules<>(InExRuleMatcher.WILDCARD_PATH_RULE_MATCHER); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
8c75c554f32e317adf5cacdb0974b94d4577e767
df0d105e3bc11190c9f75b68014356d631094710
/src/main/java/com/zj/study/algorithm/recursion/CombSumMain.java
ed748156018b52f72035c094b996b94fb936fec6
[]
no_license
zhaojian770627/javastudy
411109670f099be23142748e97346ccd62057c41
ca2613fbfc24bfc68254f3733b0d1409aecf3c94
refs/heads/master
2023-01-11T10:36:25.977810
2022-01-09T14:06:01
2022-01-09T14:06:01
162,666,475
0
0
null
2022-12-27T14:50:49
2018-12-21T04:40:01
Java
UTF-8
Java
false
false
1,218
java
package com.zj.study.algorithm.recursion; import java.util.ArrayList; import java.util.List; import java.util.Stack; public class CombSumMain { public static void main(String[] args) { CombSumMain main = new CombSumMain(); // main.subsets(3); main.combSum(new int[] { 2, 3, 6, 7 }, 20); } private void combSum(int[] ary, int sum) { Stack<Integer> stack = new Stack<>(); List<Integer[]> result = new ArrayList<>(); subsets_recursive_helper(result, stack, ary, sum, 0); System.out.print("["); for (Integer[] ss : result) { System.out.print("("); for (int s : ss) { System.out.print(s + " "); } System.out.print(") "); } System.out.print("]"); } // [() (a ) (a b ) (a b c ) (a c ) (b ) (b c ) (c ) ] // 每次从递归中退出,函数全部pop,而上一层还停留指定的位置 private void subsets_recursive_helper(List<Integer[]> result, Stack<Integer> queue, int[] ary, int remains, int i) { if (remains < 0) return; if (remains == 0) { result.add(queue.toArray(new Integer[] {})); } else for (int j = i; j < ary.length; j++) { queue.push(ary[j]); subsets_recursive_helper(result, queue, ary, remains - ary[j], j); queue.pop(); } } }
[ "zhaojian770627@163.com" ]
zhaojian770627@163.com
7534304915e9722c3009215e25fe86378453360a
dadca8dda7bb1bbf69a32a3fa237b59af120399a
/cat_conn/src/main/java/com/cgltech/cat_conn/dal/dao/mybatis/mapper/TicketCutMapper.java
d2dd1d3878632b96acf84d0f750ec2fc61f2f746
[]
no_license
lvywmqt/springboot
79a8c82671f3dd2599e8768305af3cedd29a2ac8
0b473cac7978cbd79fa868dd79a9238bd9f809f5
refs/heads/master
2021-07-02T07:25:30.802152
2019-04-02T02:49:58
2019-04-02T02:49:58
144,268,307
2
0
null
null
null
null
UTF-8
Java
false
false
682
java
package com.cgltech.cat_conn.dal.dao.mybatis.mapper; import java.io.Serializable; import java.util.List; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Repository; import com.cgltech.cat_conn.dal.dao.mybatis.CrudMapper; import com.cgltech.cat_conn.dal.entity.TicketCut; @Repository public interface TicketCutMapper<T extends Serializable> extends CrudMapper<T>{ TicketCut selectOne(String orderNo)throws DataAccessException; List<TicketCut>selectCompleteTicketCut()throws DataAccessException; List<TicketCut> selectUnResponseTicketCut() throws DataAccessException; void updateResponseStatus(TicketCut ticketCut); }
[ "you@example.com" ]
you@example.com
488f96c57cc14694d2405edbc4b53afebf765752
3785d3fdd6f673fe51c9db3cd80fa930bc89b26f
/handsomelibrary/src/main/java/com/example/handsomelibrary/utils/AppUtils.java
dc0d7f6b13a9c5a5739d9528881e91223ac2ddcf
[]
no_license
SetAdapter/HandsomeGuy
2f7781707e2012d4c416ff7a9f0d3d3387c3c5f3
b63bc8ccb4498a1ee7760c604e316771e4076be4
refs/heads/master
2020-03-11T23:26:54.900031
2018-06-14T06:57:12
2018-06-14T06:57:12
130,321,973
3
0
null
null
null
null
UTF-8
Java
false
false
4,482
java
package com.example.handsomelibrary.utils; import android.app.ActivityManager; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import java.util.List; import static android.content.Context.ACTIVITY_SERVICE; /** * App相关的辅助类 * Created by Stefan on 2018/4/24 14:43. */ public class AppUtils { private AppUtils() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } /** * 获取应用程序名称 */ public static String getAppName(Context context) { try { PackageManager packageManager = context.getPackageManager(); PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); int labelRes = packageInfo.applicationInfo.labelRes; return context.getResources().getString(labelRes); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } return null; } /** * 获取当前应用的版本号 versionCode * * @param context * @return */ public static int getVersionCode(Context context) { PackageInfo info = null; try { info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); return 1; } return info.versionCode; } /** * 获取当前应用的版本名称 versionName * * @param context * @return */ public static String getVersionName(Context context) { PackageManager packageManager = context.getPackageManager(); PackageInfo packageInfo = null; try { packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); return "0.0.0"; } return packageInfo.versionName; } /** * 获取当前应用的 包名 * * @param context * @return */ public static String getLocalPackageName(Context context) { PackageManager packageManager = context.getPackageManager(); PackageInfo info = null; try { info = packageManager.getPackageInfo(context.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); return "获取失败"; } return info.packageName; } /** * 当前的包是否存在 * * @param context * @param pckName * @return */ public static boolean isPackageExist(Context context, String pckName) { try { PackageManager packageManager = context.getPackageManager(); PackageInfo pckInfo = packageManager.getPackageInfo(pckName, 0); if (null != pckInfo) return true; } catch (PackageManager.NameNotFoundException e) { L.e("TDvice", e.getMessage()); } return false; } /** * 判断app是否在前台还是在后台运行 * * @param context * @return */ public static boolean isBackground(Context context) { ActivityManager activityManager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE); List<ActivityManager.RunningAppProcessInfo> appProcesses = activityManager.getRunningAppProcesses(); for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) { if (appProcess.processName.equals(context.getPackageName())) { /* BACKGROUND=400 EMPTY=500 FOREGROUND=100 GONE=1000 PERCEPTIBLE=130 SERVICE=300 ISIBLE=200 */ L.i(context.getPackageName(), "此appimportace =" + appProcess.importance + ",context.getClass().getName()=" + context.getClass().getName()); if (appProcess.importance != ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) { L.i(context.getPackageName(), "处于后台" + appProcess.processName); return true; } else { L.i(context.getPackageName(), "处于前台" + appProcess.processName); return false; } } } return false; } }
[ "383411934@qq.com" ]
383411934@qq.com
e31ee9e8ca7c91b53afcae30063b2c9ffb6a426f
e41154fbbe6627197f4f9f9269f64f8c5f9b011d
/app/src/main/java/com/ymt/sgr/kitchen/ui/adapter/ListDropDownAdapter.java
3af20c730481fbbb570d2999a139a0bcd9915fc0
[]
no_license
514721857/Kitchen
46773322b46ff1b973f4bdfadec1746a02a7125c
2317fc8887486215878ccc29142253046da59782
refs/heads/master
2020-03-28T22:33:06.607428
2018-12-06T14:31:31
2018-12-06T14:31:31
149,241,348
0
0
null
null
null
null
UTF-8
Java
false
false
2,334
java
package com.ymt.sgr.kitchen.ui.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.ymt.sgr.kitchen.R; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; public class ListDropDownAdapter extends BaseAdapter { private Context context; private List<String> list; private int checkItemPosition = 0; public void setCheckItem(int position) { checkItemPosition = position; notifyDataSetChanged(); } public ListDropDownAdapter(Context context, List<String> list) { this.context = context; this.list = list; } @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView != null) { viewHolder = (ViewHolder) convertView.getTag(); } else { convertView = LayoutInflater.from(context).inflate(R.layout.item_default_drop_down, null); viewHolder = new ViewHolder(convertView); convertView.setTag(viewHolder); } fillValue(position, viewHolder); return convertView; } private void fillValue(int position, ViewHolder viewHolder) { viewHolder.mText.setText(list.get(position)); if (checkItemPosition != -1) { if (checkItemPosition == position) { viewHolder.mText.setTextColor(context.getResources().getColor(R.color.drop_down_selected)); viewHolder.mText.setBackgroundResource(R.color.check_bg); } else { viewHolder.mText.setTextColor(context.getResources().getColor(R.color.drop_down_unselected)); viewHolder.mText.setBackgroundResource(R.color.white); } } } static class ViewHolder { @BindView(R.id.text) TextView mText; ViewHolder(View view) { ButterKnife.bind(this, view); } } }
[ "2090161812@qq.com" ]
2090161812@qq.com
a792396d4ae415de9d0f7ff62467d65b93bc1ce5
c87fa48cb71f76bbcfb406e53177c16219aae4cb
/Datasets/Dataset1/Java/1263.java
0b31bceb793ae41e3342d7cc156c68a55a3e21d0
[]
no_license
mrezende/CodRep-competition
b4a49b7b9f22a9bfe3bfff4fd076c166da3d0f16
aae413ca563ae3cc3fde3b105809dd4111800521
refs/heads/master
2021-07-24T16:08:57.416020
2019-01-08T23:37:00
2019-01-08T23:37:00
135,821,155
0
0
null
2018-12-18T22:07:11
2018-06-02T13:45:09
null
UTF-8
Java
false
false
1,442
java
/* Derby - Class org.apache.derbyTesting.functionTests.tests.largedata.LobLimitsClientTest Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.derbyTesting.functionTests.tests.largedata; import org.apache.derbyTesting.junit.TestConfiguration; import junit.framework.Test; /** * LobLimitsClientTest runs the large lob limits test for the * client. It is separated from LobLimitsTest because the * test takes so long that it is convenient to run it separately * */ public class LobLimitsClientTest extends LobLimitsTest { public LobLimitsClientTest(String name) { super(name); } public static Test suite() { return (TestConfiguration.clientServerDecorator(LobLimitsTest.suite())); } }
[ "rezende.martins@gmail.com" ]
rezende.martins@gmail.com
632d02d1d5951b7b3d75b4c51152669accc58c9f
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1119_public/tests/unittests/src/java/module1119_public_tests_unittests/a/Foo3.java
e7c4df56a7ba0ddb6debe00e7e320bbd4e7e8015
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,680
java
package module1119_public_tests_unittests.a; import java.util.zip.*; import javax.annotation.processing.*; import javax.lang.model.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.awt.datatransfer.DataFlavor * @see java.beans.beancontext.BeanContext * @see java.io.File */ @SuppressWarnings("all") public abstract class Foo3<R> extends module1119_public_tests_unittests.a.Foo2<R> implements module1119_public_tests_unittests.a.IFoo3<R> { java.rmi.Remote f0 = null; java.nio.file.FileStore f1 = null; java.sql.Array f2 = null; public R element; public static Foo3 instance; public static Foo3 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module1119_public_tests_unittests.a.Foo2.create(input); } public String getName() { return module1119_public_tests_unittests.a.Foo2.getInstance().getName(); } public void setName(String string) { module1119_public_tests_unittests.a.Foo2.getInstance().setName(getName()); return; } public R get() { return (R)module1119_public_tests_unittests.a.Foo2.getInstance().get(); } public void set(Object element) { this.element = (R)element; module1119_public_tests_unittests.a.Foo2.getInstance().set(this.element); } public R call() throws Exception { return (R)module1119_public_tests_unittests.a.Foo2.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
c14c5223dc0b2ac46d5c77569f0f84418059271e
aede85516075ed24429079969ff889db611ee2ab
/app/src/main/java/com/dogvip/giannis/dogviprefactored/services/jobs/SyncLocalUserRolesAndPetsJob.java
de51524d2e2d7da9e57bddf6cf0565a76d5b5993
[]
no_license
tsironis13/DogVIPRefactored
df67b77b077c2dfec214cc616abd015522fe6002
30873a402c6f982bec0334ca81df382a6ce562d7
refs/heads/master
2021-08-30T10:03:48.233731
2017-12-17T11:43:39
2017-12-17T11:43:39
112,445,261
0
0
null
null
null
null
UTF-8
Java
false
false
5,760
java
package com.dogvip.giannis.dogviprefactored.services.jobs; import android.util.Log; import com.dogvip.giannis.dogviprefactored.config.AppConfig; import com.dogvip.giannis.dogviprefactored.pojo.BaseRequest; import com.dogvip.giannis.dogviprefactored.pojo.sync.SyncUserRolesAndPetsResponse; import com.dogvip.giannis.dogviprefactored.retrofit.ServiceAPI; import com.dogvip.giannis.dogviprefactored.roompersistencedata.DogVipRoomDatabase; import com.dogvip.giannis.dogviprefactored.roompersistencedata.entities.UserRole; import com.dogvip.giannis.dogviprefactored.utilities.errorhandling.RetryWithDelay; import com.firebase.jobdispatcher.JobParameters; import com.firebase.jobdispatcher.JobService; import java.util.List; import javax.inject.Inject; import dagger.android.AndroidInjection; import io.reactivex.Completable; import io.reactivex.schedulers.Schedulers; /** * Created by giannis on 7/12/2017. */ public class SyncLocalUserRolesAndPetsJob extends JobService { private static final String debugTag = SyncLocalUserRolesAndPetsJob.class.getSimpleName(); @Inject ServiceAPI mServiceAPI; @Inject BaseRequest mBaseRequest; @Inject DogVipRoomDatabase dogVipRoomDatabase; @Inject RetryWithDelay retryWithDelay; @Override public void onCreate() { AndroidInjection.inject(this); super.onCreate(); } @Override public boolean onStartJob(JobParameters job) { Log.e(debugTag, "SyncLocalUserRolesAndPetsJob onStartJob"); mBaseRequest.setAction("sync_user_roles_pets"); mBaseRequest.setAuthtoken(job.getExtras().getString("auth_token")); mServiceAPI .syncUserRolesAndPets(mBaseRequest) .subscribeOn(Schedulers.io()) .retryWhen(configureRetryWithDelayParams(3, 2000)) .subscribe(response -> { if (response.getCode() == AppConfig.STATUS_OK) { syncLocalUserRolesAndPets(response.getUserRolesPets()) .subscribeOn(Schedulers.io()) .subscribe(() -> { Log.e(debugTag, "SyncLocalUserRolesAndPetsJob successfully finished"); jobFinished(job, false); // dogVipRoomDatabase.stateEntityDao().get().subscribe(stateEntities -> { // for (UserData stateEntity: stateEntities) { // Log.e(debugTag, "ID: "+stateEntity.getId() + " UPDATE: "+stateEntity.getUpdated_at()); // } // }); // dogVipRoomDatabase.userRoleDao().getUserRoles().subscribe(userRoles -> { // for (UserRole userRole: userRoles) { // Log.e(debugTag, "ID: "+userRole.getId() + " NAME: "+userRole.getName() + " SURNAME: "+userRole.getSurname()); // } // }); // dogVipRoomDatabase.petDao().getAllPets().subscribe(pets -> { // for (Pet pet: pets) { // Log.e(debugTag, "ID: "+pet.getP_id() + " NAME: "+pet.getP_name() + " race: "+pet.getRace()); // } // }); }, onError -> { Log.e(debugTag, "job finished with error, reschedule it"); jobFinished(job, true); }); } else { jobFinished(job, true); } }, onError -> jobFinished(job, true)); jobFinished(job, false); return true; } /* Called when the scheduling engine has decided to interrupt the execution of a running job, most * likely because the runtime constraints associated with the job are no longer satisfied. The job * must stop execution * */ @Override public boolean onStopJob(JobParameters job) { Log.e(debugTag, "onEndJob"); return true; } private Completable syncLocalUserRolesAndPets(SyncUserRolesAndPetsResponse userRolesAndPets) { return Completable.fromAction(() -> { // Log.e(debugTag, dogVipRoomDatabase + " "); dogVipRoomDatabase.stateEntityDao().updateUserStateEntity(System.currentTimeMillis()/1000L, new int[]{1,2,3}); dogVipRoomDatabase.userRoleDao().deleteAllUserRoles(); if (!userRolesAndPets.getUserRoles().isEmpty()) { List<Long> rows = dogVipRoomDatabase .userRoleDao() .insertUserRoles(userRolesAndPets.getUserRoles()); if (!rows.isEmpty()) { dogVipRoomDatabase .petDao() .insertPet(userRolesAndPets.getOwnerPets()); } } }); } private RetryWithDelay configureRetryWithDelayParams(int maxRetries, int retryDelayMillis) { retryWithDelay.setMaxRetries(maxRetries); retryWithDelay.setRetryDelayMillis(retryDelayMillis); return retryWithDelay; } }
[ "gtsironis8@gmail.com" ]
gtsironis8@gmail.com
220d42213f5ff05322a7e84eabdc659cdc77ea45
32fa97c2dc55cd48a181d962b4b1efb4b2466dc0
/src/com/android/bluetooth/gatt/PeriodicScanManager.java
8101afce3bc2d40877557b9f2c39750c391662eb
[]
no_license
Ankits-lab/packages_apps_Bluetooth
511d325f93d1fa7bace1982ffab11423b17551ce
5d0ed4858a8b35023520e01c3685bd007df04809
refs/heads/main
2023-01-09T21:58:07.263321
2020-11-14T09:26:42
2020-11-14T09:26:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,981
java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.bluetooth.gatt; import android.bluetooth.le.IPeriodicAdvertisingCallback; import android.bluetooth.le.PeriodicAdvertisingReport; import android.bluetooth.le.ScanRecord; import android.bluetooth.le.ScanResult; import android.os.IBinder; import android.os.IInterface; import android.os.RemoteException; import android.util.Log; import com.android.bluetooth.btservice.AdapterService; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * Manages Bluetooth LE Periodic scans * * @hide */ class PeriodicScanManager { private static final boolean DBG = GattServiceConfig.DBG; private static final String TAG = GattServiceConfig.TAG_PREFIX + "SyncManager"; private final AdapterService mAdapterService; Map<IBinder, SyncInfo> mSyncs = Collections.synchronizedMap(new HashMap<>()); static int sTempRegistrationId = -1; /** * Constructor of {@link SyncManager}. */ PeriodicScanManager(AdapterService adapterService) { if (DBG) { Log.d(TAG, "advertise manager created"); } mAdapterService = adapterService; } void start() { initializeNative(); } void cleanup() { if (DBG) { Log.d(TAG, "cleanup()"); } cleanupNative(); mSyncs.clear(); sTempRegistrationId = -1; } class SyncInfo { /* When id is negative, the registration is ongoing. When the registration finishes, id * becomes equal to sync_handle */ public Integer id; public SyncDeathRecipient deathRecipient; public IPeriodicAdvertisingCallback callback; SyncInfo(Integer id, SyncDeathRecipient deathRecipient, IPeriodicAdvertisingCallback callback) { this.id = id; this.deathRecipient = deathRecipient; this.callback = callback; } } IBinder toBinder(IPeriodicAdvertisingCallback e) { return ((IInterface) e).asBinder(); } class SyncDeathRecipient implements IBinder.DeathRecipient { public IPeriodicAdvertisingCallback callback; SyncDeathRecipient(IPeriodicAdvertisingCallback callback) { this.callback = callback; } @Override public void binderDied() { if (DBG) { Log.d(TAG, "Binder is dead - unregistering advertising set"); } stopSync(callback); } } Map.Entry<IBinder, SyncInfo> findSync(int syncHandle) { Map.Entry<IBinder, SyncInfo> entry = null; for (Map.Entry<IBinder, SyncInfo> e : mSyncs.entrySet()) { if (e.getValue().id == syncHandle) { entry = e; break; } } return entry; } void onSyncStarted(int regId, int syncHandle, int sid, int addressType, String address, int phy, int interval, int status) throws Exception { if (DBG) { Log.d(TAG, "onSyncStarted() - regId=" + regId + ", syncHandle=" + syncHandle + ", status=" + status); } Map.Entry<IBinder, SyncInfo> entry = findSync(regId); if (entry == null) { Log.i(TAG, "onSyncStarted() - no callback found for regId " + regId); // Sync was stopped before it was properly registered. stopSyncNative(syncHandle); return; } IPeriodicAdvertisingCallback callback = entry.getValue().callback; if (status == 0) { entry.setValue(new SyncInfo(syncHandle, entry.getValue().deathRecipient, callback)); } else { IBinder binder = entry.getKey(); binder.unlinkToDeath(entry.getValue().deathRecipient, 0); mSyncs.remove(binder); } // TODO: fix callback arguments // callback.onSyncStarted(syncHandle, tx_power, status); } void onSyncReport(int syncHandle, int txPower, int rssi, int dataStatus, byte[] data) throws Exception { if (DBG) { Log.d(TAG, "onSyncReport() - syncHandle=" + syncHandle); } Map.Entry<IBinder, SyncInfo> entry = findSync(syncHandle); if (entry == null) { Log.i(TAG, "onSyncReport() - no callback found for syncHandle " + syncHandle); return; } IPeriodicAdvertisingCallback callback = entry.getValue().callback; PeriodicAdvertisingReport report = new PeriodicAdvertisingReport(syncHandle, txPower, rssi, dataStatus, ScanRecord.parseFromBytes(data)); callback.onPeriodicAdvertisingReport(report); } void onSyncLost(int syncHandle) throws Exception { if (DBG) { Log.d(TAG, "onSyncLost() - syncHandle=" + syncHandle); } Map.Entry<IBinder, SyncInfo> entry = findSync(syncHandle); if (entry == null) { Log.i(TAG, "onSyncLost() - no callback found for syncHandle " + syncHandle); return; } IPeriodicAdvertisingCallback callback = entry.getValue().callback; mSyncs.remove(entry); callback.onSyncLost(syncHandle); } void startSync(ScanResult scanResult, int skip, int timeout, IPeriodicAdvertisingCallback callback) { SyncDeathRecipient deathRecipient = new SyncDeathRecipient(callback); IBinder binder = toBinder(callback); try { binder.linkToDeath(deathRecipient, 0); } catch (RemoteException e) { throw new IllegalArgumentException("Can't link to periodic scanner death"); } String address = scanResult.getDevice().getAddress(); int sid = scanResult.getAdvertisingSid(); int cbId = --sTempRegistrationId; mSyncs.put(binder, new SyncInfo(cbId, deathRecipient, callback)); if (DBG) { Log.d(TAG, "startSync() - reg_id=" + cbId + ", callback: " + binder); } startSyncNative(sid, address, skip, timeout, cbId); } void stopSync(IPeriodicAdvertisingCallback callback) { IBinder binder = toBinder(callback); if (DBG) { Log.d(TAG, "stopSync() " + binder); } SyncInfo sync = mSyncs.remove(binder); if (sync == null) { Log.e(TAG, "stopSync() - no client found for callback"); return; } Integer syncHandle = sync.id; binder.unlinkToDeath(sync.deathRecipient, 0); if (syncHandle < 0) { Log.i(TAG, "stopSync() - not finished registration yet"); // Sync will be freed once initiated in onSyncStarted() return; } stopSyncNative(syncHandle); } static { classInitNative(); } private static native void classInitNative(); private native void initializeNative(); private native void cleanupNative(); private native void startSyncNative(int sid, String address, int skip, int timeout, int regId); private native void stopSyncNative(int syncHandle); }
[ "keneankit01@gmail.com" ]
keneankit01@gmail.com
03f2bb2e47a87a7cf7a0eac1fb3faea895351ba8
3aedf39fce77aa36eee9d675bf1ed786e15f3b1c
/src/main/java/animals/Deplacer.java
e9acca8c5f7500206f3095d134e77e3a285c9eb3
[]
no_license
Pierre-AntoineCAYLA/maven
2a2a2d7a10a4c27a7afcf390b416c6bf212cb4c9
a3e039059e417c90948e9530bf84c6074b394b8c
refs/heads/master
2020-03-10T07:42:23.727491
2018-04-12T15:06:22
2018-04-12T15:06:22
129,268,865
0
0
null
null
null
null
ISO-8859-2
Java
false
false
249
java
package animals; public enum Deplacer { //donnes les possibilités de déplacements COURIR(1, "Courir"), MARCHER(2, "Marcher"), SAUTER(3, "Sauter"); int code; String label; Deplacer(int id, String value) { code = id; label = value; } }
[ "you@example.com" ]
you@example.com
d9ba872ac4b0e4291010f713a62c38510eaba8b8
8e069c3fec6dc64cfa741daf6fe63212cc0be6fc
/src/p045_sol1.java
be7c573cde0ca21ab253faf1559d812116643fce
[]
no_license
hpplayer/LeetCode
81b9651d6ebf53287b1f27241be211add3e3bc8a
527df4581439cbfa52ac17c96f56b0447f87c3f0
refs/heads/master
2020-05-16T21:33:20.991009
2015-11-01T03:55:10
2015-11-01T03:55:10
31,480,577
0
1
null
null
null
null
UTF-8
Java
false
false
3,208
java
/* Jump Game II Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. For example: Given array A = [2,3,1,1,4] The minimum number of jumps to reach the last index is 2. (Jump 1 step from index 0 to 1, then 3 steps to the last index.) */ /** * This is my solution will cause LTE error * Why? * In my solution, I will scan all cells within the range indicated by the value in the cell * then i will jump to that cell and start next scan. * * Since we will scan the subarray in each scan, if initial values are very large, then we will scan a lot of same subarrays. * Like: * [6,5,4,3,2,1, 1,1,1,1,1] * For index 0, we will scan 6 cells, then found index 1 is largest * then we will scan index 1, we will scan 5 cells, which already been scanned in last step * then found index 2 is largest... * * Actually, when we found 5 is largest, we should directly jump to index 0 + 1 + 5, 1 is the index of largest cell, 5 is the value in that cell * * Besides, we can't always take the largest cell and use full of the value, ex: * [5, 4, 1, 3, 0, 0, 0] * if we use index=1, and take 4 steps away * then we will reach index=5, which is actually 0 * Our correct way is take index1, but use half of it to reach index[4], which gives 3, * then we use 3 there. So, this problem is actually not easy as it may looks like * * Remark: * The greedy selection of values in cell may not return the longest jump * We also need to consider about the index * In other words, the longest jump is composed of the index itself + the value in this cell * My solution does not consider this sum * In sol2, we calculate the longest jump based on index and value, and we always pick the * longest jump in each range, so it is greedy in this way, though it may not so "greedy" as my algorithm is * * In sol2 and sol3, we both search the array range by range to avoid repeat scan * Sol2 provides a BFS solution with is very decent * Sol3 uses a similar idea but different implementation * Both sol2 and sol3 are O(n) time complexity algorithm and O(1) space complexity * Sol2 is more understandable, so sol2 is more recommended * * @author hpPlayer * @date Sep 2, 2015 2:50:36 PM */ public class p045_sol1 { public static void main(String[] args){ int nums[] = {1,2,0,1}; System.out.println(new p045_sol1().jump(nums)); } public int jump(int[] nums) { int step = 0, index = 0; while(index < nums.length - 1){ int max = 0; int i =1; int move = 1; for(; i <= nums[index] && (index + i) < nums.length; i++){ if((index + i) >= nums.length - 1) return step + 1; max = Math.max(max, nums[index + i]); if(nums[index + i] == max){ move = i; } } //System.out.println(max); //System.out.println(move); //System.out.println(max + i); index += max + move;//1 for next index step += 2; } return step; } }
[ "hpplayer@live.cn" ]
hpplayer@live.cn
4110a127f1334edeb69d04cd99de8cf62c1453e2
ffbe549bb245a140ff86ba8213723cc7e803ca68
/src/main/java/de/origindd/mpeg/mpeg7/_2004/PartitionType.java
ed6aafc8199951f5963cf01000874cbf5b5622de
[]
no_license
OriginDD/mpeg-7-extractor
43259f3a1b0dea1cc204395039e6221624599717
c7c1cb5e9d7d09286ff95e1e4baa8dff9a0483bb
refs/heads/master
2021-01-17T09:58:54.051776
2017-03-17T06:46:25
2017-03-17T06:46:25
83,997,792
0
0
null
null
null
null
UTF-8
Java
false
false
4,681
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.01.12 at 06:39:36 PM BRST // package de.origindd.mpeg.mpeg7._2004; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PartitionType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PartitionType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Origin" type="{urn:mpeg:mpeg7:schema:2004}SignalPlaneOriginType" minOccurs="0"/> * &lt;element name="Start" type="{urn:mpeg:mpeg7:schema:2004}SignalPlaneType"/> * &lt;choice> * &lt;element name="End" type="{urn:mpeg:mpeg7:schema:2004}SignalPlaneType"/> * &lt;element name="Extent" type="{urn:mpeg:mpeg7:schema:2004}SignalPlaneType"/> * &lt;/choice> * &lt;/sequence> * &lt;attribute name="dim"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}positiveInteger"> * &lt;maxInclusive value="4"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PartitionType", propOrder = { "origin", "start", "end", "extent" }) public class PartitionType { @XmlElement(name = "Origin") protected SignalPlaneOriginType origin; @XmlElement(name = "Start", required = true) protected SignalPlaneType start; @XmlElement(name = "End") protected SignalPlaneType end; @XmlElement(name = "Extent") protected SignalPlaneType extent; @XmlAttribute(name = "dim") protected Integer dim; /** * Gets the value of the origin property. * * @return * possible object is * {@link SignalPlaneOriginType } * */ public SignalPlaneOriginType getOrigin() { return origin; } /** * Sets the value of the origin property. * * @param value * allowed object is * {@link SignalPlaneOriginType } * */ public void setOrigin(SignalPlaneOriginType value) { this.origin = value; } /** * Gets the value of the start property. * * @return * possible object is * {@link SignalPlaneType } * */ public SignalPlaneType getStart() { return start; } /** * Sets the value of the start property. * * @param value * allowed object is * {@link SignalPlaneType } * */ public void setStart(SignalPlaneType value) { this.start = value; } /** * Gets the value of the end property. * * @return * possible object is * {@link SignalPlaneType } * */ public SignalPlaneType getEnd() { return end; } /** * Sets the value of the end property. * * @param value * allowed object is * {@link SignalPlaneType } * */ public void setEnd(SignalPlaneType value) { this.end = value; } /** * Gets the value of the extent property. * * @return * possible object is * {@link SignalPlaneType } * */ public SignalPlaneType getExtent() { return extent; } /** * Sets the value of the extent property. * * @param value * allowed object is * {@link SignalPlaneType } * */ public void setExtent(SignalPlaneType value) { this.extent = value; } /** * Gets the value of the dim property. * * @return * possible object is * {@link Integer } * */ public Integer getDim() { return dim; } /** * Sets the value of the dim property. * * @param value * allowed object is * {@link Integer } * */ public void setDim(Integer value) { this.dim = value; } }
[ "ulrich.kowohl@zalando.de" ]
ulrich.kowohl@zalando.de
45a9a9a46bc772bd4317854cbb31c01bb8002376
b85d0ce8280cff639a80de8bf35e2ad110ac7e16
/com/fossil/dgs.java
ba9bca404b27012c71e992f758bbf2a26beb3a3e
[]
no_license
MathiasMonstrey/fosil_decompiled
3d90433663db67efdc93775145afc0f4a3dd150c
667c5eea80c829164220222e8fa64bf7185c9aae
refs/heads/master
2020-03-19T12:18:30.615455
2018-06-07T17:26:09
2018-06-07T17:26:09
136,509,743
1
0
null
null
null
null
UTF-8
Java
false
false
622
java
package com.fossil; import com.portfolio.platform.enums.Unit; public final /* synthetic */ class dgs { public static final /* synthetic */ int[] cEQ = new int[Unit.values().length]; public static final /* synthetic */ int[] cTK = new int[Unit.values().length]; public static final /* synthetic */ int[] cTL = new int[Unit.values().length]; static { cEQ[Unit.IMPERIAL.ordinal()] = 1; cEQ[Unit.METRIC.ordinal()] = 2; cTK[Unit.IMPERIAL.ordinal()] = 1; cTK[Unit.METRIC.ordinal()] = 2; cTL[Unit.IMPERIAL.ordinal()] = 1; cTL[Unit.METRIC.ordinal()] = 2; } }
[ "me@mathiasmonstrey.be" ]
me@mathiasmonstrey.be
26d4f5be5522bc315030ef7a8166f61737f0407d
04b1803adb6653ecb7cb827c4f4aa616afacf629
/third_party/android_29_sdk/public/sources/android-29/java/util/IllegalFormatCodePointException.java
02add44947690e11bca3db6025943e1226dcdb23
[ "Apache-2.0", "LGPL-2.0-or-later", "GPL-1.0-or-later", "MIT", "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
Java
false
false
2,388
java
/* * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.util; /** * Unchecked exception thrown when a character with an invalid Unicode code * point as defined by {@link Character#isValidCodePoint} is passed to the * {@link Formatter}. * * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any * method or constructor in this class will cause a {@link * NullPointerException} to be thrown. * * @since 1.5 */ public class IllegalFormatCodePointException extends IllegalFormatException { private static final long serialVersionUID = 19080630L; private int c; /** * Constructs an instance of this class with the specified illegal code * point as defined by {@link Character#isValidCodePoint}. * * @param c * The illegal Unicode code point */ public IllegalFormatCodePointException(int c) { this.c = c; } /** * Returns the illegal code point as defined by {@link * Character#isValidCodePoint}. * * @return The illegal Unicode code point */ public int getCodePoint() { return c; } public String getMessage() { return String.format("Code point = %#x", c); } }
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
1003750972b0800516449861edadff7a08024a6a
9eb3d46bd07c90b0e481f40ee848b2404900fd49
/collectionTest/src/basic/Lotto.java
493419eb17d059a985b521a27846c8f054a88cc6
[]
no_license
so0487/HighJava
b32a66e7d681808484f29552e703e2c5e6e6097c
d2a3ee667e23ce6876742dd40ed85992f6a8f62c
refs/heads/main
2023-02-06T07:35:24.740381
2020-12-26T05:36:44
2020-12-26T05:36:44
311,550,702
0
0
null
null
null
null
UTF-8
Java
false
false
2,226
java
package basic; import java.util.HashSet; import java.util.InputMismatchException; import java.util.Scanner; public class Lotto { public static void main(String[] args) { Lotto lot= new Lotto(); lot.lottoStart(); } public void lottoStart(){ while(true){ System.out.println("======================"); System.out.println("Lotto프로그램"); System.out.println("--------------"); System.out.println("1.Lotto 구입"); System.out.println("2.프로그램종료"); System.out.println("======================"); Scanner sc = new Scanner(System.in); int input = 0; try { System.out.print("메뉴선택 : " ); input = sc.nextInt(); } catch (InputMismatchException e) { System.out.println("잘못입력하셨습니다"); continue; } int result = input; switch (result) { case 1: lottoBuy(); break; case 2: System.out.println("감사합니다"); System.exit(0); break; default: System.out.println("다시입력해주세요^^"); } } } //로또 구입매서드 public void lottoBuy(){ //while(true){ Scanner sc = new Scanner(System.in); int input = 0; System.out.println("로또한장의 금액은 1000원입니다."); System.out.println("금액을 입력해주세요"); try { input = sc.nextInt(); } catch (InputMismatchException e) { System.out.println("숫자만 입력해주세요^^"); } if(input < 1000){ System.out.println("입력금액이 너무 적습니다 로또구매실패!!!"); //break; }else if(input > 100000){ System.out.println("입력금액이 너무 많습니다 로또 구매실패!!!"); //break; } else{ lottoNum(input); } //} } //로또 번호 출력 메서드 public void lottoNum(int input){ System.out.println("행운의 로또 번호는 아래와 같습니다."); for (int i = 0; i < input/1000; i++) { HashSet<Integer> lotto = new HashSet<>(); while(lotto.size()<6){ lotto.add((int)(Math.random()*45+1)); } System.out.println("로또번호" +(i+1)+"는"+lotto); } System.out.println(); System.out.println("받은 금액은"+input + "거스름돈은"+input%1000+"입니다."); } }
[ "so04876725@gmail.com" ]
so04876725@gmail.com
4e6cebb1a4eab84a3d5e04ce3eb5391d1189be01
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project12/src/main/java/org/gradle/test/performance12_2/Production12_178.java
3175538637f184d572061479d53be5679c540814
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
303
java
package org.gradle.test.performance12_2; public class Production12_178 extends org.gradle.test.performance7_2.Production7_178 { private final String property; public Production12_178() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
12072e46042a21fb311c29dbd74b594f6e6feb05
f05e5a792ecb1f878636de1959c847c506ccda73
/spring-workspace/global-pay/src/test/java/kr/kro/globalpay/currency/CurrencyDAOTest.java
f5154b459160493cf84408e2a2887eb331f71561
[]
no_license
hennylee/Hana-Global-Pay
3569263f40243fbe8076b2269bf40a8138262f4a
6de8b818cebe9559c204c0161aa6926abf11586b
refs/heads/master
2023-07-31T10:20:32.859191
2021-10-06T08:10:57
2021-10-06T08:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,340
java
package kr.kro.globalpay.currency; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import kr.kro.globalpay.Configure; import kr.kro.globalpay.card.dao.CardDAO; import kr.kro.globalpay.card.vo.CardBalanceVO; import kr.kro.globalpay.currency.dao.CurrencyDAO; import kr.kro.globalpay.currency.service.CurrencyService; import kr.kro.globalpay.currency.vo.ExchangeRateVO; import kr.kro.globalpay.currency.vo.NationCodeVO; import kr.kro.globalpay.currency.vo.OpenbankAccountVO; import kr.kro.globalpay.shopping.vo.RegisterAlarmVO; public class CurrencyDAOTest extends Configure{ @Autowired private CurrencyDAO dao; @Autowired private CardDAO cardDao; @Autowired private CurrencyService service; @Ignore @Test public void 전체국가코드조회Test() throws Exception { List<NationCodeVO> list = service.nationAll(); for(NationCodeVO vo : list) { System.out.println(vo); } } @Ignore @Test public void 국가별환율조회Test() throws Exception { String nation = "USD"; List<ExchangeRateVO> list = dao.findCurrencyByNation(nation); for(ExchangeRateVO vo : list) { System.out.println(vo); } } @Ignore @Test public void 오픈뱅킹_잔액변경_테스트() throws Exception { OpenbankAccountVO account = new OpenbankAccountVO(); account.setBalance(50); account.setAccountBank("카카오"); account.setAccountNum("12121-12-1211212"); dao.updateAccountBalance(account); } @Ignore @Test public void 카드_잔액변경_테스트() throws Exception { CardBalanceVO card = new CardBalanceVO(); card.setBalance(50); card.setCardNo("1235"); card.setCurrencyEn("USD"); dao.updateCardBalance(card); } @Ignore @Test public void 카드_외화별_잔액조회() throws Exception { Map<String, String> map = new HashMap<String, String>(); map.put("cardNo", "1235"); map.put("currencyEn", "USD"); double d = cardDao.findOneBalance(map); System.out.println(d); } // @Ignore @Test public void 알람_리스트조회() throws Exception { List<RegisterAlarmVO> list = dao.alarmTarget( 1328.00, "EUR"); for(RegisterAlarmVO vo : list) { System.out.println(vo.getMemberVO().getPhone()); } } }
[ "haenyilee@kakao.com" ]
haenyilee@kakao.com
5ede882e839c9800c1857fd178a7b60766426530
2fd1b33dd3110777e9b41ee1371daf12a749a9ee
/Chap4/Generate_Random_LowerCaseNumber.java
14e530ec2af048c637163db7827bb76170ac7fd9
[]
no_license
HULLZHU/eclipse-workspace
04c474c3cdfdfc79567342974ef04c037e684fae
3989116abd9a994336e649af11650761693e92c3
refs/heads/master
2021-06-09T18:34:17.479825
2019-11-05T20:39:05
2019-11-05T20:39:05
145,763,364
1
0
null
null
null
null
GB18030
Java
false
false
555
java
public class Generate_Random_LowerCaseNumber { public static void main(String[] args) { System.out.println("Now a random lowercase letter will be shown"); int rand_1 = (int) Math.floor(26*Math.random()); //随机数1的取值范围是0-25共26个数 int rand_2 = 97 + rand_1; //随机数2的取值范围是97-122共26个数 char rand_Letter = (char) rand_2; //将随机数2由numerical转换为character System.out.println(rand_Letter); System.out.println((char)65); // TODO Auto-generated method stub } }
[ "42597991+HULLZHU@users.noreply.github.com" ]
42597991+HULLZHU@users.noreply.github.com
2cd4c7cd2f1cdab812cc217fb167a5ef068a317e
a73dfb319f28cc1ff8aac4bb8721157638253878
/work/09_ecai/lotteryServer/src/main/java/lottery/domains/pool/payment/lepay/request/FCSOpenApiTradeRecordRequest.java
3652b85000971f56d4057240944962e7e41df704
[]
no_license
xxsheng/JavaTest
63da06d3db5384644ff290d10eed2d1027b613f5
cd3364302734501234c450e4a498eabce0b89efb
refs/heads/master
2021-10-19T06:21:02.472764
2019-02-18T15:17:19
2019-02-18T15:17:19
160,063,042
2
0
null
null
null
null
UTF-8
Java
false
false
686
java
package lottery.domains.pool.payment.lepay.request; import java.util.Map; public class FCSOpenApiTradeRecordRequest extends FCSOpenApiRequest { private String tradeId; private String outTradeNo; public String getTradeId() { return this.tradeId; } public void setTradeId(String tradeId) { this.tradeId = tradeId; } public String getOutTradeNo() { return this.outTradeNo; } public void setOutTradeNo(String outTradeNo) { this.outTradeNo = outTradeNo; } public Map<String, String> getTextParams() { Map map = getBaseTextParams(); map.put("trade_id", this.tradeId); map.put("out_trade_no", this.outTradeNo); return map; } }
[ "1558281773@qq.com" ]
1558281773@qq.com
149b86fb197d4dd056a097ff37c17ef9f00ccfab
7df40f6ea2209b7d48979465fd8081ec2ad198cc
/TOOLS/server/com/wurmonline/server/modifiers/ModifierTypes.java
e13c53283718c5467e12b5ae2af1f201d6dd3555
[ "IJG" ]
permissive
warchiefmarkus/WurmServerModLauncher-0.43
d513810045c7f9aebbf2ec3ee38fc94ccdadd6db
3e9d624577178cd4a5c159e8f61a1dd33d9463f6
refs/heads/master
2021-09-27T10:11:56.037815
2021-09-19T16:23:45
2021-09-19T16:23:45
252,689,028
0
0
null
2021-09-19T16:53:10
2020-04-03T09:33:50
Java
UTF-8
Java
false
false
670
java
package com.wurmonline.server.modifiers; public interface ModifierTypes { public static final int MODIFIER_UNKNOWN = 0; public static final int MODIFIER_STAMINA_REGAIN = 1; public static final int MODIFIER_SKILL = 2; public static final int MODIFIER_MOVEMENT = 3; public static final int MODIFIER_VISION = 4; public static final int MODIFIER_PARRY = 5; public static final int MODIFIER_DODGE = 6; public static final int MODIFIER_WEB_HURTING = 7; } /* Location: C:\Users\leo\Desktop\server.jar!\com\wurmonline\server\modifiers\ModifierTypes.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "warchiefmarkus@gmail.com" ]
warchiefmarkus@gmail.com
a6555a237add1d5cf68dda30affe58244e149be2
d0d3a77b52d5ba957e0609a241de85f5a327ba79
/src/main/java/com/lmcat/soft/service/ICustomerCooperationService.java
d338b269b4ab9fb95bfccac529d2873b0fe44f2d
[]
no_license
wangyongst/lmcat-soft-manager
058d35945358747480a69f4887a7b0fa8445cd61
3f8252997d8e83761eb6ae4798073708fc24877e
refs/heads/master
2020-03-17T11:00:31.061636
2018-05-16T07:30:43
2018-05-16T07:30:43
133,533,687
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
package com.lmcat.soft.service; import com.lmcat.soft.common.base.IBaseService; import com.lmcat.soft.module.CustomerCooperation; public interface ICustomerCooperationService extends IBaseService<CustomerCooperation> { }
[ "wangyongst@gmail.com" ]
wangyongst@gmail.com
4be58447667e436d028e6254d4bb396e56882887
882e77219bce59ae57cbad7e9606507b34eebfcf
/mi2s_securitycenter_miui12/src/main/java/com/miui/permcenter/compact/MiuiSettingsCompat.java
221da564654afef1380faef666b2d06d58f27554
[]
no_license
CrackerCat/XiaomiFramework
17a12c1752296fa1a52f61b83ecf165f328f4523
0b7952df317dac02ebd1feea7507afb789cef2e3
refs/heads/master
2022-06-12T03:30:33.285593
2020-05-06T11:30:54
2020-05-06T11:30:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,755
java
package com.miui.permcenter.compact; import android.content.ContentResolver; import android.content.Context; import java.util.List; public class MiuiSettingsCompat { public static final String TAG = "MiuiSettingsCompat"; public static boolean getCloudDataBoolean(ContentResolver contentResolver, String str, String str2, boolean z) { try { Class<?> cls = Class.forName("android.provider.MiuiSettings$SettingsCloudData"); Class[] clsArr = {ContentResolver.class, String.class, String.class, Boolean.TYPE}; return ((Boolean) ReflectUtilHelper.callStaticObjectMethod(TAG, cls, Boolean.TYPE, "getCloudDataBoolean", clsArr, contentResolver, str, str2, Boolean.valueOf(z))).booleanValue(); } catch (Exception e) { e.printStackTrace(); return false; } } public static int getCloudDataInt(ContentResolver contentResolver, String str, String str2, int i) { try { Class<?> cls = Class.forName("android.provider.MiuiSettings$SettingsCloudData"); Class[] clsArr = {ContentResolver.class, String.class, String.class, Integer.TYPE}; return ((Integer) ReflectUtilHelper.callStaticObjectMethod(TAG, cls, Integer.TYPE, "getCloudDataInt", clsArr, contentResolver, str, str2, Integer.valueOf(i))).intValue(); } catch (Exception e) { e.printStackTrace(); return 0; } } public static List<Object> getCloudDataList(ContentResolver contentResolver, String str) { try { return (List) ReflectUtilHelper.callStaticObjectMethod(TAG, Class.forName("android.provider.MiuiSettings$SettingsCloudData"), List.class, "getCloudDataList", new Class[]{ContentResolver.class, String.class}, contentResolver, str); } catch (Exception e) { e.printStackTrace(); return null; } } public static String getCloudDataString(ContentResolver contentResolver, String str, String str2, String str3) { try { return (String) ReflectUtilHelper.callStaticObjectMethod(TAG, Class.forName("android.provider.MiuiSettings$SettingsCloudData"), String.class, "getCloudDataString", new Class[]{ContentResolver.class, String.class, String.class, String.class}, contentResolver, str, str2, str3); } catch (Exception e) { e.printStackTrace(); return ""; } } public static boolean isInstallMonitorEnabled(Context context) { try { Class[] clsArr = {Context.class}; return ((Boolean) ReflectUtilHelper.callStaticObjectMethod(TAG, Class.forName("android.provider.MiuiSettings$AntiVirus"), Boolean.TYPE, "isInstallMonitorEnabled", clsArr, context)).booleanValue(); } catch (Exception e) { e.printStackTrace(); return false; } } public static boolean isNavigationBarFullScreen(Context context, String str) { try { Class[] clsArr = {ContentResolver.class, String.class}; return ((Boolean) ReflectUtilHelper.callStaticObjectMethod(TAG, Class.forName("android.provider.MiuiSettings$Global"), Boolean.TYPE, "getBoolean", clsArr, context.getContentResolver(), str)).booleanValue(); } catch (Exception e) { e.printStackTrace(); return false; } } public static void setInstallMonitorEnabled(Context context, boolean z) { try { ReflectUtilHelper.callStaticObjectMethod(TAG, Class.forName("android.provider.MiuiSettings$AntiVirus"), "setInstallMonitorEnabled", new Class[]{Context.class, Boolean.TYPE}, context, Boolean.valueOf(z)); } catch (Exception e) { e.printStackTrace(); } } }
[ "sanbo.xyz@gmail.com" ]
sanbo.xyz@gmail.com
0524a071112df961d3a42ae9477dca13b43248a3
e3990e8c3b1e0b8824a0a19bf9d12e48441def7a
/ebean-test/src/test/java/org/etest/PlainBean.java
a86ba2c9f68714fb4ce82f10179d71109043c61f
[ "Apache-2.0" ]
permissive
ebean-orm/ebean
13c9c465f597dd2cf8b3e54e4b300543017c9dee
bfe94786de3c3b5859aaef5afb3a7572e62275c4
refs/heads/master
2023-08-22T12:57:34.271133
2023-08-22T11:43:41
2023-08-22T11:43:41
5,793,895
1,199
224
Apache-2.0
2023-09-11T14:05:26
2012-09-13T11:49:56
Java
UTF-8
Java
false
false
443
java
package org.etest; import java.util.Objects; public class PlainBean { public int id; public String name; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PlainBean plainBean = (PlainBean) o; return id == plainBean.id && name.equals(plainBean.name); } @Override public int hashCode() { return Objects.hash(id, name); } }
[ "robin.bygrave@gmail.com" ]
robin.bygrave@gmail.com
8de7ad624345ca7139c98300c842e51a13db5863
cca87c4ade972a682c9bf0663ffdf21232c9b857
/com/tencent/mm/boot/svg/a/a/ahj.java
19c36059548e83f15cc49f4a4e5916a70f4d4131
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
4,285
java
package com.tencent.mm.boot.svg.a.a; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Paint.Cap; import android.graphics.Paint.Join; import android.graphics.Paint.Style; import android.graphics.Path; import android.os.Looper; import com.tencent.mm.plugin.appbrand.jsapi.map.f; import com.tencent.mm.svg.WeChatSVGRenderC2Java; import com.tencent.mm.svg.c; import com.tencent.smtt.sdk.WebView; public final class ahj extends c { private final int height = f.CTRL_INDEX; private final int width = 111; protected final int b(int i, Object... objArr) { switch (i) { case 0: return 111; case 1: return f.CTRL_INDEX; case 2: Canvas canvas = (Canvas) objArr[0]; Looper looper = (Looper) objArr[1]; Matrix d = c.d(looper); float[] c = c.c(looper); Paint g = c.g(looper); g.setFlags(385); g.setStyle(Style.FILL); Paint g2 = c.g(looper); g2.setFlags(385); g2.setStyle(Style.STROKE); g.setColor(WebView.NIGHT_MODE_COLOR); g2.setStrokeWidth(1.0f); g2.setStrokeCap(Cap.BUTT); g2.setStrokeJoin(Join.MITER); g2.setStrokeMiter(4.0f); g2.setPathEffect(null); g2 = c.a(g2, looper); g2.setStrokeWidth(1.0f); Paint a = c.a(g, looper); Paint a2 = c.a(g2, looper); a.setColor(-3355444); a2.setColor(-3355444); a2.setStrokeWidth(2.0f); canvas.save(); c = c.a(c, 1.0f, 0.0f, 40.0f, 0.0f, 1.0f, 52.0f); d.reset(); d.setValues(c); canvas.concat(d); canvas.save(); Paint a3 = c.a(a, looper); Paint a4 = c.a(a2, looper); Path h = c.h(looper); h.moveTo(16.837944f, 33.589672f); h.cubicTo(7.7312255f, 33.589672f, 0.26877472f, 26.054348f, 0.26877472f, 16.858696f); h.cubicTo(0.26877472f, 7.6630435f, 7.7312255f, 0.12771739f, 16.837944f, 0.12771739f); h.cubicTo(25.944664f, 0.12771739f, 33.407116f, 7.6630435f, 33.407116f, 16.858696f); h.cubicTo(33.407116f, 26.182066f, 25.944664f, 33.589672f, 16.837944f, 33.589672f); h.close(); h.moveTo(16.837944f, 1.4048913f); h.cubicTo(8.363636f, 1.4048913f, 1.5335969f, 8.30163f, 1.5335969f, 16.858696f); h.cubicTo(1.5335969f, 25.41576f, 8.363636f, 32.3125f, 16.837944f, 32.3125f); h.cubicTo(25.312254f, 32.3125f, 32.142292f, 25.41576f, 32.142292f, 16.858696f); h.cubicTo(32.142292f, 8.429348f, 25.18577f, 1.4048913f, 16.837944f, 1.4048913f); h.close(); WeChatSVGRenderC2Java.setFillType(h, 2); canvas.drawPath(h, a3); canvas.drawPath(h, a4); canvas.restore(); canvas.save(); a3 = c.a(a, looper); a = c.a(a2, looper); h = c.h(looper); h.moveTo(39.35178f, 40.23098f); h.cubicTo(39.225296f, 40.23098f, 38.972332f, 40.23098f, 38.845848f, 40.10326f); h.lineTo(27.841898f, 28.991848f); h.cubicTo(27.588932f, 28.736412f, 27.588932f, 28.35326f, 27.841898f, 28.097826f); h.cubicTo(28.094862f, 27.842392f, 28.474308f, 27.842392f, 28.727272f, 28.097826f); h.lineTo(39.731224f, 39.20924f); h.cubicTo(39.984188f, 39.464672f, 39.984188f, 39.847828f, 39.731224f, 40.10326f); h.cubicTo(39.604744f, 40.23098f, 39.47826f, 40.23098f, 39.35178f, 40.23098f); h.close(); WeChatSVGRenderC2Java.setFillType(h, 2); canvas.drawPath(h, a3); canvas.drawPath(h, a); canvas.restore(); canvas.restore(); c.f(looper); break; } return 0; } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
3e4943cee40e12dd50d60b1493dc6b19eee3b939
273a08fddddae0afff8084c8795083bb0020ac5c
/app/src/main/java/com/leisurely/spread/framework/base/BaseFragment.java
fdee5e2b3c22f998d5a50f017c58c06e4577b817
[]
no_license
kevin161/hwSpread
66da159130fdc520379d6722a073796fc2417a0b
a25183d732a39d931e6158b1faa77c645cc0bc49
refs/heads/master
2020-12-12T23:19:57.671628
2020-02-02T12:58:57
2020-02-02T12:58:57
234,254,089
0
0
null
null
null
null
UTF-8
Java
false
false
1,435
java
package com.leisurely.spread.framework.base; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.leisurely.spread.util.ToastUtil; public abstract class BaseFragment extends Fragment implements View.OnClickListener { protected View baseView; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { baseView = inflater.inflate(getBaseLayoutId(), null); initView(); initListener(); initData(); return baseView; } protected abstract int getBaseLayoutId(); protected abstract void initView(); protected abstract void initListener(); protected abstract void initData(); /** * 展示toast * @param msg */ protected void showToast(String msg) { ToastUtil.showToast(msg); } /** * 设置view的单击监听 * @param id view的id */ protected void setClickListener(int id) { if(baseView==null) { return; } baseView.findViewById(id).setOnClickListener(this); } /** * 设置view的单击监听 * @param view */ protected void setClickListener(View view) { view.setOnClickListener(this); } }
[ "kevin161@sina.com" ]
kevin161@sina.com
cac895fbd3fc4a3151199bc0c63aa8d02a83fc26
04f00b16a59397e7a2e0529a07df4c71c96baaaf
/src/csv/common/domain/CustomerIdentifierType.java
87b001ef76a55c4317369c865bab1e6e8dc71ec4
[]
no_license
fatihalgan/CSV2
84fed95fb22ff99d26c4f83325990048f88ab2ce
f6dce800ed5dacf8b9f276444bee2ef03a5cd098
refs/heads/master
2020-12-31T04:28:26.961178
2016-04-21T14:55:48
2016-04-21T14:55:48
56,343,667
0
0
null
null
null
null
UTF-8
Java
false
false
585
java
package csv.common.domain; public enum CustomerIdentifierType { MSISDN("MSISDN"), CustomerCode("CustomerCode"); private String type; private CustomerIdentifierType(String type) { this.type = type; } public String getLabel() { return type; } public String getValue() { return type; } public String toString() { return getLabel(); } public static CustomerIdentifierType factory(String type) { if(type.equals("MSISDN")) return MSISDN; else if(type.equals("CustomerCode")) return CustomerCode; else return null; } }
[ "fatih.algan@gmail.com" ]
fatih.algan@gmail.com
5fad64f913064386f287b7e07fb059f52e4d10af
e62c3b93b38d2d7781d38ba1cdbabfea2c1cf7af
/bocbiiclient/src/main/java/com/boc/bocsoft/mobile/bii/bus/wealthmanagement/model/PsnXpadAutTradStatus/PsnXpadAutTradStatusResponse.java
1ee1c6c5949fbfbde10e2c6de5da060d6d60d172
[]
no_license
soghao/zgyh
df34779708a8d6088b869d0efc6fe1c84e53b7b1
09994dda29f44b6c1f7f5c7c0b12f956fc9a42c1
refs/heads/master
2021-06-19T07:36:53.910760
2017-06-23T14:23:10
2017-06-23T14:23:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package com.boc.bocsoft.mobile.bii.bus.wealthmanagement.model.PsnXpadAutTradStatus; import com.boc.bocsoft.mobile.bii.common.model.BIIResponse; /** * 委托常规交易状况查询 * Created by zhx on 2016/9/5 */ public class PsnXpadAutTradStatusResponse extends BIIResponse<PsnXpadAutTradStatusResult> { }
[ "15609143618@163.com" ]
15609143618@163.com
4fa9d974b5dcae0fe3342466ea680a64f731dfef
89b24b44d2c36308030ac733cf88cdecb45d9706
/sqliteconnection/src/main/java/ru/noties/sqliteconnection/base/StatementQueryBase.java
b035bf748338d8312bb6e6db699efb7fa91af643
[]
no_license
noties/SqliteConnection
205ff3ef39c1a11612d0509558136113d370522a
6d8c50b2721dca30c02f967bfe202d885cab446e
refs/heads/master
2021-01-23T07:55:10.187485
2017-01-31T11:23:44
2017-01-31T11:23:44
80,514,365
0
0
null
null
null
null
UTF-8
Java
false
false
1,296
java
package ru.noties.sqliteconnection.base; import android.database.Cursor; import ru.noties.sqliteconnection.StatementQuery; @SuppressWarnings("WeakerAccess") public abstract class StatementQueryBase extends StatementBase<Cursor> implements StatementQuery { protected StatementQueryBase(String sql) { super(sql); } @Override public StatementQuery bind(String name, boolean value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, int value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, long value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, float value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, double value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, byte[] value) { return (StatementQuery) super.bind(name, value); } @Override public StatementQuery bind(String name, String value) { return (StatementQuery) super.bind(name, value); } }
[ "mail@dimitryivanov.ru" ]
mail@dimitryivanov.ru
1176969b68327e3fbb00b48cdad22298f00c0693
aa2ad2ebaebc9501a95a90b1fe5e91452995a077
/musci-ws/src/main/java/com/example/musciws/Netty/InformationOperateMap.java
ca83c6ce1d1d2aaf822543413f97f91df8930bb3
[]
no_license
MusicCore/MS
305a8f04e705f2d2e78adff31a26f77ca9254bfe
fa23c4fd01130e6f4bce60ec7c83962a13376738
refs/heads/master
2020-04-17T07:46:43.243838
2019-05-17T08:22:46
2019-05-17T08:22:46
166,383,713
0
1
null
null
null
null
UTF-8
Java
false
false
2,078
java
package com.example.musciws.Netty; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; public class InformationOperateMap { /* ConcurrentMap 多线程安全高效 HashMap 非线程安全 HashTable 线程安全但不高效 */ public static ConcurrentMap<String,ConcurrentMap<String,InformationOperateMap>> map = new ConcurrentHashMap<>(); private ChannelHandlerContext ctx; private Mage mage; public InformationOperateMap(ChannelHandlerContext ctx, Mage mage) { this.ctx = ctx; this.mage = mage; } /** * 添加用户信息 * @param ctx * @param mage */ public static void add(ChannelHandlerContext ctx,Mage mage){ InformationOperateMap iom = new InformationOperateMap(ctx,mage); ConcurrentMap<String,InformationOperateMap> cmap = new ConcurrentHashMap<>(); if(map.containsKey(mage.getTable())){ map.get(mage.getTable()).put(mage.getId(),iom); }else { cmap.put(mage.getId(),iom); map.put(mage.getTable(),cmap); } } /** * 删除用户 * @param id * @param table */ public static void delete(String id,String table){ ConcurrentMap<String,InformationOperateMap> cmap = map.get(table); if(cmap.size()<=1){ map.remove(table); }else{ cmap.remove(id); } } /** * 判断是否存在用户 * @param mage * @return */ public static Boolean isNo(Mage mage){ return map.containsKey(mage.getTable())?map.get(mage.getTable()).containsKey(mage.getId())?false:true:true; } /** * 发送消息 * @param mage * @throws Exception */ public void sead(Mage mage) throws Exception{ ctx.writeAndFlush(new TextWebSocketFrame(mage.toJson())); } public Mage getMage(){ return mage; } }
[ "your email" ]
your email
5eac5b9bde3184d76ca4821ec7714a67839fb121
d25c1e29faf8afa100c3f8239ab7e85ba2afa310
/src/MagneticForceBetweenTwoBalls.java
fff0c15177b3dcbb00fc6e74f23988955770c6aa
[]
no_license
pranavacharya/leetcode
0b981891da3b14dbabd3e0dcbba5e55a41bce66f
e0798b9212bf4a65c89f6a35151272263b336338
refs/heads/master
2022-09-12T09:29:38.015114
2022-06-19T22:17:22
2022-06-19T22:17:22
235,647,255
1
0
null
null
null
null
UTF-8
Java
false
false
1,124
java
import java.util.Arrays; public class MagneticForceBetweenTwoBalls { public int maxDistance(int[] position, int m) { Arrays.sort(position); int min = 0; int low = 0; int high = position[position.length - 1]; while (low <= high) { int mid = low + (high - low) / 2; if (canPlace(position, mid, m)) { min = mid; low = mid + 1; } else { high = mid - 1; } } return min; } public boolean canPlace(int[] position, int distance, int m) { int count = 1; int last = position[0]; for (int i = 0; i < position.length; i++) { if (position[i] - last >= distance) { count++; last = position[i]; } } return count >= m; } public static void main(String args[]) { MagneticForceBetweenTwoBalls mfbtb = new MagneticForceBetweenTwoBalls(); int[] position = new int[]{5, 4, 3, 2, 1, 100}; System.out.println(mfbtb.maxDistance(position, 2)); } }
[ "apranav.acharya@gmail.com" ]
apranav.acharya@gmail.com
8d1238e62ad1edc1a18e03aff14f8d8b001633b2
f4e15ee34808877459d81fd601d6be03bdfb4a9d
/org/apache/commons/codec/BinaryDecoder.java
a0eb8b6efb516c3f5b9b3bc09024bcee069d76fa
[]
no_license
Lianite/wurm-server-reference
369081debfa72f44eafc6a080002c4a3970f8385
e4dd8701e4af13901268cf9a9fa206fcb5196ff0
refs/heads/master
2023-07-22T16:06:23.426163
2020-04-07T23:15:35
2020-04-07T23:15:35
253,933,452
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
// // Decompiled by Procyon v0.5.30 // package org.apache.commons.codec; public interface BinaryDecoder extends Decoder { byte[] decode(final byte[] p0) throws DecoderException; }
[ "jdraco6@gmail.com" ]
jdraco6@gmail.com
d5136003f778b3d7aeeedad43c4dc12ffae86b13
af89582156f440da6b833499275b01fdd7b0183a
/app/src/main/java/com/sxzx/view/LoadingDialog.java
c32836172d721a0eacb3162be6447e396c7268a5
[]
no_license
SuperZhouyong/SuperYong
0c354ca6c0af99cb006a4acbdc2cacec7a527688
b1c3db3843dfc9178b8b38c85f33e14c8eb4d45a
refs/heads/master
2021-05-03T17:43:42.809726
2016-12-23T02:52:10
2016-12-23T02:54:57
63,049,730
6
1
null
null
null
null
UTF-8
Java
false
false
2,888
java
package com.sxzx.view; import android.app.Activity; import android.app.Dialog; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.koolearn.klibrary.ui.android.R; /** * Created by Administrator * on 2016/10/21. */ public class LoadingDialog { /** 加载数据对话框 */ private static Dialog mLoadingDialog; /** * 显示加载对话框 * @param context 上下文 * @param msg 对话框显示内容 * @param cancelable 对话框是否可以取消 */ public static Dialog showDialogForLoading(Activity context, String msg, boolean cancelable) { View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null); TextView loadingText = (TextView)view.findViewById(R.id.id_tv_loading_dialog_text); loadingText.setText(msg); mLoadingDialog = new Dialog(context, R.style.CustomProgressDialog); mLoadingDialog.setCancelable(cancelable); mLoadingDialog.setCanceledOnTouchOutside(false); mLoadingDialog.setContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); mLoadingDialog.show(); return mLoadingDialog; } public static Dialog showDialogForLoading(Activity context, String msg) { View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null); TextView loadingText = (TextView)view.findViewById(R.id.id_tv_loading_dialog_text); loadingText.setText(msg); mLoadingDialog = new Dialog(context, R.style.CustomProgressDialog); mLoadingDialog.setCancelable(false); mLoadingDialog.setCanceledOnTouchOutside(false); mLoadingDialog.setContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); mLoadingDialog.show(); return mLoadingDialog; } public static Dialog showDialogForLoading(Activity context) { View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null); TextView loadingText = (TextView)view.findViewById(R.id.id_tv_loading_dialog_text); loadingText.setText("加载中..."); mLoadingDialog = new Dialog(context, R.style.CustomProgressDialog); mLoadingDialog.setCancelable(false); mLoadingDialog.setCanceledOnTouchOutside(false); mLoadingDialog.setContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); mLoadingDialog.show(); return mLoadingDialog; } /** * 关闭加载对话框 */ public static void cancelDialogForLoading() { if(mLoadingDialog != null) { mLoadingDialog.cancel(); } } }
[ "z_zhouyong@163.com" ]
z_zhouyong@163.com
a5225f5d3d8f7df4fc6d39424bea8f43da947dbd
350a028b43ef498f6bcf748c7855f00c74379ecb
/3.Java Fundamentals SoftUni/Java OOP Advanced/UnitTestsOnPreviousExam/src/test/java/panzer/models/miscellaneous/VehicleAssemblerTest.java
e78824618e656ee9fcdb6c30ecbec7cd54fe3670
[]
no_license
martinrangelov96/SoftUni-Lections-Exercises-And-Homeworks
e2322ba51de0b354ba94ec4d19415de8938ee5b4
009a21268621238027b288a95b2dfc6a09578155
refs/heads/master
2022-12-02T15:58:02.790326
2019-07-17T07:15:30
2019-07-17T07:15:30
168,360,969
1
0
null
2022-11-24T09:51:29
2019-01-30T14:57:54
Java
UTF-8
Java
false
false
8,179
java
package panzer.models.miscellaneous; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import panzer.contracts.*; import java.lang.reflect.Field; import java.math.BigDecimal; import java.util.List; public class VehicleAssemblerTest { private Assembler vehicleAssembler; private AttackModifyingPart attackModifyingPart; private DefenseModifyingPart defenseModifyingPart; private HitPointsModifyingPart hitPointsModifyingPart; @Before public void setUp() throws Exception { this.vehicleAssembler = new VehicleAssembler(); this.attackModifyingPart = Mockito.mock(AttackModifyingPart.class); this.defenseModifyingPart = Mockito.mock(DefenseModifyingPart.class); this.hitPointsModifyingPart = Mockito.mock(HitPointsModifyingPart.class); this.vehicleAssembler.addArsenalPart(this.attackModifyingPart); this.vehicleAssembler.addShellPart(this.defenseModifyingPart); this.vehicleAssembler.addEndurancePart(this.hitPointsModifyingPart); } @Test public void getTotalWeight() { //Arrange Mockito.when(this.attackModifyingPart.getWeight()).thenReturn(10.0); Mockito.when(this.defenseModifyingPart.getWeight()).thenReturn(20.0); Mockito.when(this.hitPointsModifyingPart.getWeight()).thenReturn(30.0); //Act double actualTotalWeight = this.vehicleAssembler.getTotalWeight(); double expectedTotalWeight = 60.0; //Assert Assert.assertEquals(expectedTotalWeight, actualTotalWeight, 0.1); } @Test public void getTotalPrice() { //Arrange Mockito.when(this.attackModifyingPart.getPrice()).thenReturn(BigDecimal.ZERO); Mockito.when(this.defenseModifyingPart.getPrice()).thenReturn(BigDecimal.TEN); Mockito.when(this.hitPointsModifyingPart.getPrice()).thenReturn(BigDecimal.ONE); //Act BigDecimal actualTotalPrice = this.vehicleAssembler.getTotalPrice(); BigDecimal expectedTotalPrice = BigDecimal.valueOf(11); //Assert Assert.assertEquals(expectedTotalPrice, actualTotalPrice); } @Test public void getTotalPriceWithoutParts() { //Arrange Assembler assembler = new VehicleAssembler(); //Act BigDecimal actualTotalPrice = assembler.getTotalPrice(); BigDecimal expectedTotalPrice = BigDecimal.ZERO; //Assert Assert.assertEquals(expectedTotalPrice, actualTotalPrice); } @Test public void getTotalAttackModification() { //Arrange Mockito.when(this.attackModifyingPart.getAttackModifier()).thenReturn(50); AttackModifyingPart attackModifyingPart = Mockito.mock(AttackModifyingPart.class); Mockito.when(attackModifyingPart.getAttackModifier()).thenReturn(120); this.vehicleAssembler.addArsenalPart(attackModifyingPart); //Act long actualTotalAttackModification = this.vehicleAssembler.getTotalAttackModification(); long expectedTotalAttackModification = 170; //Assert Assert.assertEquals(expectedTotalAttackModification, actualTotalAttackModification); } @Test public void getTotalDefenseModification() { //Arrange Mockito.when(this.defenseModifyingPart.getDefenseModifier()).thenReturn(50); DefenseModifyingPart defenseModifyingPart = Mockito.mock(DefenseModifyingPart.class); Mockito.when(defenseModifyingPart.getDefenseModifier()).thenReturn(120); this.vehicleAssembler.addShellPart(defenseModifyingPart); //Act long actualTotalDefenseModification = this.vehicleAssembler.getTotalDefenseModification(); long expectedTotalDefenseModification = 170; //Assert Assert.assertEquals(expectedTotalDefenseModification, actualTotalDefenseModification); } @Test public void getTotalHitPointModification() { //Arrange Mockito.when(this.hitPointsModifyingPart.getHitPointsModifier()).thenReturn(50); HitPointsModifyingPart hitPointsModifyingPart = Mockito.mock(HitPointsModifyingPart.class); Mockito.when(hitPointsModifyingPart.getHitPointsModifier()).thenReturn(120); this.vehicleAssembler.addEndurancePart(hitPointsModifyingPart); //Act long actualTotalHitPointModification = this.vehicleAssembler.getTotalHitPointModification(); long expectedTotalHitPointModification = 170; //Assert Assert.assertEquals(expectedTotalHitPointModification, actualTotalHitPointModification); } @Test public void testAddArsenalPartCollectionSize() { //Arrange Assembler assembler = new VehicleAssembler(); AttackModifyingPart part = Mockito.mock(AttackModifyingPart.class); AttackModifyingPart part1 = Mockito.mock(AttackModifyingPart.class); AttackModifyingPart part2 = Mockito.mock(AttackModifyingPart.class); //Act assembler.addArsenalPart(part); assembler.addArsenalPart(part1); assembler.addArsenalPart(part2); int actualSize = 0; try { Field arsenalParts = assembler.getClass().getDeclaredField("arsenalParts"); arsenalParts.setAccessible(true); List<AttackModifyingPart> parts = (List<AttackModifyingPart>) arsenalParts.get(assembler); actualSize = parts.size(); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } int expectedSize = 3; //Assert Assert.assertEquals(expectedSize, actualSize); } @Test public void testAddArsenalPart() { //Arrange Assembler assembler = new VehicleAssembler(); Part part = Mockito.mock(AttackModifyingPart.class); Part part1 = Mockito.mock(AttackModifyingPart.class); Mockito.when(((AttackModifyingPart) part).getAttackModifier()).thenReturn(Integer.MAX_VALUE); Mockito.when(((AttackModifyingPart) part1).getAttackModifier()).thenReturn(Integer.MAX_VALUE); //Act assembler.addArsenalPart(part); assembler.addArsenalPart(part1); long actualTotalAttackModification = assembler.getTotalAttackModification(); long expectedTotalAttackModification = (long) Integer.MAX_VALUE + Integer.MAX_VALUE; //Assert Assert.assertEquals(expectedTotalAttackModification, actualTotalAttackModification); } @Test public void addShellPart() { //Arrange Assembler assembler = new VehicleAssembler(); Part part1 = Mockito.mock(DefenseModifyingPart.class); Part part2 = Mockito.mock(DefenseModifyingPart.class); Mockito.when(((DefenseModifyingPart) part1).getDefenseModifier()).thenReturn(Integer.MAX_VALUE); Mockito.when(((DefenseModifyingPart) part2).getDefenseModifier()).thenReturn(Integer.MAX_VALUE); //Act assembler.addShellPart(part1); assembler.addShellPart(part2); long actualValue = assembler.getTotalDefenseModification(); long expectedValue = (long) Integer.MAX_VALUE + Integer.MAX_VALUE; //Assert Assert.assertEquals(expectedValue, actualValue); } @Test public void addEndurancePart() { //Arrange Assembler assembler = new VehicleAssembler(); Part part1 = Mockito.mock(HitPointsModifyingPart.class); Part part2 = Mockito.mock(HitPointsModifyingPart.class); Mockito.when(((HitPointsModifyingPart) part1).getHitPointsModifier()).thenReturn(Integer.MAX_VALUE); Mockito.when(((HitPointsModifyingPart) part2).getHitPointsModifier()).thenReturn(Integer.MAX_VALUE); //Act assembler.addEndurancePart(part1); assembler.addEndurancePart(part2); long actualTotalHitPointModification = assembler.getTotalHitPointModification(); long expectedTotalHitPointModification = (long) Integer.MAX_VALUE + Integer.MAX_VALUE; //Assert Assert.assertEquals(expectedTotalHitPointModification, actualTotalHitPointModification); } }
[ "martin.rangelov96@gmail.com" ]
martin.rangelov96@gmail.com
bbc940b1600021f2532c3b5f3296c1f23785dc65
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XRENDERING-481-1-18-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/macro/toc/TreeParametersBuilder_ESTest_scaffolding.java
e061c48a19c2f02c196de838d041f4d77fd432b4
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
3,273
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Mar 31 17:29:00 UTC 2020 */ package org.xwiki.rendering.internal.macro.toc; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class TreeParametersBuilder_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.xwiki.rendering.internal.macro.toc.TreeParametersBuilder"; 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(TreeParametersBuilder_ESTest_scaffolding.class.getClassLoader() , "org.xwiki.rendering.internal.macro.toc.TreeParametersBuilder", "org.xwiki.rendering.block.AbstractBlock", "org.xwiki.rendering.block.XDOM", "org.xwiki.rendering.macro.toc.TocMacroParameters", "org.xwiki.rendering.block.match.BlockNavigator$1", "org.xwiki.rendering.block.BlockFilter", "org.xwiki.rendering.block.match.BlockNavigator", "org.xwiki.rendering.block.Block", "org.xwiki.rendering.syntax.Syntax", "org.xwiki.rendering.transformation.TransformationContext", "org.xwiki.rendering.block.MetaDataBlock", "org.xwiki.rendering.block.match.BlockMatcher", "org.xwiki.rendering.block.MacroBlock", "org.xwiki.rendering.internal.macro.toc.TreeParameters", "org.xwiki.rendering.block.QuotationBlock", "org.xwiki.rendering.block.Block$Axes", "org.xwiki.rendering.block.CompatibilityBlock", "org.xwiki.rendering.listener.ImageListener", "org.xwiki.rendering.transformation.MacroTransformationContext", "org.xwiki.rendering.transformation.Transformation", "org.xwiki.rendering.macro.toc.TocMacroParameters$Scope", "org.xwiki.rendering.listener.LinkListener", "org.xwiki.rendering.block.match.ClassBlockMatcher", "org.xwiki.rendering.block.SectionBlock", "org.xwiki.rendering.listener.Listener" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
08cbc9459a135f2312256f7551dc6e30cc04b9ed
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/io/reactivex/internal/operators/flowable/FlowableThrottleLatest.java
2ec8048a92a27addd8c32aa5aa571db49ddb277f
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
6,660
java
package io.reactivex.internal.operators.flowable; import io.reactivex.Flowable; import io.reactivex.FlowableSubscriber; import io.reactivex.Scheduler; import io.reactivex.exceptions.MissingBackpressureException; import io.reactivex.internal.subscriptions.SubscriptionHelper; import io.reactivex.internal.util.BackpressureHelper; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; public final class FlowableThrottleLatest<T> extends s6.a.c.b.a.a<T, T> { public final long b; public final TimeUnit c; public final Scheduler d; public final boolean e; public static final class a<T> extends AtomicInteger implements FlowableSubscriber<T>, Subscription, Runnable { private static final long serialVersionUID = -8296689127439125014L; public final Subscriber<? super T> a; public final long b; public final TimeUnit c; public final Scheduler.Worker d; public final boolean e; public final AtomicReference<T> f = new AtomicReference<>(); public final AtomicLong g = new AtomicLong(); public Subscription h; public volatile boolean i; public Throwable j; public volatile boolean k; public volatile boolean l; public long m; public boolean n; public a(Subscriber<? super T> subscriber, long j2, TimeUnit timeUnit, Scheduler.Worker worker, boolean z) { this.a = subscriber; this.b = j2; this.c = timeUnit; this.d = worker; this.e = z; } public void a() { if (getAndIncrement() == 0) { AtomicReference<T> atomicReference = this.f; AtomicLong atomicLong = this.g; Subscriber<? super T> subscriber = this.a; int i2 = 1; while (!this.k) { boolean z = this.i; if (!z || this.j == null) { boolean z2 = atomicReference.get() == null; if (z) { if (z2 || !this.e) { atomicReference.lazySet(null); subscriber.onComplete(); } else { T andSet = atomicReference.getAndSet(null); long j2 = this.m; if (j2 != atomicLong.get()) { this.m = j2 + 1; subscriber.onNext(andSet); subscriber.onComplete(); } else { subscriber.onError(new MissingBackpressureException("Could not emit final value due to lack of requests")); } } this.d.dispose(); return; } if (z2) { if (this.l) { this.n = false; this.l = false; } } else if (!this.n || this.l) { T andSet2 = atomicReference.getAndSet(null); long j3 = this.m; if (j3 != atomicLong.get()) { subscriber.onNext(andSet2); this.m = j3 + 1; this.l = false; this.n = true; this.d.schedule(this, this.b, this.c); } else { this.h.cancel(); subscriber.onError(new MissingBackpressureException("Could not emit value due to lack of requests")); this.d.dispose(); return; } } i2 = addAndGet(-i2); if (i2 == 0) { return; } } else { atomicReference.lazySet(null); subscriber.onError(this.j); this.d.dispose(); return; } } atomicReference.lazySet(null); } } @Override // org.reactivestreams.Subscription public void cancel() { this.k = true; this.h.cancel(); this.d.dispose(); if (getAndIncrement() == 0) { this.f.lazySet(null); } } @Override // org.reactivestreams.Subscriber public void onComplete() { this.i = true; a(); } @Override // org.reactivestreams.Subscriber public void onError(Throwable th) { this.j = th; this.i = true; a(); } @Override // org.reactivestreams.Subscriber public void onNext(T t) { this.f.set(t); a(); } @Override // io.reactivex.FlowableSubscriber, org.reactivestreams.Subscriber public void onSubscribe(Subscription subscription) { if (SubscriptionHelper.validate(this.h, subscription)) { this.h = subscription; this.a.onSubscribe(this); subscription.request(Long.MAX_VALUE); } } @Override // org.reactivestreams.Subscription public void request(long j2) { if (SubscriptionHelper.validate(j2)) { BackpressureHelper.add(this.g, j2); } } @Override // java.lang.Runnable public void run() { this.l = true; a(); } } public FlowableThrottleLatest(Flowable<T> flowable, long j, TimeUnit timeUnit, Scheduler scheduler, boolean z) { super(flowable); this.b = j; this.c = timeUnit; this.d = scheduler; this.e = z; } @Override // io.reactivex.Flowable public void subscribeActual(Subscriber<? super T> subscriber) { this.source.subscribe((FlowableSubscriber) new a(subscriber, this.b, this.c, this.d.createWorker(), this.e)); } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
8b3a9e27ec7fff67b393cd14669cfe5a11c40118
8a4b1696754c626b295e78e6d5c60e6c26de7f84
/spring-web/src/test/java/org/springframework/web/client/HttpMessageConverterExtractorTests.java
f9c587248ec57e0920587ee98636d6a579dd7519
[ "Apache-2.0" ]
permissive
404-not-find/spring-framework
437db62dfc163acb3f83597a004ad90703d55ba3
1c724069c3a76d1619d2fee78ded5aaf6ab1b69b
refs/heads/3.2.x
2023-02-26T08:36:28.375877
2013-02-04T23:03:51
2013-02-04T23:05:08
8,048,651
3
0
null
2023-02-07T18:04:55
2013-02-06T09:55:42
Java
UTF-8
Java
false
false
6,544
java
/* * Copyright 2002-2012 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.web.client; import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import java.io.IOException; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Test; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.converter.GenericHttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter; /** * Test fixture for {@link HttpMessageConverter}. * * @author Arjen Poutsma */ public class HttpMessageConverterExtractorTests { private HttpMessageConverterExtractor extractor; private ClientHttpResponse response; @Before public void createMocks() { response = createMock(ClientHttpResponse.class); } @Test public void noContent() throws IOException { HttpMessageConverter<?> converter = createMock(HttpMessageConverter.class); extractor = new HttpMessageConverterExtractor<String>(String.class, createConverterList(converter)); expect(response.getStatusCode()).andReturn(HttpStatus.NO_CONTENT); replay(response, converter); Object result = extractor.extractData(response); assertNull(result); verify(response, converter); } @Test public void notModified() throws IOException { HttpMessageConverter<?> converter = createMock(HttpMessageConverter.class); extractor = new HttpMessageConverterExtractor<String>(String.class, createConverterList(converter)); expect(response.getStatusCode()).andReturn(HttpStatus.NOT_MODIFIED); replay(response, converter); Object result = extractor.extractData(response); assertNull(result); verify(response, converter); } @Test public void zeroContentLength() throws IOException { HttpMessageConverter<?> converter = createMock(HttpMessageConverter.class); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.setContentLength(0); extractor = new HttpMessageConverterExtractor<String>(String.class, createConverterList(converter)); expect(response.getStatusCode()).andReturn(HttpStatus.OK); expect(response.getHeaders()).andReturn(responseHeaders); replay(response, converter); Object result = extractor.extractData(response); assertNull(result); verify(response, converter); } @Test @SuppressWarnings("unchecked") public void normal() throws IOException { HttpMessageConverter<String> converter = createMock(HttpMessageConverter.class); List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(); converters.add(converter); HttpHeaders responseHeaders = new HttpHeaders(); MediaType contentType = MediaType.TEXT_PLAIN; responseHeaders.setContentType(contentType); String expected = "Foo"; extractor = new HttpMessageConverterExtractor<String>(String.class, converters); expect(response.getStatusCode()).andReturn(HttpStatus.OK); expect(response.getHeaders()).andReturn(responseHeaders).times(2); expect(converter.canRead(String.class, contentType)).andReturn(true); expect(converter.read(String.class, response)).andReturn(expected); replay(response, converter); Object result = extractor.extractData(response); assertEquals(expected, result); verify(response, converter); } @Test @SuppressWarnings("unchecked") public void cannotRead() throws IOException { HttpMessageConverter<String> converter = createMock(HttpMessageConverter.class); List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(); converters.add(converter); HttpHeaders responseHeaders = new HttpHeaders(); MediaType contentType = MediaType.TEXT_PLAIN; responseHeaders.setContentType(contentType); extractor = new HttpMessageConverterExtractor<String>(String.class, converters); expect(response.getStatusCode()).andReturn(HttpStatus.OK); expect(response.getHeaders()).andReturn(responseHeaders).times(2); expect(converter.canRead(String.class, contentType)).andReturn(false); replay(response, converter); try { extractor.extractData(response); fail("RestClientException expected"); } catch (RestClientException expected) { // expected } verify(response, converter); } @Test @SuppressWarnings("unchecked") public void generics() throws IOException { GenericHttpMessageConverter<String> converter = createMock(GenericHttpMessageConverter.class); List<HttpMessageConverter<?>> converters = createConverterList(converter); HttpHeaders responseHeaders = new HttpHeaders(); MediaType contentType = MediaType.TEXT_PLAIN; responseHeaders.setContentType(contentType); String expected = "Foo"; ParameterizedTypeReference<List<String>> reference = new ParameterizedTypeReference<List<String>>() {}; Type type = reference.getType(); extractor = new HttpMessageConverterExtractor<List<String>>(type, converters); expect(response.getStatusCode()).andReturn(HttpStatus.OK); expect(response.getHeaders()).andReturn(responseHeaders).times(2); expect(converter.canRead(type, null, contentType)).andReturn(true); expect(converter.read(type, null, response)).andReturn(expected); replay(response, converter); Object result = extractor.extractData(response); assertEquals(expected, result); verify(response, converter); } private List<HttpMessageConverter<?>> createConverterList(HttpMessageConverter converter) { List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(1); converters.add(converter); return converters; } }
[ "rstoyanchev@vmware.com" ]
rstoyanchev@vmware.com
0972de038656a7894e1cb424b91016f9ffb479c4
e939c1a576daf7dbf9a8fec6d5be3ecea8fd5fd2
/extensions/vector/src/arc/graphics/vector/PathConstants.java
dfb41ef3830aab679e0e2deadcdf3448801623dc
[]
no_license
irfanmauuu/Arc
4c9210671515de61463fa3d351fe3517493c1679
6a8eb57007ff1b0ae465fbfe9983edb585964823
refs/heads/master
2022-11-16T18:28:07.349294
2020-06-29T23:32:16
2020-06-29T23:32:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package arc.graphics.vector; interface PathConstants{ int moveTo = 0; int lineTo = 1; int cubicTo = 2; int close = 3; int winding = 4; int PT_CORNER = 0x01; int PT_LEFT = 0x02; int PT_BEVEL = 0x04; int PT_INNERBEVEL = 0x08; int PT_FILL_BEVEL = 0x10; int PT_FILL_INNERBEVEL = 0x20; }
[ "arnukren@gmail.com" ]
arnukren@gmail.com
534067806d45144bb038ee3c92e0c4e67096b746
1935f2fd778590c7c37f5a33de79ca2710a804c4
/bboss-security/src/org/frameworkset/security/session/impl/SimpleHttpSessionContext.java
c00a30bea338ff95cb30dd4a17237d0559b4810e
[ "Apache-2.0" ]
permissive
bbossgroups/security
89c7020af6a708eec7a25231af770cb90e7c8ae7
42302717f36c36a28e555a5aae2aecd62ed00f92
refs/heads/master
2023-08-09T22:45:51.521357
2023-07-23T13:38:07
2023-07-23T13:38:07
48,433,777
34
28
null
null
null
null
UTF-8
Java
false
false
571
java
package org.frameworkset.security.session.impl; import java.util.Enumeration; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionContext; @SuppressWarnings("deprecation") public class SimpleHttpSessionContext implements HttpSessionContext { public SimpleHttpSessionContext() { // TODO Auto-generated constructor stub } @Override public Enumeration getIds() { // TODO Auto-generated method stub return null; } @Override public HttpSession getSession(String sessionid) { // TODO Auto-generated method stub return null; } }
[ "yin-bp@163.com" ]
yin-bp@163.com
9ebf0e62fa9e40b83a6cb1fad9923d31514d9b0b
617f7a935b6fc493f6ef7b1fe061ae683527468f
/holdem-abs/src/main/java/ao/holdem/abs/odds/agglom/hist/StrengthHist.java
e76dbf26369d7c83256c03dc864dd5ca1c332bcc
[]
no_license
alexoooo/alexoholdem
bde574125fdcd49a82c8f2b4d8426f9483109672
9eef5168aa78254454400d5d3076d9d1770e4ade
refs/heads/master
2020-04-17T12:36:37.843728
2019-02-15T21:43:30
2019-02-15T21:43:30
166,585,757
1
0
null
null
null
null
UTF-8
Java
false
false
4,470
java
package ao.holdem.abs.odds.agglom.hist; import ao.holdem.engine.eval.HandStrength; import ao.holdem.persist.GenericBinding; import ao.util.data.Arrs; import ao.util.math.crypt.MD5; import ao.util.math.crypt.SecureHash; import com.sleepycat.bind.tuple.TupleInput; import com.sleepycat.bind.tuple.TupleOutput; import org.apache.log4j.Logger; import java.util.Arrays; /** * Date: Sep 29, 2008 * Time: 5:26:34 PM * * Histogram of possible strengths of hands. */ public class StrengthHist implements Comparable<StrengthHist> { //-------------------------------------------------------------------- private static final Logger LOG = Logger.getLogger(StrengthHist.class); //-------------------------------------------------------------------- private final int HIST[]; private double mean = Double.NaN; //-------------------------------------------------------------------- public StrengthHist() { this( new int[HandStrength.COUNT] ); } private StrengthHist(int hist[]) { HIST = hist; } //-------------------------------------------------------------------- public void count(short value) { HIST[ value ]++; mean = Double.NaN; } //-------------------------------------------------------------------- public int get(short value) { return HIST[ value ]; } public int maxCount() { int maxCount = 0; for (int count : HIST) { if (maxCount < count) { maxCount = count; } } return maxCount; } public long totalCount() { long total = 0; for (int count : HIST) total += count; return total; } //-------------------------------------------------------------------- public long secureHashCode() { SecureHash hash = new MD5(); for (int count : HIST) { hash.feed(count); } return hash.bigDigest().longValue(); } //-------------------------------------------------------------------- public double mean() { if (Double.isNaN(mean)) { mean = calculateMean(); } return mean; } private double calculateMean() { long sum = 0; long count = 0; for (int i = 0; i < HIST.length; i++) { long histCount = HIST[i]; sum += histCount * (i + 1); count += histCount; } return (double) sum / count; } //-------------------------------------------------------------------- public int compareTo(StrengthHist o) { return Double.compare(mean(), o.mean()); } //-------------------------------------------------------------------- @Override public String toString() { return Arrs.join(HIST, "\t"); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StrengthHist strengthHist = (StrengthHist) o; return Arrays.equals(HIST, strengthHist.HIST); } @Override public int hashCode() { return Arrays.hashCode(HIST); } //-------------------------------------------------------------------- public static final int BINDING_SIZE = HandStrength.COUNT * 4; public static final Binding BINDING = new Binding(); public static class Binding extends GenericBinding<StrengthHist> { public StrengthHist read(TupleInput input) { int hist[] = new int[ HandStrength.COUNT ]; for (int i = 0; i < hist.length; i++) { hist[i] = input.readInt(); } return new StrengthHist(hist); } public void write(StrengthHist o, TupleOutput to) { for (int i = 0; i < o.HIST.length; i++) { to.writeInt( o.HIST[i] ); } } } //-------------------------------------------------------------------- public static void main(String[] args) { StrengthHist h = new StrengthHist(); LOG.info(h.secureHashCode()); h.count((short) 0); LOG.info(h.secureHashCode()); h.count((short) 1); LOG.info(h.secureHashCode()); h.count((short) 2); LOG.info(h.secureHashCode()); } }
[ "ostrovsky.alex@gmail.com" ]
ostrovsky.alex@gmail.com
22582f4461a081ca40c8ca9738fd98db16291196
7caccf54d079388a20ae27ddd2ee88b299095a62
/src/test/java/com/chenlish/live/config/WebConfigurerTestController.java
4b0b952bf4b87436f05598fed82480a5b4d01c0f
[]
no_license
chenlish/jhipster-live
f333885c71a032941a13572f855579bf614f6d07
25114263c22c33fc17c38e1e3ad1ce01fa46d414
refs/heads/main
2023-07-25T12:53:00.682690
2021-09-05T06:32:49
2021-09-05T06:32:49
403,233,911
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.chenlish.live.config; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WebConfigurerTestController { @GetMapping("/api/test-cors") public void testCorsOnApiPath() {} @GetMapping("/test/test-cors") public void testCorsOnOtherPath() {} }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
3f85e8e127de400344ed13adeb701b61f3c50d09
1827d69543129013bfb10ae3d51d82967ee479b2
/code-generator/src/main/java/com/wk/CodeGeneratorApplication.java
361c758c446e1d7439e29875aff568dee1786ebf
[]
no_license
wk-001/cg-v3
42a5604fe2f1ad0639c513c619f56f6270ee5860
3cead4e86bfea03ae34696e3ff21078ef2c1c689
refs/heads/master
2022-06-23T17:48:43.210379
2020-04-07T02:46:13
2020-04-07T02:46:13
253,669,713
1
0
null
null
null
null
UTF-8
Java
false
false
325
java
package com.wk; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CodeGeneratorApplication { public static void main(String[] args) { SpringApplication.run(CodeGeneratorApplication.class, args); } }
[ "123@qq.com" ]
123@qq.com
aa5e366ec87ddcb921c6fce548cf2387eae636e1
2624bb8f13b871056306d811c76acb3104c052c8
/grape-weixin/src/main/java/com/saike/grape/weixin/bean/WeChatPublic.java
3bcb00c0b1dabd84908db1b2bab262bd89e04576
[]
no_license
liubao19860416/grape-weixin-
d25c12c197d8ee4fcb1fa54a04b3850edfc9bc1e
90345a56e788a3cc702b95adb7d67f5358f997e2
refs/heads/master
2021-01-10T08:12:11.444379
2015-10-24T11:06:31
2015-10-24T11:06:31
44,861,612
0
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
package com.saike.grape.weixin.bean; import java.io.Serializable; /** * 添加的微信拥有者信息 * * @author Liubao * @2015年6月29日 * */ public class WeChatPublic extends BaseBean implements Serializable { private static final long serialVersionUID = 9149213375158290109L; private String wechatId; private String appsecret; private String appid; private String userId; private String wechatPName; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } private String accessToken; public String getWechatId() { return wechatId; } public void setWechatId(String wechatId) { this.wechatId = wechatId; } public String getAccessToken() { return accessToken; } public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public String getAppsecret() { return appsecret; } public void setAppsecret(String appsecret) { this.appsecret = appsecret; } public String getAppid() { return appid; } public void setAppid(String appid) { this.appid = appid; } public void setWechatPName(String wechatPName) { this.wechatPName = wechatPName; } public String getWechatPName() { return wechatPName; } }
[ "18611478781@163.com" ]
18611478781@163.com
eb917eb77858006203c6c5b4519e03b9934bc82d
06da3da551d125b6c28f6eaf3be3f1fc4f106420
/AriaFtpPlug/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java
554f11eee576179d346bdf058681ddd66751947a
[ "Apache-2.0" ]
permissive
pangyu646182805/Aria
c24fe9221d534c9c78ef1782e9d2c15cca5f065a
2de77b11d672afd8fb78a1445b3aecaa03b9e1e6
refs/heads/master
2021-06-28T15:35:23.973216
2017-09-13T03:32:41
2017-09-13T03:32:41
103,469,544
2
0
null
2017-09-14T01:22:16
2017-09-14T01:22:16
null
UTF-8
Java
false
false
6,225
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.net.ftp.parser; import java.util.HashMap; import java.util.List; import java.util.ListIterator; import java.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.apache.commons.net.ftp.FTPClientConfig; /** * Special implementation VMSFTPEntryParser with versioning turned on. * This parser removes all duplicates and only leaves the version with the highest * version number for each filename. * * This is a sample of VMS LIST output * * "1-JUN.LIS;1 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", * "1-JUN.LIS;2 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", * "DATA.DIR;1 1/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", * <P> * * @version $Id: VMSVersioningFTPEntryParser.java 1747119 2016-06-07 02:22:24Z ggregory $ * * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions) */ public class VMSVersioningFTPEntryParser extends VMSFTPEntryParser { private final Pattern _preparse_pattern_; private static final String PRE_PARSE_REGEX = "(.*?);([0-9]+)\\s*.*"; /** * Constructor for a VMSFTPEntryParser object. * * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen * under normal conditions. It it is seen, this is a sign that * <code>REGEX</code> is not a valid regular expression. */ public VMSVersioningFTPEntryParser() { this(null); } /** * This constructor allows the creation of a VMSVersioningFTPEntryParser * object with something other than the default configuration. * * @param config The {@link FTPClientConfig configuration} object used to * configure this parser. * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen * under normal conditions. It it is seen, this is a sign that * <code>REGEX</code> is not a valid regular expression. * @since 1.4 */ public VMSVersioningFTPEntryParser(FTPClientConfig config) { super(); configure(config); try { //_preparse_matcher_ = new Perl5Matcher(); _preparse_pattern_ = Pattern.compile(PRE_PARSE_REGEX); } catch (PatternSyntaxException pse) { throw new IllegalArgumentException ( "Unparseable regex supplied: " + PRE_PARSE_REGEX); } } /** * Implement hook provided for those implementers (such as * VMSVersioningFTPEntryParser, and possibly others) which return * multiple files with the same name to remove the duplicates .. * * @param original Original list * * @return Original list purged of duplicates */ @Override public List<String> preParse(List<String> original) { HashMap<String, Integer> existingEntries = new HashMap<String, Integer>(); ListIterator<String> iter = original.listIterator(); while (iter.hasNext()) { String entry = iter.next().trim(); MatchResult result = null; Matcher _preparse_matcher_ = _preparse_pattern_.matcher(entry); if (_preparse_matcher_.matches()) { result = _preparse_matcher_.toMatchResult(); String name = result.group(1); String version = result.group(2); Integer nv = Integer.valueOf(version); Integer existing = existingEntries.get(name); if (null != existing) { if (nv.intValue() < existing.intValue()) { iter.remove(); // removes older version from original list. continue; } } existingEntries.put(name, nv); } } // we've now removed all entries less than with less than the largest // version number for each name that were listed after the largest. // we now must remove those with smaller than the largest version number // for each name that were found before the largest while (iter.hasPrevious()) { String entry = iter.previous().trim(); MatchResult result = null; Matcher _preparse_matcher_ = _preparse_pattern_.matcher(entry); if (_preparse_matcher_.matches()) { result = _preparse_matcher_.toMatchResult(); String name = result.group(1); String version = result.group(2); Integer nv = Integer.valueOf(version); Integer existing = existingEntries.get(name); if (null != existing) { if (nv.intValue() < existing.intValue()) { iter.remove(); // removes older version from original list. } } } } return original; } @Override protected boolean isVersioning() { return true; } } /* Emacs configuration * Local variables: ** * mode: java ** * c-basic-offset: 4 ** * indent-tabs-mode: nil ** * End: ** */
[ "511455842@qq.com" ]
511455842@qq.com
ad04873e0e0ec94b4226560a5c7c2212d2f7f155
d3a3f32b6e0bd2eeb3e19fc104ed8f1717ede1f6
/src/annotations/PasswordUtils.java
5be5428201ffc2e02785e6d76290641e8beefec9
[]
no_license
Cowerling/ThinkingInJava
2ead12fc1845cc2ae594cb9a0a0985af8846fc72
f8e12948b62772f79a20592170c34db5eff538e5
refs/heads/master
2021-01-10T17:59:14.899381
2016-04-28T15:28:36
2016-04-28T15:28:36
47,770,416
2
0
null
null
null
null
UTF-8
Java
false
false
684
java
package annotations; import java.util.*; /** * Created by dell on 2016/3/8. */ public class PasswordUtils { @UseCase(id = 47, description = "Passwords must contain at least one numeric") public boolean validatePassword(String password) { return (password.matches("\\w*\\d\\w*")); } @UseCase(id = 48) public String encryptPassword(String password) { return new StringBuilder(password).reverse().toString(); } @UseCase(id = 49, description = "New passwords can't equal previously used ones") public boolean checkForNewPassword(List<String> prevPasswords, String password) { return !prevPasswords.contains(password); } }
[ "Cowerling@gmail.com" ]
Cowerling@gmail.com
b26c0a6f13ceb288d0b5543a19b4b80eb33310a6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_dee7567d2af3c3a213fd127a06e972e79b08a5ad/CompositeFreezeLayer/16_dee7567d2af3c3a213fd127a06e972e79b08a5ad_CompositeFreezeLayer_t.java
368adad0c80bf70ca4cc8d77f626d199b92ca4cf
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,817
java
/******************************************************************************* * Copyright (c) 2012 Original authors and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Original authors and others - initial API and implementation ******************************************************************************/ package org.eclipse.nebula.widgets.nattable.freeze; import org.eclipse.nebula.widgets.nattable.command.ILayerCommand; import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; import org.eclipse.nebula.widgets.nattable.freeze.command.FreezeCommandHandler; import org.eclipse.nebula.widgets.nattable.freeze.config.DefaultFreezeGridBindings; import org.eclipse.nebula.widgets.nattable.grid.command.ClientAreaResizeCommand; import org.eclipse.nebula.widgets.nattable.grid.layer.DimensionallyDependentLayer; import org.eclipse.nebula.widgets.nattable.layer.CompositeLayer; import org.eclipse.nebula.widgets.nattable.layer.ILayer; import org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter; import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer; import org.eclipse.nebula.widgets.nattable.style.DisplayMode; import org.eclipse.nebula.widgets.nattable.util.GUIHelper; import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Rectangle; public class CompositeFreezeLayer extends CompositeLayer { private final FreezeLayer freezeLayer; private final ViewportLayer viewportLayer; private final SelectionLayer selectionLayer; private final ILayerPainter layerPainter = new FreezableLayerPainter(); public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer) { this(freezeLayer, viewportLayer, selectionLayer, true); } public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer, boolean useDefaultConfiguration) { super(2, 2); this.freezeLayer = freezeLayer; this.viewportLayer = viewportLayer; this.selectionLayer = selectionLayer; setChildLayer("FROZEN_REGION", freezeLayer, 0, 0); //$NON-NLS-1$ setChildLayer("FROZEN_ROW_REGION", new DimensionallyDependentLayer(selectionLayer, viewportLayer, freezeLayer), 1, 0); //$NON-NLS-1$ setChildLayer("FROZEN_COLUMN_REGION", new DimensionallyDependentLayer(selectionLayer, freezeLayer, viewportLayer), 0, 1); //$NON-NLS-1$ setChildLayer("NONFROZEN_REGION", viewportLayer, 1, 1); //$NON-NLS-1$ registerCommandHandlers(); if (useDefaultConfiguration) { addConfiguration(new DefaultFreezeGridBindings()); } } public boolean isFrozen() { return freezeLayer.isFrozen(); } @Override public ILayerPainter getLayerPainter() { return layerPainter; } @Override protected void registerCommandHandlers() { registerCommandHandler(new FreezeCommandHandler(freezeLayer, viewportLayer, selectionLayer)); } @Override public boolean doCommand(ILayerCommand command) { //if this layer should handle a ClientAreaResizeCommand we have to ensure that //it is only called on the ViewportLayer, as otherwise an undefined behaviour //could occur because the ViewportLayer isn't informed about potential refreshes if (command instanceof ClientAreaResizeCommand) { this.viewportLayer.doCommand(command); } return super.doCommand(command); } class FreezableLayerPainter extends CompositeLayerPainter { public FreezableLayerPainter() { } @Override public void paintLayer(ILayer natLayer, GC gc, int xOffset, int yOffset, Rectangle rectangle, IConfigRegistry configRegistry) { super.paintLayer(natLayer, gc, xOffset, yOffset, rectangle, configRegistry); Color separatorColor = configRegistry.getConfigAttribute(IFreezeConfigAttributes.SEPARATOR_COLOR, DisplayMode.NORMAL); if (separatorColor == null) { separatorColor = GUIHelper.COLOR_BLUE; } gc.setClipping(rectangle); Color oldFg = gc.getForeground(); gc.setForeground(separatorColor); final int freezeWidth = freezeLayer.getWidth() - 1; if (freezeWidth > 0) { gc.drawLine(xOffset + freezeWidth, yOffset, xOffset + freezeWidth, yOffset + getHeight() - 1); } final int freezeHeight = freezeLayer.getHeight() - 1; if (freezeHeight > 0) { gc.drawLine(xOffset, yOffset + freezeHeight, xOffset + getWidth() - 1, yOffset + freezeHeight); } gc.setForeground(oldFg); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0e15f5031e508288e1c1a8d7551330bba0413d7f
a3fe5db4cf9f5dc75b8331b1fe69de13e0549587
/activemq/util/ByteArrayOutputStream.java
a58ddb9f2a67331672e6fde224a1505632606400
[]
no_license
ShengtaoHou/software-recovery
7cd8e1a0aabadb808a0f00e5b0503a582c8d3c89
72a3dde6a0cba56f851c29008df94ae129a05d03
refs/heads/master
2020-09-26T08:25:54.952083
2019-12-11T07:32:57
2019-12-11T07:32:57
226,215,103
1
0
null
null
null
null
UTF-8
Java
false
false
1,932
java
// // Decompiled by Procyon v0.5.36 // package org.apache.activemq.util; import java.io.OutputStream; public class ByteArrayOutputStream extends OutputStream { byte[] buffer; int size; public ByteArrayOutputStream() { this(1028); } public ByteArrayOutputStream(final int capacity) { this.buffer = new byte[capacity]; } @Override public void write(final int b) { final int newsize = this.size + 1; this.checkCapacity(newsize); this.buffer[this.size] = (byte)b; this.size = newsize; } @Override public void write(final byte[] b, final int off, final int len) { final int newsize = this.size + len; this.checkCapacity(newsize); System.arraycopy(b, off, this.buffer, this.size, len); this.size = newsize; } private void checkCapacity(final int minimumCapacity) { if (minimumCapacity > this.buffer.length) { final byte[] b = new byte[Math.max(this.buffer.length << 1, minimumCapacity)]; System.arraycopy(this.buffer, 0, b, 0, this.size); this.buffer = b; } } public void reset() { this.size = 0; } public ByteSequence toByteSequence() { return new ByteSequence(this.buffer, 0, this.size); } public byte[] toByteArray() { final byte[] rc = new byte[this.size]; System.arraycopy(this.buffer, 0, rc, 0, this.size); return rc; } public int size() { return this.size; } public boolean endsWith(final byte[] array) { int i = 0; int start = this.size - array.length; if (start < 0) { return false; } while (start < this.size) { if (this.buffer[start++] != array[i++]) { return false; } } return true; } }
[ "shengtao@ShengtaoHous-MacBook-Pro.local" ]
shengtao@ShengtaoHous-MacBook-Pro.local
f1f24b65b4bf141cf4426b163c7c9e5bfeb35071
0814926bb73ae5ac92022638d0a11d3afe27beb0
/app/src/main/java/com/sj/yinjiaoyun/xuexi/db/DBcolumns.java
a0266e869ddbb605c9770034cb67e6c009350d39
[]
no_license
fyhtosky/5xuexi
287e19745de18555b63163a2de45bf07d610978d
07477d74c85332176f81606fa7760b23b0de9a09
refs/heads/master
2020-03-21T08:55:30.539607
2018-06-25T03:57:29
2018-06-25T03:57:29
138,374,168
0
0
null
null
null
null
UTF-8
Java
false
false
2,798
java
package com.sj.yinjiaoyun.xuexi.db; /** * * @author 白玉梁 */ public class DBcolumns { /** * 聊天消息信息表 */ public static final String TABLE_MSG= "table_msg"; public static final String MSG_ID = "msg_id"; public static final String MSG_FROM = "msg_from"; public static final String MSG_TO = "msg_to"; public static final String MSG_TYPE = "msg_type"; public static final String MSG_CONTENT = "msg_content"; public static final String MSG_ISCOMING = "msg_iscoming"; public static final String MSG_DATE= "msg_date"; public static final String MSG_ISREADED = "msg_isreaded"; public static final String MSG_BAK1= "msg_bak1"; public static final String MSG_BAK2 = "msg_bak2"; public static final String MSG_BAK3 = "msg_bak3"; public static final String MSG_BAK4= "msg_bak4"; public static final String MSG_BAK5= "msg_bak5"; public static final String MSG_BAK6= "msg_bak6"; /** * 聊天会话表 */ public static final String TABLE_SESSION = "table_session"; public static final String SESSION_id = "session_id"; public static final String SESSION_FROM = "session_from"; public static final String SESSION_TYPE = "session_type"; public static final String SESSION_TIME = "session_time"; public static final String SESSION_CONTENT = "session_content"; public static final String SESSION_TO = "session_to";// 登录人id public static final String SESSION_ISDISPOSE = "session_isdispose"; /** * 好友消息通知表 */ public static final String TABLE_SYS_NOTICE = "table_sys_notice"; public static final String SYS_NOTICE_ID = "sys_notice_id"; public static final String SYS_NOTICE_TYPE = "sys_notice_type"; public static final String SYS_NOTICE_FROM= "sys_notice_from"; public static final String SYS_NOTICE_FROM_HEAD = "sys_notice_from_head"; public static final String SYS_NOTICE_CONTENT = "sys_notice_content"; public static final String SYS_NOTICE_ISDISPOSE = "sys_notice_isdispose"; /** * 最近回话列表 * */ public static final String TABLE_ROW="table_row"; public static final String TABLE_ROW_ID="table_row_id"; public static final String TABLE_ROW_SENDER="table_row_sender"; public static final String TABLE_ROW_RECEIVER="table_row_receiver"; public static final String TABLE_ROW_MSG="table_row_msg"; public static final String TABLE_ROW_SYSTEM="table_row_system"; public static final String TABLE_ROW_MSG_TYPE="table_row_msg_type"; public static final String TABLE_ROW_CREATE_TIME="table_row_create_time"; public static final String TABLE_ROW_MSG_COUNT="table_row_msg_count"; public static final String TABLE_ROW_MSG_NAME="table_row_msg_name"; public static final String TABLE_ROW_MSG_LOGO="table_row_msg_logo"; public static final String TABLE_ROW_SENDER_NAME="table_row_sender_name"; }
[ "you@example.com" ]
you@example.com
b2d0329997210cea93c24ff0827c1e1d592766e9
be59c0ca127a4f7041758b2709e1327bc71b6e12
/qipai/guajiLogin/src/main/java/com/sy/sanguo/common/util/CoderUtil.java
2f32b370e3b725126e789781bf51d915ff5d7989
[]
no_license
Yiwei-TEST/xxqp-server
2389dd6b12614b0a9557d59b473f88a3a59620cf
c2c683ce8060c0cbaee86c3ee550e0195e1bb7e4
refs/heads/main
2023-08-14T08:49:37.586893
2021-09-15T03:21:13
2021-09-15T03:21:13
401,583,086
1
4
null
null
null
null
UTF-8
Java
false
false
2,610
java
package com.sy.sanguo.common.util; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; public class CoderUtil { public static final String DEFAULT_CHARSET = "UTF-8"; /** * 解码 * * @param str * @param charset * @return * @throws UnsupportedEncodingException */ public static final String decode(String str, String charset) throws UnsupportedEncodingException { try { return URLDecoder.decode(str, charset); } catch (UnsupportedEncodingException e) { throw e; } catch (Exception e) { return str; } } /** * 编码 * * @param str * @param charset * @return * @throws UnsupportedEncodingException */ public static final String encode(String str, String charset) throws UnsupportedEncodingException { return URLEncoder.encode(str, charset); } /** * UTF-8解码 * * @param str * @return * @throws UnsupportedEncodingException */ public static final String decode(String str) throws UnsupportedEncodingException { return decode(str, DEFAULT_CHARSET); } /** * UTF-8编码 * * @param str * @return * @throws UnsupportedEncodingException */ public static final String encode(String str) throws UnsupportedEncodingException { return encode(str, DEFAULT_CHARSET); } /** * 解码 * * @param str * @param charset * @return * @throws UnsupportedEncodingException */ public static final String decode(String str, String charset, int count) throws UnsupportedEncodingException { for (int i = 0; i < count; i++) { str = URLDecoder.decode(str, charset); } return str; } /** * 编码 * * @param str * @param charset * @param count * @return * @throws UnsupportedEncodingException */ public static final String encode(String str, String charset, int count) throws UnsupportedEncodingException { for (int i = 0; i < count; i++) { str = URLEncoder.encode(str, charset); } return str; } /** * UTF-8解码 * * @param str * @param count * @return * @throws UnsupportedEncodingException */ public static final String decode(String str, int count) throws UnsupportedEncodingException { for (int i = 0; i < count; i++) { str = decode(str, DEFAULT_CHARSET); } return str; } /** * UTF-8编码 * * @param str * @param count * @return * @throws UnsupportedEncodingException */ public static final String encode(String str, int count) throws UnsupportedEncodingException { for (int i = 0; i < count; i++) { str = encode(str, DEFAULT_CHARSET); } return str; } }
[ "ee68i5@yeah.net" ]
ee68i5@yeah.net
7b5a14183ecec2f228ac0592d271d9302e66f29b
3883554587c8f3f75a7bebd746e1269b8e1e5ef1
/kubernetes-model-generator/kubernetes-model-flowcontrol/src/generated/java/io/fabric8/kubernetes/api/model/flowcontrol/v1beta1/PriorityLevelConfigurationCondition.java
b4edcacb301bacf423de8fc3b8b510baa5e6d59a
[ "Apache-2.0" ]
permissive
KamalSinghKhanna/kubernetes-client
58f663fdc0ca4b6006ae1448ac89b04b6093e46d
08261fba6c9306eb063534ec2320e9166f85c71c
refs/heads/master
2023-08-17T04:33:28.646984
2021-09-23T17:17:24
2021-09-23T17:17:24
409,863,910
1
0
Apache-2.0
2021-09-24T06:55:57
2021-09-24T06:55:57
null
UTF-8
Java
false
false
4,800
java
package io.fabric8.kubernetes.api.model.flowcontrol.v1beta1; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.ToString; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "lastTransitionTime", "message", "reason", "status", "type" }) @ToString @EqualsAndHashCode @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) public class PriorityLevelConfigurationCondition implements KubernetesResource { @JsonProperty("lastTransitionTime") private String lastTransitionTime; @JsonProperty("message") private java.lang.String message; @JsonProperty("reason") private java.lang.String reason; @JsonProperty("status") private java.lang.String status; @JsonProperty("type") private java.lang.String type; @JsonIgnore private Map<java.lang.String, Object> additionalProperties = new HashMap<java.lang.String, Object>(); /** * No args constructor for use in serialization * */ public PriorityLevelConfigurationCondition() { } /** * * @param reason * @param lastTransitionTime * @param message * @param type * @param status */ public PriorityLevelConfigurationCondition(String lastTransitionTime, java.lang.String message, java.lang.String reason, java.lang.String status, java.lang.String type) { super(); this.lastTransitionTime = lastTransitionTime; this.message = message; this.reason = reason; this.status = status; this.type = type; } @JsonProperty("lastTransitionTime") public String getLastTransitionTime() { return lastTransitionTime; } @JsonProperty("lastTransitionTime") public void setLastTransitionTime(String lastTransitionTime) { this.lastTransitionTime = lastTransitionTime; } @JsonProperty("message") public java.lang.String getMessage() { return message; } @JsonProperty("message") public void setMessage(java.lang.String message) { this.message = message; } @JsonProperty("reason") public java.lang.String getReason() { return reason; } @JsonProperty("reason") public void setReason(java.lang.String reason) { this.reason = reason; } @JsonProperty("status") public java.lang.String getStatus() { return status; } @JsonProperty("status") public void setStatus(java.lang.String status) { this.status = status; } @JsonProperty("type") public java.lang.String getType() { return type; } @JsonProperty("type") public void setType(java.lang.String type) { this.type = type; } @JsonAnyGetter public Map<java.lang.String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(java.lang.String name, Object value) { this.additionalProperties.put(name, value); } }
[ "marc@marcnuri.com" ]
marc@marcnuri.com
683c9cbad4e419fe72ed8f6b8e343f1e4db0590c
578a93131902626d32ee7ceb4ddbf49d3386892d
/src/com/casic27/platform/bpm/service/paticipant/BpmNodeParticipantCalculationStartUser.java
8dfd97a5243663f6f595aa35221051ad3588a6bd
[]
no_license
darknessitachi/kcPlatform
0bf061ae3a914242f3c968f57ca2110ffcb309e4
f7ee9b92dada46d3e10d7a4b8414cf1669a7541d
refs/heads/master
2021-01-21T05:29:07.981525
2015-09-21T11:21:44
2015-09-21T11:21:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,534
java
package com.casic27.platform.bpm.service.paticipant; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.casic27.platform.bpm.entity.BpmNodeParticipant; import com.casic27.platform.bpm.entity.TaskExecutor; import com.casic27.platform.common.user.entity.User; import com.casic27.platform.common.user.service.UserService; /** * 分配类型为发起人 * @author Administrator * */ @Component public class BpmNodeParticipantCalculationStartUser implements IBpmNodeParticipantCalculation { @Autowired private UserService userService; @Override public List<User> getExecutor(BpmNodeParticipant bpmNodeParticipant, CalcVars vars) { String startUserId = vars.getStartUserId(); List<User> list = new ArrayList<User>(); User user = userService.getUserById(startUserId); list.add(user); return list; } @Override public Set<TaskExecutor> getTaskExecutor(BpmNodeParticipant bpmNodeParticipant, CalcVars vars) { String startUserId = vars.getStartUserId(); Set<TaskExecutor> list = new LinkedHashSet<TaskExecutor>(); User user = userService.getUserById(startUserId); list.add(TaskExecutor.getTaskUser(user.getZjid(),user.getYhmc())); return list; } @Override public String getTitle() { return "发起人"; } @Override public String getKey() { return "1"; } }
[ "515585452@qq.com" ]
515585452@qq.com
0ddcaf1048930348e26871cc177169dcc18af663
145993c6190554c00c014e47338c891199a3e467
/asProject/androidPlayer/androidPlayer/src/main/java/com/android/player/widget/MyPopupDialog.java
42579d0c7b0193538e0f891c66abafb451b4803a
[]
no_license
cuipengpeng/codeUtil
d45d4f239de40fe2806011b5b7fd6238b23e940c
ae0bdbcf6237fa3cfb6fac724e487627ee06d1c3
refs/heads/master
2023-02-25T14:57:56.259687
2023-01-04T13:09:19
2023-02-10T16:14:10
126,859,505
0
0
null
null
null
null
UTF-8
Java
false
false
6,104
java
package com.android.player.widget; import android.app.Dialog; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.EditText; import android.widget.RelativeLayout; import android.widget.TextView; import com.android.player.R; /** * 弹出一个或两个对话框的按钮的类 */ public class MyPopupDialog extends Dialog implements android.view.View.OnClickListener{ private LayoutInflater inflater; private Context mContext; private View view; /**标识是否为两个按钮。*/ private boolean isTwoButton; /**标题*/ public TextView mPop_dialog_tv_title; /**显示内容*/ public TextView mPop_dialog_tv_content; /**显示两对话按钮*/ private RelativeLayout mPop_dialog_rl_two_button; /**左边按钮显示的内容*/ public TextView mPop_dialog_tv_left_content; /**右边按钮*/ public TextView mPop_dialog_tv_right_content; /**一个按钮*/ public TextView mPop_dialog_tv_one_button; public EditText mEdittext; private boolean verifyLoginPassword = false; private OnClickListen mOnClickListen; private String mTitle; private String mContent; private String mLeftBtn; private String mRightBtn; private String mOneBtn; // public MyPopupDialog(Context context, int theme) { // super(context, theme); // } // // protected MyPopupDialog(Context context, boolean cancelable, OnCancelListener cancelListener) { // super(context, cancelable, cancelListener); // } // // public MyPopupDialog(Context context) { // super(context); // inflater = LayoutInflater.from(context); // view = inflater.inflate(R.layout.dialog_fragment_pop, null); // bindViews(); // } /** * * @param context * @param mTitle 标题 * @param mContent 内容 * @param mLeftBtn * @param mRightBtn * @param mOneBtn * @param isTwoButton 是否显示两个按钮 */ public MyPopupDialog(Context context, String mTitle, String mContent, String mLeftBtn, String mRightBtn, String mOneBtn, boolean isTwoButton) { super(context); mContext = context; verifyLoginPassword = false; inflater = LayoutInflater.from(context); view = inflater.inflate(R.layout.dialog_fragment_pop, null); getWindow().requestFeature(Window.FEATURE_NO_TITLE); getWindow().setBackgroundDrawable(context.getResources().getDrawable(R.drawable.circle_corner_white_bg)); setContentView(view); this.mTitle = mTitle; this.mContent = mContent; this.mLeftBtn = mLeftBtn; this.mRightBtn = mRightBtn; this.mOneBtn = mOneBtn; this.isTwoButton = isTwoButton; bindViews(); } public MyPopupDialog(Context context, String mTitle, String mContent, String mLeftBtn, String mRightBtn, String mOneBtn, boolean isTwoButton, boolean verifyLoginPassword) { super(context); mContext = context; this.verifyLoginPassword = verifyLoginPassword; inflater = LayoutInflater.from(context); if(verifyLoginPassword){ view = inflater.inflate(R.layout.dialog_verify_login_password, null); }else { view = inflater.inflate(R.layout.dialog_fragment_pop, null); } getWindow().requestFeature(Window.FEATURE_NO_TITLE); getWindow().setBackgroundDrawable(context.getResources().getDrawable(R.drawable.circle_corner_white_bg)); setContentView(view); this.mTitle = mTitle; this.mContent = mContent; this.mLeftBtn = mLeftBtn; this.mRightBtn = mRightBtn; this.mOneBtn = mOneBtn; this.isTwoButton = isTwoButton; bindViews(); } /** * 设置回调监听接口 */ public interface OnClickListen{ public void leftClick(); public void rightClick(); } /** * 设置点击监听 * @param mOnClickListen */ public void setOnClickListen(OnClickListen mOnClickListen) { this.mOnClickListen = mOnClickListen; } /** * 初始化View以及设置监听 */ private void bindViews() { mPop_dialog_tv_title = (TextView) view.findViewById(R.id.pop_dialog_tv_title); mPop_dialog_tv_content = (TextView) view.findViewById(R.id.pop_dialog_tv_content); mPop_dialog_rl_two_button = (RelativeLayout) view.findViewById(R.id.pop_dialog_rl_two_button); mPop_dialog_tv_left_content = (TextView) view.findViewById(R.id.pop_dialog_tv_left_content); mPop_dialog_tv_right_content = (TextView) view.findViewById(R.id.pop_dialog_tv_right_content); mPop_dialog_tv_one_button = (TextView) view.findViewById(R.id.pop_dialog_tv_one_button); if (null == mTitle) { mPop_dialog_tv_title.setVisibility(View.GONE); }else { mPop_dialog_tv_title.setVisibility(View.VISIBLE); mPop_dialog_tv_title.setText(mTitle); } mPop_dialog_tv_content.setText(mContent); if (isTwoButton) { mPop_dialog_tv_one_button.setVisibility(View.GONE); mPop_dialog_tv_left_content.setText(mLeftBtn); mPop_dialog_tv_right_content.setText(mRightBtn); }else{ mPop_dialog_rl_two_button.setVisibility(View.GONE); mPop_dialog_tv_one_button.setText(mOneBtn); //79c5f9 } mPop_dialog_tv_left_content.setTextColor(mContext.getResources().getColor(R.color.appViewFullTextColor)); //设置字体颜色 mPop_dialog_tv_right_content.setTextColor(mContext.getResources().getColor(R.color.appViewFullTextColor)); mPop_dialog_tv_one_button.setTextColor(mContext.getResources().getColor(R.color.appViewFullTextColor)); mPop_dialog_tv_left_content.setOnClickListener(this); mPop_dialog_tv_right_content.setOnClickListener(this); mPop_dialog_tv_one_button.setOnClickListener(this); if(verifyLoginPassword){ mEdittext = (EditText) view.findViewById(R.id.pop_dialog_et_login_pwd); } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.pop_dialog_tv_left_content: //点击左边按钮 mOnClickListen.leftClick(); break; case R.id.pop_dialog_tv_right_content: //右边按钮 mOnClickListen.rightClick(); break; case R.id.pop_dialog_tv_one_button: //点击一个按钮时 mOnClickListen.rightClick(); break; default: break; } } }
[ "abcd123@123.com" ]
abcd123@123.com
7f173d02e2e4e0105ff3eb56cfd0575127984ab5
6f581e209761374a5fa4d49730cff4e8fedc06cb
/src/main/java/ru/epam/javacore/lesson_14_serialization/homework/carrier/exception/unchecked/CarrierDeleteConstraintViolationException.java
b66c7f5ff903b78aea2997eeb31aa1ea684ea3aa
[]
no_license
DmitryYusupov/epamjavacore
b4cfe78ba608e05d855568704b13d696d357474a
6f5009c89d372dbeb7dd5daffaed47e383ad93c0
refs/heads/master
2022-02-14T00:42:11.032705
2020-02-13T08:31:15
2020-02-13T08:31:15
225,563,013
0
10
null
2022-01-21T23:37:23
2019-12-03T07:59:48
Java
UTF-8
Java
false
false
646
java
package ru.epam.javacore.lesson_14_serialization.homework.carrier.exception.unchecked; import ru.epam.javacore.lesson_14_serialization.homework.common.business.exception.unchecked.OurCompanyUncheckedException; public class CarrierDeleteConstraintViolationException extends OurCompanyUncheckedException { private static final String MESSAGE = "Cant delete carrier with id '%s'. There are transportations which relates to it!"; public CarrierDeleteConstraintViolationException(String message) { super(message); } public CarrierDeleteConstraintViolationException(long carrierId) { this(String.format(MESSAGE, carrierId)); } }
[ "Dmitry_Yusupov@epam.com" ]
Dmitry_Yusupov@epam.com
9568385ba3914de7641ac09b2083d3515e29ccc5
e942f8f56530d6f1dd8559f6f8508fa6ce286986
/mirage/src/main/java/Interactions/DropdownAction.java
b3ff87966aed9c5ddcb82284f8202d6bd3042e68
[]
no_license
GowthamKandanuru/Flipkart
acd680d49c293288c772996d96bc61f85eb512eb
cc5c4664e8b6b995b42d4c254f41d29752c1dc20
refs/heads/master
2021-07-07T10:43:34.769258
2020-02-28T19:52:59
2020-02-28T19:52:59
238,291,348
0
0
null
2021-04-26T20:00:15
2020-02-04T19:45:16
HTML
UTF-8
Java
false
false
1,609
java
package Interactions; import java.util.List; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.*; import Config.PropertyFile; import PageObject.*; import Utility.ExcelUtils; public class DropdownAction { WebDriver driver; PropertyFile prop; Actions a; List<String> s; WebDriverWait wait; Select select; JavascriptExecutor js; public DropdownAction() { prop = new PropertyFile(); System.setProperty(prop.getDriver(),prop.getDriverPath()); driver = new FirefoxDriver(); wait = new WebDriverWait(driver,30); a = new Actions(driver); js = (JavascriptExecutor)driver; } public void Login() { LoginPage l = PageFactory.initElements(driver,LoginPage.class); driver.get(prop.getUrl()); l.username.sendKeys(prop.getUser()); l.password.sendKeys(prop.getPass()); l.login.click(); } public void verifyDropdown() throws Throwable { SearchBox box = PageFactory.initElements(driver,SearchBox.class); DropDown d = PageFactory.initElements(driver,DropDown.class); s = ExcelUtils.getData(prop.getExcelPath(),prop.getSheet()); for(String s1 : s) { if(s1.equals("Puma")) { box.searchbox.sendKeys(s1); box.searchbox.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOf(d.obj)).click(); js.executeScript("window.scrollBy(0,500)"); select = new Select(d.dropdown); select.selectByValue("1000"); break; } } } public void closeBrowser() { driver.quit(); } }
[ "you@example.com" ]
you@example.com
f5685f8e51e85a4e2db9f398fd6f5cc4aaa68cc3
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13942-3-20-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/model/internal/reference/AbstractStringEntityReferenceResolver_ESTest.java
58205c43344bad3d98bf78473d5c22a2319dbf29
[]
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
1,041
java
/* * This file was automatically generated by EvoSuite * Tue Apr 07 16:19:33 UTC 2020 */ package org.xwiki.model.internal.reference; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.xwiki.model.internal.reference.DefaultSymbolScheme; import org.xwiki.model.internal.reference.ExplicitStringEntityReferenceResolver; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class AbstractStringEntityReferenceResolver_ESTest extends AbstractStringEntityReferenceResolver_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { Object[] objectArray0 = new Object[4]; ExplicitStringEntityReferenceResolver explicitStringEntityReferenceResolver0 = new ExplicitStringEntityReferenceResolver(); DefaultSymbolScheme defaultSymbolScheme0 = new DefaultSymbolScheme(); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
6046a7e43b3aed6bccccbd4102b8612aca670b8a
7cfde3b082522eeb5fb1d4546ebc6ab24a4f11a4
/wgames/gameserver/src/main/java/org/linlinjava/litemall/gameserver/process/C4274_0.java
c9e2a6c681b58a3ee40aa83bd89cc58731912fe0
[]
no_license
miracle-ET/DreamInMiracle
9f784e7f373e78a7011aceb2b5b78ce6f5b7c268
2587221feb4fd152fc91cabd533b383c7e44b86f
refs/heads/master
2022-07-21T21:44:55.253764
2020-01-03T03:59:17
2020-01-03T03:59:17
231,498,544
0
2
null
2022-06-21T02:33:57
2020-01-03T02:41:06
Java
UTF-8
Java
false
false
1,394
java
package org.linlinjava.litemall.gameserver.process; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import org.linlinjava.litemall.gameserver.GameHandler; import org.linlinjava.litemall.gameserver.data.GameReadTool; import org.linlinjava.litemall.gameserver.data.vo.Vo_4275_0; import org.linlinjava.litemall.gameserver.data.write.M4275_0; import org.linlinjava.litemall.gameserver.fight.FightManager; import org.linlinjava.litemall.gameserver.game.GameObjectChar; import org.springframework.stereotype.Service; @Service public class C4274_0 implements GameHandler { @Override public void process(ChannelHandlerContext ctx, ByteBuf buff) { int current_time = GameReadTool.readInt(buff); int peer_time = GameReadTool.readInt(buff); Vo_4275_0 vo_4275_0 = new Vo_4275_0(); vo_4275_0.a = peer_time + 10000 + FightManager.RANDOM.nextInt(500); final GameObjectChar session = GameObjectChar.getGameObjectChar(); final long time = System.currentTimeMillis(); if (time - session.heartEcho < 3000) { ctx.disconnect(); } session.heartEcho = System.currentTimeMillis(); final ByteBuf write = new M4275_0().write(vo_4275_0); ctx.writeAndFlush(write); } @Override public int cmd() { return 4274; } }
[ "Administrator@DESKTOP-M4SH3SF" ]
Administrator@DESKTOP-M4SH3SF
0fc338471bfeec01e99b51bb27520f08f87a3d15
a31467252e383a5cf8b527627686be70211edf39
/src/main/java/exceptions/FinallyWorks.java
bc48e294ccedb61cd98769e9c5ff8b7366530f6e
[]
no_license
xiaozhiliaoo/thinkinginjava-practice
214604f6e843ffc989b2c8bc2f62e11fc17622f5
c47a8c578dfef275cfe956252a2462554f245020
refs/heads/master
2022-08-09T18:08:39.063874
2022-07-30T09:57:35
2022-07-30T09:57:35
248,148,101
0
0
null
2020-10-13T20:26:58
2020-03-18T05:41:16
Java
UTF-8
Java
false
false
900
java
package exceptions;//: exceptions/FinallyWorks.java // The finally clause is always executed. class ThreeException extends Exception { } public class FinallyWorks { //计数器 static int count = 0; public static void main(String[] args) { while (true) { try { // Post-increment is zero first time: 后置++ if (count++ == 0) { throw new ThreeException(); } System.out.println("No exception"); } catch (ThreeException e) { System.out.println("ThreeException"); } finally { System.out.println("In finally clause"); if (count == 2){ break; } // out of "while" } } } } /* Output: ThreeException In finally clause No exception In finally clause *///:~
[ "lili@chainup.com" ]
lili@chainup.com
dee8aa9db37933fc016d92689372be3a02669a00
20591524b55c1ce671fd325cbe41bd9958fc6bbd
/tlt-demo/src/main/java/com/allinpay/demo/util/DemoUtil.java
752407b19cf32b88652b23085529cff74998dad1
[]
no_license
ybak/loans-suniu
7659387eab42612fce7c0fa80181f2a2106db6e1
b8ab9bfa5ad8be38dc42c0e02b73179b11a491d5
refs/heads/master
2021-03-24T01:00:17.702884
2019-09-25T15:28:35
2019-09-25T15:28:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,114
java
package com.allinpay.demo.util; import java.security.Provider; import java.text.SimpleDateFormat; import java.util.Date; import org.bouncycastle.jce.provider.BouncyCastleProvider; import com.allinpay.demo.AIPGException; import com.allinpay.demo.DemoConfig; import com.allinpay.demo.xstruct.common.InfoReq; /** * @Description * @Author meixf@allinpay.com * @Date 2018年5月24日 **/ public class DemoUtil { private static Provider prvd = null; static { prvd = new BouncyCastleProvider(); } public static InfoReq makeReq(String trxcod,String merchantid,String username,String userpass) { InfoReq info = new InfoReq(); info.setTRX_CODE(trxcod); info.setREQ_SN(merchantid + String.format("-%016d", System.currentTimeMillis())); info.setUSER_NAME(username); info.setUSER_PASS(userpass); info.setLEVEL("5"); info.setDATA_TYPE("2"); info.setVERSION("05"); info.setMERCHANT_ID(merchantid); return info; } public static String getNow() { SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); return df.format(new Date()); } /** * @param xmlMsg 待签名报文 * @return 签名后的报文 * @throws AIPGException */ public static String buildSignedXml(String xmlMsg,String pfxpass, String... keyFile) throws AIPGException { if (xmlMsg == null) { throw new AIPGException("传入的加签报文为空"); } String IDD_STR = "<SIGNED_MSG></SIGNED_MSG>"; if (xmlMsg.indexOf(IDD_STR) == -1) { throw new AIPGException("找不到签名信息字段"); } String strMsg = xmlMsg.replaceAll(IDD_STR, ""); AIPGSignature signature = new AIPGSignature(prvd); System.out.println("加签内容" + strMsg); String newKeyFile = null; if (keyFile != null) { newKeyFile = keyFile[0]; } String signedStr = signature.signMsg(strMsg, newKeyFile, pfxpass); String strRnt = xmlMsg.replaceAll(IDD_STR, "<SIGNED_MSG>" + signedStr + "</SIGNED_MSG>"); return strRnt; } /** * @param xmlMsg 返回报文 * @param pathCer 通联公钥 * @return * @throws AIPGException310001 */ public static boolean verifyXml(String xmlMsg, String... pathcer) throws AIPGException { if (xmlMsg == null) { throw new AIPGException("传入的验签报文为空"); } int pre = xmlMsg.indexOf("<SIGNED_MSG>"); int suf = xmlMsg.indexOf("</SIGNED_MSG>"); if (pre == -1 || suf == -1 || pre >= suf) { throw new AIPGException("找不到签名信息"); } String signedStr = xmlMsg.substring(pre + 12, suf); String msgStr = xmlMsg.substring(0, pre) + xmlMsg.substring(suf + 13); AIPGSignature signature = new AIPGSignature(prvd); String newPathcer = null; if (pathcer.length > 0) { newPathcer = pathcer[0]; } return signature.verifyMsg(signedStr, msgStr, newPathcer); } }
[ "tiramisuy18@163.com" ]
tiramisuy18@163.com
c8ed888d9eff3487fb70db6fe3b8b5d12fb8f0ab
79c4ee1dd1db53267b8466c5f6a69312a715ad96
/frameworkx/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/FailbackClusterInvoker.java
adb2a5ae344f9bfb1f5c8d7495d4e13752a6499c
[ "Apache-2.0" ]
permissive
nince-wyj/jahhan
8978eaaa612e61d18f258b56bd386c32e6c7cdbe
9ee33e3b6380fdf516b0b88ceae43f3c67e87c15
refs/heads/master
2022-11-17T14:50:05.429321
2019-11-10T01:00:47
2019-11-10T01:00:47
71,103,781
11
8
Apache-2.0
2022-11-16T07:34:45
2016-10-17T05:45:48
Java
UTF-8
Java
false
false
4,397
java
/* * Copyright 1999-2011 Alibaba Group. * * 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.alibaba.dubbo.rpc.cluster.support; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import com.alibaba.dubbo.common.utils.NamedThreadFactory; import com.alibaba.dubbo.rpc.Invocation; import com.alibaba.dubbo.rpc.Invoker; import com.alibaba.dubbo.rpc.Result; import com.alibaba.dubbo.rpc.RpcResult; import com.alibaba.dubbo.rpc.cluster.Directory; import lombok.extern.slf4j.Slf4j; import net.jahhan.common.extension.exception.JahhanException; import net.jahhan.spi.LoadBalance; /** * 失败自动恢复,后台记录失败请求,定时重发,通常用于消息通知操作。 * * @author tony.chenl */ @Slf4j public class FailbackClusterInvoker<T> extends AbstractClusterInvoker<T> { private static final long RETRY_FAILED_PERIOD = 5 * 1000; private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2, new NamedThreadFactory("failback-cluster-timer", true)); private volatile ScheduledFuture<?> retryFuture; private final ConcurrentMap<Invocation, AbstractClusterInvoker<?>> failed = new ConcurrentHashMap<Invocation, AbstractClusterInvoker<?>>(); public FailbackClusterInvoker(Directory<T> directory){ super(directory); } private void addFailed(Invocation invocation, AbstractClusterInvoker<?> router) { if (retryFuture == null) { synchronized (this) { if (retryFuture == null) { retryFuture = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() { public void run() { // 收集统计信息 try { retryFailed(); } catch (Throwable t) { // 防御性容错 log.error("Unexpected error occur at collect statistic", t); } } }, RETRY_FAILED_PERIOD, RETRY_FAILED_PERIOD, TimeUnit.MILLISECONDS); } } } failed.put(invocation, router); } void retryFailed() { if (failed.size() == 0) { return; } for (Map.Entry<Invocation, AbstractClusterInvoker<?>> entry : new HashMap<Invocation, AbstractClusterInvoker<?>>( failed).entrySet()) { Invocation invocation = entry.getKey(); Invoker<?> invoker = entry.getValue(); try { invoker.invoke(invocation); failed.remove(invocation); } catch (Throwable e) { log.error("Failed retry to invoke method " + invocation.getMethodName() + ", waiting again.", e); } } } protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws JahhanException { try { checkInvokers(invokers, invocation); Invoker<T> invoker = select(loadbalance, invocation, invokers, null); return invoker.invoke(invocation); } catch (Throwable e) { log.error("Failback to invoke method " + invocation.getMethodName() + ", wait for retry in background. Ignored exception: " + e.getMessage() + ", ", e); addFailed(invocation, this); return new RpcResult(); // ignore } } }
[ "41284688@qq.com" ]
41284688@qq.com
b5a35450da3029188da28c3c8acdaa3c68ebf408
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_234977778cb204ad559d1c0f85cdfe7fba66077c/TeachingAssistantRecordImpl/7_234977778cb204ad559d1c0f85cdfe7fba66077c_TeachingAssistantRecordImpl_s.java
3bcb8e6118fb6cbcbaff7e3b74c5bb2283964ba2
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,431
java
/********************************************************************************** * * $Id$ * *********************************************************************************** * * Copyright (c) 2005 The Regents of the University of California, The Regents of the University of Michigan, * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation * * Licensed under the Educational Community License Version 1.0 (the "License"); * By obtaining, using and/or copying this Original Work, you agree that you have read, * understand, and will comply with the terms and conditions of the Educational Community License. * You may obtain a copy of the License at: * * http://cvs.sakaiproject.org/licenses/license_1_0.html * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **********************************************************************************/ package org.sakaiproject.component.section.sakai20; import java.io.Serializable; import org.sakaiproject.api.section.coursemanagement.LearningContext; import org.sakaiproject.api.section.coursemanagement.User; import org.sakaiproject.api.section.facade.Role; /** * A detachable TeachingAssistantRecord for persistent storage. * * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a> * */ public class TeachingAssistantRecordImpl extends ParticipationRecordImpl implements Serializable { private static final long serialVersionUID = 1L; /** * No-arg constructor needed for hibernate */ public TeachingAssistantRecordImpl() { } public TeachingAssistantRecordImpl(LearningContext learningContext, User user) { this.learningContext = learningContext; this.user = user; } public Role getRole() { return Role.TA; } } /********************************************************************************** * $Id$ *********************************************************************************/
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f20a986f17a46bab266b1343649a0af8aa45fe33
c8664fc194971e6e39ba8674b20d88ccfa7663b1
/com/tencent/mm/protocal/c/xm.java
35801664e2331aec1a300720c0f30186fac88080
[]
no_license
raochuan/wexin1120
b926bc8d4143c4b523ed43e265cd20ef0c89ad40
1eaa71e1e3e7c9f9b9f96db8de56db3dfc4fb4d3
refs/heads/master
2020-05-17T23:57:00.000696
2017-11-03T02:33:27
2017-11-03T02:33:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,928
java
package com.tencent.mm.protocal.c; import com.tencent.gmtrace.GMTrace; import java.util.LinkedList; public final class xm extends axc { public String kqI; public double latitude; public double longitude; public String tUs; public String tUt; public xm() { GMTrace.i(3757425295360L, 27995); GMTrace.o(3757425295360L, 27995); } protected final int a(int paramInt, Object... paramVarArgs) { GMTrace.i(3757559513088L, 27996); if (paramInt == 0) { paramVarArgs = (b.a.a.c.a)paramVarArgs[0]; if (this.urE != null) { paramVarArgs.ff(1, this.urE.aWM()); this.urE.a(paramVarArgs); } paramVarArgs.a(2, this.latitude); paramVarArgs.a(3, this.longitude); if (this.kqI != null) { paramVarArgs.e(4, this.kqI); } if (this.tUs != null) { paramVarArgs.e(5, this.tUs); } if (this.tUt != null) { paramVarArgs.e(6, this.tUt); } GMTrace.o(3757559513088L, 27996); return 0; } int i; if (paramInt == 1) { paramInt = 0; if (this.urE != null) { paramInt = b.a.a.a.fc(1, this.urE.aWM()) + 0; } i = paramInt + (b.a.a.b.b.a.cK(2) + 8) + (b.a.a.b.b.a.cK(3) + 8); paramInt = i; if (this.kqI != null) { paramInt = i + b.a.a.b.b.a.f(4, this.kqI); } i = paramInt; if (this.tUs != null) { i = paramInt + b.a.a.b.b.a.f(5, this.tUs); } paramInt = i; if (this.tUt != null) { paramInt = i + b.a.a.b.b.a.f(6, this.tUt); } GMTrace.o(3757559513088L, 27996); return paramInt; } if (paramInt == 2) { paramVarArgs = new b.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler); for (paramInt = axc.a(paramVarArgs); paramInt > 0; paramInt = axc.a(paramVarArgs)) { if (!super.a(paramVarArgs, this, paramInt)) { paramVarArgs.cpJ(); } } GMTrace.o(3757559513088L, 27996); return 0; } if (paramInt == 3) { Object localObject1 = (b.a.a.a.a)paramVarArgs[0]; xm localxm = (xm)paramVarArgs[1]; paramInt = ((Integer)paramVarArgs[2]).intValue(); switch (paramInt) { default: GMTrace.o(3757559513088L, 27996); return -1; case 1: paramVarArgs = ((b.a.a.a.a)localObject1).FK(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { Object localObject2 = (byte[])paramVarArgs.get(paramInt); localObject1 = new en(); localObject2 = new b.a.a.a.a((byte[])localObject2, unknownTagHandler); for (boolean bool = true; bool; bool = ((en)localObject1).a((b.a.a.a.a)localObject2, (com.tencent.mm.bl.a)localObject1, axc.a((b.a.a.a.a)localObject2))) {} localxm.urE = ((en)localObject1); paramInt += 1; } GMTrace.o(3757559513088L, 27996); return 0; case 2: localxm.latitude = ((b.a.a.a.a)localObject1).xSv.readDouble(); GMTrace.o(3757559513088L, 27996); return 0; case 3: localxm.longitude = ((b.a.a.a.a)localObject1).xSv.readDouble(); GMTrace.o(3757559513088L, 27996); return 0; case 4: localxm.kqI = ((b.a.a.a.a)localObject1).xSv.readString(); GMTrace.o(3757559513088L, 27996); return 0; case 5: localxm.tUs = ((b.a.a.a.a)localObject1).xSv.readString(); GMTrace.o(3757559513088L, 27996); return 0; } localxm.tUt = ((b.a.a.a.a)localObject1).xSv.readString(); GMTrace.o(3757559513088L, 27996); return 0; } GMTrace.o(3757559513088L, 27996); return -1; } } /* Location: /Users/xianghongyan/decompile/dex2jar/classes2-dex2jar.jar!/com/tencent/mm/protocal/c/xm.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "15223790237@139.com" ]
15223790237@139.com
6e151e2ef834e0c9893324a9cc97a2e770329f0b
0fe72973b9268401bf53c59c0dcfba6b2fbb30c6
/src/main/java/com/hr/framework/projections/employees/reports/EmployeeHiringFilesProjection.java
6cff2b3061f1464d07e48a0f231f64f819635d87
[ "MIT" ]
permissive
yousef1876/Ecommerce-Banking-IngenicoConnectAPI
23b90b3af3b4810ee56b33542a1d727b58e8b9d7
31e0bafccbd2fb6fc3fdaecce7afcba54d5efc74
refs/heads/master
2021-05-09T19:22:37.023326
2018-01-23T17:41:08
2018-01-23T17:41:08
118,640,234
1
1
null
null
null
null
UTF-8
Java
false
false
545
java
package com.hr.framework.projections.employees.reports; import com.enums.HireDocuments; import com.hr.framework.po.employee.base.Employee; import com.hr.framework.po.employee.base.reports.HiringFiles; import org.springframework.data.rest.core.config.Projection; @Projection(name = "hiringFilesProjection" , types = {HiringFiles.class}) public interface EmployeeHiringFilesProjection { Long getId(); String getFileName(); String getFileType(); Employee getEmployees(); HireDocuments getType(); }
[ "javaonly23@gmail.com" ]
javaonly23@gmail.com
a82b64840fd616c87b984ccab2dd15efa6f1bcce
90a46fe343f52c9ab944400e8e95f98168ad38fb
/app/src/main/java/com/mobss/islamic/namesofAllah/utils/KeyboardUtils.java
5e35c2901a6334eb3c28465f79f02043cb227f93
[]
no_license
ilkayaktas/NamesOfAllah
ab31984bec27413d2962a833966a0679b3885b77
85e671dd76ce76d5a7b0b6044ab5206ba5fb9850
refs/heads/master
2020-11-30T00:32:42.721767
2018-07-27T14:30:45
2018-07-27T14:30:45
95,926,479
1
0
null
null
null
null
UTF-8
Java
false
false
1,979
java
/* * Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED * 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 * * https://www.mindorks.com/license/apache-v2 * * 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.mobss.islamic.namesofAllah.utils; import android.app.Activity; import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; /** * Created by janisharali on 27/01/17. */ public final class KeyboardUtils { private KeyboardUtils() { // This utility class is not publicly instantiable } public static void hideSoftInput(Activity activity) { View view = activity.getCurrentFocus(); if (view == null) view = new View(activity); InputMethodManager imm = (InputMethodManager) activity .getSystemService(Activity.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } public static void showSoftInput(EditText edit, Context context) { edit.setFocusable(true); edit.setFocusableInTouchMode(true); edit.requestFocus(); InputMethodManager imm = (InputMethodManager) context .getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(edit, 0); } public static void toggleSoftInput(Context context) { InputMethodManager imm = (InputMethodManager) context .getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); } }
[ "ilkayaktas@gmail.com" ]
ilkayaktas@gmail.com
f61453711ea54b09bd1d666857f5141de5de1cfe
29c684fd22ef6b420c2b123c79ff5ac4462f1d02
/src/main/java/com/company/mitienda/repository/ProductoRepository.java
b39eb2de572e3394dfd45d8d1d898a2f6882f9ab
[]
no_license
and892/mitienda
d8190c92ecb6dd7ec5d779dc79f55c3930a69d85
6d049b792aa7786c47dd4b9a00d3b1020e9613f0
refs/heads/master
2023-07-23T07:34:12.868431
2020-04-25T16:27:11
2020-04-25T16:27:11
243,262,407
3
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.company.mitienda.repository; import com.company.mitienda.domain.Producto; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the Producto entity. */ @SuppressWarnings("unused") @Repository public interface ProductoRepository extends JpaRepository<Producto, Long> { }
[ "someone@someplace.com" ]
someone@someplace.com
b90e9c666386d46fb25671c210f3b8a03921a2f4
4192d19e5870c22042de946f211a11c932c325ec
/j-hi-20110703/src/org/hi/framework/security/dao/ibatis3/SecurityGroupDAOIbatis3.java
1bd14b9a4c48a12a5fa15f16a1770e82be168b97
[]
no_license
arthurxiaohz/ic-card
1f635d459d60a66ebda272a09ba65e616d2e8b9e
5c062faf976ebcffd7d0206ad650f493797373a4
refs/heads/master
2021-01-19T08:15:42.625340
2013-02-01T06:57:41
2013-02-01T06:57:41
39,082,049
2
1
null
null
null
null
UTF-8
Java
false
false
252
java
package org.hi.framework.security.dao.ibatis3; import org.hi.framework.dao.ibatis3.BaseDAOIbatis; import org.hi.framework.security.dao.SecurityGroupDAO; public class SecurityGroupDAOIbatis3 extends BaseDAOIbatis implements SecurityGroupDAO{ }
[ "Angi.Wang.AFE@gmail.com" ]
Angi.Wang.AFE@gmail.com
41888ea0111f6326a5d08eef0f5e68710ae18f21
7fdb95003f2342be8d4a15c0210dd21acbc5c5f9
/src/main/java/no/ugland/utransprod/gui/ProductionOverviewView.java
0432e8f535f52c3791592ea693cf59120bb8a0f9
[]
no_license
abrekka/protrans
ca9f622c524ee46cb038dbba64bb2b64c06073aa
d1a2cb45be11badef43769c86c0c551c28b508d7
refs/heads/master
2023-07-21T04:10:10.521165
2021-03-08T12:13:42
2021-03-08T12:13:42
13,751,649
0
0
null
2022-06-29T16:55:36
2013-10-21T18:47:33
Java
ISO-8859-15
Java
false
false
3,728
java
package no.ugland.utransprod.gui; import java.awt.BorderLayout; import java.awt.Component; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JScrollPane; import no.ugland.utransprod.gui.handlers.ProductionOverviewViewHandler; import no.ugland.utransprod.util.InternalFrameBuilder; import org.jdesktop.swingx.JXTable; import com.google.inject.Inject; import com.jgoodies.forms.builder.PanelBuilder; import com.jgoodies.forms.factories.ButtonBarFactory; import com.jgoodies.forms.layout.CellConstraints; import com.jgoodies.forms.layout.FormLayout; /** * Viser produksjonsoversikt * * @author atle.brekka */ public class ProductionOverviewView implements Viewer { private ProductionOverviewViewHandler viewHandler; private JXTable productionTable; private JButton buttonClose; private JComboBox comboBoxProductAreaGroup; private JButton buttonRefresh; private JButton buttonSearch; private JCheckBox checkBoxFilter; private JButton buttonShowTakstolInfo; private JButton buttonExcel; @Inject public ProductionOverviewView(ProductionOverviewViewHandler viewHandler) { this.viewHandler = viewHandler; } private void initComponents(WindowInterface window) { buttonExcel = viewHandler.getButtonExcel(window); productionTable = viewHandler.getTable(window); buttonClose = viewHandler.getCancelButton(window); checkBoxFilter = viewHandler.getCheckBoxFilter(); buttonRefresh = viewHandler.getButtonRefresh(window); buttonSearch = viewHandler.getButtonSearch(window); comboBoxProductAreaGroup = viewHandler.getComboBoxProductAreaGroup(); buttonShowTakstolInfo = viewHandler.getButtonShowTakstolInfo(window); } /** * Bygger panel * * @param window * @return panel */ public Component buildPanel(WindowInterface window) { initComponents(window); FormLayout layout = new FormLayout("10dlu,p,3dlu,p,3dlu,p,3dlu,p,280dlu:grow,10dlu", "10dlu,p,3dlu,fill:300dlu:grow,3dlu,p"); PanelBuilder builder = new PanelBuilder(layout); // PanelBuilder builder = new PanelBuilder(new FormDebugPanel(), // layout); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(productionTable); scrollPane.setName("ScrollPaneTable"); builder.addLabel("Produktområde:", cc.xy(2, 2)); builder.add(comboBoxProductAreaGroup, cc.xy(4, 2)); builder.add(buttonSearch, cc.xy(6, 2)); builder.add(checkBoxFilter, cc.xy(8, 2)); builder.add(scrollPane, cc.xyw(2, 4, 8)); builder.add(ButtonBarFactory.buildCenteredBar(buttonExcel, buttonRefresh, buttonClose), cc.xyw(2, 6, 8)); return builder.getPanel(); } /** * @see no.ugland.utransprod.gui.Viewer#buildWindow() */ public WindowInterface buildWindow() { WindowInterface window = InternalFrameBuilder.buildInternalFrame(viewHandler.getWindowTitle(), viewHandler.getWindowSize(), true); window.add(buildPanel(window), BorderLayout.CENTER); return window; } /** * Gjør ingenting * * @see no.ugland.utransprod.gui.Viewer#cleanUp() */ public void cleanUp() { } /** * @see no.ugland.utransprod.gui.Viewer#getTitle() */ public String getTitle() { return viewHandler.getWindowTitle(); } /** * Gjør ingenting * * @see no.ugland.utransprod.gui.Viewer#initWindow() */ public void initWindow() { } /** * Returnerer true * * @see no.ugland.utransprod.gui.Viewer#useDispose() */ public boolean useDispose() { return true; } }
[ "atle@brekka.no" ]
atle@brekka.no
7963881b9fc16d80d5f29d46dba92e7daa893096
a78cbb3413a46c8b75ed2d313b46fdd76fff091f
/src/mobius.esc/escjava/tags/escjava-2-0a4/ESCTools/Javafe/java/javafe/parser/TokenQueue.java
3906bb32b8437c0f9ea81c14dbd9bf8b452e4ccd
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
wellitongb/Mobius
806258d483bd9b893312d7565661dadbf3f92cda
4b16bae446ef5b91b65fd248a1d22ffd7db94771
refs/heads/master
2021-01-16T22:25:14.294886
2013-02-18T20:25:24
2013-02-18T20:25:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,008
java
/* Copyright 2000, 2001, Compaq Computer Corporation */ package javafe.parser; import javafe.util.Assert; class TokenQueue { //// Instance variables /** * Contents of queue tokens. Used as circular buffer with * <code>start</code> and <code>end</code> being output and input * pointers, respectively. <code>toks[start]</code> is first * element; <code>toks[(end + toks.len - 1) % toks.len]</code> is * last element. */ //@ invariant \nonnullelements(toks) private Token[] toks; //@ invariant 0 <= start && start < toks.length private int start; //@ invariant 0 <= end && end < toks.length private int end; //@ ensures !notempty public TokenQueue() { toks = new Token[4]; for(int i = 0; i < toks.length; i++) toks[i] = new Token(); start = end = 0; } /** Do not write. True iff queue is not empty. */ // //@ invariant notempty == (end != start ) public boolean notempty = false; // Invariants (size == ((end + toks.length) - start) % toks.length): //// Methods /** Returns number of items in token queue. */ //@ ensures \result>=0 //@ ensures \result>0 == notempty public int size() { int sa = (start <= end ? 0 : toks.length); return (end + sa) - start; } /** Returns <code>n</code>th element in token queue. <pre><esc> requires 0 <= n; </esc></pre> */ //@ ensures \result != null public Token elementAt(int n) { int sa = (start <= end ? 0 : toks.length); int size = (end + sa) - start; if (n < 0 || size <= n) throw new IndexOutOfBoundsException(); int ndx = start + n; if (toks.length <= ndx) ndx -= toks.length; return toks[ndx]; } //@ nowarn Exception public void setElementAt(int n,Token t) { int sa = (start <= end ? 0 : toks.length); int size = (end + sa) - start; if (n < 0 || size <= n) throw new IndexOutOfBoundsException(); int ndx = start + n; if (toks.length <= ndx) ndx -= toks.length; toks[ndx] = t; } //@ nowarn Exception /** Empties lookahead queue. */ //@ modifies notempty //@ ensures !notempty public void clear() { end = start = 0; notempty = false; for(int i = 0; i < toks.length; i++) { Token t = toks[i]; //@ assert 0 <= i && i < toks.length //@ assert (\forall int j; 0 <= j && j < toks.length ==> toks[j] != null ) //@ assert toks[0] != null //@ assert t != null t.clear(); } } /** Removes head of token queue. Requires: notempty <pre><esc> requires dst != null </esc></pre> */ //@ requires notempty //@ modifies notempty public void dequeue(Token dst) { if (start != end) { toks[start].copyInto(dst); // Clear token to allow GC: toks[start].clear(); start = start+1; if (start == toks.length) start = 0; notempty = (start != end); } else Assert.precondition(false); } /** Pushes a token onto the lookahead queue. <pre><esc> requires td != null </esc></pre> */ public void enqueue(Token td) { Assert.notNull(td); // We always have space at end td.copyInto(toks[end]); end=end+1; if (end == toks.length) end = 0; if (start == end) { // Out of space, need to extend array, double it int len = toks.length; Token[] _new = new Token[2*len]; for(int i = 0; i < len; i++) _new[i] = toks[(i + start) % len]; for(int i = _new.length-1; len <= i; i--) _new[i] = new Token(); start = 0; end = toks.length; toks = _new; } notempty = true; } //@ ensures \result != null private String stateToString() { return ("start: " + start + " end: " + end + " length: " + toks.length); } public void zzz(String prefix) { Assert.notFalse(notempty == (end != start), prefix+"notempty not correct"); int len = toks.length; int size = size(); Assert.notFalse(0 <= start && start < len, prefix + "start out of bounds"); Assert.notFalse(0 <= end && end < len, prefix + "end out of bounds"); for(int i = 0; i < len; i++) { Assert.notNull(toks[i], (prefix + "bad lookahead queue: " + stateToString() + " at: " + i)); int ndx = (i + start) % len; if (i < size) toks[ndx].zzz(); else Assert.notFalse(toks[ndx].auxVal == null, //@ nowarn Pre prefix + "bad lookahead queue: " + stateToString() + " at: " + ndx); } } }
[ "nobody@c6399e9c-662f-4285-9817-23cccad57800" ]
nobody@c6399e9c-662f-4285-9817-23cccad57800
b630130c80cce6ecaa48a7b34372e745f9a82c91
237fe95c6238b5cfc5761e5da57f9d2ebd6eb0e4
/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/codesystems/MatchGrade.java
308913ae944a823a72061d57bfaf6cf194a2819f
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
xymondeath/hapi-fhir
fb9ca9181395e3ab1c639cd53d54937c7b2304cb
f5f9dff3915f3acbb43aa8b69a08ac374a88cbdb
refs/heads/master
2020-04-12T09:49:52.682163
2018-12-18T19:09:20
2018-12-18T19:09:20
162,409,610
0
0
Apache-2.0
2018-12-19T08:52:51
2018-12-19T08:52:51
null
UTF-8
Java
false
false
4,836
java
package org.hl7.fhir.r4.model.codesystems; /* Copyright (c) 2011+, HL7, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 import org.hl7.fhir.exceptions.FHIRException; public enum MatchGrade { /** * This record meets the matching criteria to be automatically considered as a full match. */ CERTAIN, /** * This record is a close match, but not a certain match. Additional review (e.g. by a human) may be required before using this as a match. */ PROBABLE, /** * This record may be a matching one. Additional review (e.g. by a human) SHOULD be performed before using this as a match. */ POSSIBLE, /** * This record is known not to be a match. Note that usually non-matching records are not returned, but in some cases records previously or likely considered as a match may specifically be negated by the matching engine. */ CERTAINLYNOT, /** * added to help the parsers */ NULL; public static MatchGrade fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; if ("certain".equals(codeString)) return CERTAIN; if ("probable".equals(codeString)) return PROBABLE; if ("possible".equals(codeString)) return POSSIBLE; if ("certainly-not".equals(codeString)) return CERTAINLYNOT; throw new FHIRException("Unknown MatchGrade code '"+codeString+"'"); } public String toCode() { switch (this) { case CERTAIN: return "certain"; case PROBABLE: return "probable"; case POSSIBLE: return "possible"; case CERTAINLYNOT: return "certainly-not"; default: return "?"; } } public String getSystem() { return "http://terminology.hl7.org/CodeSystem/match-grade"; } public String getDefinition() { switch (this) { case CERTAIN: return "This record meets the matching criteria to be automatically considered as a full match."; case PROBABLE: return "This record is a close match, but not a certain match. Additional review (e.g. by a human) may be required before using this as a match."; case POSSIBLE: return "This record may be a matching one. Additional review (e.g. by a human) SHOULD be performed before using this as a match."; case CERTAINLYNOT: return "This record is known not to be a match. Note that usually non-matching records are not returned, but in some cases records previously or likely considered as a match may specifically be negated by the matching engine."; default: return "?"; } } public String getDisplay() { switch (this) { case CERTAIN: return "Certain Match"; case PROBABLE: return "Probable Match"; case POSSIBLE: return "Possible Match"; case CERTAINLYNOT: return "Certainly Not a Match"; default: return "?"; } } }
[ "jamesagnew@gmail.com" ]
jamesagnew@gmail.com
c62fa5f4ba6f761276d9562506435dab9cec4004
20b3536c5b53ce04ce3f1174e40a0ba1589ea167
/Leetcode/src/com/programming/leetcode/Medium/GasStation.java
7e232bde6a41b5bf7e50ff50f74670348fb6c8b9
[]
no_license
RahilModi/Coding-Practice
361e90c95a73c2d68e7d7f2100501e400a164a6f
35c0ae1bf239221fc34ceb9731b416dec11179c3
refs/heads/master
2020-03-30T11:38:02.556473
2019-04-08T00:38:29
2019-04-08T00:38:29
151,184,024
1
0
null
null
null
null
UTF-8
Java
false
false
647
java
package com.programming.leetcode.Medium; public class GasStation { public int canCompleteCircuit(int[] gas, int[] cost) { int start = 0, total = 0, sum = 0; for(int i =0; i < gas.length; i++){ sum += gas[i] - cost[i]; if(sum < 0){ total += sum; start = i+1; sum = 0; } } total += sum; return total >= 0 ? start : -1; } public static void main(String[] args) { GasStation obj = new GasStation(); System.out.println(obj.canCompleteCircuit(new int[]{1,2,3,4,5}, new int[]{3,4,5,1,2})); } }
[ "rmodi10@gmail.com" ]
rmodi10@gmail.com
92e7c174743debdd45d3c05f6082575aa12e9886
b1c1f87e19dec3e06b66b60ea32943ca9fceba81
/spring-web/src/main/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter.java
d41121ff546fcf9e77102467c481f4dd0440c53f
[ "Apache-2.0" ]
permissive
JunMi/SpringFramework-SourceCode
d50751f79803690301def6478e198693e2ff7348
4918e0e6a0676a62fd2a9d95acf6eb4fa5edb82b
refs/heads/master
2020-06-19T10:55:34.451834
2019-07-13T04:32:14
2019-07-13T13:11:54
196,678,387
1
0
null
null
null
null
UTF-8
Java
false
false
3,105
java
/* * Copyright 2002-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 * * https://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.http.converter.xml; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.springframework.http.MediaType; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.util.Assert; /** * Implementation of {@link org.springframework.http.converter.HttpMessageConverter HttpMessageConverter} * that can read and write XML using <a href="https://github.com/FasterXML/jackson-dataformat-xml"> * Jackson 2.x extension component for reading and writing XML encoded data</a>. * * <p>By default, this converter supports {@code application/xml}, {@code text/xml}, and * {@code application/*+xml} with {@code UTF-8} character set. This can be overridden by * setting the {@link #setSupportedMediaTypes supportedMediaTypes} property. * * <p>The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. * * <p>Compatible with Jackson 2.9 and higher, as of Spring 5.0. * * @author Sebastien Deleuze * @since 4.1 */ public class MappingJackson2XmlHttpMessageConverter extends AbstractJackson2HttpMessageConverter { /** * Construct a new {@code MappingJackson2XmlHttpMessageConverter} using default configuration * provided by {@code Jackson2ObjectMapperBuilder}. */ public MappingJackson2XmlHttpMessageConverter() { this(Jackson2ObjectMapperBuilder.xml().build()); } /** * Construct a new {@code MappingJackson2XmlHttpMessageConverter} with a custom {@link ObjectMapper} * (must be a {@link XmlMapper} instance). * You can use {@link Jackson2ObjectMapperBuilder} to build it easily. * @see Jackson2ObjectMapperBuilder#xml() */ public MappingJackson2XmlHttpMessageConverter(ObjectMapper objectMapper) { super(objectMapper, new MediaType("application", "xml"), new MediaType("text", "xml"), new MediaType("application", "*+xml")); Assert.isInstanceOf(XmlMapper.class, objectMapper, "XmlMapper required"); } /** * {@inheritDoc} * The {@code ObjectMapper} parameter must be a {@link XmlMapper} instance. */ @Override public void setObjectMapper(ObjectMapper objectMapper) { Assert.isInstanceOf(XmlMapper.class, objectMapper, "XmlMapper required"); super.setObjectMapper(objectMapper); } }
[ "648326357@qq.com" ]
648326357@qq.com
c019dc4232c0dd13491659770385cd12429812e3
57ebb672b89c14c9d7bd8ac86c0045750e3820a4
/spring-samples/spring-boot-samples/springboot-war/src/test/java/com/sivalabs/springboot/ApplicationTests.java
4de08275bd9dd6afef002426036b105c6795ec63
[]
no_license
cryptopk-others/proof-of-concepts
cb12e21b7ff5486818adeca9103422be839f2928
e0ec8c1ce25c2acc6e144f2a54446082e819b248
refs/heads/master
2021-06-06T16:29:44.154936
2016-07-14T08:20:44
2016-07-14T08:20:44
64,490,733
0
0
null
null
null
null
UTF-8
Java
false
false
495
java
package com.sivalabs.springboot; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = Application.class) @WebAppConfiguration public class ApplicationTests { @Test public void contextLoads() { } }
[ "sivaprasadreddy.k@gmail.com" ]
sivaprasadreddy.k@gmail.com
44e4575db6a43c2539ba75364f25bccfc17f1677
15ae8d4bd9e1085e0ba7a54beae2f0c126a2dce4
/src/nowCoderClass1/section12/dynamicManage/MyDynamicManage.java
e2a27629cd46ddc525a4ecf62f4b03fe03045086
[]
no_license
qdh0520/Algorithm
aae9cc61cc020ba371afe4e638bdb5bff11150cf
40f626d95eb877005149631d4ffc228b2829cc89
refs/heads/master
2020-07-06T12:23:23.300710
2019-09-19T14:50:29
2019-09-19T14:50:29
203,016,025
1
0
null
2019-08-18T14:32:46
2019-08-18T14:32:45
null
UTF-8
Java
false
false
6,117
java
package nowCoderClass1.section12.dynamicManage; /** * Created by Dell on 2017-06-04. */ public class MyDynamicManage { /** * 动态规划的暴力搜索 * @param arr 存放钱的种类 * @param aim 要找零的总数 */ public int violence(int[] arr,int aim){ if(arr==null||arr.length==0||aim==0){ return 0; } return violenceSolution(arr,0,aim); } /** * 使用暴力搜索的办法去解决,递归,从下标0的钱币使用不同的数量构成的种类+其他钱币构成的种类 * @param arr 钱币的面值 * @param index 当前要统计的初始下标 * @param aim 还要找零的钱数 * @return 使用index之后的面值的钱币构成的钱数 */ private int violenceSolution(int[] arr,int index, int aim) { int res=0; //保证找零的钱币不会超出aim,通过for的条件限制找零的数量,但是如何计数,需要判断最后的aim是否等于0 //限制下标不要越界,注意不要无限递归下去 if(index==arr.length){ res=aim==0?1:0;//每种方法的计数都会到这里,如果钱正好找完,方法数加1,如果还有剩余的钱,则此次结果为0 }else{ for(int i=0;i*arr[index]<=aim;i++){//条件是使用该货币的数量从0至最大 res+=violenceSolution(arr,index+1,aim-i*arr[index]); } } return res; } /** * 使用记忆搜索法,记忆的key是 index,aim */ public int memorySearch(int[] arr,int aim){ if(arr==null||arr.length==0||aim==0){ return 0; } int[][] map=new int[arr.length+1][aim+1]; return memorySolution(arr,0,aim,map); } private int memorySolution(int[] arr, int index, int aim, int[][] map) { int res=0; //保证找零的钱币不会超出aim,通过for的条件限制找零的数量,但是如何计数,需要判断最后的aim是否等于0 //限制下标不要越界,注意不要无限递归下去 if(index==arr.length){ res=aim==0?1:0;//每种方法的计数都会到这里,如果钱正好找完,方法数加1,如果还有剩余的钱,则此次结果为0 }else{ for(int i=0;i*arr[index]<=aim;i++){//条件是使用该货币的数量从0至最大 int current=aim-i*arr[index];//存放未找零的钱数 int value=map[index+1][current]; if(value==0){//没计算过 res+=violenceSolution(arr,index+1,current); }else{ res+=value==-1?0:value; } } } //维护本次搜索的值到map map[index][aim]=res==0?-1:res; return res; } /** * 动态规划是利用矩阵,按顺序去计算出最终的结果 * 矩阵的行是钱币的种类,列是钱的数量。从0至aim * i和j的值的含义是使用arr[0...i]货币,组成钱数j的方法数 * 很容易能确定第一行的对应的钱数的种类,那i,j对应的位置上的 */ public int dynamicOne(int[] arr,int aim){ if(arr==null||arr.length==0||aim==0){ return 0; } int[][] dp=new int[arr.length][aim+1]; //先将第一列的值初始化为1 for(int i=0;i<arr.length;i++){ dp[i][0]=1; } //依次求得每一行的值 for(int i=0;i<arr.length;i++){ dynamicOne(arr,i,aim,dp); for(int j=0;j<=aim;j++){ System.out.print(" "+dp[i][j]); } System.out.println(); } return dp[arr.length-1][aim]; } private void dynamicOne(int[] arr, int row, int aim, int[][] dp) { //从第0行开始 if(row==0){//第0行 for(int i=1;i*arr[row]<=aim;i++) { int currentMoney=i*arr[row]; dp[row][currentMoney]=1; } }else{//第1 - r-1行 //arr[i]货币的数量从0 - 最多的数量 //根据i-1,钱数去找对应的种数 for(int j=1;j<=aim;j++){//依次求解i,j对应的位置上的值 //使用aim[j]不同的数量统计 int type=0;//要不停的进行累加,所以此处可以化简dp[i][j]=dp[row][j-arr[row]]+dp[row-1][j] for(int num=0;num*arr[row]<=j;num++){//num代表使用arr[row]的钱币数量 type+=dp[row-1][j-num*arr[row]]; } //统计结束,赋值 dp[row][j]=type; } } } public int dynamicTwo(int[] arr,int aim){ if(arr==null||arr.length==0||aim==0){ return 0; } int[][] dp=new int[arr.length][aim+1]; //先将第一列的值初始化为1 for(int i=0;i<arr.length;i++){ dp[i][0]=1; } //依次求得每一行的值 for(int i=0;i<arr.length;i++){ dynamicTwo(arr,i,aim,dp); for(int j=0;j<=aim;j++){ System.out.print(" "+dp[i][j]); } System.out.println(); } return dp[arr.length-1][aim]; } private void dynamicTwo(int[] arr, int row, int aim, int[][] dp) { //从第0行开始 if(row==0){//第0行 for(int i=1;i*arr[row]<=aim;i++) { int currentMoney=i*arr[row]; dp[row][currentMoney]=1; } }else{//第1 - r-1行 //arr[i]货币的数量从0 - 最多的数量 //根据i-1,钱数去找对应的种数 for(int j=1;j<=aim;j++){//依次求解i,j对应的位置上的值 //此处可以化简dp[i][j]=dp[row][j-arr[row]]+dp[row-1][j] if(j<arr[row]){ dp[row][j]=dp[row-1][j]; }else{ dp[row][j]=dp[row][j-arr[row]]+dp[row-1][j]; } } } } }
[ "18103412880@163.com" ]
18103412880@163.com
c9488ae7a07366d7c6f6ea8c866e7b49c0734787
2286dbc2c27059bfa9c6721de050b3328565d866
/src/main/java/com/pixelmed/validate/DicomInstanceValidator.java
f4447d94c350881ff103bd6fea04cfec4707d6db
[ "MIT" ]
permissive
anniyanvr/nifi-dicom
ae58a48f189c474a14f961cbc8ca6dc9c360c23a
f8616408bda79b3f18845fa156d2f623b6e8bcfc
refs/heads/master
2023-07-17T06:02:41.369860
2021-09-03T12:55:32
2021-09-03T12:55:32
276,812,772
0
0
MIT
2021-09-03T17:34:34
2020-07-03T05:10:40
null
UTF-8
Java
false
false
4,359
java
/* Copyright (c) 2001-2017, David A. Clunie DBA Pixelmed Publishing. All rights reserved. */ package com.pixelmed.validate; import com.pixelmed.dicom.*; // JAXP packages import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.Document; import java.io.*; /** * <p>The {@link DicomInstanceValidator DicomInstanceValidator} class is * for validating composite storage SOP instances against the standard IOD for the corresponding storage SOP Class.</p> * * <p>Typically used by reading the list of attributes that comprise an object, validating them * and displaying the resulting string results to the user on the standard output, in a dialog * box or whatever. The basic implementation of the {@link #main main} method (that may be useful as a * command line utility in its own right) is as follows:</p> * * <pre> * AttributeList list = new AttributeList(); * list.read(arg[0],null,true,true); * DicomInstanceValidator validator = new DicomInstanceValidator(); * System.err.print(validator.validate(list)); * </pre> * * @see com.pixelmed.dicom.AttributeList * * @author dclunie */ public class DicomInstanceValidator { private static final String identString = "@(#) $Header: /userland/cvs/pixelmed/imgbook/com/pixelmed/validate/DicomInstanceValidator.java,v 1.9 2017/01/24 10:50:52 dclunie Exp $"; /***/ private Transformer transformer; private class OurURIResolver implements URIResolver { /** * @param href * @param base */ public Source resolve(String href,String base) throws TransformerException { //System.err.println("OurURIResolver.resolve() href="+href+" base="+base); InputStream stream = DicomInstanceValidator.class.getResourceAsStream("/com/pixelmed/validate/"+href); return new StreamSource(stream); } } /** * <p>Create an instance of validator.</p> * * <p>Once created, a validator may be reused for as many validations as desired.</p> * * @throws javax.xml.transform.TransformerConfigurationException */ public DicomInstanceValidator() throws javax.xml.transform.TransformerConfigurationException { InputStream transformStream = DicomInstanceValidator.class.getResourceAsStream("/com/pixelmed/validate/"+"DicomIODDescriptionsCompiled.xsl"); Source transformSource = new StreamSource(transformStream); TransformerFactory tf = TransformerFactory.newInstance(); tf.setURIResolver(new OurURIResolver()); // this helps us find the common rules in the jar file transformer = tf.newTransformer(transformSource); } /** * <p>Validate a DICOM composite storage instance against the standard IOD for the appropriate storage SOP Class.</p> * * @param list the list of attributes comprising the DICOM composite storage instance to be validated * @return a string describing the results of the validation * @throws javax.xml.parsers.ParserConfigurationException * @throws javax.xml.transform.TransformerException * @throws java.io.UnsupportedEncodingException */ public String validate(AttributeList list) throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException, java.io.UnsupportedEncodingException { Document inputDocument = new XMLRepresentationOfDicomObjectFactory().getDocument(list); Source inputSource = new DOMSource(inputDocument); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); StreamResult outputResult = new StreamResult(outputStream); transformer.transform(inputSource,outputResult); return outputStream.toString("UTF-8"); } /** * <p>Read the DICOM file specified on the command line and validate it against the standard IOD for the appropriate storage SOP Class.</p> * * <p>The result of the validation is printed to the standard output.</p> * * @param arg the name of the file containing the DICOM composite storage instance to be validated */ public static void main(String arg[]) { try { AttributeList list = new AttributeList(); list.read(arg[0],TagFromName.PixelData); DicomInstanceValidator validator = new DicomInstanceValidator(); System.out.print(validator.validate(list)); // no need to use SLF4J since command line utility/test } catch (Exception e) { e.printStackTrace(System.err); // no need to use SLF4J since command line utility/test } } }
[ "daniel.blezek@gmail.com" ]
daniel.blezek@gmail.com
44e91b93e5405390c1a767f94323f0ad6b695a25
a09264296959f689565bb5bf065a3684dacda923
/SVNavigatoru-Maven/src/main/java/com/svnavigatoru600/web/url/users/UserAccountUrlParts.java
3cf7027e07c2515bca9789118b3ca5294e1fce8c
[]
no_license
tomas-skalicky/Spring-SVNavigatoru600
fbb4518062d958b7f24cefe3077d535024b3512a
166ab32c7ce6329fd65e38f3c18ff3ba486ed21f
refs/heads/master
2020-06-04T06:12:51.619939
2019-12-23T13:40:48
2019-12-23T13:40:48
6,842,695
0
0
null
2019-12-23T13:39:25
2012-11-24T18:08:37
Java
UTF-8
Java
false
false
1,877
java
package com.svnavigatoru600.web.url.users; import javax.servlet.http.HttpServletRequest; import com.svnavigatoru600.domain.users.NotificationTypeEnum; import com.svnavigatoru600.domain.users.User; import com.svnavigatoru600.service.util.HttpRequestUtils; import com.svnavigatoru600.web.url.CommonUrlParts; /** * Contains snippets of URL which concern just user account web pages. * * @author <a href="mailto:skalicky.tomas@gmail.com">Tomas Skalicky</a> */ public final class UserAccountUrlParts { public static final String BASE_URL = "/uzivatelsky-ucet/"; public static final String SAVED_URL = UserAccountUrlParts.BASE_URL + CommonUrlParts.SAVED_EXTENSION; public static final String UNSUBSCRIBE_EXTENSION = "odhlasit-notifikace/"; public static final String UNSUBSCRIBE_URL = UserAccountUrlParts.BASE_URL + UserAccountUrlParts.UNSUBSCRIBE_EXTENSION; public static final String UNSUBSCRIBED_EXTENSION = "odhlaseno/"; public static final String UNSUBSCRIBE_FAILED_FOREIGN_ACCOUNT_URL = UserAccountUrlParts.UNSUBSCRIBE_URL + CommonUrlParts.FAIL_EXTENSION + "cizi-ucet/"; private UserAccountUrlParts() { } /** * Gets URL which unsubscribes the given {@link User user} from receiving notifications of the given * {@link NotificationTypeEnum notificationType} if the user clicks on it. Moreover, controller associated with the URL * redirects the user to the user account settings page. */ public static String getUrlForUnsubscription(User user, NotificationTypeEnum notificationType, HttpServletRequest request) { return String.format("%s%s%s/%s%d/", HttpRequestUtils.getContextHomeDirectory(request), UserAccountUrlParts.BASE_URL, user.getUsername(), UserAccountUrlParts.UNSUBSCRIBE_EXTENSION, notificationType.ordinal()); } }
[ "skalicky.tomas@gmail.com" ]
skalicky.tomas@gmail.com
1b45fe3c82b2cffb272f9d6b2f2a2b651b7e5aa0
77baa80ea081820587d7227bc75fd33b9cdd7359
/backend/src/main/java/ch/unibe/ese/calendar/UserManager.java
3e7945496bc7df6ec6b517bd4bdd36b2e393e3cc
[]
no_license
lyriael/ese2011-simple-ui
96991e93647f367d21f4379c1f79a15a3d874849
d05f62ddc8b519f91797ffa86795fc80e588d906
refs/heads/master
2021-01-18T06:17:56.919619
2011-10-05T13:37:30
2011-10-05T13:37:30
2,517,792
0
0
null
null
null
null
UTF-8
Java
false
false
1,046
java
package ch.unibe.ese.calendar; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; public class UserManager { private static UserManager instance; private Map<String, User> users = new HashMap<String, User>(); private UserManager() { } public static UserManager getIsntance() { if (instance == null) { instance = new UserManager(); } return instance; } public synchronized User createUser(String userName, String password) { User user = new User(userName, password); users.put(userName, user); return user; } /** * * @param userName * @return the user with that name or null if no such user exists */ public synchronized User getUserByName(String userName) { return users.get(userName); } /** * @return an unmodifiable set of all users */ public synchronized Set<User> getAllUsers() { Set<User> result = new HashSet<User>(); result.addAll(users.values()); return Collections.unmodifiableSet(result); } }
[ "reto@apache.org" ]
reto@apache.org
087f053332bcfba60003dea6954074dd1c24fbe6
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14556-10-19-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateBaseStore_ESTest.java
be2310a05cad075d7cd536243c9d085e50dd7511
[]
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
572
java
/* * This file was automatically generated by EvoSuite * Thu Apr 09 11:07:27 UTC 2020 */ package com.xpn.xwiki.store; 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 XWikiHibernateBaseStore_ESTest extends XWikiHibernateBaseStore_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
b076afa5ff10318cd6b1c8bd216f6fe69c80eced
54c1dcb9a6fb9e257c6ebe7745d5008d29b0d6b6
/app/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java
03e0a4839ab48a616fd4404bde54f344a133ab82
[]
no_license
rcoolboy/guilvN
3817397da465c34fcee82c0ca8c39f7292bcc7e1
c779a8e2e5fd458d62503dc1344aa2185101f0f0
refs/heads/master
2023-05-31T10:04:41.992499
2021-07-07T09:58:05
2021-07-07T09:58:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,387
java
package com.facebook.react.modules.datepicker; import android.app.DatePickerDialog; import android.content.DialogInterface; import android.os.Bundle; import android.widget.DatePicker; import androidx.fragment.app.FragmentActivity; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.module.annotations.ReactModule; import com.google.gson.internal.bind.TypeAdapters; import com.p118pd.sdk.AbstractC7175o00o0o0o; import com.p118pd.sdk.DialogInterface$OnCancelListenerC7165o00o0OoO; import javax.annotation.Nonnull; import javax.annotation.Nullable; @ReactModule(name = DatePickerDialogModule.FRAGMENT_TAG) public class DatePickerDialogModule extends ReactContextBaseJavaModule { public static final String ACTION_DATE_SET = "dateSetAction"; public static final String ACTION_DISMISSED = "dismissedAction"; public static final String ARG_DATE = "date"; public static final String ARG_MAXDATE = "maxDate"; public static final String ARG_MINDATE = "minDate"; public static final String ARG_MODE = "mode"; public static final String ERROR_NO_ACTIVITY = "E_NO_ACTIVITY"; @VisibleForTesting public static final String FRAGMENT_TAG = "DatePickerAndroid"; public class DatePickerDialogListener implements DatePickerDialog.OnDateSetListener, DialogInterface.OnDismissListener { public final Promise mPromise; public boolean mPromiseResolved = false; public DatePickerDialogListener(Promise promise) { this.mPromise = promise; } public void onDateSet(DatePicker datePicker, int i, int i2, int i3) { if (!this.mPromiseResolved && DatePickerDialogModule.this.getReactApplicationContext().hasActiveCatalystInstance()) { WritableNativeMap writableNativeMap = new WritableNativeMap(); writableNativeMap.putString("action", DatePickerDialogModule.ACTION_DATE_SET); writableNativeMap.putInt(TypeAdapters.C104427.YEAR, i); writableNativeMap.putInt(TypeAdapters.C104427.MONTH, i2); writableNativeMap.putInt("day", i3); this.mPromise.resolve(writableNativeMap); this.mPromiseResolved = true; } } public void onDismiss(DialogInterface dialogInterface) { if (!this.mPromiseResolved && DatePickerDialogModule.this.getReactApplicationContext().hasActiveCatalystInstance()) { WritableNativeMap writableNativeMap = new WritableNativeMap(); writableNativeMap.putString("action", "dismissedAction"); this.mPromise.resolve(writableNativeMap); this.mPromiseResolved = true; } } } public DatePickerDialogModule(ReactApplicationContext reactApplicationContext) { super(reactApplicationContext); } private Bundle createFragmentArguments(ReadableMap readableMap) { Bundle bundle = new Bundle(); if (readableMap.hasKey(ARG_DATE) && !readableMap.isNull(ARG_DATE)) { bundle.putLong(ARG_DATE, (long) readableMap.getDouble(ARG_DATE)); } if (readableMap.hasKey(ARG_MINDATE) && !readableMap.isNull(ARG_MINDATE)) { bundle.putLong(ARG_MINDATE, (long) readableMap.getDouble(ARG_MINDATE)); } if (readableMap.hasKey(ARG_MAXDATE) && !readableMap.isNull(ARG_MAXDATE)) { bundle.putLong(ARG_MAXDATE, (long) readableMap.getDouble(ARG_MAXDATE)); } if (readableMap.hasKey("mode") && !readableMap.isNull("mode")) { bundle.putString("mode", readableMap.getString("mode")); } return bundle; } @Override // com.facebook.react.bridge.NativeModule @Nonnull public String getName() { return FRAGMENT_TAG; } @ReactMethod public void open(@Nullable ReadableMap readableMap, Promise promise) { FragmentActivity fragmentActivity = (FragmentActivity) getCurrentActivity(); if (fragmentActivity == null) { promise.reject("E_NO_ACTIVITY", "Tried to open a DatePicker dialog while not attached to an Activity"); return; } AbstractC7175o00o0o0o supportFragmentManager = fragmentActivity.getSupportFragmentManager(); DialogInterface$OnCancelListenerC7165o00o0OoO o00o0ooo = (DialogInterface$OnCancelListenerC7165o00o0OoO) supportFragmentManager.OooO00o(FRAGMENT_TAG); if (o00o0ooo != null) { o00o0ooo.dismiss(); } DatePickerDialogFragment datePickerDialogFragment = new DatePickerDialogFragment(); if (readableMap != null) { datePickerDialogFragment.setArguments(createFragmentArguments(readableMap)); } DatePickerDialogListener datePickerDialogListener = new DatePickerDialogListener(promise); datePickerDialogFragment.setOnDismissListener(datePickerDialogListener); datePickerDialogFragment.setOnDateSetListener(datePickerDialogListener); datePickerDialogFragment.show(supportFragmentManager, FRAGMENT_TAG); } }
[ "593746220@qq.com" ]
593746220@qq.com
f8eed088950e3e5432558d2ef0546d3fa2476d98
064297c7982d1f1b5f290275483dcad1138e236e
/src/main/java/net/earthcomputer/multiconnect/protocols/v1_13_2/mixin/MixinOtherClientPlayerEntity.java
a7442e566369c61bbf89ffd73a300b532ae56fc7
[ "MIT" ]
permissive
MCSuchter/multiconnect
12b4a01ac828d0ec38f8bdcc1e157e7f593bbf3e
d236f338898002987306bd7165dcfd57c4bc45c1
refs/heads/master
2020-12-09T11:31:50.274945
2020-01-11T20:19:03
2020-01-11T20:19:03
233,292,125
1
0
MIT
2020-01-11T20:22:12
2020-01-11T20:22:11
null
UTF-8
Java
false
false
1,661
java
package net.earthcomputer.multiconnect.protocols.v1_13_2.mixin; import com.mojang.authlib.GameProfile; import net.earthcomputer.multiconnect.api.Protocols; import net.earthcomputer.multiconnect.impl.ConnectionInfo; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.network.OtherClientPlayerEntity; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.EntityPose; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(OtherClientPlayerEntity.class) public abstract class MixinOtherClientPlayerEntity extends AbstractClientPlayerEntity { public MixinOtherClientPlayerEntity(ClientWorld world, GameProfile gameProfile) { super(world, gameProfile); } @Inject(method = "updateSize", at = @At("HEAD")) private void onUpdateSize(CallbackInfo ci) { if (ConnectionInfo.protocolVersion <= Protocols.V1_13_2) { EntityPose pose; if (isFallFlying()) { pose = EntityPose.FALL_FLYING; } else if (isSleeping()) { pose = EntityPose.SLEEPING; } else if (isSwimming()) { pose = EntityPose.SWIMMING; } else if (isUsingRiptide()) { pose = EntityPose.SPIN_ATTACK; } else if (isSneaking() && !abilities.flying) { pose = EntityPose.CROUCHING; } else { pose = EntityPose.STANDING; } setPose(pose); } } }
[ "burtonjae@hotmail.co.uk" ]
burtonjae@hotmail.co.uk
f8ceff93eb22f5593ac7780def1bcaa69a80f924
4d2a8eff4251a05261805e212c38fbc6f72c5d58
/drools-wb-services/drools-wb-verifier/drools-wb-verifier-backend/src/main/java/org/drools/workbench/services/verifier/webworker/client/AnalyzerBuilder.java
f91d75b96b8407defecd247c893e17eaae4839a9
[ "Apache-2.0" ]
permissive
phoenix110/drools-wb
d43a624ca19c1e0b07e60993ae1eba1dd68db3a0
9df3db9d9998fa2bef16996cc3f29e94d1e14fed
refs/heads/master
2021-01-19T13:03:41.211802
2017-02-16T12:15:12
2017-02-16T12:15:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,466
java
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates. * * 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.drools.workbench.services.verifier.webworker.client; import java.util.Date; import com.google.gwt.i18n.client.DateTimeFormat; import org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration; import org.drools.workbench.services.verifier.api.client.configuration.CheckWhiteList; import org.drools.workbench.services.verifier.api.client.configuration.DateTimeFormatProvider; import org.drools.workbench.services.verifier.api.client.configuration.RunnerType; import org.drools.workbench.services.verifier.api.client.index.Index; import org.drools.workbench.services.verifier.api.client.index.keys.UUIDKeyProvider; import org.drools.workbench.services.verifier.core.main.Analyzer; import org.drools.workbench.services.verifier.core.main.Reporter; import org.drools.workbench.services.verifier.plugin.client.api.Initialize; import org.drools.workbench.services.verifier.plugin.client.builders.BuildException; import org.drools.workbench.services.verifier.plugin.client.builders.IndexBuilder; import org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities; import org.uberfire.commons.uuid.UUID; public class AnalyzerBuilder { private Reporter reporter; private Initialize initialize; private VerifierColumnUtilities columnUtilities; private Index index; private AnalyzerConfiguration configuration; private Analyzer analyzer; private RunnerType runnerType; public Analyzer buildAnalyzer() throws BuildException { if ( analyzer == null ) { analyzer = new Analyzer( reporter, getIndex(), getConfiguration() ); } return analyzer; } Index getIndex() throws BuildException { if ( index == null ) { index = new IndexBuilder( initialize.getModel(), initialize.getHeaderMetaData(), getUtils(), getConfiguration() ).build(); } return index; } private VerifierColumnUtilities getUtils() { if ( columnUtilities == null ) { columnUtilities = new VerifierColumnUtilities( initialize.getModel(), initialize.getHeaderMetaData(), initialize.getFactTypes() ); } return columnUtilities; } AnalyzerConfiguration getConfiguration() { if ( configuration == null ) { configuration = new AnalyzerConfiguration( initialize.getUuid(), new DateTimeFormatProvider() { @Override public String format( final Date dateValue ) { return DateTimeFormat.getFormat( initialize.getDateFormat() ) .format( dateValue ); } }, new UUIDKeyProvider() { @Override protected String newUUID() { return UUID.uuid(); } }, CheckWhiteList.newDefault(), runnerType ); } return configuration; } public AnalyzerBuilder with( final Reporter reporter ) { this.reporter = reporter; return this; } public AnalyzerBuilder with( final Initialize initialize ) { this.initialize = initialize; return this; } public AnalyzerBuilder with( final RunnerType runnerType ) { this.runnerType = runnerType; return this; } }
[ "manstis@users.noreply.github.com" ]
manstis@users.noreply.github.com
f06bdceb7a138b76b8b9854131e713b1bd3cd997
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/19/org/apache/commons/lang3/time/FastDateFormat_createInstance_103.java
8c2b12e62edc05273cf273f99dc72fd2b4d090ca
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,347
java
org apach common lang3 time fast date format fastdateformat fast thread safe version link java text simpl date format simpledateformat direct replac code simpl date format simpledateformat format situat multi thread server environ code simpl date format simpledateformat thread safe jdk version sun close bug rfe format support pattern compat simpl date format simpledateformat time zone java introduc pattern letter code 'z' repres time zone rfc822 format code code pattern letter jdk version addit pattern code zz' 'zz' made repres iso8601 full format time zone code code introduc minor incompat java gain function version fast date format fastdateformat format overrid fast date format fastdateformat creat instanc createinst string pattern time zone timezon time zone timezon local local fast date format fastdateformat pattern time zone timezon local
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com