blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
fb20d48a16594a3bac134742c92741ab2b287791
6871694e3218246df1d6baca5c3b9e356dc6acac
/src/main/java/br/com/eleicao/api/repository/EleicaoRepository.java
c7b7c874f86aa8de4e26b0b86c3f82f9d2f0de32
[]
no_license
bkprestes/eleicao
e80e1ee60f08a1bedf67d9dcc2815695e6d750d4
ec6ee720db24134375fb59a552968b7752598519
refs/heads/master
2023-05-03T09:15:45.166795
2021-05-29T22:56:52
2021-05-29T22:56:52
320,129,341
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package br.com.eleicao.api.repository; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import br.com.eleicao.api.domain.Eleicao; import br.com.eleicao.api.mapper.EleicaoMapper; @Repository public class EleicaoRepository { @Autowired private EleicaoMapper eleicaoMapper; public Eleicao salvar(Eleicao eleicao) { eleicaoMapper.insert(eleicao); return eleicao; } public Eleicao pesquisaPorId(Long id) { return eleicaoMapper.selectById(id); } public Eleicao update(Eleicao eleicao) { eleicaoMapper.update(eleicao); return eleicaoMapper.selectById(eleicao.getId()); } public void delete(Long id) { eleicaoMapper.delete(id); } public ArrayList<Eleicao> listarEleicoes() { return eleicaoMapper.listarEleicoes(); } }
6e0cec5398bd522a6a68fe0af8fc4e709f535602
a5d1e976fe51d2ce8f2add3a94b35b1b2be3c54e
/src/main/java/gov/noaa/ncdc/wct/ui/Viewer.java
ec66c2cab99e2b2841e8ca7015c57c37b460b37c
[]
no_license
gss2002/wct
cc4ee9aa684db0941eaefe2fbd04642967f6d3f6
f242d36d074ff024eb55e8f6cbd626ac7072ad74
refs/heads/master
2020-12-24T07:19:45.685966
2016-12-26T20:48:28
2016-12-26T20:48:28
59,535,643
4
0
null
null
null
null
UTF-8
Java
false
false
595
java
package gov.noaa.ncdc.wct.ui; import gov.noaa.ncdc.wct.decoders.cdm.RadialDatasetSweepRemappedRaster; import org.geotools.cv.SampleDimension; public interface Viewer { /** * Returns the current RadialDatasetSweepRemappedRaster object in use for decoding/resampling * Radial data. This allows the display the range/aziumuth/height on the status bar. Return null * if the implementing viewer doesn't support Radial data. * @return */ public RadialDatasetSweepRemappedRaster getRadialRemappedRaster(); public SampleDimension getSampleDimension(); }
6584b2f50df022cf7a12394d93afbd7857ffa388
4f27dea3e3adb5251bf7f211827bd7200d9df675
/my-app/src/main/java/org/dxctraining/JavaConfig.java
c277640be141ca1a7707b06d1496f8685a91180d
[]
no_license
ayushi-07199/Hotel
28c4bf7f730a213f5f57cd716f95d84902ef2ca3
cbecdc28668c1ce316bf9a747db09c053294f14e
refs/heads/master
2022-12-01T01:37:02.622986
2020-08-12T07:49:42
2020-08-12T07:49:42
286,828,192
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package org.dxctraining; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; @Configuration @ComponentScan("org.dxctraining") public class JavaConfig { }
988a08f1f585f11e7df152559128023d7e43b950
afa1969b996167d688b8cb65c329cee21d632efb
/app/src/main/java/vivaladev/com/dirtyclocky/ui/activities/activityHelper/ActivityHelper.java
112dd39086d846bda7731f89d5872f0dc5398895
[]
no_license
vivaladev/alarmRecognizeClock
5a8d57c4bd3a4974abd5767faba839dfcb221c11
ed4e932c22961365e12f8f790e194c159939dd0c
refs/heads/master
2020-03-22T00:10:02.336555
2018-07-02T08:26:31
2018-07-02T08:26:31
139,228,019
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package vivaladev.com.dirtyclocky.ui.activities.activityHelper; import android.app.Activity; import android.os.Build; import android.support.v4.content.ContextCompat; import android.view.View; import android.view.Window; import android.view.WindowManager; public class ActivityHelper { public static void setStatusBar(Activity activity, View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); Window window = activity.getWindow(); window.setFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(ContextCompat.getColor(activity, android.R.color.black)); } } }
2eef3c08d52a08e0312318f07bee970bd79c7429
9638f6bb6f65238e807ef1a10b19fa716fd79bfe
/UserRegistrationApp/src/test/java/com/tekleads/service/TestUserDetailsServiceImpl.java
7ddfc8e6025b6c0a4e095c8fe2215c820cecb982
[]
no_license
sangrammule1/UserRegistration
dd607eda86986882c8cd6c491477efd051d38a9e
4fb96ad26a9accd5bbcd7aa18fade12e1b66e4ae
refs/heads/main
2023-02-02T21:49:55.913956
2020-12-20T04:59:12
2020-12-20T04:59:12
322,996,373
0
0
null
null
null
null
UTF-8
Java
false
false
3,957
java
package com.tekleads.service; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.springframework.beans.BeanUtils; import org.springframework.boot.test.context.SpringBootTest; import com.tekleads.domain.UserDetails; import com.tekleads.entity.CityMasterEntity; import com.tekleads.entity.CountryMasterEntity; import com.tekleads.entity.StateMasterEntity; import com.tekleads.entity.UserDetailsEntity; import com.tekleads.repository.CityMasterRepository; import com.tekleads.repository.CountryMasterRepository; import com.tekleads.repository.StateMasterRepository; import com.tekleads.repository.UserDetailsRepository; @SpringBootTest public class TestUserDetailsServiceImpl { @InjectMocks private UserDetailsServiceImpl service; @Mock private CountryMasterRepository countryRepo; @Mock private StateMasterRepository stateRepo; @Mock private CityMasterRepository cityRepo; @Mock private UserDetailsRepository userRepo; public static List<CountryMasterEntity> listCountry = null; public static List<StateMasterEntity> listStates = null; public static List<CityMasterEntity> listCities = null; public static UserDetails userDetails=null; public static UserDetailsEntity userDetailsEntity=null; @BeforeAll public static void init() { listCountry = new ArrayList<CountryMasterEntity>(); CountryMasterEntity entity1 = new CountryMasterEntity(); entity1.setCountryId(1); entity1.setCountryName("INDIA"); CountryMasterEntity entity2 = new CountryMasterEntity(); entity2.setCountryId(2); entity2.setCountryName("USA"); listCountry.add(entity1); listCountry.add(entity2); listStates = new ArrayList<StateMasterEntity>(); StateMasterEntity state1 = new StateMasterEntity(); state1.setStateId(1); state1.setStateName("MH"); StateMasterEntity state2 = new StateMasterEntity(); state2.setStateId(2); state2.setStateName("TS"); listStates.add(state1); listStates.add(state2); listCities = new ArrayList<CityMasterEntity>(); CityMasterEntity city1 = new CityMasterEntity(); city1.setCityId(1); city1.setCityName("PUNE"); CityMasterEntity city2 = new CityMasterEntity(); city2.setCityId(2); city2.setCityName("MUMBAI"); listCities.add(city1); listCities.add(city2); userDetails=new UserDetails(); userDetails.setCityId(5); userDetails.setCountryId(1); userDetails.setEmail("[email protected]"); userDetails.setFname("Ram"); userDetails.setLname("Mule"); userDetailsEntity=new UserDetailsEntity(); BeanUtils.copyProperties(userDetails, userDetailsEntity); userDetailsEntity.setUserId(111); } @Test public void testGetAllCountries() { when(countryRepo.findAll()).thenReturn(listCountry); Map<Integer, String> countries = service.getAllCountries(); assertNotNull(countries); } @Test public void testGetStatesByCountryId() { when(stateRepo.findByCountryId(1)).thenReturn(listStates); Map<Integer, String> states = service.getStatesByCountryId(1); assertNotNull(states); } @Test public void testGetCityByStateId() { when(cityRepo.findByStateId(4)).thenReturn(listCities); Map<Integer, String> cities = service.getCityByStateId(4); assertNotNull(cities); } @Test @Disabled public void testRegisterUserDetails() { when(userRepo.save(userDetailsEntity)).thenReturn(userDetailsEntity); boolean isRegisterd = service.registerUserDetails(userDetails); assertEquals(true, isRegisterd); } }
2bed84f6b539a2986d6358cfdd1af12eb16d463a
228a36a3bd0fb3ac57a2b80e4a0da9a7c931f71a
/src/combit/ListLabel24/DefinePrintOptionsHandler.java
3b942426cdf92562e7e092305ab76ee9db62b83d
[]
no_license
Javonet-io-user/51231a55-11d9-48ca-acc1-07050ae1a4a8
f95fdc610f310fb054caea59f3a23d47ef49869f
52adc814c098fc94f64c36e153201725adc10c0a
refs/heads/master
2020-04-28T17:03:40.894650
2019-03-13T14:06:01
2019-03-13T14:06:01
175,433,069
0
0
null
null
null
null
UTF-8
Java
false
false
964
java
package combit.ListLabel24; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import Common.MethodTypeAnnotation; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import combit.ListLabel24.*; import jio.System.*; public interface DefinePrintOptionsHandler { /** Method */ @MethodTypeAnnotation(type = "Method") public void Invoke(Object sender, EventArgs e); }
88122c7c852bb9c712797f77c21cdf9e31ff334a
df5d6a911400cbc26a990349891310f2ee118ef1
/smoothcsv-app-modules/smoothcsv-core/src/main/java/command/grid/FocusCommand.java
6bfce90e5da53e4f1c259148e6c8ea8b06abd763
[ "Apache-2.0" ]
permissive
k-hatano/smoothcsv
8df0eb4a9d66e24e08b547f5aa20d6cbb2b8254c
ab37ddd2c9f45d05872c8bf1d43ff49e3de2c18a
refs/heads/master
2022-05-22T17:35:16.465561
2020-06-06T01:28:18
2020-06-06T01:39:45
204,708,583
1
0
null
2019-08-27T22:24:14
2019-08-27T13:24:13
null
UTF-8
Java
false
false
972
java
/* * Copyright 2016 kohii * * 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 command.grid; import com.smoothcsv.core.command.GridCommand; import com.smoothcsv.core.csvsheet.CsvGridSheetPane; /** * @author kohii */ public class FocusCommand extends GridCommand { @Override public void run(CsvGridSheetPane gridSheetPane) { if (gridSheetPane.isEditing()) { gridSheetPane.stopCellEditingIfEditing(); } gridSheetPane.requestFocus(); } }
c597b2351647405ebd5c0c82da4c6e41f06e777f
947786c9927ef1439f5c6f4f32e96ee3755c96de
/src/com/igate/cricketapplication/service/ICricketApplicationService.java
26a763285f8c166b924a8be0ac6e9b0e81def38f
[]
no_license
archil620/CricketApplicationJava
c0ce0951b4ed43f7f78c04bb2a58feac8e8637ab
31bacb5e62ed30e30c2b7e9e0b547e9852d5f883
refs/heads/master
2020-04-15T13:47:33.347935
2019-01-08T20:51:20
2019-01-08T20:51:20
164,730,302
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
package com.igate.cricketapplication.service; import java.util.List; import java.util.Map; import com.igate.cricketapplication.dto.Cricket; import com.igate.cricketapplication.exception.CricketAppException; public interface ICricketApplicationService { public List<Cricket> showPlayers() throws CricketAppException; public int addPlayer(Cricket player) throws CricketAppException; public Map<String, String> isValidated(Cricket player); }
b4ec859875c8dd39dad510a664fcf7dc1dcad1b8
873f724bc13de8ade32dc680be67b2cdf9241b92
/马上开饭/src/com/uplooking/meihaoshiguang/adapter/RecipeCommenListAdapter.java
ff0fbc4016e02cbbc96e82787027ca263c09fdad
[]
no_license
zhaoaoranke/mashangkaifan
85a379653d63874698063b4158e720844e03d12c
0acc152154e246c0ede18c2e83f1bb3fc64f4b27
refs/heads/master
2021-05-02T04:11:47.543478
2016-12-13T04:19:02
2016-12-13T04:19:02
76,265,379
0
0
null
null
null
null
UTF-8
Java
false
false
2,440
java
package com.uplooking.meihaoshiguang.adapter; import java.util.List; import com.lidroid.xutils.BitmapUtils; import com.uplooking.meihaoshiguang.entity.ResponceRecipeDetail.RecipeComment; import com.uplooking.meihaoshiguang.tools.BitmapHelper; import com.uplooking.meihaoshiguang.tools.TimeFormater; import com.uplooking.meihaoshiguang.R; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; public class RecipeCommenListAdapter extends BaseAdapter{ private List<RecipeComment> list; private LayoutInflater inflater; private BitmapUtils bitmapUtils; public RecipeCommenListAdapter(Context context,List<RecipeComment> list) { super(); inflater = LayoutInflater.from(context); this.list = list; bitmapUtils = BitmapHelper.getBitmapUtils(context); } @Override public int getCount() { return list.size(); } @Override public RecipeComment getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if(convertView == null){ convertView = inflater.inflate(R.layout.item_recipe_comment, null); holder = new ViewHolder(); holder.headPhotoImg = (ImageView) convertView.findViewById(R.id.item_recipe_comment_headImg); holder.nickNameTv = (TextView) convertView.findViewById(R.id.item_recipe_comment_nickNameTv); holder.contentTv = (TextView) convertView.findViewById(R.id.item_recipe_comment_contentTv); holder.dateTimeTv = (TextView) convertView.findViewById(R.id.item_recipe_comment_dateTv); convertView.setTag(holder); }else{ holder = (ViewHolder) convertView.getTag(); } RecipeComment comment = getItem(position); holder.nickNameTv.setText(comment.getUserNickName()); holder.contentTv.setText(comment.getContent()); holder.dateTimeTv.setText(TimeFormater.formatTime(comment.getCommentDate())); // bitmapUtils.display(holder.headPhotoImg, comment.getUserHeadPhoto()); return convertView; } private class ViewHolder{ ImageView headPhotoImg; TextView nickNameTv; TextView contentTv; TextView dateTimeTv; } public void addDatas(List<RecipeComment> list) { this.list.addAll(list); notifyDataSetChanged(); } }
8e31508d0d93dce834756e6bbbe2a931399df73e
500934481bd99d0c6ee59add9e7c3ba43d1e459d
/core/src/test/java/nl/weeaboo/vn/impl/render/DrawTransformTest.java
64c680184b65bfba04bc0f505116c5dc5201fcf7
[ "Apache-2.0" ]
permissive
anonl/nvlist
c60c1cf92eb91e0441385f2db1a66992e3653be3
235b251c0896c9fb568398012a4316f2f4177fd9
refs/heads/master
2023-08-24T01:00:05.582554
2023-07-29T11:31:12
2023-07-29T11:31:12
39,298,591
26
5
NOASSERTION
2023-09-09T07:54:45
2015-07-18T13:07:58
Java
UTF-8
Java
false
false
1,068
java
package nl.weeaboo.vn.impl.render; import org.junit.Assert; import org.junit.Test; import nl.weeaboo.vn.core.BlendMode; import nl.weeaboo.vn.math.Matrix; public class DrawTransformTest { @Test public void defaultValues() { DrawTransform dt = new DrawTransform(); Assert.assertEquals(0, dt.getZ()); Assert.assertEquals(true, dt.isClipEnabled()); Assert.assertEquals(BlendMode.DEFAULT, dt.getBlendMode()); Assert.assertEquals(Matrix.identityMatrix(), dt.getTransform()); } @Test public void copyConstructor() { DrawTransform dt = new DrawTransform(); dt.setZ((short)1); dt.setClipEnabled(false); dt.setBlendMode(BlendMode.ADD); dt.setTransform(Matrix.translationMatrix(1, 2)); dt = new DrawTransform(dt); Assert.assertEquals(1, dt.getZ()); Assert.assertEquals(false, dt.isClipEnabled()); Assert.assertEquals(BlendMode.ADD, dt.getBlendMode()); Assert.assertEquals(Matrix.translationMatrix(1, 2), dt.getTransform()); } }
2b674c3591dc1313d5c042480baccba5e3ccc051
fada9a60bc15aebb89e41e3da3c09319e132557f
/src/test/java/funkciok/IndexTeszt.java
10281fe76c4a09c6d94b3174165a1509759bf5ea
[ "Apache-2.0" ]
permissive
balogh0827/Szudoku
856dab4e3a9f6860c8a2c7fe1ecbf866c81247e8
374ad000b781024cad80001143d1f661291aea8d
refs/heads/master
2021-01-20T11:23:28.636324
2015-05-25T21:25:40
2015-05-25T21:31:30
36,254,743
0
0
null
null
null
null
UTF-8
Java
false
false
1,885
java
/* * Copyright 2015 Debreceni Egyetem, Informatikai Kar. * * 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 funkciok; import org.junit.Test; import static org.junit.Assert.*; /** * * @author STARLIGHT */ public class IndexTeszt { public IndexTeszt() { } @Test public void indexetSzámolRekeszbenNulla(){ assertEquals(2, IndexSzamito.indexetSzámolRekeszben(0)); } @Test public void indexetSzámolRekeszbenEgy(){ assertEquals(0, IndexSzamito.indexetSzámolRekeszben(1)); } @Test public void indexetSzámolRekeszbenKettő(){ assertEquals(1, IndexSzamito.indexetSzámolRekeszben(2)); } @Test public void indexetSzámolRekeszbenHárom(){ assertEquals(2, IndexSzamito.indexetSzámolRekeszben(3)); } @Test public void indexetSzámolRekeszbenKilenc(){ assertEquals(2, IndexSzamito.indexetSzámolRekeszben(9)); } @Test public void indexetSzámolTáblábanEgy(){ assertEquals(0, IndexSzamito.indexetSzámolTáblában(1)); } @Test public void indexetSzámolTáblábanNégy(){ assertEquals(1, IndexSzamito.indexetSzámolTáblában(4)); } @Test public void indexetSzámolTáblábanHét(){ assertEquals(2, IndexSzamito.indexetSzámolTáblában(7)); } }
a79b346ec70847cbd50152dbe2885826298a3c29
467ee5ae7976462664c9cb9f0dc41ee80987f2fb
/src/template/designpattern/TemplatePatternDemo.java
1679e917617162ff3d50e00fa8f9639c21e6c4ce
[]
no_license
masudjbd/DesignPattern
065f9dbfac8e151c4c0b44ae1b06865a73d6f491
b57f853f29d77f0804f9200511c25780033af693
refs/heads/master
2016-09-05T19:05:57.549617
2015-08-06T23:34:17
2015-08-06T23:34:17
40,327,597
0
1
null
null
null
null
UTF-8
Java
false
false
496
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package template.designpattern; /** * * @author Masudur Rahman <[email protected]> */ public class TemplatePatternDemo { public static void main(String[] args) { Game game = new Cricket(); game.play(); System.out.println(); game = new Football(); game.play(); } }
a2f96252467ea73621b09c42ef9cdabc6bc4f284
70d40e4d2a188dc76ae458e8bc37055e12e6a1e4
/app/src/main/java/com/lanou3g/newdemo/investment/bean/InvestRaiseBean.java
0b590531e9898180137e18121e2485974916060a
[]
no_license
Liuchengyang/TestDemo
4e65183ae0b7973dc3c5d95908cea9c500d1ad38
47829fba004518bfc05b427a930c3f25780c52c4
refs/heads/master
2021-01-20T17:50:05.469306
2016-10-19T07:15:18
2016-10-19T07:15:18
68,558,928
12
0
null
null
null
null
UTF-8
Java
false
false
11,735
java
package com.lanou3g.newdemo.investment.bean; import java.util.List; /** *         ┏┓   ┏┓+ + *        ┏┛┻━━━┛┻┓ + + *        ┃       ┃ *        ┃   ━   ┃ ++ + + + *        ████━████ ┃+ *        ┃       ┃ + *        ┃   ┻   ┃ *        ┃       ┃ + + *        ┗━┓   ┏━┛ *          ┃   ┃ *          ┃   ┃ + + + + *          ┃   ┃    Code is far away from bug with the animal protecting *          ┃   ┃ +     神兽保佑,代码无bug *          ┃   ┃ *          ┃   ┃  + *          ┃    ┗━━━┓ + + *          ┃        ┣┓ *          ┃        ┏┛ *          ┗┓┓┏━┳┓┏┛ + + + + *           ┃┫┫ ┃┫┫ *           ┗┻┛ ┗┻┛+ + + + * <p> * Created by 刘城羊 on 16/7/10. */ public class InvestRaiseBean { /** * code : 0 * data : {"page":1,"totalCount":1,"pageSize":20,"data":[{"can_exit":false,"cf_advantage":[{"adcontent":"吕强","adname":"创始人"},{"adcontent":"张岩、邓巍、陈玮华","adname":"团队成员"}],"cf_raising":"¥1000万","cf_success_raising_offer":"¥500万","company_brief":"烤肉饭的大掌柜。一个简单而真实的人。","company_id":160319,"company_logo":"https://krplus-pic.b0.upaiyun.com/201605/11/49927d0b590ad96f809dbb0ace9c1242.png!200","company_name":"kao!烤肉饭","crowdFundingId":191,"file_list_img":"https://krplus-pic.b0.upaiyun.com/201609/30/b697b19b8b004c79d000ef5f30544a3e.jpg","followed":false,"fundStatus":{"crowd_funding_status":"MAO_DING","desc":"10月11日 10:10 募资","start_time":1476151800000},"lead_name":"萍乡安普梦想企业咨询中心(有限合伙)","min_investment":"¥10万","payUrl":"https://z.36kr.com/m/deposit/confirm?id=191","rate":0.5}]} * msg : 操作成功! */ private int code; /** * page : 1 * totalCount : 1 * pageSize : 20 * data : [{"can_exit":false,"cf_advantage":[{"adcontent":"吕强","adname":"创始人"},{"adcontent":"张岩、邓巍、陈玮华","adname":"团队成员"}],"cf_raising":"¥1000万","cf_success_raising_offer":"¥500万","company_brief":"烤肉饭的大掌柜。一个简单而真实的人。","company_id":160319,"company_logo":"https://krplus-pic.b0.upaiyun.com/201605/11/49927d0b590ad96f809dbb0ace9c1242.png!200","company_name":"kao!烤肉饭","crowdFundingId":191,"file_list_img":"https://krplus-pic.b0.upaiyun.com/201609/30/b697b19b8b004c79d000ef5f30544a3e.jpg","followed":false,"fundStatus":{"crowd_funding_status":"MAO_DING","desc":"10月11日 10:10 募资","start_time":1476151800000},"lead_name":"萍乡安普梦想企业咨询中心(有限合伙)","min_investment":"¥10万","payUrl":"https://z.36kr.com/m/deposit/confirm?id=191","rate":0.5}] */ private DataBean data; private String msg; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public DataBean getData() { return data; } public void setData(DataBean data) { this.data = data; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public static class DataBean { private int page; private int totalCount; private int pageSize; /** * can_exit : false * cf_advantage : [{"adcontent":"吕强","adname":"创始人"},{"adcontent":"张岩、邓巍、陈玮华","adname":"团队成员"}] * cf_raising : ¥1000万 * cf_success_raising_offer : ¥500万 * company_brief : 烤肉饭的大掌柜。一个简单而真实的人。 * company_id : 160319 * company_logo : https://krplus-pic.b0.upaiyun.com/201605/11/49927d0b590ad96f809dbb0ace9c1242.png!200 * company_name : kao!烤肉饭 * crowdFundingId : 191 * file_list_img : https://krplus-pic.b0.upaiyun.com/201609/30/b697b19b8b004c79d000ef5f30544a3e.jpg * followed : false * fundStatus : {"crowd_funding_status":"MAO_DING","desc":"10月11日 10:10 募资","start_time":1476151800000} * lead_name : 萍乡安普梦想企业咨询中心(有限合伙) * min_investment : ¥10万 * payUrl : https://z.36kr.com/m/deposit/confirm?id=191 * rate : 0.5 */ private List<DataBeanf> data; public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getTotalCount() { return totalCount; } public void setTotalCount(int totalCount) { this.totalCount = totalCount; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public List<DataBeanf> getData() { return data; } public void setData(List<DataBeanf> data) { this.data = data; } public static class DataBeanf { private boolean can_exit; private String cf_raising; private String cf_success_raising_offer; private String company_brief; private int company_id; private String company_logo; private String company_name; private int crowdFundingId; private String file_list_img; private boolean followed; /** * crowd_funding_status : MAO_DING * desc : 10月11日 10:10 募资 * start_time : 1476151800000 */ private FundStatusBean fundStatus; private String lead_name; private String min_investment; private String payUrl; private double rate; /** * adcontent : 吕强 * adname : 创始人 */ private List<CfAdvantageBean> cf_advantage; public boolean isCan_exit() { return can_exit; } public void setCan_exit(boolean can_exit) { this.can_exit = can_exit; } public String getCf_raising() { return cf_raising; } public void setCf_raising(String cf_raising) { this.cf_raising = cf_raising; } public String getCf_success_raising_offer() { return cf_success_raising_offer; } public void setCf_success_raising_offer(String cf_success_raising_offer) { this.cf_success_raising_offer = cf_success_raising_offer; } public String getCompany_brief() { return company_brief; } public void setCompany_brief(String company_brief) { this.company_brief = company_brief; } public int getCompany_id() { return company_id; } public void setCompany_id(int company_id) { this.company_id = company_id; } public String getCompany_logo() { return company_logo; } public void setCompany_logo(String company_logo) { this.company_logo = company_logo; } public String getCompany_name() { return company_name; } public void setCompany_name(String company_name) { this.company_name = company_name; } public int getCrowdFundingId() { return crowdFundingId; } public void setCrowdFundingId(int crowdFundingId) { this.crowdFundingId = crowdFundingId; } public String getFile_list_img() { return file_list_img; } public void setFile_list_img(String file_list_img) { this.file_list_img = file_list_img; } public boolean isFollowed() { return followed; } public void setFollowed(boolean followed) { this.followed = followed; } public FundStatusBean getFundStatus() { return fundStatus; } public void setFundStatus(FundStatusBean fundStatus) { this.fundStatus = fundStatus; } public String getLead_name() { return lead_name; } public void setLead_name(String lead_name) { this.lead_name = lead_name; } public String getMin_investment() { return min_investment; } public void setMin_investment(String min_investment) { this.min_investment = min_investment; } public String getPayUrl() { return payUrl; } public void setPayUrl(String payUrl) { this.payUrl = payUrl; } public double getRate() { return rate; } public void setRate(double rate) { this.rate = rate; } public List<CfAdvantageBean> getCf_advantage() { return cf_advantage; } public void setCf_advantage(List<CfAdvantageBean> cf_advantage) { this.cf_advantage = cf_advantage; } public static class FundStatusBean { private String crowd_funding_status; private String desc; private long start_time; public String getCrowd_funding_status() { return crowd_funding_status; } public void setCrowd_funding_status(String crowd_funding_status) { this.crowd_funding_status = crowd_funding_status; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public long getStart_time() { return start_time; } public void setStart_time(long start_time) { this.start_time = start_time; } } public static class CfAdvantageBean { private String adcontent; private String adname; public String getAdcontent() { return adcontent; } public void setAdcontent(String adcontent) { this.adcontent = adcontent; } public String getAdname() { return adname; } public void setAdname(String adname) { this.adname = adname; } } } } }
0dda6dc9a3dfcb07de393ca548a5902a516ed2cd
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Lang-10/org.apache.commons.lang3.time.FastDateParser/BBC-F0-opt-10/tests/28/org/apache/commons/lang3/time/FastDateParser_ESTest.java
c69717b7acf4a9378148b19aefe6683815d05fe9
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
50,268
java
/* * This file was automatically generated by EvoSuite * Sat Oct 23 10:17:40 GMT 2021 */ package org.apache.commons.lang3.time; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.text.ParseException; import java.text.ParsePosition; import java.time.ZoneId; import java.time.ZoneOffset; import java.util.Date; import java.util.Locale; import java.util.SimpleTimeZone; import java.util.TimeZone; import java.util.regex.Pattern; import org.apache.commons.lang3.time.FastDateParser; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class FastDateParser_ESTest extends FastDateParser_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("y>S&-E\r"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("y>S&-E\r", timeZone0, locale0); int int0 = fastDateParser0.adjustYear(67); assertEquals(1967, int0); } @Test(timeout = 4000) public void test01() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-308), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); Object object0 = fastDateParser0.parseObject(" locale does not support dates before 1868 ad)\n"); assertEquals("Fri Feb 14 20:21:21 GMT 2014", object0.toString()); } @Test(timeout = 4000) public void test02() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.US; FastDateParser fastDateParser0 = new FastDateParser("z'}?", timeZone0, locale0); boolean boolean0 = fastDateParser0.isNextNumber(); assertFalse(boolean0); } @Test(timeout = 4000) public void test03() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-308), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); TimeZone timeZone0 = fastDateParser0.getTimeZone(); assertFalse(timeZone0.useDaylightTime()); } @Test(timeout = 4000) public void test04() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(5, "1NK9hD\"n$V6O8$FP", 5, 5, 0, 5, 0, 5, 1, 90); Locale locale0 = Locale.GERMAN; FastDateParser fastDateParser0 = new FastDateParser("GMTIST", simpleTimeZone0, locale0); TimeZone timeZone0 = fastDateParser0.getTimeZone(); assertSame(timeZone0, simpleTimeZone0); } @Test(timeout = 4000) public void test05() throws Throwable { Locale locale0 = Locale.ITALY; TimeZone timeZone0 = TimeZone.getTimeZone("$y{"); FastDateParser fastDateParser0 = new FastDateParser("1I++{~}", timeZone0, locale0); int int0 = fastDateParser0.adjustYear((-2804)); assertEquals((-804), int0); } @Test(timeout = 4000) public void test06() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-288), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition((-288)); // Undeclared exception! try { fastDateParser0.parseObject("s*+", parsePosition0); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test07() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("y>S&-E\r"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("y>S&-E\r", timeZone0, locale0); // Undeclared exception! try { fastDateParser0.parseObject("y>S&-E\r", (ParsePosition) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test08() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.GERMANY; FastDateParser fastDateParser0 = new FastDateParser("M#R<", timeZone0, locale0); // Undeclared exception! try { fastDateParser0.parseObject((String) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test09() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("/R", timeZone0, locale0); // Undeclared exception! try { fastDateParser0.parse((String) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test10() throws Throwable { ZoneOffset zoneOffset0 = ZoneOffset.ofTotalSeconds(0); TimeZone timeZone0 = TimeZone.getTimeZone((ZoneId) zoneOffset0); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = null; try { fastDateParser0 = new FastDateParser((String) null, timeZone0, locale0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test11() throws Throwable { Locale locale0 = Locale.GERMANY; TimeZone timeZone0 = TimeZone.getDefault(); Locale locale1 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''|'[^']++(''[^']*+)*+'|[^'A-Za-z]++", timeZone0, locale0); FastDateParser fastDateParser1 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''|'[^']++(''[^']*+)*+'|[^'A-Za-z]++", timeZone0, locale1); boolean boolean0 = fastDateParser1.equals(timeZone0); assertFalse(boolean0); } @Test(timeout = 4000) public void test12() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(0, "5UH dTzU%B\"d>%y^x", 0, 0, 0, 0, 387, 0, 0, 638); Locale locale0 = Locale.forLanguageTag("org.apache.commons.lang3.time.FastDateParser$CopyQuotedStrategy"); FastDateParser fastDateParser0 = new FastDateParser("#7] =C]$0~Wom\"", simpleTimeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition(0); Date date0 = fastDateParser0.parse("5UH dTzU%B\"d>%y^x", parsePosition0); assertNull(date0); } @Test(timeout = 4000) public void test13() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-1), "/R"); Locale locale0 = FastDateParser.JAPANESE_IMPERIAL; FastDateParser fastDateParser0 = new FastDateParser("/R", simpleTimeZone0, locale0); try { fastDateParser0.parse("Ar}1hve(dnV"); fail("Expecting exception: ParseException"); } catch(ParseException e) { // // (The ja_JP_JP_#u-ca-japanese locale does not support dates before 1868 AD) // Unparseable date: \"Ar}1hve(dnV\" does not match / // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test14() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.US; FastDateParser fastDateParser0 = new FastDateParser("z'}?", timeZone0, locale0); Date date0 = fastDateParser0.parse("GMTCST"); assertEquals("Fri Feb 14 20:21:21 GMT 2014", date0.toString()); } @Test(timeout = 4000) public void test15() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.US; FastDateParser fastDateParser0 = new FastDateParser("z'}?", timeZone0, locale0); Date date0 = fastDateParser0.parse("AST"); assertEquals("Fri Feb 14 20:21:21 GMT 2014", date0.toString()); } @Test(timeout = 4000) public void test16() throws Throwable { Locale locale0 = Locale.ITALY; TimeZone timeZone0 = TimeZone.getTimeZone("1I++{~}"); FastDateParser fastDateParser0 = new FastDateParser("z`^_", timeZone0, locale0); assertEquals("z`^_", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test17() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("G_TP"); Locale locale0 = new Locale("G_TP", "G_TP", "G_TP"); FastDateParser fastDateParser0 = new FastDateParser("G_TP", timeZone0, locale0); assertEquals("G_TP", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test18() throws Throwable { Locale locale0 = FastDateParser.JAPANESE_IMPERIAL; SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1, "D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''}'[^']++(''[^']*+)*+'|[^'A-Za-z]++"); FastDateParser fastDateParser0 = new FastDateParser("^D=yyB}", simpleTimeZone0, locale0); assertEquals("^D=yyB}", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test19() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("CTT"); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("<bhzHv:c*SvMNR", timeZone0, locale0); assertEquals("<bhzHv:c*SvMNR", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test20() throws Throwable { Locale locale0 = Locale.ENGLISH; TimeZone timeZone0 = TimeZone.getDefault(); FastDateParser fastDateParser0 = new FastDateParser("h: -{}wKW}CQ/x$$", timeZone0, locale0); assertEquals("h: -{}wKW}CQ/x$$", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test21() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("y>S&-E\r"); Locale locale0 = Locale.CANADA_FRENCH; FastDateParser fastDateParser0 = new FastDateParser("G8W6&IlVsu)'];Cuk~h", timeZone0, locale0); // Undeclared exception! try { fastDateParser0.parse("", (ParsePosition) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test22() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("[whW=2y7", timeZone0, locale0); assertEquals("[whW=2y7", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test23() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("+T*({![n(z$"); Locale locale0 = Locale.FRANCE; FastDateParser fastDateParser0 = new FastDateParser("5Dh;@{Q]4 muP:", timeZone0, locale0); assertEquals("5Dh;@{Q]4 muP:", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test24() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("4$fk?~O"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("4$fk?~O", timeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition(0); fastDateParser0.parseObject("4$fk?~O", parsePosition0); assertEquals("java.text.ParsePosition[index=2,errorIndex=-1]", parsePosition0.toString()); assertEquals(2, parsePosition0.getIndex()); } @Test(timeout = 4000) public void test25() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("y>S&-E\r"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("3DTe(9Tp#,Oaz", timeZone0, locale0); assertEquals("3DTe(9Tp#,Oaz", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test26() throws Throwable { Locale locale0 = Locale.GERMANY; SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(4217, "EX9,"); FastDateParser fastDateParser0 = new FastDateParser("z2#5sSv+L}", simpleTimeZone0, locale0); assertEquals("z2#5sSv+L}", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test27() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("0u/bYim/163<ltgx'", timeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition(96); // Undeclared exception! try { fastDateParser0.parse("0u/bYim/163<ltgx'", parsePosition0); fail("Expecting exception: StringIndexOutOfBoundsException"); } catch(StringIndexOutOfBoundsException e) { } } @Test(timeout = 4000) public void test28() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("D.vmix|'/hz", timeZone0, locale0); assertEquals("D.vmix|'/hz", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test29() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("-+J>rm"); Locale locale0 = Locale.CANADA; FastDateParser fastDateParser0 = new FastDateParser("-+J>rm", timeZone0, locale0); assertEquals("-+J>rm", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test30() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("6[h,.,)/^QZ;kZ", timeZone0, locale0); assertEquals("6[h,.,)/^QZ;kZ", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test31() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-308), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser("*", simpleTimeZone0, locale0); assertEquals("*", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test32() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.CHINA; FastDateParser fastDateParser0 = new FastDateParser(")i;sl9Cc['xBS", timeZone0, locale0); assertEquals(")i;sl9Cc['xBS", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test33() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-308), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser("@7\"K(wD~pz9)k$#N", simpleTimeZone0, locale0); assertEquals("@7\"K(wD~pz9)k$#N", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test34() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("%wS&l-VF\r", timeZone0, locale0); int int0 = fastDateParser0.adjustYear(34); assertEquals(1934, int0); } @Test(timeout = 4000) public void test35() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("y>S&-E\r"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("y>S&-E\r", timeZone0, locale0); // Undeclared exception! try { fastDateParser0.getFieldWidth(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test36() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("?JG@Cjo+,L` v5\"l1n", timeZone0, locale0); assertEquals("?JG@Cjo+,L` v5\"l1n", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test37() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("-+J>rm"); Locale locale0 = Locale.CANADA; FastDateParser fastDateParser0 = new FastDateParser("94<$rl)f[nU!n", timeZone0, locale0); assertEquals("94<$rl)f[nU!n", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test38() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = FastDateParser.JAPANESE_IMPERIAL; FastDateParser fastDateParser0 = new FastDateParser("/ bTgK@_:WO;2c", timeZone0, locale0); assertEquals("/ bTgK@_:WO;2c", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test39() throws Throwable { Locale locale0 = Locale.ENGLISH; TimeZone timeZone0 = TimeZone.getDefault(); FastDateParser fastDateParser0 = new FastDateParser("/R", timeZone0, locale0); try { fastDateParser0.parse("JST"); fail("Expecting exception: ParseException"); } catch(ParseException e) { // // Unparseable date: \"JST\" does not match / // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test40() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; Locale locale1 = Locale.forLanguageTag("@PV="); FastDateParser fastDateParser0 = new FastDateParser("@PV=", timeZone0, locale0); FastDateParser fastDateParser1 = new FastDateParser("@PV=", timeZone0, locale1); boolean boolean0 = fastDateParser1.equals(fastDateParser0); assertFalse(boolean0); } @Test(timeout = 4000) public void test41() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1049, " locale does not support dates before 1868 AD)\n"); TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); FastDateParser fastDateParser1 = new FastDateParser(" locale does not support dates before 1868 AD)\n", timeZone0, locale0); boolean boolean0 = fastDateParser0.equals(fastDateParser1); assertFalse(boolean0); } @Test(timeout = 4000) public void test42() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-308), " locale does not support dates before 1868 AD)\n"); Locale locale0 = new Locale(" locale does not support dates before 1868 AD)\n", " locale does not support dates before 1868 AD)\n"); FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); FastDateParser fastDateParser1 = new FastDateParser(" locale does not support dates before 1868 ad)\n", simpleTimeZone0, locale0); boolean boolean0 = fastDateParser1.equals(fastDateParser0); assertFalse(boolean0); } @Test(timeout = 4000) public void test43() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1049, " locale does not support dates before 1868 AD)\n"); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser(" locale does not support dates before 1868 AD)\n", simpleTimeZone0, locale0); boolean boolean0 = fastDateParser0.equals(fastDateParser0); assertTrue(boolean0); } @Test(timeout = 4000) public void test44() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("CTT"); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = null; try { fastDateParser0 = new FastDateParser("ja", timeZone0, locale0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Invalid pattern // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test45() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.FRANCE; FastDateParser fastDateParser0 = new FastDateParser("MIT", timeZone0, locale0); Date date0 = fastDateParser0.parse("9-p5tM?2z:CA1[7"); assertEquals("Fri Feb 14 20:21:21 GMT 2014", date0.toString()); } @Test(timeout = 4000) public void test46() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.SIMPLIFIED_CHINESE; FastDateParser fastDateParser0 = new FastDateParser("E/.E%#X4M`,=", timeZone0, locale0); Pattern pattern0 = fastDateParser0.getParsePattern(); assertEquals("(\u661F\u671F\u4E00|\u661F\u671F\u4E00|\u661F\u671F\u4E09|\u661F\u671F\u4E09|\u661F\u671F\u4E8C|\u661F\u671F\u4E8C|\u661F\u671F\u4E94|\u661F\u671F\u4E94|\u661F\u671F\u516D|\u661F\u671F\u516D|\u661F\u671F\u56DB|\u661F\u671F\u56DB|\u661F\u671F\u65E5|\u661F\u671F\u65E5)/\\.(\u661F\u671F\u4E00|\u661F\u671F\u4E00|\u661F\u671F\u4E09|\u661F\u671F\u4E09|\u661F\u671F\u4E8C|\u661F\u671F\u4E8C|\u661F\u671F\u4E94|\u661F\u671F\u4E94|\u661F\u671F\u516D|\u661F\u671F\u516D|\u661F\u671F\u56DB|\u661F\u671F\u56DB|\u661F\u671F\u65E5|\u661F\u671F\u65E5)%#", pattern0.pattern()); } @Test(timeout = 4000) public void test47() throws Throwable { SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(0, "5UH dTzU%B\"d>%y^x", 0, 0, 0, 0, 387, 0, 0, 638); Locale locale0 = Locale.forLanguageTag("org.apache.commons.lang3.time.FastDateParser$CopyQuotedStrategy"); FastDateParser fastDateParser0 = new FastDateParser("#7] =C]$0~Wom\"", simpleTimeZone0, locale0); TimeZone timeZone0 = fastDateParser0.getTimeZone(); assertSame(timeZone0, simpleTimeZone0); } @Test(timeout = 4000) public void test48() throws Throwable { Locale locale0 = FastDateParser.JAPANESE_IMPERIAL; SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1, "D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''}'[^']++(''[^']*+)*+'|[^'A-Za-z]++"); FastDateParser fastDateParser0 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''}'[^']++(''[^']*+)*+'|[^'A-Za-z]++", simpleTimeZone0, locale0); try { fastDateParser0.parseObject("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''}'[^']++(''[^']*+)*+'|[^'A-Za-z]++"); fail("Expecting exception: ParseException"); } catch(ParseException e) { // // (The ja_JP_JP_#u-ca-japanese locale does not support dates before 1868 AD) // Unparseable date: \"D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''}'[^']++(''[^']*+)*+'|[^'A-Za-z]++\" does not match (\\p{IsNd}++)\\+\\|(\u571F|\u571F\u66DC\u65E5|\u65E5|\u65E5\u66DC\u65E5|\u6708|\u6708\u66DC\u65E5|\u6728|\u6728\u66DC\u65E5|\u6C34|\u6C34\u66DC\u65E5|\u706B|\u706B\u66DC\u65E5|\u91D1|\u91D1\u66DC\u65E5)\\+\\|(\\p{IsNd}++)\\+\\|(\u7D00\u5143\u524D|\u7D00\u5143\u524D|\u897F\u66A6|\u897F\u66A6)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(GMT[+\\-]\\d{0,1}\\d{2}|[+\\-]\\d{2}:?\\d{2}|ACDT|ACST|ACT|ACWST|ADT|AEDT|AEST|AFT|AKDT|AKST|ALMT|AMT|ANAT|AQTT|ART|AST|AWST|AZOST|AZOT|AZT|BDT|BNT|BOT|Bougainville\\s*+Standard\\s*+Time|BRT|BST|BTT|CAT|CCT|CDT|CEST|CET|CHADT|CHAST|CHOT|ChST|CHUT|CKT|CLST|CLT|COT|CST|CVT|CXT|DAVT|DDUT|EASST|EAST|EAT|ECT|EDT|EEST|EET|EGST|EGT|EST|FJST|FJT|FKT|FNT|GALT|GAMT|GET|GFT|GILT|GMT|GMT\\+01:00|GMT\\+02:00|GMT\\+03:00|GMT\\+04:00|GMT\\+05:00|GMT\\+06:00|GMT\\+07:00|GMT\\+08:00|GMT\\+09:00|GMT\\+10:00|GMT\\+11:00|GMT\\+12:00|GMT\\+13:00|GMT\\+14:00|GMT-01:00|GMT-02:00|GMT-03:00|GMT-04:00|GMT-05:00|GMT-06:00|GMT-07:00|GMT-08:00|GMT-09:00|GMT-10:00|GMT-11:00|GMT-12:00|GST|GYT|HDT|HKT|HOVT|HST|ICT|IDT|IOT|IRDT|IRKT|IRST|IST|JST|KGT|KOST|Kostanay\\s*+Standard\\s*+Time|KRAT|KST|LHDT|LHST|LINT|MAGT|MART|MAWT|MDT|MEST|MET|MHT|MIST|MMT|MSK|MST|MUT|MVT|MYT|NCT|NDT|NFST|NFT|NOVT|NPT|NRT|NST|NUT|NZDT|NZST|OMST|ORAT|PDT|PET|PETT|PGT|Philippines\\s*+Standard\\s*+Time|PHOT|PKT|PMDT|PMST|PONT|PST|PWT|PYST|PYT|QOST|QYZT|RET|ROTT|SAKT|SAMT|SAST|SBT|SCT|SGT|Srednekolymsk\\s*+Time|SRET|SRT|SST|SYOT|TAHT|TFT|TJT|TKT|TLT|TMT|TOT|TVT|ULAT|UTC|UYT|UZT|VET|VLAT|VOST|VUT|WAKT|WAT|WEST|WET|WFT|WGST|WGT|WIB|WIT|WITA|WSDT|WSST|XJT|YAKT|YEKT|\u30A2\u30A4\u30EB\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30A2\u30AF\u30BF\u30A6\u6642\u9593|\u30A2\u30AF\u30C8\u30D9\u6642\u9593|\u30A2\u30AF\u30EC\u6642\u9593|\u30A2\u30BC\u30EB\u30D0\u30A4\u30B8\u30E3\u30F3\u6642\u9593|\u30A2\u30BE\u30EC\u30B9\u590F\u6642\u9593|\u30A2\u30BE\u30EC\u30B9\u6642\u9593|\u30A2\u30CA\u30C9\u30A5\u30A4\u30EA\u6642\u9593|\u30A2\u30D5\u30AC\u30CB\u30B9\u30BF\u30F3\u6642\u9593|\u30A2\u30DE\u30BE\u30F3\u6642\u9593|\u30A2\u30E9\u30B9\u30AB\u590F\u6642\u9593|\u30A2\u30E9\u30B9\u30AB\u6A19\u6E96\u6642|\u30A2\u30E9\u30D3\u30A2\u6A19\u6E96\u6642|\u30A2\u30EB\u30BC\u30F3\u30C1\u30F3\u6642\u9593|\u30A2\u30EB\u30DE\u30A2\u30BF\u6642\u9593|\u30A2\u30EB\u30E1\u30CB\u30A2\u6642\u9593|\u30A4\u30B9\u30E9\u30A8\u30EB\u590F\u6642\u9593|\u30A4\u30B9\u30E9\u30A8\u30EB\u6A19\u6E96\u6642|\u30A4\u30E9\u30F3\u590F\u6642\u9593|\u30A4\u30E9\u30F3\u6A19\u6E96\u6642|\u30A4\u30EB\u30AF\u30FC\u30C4\u30AF\u6642\u9593|\u30A4\u30F3\u30C9\u30B7\u30CA\u6642\u9593|\u30A4\u30F3\u30C9\u6A19\u6E96\u6642|\u30A4\u30F3\u30C9\u6D0B\u5730\u57DF\u6642\u9593|\u30A4\u30FC\u30B9\u30BF\u30FC\u5CF6\u590F\u6642\u9593|\u30A4\u30FC\u30B9\u30BF\u30FC\u5CF6\u6642\u9593|\u30A6\u30A7\u30FC\u30AF\u6642\u9593|\u30A6\u30B9\u30C1\u30CD\u30E9\u6642\u9593|\u30A6\u30BA\u30D9\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30A6\u30E9\u30B8\u30AA\u30B9\u30C8\u30AF\u6642\u9593|\u30A6\u30E9\u30FC\u30F3\u30D0\u30FC\u30C8\u30EB\u6642\u9593|\u30A6\u30EB\u30B0\u30A2\u30A4\u6642\u9593|\u30A8\u30AB\u30C6\u30EA\u30F3\u30D6\u30EB\u30B0\u6642\u9593|\u30A8\u30AF\u30A2\u30C9\u30EB\u6642\u9593|\u30AA\u30E0\u30B9\u30AF\u6642\u9593|\u30AA\u30E9\u30EB\u6642\u9593|\u30AB\u30FC\u30DC\u30D9\u30EB\u30C7\u6642\u9593|\u30AC\u30A4\u30A2\u30CA\u6642\u9593|\u30AC\u30E9\u30D1\u30B4\u30B9\u6642\u9593|\u30AC\u30F3\u30D3\u30A2\u6642\u9593|\u30AC\u30FC\u30CA\u6A19\u6E96\u6642|\u30AD\u30B8\u30EB\u30AA\u30EB\u30C0\u6642\u9593|\u30AD\u30E5\u30FC\u30D0\u590F\u6642\u9593|\u30AD\u30E5\u30FC\u30D0\u6A19\u6E96\u6642|\u30AD\u30EB\u30AE\u30B9\u30BF\u30F3\u6642\u9593|\u30AE\u30EB\u30D0\u30FC\u30C8\u8AF8\u5CF6\u6642\u9593|\u30AF\u30C3\u30AF\u8AF8\u5CF6\u6642\u9593|\u30AF\u30E9\u30B9\u30CE\u30E4\u30EB\u30B9\u30AF\u6642\u9593|\u30AF\u30EA\u30B9\u30DE\u30B9\u8AF8\u5CF6\u6642\u9593|\u30B0\u30A2\u30E0\u6A19\u6E96\u6642|\u30B0\u30EA\u30CB\u30C3\u30B8\u6A19\u6E96\u6642|\u30B0\u30EB\u30B8\u30A2\u6642\u9593|\u30B3\u30B3\u30B9\u8AF8\u5CF6\u6642\u9593|\u30B3\u30B9\u30E9\u30A8\u6642\u9593|\u30B3\u30ED\u30F3\u30D3\u30A2\u6642\u9593|\u30B5\u30DE\u30E9\u6642\u9593|\u30B5\u30E2\u30A2\u6A19\u6E96\u6642|\u30B5\u30F3\u30D4\u30A8\u30FC\u30EB\u30FB\u30DF\u30AF\u30ED\u30F3\u8AF8\u5CF6\u590F\u6642\u9593|\u30B5\u30F3\u30D4\u30A8\u30FC\u30EB\u30FB\u30DF\u30AF\u30ED\u30F3\u8AF8\u5CF6\u6A19\u6E96\u6642|\u30B7\u30F3\u30AC\u30DD\u30FC\u30EB\u6642\u9593|\u30B9\u30EA\u30CA\u30E0\u6642\u9593|\u30BB\u30A4\u30B7\u30A7\u30EB\u6642\u9593|\u30BD\u30ED\u30E2\u30F3\u8AF8\u5CF6\u6642\u9593|\u30BF\u30B8\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30BF\u30D2\u30C1\u6642\u9593|\u30C1\u30E3\u30BF\u30E0\u590F\u6642\u9593|\u30C1\u30E3\u30BF\u30E0\u6A19\u6E96\u6642|\u30C1\u30E5\u30FC\u30AF\u6642\u9593|\u30C1\u30E7\u30A4\u30D0\u30EB\u30B5\u30F3\u6642\u9593|\u30C1\u30EA\u590F\u6642\u9593|\u30C1\u30EA\u6642\u9593|\u30C4\u30D0\u30EB\u6642\u9593|\u30C7\u30A4\u30D3\u30B9\u6642\u9593|\u30C7\u30E5\u30E2\u30F3\u30C7\u30E5\u30EB\u30F4\u30A3\u30EB\u6642\u9593|\u30C8\u30B1\u30E9\u30A6\u8AF8\u5CF6\u6642\u9593|\u30C8\u30EB\u30AF\u30E1\u30CB\u30B9\u30BF\u30F3\u6642\u9593|\u30C8\u30F3\u30AC\u6642\u9593|\u30CA\u30A6\u30EB\u6642\u9593|\u30CB\u30A6\u30A8\u5CF6\u6642\u9593|\u30CB\u30E5\u30FC\u30AB\u30EC\u30C9\u30CB\u30A2\u6642\u9593|\u30CB\u30E5\u30FC\u30B8\u30FC\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30CB\u30E5\u30FC\u30B8\u30FC\u30E9\u30F3\u30C9\u6A19\u6E96\u6642|\u30CB\u30E5\u30FC\u30D5\u30A1\u30F3\u30C9\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30CB\u30E5\u30FC\u30D5\u30A1\u30F3\u30C9\u30E9\u30F3\u30C9\u6A19\u6E96\u6642|\u30CD\u30D1\u30FC\u30EB\u6642\u9593|\u30CE\u30DC\u30B7\u30D3\u30EB\u30B9\u30AF\u6642\u9593|\u30CE\u30FC\u30D5\u30A9\u30FC\u30AF\u590F\u6642\u9593|\u30CE\u30FC\u30D5\u30A9\u30FC\u30AF\u6642\u9593|\u30CF\u30EF\u30A4\u590F\u6642\u9593|\u30CF\u30EF\u30A4\u6A19\u6E96\u6642|\u30D0\u30CC\u30A2\u30C4\u6642\u9593|\u30D0\u30F3\u30B0\u30E9\u30C7\u30B7\u30E5\u6642\u9593|\u30D1\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30D1\u30D7\u30A2\u30CB\u30E5\u30FC\u30AE\u30CB\u30A2\u6642\u9593|\u30D1\u30E9\u30AA\u6642\u9593|\u30D1\u30E9\u30B0\u30A2\u30A4\u590F\u6642\u9593|\u30D1\u30E9\u30B0\u30A2\u30A4\u6642\u9593|\u30D4\u30C8\u30B1\u30EB\u30F3\u5CF6\u6A19\u6E96\u6642|\u30D5\u30A3\u30B8\u30FC\u590F\u6642\u9593|\u30D5\u30A3\u30B8\u30FC\u6642\u9593|\u30D5\u30A7\u30CB\u30C3\u30AF\u30B9\u8AF8\u5CF6\u6642\u9593|\u30D5\u30A7\u30EB\u30CA\u30F3\u30C9\u30FB\u30C7\u30FB\u30CE\u30ED\u30FC\u30CB\u30E3\u6642\u9593|\u30D5\u30A9\u30FC\u30AF\u30E9\u30F3\u30C9\u8AF8\u5CF6\u6642\u9593|\u30D6\u30E9\u30B8\u30EB\u6642\u9593|\u30D6\u30EB\u30CD\u30A4\u6642\u9593|\u30D6\u30FC\u30BF\u30F3\u6642\u9593|\u30D9\u30CD\u30BA\u30A8\u30E9\u6642\u9593|\u30DA\u30C8\u30ED\u30D1\u30D6\u30ED\u30D5\u30B9\u30AF\u30AB\u30E0\u30C1\u30E3\u30C4\u30AD\u30FC\u6642\u9593|\u30DA\u30EB\u30FC\u6642\u9593|\u30DB\u30D6\u30C9\u6642\u9593|\u30DC\u30B9\u30C8\u30FC\u30AF\u57FA\u5730\u6642\u9593|\u30DC\u30EA\u30D3\u30A2\u6642\u9593|\u30DD\u30F3\u30DA\u30A4\u6642\u9593|\u30DE\u30AC\u30C0\u30F3\u6642\u9593|\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u590F\u6642\u9593|\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u6642\u9593|\u30DE\u30EB\u30B1\u30B5\u30B9\u6642\u9593|\u30DE\u30EC\u30FC\u30B7\u30A2\u6642\u9593|\u30DE\u30FC\u30B7\u30E3\u30EB\u5CF6\u6642\u9593|\u30DF\u30E3\u30F3\u30DE\u30FC\u6642\u9593|\u30E2\u30B9\u30AF\u30EF\u6A19\u6E96\u6642|\u30E2\u30EB\u30B8\u30D6\u6642\u9593|\u30E2\u30FC\u30BD\u30F3\u6642\u9593|\u30E2\u30FC\u30EA\u30B7\u30E3\u30B9\u6642\u9593|\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593|\u30E9\u30A4\u30F3\u8AF8\u5CF6\u6642\u9593|\u30EC\u30E6\u30CB\u30AA\u30F3\u6642\u9593|\u30ED\u30BC\u30E9\u6642\u9593|\u30ED\u30FC\u30C9\u30CF\u30A6\u5CF6\u590F\u6642\u9593|\u30ED\u30FC\u30C9\u30CF\u30A6\u5CF6\u6A19\u6E96\u6642|\u30EF\u30EA\u30B9\u53CA\u3073\u30D5\u30C4\u30CA\u6642\u9593|\u4E2D\u56FD\u6A19\u6E96\u6642|\u4E2D\u592E\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u4E2D\u897F\u90E8\u6A19\u6E96\u6642\\(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u4E2D\u90E8\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u4E2D\u90E8\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u4E2D\u90E8\u590F\u6642\u9593|\u4E2D\u90E8\u590F\u6642\u9593\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u590F\u6642\u9593\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u4E2D\u90E8\u6A19\u6E96\u6642|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u30CE\u30FC\u30B6\u30F3\u30C6\u30EA\u30C8\u30EA\u30FC\\)|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u4ECF\u5357\u65B9\u9818\u304A\u3088\u3073\u5357\u6975\u6642\u9593|\u4ECF\u9818\u30AE\u30A2\u30CA\u6642\u9593|\u5354\u5B9A\u4E16\u754C\u6642|\u5357\u30A2\u30D5\u30EA\u30AB\u6A19\u6E96\u6642|\u5357\u30B8\u30E7\u30FC\u30B8\u30A2\u5CF6\u6A19\u6E96\u6642|\u5927\u897F\u6D0B\u590F\u6642\u9593|\u5927\u897F\u6D0B\u6A19\u6E96\u6642|\u592A\u5E73\u6D0B\u590F\u6642\u9593|\u592A\u5E73\u6D0B\u6A19\u6E96\u6642|\u5C71\u5730\u590F\u6642\u9593|\u5C71\u5730\u6A19\u6E96\u6642|\u65E5\u672C\u6A19\u6E96\u6642|\u662D\u548C\u57FA\u5730\u6642\u9593|\u6771\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u6771\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u6771\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u6771\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593|\u6771\u30C6\u30A3\u30E2\u30FC\u30EB\u6642\u9593|\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u6771\u90E8\u590F\u6642\u9593|\u6771\u90E8\u590F\u6642\u9593\\(\u30BF\u30B9\u30DE\u30CB\u30A2\\)|\u6771\u90E8\u590F\u6642\u9593\\(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u6771\u90E8\u590F\u6642\u9593\\(\u30D3\u30AF\u30C8\u30EA\u30A2\\)|\u6771\u90E8\u6A19\u6E96\u6642|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30AF\u30A4\u30FC\u30F3\u30BA\u30E9\u30F3\u30C9\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30BF\u30B9\u30DE\u30CB\u30A2\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30D3\u30AF\u30C8\u30EA\u30A2\\)|\u6A3A\u592A\u6642\u9593|\u6E7E\u5CB8\u6A19\u6E96\u6642|\u82F1\u56FD\u590F\u6642\u9593|\u897F\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u897F\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u897F\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u897F\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593|\u897F\u30B5\u30E2\u30A2\u590F\u6642\u9593|\u897F\u30B5\u30E2\u30A2\u6642\u9593|\u897F\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u897F\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u897F\u90E8\u6A19\u6E96\u6642\\(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u97D3\u56FD\u6A19\u6E96\u6642|\u9999\u6E2F\u6642\u9593)\\+\\|(\u5348\u524D|\u5348\u5F8C)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(\\p{IsNd}++)\\+\\|(GMT[+\\-]\\d{0,1}\\d{2}|[+\\-]\\d{2}:?\\d{2}|ACDT|ACST|ACT|ACWST|ADT|AEDT|AEST|AFT|AKDT|AKST|ALMT|AMT|ANAT|AQTT|ART|AST|AWST|AZOST|AZOT|AZT|BDT|BNT|BOT|Bougainville\\s*+Standard\\s*+Time|BRT|BST|BTT|CAT|CCT|CDT|CEST|CET|CHADT|CHAST|CHOT|ChST|CHUT|CKT|CLST|CLT|COT|CST|CVT|CXT|DAVT|DDUT|EASST|EAST|EAT|ECT|EDT|EEST|EET|EGST|EGT|EST|FJST|FJT|FKT|FNT|GALT|GAMT|GET|GFT|GILT|GMT|GMT\\+01:00|GMT\\+02:00|GMT\\+03:00|GMT\\+04:00|GMT\\+05:00|GMT\\+06:00|GMT\\+07:00|GMT\\+08:00|GMT\\+09:00|GMT\\+10:00|GMT\\+11:00|GMT\\+12:00|GMT\\+13:00|GMT\\+14:00|GMT-01:00|GMT-02:00|GMT-03:00|GMT-04:00|GMT-05:00|GMT-06:00|GMT-07:00|GMT-08:00|GMT-09:00|GMT-10:00|GMT-11:00|GMT-12:00|GST|GYT|HDT|HKT|HOVT|HST|ICT|IDT|IOT|IRDT|IRKT|IRST|IST|JST|KGT|KOST|Kostanay\\s*+Standard\\s*+Time|KRAT|KST|LHDT|LHST|LINT|MAGT|MART|MAWT|MDT|MEST|MET|MHT|MIST|MMT|MSK|MST|MUT|MVT|MYT|NCT|NDT|NFST|NFT|NOVT|NPT|NRT|NST|NUT|NZDT|NZST|OMST|ORAT|PDT|PET|PETT|PGT|Philippines\\s*+Standard\\s*+Time|PHOT|PKT|PMDT|PMST|PONT|PST|PWT|PYST|PYT|QOST|QYZT|RET|ROTT|SAKT|SAMT|SAST|SBT|SCT|SGT|Srednekolymsk\\s*+Time|SRET|SRT|SST|SYOT|TAHT|TFT|TJT|TKT|TLT|TMT|TOT|TVT|ULAT|UTC|UYT|UZT|VET|VLAT|VOST|VUT|WAKT|WAT|WEST|WET|WFT|WGST|WGT|WIB|WIT|WITA|WSDT|WSST|XJT|YAKT|YEKT|\u30A2\u30A4\u30EB\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30A2\u30AF\u30BF\u30A6\u6642\u9593|\u30A2\u30AF\u30C8\u30D9\u6642\u9593|\u30A2\u30AF\u30EC\u6642\u9593|\u30A2\u30BC\u30EB\u30D0\u30A4\u30B8\u30E3\u30F3\u6642\u9593|\u30A2\u30BE\u30EC\u30B9\u590F\u6642\u9593|\u30A2\u30BE\u30EC\u30B9\u6642\u9593|\u30A2\u30CA\u30C9\u30A5\u30A4\u30EA\u6642\u9593|\u30A2\u30D5\u30AC\u30CB\u30B9\u30BF\u30F3\u6642\u9593|\u30A2\u30DE\u30BE\u30F3\u6642\u9593|\u30A2\u30E9\u30B9\u30AB\u590F\u6642\u9593|\u30A2\u30E9\u30B9\u30AB\u6A19\u6E96\u6642|\u30A2\u30E9\u30D3\u30A2\u6A19\u6E96\u6642|\u30A2\u30EB\u30BC\u30F3\u30C1\u30F3\u6642\u9593|\u30A2\u30EB\u30DE\u30A2\u30BF\u6642\u9593|\u30A2\u30EB\u30E1\u30CB\u30A2\u6642\u9593|\u30A4\u30B9\u30E9\u30A8\u30EB\u590F\u6642\u9593|\u30A4\u30B9\u30E9\u30A8\u30EB\u6A19\u6E96\u6642|\u30A4\u30E9\u30F3\u590F\u6642\u9593|\u30A4\u30E9\u30F3\u6A19\u6E96\u6642|\u30A4\u30EB\u30AF\u30FC\u30C4\u30AF\u6642\u9593|\u30A4\u30F3\u30C9\u30B7\u30CA\u6642\u9593|\u30A4\u30F3\u30C9\u6A19\u6E96\u6642|\u30A4\u30F3\u30C9\u6D0B\u5730\u57DF\u6642\u9593|\u30A4\u30FC\u30B9\u30BF\u30FC\u5CF6\u590F\u6642\u9593|\u30A4\u30FC\u30B9\u30BF\u30FC\u5CF6\u6642\u9593|\u30A6\u30A7\u30FC\u30AF\u6642\u9593|\u30A6\u30B9\u30C1\u30CD\u30E9\u6642\u9593|\u30A6\u30BA\u30D9\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30A6\u30E9\u30B8\u30AA\u30B9\u30C8\u30AF\u6642\u9593|\u30A6\u30E9\u30FC\u30F3\u30D0\u30FC\u30C8\u30EB\u6642\u9593|\u30A6\u30EB\u30B0\u30A2\u30A4\u6642\u9593|\u30A8\u30AB\u30C6\u30EA\u30F3\u30D6\u30EB\u30B0\u6642\u9593|\u30A8\u30AF\u30A2\u30C9\u30EB\u6642\u9593|\u30AA\u30E0\u30B9\u30AF\u6642\u9593|\u30AA\u30E9\u30EB\u6642\u9593|\u30AB\u30FC\u30DC\u30D9\u30EB\u30C7\u6642\u9593|\u30AC\u30A4\u30A2\u30CA\u6642\u9593|\u30AC\u30E9\u30D1\u30B4\u30B9\u6642\u9593|\u30AC\u30F3\u30D3\u30A2\u6642\u9593|\u30AC\u30FC\u30CA\u6A19\u6E96\u6642|\u30AD\u30B8\u30EB\u30AA\u30EB\u30C0\u6642\u9593|\u30AD\u30E5\u30FC\u30D0\u590F\u6642\u9593|\u30AD\u30E5\u30FC\u30D0\u6A19\u6E96\u6642|\u30AD\u30EB\u30AE\u30B9\u30BF\u30F3\u6642\u9593|\u30AE\u30EB\u30D0\u30FC\u30C8\u8AF8\u5CF6\u6642\u9593|\u30AF\u30C3\u30AF\u8AF8\u5CF6\u6642\u9593|\u30AF\u30E9\u30B9\u30CE\u30E4\u30EB\u30B9\u30AF\u6642\u9593|\u30AF\u30EA\u30B9\u30DE\u30B9\u8AF8\u5CF6\u6642\u9593|\u30B0\u30A2\u30E0\u6A19\u6E96\u6642|\u30B0\u30EA\u30CB\u30C3\u30B8\u6A19\u6E96\u6642|\u30B0\u30EB\u30B8\u30A2\u6642\u9593|\u30B3\u30B3\u30B9\u8AF8\u5CF6\u6642\u9593|\u30B3\u30B9\u30E9\u30A8\u6642\u9593|\u30B3\u30ED\u30F3\u30D3\u30A2\u6642\u9593|\u30B5\u30DE\u30E9\u6642\u9593|\u30B5\u30E2\u30A2\u6A19\u6E96\u6642|\u30B5\u30F3\u30D4\u30A8\u30FC\u30EB\u30FB\u30DF\u30AF\u30ED\u30F3\u8AF8\u5CF6\u590F\u6642\u9593|\u30B5\u30F3\u30D4\u30A8\u30FC\u30EB\u30FB\u30DF\u30AF\u30ED\u30F3\u8AF8\u5CF6\u6A19\u6E96\u6642|\u30B7\u30F3\u30AC\u30DD\u30FC\u30EB\u6642\u9593|\u30B9\u30EA\u30CA\u30E0\u6642\u9593|\u30BB\u30A4\u30B7\u30A7\u30EB\u6642\u9593|\u30BD\u30ED\u30E2\u30F3\u8AF8\u5CF6\u6642\u9593|\u30BF\u30B8\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30BF\u30D2\u30C1\u6642\u9593|\u30C1\u30E3\u30BF\u30E0\u590F\u6642\u9593|\u30C1\u30E3\u30BF\u30E0\u6A19\u6E96\u6642|\u30C1\u30E5\u30FC\u30AF\u6642\u9593|\u30C1\u30E7\u30A4\u30D0\u30EB\u30B5\u30F3\u6642\u9593|\u30C1\u30EA\u590F\u6642\u9593|\u30C1\u30EA\u6642\u9593|\u30C4\u30D0\u30EB\u6642\u9593|\u30C7\u30A4\u30D3\u30B9\u6642\u9593|\u30C7\u30E5\u30E2\u30F3\u30C7\u30E5\u30EB\u30F4\u30A3\u30EB\u6642\u9593|\u30C8\u30B1\u30E9\u30A6\u8AF8\u5CF6\u6642\u9593|\u30C8\u30EB\u30AF\u30E1\u30CB\u30B9\u30BF\u30F3\u6642\u9593|\u30C8\u30F3\u30AC\u6642\u9593|\u30CA\u30A6\u30EB\u6642\u9593|\u30CB\u30A6\u30A8\u5CF6\u6642\u9593|\u30CB\u30E5\u30FC\u30AB\u30EC\u30C9\u30CB\u30A2\u6642\u9593|\u30CB\u30E5\u30FC\u30B8\u30FC\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30CB\u30E5\u30FC\u30B8\u30FC\u30E9\u30F3\u30C9\u6A19\u6E96\u6642|\u30CB\u30E5\u30FC\u30D5\u30A1\u30F3\u30C9\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u30CB\u30E5\u30FC\u30D5\u30A1\u30F3\u30C9\u30E9\u30F3\u30C9\u6A19\u6E96\u6642|\u30CD\u30D1\u30FC\u30EB\u6642\u9593|\u30CE\u30DC\u30B7\u30D3\u30EB\u30B9\u30AF\u6642\u9593|\u30CE\u30FC\u30D5\u30A9\u30FC\u30AF\u590F\u6642\u9593|\u30CE\u30FC\u30D5\u30A9\u30FC\u30AF\u6642\u9593|\u30CF\u30EF\u30A4\u590F\u6642\u9593|\u30CF\u30EF\u30A4\u6A19\u6E96\u6642|\u30D0\u30CC\u30A2\u30C4\u6642\u9593|\u30D0\u30F3\u30B0\u30E9\u30C7\u30B7\u30E5\u6642\u9593|\u30D1\u30AD\u30B9\u30BF\u30F3\u6642\u9593|\u30D1\u30D7\u30A2\u30CB\u30E5\u30FC\u30AE\u30CB\u30A2\u6642\u9593|\u30D1\u30E9\u30AA\u6642\u9593|\u30D1\u30E9\u30B0\u30A2\u30A4\u590F\u6642\u9593|\u30D1\u30E9\u30B0\u30A2\u30A4\u6642\u9593|\u30D4\u30C8\u30B1\u30EB\u30F3\u5CF6\u6A19\u6E96\u6642|\u30D5\u30A3\u30B8\u30FC\u590F\u6642\u9593|\u30D5\u30A3\u30B8\u30FC\u6642\u9593|\u30D5\u30A7\u30CB\u30C3\u30AF\u30B9\u8AF8\u5CF6\u6642\u9593|\u30D5\u30A7\u30EB\u30CA\u30F3\u30C9\u30FB\u30C7\u30FB\u30CE\u30ED\u30FC\u30CB\u30E3\u6642\u9593|\u30D5\u30A9\u30FC\u30AF\u30E9\u30F3\u30C9\u8AF8\u5CF6\u6642\u9593|\u30D6\u30E9\u30B8\u30EB\u6642\u9593|\u30D6\u30EB\u30CD\u30A4\u6642\u9593|\u30D6\u30FC\u30BF\u30F3\u6642\u9593|\u30D9\u30CD\u30BA\u30A8\u30E9\u6642\u9593|\u30DA\u30C8\u30ED\u30D1\u30D6\u30ED\u30D5\u30B9\u30AF\u30AB\u30E0\u30C1\u30E3\u30C4\u30AD\u30FC\u6642\u9593|\u30DA\u30EB\u30FC\u6642\u9593|\u30DB\u30D6\u30C9\u6642\u9593|\u30DC\u30B9\u30C8\u30FC\u30AF\u57FA\u5730\u6642\u9593|\u30DC\u30EA\u30D3\u30A2\u6642\u9593|\u30DD\u30F3\u30DA\u30A4\u6642\u9593|\u30DE\u30AC\u30C0\u30F3\u6642\u9593|\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u590F\u6642\u9593|\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u6642\u9593|\u30DE\u30EB\u30B1\u30B5\u30B9\u6642\u9593|\u30DE\u30EC\u30FC\u30B7\u30A2\u6642\u9593|\u30DE\u30FC\u30B7\u30E3\u30EB\u5CF6\u6642\u9593|\u30DF\u30E3\u30F3\u30DE\u30FC\u6642\u9593|\u30E2\u30B9\u30AF\u30EF\u6A19\u6E96\u6642|\u30E2\u30EB\u30B8\u30D6\u6642\u9593|\u30E2\u30FC\u30BD\u30F3\u6642\u9593|\u30E2\u30FC\u30EA\u30B7\u30E3\u30B9\u6642\u9593|\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593|\u30E9\u30A4\u30F3\u8AF8\u5CF6\u6642\u9593|\u30EC\u30E6\u30CB\u30AA\u30F3\u6642\u9593|\u30ED\u30BC\u30E9\u6642\u9593|\u30ED\u30FC\u30C9\u30CF\u30A6\u5CF6\u590F\u6642\u9593|\u30ED\u30FC\u30C9\u30CF\u30A6\u5CF6\u6A19\u6E96\u6642|\u30EF\u30EA\u30B9\u53CA\u3073\u30D5\u30C4\u30CA\u6642\u9593|\u4E2D\u56FD\u6A19\u6E96\u6642|\u4E2D\u592E\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u4E2D\u897F\u90E8\u6A19\u6E96\u6642\\(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u4E2D\u90E8\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u4E2D\u90E8\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u4E2D\u90E8\u590F\u6642\u9593|\u4E2D\u90E8\u590F\u6642\u9593\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u590F\u6642\u9593\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u4E2D\u90E8\u6A19\u6E96\u6642|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u30CE\u30FC\u30B6\u30F3\u30C6\u30EA\u30C8\u30EA\u30FC\\)|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u4E2D\u90E8\u6A19\u6E96\u6642\\(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u4ECF\u5357\u65B9\u9818\u304A\u3088\u3073\u5357\u6975\u6642\u9593|\u4ECF\u9818\u30AE\u30A2\u30CA\u6642\u9593|\u5354\u5B9A\u4E16\u754C\u6642|\u5357\u30A2\u30D5\u30EA\u30AB\u6A19\u6E96\u6642|\u5357\u30B8\u30E7\u30FC\u30B8\u30A2\u5CF6\u6A19\u6E96\u6642|\u5927\u897F\u6D0B\u590F\u6642\u9593|\u5927\u897F\u6D0B\u6A19\u6E96\u6642|\u592A\u5E73\u6D0B\u590F\u6642\u9593|\u592A\u5E73\u6D0B\u6A19\u6E96\u6642|\u5C71\u5730\u590F\u6642\u9593|\u5C71\u5730\u6A19\u6E96\u6642|\u65E5\u672C\u6A19\u6E96\u6642|\u662D\u548C\u57FA\u5730\u6642\u9593|\u6771\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u6771\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u6771\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u6771\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593|\u6771\u30C6\u30A3\u30E2\u30FC\u30EB\u6642\u9593|\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u6771\u90E8\u590F\u6642\u9593|\u6771\u90E8\u590F\u6642\u9593\\(\u30BF\u30B9\u30DE\u30CB\u30A2\\)|\u6771\u90E8\u590F\u6642\u9593\\(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u6771\u90E8\u590F\u6642\u9593\\(\u30D3\u30AF\u30C8\u30EA\u30A2\\)|\u6771\u90E8\u6A19\u6E96\u6642|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30AF\u30A4\u30FC\u30F3\u30BA\u30E9\u30F3\u30C9\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30BF\u30B9\u30DE\u30CB\u30A2\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA\\)|\u6771\u90E8\u6A19\u6E96\u6642\\(\u30D3\u30AF\u30C8\u30EA\u30A2\\)|\u6A3A\u592A\u6642\u9593|\u6E7E\u5CB8\u6A19\u6E96\u6642|\u82F1\u56FD\u590F\u6642\u9593|\u897F\u30A2\u30D5\u30EA\u30AB\u6642\u9593|\u897F\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593|\u897F\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u590F\u6642\u9593|\u897F\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593|\u897F\u30B5\u30E2\u30A2\u590F\u6642\u9593|\u897F\u30B5\u30E2\u30A2\u6642\u9593|\u897F\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593|\u897F\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593|\u897F\u90E8\u6A19\u6E96\u6642\\(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\\)|\u97D3\u56FD\u6A19\u6E96\u6642|\u9999\u6E2F\u6642\u9593)\\+\\|'\\}\\[\\^\\]\\+\\+\\('\\[\\^\\]\\*\\+\\)\\*\\+\\|\\[\\^ // verifyException("org.apache.commons.lang3.time.FastDateParser", e); } } @Test(timeout = 4000) public void test49() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ENGLISH; FastDateParser fastDateParser0 = new FastDateParser("/R", timeZone0, locale0); Locale locale1 = fastDateParser0.getLocale(); assertEquals("", locale1.getISO3Country()); } @Test(timeout = 4000) public void test50() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.SIMPLIFIED_CHINESE; FastDateParser fastDateParser0 = new FastDateParser("E/.E%#X4M`,=", timeZone0, locale0); String string0 = fastDateParser0.getPattern(); assertEquals("E/.E%#X4M`,=", string0); } @Test(timeout = 4000) public void test51() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.ITALIAN; FastDateParser fastDateParser0 = new FastDateParser("GMTART", timeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition(7); Object object0 = fastDateParser0.parseObject("FastDateParser[GMTART,it,GMT]", parsePosition0); assertNull(object0); } @Test(timeout = 4000) public void test52() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''|'[^']++(''[^']*+)*+'|[^'A-Za-z]++", timeZone0, locale0); String string0 = fastDateParser0.toString(); assertEquals("FastDateParser[D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''|'[^']++(''[^']*+)*+'|[^'A-Za-z]++,it_IT,GMT]", string0); } @Test(timeout = 4000) public void test53() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+|S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+|''|'[^']++(''[^']*+)*+'|[^'A-Za-z]++", timeZone0, locale0); fastDateParser0.hashCode(); } @Test(timeout = 4000) public void test54() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.US; FastDateParser fastDateParser0 = new FastDateParser("SL2:9]I+2]VMlp", timeZone0, locale0); ParsePosition parsePosition0 = new ParsePosition(0); fastDateParser0.parse("7o/Pd5VR|", parsePosition0); assertEquals("java.text.ParsePosition[index=1,errorIndex=-1]", parsePosition0.toString()); assertEquals(1, parsePosition0.getIndex()); } @Test(timeout = 4000) public void test55() throws Throwable { TimeZone timeZone0 = TimeZone.getTimeZone("GMT"); Locale locale0 = Locale.ITALY; FastDateParser fastDateParser0 = new FastDateParser("!.{masxGML;x?%og.", timeZone0, locale0); assertEquals("!.{masxGML;x?%og.", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test56() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.CHINESE; FastDateParser fastDateParser0 = new FastDateParser("kMZMV|V{s9,Bxr=NU6i8", timeZone0, locale0); assertEquals("kMZMV|V{s9,Bxr=NU6i8", fastDateParser0.getPattern()); } @Test(timeout = 4000) public void test57() throws Throwable { TimeZone timeZone0 = TimeZone.getDefault(); Locale locale0 = Locale.SIMPLIFIED_CHINESE; FastDateParser fastDateParser0 = new FastDateParser("D+|E+|F+|G+|H+|K+|M+S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+M''}'[^']++(''[^']*+)*+'|[^'A-Za-z]+", timeZone0, locale0); assertEquals("D+|E+|F+|G+|H+|K+|M+S+|W+|Z+|a+|d+|h+|k+|m+|s+|w+|y+|z+M''}'[^']++(''[^']*+)*+'|[^'A-Za-z]+", fastDateParser0.getPattern()); } }
51bcf2d8eb72277dffe35b2745489e25b5d7acb3
35f725b3d8a9416c937f65110d144750960c7dcd
/src/main/java/org/SirTobiSwobi/c3/c3committee/resources/EvaluationsResource.java
fe2c0bbdf3254e5b3450350fc53c327aa9a0a1b4
[ "MIT" ]
permissive
SirTobiSwobi/c3-committee
3ce281448a178855a641af4049ab3928594dee76
c8c083416789877c0bb4ce2d52a639f93da7a159
refs/heads/master
2022-12-20T00:29:30.343453
2020-10-24T21:03:33
2020-10-24T21:03:33
157,759,053
0
0
null
null
null
null
UTF-8
Java
false
false
2,816
java
package org.SirTobiSwobi.c3.c3committee.resources; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.SirTobiSwobi.c3.c3committee.api.TCEvalCategory; import org.SirTobiSwobi.c3.c3committee.api.TCEvaluation; import org.SirTobiSwobi.c3.c3committee.api.TCEvaluations; import org.SirTobiSwobi.c3.c3committee.api.TCTrainingSession; import org.SirTobiSwobi.c3.c3committee.db.EvalCategory; import org.SirTobiSwobi.c3.c3committee.db.Evaluation; import org.SirTobiSwobi.c3.c3committee.db.ReferenceHub; import org.SirTobiSwobi.c3.c3committee.db.TrainingSession; @Path("/evaluations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public class EvaluationsResource { private ReferenceHub refHub; public EvaluationsResource(ReferenceHub refHub) { super(); this.refHub = refHub; } @GET public Response getTrainingSessions(@QueryParam("hash") String hash){ TrainingSession[] trainingSessions = refHub.getEvaluationManager().getTrainingSessionArray(); TCTrainingSession[] TCtrainingSessionArray = new TCTrainingSession[trainingSessions.length]; for(int i=0; i<trainingSessions.length;i++){ TrainingSession trainingSession = trainingSessions[i]; TCEvaluation[] foldEvaluations=new TCEvaluation[trainingSession.getEvaluationArray().length]; Evaluation[] evaluations=trainingSession.getEvaluationArray(); for(int j=0; j<foldEvaluations.length; j++){ Evaluation eval = evaluations[j]; TCEvalCategory[] TCevalCategories = new TCEvalCategory[eval.getEvalCategories().length]; EvalCategory[] evalCategories = eval.getEvalCategories(); for(int k=0; k<evalCategories.length; k++){ EvalCategory evalCat = evalCategories[k]; TCevalCategories[k]=new TCEvalCategory(evalCat.getId(), evalCat.getLabel(), evalCat.getDescription(), evalCat.getTP(), evalCat.getFP(), evalCat.getFN(), evalCat.getPrecision(), evalCat.getRecall(), evalCat.getF1()); } foldEvaluations[j] = new TCEvaluation(eval.isIncludeImplicits(), eval.getAssignmentThreshold(), eval.getMicroaveragePrecision(), eval.getMicroaverageRecall(), eval.getMicroaverageF1(), eval.getMacroaveragePrecision(), eval.getMacroaverageRecall(), eval.getMacroaverageF1(), eval.getFoldId(), TCevalCategories); } TCTrainingSession tcTrainingSession = new TCTrainingSession(trainingSession.getModelId(), trainingSession.getTimestamp(), trainingSession.getDescription(), trainingSession.getId(), foldEvaluations); TCtrainingSessionArray[i]=tcTrainingSession; } TCEvaluations evaluations = new TCEvaluations(TCtrainingSessionArray); return Response.ok(evaluations).build(); } }
d8a893ee997781c0a840cedb60d55d9b6c724bff
3aade4e00320f036c4f317169eb3d7c8f36d00a9
/selenium/src/test/java/com/zestcarrental/util/StringUtils.java
b3330e14b349b37482b23d21dbd8729bea13453c
[]
no_license
volynvlad/automation-training
9a23b63ba01019c7895fed8cf75a0e5b1efa9f51
ca6fa651af67dc10431c21da0e6baf8eafd00b08
refs/heads/master
2021-12-14T21:56:21.551457
2019-12-19T09:18:09
2019-12-19T09:18:09
211,614,344
1
0
null
2021-12-14T20:43:37
2019-09-29T06:25:37
Java
UTF-8
Java
false
false
1,416
java
package com.zestcarrental.util; public class StringUtils { public static final String HOMEPAGE_URL = "https://www.zestcarrental.com/"; public static final String QUOTE_DATES_URL = "https://www.zestcarrental.com/quote/dates/"; public static final String QUOTE_RESULTS_URL = "https://www.zestcarrental.com/quote/results/"; public static final String BOOKING_EXTRAS_URL = "https://www.zestcarrental.com/booking/extras/"; public static final String[] MONTHS = {"january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"}; public static final String ERROR_MESSAGE_BOOK_DATE_ORDER = "The end date must be after the start date."; public static final String ERROR_MESSAGE_TIME = "Sorry, it is too late to make this booking online. Currently we require 17 hours notice to make a booking."; public static final String ERROR_MESSAGE_BOOK_TOO_LONG = "There are no vehicles available for a rental duration longer than 60 days."; public static final String ERROR_MESSAGE_TOO_SMALL_DRIVER_AGE = "There are no vehicles available for a driver of age 24."; public static final String CURRENCY_EUR = "EUR (€)"; public static final String CURRENCY_GBP = "GBP (£)"; public static final String ERROR_MESSAGE_VALID_CARD = "Please enter a valid card number."; }
eaa588c2e44cbd333a0c8d6d65b68d33ad671f49
0f752b8c33a391ce8ebc72f1bc8410ae825779b3
/src/main/java/BankStatementAnalyser/BankTransactionFilter.java
4891b57bfed25826af894a98a420caddee5d7e29
[]
no_license
prasanth-varikallu/ExercisesJavaDevelopment
70e11bfdb05dfcf4fb759f363993f086e37da8bf
7533c8c534ef9246eeda7e97266be0768c77b891
refs/heads/master
2020-07-30T10:00:05.496454
2020-03-12T06:32:46
2020-03-12T06:32:46
210,183,251
0
0
null
null
null
null
UTF-8
Java
false
false
145
java
package BankStatementAnalyser; @FunctionalInterface public interface BankTransactionFilter { boolean test(BankTransaction transaction); }
25a79baba6ffff6a63e997aaac7f3e7962ee92ff
56e8ae35fb05a2a88d7dcaab860c85a7b6c8c822
/gardener/src/main/java/com/youqd/kind/ckind/bean/GetJob.java
a022d9f9e061adf291eb0602545ef4ba71ff1d24
[]
no_license
ChenxiuLion/kind
99f3a660d9615268a7b0ee071e9492578f7fe45c
67e71c6dac77e5493ee27ec9c8a3bd88a8294098
refs/heads/master
2021-07-14T12:45:38.552671
2017-10-18T08:08:40
2017-10-18T08:08:40
107,377,443
0
0
null
null
null
null
UTF-8
Java
false
false
4,662
java
package com.youqd.kind.ckind.bean; import android.text.TextUtils; import java.util.List; /** * Created by Chenxiu on 2016/7/27. */ public class GetJob { /** * ResultData : [{"ID":7,"HomeWorkTitle":"回家把3写300遍","Content":"回家把1写100遍,拍照上传提交作业!!!","Photo":null,"PeriodsType":0,"GardenerID":1,"KindergartenID":1,"ClassID":1,"CreateTime":"2016-07-27T00:00:00","StartTime":"2016-07-27 00:00:00.000","EndTime":"2016-07-27 00:00:00.000"}] * ResultCode : 1 * ResultMessage : 执行成功 * ReusltDataTotal : 0 */ private int ResultCode; private String ResultMessage; private int ReusltDataTotal; /** * ID : 7 * HomeWorkTitle : 回家把3写300遍 * Content : 回家把1写100遍,拍照上传提交作业!!! * Photo : null * PeriodsType : 0 * GardenerID : 1 * KindergartenID : 1 * ClassID : 1 * CreateTime : 2016-07-27T00:00:00 * StartTime : 2016-07-27 00:00:00.000 * EndTime : 2016-07-27 00:00:00.000 */ private List<ResultDataBean> ResultData; public int getResultCode() { return ResultCode; } public void setResultCode(int ResultCode) { this.ResultCode = ResultCode; } public String getResultMessage() { return ResultMessage; } public void setResultMessage(String ResultMessage) { this.ResultMessage = ResultMessage; } public int getReusltDataTotal() { return ReusltDataTotal; } public void setReusltDataTotal(int ReusltDataTotal) { this.ReusltDataTotal = ReusltDataTotal; } public List<ResultDataBean> getResultData() { return ResultData; } public void setResultData(List<ResultDataBean> ResultData) { this.ResultData = ResultData; } public static class ResultDataBean { private int ID; private String HomeWorkTitle; private String Content; private String Photo; private int PeriodsType; private int GardenerID; private int KindergartenID; private int ClassID; private String CreateTime; private String StartTime; private String EndTime; private String Status; public String getStatus() { return Status; } public void setStatus(String status) { Status = status; } public int getID() { return ID; } public void setID(int ID) { this.ID = ID; } public String getHomeWorkTitle() { return HomeWorkTitle; } public void setHomeWorkTitle(String HomeWorkTitle) { this.HomeWorkTitle = HomeWorkTitle; } public String getContent() { return Content; } public void setContent(String Content) { this.Content = Content; } public String getPhoto() { if(TextUtils.isEmpty(Photo)){ return ""; } return Photo; } public void setPhoto(String Photo) { this.Photo = Photo; } public int getPeriodsType() { return PeriodsType; } public void setPeriodsType(int PeriodsType) { this.PeriodsType = PeriodsType; } public int getGardenerID() { return GardenerID; } public void setGardenerID(int GardenerID) { this.GardenerID = GardenerID; } public int getKindergartenID() { return KindergartenID; } public void setKindergartenID(int KindergartenID) { this.KindergartenID = KindergartenID; } public int getClassID() { return ClassID; } public void setClassID(int ClassID) { this.ClassID = ClassID; } public String getCreateTime() { return CreateTime; } public void setCreateTime(String CreateTime) { this.CreateTime = CreateTime; } public String getStartTime() { return StartTime; } public void setStartTime(String StartTime) { this.StartTime = StartTime; } public String getEndTime() { return EndTime; } public void setEndTime(String EndTime) { this.EndTime = EndTime; } } }
86b8fdc79a561bf527a33f0ed40b79d93bec49c3
fb15d17e681d9177cdb24728dd83cd01d46be18f
/NeoProfessions/src/me/Neoblade298/NeoProfessions/Listeners/BlacksmithListeners.java
324b3446a52292c2216ee5f2126ec0370a3cabe1
[]
no_license
diss12/MLMCPlugins
ced9086aad597de64a6d675888b705559e3021a9
f9c0a3ea08e329ff7c074fb989ab7b194ccfce8a
refs/heads/master
2020-06-28T17:27:21.586095
2019-08-11T21:12:00
2019-08-11T21:12:00
200,295,969
0
0
null
2019-08-02T20:47:18
2019-08-02T20:47:17
null
UTF-8
Java
false
false
2,986
java
package me.Neoblade298.NeoProfessions.Listeners; import java.util.HashMap; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import me.Neoblade298.NeoProfessions.Main; import me.Neoblade298.NeoProfessions.Utilities.BlacksmithUtils; import me.Neoblade298.NeoProfessions.Utilities.Util; public class BlacksmithListeners implements Listener{ HashMap<Player, ItemStack> selectedRepair = new HashMap<Player, ItemStack>(); Main main; BlacksmithUtils blacksmithUtils; Util util; public BlacksmithListeners(Main main) { this.main = main; blacksmithUtils = new BlacksmithUtils(); util = new Util(); } @EventHandler public void onPlayerInteract(PlayerInteractEvent e) { if(!e.getAction().equals(Action.RIGHT_CLICK_AIR) && !e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) { return; } if(e.getPlayer() == null || !(e.getPlayer() instanceof Player) || e.getHand().equals(EquipmentSlot.OFF_HAND)) { return; } Player p = e.getPlayer(); // If player has not selected a repair, select it if(!selectedRepair.containsKey(p)) { if(blacksmithUtils.isRepairItem(p.getInventory().getItemInMainHand())) { selectedRepair.put(p, p.getInventory().getItemInMainHand()); util.sendMessage(p, "&7Hold the item you wish to repair in your main hand and right click!"); // Time out the repair in 10 seconds Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(main, new Runnable() { public void run() { if(selectedRepair.containsKey(p)) { selectedRepair.remove(p); util.sendMessage(p, "&cRepair timed out"); } } }, 200L); } } // If a repair is selected, then complete the repair else { e.setCancelled(true); ItemStack repair = selectedRepair.get(p); ItemStack item = p.getInventory().getItemInMainHand(); int repairLevel = blacksmithUtils.getItemLevel(repair); int potency = blacksmithUtils.getItemPotency(repair); double percentage = (double) potency / 100; int itemLevel = util.getItemLevel(item); if(itemLevel != -1) { if(itemLevel <= repairLevel ){ if(p.getInventory().containsAtLeast(repair, 1)) { p.getInventory().removeItem(util.setAmount(repair.clone(), 1)); selectedRepair.remove(p); util.setCurrentDurability(item, util.getCurrentDurability(item) + (int)(percentage * util.getMaxDurability(item))); util.sendMessage(p, "&7Successfully repaired item!"); } else { util.sendMessage(p, "&cSomething went wrong! Please try again."); } } else { util.sendMessage(p, "&cThis repair kit is incompatible with this item!"); } } else { util.sendMessage(p, "&cRepair kits only work on quest items!"); } } } }
4306f9558bbb0768e8e62511c3f1fdcae0bef2b0
4a5c8e10faceebfae461d45806e53ff5451a8342
/src/main/java/br/com/ffroliva/portfolio/exception/AppException.java
e4213385b5a1be8356497cf6dca44eaeb162bbed
[]
no_license
ffroliva/portfolio-backend
bdfee5d8325c3c1731eec9017ea47b44ed1fa623
e0be906d3eda42a9c0c341c6129b1b041299b77f
refs/heads/master
2020-05-31T18:15:30.235982
2020-02-21T10:45:48
2020-02-21T10:45:48
190,429,442
0
0
null
2019-07-02T03:03:05
2019-06-05T16:23:27
Java
UTF-8
Java
false
false
495
java
package br.com.ffroliva.portfolio.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public class AppException extends RuntimeException { private static final long serialVersionUID = 3795232316629825440L; public AppException(String message) { super(message); } public AppException(String message, Throwable cause) { super(message, cause); } }
5b396794a925b0ad0feb63540a88c99eec319e4a
9c7b2e0bdc53dbd8911465c0f8034cdbb959b18d
/src/sample/Report.java
0d8364738c55a5363c4f3c53e300bdbb3e148ec9
[]
no_license
pvpetit/ResortProject
fc0bd6610bde21b196e1f16e19d876665cfceeb9
04f7848df955bad7a9d087b685a006d0bc0e9fef
refs/heads/master
2020-04-01T22:28:12.407693
2018-12-04T23:02:41
2018-12-04T23:02:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,547
java
package sample; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; /** * Class used to print summary reports in Manager window * StringProperty used to display on TableView */ public class Report { private String summaryField; private double summaryCount; private StringProperty fieldProperty; private StringProperty countProperty; public Report(String field, int count){ this.summaryField = field; this.summaryCount = count; fieldProperty = new SimpleStringProperty(); this.fieldProperty.set(field); countProperty = new SimpleStringProperty(); this.countProperty.set(String.valueOf(count)); } public String getSummaryField() { return summaryField; } public void setSummaryField(String summaryField) { this.summaryField = summaryField; } public double getSummaryCount() { return summaryCount; } public void setSummaryCount(double summaryCount) { this.summaryCount = summaryCount; } public String getFieldProperty() { return fieldProperty.get(); } public StringProperty fieldPropertyProperty() { return fieldProperty; } public void setFieldProperty(String fieldProperty) { this.fieldProperty.set(fieldProperty); } public String getCountProperty() { return countProperty.get(); } public StringProperty countPropertyProperty() { return countProperty; } public void setCountProperty(String countProperty) { this.countProperty.set(countProperty); } }
424c07e7dc5a76661fc7e9d52a0c15786b56066c
9322352feea060731ce809a3cd316af9f073714c
/JPADCore_v2/src/standaloneutils/mathtools/Complex.java
9fd6977c9b0cb442ed4594da7968ed9668918a7d
[]
no_license
QiquWong/jpad
87e5d927ebdebf9cd03084076ad30226de9ec029
a4e381cd45c9441d467e0e05e92cc59eb858f195
refs/heads/master
2020-05-15T18:38:17.354463
2019-04-19T16:53:08
2019-04-19T16:53:08
182,434,002
5
2
null
2019-04-20T17:18:19
2019-04-20T17:18:18
null
UTF-8
Java
false
false
58,499
java
package standaloneutils.mathtools; import java.io.Serializable; /** * <p> * @version 1.0 FINAL <br> ALM Fri 29-Aug-97 * <p> * A Java class for performing complex number arithmetic to <tt>double</tt> * precision. * * <p> * @author <a HREF="mailto:Alexander Anderson <[email protected]>">Sandy Anderson</a> * @author <a HREF="mailto:Priyantha Jayanetti <[email protected]>">Priyantha Jayanetti</a> * <p> * </dl> * <font color="000080"> * <pre> * <b>Copyright (c) 1997, ALMA Services. All Rights Reserved.</b> * <br> * Permission to use, copy, modify, and distribute this software and its * documentation is hereby granted provided that this copyright notice appears * in all copies and that all modifications are clearly marked. * <br> * THE AUTHORS MAKE 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, OR * NON-INFRINGEMENT. THE AUTHORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR * ITS DERIVATIVES. * <br> * Last change: ALM 29 Aug 97 2:13 am * </pre> * </font> * <p> * <dd>The latest version of this <tt>Complex</tt> class is available from * the <a href="http://www.netlib.org/">Netlib Repository</a>. * </dd> * <p> * <dd>Here's an example of the style the class permits:<br> * * <pre> * <b>import</b> ORG.netlib.math.complex.Complex;<br> * <b>public</b> <b>class</b> Test {<br> * <b>public boolean</b> isInMandelbrot (Complex c, <b>int</b> maxIter) { * Complex z= <b>new</b> Complex(0, 0);<br> * <b>for</b> (<b>int</b> i= 0; i < maxIter; i++) { * z= z.mul(z).add(c); * <b>if</b> (z.abs() > 2) <b>return false</b>; * }<br> * <b>return true</b>; * }<br> * } * </pre> * </dd> * <p> * <dd>This class was developed by * <a HREF="http://www.almide.demon.co.uk">Sandy Anderson</a> at the * <a HREF="http://www.mdx.ac.uk/www/see/opsee.htm">School of Electronic Engineering</a>, * <a HREF="http://www.mdx.ac.uk/">Middlesex University</a>, UK, and * <a HREF="http://www2.eece.maine.edu/~pidge/index.html">Priyantha Jayanetti</a> at * <a HREF="http://www.eece.maine.edu/Power/">The Power Systems Program</a>, the * <a HREF="http://www.ume.maine.edu/">University of Maine</a>, USA. * </dd> * <p> * <dd>And many, many thanks to <a href="mailto:[email protected]">Mr. Daniel * Hirsch</a>, for his constant advice on the mathematics, his exasperating * ability to uncover bugs blindfold, and for his persistent badgering over * the exact wording of this documentation. * </dd> * <p> * <dd>For instance, he starts to growl like a badger if you say "infinite set".</dd><br> * <dd>"Grrr...What's <i>that</i> mean? <i>Countably</i> infinite?"</dd><br> * <dd>You think for a while.</dd><br> * <dd>"Grrr..."</dd><br> * <dd>"Yes."</dd><br> * <dd>"Ah! Then you mean <i>infinitely many</i>."</dd><br> * <p> * * <p> Modified by: Joseph A. Huwaldt, April 3, 2014, Added "equals()" and "hashCode()". </p> **/ public class Complex implements Cloneable, Serializable { public static final String VERSION = "1.0 FINAL alm"; public static final String DATE = "Fri 29-Jul-97"; public static final String AUTHOR = "[email protected]"; public static final String REMARK = "Class available from http://www.netlib.org/"; /** * Switches on debugging information. * <p> **/ // protected static boolean debug = false; /** * Whilst debugging: the nesting level when tracing method calls. * <p> **/ // private static int trace_nesting = 0; /** * Twice <a * href="http://cad.ucla.edu/repository/useful/PI.txt"><tt><b>PI</b></tt></a> * radians is the same thing as 360 degrees. * <p> **/ protected static final double TWO_PI = 2.0 * Math.PI; /** * A constant representing <i><b>i</b></i>, the famous square root of * <i>-1</i>. * <p> * The other square root of <i>-1</i> is - <i><b>i</b></i>. * <p> **/ public static final Complex i = new Complex(0.0, 1.0); // private static final Complex one = new Complex(1.0, 0.0); // private static double epsilon = Math.abs(1.0e-5); // private static long objectCount; // !!! private double re; private double im; //---------------------------------// // CONSTRUCTORS // //---------------------------------// /** * Constructs a <tt>Complex</tt> representing the number zero. * * <p> **/ public Complex () { this(0.0, 0.0); }//end Complex() /** * Constructs a <tt>Complex</tt> representing a real number. * * <p> * @param re The real number * <p> * @see Complex#real(double) **/ public Complex (double re) { this(re, 0.0); }//end Complex(double) /** * Constructs a separate new <tt>Complex</tt> from an existing * <tt>Complex</tt>. * * <p> * @param z A <tt>Complex</tt> number * <p> **/ public Complex (Complex z) { this(z.re, z.im); }//end Complex(Complex) /** * Constructs a <tt>Complex</tt> from real and imaginary parts. * * <p> * <i><b>Note:</b><ul> <font color="000080">All methods in class * <tt>Complex</tt> which deliver a <tt>Complex</tt> are written such that * no intermediate <tt>Complex</tt> objects get generated. This means that * you can easily anticipate the likely effects on garbage collection caused * by your own coding.</font> * </ul></i> * <p> * @param re Real part * @param im Imaginary part * <p> * @see Complex#cart(double, double) * @see Complex#polar(double, double) **/ public Complex (double re, double im) { this.re = re; this.im = im; // if (debug) System.out.println(indent(trace_nesting) + "new Complex, #" + (++objectCount));// !!! }//end Complex(double,double) //---------------------------------// // DEBUG // //---------------------------------// /* // BETA Debugging methods... private static void entering (String what) { System.out.print(indent(trace_nesting) + what); trace_nesting++; }//end entering(String) private static void enter (String what, double param1, double param2) { entering(what); System.out.println("(" + param1 + ", " + param2 + ") "); }//end enter(String,double,double) private static void enter (String what, double param) { entering(what); System.out.println("(" + param + ") "); }//end enter(String,double) private static void enter (String what, Complex z) { entering(what); System.out.println("(" + z + ") "); }//end enter(String,ORG.netlib.math.complex.Complex) private static void enter (String what, Complex z1, Complex z2) { entering(what); System.out.println("(" + z1 + ", " + z2 + ") "); }//end enter(String,Complex,ORG.netlib.math.complex.Complex) private static void enter (String what, Complex z, double x) { entering(what); System.out.println("(" + z + ", " + x + ") "); }//end enter(String,Complex,double) private static void enter (String what, Complex z, double x, double y) { entering(what); System.out.println("(" + z + ", " + cart(x, y) + ") "); }//end enter(String,Complex,double) private static void enter (String what, Complex z1, Complex z2, double x) { entering(what); System.out.println("(" + z1 + ", " + z2 + ", " + x + ") "); }//end enter(String,Complex,Complex,double) private static void leaving (String what) { trace_nesting--; System.out.print(indent(trace_nesting) + "is "); }//end leaving(String) private static void leave (String what, boolean result) { leaving(what); System.out.println(result); }//end leave(String,boolean) private static void leave (String what, double result) { leaving(what); System.out.println(result); }//end leave(String,double) private static void leave (String what, Complex result) { leaving(what); System.out.println(result); }//end leave(String,ORG.netlib.math.complex.Complex) private static String indent (int nesting) { StringBuffer indention = new StringBuffer(""); for (int i = 0; i < nesting; i++) { indention.append(" "); }//endfor return indention.toString(); }//end indent(int) */ /** * Useful for checking up on the exact version. * * <p> **/ public static void main (String[] args) { System.out.println(); System.out.println("Module : " + Complex.class.getName()); System.out.println("Version: " + Complex.VERSION); System.out.println("Date : " + Complex.DATE); System.out.println("Author : " + Complex.AUTHOR); System.out.println("Remark : " + Complex.REMARK); System.out.println(); System.out.println("Hint: use TestComplex to test the class."); System.out.println(); }//end main(String[]) //---------------------------------// // STATIC // //---------------------------------// /** * Returns a <tt>Complex</tt> representing a real number. * * <p> * @param real The real number * <p> * @return <tt>Complex</tt> representation of the real * <p> * @see Complex#re() * @see Complex#cart(double, double) **/ public static Complex real (double real) { return new Complex(real, 0.0); }//end real(double) /** * Returns a <tt>Complex</tt> from real and imaginary parts. * * <p> * @param re Real part * @param im Imaginary part * <p> * @return <tt>Complex</tt> from Cartesian coordinates * <p> * @see Complex#re() * @see Complex#im() * @see Complex#polar(double, double) * @see Complex#toString() **/ public static Complex cart (double re, double im) { return new Complex(re, im); }//end cart(double,double) /** * Returns a <tt>Complex</tt> from a size and direction. * * <p> * @param r Size * @param theta Direction (in <i>radians</i>) * <p> * @return <tt>Complex</tt> from Polar coordinates * <p> * @see Complex#abs() * @see Complex#arg() * @see Complex#cart(double, double) **/ public static Complex polar (double r, double theta) { if (r < 0.0) { theta += Math.PI; r = -r; }//endif theta = theta % TWO_PI; return cart(r * Math.cos(theta), r * Math.sin(theta)); }//end polar(double,double) /** * Returns the <tt>Complex</tt> base raised to the power of the exponent. * * <p> * @param base The base "to raise" * @param exponent The exponent "by which to raise" * <p> * @return base "raised to the power of" exponent * <p> * @see Complex#pow(double, ORG.netlib.math.complex.Complex) **/ public static Complex pow (Complex base, double exponent) { // return base.log().scale(exponent).exp(); double re = exponent * Math.log(base.abs()); double im = exponent * base.arg(); double scalar = Math.exp(re); return cart( scalar * Math.cos(im), scalar * Math.sin(im) ); }//end pow(Complex,double) /** * Returns the base raised to the power of the <tt>Complex</tt> exponent. * * <p> * @param base The base "to raise" * @param exponent The exponent "by which to raise" * <p> * @return base "raised to the power of" exponent * <p> * @see Complex#pow(ORG.netlib.math.complex.Complex, ORG.netlib.math.complex.Complex) * @see Complex#exp() **/ public static Complex pow (double base, Complex exponent) { // return real(base).log().mul(exponent).exp(); double re = Math.log(Math.abs(base)); double im = Math.atan2(0.0, base); double re2 = (re*exponent.re) - (im*exponent.im); double im2 = (re*exponent.im) + (im*exponent.re); double scalar = Math.exp(re2); return cart( scalar * Math.cos(im2), scalar * Math.sin(im2) ); }//end pow(double,Complex) /** * Returns the <tt>Complex</tt> base raised to the power of the <tt>Complex</tt> exponent. * * <p> * @param base The base "to raise" * @param exponent The exponent "by which to raise" * <p> * @return base "raised to the power of" exponent * <p> * @see Complex#pow(ORG.netlib.math.complex.Complex, double) * @see Complex#pow(ORG.netlib.math.complex.Complex) **/ public static Complex pow (Complex base, Complex exponent) { // return base.log().mul(exponent).exp(); double re = Math.log(base.abs()); double im = base.arg(); double re2 = (re*exponent.re) - (im*exponent.im); double im2 = (re*exponent.im) + (im*exponent.re); double scalar = Math.exp(re2); return cart( scalar * Math.cos(im2), scalar * Math.sin(im2) ); }//end pow(Complex,Complex) //---------------------------------// // PUBLIC // //---------------------------------// /** * Returns <tt>true</tt> if either the real or imaginary component of this * <tt>Complex</tt> is an infinite value. * * <p> * @return <tt>true</tt> if either component of the <tt>Complex</tt> object is infinite; <tt>false</tt>, otherwise. * <p> **/ public boolean isInfinite () { return ( Double.isInfinite(re) || Double.isInfinite(im) ); }//end isInfinite() /** * Returns <tt>true</tt> if either the real or imaginary component of this * <tt>Complex</tt> is a Not-a-Number (<tt>NaN</tt>) value. * * <p> * @return <tt>true</tt> if either component of the <tt>Complex</tt> object is <tt>NaN</tt>; <tt>false</tt>, otherwise. * <p> **/ public boolean isNaN () { return ( Double.isNaN(re) || Double.isNaN(im) ); }//end isNaN() /** * Decides if two <tt>Complex</tt> numbers are "sufficiently" alike to be * considered equal. * * <p> * <tt>tolerance</tt> is the maximum magnitude of the difference between * them before they are considered <i>not</i> equal. * <p> * Checking for equality between two real numbers on computer hardware is a * tricky business. Try * <p> * <pre> System.out.println((1.0/3.0 * 3.0));</pre> * <p> * and you'll see the nature of the problem! It's just as tricky with * <tt>Complex</tt> numbers. * <p> * Realize that because of these complications, it's possible to find that * the magnitude of one <tt>Complex</tt> number <tt>a</tt> is less than * another, <tt>b</tt>, and yet <tt>a.equals(b, myTolerance)</tt> returns * <tt>true</tt>. Be aware! * <p> * @param z The <tt>Complex</tt> to compare with * @param tolerance The tolerance for equality * <p> * @return <tt>true</tt>, or <tt>false</tt> * <p> **/ public boolean equals (Complex z, double tolerance) { // still true when _equal_ to tolerance? ... return abs(re - z.re, im -z.im) <= Math.abs(tolerance); // ...and tolerance is always non-negative }//end equals(Complex,double) /** * Indicates whether some other object is "equal to" this one. * The result is true if and only if the argument is not null * and is a Complex object that has exactly the same * imaginary and real parts as this object. **/ @Override public boolean equals(Object obj) { if (obj == this) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Complex other = (Complex)obj; if (re == other.re && im == other.im) return true; return false; } /** * Returns a hash code value for the object. **/ @Override public int hashCode() { return (int)(re*1024*31 + im*1024*37); } /** * Extracts the real part of a <tt>Complex</tt> as a <tt>double</tt>. * * <p> * <pre> * re(x + <i><b>i</b></i>*y) = x * </pre> * <p> * @return The real part * <p> * @see Complex#im() * @see Complex#cart(double, double) * @see Complex#real(double) **/ public double re () { return re; }//end re() /** * Extracts the imaginary part of a <tt>Complex</tt> as a <tt>double</tt>. * * <p> * <pre> * im(x + <i><b>i</b></i>*y) = y * </pre> * <p> * @return The imaginary part * <p> * @see Complex#re() * @see Complex#cart(double, double) **/ public double im () { return im; }//end im() /** * Returns the square of the "length" of a <tt>Complex</tt> number. * * <p> * <pre> * norm(x + <i><b>i</b></i>*y) = x*x + y*y * </pre> * <p> * Always non-negative. * <p> * @return The norm * <p> * @see Complex#abs() **/ public double norm () { return (re*re) + (im*im); }//end norm() /** * Returns the magnitude of a <tt>Complex</tt> number. * * <p> * <pre> * abs(z) = sqrt(norm(z)) * </pre> * <p> * In other words, it's Pythagorean distance from the origin * (<i>0 + 0<b>i</b></i>, or zero). * <p> * The magnitude is also referred to as the "modulus" or "length". * <p> * Always non-negative. * <p> * @return The magnitude (or "length") * <p> * @see Complex#arg() * @see Complex#polar(double, double) * @see Complex#norm() **/ public double abs () { return abs(re, im); }//end abs() static private double abs (double x, double y) { // abs(z) = sqrt(norm(z)) // Adapted from "Numerical Recipes in Fortran 77: The Art of Scientific Computing" (ISBN 0-521-43064-X) double absX = Math.abs(x); double absY = Math.abs(y); if (absX == 0.0 && absY == 0.0) { // !!! Numerical Recipes, mmm? return 0.0; } else if (absX >= absY) { double d = y / x; return absX*Math.sqrt(1.0 + d*d); } else { double d = x / y; return absY*Math.sqrt(1.0 + d*d); }//endif }//end abs() /** * Returns the <i>principal</i> angle of a <tt>Complex</tt> number, in * radians, measured counter-clockwise from the real axis. (Think of the * reals as the x-axis, and the imaginaries as the y-axis.) * * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>arg(z)</i>, the others are of * the form: * <p> * <pre> * <b>A</b> + 2*k*<b>PI</b> * </pre> * <p> * where k is any integer. * <p> * <tt>arg()</tt> always returns a <tt>double</tt> between * -<tt><b>PI</b></tt> and +<tt><b>PI</b></tt>. * <p> * <i><b>Note:</b><ul> 2*<tt><b>PI</b></tt> radians is the same as 360 degrees. * </ul></i> * <p> * <i><b>Domain Restrictions:</b><ul> There are no restrictions: the * class defines arg(0) to be 0 * </ul></i> * <p> * @return Principal angle (in radians) * <p> * @see Complex#abs() * @see Complex#polar(double, double) **/ public double arg () { return Math.atan2(im, re); }//end arg() /** * Returns the "negative" of a <tt>Complex</tt> number. * * <p> * <pre> * neg(a + <i><b>i</b></i>*b) = -a - <i><b>i</b></i>*b * </pre> * <p> * The magnitude of the negative is the same, but the angle is flipped * through <tt><b>PI</b></tt> (or 180 degrees). * <p> * @return Negative of the <tt>Complex</tt> * <p> * @see Complex#scale(double) **/ public Complex neg () { return this.scale(-1.0); }//end neg() /** * Returns the <tt>Complex</tt> "conjugate". * * <p> * <pre> * conj(x + <i><b>i</b></i>*y) = x - <i><b>i</b></i>*y * </pre> * <p> * The conjugate appears "flipped" across the real axis. * <p> * @return The <tt>Complex</tt> conjugate *<p> **/ public Complex conj () { return cart(re, -im); }//end conj() /** * Returns the <tt>Complex</tt> multiplicative inverse. * * <p> * <pre> * inv(z) = 1 / z * </pre> * <p> * @return The <tt>Complex</tt> reciprocal *<p> **/ /* DEPRECATED !!! public Complex inv () { double scalar = 1.0 / ((re*re)+(im*im)); return cart(re*scalar, - im*scalar); }//end inv() /* */ static private void inv (Complex z) { double zRe, zIm; double scalar; if (Math.abs(z.re) >= Math.abs(z.im)) { scalar = 1.0 / ( z.re + z.im*(z.im/z.re) ); zRe = scalar; zIm = scalar * (- z.im/z.re); } else { scalar = 1.0 / ( z.re*(z.re/z.im) + z.im ); zRe = scalar * ( z.re/z.im); zIm = - scalar; }//endif z.re = zRe; z.im = zIm; }//end inv(Complex) /** * Returns the <tt>Complex</tt> scaled by a real number. * * <p> * <pre> * scale((x + <i><b>i</b></i>*y), s) = (x*s + <i><b>i</b></i>*y*s) * </pre> * <p> * Scaling by the real number <i>2.0</i>, doubles the magnitude, but leaves * the <tt>arg()</tt> unchanged. Scaling by <i>-1.0</i> keeps the magnitude * the same, but flips the <tt>arg()</tt> by <tt><b>PI</b></tt> (180 degrees). * <p> * @param scalar A real number scale factor * <p> * @return <tt>Complex</tt> scaled by a real number * <p> * @see Complex#mul(ORG.netlib.math.complex.Complex) * @see Complex#div(ORG.netlib.math.complex.Complex) * @see Complex#neg() **/ public Complex scale (double scalar) { return cart(scalar*re, scalar*im); }//end scale(double) /** * To perform z1 + z2, you write <tt>z1.add(z2)</tt> . * * <p> * <pre> * (a + <i><b>i</b></i>*b) + (c + <i><b>i</b></i>*d) = ((a+c) + <i><b>i</b></i>*(b+d)) * </pre> * <p> **/ public Complex add (Complex z) { return cart(re + z.re, im + z.im); }//end add(Complex) /** * To perform z1 - z2, you write <tt>z1.sub(z2)</tt> . * * <p> * <pre> * (a + <i><b>i</b></i>*b) - (c + <i><b>i</b></i>*d) = ((a-c) + <i><b>i</b></i>*(b-d)) * </pre> * <p> **/ public Complex sub (Complex z) { return cart(re - z.re, im - z.im); }//end sub(Complex) /** * To perform z1 * z2, you write <tt>z1.mul(z2)</tt> . * * <p> * <pre> * (a + <i><b>i</b></i>*b) * (c + <i><b>i</b></i>*d) = ( (a*c) - (b*d) + <i><b>i</b></i>*((a*d) + (b*c)) ) * </pre> * <p> * @see Complex#scale(double) **/ public Complex mul (Complex z) { return cart( (re*z.re) - (im*z.im), (re*z.im) + (im*z.re) ); // return cart( (re*z.re) - (im*z.im), (re + im)*(z.re + z.im) - re*z.re - im*z.im); }//end mul(Complex) /** * To perform z1 / z2, you write <tt>z1.div(z2)</tt> . * * <p> * <pre> * (a + <i><b>i</b></i>*b) / (c + <i><b>i</b></i>*d) = ( (a*c) + (b*d) + <i><b>i</b></i>*((b*c) - (a*d)) ) / norm(c + <i><b>i</b></i>*d) * </pre> * <p> * <i><b>Take care not to divide by zero!</b></i> * <p> * <i><b>Note:</b><ul> <tt>Complex</tt> arithmetic in Java never causes * exceptions. You have to deliberately check for overflow, division by * zero, and so on, <u>for yourself</u>. * </ul></i> * <p> * <i><b>Domain Restrictions:</b><ul> z1/z2 is undefined if z2 = 0 * </ul></i> * <p> * @see Complex#scale(double) **/ public Complex div (Complex z) { Complex result = new Complex(this); div(result, z.re, z.im); return result; }//end div(Complex) static private void div (Complex z, double x, double y) { // Adapted from "Numerical Recipes in Fortran 77: The Art of Scientific Computing" (ISBN 0-521-43064-X) double zRe, zIm; double scalar; if (Math.abs(x) >= Math.abs(y)) { scalar = 1.0 / ( x + y*(y/x) ); zRe = scalar * (z.re + z.im*(y/x)); zIm = scalar * (z.im - z.re*(y/x)); } else { scalar = 1.0 / ( x*(x/y) + y ); zRe = scalar * (z.re*(x/y) + z.im); zIm = scalar * (z.im*(x/y) - z.re); }//endif z.re = zRe; z.im = zIm; }//end div(Complex,double,double) /** * Returns a <tt>Complex</tt> representing one of the two square roots. * * <p> * <pre> * sqrt(z) = sqrt(abs(z)) * ( cos(arg(z)/2) + <i><b>i</b></i> * sin(arg(z)/2) ) * </pre> * <p> * For any <i>complex</i> number <i>z</i>, <i>sqrt(z)</i> will return the * <i>complex</i> root whose <i>arg</i> is <i>arg(z)/2</i>. * <p> * <i><b>Note:</b><ul> There are always two square roots for each * <tt>Complex</tt> number, except for 0 + 0<b>i</b>, or zero. The other * root is the <tt>neg()</tt> of the first one. Just as the two roots of * 4 are 2 and -2, the two roots of -1 are <b>i</b> and - <b>i</b>. * </ul></i> * <p> * @return The square root whose <i>arg</i> is <i>arg(z)/2</i>. * <p> * @see Complex#pow(ORG.netlib.math.complex.Complex, double) **/ public Complex sqrt () { Complex result = new Complex(this); sqrt(result); return result; }//end sqrt() static private void sqrt (Complex z) { // Jim Shapiro <[email protected]> // adapted from "Numerical Recipies in C" (ISBN 0-521-43108-5) by William H. Press et al double u = 0.0; double v = 0.0; double mag = z.abs(); if (mag > 0.0) { if (z.re > 0.0) { double temp = Math.sqrt(0.5 * (mag + z.re)); z.re = temp; z.im = 0.5 * z.im / temp; } else { double temp = Math.sqrt(0.5 * (mag - z.re)); if (z.im < 0.0) { temp = -temp; }//endif z.re = 0.5 * z.im / temp; z.im = temp; }//endif } else { z.re = 0.0; z.im = 0.0; }//endif }//end sqrt(Complex) /** * Returns this <tt>Complex</tt> raised to the power of a <tt>Complex</tt> exponent. * * <p> * @param exponent The exponent "by which to raise" * <p> * @return this <tt>Complex</tt> "raised to the power of" the exponent * <p> * @see Complex#pow(ORG.netlib.math.complex.Complex, ORG.netlib.math.complex.Complex) **/ public Complex pow (Complex exponent) { return Complex.pow(this, exponent); }//end pow(Complex) /** * Returns the number <i><b>e</b></i> "raised to" a <tt>Complex</tt> power. * * <p> * <pre> * exp(x + <i><b>i</b></i>*y) = exp(x) * ( cos(y) + <i><b>i</b></i> * sin(y) ) * </pre> * <p> * <i><b>Note:</b><ul> The value of <i><b>e</b></i>, a transcendental number, is * roughly 2.71828182846... * <p> * * Also, the following is quietly amazing: * <pre> * <i><b>e</b></i><sup><font size=+0><b>PI</b>*<i><b>i</b></i></font></sup> = - 1 * </pre> * </ul> * </i> * <p> * @return <i><b>e</b></i> "raised to the power of" this <tt>Complex</tt> * <p> * @see Complex#log() * @see Complex#pow(double, ORG.netlib.math.complex.Complex) **/ public Complex exp () { double scalar = Math.exp(re); // e^ix = cis x return cart( scalar * Math.cos(im), scalar * Math.sin(im) ); }//end exp() /** * Returns the <i>principal</i> natural logarithm of a <tt>Complex</tt> * number. * * <p> * <pre> * log(z) = log(abs(z)) + <i><b>i</b></i> * arg(z) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>L</b> is the principal solution of <i>log(z)</i>, the others are of * the form: * <p> * <pre> * <b>L</b> + (2*k*<b>PI</b>)*<i><b>i</b></i> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> natural logarithm * <p> * @see Complex#exp() **/ public Complex log () { return cart( Math.log(this.abs()), this.arg() ); // principal value }//end log() /** * Returns the <i>principal</i> logarithm (<i>base 10</i>) of a * <tt>Complex</tt> number. * * <p> * <pre> * log10(z) = log(z) / log(10) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>L</b> is the principal solution of <i>log10(z)</i>, the others are * of the form: * <p> * <pre> * <b>L</b> + (2*k*<b>PI</b>)*<i><b>i</b></i> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> logarithm (base 10) * <p> * @see Complex#exp() * @see Complex#log() **/ /* DEPRECATED !!! public Complex log10 () { Complex result; // if (debug) enter("log10", this); double scalar = 1.0/Math.log(10.0); // result = this.log().scale(scalar); result = cart( scalar * Math.log(this.abs()), scalar * this.arg() ); // if (debug) leave("log10", result); return result; }//end log10() /* */ /** * Returns the sine of a <tt>Complex</tt> number. * * <p> * <pre> * sin(z) = ( exp(<i><b>i</b></i>*z) - exp(-<i><b>i</b></i>*z) ) / (2*<i><b>i</b></i>) * </pre> * <p> * @return The <tt>Complex</tt> sine * <p> * @see Complex#asin() * @see Complex#sinh() * @see Complex#cosec() * @see Complex#cos() * @see Complex#tan() **/ public Complex sin () { Complex result; // sin(z) = ( exp(i*z) - exp(-i*z) ) / (2*i) double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _1: _1.sub(_2) ... _re1 = _re1 - _re2; // !!! _im1 = _im1 - _im2; // !!! // result: _1.div(2*i) ... result = cart( 0.5*_im1, -0.5*_re1 ); // result = cart(_re1, _im1); // div(result, 0.0, 2.0); return result; }//end sin() /** * Returns the cosine of a <tt>Complex</tt> number. * * <p> * <pre> * cos(z) = ( exp(<i><b>i</b></i>*z) + exp(-<i><b>i</b></i>*z) ) / 2 * </pre> * <p> * @return The <tt>Complex</tt> cosine * <p> * @see Complex#acos() * @see Complex#cosh() * @see Complex#sec() * @see Complex#sin() * @see Complex#tan() **/ public Complex cos () { Complex result; // cos(z) = ( exp(i*z) + exp(-i*z) ) / 2 double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _1: _1.add(_2) ... _re1 = _re1 + _re2; // !!! _im1 = _im1 + _im2; // !!! // result: _1.scale(0.5) ... result = cart( 0.5 * _re1, 0.5 * _im1 ); return result; }//end cos() /** * Returns the tangent of a <tt>Complex</tt> number. * * <p> * <pre> * tan(z) = sin(z) / cos(z) * </pre> * <p> * <i><b>Domain Restrictions:</b><ul> tan(z) is undefined whenever z = (k + 1/2) * <tt><b>PI</b></tt><br> * where k is any integer * </ul></i> * <p> * @return The <tt>Complex</tt> tangent * <p> * @see Complex#atan() * @see Complex#tanh() * @see Complex#cot() * @see Complex#sin() * @see Complex#cos() **/ public Complex tan () { Complex result; // tan(z) = sin(z) / cos(z) double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; double _re3, _im3; double cs_re, cs_im; // sin() ... // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _3: _1.sub(_2) ... _re3 = _re1 - _re2; _im3 = _im1 - _im2; // result: _3.div(2*i) ... result = cart( 0.5*_im3, -0.5*_re3 ); // result = cart(_re3, _im3); // div(result, 0.0, 2.0); // cos() ... // _3: _1.add(_2) ... _re3 = _re1 + _re2; _im3 = _im1 + _im2; // cs: _3.scale(0.5) ... cs_re = 0.5 * _re3; cs_im = 0.5 * _im3; // result: result.div(cs) ... div(result, cs_re, cs_im); return result; }//end tan() /** * Returns the cosecant of a <tt>Complex</tt> number. * * <p> * <pre> * cosec(z) = 1 / sin(z) * </pre> * <p> * <i><b>Domain Restrictions:</b><ul> cosec(z) is undefined whenever z = k * <tt><b>PI</b></tt><br> * where k is any integer * </ul></i> * <p> * @return The <tt>Complex</tt> cosecant * <p> * @see Complex#sin() * @see Complex#sec() * @see Complex#cot() **/ public Complex cosec () { Complex result; // cosec(z) = 1 / sin(z) double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _1: _1.sub(_2) ... _re1 = _re1 - _re2; // !!! _im1 = _im1 - _im2; // !!! // _result: _1.div(2*i) ... result = cart( 0.5*_im1, -0.5*_re1 ); // result = cart(_re1, _im1); // div(result, 0.0, 2.0); // result: one.div(_result) ... inv(result); return result; }//end cosec() /** * Returns the secant of a <tt>Complex</tt> number. * * <p> * <pre> * sec(z) = 1 / cos(z) * </pre> * <p> * <i><b>Domain Restrictions:</b><ul> sec(z) is undefined whenever z = (k + 1/2) * <tt><b>PI</b></tt><br> * where k is any integer * </ul></i> * <p> * @return The <tt>Complex</tt> secant * <p> * @see Complex#cos() * @see Complex#cosec() * @see Complex#cot() **/ public Complex sec () { Complex result; // sec(z) = 1 / cos(z) double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _1: _1.add(_2) ... _re1 = _re1 + _re2; _im1 = _im1 + _im2; // result: _1.scale(0.5) ... result = cart(0.5*_re1, 0.5*_im1); // result: one.div(result) ... inv(result); return result; }//end sec() /** * Returns the cotangent of a <tt>Complex</tt> number. * * <p> * <pre> * cot(z) = 1 / tan(z) * </pre> * <p> * <i><b>Domain Restrictions:</b><ul> cot(z) is undefined whenever z = k * <tt><b>PI</b></tt><br> * where k is any integer * </ul></i> * <p> * @return The <tt>Complex</tt> cotangent * <p> * @see Complex#tan() * @see Complex#cosec() * @see Complex#sec() **/ public Complex cot () { Complex result; // cot(z) = 1 / tan(z) = cos(z) / sin(z) double scalar; double iz_re, iz_im; double _re1, _im1; double _re2, _im2; double _re3, _im3; double sn_re, sn_im; // cos() ... // iz: i.mul(z) ... iz_re = -im; iz_im = re; // _1: iz.exp() ... scalar = Math.exp(iz_re); _re1 = scalar * Math.cos(iz_im); _im1 = scalar * Math.sin(iz_im); // _2: iz.neg().exp() ... scalar = Math.exp(-iz_re); _re2 = scalar * Math.cos(-iz_im); _im2 = scalar * Math.sin(-iz_im); // _3: _1.add(_2) ... _re3 = _re1 + _re2; _im3 = _im1 + _im2; // result: _3.scale(0.5) ... result = cart( 0.5*_re3, 0.5*_im3 ); // sin() ... // _3: _1.sub(_2) ... _re3 = _re1 - _re2; _im3 = _im1 - _im2; // sn: _3.div(2*i) ... sn_re = 0.5 * _im3; // !!! sn_im = - 0.5 * _re3; // !!! // result: result.div(sn) ... div(result, sn_re, sn_im); return result; }//end cot() /** * Returns the hyperbolic sine of a <tt>Complex</tt> number. * * <p> * <pre> * sinh(z) = ( exp(z) - exp(-z) ) / 2 * </pre> * <p> * @return The <tt>Complex</tt> hyperbolic sine * <p> * @see Complex#sin() * @see Complex#asinh() **/ public Complex sinh () { Complex result; // sinh(z) = ( exp(z) - exp(-z) ) / 2 double scalar; double _re1, _im1; double _re2, _im2; // _1: z.exp() ... scalar = Math.exp(re); _re1 = scalar * Math.cos(im); _im1 = scalar * Math.sin(im); // _2: z.neg().exp() ... scalar = Math.exp(-re); _re2 = scalar * Math.cos(-im); _im2 = scalar * Math.sin(-im); // _1: _1.sub(_2) ... _re1 = _re1 - _re2; // !!! _im1 = _im1 - _im2; // !!! // result: _1.scale(0.5) ... result = cart( 0.5 * _re1, 0.5 * _im1 ); return result; }//end sinh() /** * Returns the hyperbolic cosine of a <tt>Complex</tt> number. * * <p> * <pre> * cosh(z) = ( exp(z) + exp(-z) ) / 2 * </pre> * <p> * @return The <tt>Complex</tt> hyperbolic cosine * <p> * @see Complex#cos() * @see Complex#acosh() **/ public Complex cosh () { Complex result; // cosh(z) = ( exp(z) + exp(-z) ) / 2 double scalar; double _re1, _im1; double _re2, _im2; // _1: z.exp() ... scalar = Math.exp(re); _re1 = scalar * Math.cos(im); _im1 = scalar * Math.sin(im); // _2: z.neg().exp() ... scalar = Math.exp(-re); _re2 = scalar * Math.cos(-im); _im2 = scalar * Math.sin(-im); // _1: _1.add(_2) ... _re1 = _re1 + _re2; // !!! _im1 = _im1 + _im2; // !!! // result: _1.scale(0.5) ... result = cart( 0.5 * _re1, 0.5 * _im1 ); return result; }//end cosh() /** * Returns the hyperbolic tangent of a <tt>Complex</tt> number. * * <p> * <pre> * tanh(z) = sinh(z) / cosh(z) * </pre> * <p> * @return The <tt>Complex</tt> hyperbolic tangent * <p> * @see Complex#tan() * @see Complex#atanh() **/ public Complex tanh () { Complex result; // tanh(z) = sinh(z) / cosh(z) double scalar; double _re1, _im1; double _re2, _im2; double _re3, _im3; double ch_re, ch_im; // sinh() ... // _1: z.exp() ... scalar = Math.exp(re); _re1 = scalar * Math.cos(im); _im1 = scalar * Math.sin(im); // _2: z.neg().exp() ... scalar = Math.exp(-re); _re2 = scalar * Math.cos(-im); _im2 = scalar * Math.sin(-im); // _3: _1.sub(_2) ... _re3 = _re1 - _re2; _im3 = _im1 - _im2; // result: _3.scale(0.5) ... result = cart(0.5*_re3, 0.5*_im3); // cosh() ... // _3: _1.add(_2) ... _re3 = _re1 + _re2; _im3 = _im1 + _im2; // ch: _3.scale(0.5) ... ch_re = 0.5 * _re3; ch_im = 0.5 * _im3; // result: result.div(ch) ... div(result, ch_re, ch_im); return result; }//end tanh() /** * Returns the <i>principal</i> arc sine of a <tt>Complex</tt> number. * * <p> * <pre> * asin(z) = -<i><b>i</b></i> * log(<i><b>i</b></i>*z + sqrt(1 - z*z)) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>asin(z)</i>, the others are * of the form: * <p> * <pre> * k*<b>PI</b> + (-1)<sup><font size=-1>k</font></sup> * <b>A</b> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> arc sine * <p> * @see Complex#sin() * @see Complex#sinh() **/ public Complex asin () { Complex result; // asin(z) = -i * log(i*z + sqrt(1 - z*z)) double _re1, _im1; // _1: one.sub(z.mul(z)) ... _re1 = 1.0 - ( (re*re) - (im*im) ); _im1 = 0.0 - ( (re*im) + (im*re) ); // result: _1.sqrt() ... result = cart(_re1, _im1); sqrt(result); // _1: z.mul(i) ... _re1 = - im; _im1 = + re; // result: _1.add(result) ... result.re = _re1 + result.re; result.im = _im1 + result.im; // _1: result.log() ... _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: i.neg().mul(_1) ... result.re = _im1; result.im = - _re1; return result; }//end asin() /** * Returns the <i>principal</i> arc cosine of a <tt>Complex</tt> number. * * <p> * <pre> * acos(z) = -<i><b>i</b></i> * log( z + <i><b>i</b></i> * sqrt(1 - z*z) ) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>acos(z)</i>, the others are * of the form: * <p> * <pre> * 2*k*<b>PI</b> +/- <b>A</b> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> arc cosine * <p> * @see Complex#cos() * @see Complex#cosh() **/ public Complex acos () { Complex result; // acos(z) = -i * log( z + i * sqrt(1 - z*z) ) double _re1, _im1; // _1: one.sub(z.mul(z)) ... _re1 = 1.0 - ( (re*re) - (im*im) ); _im1 = 0.0 - ( (re*im) + (im*re) ); // result: _1.sqrt() ... result = cart(_re1, _im1); sqrt(result); // _1: i.mul(result) ... _re1 = - result.im; _im1 = + result.re; // result: z.add(_1) ... result.re = re + _re1; result.im = im + _im1; // _1: result.log() _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: i.neg().mul(_1) ... result.re = _im1; result.im = - _re1; return result; }//end acos() /** * Returns the <i>principal</i> arc tangent of a <tt>Complex</tt> number. * * <p> * <pre> * atan(z) = -<i><b>i</b></i>/2 * log( (<i><b>i</b></i>-z)/(<i><b>i</b></i>+z) ) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>atan(z)</i>, the others are * of the form: * <p> * <pre> * <b>A</b> + k*<b>PI</b> * </pre> * <p> * where k is any integer. * <p> * <i><b>Domain Restrictions:</b><ul> atan(z) is undefined for z = + <b>i</b> or z = - <b>i</b> * </ul></i> * <p> * @return Principal <tt>Complex</tt> arc tangent * <p> * @see Complex#tan() * @see Complex#tanh() **/ public Complex atan () { Complex result; // atan(z) = -i/2 * log( (i-z)/(i+z) ) double _re1, _im1; // result: i.sub(z) ... result = cart(- re, 1.0 - im); // _1: i.add(z) ... _re1 = + re; _im1 = 1.0 + im; // result: result.div(_1) ... div(result, _re1, _im1); // _1: result.log() ... _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: half_i.neg().mul(_2) ... result.re = 0.5*_im1; result.im = -0.5*_re1; return result; }//end atan() /** * Returns the <i>principal</i> inverse hyperbolic sine of a * <tt>Complex</tt> number. * * <p> * <pre> * asinh(z) = log(z + sqrt(z*z + 1)) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>asinh(z)</i>, the others are * of the form: * <p> * <pre> * k*<b>PI</b>*<b><i>i</i></b> + (-1)<sup><font size=-1>k</font></sup> * <b>A</b> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> inverse hyperbolic sine * <p> * @see Complex#sinh() **/ /* * Many thanks to the mathematicians of aus.mathematics and sci.math, and * to Zdislav V. Kovarik of the Department of Mathematics and Statistics, * McMaster University and John McGowan <[email protected]> in particular, * for their advice on the current naming conventions for "area/argumentus * sinus hyperbolicus". */ public Complex asinh () { Complex result; // asinh(z) = log(z + sqrt(z*z + 1)) double _re1, _im1; // _1: z.mul(z).add(one) ... _re1 = ( (re*re) - (im*im) ) + 1.0; _im1 = ( (re*im) + (im*re) ) + 0.0; // result: _1.sqrt() ... result = cart(_re1, _im1); sqrt(result); // result: z.add(result) ... result.re = re + result.re; // ! result.im = im + result.im; // ! // _1: result.log() ... _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: _1 ... result.re = _re1; result.im = _im1; return result; }//end asinh() /** * Returns the <i>principal</i> inverse hyperbolic cosine of a * <tt>Complex</tt> number. * * <p> * <pre> * acosh(z) = log(z + sqrt(z*z - 1)) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>acosh(z)</i>, the others are * of the form: * <p> * <pre> * 2*k*<b>PI</b>*<b><i>i</i></b> +/- <b>A</b> * </pre> * <p> * where k is any integer. * <p> * @return Principal <tt>Complex</tt> inverse hyperbolic cosine * <p> * @see Complex#cosh() **/ public Complex acosh () { Complex result; // acosh(z) = log(z + sqrt(z*z - 1)) double _re1, _im1; // _1: z.mul(z).sub(one) ... _re1 = ( (re*re) - (im*im) ) - 1.0; _im1 = ( (re*im) + (im*re) ) - 0.0; // result: _1.sqrt() ... result = cart(_re1, _im1); sqrt(result); // result: z.add(result) ... result.re = re + result.re; // ! result.im = im + result.im; // ! // _1: result.log() ... _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: _1 ... result.re = _re1; result.im = _im1; return result; }//end acosh() /** * Returns the <i>principal</i> inverse hyperbolic tangent of a * <tt>Complex</tt> number. * * <p> * <pre> * atanh(z) = 1/2 * log( (1+z)/(1-z) ) * </pre> * <p> * There are infinitely many solutions, besides the principal solution. * If <b>A</b> is the principal solution of <i>atanh(z)</i>, the others are * of the form: * <p> * <pre> * <b>A</b> + k*<b>PI</b>*<b><i>i</i></b> * </pre> * <p> * where k is any integer. * <p> * <i><b>Domain Restrictions:</b><ul> atanh(z) is undefined for z = + 1 or z = - 1 * </ul></i> * <p> * @return Principal <tt>Complex</tt> inverse hyperbolic tangent * <p> * @see Complex#tanh() **/ public Complex atanh () { Complex result; // atanh(z) = 1/2 * log( (1+z)/(1-z) ) double _re1, _im1; // result: one.add(z) ... result = cart(1.0 + re, + im); // _1: one.sub(z) ... _re1 = 1.0 - re; _im1 = - im; // result: result.div(_1) ... div(result, _re1, _im1); // _1: result.log() ... _re1 = Math.log(result.abs()); _im1 = result.arg(); // result: _1.scale(0.5) ... result.re = 0.5 * _re1; result.im = 0.5 * _im1; return result; }//end atanh() /** * Converts a <tt>Complex</tt> into a <tt>String</tt> of the form * <tt>(</tt><i>a</i><tt> + </tt><i>b</i><tt>i)</tt>. * * <p> * This enables the <tt>Complex</tt> to be easily printed. For example, if * <tt>z</tt> was <i>2 - 5<b>i</b></i>, then * <pre> * System.out.println("z = " + z); * </pre> * would print * <pre> * z = (2 - 5i) * </pre> * <!-- * <i><b>Note:</b><ul>Concatenating <tt>String</tt>s, using a system * overloaded meaning of the "<tt>+</tt>" operator, in fact causes the * <tt>toString()</tt> method to be invoked on the object <tt>z</tt> at * runtime.</ul></i> * --> * <p> * @return <tt>String</tt> containing the cartesian coordinate representation * <p> * @see Complex#cart(double, double) **/ public String toString () { if (im < 0.0) { // ...remembering NaN & Infinity return ("(" + re + " - " + (-im) + "i)"); } else if (1.0/im == Double.NEGATIVE_INFINITY) { return ("(" + re + " - " + 0.0 + "i)"); } else { return ("(" + re + " + " + (+im) + "i)"); }//endif }//end toString() /* I know a young man called Daniel, When you meet him, you'll like him, and you'll Find him so true, so human and new, You'll want to live life with no manual. */ }//end Complex /* Jim Shapiro <[email protected]> Priyantha Jayanetti --------------------------- email: [email protected] Dept. of Electrical & Computer Engineering University of Maine, Orono Mr. Daniel Hirsch <[email protected]> /* Correct my address in any reply, or it'll be treated as spam: -- // Alexander Anderson <[email protected]> // Home Fone +44 (0) 171-794-4543 // London, UK http://www.almide.demon.co.uk/ // PGP print C6 8C 55 F2 77 7B 99 9B 14 77 66 F5 B8 74 CF 12 */
20308af4028f438261a503cf2b46b4d6e9ef0049
908e6a9b29193e6c3dd0ba07efd6e56c6684eaca
/src/main/java/com/poojalakhani27/rockpaperscissors/RockPaperScissorsApplication.java
2c258c1b6b9165fe43f3943e26401ab89b82beec
[]
no_license
poojalakhani27/rockpaperscissors
c657421fe44400d49686d5bfda022ab5d9c33a2b
b93f90df416908ab1cec03ee0e99e050a0ee7e5e
refs/heads/master
2021-07-21T13:22:21.870023
2017-10-31T14:15:47
2017-10-31T14:15:47
109,002,764
0
2
null
null
null
null
UTF-8
Java
false
false
362
java
package com.poojalakhani27.rockpaperscissors; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class RockPaperScissorsApplication { public static void main(String[] args) { SpringApplication.run(RockPaperScissorsApplication.class, args); } }
592808e62a39c8dc8be2e66d6cc14788c27e9f30
a5b866f5708d857347a50d6f106754c040d1acf4
/Data Types and Variables - Exercise/src/SpiceMustFlow.java
0eb0492798226b562a5bd6337a6f6045705cf6a9
[]
no_license
StanchevaYoana/Java-Fundamentals
3c8434cdab20a009737e0d25be2d45bc0d772e37
99a883c313864f52ae39026a508925f4924325d4
refs/heads/master
2020-06-21T20:00:54.710482
2019-08-05T13:50:29
2019-08-05T13:50:29
197,541,288
3
0
null
null
null
null
UTF-8
Java
false
false
692
java
import java.util.Scanner; public class SpiceMustFlow { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long starting = Long.parseLong(scanner.nextLine()); long days = 0; long yielded = 0; if (starting < 100) { System.out.println(days); System.out.println(yielded); } else { while (starting >= 100) { days++; yielded += starting; starting -= 10; yielded -= 26; } yielded -= 26; System.out.println(days); System.out.println(yielded); } } }
41322aefc6290790b3ab7041001440209a14056e
71d1c67e88137580ea71914f49b256aadfaa3b40
/scgateway_security/auth/src/main/java/com/zhao/cloud/gateway/auth/extend/filter/PhoneLoginAuthenticationFilter.java
a6bf1affee03f2dd6018ba95b94462927036c898
[]
no_license
wangyuanchen/springcloud-demo-security
ddec46b1e8b19727eb8581882b177a7c3e82f0ea
4ae93d86937cbd563f21a4781c3dc97ea8eb5de8
refs/heads/master
2022-07-05T06:11:36.970965
2020-02-12T08:08:36
2020-02-12T08:08:36
239,957,605
0
0
null
2022-06-21T02:47:11
2020-02-12T08:05:53
Java
UTF-8
Java
false
false
2,498
java
package com.zhao.cloud.gateway.auth.extend.filter; import com.zhao.cloud.gateway.auth.extend.token.PhoneAuthenticationToken; import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.authentication.AuthenticationServiceException; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * 手机验证码登陆过滤器 * * @author zhaoliang */ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter { private static final String SPRING_SECURITY_RESTFUL_PHONE_KEY = "phone"; private static final String SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY = "verifyCode"; private static final String SPRING_SECURITY_RESTFUL_LOGIN_URL = "/phoneLogin"; private static final String SPRING_POST_METHOD = "POST"; public PhoneLoginAuthenticationFilter() { super(new AntPathRequestMatcher(SPRING_SECURITY_RESTFUL_LOGIN_URL, SPRING_POST_METHOD)); } @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!request.getMethod().equals(SPRING_POST_METHOD)) { throw new AuthenticationServiceException( "Authentication method not supported: " + request.getMethod()); } // 手机验证码登陆 String principal = obtainParameter(request, SPRING_SECURITY_RESTFUL_PHONE_KEY); String credentials = obtainParameter(request, SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY); AbstractAuthenticationToken authRequest = new PhoneAuthenticationToken(principal, credentials); // 记录其他请求信息 setDetails(request, authRequest); return this.getAuthenticationManager().authenticate(authRequest); } private void setDetails(HttpServletRequest request, AbstractAuthenticationToken authRequest) { authRequest.setDetails(authenticationDetailsSource.buildDetails(request)); } private String obtainParameter(HttpServletRequest request, String parameter) { return request.getParameter(parameter); } }
eaf2c20a34730f6467c1147cba57ea4119f3b040
5920947574c1cf4f85404ae0b1ccce61422139d5
/src/main/java/com/example/rest312/model/Role.java
94d88eb0216403f7d16d46d923a09beb304bf371
[]
no_license
PlatonOff7187/3.1.3
31f6f4e3a7bcbbe90fb88385eaefe397e9356c45
927d0ffdf03bc121bd230e5a971998f4e8c17668
refs/heads/master
2023-07-16T18:05:33.725867
2021-09-08T21:08:46
2021-09-08T21:08:46
402,215,855
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package com.example.rest312.model; import lombok.Data; import org.springframework.security.core.GrantedAuthority; import javax.persistence.*; import java.util.Set; @Data @Entity @Table(name = "roles") public class Role implements GrantedAuthority { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column private String name; @Transient @ManyToMany(mappedBy = "roles") private Set<User> users; public Role() { } public Role(int id, String name, Set<User> users) { this.id = id; this.name = name; this.users = users; } public Role (String name) { this.name = name; } @Override public String getAuthority() { return name; } @Override public String toString() { return name.substring(5); } }
58b11d3033d8b971b33f1935a802446f5564f0f2
cd8843d24154202f92eaf7d6986d05a7266dea05
/saaf-base-5.0/2000_saaf-tta-model/src/main/java/com/sie/watsons/base/questionnaire/model/inter/server/TtaQuestionNewMapDetailServer.java
d82abb94e482604541c89c37d390ad073b62cd18
[]
no_license
lingxiaoti/tta_system
fbc46c7efc4d408b08b0ebb58b55d2ad1450438f
b475293644bfabba9aeecfc5bd6353a87e8663eb
refs/heads/master
2023-03-02T04:24:42.081665
2021-02-07T06:48:02
2021-02-07T06:48:02
336,717,227
0
0
null
null
null
null
UTF-8
Java
false
false
5,632
java
package com.sie.watsons.base.questionnaire.model.inter.server; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.sie.saaf.common.model.dao.BaseCommonDAO_HI; import com.sie.saaf.common.model.inter.server.BaseCommonServer; import com.sie.saaf.common.util.BigDecimalUtils; import com.sie.saaf.common.util.SaafToolUtils; import com.sie.watsons.base.questionnaire.model.dao.readonly.TtaQuestionNewMapDetailDAO_HI_RO; import com.sie.watsons.base.questionnaire.model.entities.TtaQuestionNewMapDetailEntityModel; import com.sie.watsons.base.questionnaire.model.entities.TtaQuestionNewMapDetailEntity_HI; import com.sie.watsons.base.questionnaire.model.entities.readonly.TtaQuestionNewMapDetailEntity_HI_RO; import com.sie.watsons.base.questionnaire.model.inter.ITtaQuestionNewMapDetail; import com.sie.watsons.base.report.utils.EasyExcelUtil; import com.yhg.base.utils.StringUtils; import com.yhg.hibernate.core.paging.Pagination; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.Assert; import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; import java.util.List; import java.util.Map; @Component("ttaQuestionNewMapDetailServer") public class TtaQuestionNewMapDetailServer extends BaseCommonServer<TtaQuestionNewMapDetailEntity_HI> implements ITtaQuestionNewMapDetail{ private static final Logger LOGGER = LoggerFactory.getLogger(TtaQuestionNewMapDetailServer.class); @Autowired private BaseCommonDAO_HI<TtaQuestionNewMapDetailEntity_HI> ttaQuestionNewMapDetailDAO_HI; @Autowired private TtaQuestionNewMapDetailDAO_HI_RO ttaQuestionNewMapDetailDAO_HI_RO; public TtaQuestionNewMapDetailServer() { super(); } @Override public void saveOrUpadateBatchDetail(JSONObject jsonParams) { if (jsonParams != null && jsonParams.getJSONArray("lineArr") != null) { JSONArray lineArr = jsonParams.getJSONArray("lineArr"); List<TtaQuestionNewMapDetailEntity_HI> list = JSON.parseArray(lineArr.toJSONString(), TtaQuestionNewMapDetailEntity_HI.class); Integer varUserId = jsonParams.getInteger("varUserId"); for (TtaQuestionNewMapDetailEntity_HI entity : list) { entity.setLastUpdatedBy(varUserId); entity.setCreatedBy(varUserId); entity.setOperatorUserId(varUserId); } ttaQuestionNewMapDetailDAO_HI.saveOrUpdateAll(list); } } @Override public Pagination<TtaQuestionNewMapDetailEntity_HI_RO> queryQuestionNewMapDetailList(JSONObject queryParamJSON, Integer pageIndex, Integer pageRows) { Map<String, Object> paramsMap = new HashMap<String, Object>(); StringBuffer sbSql = new StringBuffer(); sbSql.append(TtaQuestionNewMapDetailEntity_HI_RO.querySlq); SaafToolUtils.parperParam(queryParamJSON, "t.proposal_id", "proposalId", sbSql, paramsMap, "="); SaafToolUtils.changeQuerySort(queryParamJSON, sbSql, " map_detail_id asc", false); return ttaQuestionNewMapDetailDAO_HI_RO.findPagination(sbSql.toString(),SaafToolUtils.getSqlCountString(sbSql), paramsMap, pageIndex, pageRows); } @Override public void saveImportNewProductList(JSONObject jsonObject, MultipartFile file) throws Exception { String proposalId = jsonObject.getString("proposalId"); String saleType = jsonObject.getString("saleType"); Map<String,Object> result = EasyExcelUtil.readExcel(file, TtaQuestionNewMapDetailEntityModel.class,0); List<Map<String, Object>> datas = (List<Map<String, Object>>)result.get("datas"); if (datas != null) { datas.forEach(item->{ item.put("OPERATOR_USER_ID", jsonObject.get("varUserId")); item.put("PROPOSAL_ID", proposalId); String cost = item.get("COST") + ""; String retailPrice = item.get("RETAIL_PRICE") + ""; String promoPrice = item.get("PROMO_PRICE") + ""; if (StringUtils.isBlank(cost) || "null".equalsIgnoreCase(cost)) { Assert.isTrue(false, "上传新品附件有cost为空的值,请检查"); } if (StringUtils.isBlank(retailPrice) || "null".equalsIgnoreCase(retailPrice)) { Assert.isTrue(false, "上传新品附件有retailPrice为空的值,请检查"); } if (StringUtils.isBlank(promoPrice) || "null".equalsIgnoreCase(promoPrice)) { Assert.isTrue(false, "上传新品附件有promoPrice为空的值,请检查"); } Double normalGp = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(Double.parseDouble(cost), Double.parseDouble(retailPrice))) * 100, 2); item.put("NORMAL_GP", normalGp); if ("B01".equalsIgnoreCase(saleType)) { if (StringUtils.isNotEmpty(cost) && StringUtils.isNotEmpty(promoPrice)) { Double promoGp = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(Double.parseDouble(cost), Double.parseDouble(promoPrice))) * 100, 2); item.put("PROMO_GP", promoGp); } } else { item.put("PROMO_GP", item.get("NORMAL_GP")); } }); } List<TtaQuestionNewMapDetailEntity_HI> newMapDetailList = JSON.parseArray(SaafToolUtils.toJson(datas), TtaQuestionNewMapDetailEntity_HI.class); ttaQuestionNewMapDetailDAO_HI.saveOrUpdateAll(newMapDetailList); //ttaQuestionNewMapDetailDAO_HI.saveSeqBatchJDBC("TTA_QUESTION_NEW_MAP_DETAIL",datas,"MAP_DETAIL_ID","SEQ_TTA_QUESTION_NEW_MAP_DETAIL.NEXTVAL"); System.out.println(datas); } public static void main(String[] args) { Double subtract = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(1.0, 3.0)) * 100,2); System.out.println(subtract); } }
99728940b14750e5d436784afe3b4103d63ae8b9
2fda0a2f1f5f5d4e7d72ff15a73a4d3e1e93abeb
/proFL-plugin-2.0.3/org/apache/maven/scm/provider/accurev/command/changelog/AccuRevChangeLogCommand.java
26cd528dafb863fc88bbddf47326ea77804077cf
[ "MIT" ]
permissive
ycj123/Research-Project
d1a939d99d62dc4b02d9a8b7ecbf66210cceb345
08296e0075ba0c13204944b1bc1a96a7b8d2f023
refs/heads/main
2023-05-29T11:02:41.099975
2021-06-08T13:33:26
2021-06-08T13:33:26
374,899,147
0
0
null
null
null
null
UTF-8
Java
false
false
12,752
java
// // Decompiled by Procyon v0.5.36 // package org.apache.maven.scm.provider.accurev.command.changelog; import org.apache.maven.scm.provider.ScmProviderRepository; import java.util.Iterator; import java.util.Map; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import java.util.Collection; import java.util.ArrayList; import java.util.HashMap; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.accurev.Stream; import org.apache.maven.scm.provider.accurev.AccuRev; import org.apache.maven.scm.provider.accurev.FileDifference; import java.util.List; import org.apache.maven.scm.provider.accurev.Transaction; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.provider.accurev.AccuRevCapability; import java.util.Collections; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmException; import java.util.Date; import org.apache.maven.scm.provider.accurev.AccuRevException; import org.apache.maven.scm.provider.accurev.AccuRevVersion; import org.codehaus.plexus.util.StringUtils; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommand; public class AccuRevChangeLogCommand extends AbstractAccuRevCommand { public AccuRevChangeLogCommand(final ScmLogger logger) { super(logger); } @Override protected ScmResult executeAccurevCommand(final AccuRevScmProviderRepository repository, final ScmFileSet fileSet, final CommandParameters parameters) throws ScmException, AccuRevException { final ScmBranch branch = (ScmBranch)parameters.getScmVersion(CommandParameter.BRANCH, null); final AccuRevVersion branchVersion = repository.getAccuRevVersion(branch); String stream = branchVersion.getBasisStream(); String fromSpec = branchVersion.getTimeSpec(); String toSpec = "highest"; ScmVersion startVersion = parameters.getScmVersion(CommandParameter.START_SCM_VERSION, null); ScmVersion endVersion = parameters.getScmVersion(CommandParameter.END_SCM_VERSION, null); if (startVersion != null && StringUtils.isNotEmpty(startVersion.getName())) { final AccuRevVersion fromVersion = repository.getAccuRevVersion(startVersion); final AccuRevVersion toVersion = (endVersion == null) ? new AccuRevVersion(fromVersion.getBasisStream(), "now") : repository.getAccuRevVersion(endVersion); if (!StringUtils.equals(fromVersion.getBasisStream(), toVersion.getBasisStream())) { throw new AccuRevException("Not able to provide change log between different streams " + fromVersion + "," + toVersion); } stream = fromVersion.getBasisStream(); fromSpec = fromVersion.getTimeSpec(); toSpec = toVersion.getTimeSpec(); } Date startDate = parameters.getDate(CommandParameter.START_DATE, null); Date endDate = parameters.getDate(CommandParameter.END_DATE, null); final int numDays = parameters.getInt(CommandParameter.NUM_DAYS, 0); if (numDays > 0) { if (startDate != null || endDate != null) { throw new ScmException("Start or end date cannot be set if num days is set."); } final int day = 86400000; startDate = new Date(System.currentTimeMillis() - numDays * (long)day); endDate = new Date(System.currentTimeMillis() + day); } if (endDate != null && startDate == null) { throw new ScmException("The end date is set but the start date isn't."); } if (startDate != null) { fromSpec = AccuRevScmProviderRepository.formatTimeSpec(startDate); } else if (fromSpec == null) { fromSpec = "1"; } final Transaction fromTransaction = this.getDepotTransaction(repository, stream, fromSpec); long fromTranId = 1L; if (fromTransaction != null) { fromTranId = fromTransaction.getTranId(); if (startDate == null) { startDate = fromTransaction.getWhen(); } } if (endDate != null) { toSpec = AccuRevScmProviderRepository.formatTimeSpec(endDate); } else if (toSpec == null) { toSpec = "highest"; } final Transaction toTransaction = this.getDepotTransaction(repository, stream, toSpec); long toTranId = 1L; if (toTransaction != null) { toTranId = toTransaction.getTranId(); if (endDate == null) { endDate = toTransaction.getWhen(); } } startVersion = new ScmRevision(repository.getRevision(stream, fromTranId)); endVersion = new ScmRevision(repository.getRevision(stream, toTranId)); List<Transaction> streamHistory = Collections.emptyList(); List<Transaction> workspaceHistory = Collections.emptyList(); List<FileDifference> streamDifferences = Collections.emptyList(); final StringBuilder errorMessage = new StringBuilder(); final AccuRev accurev = repository.getAccuRev(); final Stream changelogStream = accurev.showStream(stream); if (changelogStream == null) { errorMessage.append("Unknown accurev stream -").append(stream).append("."); } else { final String message = "Changelog on stream " + stream + "(" + changelogStream.getStreamType() + ") from " + fromTranId + " (" + startDate + "), to " + toTranId + " (" + endDate + ")"; if ((startDate != null && startDate.after(endDate)) || fromTranId >= toTranId) { this.getLogger().warn("Skipping out of range " + message); } else { this.getLogger().info(message); Stream diffStream = changelogStream; if (changelogStream.isWorkspace()) { workspaceHistory = accurev.history(stream, Long.toString(fromTranId + 1L), Long.toString(toTranId), 0, false, false); if (workspaceHistory == null) { errorMessage.append("history on workspace " + stream + " from " + fromTranId + 1 + " to " + toTranId + " failed."); } stream = changelogStream.getBasis(); diffStream = accurev.showStream(stream); } if (AccuRevCapability.DIFF_BETWEEN_STREAMS.isSupported(accurev.getClientVersion())) { if (startDate.before(diffStream.getStartDate())) { this.getLogger().warn("Skipping diff of " + stream + " due to start date out of range"); } else { streamDifferences = accurev.diff(stream, Long.toString(fromTranId), Long.toString(toTranId)); if (streamDifferences == null) { errorMessage.append("Diff " + stream + "- " + fromTranId + " to " + toTranId + "failed."); } } } streamHistory = accurev.history(stream, Long.toString(fromTranId + 1L), Long.toString(toTranId), 0, false, false); if (streamHistory == null) { errorMessage.append("history on stream " + stream + " from " + fromTranId + 1 + " to " + toTranId + " failed."); } } } final String errorString = errorMessage.toString(); if (StringUtils.isBlank(errorString)) { final ChangeLogSet changeLog = this.getChangeLog(changelogStream, streamDifferences, streamHistory, workspaceHistory, startDate, endDate); changeLog.setEndVersion(endVersion); changeLog.setStartVersion(startVersion); return new ChangeLogScmResult(accurev.getCommandLines(), changeLog); } return new ChangeLogScmResult(accurev.getCommandLines(), "AccuRev errors: " + (Object)errorMessage, accurev.getErrorOutput(), false); } private Transaction getDepotTransaction(final AccuRevScmProviderRepository repo, final String stream, final String tranSpec) throws AccuRevException { return repo.getDepotTransaction(stream, tranSpec); } private ChangeLogSet getChangeLog(final Stream stream, final List<FileDifference> streamDifferences, final List<Transaction> streamHistory, final List<Transaction> workspaceHistory, final Date startDate, final Date endDate) { final Map<Long, FileDifference> differencesMap = new HashMap<Long, FileDifference>(); for (final FileDifference fileDifference : streamDifferences) { differencesMap.put(fileDifference.getElementId(), fileDifference); } final List<Transaction> mergedHistory = new ArrayList<Transaction>(streamHistory); String streamPrefix = "/"; mergedHistory.addAll(workspaceHistory); streamPrefix = stream.getId() + "/"; final List<ChangeSet> entries = new ArrayList<ChangeSet>(streamHistory.size()); for (final Transaction t : mergedHistory) { if (startDate == null || !t.getWhen().before(startDate)) { if (endDate != null && t.getWhen().after(endDate)) { continue; } if ("mkstream".equals(t.getTranType())) { continue; } final Collection<Transaction.Version> versions = t.getVersions(); final List<ChangeFile> files = new ArrayList<ChangeFile>(versions.size()); for (final Transaction.Version v : versions) { final FileDifference difference = differencesMap.get(v.getElementId()); if (difference != null) { final String newVersionSpec = difference.getNewVersionSpec(); if (newVersionSpec != null && newVersionSpec.equals(v.getRealSpec())) { if (this.getLogger().isDebugEnabled()) { this.getLogger().debug("Removing difference for " + v); } differencesMap.remove(v.getElementId()); } } if (v.getRealSpec().startsWith(streamPrefix) && !v.getVirtualSpec().startsWith(streamPrefix)) { if (!this.getLogger().isDebugEnabled()) { continue; } this.getLogger().debug("Skipping workspace to basis stream promote " + v); } else { final ChangeFile f = new ChangeFile(v.getElementName(), v.getVirtualSpec() + " (" + v.getRealSpec() + ")"); files.add(f); } } if (versions.isEmpty() || !files.isEmpty()) { final ChangeSet changeSet = new ChangeSet(t.getWhen(), t.getComment(), t.getAuthor(), files); entries.add(changeSet); } else { if (!this.getLogger().isDebugEnabled()) { continue; } this.getLogger().debug("All versions removed for " + t); } } } if (!differencesMap.isEmpty()) { final List<ChangeFile> upstreamFiles = new ArrayList<ChangeFile>(); for (final FileDifference difference2 : differencesMap.values()) { if (difference2.getNewVersionSpec() != null) { upstreamFiles.add(new ChangeFile(difference2.getNewFile().getPath(), difference2.getNewVersionSpec())); } else { upstreamFiles.add(new ChangeFile(difference2.getOldFile().getPath(), null)); } } entries.add(new ChangeSet(endDate, "Upstream changes", "various", upstreamFiles)); } return new ChangeLogSet(entries, startDate, endDate); } public ChangeLogScmResult changelog(final ScmProviderRepository repo, final ScmFileSet testFileSet, final CommandParameters params) throws ScmException { return (ChangeLogScmResult)this.execute(repo, testFileSet, params); } }
dfdafa862c5d3635a23eb9bbd491595d8b684962
a916084cde72388adac81877672a38c188cef341
/lib/JsonPath-master/src/test/java/com/nebhale/jsonpath/internal/component/RootPathComponentTest.java
37e0e87781004aa21de04571d36abce0388b67b4
[ "Apache-2.0" ]
permissive
haggarwal90/java_jsonparser_example
40276531ce473efdd65b6a57d0cc132b1fedc4ab
5dbb0581035d3fdb27d63f8a060aafcb0b092a58
refs/heads/master
2021-01-19T00:28:58.618518
2016-07-16T14:06:02
2016-07-16T14:06:02
63,485,599
1
0
null
null
null
null
UTF-8
Java
false
false
1,208
java
/* * Copyright 2013 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 com.nebhale.jsonpath.internal.component; import static com.nebhale.jsonpath.testutils.JsonUtils.NODE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import org.junit.Test; public final class RootPathComponentTest { private final RootPathComponent pathComponent = new RootPathComponent(null); @Test public void select() { assertSame(NODE, this.pathComponent.select(NODE)); } @Test public void testToString() { assertEquals("RootPathComponent []", new RootPathComponent(null).toString()); } }
0c1d7406d084e35838c2b7de18cfae845b7a1929
704c470106fc0653ea5ccd82c15067fd9f7fa866
/InventoryItem.java
9e1ab50132e097b562cc5e58a0489a32104d55d0
[]
no_license
FARANDISUTANTO/FARANDIJAVA
067899ec6ce35721d0942d6ee0e9ce171b391e9c
311d2db1a2cb9bcae8ad0bf18756276110b6520f
refs/heads/master
2020-06-04T07:36:12.052098
2019-07-17T13:08:30
2019-07-17T13:08:30
191,927,384
0
0
null
null
null
null
UTF-8
Java
false
false
1,067
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Asus */ package uasoop; public class InventoryItem { private Item item; private int qty; // default qty = 0 public InventoryItem(Item item) { this.item = item; this.qty = 0; } // default qty = qty public InventoryItem(Item item, int qty) { this.item = item; this.qty = qty; } // kembalikan item public Item getItem() { return this.item; } // kembalikan jumlah qty public int getQty() { return this.qty; } // ubah qty menjadi sebanyak qty // jika qty < 0 throw IllegalArgumentException public int setQty(int qty) { if (qty < 0) throw new IllegalArgumentException(); this.qty = qty; return qty; } public String toString() { return String.format("<InventoryItem:%s:%d>", item.toString(), qty); } }
f83b032bfd499b152121e000e89f29d8194e6bbd
d36d5ba4d8d1df1ad4494c94bd39252e128c5b5b
/com.jaspersoft.studio.book/src/com/jaspersoft/studio/book/messages/MessagesByKeys.java
931184801b78d1ab8595b788817f78e994fb4918
[]
no_license
xviakoh/jaspersoft-xvia-plugin
6dfca36eb27612f136edc4c206e631d8dd8470f0
c037a0568a518e858a201fda257a8fa416af3908
refs/heads/master
2021-01-01T19:35:32.905460
2015-06-18T15:21:11
2015-06-18T15:21:11
37,666,261
0
0
null
null
null
null
UTF-8
Java
false
false
1,290
java
/******************************************************************************* * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved. * http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * 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 ******************************************************************************/ package com.jaspersoft.studio.book.messages; import java.util.MissingResourceException; import java.util.ResourceBundle; public class MessagesByKeys { private static final String MESSAGES_BY_KEYS = "com.jaspersoft.studio.book.messages.messagesbykeys"; private static final ResourceBundle RB_MESSAGES_BY_KEYS = ResourceBundle.getBundle(MESSAGES_BY_KEYS); private MessagesByKeys(){ } public static String getString(String key) { try { return RB_MESSAGES_BY_KEYS.getString(key.toLowerCase()); } catch (MissingResourceException e) { return key; } } public static boolean hasTranslation(String key) { return RB_MESSAGES_BY_KEYS.containsKey(key); } }
d73379b88760fdde1ac45972557b73e7d9f19a55
050da0f7feb7f54dc8674cf753c09dccd15505a6
/src/main/java/com/zhuayinline/pets/crawler/service/impl/GoodmaoningService.java
8e4c28b031f852aa582759e6f4d35d45d8a8b5c5
[]
no_license
devinzhang0209/pets_crawler
33417ec3d214b554d1be946a2f191a7b25108644
07438b4729783f3658e3ccc3f236e581eb68b21e
refs/heads/master
2023-02-25T06:47:39.572306
2021-02-03T13:19:42
2021-02-03T13:19:42
319,624,309
0
0
null
null
null
null
UTF-8
Java
false
false
8,835
java
package com.zhuayinline.pets.crawler.service.impl; import com.zhuayinline.pets.crawler.dao.PetsProductMapper; import com.zhuayinline.pets.crawler.entity.PetsProduct; import com.zhuayinline.pets.crawler.service.AbstractPetsCall; import com.zhuayinline.pets.crawler.util.SearchUtil; import com.zhuayinline.pets.crawler.util.StringUtil; import com.zhuayinline.pets.crawler.vo.Category; import com.zhuayinline.pets.crawler.vo.Website; import org.apache.commons.collections.CollectionUtils; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author Devin Zhang * @className GoodmaoningService * @description TODO * @date 2021-1-23 15:32:20 */ @Service public class GoodmaoningService extends AbstractPetsCall { @Autowired private SearchUtil searchUtil; @Autowired private PetsProductMapper petsProductMapper; @Override public String getSource() { return Website.CWSC.getWebsiteName(); } @Override public String getCategoryBaseUrl() { return Website.CWSC.getBaseCategoryUrl(); } @Override public List<Category> getAllCategory() throws Exception { List<Category> categories = new LinkedList<>(); Document document = searchUtil.getDocument(getCategoryBaseUrl()); Elements rootCategoryElement = document.getElementsByClass("categorys-item"); for (int index = 0; index < rootCategoryElement.size(); index++) { Element categoryDoc = rootCategoryElement.get(index); String category1 = categoryDoc.getElementsByClass("categorys-title").get(0).select("strong").text(); String category2 = StringUtil.EMPTY; String category3; String categoryLink; Elements secondCategoryDoc = categoryDoc.getElementsByClass("dl_fore1"); if (CollectionUtils.isNotEmpty(secondCategoryDoc)) { for (Element element : secondCategoryDoc) { Elements children = element.children(); for (Element childDoc : children) { if (childDoc.tagName().equalsIgnoreCase("dt")) { category2 = childDoc.text(); } else if (childDoc.tagName().equalsIgnoreCase("dd")) { Elements thirdCategoryDoc = childDoc.children(); for (Element a : thirdCategoryDoc) { category3 = a.text(); categoryLink = a.attr("href"); if (StringUtil.isNotEmpty(categoryLink)) { categoryLink = Website.CWSC.getWebsiteUrl() + categoryLink; Category category = buildCategory(category1, category2, category3, categoryLink); categories.add(category); } } } } } } } return categories; } @Override public Object[] getCategoryProductCount(String categoryProductUrl) throws Exception { Object[] objs = new Object[2]; Integer page = 1; Document document = searchUtil.getDocument(categoryProductUrl); try { Elements pageDoc = document.getElementsByClass("pg"); if (CollectionUtils.isNotEmpty(pageDoc)) { Elements pageNoDoc = pageDoc.get(0).select("span[title^='共']"); if (CollectionUtils.isNotEmpty(pageNoDoc)) { String totalPage = pageNoDoc.text(). replaceAll("/", "") .replaceAll("页", "") .trim(); page = Integer.parseInt(totalPage); } } } catch (Exception e) { e.printStackTrace(); } objs[0] = page; return objs; } @Override public List<PetsProduct> getProducts(Category category, String categoryProductUrl) throws Exception { List<PetsProduct> products = new LinkedList<>(); Document document = searchUtil.getDocument(categoryProductUrl); Elements productList = document.getElementsByClass("thumb"); if (CollectionUtils.isNotEmpty(productList)) { for (Element element : productList) { PetsProduct product = null; try { String productLink = Website.CWSC.getWebsiteUrl() + element.select("a").attr("href"); String imageLink = element.select("a img").attr("src"); String productName = element.select("a img").attr("alt"); String productId = productLink.replaceAll(Website.CWSC.getWebsiteUrl(), "") .replaceAll(".html", ""); String brand = StringUtil.EMPTY; if (element.parent() != null && CollectionUtils.isNotEmpty(element.parent().getElementsByClass("lj_qq"))) { brand = element.parent().getElementsByClass("lj_qq").text(); brand = brand.replaceAll("\\.", "") .replaceAll(":", "") .replaceAll("旗舰店", "") .replaceAll(" ", "") .trim(); } if (StringUtil.isNotEmpty(productLink)) { Document productDocument = searchUtil.getDocument(productLink); if (productDocument == null) { continue; } String productPrice; String priceSource = productDocument.getElementById("sku_price").text().replaceAll("¥", "").trim(); if (priceSource.contains("~")) { productPrice = priceSource.split("~")[0]; } else { productPrice = priceSource; } String productSpecs = StringUtil.EMPTY; Elements goodsSku = productDocument.getElementsByClass("goods_sku f_v tb-selected"); if (CollectionUtils.isNotEmpty(goodsSku)) { try { productSpecs = goodsSku.text(); } catch (Exception e) { } } //从产品名称中取产品规格 String finder = StringUtil.EMPTY; String units = "kg|KG|g|千克|克|磅|G|cm|CM|w|W|ml|包"; String patternStr = "(\\d*\\.)?[0-9]+(" + units + ")"; Pattern pattern = Pattern.compile(patternStr); Matcher matcher = pattern.matcher(productName); if (matcher.find()) { finder = matcher.group(); } if (StringUtil.isEmpty(productSpecs) || StringUtil.isNotEmpty(finder) || productSpecs.trim().equalsIgnoreCase("w")) { productSpecs = finder; } String productUnit = productSpecs; product = buildProduct(productId, category, productName, brand, productUnit, imageLink, productLink, productPrice, productSpecs); } } catch (Exception e) { e.printStackTrace(); } if (null != product) { products.add(product); } } } return products; } @Override public String search() { try { return super.search(petsProductMapper); } catch (Exception e) { e.printStackTrace(); } return StringUtil.EMPTY; } @Override public String getPageLink(int page, Category category, Map<String, String> otherParams) { String pageLink = category.getCategoryLink(); if (pageLink.endsWith(".html")) { pageLink = pageLink + "?page=" + page; } else { pageLink = pageLink + "&page=" + page; } System.out.println(String.format("pageLink:%s", pageLink)); return pageLink; } }
605f4b92d7d3c750e4a4befbf81a152e91dea983
6f79ce0eb931b6268623dcc8fb1a87b87c376e63
/GuessMe/src/com/tsguild/foundations/scanner/FortuneCookie.java
68ca2a9e247fdea5c625fb84726c38cb92f722e6
[]
no_license
asoneji03/badge1_milestone1_coursework
56a621e5abee4b6b23836f4c9c0f534312ca4823
6599bcde15be6f09624446073d58f01462b82553
refs/heads/master
2022-11-16T20:31:36.579143
2020-07-11T17:06:30
2020-07-11T17:06:30
251,488,696
0
0
null
null
null
null
UTF-8
Java
false
false
1,300
java
package com.tsguild.foundations.scanner; import java.util.Random; public class FortuneCookie { public static void main(String[] args) { Random randomizer = new Random(); int x =randomizer.nextInt(9); System.out.println("Your Greek Fortune: " + ""); if(x ==0){ System.out.println("Those aren't the droids you're looking for."); }else if(x == 1){ System.out.println("Never go in against a Sicilian when death is on the line!"); }else if(x == 2){ System.out.println("Goonies never say die"); }else if(x==3){ System.out.println("With great power there must also come - great responsibility."); }else if(x==4){ System.out.println("Never argue with the data."); }else if(x==5){ System.out.println("Try not. Do, or do not. There is no try."); }else if(x==6){ System.out.println("You are a leaf on the wind, watch how you soar."); }else if(x==7){ System.out.println("Do absolutely nothing, and it will be everything that you thought it could be."); }else if(x==8){ System.out.println("Kneel before Zod."); }else if(x==9){ System.out.println("Make it so."); } } }
[ "asoneji03@gmail" ]
asoneji03@gmail
eb3c54836ce0ada8a7325e6362ab603df4bdbe00
9da47857660e795bee3cb7c468f72eab93608ef7
/UniversityProtal/src/main/java/com/mycompany/universityprotal/repository/StudentaccountRepository.java
24ffc7ef9d303cd6ab4c5d44bd9dce9087f40cfd
[]
no_license
sharifulislamhridoy/University-Portal
7998471adfdc496580cc2d6db0d967dd86f312d2
69c6aa8c7a899079479a46c9fbca6b7cece39b7c
refs/heads/master
2022-12-23T01:39:50.797247
2020-10-03T21:38:20
2020-10-03T21:38:20
300,976,481
0
1
null
null
null
null
UTF-8
Java
false
false
3,041
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.universityprotal.repository; import com.mycompany.universityprotal.model.Studentaccount; import com.mycompany.universityprotal.service.I_StudentaccountService; import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; /** * * @author shari */ @Repository public class StudentaccountRepository implements I_StudentaccountService{ @Autowired SessionFactory sessionFactory; @Override public Studentaccount save(Studentaccount studentaccount) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); s.save(studentaccount); t.commit(); s.close(); return studentaccount; } @Override public List<Studentaccount> viewAll() { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); List<Studentaccount> categoryList = s.createQuery("from Studentaccount").list(); t.commit(); s.close(); return categoryList; } public List<Studentaccount> selectByCourseId(String id) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); List<Studentaccount> courses = s.createQuery("FROM Studentaccount WHERE studentsId='" + id + "'").list(); t.commit(); s.close(); return courses; } public List<Studentaccount> selectByCourseName(String name) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); List<Studentaccount> courses = s.createQuery("FROM Studentaccount WHERE coursesName='" + name + "'").list(); t.commit(); s.close(); return courses; } @Override public void update(Studentaccount studentaccount) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); s.update(studentaccount); t.commit(); s.close(); } @Override public void delete(Integer id) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); Studentaccount cm = (Studentaccount) s.get(Studentaccount.class, id); s.delete(cm); t.commit(); s.close(); } @Override public Studentaccount getById(Integer id) { Session s = sessionFactory.openSession(); Transaction t = s.getTransaction(); t.begin(); Studentaccount cm = (Studentaccount) s.get(Studentaccount.class, id); t.commit(); s.close(); return cm; } }
c457169e7758c9a1adb96aab4c7e0a717e52c802
fcf62ead7c86c4c6a0c7b25270e8f9b1331578dc
/base/src/main/kotlin/com/dcc/ibase/network/request/UploadRequest.java
d6cb3ca3576b426d8614ffeb413ecf3a37759cf6
[]
no_license
dccjll/ibase
e39f9c09630c9bc836772a551e0115ce74c5a3f7
4e8eef85fd26636dfceb2344aab690cd0f8572c3
refs/heads/master
2021-08-22T14:14:04.090901
2020-04-09T10:22:17
2020-04-09T10:22:17
159,888,745
0
0
null
null
null
null
UTF-8
Java
false
false
7,945
java
package com.dcc.ibase.network.request; import com.dcc.ibase.network.body.UploadProgressRequestBody; import com.dcc.ibase.network.callback.ACallback; import com.dcc.ibase.network.callback.UCallback; import com.dcc.ibase.network.core.ApiManager; import com.dcc.ibase.network.mode.CacheResult; import com.dcc.ibase.network.mode.MediaTypes; import com.dcc.ibase.network.subscriber.ApiCallbackSubscriber; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import io.reactivex.Observable; import io.reactivex.annotations.NonNull; import io.reactivex.observers.DisposableObserver; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.internal.Util; import okio.BufferedSink; import okio.Okio; import okio.Source; /** * @Description: 上传请求 * @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a> * @date: 17/5/14 20:28. */ public class UploadRequest extends BaseHttpRequest<UploadRequest> { protected List<MultipartBody.Part> multipartBodyParts = new ArrayList<>(); protected StringBuilder stringBuilder = new StringBuilder(); public UploadRequest(String suffixUrl) { super(suffixUrl); } public UploadRequest(String suffixUrl, UCallback callback) { super(suffixUrl); this.uploadCallback = callback; } @Override protected <T> Observable<T> execute(Type type) { if (stringBuilder.length() > 0) { suffixUrl = suffixUrl + stringBuilder.toString(); } if (params != null && params.size() > 0) { Iterator<Map.Entry<String, String>> entryIterator = params.entrySet().iterator(); Map.Entry<String, String> entry; while (entryIterator.hasNext()) { entry = entryIterator.next(); if (entry != null) { multipartBodyParts.add(MultipartBody.Part.createFormData(entry.getKey(), entry.getValue())); } } } return apiService.uploadFiles(suffixUrl, multipartBodyParts).compose(this.<T>norTransformer(type)); } @Override protected <T> Observable<CacheResult<T>> cacheExecute(Type type) { return null; } @Override protected <T> void execute(ACallback<T> callback) { DisposableObserver disposableObserver = new ApiCallbackSubscriber(callback); if (super.tag != null) { ApiManager.get().add(super.tag, disposableObserver); } this.execute(getType(callback)).subscribe(disposableObserver); } public UploadRequest addUrlParam(String paramKey, String paramValue) { if (paramKey != null && paramValue != null) { if (stringBuilder.length() == 0) { stringBuilder.append("?"); } else { stringBuilder.append("&"); } stringBuilder.append(paramKey).append("=").append(paramValue); } return this; } public UploadRequest addFiles(Map<String, File> fileMap) { if (fileMap == null) { return this; } for (Map.Entry<String, File> entry : fileMap.entrySet()) { addFile(entry.getKey(), entry.getValue()); } return this; } public UploadRequest addFile(String key, File file) { return addFile(key, file, null); } public UploadRequest addFile(String key, File file, UCallback callback) { if (key == null || file == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, file); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addImageFile(String key, File file) { return addImageFile(key, file, null); } public UploadRequest addImageFile(String key, File file, UCallback callback) { if (key == null || file == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.IMAGE_TYPE, file); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addBytes(String key, byte[] bytes, String name) { return addBytes(key, bytes, name, null); } public UploadRequest addBytes(String key, byte[] bytes, String name, UCallback callback) { if (key == null || bytes == null || name == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, bytes); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addStream(String key, InputStream inputStream, String name) { return addStream(key, inputStream, name, null); } public UploadRequest addStream(String key, InputStream inputStream, String name, UCallback callback) { if (key == null || inputStream == null || name == null) { return this; } RequestBody requestBody = create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, inputStream); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, requestBody); this.multipartBodyParts.add(part); } return this; } protected RequestBody create(final MediaType mediaType, final InputStream inputStream) { return new RequestBody() { @Override public MediaType contentType() { return mediaType; } @Override public long contentLength() { try { return inputStream.available(); } catch (IOException e) { return 0; } } @Override public void writeTo(@NonNull BufferedSink sink) throws IOException { Source source = null; try { source = Okio.source(inputStream); sink.writeAll(source); } finally { Util.closeQuietly(source); } } }; } }
dc1e0db21903abd1bd560bb9526e7ea24f05797e
66d85ab1c5bf23ac29875662a542f1948f7ed49c
/Shop/ShoppingCart.java
d2e6336cf6826b8ca1339120775251fc47b0e244
[]
no_license
denys999/JavaDocker
7c5f0dc98e800f74d347dfa0420a7aa9f9eab86f
d6245c694fb2469a17c05036d5d2db3fa388bd80
refs/heads/main
2023-07-18T06:55:40.230781
2021-09-04T23:03:19
2021-09-04T23:03:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
64
java
package Shop; public class ShoppingCart { int quantity; }
f05dd874a7e006eaee9902bc9965eb9ccd684abf
db99c3ef893f72c1370ec9da420adc5974aeba47
/src/de/mrunde/bachelorthesis/instructions/GlobalInstruction.java
f199f4b6f10e6989f535e282df0ef61e61b848a1
[ "MIT" ]
permissive
mrunde/Bachelor-Thesis
b4696f7c8e69652407495f8ea4cd9062410ab900
aca28714f896219b14093038a658cadea5c872e9
refs/heads/master
2021-01-20T12:13:15.532554
2016-11-19T12:02:14
2016-11-19T12:02:14
19,544,598
9
4
null
null
null
null
UTF-8
Java
false
false
2,336
java
package de.mrunde.bachelorthesis.instructions; import com.mapquest.android.maps.GeoPoint; import de.mrunde.bachelorthesis.basics.Landmark; import de.mrunde.bachelorthesis.basics.LandmarkCategory; /** * This is a "global landmark"-based instruction. * * @author Marius Runde */ public class GlobalInstruction extends Instruction { /** * The global landmark along the route */ private Landmark global; /** * Is the landmark on the left or right from the user's perspective? */ private boolean leftTurn; /** * Constructor of the GlobalInstruction class * * @param instructionPoint * The point where the instruction should be spoken * @param global * The global landmark along the route */ public GlobalInstruction(GeoPoint instructionPoint, Landmark global, boolean leftTurn) { super(instructionPoint, 0); this.global = global; this.leftTurn = leftTurn; } /** * @return The instruction as a verbal text */ public String toString() { String instruction = "You will pass "; if (LandmarkCategory.SIGHTSEEING.equals(this.global.getCategory())) { // Use landmark title for landmarks of the category SIGHTSEEING instruction += "the " + this.global.getTitle() + " soon"; } else { // Use landmark category for all other landmarks instruction += "the " + this.global.getFormattedCategory() + " soon"; } if (this.leftTurn) { instruction += " on your left"; } else { instruction += " on your right"; } return instruction; } /** * @return The extended instruction as a verbal text which uses the title of * the landmark instead of its category */ public String toExtendedString() { String instruction = "You will pass the " + this.global.getTitle() + " soon"; if (this.leftTurn) { instruction += " on your left"; } else { instruction += " on your right"; } return instruction; } /** * @return The global landmark along the route */ public Landmark getGlobal() { return this.global; } /** * @return Whether the landmark is on the left (<code>TRUE</code>) or right * (<code>FALSE</code>) from the user's perspective */ public boolean getLeftTurn() { return this.leftTurn; } }
0191fea42d219f3f5faac448f6823f2fb9c40ee1
9df342b8b7ecd2a9a39a585b6b84f9c19ee1506b
/src/indi/wangx/java/collection/IteratorTest.java
ebadffbe44f15005f4e039f7511db037a022f9a0
[]
no_license
WangXinW/jdk1.8-src
2abbf6771ec7d69eca457c635ca665c6c26980b9
112ff6c8844a205c158743afa0e94fc6ebd3d386
refs/heads/master
2020-07-28T20:46:53.809525
2019-10-09T03:47:20
2019-10-09T03:47:20
209,532,127
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
package indi.wangx.java.collection; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.junit.Test; /** * @author 27630 * @since 20190930 */ public class IteratorTest { @Test public void testIterator() { // HashMap Iterator // ArrayList Iterator List<String> list = new ArrayList<String>(); for (int i = 0;i < 10;i++) { list.add( Integer.toString(i)); } for (String item : list) { if ("0".equals(item)) { // list.remove("0"); } } for (int i = 0;i < list.size();i++) { if ("0".equals(list.get(i))) { list.remove(i); } } Iterator<String> iter = list.iterator(); while (iter.hasNext()) { if ("0".equals(iter.next())) { iter.remove(); } } } }
34e3a0fee642888157aea6e0b2f2ab179d82672d
7d4aea329c3c0daab1bf6d19b046bee3f2277f6c
/src/main/java/glassmaker/testmod/item/ItemTestLayered.java
5ba47b85af4ff3a2176bb3cc693c0bc06cbbcbd1
[ "MIT" ]
permissive
Glassmaker/TestMod
16f7aaf40ec98f528e25dfd06828c7e446dea136
d3783ab3fcc6a26cdefd251d6bc2f3a354e3ef4c
refs/heads/master
2021-01-17T15:07:43.607997
2019-02-22T12:31:26
2019-02-22T12:31:26
27,203,835
0
0
null
null
null
null
UTF-8
Java
false
false
332
java
package glassmaker.testmod.item; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; public class ItemTestLayered extends Item { public ItemTestLayered() { super(new Item.Properties().group(ItemGroup.DECORATIONS).maxStackSize(64)); //this.setUnlocalizedName("testmod.test.item.layered"); } }
65ba152f537123a78dc0a85bfa3a88303079d915
caa22f4260b7eadd8c92e9a39e12cee180adff2b
/hdimageview/src/main/java/xyz/zpayh/hdimageview/ImageSourceLoadListener.java
f709bea84d1e00d3fc5260dd546b326143fedc7e
[]
no_license
applibgroup/Pan_and_Zoom
e2806c428abd110c724fd539b1ce760b2cb2cddf
8be5e7385661724b7b583a0dce159ce9b4e9e69e
refs/heads/master
2023-08-16T11:35:09.914444
2021-08-10T10:46:36
2021-08-10T10:46:36
394,613,826
0
3
null
2021-09-28T10:44:24
2021-08-10T10:35:57
Java
UTF-8
Java
false
false
1,000
java
/* * * * Copyright 2017 陈志鹏 * * * * 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 xyz.zpayh.hdimageview; //import android.net.Uri; import ohos.utils.net.Uri; /** * 文 件 名: ImageSourceLoadListener * 创 建 人: 陈志鹏 * 创建日期: 2017/4/17 02:37 * 邮 箱: [email protected] * 修改时间: * 修改备注: */ public interface ImageSourceLoadListener { void loadSuccess(Uri uri, ImageSizeOptions options); }
569169e935ff8067055dfcc1f2df4e16b88729e0
40b7c6155cf0b224aeea084c2ae40a1111187228
/src/collection/VectorTest2.java
bc48d2a6f5e0d6131734db521bbe3392fd36b12e
[]
no_license
wns8628/java-chapter03
80a3714e8cbd6b21fea7659c94d3ddddd700df44
cfc3e396ce45748ab2ecaaf04893ef6a0f8ec34a
refs/heads/master
2020-04-14T15:13:29.811426
2019-01-07T08:16:38
2019-01-07T08:16:38
163,919,249
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package collection; import java.util.Enumeration; import java.util.Vector; public class VectorTest2 { public static void main(String[] args) { //옛날 벡터써보자 Vector<String> v = new Vector<String>(); v.addElement("둘리"); v.addElement("마이콜"); v.addElement("또치"); //순회1 int count = v.size(); //size는 옛날부터있었다. for(int i =0; i < count; i++) { String s = v.elementAt(i); System.out.println(s); } v.removeElementAt(2); //순회2 존나옛날방식.. Enumeration<String> e = v.elements(); while(e.hasMoreElements()) { String s = e.nextElement(); System.out.println(s); } } }
[ "wns8628" ]
wns8628
cf34599252f6f5e16abee21e7627363159c1c56d
6753c0b0113b960cdcdd5738787e3cea3d90dbc4
/MetodoDefault/src/packageInterface/InterfaceA.java
c06d2932802d98cd87db999df696016747d4f3a4
[]
no_license
DEVLuisEnrique/Interfaces-Java
9d13c2aee32220a3857c406b946a9732305b286b
39d7091e21c0e8457b6c7e4372a393ffb41ab629
refs/heads/master
2023-02-04T12:38:05.024377
2020-12-22T13:52:34
2020-12-22T13:52:34
322,739,736
2
0
null
null
null
null
UTF-8
Java
false
false
83
java
package packageInterface; public interface InterfaceA extends InterfaceB { }
d0a35d04b08fb1ce3a87f4ab91b6f48af28eaeea
3644e8a709bb2d56f2dc533654792b1aa71f234a
/bestwonderful/src/main/java/com/aikon/wht/model/EventModel.java
047244a32368dc5912ecdf842dbd12af6e401afc
[]
no_license
whttony0000/kyoumi
de4c1eb7fe12494096ca583e4439c391c39d2255
abeea6965cba3230c229dc1b41a8ffa51ebf1008
refs/heads/master
2021-05-06T17:12:35.096008
2018-01-04T04:00:52
2018-01-04T04:00:52
111,797,524
5
2
null
null
null
null
UTF-8
Java
false
false
89
java
package com.aikon.wht.model; /** * @author haitao.wang */ public class EventModel { }
f16a921248c051521ef6319cef9860e7f886228a
3581ea333137a694eeec2e07da2b3c7b556ac32c
/testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/resource/basic/resource/GenericEntityDoubleWriter.java
437b0fe0fd0f2f1f446d6dcd5287ffd3ade2cc9c
[ "Apache-2.0" ]
permissive
fabiocarvalho777/Resteasy
d8b39366c50d49d197d5938b97c73b1a5cb581b5
94dae2cf6866705fe409048fde78ef2316c93121
refs/heads/master
2020-12-02T16:28:18.396872
2017-07-07T18:36:57
2017-07-07T18:36:57
96,557,475
1
0
null
2017-07-07T16:41:04
2017-07-07T16:41:04
null
UTF-8
Java
false
false
2,046
java
package org.jboss.resteasy.test.resource.basic.resource; import org.jboss.logging.Logger; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.List; @Provider @Produces("*/*") public class GenericEntityDoubleWriter implements MessageBodyWriter<List<Double>> { private static Logger logger = Logger.getLogger(GenericEntityDoubleWriter.class); public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { logger.info("DoubleWriter type: " + type.getName()); if (!List.class.isAssignableFrom(type)) { return false; } logger.info("DoubleWriter: " + genericType); if (!(genericType instanceof ParameterizedType)) { return false; } logger.info("DoubleWriter"); ParameterizedType pt = (ParameterizedType) genericType; boolean result = pt.getActualTypeArguments()[0].equals(Double.class); logger.info("Doublewriter result!!!: " + result); return result; } public long getSize(List<Double> doubles, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return -1; } public void writeTo(List<Double> floats, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { StringBuffer buf = new StringBuffer(); for (Double f : floats) { buf.append(f.toString()).append("D "); } entityStream.write(buf.toString().getBytes()); } }
7a8f57c78d5ef478de49c19416b96476bdacdabe
153bc35641a3650ff202429996aebee162459819
/Spring0731/src/SpringHelloKrImp.java
d3fb1e9899a1bd07292b460e27ca6bc7ec871e1e
[]
no_license
VitoJeong/Java
8780e90a3074500339925b5131e291b8a95560fd
5e82252ad9e008dca2c9dff7c1b95731a0791bac
refs/heads/master
2023-04-03T02:04:39.863557
2021-04-07T13:25:30
2021-04-07T13:25:30
273,157,853
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
public class SpringHelloKrImp implements SpringHelloKr { @Override public void sayHello() { System.out.println("인터페이스를 구현한 클래스"); System.out.println("sayHello()호출!!"); } }
117e497647762ecefbaebd29999154195fdbcb16
3ee87ef515337cc2997526154a466c0df616e619
/core/Grammar2Model.GVQ/src/gts/modernization/model/GVQ/Core/InitUnitElementValue.java
a351c5258a12a630b80de045f1ce7c03bb13f721
[]
no_license
adolfosbh/gra2mol
e0eb121e0d4b9757b53546e90aa570194a920bf5
ab03b456446ba906ce796fd996703df243410492
refs/heads/master
2020-04-05T23:00:58.753302
2016-11-19T13:13:07
2016-11-19T13:13:07
51,363,734
0
0
null
2016-02-09T11:49:49
2016-02-09T11:49:49
null
UTF-8
Java
false
false
4,370
java
/** * <copyright> * </copyright> * * $Id$ */ package gts.modernization.model.GVQ.Core; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Init Unit Element Value</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getType <em>Type</em>}</li> * <li>{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getValue <em>Value</em>}</li> * <li>{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getExtension <em>Extension</em>}</li> * <li>{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getParams <em>Params</em>}</li> * </ul> * </p> * * @see gts.modernization.model.GVQ.Core.CorePackage#getInitUnitElementValue() * @model * @generated */ public interface InitUnitElementValue extends EObject { /** * Returns the value of the '<em><b>Type</b></em>' attribute. * The literals are from the enumeration {@link gts.modernization.model.GVQ.Core.InitUnitElementValueType}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Type</em>' attribute. * @see gts.modernization.model.GVQ.Core.InitUnitElementValueType * @see #setType(InitUnitElementValueType) * @see gts.modernization.model.GVQ.Core.CorePackage#getInitUnitElementValue_Type() * @model * @generated */ InitUnitElementValueType getType(); /** * Sets the value of the '{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getType <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Type</em>' attribute. * @see gts.modernization.model.GVQ.Core.InitUnitElementValueType * @see #getType() * @generated */ void setType(InitUnitElementValueType value); /** * Returns the value of the '<em><b>Value</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Value</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Value</em>' attribute. * @see #setValue(String) * @see gts.modernization.model.GVQ.Core.CorePackage#getInitUnitElementValue_Value() * @model * @generated */ String getValue(); /** * Sets the value of the '{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getValue <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Value</em>' attribute. * @see #getValue() * @generated */ void setValue(String value); /** * Returns the value of the '<em><b>Extension</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Extension</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Extension</em>' attribute. * @see #setExtension(String) * @see gts.modernization.model.GVQ.Core.CorePackage#getInitUnitElementValue_Extension() * @model * @generated */ String getExtension(); /** * Sets the value of the '{@link gts.modernization.model.GVQ.Core.InitUnitElementValue#getExtension <em>Extension</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Extension</em>' attribute. * @see #getExtension() * @generated */ void setExtension(String value); /** * Returns the value of the '<em><b>Params</b></em>' containment reference list. * The list contents are of type {@link gts.modernization.model.GVQ.Core.Parameter}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Params</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Params</em>' containment reference list. * @see gts.modernization.model.GVQ.Core.CorePackage#getInitUnitElementValue_Params() * @model containment="true" * @generated */ EList<Parameter> getParams(); } // InitUnitElementValue
61b4c394f45c2656baba4b39451c4d5f6d87a573
fdfea32238ec4432c8c4dd70cd211686dbcca653
/app/src/main/java/com/example/horsetrackbetting/BettingActivity.java
845bdcd68b0ba51b3dab6aed06fe1530ad75e474
[]
no_license
ReneLisasi/Horse-Betting-App
1df195483ad4caf09720b21eed7bb1a6f3e81e69
5e4ddfcc8818d9b63da3443fc6b3267386d39cf2
refs/heads/master
2023-03-05T23:59:24.126363
2021-02-11T05:28:50
2021-02-11T05:28:50
330,286,934
0
0
null
null
null
null
UTF-8
Java
false
false
7,326
java
package com.example.horsetrackbetting; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.util.Random; /*author: RLisasi * this is where the action takes place */ public class BettingActivity extends AppCompatActivity implements View.OnClickListener { //properties TextView txtHorseNumber; TextView txtHorseName; TextView txtHorseOdds; TextView txtBalance; Button btnLess; TextView txtBetAmount; Button btnMore; TextView txtPayout; TextView txtGoal; Button btnBet2; Button btnCancel; Horse selectedHorse; Account selectedAccount; int displayHorseNumber = 0; String displayHorseName=null; int displayHorseOdds=0; int displayAccountBalance; int displayAccountBetAmount=100; int displayAccountPayout; int displayAccountGoal; Random rnd; int noob; static int winner; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_betting); //bala = (bala - displayAccountBetAmount); doAll(); } //get values from other activities public void getSelection(){ //get horse selection from selecting activity displayHorseNumber = SelectingActivity.getSelectionNumber(); displayHorseName = SelectingActivity.getSelectionName(); displayHorseOdds = SelectingActivity.getSelectionOdds(); //get account values displayAccountBalance = Account.defaultAccount.getBalance(); displayAccountBetAmount = Account.defaultAccount.getBetAmount(); displayAccountPayout = Account.defaultAccount.getPayout() * displayHorseOdds; displayAccountGoal = Account.defaultAccount.getGoal(); } //instantiate new objects here public void CreateHorse(){ //new horse selectedHorse = new Horse(displayHorseName, displayHorseNumber , displayHorseOdds); //create default account selectedAccount = new Account(displayAccountBalance,displayAccountBetAmount, displayAccountPayout, displayAccountGoal); } //attach variables to xml public void findViews(){ txtHorseNumber = (TextView) findViewById(R.id.txtHorseNumber); txtHorseName = (TextView) findViewById(R.id.txtHorseName); txtHorseOdds = (TextView) findViewById(R.id.txtHorseOdds); txtBalance = (TextView) findViewById(R.id.txtBalance); txtBetAmount = (TextView) findViewById(R.id.txtBetAmount); txtPayout = (TextView) findViewById(R.id.txtPayout); txtGoal = (TextView) findViewById(R.id.txtGoal); btnLess = (Button) findViewById(R.id.btnBetLess); btnMore = (Button) findViewById(R.id.btnBetMore); btnBet2 = (Button) findViewById(R.id.btnBet2); btnCancel = (Button) findViewById(R.id.btnCancel); //set listeners for all buttons btnLess.setOnClickListener(this); btnMore.setOnClickListener(this); btnBet2.setOnClickListener(this); btnCancel.setOnClickListener(this); } //set text values to new horse public void setTxt(){ txtHorseNumber.setText(Integer.toString(selectedHorse.horseNumber)); txtHorseName.setText(selectedHorse.horseName); txtHorseOdds.setText(Integer.toString(selectedHorse.horseOdds)+"/1"); txtBalance.setText(Integer.toString(displayAccountBalance-displayAccountBetAmount)); txtBetAmount.setText(Integer.toString(displayAccountBetAmount)); txtPayout.setText(Integer.toString(displayAccountPayout)); txtGoal.setText(Integer.toString(displayAccountGoal)); } public int calculateLess(){ //when you click the bet amount and payout decrease int bala2 = displayAccountBalance; //if statement here if (displayAccountBalance > 0 && displayAccountBetAmount >50) { displayAccountBetAmount -= 100; displayAccountPayout = displayAccountBetAmount * displayHorseOdds; bala2 = (bala2 - displayAccountBetAmount); txtBalance.setText(Integer.toString(bala2)); }else{ Toast.makeText(this, "You can't go lower than 0", Toast.LENGTH_SHORT).show(); } setTxt(); txtBalance.setText(Integer.toString(bala2)); //try to return bala2 to return bala2; } private void calculateMore() { //when you click the bet amount and payout increase int bala = displayAccountBalance; //if statement here if (displayAccountBalance > displayAccountBetAmount && bala >0) { displayAccountBetAmount += 100; displayAccountPayout = displayAccountBetAmount * displayHorseOdds; bala = (bala - displayAccountBetAmount); }else{ Toast.makeText(this, "You can't go higher", Toast.LENGTH_SHORT).show(); } setTxt(); txtBalance.setText(Integer.toString(bala)); } //do everything private void doAll(){ getSelection(); CreateHorse(); findViews(); setTxt(); } //default method for handling all Onclick events @Override public void onClick(View v) { //find buttons by id and implement code switch (v.getId()){ case R.id.btnBetLess: //handle less noob = calculateLess(); break; case R.id.btnBetMore: //handle more calculateMore(); break; case R.id.btnBet2: //handle bet //Add if statement for must bet > 0 winner = getRandom(); if (winner == displayHorseNumber){ displayAccountBalance = displayAccountBalance + displayAccountPayout; Account.defaultAccount.setBalance(displayAccountBalance); Toast.makeText(this, "You won "+ displayAccountPayout + "Your bal is"+ displayAccountBalance, Toast.LENGTH_SHORT).show(); }else{ displayAccountBalance = displayAccountBalance - displayAccountBetAmount; Account.defaultAccount.setBalance(displayAccountBalance); Toast.makeText(this, "You lost "+ displayAccountBetAmount+ "Your bal is"+ displayAccountBalance, Toast.LENGTH_SHORT).show(); } setTxt(); Intent Racing = new Intent(BettingActivity.this, RacingActivity.class); startActivity(Racing); break; case R.id.btnCancel: //handle cancel super.onBackPressed(); break; } } public static int getWinner(){ return winner; } //generate a random number public int getRandom(){ /*because this is a horse betting app odds should play a factor in the outcome of the winning horse I did not have time to add this and didn't want to risk any last minute breakdowns but this is where it would go*/ rnd = new Random(); int rand = (rnd.nextInt(6)+1); return rand; } }
3b5cf2fb5d6b19bcca36a2dbbfdbfdb47b381629
003be987f36ed4f2c7f5d697f3e601ba62b27a59
/src/main/test/teste/builder/ClienteBuilder.java
68d92104219d8f5ac8ac6e38dfeb952f5b50babc
[]
no_license
rdarski/bempromotorabackend
f3a810c9b5df201f0daf6e15dca75754f0a9a72a
ff74816d39adc41ca554d2e2bd26ce356e4b5317
refs/heads/master
2020-06-29T03:54:50.962377
2019-09-21T15:23:46
2019-09-21T15:23:46
200,433,606
3
0
null
2019-08-04T00:35:21
2019-08-04T00:35:20
null
UTF-8
Java
false
false
1,433
java
package teste.builder; import comum.Data; import comum.Periodo; import modelo.*; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; public class ClienteBuilder { public static Cliente ClienteComEndereco(){ Cliente padrao = new Cliente(); padrao.setCpf("08557752971"); padrao.setNome("Gandalf"); padrao.setId(1L); Endereco endereco = new Endereco(); endereco.setCep("08088328"); endereco.setId(1L); endereco.setLogradouro("R. da Conceicao 193D"); endereco.setParceiro(padrao); Data umDoQuatroDeDezenove = Data.em(1, 4, 2019); Data trintaEUmDoDozeDeDezenove = Data.em(31, 12, 2019); Periodo vigencia = Periodo.de(umDoQuatroDeDezenove, trintaEUmDoDozeDeDezenove); endereco.setVigencia(vigencia); Set<Endereco> enderecos = new HashSet<>(); enderecos.add(endereco); padrao.setEnderecos(enderecos); return padrao; } public static Cliente semConvenio(){ return ClienteComEndereco(); } public static Cliente comStiuacaoDeConvenio(SituacaoConvenio situacao) { Convenio inss = ConvenioBuilder.INSS(); Cliente cliente = ClienteComEndereco(); ConvenioCliente convenioCliente = new ConvenioCliente(inss, cliente, situacao); cliente.setConvenio(convenioCliente); return cliente; } }
52dad7ebb34ae8fba4b2d10e206e900ad70c1a17
9757bbb318fa245dcdb099ce356ddbeff5f2fbaf
/src/main/java/g0301_0400/s0372_super_pow/Solution.java
6aee866765ce1d229f7f0484e5d879df450f837d
[ "MIT" ]
permissive
javadev/LeetCode-in-Java
181aebf56caa51a4442f07466e89b869aa217424
413de2cb56123d3844a1b142eec7e9a8182c78fb
refs/heads/main
2023-08-31T01:46:52.740790
2023-08-30T08:45:06
2023-08-30T08:45:06
426,947,282
103
57
MIT
2023-09-14T08:08:08
2021-11-11T09:46:12
Java
UTF-8
Java
false
false
1,800
java
package g0301_0400.s0372_super_pow; // #Medium #Math #Divide_and_Conquer #2022_07_12_Time_1_ms_(100.00%)_Space_42.4_MB_(87.15%) public class Solution { private static final int MOD = 1337; public int superPow(int a, int[] b) { int phi = phi(MOD); int arrMod = arrMod(b, phi); if (isGreaterOrEqual(b, phi)) { // Cycle has started // cycle starts at phi with length phi return exp(a % MOD, phi + arrMod); } return exp(a % MOD, arrMod); } private int phi(int n) { double result = n; for (int p = 2; p * p <= n; p++) { if (n % p > 0) { continue; } while (n % p == 0) { n /= p; } result *= 1.0 - 1.0 / p; } if (n > 1) { // if starting n was also prime (so it was greater than sqrt(n)) result *= (1.0 - (1.0 / n)); } return (int) result; } // Returns true if number in array is greater than integer named phi private boolean isGreaterOrEqual(int[] b, int phi) { int cur = 0; for (int j : b) { cur = cur * 10 + j; if (cur >= phi) { return true; } } return false; } // Returns number in array mod phi private int arrMod(int[] b, int phi) { int res = 0; for (int j : b) { res = (res * 10 + j) % phi; } return res; } // Binary exponentiation private int exp(int a, int b) { int y = 1; while (b > 0) { if (b % 2 == 1) { y = (y * a) % MOD; } a = (a * a) % MOD; b /= 2; } return y; } }
1d2603a0112cad46df3c9602a102230eca3349c7
988ac610b4c6e949d45e6c8a6d10073e40d678b3
/shop/src/main/java/ru/tokarev/shop/controller/CategoryAdminController.java
271088fa4bec551d5e127251efb6cb12ac1ae238
[]
no_license
vedmas/shop-project
21e0bb37fb10b620116374579d85822713e14549
12b421b6130eacaf1b20f3d28b6b42b3b3d86935
refs/heads/master
2022-05-03T02:40:14.532512
2020-05-05T16:58:57
2020-05-05T16:58:57
250,497,327
0
0
null
2020-03-31T03:36:56
2020-03-27T09:51:36
HTML
UTF-8
Java
false
false
2,720
java
package ru.tokarev.shop.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import ru.tokarev.shop.controller.repr.CategoryRepr; import ru.tokarev.shop.repository.entity.Category; import ru.tokarev.shop.service.category.CategoryService; import javax.validation.Valid; import java.util.List; @Controller @RequestMapping("/admin") public class CategoryAdminController { private final CategoryService categoryService; @Autowired public CategoryAdminController(CategoryService categoryService) { this.categoryService = categoryService; } @GetMapping("/categories") public String categoriesPage(Model model) { List<Category> categories = categoryService.findAll(); model.addAttribute("activePage", "Categories"); model.addAttribute("categories", categories); return "/admin/categories"; } @GetMapping("/category/{id}/edit") public String categoryEdit(@PathVariable Long id, Model model) { model.addAttribute("edit", true); model.addAttribute("activePage", "Categories"); model.addAttribute("category", categoryService.get(id)); return "admin/category_form"; } @GetMapping("/category/create") public String categoryCreate(Model model) { model.addAttribute("create", true); model.addAttribute("activePage", "Categories"); model.addAttribute("category", new Category()); return "admin/category_form"; } @PostMapping("/category") public String actionOnTheCategory(@Valid CategoryRepr categoryRepr, RedirectAttributes redirectAttributes) { try { categoryService.saveCategory(categoryRepr); } catch (Exception ex) { redirectAttributes.addFlashAttribute("error", true); if (categoryRepr.getId() == null) { return "redirect:/admin/category/create"; } return "redirect:/admin/category/" + categoryRepr.getId() + "/edit"; } return "redirect:/admin/categories"; } @GetMapping("/category/{id}/delete") public String categoryDelete(@PathVariable Long id, Model model) { categoryService.deleteById(id); model.addAttribute("activePage", "Categories"); return "redirect:/admin/categories"; } }
009a45a70cfa2276a22531c8ad2d800535fa477b
81743e6e9f2314c867e4806deffbf2700aad822c
/app/build/generated/source/buildConfig/debug/com/osahub/anurag/trafficmonitoringsystem/BuildConfig.java
e7c693b29b1c27d4f17418240da4c0f67e8f3df0
[]
no_license
anuragtrehan/TrafficMonitoringSystem
e843bbc5d0a5443f65d1410c1d9b9949acfbc531
53d20f9cdb0415adf2bf8c855dabc42cf52efbe9
refs/heads/master
2020-12-24T09:53:54.204396
2016-11-09T07:31:56
2016-11-09T07:31:56
73,261,248
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
/** * Automatically generated file. DO NOT MODIFY */ package com.osahub.anurag.trafficmonitoringsystem; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.osahub.anurag.trafficmonitoringsystem"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
bd42f778f4735ef63f11309075cf776c8a1e5625
66915712de76e57274293f4e44e78a50537a33c1
/src/main/java/com/witsafe/controller/security/CommonController.java
4a86029f861ab71b1ff542a47535242a659ebd53
[]
no_license
lipengdarcy/GiianCheck
a9bdf6dd973ff0f883c21ff4e71450fe32cf1f09
5e4b61881faee2616576e12526a38733e0a8f5f3
refs/heads/master
2021-01-10T08:44:39.404111
2018-01-17T03:55:07
2018-01-17T03:55:07
46,246,538
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
package com.witsafe.controller.security; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * 公用页面Controller,如404找不到页面等 */ @Controller public class CommonController { private static Log log = LogFactory.getLog(CommonController.class); // 无权限页面 @RequestMapping(value = "/403", method = RequestMethod.GET) public String unAuthorized403() { log.error("你没有权限登录,请登录或获取相应权限"); return "commons/403"; } // 找不到页面 @RequestMapping(value = "/404", method = RequestMethod.GET) public String unFound404() { log.error("找不到页面,请检查"); return "commons/404"; } }
adbd77c6442cc7679da925ecfa364da42e5bebd1
4c49d8e69dea8839ccefd078b4837ece9fbf62b7
/src/test/java/SolveSudokuTest.java
5ab271155abe8efbdec5ed02d2dd967389e065d9
[]
no_license
zpng/leetcode
e056298929665c7c0858050e9fdb290959341827
17621cdd1479b316586d15253c68f3e54c395024
refs/heads/master
2021-01-23T00:06:26.526969
2017-04-12T15:13:36
2017-04-12T15:13:36
85,696,911
0
0
null
null
null
null
UTF-8
Java
false
false
687
java
import org.junit.Test; import java.util.Arrays; import static org.junit.Assert.*; /** * Created by zhangpeng on 2017/4/3. */ public class SolveSudokuTest { @Test public void solveSudoku() throws Exception { char[][] sudo = {".87654321".toCharArray(), "2........".toCharArray(), "3........".toCharArray(), "4........".toCharArray(), "5........".toCharArray(), "6........".toCharArray(), "7........".toCharArray(), "8........".toCharArray(), "9........".toCharArray()}; new SolveSudoku().solveSudoku(sudo); System.out.println(Arrays.deepToString(sudo)); } }
5c1c1e66fac284ae96c6133af208a2ae3f959d16
0e7e8940bf50f6a068444c1bb35cf91e9cc685b0
/src/main/java/com/nam/book/Application.java
7d729b08700a1df6e6ea3e57a17f22529fc0d101
[]
no_license
namkyo/nam-spring-webservice
93f3d43a6993ef44f40b37a67217cfce175034e9
4107119d4ae72966d362172513ac955bb588d4da
refs/heads/master
2023-07-04T08:42:46.193093
2021-08-04T15:11:50
2021-08-04T15:11:50
314,988,826
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.nam.book; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; @SpringBootApplication @EnableJpaAuditing public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
d78c9e8cd52552297348ce11a293178f6f726d7e
7c88e6cd7c2604a9bfebd197a9f192bdddfbcb7c
/Net/src/main/java/HalfNio/NioClient.java
02a79741abbca21cb02e72b9ed691de08f90a0b9
[]
no_license
fcy-nienan/Image
1bca0a42085d681f73f41420a242e2c4b542f0e7
168bc4b5a50d5887693ac4ac44bbee3447e84105
refs/heads/develop
2022-12-24T04:33:53.026049
2022-07-27T16:31:10
2022-07-27T16:31:10
154,528,986
0
0
null
2022-12-16T01:43:43
2018-10-24T15:56:29
Java
UTF-8
Java
false
false
1,130
java
package HalfNio; import java.io.*; import java.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @descripiton: * @author: fcy * @date: 2018-08-03 11:00 */ public class NioClient { public static void main(String args[]) throws Exception { ExecutorService service= Executors.newCachedThreadPool(); for(int i=0;i<444;i++){ service.submit(new Client()); } service.shutdown(); } public static void send()throws Exception{ Socket socket=new Socket("127.0.0.1",8778); OutputStream stream=socket.getOutputStream(); BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(stream)); while(true){ Thread.sleep(1000); writer.append(Thread.currentThread().getId()+":Hello World!"); writer.flush(); } } static class Client implements Runnable{ @Override public void run() { try { send(); } catch (Exception e) { e.printStackTrace(); } } } }
bed619c28120e59f9c4b768525834426a2bb003c
f43c14bdfcde65ac822797ea689f82442a72de11
/Data-Structure/Stack/Implement Stack Using two queue.java
36de4a5fadf4f06b41bb9717e14e8f44a7d946db
[]
no_license
xuanli0212/Algorithm
c8da46edf6d0477b21f9ec6c90fff2eaec69c589
6908810b1cae74a31b4d8e710c50ff7ace993c4e
refs/heads/master
2021-03-27T13:08:32.314292
2016-11-16T01:34:43
2016-11-16T01:34:43
52,653,440
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
class Stack { private Queue<Integer> queue1 = new LinkedList<Integer>(); private Queue<Integer> queue2 = new LinkedList<Integer>(); public void push(int x) { queue1.offer(x); // Write your code here } // Pop the top of the stack public void pop() { while(queue1.size() > 1){ queue2.offer(queue1.poll()); } queue1.poll(); Queue<Integer> temp = queue1; queue1 = queue2; queue2 = temp; } // Return the top of the stack public int top() { while(queue1.size() > 1){ queue2.offer(queue1.poll()); } int item = queue1.poll(); Queue<Integer> temp = queue1; queue1 = queue2; queue2 = temp; queue1.offer(item); return item; // Write your code here } // Check the stack is empty or not. public boolean isEmpty() { return queue1.size() ==0; // Write your code here } }
810cc67bbfda503c4d0a887807577b88dcff7929
cc2dd5dddf99ce1c0e3d532a50594e129485d276
/gmall-ums/src/main/java/com/atguigu/gmall/ums/service/impl/MemberCollectSubjectServiceImpl.java
a5569db6fcc8fe9c984632bf31a2c1d733d0787b
[ "Apache-2.0" ]
permissive
1090168015/gmall-0615
36fab84dee916801d811b3c78d6b909f4b074e7c
01371f2d1c88fad3c303f19792073f6c65dce8cf
refs/heads/master
2022-12-21T12:55:32.342441
2019-11-19T08:40:19
2019-11-19T08:40:19
218,018,896
0
0
Apache-2.0
2019-10-28T11:42:22
2019-10-28T10:13:39
JavaScript
UTF-8
Java
false
false
1,124
java
package com.atguigu.gmall.ums.service.impl; import com.atguigu.gmall.ums.service.MemberCollectSubjectService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.atguigu.gmall.core.bean.PageVo; import com.atguigu.gmall.core.bean.Query; import com.atguigu.gmall.core.bean.QueryCondition; import com.atguigu.gmall.ums.dao.MemberCollectSubjectDao; import com.atguigu.gmall.usm.entity.MemberCollectSubjectEntity; @Service("memberCollectSubjectService") public class MemberCollectSubjectServiceImpl extends ServiceImpl<MemberCollectSubjectDao, MemberCollectSubjectEntity> implements MemberCollectSubjectService { @Override public PageVo queryPage(QueryCondition params) { IPage<MemberCollectSubjectEntity> page = this.page( new Query<MemberCollectSubjectEntity>().getPage(params), new QueryWrapper<MemberCollectSubjectEntity>() ); return new PageVo(page); } }
f8ad398f46228f91310b74521777778ccbde989c
cba9ec71a69dc249ee2bbaf7ca2c47afa07cb332
/Phase1.2/Dao Classes/LoginDao.java
027ae59e217eb8670db5d243628b987407e58285
[]
no_license
manishkaujalgi/Project_phase-1.5
b1ab5f2ba1bd9da470ca755930ca1ddfa0184f8c
6287674884ffd86f2a6a10570384ac0e698be702
refs/heads/master
2021-04-26T22:08:20.322549
2018-03-06T05:59:22
2018-03-06T05:59:22
124,027,136
0
0
null
null
null
null
UTF-8
Java
false
false
1,407
java
package model; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class LoginDao { public LoginDao(Connection connect){ this.connection=connect; if(connection!=null){ System.out.println("Established Connection successfully"); } else{ System.err.println("Failed to establish Connection"); } } public void InsertData(){ try { statement= connection.createStatement(); String sql="LOAD XML LOCAL INFILE 'C:/Users/vaish/itmdev/src/main/webapp" + "/XML/LoginDetails.xml' " + "INTO TABLE login ROWS IDENTIFIED BY '<loginDetails>';"; statement.execute(sql); System.out.println("XML data is pushed into the database"); } catch (SQLException e) { System.err.println("Failed in Updating Data to OTP Table"); } } public ResultSet getResultSet() throws Exception { ResultSet rs = null; try { statement = connection.createStatement(); String sql = "select * from login"; rs = statement.executeQuery(sql); } catch(SQLException e) { System.out.println(e.getMessage()); } return rs; } public void close(){ try { statement.close(); connection.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private static Statement statement = null; private static Connection connection=null; }
789e70dce8ee1df8bb45d399a2223f4e5b10a8d6
8312705a0d2c85a31dde61b057f2acae355c180c
/WebProj5/src/com/internousdev/webproj5/action/LoginAction.java
8997492e4a1f56e02b8ae88a57100f843c9c5f12
[]
no_license
mihiradaiki/test
099074ff962940a1080c607f8c9834dba269cdf3
2f094ea25fec915e664beaeda1d0518c97ce9ee4
refs/heads/master
2021-05-02T06:31:06.503280
2018-04-02T02:47:40
2018-04-02T02:47:40
120,857,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,427
java
package com.internousdev.webproj5.action; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.struts2.interceptor.SessionAware; import com.internousdev.webproj5.dao.LoginDAO; import com.internousdev.webproj5.dto.LoginDTO; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport implements SessionAware{ private String username; private String password; private List<LoginDTO> loginDTOList= new ArrayList<LoginDTO>(); private Map<String, Object> session; public String execute(){ String ret = ERROR; System.out.println(username); System.out.println(password); LoginDAO dao=new LoginDAO(); loginDTOList=dao.select(username, password); if(this.username.equals(loginDTOList.get(0).getUsername()) && this.password.equals(loginDTOList.get(0).getPassword())){ session.put("loginDTOList", loginDTOList); ret=SUCCESS; }else{ session.put("loginDTOList", loginDTOList); ret=ERROR; } return ret; } public String getUsername(){ return username; } public void setUsername(String username){ this.username = username; } public String getPassword(){ return password; } public void setPassword(String password){ this.password = password; } public Map<String, Object> getSession(){ return session; } public void setSession(Map<String, Object> session){ this.session = session; } }
d06b8898524e5d49148c8b94e613f762b0660e3a
c21cc15ac38c35a0c80652fefd830b2dab82eb01
/PredictiveScalingGeneticAlgorithm/src/geneticalgorithm/database/RuleEngine.java
7c6588e49f3836419d234c9e44b4d93aed32406c
[]
no_license
tomborel/University-Projects
9fd4c9af3e4ed94d6b903aad6d83af3ac5bf4b22
cfdef19de8158ada9acb4a02ac91e7d17a8145a1
refs/heads/master
2021-01-16T21:21:19.820944
2014-09-28T18:38:17
2014-09-28T18:38:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,477
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package geneticalgorithm.database; import geneticalgorithm.mappers.RuleMapper; import geneticalgorithm.objects.AbstractIndividual; import geneticalgorithm.objects.BaldwinianPittsburghIndividual; /** * * @author Tom */ public class RuleEngine { private RuleMapper mapper = new RuleMapper(); public String readRule(String input) { return mapper.selectQuery(input); } public void deleteRuleBase() { mapper.deleteQuery(); } public void writeRules(AbstractIndividual individual) { if(mapper.selectCount() > 0) mapper.deleteQuery(); BaldwinianPittsburghIndividual individualToAdd = (BaldwinianPittsburghIndividual) individual; int index = 0; while(index < individual.getGenes().length) { int ruleIndex = 0; String ruleToAdd = ""; while(ruleIndex < individualToAdd.getRuleLength()) { ruleToAdd += individualToAdd.getGenes()[index]; index++; ruleIndex++; if(ruleIndex == individualToAdd.getRuleLength() - 2) ruleToAdd += " : "; } mapper.insertQuery(ruleToAdd); } } }
e5340bc4fd156f05e282df1582c887f85b80c167
863e064055cef2f8ba298602ad1feb5a2b80b336
/src/main/java/org/meizhuo/rpc/promise/ThenVoidResCallBack.java
0cc30f7eb3e55eaff5b524fa866d338f1522c58f
[]
no_license
wephone/MeiZhuoRPC
5c333d90cb8aad4fe6f1d3476563fca4f7704375
f60b56d2aa7677d75907620989abc24d0509581f
refs/heads/master
2021-09-22T15:00:34.130651
2018-09-11T07:50:33
2018-09-11T07:50:33
115,402,932
68
28
null
null
null
null
UTF-8
Java
false
false
120
java
package org.meizhuo.rpc.promise; public interface ThenVoidResCallBack<T> extends RxCallBack{ void done(T arg); }
78ee14aadfb73356090fac31cdf181f0df4a1979
a936ec2db1f9add848f83b0861533e1f1bc8806f
/SUN/src/com/sun/app/process/front/honour/HonourListProcess.java
39527362b62df66e2a1e62fe082843384ef5c599
[ "Apache-2.0" ]
permissive
ManGroup/Demo
6e295d5ff22daf50ec91320516a2608bd0d2e876
e4892a70493df3a955a1eee5b2145060e61c26c4
refs/heads/master
2020-12-30T09:57:55.044116
2014-01-10T00:41:01
2014-01-10T00:41:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package com.sun.app.process.front.honour; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.sun.app.process.BaseProcess; public class HonourListProcess extends BaseProcess { @Override public HashMap<String, Object> execute(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> model) throws Exception { // TODO Auto-generated method stub String typeId = request.getParameter("typeId"); List allHonour = getFsMgr().getProjectService().getHonourProjectByType( typeId); List honourType = getFsMgr().getProjectService().getHonourType(); model.put("allType", honourType); model.put("allHonour", allHonour); String flashPath = getServMgr().getSysService().queryForFlash(); model.put("fpath", flashPath); model.put("typeId", typeId); return model; } }
3bc45bf5a8e699b64016e3b46f7994e2e9998198
3632c9297cd8a75ebfcad71e7543296bab3efcbf
/bc2/src/shared/java/com/topfinance/ebo/msg/Saps37300101.java
6ef0add952db4c4c9243f1670f52fb510bb5b23a
[]
no_license
luboid/leontestbed
9850500166bd42378ae35f92768a198b1c2dd7c2
eb1c704b1ea77a62097375239ecb2c025c7a19dc
refs/heads/master
2021-01-10T21:48:41.905677
2015-09-24T10:28:18
2015-09-24T10:28:18
41,542,498
1
0
null
null
null
null
UTF-8
Java
false
false
2,119
java
package com.topfinance.ebo.msg; import com.topfinance.ebo.msg.JaxbMapping; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.OneToMany; /** * Saps37300101 generated by ParseSampleXml */ @Entity @Table(name = "T_C2_SAPS_373") public class Saps37300101 implements java.io.Serializable { // Fields @JaxbMapping(objPath="") private Integer id; @JaxbMapping(objPath="fndsOfPoolMgmt.fndsOfPoolMgmtInf.brnchList[0].mmbId") private String mmbId; private Saps37300101Hdr fid; /** default constructor */ public Saps37300101() { } /** * Returns the id * * @return the id */ @Id @Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0) @SequenceGenerator(name = "CFG_SEQUNCE_GEN", sequenceName = "S_CFG_SEQUNCE") @GeneratedValue(strategy = GenerationType.AUTO, generator = "CFG_SEQUNCE_GEN") public Integer getid() { return id; } /** * Sets the id * * @param newid the new id */ public void setid(Integer newid) { id = newid; } /** * Returns the mmbId * * @return the mmbId */ @Column(name = "MMBID") public String getMmbId() { return mmbId; } /** * Sets the mmbId * * @param newMmbId the new mmbId */ public void setMmbId(String newMmbId) { mmbId = newMmbId; } @ManyToOne(cascade=CascadeType.ALL) @JoinColumn(name="FID", nullable=false, updatable=false) public Saps37300101Hdr getFid() { return fid; } public void setFid(Saps37300101Hdr fid) { this.fid = fid; } }
b1b8093e8e9cb5f7230ce894d8802efc1eb15c2b
3de85c8d0aa02af359cc2108d84734014b6dd1f4
/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRichTextString.java
d9bfc8137cedb2cb509c6162915085dadca4de06
[]
no_license
kinow/poi
30695fb6a7a07027df9e53e33dc2a1ac8b5a0e59
bfeeba5eb8f03d0d7ac588a30712ec4e66f107aa
refs/heads/trunk
2021-01-22T21:45:40.637254
2017-03-18T18:46:15
2017-03-18T18:46:15
85,472,973
0
0
null
2017-03-19T12:07:46
2017-03-19T12:07:46
null
UTF-8
Java
false
false
2,332
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.poi.xssf.binary; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.util.Internal; import org.apache.poi.util.NotImplemented; import org.apache.poi.xssf.usermodel.XSSFRichTextString; /** * Wrapper class around String so that we can use it in Comment. * Nothing has been implemented yet except for {@link #getString()}. * * @since 3.16-beta3 */ @Internal class XSSFBRichTextString extends XSSFRichTextString { private final String string; XSSFBRichTextString(String string) { this.string = string; } @Override @NotImplemented public void applyFont(int startIndex, int endIndex, short fontIndex) { } @Override @NotImplemented public void applyFont(int startIndex, int endIndex, Font font) { } @Override @NotImplemented public void applyFont(Font font) { } @Override @NotImplemented public void clearFormatting() { } @Override public String getString() { return string; } @Override public int length() { return string.length(); } @Override @NotImplemented public int numFormattingRuns() { return 0; } @Override @NotImplemented public int getIndexOfFormattingRun(int index) { return 0; } @Override @NotImplemented public void applyFont(short fontIndex) { } }
dadf161e366646a3819f47ef1d6114781f3cb2f7
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/platform/bootstrap/gensrc/de/hybris/platform/promotionengineservices/promotionengine/report/data/PromotionEngineResults.java
9015773e9e260becf23d9e979735108b11e49da4
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
2,500
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! * --- Generated at Jan 17, 2020 11:49:29 AM * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.promotionengineservices.promotionengine.report.data; import java.io.Serializable; import de.hybris.platform.promotionengineservices.promotionengine.report.data.OrderEntryLevelPromotionEngineResults; import de.hybris.platform.promotionengineservices.promotionengine.report.data.OrderLevelPromotionEngineResults; import java.util.List; public class PromotionEngineResults implements Serializable { /** Default serialVersionUID value. */ private static final long serialVersionUID = 1L; /** <i>Generated property</i> for <code>PromotionEngineResults.orderLevelPromotionEngineResults</code> property defined at extension <code>promotionengineservices</code>. */ private OrderLevelPromotionEngineResults orderLevelPromotionEngineResults; /** <i>Generated property</i> for <code>PromotionEngineResults.orderEntryLevelPromotionEngineResults</code> property defined at extension <code>promotionengineservices</code>. */ private List<OrderEntryLevelPromotionEngineResults> orderEntryLevelPromotionEngineResults; public PromotionEngineResults() { // default constructor } public void setOrderLevelPromotionEngineResults(final OrderLevelPromotionEngineResults orderLevelPromotionEngineResults) { this.orderLevelPromotionEngineResults = orderLevelPromotionEngineResults; } public OrderLevelPromotionEngineResults getOrderLevelPromotionEngineResults() { return orderLevelPromotionEngineResults; } public void setOrderEntryLevelPromotionEngineResults(final List<OrderEntryLevelPromotionEngineResults> orderEntryLevelPromotionEngineResults) { this.orderEntryLevelPromotionEngineResults = orderEntryLevelPromotionEngineResults; } public List<OrderEntryLevelPromotionEngineResults> getOrderEntryLevelPromotionEngineResults() { return orderEntryLevelPromotionEngineResults; } }
5ba4f7d6bf88c3769d312491d8bba5816409a0c6
e10a273a5e3f80a5c1d7c5e1748e7fe989c016d6
/commons/src/androidTest/java/com/example/commons/ExampleInstrumentedTest.java
2817c33ad49faeacc945e9531144ebe19007215b
[]
no_license
summerho/AudioPlayDemo
39b3ac292234db69f44ef5c4537041c6d836d8a1
8b1b10637fc9c7f6382d90674dadff9ecc3ab6fc
refs/heads/master
2023-06-10T20:50:08.939153
2021-07-07T03:25:24
2021-07-07T03:25:24
378,097,777
0
0
null
null
null
null
UTF-8
Java
false
false
757
java
package com.example.commons; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.commons.test", appContext.getPackageName()); } }
8259c282cf55e0706744ea458b28a506c37d7611
d6b78b0eefdc1b77b8b9bc7d6a2b54687e9a537f
/ServerAlone - Copy/src/DateDelete.java
27415aa7ff6efd0974d480c9572b4be59a048cc8
[]
no_license
SaemHasan/Online-Ticket-Reservation-System
6e20628ffbba1b903442e06051be813381c421b7
6c41c7ce0cf7eec2965d320be8e7082d1f6ccd6b
refs/heads/master
2022-07-28T16:09:03.963666
2020-05-19T15:13:05
2020-05-19T15:13:05
265,281,324
0
0
null
null
null
null
UTF-8
Java
false
false
2,499
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; public class DateDelete { BufferedReader inFromClient; PrintWriter outToClient; String movieID; public DateDelete(String movieID) { this.movieID = movieID; } public void dataToClient(Socket s) throws SQLException, IOException { Socket connectionSocket = s; inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); outToClient = new PrintWriter(connectionSocket.getOutputStream(), true); ConnectionClass connectionClass = new ConnectionClass(); Connection connection = connectionClass.getConnection(); Statement statement = connection.createStatement(); String query = "SELECT * FROM movies where MOVIE_ID='"+movieID+"'"; ResultSet resultSet = statement.executeQuery(query); LocalDate start=null; LocalDate end=null; List<LocalDate> dates = new ArrayList<>(); if(resultSet.next()){ start = LocalDate.parse(resultSet.getString("START_DATE")); end = LocalDate.parse(resultSet.getString("END_DATE")); } while (!start.equals(end)) { dates.add(start); start = start.plusDays(1); } dates.add(start); for(LocalDate localDate:dates){ try { connectionClass = new ConnectionClass(); connection = connectionClass.getConnection(); statement = connection.createStatement(); query = "SELECT * FROM calendar";; ResultSet result = statement.executeQuery(query); while (result.next()){ if (String.valueOf(localDate).equals(String.valueOf(result.getDate(1)))) { query="UPDATE calendar SET NUM_OF_MOVIES='"+(result.getInt(2)-1)+"' where DATES='"+result.getDate(1)+"'"; statement=connection.createStatement(); statement.executeUpdate(query); break; } } } catch (SQLException e) { e.printStackTrace(); } } } }
b8541d1670a68d28a777059e5b45f4724928ec79
92447c7f8d23b4e7e78468c2ef332b19e50b9249
/app/src/main/java/com/tarena/cartoonlivehybrid/activity/RegisterActivity.java
72f8236bcf8d17aad91f2a695aeab1ad9c1a8563
[]
no_license
mimidouhaitun/CartoonLiveHybrid
1ddbdfb55856c629f6be91d7b49988f05a8c9c01
07f4cd976b6adaa34d236ca92ecab1a672785d7b
refs/heads/master
2020-06-27T16:19:54.476121
2019-08-01T07:00:16
2019-08-01T07:00:16
199,995,673
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package com.tarena.cartoonlivehybrid.activity; import android.app.Activity; import com.tarena.cartoonlivehybrid.R; import org.androidannotations.annotations.EActivity; /** * Created by pjy on 2017/7/25. */ @EActivity(R.layout.activity_register) public class RegisterActivity extends Activity { }
de84988d2f15b6c74f7b90ffa2c54024ffcf739d
b36ca160b7668fe800048065feda56cbadac3761
/auth-integration/src/main/java/com/microservices/apigateway/security/route/internal/MetricsInternalRoute.java
c393167b48fefebb607f7b608c4356f4590bf74e
[]
no_license
meelement/microservices-security
f8d9ecfddb552301f368610076179acc4d86fff9
62ee113faa163eab685c396f7c0299fd8bf631d4
refs/heads/master
2023-08-12T16:32:01.791166
2021-10-18T18:26:06
2021-10-18T18:26:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,632
java
package com.microservices.apigateway.security.route.internal; import com.microservices.apigateway.security.configuration.MetricsConfiguration; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.http.MediaType; @Component("MetricsInternalRoute") public class MetricsInternalRoute extends RouteBuilder { static final Logger logger = LoggerFactory.getLogger(MetricsInternalRoute.class); @Autowired private MetricsConfiguration metricsConfig; @Override public void configure() throws Exception { // /--------------------------------------------------\ // | Internal route definition | // | Actuator Endpoints (health, metrics, etc.) | // \--------------------------------------------------/ from("direct:internal-integration-health") .id("direct-integration-health") .to("log:list?showHeaders=true&level=DEBUG") .removeHeader("origin") .removeHeader(Exchange.HTTP_PATH) .setHeader(Exchange.CONTENT_TYPE, constant(MediaType.APPLICATION_JSON)) .removeHeader("breadcrumbId") .to("http4://" + metricsConfig.getHost() + ":" + metricsConfig.getPort() + "/" + metricsConfig.getContextPath() + "?connectTimeout=500&bridgeEndpoint=true&copyHeaders=true&connectionClose=true&type=metrics") .end(); } }
f45eb3db24ca050f79243efa43af6bb70384b8af
b0d08ac1d06adb7d0a007b9d8865a7e59c31024b
/tour-manage/tour-manage-pojo/src/main/java/com/songyang/tour/pojo/SyFolk.java
37f94d95fa87e36e108e050a6bd49d47448dc388
[]
no_license
maogu1131/tour
48a0685d8cdb6ebd9e606cfc10cdd535f7ec505b
b3e314ec6da21ba08278d258aa0e4ba44e3e251f
refs/heads/master
2021-09-08T10:50:48.537663
2018-03-09T10:07:03
2018-03-09T10:07:03
124,409,573
0
0
null
null
null
null
UTF-8
Java
false
false
7,449
java
package com.songyang.tour.pojo; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * sy_folk 实体类 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ public class SyFolk implements Serializable { private static final long serialVersionUID = 1L; /** * 数据库字段长度:20 * 字段备注:主键 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Long id; /** * 数据库字段长度:64 * 字段备注:名称 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String title; /** * 热度:1-不热,2-热 * @see com.songyang.tour.constants.TourConstants.HOT */ private Integer hot; /** * 数据库字段长度:64 * 字段备注:地址描述 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String address; /** * 数据库字段长度:22 * 字段备注:经度 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private BigDecimal longitude; /** * 数据库字段长度:22 * 字段备注:纬度 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private BigDecimal latitude; /** * 数据库字段长度:19 * 字段备注:开始时间 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Date startTime; /** * 数据库字段长度:19 * 字段备注:结束时间 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Date endTime; /** * 数据库字段长度:1 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Integer status; /** * 数据库字段长度:11 * 字段备注:预定电话 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String phone; /** * 数据库字段长度:64 * 字段备注:活动描述 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String desc; /** * 字段备注:活动图片地址,以逗号分隔 */ private String bannerUrl; /** * 临时字段 不配置XML 只做页面展示用 */ private List<String> bannerUrlList; // url 列表 编辑图片是使用 不用配置XML private String bannerUrlListStr; /** * 数据库字段长度:256 * 字段备注:活动详情图片地址,以逗号分隔 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String picUrl; /** * 临时字段 不配置XML 只做页面展示用 */ private List<String> picUrlList; // url 列表 编辑图片是使用 不用配置XML private String picUrlListStr; /** * 数据库字段长度:256 * 字段备注:收费描述 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String chargeDesc; /** * 数据库字段长度:256 * 字段备注:特色描述 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String specialDesc; /** * 数据库字段长度:256 * 字段备注:特色文化图片地址,以逗号分隔 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String specialPicUrl; /** * 临时字段 不配置XML 只做页面展示用 */ private List<String> specialPicUrlList; // url 列表 编辑图片是使用 不用配置XML private String specialPicUrlListStr; /** * 数据库字段长度:128 * 字段备注:活动游玩提示 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String playTips; /** * 数据库字段长度:64 * 字段备注:创建者 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String creator; /** * 数据库字段长度:19 * 字段备注:创建时间 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Date createTime; /** * 数据库字段长度:64 * 字段备注:修改者 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private String modifier; /** * 数据库字段长度:19 * 字段备注:修改时间 * Sun Sep 03 16:51:08 CST 2017 AutoGenerate */ private Date modifyTime; public String getBannerUrl() { return bannerUrl; } public void setBannerUrl(String bannerUrl) { this.bannerUrl = bannerUrl; } public List<String> getBannerUrlList() { return bannerUrlList; } public void setBannerUrlList(List<String> bannerUrlList) { this.bannerUrlList = bannerUrlList; } public String getBannerUrlListStr() { return bannerUrlListStr; } public void setBannerUrlListStr(String bannerUrlListStr) { this.bannerUrlListStr = bannerUrlListStr; } public void setPicUrlListStr(String picUrlListStr) { this.picUrlListStr = picUrlListStr; } public void setSpecialPicUrlListStr(String specialPicUrlListStr) { this.specialPicUrlListStr = specialPicUrlListStr; } public SyFolk(){ } public void setId(Long id){ this.id = id; } public Long getId(){ return id; } public void setTitle(String title){ this.title = title; } public String getTitle(){ return title; } public void setAddress(String address){ this.address = address; } public String getAddress(){ return address; } public void setLongitude(BigDecimal longitude){ this.longitude = longitude; } public BigDecimal getLongitude(){ return longitude; } public void setLatitude(BigDecimal latitude){ this.latitude = latitude; } public BigDecimal getLatitude(){ return latitude; } public void setStartTime(Date startTime){ this.startTime = startTime; } public Date getStartTime(){ return startTime; } public void setEndTime(Date endTime){ this.endTime = endTime; } public Date getEndTime(){ return endTime; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public void setDesc(String desc){ this.desc = desc; } public String getDesc(){ return desc; } public void setPicUrl(String picUrl){ this.picUrl = picUrl; } public String getPicUrl(){ return picUrl; } public void setChargeDesc(String chargeDesc){ this.chargeDesc = chargeDesc; } public String getChargeDesc(){ return chargeDesc; } public void setSpecialDesc(String specialDesc){ this.specialDesc = specialDesc; } public String getSpecialDesc(){ return specialDesc; } public void setSpecialPicUrl(String specialPicUrl){ this.specialPicUrl = specialPicUrl; } public String getSpecialPicUrl(){ return specialPicUrl; } public void setPlayTips(String playTips){ this.playTips = playTips; } public String getPlayTips(){ return playTips; } public void setCreator(String creator){ this.creator = creator; } public String getCreator(){ return creator; } public void setCreateTime(Date createTime){ this.createTime = createTime; } public Date getCreateTime(){ return createTime; } public void setModifier(String modifier){ this.modifier = modifier; } public String getModifier(){ return modifier; } public void setModifyTime(Date modifyTime){ this.modifyTime = modifyTime; } public Date getModifyTime(){ return modifyTime; } public List<String> getPicUrlList() { return picUrlList; } public void setPicUrlList(List<String> picUrlList) { this.picUrlList = picUrlList; } public List<String> getSpecialPicUrlList() { return specialPicUrlList; } public void setSpecialPicUrlList(List<String> specialPicUrlList) { this.specialPicUrlList = specialPicUrlList; } public Integer getHot() { return hot; } public void setHot(Integer hot) { this.hot = hot; } public String getPicUrlListStr() { return picUrlListStr; } public String getSpecialPicUrlListStr() { return specialPicUrlListStr; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } }
0da9550974e060134dbeec8fced047ca3e2dda8a
7b13ae51d28fcd8f28917756d96425baf227aeb4
/modules/metadata/common/src/main/java/org/youi/metadata/common/MetaItemDataType.java
5b2f3663e734d1debda75746963cd212840f8ee1
[]
no_license
zhyi12/youi-product
ee38b95a39bf3436fbf257e16dd992fe488336bf
1cc6ccee3b6c341024a94c04db0bd440264aa71d
refs/heads/master
2022-12-20T14:04:31.613283
2020-07-31T02:50:38
2020-07-31T02:50:38
203,384,105
2
3
null
2022-12-15T23:38:49
2019-08-20T13:39:39
Java
UTF-8
Java
false
false
1,317
java
/* * Copyright 2018-2024 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.youi.metadata.common; public enum MetaItemDataType { integer("int","整数"), bigint("bigint","长整数"), number("number","数值"), date("date","日期"), string("string","文本"); private String key; private String text; MetaItemDataType(String key, String text){ this.key = key; this.text = text; } public String getKey() { return key; } public MetaItemDataType setKey(String key) { this.key = key; return this; } public String getText() { return text; } public MetaItemDataType setText(String text) { this.text = text; return this; } }
92d77b642f5c1eace879781a27e1d3774d3964d0
0be0309c177e515d5c3841c65560711ba5d28db9
/src/main/java/app/Main.java
6abb41472981219b4148fc3c74f9ba075d9cda5b
[]
no_license
kamilcieslik/office_contact_application_with_google_maps
d26e635e0c44a3c371bc76205a3a7a997b8269f6
5db3c1826f15d6d90a90698af74382f62c1f4439
refs/heads/master
2021-09-07T10:43:34.678837
2018-02-21T18:05:30
2018-02-21T18:05:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,485
java
package app; import javafx.controller.MainFrameController; import database.entity.Address; import database.entity.Contact; import database.entity.Province; import database.entity.Trade; import database.service.OfficeService; import database.view.ViewExtendedContact; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.exception.GenericJDBCException; import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import java.util.prefs.Preferences; public class Main extends Application { private static Stage mainStage; private SessionFactory sessionFactory; private Preferences pref; public static Stage getMainStage() { return mainStage; } private static void setupLog4J() { System.setProperty("log4j.configuration", new File(".", File.separatorChar + "src/main/resources/log4j_config/log4j.properties").toURI().toString()); } private void initSessionFactory() { try { sessionFactory = new Configuration() .configure() .addAnnotatedClass(Address.class) .addAnnotatedClass(Contact.class) .addAnnotatedClass(Province.class) .addAnnotatedClass(Trade.class) .addAnnotatedClass(ViewExtendedContact.class) .buildSessionFactory(); } catch (GenericJDBCException e) { System.out.println("Błąd połączenia z bazą danych.\nPowód: " + e.getCause().getMessage()); System.exit(0); } } @Override public void start(Stage primaryStage) { Boolean sceneWasLoadedSuccessfully = true; setupLog4J(); initSessionFactory(); OfficeService officeService = new OfficeService(sessionFactory); pref = Preferences.userRoot(); FXMLLoader loader = new FXMLLoader(); try { Main.mainStage = primaryStage; loader.setLocation(getClass().getResource("../fxml/MainFrame.fxml")); loader.load(); } catch (IOException ioEcx) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ioEcx); sceneWasLoadedSuccessfully = false; } if (sceneWasLoadedSuccessfully) { Parent root = loader.getRoot(); primaryStage.setTitle("Inter Art - Kontakty"); primaryStage.getIcons().add(new Image("/image/icon.png")); primaryStage.setMinWidth(970); primaryStage.setMinHeight(890); primaryStage.setScene(new Scene(root, pref.getDouble("scene_width", 1600), pref.getDouble("scene_height", 900))); MainFrameController display = loader.getController(); display.setFrameObjects(officeService); primaryStage.show(); } } @Override public void stop() { sessionFactory.close(); pref = Preferences.userRoot(); pref.putDouble("scene_width", getMainStage().getWidth() - 16.0); pref.putDouble("scene_height", getMainStage().getHeight() - 42.5); System.exit(0); } public static void main(String[] args) { launch(args); } }
a7f6c620d245d830057897ea5a767b6ef9aef126
7d5691687676b900553628f9287b7cb9094dac9a
/android/src/com/mapswithme/maps/scheduling/ConnectivityListener.java
a9450e017156c4f58520e12ffc44bf8428865309
[ "Apache-2.0" ]
permissive
mapsme/omim
bf3ea4f419a547b7c124107e344d7f565d707c12
1892903b63f2c85b16ed4966d21fe76aba06b9ba
refs/heads/master
2023-02-20T16:31:08.733960
2021-04-27T13:57:41
2021-04-28T14:44:52
42,798,033
5,032
1,527
Apache-2.0
2022-10-03T08:28:24
2015-09-20T02:57:13
C++
UTF-8
Java
false
false
100
java
package com.mapswithme.maps.scheduling; public interface ConnectivityListener { void listen(); }
c4a49766b6ac7499bbc3cd1ed40e4e0cb0f704c0
57e4d7ee5ed61538ab5139505226bd1b52f1a122
/websocket-spring-reactive/src/main/java/me/silloy/study/websocket/netty/config/ReactiveJavaClientWebSocket.java
666eb34cf7db36cc7a9b11a5e9be611fcbb90089
[]
no_license
silloy/rookie
e9bda43b3de5daf5674511748387f026250b2354
fc448f0d2293e92a67aad3778efb025830e1c954
refs/heads/main
2023-03-08T20:46:23.567851
2023-03-06T08:05:40
2023-03-06T08:05:40
304,278,168
0
2
null
null
null
null
UTF-8
Java
false
false
941
java
package me.silloy.study.websocket.netty.config; import java.net.URI; import java.time.Duration; import org.springframework.web.reactive.socket.WebSocketMessage; import org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient; import org.springframework.web.reactive.socket.client.WebSocketClient; import reactor.core.publisher.Mono; public class ReactiveJavaClientWebSocket { public static void main(String[] args) throws InterruptedException { WebSocketClient client = new ReactorNettyWebSocketClient(); client.execute( URI.create("ws://127.0.0.1:8080/event-emitter"), session -> session.send( Mono.just(session.textMessage("event-spring-reactive-client-websocket"))) .thenMany(session.receive() .map(WebSocketMessage::getPayloadAsText) .log()) .then()) .block(Duration.ofSeconds(10L)) ; } }
a9b3793f4e2b13680deb49f96b981d990b90ebb4
c503eb571de7d57d17ed535ee34f9026e755af53
/TrinomialBrute.java
18c7b231415b9775003807013aedc93f281e6ad6
[]
no_license
Jasonzyy9/Java
a7f31a4c502fb5660234f930bb4f62255b7fa363
96799ecd396ff1b063fa5acbcf8036c22dababe3
refs/heads/master
2020-12-27T09:43:26.778609
2020-02-13T06:19:14
2020-02-13T06:19:14
237,855,638
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
/* ***************************************************************************** * Name: Alan Turing * Coursera User ID: 123456 * Last modified: 1/1/2019 **************************************************************************** */ public class TrinomialBrute { // Returns the trinomial coefficient T(n, k). public static long trinomial(int n, int k) { if (n == 0 && k == 0) { return 1; } else if ((k < (-1 * n)) || (k > n)) { return 0; } else { return trinomial(n - 1, k - 1) + trinomial(n - 1, k) + trinomial(n - 1, k + 1); } } // Takes two integer command-line arguments n and k and prints T(n, k). public static void main(String[] args) { int n = Integer.parseInt(args[0]); int k = Integer.parseInt(args[1]); System.out.println(trinomial(n, k)); } }
94bdf37e3c011d97df9a0928ad3565ad67bd2636
f4d09c0998873e7b0f7c2a2138f70f72e1cca0fe
/app/docksidestage/dbflute/exbhv/MemberFollowingBhv.java
0024c82f725edb21d40553763913197d25964af5
[ "Apache-2.0" ]
permissive
dbflute-example/dbflute-example-on-play2java
aec77bff569418a8e51dc52ad02eec68b218d03a
85f39e9cbc0d7b9dcd620f5f373909df93edf607
refs/heads/master
2022-06-15T07:09:42.916040
2022-05-14T06:33:18
2022-05-14T06:33:18
27,213,603
2
0
null
2015-09-08T06:23:03
2014-11-27T07:16:37
Java
UTF-8
Java
false
false
966
java
/* * Copyright 2014-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package docksidestage.dbflute.exbhv; import docksidestage.dbflute.bsbhv.BsMemberFollowingBhv; /** * The behavior of MEMBER_FOLLOWING. * <p> * You can implement your original methods here. * This class remains when re-generating. * </p> * @author DBFlute(AutoGenerator) */ public class MemberFollowingBhv extends BsMemberFollowingBhv { }
488162e756f0c9ebada6d8e28cb00757d23d6bbd
bb3e390a97e604604a3d5712ab9eeb60f166ba31
/src/main/java/ZestMoney/Utility/globalVar.java
cbe2b17d1edb56618c9c2d8ea759203038101421
[]
no_license
jyotivicky/ZestMoney
7feaffb1ae1a795d61d2a65d220c02cba41d0c53
0b2fba184c736f5bc11e3c5dcf45081ecddd6266
refs/heads/master
2023-05-04T15:08:54.791938
2020-03-17T10:57:09
2020-03-17T10:57:09
247,938,586
0
0
null
2023-04-14T17:09:32
2020-03-17T10:16:31
HTML
UTF-8
Java
false
false
1,541
java
package ZestMoney.Utility; //To Store Variable Which Are Constant import java.io.File; import org.apache.log4j.Logger; import org.openqa.selenium.WebDriver; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.reporter.ExtentHtmlReporter; public class globalVar{ /* * wait variables */ public static final int Wait_1000 = 1000; public static final int Wait_2000 = 2000; public static final int Wait_3000 = 3000; public static final int Implictly_Wait = 120; public static final int Explicitly_Wait120 = 120; public static final int Explicitly_Wait240 = 240; /* * these variables are extent report file location */ public static final String SystemExtentReportPath = "ZestReport\\zest.html"; /* * variables for properties file path */ public final static String SystemConfigPath = "Config_File\\Config.properties"; /* * these variables to generate report */ public static Logger log; public static ExtentHtmlReporter htmlreporter; public static ExtentReports extent; public static ExtentTest test; /* * these variables to create a file download folder */ public static File downloadfiles = new File("FileDownload"); public static String downloadFilepath = downloadfiles.getAbsolutePath(); /* * these variables are for the data read from the properties file to read data * like username, password,url */ public static ReadConfig config = new ReadConfig(); public globalVar() { } }
e59afab792d655dc183591ed86c9ed5022ca279a
9f3fb735b67bf2734c301cadf88f844a74b2f41c
/tensquare_base/src/test/java/leetCode/Solution4.java
b6c392a05d1c621d22119d83682359c0150e308b
[]
no_license
CXLYJ/tensquare_parent
a682ee3fddcac2a9b5983fcccefc4ffcf8f03bab
d8760820d5a66414b1df50362d86ab58a12479bb
refs/heads/master
2022-06-24T19:40:15.488773
2020-11-19T07:07:02
2020-11-19T07:07:02
180,058,563
2
3
null
2022-06-17T02:10:14
2019-04-08T02:57:53
Java
UTF-8
Java
false
false
1,388
java
package leetCode; /** * @author :lyj * @email: : [email protected] * @date :2019/5/13 11:22 * * LeetCode-大于给定元素的最小元素 */ public class Solution4 { /** * 题目描述 * * 题目描述:给定一个有序的字符数组 letters 和一个字符 target, * 要求找出 letters 中大于 target 的最小字符,如果找不到就返回第 1 个字符。 * * Input: letters = ["c", "f", "j"] target = "d" Output: "f" Input: letters = ["c", "f", "j"] target = "k" Output: "c" */ /** * 思路 * * 给定数组是有序的,给定一个key值。每次查找最中间的值,如果相等,就返回对应下标,如果key大于最中间的值, * 则在数组的右半边继续查找,如果小于,则在数组左半边查找,最终有两种结果,一种是找到并返回下标,第二种是没找到 * @param letters * @param target * @return */ public char nextGreatestLetter(char[] letters, char target){ int n = letters.length; int l = 0, h = n - 1; while (l <= h){ int m = l + (h - 1) / 2; if (target >= letters[m]){ l = m + 1; } else { h = m - 1; } } return 1 < n ? letters[l] : letters[0]; } }
a2f2c8bf0550d56656f72a4d831509399bbad830
e03effd75d0086ce248066b6139c894d53bc343f
/ns-main-service/src/main/java/com/acrocontext/reactive/services/BeanValidatorService.java
7f482fbbc124aab72c70e7f10a86a0d3bf4badc5
[ "Apache-2.0" ]
permissive
nsclass/ns-svg-converter
6415153a475c372263fe888f264d801540eb6d0d
dc0648d57ea9a29b7abf776299e855d37e83d138
refs/heads/master
2023-07-23T02:35:10.352685
2023-07-18T21:08:44
2023-07-18T21:08:44
158,753,855
8
0
Apache-2.0
2023-07-18T21:08:46
2018-11-22T22:02:08
Java
UTF-8
Java
false
false
1,266
java
/* * Copyright 2017-2023, Nam Seob Seo * * 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.acrocontext.reactive.services; import com.acrocontext.common.utils.SimpleValidation; import com.acrocontext.exceptions.BeanValidationException; import jakarta.validation.Validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * Date 12/5/17 * * @author Nam Seob Seo */ @Service public class BeanValidatorService { private final Validator validator; @Autowired public BeanValidatorService(Validator validator) { this.validator = validator; } public <T> BeanValidationException validate(T object) { return SimpleValidation.validate(validator, object); } }
9dc0ab163f85b367c0b910f4905bf45191bd88c5
e018d2574abffdf86bff81fe04d6cf63c5ed4a0a
/hibernate-sharding/src/main/java/com/javastorm/hibernatesharding/entity/User.java
d2e52587ec91df254f8c64113ef6da916ddfe3fb
[]
no_license
hemant-kumar/javastorm
f93d27792291b3e1c43defca4319b6bb122db0e6
b7fb8801d62a94ba65319f3d5cc1e028b33945fc
refs/heads/master
2021-01-10T11:38:24.590147
2017-06-14T08:00:12
2017-06-14T08:00:12
8,462,311
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package com.javastorm.hibernatesharding.entity; import java.util.UUID; /** * This POJO class is intended for holding User Information. * * @author Hemant Kumar * @version 1.0 Dated: 18/03/2013 */ public class User extends HibernateEntity { private static final long serialVersionUID = 10296L; protected UUID userid_; protected String name_; protected String gender_; protected String country_; public UUID getUserid() { return userid_; } public void setUserid(UUID userid) { this.userid_ = userid; } public String getName() { return name_; } public void setName(String name) { this.name_ = name; } public String getGender() { return gender_; } public void setGender(String gender) { this.gender_ = gender; } public String getCountry() { return country_; } public void setCountry(String country) { this.country_ = country; } @Override public Integer getShard() { if(country_.equalsIgnoreCase("India")) { return 1; } return 2; } }
e5c19dfa8752eab6510adf1425898d10d592b7b7
c30256b25e2694b3b85104162e47f7495abaa3b2
/demo/src/main/java/com/liang530/demo/MainActivity.java
80ddda0e28ed0737c005376cd75e14c8396d23f8
[]
no_license
liang530/OkVolley
a3488a56d7929c437fbcfc02ea86653e3fa42008
adb17cd5ad1515fb0c439f9795665919b0539d80
refs/heads/master
2021-01-11T00:03:20.966926
2016-11-23T05:51:16
2016-11-23T05:51:16
70,764,350
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.liang530.demo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
89c1a94dc6fc3046246d3f6950577056ac1bd007
4d02db6d2c97e058a8cce28dd1d0b7e977e78168
/56/src/Application.java
247f49644d5d4fb3dd4f43fbe023166fd0865d94
[]
no_license
Sogeki-hei/ProgrammingByDoing
ca0d066cfe41c6c7a0b3403f193330dc716ddce4
30f49b3225161b9b2f093828c97681278ded3c5d
refs/heads/master
2021-01-17T09:39:35.502475
2015-03-20T03:51:13
2015-03-20T03:51:13
32,560,652
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
// Haruka Kasugano 11/3/2015 import java.util.Scanner; public class Application { public static void main(String[] args) { double nbr, sr; Scanner keyboard = new Scanner(System.in); System.out.println("SQUARE ROOT!"); System.out.println("Enter a number: "); nbr = keyboard.nextDouble(); while ( nbr < 0) { System.out.println("You can't take the square root of a negative number, silly."); System.out.println("Try again: "); nbr = keyboard.nextDouble(); } sr = Math.sqrt(nbr); System.out.println("The square root of " + nbr + " is " + sr + "."); } }
5750bec88a0e9962ae60aa023d78d1a66c69c52d
665110e99befea67ea7dcdd6939e313cff471654
/src/main/java/net/smert/frameworkgl/collision/narrowphase/algorithm/NarrowphaseAlgorithm.java
3599116128dc1c66fd6b317069b3400161705f30
[ "Apache-2.0" ]
permissive
kovertopz/Framework-GL
187cd6771c5ed0192da3564a22c6281956bb2ce2
1504f4746c80bf0667f62ecea2569f8d37a46184
refs/heads/master
2021-06-07T08:22:46.693230
2017-07-08T09:10:17
2017-07-08T09:10:17
24,876,706
10
1
null
null
null
null
UTF-8
Java
false
false
1,046
java
/** * Copyright 2012 Jason Sorensen ([email protected]) * * 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 net.smert.frameworkgl.collision.narrowphase.algorithm; import net.smert.frameworkgl.collision.CollisionGameObject; import net.smert.frameworkgl.collision.narrowphase.ContactData; /** * * @author Jason Sorensen <[email protected]> */ public interface NarrowphaseAlgorithm { public int processCollision(CollisionGameObject collisionObject0, CollisionGameObject collisionObject1, ContactData contactData); }
2c61ab701bae1684f3a247b55c06b5ed810a484a
5cc0b8ca4aacbc18cd7b9885a9b18761be28a275
/src/test/java/com/example/apiassignment/SmokeTest.java
c7285a28400d1c9e149830e6e68488660339bc8e
[ "CC0-1.0" ]
permissive
bg-gaggle-example/api-assignment
c411ee4a567b487a6784e6cdce68d2ed695c8356
7c4210415433cd2a601ef8a73bbe67a89dbf3a4b
refs/heads/main
2023-03-26T02:25:56.535629
2021-03-14T19:50:27
2021-03-14T19:50:27
346,407,175
0
0
CC0-1.0
2021-03-14T16:23:17
2021-03-10T15:46:10
Java
UTF-8
Java
false
false
447
java
package com.example.apiassignment; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest public class SmokeTest { @Autowired private WelcomeController controller; @Test public void contextLoads() throws Exception { assertThat(controller).isNotNull(); } }
b9aa7f333b5180204bbd90f1b5041501c4301a0d
5bcc7ba7ffa8b03720ed54a12c661c9cfd4e751d
/zkclient/src/main/java/edu/uw/zookeeper/protocol/client/OperationClientExecutor.java
ddb21b4ef2808004ee82023d10ec9f8803e9618c
[ "Apache-2.0" ]
permissive
lisaglendenning/zookeeper-lite
2b1165038272a4b86d96674967df8c00247069cc
2a9679ddb196b3f65d687d67d7ef534e162fe6d9
refs/heads/master
2020-05-17T12:13:13.230458
2015-07-02T21:53:50
2015-07-02T21:53:50
9,090,323
10
1
null
null
null
null
UTF-8
Java
false
false
5,390
java
package edu.uw.zookeeper.protocol.client; import java.lang.ref.SoftReference; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledExecutorService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import edu.uw.zookeeper.common.LoggingFutureListener; import edu.uw.zookeeper.common.Promise; import edu.uw.zookeeper.common.SettableFuturePromise; import edu.uw.zookeeper.common.TimeValue; import edu.uw.zookeeper.protocol.Message; import edu.uw.zookeeper.protocol.ConnectMessage; import edu.uw.zookeeper.protocol.Operation; import edu.uw.zookeeper.protocol.ProtocolConnection; public class OperationClientExecutor<C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> extends PendingQueueClientExecutor<Operation.Request, Message.ServerResponse<?>, PendingQueueClientExecutor.RequestTask<Operation.Request, Message.ServerResponse<?>>, C, PendingQueueClientExecutor.PendingPromiseTask> { public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ConnectMessage.Request request, C connection, ScheduledExecutorService executor) { return newInstance( request, AssignXidProcessor.newInstance(), connection, executor); } public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ConnectMessage.Request request, AssignXidProcessor xids, C connection, ScheduledExecutorService executor) { return newInstance( ConnectTask.connect(request, connection), xids, connection, TimeValue.milliseconds(request.getTimeOut()), executor); } public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ListenableFuture<ConnectMessage.Response> session, AssignXidProcessor xids, C connection, TimeValue timeOut, ScheduledExecutorService executor) { return new OperationClientExecutor<C>( xids, LogManager.getLogger(OperationClientExecutor.class), session, connection, timeOut, executor); } protected final OperationActor actor; protected final AssignXidProcessor xids; protected OperationClientExecutor( AssignXidProcessor xids, Logger logger, ListenableFuture<ConnectMessage.Response> session, C connection, TimeValue timeOut, ScheduledExecutorService scheduler) { super(logger, session, connection, timeOut, scheduler); this.xids = xids; this.actor = new OperationActor(logger); } @Override public ListenableFuture<Message.ServerResponse<?>> submit( Operation.Request request, Promise<Message.ServerResponse<?>> promise) { RequestTask<Operation.Request, Message.ServerResponse<?>> task = RequestTask.of(request, promise); LoggingFutureListener.listen(logger(), task); if (! send(task)) { task.cancel(true); } return Futures.nonCancellationPropagating(task); } @Override public void onSuccess(PendingPromiseTask result) { try { Message.ServerResponse<?> response = result.get(); result.getPromise().set(response); } catch (ExecutionException e) { result.getPromise().setException(e.getCause()); onFailure(e.getCause()); } catch (CancellationException e) { result.getPromise().cancel(true); } catch (InterruptedException e) { throw new AssertionError(e); } } @Override protected OperationActor actor() { return actor; } @Override protected Logger logger() { return actor.logger(); } protected class OperationActor extends ForwardingActor { protected OperationActor( Logger logger) { super(connection, logger); } @Override protected boolean apply(RequestTask<Operation.Request, Message.ServerResponse<?>> input) { if (! input.isDone()) { // Assign xids here so we can properly track message request -> response Message.ClientRequest<?> message = (Message.ClientRequest<?>) xids.apply(input.task()); PendingPromiseTask task = PendingPromiseTask.create( input.promise(), new SoftReference<Message.ClientRequest<?>>(message), SettableFuturePromise.<Message.ServerResponse<?>>create()); if (! pending.send(task)) { input.cancel(true); } } return true; } } }
89d9394ec1804907e471eace201507b044ade4c3
3c747bd03525c4899cf3eb13eb9d5d5cdf2b1882
/PruebaIf.java
92a0ab62d07c68d61f7d12f569c0044926420c7e
[ "CC0-1.0" ]
permissive
RachellCasanova/programacion2-20
ba2c15c1ca98586c65d760f26c53ffeb2f2f6e18
ad39975d7298f0841b0001e0f5c4616402d46f55
refs/heads/master
2022-12-23T01:10:49.059030
2020-09-18T14:48:13
2020-09-18T14:48:13
297,527,695
1
0
null
2020-09-22T03:44:27
2020-09-22T03:44:26
null
UTF-8
Java
false
false
349
java
public class PruebaIf{ public static void main (String[] args){ double nota = 60; if (nota >= 67.5){ System.out.println("El estudiante pasa el curso"); } else{ if (nota >= 57.5 && nota < 67.5){ System.out.println("El estudiante va a ampliación"); } else{ System.out.println("El estudiante reprueba"); } } } }
90cf911448eb8bc85c48b7be900d251569bb7d26
ad3761479f5392e1c8ea5aafe6dfc4037e30a752
/琴琴的资料/IOLearn/src/cn/itcast/filestream/JiHeDemo.java
202a29812f835578c492bc00474c0724d9cf9b77
[]
no_license
luckysky1013/JavaSE
3fdf8b3622d225046baa07eadcd9b3eec30509fe
47a1f59ac2270dbe9564235feb18b423089decd1
refs/heads/master
2022-02-20T05:55:23.316855
2019-09-03T06:50:02
2019-09-03T06:50:02
104,970,817
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package cn.itcast.filestream; import java.io.BufferedOutputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashSet; import java.util.Random; /*使用集合存储10个1-50(含50)的随机偶数元素,要求数字不能重复, * 按指定格式输出到C盘的num.txt中,例如: 48,44,40,38,34,30,26...... */ public class JiHeDemo { public static void main(String[] args) throws IOException { Random rand = new Random(); HashSet<Integer> hs = new HashSet<Integer>(); while(hs.size()<=10){ int random = rand.nextInt(50)+1; hs.add(random); } String str = ""; int index = 0 ; for (Integer integer : hs) { if(index == hs.size()-1){ str += integer; }else{ str += integer+","; index++; } } BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("random.txt")); bos.write(str.getBytes()); bos.close(); } }
c551d4fbdb370d9bbf3b39b1e5e245396765552c
3e2fc9f02ad811bcd8598307bc148948287ea047
/app/src/androidTest/java/com/capstoneproject/capstone/ExampleInstrumentedTest.java
2ae3cece0d81c3b71c8331bcba5d5fc9e2b0a6c6
[]
no_license
moldezjosh/CapstoneProject
56579cba254b2963aa4240dc93e3b753c9c28295
a25b5da3abaffa850de31c0ebb7008d7c9e8abea
refs/heads/master
2020-04-28T03:12:23.245059
2019-05-02T13:31:22
2019-05-02T13:31:22
174,927,776
0
0
null
2019-05-02T13:31:23
2019-03-11T04:51:22
Java
UTF-8
Java
false
false
740
java
package com.capstoneproject.capstone; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.capstoneproject.capstone", appContext.getPackageName()); } }
708e93ad544f59c581140237643eda183396f81b
e0c7a976d1926b7db3d06a43bec0901e759829dd
/Module2/src/_14_thuat_toan_sap_xep_/bai_tap/tt_sx_chen/InsertionSort.java
29a83924b8857551c11e71bdaa36f2a25fd3e1b4
[]
no_license
dungsumo18993/C1020G1_NguyenVietDung
bea12d59605b6cc2b67835033f5579d0423d4b42
35a94ae8abf0f39af37db44363efe17a414f7916
refs/heads/main
2023-04-19T22:05:44.404434
2021-05-05T06:11:47
2021-05-05T06:11:47
307,287,256
0
0
null
null
null
null
UTF-8
Java
false
false
632
java
package _14_thuat_toan_sap_xep_.bai_tap.tt_sx_chen; public class InsertionSort { public static void insertionSort(double[] arr){ for (int i=1; i<arr.length; i++){ double currentElement = arr[i]; int j; for (j=i-1; j>=0 && arr[j] > currentElement; j--){ arr[j+1]=arr[j]; } arr[j+1]=currentElement; } } public static void main(String[] args) { double[] arr = {1, 9, 3.2, 6.6, 5.7, -4.5}; insertionSort(arr); for (int i=0; i<arr.length; i++){ System.out.println(arr[i]); } } }
28d6e0e93c4547a24b2a1771c8178cf532d60518
96c69d685ebc4273fa676172cd24698a86119fe2
/app/src/main/java/com/cuci/enticement/plate/mine/activity/MyTeamTwoActivity.java
6fd397bd39054cf7136b638757c955a3af3fcde1
[]
no_license
tracyly/yinshimei
e68b1079200dfa531dc65b34cd516844441c40fb
b5e030d5e3bcd55c00e4bb543371785054e50864
refs/heads/master
2022-06-20T21:36:20.351396
2020-04-13T11:05:25
2020-04-13T11:05:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,684
java
package com.cuci.enticement.plate.mine.activity; import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProviders; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.classic.common.MultipleStatusView; import com.cuci.enticement.BasicApp; import com.cuci.enticement.R; import com.cuci.enticement.base.BaseActivity; import com.cuci.enticement.bean.MyTeamlbBean; import com.cuci.enticement.bean.MyTeamslBean; import com.cuci.enticement.bean.Status; import com.cuci.enticement.bean.UserInfo; import com.cuci.enticement.plate.mine.adapter.ItemMyTeamTwoViewBinder; import com.cuci.enticement.plate.mine.vm.MineViewModel; import com.cuci.enticement.utils.AppUtils; import com.cuci.enticement.utils.FToast; import com.cuci.enticement.utils.HttpUtils; import com.cuci.enticement.utils.ImageLoader; import com.cuci.enticement.utils.SharedPrefUtils; import com.cuci.enticement.widget.BrandItemDecoration; import com.cuci.enticement.widget.ClearEditText; import com.cuci.enticement.widget.CustomRefreshHeader; import com.google.gson.Gson; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; import java.io.IOException; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; import me.drakeet.multitype.Items; import me.drakeet.multitype.MultiTypeAdapter; import okhttp3.ResponseBody; public class MyTeamTwoActivity extends BaseActivity implements OnRefreshLoadMoreListener, ItemMyTeamTwoViewBinder.OnProdClickListener { @BindView(R.id.img_back) ImageView imgBack; @BindView(R.id.text_biaoti) TextView textBiaoti; @BindView(R.id.con_toubu) ConstraintLayout conToubu; @BindView(R.id.edt_shousuo) ClearEditText edtShousuo; @BindView(R.id.recycler_view) RecyclerView recyclerView; @BindView(R.id.refresh_layout) SmartRefreshLayout refreshLayout; @BindView(R.id.status_view) MultipleStatusView statusView; @BindView(R.id.civ_tuxiang) CircleImageView civTuxiang; @BindView(R.id.text_zhongrenshu) TextView textZhongrenshu; @BindView(R.id.text_xinzengrenshu) TextView textXinzengrenshu; @BindView(R.id.text_rzengrenshu) TextView textRzengrenshu; @BindView(R.id.ll_shuzi) LinearLayout llShuzi; @BindView(R.id.text_zhongrenshu1) TextView textZhongrenshu1; @BindView(R.id.text_xinzengrenshu1) TextView textXinzengrenshu1; @BindView(R.id.text_rzengrenshu1) TextView textRzengrenshu1; @BindView(R.id.ll_wenzi) LinearLayout llWenzi; @BindView(R.id.con_zhongbu) ConstraintLayout conZhongbu; @BindView(R.id.text_name) TextView textName; private MineViewModel mViewModel; private UserInfo mUserInfo; private MultiTypeAdapter mAdapter; private Items mItems; private LinearLayoutManager mLayoutManager; private boolean mCanLoadMore = true; private int page = 1; private String s; private MyTeamlbBean.DataBean.ListBean data; @Override public int getLayoutId() { return R.layout.activity_myteam_gedai; } @Override public void initViews(Bundle savedInstanceState) { mViewModel = new ViewModelProvider(this).get(MineViewModel.class); Intent intent = getIntent(); if (intent == null) { FToast.error("数据错误"); return; } mUserInfo = SharedPrefUtils.get(UserInfo.class); data = (MyTeamlbBean.DataBean.ListBean) intent.getSerializableExtra("Data"); int id = data.getId(); String nickname = data.getNickname(); String headimg = data.getHeadimg(); textName.setText(nickname); ImageLoader.loadPlaceholder1(headimg, civTuxiang); if (data == null) { FToast.error("数据错误"); return; } CustomRefreshHeader header = new CustomRefreshHeader(this); header.setBackground(0xFFF3F4F6); //mRefreshLayout.setRefreshHeader(header); refreshLayout.setEnableFooterFollowWhenNoMoreData(true); refreshLayout.setOnRefreshLoadMoreListener(this); mAdapter = new MultiTypeAdapter(); mItems = new Items(); mAdapter.setItems(mItems); recyclerView.setItemAnimator(new DefaultItemAnimator()); mAdapter.register(MyTeamlbBean.DataBean.ListBean.class, new ItemMyTeamTwoViewBinder(this)); BrandItemDecoration mDecoration = new BrandItemDecoration(this, 10); recyclerView.addItemDecoration(mDecoration); mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); recyclerView.setLayoutManager(mLayoutManager); recyclerView.setAdapter(mAdapter); mViewModel.hqteamsl(mUserInfo.getToken(), String.valueOf(mUserInfo.getId()), "2",""+ AppUtils.getVersionCode(BasicApp.getContext())) .observe(this, mObserver); load(); edtShousuo.setOnEditorActionListener(new TextView.OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEND || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { //do something; load(); return true; } return false; } }); imgBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } private void load() { if (mUserInfo == null) { refreshLayout.finishRefresh(); return; } s = edtShousuo.getText().toString(); mViewModel.hqteamtj2(mUserInfo.getToken(), String.valueOf(mUserInfo.getId()), "2", String.valueOf(data.getId()), s, "1",""+ AppUtils.getVersionCode(BasicApp.getContext()), Status.LOAD_REFRESH) .observe(this, mObserver1); } private Observer<Status<ResponseBody>> mObserver1 = status -> { switch (status.status) { case Status.SUCCESS: statusView.showContent(); ResponseBody body = status.content; opera1(body, status); break; case Status.ERROR: if (status.loadType == Status.LOAD_MORE) { mCanLoadMore = true; refreshLayout.finishLoadMore(); } else { refreshLayout.finishRefresh(); } FToast.error("网络错误"); break; case Status.LOADING: break; } }; private void opera1(ResponseBody body, Status status) { try { String b = body.string(); MyTeamlbBean mMyTeamlbBean = new Gson().fromJson(b, MyTeamlbBean.class); List<MyTeamlbBean.DataBean.ListBean> item = mMyTeamlbBean.getData().getList(); if (item == null || item.size() == 0) { if (status.loadType == Status.LOAD_REFRESH) { refreshLayout.finishRefresh(); statusView.showEmpty(); } else { refreshLayout.finishLoadMore(); } return; } if (mMyTeamlbBean.getCode() == 1) { page = mMyTeamlbBean.getData().getPage().getCurrent() + 1; mCanLoadMore = true; if (status.loadType == Status.LOAD_REFRESH) { mItems.clear(); mItems.addAll(item); mAdapter.notifyDataSetChanged(); refreshLayout.finishRefresh(); } else { mItems.addAll(item); mAdapter.notifyDataSetChanged(); refreshLayout.finishLoadMore(); } }else if(mMyTeamlbBean.getCode() == HttpUtils.CODE_INVALID){ HttpUtils.Invalid(this); finish(); FToast.error(mMyTeamlbBean.getInfo()); } else { if (status.loadType == Status.LOAD_MORE) { mCanLoadMore = true; refreshLayout.finishLoadMore(); } else { refreshLayout.finishRefresh(); } FToast.error(mMyTeamlbBean.getInfo()); } } catch (IOException e) { e.printStackTrace(); FToast.error("数据错误"); } } private Observer<Status<ResponseBody>> mObserver = status -> { switch (status.status) { case Status.SUCCESS: ResponseBody body = status.content; opera(body); break; case Status.ERROR: FToast.error("网络错误"); break; case Status.LOADING: break; } }; private void opera(ResponseBody body) { try { String b = body.string(); MyTeamslBean mMyTeamslBean = new Gson().fromJson(b, MyTeamslBean.class); if (mMyTeamslBean.getCode() == 1) { textZhongrenshu.setText("" + mMyTeamslBean.getData().getTotal_all()); textXinzengrenshu.setText("" + mMyTeamslBean.getData().getTotal_mon()); textRzengrenshu.setText("" + mMyTeamslBean.getData().getTotal_day()); } else if(mMyTeamslBean.getCode() == HttpUtils.CODE_INVALID){ HttpUtils.Invalid(this); finish(); FToast.error(mMyTeamslBean.getInfo()); }else { FToast.error(mMyTeamslBean.getInfo()); } } catch (IOException e) { e.printStackTrace(); FToast.error("数据错误"); } } @Override public void onLoadMore(@NonNull RefreshLayout refreshLayout) { if (mCanLoadMore) { mCanLoadMore = false; mViewModel.hqteamtj2(mUserInfo.getToken(), String.valueOf(mUserInfo.getId()), "2", "" + data.getId(), s, "" + page,""+ AppUtils.getVersionCode(BasicApp.getContext()), Status.LOAD_MORE) .observe(this, mObserver1); } else { refreshLayout.finishLoadMore(); } } @Override public void onRefresh(@NonNull RefreshLayout refreshLayout) { mCanLoadMore = false; load(); } @Override public void onProdClick(MyTeamlbBean.DataBean.ListBean item) { if(item.getId()==2&&item.getTeams()!=0){ Intent intentProd = new Intent(this, MyTeamTwoActivity.class); intentProd.putExtra("Data", item); startActivity(intentProd); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO: add setContentView(...) invocation ButterKnife.bind(this); } }
aaf55f7799587f19b9664d1a91d5ef241f5d0ece
784e5063fe211faa8516d1bd487f9fa5bdbff4e4
/src/main/java/com/web/entity/Check.java
f3d76ecf3f41fb227a4c706a4e05f5908e81d1e2
[]
no_license
Stringxy/wisezone
a9c6a9711843ef38d22d311be057b5f7b738421f
fcf1c9d232729c44fc8b20d056e241b82f0e19b5
refs/heads/master
2021-01-13T03:46:53.161785
2017-01-08T14:17:28
2017-01-08T14:17:28
77,233,132
0
0
null
null
null
null
UTF-8
Java
false
false
1,365
java
package com.web.entity; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * 练习题关卡表 * @author Administrator * */ @Entity @Table(name="checkpoint") public class Check implements Serializable { private Integer checkId; private String checkName; //关卡名称 private Integer checkCount; //关卡总数量 private Major major; //所属专业 @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public Integer getCheckId() { return checkId; } public void setCheckId(Integer checkId) { this.checkId = checkId; } @Column(nullable=false) public String getCheckName() { return checkName; } public void setCheckName(String checkName) { this.checkName = checkName; } @Column(nullable=false) public Integer getCheckCount() { return checkCount; } public void setCheckCount(Integer checkCount) { this.checkCount = checkCount; } @ManyToOne @JoinColumn(name="majorId") public Major getMajor() { return major; } public void setMajor(Major major) { this.major = major; } }
3f9d7dccd9a29b915856a893b8c7e28e92bd4690
2749d50368928c3640a9474d3ac488197d11d7b7
/api_b/dynamic/src/main/java/com/networknt/apib/handler/DataGetHandler.java
b87f6ee64d948a1e3b4b083bb14149f6ad049d6f
[ "Apache-2.0" ]
permissive
zmax1360/light4j-APIchain
7864a956bb1e6b17ea98a9bc41919ccc15404546
06ffb1f37b24b0967d0b08270016f1daf20d1aac
refs/heads/master
2022-09-05T19:22:40.206863
2021-10-26T23:22:05
2021-10-26T23:22:05
127,503,179
0
0
null
2022-08-18T19:04:17
2018-03-31T05:48:52
Java
UTF-8
Java
false
false
3,918
java
package com.networknt.apib.handler; import com.fasterxml.jackson.core.type.TypeReference; import com.networknt.client.Http2Client; import com.networknt.cluster.Cluster; import com.networknt.config.Config; import com.networknt.exception.ClientException; import com.networknt.security.JwtHelper; import com.networknt.server.Server; import com.networknt.service.SingletonServiceFactory; import io.undertow.UndertowOptions; import io.undertow.client.ClientConnection; import io.undertow.client.ClientRequest; import io.undertow.client.ClientResponse; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.util.Methods; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xnio.OptionMap; import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; public class DataGetHandler implements HttpHandler { static Logger logger = LoggerFactory.getLogger(DataGetHandler.class); static Cluster cluster = SingletonServiceFactory.getBean(Cluster.class); static String tag = Server.config.getEnvironment(); static String apidHost = cluster.serviceToUrl("https", "com.networknt.apid-1.0.0", tag, null); static String path = "/v1/data"; static Map<String, Object> securityConfig = (Map) Config.getInstance().getJsonMapConfig(JwtHelper.SECURITY_CONFIG); static boolean securityEnabled = (Boolean) securityConfig.get(JwtHelper.ENABLE_VERIFY_JWT); static Http2Client client = Http2Client.getInstance(); static ClientConnection connection; public ClientConnection getConnection( String URI ) throws Exception { return client.connect(new URI(URI), Http2Client.WORKER, Http2Client.SSL, Http2Client.POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get(); } public DataGetHandler() { try { connection = getConnection(apidHost); } catch (Exception e) { logger.error("Exeption:", e); } } @Override public void handleRequest( HttpServerExchange exchange ) throws Exception { List<String> list = new ArrayList<>(); final CountDownLatch latch = new CountDownLatch(1); if (connection == null || !connection.isOpen()) { try { connection = getConnection(apidHost); } catch (Exception e) { logger.error("Exeption:", e); throw new ClientException(e); } } final AtomicReference<ClientResponse> reference = new AtomicReference<>(); try { ClientRequest request = new ClientRequest().setMethod(Methods.GET).setPath(path); // this is to ask client module to pass through correlationId and traceabilityId as well as // getting access token from oauth2 server automatically and attatch authorization headers. if (securityEnabled) client.propagateHeaders(request, exchange); connection.sendRequest(request, client.createClientCallback(reference, latch)); latch.await(); int statusCode = reference.get().getResponseCode(); if (statusCode >= 300) { throw new Exception("Failed to call API D: " + statusCode); } List<String> apidList = Config.getInstance().getMapper().readValue(reference.get().getAttachment(Http2Client.RESPONSE_BODY), new TypeReference<List<String>>() { }); list.addAll(apidList); } catch (Exception e) { logger.error("Exception:", e); throw new ClientException(e); } list.add("API B: Message 1"); list.add("API B: Message 2"); exchange.getResponseSender().send(Config.getInstance().getMapper().writeValueAsString(list)); } }
a46e4fcd3ea9d1d054d482dd23929d08c480eafa
b7e9243f8ebc117429d1a7b5ba1e0cdb00c7ec7c
/sma-ttqv/src/main/java/sma/gps/fich/ttqv/TtqvQu4Mem.java
9ded4155e85e2acc432214cbc2537c69ca832ec6
[]
no_license
SebM70/sma-gps
c20a8835671f3d8bbe17e50f6ab79995e92ccf52
083e65411201cf0d822752d2f52e93e5478c40bb
refs/heads/master
2021-08-27T21:24:43.111967
2017-12-10T10:56:55
2017-12-10T10:56:55
113,736,482
0
0
null
null
null
null
UTF-8
Java
false
false
2,520
java
package sma.gps.fich.ttqv; import java.io.IOException; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import sma.gps.model.Coord; import sma.gps.model.Track; import sma.util.access.MemoryDatabase; import com.healthmarketscience.jackcess.Table; /** * * @author marsolle * */ public class TtqvQu4Mem extends TtqvQu4 { private byte[] memFile; public TtqvQu4Mem(byte[] memQu4) { this.memFile = memQu4; } @Override public void connect() throws IOException { // db = Database.open(file, true); db = MemoryDatabase.open(memFile); sLog.info("db.getFileFormat()={}", db.getFileFormat()); } @Override public void close() throws IOException { db.close(); } @Override public List<Track> getTracksFromTable(String tableName) throws Exception { List<Track> lstTrk = new LinkedList<Track>(); // "Select tr_idx,name,info,style From [" + table + "] Where (del=0)"; Table table = db.getTable(tableName); // Map<String, Object> row = Cursor.findRow(table, Collections.singletonMap("del", "0")); Map<Integer, Track> mapTracks = new LinkedHashMap<Integer, Track>(); for (Map<String, Object> row : table) { boolean isDel = (Boolean) row.get("del"); if (!isDel) { // create 1 track per line fetched Track trk = new Track(); trk.setName((String) row.get("name")); sLog.debug(trk.getName()); // log("trk.nom=" + trk.nom); trk.setDescription((String) row.get("info")); trk.setStyle((String) row.get("style")); Integer tr_idx = (Integer) row.get("tr_idx"); mapTracks.put(tr_idx, trk); lstTrk.add(trk); } } this.loadTracks(mapTracks, tableName); return lstTrk; } private void loadTracks(Map<Integer, Track> pMapTracks, String tableName) throws IOException { // String sql = "Select fp,lat,lon,alt,speed From [" + tableName + "_trp] Where (tr_idx=" + tr_idx + ") and (del=0)"; // sql += " Order By trp_idx"; Table table = db.getTable(tableName + "_trp"); for (Map<String, Object> row : table) { boolean isDel = (Boolean) row.get("del"); if (!isDel) { Integer tr_idx = (Integer) row.get("tr_idx"); Track trk = pMapTracks.get(tr_idx); if (trk == null) { sLog.warn("Not tr_idx " + tr_idx + " in map!"); } else { Coord coord = new Coord((Double) row.get("lat"), (Double) row.get("lon")); boolean first = (Boolean) row.get("fp"); trk.add(coord, first); } // sLog.info("fetched tr_idx=" + row.get("tr_idx")); } } } }
db781b5af48d5a35e121bca686754553caf9c3db
456d43c584fb66f65c6a7147cdd22595facf8bd9
/jpa/deferred/src/main/java/example/model/Customer598.java
5f4ada83cfcc882d2971fd81ca5ace9c38f51a8c
[ "Apache-2.0" ]
permissive
niushapaks/spring-data-examples
283eec991014e909981055f48efe67ff1e6e19e6
1ad228b04523e958236d58ded302246bba3c1e9b
refs/heads/main
2023-08-21T14:25:55.998574
2021-09-29T13:14:33
2021-09-29T13:14:33
411,679,335
1
0
Apache-2.0
2021-09-29T13:11:03
2021-09-29T13:11:02
null
UTF-8
Java
false
false
624
java
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer598 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer598() {} public Customer598(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer598[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
c8898a1f5e264131a075a1b7dbbe816df2eb0f4e
40894e0795ab7d4a0b14082ecb5299160b370d59
/spring-beanpostprocessor-duplicate/src/main/java/io/github/aveuiller/bug_reproduction/bean_post_process/PostProcessedSpringBean.java
5c7cbcbba6a72496bdfb6d56a14f535273e90baf
[]
no_license
aveuiller/bug_reproduction
c36ae254e421ac0fc77ccf0002ff1f52110cabd7
4c9353e0c77576cf429e449fc38bbfb1457b90b2
refs/heads/main
2023-06-04T06:59:16.494922
2021-06-28T08:22:06
2021-06-28T08:24:29
355,122,995
0
0
null
null
null
null
UTF-8
Java
false
false
927
java
package io.github.aveuiller.bug_reproduction.bean_post_process; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.stereotype.Component; import java.util.List; /** * Original Bean is forced as component, so always resolved */ @Component("postProcessedSpringBean") public class PostProcessedSpringBean implements BeanPostProcessor { @Autowired protected StatefulComponent statefulComponent; @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { System.out.println("Original Method called"); int myElement = 1; statefulComponent.addInt(myElement); return myElement; } public List<Integer> getInitList() { return statefulComponent.initList; } }
87bc197b2031a1f229f8e02024b9dd54a78c6319
0a8cb2f36742c3692b9994c26583ae987aa776e9
/app/src/androidTest/java/com/example/akurian/navigate/ApplicationTest.java
de34f8267f08de5d72c6104baa0acad8eccac648
[]
no_license
anukurian16/navigate
ee2d1240a2452add9f29cc4bbc14d5cab8f5f1e5
90b8f5ea74cf54dcfedf803abfb9a65db9326856
refs/heads/master
2016-08-12T04:33:51.906773
2016-04-02T08:50:48
2016-04-02T08:50:48
55,285,842
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package com.example.akurian.navigate; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
cb55168bf6c298b3a51b333cc7c0418642a56bb7
dcda6b7f7640315e32f1dc11a36323060e23f28a
/mod15/03/HomeworkTesterV3.java
2c7e3bec6965613b4486a7e1e6599d79e7ff3724
[]
no_license
aharabedian/APCS
92e73acadac7b8616a44011e6d70daad05acb4a1
e328088f2012d16519694026276f2b57ac577808
refs/heads/master
2021-09-20T09:40:16.009302
2018-08-07T23:30:49
2018-08-07T23:30:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,014
java
/** * Author: Aaron * Description: Tests "HomeworkV3" class * Date: 7-30-18 */ import java.util.ArrayList; import java.util.List; public class HomeworkTesterV3 { public static void main(String args[]){ //ArrayList of homework List<HomeworkV3> homework = new ArrayList<HomeworkV3>(); //Add courses homework.add(new EnglishV3()); homework.add(new GeometryV3()); homework.add(new ChemistryV3()); homework.add(new EconomicsV3()); //Add assignments for(HomeworkV3 course : homework) { course.createAssignment((int)(Math.random() * 10) + 5); } //Display homework, Complete part of homework, display remaining homework for(HomeworkV3 course : homework) { System.out.println("Before reading: " + course); course.doHomework((int)(Math.random() * 5)); System.out.println("After reading: " + course); System.out.println(); } } }
3e6b99e94ebafd0e9e835bd51b255e2d047442a2
d67836673d880685a83620b6e0862202bf9d716b
/java/mioj-java/src/main/java/mine/code/mioj/_84_ADC/Main.java
687f4171e644fd648b3b8add82ba14c54737566b
[]
no_license
zoyanhui/mioj
6f277496add5bbff66d0a74274edfed9b63cc159
d8d5a3239dea86434dceaed2421db91abe7e1c4e
refs/heads/master
2022-12-22T23:24:34.439619
2020-09-18T02:19:45
2020-09-18T02:19:45
296,489,187
0
0
null
null
null
null
UTF-8
Java
false
false
2,323
java
package mine.code.mioj._84_ADC; /** * - 论 ADC 如何出装 * 序号:#84 * 难度:有挑战 * 时间限制:1000ms * 内存限制:10M * 描述 * 每次打 ADC 时,都会纠结是出『暗影战斧』还是『破甲弓』,现在给出护甲的计算公式、当前英雄等级、对方英雄护甲,你可以计算出买哪个装备单次攻击伤害更高嘛? * * 首先,我们计算对方英雄的 护甲值: 护甲值 = 原始护甲值 - 护甲穿透。 * * 然后,我们计算护甲可以提供的 伤害减免,伤害减免公式为: 伤害减免 = (护甲值) / (602 + 护甲值)。 * * 英雄的 攻击力 为: 100 + 装备攻击 * * 实际英雄受的伤害为: 攻击力 x (100% - 伤害减免) * * 装备属性如下: * * 暗影战斧 axe +85 物理攻击 唯一被动(切割):增加(100+英雄等级*10)点护甲穿透 * * 破甲弓 bow +80 物理攻击 唯一被动:增加 45% 护甲穿透(实际穿透的护甲值为 原始护甲 x ( 1 - 45%) ) * * 输入 * 一行数字,每行两个数(空格隔开):x y(己方英雄等级 对方英雄护甲)。 * * 输出 * 如果『暗影战斧』伤害更高,那么输出 axe,如果『破甲弓』更优秀,那么输出 bow。 如果两个一样,那么输出 same。 * * 输入样例 * 15 100 * 0 1000 * 0 200 * * 输出样例 * axe * bow * axe * * * Created by zhouyanhui on 2019/11/26. */ import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String line; while (scan.hasNextLine()) { line = scan.nextLine().trim(); String[] s = line.split(" ", 2); System.out.println(solution(Integer.valueOf(s[0]), Integer.valueOf(s[1]))); } } private static String solution(int a, int b) { double axeArmo = b - (100 + a * 10); double axe = (100 + 85) * (1.0 - axeArmo / (602 + axeArmo)); double bowArmo = b * (1.0 - 0.45); double bow = (100 + 80) * (1 - bowArmo / (602 + bowArmo)); int compare = Double.compare(axe, bow); if(compare > 0){ return "axe"; }else if(compare < 0){ return "bow"; }else{ return "same"; } } }
d4f14ecdfdb1e8503cc6faec388687d10ed8275c
d5a20b64bac252e7d8214bf29979496afb6649e9
/Web/src/test/java/Utils/GetScreenshot.java
57658c9d0048b440300515c3bcc7bc760f9b60e9
[]
no_license
thatoq/VossWebAutomation
d77af3586980040714e2823268d956e314aadc4c
ae01521993a3ef1db5eee33fab99403af86bdf59
refs/heads/master
2023-04-16T15:09:52.435768
2020-07-19T18:52:24
2020-07-19T18:52:24
280,916,434
0
0
null
2021-04-26T20:30:14
2020-07-19T17:30:29
Java
UTF-8
Java
false
false
830
java
package Utils; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; public class GetScreenshot { public static String capture(WebDriver driver, String screenshotName) throws IOException { // String dateName=new SimpleDateFormat().format(new Date()); TakesScreenshot ts=((TakesScreenshot)driver); File source=ts.getScreenshotAs(OutputType.FILE); String destination=System.getProperty("user.dir")+"/Screenshots"+screenshotName+ ".png"; File finalDestination=new File(destination); FileUtils.copyFile(source,finalDestination); return destination; } }
66098a6582d1438240bc80f55aaae004e7e6063f
4800babe875f9ae46854f663b9eb8162e556dd52
/CreatingDynamicUIWithAndroidFragments/app/src/main/java/com/example/anid/creatingdynamicuiwithandroidfragments/BookListFragment.java
5757523b6cbde2dea95f089d1887f04cad3df7bd
[]
no_license
anidmurmu/AndroidTutorials
d1c1602532380937089887c310a5607e27540986
0add2cdef194930a7acfbaf1561feff55006b531
refs/heads/master
2020-04-12T13:52:27.086825
2019-01-17T06:32:30
2019-01-17T06:32:30
162,534,535
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
package com.example.anid.creatingdynamicuiwithandroidfragments; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class BookListFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View viewHierarchy = inflater.inflate(R.layout.fragment_book_list, container, false); return viewHierarchy; } }