blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
47275e35d00fda660fe935c41b121f1eb82377dc
0e26db39ed5923c73c1ac874c7d86218712f657f
/app/src/main/java/temp_dagger/modules/BatteryModule.java
dd3ce8954c8946b1b906fbdb6e722e82e5a34080
[]
no_license
laxmansingh1088/MVVMLearning
d12714fe49c7faed9b47916d7f2141542873c5e7
1f2f5cbdb4e5d61624c8919b2ed233c509d92562
refs/heads/master
2022-11-30T17:46:46.079348
2020-07-23T11:53:14
2020-07-23T11:53:14
252,494,340
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package temp_dagger.modules; import android.util.Log; import dagger.Module; import dagger.Provides; import temp_dagger.smartphone.Battery; @Module public class BatteryModule { int currentBatteryPercent; public BatteryModule(int currentBatteryPercent) { this.currentBatteryPercent = currentBatteryPercent; Log.d("dagger", "currentBatteryPercent--- " + this.currentBatteryPercent); } @Provides Battery providesBattery() { return new Battery(); } }
1a2ad7bce26dd1be08d636ea9624afb53ccfb7ec
69d29f6b2d3c32571917465b59a409613cafa609
/src/main/java/com/minseokism/webservice/web/WebRestController.java
d097e5930bd8a9b7f8f491edb2b244f0202849b4
[]
no_license
minseokism/spring-webservice
d23f1bd687a06fb4fb8bd9dc459a85da984e3db6
db76a7c245dcc7dbbab6725571373495c290384c
refs/heads/master
2018-07-20T11:19:36.588118
2018-07-05T01:34:45
2018-07-05T01:34:45
125,801,116
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.minseokism.webservice.web; import com.minseokism.webservice.dto.PostsSaveRequestDto; import com.minseokism.webservice.service.PostsService; import lombok.AllArgsConstructor; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; @RestController @AllArgsConstructor public class WebRestController { private PostsService postsService; private Environment env; @GetMapping("/hello") public String hello() { return "HelloWorld"; } @PostMapping("/posts") public Long savePosts(@RequestBody PostsSaveRequestDto dto) { return postsService.save(dto); } @GetMapping("/profile") public String getProfile() { return Arrays.stream(env.getActiveProfiles()) .findFirst() .orElse(""); } }
38e61433f54ae9e7d919ac13475d4bea230b2473
5ab93cc5796b0f6e05e45b01c730b1f6af9bd131
/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
710a23601e2f11c7e70d966e75d15bad43664f95
[ "Apache-2.0" ]
permissive
atakora/maven-surefire
846c5cb6ad1c09a6c408b6f56372e9d94ec9793e
179abbf026902e44b1d95f7ef41b69bdb24434df
refs/heads/master
2020-04-06T05:48:18.746663
2017-02-14T00:26:24
2017-02-14T00:26:24
82,915,677
1
0
null
2017-02-23T10:27:15
2017-02-23T10:27:14
null
UTF-8
Java
false
false
4,253
java
package org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Before; import org.junit.Test; import java.util.Iterator; import java.util.Locale; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; /** * https://issues.apache.org/jira/browse/SUREFIRE-1295 * https://github.com/apache/maven-surefire/pull/136 * * @author michaeltandy * @since 2.19.2 */ public class Surefire1295AttributeJvmCrashesToTestsIT extends SurefireJUnit4IntegrationTestCase { @Before public void skipWindows() { String os = System.getProperty( "os.name" ).toLowerCase( Locale.ROOT ); assumeTrue( os.equals( "mac os x" ) || os.equals( "linux" ) /*|| os.contains( "windows" )*/ ); } @Test public void crashInFork() throws VerificationException { SurefireLauncher launcher = unpack( "crash-during-test" ); checkCrashTypes( launcher ); } @Test public void crashInSingleUseFork() throws VerificationException { SurefireLauncher launcher = unpack( "crash-during-test" ) .forkCount( 1 ) .reuseForks( false ); checkCrashTypes( launcher ); } @Test public void crashInReusableFork() throws VerificationException { SurefireLauncher launcher = unpack( "crash-during-test" ) .forkPerThread() .reuseForks( true ) .threadCount( 1 ); checkCrashTypes( launcher ); } private static void checkCrashTypes( SurefireLauncher launcher ) throws VerificationException { checkCrash( launcher.addGoal( "-DcrashType=exit" ) ); checkCrash( launcher.addGoal( "-DcrashType=abort" ) ); checkCrash( launcher.addGoal( "-DcrashType=segfault" ) ); } private static void checkCrash( SurefireLauncher launcher ) throws VerificationException { OutputValidator validator = launcher.maven() .withFailure() .executeTest() .verifyTextInLog( "The forked VM terminated without properly saying " + "goodbye. VM crash or System.exit called?" ) .verifyTextInLog( "Crashed tests:" ); for ( Iterator<String> it = validator.loadLogLines().iterator(); it.hasNext(); ) { String line = it.next(); if ( line.contains( "Crashed tests:" ) ) { line = it.next(); if ( it.hasNext() ) { assertThat( line ).contains( "junit44.environment.BasicTest" ); } else { fail( "Could not find any line after 'Crashed tests:'." ); } } } } }
8ba93357bb8de558f9b2cda5568578bbff61c6f5
4d80b85fd709667c397f7a4ae88b5ea881d9b7a2
/src/day_8_techtest/TestInCrcullum.java
b937ec2fd23e5637ef8ad6fda91730138b727f07
[]
no_license
amerdina/Techcircle_work
0f345cebd1d0959c28811c2af7cc247d2febb6f3
8e16a253ab4fdcd249bbe131c07f952cfe1cfeed
refs/heads/main
2023-07-31T07:48:03.061469
2021-09-23T17:38:46
2021-09-23T17:38:46
409,681,092
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package day_8_techtest; import java.util.Scanner; public class TestInCrcullum { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Please type number"); int Num1 = scan.nextInt(); scan.close(); } }
a49d62b847a4f574bf0851862173d0f484607380
05e5bee54209901d233f4bfa425eb6702970d6ab
/net/minecraft/server/v1_7_R4/EntitySnowman.java
f155d3c601d081e84cc207be71607b0c7ee8f23f
[]
no_license
TheShermanTanker/PaperSpigot-1.7.10
23f51ff301e7eb05ef6a3d6999dd2c62175c270f
ea9d33bcd075e00db27b7f26450f9dc8e6d18262
refs/heads/master
2022-12-24T10:32:09.048106
2020-09-25T15:43:22
2020-09-25T15:43:22
298,614,646
0
1
null
null
null
null
UTF-8
Java
false
false
4,229
java
/* */ package net.minecraft.server.v1_7_R4; /* */ /* */ import org.bukkit.block.BlockState; /* */ import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; /* */ import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; /* */ import org.bukkit.entity.Entity; /* */ import org.bukkit.event.Event; /* */ import org.bukkit.event.block.EntityBlockFormEvent; /* */ /* */ public class EntitySnowman extends EntityGolem implements IRangedEntity { /* */ public EntitySnowman(World world) { /* 12 */ super(world); /* 13 */ a(0.4F, 1.8F); /* 14 */ getNavigation().a(true); /* 15 */ this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 1.25D, 20, 10.0F)); /* 16 */ this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, 1.0D)); /* 17 */ this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); /* 18 */ this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this)); /* 19 */ this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityInsentient.class, 0, true, false, IMonster.a)); /* */ } /* */ /* */ public boolean bk() { /* 23 */ return true; /* */ } /* */ /* */ protected void aD() { /* 27 */ super.aD(); /* 28 */ getAttributeInstance(GenericAttributes.maxHealth).setValue(4.0D); /* 29 */ getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); /* */ } /* */ /* */ public void e() { /* 33 */ super.e(); /* 34 */ int i = MathHelper.floor(this.locX); /* 35 */ int j = MathHelper.floor(this.locY); /* 36 */ int k = MathHelper.floor(this.locZ); /* */ /* 38 */ if (L()) { /* 39 */ damageEntity(DamageSource.DROWN, 1.0F); /* */ } /* */ /* 42 */ if (this.world.getBiome(i, k).a(i, j, k) > 1.0F) { /* 43 */ damageEntity(CraftEventFactory.MELTING, 1.0F); /* */ } /* */ /* 46 */ for (int l = 0; l < 4; l++) { /* 47 */ i = MathHelper.floor(this.locX + ((l % 2 * 2 - 1) * 0.25F)); /* 48 */ j = MathHelper.floor(this.locY); /* 49 */ k = MathHelper.floor(this.locZ + ((l / 2 % 2 * 2 - 1) * 0.25F)); /* 50 */ if (this.world.getType(i, j, k).getMaterial() == Material.AIR && this.world.getBiome(i, k).a(i, j, k) < 0.8F && Blocks.SNOW.canPlace(this.world, i, j, k)) { /* */ /* 52 */ BlockState blockState = this.world.getWorld().getBlockAt(i, j, k).getState(); /* 53 */ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.SNOW)); /* */ /* 55 */ EntityBlockFormEvent event = new EntityBlockFormEvent((Entity)getBukkitEntity(), blockState.getBlock(), blockState); /* 56 */ this.world.getServer().getPluginManager().callEvent((Event)event); /* */ /* 58 */ if (!event.isCancelled()) { /* 59 */ blockState.update(true); /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ protected Item getLoot() { /* 67 */ return Items.SNOW_BALL; /* */ } /* */ /* */ protected void dropDeathLoot(boolean flag, int i) { /* 71 */ int j = this.random.nextInt(16); /* */ /* 73 */ for (int k = 0; k < j; k++) { /* 74 */ a(Items.SNOW_BALL, 1); /* */ } /* */ } /* */ /* */ public void a(EntityLiving entityliving, float f) { /* 79 */ EntitySnowball entitysnowball = new EntitySnowball(this.world, this); /* 80 */ double d0 = entityliving.locX - this.locX; /* 81 */ double d1 = entityliving.locY + entityliving.getHeadHeight() - 1.100000023841858D - entitysnowball.locY; /* 82 */ double d2 = entityliving.locZ - this.locZ; /* 83 */ float f1 = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F; /* */ /* 85 */ entitysnowball.shoot(d0, d1 + f1, d2, 1.6F, 12.0F); /* 86 */ makeSound("random.bow", 1.0F, 1.0F / (aI().nextFloat() * 0.4F + 0.8F)); /* 87 */ this.world.addEntity(entitysnowball); /* */ } /* */ } /* Location: D:\Paper-1.7.10\PaperSpigot-1.7.10-R0.1-SNAPSHOT-latest.jar!\net\minecraft\server\v1_7_R4\EntitySnowman.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
e97645bb53f88a8027ff0e2969cc3dc096cbb319
6b4786390e0748ff75cd65ab9ee34c01db15616d
/genetic-algorithm/INFO6205-20-master/6205Final_QingMu_WenSun/src/test/java/GeneticAlgorithm/FitnessTest.java
79e4d2257f7c28ab910cfcdd2462639414e63f88
[]
no_license
wwensun/project-collection
691f501be64ec586ce91368762167e330f41e25f
87efd368bd737f0a423f15ba9a68a8842ffc748c
refs/heads/master
2022-12-09T15:58:03.097024
2019-06-01T03:42:28
2019-06-01T03:42:28
163,567,335
0
0
null
2022-12-08T01:20:35
2018-12-30T06:36:53
Java
UTF-8
Java
false
false
4,276
java
package GeneticAlgorithm; import GeneticModel.Chromosome; import GeneticModel.Classroom; import GeneticModel.CourseClass; import GeneticModel.Schedule; import GeneticModel.School; import GeneticModel.Timeslot; import java.util.HashMap; import java.util.Map.Entry; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; public class FitnessTest{ @Test public void testFitness0() { School school = School.getInstance(); CourseClass c1 = new CourseClass(1,"Algorithm",50,2); school.addCourseClass(c1); Classroom r1 = new Classroom(1,40); school.addClassroom(r1); Chromosome chro = Chromosome.getInstance(); chro.setList(); HashMap<CourseClass,Timeslot> hash = new HashMap<CourseClass,Timeslot>(); hash.put(c1, chro.getList().get(12)); Schedule schedule = new Schedule(hash,2,0); school.getRoomList().remove(r1); school.getClassList().remove(c1); assertEquals(0.333333333, schedule.getFitness(),1.0E-7); } @Test public void testFitness1() { School school = School.getInstance(); CourseClass c1 = new CourseClass(1,"Algorithm",50,2); CourseClass c2 = new CourseClass(2,"Database",40,3); school.addCourseClass(c1); school.addCourseClass(c2); Classroom r1 = new Classroom(1,40); school.addClassroom(r1); Chromosome chro = Chromosome.getInstance(); chro.setList(); HashMap<CourseClass,Timeslot> hash = new HashMap<CourseClass,Timeslot>(); hash.put(c1, chro.getList().get(2)); hash.put(c2, chro.getList().get(15)); Schedule schedule = new Schedule(hash,2,0); school.getRoomList().remove(r1); school.getClassList().remove(c1); school.getClassList().remove(c2); assertEquals(0.833333333, schedule.getFitness(),1.0E-7); } @Test public void testFitness2() { School school = School.getInstance(); CourseClass c1 = new CourseClass(1,"Algorithm",50,2); CourseClass c2 = new CourseClass(2,"Database",80,3); CourseClass c3 = new CourseClass(3,"Object-Oriented Design",100,3); CourseClass c4 = new CourseClass(4,"Big Data",60,4); school.addCourseClass(c1); school.addCourseClass(c2); school.addCourseClass(c3); school.addCourseClass(c4); Classroom r1 = new Classroom(3,80); school.addClassroom(r1); Chromosome chro = Chromosome.getInstance(); chro.setList(); HashMap<CourseClass,Timeslot> hash = new HashMap<CourseClass,Timeslot>(); hash.put(c1, chro.getList().get(0)); hash.put(c2, chro.getList().get(15)); hash.put(c3, chro.getList().get(16)); hash.put(c4, chro.getList().get(50)); Schedule schedule = new Schedule(hash,2,0); school.getRoomList().remove(r1); school.getClassList().remove(c1); school.getClassList().remove(c2); school.getClassList().remove(c3); school.getClassList().remove(c4); assertEquals(0.666666666, schedule.getFitness(),1.0E-7); } @Test public void testFitness3() { School school = School.getInstance(); CourseClass c1 = new CourseClass(1,"Algorithm",50,4); CourseClass c2 = new CourseClass(2,"Database",80,3); school.addCourseClass(c1); school.addCourseClass(c2); Classroom r1 = new Classroom(3,30); school.addClassroom(r1); Chromosome chro = Chromosome.getInstance(); chro.setList(); HashMap<CourseClass,Timeslot> hash = new HashMap<CourseClass,Timeslot>(); hash.put(c1, chro.getList().get(24)); hash.put(c2, chro.getList().get(25)); Schedule schedule = new Schedule(hash,2,0); school.getRoomList().remove(r1); school.getClassList().remove(c1); school.getClassList().remove(c2); assertEquals(0.0, schedule.getFitness(),1.0E-7); } }
ca2d86bdbb7db5e1386c5c66f9d62b05303cd677
9119e9880a31644d2593560c95de0f9e1fb41238
/src/main/java/net/alexherman/example/ExampleConsumer.java
a7f3cec03af739e6198c7ac9f826c85bed640bb3
[ "MIT" ]
permissive
Simulalex/multi-sdk-example
dc5503af18f134ba2d1aaf875dbe4dd18e01e9df
d7755fa13c656b9f9126eed0ff8ce1a2318f78f5
refs/heads/master
2020-07-05T23:37:01.633663
2019-08-30T19:01:31
2019-08-30T19:01:31
202,818,536
0
0
null
null
null
null
UTF-8
Java
false
false
477
java
package net.alexherman.example; import net.alexherman.example.api.DefaultApi; public class ExampleConsumer { private final DefaultApi swansonQuotesApi; public static ExampleConsumer create() { return new ExampleConsumer(new DefaultApi()); } public ExampleConsumer(DefaultApi swansonQuotesApi) { this.swansonQuotesApi = swansonQuotesApi; } public String dropKnowledge() { return swansonQuotesApi.quotesGet().get(0); } }
ee80249833c935f03b8ce4eb5f328549127be0f2
34a5ee54e16f1bcd57e51875d7a21555351540df
/day02/LiuJian/app/src/main/java/com/example/day03_project/base/BasePresenter.java
2ded1ee80cccffc32049b7f01d3ce8c70ebe7e16
[]
no_license
tddch/group2
a9bc71aa6346f8f99138460b5d84b649408c2f1b
32299da0d15307c8a8b470c0ed9016a1598eb31a
refs/heads/main
2023-02-14T19:44:36.240200
2021-01-02T13:22:02
2021-01-02T13:22:02
322,761,173
0
1
null
null
null
null
UTF-8
Java
false
false
566
java
package com.example.day03_project.base; import com.example.day03_project.inesenter.IBasePresenter; import com.example.day03_project.inesenter.IBaseView; import java.lang.ref.WeakReference; /** * */ public abstract class BasePresenter<V extends IBaseView> implements IBasePresenter<V> { protected V mView; WeakReference<V> weakReference; @Override public void attachView(V v) { weakReference = new WeakReference<V>(v); mView=weakReference.get(); } @Override public void unAttachView() { mView=null; } }
17a187d0e9efe1661ef801c0912aea7b6b914f2d
251e8727e3de71edf80a3592d7b929bf83629273
/Spring_1400_AOP_Introduction/src/com/bjsxt/aop/LogInterceptor.java
82490977ae90374a4c589c0aa72182c8fa3638ab
[]
no_license
jokulyao/SpringLearn
663d3c92c30c2bb3e2654eb3e5ad7b6be86287b8
001554ed82c0bd31e4ce90ef8f69f7ec6604a15b
refs/heads/master
2021-01-10T09:59:34.692405
2015-10-31T06:34:28
2015-10-31T06:34:28
44,752,141
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package com.bjsxt.aop; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; public class LogInterceptor implements InvocationHandler { private Object target; public Object getTarget() { return target; } public void setTarget(Object target) { this.target = target; } public void beforeMethod(Method m) { System.out.println(m.getName() + " start"); } @Override public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { beforeMethod(m); m.invoke(target, args); return null; } }
6af7e12402320cd5e01fa279c5a1f8d032c0719e
fe19596b12b5933d8feda729a7424ff0b07c89bd
/counter-master-with-cd/src/androidTest/java/me/tsukanov/counter/ui/DeleteCounterNoChildAtPosition.java
4bf2a5cafc7b214fc1cd49c04501e75328727812
[ "Apache-2.0" ]
permissive
federicaventriglia/EspressoTests
6997c4813253e0431a571e05f7adc41a49a86c41
1c58788eef44c398afe7b0bd1cc5c08c245178e8
refs/heads/master
2020-05-18T02:50:20.141656
2020-01-14T21:33:34
2020-01-14T21:33:34
184,121,063
0
0
null
null
null
null
UTF-8
Java
false
false
4,358
java
package me.tsukanov.counter.ui; import android.support.test.espresso.ViewInteraction; import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import me.tsukanov.counter.R; import static android.support.test.InstrumentationRegistry.getInstrumentation; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; import static android.support.test.espresso.action.ViewActions.replaceText; import static android.support.test.espresso.action.ViewActions.scrollTo; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withClassName; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.is; @LargeTest @RunWith(AndroidJUnit4.class) public class DeleteCounterNoChildAtPosition { @Rule public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class); @Test public void deleteCounterNoChildAtPosition() { ViewInteraction appCompatImageButton = onView( allOf(withContentDescription("Open navigation"), isDisplayed())); appCompatImageButton.perform(click()); ViewInteraction linearLayout = onView( allOf(withId(R.id.add_counter), withContentDescription("add_counter_linear_layout"), isDisplayed())); linearLayout.perform(click()); ViewInteraction appCompatEditText = onView( allOf(withId(R.id.edit_name), withContentDescription("dialog_edit_text"))); appCompatEditText.perform(scrollTo(), replaceText("Test"), closeSoftKeyboard()); ViewInteraction appCompatEditText2 = onView( allOf(withId(R.id.edit_value), withContentDescription("edit_value_text_view"))); appCompatEditText2.perform(scrollTo(), replaceText("0"), closeSoftKeyboard()); ViewInteraction appCompatImageButton2 = onView( allOf(withContentDescription("Open navigation"), isDisplayed())); appCompatImageButton2.perform(click()); ViewInteraction linearLayout2 = onView( allOf(withId(R.id.MenuRowLinearLayout), withContentDescription("menu_row_linear_layout"), isDisplayed())); linearLayout2.check(matches(isDisplayed())); openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); ViewInteraction appCompatTextView2 = onView( allOf(withId(R.id.title), isDisplayed())); appCompatTextView2.perform(click()); ViewInteraction appCompatButton3 = onView( allOf(withId(android.R.id.button1))); appCompatButton3.perform(scrollTo(), click()); } private static Matcher<View> childAtPosition( final Matcher<View> parentMatcher, final int position) { return new TypeSafeMatcher<View>() { @Override public void describeTo(Description description) { description.appendText("Child at position " + position + " in parent "); parentMatcher.describeTo(description); } @Override public boolean matchesSafely(View view) { ViewParent parent = view.getParent(); return parent instanceof ViewGroup && parentMatcher.matches(parent) && view.equals(((ViewGroup) parent).getChildAt(position)); } }; } }
367b15efa5ac2accc57829d2a00d9ea3de063e09
bac6c52dd2f788b60ef4a06892959b9a6bf3b1be
/app/src/main/java/skot/datadebaser/FoodItem.java
13f43f07c74dd26c842f9499f07de3d2a1b53582
[]
no_license
BaronVasDeferens/dataDebaser
d916b948a01fa6c04f69d5f5b2791909b8b5266a
572bfb0e026a69c1e48e9a11853de703f4c8dc80
refs/heads/master
2020-09-12T04:06:18.650157
2019-11-18T15:11:07
2019-11-18T15:11:07
222,298,710
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package skot.datadebaser; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; import android.support.annotation.NonNull; import java.sql.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; /** * Food Item * (or maybe more accurately, "list item") * Describes a repeatedly-purchased item and when it was initially added. */ @Entity(tableName = "fooditem", primaryKeys = {"itemname"}) public class FoodItem { @ColumnInfo(name = "itemname") @NonNull private String itemName; @ColumnInfo(name = "datecreated") private long dateCreated; public FoodItem(@NonNull String itemName) { this.itemName = itemName; } @NonNull public String getItemName() { return itemName; } public void setItemName(String itemName) { this.itemName = itemName; } public long getDateCreated() { return dateCreated; } public void setDateCreated(long dateCreated) { this.dateCreated = dateCreated; } public Date getDateCreatedInterp() { Date date = new Date(dateCreated); String formatted = DateFormat.getDateInstance().format(date); System.out.println(">>> " + formatted); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String format2 = simpleDateFormat.format(date); System.out.println("format2 = " + format2); return date; } public String getDateAsString() { Date date = new Date(dateCreated); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); return simpleDateFormat.format(date); } }
73759d3c291a7708cf66216b9b8f69d4f20a1952
efb8cb353d96272de13ca7bb9196655e511c4897
/src/rsalesc/roborio/utils/stats/SegmentTrie.java
870e841c4a07d84c1f4572ee86a50fd4da6e8a2b
[]
no_license
rsalesc/roborio
4c16a7e4cbc6605341ae37ee94d706adc8179e8b
a74b1cba3237e2cecaa45f65cca152663c20e74a
refs/heads/master
2021-03-19T11:53:22.724539
2017-08-31T05:26:47
2017-08-31T05:26:47
98,042,244
1
0
null
null
null
null
UTF-8
Java
false
false
2,211
java
package rsalesc.roborio.utils.stats; /** * Created by Roberto Sales on 27/07/17. */ public class SegmentTrie<T> { private int[] segments; private int[][] transitions; private Object[] data; private int length; private int created; private int depth; private int rootIndex; public SegmentTrie(int[] segments) { this.segments = segments; depth = segments.length; length = 2; created = 0; transitions = new int[length][]; data = new Object[length]; rootIndex = makeNode(0); } private int makeNode(int level) { if(created >= length) { int[][] newTransitions = new int[length * 2][]; System.arraycopy(transitions, 0, newTransitions, 0, length); transitions = newTransitions; Object[] newData = new Object[length * 2]; System.arraycopy(data, 0, newData, 0, length); data = newData; length = length * 2; } transitions[created] = new int[level >= depth ? 0 : segments[level]]; for(int i = 0; i < transitions[created].length; i++) transitions[created][i] = -1; data[created] = null; return created++; } public void add(int[] attributes, T payload) { if(attributes.length != depth) throw new IllegalArgumentException(); int cur = rootIndex; for(int i = 0; i < depth; i++) { int next = transitions[cur][attributes[i]]; if(next == -1) next = (transitions[cur][attributes[i]] = makeNode(i+1)); cur = next; } data[cur] = payload; } @SuppressWarnings("unchecked") public T get(int[] attributes) { if(attributes.length != depth) throw new IllegalArgumentException(); int cur = rootIndex; for(int i = 0; i < depth; i++) { int next = transitions[cur][attributes[i]]; if(next == -1) return null; cur = next; } return (T) data[cur]; } public void add(int[] attributes) { add(attributes, null); } }
7c444509bfdd9b353ee56141e462126e1318bec2
f8dded68b9125a95e64745b3838c664b11ce7bbe
/cdm/src/main/java/ucar/nc2/iosp/nexrad2/Level2Record.java
2bd4e37c415122ba6b009ee19dd6059c08b9b662
[ "NetCDF" ]
permissive
melissalinkert/netcdf
8d01f27f377b0b6639ac47bfc891e1b92e5b3bd1
18482c15fce43a4b378dacdc9177ec600280c903
refs/heads/master
2016-09-09T19:25:59.885325
2012-02-07T01:44:35
2012-02-07T01:44:35
3,373,307
1
4
null
null
null
null
UTF-8
Java
false
false
41,460
java
/* * Copyright 1998-2009 University Corporation for Atmospheric Research/Unidata * * Portions of this software were developed by the Unidata Program at the * University Corporation for Atmospheric Research. * * Access and use of this software shall impose the following obligations * and understandings on the user. The user is granted the right, without * any fee or cost, to use, copy, modify, alter, enhance and distribute * this software, and any derivative works thereof, and its supporting * documentation for any purpose whatsoever, provided that this entire * notice appears in all copies of the software, derivative works and * supporting documentation. Further, UCAR requests that the user credit * UCAR/Unidata in any publications that result from the use of this * software or in any product that includes this software. The names UCAR * and/or Unidata, however, may not be used in any advertising or publicity * to endorse or promote any products or commercial entity unless specific * written permission is obtained from UCAR/Unidata. The user also * understands that UCAR/Unidata is not obligated to provide the user with * any support, consulting, training or assistance of any kind with regard * to the use, operation and performance of this software nor to provide * the user with any updates, revisions, new versions or "bug fixes." * * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. */ package ucar.nc2.iosp.nexrad2; import ucar.unidata.io.RandomAccessFile; import ucar.ma2.IndexIterator; import ucar.ma2.Range; import java.io.IOException; import java.io.PrintStream; import java.util.Date; /** * This class reads one record (radial) in an NEXRAD level II file. * File must be uncompressed. * Not handling messages yet, only data. * <p> * 10/16/05: Now returns data as a byte, so use scale and offset. * * Adapted with permission from the Java Iras software developed by David Priegnitz at NSSL. * * @author caron * @author David Priegnitz */ public class Level2Record { /** Reflectivity moment identifier */ public static final int REFLECTIVITY = 1; /** Radial Velocity moment identifier */ public static final int VELOCITY_HI = 2; /** Radial Velocity moment identifier */ public static final int VELOCITY_LOW = 4; /** Sprectrum Width moment identifier */ public static final int SPECTRUM_WIDTH = 3; /** Low doppler resolution code */ public static final int DOPPLER_RESOLUTION_LOW_CODE = 4; /** High doppler resolution code */ public static final int DOPPLER_RESOLUTION_HIGH_CODE = 2; /** Horizontal beam width */ public static final float HORIZONTAL_BEAM_WIDTH = (float) 1.5; // LOOK /* added for high resolution message type 31 */ public static final int REFLECTIVITY_HIGH = 5; /** High Resolution Radial Velocity moment identifier */ public static final int VELOCITY_HIGH = 6; /** High Resolution Sprectrum Width moment identifier */ public static final int SPECTRUM_WIDTH_HIGH = 7; /** High Resolution Radial Velocity moment identifier */ public static final int DIFF_REFLECTIVITY_HIGH = 8; /** High Resolution Radial Velocity moment identifier */ public static final int DIFF_PHASE = 9; /** High Resolution Sprectrum Width moment identifier */ public static final int CORRELATION_COEFFICIENT = 10; // Lookup Tables /** Initialization flag for lookup tables public static int data_lut_init_flag = 0; /** Reflectivity look up table public static float[] Reflectivity_LUT = new float[256]; /** 1 km Velocity look up table public static float[] Velocity_1km_LUT = new float[256]; /** 1/2 km Velocity look up table public static float[] Velocity_hkm_LUT = new float[256]; static { Reflectivity_LUT[0] = 0.0f; // Float.NaN; //(float) SIGNAL_BELOW_THRESHOLD; Reflectivity_LUT[1] = Float.NaN; //(float) SIGNAL_OVERLAID; Velocity_1km_LUT[0] = 0.0f; // Float.NaN; //(float) SIGNAL_BELOW_THRESHOLD; Velocity_1km_LUT[1] = Float.NaN; //(float) SIGNAL_OVERLAID; Velocity_hkm_LUT[0] = 0.0f; // Float.NaN; //(float) SIGNAL_BELOW_THRESHOLD; Velocity_hkm_LUT[1] = Float.NaN; //(float) SIGNAL_OVERLAID; for (int i = 2; i < 256; i++) { Reflectivity_LUT[i] = (float) (i / 2.0 - 33.0); Velocity_1km_LUT[i] = (float) (i - 129.0); Velocity_hkm_LUT[i] = (float) (i / 2.0 - 64.5); // also spectrum width } } */ public static final byte MISSING_DATA = (byte) 1; public static final byte BELOW_THRESHOLD = (byte) 0; /** Size of the file header, aka title */ static final int FILE_HEADER_SIZE = 24; /** Size of the CTM record header */ private static final int CTM_HEADER_SIZE = 12; /** Size of the the message header, to start of the data message */ private static final int MESSAGE_HEADER_SIZE = 28; /** Size of the entire message, if its a radar data message */ private static final int RADAR_DATA_SIZE = 2432; static public String getDatatypeName( int datatype) { switch (datatype) { case REFLECTIVITY : return "Reflectivity"; case VELOCITY_HI : case VELOCITY_LOW : return "RadialVelocity"; case SPECTRUM_WIDTH : return "SpectrumWidth"; case REFLECTIVITY_HIGH : return "Reflectivity_HI"; case VELOCITY_HIGH : return "RadialVelocity_HI"; case SPECTRUM_WIDTH_HIGH : return "SpectrumWidth_HI"; case DIFF_REFLECTIVITY_HIGH : return "Reflectivity_DIFF"; case DIFF_PHASE : return "Phase"; case CORRELATION_COEFFICIENT : return "RHO"; default : throw new IllegalArgumentException(); } } static public String getDatatypeUnits(int datatype) { switch (datatype) { case REFLECTIVITY : return "dBz"; case VELOCITY_HI : case VELOCITY_LOW : case SPECTRUM_WIDTH : return "m/s"; case REFLECTIVITY_HIGH : return "dBz"; case DIFF_REFLECTIVITY_HIGH : return "dBz"; case VELOCITY_HIGH : case SPECTRUM_WIDTH_HIGH : return "m/s"; case DIFF_PHASE : return "deg"; case CORRELATION_COEFFICIENT : return "N/A"; } throw new IllegalArgumentException(); } public short getDatatypeSNRThreshhold(int datatype) { switch (datatype) { case REFLECTIVITY_HIGH : return ref_snr_threshold; case VELOCITY_HIGH : return vel_snr_threshold; case SPECTRUM_WIDTH_HIGH : return sw_snr_threshold; case DIFF_REFLECTIVITY_HIGH : return zdrHR_snr_threshold; case DIFF_PHASE : return phiHR_snr_threshold; case CORRELATION_COEFFICIENT : return rhoHR_snr_threshold; default : throw new IllegalArgumentException(); } } public short getDatatypeRangeFoldingThreshhold(int datatype) { switch (datatype) { case REFLECTIVITY_HIGH : return ref_rf_threshold; case VELOCITY_HIGH : return vel_rf_threshold; case SPECTRUM_WIDTH_HIGH : return sw_rf_threshold; case REFLECTIVITY : case VELOCITY_LOW : case VELOCITY_HI : case SPECTRUM_WIDTH : return threshhold; case DIFF_REFLECTIVITY_HIGH : return zdrHR_rf_threshold; case DIFF_PHASE : return phiHR_rf_threshold; case CORRELATION_COEFFICIENT : return rhoHR_rf_threshold; default : throw new IllegalArgumentException(); } } public float getDatatypeScaleFactor(int datatype) { switch (datatype) { case REFLECTIVITY: return 0.5f; case VELOCITY_LOW : return 1.0f; case VELOCITY_HI: case SPECTRUM_WIDTH : return 0.5f; case REFLECTIVITY_HIGH : return 1/reflectHR_scale; case VELOCITY_HIGH : return 1/velocityHR_scale; case SPECTRUM_WIDTH_HIGH : return 1/spectrumHR_scale; case DIFF_REFLECTIVITY_HIGH : return 1.0f/zdrHR_scale; case DIFF_PHASE : return 1.0f/phiHR_scale; case CORRELATION_COEFFICIENT : return 1.0f/rhoHR_scale; default : throw new IllegalArgumentException(); } } public float getDatatypeAddOffset(int datatype) { switch (datatype) { case REFLECTIVITY : return -33.0f; case VELOCITY_LOW : return -129.0f; case VELOCITY_HI: case SPECTRUM_WIDTH : return -64.5f; case REFLECTIVITY_HIGH : return reflectHR_addoffset*(-1)/reflectHR_scale; case VELOCITY_HIGH : return velocityHR_addoffset*(-1)/velocityHR_scale; case SPECTRUM_WIDTH_HIGH : return spectrumHR_addoffset*(-1)/spectrumHR_scale; case DIFF_REFLECTIVITY_HIGH : return zdrHR_addoffset*(-1)/zdrHR_scale; case DIFF_PHASE : return phiHR_addoffset*(-1)/phiHR_scale; case CORRELATION_COEFFICIENT : return rhoHR_addoffset*(-1)/rhoHR_scale; default : throw new IllegalArgumentException(); } } static public String getMessageTypeName( int code) { switch (code) { case 1 : return "digital radar data"; case 2 : return "RDA status data"; case 3 : return "performance/maintainence data"; case 4 : return "console message - RDA to RPG"; case 5 : return "maintainence log data"; case 6 : return "RDA control ocmmands"; case 7 : return "volume coverage pattern"; case 8 : return "clutter censor zones"; case 9 : return "request for data"; case 10 : return "console message - RPG to RDA"; case 11 : return "loop back test - RDA to RPG"; case 12 : return "loop back test - RPG to RDA"; case 13 : return "clutter filter bypass map - RDA to RPG"; case 14 : return "edited clutter filter bypass map - RDA to RPG"; case 15: return "Notchwidth Map"; case 18: return "RDA Adaptation data"; case 31: return "Digitail Radar Data Generic Format"; default : return "unknown "+code; } } static public String getRadialStatusName( int code) { switch (code) { case 0 : return "start of new elevation"; case 1 : return "intermediate radial"; case 2 : return "end of elevation"; case 3 : return "begin volume scan"; case 4 : return "end volume scan"; default : return "unknown "+code; } } static public String getVolumeCoveragePatternName( int code) { switch (code) { case 11 : return "16 elevation scans every 5 mins"; case 12 : return "14 elevation scan every 4.1 mins"; case 21 : return "11 elevation scans every 6 mins"; case 31 : return "8 elevation scans every 10 mins"; case 32 : return "7 elevation scans every 10 mins"; case 121: return "9 elevations, 20 scans every 5 minutes"; case 211: return "14 elevations, 16 scans every 5 mins"; case 212: return "14 elevations, 17 scans every 4 mins"; case 221: return "9 elevations, 11 scans every 5 minutes"; default : return "unknown "+code; } } static public java.util.Date getDate(int julianDays, int msecs) { long total = ((long) (julianDays - 1)) * 24 * 3600 * 1000 + msecs; return new Date( total); } static private org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Level2Record.class); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// int recno; // record number within the file long message_offset; // offset of start of message boolean hasReflectData, hasDopplerData; boolean hasHighResREFData; boolean hasHighResVELData; boolean hasHighResSWData ; boolean hasHighResZDRData ; boolean hasHighResPHIData ; boolean hasHighResRHOData ; // message header short message_size = 0; byte id_channel = 0; public byte message_type = 0; short id_sequence = 0; short mess_julian_date = 0; int mess_msecs = 0; short seg_count = 0; short seg_number = 0; // radar data header int data_msecs = 0; short data_julian_date = 0; short unamb_range = 0; int azimuth_ang = 0; short radial_num = 0; // radial number within the elevation : starts with one short radial_status = 0; short elevation_ang = 0; short elevation_num = 0; short reflect_first_gate = 0; // distance to first reflectivity gate (m) short reflect_gate_size = 0; // reflectivity gate size (m) short reflect_gate_count = 0; // number of reflectivity gates short doppler_first_gate = 0; // distance to first reflectivity gate (m) short doppler_gate_size = 0; // reflectivity gate size (m) short doppler_gate_count = 0; // number of reflectivity gates short cut = 0; float calibration = 0; // system gain calibration constant (db biased) short resolution = 0; // dopplar velocity resolution short vcp = 0; // volume coverage pattern short nyquist_vel; // nyquist velocity short attenuation; // atmospheric attenuation factor short threshhold; // threshhold paramter for minimum difference short ref_snr_threshold; // reflectivity signal to noise threshhold short vel_snr_threshold; short sw_snr_threshold; short zdrHR_snr_threshold; short phiHR_snr_threshold; short rhoHR_snr_threshold; short ref_rf_threshold; // reflectivity range folding threshhold short vel_rf_threshold; short sw_rf_threshold; short zdrHR_rf_threshold; short phiHR_rf_threshold; short rhoHR_rf_threshold; private short reflect_offset; // reflectivity data pointer (byte number from start of message) private short velocity_offset; // velocity data pointer (byte number from start of message) private short spectWidth_offset; // spectrum-width data pointer (byte number from start of message) // new addition for message type 31 short rlength = 0; String id; float azimuth; byte compressIdx; byte sp; byte ars; byte rs; float elevation; byte rsbs; byte aim; short dcount; int dbp1; int dbp2; int dbp3; int dbp4; int dbp5; int dbp6; int dbp7; int dbp8; int dbp9; short reflectHR_gate_count = 0; short velocityHR_gate_count = 0; short spectrumHR_gate_count = 0; float reflectHR_scale = 0; float velocityHR_scale = 0; float spectrumHR_scale = 0; float zdrHR_scale = 0; float phiHR_scale = 0; float rhoHR_scale = 0; float reflectHR_addoffset = 0; float velocityHR_addoffset = 0; float spectrumHR_addoffset = 0; float zdrHR_addoffset = 0; float phiHR_addoffset = 0; float rhoHR_addoffset = 0; short reflectHR_offset = 0; short velocityHR_offset = 0; short spectrumHR_offset = 0; short zdrHR_offset = 0; short phiHR_offset = 0; short rhoHR_offset = 0; short zdrHR_gate_count = 0; short phiHR_gate_count = 0; short rhoHR_gate_count = 0; short reflectHR_gate_size = 0; short velocityHR_gate_size = 0; short spectrumHR_gate_size = 0; short zdrHR_gate_size = 0; short phiHR_gate_size = 0; short rhoHR_gate_size = 0; short reflectHR_first_gate = 0; short velocityHR_first_gate = 0; short spectrumHR_first_gate = 0; short zdrHR_first_gate = 0; short phiHR_first_gate = 0; short rhoHR_first_gate = 0; public static Level2Record factory(RandomAccessFile din, int record, long message_offset31) throws IOException { long offset = record * RADAR_DATA_SIZE + FILE_HEADER_SIZE + message_offset31; if (offset >= din.length()) return null; else return new Level2Record(din, record, message_offset31); } public Level2Record(RandomAccessFile din, int record, long message_offset31) throws IOException { this.recno = record; message_offset = record * RADAR_DATA_SIZE + FILE_HEADER_SIZE + message_offset31; din.seek(message_offset); din.skipBytes(CTM_HEADER_SIZE); // Message Header // int size = din.readInt(); message_size = din.readShort(); // size in "halfwords" = 2 bytes id_channel = din.readByte(); // channel id message_type = din.readByte(); id_sequence = din.readShort(); mess_julian_date = din.readShort(); // from 1/1/70; prob "message generation time" mess_msecs = din.readInt(); // message generation time seg_count = din.readShort(); // number of message segments seg_number = din.readShort(); // this segment // if (message_type != 1 ) return; if(message_type == 1) { // data header data_msecs = din.readInt(); // collection time for this radial, msecs since midnight data_julian_date = din.readShort(); // prob "collection time" unamb_range = din.readShort(); // unambiguous range azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ?? radial_num = din.readShort(); // radial number within the elevation radial_status = din.readShort(); elevation_ang = din.readShort(); elevation_num = din.readShort(); // RDA elevation number reflect_first_gate = din.readShort(); // range to first gate of reflectivity (m) may be negetive doppler_first_gate = din.readShort(); // range to first gate of dopplar (m) may be negetive reflect_gate_size = din.readShort(); // reflectivity data gate size (m) doppler_gate_size = din.readShort(); // dopplar data gate size (m) reflect_gate_count = din.readShort(); // number of reflectivity gates doppler_gate_count = din.readShort(); // number of velocity or spectrum width gates cut = din.readShort(); // sector number within cut calibration = din.readFloat(); // system gain calibration constant (db biased) reflect_offset = din.readShort(); // reflectivity data pointer (byte number from start of message) velocity_offset = din.readShort(); // velocity data pointer (byte number from start of message) spectWidth_offset = din.readShort(); // spectrum-width data pointer (byte number from start of message) resolution = din.readShort(); // dopplar velocity resolution vcp = din.readShort(); // volume coverage pattern din.skipBytes(14); nyquist_vel = din.readShort(); // nyquist velocity attenuation = din.readShort(); // atmospheric attenuation factor threshhold = din.readShort(); // threshhold paramter for minimum difference hasReflectData = (reflect_gate_count > 0); hasDopplerData = (doppler_gate_count > 0); return; } else if(message_type == 31) { // data header id = din.readString(4); data_msecs = din.readInt(); // collection time for this radial, msecs since midnight data_julian_date = din.readShort(); // prob "collection time" radial_num = din.readShort(); // radial number within the elevation azimuth = din.readFloat(); // LOOK why unsigned ?? compressIdx = din.readByte(); sp = din.readByte(); rlength = din.readShort(); ars = din.readByte(); rs = din.readByte(); elevation_num = din.readByte(); // RDA elevation number cut = din.readByte(); // sector number within cut elevation = din.readFloat(); rsbs = din.readByte(); aim = din.readByte(); dcount = din.readShort(); dbp1 = din.readInt(); dbp2 = din.readInt(); dbp3 = din.readInt(); dbp4 = din.readInt(); dbp5 = din.readInt(); dbp6 = din.readInt(); dbp7 = din.readInt(); dbp8 = din.readInt(); dbp9 = din.readInt(); vcp = getDataBlockValue(din, (short) dbp1, 40); int dbpp4 = 0; int dbpp5 = 0; int dbpp6 = 0; int dbpp7 = 0; int dbpp8 = 0; int dbpp9 = 0; if(dbp4 > 0) { String tname = getDataBlockStringValue(din, (short) dbp4, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp4; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp4; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp4; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp4; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp4; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp4; } else { System.out.println("Missing radial product"); } } if(dbp5 > 0) { String tname = getDataBlockStringValue(din, (short) dbp5, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp5; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp5; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp5; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp5; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp5; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp5; } else { System.out.println("Missing radial product"); } } if(dbp6 > 0) { String tname = getDataBlockStringValue(din, (short) dbp6, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp6; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp6; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp6; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp6; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp6; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp6; } else { System.out.println("Missing radial product"); } } if(dbp7 > 0) { String tname = getDataBlockStringValue(din, (short) dbp7, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp7; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp7; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp7; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp7; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp7; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp7; } else { System.out.println("Missing radial product"); } } if(dbp8 > 0) { String tname = getDataBlockStringValue(din, (short) dbp8, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp8; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp8; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp8; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp8; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp8; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp8; } else { System.out.println("Missing radial product"); } } if(dbp9 > 0) { String tname = getDataBlockStringValue(din, (short) dbp9, 1,3); if(tname.startsWith("REF")) { hasHighResREFData = true; dbpp4 = dbp9; } else if (tname.startsWith("VEL")) { hasHighResVELData = true; dbpp5 = dbp9; } else if (tname.startsWith("SW")) { hasHighResSWData = true; dbpp6 = dbp9; } else if (tname.startsWith("ZDR")) { hasHighResZDRData = true; dbpp7 = dbp9; } else if (tname.startsWith("PHI")) { hasHighResPHIData = true; dbpp8 = dbp9; } else if (tname.startsWith("RHO")) { hasHighResRHOData = true; dbpp9 = dbp9; } else { System.out.println("Missing radial product"); } } //hasHighResREFData = (dbp4 > 0); if(hasHighResREFData ) { reflectHR_gate_count = getDataBlockValue(din, (short) dbpp4, 8); reflectHR_first_gate = getDataBlockValue(din, (short) dbpp4, 10); reflectHR_gate_size = getDataBlockValue(din, (short) dbpp4, 12); ref_rf_threshold = getDataBlockValue(din, (short) dbpp4, 14); ref_snr_threshold = getDataBlockValue(din, (short) dbpp4, 16); reflectHR_scale = getDataBlockValue1(din, (short) dbpp4, 20); reflectHR_addoffset = getDataBlockValue1(din, (short) dbpp4, 24); reflectHR_offset = (short)( dbpp4+ 28); } //hasHighResVELData = (dbp5 > 0); if(hasHighResVELData) { velocityHR_gate_count = getDataBlockValue(din, (short) dbpp5, 8); velocityHR_first_gate = getDataBlockValue(din, (short) dbpp5, 10); velocityHR_gate_size = getDataBlockValue(din, (short) dbpp5, 12); vel_rf_threshold = getDataBlockValue(din, (short) dbpp5, 14); vel_snr_threshold = getDataBlockValue(din, (short) dbpp5, 16); velocityHR_scale = getDataBlockValue1(din, (short) dbpp5, 20); velocityHR_addoffset = getDataBlockValue1(din, (short) dbpp5, 24); velocityHR_offset = (short)( dbpp5+ 28); } // hasHighResSWData = (dbp6 > 0); if(hasHighResSWData) { spectrumHR_gate_count = getDataBlockValue(din, (short) dbpp6, 8); spectrumHR_first_gate = getDataBlockValue(din, (short) dbpp6, 10); spectrumHR_gate_size = getDataBlockValue(din, (short) dbpp6, 12); sw_rf_threshold = getDataBlockValue(din, (short) dbpp6, 14); sw_snr_threshold = getDataBlockValue(din, (short) dbpp6, 16); spectrumHR_scale = getDataBlockValue1(din, (short) dbpp6, 20); spectrumHR_addoffset = getDataBlockValue1(din, (short) dbpp6, 24); spectrumHR_offset = (short) (dbpp6 + 28); } // hasHighResZDRData = (dbp7 > 0); if(hasHighResZDRData) { zdrHR_gate_count = getDataBlockValue(din, (short) dbpp7, 8); zdrHR_first_gate = getDataBlockValue(din, (short) dbpp7, 10); zdrHR_gate_size = getDataBlockValue(din, (short) dbpp7, 12); zdrHR_rf_threshold = getDataBlockValue(din, (short) dbpp7, 14); zdrHR_snr_threshold = getDataBlockValue(din, (short) dbpp7, 16); zdrHR_scale = getDataBlockValue1(din, (short) dbpp7, 20); zdrHR_addoffset = getDataBlockValue1(din, (short) dbpp7, 24); zdrHR_offset = (short) (dbpp7 + 28); } //hasHighResPHIData = (dbp8 > 0); if(hasHighResPHIData) { phiHR_gate_count = getDataBlockValue(din, (short) dbpp8, 8); phiHR_first_gate = getDataBlockValue(din, (short) dbpp8, 10); phiHR_gate_size = getDataBlockValue(din, (short) dbpp8, 12); phiHR_rf_threshold = getDataBlockValue(din, (short) dbpp8, 14); phiHR_snr_threshold = getDataBlockValue(din, (short) dbpp8, 16); phiHR_scale = getDataBlockValue1(din, (short) dbpp8, 20); phiHR_addoffset = getDataBlockValue1(din, (short) dbpp8, 24); phiHR_offset = (short) (dbpp8 + 28); } //hasHighResRHOData = (dbp9 > 0); if(hasHighResRHOData) { rhoHR_gate_count = getDataBlockValue(din, (short) dbpp9, 8); rhoHR_first_gate = getDataBlockValue(din, (short) dbpp9, 10); rhoHR_gate_size = getDataBlockValue(din, (short) dbpp9, 12); rhoHR_rf_threshold = getDataBlockValue(din, (short) dbpp9, 14); rhoHR_snr_threshold = getDataBlockValue(din, (short) dbpp9, 16); rhoHR_scale = getDataBlockValue1(din, (short) dbpp9, 20); rhoHR_addoffset = getDataBlockValue1(din, (short) dbpp9, 24); rhoHR_offset = (short) (dbpp9 + 28); } return; } else return; } public void dumpMessage(PrintStream out) { out.println(recno+" ---------------------"); out.println(" message type = "+getMessageTypeName(message_type)+" ("+message_type+")"); out.println(" message size = "+message_size+" segment="+seg_number+"/"+seg_count); } public void dump(PrintStream out) { out.println(recno+" ------------------------------------------"+message_offset); out.println(" message type = "+getMessageTypeName(message_type)); out.println(" data date = "+data_julian_date+" : "+data_msecs); out.println(" elevation = "+getElevation()+" ("+elevation_num+")"); out.println(" azimuth = "+getAzimuth()); out.println(" radial = "+radial_num+" status= "+getRadialStatusName( radial_status)+ " ratio = "+getAzimuth()/radial_num); out.println(" reflectivity first= "+reflect_first_gate+" size= "+reflect_gate_size+" count= "+reflect_gate_count); out.println(" doppler first= "+doppler_first_gate+" size= "+doppler_gate_size+" count= "+doppler_gate_count); out.println(" offset: reflect= "+reflect_offset+" velocity= "+velocity_offset+" spWidth= "+spectWidth_offset); out.println(" pattern = "+vcp+" cut= "+cut); } public void dump2(PrintStream out) { out.println("recno= " + recno+ " massType= "+message_type+" massSize = "+message_size); } public boolean checkOk() { boolean ok = true; if ( Float.isNaN(getAzimuth()) ) { logger.warn("****"+recno+ " HAS bad azimuth value = "+ azimuth_ang); ok = false; } if (message_type != 1) return ok; if ((seg_count != 1) || (seg_number != 1)) { logger.warn("*** segment = "+seg_number+"/"+seg_count+who()); } if ((reflect_offset < 0) || (reflect_offset > RADAR_DATA_SIZE)) { logger.warn("****"+recno+ " HAS bad reflect offset= "+reflect_offset+who()); ok = false; } if ((velocity_offset < 0) || (velocity_offset > RADAR_DATA_SIZE)) { logger.warn("****"+recno+ " HAS bad velocity offset= "+velocity_offset+who()); ok = false; } if ((spectWidth_offset < 0) || (spectWidth_offset > RADAR_DATA_SIZE)) { logger.warn("****"+recno+ " HAS bad spwidth offset= "+reflect_offset+who()); ok = false; } if ((velocity_offset > 0) && (spectWidth_offset <= 0)) { logger.warn("****"+recno+ " HAS velocity NOT spectWidth!!"+who()); ok = false; } if ((velocity_offset <= 0) && (spectWidth_offset > 0)) { logger.warn("****"+recno+ " HAS spectWidth AND NOT velocity!!"+who()); ok = false; } if (mess_julian_date != data_julian_date) { logger.warn("*** message date = "+mess_julian_date+" : "+mess_msecs+who()+"\n"+ " data date = "+data_julian_date+" : "+data_msecs); ok = false; } if (!hasReflectData && !hasDopplerData) { logger.info("*** no reflect or dopplar = "+who()); } return ok; } private String who() { return " message("+recno +" "+ message_offset+")"; } /** * Get the azimuth in degrees * * @return azimuth angle in degrees 0 = true north, 90 = east */ public float getAzimuth() { if( message_type == 31) return azimuth; else if (message_type == 1) return 180.0f * azimuth_ang / 32768.0f; else return -1.0f; } /** * Get the elevation angle in degrees * * @return elevation angle in degrees 0 = parellel to pedestal base, 90 = perpendicular */ public float getElevation() { if( message_type == 31) return elevation; else if (message_type == 1) return 180.0f * elevation_ang / 32768.0f; else return -1.0f; } /** * This method returns the gate size in meters * @param datatype which type of data : REFLECTIVITY, VELOCITY_HI, VELOCITY_LO, SPECTRUM_WIDTH * @return the gate size in meters */ public int getGateSize(int datatype) { switch (datatype) { case REFLECTIVITY : return ((int) reflect_gate_size); case VELOCITY_HI : case VELOCITY_LOW : case SPECTRUM_WIDTH : return ((int) doppler_gate_size); //high resolution case REFLECTIVITY_HIGH : return ((int) reflectHR_gate_size); case VELOCITY_HIGH : return ((int) velocityHR_gate_size); case SPECTRUM_WIDTH_HIGH : return ((int) spectrumHR_gate_size); case DIFF_REFLECTIVITY_HIGH : return ((int) zdrHR_gate_size); case DIFF_PHASE : return ((int) phiHR_gate_size); case CORRELATION_COEFFICIENT : return ((int) rhoHR_gate_size); } return -1; } /** * This method returns the starting gate in meters * @param datatype which type of data : REFLECTIVITY, VELOCITY_HI, VELOCITY_LO, SPECTRUM_WIDTH * @return the starting gate in meters */ public int getGateStart(int datatype) { switch (datatype) { case REFLECTIVITY : return ((int) reflect_first_gate); case VELOCITY_HI : case VELOCITY_LOW : case SPECTRUM_WIDTH : return ((int) doppler_first_gate); //high resolution case REFLECTIVITY_HIGH : return ((int) reflectHR_first_gate); case VELOCITY_HIGH : return ((int) velocityHR_first_gate); case SPECTRUM_WIDTH_HIGH : return ((int) spectrumHR_first_gate); case DIFF_REFLECTIVITY_HIGH : return ((int) zdrHR_first_gate); case DIFF_PHASE : return ((int) phiHR_first_gate); case CORRELATION_COEFFICIENT : return ((int) rhoHR_first_gate); } return -1; } /** * This method returns the number of gates * @param datatype which type of data : REFLECTIVITY, VELOCITY_HI, VELOCITY_LO, SPECTRUM_WIDTH * @return the number of gates */ public int getGateCount(int datatype) { switch (datatype) { case REFLECTIVITY : return ((int) reflect_gate_count); case VELOCITY_HI : case VELOCITY_LOW : case SPECTRUM_WIDTH : return ((int) doppler_gate_count); // hight resolution case REFLECTIVITY_HIGH : return ((int) reflectHR_gate_count); case VELOCITY_HIGH : return ((int) velocityHR_gate_count); case SPECTRUM_WIDTH_HIGH : return ((int) spectrumHR_gate_count); case DIFF_REFLECTIVITY_HIGH : return ((int) zdrHR_gate_count); case DIFF_PHASE : return ((int) phiHR_gate_count); case CORRELATION_COEFFICIENT : return ((int) rhoHR_gate_count); } return 0; } private short getDataOffset(int datatype) { switch (datatype) { case REFLECTIVITY : return reflect_offset; case VELOCITY_HI : case VELOCITY_LOW : return velocity_offset; case SPECTRUM_WIDTH : return spectWidth_offset; case REFLECTIVITY_HIGH : return reflectHR_offset; case VELOCITY_HIGH : return velocityHR_offset; case SPECTRUM_WIDTH_HIGH : return spectrumHR_offset; case DIFF_REFLECTIVITY_HIGH : return zdrHR_offset; case DIFF_PHASE : return phiHR_offset; case CORRELATION_COEFFICIENT : return (short)rhoHR_offset; } return Short.MIN_VALUE; } private short getDataBlockValue(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readShort(); } private String getDataBlockStringValue(RandomAccessFile raf, short offset, int skip, int size) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readString(size); } private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException { long off = offset + message_offset + MESSAGE_HEADER_SIZE; raf.seek(off); raf.skipBytes(skip); return raf.readFloat(); } public java.util.Date getDate() { return getDate( data_julian_date, data_msecs); } /** * Read data from this record. * @param raf read from this file * @param datatype which type of data : REFLECTIVITY, VELOCITY_HI, VELOCITY_LO, SPECTRUM_WIDTH * @param gateRange handles the possible subset of data to return * @param ii put the data here * @throws IOException on read error */ public void readData(RandomAccessFile raf, int datatype, Range gateRange, IndexIterator ii) throws IOException { long offset = message_offset; offset += MESSAGE_HEADER_SIZE; // offset is from "start of digital radar data message header" offset += getDataOffset( datatype); raf.seek(offset); if (logger.isDebugEnabled()) { logger.debug(" read recno "+recno+" at offset "+offset+" count= "+getGateCount(datatype)); logger.debug(" offset: reflect= "+reflect_offset+" velocity= "+velocity_offset+" spWidth= "+spectWidth_offset); } int dataCount = getGateCount( datatype); if( datatype == DIFF_PHASE) { short[] data = new short[dataCount]; raf.readShort(data, 0, dataCount); for (int i = gateRange.first(); i <= gateRange.last(); i += gateRange.stride()) { if (i >= dataCount) ii.setShortNext(MISSING_DATA); else ii.setShortNext(data[i]); } } else { byte[] data = new byte[dataCount]; raf.readFully(data); //short [] ds = convertunsignedByte2Short(data); for (int i = gateRange.first(); i <= gateRange.last(); i += gateRange.stride()) { if (i >= dataCount) ii.setByteNext(MISSING_DATA); else ii.setByteNext(data[i]); } } } /** * Instances which have same content are equal. * public boolean equals(Object oo) { if (this == oo) return true; if ( !(oo instanceof Level2Record)) return false; return hashCode() == oo.hashCode(); } /** Override Object.hashCode() to implement equals. * public int hashCode() { if (hashCode == 0) { int result = 17; result = 37*result + elevation_num; //result = 37*result + cut; //result = 37*result + datatype; hashCode = result; } return hashCode; } private volatile int hashCode = 0; */ public short[] convertunsignedByte2Short(byte[] inb) { int len = inb.length; short [] outs = new short[len]; int i = 0; for(byte b: inb){ outs[i++] = convertunsignedByte2Short(b); } return outs; } public short convertunsignedByte2Short(byte b) { return (short) ((b < 0) ? (short) b + 256 : (short) b); } public String toString() { return "elev= "+elevation_num+" radial_num = "+radial_num; } }
4992f40bd89d17651f04adcc199148dc9eea94a9
1faf20fa9c385090163f44426776160c3cf973bd
/base-sdk/src/main/java/com/why/base/cache/ActicityLifeCycle.java
563e9cf3519720f025c865c0c7b8b8639ff56bf5
[]
no_license
hongyunwu/base-sdk
3d3390f48994e2700998fde54e277340462adf27
d176370c9f300897d2d540851d24576268aba8a0
refs/heads/master
2021-01-15T17:28:56.237780
2018-06-20T10:20:09
2018-06-20T10:20:09
99,755,689
1
1
null
null
null
null
UTF-8
Java
false
false
3,860
java
package com.why.base.cache; import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.ViewTreeObserver; import android.view.inputmethod.InputMethodManager; import com.squareup.leakcanary.RefWatcher; import com.why.base.utils.IMMLeaks; import com.why.base.utils.LogUtils; import java.lang.reflect.Field; import java.lang.reflect.Method; import static android.content.Context.INPUT_METHOD_SERVICE; import static android.os.Build.VERSION.SDK_INT; import static android.os.Build.VERSION_CODES.KITKAT; /** * Created by wuhongyun on 17-8-28. * * 可以在此处理一些性能监听,统计事件 */ class ActicityLifeCycle implements Application.ActivityLifecycleCallbacks { private AppCache mAppCache; private InputMethodManager inputMethodManager; private Field mServedViewField; private Field mHField; private Method finishInputLockedMethod; public ActicityLifeCycle(AppCache appCache) { this.mAppCache = appCache; initIMM(); } /** * 初始化输入法service */ private void initIMM() { // Don't know about other versions yet. if (SDK_INT < KITKAT || SDK_INT > 22) { return; } inputMethodManager = (InputMethodManager) AppCache.getContext().getSystemService(INPUT_METHOD_SERVICE); Method focusInMethod; try { mServedViewField = InputMethodManager.class.getDeclaredField("mServedView"); mServedViewField.setAccessible(true); mHField = InputMethodManager.class.getDeclaredField("mServedView"); mHField.setAccessible(true); finishInputLockedMethod = InputMethodManager.class.getDeclaredMethod("finishInputLocked"); finishInputLockedMethod.setAccessible(true); focusInMethod = InputMethodManager.class.getDeclaredMethod("focusIn", View.class); focusInMethod.setAccessible(true); } catch (Exception unexpected) { Log.e("IMMLeaks", "Unexpected reflection exception", unexpected); return; } } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { mAppCache.pushActivity(activity); handleLeaks(activity); } /** * 处理掉输入法持有activity引用导致的泄露问题 * * @param activity */ private void handleLeaks(Activity activity) { if (SDK_INT < KITKAT || SDK_INT > 22) { return; } try { IMMLeaks.ReferenceCleaner cleaner = new IMMLeaks.ReferenceCleaner(inputMethodManager, mHField, mServedViewField, finishInputLockedMethod); View rootView = activity.getWindow().getDecorView().getRootView(); ViewTreeObserver viewTreeObserver = rootView.getViewTreeObserver(); viewTreeObserver.addOnGlobalFocusChangeListener(cleaner); }catch (Exception e){ e.printStackTrace(); } } @Override public void onActivityStarted(Activity activity) { } @Override public void onActivityResumed(Activity activity) { } @Override public void onActivityPaused(Activity activity) { } @Override public void onActivityStopped(Activity activity) { } @Override public void onActivitySaveInstanceState(Activity activity, Bundle outState) { } @Override public void onActivityDestroyed(Activity activity) { RefWatcher mRefWatcher = mAppCache.getRefWatcher(); if (mRefWatcher!=null){ mRefWatcher.watch(activity); } mAppCache.popActivity(activity); LogUtils.i("onActivityDestroyed: " + activity.getClass().getSimpleName()); } }
c085af6c2c7d65b5ea391ba11e01f0972c91fb06
c5011fe58e6963c16b162fbef6ba8d5bcaa8a53e
/src/constants/Messages.java
0d5bb9c3df26af2871bd5ae857a1b9b2c0e9e51b
[]
no_license
NatalliaNovikava/Task-Issue-Tracker
b0ba237de76a43c74c58178c7a754bb5259749ca
7c69136e87d39c01ac7b4d6e432bc96d8fd4f52a
refs/heads/master
2021-01-13T02:04:05.236791
2014-05-04T16:27:31
2014-05-04T16:27:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package constants; public class Messages { public final static String NO_VALID_DATA = "Please make sure to provide a valid value for all fields."; public final static String NO_ISSUES_APPLICATION = "No issues in the application"; public final static String NO_ISSUES_ASSIGNEE = "No assignee issues"; public final static String ERROR_DATA = "Invalid data.Enter the correct data."; public final static String ERROR_SAX = "SAX exception"; public final static String ERROR_IO = "I/O exception"; public final static String ERROR_DATABASE_ACCESS = "ERROR:Database access error"; }
e2ce8adba53ce3fe2de3827dcca63b2e3aa06c5f
fb72a87ab87217a72a19642ba4ec165d7b5ae157
/app/src/main/java/com/damenghai/chahuitong/view/mall/GoodsDetailPresenter.java
f0815e5d5b1041ea3a65816ffa64a5cc554703c6
[]
no_license
chaxin/CHTAndroid3x
bd07bbf59ff261977acbae49075b5c3fd0895d76
d2ef3ef4742f9aeb89e13db51f860f71c368243b
refs/heads/master
2021-01-10T13:35:33.590133
2016-03-07T04:02:08
2016-03-07T04:02:08
52,758,554
0
0
null
null
null
null
UTF-8
Java
false
false
3,030
java
package com.damenghai.chahuitong.view.mall; import android.content.Intent; import android.text.TextUtils; import com.damenghai.chahuitong.config.API; import com.damenghai.chahuitong.expansion.data.BaseDataActivityPresenter; import com.damenghai.chahuitong.model.bean.GoodsInfo; import com.damenghai.chahuitong.model.service.ServiceClient; import com.damenghai.chahuitong.model.service.ServiceResponse; import com.damenghai.chahuitong.model.service.ServiceTransform; import com.damenghai.chahuitong.utils.DialogFactory; import com.damenghai.chahuitong.utils.LUtils; import com.damenghai.chahuitong.view.user.LoginActivity; /** * Copyright (c) 2015. LiaoPeiKun Inc. All rights reserved. */ public class GoodsDetailPresenter extends BaseDataActivityPresenter<GoodsDetailActivity, GoodsInfo> { private String mGoodsId; private String mKey; @Override protected void onCreateView(GoodsDetailActivity view) { super.onCreateView(view); mGoodsId = getView().getIntent().getStringExtra("goods_id"); showGoodsDetail(); } private boolean isLogin() { if (TextUtils.isEmpty(mKey)) { mKey = LUtils.getPreferences().getString("key", ""); } if (TextUtils.isEmpty(mKey)) { getView().startActivity(new Intent(getView(), LoginActivity.class)); return false; } return true; } private void showGoodsDetail() { ServiceClient.getServices().goodsDetail(mGoodsId, mKey) .compose(new ServiceTransform<GoodsInfo>()) .subscribe(getDataSubscriber()); } public void addFavorites() { if (isLogin()) { ServiceClient.getServices().favAdd(mKey, mGoodsId, API.VERSION) .compose(new ServiceTransform<String>()) .subscribe(new ServiceResponse<String>() { @Override public void onNext(String result) { LUtils.toast("操作成功"); } }); } } public void addCart() { if (isLogin()) { ServiceClient.getServices().cartAdd(mKey, mGoodsId, "1") .compose(new ServiceTransform<>()) .subscribe(new ServiceResponse<String>() { @Override public void onNext(String s) { super.onNext(s); DialogFactory.createCartDialog(getView()); } }); } } public void toCart() { if (isLogin()) { getView().startActivity(new Intent(getView(), CartActivity.class)); } } public void toBuy() { if (isLogin()) { Intent intent = new Intent(getView(), BuyActivity.class); intent.putExtra("goods_id", mGoodsId); intent.putExtra("buynum", "1"); getView().startActivity(intent); } } }
a03340556c17e0c4b076874bc0e1b6536efc1c55
9c980642abbe5c31d3960ff006d2d90fa9f21e21
/src/Collection/PropertiesTest01.java
32952f4a0f509db1d54a6b4b8475c801f791d846
[]
no_license
Li-jiabing/JavaSE
cc98a4657cf7ae3527a00bd433d25416f37924ea
5565b60e589853aed944b0bc9c40067719552ade
refs/heads/master
2023-07-17T23:34:26.911559
2021-09-09T09:16:41
2021-09-09T09:16:41
379,801,188
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package Collection; import java.util.Properties; /** * 目前只需要掌握Properties属性类对象的相关方法即可。 * Properties是一个Map集合,继承HashTable,Properties的key和value都是String类型 * Properties被成为属性类对象 * Properties是线程安全的 * 需要掌握Properties两个方法,一个存,一个取 */ public class PropertiesTest01 { public static void main(String[] args) { //创建一个Properties对象 Properties properties = new Properties(); properties.put("url","jdbc:mysql://localhost:3306/bjpowernode"); properties.put("driver","com.mysql.jdbc.Driver"); properties.put("username","root"); properties.put("password","123456"); //通过key获取value String getValue = properties.getProperty("password"); System.out.println(getValue); } }
02fe4c57fda5061dc8b202fda3c1cb2e63fb99fb
63e9fb6e0ae181bfa9f6552bf31985fc60897ad6
/common-modules/user-data-storage/UserDirectory/src/main/java/org/societies/common/userdirectory/api/IUserDirectory.java
226fe1c8814021d4d8204e7fe65ae3c523dde0a0
[ "BSD-2-Clause", "BSD-2-Clause-Views" ]
permissive
societies/SOCIETIES-Platform
6503b84b11b21f5bd4b5f1db0c22c4356b4a3f02
7050936833dcadf5cf318921ba97154843a05a46
HEAD
2016-09-05T22:29:20.159081
2014-05-20T10:53:33
2014-05-20T10:53:33
2,576,064
15
4
null
null
null
null
UTF-8
Java
false
false
458
java
package org.societies.common.userdirectory.api; import java.util.Collection; public interface IUserDirectory { public Object createNewUserContact(); public boolean insertUser(IUserProfile contact); public boolean updateUser(IUserProfile contact); public Collection<Object> queryUser(Object Parameter); public boolean isUserExists(Object parameter); public Collection<Object> retrieveAllUser(); // org.societies.common.userdirectory }
[ "root@localhost" ]
root@localhost
1eba83dc3cdbfd9244c12d1424f19b2eb346dabd
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE369_Divide_by_Zero/s03/CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73a.java
756898a95f91f2917afae3fc5a765aea02afca99
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
4,791
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73a.java Label Definition File: CWE369_Divide_by_Zero__int.label.xml Template File: sources-sinks-73a.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: getCookies_Servlet Read data from the first cookie using getCookies() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: divide * GoodSink: Check for zero before dividing * BadSink : Dividing by a value that may be zero * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ package testcases.CWE369_Divide_by_Zero.s03; import testcasesupport.*; import java.util.LinkedList; import javax.servlet.http.*; import java.util.logging.Level; public class CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73a extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */ /* Read data from cookies */ { Cookie cookieSources[] = request.getCookies(); if (cookieSources != null) { /* POTENTIAL FLAW: Read data from the first cookie value */ String stringNumber = cookieSources[0].getValue(); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat); } } } LinkedList<Integer> dataLinkedList = new LinkedList<Integer>(); dataLinkedList.add(0, data); dataLinkedList.add(1, data); dataLinkedList.add(2, data); (new CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73b()).badSink(dataLinkedList , request, response ); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); goodB2G(request, response); } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; LinkedList<Integer> dataLinkedList = new LinkedList<Integer>(); dataLinkedList.add(0, data); dataLinkedList.add(1, data); dataLinkedList.add(2, data); (new CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73b()).goodG2BSink(dataLinkedList , request, response ); } /* goodB2G() - use BadSource and GoodSink */ private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */ /* Read data from cookies */ { Cookie cookieSources[] = request.getCookies(); if (cookieSources != null) { /* POTENTIAL FLAW: Read data from the first cookie value */ String stringNumber = cookieSources[0].getValue(); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat); } } } LinkedList<Integer> dataLinkedList = new LinkedList<Integer>(); dataLinkedList.add(0, data); dataLinkedList.add(1, data); dataLinkedList.add(2, data); (new CWE369_Divide_by_Zero__int_getCookies_Servlet_divide_73b()).goodB2GSink(dataLinkedList , request, response ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
bd5d9b042dcf09780b391bbd34aa782a4630fc4a
1281f6894949b6bfc390c14167ce2475f8d9314c
/src/main/java/springaop/User.java
638f125ac5f1318a29d6d478d4b046cbeebc7350
[ "MIT" ]
permissive
rodbate/TestJava
da5a254bb541d17ac361883a23eeb4a37de21ea3
659882746e467be2c03ee79c821a8ac6f85d4b8a
refs/heads/master
2021-01-21T13:25:57.542535
2016-06-01T09:22:06
2016-06-01T09:22:06
49,862,481
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
package springaop; public class User { private String name; private Integer age; public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } @Override public String toString() { return "name: "+ name + "age: "+ age; } }
9c0ccf8e187805a9b4ee659844263a32ecd42515
16823c9852389a1bff5da9b71cac3bde488925a0
/src/test/java/com/integrate/angular/rest/angularrest/AngularRestApplicationTests.java
7ebfa613f77e290e1780e2b29b7001fae0e8c069
[]
no_license
Amar-VH/angular-rest
3cd9bd6763e972a72aeab550f5f68a646961e869
4e675985999d6317a59d885761f8a2bbd38365a9
refs/heads/master
2022-09-21T05:50:32.141262
2020-06-07T21:32:41
2020-06-07T21:32:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package com.integrate.angular.rest.angularrest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class AngularRestApplicationTests { @Test void contextLoads() { } }
70e9b342300c90affc293797a4477155f54ef06a
891a22a195507852e83ab8d52f51322a9d041325
/src/br/com/bytebank/exceptions/ErrorValidator.java
ffce50e39a125890c170d2bf0f02622ff50cc7f6
[]
no_license
Rfontt/Object-Oriented-Java
f2bd7e636fd4de1b6ab0ea5fde44da5290375664
26c9ca16bc9dde1dfed2642720f47a089dd7b397
refs/heads/main
2023-06-25T00:28:30.288584
2021-07-28T12:58:51
2021-07-28T12:58:51
380,562,096
0
0
null
null
null
null
UTF-8
Java
false
false
167
java
package br.com.bytebank.exceptions; public class ErrorValidator extends RuntimeException{ public ErrorValidator(String message) { super(message); } }
bd1976e83b94cf2eb3aa8eb7ef3c069c31726b21
9fb7b78bf0d421b9324d58f5d2e4203ff06940b8
/app/src/main/java/com/shaubert/liftago/util/Sizes.java
4cb61ce7c271e7004a3ead1022cd758b81de72ed
[ "Apache-2.0" ]
permissive
shaubert/MessengerSample
6e5c3bb0c87f98e5e0eba49fe39709a4c112eea1
6664cedaf148178a049bac6418b2f333f5fa1a48
refs/heads/master
2021-01-10T03:47:43.122594
2016-01-10T07:56:31
2016-01-10T07:56:31
49,331,427
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
package com.shaubert.liftago.util; import android.content.Context; import android.content.res.Resources; import android.util.TypedValue; public class Sizes { public static int dpToPx(Context context, float dp) { Resources r = context.getResources(); return (int) (TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()) + 0.5f); } public static int spToPx(Context context, float sp) { Resources r = context.getResources(); return (int) (TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_SP, sp, r.getDisplayMetrics()) + 0.5f); } }
131d1b34f5c2efbfbd651794fee6a544efa89544
ea7922493a8ebc9126f0c4a76143bca8ad732aee
/src/main/java/persistence/oa/OaGridPartyDataMapper.java
cfc457eb85e3356998997fa6c9d8460b3c96730a
[]
no_license
xvchaoqun/owip
eb12a6f4716cb0ac774fb1b61d46a909ec9d4b1f
167d5c78c9bc06a3ecffeefaedac890d106723ca
refs/heads/master
2023-06-17T00:55:07.071553
2021-07-13T08:48:22
2021-07-13T08:48:22
386,553,504
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package persistence.oa; import domain.oa.OaGridPartyData; import domain.oa.OaGridPartyDataExample; import java.util.List; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.session.RowBounds; public interface OaGridPartyDataMapper { long countByExample(OaGridPartyDataExample example); int deleteByExample(OaGridPartyDataExample example); int deleteByPrimaryKey(Integer id); int insert(OaGridPartyData record); int insertSelective(OaGridPartyData record); List<OaGridPartyData> selectByExampleWithRowbounds(OaGridPartyDataExample example, RowBounds rowBounds); List<OaGridPartyData> selectByExample(OaGridPartyDataExample example); OaGridPartyData selectByPrimaryKey(Integer id); int updateByExampleSelective(@Param("record") OaGridPartyData record, @Param("example") OaGridPartyDataExample example); int updateByExample(@Param("record") OaGridPartyData record, @Param("example") OaGridPartyDataExample example); int updateByPrimaryKeySelective(OaGridPartyData record); int updateByPrimaryKey(OaGridPartyData record); }
3fb3b2ea7a6bb7b6d146449afd4aba39202f588b
a03b08fee1079a171063da05e5600e8f7c210c4b
/red5/src/org/red5/server/messaging/ServiceAdapter.java
1deed2e7afdd8cf4d8a808ce8bf6f9e75c2dfce3
[ "Apache-2.0" ]
permissive
kaltura/server-bin-linux-64bit
ae35434fba4f754185b22ba79c3e56de35d7c0b1
51dd2d7b768b0064c9e53e0d8cfd8d81b26c8884
refs/heads/master
2021-01-01T18:43:20.488250
2019-07-24T07:51:54
2019-07-24T07:51:54
10,905,968
2
2
null
2020-11-16T18:11:05
2013-06-24T11:10:25
HTML
UTF-8
Java
false
false
3,619
java
/* * RED5 Open Source Flash Server - http://code.google.com/p/red5/ * * Copyright 2006-2012 by respective authors (see below). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.red5.server.messaging; import org.red5.compatibility.flex.messaging.messages.CommandMessage; import org.red5.compatibility.flex.messaging.messages.Message; /** * The ServiceAdapter class is the base definition of a service adapter. * * @author Paul Gregoire */ public abstract class ServiceAdapter { /** * Starts the adapter if its associated Destination is started and if the adapter * is not already running. If subclasses override, they must call super.start(). */ public void start() { } /** * Stops the ServiceAdapter. If subclasses override, they must call super.start(). */ public void stop() { } /** * Handle a data message intended for this adapter. This method is responsible for * handling the message and returning a result (if any). The return value of this * message is used as the body of the acknowledge message returned to the client. It * may be null if there is no data being returned for this message. * Typically the data content for the message is stored in the body property of the * message. The headers of the message are used to store fields which relate to the * transport of the message. The type of operation is stored as the operation property * of the message. * * @param message the message as sent by the client intended for this adapter * @return the body of the acknowledge message (or null if there is no body) */ public abstract Object invoke(Message message); /** * Accept a command from the adapter's service and perform some internal * action based upon it. CommandMessages are used for messages which control * the state of the connection between the client and the server. For example, * this handles subscribe, unsubscribe, and ping operations. The messageRefType * property of the CommandMessage is used to associate a command message with a * particular service. Services are configured to handle messages of a particular * concrete type. For example, the MessageService is typically invoked to handle * messages of type flex.messaging.messages.AsyncMessage. To ensure a given * CommandMessage is routed to the right service, its MessageRefType is set to the * string name of the message type for messages handled by that service. * * @param commandMessage * @return Exception if not implemented */ public Object manage(CommandMessage commandMessage) { throw new UnsupportedOperationException("This adapter does not support the manage call"); } /** * Returns true if the adapter performs custom subscription management. * The default return value is false, and subclasses should override this * method as necessary. * * @return true if subscriptions are handled */ public boolean handlesSubscriptions() { return true; } }
[ "tantan@6b8eccd3-e8c5-4e7d-8186-e12b5326b719" ]
tantan@6b8eccd3-e8c5-4e7d-8186-e12b5326b719
6c452e1ada607abc8df53e952c120dd77239ef6d
7440fdea99829b666b8a92382505b07a235d39cc
/spring-cloud-kafka/rulelib/src/main/java/com/edel/rulelib/java8/impl/GreaterThanOrEqualsComparisonWithObject.java
6b1229940db4a201f574862949c33916adf546b9
[]
no_license
quicksilverj2/all-my-test-projects
936b1e41f3cef1edb6b3804fa46de8931d79be8e
18f59814365f57f6e95147ce92fc5ff8dd456594
refs/heads/master
2020-04-14T10:46:28.387014
2019-01-03T06:42:38
2019-01-03T06:42:38
163,795,711
0
0
null
null
null
null
UTF-8
Java
false
false
3,782
java
package com.edel.rulelib.java8.impl; import com.edel.rulelib.java8.execution.ExecutionEvent; import com.edel.rulelib.java8.rule.MatchRuleWithObject; import com.edel.rulelib.java8.util.ExpressionHelper; import com.google.gson.JsonObject; import lombok.*; import java.lang.reflect.Field; /** * Created by jitheshrajan on 10/12/18. */ @Builder @AllArgsConstructor @NoArgsConstructor @ToString public class GreaterThanOrEqualsComparisonWithObject implements MatchRuleWithObject { @Setter private String category; @Setter private boolean isConstant; @Setter private String left; @Setter private String right; @Override public String getRuleCategory() { return category; } @Override public ExecutionEvent matches(Object inputObject) { if(inputObject instanceof JsonObject){ return matchesJson((JsonObject) inputObject); } ExecutionEvent returnableExecutionEvent = ExecutionEvent.builder().outcome(false).detail(inputObject).build(); Object leftFieldObject; Object rightFieldObject; System.out.println("Rule comparison started"); try{ Field leftField = inputObject.getClass().getDeclaredField(left); leftField.setAccessible(true); System.out.println(leftField.get(inputObject)); leftFieldObject = leftField.get(inputObject); if(isConstant){ rightFieldObject = right; }else{ Field rightField = inputObject.getClass().getDeclaredField(right); rightField.setAccessible(true); System.out.println(rightField.get(inputObject)); rightFieldObject = rightField.get(inputObject); } returnableExecutionEvent.setOutcome(ExpressionHelper.compareObjectsForGreaterThanOrEquals(leftFieldObject, rightFieldObject)); returnableExecutionEvent.setRuleString(left+" GREATER THAN OR EQUALS "+right+" : "+leftFieldObject+" GREATER THAN OR EQUALS "+rightFieldObject); return returnableExecutionEvent; } catch (NoSuchFieldException e) { System.err.println("couldnt get fields :"); e.printStackTrace(); return returnableExecutionEvent; } catch (IllegalAccessException e) { System.err.println("illegal argument exception :"); e.printStackTrace(); return returnableExecutionEvent; } catch (Exception e){ System.err.println("Error while processing the rule!"); e.printStackTrace(); return returnableExecutionEvent; } } public <T extends JsonObject> ExecutionEvent matchesJson(T inputObject){ ExecutionEvent returnableExecutionEvent = ExecutionEvent.builder().outcome(false).detail(inputObject).build(); try{ Object leftFieldObject; Object rightFieldObject; leftFieldObject = inputObject.get(left).getAsString(); if(isConstant){ rightFieldObject = right; }else{ rightFieldObject = inputObject.get(right).getAsString(); } returnableExecutionEvent.setOutcome(ExpressionHelper.compareObjectsForGreaterThanOrEquals(leftFieldObject, rightFieldObject)); returnableExecutionEvent.setRuleString(left+" GREATER THAN OR EQUALS "+right+" : "+leftFieldObject+" GREATER THAN OR EQUALS "+rightFieldObject); return returnableExecutionEvent; }catch (Exception e){ System.err.println("Error while processing the rule!"); e.printStackTrace(); return returnableExecutionEvent; } } }
62c9b01c48d7d571c6ceb7b5e4ee6ed38972e3f4
35550c8259708dd44208d2f8e5658cb5972e6e85
/spring_crud/src/main/java/com/nguyenmauhuy/spring_crud/model/request/employee/employeeSaveRequest.java
351b6e5b304c59d40ea3f12845394d8dfa62c4d2
[]
no_license
address20001030/spring
3ee6c965addd66c946526c54cd2a488b387f3e11
5b0bd3e3a5fdb0e6576f9958a15b84d07330a8eb
refs/heads/master
2023-06-16T00:06:55.191850
2021-07-10T07:58:19
2021-07-10T07:58:19
384,635,366
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.nguyenmauhuy.spring_crud.model.request.employee; import lombok.Data; import javax.persistence.Column; @Data public class employeeSaveRequest { private String userName; private String password; private String name; private String sex; private String email; private String phone; private String address; }
bf41ab902c219b42173b6a17ae310f5516529e7d
4c0f9715a304b93eeb7527b4e37d98b5de15d52e
/src/main/java/com/nowcoder/community/service/FollowService.java
7a545bff52195de393ca4247c8f439721f45111a
[]
no_license
shuanglongHu/community
fb9d9a7e423402630df4e2aefde658fa7115a39b
d7055aed13c71759708fcc0f8126afce2cbda2f2
refs/heads/master
2023-06-26T14:53:48.205073
2021-07-29T12:34:30
2021-07-29T12:34:30
374,119,087
0
0
null
null
null
null
UTF-8
Java
false
false
4,644
java
package com.nowcoder.community.service; import com.nowcoder.community.entity.User; import com.nowcoder.community.util.CommunityConstant; import com.nowcoder.community.util.RedisKeyUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.data.redis.core.RedisOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.SessionCallback; import org.springframework.stereotype.Service; import java.util.*; @Service public class FollowService implements CommunityConstant { @Autowired private RedisTemplate redisTemplate; @Autowired private UserService userService; public void follow(int userId, int entityType, int entityId) { redisTemplate.execute(new SessionCallback() { @Override public Object execute(RedisOperations redisOperations) throws DataAccessException { String followeeKey = RedisKeyUtil.getFolloweeKey(userId,entityType); String followerKey = RedisKeyUtil.getFollowerKey(entityType, entityId); redisOperations.multi(); redisOperations.opsForZSet().add(followeeKey,entityId,System.currentTimeMillis()); redisOperations.opsForZSet().add(followerKey,userId,System.currentTimeMillis()); return redisOperations.exec(); } }); } public void unfollow(int userId, int entityType, int entityId) { redisTemplate.execute(new SessionCallback() { @Override public Object execute(RedisOperations redisOperations) throws DataAccessException { String followeeKey = RedisKeyUtil.getFolloweeKey(userId,entityType); String followerKey = RedisKeyUtil.getFollowerKey(entityType, entityId); redisOperations.multi(); redisOperations.opsForZSet().remove(followeeKey,entityId); redisOperations.opsForZSet().remove(followerKey,userId); return redisOperations.exec(); } }); } //查询关注的实体的数量 public long findFolloweeCount(int userId, int entityType) { String followeeKey = RedisKeyUtil.getFolloweeKey(userId, entityType); return redisTemplate.opsForZSet().zCard(followeeKey); } //查询实体的粉丝数量 public long findFollowerCount(int entityType, int entityId) { String followerKey = RedisKeyUtil.getFollowerKey(entityType, entityId); return redisTemplate.opsForZSet().zCard(followerKey); } //查询当前用户是否已经关注该实体 public boolean hasFollowed(int userId, int entityType, int entityId) { String followeeKey = RedisKeyUtil.getFolloweeKey(userId, entityType); return redisTemplate.opsForZSet().score(followeeKey,entityId) != null; } //查询某个用户关注的人 public List<Map<String,Object>> findFollowees(int userId, int offset, int limit) { String followeeKey = RedisKeyUtil.getFolloweeKey(userId, ENTITY_TYPE_USER); Set<Integer> targetIds = redisTemplate.opsForZSet().reverseRange(followeeKey, offset, offset + limit - 1); if (targetIds == null) { return null; } List<Map<String, Object>> list = new ArrayList<>(); for(Integer targetId : targetIds) { Map<String, Object> map = new HashMap<>(); User user = userService.findUserById(targetId); map.put("user",user); Double score = redisTemplate.opsForZSet().score(followeeKey, targetId); map.put("followTime", new Date(score.longValue())); list.add(map); } return list; } //查询某个用户的粉丝 public List<Map<String,Object>> findFollowers(int userId, int offset, int limit) { String followerKey = RedisKeyUtil.getFollowerKey(ENTITY_TYPE_USER, userId); Set<Integer> targetIds = redisTemplate.opsForZSet().reverseRange(followerKey, offset, offset + limit - 1); if (targetIds == null) { return null; } List<Map<String, Object>> list = new ArrayList<>(); for(Integer targetId : targetIds) { Map<String, Object> map = new HashMap<>(); User user = userService.findUserById(targetId); map.put("user",user); Double score = redisTemplate.opsForZSet().score(followerKey, targetId); map.put("followTime", new Date(score.longValue())); list.add(map); } return list; } }
d06a8644631f2a42bbf6eb0ee5494ef65d651155
c2f5ffcc1df2fa8382730b47ee46dea6afbc3eda
/app/src/main/java/com/example/clockjava/fragments/addClockButtonFragment/AddClockFragment.java
26e808534c248f351d59e31bc457a984f23fdd48
[]
no_license
bbogatov/ClockJava
1516e4ced39663b2110730c14c59d9b84a48ffe5
bced0c4e700e70b5754b5d3a77504a076b851f2b
refs/heads/master
2020-06-02T09:28:29.751599
2019-07-30T17:16:50
2019-07-30T17:16:50
191,114,358
0
0
null
null
null
null
UTF-8
Java
false
false
1,496
java
package com.example.clockjava.fragments.addClockButtonFragment; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import com.example.clockjava.R; import com.example.clockjava.activities.newClock.NewClockActivity; /** * Class that response for add new clock button */ public class AddClockFragment extends Fragment implements AddClockContract.View { private ImageButton addClockButton; private AddClockContract.Presenter presenter; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_new_clock_button, null); presenter = new AddClockPresenter(this); addClockButton = view.findViewById(R.id.clock_button); addClockButton.setOnClickListener((View v) -> presenter.addClockButtonPressed()); return view; } /** * If user wants to add new clock it clicks on {@link #addClockButton} and this code starts next activity. */ @Override public void showNewClockActivity() { Intent newClockIntent = new Intent(getContext(), NewClockActivity.class); startActivity(newClockIntent); } }
8b99683ef5bbb004b8ccf32d6706241ce727c463
afe8cbfa41af8f88397ee4b134ec4347b67af3b2
/src/main/java/com/spring/osworks/domain/entity/OrdemServico.java
abba57d3b15fbca521bf645b76574a1eef34ed2b
[]
no_license
lucas-salles/osworks-api
21163a64255a3e8938dc3138ebd45a4372f32ebc
1e5c9c850929e2ce9a59e5a49c0b9b39aca4ea91
refs/heads/main
2023-02-18T09:56:31.306911
2021-01-15T15:19:32
2021-01-15T15:19:32
329,940,934
0
0
null
null
null
null
UTF-8
Java
false
false
4,121
java
package com.spring.osworks.domain.entity; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.groups.ConvertGroup; import javax.validation.groups.Default; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty.Access; import com.spring.osworks.domain.ValidationGroups; import com.spring.osworks.domain.exception.DomainException; @Entity public class OrdemServico { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Valid @ConvertGroup(from = Default.class, to = ValidationGroups.ClienteId.class) @NotNull @ManyToOne private Cliente cliente; @NotBlank private String descricao; @NotNull private BigDecimal preco; @Enumerated(EnumType.STRING) @JsonProperty(access = Access.READ_ONLY) private StatusOrdemServico status; @JsonProperty(access = Access.READ_ONLY) private OffsetDateTime dataAbertura; @JsonProperty(access = Access.READ_ONLY) private OffsetDateTime dataFinalizacao; @OneToMany(mappedBy = "ordemServico") private List<Comentario> comentarios = new ArrayList<>(); public OrdemServico() {} public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Cliente getCliente() { return cliente; } public void setCliente(Cliente cliente) { this.cliente = cliente; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public BigDecimal getPreco() { return preco; } public void setPreco(BigDecimal preco) { this.preco = preco; } public StatusOrdemServico getStatus() { return status; } public void setStatus(StatusOrdemServico status) { this.status = status; } public OffsetDateTime getDataAbertura() { return dataAbertura; } public void setDataAbertura(OffsetDateTime dataAbertura) { this.dataAbertura = dataAbertura; } public OffsetDateTime getDataFinalizacao() { return dataFinalizacao; } public void setDataFinalizacao(OffsetDateTime dataFinalizacao) { this.dataFinalizacao = dataFinalizacao; } public List<Comentario> getComentarios() { return comentarios; } public void setComentarios(List<Comentario> comentarios) { this.comentarios = comentarios; } @Override public String toString() { return "OrdemServico [id=" + id + ", cliente=" + cliente + ", descricao=" + descricao + ", preco=" + preco + ", status=" + status + ", dataAbertura=" + dataAbertura + ", dataFinalizacao=" + dataFinalizacao + ", comentarios=" + comentarios + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OrdemServico other = (OrdemServico) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } public boolean podeSerFinalizadaOuCancelada() { return StatusOrdemServico.ABERTA.equals(getStatus()); } public void finalizar() { if(!podeSerFinalizadaOuCancelada()) { throw new DomainException("Ordem de serviço não pode ser finalizada"); } setStatus(StatusOrdemServico.FINALIZADA); setDataFinalizacao(OffsetDateTime.now()); } public void cancelar() { if(!podeSerFinalizadaOuCancelada()) { throw new DomainException("Ordem de serviço não pode ser cancelada"); } setStatus(StatusOrdemServico.CANCELADA); } }
7979b2c0e6186a0b30e1e29263261819954c6c6d
5a2b265183d8bb7170d0ace4e4449a2d3a3adfa3
/extensions/training/trainingfulfilmentprocess/testsrc/com/epam/training/fulfilmentprocess/test/actions/consignmentfulfilment/ConfirmConsignmentPickup.java
7e25b234cff4d5c5f98410d39527f48ab0a09c21
[]
no_license
studenthybris/study_project
5401f6800030f3592ac0aa8ab9ce72b9ec1ac68c
8b30e2a422929af008075a3670e0ac1c04c67bb2
refs/heads/master
2021-05-14T07:40:44.418472
2018-01-23T14:45:32
2018-01-23T14:45:32
116,271,960
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
/* * [y] hybris Platform * * Copyright (c) 2000-2015 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("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 hybris. * * */ package com.epam.training.fulfilmentprocess.test.actions.consignmentfulfilment; public class ConfirmConsignmentPickup extends AbstractTestConsActionTemp { //empty }
90b925ed16281588f34cb50980aff53509fd6a0d
2e4d2a0cfe09404b5db006cfcec230389564022e
/Utils/src/main/java/sinlov/toolsclass/verify/VerifyChinaIDCard.java
d2f135e700209144705954a4ae0af40d438260fe
[ "Apache-2.0" ]
permissive
sinlov/JavaFactory
7c79cdc506474d16eb89d141ecb2b8ab9d4b3d7b
1ce55ad0c3caebe8e8c941703a0309aecf6ce0b0
refs/heads/master
2020-09-26T09:47:11.936066
2020-08-02T17:42:15
2020-08-02T17:42:15
66,898,964
0
0
null
null
null
null
UTF-8
Java
false
false
214,483
java
package sinlov.toolsclass.verify; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Hashtable; import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 身份证验证工具,请配合 {@link WordsMatcher} 使用 * <pre> * sinlov * * /\__/\ * /` '\ * ≈≈≈ 0 0 ≈≈≈ Hello world! * \ -- / * / \ * / \ * | | * \ || || / * \_oo__oo_/≡≡≡≡≡≡≡≡o * * </pre> * Created by sinlov on 16/3/23. */ public class VerifyChinaIDCard { public static final String REG_FAST_ID_CARD = "^(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)$"; private static final String ERR_LENGTH = "身份证号码长度应该为15位或18位"; private static final String ERR_NUMBER_FORMAT = "身份证15位号码都应为数字 ; 18位号码除最后一位外,都应为数字。"; private static final String ERR_BIRTHDAY = "身份证生日无效。"; private static final String ERR_BIRTHDAY_RANGE = "身份证生日不在有效范围。"; private static final String ERR_BIRTHDAY_MONTH = "身份证月份无效"; private static final String ERR_BIRTHDAY_DAY = "身份证日期无效"; private static final String ERR_AREA_CODE = "身份证地区编码错误"; private static final String ERR_WORDS_INVALID = "身份证无效,不是合法的身份证号码"; private static final String[] VAL_CODE_ARR = {"1", "0", "x", "9", "8", "7", "6", "5", "4", "3", "2"}; private static final String[] WI = {"7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"}; private static VerifyChinaIDCard instance; private Hashtable<String, String> areaCodeTable; private Hashtable<String, String> areaCodeFullTable; public static VerifyChinaIDCard getInstance() { if (null == instance) { instance = new VerifyChinaIDCard(); } return instance; } /** * 功能:身份证的有效验证 * * @param iDStr 身份证号 * @return 有效:返回"" 无效:返回String信息 * throws ParseException */ public String authentication(String iDStr) throws ParseException { iDStr = iDStr.toLowerCase(); String errorInfo; String ai = ""; // ================ 号码的长度 15位或18位 ================ if (iDStr.length() != 15 && iDStr.length() != 18) { errorInfo = ERR_LENGTH; return errorInfo; } // =======================(end)======================== // ================ 数字 除最后以为都为数字 ================ if (iDStr.length() == 18) { ai = iDStr.substring(0, 17); } else if (iDStr.length() == 15) { if (!checkSortIDYearCode(iDStr)) { errorInfo = ERR_BIRTHDAY_RANGE; return errorInfo; } ai = iDStr.substring(0, 6) + "19" + iDStr.substring(6, 15); } if (!isNumeric(ai)) { errorInfo = ERR_NUMBER_FORMAT; return errorInfo; } // =======================(end)======================== // ================ 出生年月是否有效 ================ String strYear = ai.substring(6, 10);// 年份 String strMonth = ai.substring(10, 12);// 月份 String strDay = ai.substring(12, 14);// 月份 if (!WordsMatcher.isDataFormat(strYear + "-" + strMonth + "-" + strDay)) { errorInfo = ERR_BIRTHDAY; return errorInfo; } GregorianCalendar gc = new GregorianCalendar(); SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA); if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse( strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { errorInfo = ERR_BIRTHDAY_RANGE; return errorInfo; } if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { errorInfo = ERR_BIRTHDAY_MONTH; return errorInfo; } if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { errorInfo = ERR_BIRTHDAY_DAY; return errorInfo; } // =====================(end)===================== // ================ 6位地区码时候有效 ================ // Hashtable<String, String> h = getAreaCodeFull(); // if (h.get(ai.substring(0, 6)) == null) { // errorInfo = ERR_AREA_CODE; // return errorInfo; // } Hashtable<String, String> codeTable = getAreaCode(); if (null == codeTable.get(ai.substring(0, 2))) { errorInfo = ERR_AREA_CODE; return errorInfo; } // ============================================== // ================ 判断最后一位的值 ================ int totalMULAiWi = 0; for (int i = 0; i < 17; i++) { totalMULAiWi = totalMULAiWi + Integer.parseInt(String.valueOf(ai.charAt(i))) * Integer.parseInt(WI[i]); } int modValue = totalMULAiWi % 11; String strVerifyCode = VAL_CODE_ARR[modValue]; ai = ai + strVerifyCode; if (iDStr.length() == 18) { if (!ai.equals(iDStr)) { errorInfo = ERR_WORDS_INVALID; return errorInfo; } } else { return ""; } return ""; } /** * 15位的身份证年份发行,不会超过1980年,故15位的身份证第7位不可能大于8 * * @param iDStr idString {@link String} * @return true is pass */ private boolean checkSortIDYearCode(String iDStr) { String yi = iDStr.substring(6, 7); boolean b; try { b = Integer.valueOf(yi) > 7; } catch (NumberFormatException e) { e.printStackTrace(); b = true; } return b; } /** * 功能:判断字符串是否为全数字 * * @param str {@link String} * @return boolean */ private boolean isNumeric(String str) { Pattern pattern = Pattern.compile("[0-9]*"); Matcher isNum = pattern.matcher(str); return isNum.matches(); } /** * 获取地区二位编码 * * @return hash table of area code {@link Hashtable} */ private Hashtable<String, String> getAreaCode() { if (areaCodeTable == null) { areaCodeTable = new Hashtable<>(); areaCodeTable.put("11", "北京"); areaCodeTable.put("12", "天津"); areaCodeTable.put("13", "河北"); areaCodeTable.put("14", "山西"); areaCodeTable.put("15", "内蒙古"); areaCodeTable.put("21", "辽宁"); areaCodeTable.put("22", "吉林"); areaCodeTable.put("23", "黑龙江"); areaCodeTable.put("31", "上海"); areaCodeTable.put("32", "江苏"); areaCodeTable.put("33", "浙江"); areaCodeTable.put("34", "安徽"); areaCodeTable.put("35", "福建"); areaCodeTable.put("36", "江西"); areaCodeTable.put("37", "山东"); areaCodeTable.put("41", "河南"); areaCodeTable.put("42", "湖北"); areaCodeTable.put("43", "湖南"); areaCodeTable.put("44", "广东"); areaCodeTable.put("45", "广西"); areaCodeTable.put("46", "海南"); areaCodeTable.put("50", "重庆"); areaCodeTable.put("51", "四川"); areaCodeTable.put("52", "贵州"); areaCodeTable.put("53", "云南"); areaCodeTable.put("54", "西藏"); areaCodeTable.put("61", "陕西"); areaCodeTable.put("62", "甘肃"); areaCodeTable.put("63", "青海"); areaCodeTable.put("64", "宁夏"); areaCodeTable.put("65", "新疆"); areaCodeTable.put("71", "台湾"); areaCodeTable.put("81", "香港"); areaCodeTable.put("82", "澳门"); areaCodeTable.put("91", "国外"); } return areaCodeTable; } /** * 功能:获取完整地区编码 * * @return result 地区代码对象 {@link Hashtable} */ public Hashtable getAreaCodeFull() { if (areaCodeFullTable == null) { areaCodeFullTable = new Hashtable<>(); areaCodeFullTable.put("110000", "北京市"); areaCodeFullTable.put("110100", "市辖区"); areaCodeFullTable.put("110101", "东城区"); areaCodeFullTable.put("110102", "西城区"); areaCodeFullTable.put("110103", "崇文区"); areaCodeFullTable.put("110104", "宣武区"); areaCodeFullTable.put("110105", "朝阳区"); areaCodeFullTable.put("110106", "丰台区"); areaCodeFullTable.put("110107", "石景山区"); areaCodeFullTable.put("110108", "海淀区"); areaCodeFullTable.put("110109", "门头沟区"); areaCodeFullTable.put("110111", "房山区"); areaCodeFullTable.put("110112", "通州区"); areaCodeFullTable.put("110113", "顺义区"); areaCodeFullTable.put("110114", "昌平区"); areaCodeFullTable.put("110115", "大兴区"); areaCodeFullTable.put("110116", "怀柔区"); areaCodeFullTable.put("110117", "平谷区"); areaCodeFullTable.put("110200", "县"); areaCodeFullTable.put("110228", "密云县"); areaCodeFullTable.put("110229", "延庆县"); areaCodeFullTable.put("120000", "天津市"); areaCodeFullTable.put("120100", "市辖区"); areaCodeFullTable.put("120101", "和平区"); areaCodeFullTable.put("120102", "河东区"); areaCodeFullTable.put("120103", "河西区"); areaCodeFullTable.put("120104", "南开区"); areaCodeFullTable.put("120105", "河北区"); areaCodeFullTable.put("120106", "红桥区"); areaCodeFullTable.put("120107", "塘沽区"); areaCodeFullTable.put("120108", "汉沽区"); areaCodeFullTable.put("120109", "大港区"); areaCodeFullTable.put("120110", "东丽区"); areaCodeFullTable.put("120111", "西青区"); areaCodeFullTable.put("120112", "津南区"); areaCodeFullTable.put("120113", "北辰区"); areaCodeFullTable.put("120114", "武清区"); areaCodeFullTable.put("120115", "宝坻区"); areaCodeFullTable.put("120200", "县"); areaCodeFullTable.put("120221", "宁河县"); areaCodeFullTable.put("120223", "静海县"); areaCodeFullTable.put("120225", "蓟县"); areaCodeFullTable.put("130000", "河北省"); areaCodeFullTable.put("130100", "石家庄市"); areaCodeFullTable.put("130101", "市辖区"); areaCodeFullTable.put("130102", "长安区"); areaCodeFullTable.put("130103", "桥东区"); areaCodeFullTable.put("130104", "桥西区"); areaCodeFullTable.put("130105", "新华区"); areaCodeFullTable.put("130107", "井陉矿区"); areaCodeFullTable.put("130108", "裕华区"); areaCodeFullTable.put("130121", "井陉县"); areaCodeFullTable.put("130123", "正定县"); areaCodeFullTable.put("130124", "栾城县"); areaCodeFullTable.put("130125", "行唐县"); areaCodeFullTable.put("130126", "灵寿县"); areaCodeFullTable.put("130127", "高邑县"); areaCodeFullTable.put("130128", "深泽县"); areaCodeFullTable.put("130129", "赞皇县"); areaCodeFullTable.put("130130", "无极县"); areaCodeFullTable.put("130131", "平山县"); areaCodeFullTable.put("130132", "元氏县"); areaCodeFullTable.put("130133", "赵县"); areaCodeFullTable.put("130181", "辛集市"); areaCodeFullTable.put("130182", "藁城市"); areaCodeFullTable.put("130183", "晋州市"); areaCodeFullTable.put("130184", "新乐市"); areaCodeFullTable.put("130185", "鹿泉市"); areaCodeFullTable.put("130200", "唐山市"); areaCodeFullTable.put("130201", "市辖区"); areaCodeFullTable.put("130202", "路南区"); areaCodeFullTable.put("130203", "路北区"); areaCodeFullTable.put("130204", "古冶区"); areaCodeFullTable.put("130205", "开平区"); areaCodeFullTable.put("130206", "新区"); areaCodeFullTable.put("130221", "丰润县"); areaCodeFullTable.put("130223", "滦县"); areaCodeFullTable.put("130224", "滦南县"); areaCodeFullTable.put("130225", "乐亭县"); areaCodeFullTable.put("130227", "迁西县"); areaCodeFullTable.put("130229", "玉田县"); areaCodeFullTable.put("130230", "唐海县"); areaCodeFullTable.put("130281", "遵化市"); areaCodeFullTable.put("130282", "丰南市"); areaCodeFullTable.put("130283", "迁安市"); areaCodeFullTable.put("130300", "秦皇岛市"); areaCodeFullTable.put("130301", "市辖区"); areaCodeFullTable.put("130302", "海港区"); areaCodeFullTable.put("130303", "山海关区"); areaCodeFullTable.put("130304", "北戴河区"); areaCodeFullTable.put("130321", "青龙满族自治县"); areaCodeFullTable.put("130322", "昌黎县"); areaCodeFullTable.put("130323", "抚宁县"); areaCodeFullTable.put("130324", "卢龙县"); areaCodeFullTable.put("130400", "邯郸市"); areaCodeFullTable.put("130401", "市辖区"); areaCodeFullTable.put("130402", "邯山区"); areaCodeFullTable.put("130403", "丛台区"); areaCodeFullTable.put("130404", "复兴区"); areaCodeFullTable.put("130406", "峰峰矿区"); areaCodeFullTable.put("130421", "邯郸县"); areaCodeFullTable.put("130423", "临漳县"); areaCodeFullTable.put("130424", "成安县"); areaCodeFullTable.put("130425", "大名县"); areaCodeFullTable.put("130426", "涉县"); areaCodeFullTable.put("130427", "磁县"); areaCodeFullTable.put("130428", "肥乡县"); areaCodeFullTable.put("130429", "永年县"); areaCodeFullTable.put("130430", "邱县"); areaCodeFullTable.put("130431", "鸡泽县"); areaCodeFullTable.put("130432", "广平县"); areaCodeFullTable.put("130433", "馆陶县"); areaCodeFullTable.put("130434", "魏县"); areaCodeFullTable.put("130435", "曲周县"); areaCodeFullTable.put("130481", "武安市"); areaCodeFullTable.put("130500", "邢台市"); areaCodeFullTable.put("130501", "市辖区"); areaCodeFullTable.put("130502", "桥东区"); areaCodeFullTable.put("130503", "桥西区"); areaCodeFullTable.put("130521", "邢台县"); areaCodeFullTable.put("130522", "临城县"); areaCodeFullTable.put("130523", "内丘县"); areaCodeFullTable.put("130524", "柏乡县"); areaCodeFullTable.put("130525", "隆尧县"); areaCodeFullTable.put("130526", "任县"); areaCodeFullTable.put("130527", "南和县"); areaCodeFullTable.put("130528", "宁晋县"); areaCodeFullTable.put("130529", "巨鹿县"); areaCodeFullTable.put("130530", "新河县"); areaCodeFullTable.put("130531", "广宗县"); areaCodeFullTable.put("130532", "平乡县"); areaCodeFullTable.put("130533", "威县"); areaCodeFullTable.put("130534", "清河县"); areaCodeFullTable.put("130535", "临西县"); areaCodeFullTable.put("130581", "南宫市"); areaCodeFullTable.put("130582", "沙河市"); areaCodeFullTable.put("130600", "保定市"); areaCodeFullTable.put("130601", "市辖区"); areaCodeFullTable.put("130602", "新市区"); areaCodeFullTable.put("130603", "北市区"); areaCodeFullTable.put("130604", "南市区"); areaCodeFullTable.put("130621", "满城县"); areaCodeFullTable.put("130622", "清苑县"); areaCodeFullTable.put("130623", "涞水县"); areaCodeFullTable.put("130624", "阜平县"); areaCodeFullTable.put("130625", "徐水县"); areaCodeFullTable.put("130626", "定兴县"); areaCodeFullTable.put("130627", "唐县"); areaCodeFullTable.put("130628", "高阳县"); areaCodeFullTable.put("130629", "容城县"); areaCodeFullTable.put("130630", "涞源县"); areaCodeFullTable.put("130631", "望都县"); areaCodeFullTable.put("130632", "安新县"); areaCodeFullTable.put("130633", "易县"); areaCodeFullTable.put("130634", "曲阳县"); areaCodeFullTable.put("130635", "蠡县"); areaCodeFullTable.put("130636", "顺平县"); areaCodeFullTable.put("130637", "博野县"); areaCodeFullTable.put("130638", "雄县"); areaCodeFullTable.put("130681", "涿州市"); areaCodeFullTable.put("130682", "定州市"); areaCodeFullTable.put("130683", "安国市"); areaCodeFullTable.put("130684", "高碑店市"); areaCodeFullTable.put("130700", "张家口市"); areaCodeFullTable.put("130701", "市辖区"); areaCodeFullTable.put("130702", "桥东区"); areaCodeFullTable.put("130703", "桥西区"); areaCodeFullTable.put("130705", "宣化区"); areaCodeFullTable.put("130706", "下花园区"); areaCodeFullTable.put("130721", "宣化县"); areaCodeFullTable.put("130722", "张北县"); areaCodeFullTable.put("130723", "康保县"); areaCodeFullTable.put("130724", "沽源县"); areaCodeFullTable.put("130725", "尚义县"); areaCodeFullTable.put("130726", "蔚县"); areaCodeFullTable.put("130727", "阳原县"); areaCodeFullTable.put("130728", "怀安县"); areaCodeFullTable.put("130729", "万全县"); areaCodeFullTable.put("130730", "怀来县"); areaCodeFullTable.put("130731", "涿鹿县"); areaCodeFullTable.put("130732", "赤城县"); areaCodeFullTable.put("130733", "崇礼县"); areaCodeFullTable.put("130800", "承德市"); areaCodeFullTable.put("130801", "市辖区"); areaCodeFullTable.put("130802", "双桥区"); areaCodeFullTable.put("130803", "双滦区"); areaCodeFullTable.put("130804", "鹰手营子矿区"); areaCodeFullTable.put("130821", "承德县"); areaCodeFullTable.put("130822", "兴隆县"); areaCodeFullTable.put("130823", "平泉县"); areaCodeFullTable.put("130824", "滦平县"); areaCodeFullTable.put("130825", "隆化县"); areaCodeFullTable.put("130826", "丰宁满族自治县"); areaCodeFullTable.put("130827", "宽城满族自治县"); areaCodeFullTable.put("130828", "围场满族蒙古族自"); areaCodeFullTable.put("130900", "沧州市"); areaCodeFullTable.put("130901", "市辖区"); areaCodeFullTable.put("130902", "新华区"); areaCodeFullTable.put("130903", "运河区"); areaCodeFullTable.put("130921", "沧县"); areaCodeFullTable.put("130922", "青县"); areaCodeFullTable.put("130923", "东光县"); areaCodeFullTable.put("130924", "海兴县"); areaCodeFullTable.put("130925", "盐山县"); areaCodeFullTable.put("130926", "肃宁县"); areaCodeFullTable.put("130927", "南皮县"); areaCodeFullTable.put("130928", "吴桥县"); areaCodeFullTable.put("130929", "献县"); areaCodeFullTable.put("130930", "孟村回族自治县"); areaCodeFullTable.put("130981", "泊头市"); areaCodeFullTable.put("130982", "任丘市"); areaCodeFullTable.put("130983", "黄骅市"); areaCodeFullTable.put("130984", "河间市"); areaCodeFullTable.put("131000", "廊坊市"); areaCodeFullTable.put("131001", "市辖区"); areaCodeFullTable.put("131002", "安次区"); areaCodeFullTable.put("131003", "广阳区"); areaCodeFullTable.put("131022", "固安县"); areaCodeFullTable.put("131023", "永清县"); areaCodeFullTable.put("131024", "香河县"); areaCodeFullTable.put("131025", "大城县"); areaCodeFullTable.put("131026", "文安县"); areaCodeFullTable.put("131028", "大厂回族自治县"); areaCodeFullTable.put("131081", "霸州市"); areaCodeFullTable.put("131082", "三河市"); areaCodeFullTable.put("131100", "衡水市"); areaCodeFullTable.put("131101", "市辖区"); areaCodeFullTable.put("131102", "桃城区"); areaCodeFullTable.put("131121", "枣强县"); areaCodeFullTable.put("131122", "武邑县"); areaCodeFullTable.put("131123", "武强县"); areaCodeFullTable.put("131124", "饶阳县"); areaCodeFullTable.put("131125", "安平县"); areaCodeFullTable.put("131126", "故城县"); areaCodeFullTable.put("131127", "景县"); areaCodeFullTable.put("131128", "阜城县"); areaCodeFullTable.put("131181", "冀州市"); areaCodeFullTable.put("131182", "深州市"); areaCodeFullTable.put("140000", "山西省"); areaCodeFullTable.put("140100", "太原市"); areaCodeFullTable.put("140101", "市辖区"); areaCodeFullTable.put("140105", "小店区"); areaCodeFullTable.put("140106", "迎泽区"); areaCodeFullTable.put("140107", "杏花岭区"); areaCodeFullTable.put("140108", "尖草坪区"); areaCodeFullTable.put("140109", "万柏林区"); areaCodeFullTable.put("140110", "晋源区"); areaCodeFullTable.put("140121", "清徐县"); areaCodeFullTable.put("140122", "阳曲县"); areaCodeFullTable.put("140123", "娄烦县"); areaCodeFullTable.put("140181", "古交市"); areaCodeFullTable.put("140200", "大同市"); areaCodeFullTable.put("140201", "市辖区"); areaCodeFullTable.put("140202", "城区"); areaCodeFullTable.put("140203", "矿区"); areaCodeFullTable.put("140211", "南郊区"); areaCodeFullTable.put("140212", "新荣区"); areaCodeFullTable.put("140221", "阳高县"); areaCodeFullTable.put("140222", "天镇县"); areaCodeFullTable.put("140223", "广灵县"); areaCodeFullTable.put("140224", "灵丘县"); areaCodeFullTable.put("140225", "浑源县"); areaCodeFullTable.put("140226", "左云县"); areaCodeFullTable.put("140227", "大同县"); areaCodeFullTable.put("140300", "阳泉市"); areaCodeFullTable.put("140301", "市辖区"); areaCodeFullTable.put("140302", "城区"); areaCodeFullTable.put("140303", "矿区"); areaCodeFullTable.put("140311", "郊区"); areaCodeFullTable.put("140321", "平定县"); areaCodeFullTable.put("140322", "盂县"); areaCodeFullTable.put("140400", "长治市"); areaCodeFullTable.put("140401", "市辖区"); areaCodeFullTable.put("140402", "城区"); areaCodeFullTable.put("140411", "郊区"); areaCodeFullTable.put("140421", "长治县"); areaCodeFullTable.put("140423", "襄垣县"); areaCodeFullTable.put("140424", "屯留县"); areaCodeFullTable.put("140425", "平顺县"); areaCodeFullTable.put("140426", "黎城县"); areaCodeFullTable.put("140427", "壶关县"); areaCodeFullTable.put("140428", "长子县"); areaCodeFullTable.put("140429", "武乡县"); areaCodeFullTable.put("140430", "沁县"); areaCodeFullTable.put("140431", "沁源县"); areaCodeFullTable.put("140481", "潞城市"); areaCodeFullTable.put("140500", "晋城市"); areaCodeFullTable.put("140501", "市辖区"); areaCodeFullTable.put("140502", "城区"); areaCodeFullTable.put("140521", "沁水县"); areaCodeFullTable.put("140522", "阳城县"); areaCodeFullTable.put("140524", "陵川县"); areaCodeFullTable.put("140525", "泽州县"); areaCodeFullTable.put("140581", "高平市"); areaCodeFullTable.put("140600", "朔州市"); areaCodeFullTable.put("140601", "市辖区"); areaCodeFullTable.put("140602", "朔城区"); areaCodeFullTable.put("140603", "平鲁区"); areaCodeFullTable.put("140621", "山阴县"); areaCodeFullTable.put("140622", "应县"); areaCodeFullTable.put("140623", "右玉县"); areaCodeFullTable.put("140624", "怀仁县"); areaCodeFullTable.put("140700", "晋中市"); areaCodeFullTable.put("140701", "市辖区"); areaCodeFullTable.put("140702", "榆次区"); areaCodeFullTable.put("140721", "榆社县"); areaCodeFullTable.put("140722", "左权县"); areaCodeFullTable.put("140723", "和顺县"); areaCodeFullTable.put("140724", "昔阳县"); areaCodeFullTable.put("140725", "寿阳县"); areaCodeFullTable.put("140726", "太谷县"); areaCodeFullTable.put("140727", "祁县"); areaCodeFullTable.put("140728", "平遥县"); areaCodeFullTable.put("140729", "灵石县"); areaCodeFullTable.put("140781", "介休市"); areaCodeFullTable.put("140800", "运城市"); areaCodeFullTable.put("140801", "市辖区"); areaCodeFullTable.put("140802", "盐湖区"); areaCodeFullTable.put("140821", "临猗县"); areaCodeFullTable.put("140822", "万荣县"); areaCodeFullTable.put("140823", "闻喜县"); areaCodeFullTable.put("140824", "稷山县"); areaCodeFullTable.put("140825", "新绛县"); areaCodeFullTable.put("140826", "绛县"); areaCodeFullTable.put("140827", "垣曲县"); areaCodeFullTable.put("140828", "夏县"); areaCodeFullTable.put("140829", "平陆县"); areaCodeFullTable.put("140830", "芮城县"); areaCodeFullTable.put("140881", "永济市"); areaCodeFullTable.put("140882", "河津市"); areaCodeFullTable.put("140900", "忻州市"); areaCodeFullTable.put("140901", "市辖区"); areaCodeFullTable.put("140902", "忻府区"); areaCodeFullTable.put("140921", "定襄县"); areaCodeFullTable.put("140922", "五台县"); areaCodeFullTable.put("140923", "代县"); areaCodeFullTable.put("140924", "繁峙县"); areaCodeFullTable.put("140925", "宁武县"); areaCodeFullTable.put("140926", "静乐县"); areaCodeFullTable.put("140927", "神池县"); areaCodeFullTable.put("140928", "五寨县"); areaCodeFullTable.put("140929", "岢岚县"); areaCodeFullTable.put("140930", "河曲县"); areaCodeFullTable.put("140931", "保德县"); areaCodeFullTable.put("140932", "偏关县"); areaCodeFullTable.put("140981", "原平市"); areaCodeFullTable.put("141000", "临汾市"); areaCodeFullTable.put("141001", "市辖区"); areaCodeFullTable.put("141002", "尧都区"); areaCodeFullTable.put("141021", "曲沃县"); areaCodeFullTable.put("141022", "翼城县"); areaCodeFullTable.put("141023", "襄汾县"); areaCodeFullTable.put("141024", "洪洞县"); areaCodeFullTable.put("141025", "古县"); areaCodeFullTable.put("141026", "安泽县"); areaCodeFullTable.put("141027", "浮山县"); areaCodeFullTable.put("141028", "吉县"); areaCodeFullTable.put("141029", "乡宁县"); areaCodeFullTable.put("141030", "大宁县"); areaCodeFullTable.put("141031", "隰县"); areaCodeFullTable.put("141032", "永和县"); areaCodeFullTable.put("141033", "蒲县"); areaCodeFullTable.put("141034", "汾西县"); areaCodeFullTable.put("141081", "侯马市"); areaCodeFullTable.put("141082", "霍州市"); areaCodeFullTable.put("142300", "吕梁地区"); areaCodeFullTable.put("142301", "孝义市"); areaCodeFullTable.put("142302", "离石市"); areaCodeFullTable.put("142303", "汾阳市"); areaCodeFullTable.put("142322", "文水县"); areaCodeFullTable.put("142323", "交城县"); areaCodeFullTable.put("142325", "兴县"); areaCodeFullTable.put("142326", "临县"); areaCodeFullTable.put("142327", "柳林县"); areaCodeFullTable.put("142328", "石楼县"); areaCodeFullTable.put("142329", "岚县"); areaCodeFullTable.put("142330", "方山县"); areaCodeFullTable.put("142332", "中阳县"); areaCodeFullTable.put("142333", "交口县"); areaCodeFullTable.put("150000", "内蒙古自治区"); areaCodeFullTable.put("150100", "呼和浩特市"); areaCodeFullTable.put("150101", "市辖区"); areaCodeFullTable.put("150102", "新城区"); areaCodeFullTable.put("150103", "回民区"); areaCodeFullTable.put("150104", "玉泉区"); areaCodeFullTable.put("150105", "赛罕区"); areaCodeFullTable.put("150121", "土默特左旗"); areaCodeFullTable.put("150122", "托克托县"); areaCodeFullTable.put("150123", "和林格尔县"); areaCodeFullTable.put("150124", "清水河县"); areaCodeFullTable.put("150125", "武川县"); areaCodeFullTable.put("150200", "包头市"); areaCodeFullTable.put("150201", "市辖区"); areaCodeFullTable.put("150202", "东河区"); areaCodeFullTable.put("150203", "昆都仑区"); areaCodeFullTable.put("150204", "青山区"); areaCodeFullTable.put("150205", "石拐区"); areaCodeFullTable.put("150206", "白云矿区"); areaCodeFullTable.put("150207", "九原区"); areaCodeFullTable.put("150221", "土默特右旗"); areaCodeFullTable.put("150222", "固阳县"); areaCodeFullTable.put("150223", "达尔罕茂明安联合"); areaCodeFullTable.put("150300", "乌海市"); areaCodeFullTable.put("150301", "市辖区"); areaCodeFullTable.put("150302", "海勃湾区"); areaCodeFullTable.put("150303", "海南区"); areaCodeFullTable.put("150304", "乌达区"); areaCodeFullTable.put("150400", "赤峰市"); areaCodeFullTable.put("150401", "市辖区"); areaCodeFullTable.put("150402", "红山区"); areaCodeFullTable.put("150403", "元宝山区"); areaCodeFullTable.put("150404", "松山区"); areaCodeFullTable.put("150421", "阿鲁科尔沁旗"); areaCodeFullTable.put("150422", "巴林左旗"); areaCodeFullTable.put("150423", "巴林右旗"); areaCodeFullTable.put("150424", "林西县"); areaCodeFullTable.put("150425", "克什克腾旗"); areaCodeFullTable.put("150426", "翁牛特旗"); areaCodeFullTable.put("150428", "喀喇沁旗"); areaCodeFullTable.put("150429", "宁城县"); areaCodeFullTable.put("150430", "敖汉旗"); areaCodeFullTable.put("150500", "通辽市"); areaCodeFullTable.put("150501", "市辖区"); areaCodeFullTable.put("150502", "科尔沁区"); areaCodeFullTable.put("150521", "科尔沁左翼中旗"); areaCodeFullTable.put("150522", "科尔沁左翼后旗"); areaCodeFullTable.put("150523", "开鲁县"); areaCodeFullTable.put("150524", "库伦旗"); areaCodeFullTable.put("150525", "奈曼旗"); areaCodeFullTable.put("150526", "扎鲁特旗"); areaCodeFullTable.put("150581", "霍林郭勒市"); areaCodeFullTable.put("150600", "鄂尔多斯市"); areaCodeFullTable.put("150601", "市辖区"); areaCodeFullTable.put("150602", "东胜区"); areaCodeFullTable.put("150621", "达拉特旗"); areaCodeFullTable.put("150622", "准格尔旗"); areaCodeFullTable.put("150623", "鄂托克前旗"); areaCodeFullTable.put("150624", "鄂托克旗"); areaCodeFullTable.put("150625", "杭锦旗"); areaCodeFullTable.put("150626", "乌审旗"); areaCodeFullTable.put("150627", "伊金霍洛旗"); areaCodeFullTable.put("150700", "呼伦贝尔市"); areaCodeFullTable.put("150701", "市辖区"); areaCodeFullTable.put("150702", "海拉尔区"); areaCodeFullTable.put("150721", "阿荣旗"); areaCodeFullTable.put("150722", "莫力达瓦达斡尔族"); areaCodeFullTable.put("150723", "鄂伦春自治旗"); areaCodeFullTable.put("150724", "鄂温克族自治旗"); areaCodeFullTable.put("150725", "陈巴尔虎旗"); areaCodeFullTable.put("150726", "新巴尔虎左旗"); areaCodeFullTable.put("150727", "新巴尔虎右旗"); areaCodeFullTable.put("150781", "满洲里市"); areaCodeFullTable.put("150782", "牙克石市"); areaCodeFullTable.put("150783", "扎兰屯市"); areaCodeFullTable.put("150784", "额尔古纳市"); areaCodeFullTable.put("150785", "根河市"); areaCodeFullTable.put("152200", "兴安盟"); areaCodeFullTable.put("152201", "乌兰浩特市"); areaCodeFullTable.put("152202", "阿尔山市"); areaCodeFullTable.put("152221", "科尔沁右翼前旗"); areaCodeFullTable.put("152222", "科尔沁右翼中旗"); areaCodeFullTable.put("152223", "扎赉特旗"); areaCodeFullTable.put("152224", "突泉县"); areaCodeFullTable.put("152500", "锡林郭勒盟"); areaCodeFullTable.put("152501", "二连浩特市"); areaCodeFullTable.put("152502", "锡林浩特市"); areaCodeFullTable.put("152522", "阿巴嘎旗"); areaCodeFullTable.put("152523", "苏尼特左旗"); areaCodeFullTable.put("152524", "苏尼特右旗"); areaCodeFullTable.put("152525", "东乌珠穆沁旗"); areaCodeFullTable.put("152526", "西乌珠穆沁旗"); areaCodeFullTable.put("152527", "太仆寺旗"); areaCodeFullTable.put("152528", "镶黄旗"); areaCodeFullTable.put("152529", "正镶白旗"); areaCodeFullTable.put("152530", "正蓝旗"); areaCodeFullTable.put("152531", "多伦县"); areaCodeFullTable.put("152600", "乌兰察布盟"); areaCodeFullTable.put("152601", "集宁市"); areaCodeFullTable.put("152602", "丰镇市"); areaCodeFullTable.put("152624", "卓资县"); areaCodeFullTable.put("152625", "化德县"); areaCodeFullTable.put("152626", "商都县"); areaCodeFullTable.put("152627", "兴和县"); areaCodeFullTable.put("152629", "凉城县"); areaCodeFullTable.put("152630", "察哈尔右翼前旗"); areaCodeFullTable.put("152631", "察哈尔右翼中旗"); areaCodeFullTable.put("152632", "察哈尔右翼后旗"); areaCodeFullTable.put("152634", "四子王旗"); areaCodeFullTable.put("152800", "巴彦淖尔盟"); areaCodeFullTable.put("152801", "临河市"); areaCodeFullTable.put("152822", "五原县"); areaCodeFullTable.put("152823", "磴口县"); areaCodeFullTable.put("152824", "乌拉特前旗"); areaCodeFullTable.put("152825", "乌拉特中旗"); areaCodeFullTable.put("152826", "乌拉特后旗"); areaCodeFullTable.put("152827", "杭锦后旗"); areaCodeFullTable.put("152900", "阿拉善盟"); areaCodeFullTable.put("152921", "阿拉善左旗"); areaCodeFullTable.put("152922", "阿拉善右旗"); areaCodeFullTable.put("152923", "额济纳旗"); areaCodeFullTable.put("210000", "辽宁省"); areaCodeFullTable.put("210100", "沈阳市"); areaCodeFullTable.put("210101", "市辖区"); areaCodeFullTable.put("210102", "和平区"); areaCodeFullTable.put("210103", "沈河区"); areaCodeFullTable.put("210104", "大东区"); areaCodeFullTable.put("210105", "皇姑区"); areaCodeFullTable.put("210106", "铁西区"); areaCodeFullTable.put("210111", "苏家屯区"); areaCodeFullTable.put("210112", "东陵区"); areaCodeFullTable.put("210113", "新城子区"); areaCodeFullTable.put("210114", "于洪区"); areaCodeFullTable.put("210122", "辽中县"); areaCodeFullTable.put("210123", "康平县"); areaCodeFullTable.put("210124", "法库县"); areaCodeFullTable.put("210181", "新民市"); areaCodeFullTable.put("210200", "大连市"); areaCodeFullTable.put("210201", "市辖区"); areaCodeFullTable.put("210202", "中山区"); areaCodeFullTable.put("210203", "西岗区"); areaCodeFullTable.put("210204", "沙河口区"); areaCodeFullTable.put("210211", "甘井子区"); areaCodeFullTable.put("210212", "旅顺口区"); areaCodeFullTable.put("210213", "金州区"); areaCodeFullTable.put("210224", "长海县"); areaCodeFullTable.put("210281", "瓦房店市"); areaCodeFullTable.put("210282", "普兰店市"); areaCodeFullTable.put("210283", "庄河市"); areaCodeFullTable.put("210300", "鞍山市"); areaCodeFullTable.put("210301", "市辖区"); areaCodeFullTable.put("210302", "铁东区"); areaCodeFullTable.put("210303", "铁西区"); areaCodeFullTable.put("210304", "立山区"); areaCodeFullTable.put("210311", "千山区"); areaCodeFullTable.put("210321", "台安县"); areaCodeFullTable.put("210323", "岫岩满族自治县"); areaCodeFullTable.put("210381", "海城市"); areaCodeFullTable.put("210400", "抚顺市"); areaCodeFullTable.put("210401", "市辖区"); areaCodeFullTable.put("210402", "新抚区"); areaCodeFullTable.put("210403", "东洲区"); areaCodeFullTable.put("210404", "望花区"); areaCodeFullTable.put("210411", "顺城区"); areaCodeFullTable.put("210421", "抚顺县"); areaCodeFullTable.put("210422", "新宾满族自治县"); areaCodeFullTable.put("210423", "清原满族自治县"); areaCodeFullTable.put("210500", "本溪市"); areaCodeFullTable.put("210501", "市辖区"); areaCodeFullTable.put("210502", "平山区"); areaCodeFullTable.put("210503", "溪湖区"); areaCodeFullTable.put("210504", "明山区"); areaCodeFullTable.put("210505", "南芬区"); areaCodeFullTable.put("210521", "本溪满族自治县"); areaCodeFullTable.put("210522", "桓仁满族自治县"); areaCodeFullTable.put("210600", "丹东市"); areaCodeFullTable.put("210601", "市辖区"); areaCodeFullTable.put("210602", "元宝区"); areaCodeFullTable.put("210603", "振兴区"); areaCodeFullTable.put("210604", "振安区"); areaCodeFullTable.put("210624", "宽甸满族自治县"); areaCodeFullTable.put("210681", "东港市"); areaCodeFullTable.put("210682", "凤城市"); areaCodeFullTable.put("210700", "锦州市"); areaCodeFullTable.put("210701", "市辖区"); areaCodeFullTable.put("210702", "古塔区"); areaCodeFullTable.put("210703", "凌河区"); areaCodeFullTable.put("210711", "太和区"); areaCodeFullTable.put("210726", "黑山县"); areaCodeFullTable.put("210727", "义县"); areaCodeFullTable.put("210781", "凌海市"); areaCodeFullTable.put("210782", "北宁市"); areaCodeFullTable.put("210800", "营口市"); areaCodeFullTable.put("210801", "市辖区"); areaCodeFullTable.put("210802", "站前区"); areaCodeFullTable.put("210803", "西市区"); areaCodeFullTable.put("210804", "鲅鱼圈区"); areaCodeFullTable.put("210811", "老边区"); areaCodeFullTable.put("210881", "盖州市"); areaCodeFullTable.put("210882", "大石桥市"); areaCodeFullTable.put("210900", "阜新市"); areaCodeFullTable.put("210901", "市辖区"); areaCodeFullTable.put("210902", "海州区"); areaCodeFullTable.put("210903", "新邱区"); areaCodeFullTable.put("210904", "太平区"); areaCodeFullTable.put("210905", "清河门区"); areaCodeFullTable.put("210911", "细河区"); areaCodeFullTable.put("210921", "阜新蒙古族自治县"); areaCodeFullTable.put("210922", "彰武县"); areaCodeFullTable.put("211000", "辽阳市"); areaCodeFullTable.put("211001", "市辖区"); areaCodeFullTable.put("211002", "白塔区"); areaCodeFullTable.put("211003", "文圣区"); areaCodeFullTable.put("211004", "宏伟区"); areaCodeFullTable.put("211005", "弓长岭区"); areaCodeFullTable.put("211011", "太子河区"); areaCodeFullTable.put("211021", "辽阳县"); areaCodeFullTable.put("211081", "灯塔市"); areaCodeFullTable.put("211100", "盘锦市"); areaCodeFullTable.put("211101", "市辖区"); areaCodeFullTable.put("211102", "双台子区"); areaCodeFullTable.put("211103", "兴隆台区"); areaCodeFullTable.put("211121", "大洼县"); areaCodeFullTable.put("211122", "盘山县"); areaCodeFullTable.put("211200", "铁岭市"); areaCodeFullTable.put("211201", "市辖区"); areaCodeFullTable.put("211202", "银州区"); areaCodeFullTable.put("211204", "清河区"); areaCodeFullTable.put("211221", "铁岭县"); areaCodeFullTable.put("211223", "西丰县"); areaCodeFullTable.put("211224", "昌图县"); areaCodeFullTable.put("211281", "铁法市"); areaCodeFullTable.put("211282", "开原市"); areaCodeFullTable.put("211300", "朝阳市"); areaCodeFullTable.put("211301", "市辖区"); areaCodeFullTable.put("211302", "双塔区"); areaCodeFullTable.put("211303", "龙城区"); areaCodeFullTable.put("211321", "朝阳县"); areaCodeFullTable.put("211322", "建平县"); areaCodeFullTable.put("211324", "喀喇沁左翼蒙古族"); areaCodeFullTable.put("211381", "北票市"); areaCodeFullTable.put("211382", "凌源市"); areaCodeFullTable.put("211400", "葫芦岛市"); areaCodeFullTable.put("211401", "市辖区"); areaCodeFullTable.put("211402", "连山区"); areaCodeFullTable.put("211403", "龙港区"); areaCodeFullTable.put("211404", "南票区"); areaCodeFullTable.put("211421", "绥中县"); areaCodeFullTable.put("211422", "建昌县"); areaCodeFullTable.put("211481", "兴城市"); areaCodeFullTable.put("220000", "吉林省"); areaCodeFullTable.put("220100", "长春市"); areaCodeFullTable.put("220101", "市辖区"); areaCodeFullTable.put("220102", "南关区"); areaCodeFullTable.put("220103", "宽城区"); areaCodeFullTable.put("220104", "朝阳区"); areaCodeFullTable.put("220105", "二道区"); areaCodeFullTable.put("220106", "绿园区"); areaCodeFullTable.put("220112", "双阳区"); areaCodeFullTable.put("220122", "农安县"); areaCodeFullTable.put("220181", "九台市"); areaCodeFullTable.put("220182", "榆树市"); areaCodeFullTable.put("220183", "德惠市"); areaCodeFullTable.put("220200", "吉林市"); areaCodeFullTable.put("220201", "市辖区"); areaCodeFullTable.put("220202", "昌邑区"); areaCodeFullTable.put("220203", "龙潭区"); areaCodeFullTable.put("220204", "船营区"); areaCodeFullTable.put("220211", "丰满区"); areaCodeFullTable.put("220221", "永吉县"); areaCodeFullTable.put("220281", "蛟河市"); areaCodeFullTable.put("220282", "桦甸市"); areaCodeFullTable.put("220283", "舒兰市"); areaCodeFullTable.put("220284", "磐石市"); areaCodeFullTable.put("220300", "四平市"); areaCodeFullTable.put("220301", "市辖区"); areaCodeFullTable.put("220302", "铁西区"); areaCodeFullTable.put("220303", "铁东区"); areaCodeFullTable.put("220322", "梨树县"); areaCodeFullTable.put("220323", "伊通满族自治县"); areaCodeFullTable.put("220381", "公主岭市"); areaCodeFullTable.put("220382", "双辽市"); areaCodeFullTable.put("220400", "辽源市"); areaCodeFullTable.put("220401", "市辖区"); areaCodeFullTable.put("220402", "龙山区"); areaCodeFullTable.put("220403", "西安区"); areaCodeFullTable.put("220421", "东丰县"); areaCodeFullTable.put("220422", "东辽县"); areaCodeFullTable.put("220500", "通化市"); areaCodeFullTable.put("220501", "市辖区"); areaCodeFullTable.put("220502", "东昌区"); areaCodeFullTable.put("220503", "二道江区"); areaCodeFullTable.put("220521", "通化县"); areaCodeFullTable.put("220523", "辉南县"); areaCodeFullTable.put("220524", "柳河县"); areaCodeFullTable.put("220581", "梅河口市"); areaCodeFullTable.put("220582", "集安市"); areaCodeFullTable.put("220600", "白山市"); areaCodeFullTable.put("220601", "市辖区"); areaCodeFullTable.put("220602", "八道江区"); areaCodeFullTable.put("220621", "抚松县"); areaCodeFullTable.put("220622", "靖宇县"); areaCodeFullTable.put("220623", "长白朝鲜族自治县"); areaCodeFullTable.put("220625", "江源县"); areaCodeFullTable.put("220681", "临江市"); areaCodeFullTable.put("220700", "松原市"); areaCodeFullTable.put("220701", "市辖区"); areaCodeFullTable.put("220702", "宁江区"); areaCodeFullTable.put("220721", "前郭尔罗斯蒙古族"); areaCodeFullTable.put("220722", "长岭县"); areaCodeFullTable.put("220723", "乾安县"); areaCodeFullTable.put("220724", "扶余县"); areaCodeFullTable.put("220800", "白城市"); areaCodeFullTable.put("220801", "市辖区"); areaCodeFullTable.put("220802", "洮北区"); areaCodeFullTable.put("220821", "镇赉县"); areaCodeFullTable.put("220822", "通榆县"); areaCodeFullTable.put("220881", "洮南市"); areaCodeFullTable.put("220882", "大安市"); areaCodeFullTable.put("222400", "延边朝鲜族自治州"); areaCodeFullTable.put("222401", "延吉市"); areaCodeFullTable.put("222402", "图们市"); areaCodeFullTable.put("222403", "敦化市"); areaCodeFullTable.put("222404", "珲春市"); areaCodeFullTable.put("222405", "龙井市"); areaCodeFullTable.put("222406", "和龙市"); areaCodeFullTable.put("222424", "汪清县"); areaCodeFullTable.put("222426", "安图县"); areaCodeFullTable.put("230000", "黑龙江省"); areaCodeFullTable.put("230100", "哈尔滨市"); areaCodeFullTable.put("230101", "市辖区"); areaCodeFullTable.put("230102", "道里区"); areaCodeFullTable.put("230103", "南岗区"); areaCodeFullTable.put("230104", "道外区"); areaCodeFullTable.put("230105", "太平区"); areaCodeFullTable.put("230106", "香坊区"); areaCodeFullTable.put("230107", "动力区"); areaCodeFullTable.put("230108", "平房区"); areaCodeFullTable.put("230121", "呼兰县"); areaCodeFullTable.put("230123", "依兰县"); areaCodeFullTable.put("230124", "方正县"); areaCodeFullTable.put("230125", "宾县"); areaCodeFullTable.put("230126", "巴彦县"); areaCodeFullTable.put("230127", "木兰县"); areaCodeFullTable.put("230128", "通河县"); areaCodeFullTable.put("230129", "延寿县"); areaCodeFullTable.put("230181", "阿城市"); areaCodeFullTable.put("230182", "双城市"); areaCodeFullTable.put("230183", "尚志市"); areaCodeFullTable.put("230184", "五常市"); areaCodeFullTable.put("230200", "齐齐哈尔市"); areaCodeFullTable.put("230201", "市辖区"); areaCodeFullTable.put("230202", "龙沙区"); areaCodeFullTable.put("230203", "建华区"); areaCodeFullTable.put("230204", "铁锋区"); areaCodeFullTable.put("230205", "昂昂溪区"); areaCodeFullTable.put("230206", "富拉尔基区"); areaCodeFullTable.put("230207", "碾子山区"); areaCodeFullTable.put("230208", "梅里斯达斡尔族"); areaCodeFullTable.put("230221", "龙江县"); areaCodeFullTable.put("230223", "依安县"); areaCodeFullTable.put("230224", "泰来县"); areaCodeFullTable.put("230225", "甘南县"); areaCodeFullTable.put("230227", "富裕县"); areaCodeFullTable.put("230229", "克山县"); areaCodeFullTable.put("230230", "克东县"); areaCodeFullTable.put("230231", "拜泉县"); areaCodeFullTable.put("230281", "讷河市"); areaCodeFullTable.put("230300", "鸡西市"); areaCodeFullTable.put("230301", "市辖区"); areaCodeFullTable.put("230302", "鸡冠区"); areaCodeFullTable.put("230303", "恒山区"); areaCodeFullTable.put("230304", "滴道区"); areaCodeFullTable.put("230305", "梨树区"); areaCodeFullTable.put("230306", "城子河区"); areaCodeFullTable.put("230307", "麻山区"); areaCodeFullTable.put("230321", "鸡东县"); areaCodeFullTable.put("230381", "虎林市"); areaCodeFullTable.put("230382", "密山市"); areaCodeFullTable.put("230400", "鹤岗市"); areaCodeFullTable.put("230401", "市辖区"); areaCodeFullTable.put("230402", "向阳区"); areaCodeFullTable.put("230403", "工农区"); areaCodeFullTable.put("230404", "南山区"); areaCodeFullTable.put("230405", "兴安区"); areaCodeFullTable.put("230406", "东山区"); areaCodeFullTable.put("230407", "兴山区"); areaCodeFullTable.put("230421", "萝北县"); areaCodeFullTable.put("230422", "绥滨县"); areaCodeFullTable.put("230500", "双鸭山市"); areaCodeFullTable.put("230501", "市辖区"); areaCodeFullTable.put("230502", "尖山区"); areaCodeFullTable.put("230503", "岭东区"); areaCodeFullTable.put("230505", "四方台区"); areaCodeFullTable.put("230506", "宝山区"); areaCodeFullTable.put("230521", "集贤县"); areaCodeFullTable.put("230522", "友谊县"); areaCodeFullTable.put("230523", "宝清县"); areaCodeFullTable.put("230524", "饶河县"); areaCodeFullTable.put("230600", "大庆市"); areaCodeFullTable.put("230601", "市辖区"); areaCodeFullTable.put("230602", "萨尔图区"); areaCodeFullTable.put("230603", "龙凤区"); areaCodeFullTable.put("230604", "让胡路区"); areaCodeFullTable.put("230605", "红岗区"); areaCodeFullTable.put("230606", "大同区"); areaCodeFullTable.put("230621", "肇州县"); areaCodeFullTable.put("230622", "肇源县"); areaCodeFullTable.put("230623", "林甸县"); areaCodeFullTable.put("230624", "杜尔伯特蒙古族自"); areaCodeFullTable.put("230700", "伊春市"); areaCodeFullTable.put("230701", "市辖区"); areaCodeFullTable.put("230702", "伊春区"); areaCodeFullTable.put("230703", "南岔区"); areaCodeFullTable.put("230704", "友好区"); areaCodeFullTable.put("230705", "西林区"); areaCodeFullTable.put("230706", "翠峦区"); areaCodeFullTable.put("230707", "新青区"); areaCodeFullTable.put("230708", "美溪区"); areaCodeFullTable.put("230709", "金山屯区"); areaCodeFullTable.put("230710", "五营区"); areaCodeFullTable.put("230711", "乌马河区"); areaCodeFullTable.put("230712", "汤旺河区"); areaCodeFullTable.put("230713", "带岭区"); areaCodeFullTable.put("230714", "乌伊岭区"); areaCodeFullTable.put("230715", "红星区"); areaCodeFullTable.put("230716", "上甘岭区"); areaCodeFullTable.put("230722", "嘉荫县"); areaCodeFullTable.put("230781", "铁力市"); areaCodeFullTable.put("230800", "佳木斯市"); areaCodeFullTable.put("230801", "市辖区"); areaCodeFullTable.put("230802", "永红区"); areaCodeFullTable.put("230803", "向阳区"); areaCodeFullTable.put("230804", "前进区"); areaCodeFullTable.put("230805", "东风区"); areaCodeFullTable.put("230811", "郊区"); areaCodeFullTable.put("230822", "桦南县"); areaCodeFullTable.put("230826", "桦川县"); areaCodeFullTable.put("230828", "汤原县"); areaCodeFullTable.put("230833", "抚远县"); areaCodeFullTable.put("230881", "同江市"); areaCodeFullTable.put("230882", "富锦市"); areaCodeFullTable.put("230900", "七台河市"); areaCodeFullTable.put("230901", "市辖区"); areaCodeFullTable.put("230902", "新兴区"); areaCodeFullTable.put("230903", "桃山区"); areaCodeFullTable.put("230904", "茄子河区"); areaCodeFullTable.put("230921", "勃利县"); areaCodeFullTable.put("231000", "牡丹江市"); areaCodeFullTable.put("231001", "市辖区"); areaCodeFullTable.put("231002", "东安区"); areaCodeFullTable.put("231003", "阳明区"); areaCodeFullTable.put("231004", "爱民区"); areaCodeFullTable.put("231005", "西安区"); areaCodeFullTable.put("231024", "东宁县"); areaCodeFullTable.put("231025", "林口县"); areaCodeFullTable.put("231081", "绥芬河市"); areaCodeFullTable.put("231083", "海林市"); areaCodeFullTable.put("231084", "宁安市"); areaCodeFullTable.put("231085", "穆棱市"); areaCodeFullTable.put("231100", "黑河市"); areaCodeFullTable.put("231101", "市辖区"); areaCodeFullTable.put("231102", "爱辉区"); areaCodeFullTable.put("231121", "嫩江县"); areaCodeFullTable.put("231123", "逊克县"); areaCodeFullTable.put("231124", "孙吴县"); areaCodeFullTable.put("231181", "北安市"); areaCodeFullTable.put("231182", "五大连池市"); areaCodeFullTable.put("231200", "绥化市"); areaCodeFullTable.put("231201", "市辖区"); areaCodeFullTable.put("231202", "北林区"); areaCodeFullTable.put("231221", "望奎县"); areaCodeFullTable.put("231222", "兰西县"); areaCodeFullTable.put("231223", "青冈县"); areaCodeFullTable.put("231224", "庆安县"); areaCodeFullTable.put("231225", "明水县"); areaCodeFullTable.put("231226", "绥棱县"); areaCodeFullTable.put("231281", "安达市"); areaCodeFullTable.put("231282", "肇东市"); areaCodeFullTable.put("231283", "海伦市"); areaCodeFullTable.put("232700", "大兴安岭地区"); areaCodeFullTable.put("232721", "呼玛县"); areaCodeFullTable.put("232722", "塔河县"); areaCodeFullTable.put("232723", "漠河县"); areaCodeFullTable.put("310000", "上海市"); areaCodeFullTable.put("310100", "市辖区"); areaCodeFullTable.put("310101", "黄浦区"); areaCodeFullTable.put("310103", "卢湾区"); areaCodeFullTable.put("310104", "徐汇区"); areaCodeFullTable.put("310105", "长宁区"); areaCodeFullTable.put("310106", "静安区"); areaCodeFullTable.put("310107", "普陀区"); areaCodeFullTable.put("310108", "闸北区"); areaCodeFullTable.put("310109", "虹口区"); areaCodeFullTable.put("310110", "杨浦区"); areaCodeFullTable.put("310112", "闵行区"); areaCodeFullTable.put("310113", "宝山区"); areaCodeFullTable.put("310114", "嘉定区"); areaCodeFullTable.put("310115", "浦东新区"); areaCodeFullTable.put("310116", "金山区"); areaCodeFullTable.put("310117", "松江区"); areaCodeFullTable.put("310118", "青浦区"); areaCodeFullTable.put("310119", "南汇区"); areaCodeFullTable.put("310120", "奉贤区"); areaCodeFullTable.put("310200", "县"); areaCodeFullTable.put("310230", "崇明县"); areaCodeFullTable.put("320000", "江苏省"); areaCodeFullTable.put("320100", "南京市"); areaCodeFullTable.put("320101", "市辖区"); areaCodeFullTable.put("320102", "玄武区"); areaCodeFullTable.put("320103", "白下区"); areaCodeFullTable.put("320104", "秦淮区"); areaCodeFullTable.put("320105", "建邺区"); areaCodeFullTable.put("320106", "鼓楼区"); areaCodeFullTable.put("320107", "下关区"); areaCodeFullTable.put("320111", "浦口区"); areaCodeFullTable.put("320112", "大厂区"); areaCodeFullTable.put("320113", "栖霞区"); areaCodeFullTable.put("320114", "雨花台区"); areaCodeFullTable.put("320115", "江宁区"); areaCodeFullTable.put("320122", "江浦县"); areaCodeFullTable.put("320123", "六合县"); areaCodeFullTable.put("320124", "溧水县"); areaCodeFullTable.put("320125", "高淳县"); areaCodeFullTable.put("320200", "无锡市"); areaCodeFullTable.put("320201", "市辖区"); areaCodeFullTable.put("320202", "崇安区"); areaCodeFullTable.put("320203", "南长区"); areaCodeFullTable.put("320204", "北塘区"); areaCodeFullTable.put("320205", "锡山区"); areaCodeFullTable.put("320206", "惠山区"); areaCodeFullTable.put("320211", "滨湖区"); areaCodeFullTable.put("320281", "江阴市"); areaCodeFullTable.put("320282", "宜兴市"); areaCodeFullTable.put("320300", "徐州市"); areaCodeFullTable.put("320301", "市辖区"); areaCodeFullTable.put("320302", "鼓楼区"); areaCodeFullTable.put("320303", "云龙区"); areaCodeFullTable.put("320304", "九里区"); areaCodeFullTable.put("320305", "贾汪区"); areaCodeFullTable.put("320311", "泉山区"); areaCodeFullTable.put("320321", "丰县"); areaCodeFullTable.put("320322", "沛县"); areaCodeFullTable.put("320323", "铜山县"); areaCodeFullTable.put("320324", "睢宁县"); areaCodeFullTable.put("320381", "新沂市"); areaCodeFullTable.put("320382", "邳州市"); areaCodeFullTable.put("320400", "常州市"); areaCodeFullTable.put("320401", "市辖区"); areaCodeFullTable.put("320402", "天宁区"); areaCodeFullTable.put("320404", "钟楼区"); areaCodeFullTable.put("320405", "戚墅堰区"); areaCodeFullTable.put("320411", "郊区"); areaCodeFullTable.put("320481", "溧阳市"); areaCodeFullTable.put("320482", "金坛市"); areaCodeFullTable.put("320483", "武进市"); areaCodeFullTable.put("320500", "苏州市"); areaCodeFullTable.put("320501", "市辖区"); areaCodeFullTable.put("320502", "沧浪区"); areaCodeFullTable.put("320503", "平江区"); areaCodeFullTable.put("320504", "金阊区"); areaCodeFullTable.put("320505", "虎丘区"); areaCodeFullTable.put("320506", "吴中区"); areaCodeFullTable.put("320507", "相城区"); areaCodeFullTable.put("320581", "常熟市"); areaCodeFullTable.put("320582", "张家港市"); areaCodeFullTable.put("320583", "昆山市"); areaCodeFullTable.put("320584", "吴江市"); areaCodeFullTable.put("320585", "太仓市"); areaCodeFullTable.put("320600", "南通市"); areaCodeFullTable.put("320601", "市辖区"); areaCodeFullTable.put("320602", "崇川区"); areaCodeFullTable.put("320611", "港闸区"); areaCodeFullTable.put("320621", "海安县"); areaCodeFullTable.put("320623", "如东县"); areaCodeFullTable.put("320681", "启东市"); areaCodeFullTable.put("320682", "如皋市"); areaCodeFullTable.put("320683", "通州市"); areaCodeFullTable.put("320684", "海门市"); areaCodeFullTable.put("320700", "连云港市"); areaCodeFullTable.put("320701", "市辖区"); areaCodeFullTable.put("320703", "连云区"); areaCodeFullTable.put("320705", "新浦区"); areaCodeFullTable.put("320706", "海州区"); areaCodeFullTable.put("320721", "赣榆县"); areaCodeFullTable.put("320722", "东海县"); areaCodeFullTable.put("320723", "灌云县"); areaCodeFullTable.put("320724", "灌南县"); areaCodeFullTable.put("320800", "淮安市"); areaCodeFullTable.put("320801", "市辖区"); areaCodeFullTable.put("320802", "清河区"); areaCodeFullTable.put("320803", "楚州区"); areaCodeFullTable.put("320804", "淮阴区"); areaCodeFullTable.put("320811", "清浦区"); areaCodeFullTable.put("320826", "涟水县"); areaCodeFullTable.put("320829", "洪泽县"); areaCodeFullTable.put("320830", "盱眙县"); areaCodeFullTable.put("320831", "金湖县"); areaCodeFullTable.put("320900", "盐城市"); areaCodeFullTable.put("320901", "市辖区"); areaCodeFullTable.put("320902", "城区"); areaCodeFullTable.put("320921", "响水县"); areaCodeFullTable.put("320922", "滨海县"); areaCodeFullTable.put("320923", "阜宁县"); areaCodeFullTable.put("320924", "射阳县"); areaCodeFullTable.put("320925", "建湖县"); areaCodeFullTable.put("320928", "盐都县"); areaCodeFullTable.put("320981", "东台市"); areaCodeFullTable.put("320982", "大丰市"); areaCodeFullTable.put("321000", "扬州市"); areaCodeFullTable.put("321001", "市辖区"); areaCodeFullTable.put("321002", "广陵区"); areaCodeFullTable.put("321003", "邗江区"); areaCodeFullTable.put("321011", "郊区"); areaCodeFullTable.put("321023", "宝应县"); areaCodeFullTable.put("321081", "仪征市"); areaCodeFullTable.put("321084", "高邮市"); areaCodeFullTable.put("321088", "江都市"); areaCodeFullTable.put("321100", "镇江市"); areaCodeFullTable.put("321101", "市辖区"); areaCodeFullTable.put("321102", "京口区"); areaCodeFullTable.put("321111", "润州区"); areaCodeFullTable.put("321121", "丹徒县"); areaCodeFullTable.put("321181", "丹阳市"); areaCodeFullTable.put("321182", "扬中市"); areaCodeFullTable.put("321183", "句容市"); areaCodeFullTable.put("321200", "泰州市"); areaCodeFullTable.put("321201", "市辖区"); areaCodeFullTable.put("321202", "海陵区"); areaCodeFullTable.put("321203", "高港区"); areaCodeFullTable.put("321281", "兴化市"); areaCodeFullTable.put("321282", "靖江市"); areaCodeFullTable.put("321283", "泰兴市"); areaCodeFullTable.put("321284", "姜堰市"); areaCodeFullTable.put("321300", "宿迁市"); areaCodeFullTable.put("321301", "市辖区"); areaCodeFullTable.put("321302", "宿城区"); areaCodeFullTable.put("321321", "宿豫县"); areaCodeFullTable.put("321322", "沭阳县"); areaCodeFullTable.put("321323", "泗阳县"); areaCodeFullTable.put("321324", "泗洪县"); areaCodeFullTable.put("330000", "浙江省"); areaCodeFullTable.put("330100", "杭州市"); areaCodeFullTable.put("330101", "市辖区"); areaCodeFullTable.put("330102", "上城区"); areaCodeFullTable.put("330103", "下城区"); areaCodeFullTable.put("330104", "江干区"); areaCodeFullTable.put("330105", "拱墅区"); areaCodeFullTable.put("330106", "西湖区"); areaCodeFullTable.put("330108", "滨江区"); areaCodeFullTable.put("330109", "萧山区"); areaCodeFullTable.put("330110", "余杭区"); areaCodeFullTable.put("330122", "桐庐县"); areaCodeFullTable.put("330127", "淳安县"); areaCodeFullTable.put("330182", "建德市"); areaCodeFullTable.put("330183", "富阳市"); areaCodeFullTable.put("330185", "临安市"); areaCodeFullTable.put("330200", "宁波市"); areaCodeFullTable.put("330201", "市辖区"); areaCodeFullTable.put("330203", "海曙区"); areaCodeFullTable.put("330204", "江东区"); areaCodeFullTable.put("330205", "江北区"); areaCodeFullTable.put("330206", "北仑区"); areaCodeFullTable.put("330211", "镇海区"); areaCodeFullTable.put("330225", "象山县"); areaCodeFullTable.put("330226", "宁海县"); areaCodeFullTable.put("330227", "鄞县"); areaCodeFullTable.put("330281", "余姚市"); areaCodeFullTable.put("330282", "慈溪市"); areaCodeFullTable.put("330283", "奉化市"); areaCodeFullTable.put("330300", "温州市"); areaCodeFullTable.put("330301", "市辖区"); areaCodeFullTable.put("330302", "鹿城区"); areaCodeFullTable.put("330303", "龙湾区"); areaCodeFullTable.put("330304", "瓯海区"); areaCodeFullTable.put("330322", "洞头县"); areaCodeFullTable.put("330324", "永嘉县"); areaCodeFullTable.put("330326", "平阳县"); areaCodeFullTable.put("330327", "苍南县"); areaCodeFullTable.put("330328", "文成县"); areaCodeFullTable.put("330329", "泰顺县"); areaCodeFullTable.put("330381", "瑞安市"); areaCodeFullTable.put("330382", "乐清市"); areaCodeFullTable.put("330400", "嘉兴市"); areaCodeFullTable.put("330401", "市辖区"); areaCodeFullTable.put("330402", "秀城区"); areaCodeFullTable.put("330411", "秀洲区"); areaCodeFullTable.put("330421", "嘉善县"); areaCodeFullTable.put("330424", "海盐县"); areaCodeFullTable.put("330481", "海宁市"); areaCodeFullTable.put("330482", "平湖市"); areaCodeFullTable.put("330483", "桐乡市"); areaCodeFullTable.put("330500", "湖州市"); areaCodeFullTable.put("330501", "市辖区"); areaCodeFullTable.put("330521", "德清县"); areaCodeFullTable.put("330522", "长兴县"); areaCodeFullTable.put("330523", "安吉县"); areaCodeFullTable.put("330600", "绍兴市"); areaCodeFullTable.put("330601", "市辖区"); areaCodeFullTable.put("330602", "越城区"); areaCodeFullTable.put("330621", "绍兴县"); areaCodeFullTable.put("330624", "新昌县"); areaCodeFullTable.put("330681", "诸暨市"); areaCodeFullTable.put("330682", "上虞市"); areaCodeFullTable.put("330683", "嵊州市"); areaCodeFullTable.put("330700", "金华市"); areaCodeFullTable.put("330701", "市辖区"); areaCodeFullTable.put("330702", "婺城区"); areaCodeFullTable.put("330703", "金东区"); areaCodeFullTable.put("330723", "武义县"); areaCodeFullTable.put("330726", "浦江县"); areaCodeFullTable.put("330727", "磐安县"); areaCodeFullTable.put("330781", "兰溪市"); areaCodeFullTable.put("330782", "义乌市"); areaCodeFullTable.put("330783", "东阳市"); areaCodeFullTable.put("330784", "永康市"); areaCodeFullTable.put("330800", "衢州市"); areaCodeFullTable.put("330801", "市辖区"); areaCodeFullTable.put("330802", "柯城区"); areaCodeFullTable.put("330803", "衢江区"); areaCodeFullTable.put("330822", "常山县"); areaCodeFullTable.put("330824", "开化县"); areaCodeFullTable.put("330825", "龙游县"); areaCodeFullTable.put("330881", "江山市"); areaCodeFullTable.put("330900", "舟山市"); areaCodeFullTable.put("330901", "市辖区"); areaCodeFullTable.put("330902", "定海区"); areaCodeFullTable.put("330903", "普陀区"); areaCodeFullTable.put("330921", "岱山县"); areaCodeFullTable.put("330922", "嵊泗县"); areaCodeFullTable.put("331000", "台州市"); areaCodeFullTable.put("331001", "市辖区"); areaCodeFullTable.put("331002", "椒江区"); areaCodeFullTable.put("331003", "黄岩区"); areaCodeFullTable.put("331004", "路桥区"); areaCodeFullTable.put("331021", "玉环县"); areaCodeFullTable.put("331022", "三门县"); areaCodeFullTable.put("331023", "天台县"); areaCodeFullTable.put("331024", "仙居县"); areaCodeFullTable.put("331081", "温岭市"); areaCodeFullTable.put("331082", "临海市"); areaCodeFullTable.put("331100", "丽水市"); areaCodeFullTable.put("331101", "市辖区"); areaCodeFullTable.put("331102", "莲都区"); areaCodeFullTable.put("331121", "青田县"); areaCodeFullTable.put("331122", "缙云县"); areaCodeFullTable.put("331123", "遂昌县"); areaCodeFullTable.put("331124", "松阳县"); areaCodeFullTable.put("331125", "云和县"); areaCodeFullTable.put("331126", "庆元县"); areaCodeFullTable.put("331127", "景宁畲族自治县"); areaCodeFullTable.put("331181", "龙泉市"); areaCodeFullTable.put("340000", "安徽省"); areaCodeFullTable.put("340100", "合肥市"); areaCodeFullTable.put("340101", "市辖区"); areaCodeFullTable.put("340102", "东市区"); areaCodeFullTable.put("340103", "中市区"); areaCodeFullTable.put("340104", "西市区"); areaCodeFullTable.put("340111", "郊区"); areaCodeFullTable.put("340121", "长丰县"); areaCodeFullTable.put("340122", "肥东县"); areaCodeFullTable.put("340123", "肥西县"); areaCodeFullTable.put("340200", "芜湖市"); areaCodeFullTable.put("340201", "市辖区"); areaCodeFullTable.put("340202", "镜湖区"); areaCodeFullTable.put("340203", "马塘区"); areaCodeFullTable.put("340204", "新芜区"); areaCodeFullTable.put("340207", "鸠江区"); areaCodeFullTable.put("340221", "芜湖县"); areaCodeFullTable.put("340222", "繁昌县"); areaCodeFullTable.put("340223", "南陵县"); areaCodeFullTable.put("340300", "蚌埠市"); areaCodeFullTable.put("340301", "市辖区"); areaCodeFullTable.put("340302", "东市区"); areaCodeFullTable.put("340303", "中市区"); areaCodeFullTable.put("340304", "西市区"); areaCodeFullTable.put("340311", "郊区"); areaCodeFullTable.put("340321", "怀远县"); areaCodeFullTable.put("340322", "五河县"); areaCodeFullTable.put("340323", "固镇县"); areaCodeFullTable.put("340400", "淮南市"); areaCodeFullTable.put("340401", "市辖区"); areaCodeFullTable.put("340402", "大通区"); areaCodeFullTable.put("340403", "田家庵区"); areaCodeFullTable.put("340404", "谢家集区"); areaCodeFullTable.put("340405", "八公山区"); areaCodeFullTable.put("340406", "潘集区"); areaCodeFullTable.put("340421", "凤台县"); areaCodeFullTable.put("340500", "马鞍山市"); areaCodeFullTable.put("340501", "市辖区"); areaCodeFullTable.put("340502", "金家庄区"); areaCodeFullTable.put("340503", "花山区"); areaCodeFullTable.put("340504", "雨山区"); areaCodeFullTable.put("340521", "当涂县"); areaCodeFullTable.put("340600", "淮北市"); areaCodeFullTable.put("340601", "市辖区"); areaCodeFullTable.put("340602", "杜集区"); areaCodeFullTable.put("340603", "相山区"); areaCodeFullTable.put("340604", "烈山区"); areaCodeFullTable.put("340621", "濉溪县"); areaCodeFullTable.put("340700", "铜陵市"); areaCodeFullTable.put("340701", "市辖区"); areaCodeFullTable.put("340702", "铜官山区"); areaCodeFullTable.put("340703", "狮子山区"); areaCodeFullTable.put("340711", "郊区"); areaCodeFullTable.put("340721", "铜陵县"); areaCodeFullTable.put("340800", "安庆市"); areaCodeFullTable.put("340801", "市辖区"); areaCodeFullTable.put("340802", "迎江区"); areaCodeFullTable.put("340803", "大观区"); areaCodeFullTable.put("340811", "郊区"); areaCodeFullTable.put("340822", "怀宁县"); areaCodeFullTable.put("340823", "枞阳县"); areaCodeFullTable.put("340824", "潜山县"); areaCodeFullTable.put("340825", "太湖县"); areaCodeFullTable.put("340826", "宿松县"); areaCodeFullTable.put("340827", "望江县"); areaCodeFullTable.put("340828", "岳西县"); areaCodeFullTable.put("340881", "桐城市"); areaCodeFullTable.put("341000", "黄山市"); areaCodeFullTable.put("341001", "市辖区"); areaCodeFullTable.put("341002", "屯溪区"); areaCodeFullTable.put("341003", "黄山区"); areaCodeFullTable.put("341004", "徽州区"); areaCodeFullTable.put("341021", "歙县"); areaCodeFullTable.put("341022", "休宁县"); areaCodeFullTable.put("341023", "黟县"); areaCodeFullTable.put("341024", "祁门县"); areaCodeFullTable.put("341100", "滁州市"); areaCodeFullTable.put("341101", "市辖区"); areaCodeFullTable.put("341102", "琅琊区"); areaCodeFullTable.put("341103", "南谯区"); areaCodeFullTable.put("341122", "来安县"); areaCodeFullTable.put("341124", "全椒县"); areaCodeFullTable.put("341125", "定远县"); areaCodeFullTable.put("341126", "凤阳县"); areaCodeFullTable.put("341181", "天长市"); areaCodeFullTable.put("341182", "明光市"); areaCodeFullTable.put("341200", "阜阳市"); areaCodeFullTable.put("341201", "市辖区"); areaCodeFullTable.put("341202", "颍州区"); areaCodeFullTable.put("341203", "颍东区"); areaCodeFullTable.put("341204", "颍泉区"); areaCodeFullTable.put("341221", "临泉县"); areaCodeFullTable.put("341222", "太和县"); areaCodeFullTable.put("341225", "阜南县"); areaCodeFullTable.put("341226", "颍上县"); areaCodeFullTable.put("341282", "界首市"); areaCodeFullTable.put("341300", "宿州市"); areaCodeFullTable.put("341301", "市辖区"); areaCodeFullTable.put("341321", "砀山县"); areaCodeFullTable.put("341322", "萧县"); areaCodeFullTable.put("341323", "灵璧县"); areaCodeFullTable.put("341324", "泗县"); areaCodeFullTable.put("341400", "巢湖市"); areaCodeFullTable.put("341401", "市辖区"); areaCodeFullTable.put("341402", "居巢区"); areaCodeFullTable.put("341421", "庐江县"); areaCodeFullTable.put("341422", "无为县"); areaCodeFullTable.put("341423", "含山县"); areaCodeFullTable.put("341424", "和县"); areaCodeFullTable.put("341500", "六安市"); areaCodeFullTable.put("341501", "市辖区"); areaCodeFullTable.put("341502", "金安区"); areaCodeFullTable.put("341503", "裕安区"); areaCodeFullTable.put("341521", "寿县"); areaCodeFullTable.put("341522", "霍邱县"); areaCodeFullTable.put("341523", "舒城县"); areaCodeFullTable.put("341524", "金寨县"); areaCodeFullTable.put("341525", "霍山县"); areaCodeFullTable.put("341600", "亳州市"); areaCodeFullTable.put("341601", "市辖区"); areaCodeFullTable.put("341602", "谯城区"); areaCodeFullTable.put("341621", "涡阳县"); areaCodeFullTable.put("341622", "蒙城县"); areaCodeFullTable.put("341623", "利辛县"); areaCodeFullTable.put("341700", "池州市"); areaCodeFullTable.put("341701", "市辖区"); areaCodeFullTable.put("341702", "贵池区"); areaCodeFullTable.put("341721", "东至县"); areaCodeFullTable.put("341722", "石台县"); areaCodeFullTable.put("341723", "青阳县"); areaCodeFullTable.put("341800", "宣城市"); areaCodeFullTable.put("341801", "市辖区"); areaCodeFullTable.put("341802", "宣州区"); areaCodeFullTable.put("341821", "郎溪县"); areaCodeFullTable.put("341822", "广德县"); areaCodeFullTable.put("341823", "泾县"); areaCodeFullTable.put("341824", "绩溪县"); areaCodeFullTable.put("341825", "旌德县"); areaCodeFullTable.put("341881", "宁国市"); areaCodeFullTable.put("350000", "福建省"); areaCodeFullTable.put("350100", "福州市"); areaCodeFullTable.put("350101", "市辖区"); areaCodeFullTable.put("350102", "鼓楼区"); areaCodeFullTable.put("350103", "台江区"); areaCodeFullTable.put("350104", "仓山区"); areaCodeFullTable.put("350105", "马尾区"); areaCodeFullTable.put("350111", "晋安区"); areaCodeFullTable.put("350121", "闽侯县"); areaCodeFullTable.put("350122", "连江县"); areaCodeFullTable.put("350123", "罗源县"); areaCodeFullTable.put("350124", "闽清县"); areaCodeFullTable.put("350125", "永泰县"); areaCodeFullTable.put("350128", "平潭县"); areaCodeFullTable.put("350181", "福清市"); areaCodeFullTable.put("350182", "长乐市"); areaCodeFullTable.put("350200", "厦门市"); areaCodeFullTable.put("350201", "市辖区"); areaCodeFullTable.put("350202", "鼓浪屿区"); areaCodeFullTable.put("350203", "思明区"); areaCodeFullTable.put("350204", "开元区"); areaCodeFullTable.put("350205", "杏林区"); areaCodeFullTable.put("350206", "湖里区"); areaCodeFullTable.put("350211", "集美区"); areaCodeFullTable.put("350212", "同安区"); areaCodeFullTable.put("350300", "莆田市"); areaCodeFullTable.put("350301", "市辖区"); areaCodeFullTable.put("350302", "城厢区"); areaCodeFullTable.put("350303", "涵江区"); areaCodeFullTable.put("350321", "莆田县"); areaCodeFullTable.put("350322", "仙游县"); areaCodeFullTable.put("350400", "三明市"); areaCodeFullTable.put("350401", "市辖区"); areaCodeFullTable.put("350402", "梅列区"); areaCodeFullTable.put("350403", "三元区"); areaCodeFullTable.put("350421", "明溪县"); areaCodeFullTable.put("350423", "清流县"); areaCodeFullTable.put("350424", "宁化县"); areaCodeFullTable.put("350425", "大田县"); areaCodeFullTable.put("350426", "尤溪县"); areaCodeFullTable.put("350427", "沙县"); areaCodeFullTable.put("350428", "将乐县"); areaCodeFullTable.put("350429", "泰宁县"); areaCodeFullTable.put("350430", "建宁县"); areaCodeFullTable.put("350481", "永安市"); areaCodeFullTable.put("350500", "泉州市"); areaCodeFullTable.put("350501", "市辖区"); areaCodeFullTable.put("350502", "鲤城区"); areaCodeFullTable.put("350503", "丰泽区"); areaCodeFullTable.put("350504", "洛江区"); areaCodeFullTable.put("350505", "泉港区"); areaCodeFullTable.put("350521", "惠安县"); areaCodeFullTable.put("350524", "安溪县"); areaCodeFullTable.put("350525", "永春县"); areaCodeFullTable.put("350526", "德化县"); areaCodeFullTable.put("350527", "金门县"); areaCodeFullTable.put("350581", "石狮市"); areaCodeFullTable.put("350582", "晋江市"); areaCodeFullTable.put("350583", "南安市"); areaCodeFullTable.put("350600", "漳州市"); areaCodeFullTable.put("350601", "市辖区"); areaCodeFullTable.put("350602", "芗城区"); areaCodeFullTable.put("350603", "龙文区"); areaCodeFullTable.put("350622", "云霄县"); areaCodeFullTable.put("350623", "漳浦县"); areaCodeFullTable.put("350624", "诏安县"); areaCodeFullTable.put("350625", "长泰县"); areaCodeFullTable.put("350626", "东山县"); areaCodeFullTable.put("350627", "南靖县"); areaCodeFullTable.put("350628", "平和县"); areaCodeFullTable.put("350629", "华安县"); areaCodeFullTable.put("350681", "龙海市"); areaCodeFullTable.put("350700", "南平市"); areaCodeFullTable.put("350701", "市辖区"); areaCodeFullTable.put("350702", "延平区"); areaCodeFullTable.put("350721", "顺昌县"); areaCodeFullTable.put("350722", "浦城县"); areaCodeFullTable.put("350723", "光泽县"); areaCodeFullTable.put("350724", "松溪县"); areaCodeFullTable.put("350725", "政和县"); areaCodeFullTable.put("350781", "邵武市"); areaCodeFullTable.put("350782", "武夷山市"); areaCodeFullTable.put("350783", "建瓯市"); areaCodeFullTable.put("350784", "建阳市"); areaCodeFullTable.put("350800", "龙岩市"); areaCodeFullTable.put("350801", "市辖区"); areaCodeFullTable.put("350802", "新罗区"); areaCodeFullTable.put("350821", "长汀县"); areaCodeFullTable.put("350822", "永定县"); areaCodeFullTable.put("350823", "上杭县"); areaCodeFullTable.put("350824", "武平县"); areaCodeFullTable.put("350825", "连城县"); areaCodeFullTable.put("350881", "漳平市"); areaCodeFullTable.put("350900", "宁德市"); areaCodeFullTable.put("350901", "市辖区"); areaCodeFullTable.put("350902", "蕉城区"); areaCodeFullTable.put("350921", "霞浦县"); areaCodeFullTable.put("350922", "古田县"); areaCodeFullTable.put("350923", "屏南县"); areaCodeFullTable.put("350924", "寿宁县"); areaCodeFullTable.put("350925", "周宁县"); areaCodeFullTable.put("350926", "柘荣县"); areaCodeFullTable.put("350981", "福安市"); areaCodeFullTable.put("350982", "福鼎市"); areaCodeFullTable.put("360000", "江西省"); areaCodeFullTable.put("360100", "南昌市"); areaCodeFullTable.put("360101", "市辖区"); areaCodeFullTable.put("360102", "东湖区"); areaCodeFullTable.put("360103", "西湖区"); areaCodeFullTable.put("360104", "青云谱区"); areaCodeFullTable.put("360105", "湾里区"); areaCodeFullTable.put("360111", "郊区"); areaCodeFullTable.put("360121", "南昌县"); areaCodeFullTable.put("360122", "新建县"); areaCodeFullTable.put("360123", "安义县"); areaCodeFullTable.put("360124", "进贤县"); areaCodeFullTable.put("360200", "景德镇市"); areaCodeFullTable.put("360201", "市辖区"); areaCodeFullTable.put("360202", "昌江区"); areaCodeFullTable.put("360203", "珠山区"); areaCodeFullTable.put("360222", "浮梁县"); areaCodeFullTable.put("360281", "乐平市"); areaCodeFullTable.put("360300", "萍乡市"); areaCodeFullTable.put("360301", "市辖区"); areaCodeFullTable.put("360302", "安源区"); areaCodeFullTable.put("360313", "湘东区"); areaCodeFullTable.put("360321", "莲花县"); areaCodeFullTable.put("360322", "上栗县"); areaCodeFullTable.put("360323", "芦溪县"); areaCodeFullTable.put("360400", "九江市"); areaCodeFullTable.put("360401", "市辖区"); areaCodeFullTable.put("360402", "庐山区"); areaCodeFullTable.put("360403", "浔阳区"); areaCodeFullTable.put("360421", "九江县"); areaCodeFullTable.put("360423", "武宁县"); areaCodeFullTable.put("360424", "修水县"); areaCodeFullTable.put("360425", "永修县"); areaCodeFullTable.put("360426", "德安县"); areaCodeFullTable.put("360427", "星子县"); areaCodeFullTable.put("360428", "都昌县"); areaCodeFullTable.put("360429", "湖口县"); areaCodeFullTable.put("360430", "彭泽县"); areaCodeFullTable.put("360481", "瑞昌市"); areaCodeFullTable.put("360500", "新余市"); areaCodeFullTable.put("360501", "市辖区"); areaCodeFullTable.put("360502", "渝水区"); areaCodeFullTable.put("360521", "分宜县"); areaCodeFullTable.put("360600", "鹰潭市"); areaCodeFullTable.put("360601", "市辖区"); areaCodeFullTable.put("360602", "月湖区"); areaCodeFullTable.put("360622", "余江县"); areaCodeFullTable.put("360681", "贵溪市"); areaCodeFullTable.put("360700", "赣州市"); areaCodeFullTable.put("360701", "市辖区"); areaCodeFullTable.put("360702", "章贡区"); areaCodeFullTable.put("360721", "赣县"); areaCodeFullTable.put("360722", "信丰县"); areaCodeFullTable.put("360723", "大余县"); areaCodeFullTable.put("360724", "上犹县"); areaCodeFullTable.put("360725", "崇义县"); areaCodeFullTable.put("360726", "安远县"); areaCodeFullTable.put("360727", "龙南县"); areaCodeFullTable.put("360728", "定南县"); areaCodeFullTable.put("360729", "全南县"); areaCodeFullTable.put("360730", "宁都县"); areaCodeFullTable.put("360731", "于都县"); areaCodeFullTable.put("360732", "兴国县"); areaCodeFullTable.put("360733", "会昌县"); areaCodeFullTable.put("360734", "寻乌县"); areaCodeFullTable.put("360735", "石城县"); areaCodeFullTable.put("360781", "瑞金市"); areaCodeFullTable.put("360782", "南康市"); areaCodeFullTable.put("360800", "吉安市"); areaCodeFullTable.put("360801", "市辖区"); areaCodeFullTable.put("360802", "吉州区"); areaCodeFullTable.put("360803", "青原区"); areaCodeFullTable.put("360821", "吉安县"); areaCodeFullTable.put("360822", "吉水县"); areaCodeFullTable.put("360823", "峡江县"); areaCodeFullTable.put("360824", "新干县"); areaCodeFullTable.put("360825", "永丰县"); areaCodeFullTable.put("360826", "泰和县"); areaCodeFullTable.put("360827", "遂川县"); areaCodeFullTable.put("360828", "万安县"); areaCodeFullTable.put("360829", "安福县"); areaCodeFullTable.put("360830", "永新县"); areaCodeFullTable.put("360881", "井冈山市"); areaCodeFullTable.put("360900", "宜春市"); areaCodeFullTable.put("360901", "市辖区"); areaCodeFullTable.put("360902", "袁州区"); areaCodeFullTable.put("360921", "奉新县"); areaCodeFullTable.put("360922", "万载县"); areaCodeFullTable.put("360923", "上高县"); areaCodeFullTable.put("360924", "宜丰县"); areaCodeFullTable.put("360925", "靖安县"); areaCodeFullTable.put("360926", "铜鼓县"); areaCodeFullTable.put("360981", "丰城市"); areaCodeFullTable.put("360982", "樟树市"); areaCodeFullTable.put("360983", "高安市"); areaCodeFullTable.put("361000", "抚州市"); areaCodeFullTable.put("361001", "市辖区"); areaCodeFullTable.put("361002", "临川区"); areaCodeFullTable.put("361021", "南城县"); areaCodeFullTable.put("361022", "黎川县"); areaCodeFullTable.put("361023", "南丰县"); areaCodeFullTable.put("361024", "崇仁县"); areaCodeFullTable.put("361025", "乐安县"); areaCodeFullTable.put("361026", "宜黄县"); areaCodeFullTable.put("361027", "金溪县"); areaCodeFullTable.put("361028", "资溪县"); areaCodeFullTable.put("361029", "东乡县"); areaCodeFullTable.put("361030", "广昌县"); areaCodeFullTable.put("361100", "上饶市"); areaCodeFullTable.put("361101", "市辖区"); areaCodeFullTable.put("361102", "信州区"); areaCodeFullTable.put("361121", "上饶县"); areaCodeFullTable.put("361122", "广丰县"); areaCodeFullTable.put("361123", "玉山县"); areaCodeFullTable.put("361124", "铅山县"); areaCodeFullTable.put("361125", "横峰县"); areaCodeFullTable.put("361126", "弋阳县"); areaCodeFullTable.put("361127", "余干县"); areaCodeFullTable.put("361128", "波阳县"); areaCodeFullTable.put("361129", "万年县"); areaCodeFullTable.put("361130", "婺源县"); areaCodeFullTable.put("361181", "德兴市"); areaCodeFullTable.put("370000", "山东省"); areaCodeFullTable.put("370100", "济南市"); areaCodeFullTable.put("370101", "市辖区"); areaCodeFullTable.put("370102", "历下区"); areaCodeFullTable.put("370103", "市中区"); areaCodeFullTable.put("370104", "槐荫区"); areaCodeFullTable.put("370105", "天桥区"); areaCodeFullTable.put("370112", "历城区"); areaCodeFullTable.put("370113", "长清区"); areaCodeFullTable.put("370124", "平阴县"); areaCodeFullTable.put("370125", "济阳县"); areaCodeFullTable.put("370126", "商河县"); areaCodeFullTable.put("370181", "章丘市"); areaCodeFullTable.put("370200", "青岛市"); areaCodeFullTable.put("370201", "市辖区"); areaCodeFullTable.put("370202", "市南区"); areaCodeFullTable.put("370203", "市北区"); areaCodeFullTable.put("370205", "四方区"); areaCodeFullTable.put("370211", "黄岛区"); areaCodeFullTable.put("370212", "崂山区"); areaCodeFullTable.put("370213", "李沧区"); areaCodeFullTable.put("370214", "城阳区"); areaCodeFullTable.put("370281", "胶州市"); areaCodeFullTable.put("370282", "即墨市"); areaCodeFullTable.put("370283", "平度市"); areaCodeFullTable.put("370284", "胶南市"); areaCodeFullTable.put("370285", "莱西市"); areaCodeFullTable.put("370300", "淄博市"); areaCodeFullTable.put("370301", "市辖区"); areaCodeFullTable.put("370302", "淄川区"); areaCodeFullTable.put("370303", "张店区"); areaCodeFullTable.put("370304", "博山区"); areaCodeFullTable.put("370305", "临淄区"); areaCodeFullTable.put("370306", "周村区"); areaCodeFullTable.put("370321", "桓台县"); areaCodeFullTable.put("370322", "高青县"); areaCodeFullTable.put("370323", "沂源县"); areaCodeFullTable.put("370400", "枣庄市"); areaCodeFullTable.put("370401", "市辖区"); areaCodeFullTable.put("370402", "市中区"); areaCodeFullTable.put("370403", "薛城区"); areaCodeFullTable.put("370404", "峄城区"); areaCodeFullTable.put("370405", "台儿庄区"); areaCodeFullTable.put("370406", "山亭区"); areaCodeFullTable.put("370481", "滕州市"); areaCodeFullTable.put("370500", "东营市"); areaCodeFullTable.put("370501", "市辖区"); areaCodeFullTable.put("370502", "东营区"); areaCodeFullTable.put("370503", "河口区"); areaCodeFullTable.put("370521", "垦利县"); areaCodeFullTable.put("370522", "利津县"); areaCodeFullTable.put("370523", "广饶县"); areaCodeFullTable.put("370600", "烟台市"); areaCodeFullTable.put("370601", "市辖区"); areaCodeFullTable.put("370602", "芝罘区"); areaCodeFullTable.put("370611", "福山区"); areaCodeFullTable.put("370612", "牟平区"); areaCodeFullTable.put("370613", "莱山区"); areaCodeFullTable.put("370634", "长岛县"); areaCodeFullTable.put("370681", "龙口市"); areaCodeFullTable.put("370682", "莱阳市"); areaCodeFullTable.put("370683", "莱州市"); areaCodeFullTable.put("370684", "蓬莱市"); areaCodeFullTable.put("370685", "招远市"); areaCodeFullTable.put("370686", "栖霞市"); areaCodeFullTable.put("370687", "海阳市"); areaCodeFullTable.put("370700", "潍坊市"); areaCodeFullTable.put("370701", "市辖区"); areaCodeFullTable.put("370702", "潍城区"); areaCodeFullTable.put("370703", "寒亭区"); areaCodeFullTable.put("370704", "坊子区"); areaCodeFullTable.put("370705", "奎文区"); areaCodeFullTable.put("370724", "临朐县"); areaCodeFullTable.put("370725", "昌乐县"); areaCodeFullTable.put("370781", "青州市"); areaCodeFullTable.put("370782", "诸城市"); areaCodeFullTable.put("370783", "寿光市"); areaCodeFullTable.put("370784", "安丘市"); areaCodeFullTable.put("370785", "高密市"); areaCodeFullTable.put("370786", "昌邑市"); areaCodeFullTable.put("370800", "济宁市"); areaCodeFullTable.put("370801", "市辖区"); areaCodeFullTable.put("370802", "市中区"); areaCodeFullTable.put("370811", "任城区"); areaCodeFullTable.put("370826", "微山县"); areaCodeFullTable.put("370827", "鱼台县"); areaCodeFullTable.put("370828", "金乡县"); areaCodeFullTable.put("370829", "嘉祥县"); areaCodeFullTable.put("370830", "汶上县"); areaCodeFullTable.put("370831", "泗水县"); areaCodeFullTable.put("370832", "梁山县"); areaCodeFullTable.put("370881", "曲阜市"); areaCodeFullTable.put("370882", "兖州市"); areaCodeFullTable.put("370883", "邹城市"); areaCodeFullTable.put("370900", "泰安市"); areaCodeFullTable.put("370901", "市辖区"); areaCodeFullTable.put("370902", "泰山区"); areaCodeFullTable.put("370911", "岱岳区"); areaCodeFullTable.put("370921", "宁阳县"); areaCodeFullTable.put("370923", "东平县"); areaCodeFullTable.put("370982", "新泰市"); areaCodeFullTable.put("370983", "肥城市"); areaCodeFullTable.put("371000", "威海市"); areaCodeFullTable.put("371001", "市辖区"); areaCodeFullTable.put("371002", "环翠区"); areaCodeFullTable.put("371081", "文登市"); areaCodeFullTable.put("371082", "荣成市"); areaCodeFullTable.put("371083", "乳山市"); areaCodeFullTable.put("371100", "日照市"); areaCodeFullTable.put("371101", "市辖区"); areaCodeFullTable.put("371102", "东港区"); areaCodeFullTable.put("371121", "五莲县"); areaCodeFullTable.put("371122", "莒县"); areaCodeFullTable.put("371200", "莱芜市"); areaCodeFullTable.put("371201", "市辖区"); areaCodeFullTable.put("371202", "莱城区"); areaCodeFullTable.put("371203", "钢城区"); areaCodeFullTable.put("371300", "临沂市"); areaCodeFullTable.put("371301", "市辖区"); areaCodeFullTable.put("371302", "兰山区"); areaCodeFullTable.put("371311", "罗庄区"); areaCodeFullTable.put("371312", "河东区"); areaCodeFullTable.put("371321", "沂南县"); areaCodeFullTable.put("371322", "郯城县"); areaCodeFullTable.put("371323", "沂水县"); areaCodeFullTable.put("371324", "苍山县"); areaCodeFullTable.put("371325", "费县"); areaCodeFullTable.put("371326", "平邑县"); areaCodeFullTable.put("371327", "莒南县"); areaCodeFullTable.put("371328", "蒙阴县"); areaCodeFullTable.put("371329", "临沭县"); areaCodeFullTable.put("371400", "德州市"); areaCodeFullTable.put("371401", "市辖区"); areaCodeFullTable.put("371402", "德城区"); areaCodeFullTable.put("371421", "陵县"); areaCodeFullTable.put("371422", "宁津县"); areaCodeFullTable.put("371423", "庆云县"); areaCodeFullTable.put("371424", "临邑县"); areaCodeFullTable.put("371425", "齐河县"); areaCodeFullTable.put("371426", "平原县"); areaCodeFullTable.put("371427", "夏津县"); areaCodeFullTable.put("371428", "武城县"); areaCodeFullTable.put("371481", "乐陵市"); areaCodeFullTable.put("371482", "禹城市"); areaCodeFullTable.put("371500", "聊城市"); areaCodeFullTable.put("371501", "市辖区"); areaCodeFullTable.put("371502", "东昌府区"); areaCodeFullTable.put("371521", "阳谷县"); areaCodeFullTable.put("371522", "莘县"); areaCodeFullTable.put("371523", "茌平县"); areaCodeFullTable.put("371524", "东阿县"); areaCodeFullTable.put("371525", "冠县"); areaCodeFullTable.put("371526", "高唐县"); areaCodeFullTable.put("371581", "临清市"); areaCodeFullTable.put("371600", "滨州市"); areaCodeFullTable.put("371601", "市辖区"); areaCodeFullTable.put("371602", "滨城区"); areaCodeFullTable.put("371621", "惠民县"); areaCodeFullTable.put("371622", "阳信县"); areaCodeFullTable.put("371623", "无棣县"); areaCodeFullTable.put("371624", "沾化县"); areaCodeFullTable.put("371625", "博兴县"); areaCodeFullTable.put("371626", "邹平县"); areaCodeFullTable.put("371700", "菏泽市"); areaCodeFullTable.put("371701", "市辖区"); areaCodeFullTable.put("371702", "牡丹区"); areaCodeFullTable.put("371721", "曹县"); areaCodeFullTable.put("371722", "单县"); areaCodeFullTable.put("371723", "成武县"); areaCodeFullTable.put("371724", "巨野县"); areaCodeFullTable.put("371725", "郓城县"); areaCodeFullTable.put("371726", "鄄城县"); areaCodeFullTable.put("371727", "定陶县"); areaCodeFullTable.put("371728", "东明县"); areaCodeFullTable.put("410000", "河南省"); areaCodeFullTable.put("410100", "郑州市"); areaCodeFullTable.put("410101", "市辖区"); areaCodeFullTable.put("410102", "中原区"); areaCodeFullTable.put("410103", "二七区"); areaCodeFullTable.put("410104", "管城回族区"); areaCodeFullTable.put("410105", "金水区"); areaCodeFullTable.put("410106", "上街区"); areaCodeFullTable.put("410108", "邙山区"); areaCodeFullTable.put("410122", "中牟县"); areaCodeFullTable.put("410181", "巩义市"); areaCodeFullTable.put("410182", "荥阳市"); areaCodeFullTable.put("410183", "新密市"); areaCodeFullTable.put("410184", "新郑市"); areaCodeFullTable.put("410185", "登封市"); areaCodeFullTable.put("410200", "开封市"); areaCodeFullTable.put("410201", "市辖区"); areaCodeFullTable.put("410202", "龙亭区"); areaCodeFullTable.put("410203", "顺河回族区"); areaCodeFullTable.put("410204", "鼓楼区"); areaCodeFullTable.put("410205", "南关区"); areaCodeFullTable.put("410211", "郊区"); areaCodeFullTable.put("410221", "杞县"); areaCodeFullTable.put("410222", "通许县"); areaCodeFullTable.put("410223", "尉氏县"); areaCodeFullTable.put("410224", "开封县"); areaCodeFullTable.put("410225", "兰考县"); areaCodeFullTable.put("410300", "洛阳市"); areaCodeFullTable.put("410301", "市辖区"); areaCodeFullTable.put("410302", "老城区"); areaCodeFullTable.put("410303", "西工区"); areaCodeFullTable.put("410305", "涧西区"); areaCodeFullTable.put("410306", "吉利区"); areaCodeFullTable.put("410311", "洛龙区"); areaCodeFullTable.put("410322", "孟津县"); areaCodeFullTable.put("410323", "新安县"); areaCodeFullTable.put("410324", "栾川县"); areaCodeFullTable.put("410325", "嵩县"); areaCodeFullTable.put("410326", "汝阳县"); areaCodeFullTable.put("410327", "宜阳县"); areaCodeFullTable.put("410328", "洛宁县"); areaCodeFullTable.put("410329", "伊川县"); areaCodeFullTable.put("410381", "偃师市"); areaCodeFullTable.put("410400", "平顶山市"); areaCodeFullTable.put("410401", "市辖区"); areaCodeFullTable.put("410402", "新华区"); areaCodeFullTable.put("410403", "卫东区"); areaCodeFullTable.put("410404", "石龙区"); areaCodeFullTable.put("410411", "湛河区"); areaCodeFullTable.put("410421", "宝丰县"); areaCodeFullTable.put("410422", "叶县"); areaCodeFullTable.put("410423", "鲁山县"); areaCodeFullTable.put("410425", "郏县"); areaCodeFullTable.put("410481", "舞钢市"); areaCodeFullTable.put("410482", "汝州市"); areaCodeFullTable.put("410500", "安阳市"); areaCodeFullTable.put("410501", "市辖区"); areaCodeFullTable.put("410502", "文峰区"); areaCodeFullTable.put("410503", "北关区"); areaCodeFullTable.put("410504", "铁西区"); areaCodeFullTable.put("410511", "郊区"); areaCodeFullTable.put("410522", "安阳县"); areaCodeFullTable.put("410523", "汤阴县"); areaCodeFullTable.put("410526", "滑县"); areaCodeFullTable.put("410527", "内黄县"); areaCodeFullTable.put("410581", "林州市"); areaCodeFullTable.put("410600", "鹤壁市"); areaCodeFullTable.put("410601", "市辖区"); areaCodeFullTable.put("410602", "鹤山区"); areaCodeFullTable.put("410603", "山城区"); areaCodeFullTable.put("410611", "淇滨区"); areaCodeFullTable.put("410621", "浚县"); areaCodeFullTable.put("410622", "淇县"); areaCodeFullTable.put("410700", "新乡市"); areaCodeFullTable.put("410701", "市辖区"); areaCodeFullTable.put("410702", "红旗区"); areaCodeFullTable.put("410703", "新华区"); areaCodeFullTable.put("410704", "北站区"); areaCodeFullTable.put("410711", "郊区"); areaCodeFullTable.put("410721", "新乡县"); areaCodeFullTable.put("410724", "获嘉县"); areaCodeFullTable.put("410725", "原阳县"); areaCodeFullTable.put("410726", "延津县"); areaCodeFullTable.put("410727", "封丘县"); areaCodeFullTable.put("410728", "长垣县"); areaCodeFullTable.put("410781", "卫辉市"); areaCodeFullTable.put("410782", "辉县市"); areaCodeFullTable.put("410800", "焦作市"); areaCodeFullTable.put("410801", "市辖区"); areaCodeFullTable.put("410802", "解放区"); areaCodeFullTable.put("410803", "中站区"); areaCodeFullTable.put("410804", "马村区"); areaCodeFullTable.put("410811", "山阳区"); areaCodeFullTable.put("410821", "修武县"); areaCodeFullTable.put("410822", "博爱县"); areaCodeFullTable.put("410823", "武陟县"); areaCodeFullTable.put("410825", "温县"); areaCodeFullTable.put("410881", "济源市"); areaCodeFullTable.put("410882", "沁阳市"); areaCodeFullTable.put("410883", "孟州市"); areaCodeFullTable.put("410900", "濮阳市"); areaCodeFullTable.put("410901", "市辖区"); areaCodeFullTable.put("410902", "市区"); areaCodeFullTable.put("410922", "清丰县"); areaCodeFullTable.put("410923", "南乐县"); areaCodeFullTable.put("410926", "范县"); areaCodeFullTable.put("410927", "台前县"); areaCodeFullTable.put("410928", "濮阳县"); areaCodeFullTable.put("411000", "许昌市"); areaCodeFullTable.put("411001", "市辖区"); areaCodeFullTable.put("411002", "魏都区"); areaCodeFullTable.put("411023", "许昌县"); areaCodeFullTable.put("411024", "鄢陵县"); areaCodeFullTable.put("411025", "襄城县"); areaCodeFullTable.put("411081", "禹州市"); areaCodeFullTable.put("411082", "长葛市"); areaCodeFullTable.put("411100", "漯河市"); areaCodeFullTable.put("411101", "市辖区"); areaCodeFullTable.put("411102", "源汇区"); areaCodeFullTable.put("411121", "舞阳县"); areaCodeFullTable.put("411122", "临颍县"); areaCodeFullTable.put("411123", "郾城县"); areaCodeFullTable.put("411200", "三门峡市"); areaCodeFullTable.put("411201", "市辖区"); areaCodeFullTable.put("411202", "湖滨区"); areaCodeFullTable.put("411221", "渑池县"); areaCodeFullTable.put("411222", "陕县"); areaCodeFullTable.put("411224", "卢氏县"); areaCodeFullTable.put("411281", "义马市"); areaCodeFullTable.put("411282", "灵宝市"); areaCodeFullTable.put("411300", "南阳市"); areaCodeFullTable.put("411301", "市辖区"); areaCodeFullTable.put("411302", "宛城区"); areaCodeFullTable.put("411303", "卧龙区"); areaCodeFullTable.put("411321", "南召县"); areaCodeFullTable.put("411322", "方城县"); areaCodeFullTable.put("411323", "西峡县"); areaCodeFullTable.put("411324", "镇平县"); areaCodeFullTable.put("411325", "内乡县"); areaCodeFullTable.put("411326", "淅川县"); areaCodeFullTable.put("411327", "社旗县"); areaCodeFullTable.put("411328", "唐河县"); areaCodeFullTable.put("411329", "新野县"); areaCodeFullTable.put("411330", "桐柏县"); areaCodeFullTable.put("411381", "邓州市"); areaCodeFullTable.put("411400", "商丘市"); areaCodeFullTable.put("411401", "市辖区"); areaCodeFullTable.put("411402", "梁园区"); areaCodeFullTable.put("411403", "睢阳区"); areaCodeFullTable.put("411421", "民权县"); areaCodeFullTable.put("411422", "睢县"); areaCodeFullTable.put("411423", "宁陵县"); areaCodeFullTable.put("411424", "柘城县"); areaCodeFullTable.put("411425", "虞城县"); areaCodeFullTable.put("411426", "夏邑县"); areaCodeFullTable.put("411481", "永城市"); areaCodeFullTable.put("411500", "信阳市"); areaCodeFullTable.put("411501", "市辖区"); areaCodeFullTable.put("411503", "平桥区"); areaCodeFullTable.put("411521", "罗山县"); areaCodeFullTable.put("411522", "光山县"); areaCodeFullTable.put("411523", "新县"); areaCodeFullTable.put("411524", "商城县"); areaCodeFullTable.put("411525", "固始县"); areaCodeFullTable.put("411526", "潢川县"); areaCodeFullTable.put("411527", "淮滨县"); areaCodeFullTable.put("411528", "息县"); areaCodeFullTable.put("411600", "周口市"); areaCodeFullTable.put("411601", "市辖区"); areaCodeFullTable.put("411602", "川汇区"); areaCodeFullTable.put("411621", "扶沟县"); areaCodeFullTable.put("411622", "西华县"); areaCodeFullTable.put("411623", "商水县"); areaCodeFullTable.put("411624", "沈丘县"); areaCodeFullTable.put("411625", "郸城县"); areaCodeFullTable.put("411626", "淮阳县"); areaCodeFullTable.put("411627", "太康县"); areaCodeFullTable.put("411628", "鹿邑县"); areaCodeFullTable.put("411681", "项城市"); areaCodeFullTable.put("411700", "驻马店市"); areaCodeFullTable.put("411701", "市辖区"); areaCodeFullTable.put("411702", "驿城区"); areaCodeFullTable.put("411721", "西平县"); areaCodeFullTable.put("411722", "上蔡县"); areaCodeFullTable.put("411723", "平舆县"); areaCodeFullTable.put("411724", "正阳县"); areaCodeFullTable.put("411725", "确山县"); areaCodeFullTable.put("411726", "泌阳县"); areaCodeFullTable.put("411727", "汝南县"); areaCodeFullTable.put("411728", "遂平县"); areaCodeFullTable.put("411729", "新蔡县"); areaCodeFullTable.put("420000", "湖北省"); areaCodeFullTable.put("420100", "武汉市"); areaCodeFullTable.put("420101", "市辖区"); areaCodeFullTable.put("420102", "江岸区"); areaCodeFullTable.put("420103", "江汉区"); areaCodeFullTable.put("420105", "汉阳区"); areaCodeFullTable.put("420106", "武昌区"); areaCodeFullTable.put("420107", "青山区"); areaCodeFullTable.put("420111", "洪山区"); areaCodeFullTable.put("420112", "东西湖区"); areaCodeFullTable.put("420113", "汉南区"); areaCodeFullTable.put("420114", "蔡甸区"); areaCodeFullTable.put("420115", "江夏区"); areaCodeFullTable.put("420116", "黄陂区"); areaCodeFullTable.put("420117", "新洲区"); areaCodeFullTable.put("420200", "黄石市"); areaCodeFullTable.put("420201", "市辖区"); areaCodeFullTable.put("420202", "黄石港区"); areaCodeFullTable.put("420203", "西塞山区"); areaCodeFullTable.put("420204", "下陆区"); areaCodeFullTable.put("420205", "铁山区"); areaCodeFullTable.put("420222", "阳新县"); areaCodeFullTable.put("420281", "大冶市"); areaCodeFullTable.put("420300", "十堰市"); areaCodeFullTable.put("420301", "市辖区"); areaCodeFullTable.put("420302", "茅箭区"); areaCodeFullTable.put("420303", "张湾区"); areaCodeFullTable.put("420321", "郧县"); areaCodeFullTable.put("420322", "郧西县"); areaCodeFullTable.put("420323", "竹山县"); areaCodeFullTable.put("420324", "竹溪县"); areaCodeFullTable.put("420325", "房县"); areaCodeFullTable.put("420381", "丹江口市"); areaCodeFullTable.put("420500", "宜昌市"); areaCodeFullTable.put("420501", "市辖区"); areaCodeFullTable.put("420502", "西陵区"); areaCodeFullTable.put("420503", "伍家岗区"); areaCodeFullTable.put("420504", "点军区"); areaCodeFullTable.put("420506", "夷陵区"); areaCodeFullTable.put("420525", "远安县"); areaCodeFullTable.put("420526", "兴山县"); areaCodeFullTable.put("420527", "秭归县"); areaCodeFullTable.put("420528", "长阳土家族自治县"); areaCodeFullTable.put("420529", "五峰土家族自治县"); areaCodeFullTable.put("420581", "宜都市"); areaCodeFullTable.put("420582", "当阳市"); areaCodeFullTable.put("420583", "枝江市"); areaCodeFullTable.put("420600", "襄樊市"); areaCodeFullTable.put("420601", "市辖区"); areaCodeFullTable.put("420602", "襄城区"); areaCodeFullTable.put("420606", "樊城区"); areaCodeFullTable.put("420607", "襄阳区"); areaCodeFullTable.put("420624", "南漳县"); areaCodeFullTable.put("420625", "谷城县"); areaCodeFullTable.put("420626", "保康县"); areaCodeFullTable.put("420682", "老河口市"); areaCodeFullTable.put("420683", "枣阳市"); areaCodeFullTable.put("420684", "宜城市"); areaCodeFullTable.put("420700", "鄂州市"); areaCodeFullTable.put("420701", "市辖区"); areaCodeFullTable.put("420702", "梁子湖区"); areaCodeFullTable.put("420703", "华容区"); areaCodeFullTable.put("420704", "鄂城区"); areaCodeFullTable.put("420800", "荆门市"); areaCodeFullTable.put("420801", "市辖区"); areaCodeFullTable.put("420802", "东宝区"); areaCodeFullTable.put("420804", "掇刀区"); areaCodeFullTable.put("420821", "京山县"); areaCodeFullTable.put("420822", "沙洋县"); areaCodeFullTable.put("420881", "钟祥市"); areaCodeFullTable.put("420900", "孝感市"); areaCodeFullTable.put("420901", "市辖区"); areaCodeFullTable.put("420902", "孝南区"); areaCodeFullTable.put("420921", "孝昌县"); areaCodeFullTable.put("420922", "大悟县"); areaCodeFullTable.put("420923", "云梦县"); areaCodeFullTable.put("420981", "应城市"); areaCodeFullTable.put("420982", "安陆市"); areaCodeFullTable.put("420984", "汉川市"); areaCodeFullTable.put("421000", "荆州市"); areaCodeFullTable.put("421001", "市辖区"); areaCodeFullTable.put("421002", "沙市区"); areaCodeFullTable.put("421003", "荆州区"); areaCodeFullTable.put("421022", "公安县"); areaCodeFullTable.put("421023", "监利县"); areaCodeFullTable.put("421024", "江陵县"); areaCodeFullTable.put("421081", "石首市"); areaCodeFullTable.put("421083", "洪湖市"); areaCodeFullTable.put("421087", "松滋市"); areaCodeFullTable.put("421100", "黄冈市"); areaCodeFullTable.put("421101", "市辖区"); areaCodeFullTable.put("421102", "黄州区"); areaCodeFullTable.put("421121", "团风县"); areaCodeFullTable.put("421122", "红安县"); areaCodeFullTable.put("421123", "罗田县"); areaCodeFullTable.put("421124", "英山县"); areaCodeFullTable.put("421125", "浠水县"); areaCodeFullTable.put("421126", "蕲春县"); areaCodeFullTable.put("421127", "黄梅县"); areaCodeFullTable.put("421181", "麻城市"); areaCodeFullTable.put("421182", "武穴市"); areaCodeFullTable.put("421200", "咸宁市"); areaCodeFullTable.put("421201", "市辖区"); areaCodeFullTable.put("421202", "咸安区"); areaCodeFullTable.put("421221", "嘉鱼县"); areaCodeFullTable.put("421222", "通城县"); areaCodeFullTable.put("421223", "崇阳县"); areaCodeFullTable.put("421224", "通山县"); areaCodeFullTable.put("421281", "赤壁市"); areaCodeFullTable.put("421300", "随州市"); areaCodeFullTable.put("421301", "市辖区"); areaCodeFullTable.put("421302", "曾都区"); areaCodeFullTable.put("421381", "广水市"); areaCodeFullTable.put("422800", "恩施土家族苗族自治"); areaCodeFullTable.put("422801", "恩施市"); areaCodeFullTable.put("422802", "利川市"); areaCodeFullTable.put("422822", "建始县"); areaCodeFullTable.put("422823", "巴东县"); areaCodeFullTable.put("422825", "宣恩县"); areaCodeFullTable.put("422826", "咸丰县"); areaCodeFullTable.put("422827", "来凤县"); areaCodeFullTable.put("422828", "鹤峰县"); areaCodeFullTable.put("429000", "省直辖县级行政单位"); areaCodeFullTable.put("429004", "仙桃市"); areaCodeFullTable.put("429005", "潜江市"); areaCodeFullTable.put("429006", "天门市"); areaCodeFullTable.put("429021", "神农架林区"); areaCodeFullTable.put("430000", "湖南省"); areaCodeFullTable.put("430100", "长沙市"); areaCodeFullTable.put("430101", "市辖区"); areaCodeFullTable.put("430102", "芙蓉区"); areaCodeFullTable.put("430103", "天心区"); areaCodeFullTable.put("430104", "岳麓区"); areaCodeFullTable.put("430105", "开福区"); areaCodeFullTable.put("430111", "雨花区"); areaCodeFullTable.put("430121", "长沙县"); areaCodeFullTable.put("430122", "望城县"); areaCodeFullTable.put("430124", "宁乡县"); areaCodeFullTable.put("430181", "浏阳市"); areaCodeFullTable.put("430200", "株洲市"); areaCodeFullTable.put("430201", "市辖区"); areaCodeFullTable.put("430202", "荷塘区"); areaCodeFullTable.put("430203", "芦淞区"); areaCodeFullTable.put("430204", "石峰区"); areaCodeFullTable.put("430211", "天元区"); areaCodeFullTable.put("430221", "株洲县"); areaCodeFullTable.put("430223", "攸县"); areaCodeFullTable.put("430224", "茶陵县"); areaCodeFullTable.put("430225", "炎陵县"); areaCodeFullTable.put("430281", "醴陵市"); areaCodeFullTable.put("430300", "湘潭市"); areaCodeFullTable.put("430301", "市辖区"); areaCodeFullTable.put("430302", "雨湖区"); areaCodeFullTable.put("430304", "岳塘区"); areaCodeFullTable.put("430321", "湘潭县"); areaCodeFullTable.put("430381", "湘乡市"); areaCodeFullTable.put("430382", "韶山市"); areaCodeFullTable.put("430400", "衡阳市"); areaCodeFullTable.put("430401", "市辖区"); areaCodeFullTable.put("430405", "珠晖区"); areaCodeFullTable.put("430406", "雁峰区"); areaCodeFullTable.put("430407", "石鼓区"); areaCodeFullTable.put("430408", "蒸湘区"); areaCodeFullTable.put("430412", "南岳区"); areaCodeFullTable.put("430421", "衡阳县"); areaCodeFullTable.put("430422", "衡南县"); areaCodeFullTable.put("430423", "衡山县"); areaCodeFullTable.put("430424", "衡东县"); areaCodeFullTable.put("430426", "祁东县"); areaCodeFullTable.put("430481", "耒阳市"); areaCodeFullTable.put("430482", "常宁市"); areaCodeFullTable.put("430500", "邵阳市"); areaCodeFullTable.put("430501", "市辖区"); areaCodeFullTable.put("430502", "双清区"); areaCodeFullTable.put("430503", "大祥区"); areaCodeFullTable.put("430511", "北塔区"); areaCodeFullTable.put("430521", "邵东县"); areaCodeFullTable.put("430522", "新邵县"); areaCodeFullTable.put("430523", "邵阳县"); areaCodeFullTable.put("430524", "隆回县"); areaCodeFullTable.put("430525", "洞口县"); areaCodeFullTable.put("430527", "绥宁县"); areaCodeFullTable.put("430528", "新宁县"); areaCodeFullTable.put("430529", "城步苗族自治县"); areaCodeFullTable.put("430581", "武冈市"); areaCodeFullTable.put("430600", "岳阳市"); areaCodeFullTable.put("430601", "市辖区"); areaCodeFullTable.put("430602", "岳阳楼区"); areaCodeFullTable.put("430603", "云溪区"); areaCodeFullTable.put("430611", "君山区"); areaCodeFullTable.put("430621", "岳阳县"); areaCodeFullTable.put("430623", "华容县"); areaCodeFullTable.put("430624", "湘阴县"); areaCodeFullTable.put("430626", "平江县"); areaCodeFullTable.put("430681", "汨罗市"); areaCodeFullTable.put("430682", "临湘市"); areaCodeFullTable.put("430700", "常德市"); areaCodeFullTable.put("430701", "市辖区"); areaCodeFullTable.put("430702", "武陵区"); areaCodeFullTable.put("430703", "鼎城区"); areaCodeFullTable.put("430721", "安乡县"); areaCodeFullTable.put("430722", "汉寿县"); areaCodeFullTable.put("430723", "澧县"); areaCodeFullTable.put("430724", "临澧县"); areaCodeFullTable.put("430725", "桃源县"); areaCodeFullTable.put("430726", "石门县"); areaCodeFullTable.put("430781", "津市市"); areaCodeFullTable.put("430800", "张家界市"); areaCodeFullTable.put("430801", "市辖区"); areaCodeFullTable.put("430802", "永定区"); areaCodeFullTable.put("430811", "武陵源区"); areaCodeFullTable.put("430821", "慈利县"); areaCodeFullTable.put("430822", "桑植县"); areaCodeFullTable.put("430900", "益阳市"); areaCodeFullTable.put("430901", "市辖区"); areaCodeFullTable.put("430902", "资阳区"); areaCodeFullTable.put("430903", "赫山区"); areaCodeFullTable.put("430921", "南县"); areaCodeFullTable.put("430922", "桃江县"); areaCodeFullTable.put("430923", "安化县"); areaCodeFullTable.put("430981", "沅江市"); areaCodeFullTable.put("431000", "郴州市"); areaCodeFullTable.put("431001", "市辖区"); areaCodeFullTable.put("431002", "北湖区"); areaCodeFullTable.put("431003", "苏仙区"); areaCodeFullTable.put("431021", "桂阳县"); areaCodeFullTable.put("431022", "宜章县"); areaCodeFullTable.put("431023", "永兴县"); areaCodeFullTable.put("431024", "嘉禾县"); areaCodeFullTable.put("431025", "临武县"); areaCodeFullTable.put("431026", "汝城县"); areaCodeFullTable.put("431027", "桂东县"); areaCodeFullTable.put("431028", "安仁县"); areaCodeFullTable.put("431081", "资兴市"); areaCodeFullTable.put("431100", "永州市"); areaCodeFullTable.put("431101", "市辖区"); areaCodeFullTable.put("431102", "芝山区"); areaCodeFullTable.put("431103", "冷水滩区"); areaCodeFullTable.put("431121", "祁阳县"); areaCodeFullTable.put("431122", "东安县"); areaCodeFullTable.put("431123", "双牌县"); areaCodeFullTable.put("431124", "道县"); areaCodeFullTable.put("431125", "江永县"); areaCodeFullTable.put("431126", "宁远县"); areaCodeFullTable.put("431127", "蓝山县"); areaCodeFullTable.put("431128", "新田县"); areaCodeFullTable.put("431129", "江华瑶族自治县"); areaCodeFullTable.put("431200", "怀化市"); areaCodeFullTable.put("431201", "市辖区"); areaCodeFullTable.put("431202", "鹤城区"); areaCodeFullTable.put("431221", "中方县"); areaCodeFullTable.put("431222", "沅陵县"); areaCodeFullTable.put("431223", "辰溪县"); areaCodeFullTable.put("431224", "溆浦县"); areaCodeFullTable.put("431225", "会同县"); areaCodeFullTable.put("431226", "麻阳苗族自治县"); areaCodeFullTable.put("431227", "新晃侗族自治县"); areaCodeFullTable.put("431228", "芷江侗族自治县"); areaCodeFullTable.put("431229", "靖州苗族侗族自治"); areaCodeFullTable.put("431230", "通道侗族自治县"); areaCodeFullTable.put("431281", "洪江市"); areaCodeFullTable.put("431300", "娄底市"); areaCodeFullTable.put("431301", "市辖区"); areaCodeFullTable.put("431302", "娄星区"); areaCodeFullTable.put("431321", "双峰县"); areaCodeFullTable.put("431322", "新化县"); areaCodeFullTable.put("431381", "冷水江市"); areaCodeFullTable.put("431382", "涟源市"); areaCodeFullTable.put("433100", "湘西土家族苗族自治"); areaCodeFullTable.put("433101", "吉首市"); areaCodeFullTable.put("433122", "泸溪县"); areaCodeFullTable.put("433123", "凤凰县"); areaCodeFullTable.put("433124", "花垣县"); areaCodeFullTable.put("433125", "保靖县"); areaCodeFullTable.put("433126", "古丈县"); areaCodeFullTable.put("433127", "永顺县"); areaCodeFullTable.put("433130", "龙山县"); areaCodeFullTable.put("440000", "广东省"); areaCodeFullTable.put("440100", "广州市"); areaCodeFullTable.put("440101", "市辖区"); areaCodeFullTable.put("440102", "东山区"); areaCodeFullTable.put("440103", "荔湾区"); areaCodeFullTable.put("440104", "越秀区"); areaCodeFullTable.put("440105", "海珠区"); areaCodeFullTable.put("440106", "天河区"); areaCodeFullTable.put("440107", "芳村区"); areaCodeFullTable.put("440111", "白云区"); areaCodeFullTable.put("440112", "黄埔区"); areaCodeFullTable.put("440113", "番禺区"); areaCodeFullTable.put("440114", "花都区"); areaCodeFullTable.put("440183", "增城市"); areaCodeFullTable.put("440184", "从化市"); areaCodeFullTable.put("440200", "韶关市"); areaCodeFullTable.put("440201", "市辖区"); areaCodeFullTable.put("440202", "北江区"); areaCodeFullTable.put("440203", "武江区"); areaCodeFullTable.put("440204", "浈江区"); areaCodeFullTable.put("440221", "曲江县"); areaCodeFullTable.put("440222", "始兴县"); areaCodeFullTable.put("440224", "仁化县"); areaCodeFullTable.put("440229", "翁源县"); areaCodeFullTable.put("440232", "乳源瑶族自治县"); areaCodeFullTable.put("440233", "新丰县"); areaCodeFullTable.put("440281", "乐昌市"); areaCodeFullTable.put("440282", "南雄市"); areaCodeFullTable.put("440300", "深圳市"); areaCodeFullTable.put("440301", "市辖区"); areaCodeFullTable.put("440303", "罗湖区"); areaCodeFullTable.put("440304", "福田区"); areaCodeFullTable.put("440305", "南山区"); areaCodeFullTable.put("440306", "宝安区"); areaCodeFullTable.put("440307", "龙岗区"); areaCodeFullTable.put("440308", "盐田区"); areaCodeFullTable.put("440400", "珠海市"); areaCodeFullTable.put("440401", "市辖区"); areaCodeFullTable.put("440402", "香洲区"); areaCodeFullTable.put("440403", "斗门区"); areaCodeFullTable.put("440404", "金湾区"); areaCodeFullTable.put("440500", "汕头市"); areaCodeFullTable.put("440501", "市辖区"); areaCodeFullTable.put("440506", "达濠区"); areaCodeFullTable.put("440507", "龙湖区"); areaCodeFullTable.put("440508", "金园区"); areaCodeFullTable.put("440509", "升平区"); areaCodeFullTable.put("440510", "河浦区"); areaCodeFullTable.put("440523", "南澳县"); areaCodeFullTable.put("440582", "潮阳市"); areaCodeFullTable.put("440583", "澄海市"); areaCodeFullTable.put("440600", "佛山市"); areaCodeFullTable.put("440601", "市辖区"); areaCodeFullTable.put("440602", "城区"); areaCodeFullTable.put("440603", "石湾区"); areaCodeFullTable.put("440681", "顺德市"); areaCodeFullTable.put("440682", "南海市"); areaCodeFullTable.put("440683", "三水市"); areaCodeFullTable.put("440684", "高明市"); areaCodeFullTable.put("440700", "江门市"); areaCodeFullTable.put("440701", "市辖区"); areaCodeFullTable.put("440703", "蓬江区"); areaCodeFullTable.put("440704", "江海区"); areaCodeFullTable.put("440781", "台山市"); areaCodeFullTable.put("440782", "新会市"); areaCodeFullTable.put("440783", "开平市"); areaCodeFullTable.put("440784", "鹤山市"); areaCodeFullTable.put("440785", "恩平市"); areaCodeFullTable.put("440800", "湛江市"); areaCodeFullTable.put("440801", "市辖区"); areaCodeFullTable.put("440802", "赤坎区"); areaCodeFullTable.put("440803", "霞山区"); areaCodeFullTable.put("440804", "坡头区"); areaCodeFullTable.put("440811", "麻章区"); areaCodeFullTable.put("440823", "遂溪县"); areaCodeFullTable.put("440825", "徐闻县"); areaCodeFullTable.put("440881", "廉江市"); areaCodeFullTable.put("440882", "雷州市"); areaCodeFullTable.put("440883", "吴川市"); areaCodeFullTable.put("440900", "茂名市"); areaCodeFullTable.put("440901", "市辖区"); areaCodeFullTable.put("440902", "茂南区"); areaCodeFullTable.put("440903", "茂港区"); areaCodeFullTable.put("440923", "电白县"); areaCodeFullTable.put("440981", "高州市"); areaCodeFullTable.put("440982", "化州市"); areaCodeFullTable.put("440983", "信宜市"); areaCodeFullTable.put("441200", "肇庆市"); areaCodeFullTable.put("441201", "市辖区"); areaCodeFullTable.put("441202", "端州区"); areaCodeFullTable.put("441203", "鼎湖区"); areaCodeFullTable.put("441223", "广宁县"); areaCodeFullTable.put("441224", "怀集县"); areaCodeFullTable.put("441225", "封开县"); areaCodeFullTable.put("441226", "德庆县"); areaCodeFullTable.put("441283", "高要市"); areaCodeFullTable.put("441284", "四会市"); areaCodeFullTable.put("441300", "惠州市"); areaCodeFullTable.put("441301", "市辖区"); areaCodeFullTable.put("441302", "惠城区"); areaCodeFullTable.put("441322", "博罗县"); areaCodeFullTable.put("441323", "惠东县"); areaCodeFullTable.put("441324", "龙门县"); areaCodeFullTable.put("441381", "惠阳市"); areaCodeFullTable.put("441400", "梅州市"); areaCodeFullTable.put("441401", "市辖区"); areaCodeFullTable.put("441402", "梅江区"); areaCodeFullTable.put("441421", "梅县"); areaCodeFullTable.put("441422", "大埔县"); areaCodeFullTable.put("441423", "丰顺县"); areaCodeFullTable.put("441424", "五华县"); areaCodeFullTable.put("441426", "平远县"); areaCodeFullTable.put("441427", "蕉岭县"); areaCodeFullTable.put("441481", "兴宁市"); areaCodeFullTable.put("441500", "汕尾市"); areaCodeFullTable.put("441501", "市辖区"); areaCodeFullTable.put("441502", "城区"); areaCodeFullTable.put("441521", "海丰县"); areaCodeFullTable.put("441523", "陆河县"); areaCodeFullTable.put("441581", "陆丰市"); areaCodeFullTable.put("441600", "河源市"); areaCodeFullTable.put("441601", "市辖区"); areaCodeFullTable.put("441602", "源城区"); areaCodeFullTable.put("441621", "紫金县"); areaCodeFullTable.put("441622", "龙川县"); areaCodeFullTable.put("441623", "连平县"); areaCodeFullTable.put("441624", "和平县"); areaCodeFullTable.put("441625", "东源县"); areaCodeFullTable.put("441700", "阳江市"); areaCodeFullTable.put("441701", "市辖区"); areaCodeFullTable.put("441702", "江城区"); areaCodeFullTable.put("441721", "阳西县"); areaCodeFullTable.put("441723", "阳东县"); areaCodeFullTable.put("441781", "阳春市"); areaCodeFullTable.put("441800", "清远市"); areaCodeFullTable.put("441801", "市辖区"); areaCodeFullTable.put("441802", "清城区"); areaCodeFullTable.put("441821", "佛冈县"); areaCodeFullTable.put("441823", "阳山县"); areaCodeFullTable.put("441825", "连山壮族瑶族自治"); areaCodeFullTable.put("441826", "连南瑶族自治县"); areaCodeFullTable.put("441827", "清新县"); areaCodeFullTable.put("441881", "英德市"); areaCodeFullTable.put("441882", "连州市"); areaCodeFullTable.put("441900", "东莞市"); areaCodeFullTable.put("442000", "中山市"); areaCodeFullTable.put("445100", "潮州市"); areaCodeFullTable.put("445101", "市辖区"); areaCodeFullTable.put("445102", "湘桥区"); areaCodeFullTable.put("445121", "潮安县"); areaCodeFullTable.put("445122", "饶平县"); areaCodeFullTable.put("445200", "揭阳市"); areaCodeFullTable.put("445201", "市辖区"); areaCodeFullTable.put("445202", "榕城区"); areaCodeFullTable.put("445221", "揭东县"); areaCodeFullTable.put("445222", "揭西县"); areaCodeFullTable.put("445224", "惠来县"); areaCodeFullTable.put("445281", "普宁市"); areaCodeFullTable.put("445300", "云浮市"); areaCodeFullTable.put("445301", "市辖区"); areaCodeFullTable.put("445302", "云城区"); areaCodeFullTable.put("445321", "新兴县"); areaCodeFullTable.put("445322", "郁南县"); areaCodeFullTable.put("445323", "云安县"); areaCodeFullTable.put("445381", "罗定市"); areaCodeFullTable.put("450000", "广西壮族自治区"); areaCodeFullTable.put("450100", "南宁市"); areaCodeFullTable.put("450101", "市辖区"); areaCodeFullTable.put("450102", "兴宁区"); areaCodeFullTable.put("450103", "新城区"); areaCodeFullTable.put("450104", "城北区"); areaCodeFullTable.put("450105", "江南区"); areaCodeFullTable.put("450106", "永新区"); areaCodeFullTable.put("450121", "邕宁县"); areaCodeFullTable.put("450122", "武鸣县"); areaCodeFullTable.put("450200", "柳州市"); areaCodeFullTable.put("450201", "市辖区"); areaCodeFullTable.put("450202", "城中区"); areaCodeFullTable.put("450203", "鱼峰区"); areaCodeFullTable.put("450204", "柳南区"); areaCodeFullTable.put("450205", "柳北区"); areaCodeFullTable.put("450211", "市郊区"); areaCodeFullTable.put("450221", "柳江县"); areaCodeFullTable.put("450222", "柳城县"); areaCodeFullTable.put("450300", "桂林市"); areaCodeFullTable.put("450301", "市辖区"); areaCodeFullTable.put("450302", "秀峰区"); areaCodeFullTable.put("450303", "叠彩区"); areaCodeFullTable.put("450304", "象山区"); areaCodeFullTable.put("450305", "七星区"); areaCodeFullTable.put("450311", "雁山区"); areaCodeFullTable.put("450321", "阳朔县"); areaCodeFullTable.put("450322", "临桂县"); areaCodeFullTable.put("450323", "灵川县"); areaCodeFullTable.put("450324", "全州县"); areaCodeFullTable.put("450325", "兴安县"); areaCodeFullTable.put("450326", "永福县"); areaCodeFullTable.put("450327", "灌阳县"); areaCodeFullTable.put("450328", "龙胜各族自治县"); areaCodeFullTable.put("450329", "资源县"); areaCodeFullTable.put("450330", "平乐县"); areaCodeFullTable.put("450331", "荔浦县"); areaCodeFullTable.put("450332", "恭城瑶族自治县"); areaCodeFullTable.put("450400", "梧州市"); areaCodeFullTable.put("450401", "市辖区"); areaCodeFullTable.put("450403", "万秀区"); areaCodeFullTable.put("450404", "蝶山区"); areaCodeFullTable.put("450411", "市郊区"); areaCodeFullTable.put("450421", "苍梧县"); areaCodeFullTable.put("450422", "藤县"); areaCodeFullTable.put("450423", "蒙山县"); areaCodeFullTable.put("450481", "岑溪市"); areaCodeFullTable.put("450500", "北海市"); areaCodeFullTable.put("450501", "市辖区"); areaCodeFullTable.put("450502", "海城区"); areaCodeFullTable.put("450503", "银海区"); areaCodeFullTable.put("450512", "铁山港区"); areaCodeFullTable.put("450521", "合浦县"); areaCodeFullTable.put("450600", "防城港市"); areaCodeFullTable.put("450601", "市辖区"); areaCodeFullTable.put("450602", "港口区"); areaCodeFullTable.put("450603", "防城区"); areaCodeFullTable.put("450621", "上思县"); areaCodeFullTable.put("450681", "东兴市"); areaCodeFullTable.put("450700", "钦州市"); areaCodeFullTable.put("450701", "市辖区"); areaCodeFullTable.put("450702", "钦南区"); areaCodeFullTable.put("450703", "钦北区"); areaCodeFullTable.put("450721", "灵山县"); areaCodeFullTable.put("450722", "浦北县"); areaCodeFullTable.put("450800", "贵港市"); areaCodeFullTable.put("450801", "市辖区"); areaCodeFullTable.put("450802", "港北区"); areaCodeFullTable.put("450803", "港南区"); areaCodeFullTable.put("450821", "平南县"); areaCodeFullTable.put("450881", "桂平市"); areaCodeFullTable.put("450900", "玉林市"); areaCodeFullTable.put("450901", "市辖区"); areaCodeFullTable.put("450902", "玉州区"); areaCodeFullTable.put("450921", "容县"); areaCodeFullTable.put("450922", "陆川县"); areaCodeFullTable.put("450923", "博白县"); areaCodeFullTable.put("450924", "兴业县"); areaCodeFullTable.put("450981", "北流市"); areaCodeFullTable.put("452100", "南宁地区"); areaCodeFullTable.put("452101", "凭祥市"); areaCodeFullTable.put("452122", "横县"); areaCodeFullTable.put("452123", "宾阳县"); areaCodeFullTable.put("452124", "上林县"); areaCodeFullTable.put("452126", "隆安县"); areaCodeFullTable.put("452127", "马山县"); areaCodeFullTable.put("452128", "扶绥县"); areaCodeFullTable.put("452129", "崇左县"); areaCodeFullTable.put("452130", "大新县"); areaCodeFullTable.put("452131", "天等县"); areaCodeFullTable.put("452132", "宁明县"); areaCodeFullTable.put("452133", "龙州县"); areaCodeFullTable.put("452200", "柳州地区"); areaCodeFullTable.put("452201", "合山市"); areaCodeFullTable.put("452223", "鹿寨县"); areaCodeFullTable.put("452224", "象州县"); areaCodeFullTable.put("452225", "武宣县"); areaCodeFullTable.put("452226", "来宾县"); areaCodeFullTable.put("452227", "融安县"); areaCodeFullTable.put("452228", "三江侗族自治县"); areaCodeFullTable.put("452229", "融水苗族自治县"); areaCodeFullTable.put("452230", "金秀瑶族自治县"); areaCodeFullTable.put("452231", "忻城县"); areaCodeFullTable.put("452400", "贺州地区"); areaCodeFullTable.put("452402", "贺州市"); areaCodeFullTable.put("452424", "昭平县"); areaCodeFullTable.put("452427", "钟山县"); areaCodeFullTable.put("452428", "富川瑶族自治县"); areaCodeFullTable.put("452600", "百色地区"); areaCodeFullTable.put("452601", "百色市"); areaCodeFullTable.put("452622", "田阳县"); areaCodeFullTable.put("452623", "田东县"); areaCodeFullTable.put("452624", "平果县"); areaCodeFullTable.put("452625", "德保县"); areaCodeFullTable.put("452626", "靖西县"); areaCodeFullTable.put("452627", "那坡县"); areaCodeFullTable.put("452628", "凌云县"); areaCodeFullTable.put("452629", "乐业县"); areaCodeFullTable.put("452630", "田林县"); areaCodeFullTable.put("452631", "隆林各族自治县"); areaCodeFullTable.put("452632", "西林县"); areaCodeFullTable.put("452700", "河池地区"); areaCodeFullTable.put("452701", "河池市"); areaCodeFullTable.put("452702", "宜州市"); areaCodeFullTable.put("452723", "罗城仫佬族自治县"); areaCodeFullTable.put("452724", "环江毛南族自治县"); areaCodeFullTable.put("452725", "南丹县"); areaCodeFullTable.put("452726", "天峨县"); areaCodeFullTable.put("452727", "凤山县"); areaCodeFullTable.put("452728", "东兰县"); areaCodeFullTable.put("452729", "巴马瑶族自治县"); areaCodeFullTable.put("452730", "都安瑶族自治县"); areaCodeFullTable.put("452731", "大化瑶族自治县"); areaCodeFullTable.put("460000", "海南省"); areaCodeFullTable.put("460100", "海口市"); areaCodeFullTable.put("460101", "市辖区"); areaCodeFullTable.put("460102", "振东区"); areaCodeFullTable.put("460103", "新华区"); areaCodeFullTable.put("460104", "秀英区"); areaCodeFullTable.put("460200", "三亚市"); areaCodeFullTable.put("460201", "市辖区"); areaCodeFullTable.put("469000", "省直辖县级行政单位"); areaCodeFullTable.put("469001", "五指山市"); areaCodeFullTable.put("469002", "琼海市"); areaCodeFullTable.put("469003", "儋州市"); areaCodeFullTable.put("469004", "琼山市"); areaCodeFullTable.put("469005", "文昌市"); areaCodeFullTable.put("469006", "万宁市"); areaCodeFullTable.put("469007", "东方市"); areaCodeFullTable.put("469021", "定安县"); areaCodeFullTable.put("469022", "屯昌县"); areaCodeFullTable.put("469023", "澄迈县"); areaCodeFullTable.put("469024", "临高县"); areaCodeFullTable.put("469025", "白沙黎族自治县"); areaCodeFullTable.put("469026", "昌江黎族自治县"); areaCodeFullTable.put("469027", "乐东黎族自治县"); areaCodeFullTable.put("469028", "陵水黎族自治县"); areaCodeFullTable.put("469029", "保亭黎族苗族自治"); areaCodeFullTable.put("469030", "琼中黎族苗族自治"); areaCodeFullTable.put("469031", "西沙群岛"); areaCodeFullTable.put("469032", "南沙群岛"); areaCodeFullTable.put("469033", "中沙群岛的岛礁及"); areaCodeFullTable.put("500000", "重庆市"); areaCodeFullTable.put("500100", "市辖区"); areaCodeFullTable.put("500101", "万州区"); areaCodeFullTable.put("500102", "涪陵区"); areaCodeFullTable.put("500103", "渝中区"); areaCodeFullTable.put("500104", "大渡口区"); areaCodeFullTable.put("500105", "江北区"); areaCodeFullTable.put("500106", "沙坪坝区"); areaCodeFullTable.put("500107", "九龙坡区"); areaCodeFullTable.put("500108", "南岸区"); areaCodeFullTable.put("500109", "北碚区"); areaCodeFullTable.put("500110", "万盛区"); areaCodeFullTable.put("500111", "双桥区"); areaCodeFullTable.put("500112", "渝北区"); areaCodeFullTable.put("500113", "巴南区"); areaCodeFullTable.put("500114", "黔江区"); areaCodeFullTable.put("500115", "长寿区"); areaCodeFullTable.put("500200", "县"); areaCodeFullTable.put("500222", "綦江县"); areaCodeFullTable.put("500223", "潼南县"); areaCodeFullTable.put("500224", "铜梁县"); areaCodeFullTable.put("500225", "大足县"); areaCodeFullTable.put("500226", "荣昌县"); areaCodeFullTable.put("500227", "璧山县"); areaCodeFullTable.put("500228", "梁平县"); areaCodeFullTable.put("500229", "城口县"); areaCodeFullTable.put("500230", "丰都县"); areaCodeFullTable.put("500231", "垫江县"); areaCodeFullTable.put("500232", "武隆县"); areaCodeFullTable.put("500233", "忠县"); areaCodeFullTable.put("500234", "开县"); areaCodeFullTable.put("500235", "云阳县"); areaCodeFullTable.put("500236", "奉节县"); areaCodeFullTable.put("500237", "巫山县"); areaCodeFullTable.put("500238", "巫溪县"); areaCodeFullTable.put("500240", "石柱土家族自治"); areaCodeFullTable.put("500241", "秀山土家族苗族"); areaCodeFullTable.put("500242", "酉阳土家族苗族"); areaCodeFullTable.put("500243", "彭水苗族土家族"); areaCodeFullTable.put("500300", "市"); areaCodeFullTable.put("500381", "江津市"); areaCodeFullTable.put("500382", "合川市"); areaCodeFullTable.put("500383", "永川市"); areaCodeFullTable.put("500384", "南川市"); areaCodeFullTable.put("510000", "四川省"); areaCodeFullTable.put("510100", "成都市"); areaCodeFullTable.put("510101", "市辖区"); areaCodeFullTable.put("510104", "锦江区"); areaCodeFullTable.put("510105", "青羊区"); areaCodeFullTable.put("510106", "金牛区"); areaCodeFullTable.put("510107", "武侯区"); areaCodeFullTable.put("510108", "成华区"); areaCodeFullTable.put("510112", "龙泉驿区"); areaCodeFullTable.put("510113", "青白江区"); areaCodeFullTable.put("510114", "新都区"); areaCodeFullTable.put("510121", "金堂县"); areaCodeFullTable.put("510122", "双流县"); areaCodeFullTable.put("510123", "温江县"); areaCodeFullTable.put("510124", "郫县"); areaCodeFullTable.put("510129", "大邑县"); areaCodeFullTable.put("510131", "蒲江县"); areaCodeFullTable.put("510132", "新津县"); areaCodeFullTable.put("510181", "都江堰市"); areaCodeFullTable.put("510182", "彭州市"); areaCodeFullTable.put("510183", "邛崃市"); areaCodeFullTable.put("510184", "崇州市"); areaCodeFullTable.put("510300", "自贡市"); areaCodeFullTable.put("510301", "市辖区"); areaCodeFullTable.put("510302", "自流井区"); areaCodeFullTable.put("510303", "贡井区"); areaCodeFullTable.put("510304", "大安区"); areaCodeFullTable.put("510311", "沿滩区"); areaCodeFullTable.put("510321", "荣县"); areaCodeFullTable.put("510322", "富顺县"); areaCodeFullTable.put("510400", "攀枝花市"); areaCodeFullTable.put("510401", "市辖区"); areaCodeFullTable.put("510402", "东区"); areaCodeFullTable.put("510403", "西区"); areaCodeFullTable.put("510411", "仁和区"); areaCodeFullTable.put("510421", "米易县"); areaCodeFullTable.put("510422", "盐边县"); areaCodeFullTable.put("510500", "泸州市"); areaCodeFullTable.put("510501", "市辖区"); areaCodeFullTable.put("510502", "江阳区"); areaCodeFullTable.put("510503", "纳溪区"); areaCodeFullTable.put("510504", "龙马潭区"); areaCodeFullTable.put("510521", "泸县"); areaCodeFullTable.put("510522", "合江县"); areaCodeFullTable.put("510524", "叙永县"); areaCodeFullTable.put("510525", "古蔺县"); areaCodeFullTable.put("510600", "德阳市"); areaCodeFullTable.put("510601", "市辖区"); areaCodeFullTable.put("510603", "旌阳区"); areaCodeFullTable.put("510623", "中江县"); areaCodeFullTable.put("510626", "罗江县"); areaCodeFullTable.put("510681", "广汉市"); areaCodeFullTable.put("510682", "什邡市"); areaCodeFullTable.put("510683", "绵竹市"); areaCodeFullTable.put("510700", "绵阳市"); areaCodeFullTable.put("510701", "市辖区"); areaCodeFullTable.put("510703", "涪城区"); areaCodeFullTable.put("510704", "游仙区"); areaCodeFullTable.put("510722", "三台县"); areaCodeFullTable.put("510723", "盐亭县"); areaCodeFullTable.put("510724", "安县"); areaCodeFullTable.put("510725", "梓潼县"); areaCodeFullTable.put("510726", "北川县"); areaCodeFullTable.put("510727", "平武县"); areaCodeFullTable.put("510781", "江油市"); areaCodeFullTable.put("510800", "广元市"); areaCodeFullTable.put("510801", "市辖区"); areaCodeFullTable.put("510802", "市中区"); areaCodeFullTable.put("510811", "元坝区"); areaCodeFullTable.put("510812", "朝天区"); areaCodeFullTable.put("510821", "旺苍县"); areaCodeFullTable.put("510822", "青川县"); areaCodeFullTable.put("510823", "剑阁县"); areaCodeFullTable.put("510824", "苍溪县"); areaCodeFullTable.put("510900", "遂宁市"); areaCodeFullTable.put("510901", "市辖区"); areaCodeFullTable.put("510902", "市中区"); areaCodeFullTable.put("510921", "蓬溪县"); areaCodeFullTable.put("510922", "射洪县"); areaCodeFullTable.put("510923", "大英县"); areaCodeFullTable.put("511000", "内江市"); areaCodeFullTable.put("511001", "市辖区"); areaCodeFullTable.put("511002", "市中区"); areaCodeFullTable.put("511011", "东兴区"); areaCodeFullTable.put("511024", "威远县"); areaCodeFullTable.put("511025", "资中县"); areaCodeFullTable.put("511028", "隆昌县"); areaCodeFullTable.put("511100", "乐山市"); areaCodeFullTable.put("511101", "市辖区"); areaCodeFullTable.put("511102", "市中区"); areaCodeFullTable.put("511111", "沙湾区"); areaCodeFullTable.put("511112", "五通桥区"); areaCodeFullTable.put("511113", "金口河区"); areaCodeFullTable.put("511123", "犍为县"); areaCodeFullTable.put("511124", "井研县"); areaCodeFullTable.put("511126", "夹江县"); areaCodeFullTable.put("511129", "沐川县"); areaCodeFullTable.put("511132", "峨边彝族自治县"); areaCodeFullTable.put("511133", "马边彝族自治县"); areaCodeFullTable.put("511181", "峨眉山市"); areaCodeFullTable.put("511300", "南充市"); areaCodeFullTable.put("511301", "市辖区"); areaCodeFullTable.put("511302", "顺庆区"); areaCodeFullTable.put("511303", "高坪区"); areaCodeFullTable.put("511304", "嘉陵区"); areaCodeFullTable.put("511321", "南部县"); areaCodeFullTable.put("511322", "营山县"); areaCodeFullTable.put("511323", "蓬安县"); areaCodeFullTable.put("511324", "仪陇县"); areaCodeFullTable.put("511325", "西充县"); areaCodeFullTable.put("511381", "阆中市"); areaCodeFullTable.put("511400", "眉山市"); areaCodeFullTable.put("511401", "市辖区"); areaCodeFullTable.put("511402", "东坡区"); areaCodeFullTable.put("511421", "仁寿县"); areaCodeFullTable.put("511422", "彭山县"); areaCodeFullTable.put("511423", "洪雅县"); areaCodeFullTable.put("511424", "丹棱县"); areaCodeFullTable.put("511425", "青神县"); areaCodeFullTable.put("511500", "宜宾市"); areaCodeFullTable.put("511501", "市辖区"); areaCodeFullTable.put("511502", "翠屏区"); areaCodeFullTable.put("511521", "宜宾县"); areaCodeFullTable.put("511522", "南溪县"); areaCodeFullTable.put("511523", "江安县"); areaCodeFullTable.put("511524", "长宁县"); areaCodeFullTable.put("511525", "高县"); areaCodeFullTable.put("511526", "珙县"); areaCodeFullTable.put("511527", "筠连县"); areaCodeFullTable.put("511528", "兴文县"); areaCodeFullTable.put("511529", "屏山县"); areaCodeFullTable.put("511600", "广安市"); areaCodeFullTable.put("511601", "市辖区"); areaCodeFullTable.put("511602", "广安区"); areaCodeFullTable.put("511621", "岳池县"); areaCodeFullTable.put("511622", "武胜县"); areaCodeFullTable.put("511623", "邻水县"); areaCodeFullTable.put("511681", "华蓥市"); areaCodeFullTable.put("511700", "达州市"); areaCodeFullTable.put("511701", "市辖区"); areaCodeFullTable.put("511702", "通川区"); areaCodeFullTable.put("511721", "达县"); areaCodeFullTable.put("511722", "宣汉县"); areaCodeFullTable.put("511723", "开江县"); areaCodeFullTable.put("511724", "大竹县"); areaCodeFullTable.put("511725", "渠县"); areaCodeFullTable.put("511781", "万源市"); areaCodeFullTable.put("511800", "雅安市"); areaCodeFullTable.put("511801", "市辖区"); areaCodeFullTable.put("511802", "雨城区"); areaCodeFullTable.put("511821", "名山县"); areaCodeFullTable.put("511822", "荥经县"); areaCodeFullTable.put("511823", "汉源县"); areaCodeFullTable.put("511824", "石棉县"); areaCodeFullTable.put("511825", "天全县"); areaCodeFullTable.put("511826", "芦山县"); areaCodeFullTable.put("511827", "宝兴县"); areaCodeFullTable.put("511900", "巴中市"); areaCodeFullTable.put("511901", "市辖区"); areaCodeFullTable.put("511902", "巴州区"); areaCodeFullTable.put("511921", "通江县"); areaCodeFullTable.put("511922", "南江县"); areaCodeFullTable.put("511923", "平昌县"); areaCodeFullTable.put("512000", "资阳市"); areaCodeFullTable.put("512001", "市辖区"); areaCodeFullTable.put("512002", "雁江区"); areaCodeFullTable.put("512021", "安岳县"); areaCodeFullTable.put("512022", "乐至县"); areaCodeFullTable.put("512081", "简阳市"); areaCodeFullTable.put("513200", "阿坝藏族羌族自治州"); areaCodeFullTable.put("513221", "汶川县"); areaCodeFullTable.put("513222", "理县"); areaCodeFullTable.put("513223", "茂县"); areaCodeFullTable.put("513224", "松潘县"); areaCodeFullTable.put("513225", "九寨沟县"); areaCodeFullTable.put("513226", "金川县"); areaCodeFullTable.put("513227", "小金县"); areaCodeFullTable.put("513228", "黑水县"); areaCodeFullTable.put("513229", "马尔康县"); areaCodeFullTable.put("513230", "壤塘县"); areaCodeFullTable.put("513231", "阿坝县"); areaCodeFullTable.put("513232", "若尔盖县"); areaCodeFullTable.put("513233", "红原县"); areaCodeFullTable.put("513300", "甘孜藏族自治州"); areaCodeFullTable.put("513321", "康定县"); areaCodeFullTable.put("513322", "泸定县"); areaCodeFullTable.put("513323", "丹巴县"); areaCodeFullTable.put("513324", "九龙县"); areaCodeFullTable.put("513325", "雅江县"); areaCodeFullTable.put("513326", "道孚县"); areaCodeFullTable.put("513327", "炉霍县"); areaCodeFullTable.put("513328", "甘孜县"); areaCodeFullTable.put("513329", "新龙县"); areaCodeFullTable.put("513330", "德格县"); areaCodeFullTable.put("513331", "白玉县"); areaCodeFullTable.put("513332", "石渠县"); areaCodeFullTable.put("513333", "色达县"); areaCodeFullTable.put("513334", "理塘县"); areaCodeFullTable.put("513335", "巴塘县"); areaCodeFullTable.put("513336", "乡城县"); areaCodeFullTable.put("513337", "稻城县"); areaCodeFullTable.put("513338", "得荣县"); areaCodeFullTable.put("513400", "凉山彝族自治州"); areaCodeFullTable.put("513401", "西昌市"); areaCodeFullTable.put("513422", "木里藏族自治县"); areaCodeFullTable.put("513423", "盐源县"); areaCodeFullTable.put("513424", "德昌县"); areaCodeFullTable.put("513425", "会理县"); areaCodeFullTable.put("513426", "会东县"); areaCodeFullTable.put("513427", "宁南县"); areaCodeFullTable.put("513428", "普格县"); areaCodeFullTable.put("513429", "布拖县"); areaCodeFullTable.put("513430", "金阳县"); areaCodeFullTable.put("513431", "昭觉县"); areaCodeFullTable.put("513432", "喜德县"); areaCodeFullTable.put("513433", "冕宁县"); areaCodeFullTable.put("513434", "越西县"); areaCodeFullTable.put("513435", "甘洛县"); areaCodeFullTable.put("513436", "美姑县"); areaCodeFullTable.put("513437", "雷波县"); areaCodeFullTable.put("520000", "贵州省"); areaCodeFullTable.put("520100", "贵阳市"); areaCodeFullTable.put("520101", "市辖区"); areaCodeFullTable.put("520102", "南明区"); areaCodeFullTable.put("520103", "云岩区"); areaCodeFullTable.put("520111", "花溪区"); areaCodeFullTable.put("520112", "乌当区"); areaCodeFullTable.put("520113", "白云区"); areaCodeFullTable.put("520114", "小河区"); areaCodeFullTable.put("520121", "开阳县"); areaCodeFullTable.put("520122", "息烽县"); areaCodeFullTable.put("520123", "修文县"); areaCodeFullTable.put("520181", "清镇市"); areaCodeFullTable.put("520200", "六盘水市"); areaCodeFullTable.put("520201", "钟山区"); areaCodeFullTable.put("520203", "六枝特区"); areaCodeFullTable.put("520221", "水城县"); areaCodeFullTable.put("520222", "盘县"); areaCodeFullTable.put("520300", "遵义市"); areaCodeFullTable.put("520301", "市辖区"); areaCodeFullTable.put("520302", "红花岗区"); areaCodeFullTable.put("520321", "遵义县"); areaCodeFullTable.put("520322", "桐梓县"); areaCodeFullTable.put("520323", "绥阳县"); areaCodeFullTable.put("520324", "正安县"); areaCodeFullTable.put("520325", "道真仡佬族苗族自"); areaCodeFullTable.put("520326", "务川仡佬族苗族自"); areaCodeFullTable.put("520327", "凤冈县"); areaCodeFullTable.put("520328", "湄潭县"); areaCodeFullTable.put("520329", "余庆县"); areaCodeFullTable.put("520330", "习水县"); areaCodeFullTable.put("520381", "赤水市"); areaCodeFullTable.put("520382", "仁怀市"); areaCodeFullTable.put("520400", "安顺市"); areaCodeFullTable.put("520401", "市辖区"); areaCodeFullTable.put("520402", "西秀区"); areaCodeFullTable.put("520421", "平坝县"); areaCodeFullTable.put("520422", "普定县"); areaCodeFullTable.put("520423", "镇宁布依族苗族自"); areaCodeFullTable.put("520424", "关岭布依族苗族自"); areaCodeFullTable.put("520425", "紫云苗族布依族自"); areaCodeFullTable.put("522200", "铜仁地区"); areaCodeFullTable.put("522201", "铜仁市"); areaCodeFullTable.put("522222", "江口县"); areaCodeFullTable.put("522223", "玉屏侗族自治县"); areaCodeFullTable.put("522224", "石阡县"); areaCodeFullTable.put("522225", "思南县"); areaCodeFullTable.put("522226", "印江土家族苗族自"); areaCodeFullTable.put("522227", "德江县"); areaCodeFullTable.put("522228", "沿河土家族自治县"); areaCodeFullTable.put("522229", "松桃苗族自治县"); areaCodeFullTable.put("522230", "万山特区"); areaCodeFullTable.put("522300", "黔西南布依族苗族自"); areaCodeFullTable.put("522301", "兴义市"); areaCodeFullTable.put("522322", "兴仁县"); areaCodeFullTable.put("522323", "普安县"); areaCodeFullTable.put("522324", "晴隆县"); areaCodeFullTable.put("522325", "贞丰县"); areaCodeFullTable.put("522326", "望谟县"); areaCodeFullTable.put("522327", "册亨县"); areaCodeFullTable.put("522328", "安龙县"); areaCodeFullTable.put("522400", "毕节地区"); areaCodeFullTable.put("522401", "毕节市"); areaCodeFullTable.put("522422", "大方县"); areaCodeFullTable.put("522423", "黔西县"); areaCodeFullTable.put("522424", "金沙县"); areaCodeFullTable.put("522425", "织金县"); areaCodeFullTable.put("522426", "纳雍县"); areaCodeFullTable.put("522427", "威宁彝族回族苗族"); areaCodeFullTable.put("522428", "赫章县"); areaCodeFullTable.put("522600", "黔东南苗族侗族自治"); areaCodeFullTable.put("522601", "凯里市"); areaCodeFullTable.put("522622", "黄平县"); areaCodeFullTable.put("522623", "施秉县"); areaCodeFullTable.put("522624", "三穗县"); areaCodeFullTable.put("522625", "镇远县"); areaCodeFullTable.put("522626", "岑巩县"); areaCodeFullTable.put("522627", "天柱县"); areaCodeFullTable.put("522628", "锦屏县"); areaCodeFullTable.put("522629", "剑河县"); areaCodeFullTable.put("522630", "台江县"); areaCodeFullTable.put("522631", "黎平县"); areaCodeFullTable.put("522632", "榕江县"); areaCodeFullTable.put("522633", "从江县"); areaCodeFullTable.put("522634", "雷山县"); areaCodeFullTable.put("522635", "麻江县"); areaCodeFullTable.put("522636", "丹寨县"); areaCodeFullTable.put("522700", "黔南布依族苗族自治"); areaCodeFullTable.put("522701", "都匀市"); areaCodeFullTable.put("522702", "福泉市"); areaCodeFullTable.put("522722", "荔波县"); areaCodeFullTable.put("522723", "贵定县"); areaCodeFullTable.put("522725", "瓮安县"); areaCodeFullTable.put("522726", "独山县"); areaCodeFullTable.put("522727", "平塘县"); areaCodeFullTable.put("522728", "罗甸县"); areaCodeFullTable.put("522729", "长顺县"); areaCodeFullTable.put("522730", "龙里县"); areaCodeFullTable.put("522731", "惠水县"); areaCodeFullTable.put("522732", "三都水族自治县"); areaCodeFullTable.put("530000", "云南省"); areaCodeFullTable.put("530100", "昆明市"); areaCodeFullTable.put("530101", "市辖区"); areaCodeFullTable.put("530102", "五华区"); areaCodeFullTable.put("530103", "盘龙区"); areaCodeFullTable.put("530111", "官渡区"); areaCodeFullTable.put("530112", "西山区"); areaCodeFullTable.put("530113", "东川区"); areaCodeFullTable.put("530121", "呈贡县"); areaCodeFullTable.put("530122", "晋宁县"); areaCodeFullTable.put("530124", "富民县"); areaCodeFullTable.put("530125", "宜良县"); areaCodeFullTable.put("530126", "石林彝族自治县"); areaCodeFullTable.put("530127", "嵩明县"); areaCodeFullTable.put("530128", "禄劝彝族苗族自治"); areaCodeFullTable.put("530129", "寻甸回族彝族自治"); areaCodeFullTable.put("530181", "安宁市"); areaCodeFullTable.put("530300", "曲靖市"); areaCodeFullTable.put("530301", "市辖区"); areaCodeFullTable.put("530302", "麒麟区"); areaCodeFullTable.put("530321", "马龙县"); areaCodeFullTable.put("530322", "陆良县"); areaCodeFullTable.put("530323", "师宗县"); areaCodeFullTable.put("530324", "罗平县"); areaCodeFullTable.put("530325", "富源县"); areaCodeFullTable.put("530326", "会泽县"); areaCodeFullTable.put("530328", "沾益县"); areaCodeFullTable.put("530381", "宣威市"); areaCodeFullTable.put("530400", "玉溪市"); areaCodeFullTable.put("530401", "市辖区"); areaCodeFullTable.put("530402", "红塔区"); areaCodeFullTable.put("530421", "江川县"); areaCodeFullTable.put("530422", "澄江县"); areaCodeFullTable.put("530423", "通海县"); areaCodeFullTable.put("530424", "华宁县"); areaCodeFullTable.put("530425", "易门县"); areaCodeFullTable.put("530426", "峨山彝族自治县"); areaCodeFullTable.put("530427", "新平彝族傣族自治"); areaCodeFullTable.put("530428", "元江哈尼族彝族傣"); areaCodeFullTable.put("530500", "保山市"); areaCodeFullTable.put("530501", "市辖区"); areaCodeFullTable.put("530502", "隆阳区"); areaCodeFullTable.put("530521", "施甸县"); areaCodeFullTable.put("530522", "腾冲县"); areaCodeFullTable.put("530523", "龙陵县"); areaCodeFullTable.put("530524", "昌宁县"); areaCodeFullTable.put("530600", "昭通市"); areaCodeFullTable.put("530601", "市辖区"); areaCodeFullTable.put("530602", "昭阳区"); areaCodeFullTable.put("530621", "鲁甸县"); areaCodeFullTable.put("530622", "巧家县"); areaCodeFullTable.put("530623", "盐津县"); areaCodeFullTable.put("530624", "大关县"); areaCodeFullTable.put("530625", "永善县"); areaCodeFullTable.put("530626", "绥江县"); areaCodeFullTable.put("530627", "镇雄县"); areaCodeFullTable.put("530628", "彝良县"); areaCodeFullTable.put("530629", "威信县"); areaCodeFullTable.put("530630", "水富县"); areaCodeFullTable.put("532300", "楚雄彝族自治州"); areaCodeFullTable.put("532301", "楚雄市"); areaCodeFullTable.put("532322", "双柏县"); areaCodeFullTable.put("532323", "牟定县"); areaCodeFullTable.put("532324", "南华县"); areaCodeFullTable.put("532325", "姚安县"); areaCodeFullTable.put("532326", "大姚县"); areaCodeFullTable.put("532327", "永仁县"); areaCodeFullTable.put("532328", "元谋县"); areaCodeFullTable.put("532329", "武定县"); areaCodeFullTable.put("532331", "禄丰县"); areaCodeFullTable.put("532500", "红河哈尼族彝族自治"); areaCodeFullTable.put("532501", "个旧市"); areaCodeFullTable.put("532502", "开远市"); areaCodeFullTable.put("532522", "蒙自县"); areaCodeFullTable.put("532523", "屏边苗族自治县"); areaCodeFullTable.put("532524", "建水县"); areaCodeFullTable.put("532525", "石屏县"); areaCodeFullTable.put("532526", "弥勒县"); areaCodeFullTable.put("532527", "泸西县"); areaCodeFullTable.put("532528", "元阳县"); areaCodeFullTable.put("532529", "红河县"); areaCodeFullTable.put("532530", "金平苗族瑶族傣族"); areaCodeFullTable.put("532531", "绿春县"); areaCodeFullTable.put("532532", "河口瑶族自治县"); areaCodeFullTable.put("532600", "文山壮族苗族自治州"); areaCodeFullTable.put("532621", "文山县"); areaCodeFullTable.put("532622", "砚山县"); areaCodeFullTable.put("532623", "西畴县"); areaCodeFullTable.put("532624", "麻栗坡县"); areaCodeFullTable.put("532625", "马关县"); areaCodeFullTable.put("532626", "丘北县"); areaCodeFullTable.put("532627", "广南县"); areaCodeFullTable.put("532628", "富宁县"); areaCodeFullTable.put("532700", "思茅地区"); areaCodeFullTable.put("532701", "思茅市"); areaCodeFullTable.put("532722", "普洱哈尼族彝族自"); areaCodeFullTable.put("532723", "墨江哈尼族自治县"); areaCodeFullTable.put("532724", "景东彝族自治县"); areaCodeFullTable.put("532725", "景谷傣族彝族自治"); areaCodeFullTable.put("532726", "镇沅彝族哈尼族拉"); areaCodeFullTable.put("532727", "江城哈尼族彝族自"); areaCodeFullTable.put("532728", "孟连傣族拉祜族佤"); areaCodeFullTable.put("532729", "澜沧拉祜族自治县"); areaCodeFullTable.put("532730", "西盟佤族自治县"); areaCodeFullTable.put("532800", "西双版纳傣族自治州"); areaCodeFullTable.put("532801", "景洪市"); areaCodeFullTable.put("532822", "勐海县"); areaCodeFullTable.put("532823", "勐腊县"); areaCodeFullTable.put("532900", "大理白族自治州"); areaCodeFullTable.put("532901", "大理市"); areaCodeFullTable.put("532922", "漾濞彝族自治县"); areaCodeFullTable.put("532923", "祥云县"); areaCodeFullTable.put("532924", "宾川县"); areaCodeFullTable.put("532925", "弥渡县"); areaCodeFullTable.put("532926", "南涧彝族自治县"); areaCodeFullTable.put("532927", "巍山彝族回族自治"); areaCodeFullTable.put("532928", "永平县"); areaCodeFullTable.put("532929", "云龙县"); areaCodeFullTable.put("532930", "洱源县"); areaCodeFullTable.put("532931", "剑川县"); areaCodeFullTable.put("532932", "鹤庆县"); areaCodeFullTable.put("533100", "德宏傣族景颇族自治"); areaCodeFullTable.put("533102", "瑞丽市"); areaCodeFullTable.put("533103", "潞西市"); areaCodeFullTable.put("533122", "梁河县"); areaCodeFullTable.put("533123", "盈江县"); areaCodeFullTable.put("533124", "陇川县"); areaCodeFullTable.put("533200", "丽江地区"); areaCodeFullTable.put("533221", "丽江纳西族自治县"); areaCodeFullTable.put("533222", "永胜县"); areaCodeFullTable.put("533223", "华坪县"); areaCodeFullTable.put("533224", "宁蒗彝族自治县"); areaCodeFullTable.put("533300", "怒江傈僳族自治州"); areaCodeFullTable.put("533321", "泸水县"); areaCodeFullTable.put("533323", "福贡县"); areaCodeFullTable.put("533324", "贡山独龙族怒族自"); areaCodeFullTable.put("533325", "兰坪白族普米族自"); areaCodeFullTable.put("533400", "迪庆藏族自治州"); areaCodeFullTable.put("533421", "香格里拉县"); areaCodeFullTable.put("533422", "德钦县"); areaCodeFullTable.put("533423", "维西傈僳族自治县"); areaCodeFullTable.put("533500", "临沧地区"); areaCodeFullTable.put("533521", "临沧县"); areaCodeFullTable.put("533522", "凤庆县"); areaCodeFullTable.put("533523", "云县"); areaCodeFullTable.put("533524", "永德县"); areaCodeFullTable.put("533525", "镇康县"); areaCodeFullTable.put("533526", "双江拉祜族佤族布"); areaCodeFullTable.put("533527", "耿马傣族佤族自治"); areaCodeFullTable.put("533528", "沧源佤族自治县"); areaCodeFullTable.put("540000", "西藏自治区"); areaCodeFullTable.put("540100", "拉萨市"); areaCodeFullTable.put("540101", "市辖区"); areaCodeFullTable.put("540102", "城关区"); areaCodeFullTable.put("540121", "林周县"); areaCodeFullTable.put("540122", "当雄县"); areaCodeFullTable.put("540123", "尼木县"); areaCodeFullTable.put("540124", "曲水县"); areaCodeFullTable.put("540125", "堆龙德庆县"); areaCodeFullTable.put("540126", "达孜县"); areaCodeFullTable.put("540127", "墨竹工卡县"); areaCodeFullTable.put("542100", "昌都地区"); areaCodeFullTable.put("542121", "昌都县"); areaCodeFullTable.put("542122", "江达县"); areaCodeFullTable.put("542123", "贡觉县"); areaCodeFullTable.put("542124", "类乌齐县"); areaCodeFullTable.put("542125", "丁青县"); areaCodeFullTable.put("542126", "察雅县"); areaCodeFullTable.put("542127", "八宿县"); areaCodeFullTable.put("542128", "左贡县"); areaCodeFullTable.put("542129", "芒康县"); areaCodeFullTable.put("542132", "洛隆县"); areaCodeFullTable.put("542133", "边坝县"); areaCodeFullTable.put("542200", "山南地区"); areaCodeFullTable.put("542221", "乃东县"); areaCodeFullTable.put("542222", "扎囊县"); areaCodeFullTable.put("542223", "贡嘎县"); areaCodeFullTable.put("542224", "桑日县"); areaCodeFullTable.put("542225", "琼结县"); areaCodeFullTable.put("542226", "曲松县"); areaCodeFullTable.put("542227", "措美县"); areaCodeFullTable.put("542228", "洛扎县"); areaCodeFullTable.put("542229", "加查县"); areaCodeFullTable.put("542231", "隆子县"); areaCodeFullTable.put("542232", "错那县"); areaCodeFullTable.put("542233", "浪卡子县"); areaCodeFullTable.put("542300", "日喀则地区"); areaCodeFullTable.put("542301", "日喀则市"); areaCodeFullTable.put("542322", "南木林县"); areaCodeFullTable.put("542323", "江孜县"); areaCodeFullTable.put("542324", "定日县"); areaCodeFullTable.put("542325", "萨迦县"); areaCodeFullTable.put("542326", "拉孜县"); areaCodeFullTable.put("542327", "昂仁县"); areaCodeFullTable.put("542328", "谢通门县"); areaCodeFullTable.put("542329", "白朗县"); areaCodeFullTable.put("542330", "仁布县"); areaCodeFullTable.put("542331", "康马县"); areaCodeFullTable.put("542332", "定结县"); areaCodeFullTable.put("542333", "仲巴县"); areaCodeFullTable.put("542334", "亚东县"); areaCodeFullTable.put("542335", "吉隆县"); areaCodeFullTable.put("542336", "聂拉木县"); areaCodeFullTable.put("542337", "萨嘎县"); areaCodeFullTable.put("542338", "岗巴县"); areaCodeFullTable.put("542400", "那曲地区"); areaCodeFullTable.put("542421", "那曲县"); areaCodeFullTable.put("542422", "嘉黎县"); areaCodeFullTable.put("542423", "比如县"); areaCodeFullTable.put("542424", "聂荣县"); areaCodeFullTable.put("542425", "安多县"); areaCodeFullTable.put("542426", "申扎县"); areaCodeFullTable.put("542427", "索县"); areaCodeFullTable.put("542428", "班戈县"); areaCodeFullTable.put("542429", "巴青县"); areaCodeFullTable.put("542430", "尼玛县"); areaCodeFullTable.put("542500", "阿里地区"); areaCodeFullTable.put("542521", "普兰县"); areaCodeFullTable.put("542522", "札达县"); areaCodeFullTable.put("542523", "噶尔县"); areaCodeFullTable.put("542524", "日土县"); areaCodeFullTable.put("542525", "革吉县"); areaCodeFullTable.put("542526", "改则县"); areaCodeFullTable.put("542527", "措勤县"); areaCodeFullTable.put("542600", "林芝地区"); areaCodeFullTable.put("542621", "林芝县"); areaCodeFullTable.put("542622", "工布江达县"); areaCodeFullTable.put("542623", "米林县"); areaCodeFullTable.put("542624", "墨脱县"); areaCodeFullTable.put("542625", "波密县"); areaCodeFullTable.put("542626", "察隅县"); areaCodeFullTable.put("542627", "朗县"); areaCodeFullTable.put("610000", "陕西省"); areaCodeFullTable.put("610100", "西安市"); areaCodeFullTable.put("610101", "市辖区"); areaCodeFullTable.put("610102", "新城区"); areaCodeFullTable.put("610103", "碑林区"); areaCodeFullTable.put("610104", "莲湖区"); areaCodeFullTable.put("610111", "灞桥区"); areaCodeFullTable.put("610112", "未央区"); areaCodeFullTable.put("610113", "雁塔区"); areaCodeFullTable.put("610114", "阎良区"); areaCodeFullTable.put("610115", "临潼区"); areaCodeFullTable.put("610121", "长安县"); areaCodeFullTable.put("610122", "蓝田县"); areaCodeFullTable.put("610124", "周至县"); areaCodeFullTable.put("610125", "户县"); areaCodeFullTable.put("610126", "高陵县"); areaCodeFullTable.put("610200", "铜川市"); areaCodeFullTable.put("610201", "市辖区"); areaCodeFullTable.put("610202", "王益区"); areaCodeFullTable.put("610203", "印台区"); areaCodeFullTable.put("610221", "耀县"); areaCodeFullTable.put("610222", "宜君县"); areaCodeFullTable.put("610300", "宝鸡市"); areaCodeFullTable.put("610301", "市辖区"); areaCodeFullTable.put("610302", "渭滨区"); areaCodeFullTable.put("610303", "金台区"); areaCodeFullTable.put("610321", "宝鸡县"); areaCodeFullTable.put("610322", "凤翔县"); areaCodeFullTable.put("610323", "岐山县"); areaCodeFullTable.put("610324", "扶风县"); areaCodeFullTable.put("610326", "眉县"); areaCodeFullTable.put("610327", "陇县"); areaCodeFullTable.put("610328", "千阳县"); areaCodeFullTable.put("610329", "麟游县"); areaCodeFullTable.put("610330", "凤县"); areaCodeFullTable.put("610331", "太白县"); areaCodeFullTable.put("610400", "咸阳市"); areaCodeFullTable.put("610401", "市辖区"); areaCodeFullTable.put("610402", "秦都区"); areaCodeFullTable.put("610403", "杨凌区"); areaCodeFullTable.put("610404", "渭城区"); areaCodeFullTable.put("610422", "三原县"); areaCodeFullTable.put("610423", "泾阳县"); areaCodeFullTable.put("610424", "乾县"); areaCodeFullTable.put("610425", "礼泉县"); areaCodeFullTable.put("610426", "永寿县"); areaCodeFullTable.put("610427", "彬县"); areaCodeFullTable.put("610428", "长武县"); areaCodeFullTable.put("610429", "旬邑县"); areaCodeFullTable.put("610430", "淳化县"); areaCodeFullTable.put("610431", "武功县"); areaCodeFullTable.put("610481", "兴平市"); areaCodeFullTable.put("610500", "渭南市"); areaCodeFullTable.put("610501", "市辖区"); areaCodeFullTable.put("610502", "临渭区"); areaCodeFullTable.put("610521", "华县"); areaCodeFullTable.put("610522", "潼关县"); areaCodeFullTable.put("610523", "大荔县"); areaCodeFullTable.put("610524", "合阳县"); areaCodeFullTable.put("610525", "澄城县"); areaCodeFullTable.put("610526", "蒲城县"); areaCodeFullTable.put("610527", "白水县"); areaCodeFullTable.put("610528", "富平县"); areaCodeFullTable.put("610581", "韩城市"); areaCodeFullTable.put("610582", "华阴市"); areaCodeFullTable.put("610600", "延安市"); areaCodeFullTable.put("610601", "市辖区"); areaCodeFullTable.put("610602", "宝塔区"); areaCodeFullTable.put("610621", "延长县"); areaCodeFullTable.put("610622", "延川县"); areaCodeFullTable.put("610623", "子长县"); areaCodeFullTable.put("610624", "安塞县"); areaCodeFullTable.put("610625", "志丹县"); areaCodeFullTable.put("610626", "吴旗县"); areaCodeFullTable.put("610627", "甘泉县"); areaCodeFullTable.put("610628", "富县"); areaCodeFullTable.put("610629", "洛川县"); areaCodeFullTable.put("610630", "宜川县"); areaCodeFullTable.put("610631", "黄龙县"); areaCodeFullTable.put("610632", "黄陵县"); areaCodeFullTable.put("610700", "汉中市"); areaCodeFullTable.put("610701", "市辖区"); areaCodeFullTable.put("610702", "汉台区"); areaCodeFullTable.put("610721", "南郑县"); areaCodeFullTable.put("610722", "城固县"); areaCodeFullTable.put("610723", "洋县"); areaCodeFullTable.put("610724", "西乡县"); areaCodeFullTable.put("610725", "勉县"); areaCodeFullTable.put("610726", "宁强县"); areaCodeFullTable.put("610727", "略阳县"); areaCodeFullTable.put("610728", "镇巴县"); areaCodeFullTable.put("610729", "留坝县"); areaCodeFullTable.put("610730", "佛坪县"); areaCodeFullTable.put("610800", "榆林市"); areaCodeFullTable.put("610801", "市辖区"); areaCodeFullTable.put("610802", "榆阳区"); areaCodeFullTable.put("610821", "神木县"); areaCodeFullTable.put("610822", "府谷县"); areaCodeFullTable.put("610823", "横山县"); areaCodeFullTable.put("610824", "靖边县"); areaCodeFullTable.put("610825", "定边县"); areaCodeFullTable.put("610826", "绥德县"); areaCodeFullTable.put("610827", "米脂县"); areaCodeFullTable.put("610828", "佳县"); areaCodeFullTable.put("610829", "吴堡县"); areaCodeFullTable.put("610830", "清涧县"); areaCodeFullTable.put("610831", "子洲县"); areaCodeFullTable.put("610900", "安康市"); areaCodeFullTable.put("610901", "市辖区"); areaCodeFullTable.put("610902", "汉滨区"); areaCodeFullTable.put("610921", "汉阴县"); areaCodeFullTable.put("610922", "石泉县"); areaCodeFullTable.put("610923", "宁陕县"); areaCodeFullTable.put("610924", "紫阳县"); areaCodeFullTable.put("610925", "岚皋县"); areaCodeFullTable.put("610926", "平利县"); areaCodeFullTable.put("610927", "镇坪县"); areaCodeFullTable.put("610928", "旬阳县"); areaCodeFullTable.put("610929", "白河县"); areaCodeFullTable.put("611000", "商洛市"); areaCodeFullTable.put("611001", "市辖区"); areaCodeFullTable.put("611002", "商州区"); areaCodeFullTable.put("611021", "洛南县"); areaCodeFullTable.put("611022", "丹凤县"); areaCodeFullTable.put("611023", "商南县"); areaCodeFullTable.put("611024", "山阳县"); areaCodeFullTable.put("611025", "镇安县"); areaCodeFullTable.put("611026", "柞水县"); areaCodeFullTable.put("620000", "甘肃省"); areaCodeFullTable.put("620100", "兰州市"); areaCodeFullTable.put("620101", "市辖区"); areaCodeFullTable.put("620102", "城关区"); areaCodeFullTable.put("620103", "七里河区"); areaCodeFullTable.put("620104", "西固区"); areaCodeFullTable.put("620105", "安宁区"); areaCodeFullTable.put("620111", "红古区"); areaCodeFullTable.put("620121", "永登县"); areaCodeFullTable.put("620122", "皋兰县"); areaCodeFullTable.put("620123", "榆中县"); areaCodeFullTable.put("620200", "嘉峪关市"); areaCodeFullTable.put("620201", "市辖区"); areaCodeFullTable.put("620300", "金昌市"); areaCodeFullTable.put("620301", "市辖区"); areaCodeFullTable.put("620302", "金川区"); areaCodeFullTable.put("620321", "永昌县"); areaCodeFullTable.put("620400", "白银市"); areaCodeFullTable.put("620401", "市辖区"); areaCodeFullTable.put("620402", "白银区"); areaCodeFullTable.put("620403", "平川区"); areaCodeFullTable.put("620421", "靖远县"); areaCodeFullTable.put("620422", "会宁县"); areaCodeFullTable.put("620423", "景泰县"); areaCodeFullTable.put("620500", "天水市"); areaCodeFullTable.put("620501", "市辖区"); areaCodeFullTable.put("620502", "秦城区"); areaCodeFullTable.put("620503", "北道区"); areaCodeFullTable.put("620521", "清水县"); areaCodeFullTable.put("620522", "秦安县"); areaCodeFullTable.put("620523", "甘谷县"); areaCodeFullTable.put("620524", "武山县"); areaCodeFullTable.put("620525", "张家川回族自治县"); areaCodeFullTable.put("620600", "武威市"); areaCodeFullTable.put("620601", "市辖区"); areaCodeFullTable.put("620602", "凉州区"); areaCodeFullTable.put("620621", "民勤县"); areaCodeFullTable.put("620622", "古浪县"); areaCodeFullTable.put("620623", "天祝藏族自治县"); areaCodeFullTable.put("622100", "酒泉地区"); areaCodeFullTable.put("622101", "玉门市"); areaCodeFullTable.put("622102", "酒泉市"); areaCodeFullTable.put("622103", "敦煌市"); areaCodeFullTable.put("622123", "金塔县"); areaCodeFullTable.put("622124", "肃北蒙古族自治县"); areaCodeFullTable.put("622125", "阿克塞哈萨克族自"); areaCodeFullTable.put("622126", "安西县"); areaCodeFullTable.put("622200", "张掖地区"); areaCodeFullTable.put("622201", "张掖市"); areaCodeFullTable.put("622222", "肃南裕固族自治县"); areaCodeFullTable.put("622223", "民乐县"); areaCodeFullTable.put("622224", "临泽县"); areaCodeFullTable.put("622225", "高台县"); areaCodeFullTable.put("622226", "山丹县"); areaCodeFullTable.put("622400", "定西地区"); areaCodeFullTable.put("622421", "定西县"); areaCodeFullTable.put("622424", "通渭县"); areaCodeFullTable.put("622425", "陇西县"); areaCodeFullTable.put("622426", "渭源县"); areaCodeFullTable.put("622427", "临洮县"); areaCodeFullTable.put("622428", "漳县"); areaCodeFullTable.put("622429", "岷县"); areaCodeFullTable.put("622600", "陇南地区"); areaCodeFullTable.put("622621", "武都县"); areaCodeFullTable.put("622623", "宕昌县"); areaCodeFullTable.put("622624", "成县"); areaCodeFullTable.put("622625", "康县"); areaCodeFullTable.put("622626", "文县"); areaCodeFullTable.put("622627", "西和县"); areaCodeFullTable.put("622628", "礼县"); areaCodeFullTable.put("622629", "两当县"); areaCodeFullTable.put("622630", "徽县"); areaCodeFullTable.put("622700", "平凉地区"); areaCodeFullTable.put("622701", "平凉市"); areaCodeFullTable.put("622722", "泾川县"); areaCodeFullTable.put("622723", "灵台县"); areaCodeFullTable.put("622724", "崇信县"); areaCodeFullTable.put("622725", "华亭县"); areaCodeFullTable.put("622726", "庄浪县"); areaCodeFullTable.put("622727", "静宁县"); areaCodeFullTable.put("622800", "庆阳地区"); areaCodeFullTable.put("622801", "西峰市"); areaCodeFullTable.put("622821", "庆阳县"); areaCodeFullTable.put("622822", "环县"); areaCodeFullTable.put("622823", "华池县"); areaCodeFullTable.put("622824", "合水县"); areaCodeFullTable.put("622825", "正宁县"); areaCodeFullTable.put("622826", "宁县"); areaCodeFullTable.put("622827", "镇原县"); areaCodeFullTable.put("622900", "临夏回族自治州"); areaCodeFullTable.put("622901", "临夏市"); areaCodeFullTable.put("622921", "临夏县"); areaCodeFullTable.put("622922", "康乐县"); areaCodeFullTable.put("622923", "永靖县"); areaCodeFullTable.put("622924", "广河县"); areaCodeFullTable.put("622925", "和政县"); areaCodeFullTable.put("622926", "东乡族自治县"); areaCodeFullTable.put("622927", "积石山保安族东乡"); areaCodeFullTable.put("623000", "甘南藏族自治州"); areaCodeFullTable.put("623001", "合作市"); areaCodeFullTable.put("623021", "临潭县"); areaCodeFullTable.put("623022", "卓尼县"); areaCodeFullTable.put("623023", "舟曲县"); areaCodeFullTable.put("623024", "迭部县"); areaCodeFullTable.put("623025", "玛曲县"); areaCodeFullTable.put("623026", "碌曲县"); areaCodeFullTable.put("623027", "夏河县"); areaCodeFullTable.put("630000", "青海省"); areaCodeFullTable.put("630100", "西宁市"); areaCodeFullTable.put("630101", "市辖区"); areaCodeFullTable.put("630102", "城东区"); areaCodeFullTable.put("630103", "城中区"); areaCodeFullTable.put("630104", "城西区"); areaCodeFullTable.put("630105", "城北区"); areaCodeFullTable.put("630121", "大通回族土族自治"); areaCodeFullTable.put("630122", "湟中县"); areaCodeFullTable.put("630123", "湟源县"); areaCodeFullTable.put("632100", "海东地区"); areaCodeFullTable.put("632121", "平安县"); areaCodeFullTable.put("632122", "民和回族土族自治"); areaCodeFullTable.put("632123", "乐都县"); areaCodeFullTable.put("632126", "互助土族自治县"); areaCodeFullTable.put("632127", "化隆回族自治县"); areaCodeFullTable.put("632128", "循化撒拉族自治县"); areaCodeFullTable.put("632200", "海北藏族自治州"); areaCodeFullTable.put("632221", "门源回族自治县"); areaCodeFullTable.put("632222", "祁连县"); areaCodeFullTable.put("632223", "海晏县"); areaCodeFullTable.put("632224", "刚察县"); areaCodeFullTable.put("632300", "黄南藏族自治州"); areaCodeFullTable.put("632321", "同仁县"); areaCodeFullTable.put("632322", "尖扎县"); areaCodeFullTable.put("632323", "泽库县"); areaCodeFullTable.put("632324", "河南蒙古族自治县"); areaCodeFullTable.put("632500", "海南藏族自治州"); areaCodeFullTable.put("632521", "共和县"); areaCodeFullTable.put("632522", "同德县"); areaCodeFullTable.put("632523", "贵德县"); areaCodeFullTable.put("632524", "兴海县"); areaCodeFullTable.put("632525", "贵南县"); areaCodeFullTable.put("632600", "果洛藏族自治州"); areaCodeFullTable.put("632621", "玛沁县"); areaCodeFullTable.put("632622", "班玛县"); areaCodeFullTable.put("632623", "甘德县"); areaCodeFullTable.put("632624", "达日县"); areaCodeFullTable.put("632625", "久治县"); areaCodeFullTable.put("632626", "玛多县"); areaCodeFullTable.put("632700", "玉树藏族自治州"); areaCodeFullTable.put("632721", "玉树县"); areaCodeFullTable.put("632722", "杂多县"); areaCodeFullTable.put("632723", "称多县"); areaCodeFullTable.put("632724", "治多县"); areaCodeFullTable.put("632725", "囊谦县"); areaCodeFullTable.put("632726", "曲麻莱县"); areaCodeFullTable.put("632800", "海西蒙古族藏族自治"); areaCodeFullTable.put("632801", "格尔木市"); areaCodeFullTable.put("632802", "德令哈市"); areaCodeFullTable.put("632821", "乌兰县"); areaCodeFullTable.put("632822", "都兰县"); areaCodeFullTable.put("632823", "天峻县"); areaCodeFullTable.put("640000", "宁夏回族自治区"); areaCodeFullTable.put("640100", "银川市"); areaCodeFullTable.put("640101", "市辖区"); areaCodeFullTable.put("640102", "城区"); areaCodeFullTable.put("640103", "新城区"); areaCodeFullTable.put("640111", "郊区"); areaCodeFullTable.put("640121", "永宁县"); areaCodeFullTable.put("640122", "贺兰县"); areaCodeFullTable.put("640200", "石嘴山市"); areaCodeFullTable.put("640201", "市辖区"); areaCodeFullTable.put("640202", "大武口区"); areaCodeFullTable.put("640203", "石嘴山区"); areaCodeFullTable.put("640204", "石炭井区"); areaCodeFullTable.put("640221", "平罗县"); areaCodeFullTable.put("640222", "陶乐县"); areaCodeFullTable.put("640223", "惠农县"); areaCodeFullTable.put("640300", "吴忠市"); areaCodeFullTable.put("640301", "市辖区"); areaCodeFullTable.put("640302", "利通区"); areaCodeFullTable.put("640321", "中卫县"); areaCodeFullTable.put("640322", "中宁县"); areaCodeFullTable.put("640323", "盐池县"); areaCodeFullTable.put("640324", "同心县"); areaCodeFullTable.put("640381", "青铜峡市"); areaCodeFullTable.put("640382", "灵武市"); areaCodeFullTable.put("640400", "固原市"); areaCodeFullTable.put("640401", "市辖区"); areaCodeFullTable.put("640402", "原州区"); areaCodeFullTable.put("640421", "海原县"); areaCodeFullTable.put("640422", "西吉县"); areaCodeFullTable.put("640423", "隆德县"); areaCodeFullTable.put("640424", "泾源县"); areaCodeFullTable.put("640425", "彭阳县"); areaCodeFullTable.put("650000", "新疆维吾尔自治区"); areaCodeFullTable.put("650100", "乌鲁木齐市"); areaCodeFullTable.put("650101", "市辖区"); areaCodeFullTable.put("650102", "天山区"); areaCodeFullTable.put("650103", "沙依巴克区"); areaCodeFullTable.put("650104", "新市区"); areaCodeFullTable.put("650105", "水磨沟区"); areaCodeFullTable.put("650106", "头屯河区"); areaCodeFullTable.put("650107", "南泉区"); areaCodeFullTable.put("650108", "东山区"); areaCodeFullTable.put("650121", "乌鲁木齐县"); areaCodeFullTable.put("650200", "克拉玛依市"); areaCodeFullTable.put("650201", "市辖区"); areaCodeFullTable.put("650202", "独山子区"); areaCodeFullTable.put("650203", "克拉玛依区"); areaCodeFullTable.put("650204", "白碱滩区"); areaCodeFullTable.put("650205", "乌尔禾区"); areaCodeFullTable.put("652100", "吐鲁番地区"); areaCodeFullTable.put("652101", "吐鲁番市"); areaCodeFullTable.put("652122", "鄯善县"); areaCodeFullTable.put("652123", "托克逊县"); areaCodeFullTable.put("652200", "哈密地区"); areaCodeFullTable.put("652201", "哈密市"); areaCodeFullTable.put("652222", "巴里坤哈萨克自治"); areaCodeFullTable.put("652223", "伊吾县"); areaCodeFullTable.put("652300", "昌吉回族自治州"); areaCodeFullTable.put("652301", "昌吉市"); areaCodeFullTable.put("652302", "阜康市"); areaCodeFullTable.put("652303", "米泉市"); areaCodeFullTable.put("652323", "呼图壁县"); areaCodeFullTable.put("652324", "玛纳斯县"); areaCodeFullTable.put("652325", "奇台县"); areaCodeFullTable.put("652327", "吉木萨尔县"); areaCodeFullTable.put("652328", "木垒哈萨克自治县"); areaCodeFullTable.put("652700", "博尔塔拉蒙古自治州"); areaCodeFullTable.put("652701", "博乐市"); areaCodeFullTable.put("652722", "精河县"); areaCodeFullTable.put("652723", "温泉县"); areaCodeFullTable.put("652800", "巴音郭楞蒙古自治州"); areaCodeFullTable.put("652801", "库尔勒市"); areaCodeFullTable.put("652822", "轮台县"); areaCodeFullTable.put("652823", "尉犁县"); areaCodeFullTable.put("652824", "若羌县"); areaCodeFullTable.put("652825", "且末县"); areaCodeFullTable.put("652826", "焉耆回族自治县"); areaCodeFullTable.put("652827", "和静县"); areaCodeFullTable.put("652828", "和硕县"); areaCodeFullTable.put("652829", "博湖县"); areaCodeFullTable.put("652900", "阿克苏地区"); areaCodeFullTable.put("652901", "阿克苏市"); areaCodeFullTable.put("652922", "温宿县"); areaCodeFullTable.put("652923", "库车县"); areaCodeFullTable.put("652924", "沙雅县"); areaCodeFullTable.put("652925", "新和县"); areaCodeFullTable.put("652926", "拜城县"); areaCodeFullTable.put("652927", "乌什县"); areaCodeFullTable.put("652928", "阿瓦提县"); areaCodeFullTable.put("652929", "柯坪县"); areaCodeFullTable.put("653000", "克孜勒苏柯尔克孜自"); areaCodeFullTable.put("653001", "阿图什市"); areaCodeFullTable.put("653022", "阿克陶县"); areaCodeFullTable.put("653023", "阿合奇县"); areaCodeFullTable.put("653024", "乌恰县"); areaCodeFullTable.put("653100", "喀什地区"); areaCodeFullTable.put("653101", "喀什市"); areaCodeFullTable.put("653121", "疏附县"); areaCodeFullTable.put("653122", "疏勒县"); areaCodeFullTable.put("653123", "英吉沙县"); areaCodeFullTable.put("653124", "泽普县"); areaCodeFullTable.put("653125", "莎车县"); areaCodeFullTable.put("653126", "叶城县"); areaCodeFullTable.put("653127", "麦盖提县"); areaCodeFullTable.put("653128", "岳普湖县"); areaCodeFullTable.put("653129", "伽师县"); areaCodeFullTable.put("653130", "巴楚县"); areaCodeFullTable.put("653131", "塔什库尔干塔吉克"); areaCodeFullTable.put("653200", "和田地区"); areaCodeFullTable.put("653201", "和田市"); areaCodeFullTable.put("653221", "和田县"); areaCodeFullTable.put("653222", "墨玉县"); areaCodeFullTable.put("653223", "皮山县"); areaCodeFullTable.put("653224", "洛浦县"); areaCodeFullTable.put("653225", "策勒县"); areaCodeFullTable.put("653226", "于田县"); areaCodeFullTable.put("653227", "民丰县"); areaCodeFullTable.put("654000", "伊犁哈萨克自治州"); areaCodeFullTable.put("654002", "伊宁市"); areaCodeFullTable.put("654003", "奎屯市"); areaCodeFullTable.put("654021", "伊宁县"); areaCodeFullTable.put("654022", "察布查尔锡伯自治"); areaCodeFullTable.put("654023", "霍城县"); areaCodeFullTable.put("654024", "巩留县"); areaCodeFullTable.put("654025", "新源县"); areaCodeFullTable.put("654026", "昭苏县"); areaCodeFullTable.put("654027", "特克斯县"); areaCodeFullTable.put("654028", "尼勒克县"); areaCodeFullTable.put("654200", "塔城地区"); areaCodeFullTable.put("654201", "塔城市"); areaCodeFullTable.put("654202", "乌苏市"); areaCodeFullTable.put("654221", "额敏县"); areaCodeFullTable.put("654223", "沙湾县"); areaCodeFullTable.put("654224", "托里县"); areaCodeFullTable.put("654225", "裕民县"); areaCodeFullTable.put("654226", "和布克赛尔蒙古自"); areaCodeFullTable.put("654300", "阿勒泰地区"); areaCodeFullTable.put("654301", "阿勒泰市"); areaCodeFullTable.put("654321", "布尔津县"); areaCodeFullTable.put("654322", "富蕴县"); areaCodeFullTable.put("654323", "福海县"); areaCodeFullTable.put("654324", "哈巴河县"); areaCodeFullTable.put("654325", "青河县"); areaCodeFullTable.put("654326", "吉木乃县"); areaCodeFullTable.put("659000", "自治区直辖县级行政"); areaCodeFullTable.put("659001", "石河子市"); } return areaCodeFullTable; } private VerifyChinaIDCard() { } }
c1a1167426ed045d65ba9e0aaa27640ee699b790
b8e7ccce10c8a017eb06a45fd7858807b7af691d
/src/test/java/com/github/aliakhtar/tosBoss/util/NLPTest.java
01e1acb1df72ad4d8904d4a49dcb5665e45ccd5f
[]
no_license
aliakhtar/TosBoss
58869b320c8d97b74a6880c7ca082793a4b16d38
0cc301063a0cb092a7b052a7374d656af66e3ea9
refs/heads/master
2020-05-17T04:53:50.329897
2014-12-08T06:02:36
2014-12-08T06:02:36
30,398,896
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
package com.github.aliakhtar.tosBoss.util; import org.junit.Test; import java.util.List; import static org.junit.Assert.*; public class NLPTest { @Test public void testGetSentences() throws Exception { String text = IO.readFile("example_tos/3Scale"); List<String> result = NLP.getPosTags(text); assertNotNull(result); assertFalse( result.toString(), result.isEmpty() ); } @Test public void testPosTagging() { String text = IO.readFile("PosTest1"); List<String> result = NLP.getPosTags(text); assertNotNull(result); assertFalse( result.toString(), result.isEmpty() ); } @Test public void testCleanUp() throws Exception { String input = "this one is ok"; String output = NLP.cleanUp(input); assertEquals(input, output); output = NLP.cleanUp("1.1 lol"); assertEquals("lol", output); assertEquals("lol", NLP.cleanUp("lol (some bullshit)") ); assertEquals("lol", NLP.cleanUp("lol (some bullshit) (\"some more bullshit\")")); } }
2b32b70606147d40ef3398957dd3bc8730a01f3d
1fa6a49e2d3775b9c058a47415e764c5e769bbea
/MY NGO PROJECT/COMP_ABHILASHA_PROJECT/jit_project1/abhilasha_project/src/Single_phon_numbsr_view.java
0c8ce18b1ca322967cf4469142874ab5330c8d7b
[]
no_license
Amreshhub/Java-
dcc1c8cffadc20e706258671c1cfd9f8602bd48b
d6026dd647b61ca698942ffac2c095884883161e
refs/heads/master
2020-12-29T21:52:35.321615
2020-02-06T17:31:41
2020-02-06T17:31:41
238,744,423
0
0
null
null
null
null
UTF-8
Java
false
false
7,068
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Single_phon_numbsr_view.java * * Created on May 18, 2012, 12:42:24 AM */ /** * * @author Amresh */ import java.sql.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Single_phon_numbsr_view extends javax.swing.JFrame implements ItemListener { Connection con; Statement st; ResultSet rs; ResultSetMetaData rmeta; /** Creates new form Single_phon_numbsr_view */ public Single_phon_numbsr_view() { initComponents(); cb1.addItemListener(this); cb1.addItem("Select Name"); } public boolean setconn(String ds,String user,String pwd) { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="jdbc:odbc:"+ds; con=DriverManager.getConnection(url,user,pwd); return(true); } catch(Exception e) { System.out.print(e.getMessage()); return(false); } }//close of conn() public void mySelect(String table) { try { st=con.createStatement(); String sql="SELECT * From "+table; rs=st.executeQuery(sql); //myDisplayResult(result); // rs.next(); //t1.setText(rs.getString(1)); //p1.setText(rs.getString(2)); } catch(Exception e) { JOptionPane.showMessageDialog(this,e.getMessage()); } } public void itemStateChanged(ItemEvent ie) { try { if(ie.getSource()==cb1) { st=con.createStatement(); String sql="SELECT * FROM NEW_MEMBER"; rs=st.executeQuery(sql); String mid=cb1.getSelectedItem().toString(); while(rs.next()) { if (mid.equals(rs.getString(1))) { t1.setText(rs.getString(2)); t2.setText(rs.getString(8)); } //} } } } catch(Exception e) { JOptionPane.showMessageDialog(this,e.getMessage()); } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); t1 = new javax.swing.JTextField(); t2 = new javax.swing.JTextField(); cb1 = new javax.swing.JComboBox(); jLabel4 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("View Single Phon Number"); getContentPane().setLayout(null); jLabel1.setFont(new java.awt.Font("Arial", 3, 18)); jLabel1.setForeground(new java.awt.Color(255, 153, 153)); jLabel1.setText("View Single Phon Number"); jLabel1.setName("jLabel1"); // NOI18N getContentPane().add(jLabel1); jLabel1.setBounds(400, 10, 230, 20); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/HDWallpapers (30).jpg"))); // NOI18N jLabel2.setText("jLabel2"); jLabel2.setName("jLabel2"); // NOI18N getContentPane().add(jLabel2); jLabel2.setBounds(0, 0, 670, 50); jPanel1.setBackground(new java.awt.Color(102, 51, 255)); jPanel1.setName("jPanel1"); // NOI18N jPanel1.setLayout(null); jLabel3.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N jLabel3.setForeground(new java.awt.Color(0, 255, 255)); jLabel3.setText("Please Select The Name"); jLabel3.setName("jLabel3"); // NOI18N jPanel1.add(jLabel3); jLabel3.setBounds(50, 20, 170, 17); jButton2.setText("Exit"); jButton2.setName("jButton2"); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.add(jButton2); jButton2.setBounds(541, 273, 110, 40); jLabel5.setFont(new java.awt.Font("Arial", 1, 14)); jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("NAME"); jLabel5.setName("jLabel5"); // NOI18N jPanel1.add(jLabel5); jLabel5.setBounds(100, 140, 50, 17); jLabel6.setFont(new java.awt.Font("Arial", 1, 14)); jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("NUMBER"); jLabel6.setName("jLabel6"); // NOI18N jPanel1.add(jLabel6); jLabel6.setBounds(100, 170, 70, 17); t1.setName("t1"); // NOI18N jPanel1.add(t1); t1.setBounds(190, 140, 250, 20); t2.setName("t2"); // NOI18N jPanel1.add(t2); t2.setBounds(190, 170, 250, 20); cb1.setName("cb1"); // NOI18N jPanel1.add(cb1); cb1.setBounds(230, 20, 200, 20); getContentPane().add(jPanel1); jPanel1.setBounds(0, 80, 670, 340); jLabel4.setFont(new java.awt.Font("Arial", 3, 18)); jLabel4.setForeground(new java.awt.Color(204, 0, 255)); jLabel4.setText("Abhilasha phonBook"); jLabel4.setName("jLabel4"); // NOI18N getContentPane().add(jLabel4); jLabel4.setBounds(210, 50, 180, 20); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-680)/2, (screenSize.height-456)/2, 680, 456); }// </editor-fold>//GEN-END:initComponents private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: setVisible(false); }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Single_phon_numbsr_view().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox cb1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel1; private javax.swing.JTextField t1; private javax.swing.JTextField t2; // End of variables declaration//GEN-END:variables }
e916b9d075a860ee971ec3b9d80658e67eaa89f6
68a977a05cd43fc76194b4c8bb011f0234e7cebc
/src/main/java/io/geovaneshimizu/whatstune/weather/Weather.java
60725fff51b91087e3a6074e574a1e70aa6423ad
[ "MIT" ]
permissive
geovaneshimizu/whatstune
28660b64f66397830a9850fd4f078378c8384323
ba16cf32f495501c6e75ba6742e4d7ec23a1d05b
refs/heads/master
2020-04-10T05:39:11.432983
2018-12-07T20:57:02
2018-12-07T20:57:02
160,833,792
0
0
null
null
null
null
UTF-8
Java
false
false
1,378
java
package io.geovaneshimizu.whatstune.weather; import java.time.Instant; import java.util.Objects; import java.util.function.Predicate; public class Weather { private final Temperature temperature; private final Instant when; private Weather(Temperature temperature, Instant timestamp) { Objects.requireNonNull(temperature, "Temperature must not be null"); Objects.requireNonNull(timestamp, "Timestamp must not be null"); this.temperature = temperature; this.when = timestamp; } static Weather now(Temperature temperature) { return new Weather(temperature, Instant.now()); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Objects.equals(temperature, weather.temperature) && Objects.equals(when, weather.when); } @Override public int hashCode() { return Objects.hash(temperature, when); } @Override public String toString() { return "Weather{" + "temperature=" + temperature + ", when=" + when + '}'; } boolean isTemperature(Predicate<Temperature> condition) { return condition.test(temperature); } }
9e83e008e43672cb0cc8f5418257cab611c71fe9
518a773e4cb287668a70e66f71127d671e2a4e70
/core/src/koda/poa/Player.java
5506d88d8b739014b649a6a3cf43f9add052c797
[]
no_license
smahbod2014/PlanOfAttack
ac4e451af73eaf43ced25021c7cd8a1b96f98700
9dcc4d8f49d5b62a68ef901e1aba7852d422afb0
refs/heads/master
2016-09-05T21:08:14.058465
2015-01-24T05:49:48
2015-01-24T05:49:48
29,763,819
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package koda.poa; import java.util.ArrayList; public class Player { public static final int FOOD_GAIN = 3; public static final int GOLD_GAIN = 4; public static final int IRON_GAIN = 3; private boolean isEnemy; private ArrayList<City> cities; private int food; private int gold; private int iron; public int id; public Player(boolean enemy, int id) { isEnemy = enemy; cities = new ArrayList<City>(); this.id = id; } @SuppressWarnings("incomplete-switch") public void step() { for (City c : cities) { switch (c.resource) { case FOOD: food += c.getResources(FOOD_GAIN); break; case GOLD: gold += c.getResources(GOLD_GAIN); break; case IRON: iron += c.getResources(IRON_GAIN); break; } } } }
9da578c25a2c908b3a1e08db4b47e709a6d55be2
9e83e13f57f4d91fae222bc4aecf90126414645f
/src/main/java/stockholm/bicycles/RUCYProductionRunner/ModifyNetwork.java
7e422d367a0461824ed2d0589b30863455c22afd
[]
no_license
gunnarfloetteroed/scenarios
4a0fe7fd647e9560efd43c10bbd232002160593b
e9ced6032ef03118ee4b8aafaba0bd7500219a13
refs/heads/master
2023-07-02T09:55:30.505963
2021-08-09T14:19:16
2021-08-09T14:19:16
286,466,518
0
1
null
null
null
null
UTF-8
Java
false
false
2,565
java
package stockholm.bicycles.RUCYProductionRunner; import java.io.IOException; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.network.NetworkWriter; import org.matsim.api.core.v01.network.Node; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; import com.opencsv.exceptions.CsvException; public class ModifyNetwork { public static void main(String[] args) throws IOException, CsvException { // TODO Auto-generated method stub // final String inputPath = "./ihop2/network-input/"; String inputNetworkFileName="C:/Users/ChengxiL/VTI/RUCY TrV ansökan - General/Data/Network/MatsimNetwork/network_NVDB.xml"; // load network Config config = ConfigUtils.createConfig(); Scenario scenario = ScenarioUtils.createScenario(config); (new MatsimNetworkReader(scenario.getNetwork())).readFile(inputNetworkFileName); Network network = scenario.getNetwork(); // // need to add one link that is missing in the network. // Node fromNode = network.getNodes().get(Id.create("89135", Node.class)); // Node toNode=network.getNodes().get(Id.create("89344", Node.class)); // final Link matsimABLink = network.getFactory().createLink(Id.create("223932_AB", Link.class),fromNode, toNode); // matsimABLink.setLength(240.0); // matsimABLink.setFreespeed(17/3.6); // matsimABLink.getAttributes().putAttribute("generalizedCost",240.0); // final Link matsimBALink = network.getFactory().createLink(Id.create("223932_BA", Link.class), toNode,fromNode); // matsimBALink.setLength(240.0); // matsimBALink.setFreespeed(17/3.6); // matsimBALink.getAttributes().putAttribute("generalizedCost",240.0); // network.addLink(matsimABLink); // network.addLink(matsimBALink); Link link223932_AB = network.getLinks().get(Id.create("223932_AB", Link.class)); link223932_AB.setLength(240.0); link223932_AB.getAttributes().putAttribute("generalizedCost",240.0); Link link223932_BA = network.getLinks().get(Id.create("223932_BA", Link.class)); link223932_BA.setLength(240.0); link223932_BA.getAttributes().putAttribute("generalizedCost",240.0); // already overwite the existing network, doing do it again!!!! NetworkWriter plainNetworkWriter = new NetworkWriter(network); plainNetworkWriter.write(inputNetworkFileName); } }
3f5b2d531fa2690b488d6916cea5d8d01341a03b
d939455f557cd9eda2619fd812025d8e19b083e3
/Java/src/com/longluo/leetcode/array/Problem804_uniqueMorseCodeWords.java
4938b4526c95737c2dee49fc1697ef30372690d1
[ "MIT" ]
permissive
longluo/leetcode
61d445bd4fbae13b99ea24e9ef465bb700022866
5a171f223c03cfdddb18488fd4bc5910039e21c4
refs/heads/master
2023-08-17T05:03:25.433075
2023-07-30T04:01:16
2023-07-30T04:01:16
58,620,185
58
20
MIT
2023-05-25T19:00:48
2016-05-12T07:52:04
Java
UTF-8
Java
false
false
2,452
java
package com.longluo.leetcode.array; import java.util.HashSet; import java.util.Set; /** * 804. 唯一摩尔斯密码词 * <p> * 国际摩尔斯密码定义一种标准编码方式,将每个字母对应于一个由一系列点和短线组成的字符串, 比如: * <p> * 'a' 对应 ".-" , * 'b' 对应 "-..." , * 'c' 对应 "-.-." ,以此类推。 * 为了方便,所有 26 个英文字母的摩尔斯密码表如下: * <p> * [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."] * 给你一个字符串数组 words ,每个单词可以写成每个字母对应摩尔斯密码的组合。 * <p> * 例如,"cab" 可以写成 "-.-..--..." ,(即 "-.-." + ".-" + "-..." 字符串的结合)。我们将这样一个连接过程称作 单词翻译 。 * 对 words 中所有单词进行单词翻译,返回不同 单词翻译 的数量。 * <p> * 示例 1: * 输入: words = ["gin", "zen", "gig", "msg"] * 输出: 2 * 解释: * 各单词翻译如下: * "gin" -> "--...-." * "zen" -> "--...-." * "gig" -> "--...--." * "msg" -> "--...--." * <p> * 共有 2 种不同翻译, "--...-." 和 "--...--.". * <p> * 示例 2: * 输入:words = ["a"] * 输出:1 * <p> * 提示: * 1 <= words.length <= 100 * 1 <= words[i].length <= 12 * words[i] 由小写英文字母组成 * <p> * https://leetcode.com/problems/unique-morse-code-words/ */ public class Problem804_uniqueMorseCodeWords { // HashSet time: O(S) space: O(S) public static int uniqueMorseRepresentations(String[] words) { if (words == null || words.length <= 1) { return words.length; } String[] morseCodes = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."}; Set<String> repSet = new HashSet<>(); for (String word : words) { StringBuilder sb = new StringBuilder(); for (char ch : word.toCharArray()) { sb.append(morseCodes[ch - 'a']); } repSet.add(sb.toString()); } return repSet.size(); } public static void main(String[] args) { System.out.println("2 ?= " + uniqueMorseRepresentations(new String[]{"gin", "zen", "gig", "msg"})); } }
e0c61612502cf934182c87691f694d70c6777356
0a0907404f03aba6f9c352d4ffc07d1f090b009d
/2AndroidApps/Tasker/app/src/main/java/com/a2zkaj/app/WorkLocationEditSearch.java
a674e5fd985ce557d22238cfa3a7f8d9c2645b63
[]
no_license
konstatinblagok/react-native-OnDemand-app
6797a809c83bc1092cffaa9d43e26c7b41582537
79549b3a57c81d0e0365e2897353e9c0d10e7012
refs/heads/main
2023-04-02T10:07:18.623624
2021-04-18T07:55:29
2021-04-18T07:55:29
359,004,670
0
0
null
null
null
null
UTF-8
Java
false
false
20,550
java
package com.a2zkaj.app; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.EditText; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import com.android.volley.Request; import com.a2zkaj.Utils.ConnectionDetector; import com.a2zkaj.adapter.PlaceSearchAdapter; import com.a2zkaj.hockeyapp.ActionBarActivityHockeyApp; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import core.Dialog.PkDialog; import core.Volley.ServiceRequest; import core.service.ServiceConstant; /** * Created by CAS61 on 1/11/2017. */ public class WorkLocationEditSearch extends ActionBarActivityHockeyApp { private RelativeLayout back; private EditText et_search; private ListView listview; private RelativeLayout alert_layout; private TextView alert_textview; private TextView tv_emptyText; private ProgressBar progresswheel; private Boolean isInternetPresent = false; private ConnectionDetector cd; private ServiceRequest mRequest; Context context; ArrayList<String> itemList_location = new ArrayList<String>(); ArrayList<String> itemList_placeId = new ArrayList<String>(); private PlaceSearchAdapter adapter; private boolean isdataAvailable = false; private boolean isEstimateAvailable = false; private String Slatitude = "", Slongitude = "", Sselected_location = ""; Dialog dialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.place_search); context = getApplicationContext(); initialize(); listview.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Sselected_location = itemList_location.get(position); cd = new ConnectionDetector(WorkLocationEditSearch.this); isInternetPresent = cd.isConnectingToInternet(); if (isInternetPresent) { LatLongRequest(ServiceConstant.GetAddressFrom_LatLong_url + itemList_placeId.get(position)); } else { alert_layout.setVisibility(View.VISIBLE); alert_textview.setText(getResources().getString(R.string.alert_nointernet)); } } }); et_search.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { cd = new ConnectionDetector(WorkLocationEditSearch.this); isInternetPresent = cd.isConnectingToInternet(); if (isInternetPresent) { if (mRequest != null) { mRequest.cancelRequest(); } String data = et_search.getText().toString().toLowerCase().replace(" ", "%20"); CitySearchRequest(ServiceConstant.place_search_url + data); } else { alert_layout.setVisibility(View.VISIBLE); alert_textview.setText(getResources().getString(R.string.alert_nointernet)); } } }); et_search.setOnEditorActionListener(new TextView.OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { CloseKeyboard(et_search); } return false; } }); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // close keyboard InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.hideSoftInputFromWindow(back.getWindowToken(), 0); WorkLocationEditSearch.this.finish(); WorkLocationEditSearch.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } }); et_search.postDelayed(new Runnable() { @Override public void run() { InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); keyboard.showSoftInput(et_search, 0); } }, 200); } private void initialize() { alert_layout = (RelativeLayout) findViewById(R.id.location_search_alert_layout); alert_textview = (TextView) findViewById(R.id.location_search_alert_textView); back = (RelativeLayout) findViewById(R.id.location_search_back_layout); et_search = (EditText) findViewById(R.id.location_search_editText); listview = (ListView) findViewById(R.id.location_search_listView); progresswheel = (ProgressBar) findViewById(R.id.location_search_progressBar); tv_emptyText = (TextView) findViewById(R.id.location_search_empty_textview); } private void CloseKeyboard(EditText edittext) { InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(edittext.getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } //--------------Alert Method----------- private void Alert(String title, String alert) { final PkDialog mDialog = new PkDialog(WorkLocationEditSearch.this); mDialog.setDialogTitle(title); mDialog.setDialogMessage(alert); mDialog.setPositiveButton(getResources().getString(R.string.action_ok), new View.OnClickListener() { @Override public void onClick(View v) { mDialog.dismiss(); } }); mDialog.show(); } //-------------------Search Place Request---------------- private void CitySearchRequest(String Url) { progresswheel.setVisibility(View.VISIBLE); System.out.println("--------------Search city url-------------------" + Url); mRequest = new ServiceRequest(WorkLocationEditSearch.this); mRequest.makeServiceRequest(Url, Request.Method.GET, null, new ServiceRequest.ServiceListener() { @Override public void onCompleteListener(String response) { System.out.println("--------------Search city reponse-------------------" + response); String status = ""; try { JSONObject object = new JSONObject(response); if (object.length() > 0) { status = object.getString("status"); JSONArray place_array = object.getJSONArray("predictions"); if (status.equalsIgnoreCase("OK")) { if (place_array.length() > 0) { itemList_location.clear(); itemList_placeId.clear(); for (int i = 0; i < place_array.length(); i++) { JSONObject place_object = place_array.getJSONObject(i); itemList_location.add(place_object.getString("description")); itemList_placeId.add(place_object.getString("place_id")); } isdataAvailable = true; } else { itemList_location.clear(); itemList_placeId.clear(); isdataAvailable = false; } } else { itemList_location.clear(); itemList_placeId.clear(); isdataAvailable = false; } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } progresswheel.setVisibility(View.INVISIBLE); alert_layout.setVisibility(View.GONE); if (isdataAvailable) { tv_emptyText.setVisibility(View.GONE); } else { tv_emptyText.setVisibility(View.VISIBLE); } adapter = new PlaceSearchAdapter(WorkLocationEditSearch.this, itemList_location); listview.setAdapter(adapter); adapter.notifyDataSetChanged(); } @Override public void onErrorListener() { progresswheel.setVisibility(View.INVISIBLE); alert_layout.setVisibility(View.GONE); // close keyboard CloseKeyboard(et_search); } }); } //-------------------Get Latitude and Longitude from Address(Place ID) Request---------------- /* private void LatLongRequest(String Url) { dialog = new Dialog(LocationSearch.this); dialog.getWindow(); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.custom_loading); dialog.setCanceledOnTouchOutside(false); dialog.show(); TextView dialog_title = (TextView) dialog.findViewById(R.id.custom_loading_textview); dialog_title.setText(getResources().getString(R.string.action_processing)); System.out.println("--------------LatLong url-------------------" + Url); mRequest = new ServiceRequest(LocationSearch.this); mRequest.makeServiceRequest(Url, Request.Method.GET, null, new ServiceRequest.ServiceListener() { @Override public void onCompleteListener(String response) { System.out.println("--------------LatLong reponse-------------------" + response); String status = ""; try { JSONObject object = new JSONObject(response); if (object.length() > 0) { status = object.getString("status"); JSONObject place_object = object.getJSONObject("result"); if (status.equalsIgnoreCase("OK")) { if (place_object.length() > 0) { JSONObject geometry_object = place_object.getJSONObject("geometry"); if (geometry_object.length() > 0) { JSONObject location_object = geometry_object.getJSONObject("location"); if (location_object.length() > 0) { Slatitude = location_object.getString("lat"); Slongitude = location_object.getString("lng"); isdataAvailable = true; } else { isdataAvailable = false; } } else { isdataAvailable = false; } } else { isdataAvailable = false; } } else { isdataAvailable = false; } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (isdataAvailable) { Intent returnIntent = new Intent(); returnIntent.putExtra("Selected_Latitude", Slatitude); returnIntent.putExtra("Selected_Longitude", Slongitude); returnIntent.putExtra("Selected_Location", Sselected_location); setResult(RESULT_OK, returnIntent); onBackPressed(); overridePendingTransition(R.anim.slideup, R.anim.slidedown); finish(); } else { dialog.dismiss(); Alert(getResources().getString(R.string.server_lable_header), status); } } @Override public void onErrorListener() { dialog.dismiss(); } }); } */ //-------------------Get Latitude and Longitude from Address(Place ID) Request---------------- private void LatLongRequest(String Url) { dialog = new Dialog(WorkLocationEditSearch.this); dialog.getWindow(); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.custom_loading); dialog.setCanceledOnTouchOutside(false); dialog.show(); TextView dialog_title = (TextView) dialog.findViewById(R.id.custom_loading_textview); dialog_title.setText(getResources().getString(R.string.action_processing)); System.out.println("--------------LatLong url-------------------" + Url); mRequest = new ServiceRequest(WorkLocationEditSearch.this); mRequest.makeServiceRequest(Url, Request.Method.GET, null, new ServiceRequest.ServiceListener() { @Override public void onCompleteListener(String response) { System.out.println("--------------LatLong reponse-------------------" + response); String status = "", sArea = "", sLocality = "", sCity_Admin1 = "", sCity_Admin2 = "", sPostalCode = "",aFormattedAddress=""; try { JSONObject object = new JSONObject(response); if (object.length() > 0) { status = object.getString("status"); JSONObject place_object = object.getJSONObject("result"); if (status.equalsIgnoreCase("OK")) { if (place_object.length() > 0) { sArea = place_object.getString("name"); aFormattedAddress= place_object.getString("formatted_address"); JSONArray addressArray = place_object.getJSONArray("address_components"); if (addressArray.length() > 0) { for (int i = 0; i < addressArray.length(); i++) { JSONObject address_object = addressArray.getJSONObject(i); JSONArray typesArray = address_object.getJSONArray("types"); if (typesArray.length() > 0) { for (int j = 0; j < typesArray.length(); j++) { if (typesArray.get(j).toString().equalsIgnoreCase("locality")) { sLocality = address_object.getString("long_name"); } else if (typesArray.get(j).toString().equalsIgnoreCase("administrative_area_level_2")) { // sCity_Admin2 = address_object.getString("long_name") ; sCity_Admin2 = address_object.getString("long_name") + ","; } else if (typesArray.get(j).toString().equalsIgnoreCase("administrative_area_level_1")) { sCity_Admin1 = address_object.getString("long_name"); } else if (typesArray.get(j).toString().equalsIgnoreCase("postal_code")) { sPostalCode = address_object.getString("long_name"); } } isdataAvailable = true; } else { isdataAvailable = false; } } } else { isdataAvailable = false; } JSONObject geometry_object = place_object.getJSONObject("geometry"); if (geometry_object.length() > 0) { JSONObject location_object = geometry_object.getJSONObject("location"); if (location_object.length() > 0) { Slatitude = location_object.getString("lat"); Slongitude = location_object.getString("lng"); isdataAvailable = true; } else { isdataAvailable = false; } } else { isdataAvailable = false; } } else { isdataAvailable = false; } } else { isdataAvailable = false; } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (isdataAvailable) { Intent returnIntent = new Intent(); returnIntent.putExtra("Selected_Latitude", Slatitude); returnIntent.putExtra("Selected_Longitude", Slongitude); returnIntent.putExtra("Selected_Location", Sselected_location); returnIntent.putExtra("HouseNo", sArea); returnIntent.putExtra("City", sCity_Admin2); returnIntent.putExtra("State", sCity_Admin1); returnIntent.putExtra("ZipCode", sPostalCode); returnIntent.putExtra("Location", sLocality); returnIntent.putExtra("formattedaddress", aFormattedAddress); setResult(RESULT_OK, returnIntent); onBackPressed(); finish(); } else { dialog.dismiss(); Alert(getResources().getString(R.string.server_lable_header), status); } } @Override public void onErrorListener() { dialog.dismiss(); } }); } @Override protected void onDestroy() { super.onDestroy(); if (dialog != null) { dialog.dismiss(); dialog = null; } } //-----------------Move Back on pressed phone back button------------------ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)) { // close keyboard InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.hideSoftInputFromWindow(back.getWindowToken(), 0); WorkLocationEditSearch.this.finish(); WorkLocationEditSearch.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); return true; } return false; } }
ffa92433765245005f23534a8c5ab1b97ebbedf7
279dd757e52b95988eed339d0f9491dbfac75d4f
/app/src/main/java/emobadara/ensias/com/memorygame/Screens/DailyLife2.java
9d68a6974763ccacde0663dea89e69d8bcdf2ebd
[]
no_license
Astroth1984/Android-Game
f44d3725640ec9058621080e126bd62901ab20dd
b2cdf417ca96cf3e52f1c557554927d362752f2d
refs/heads/master
2020-08-29T21:44:17.448803
2019-10-29T02:12:42
2019-10-29T02:12:42
218,180,996
1
0
null
null
null
null
UTF-8
Java
false
false
6,391
java
package emobadara.ensias.com.memorygame.Screens; import com.example.emobadaragaminglib.Base.Game; import com.example.emobadaragaminglib.Base.Screen; import com.example.emobadaragaminglib.Components.ButtonUI; import com.example.emobadaragaminglib.Components.Sprite; import emobadara.ensias.com.memorygame.Assets.Assets; import emobadara.ensias.com.memorygame.Sprites.Event; import emobadara.ensias.com.memorygame.Sprites.EventContainer; import emobadara.ensias.com.memorygame.States.GameActivity; import static emobadara.ensias.com.memorygame.Assets.Assets.background; import static emobadara.ensias.com.memorygame.Assets.Assets.btnNext; import static emobadara.ensias.com.memorygame.Assets.Assets.btnBack; import static emobadara.ensias.com.memorygame.Assets.Assets.imageButton; //import static emobadara.ensias.com.memorygame.Assets.Assets.imageButton2; import static emobadara.ensias.com.memorygame.Assets.DailyRoutine2Assets.classes; import static emobadara.ensias.com.memorygame.Assets.DailyRoutine2Assets.gotoschool; import static emobadara.ensias.com.memorygame.Assets.DailyRoutine2Assets.dressed; public class DailyLife2 extends Screen { private final EventContainer daily1,daily2,daily3; int h= game.getGraphics().getHeight()/4; int w= game.getGraphics().getHeight()/4; int hx= game.getGraphics().getHeight()/8; int hy= game.getGraphics().getWidth()/8; ButtonUI btn , btn_next, btn_back; private ButtonUI btn_next2,btn_play,btn_next3; private ButtonUI btn_back2 ,btn_back3; private ButtonUI btn2,btn3; public DailyLife2(Game game) { super(game); addSprite(new Sprite(background,0,0,game.getGraphics().getHeight(),game.getGraphics().getWidth())); daily1= new EventContainer(dressed,hx,hx/6,game.getGraphics().getHeight()-h,game.getGraphics().getWidth()-2*hx,2,true); addSprite(daily1); daily2= new EventContainer(gotoschool,hx,hx/6,game.getGraphics().getHeight()-h,game.getGraphics().getWidth()-2*hx,3,true); daily3= new EventContainer(classes,hx,hx/6,game.getGraphics().getHeight()-h,game.getGraphics().getWidth()-2*hx,4,true); btn_next = new ButtonUI(btnNext,imageButton,game.getGraphics().getWidth()/2 +h+h/2,game.getGraphics().getHeight()-h,h,w); btn_next2 = new ButtonUI(btnNext,imageButton,game.getGraphics().getWidth()/2 +h+h/2,game.getGraphics().getHeight()-h,h,w); btn_next3 = new ButtonUI(btnNext,imageButton,game.getGraphics().getWidth()/2 +h+h/2,game.getGraphics().getHeight()-h,h,w); btn_back = new ButtonUI(btnBack,imageButton,game.getGraphics().getWidth()/2 -h/2-2*h,game.getGraphics().getHeight()-h,h,w); btn_back2 = new ButtonUI(btnBack,imageButton,game.getGraphics().getWidth()/2 -h/2-2*h,game.getGraphics().getHeight()-h,h,w); btn_back3 = new ButtonUI(btnBack,imageButton,game.getGraphics().getWidth()/2 -h/2-2*h,game.getGraphics().getHeight()-h,h,w); btn_play= new ButtonUI(btnNext,imageButton,game.getGraphics().getWidth()-2*hx,2*game.getGraphics().getHeight()/2,h,w); addSprite(btn_next); addSprite(btn_back3); btn = new ButtonUI(imageButton,imageButton,game.getGraphics().getWidth()/2-h/2,game.getGraphics().getHeight()-h,h,w); btn3 = new ButtonUI(imageButton,imageButton,game.getGraphics().getWidth()/2-h/2,game.getGraphics().getHeight()-h,h,w); btn2 = new ButtonUI(imageButton,imageButton,game.getGraphics().getWidth()/2-h/2,game.getGraphics().getHeight()-h,h,w); addSprite(btn); } @Override public void render(float deltaTime) { } @Override public void pause() { } @Override public void resume() { } @Override public void backButton() { } @Override public void handleTouchDown(int x, int y, int pointer) { super.handleTouchDown(x, y, pointer); } @Override public void handleTouchUp(int x, int y, int pointer) { super.handleTouchUp(x, y, pointer); if (btn.onTouchUp(x,y)){ GameActivity.daily2audio1.start(); }else if (btn2.onTouchUp(x,y)) { GameActivity.daily2audio2.start(); }else if (btn3.onTouchUp(x,y)) { GameActivity.daily2audio3.start(); } if(btn_back3.onTouchUp(x,y)) { GameActivity.daily2audio1.pause(); addSprite(daily3); btn_next.setHeight(0); btn_back.setHeight(0); btn_back3.setHeight(0); btn.setHeight(0); btn2.setHeight(h); btn_back2.setHeight(h); addSprite(btn_next3); addSprite(btn_back2); addSprite(btn2); }else if (btn_next.onTouchUp(x,y)) { GameActivity.daily2audio1.pause(); addSprite(daily2); btn_next.setHeight(0); btn.setHeight(0); btn2.setHeight(h); addSprite(btn_next2); addSprite(btn_back); addSprite(btn2); }else if(btn_back.onTouchUp(x,y)) { GameActivity.daily2audio2.pause(); addSprite(daily1); btn2.setHeight(0); btn_next.setHeight(h); btn_back3.setHeight(h); btn.setHeight(h); addSprite(btn_next); addSprite(btn_back3); addSprite(btn); }else if(btn_next2.onTouchUp(x,y)) { GameActivity.daily2audio2.pause(); addSprite(daily3); btn_next2.setHeight(0); btn_back.setHeight(0); btn2.setHeight(0); btn3.setHeight(h); btn_back2.setHeight(h); addSprite(btn_next3); addSprite(btn_back2); addSprite(btn3); }else if (btn_back2.onTouchUp(x,y)) { GameActivity.daily2audio3.pause(); addSprite(daily2); btn_next2.setHeight(h); btn_back2.setHeight(0); btn3.setHeight(0); btn2.setHeight(h); btn_back.setHeight(h); addSprite(btn_back); addSprite(btn_next2); addSprite(btn2); }else if (btn_next3.onTouchUp(x,y)){ GameActivity.daily2audio3.pause(); game.setScreen(new ArrangeScreen2(game)); } } }
ee653bf5c37716aa6161acd10671f38c380bd065
12a10798bdec1b36016c37eea3571bab75d31b48
/dynatrace/src/main/java/de/tsystems/mms/apm/performancesignature/dynatracesaas/DynatraceSessionStepExecution.java
a7a11b3446bf74a2dd7015b1f2b29f9d81e340cc
[ "Apache-2.0" ]
permissive
jglick/performance-signature-dynatrace-plugin
0bba2f724b1ae5903115cb2892da76a4947ebd41
47fec08ca0d6c5382f9df3651fea806c4b4b405a
refs/heads/master
2020-04-16T16:11:27.376825
2019-01-04T10:00:47
2019-01-04T10:00:47
165,728,489
0
0
null
2019-01-14T20:16:56
2019-01-14T20:16:56
null
UTF-8
Java
false
false
6,365
java
/* * Copyright (c) 2014-2018 T-Systems Multimedia Solutions GmbH * * 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 de.tsystems.mms.apm.performancesignature.dynatracesaas; import de.tsystems.mms.apm.performancesignature.dynatracesaas.model.EntityId; import de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.DynatraceServerConnection; import de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.model.EventPushMessage; import de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.model.EventTypeEnum; import de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.model.PushEventAttachRules; import de.tsystems.mms.apm.performancesignature.dynatracesaas.util.DynatraceUtils; import de.tsystems.mms.apm.performancesignature.ui.util.PerfSigUIUtils; import hudson.EnvVars; import hudson.model.Run; import hudson.model.TaskListener; import org.apache.commons.collections.CollectionUtils; import org.jenkinsci.plugins.workflow.steps.BodyExecution; import org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback; import org.jenkinsci.plugins.workflow.steps.StepContext; import org.jenkinsci.plugins.workflow.steps.StepExecution; import javax.annotation.Nonnull; import java.time.Instant; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; import static de.tsystems.mms.apm.performancesignature.dynatracesaas.CreateDeploymentStepExecution.BUILD_VAR_KEY_DEPLOYMENT_PROJECT; import static de.tsystems.mms.apm.performancesignature.dynatracesaas.CreateDeploymentStepExecution.BUILD_VAR_KEY_DEPLOYMENT_VERSION; import static de.tsystems.mms.apm.performancesignature.dynatracesaas.rest.DynatraceServerConnection.BUILD_URL_ENV_PROPERTY; public class DynatraceSessionStepExecution extends StepExecution { private static final long serialVersionUID = 1L; private static final Logger LOGGER = Logger.getLogger(DynatraceSessionStep.class.getName()); private final transient DynatraceSessionStep step; private final transient Run<?, ?> run; private final transient DynatraceEnvInvisAction action; private BodyExecution body; public DynatraceSessionStepExecution(DynatraceSessionStep step, StepContext context) throws Exception { super(context); this.step = step; this.run = context.get(Run.class); this.action = new DynatraceEnvInvisAction(step.getTestCase(), Instant.now().toEpochMilli()); } @Override public boolean start() { StepContext context = getContext(); println("getting build details ..."); run.addAction(action); if (context.hasBody()) { body = context.newBodyInvoker() .withCallback(new Callback()) .start(); } return false; } @Override public void stop(@Nonnull Throwable cause) { println("stopping session recording ..."); action.setTimeframeStop(System.currentTimeMillis()); if (body != null) { body.cancel(cause); } } private void println(String message) { TaskListener listener = DynatraceUtils.getTaskListener(getContext()); if (listener == null) { LOGGER.log(Level.FINE, "failed to print message {0} due to null TaskListener", message); } else { PerfSigUIUtils.createLogger(listener.getLogger()).log(message); } } private class Callback extends BodyExecutionCallback.TailCall { private static final long serialVersionUID = 1L; @Override protected void finished(StepContext context) throws Exception { EnvVars envVars = getContext().get(EnvVars.class); println("stopping session recording ..."); action.setTimeframeStop(System.currentTimeMillis()); if (CollectionUtils.isNotEmpty(step.getEntityIds()) || CollectionUtils.isNotEmpty(step.getTagMatchRules())) { DynatraceServerConnection serverConnection = DynatraceUtils.createDynatraceServerConnection(step.getEnvId(), true); PushEventAttachRules attachRules = new PushEventAttachRules(); if (CollectionUtils.isNotEmpty(step.getEntityIds())) attachRules.setEntityIds(step.getEntityIds().stream().map(EntityId::getEntityId).collect(Collectors.toList())); attachRules.setTagRule(step.getTagMatchRules()); println("creating Performance Signature custom event"); EventPushMessage event = new EventPushMessage(EventTypeEnum.CUSTOM_INFO, attachRules) .setSource("Jenkins") .setTitle("Performance Signature was executed") .setStartTime(action.getTimeframeStart()) .setEndTime(action.getTimeframeStop()); if (envVars != null) { event.setDescription("Performance Signature was executed in a Jenkins Pipeline") .addCustomProperties("Jenkins Build Number", envVars.get("BUILD_ID")) .addCustomProperties("Git Commit", envVars.get("GIT_COMMIT")) .addCustomProperties("Deployment Version", envVars.get(BUILD_VAR_KEY_DEPLOYMENT_VERSION)) .addCustomProperties("Deployment Project", envVars.get(BUILD_VAR_KEY_DEPLOYMENT_PROJECT)) .addCustomProperties("Deployment Name", envVars.get("JOB_NAME")) .addCustomProperties("CiBackLink", envVars.get(BUILD_URL_ENV_PROPERTY)); } serverConnection.createEvent(event); println("created Performance Signature event"); } else { println("skipped creating Performance Signature event"); } } } }
cac53fdadc26b1d68152e9f9e0c028856a0d5e3b
208ba847cec642cdf7b77cff26bdc4f30a97e795
/aj/ae/src/androidTest/java/org.wp.ae/models/PostTest.java
3833d5b6ef4fb59dad228651162125295332c817
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
1,784
java
package org.wp.ae.models; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.test.InstrumentationTestCase; import android.test.RenamingDelegatingContext; import org.json.JSONObject; import org.wp.ae.TestUtils; import org.wp.ae.WordPress; public class PostTest extends InstrumentationTestCase { protected Context mTestContext; protected Context mTargetContext; @Override protected void setUp() throws Exception { mTargetContext = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_"); mTestContext = getInstrumentation().getContext(); super.setUp(); } public void testInvalidPostIdLoad() { SQLiteDatabase db = TestUtils.loadDBFromDump(mTargetContext, mTestContext, "taliwutt-blogs-sample.sql"); Post post = WordPress.wpDB.getPostForLocalTablePostId(-1); assertNull(post); } public void testPostSaveAndLoad() { SQLiteDatabase db = TestUtils.loadDBFromDump(mTargetContext, mTestContext, "taliwutt-blogs-sample.sql"); Post post = new Post(1, false); post.setTitle("test-post"); WordPress.wpDB.savePost(post); Post loadedPost = WordPress.wpDB.getPostForLocalTablePostId(post.getLocalTablePostId()); assertNotNull(loadedPost); assertEquals(loadedPost.getTitle(), post.getTitle()); } // reproduce issue #1544 public void testGetNullCustomFields() { Post post = new Post(1, false); assertEquals(post.getCustomFields(), null); } public void testGetNullCustomField() { Post post = new Post(1, false); JSONObject remoteGeoLatitude = post.getCustomField("geo_latitude"); assertEquals(remoteGeoLatitude, null); } }
d11487664f8646cade3ba1c89910e0bc894327e0
cda3816a44e212b52fdf1b9578e66a4543445cbb
/trunk/Src/l2next/gameserver/instancemanager/itemauction/ItemAuctionInstance.java
8c0b4be82e36f3fdb9e1e0917344d0fc8f432af8
[]
no_license
gryphonjp/L2J
556d8b1f24971782f98e1f65a2e1c2665a853cdb
003ec0ed837ec19ae7f7cf0e8377e262bf2d6fe4
refs/heads/master
2020-05-18T09:51:07.102390
2014-09-16T14:25:06
2014-09-16T14:25:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,432
java
package l2next.gameserver.instancemanager.itemauction; import gnu.trove.map.hash.TIntObjectHashMap; import l2next.commons.dao.JdbcEntityState; import l2next.commons.dbutils.DbUtils; import l2next.commons.threading.RunnableImpl; import l2next.commons.time.cron.SchedulingPattern; import l2next.commons.util.Rnd; import l2next.gameserver.Announcements; import l2next.gameserver.Config; import l2next.gameserver.ThreadPoolManager; import l2next.gameserver.cache.Msg; import l2next.gameserver.database.DatabaseFactory; import l2next.gameserver.model.Player; import l2next.gameserver.model.items.ItemInstance; import l2next.gameserver.model.items.ItemInstance.ItemLocation; import l2next.gameserver.network.serverpackets.SystemMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; public class ItemAuctionInstance { private static final Logger _log = LoggerFactory.getLogger(ItemAuctionInstance.class); private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); private static final long START_TIME_SPACE = TimeUnit.MILLISECONDS.convert(1, TimeUnit.MINUTES); private static final long FINISH_TIME_SPACE = TimeUnit.MILLISECONDS.convert(10, TimeUnit.MINUTES); private final int _instanceId; private final TIntObjectHashMap<ItemAuction> _auctions; private final List<AuctionItem> _items; private final SchedulingPattern _dateTime; private ItemAuction _currentAuction; private ItemAuction _nextAuction; private ScheduledFuture<?> _stateTask; ItemAuctionInstance(int instanceId, SchedulingPattern dateTime, List<AuctionItem> items) throws Exception { _instanceId = instanceId; _auctions = new TIntObjectHashMap<ItemAuction>(); _items = items; _dateTime = dateTime; load(); _log.info("ItemAuction: Loaded " + _items.size() + " item(s) and registered " + _auctions.size() + " auction(s) for instance " + _instanceId + "."); checkAndSetCurrentAndNextAuction(); } private void load() { Connection con = null; PreparedStatement statement = null; ResultSet rset = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT auctionId FROM item_auction WHERE instanceId=?"); statement.setInt(1, _instanceId); rset = statement.executeQuery(); while(rset.next()) { int auctionId = rset.getInt(1); try { ItemAuction auction = loadAuction(auctionId); if(auction != null) { _auctions.put(auctionId, auction); } else { ItemAuctionManager.getInstance().deleteAuction(auctionId); } } catch(SQLException e) { _log.warn("ItemAuction: Failed loading auction: " + auctionId, e); } } } catch(SQLException e) { _log.error("ItemAuction: Failed loading auctions.", e); return; } finally { DbUtils.closeQuietly(con, statement, rset); } } public ItemAuction getCurrentAuction() { return _currentAuction; } public ItemAuction getNextAuction() { return _nextAuction; } public void shutdown() { ScheduledFuture<?> stateTask = _stateTask; if(stateTask != null) { stateTask.cancel(false); } } private AuctionItem getAuctionItem(int auctionItemId) { for(int i = _items.size(); i-- > 0; ) { try { AuctionItem item = _items.get(i); if(item.getAuctionItemId() == auctionItemId) { return item; } } catch(IndexOutOfBoundsException e) { } } return null; } void checkAndSetCurrentAndNextAuction() { ItemAuction[] auctions = _auctions.values(new ItemAuction[_auctions.size()]); ItemAuction currentAuction = null; ItemAuction nextAuction = null; switch(auctions.length) { case 0: { nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE); break; } case 1: { switch(auctions[0].getAuctionState()) { case CREATED: { if(auctions[0].getStartingTime() < System.currentTimeMillis() + START_TIME_SPACE) { currentAuction = auctions[0]; nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE); } else { nextAuction = auctions[0]; } break; } case STARTED: { currentAuction = auctions[0]; nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE)); break; } case FINISHED: { currentAuction = auctions[0]; nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE); break; } default: throw new IllegalArgumentException(); } break; } default: { Arrays.sort(auctions, new Comparator<ItemAuction>() { @Override public int compare(ItemAuction o1, ItemAuction o2) { if(o2.getStartingTime() > o1.getStartingTime()) { return 1; } if(o2.getStartingTime() < o1.getStartingTime()) { return -1; } return 0; } }); // just to make sure we won`t skip any auction because of little // different times long currentTime = System.currentTimeMillis(); for(int i = 0; i < auctions.length; i++) { ItemAuction auction = auctions[i]; if(auction.getAuctionState() == ItemAuctionState.STARTED) { currentAuction = auction; break; } else if(auction.getStartingTime() <= currentTime) { currentAuction = auction; break; } } for(int i = 0; i < auctions.length; i++) { ItemAuction auction = auctions[i]; if(auction.getStartingTime() > currentTime && currentAuction != auction) { nextAuction = auction; break; } } if(nextAuction == null) { nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE); } break; } } _auctions.put(nextAuction.getAuctionId(), nextAuction); _currentAuction = currentAuction; _nextAuction = nextAuction; if(currentAuction != null && currentAuction.getAuctionState() == ItemAuctionState.STARTED) { setStateTask(ThreadPoolManager.getInstance().schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0L))); _log.info("ItemAuction: Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId); } else { setStateTask(ThreadPoolManager.getInstance().schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0L))); _log.info("ItemAuction: Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId); } } public ItemAuction getAuction(int auctionId) { return _auctions.get(auctionId); } public ItemAuction[] getAuctionsByBidder(int bidderObjId) { ItemAuction[] auctions = getAuctions(); List<ItemAuction> stack = new ArrayList<ItemAuction>(auctions.length); for(ItemAuction auction : getAuctions()) { if(auction.getAuctionState() != ItemAuctionState.CREATED) { ItemAuctionBid bid = auction.getBidFor(bidderObjId); if(bid != null) { stack.add(auction); } } } return stack.toArray(new ItemAuction[stack.size()]); } public ItemAuction[] getAuctions() { synchronized(_auctions) { return _auctions.values(new ItemAuction[_auctions.size()]); } } private class ScheduleAuctionTask extends RunnableImpl { private ItemAuction _auction; public ScheduleAuctionTask(ItemAuction auction) { _auction = auction; } @Override public void runImpl() throws Exception { ItemAuctionState state = _auction.getAuctionState(); switch(state) { case CREATED: { if(!_auction.setAuctionState(state, ItemAuctionState.STARTED)) { throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.STARTED.toString() + ", expected: " + state.toString()); } _log.info("ItemAuction: Auction " + _auction.getAuctionId() + " has started for instance " + _auction.getInstanceId()); if(Config.ALT_ITEM_AUCTION_START_ANNOUNCE) { String[] params = {}; Announcements.getInstance().announceByCustomMessage("l2next.gameserver.model.instances.L2ItemAuctionBrokerInstance.announce." + _auction.getInstanceId(), params); } checkAndSetCurrentAndNextAuction(); break; } case STARTED: { switch(_auction.getAuctionEndingExtendState()) { case 1: { if(_auction.getScheduledAuctionEndingExtendState() == 0) { _auction.setScheduledAuctionEndingExtendState(1); setStateTask(ThreadPoolManager.getInstance().schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L))); return; } break; } case 2: { if(_auction.getScheduledAuctionEndingExtendState() != 2) { _auction.setScheduledAuctionEndingExtendState(2); setStateTask(ThreadPoolManager.getInstance().schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L))); return; } break; } } if(!_auction.setAuctionState(state, ItemAuctionState.FINISHED)) { throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.FINISHED.toString() + ", expected: " + state.toString()); } onAuctionFinished(_auction); checkAndSetCurrentAndNextAuction(); break; } default: throw new IllegalStateException("Invalid state: " + state); } } } void onAuctionFinished(ItemAuction auction) { auction.broadcastToAllBidders(new SystemMessage(SystemMessage.S1_S_AUCTION_HAS_ENDED).addNumber(auction.getAuctionId())); ItemAuctionBid bid = auction.getHighestBid(); if(bid != null) { ItemInstance item = auction.createNewItemInstance(); Player player = bid.getPlayer(); if(player != null) { player.getWarehouse().addItem(item); player.sendPacket(Msg.YOU_HAVE_BID_THE_HIGHEST_PRICE_AND_HAVE_WON_THE_ITEM_THE_ITEM_CAN_BE_FOUND_IN_YOUR_PERSONAL); _log.info("ItemAuction: Auction " + auction.getAuctionId() + " has finished. Highest bid by (name) " + player.getName() + " for instance " + _instanceId); } else { // TODO [G1ta0] отправлять почтой item.setOwnerId(bid.getCharId()); item.setLocation(ItemLocation.WAREHOUSE); item.setJdbcState(JdbcEntityState.UPDATED); item.update(); _log.info("ItemAuction: Auction " + auction.getAuctionId() + " has finished. Highest bid by (id) " + bid.getCharId() + " for instance " + _instanceId); } } else { _log.info("ItemAuction: Auction " + auction.getAuctionId() + " has finished. There have not been any bid for instance " + _instanceId); } } void setStateTask(ScheduledFuture<?> future) { ScheduledFuture<?> stateTask = _stateTask; if(stateTask != null) { stateTask.cancel(false); } _stateTask = future; } private ItemAuction createAuction(long after) { AuctionItem auctionItem = _items.get(Rnd.get(_items.size())); long startingTime = _dateTime.next(after); long endingTime = startingTime + TimeUnit.MILLISECONDS.convert(auctionItem.getAuctionLength(), TimeUnit.MINUTES); int auctionId = ItemAuctionManager.getInstance().getNextId(); ItemAuction auction = new ItemAuction(auctionId, _instanceId, startingTime, endingTime, auctionItem, ItemAuctionState.CREATED); auction.store(); return auction; } private ItemAuction loadAuction(int auctionId) throws SQLException { Connection con = null; PreparedStatement statement = null; ResultSet rset = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT auctionItemId,startingTime,endingTime,auctionStateId FROM item_auction WHERE auctionId=?"); statement.setInt(1, auctionId); rset = statement.executeQuery(); if(!rset.next()) { _log.warn("ItemAuction: Auction data not found for auction: " + auctionId); return null; } int auctionItemId = rset.getInt(1); long startingTime = rset.getLong(2); long endingTime = rset.getLong(3); int auctionStateId = rset.getInt(4); DbUtils.close(statement, rset); if(startingTime >= endingTime) { _log.warn("ItemAuction: Invalid starting/ending paramaters for auction: " + auctionId); return null; } AuctionItem auctionItem = getAuctionItem(auctionItemId); if(auctionItem == null) { _log.warn("ItemAuction: AuctionItem: " + auctionItemId + ", not found for auction: " + auctionId); return null; } ItemAuctionState auctionState = ItemAuctionState.stateForStateId(auctionStateId); if(auctionState == null) { _log.warn("ItemAuction: Invalid auctionStateId: " + auctionStateId + ", for auction: " + auctionId); return null; } ItemAuction auction = new ItemAuction(auctionId, _instanceId, startingTime, endingTime, auctionItem, auctionState); statement = con.prepareStatement("SELECT playerObjId,playerBid FROM item_auction_bid WHERE auctionId=?"); statement.setInt(1, auctionId); rset = statement.executeQuery(); while(rset.next()) { int charId = rset.getInt(1); long playerBid = rset.getLong(2); ItemAuctionBid bid = new ItemAuctionBid(charId, playerBid); auction.addBid(bid); } return auction; } finally { DbUtils.closeQuietly(con, statement, rset); } } }
[ "tuningxtreme@108c6750-40d5-47c8-815d-bc471747907c" ]
tuningxtreme@108c6750-40d5-47c8-815d-bc471747907c
9160d2a0cce5d266cb561e086c2130dc9d543058
9750a2e01b80c616fcd939f2b1a35fcbb961eced
/src/factorypractice/Robin.java
f68f2ab1e965e795826f0ef2d3703078e0375fce
[]
no_license
cgonzalez007/FactoryPractice
55c77b075690e64dbe2af80c71317d2ca11b92ec
f991649642435b3cb7f5dea3daadb56821af085c
refs/heads/master
2020-06-11T11:29:41.085284
2016-12-08T22:25:45
2016-12-08T22:25:45
75,678,361
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package factorypractice; /** * * @author jlombardo */ public class Robin implements Animal { private String name; @Override public void speak() { System.out.println("Chirp"); } public Robin(String name) { this.name = name; } @Override public String getName() { return name; } @Override public void setName(String name) { this.name = name; } }
9aa7b2caf9306ebeabbfd8b86365c2d655052dcb
5dd26c721082b1f2a5b79aea1bfe05b1ab941a62
/src/com/yumodev/airthmetic/leetcode/Leetcode_0011_container_with_most_water.java
508a8e91f05625a6fb7c2f36d6f9efdbb11537a0
[]
no_license
yumodev/ymj2se
ffe8804c26614fbafb1a5c18a8a08edd63a8f9fd
b2f3633b98a358b86021651a07d13dbaef2403d7
refs/heads/master
2022-02-22T23:10:29.069504
2022-02-10T22:19:39
2022-02-10T22:19:39
177,506,209
0
0
null
null
null
null
UTF-8
Java
false
false
3,071
java
package com.yumodev.airthmetic.leetcode; /** * Created by yimodev on 17/3/27. * https://leetcode.com/problems/container-with-most-water/ */ public class Leetcode_0011_container_with_most_water { /** * 用穷举法实现,效率比较低,通不过LeetCode的用例。 * @param height * @return */ public static int maxArea(int[] height) { if (height == null || height.length <= 1){ return 0; } int maxArea = 0; for(int i = 0; i < height.length; i++){ for (int j = i + 1; j < height.length; j++){ int area = (j - i) * Math.min(height[i], height[j]); if (area > maxArea){ maxArea = area; } } } return maxArea; } /** * @param height * @return */ public static int maxArea1(int[] height) { if (height == null || height.length <= 1){ return 0; } int left = 0; int right = height.length -1; int maxArea = 0; int area = 0; while (left < right){ if (height[left] <= height[right]){ area = height[left] * (right - left); if (maxArea < area){ maxArea = area; } left++; }else{ area = height[right] * (right - left); if (maxArea < area){ maxArea = area; } right--; } } return maxArea; } public static void test(int[] num){ long startTime = System.nanoTime(); int result = maxArea1(num); long endTime = System.nanoTime(); System.out.println(String.format("time :" + (endTime - startTime)+" result: %s", result)); } public static void main(String[] args){ test(new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295}); test(new int[]{2,6,3,1}); test(new int[]{2,1}); } }
3ec9c00a93e88848435f619168180d26d06c04db
dc0c44f3c4729a75570d8c0fa2ae998bdf9e4976
/Programmieren_3/praktikum/Blatt 1/Aufgabe 4/src/de/hsos/prog3/ab1/DirigentIn.java
547bee56cde785342478353a7da4e608d3d223a7
[]
no_license
WyNotRepax/Studi
4247a2857001e0a9261c381164852f33337e59e8
b5b16ee860b029e38ea96dc629611fc7ec5bddd7
refs/heads/master
2021-12-03T13:55:50.178819
2021-10-20T23:55:19
2021-10-20T23:55:19
251,079,763
0
1
null
null
null
null
UTF-8
Java
false
false
129
java
package de.hsos.prog3.ab1; public class DirigentIn extends Mitglied { DirigentIn(String name){ super(name); } }
098bba2097c1ed97492baca63fccbe2adbca80c3
16e21056de9faff455c7d6c9a9a4ab5e2aa4af5c
/src/test/java/api/ApplicationTests.java
407b21a0b9cd7507895accc16d2eb5654c7d05e7
[]
no_license
Romulohenriquesc/backend-sisaqui-spring
dfd9b5977a8b215ff75479ff19639fc7d8b0c816
84ce7b0ef38212c76f7931a9250aef451913bd44
refs/heads/master
2022-04-07T05:38:21.881841
2020-02-13T18:45:25
2020-02-13T18:45:25
240,333,892
0
0
null
null
null
null
UTF-8
Java
false
false
189
java
package api; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ApplicationTests { @Test void contextLoads() { } }
97e9254e64aad3aaca69f12624ef6444a1fe0905
a33402efa6760ab8dde616274b598e381ab3c1cb
/A_FastDeveop/app/src/main/java/com/xumaodun/a_fastdeveop/refresh/swipe/fragment/NavGoogleFragment.java
5cd7c2d03aa2672993e576ab3a7e690602b70846
[]
no_license
xumorden/A_FastDevelop
16da724d6834efc21108d066cc03d6dc44241905
4c5947f5771b1d9c5b27566f471e384d6c0e0ce0
refs/heads/master
2020-09-10T17:00:31.494798
2016-12-08T06:28:03
2016-12-08T06:28:03
67,395,924
3
0
null
null
null
null
UTF-8
Java
false
false
963
java
package com.xumaodun.a_fastdeveop.refresh.swipe.fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.View; /** * A simple {@link Fragment} subclass. */ public class NavGoogleFragment extends BaseNavPagerFragment { public static BaseNavigationFragment newInstance() { BaseNavigationFragment fragment = new NavGoogleFragment(); return fragment; } public NavGoogleFragment() { // Required empty public constructor } @Override protected String[] getTitles() { return new String[]{"Google", "Custom"}; } @Override protected Fragment getFragment(int i) { return GoogleStyleFragment.newInstance(i); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); setTitle("Google Style"); } }
12cc3f1316c859fa08bbec19ff7775763e5c95a8
c75296ab8eac301cc551ed281a29032fedc84fc1
/ifreebudget/src/com/ifreebudget/fm/entity/beans/Transaction.java
94f65add180e8cc357e43e8a95284a8314aedc03
[]
no_license
wangji74/ifreebudget-android
6c8363166fcbc1840765c9e2056098e37161efce
7cb7a0efdf7629ee8c23f2755d5940e425b5fb6a
refs/heads/master
2021-01-10T01:33:25.212190
2012-02-16T04:05:12
2012-02-16T04:05:12
50,930,940
0
0
null
null
null
null
UTF-8
Java
false
false
3,775
java
/******************************************************************************* * Copyright 2011 [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 com.ifreebudget.fm.entity.beans; import java.math.BigDecimal; import java.util.Date; /** * @author iFreeBudget [email protected] * */ public class Transaction implements FManEntity { private static final long serialVersionUID = 1L; long txId; String fitid; long fromAccountId; long toAccountId; BigDecimal txAmount; String txNotes; Long txDate; Long createDate; int txStatus; Long parentTxId; BigDecimal fromAccountEndingBal; BigDecimal toAccountEndingBal; private int isParent; public int getTxStatus() { return txStatus; } public void setTxStatus(int txStatus) { this.txStatus = txStatus; } public Long getCreateDate() { return createDate; } public void setCreateDate(Long createDate) { this.createDate = createDate; } public Long getTxDate() { return txDate; } public void setTxDate(Long txDate) { this.txDate = txDate; } public long getFromAccountId() { return fromAccountId; } public void setFromAccountId(long fromAccountId) { this.fromAccountId = fromAccountId; } public long getTxId() { return txId; } public void setTxId(long id) { this.txId = id; } public long getToAccountId() { return toAccountId; } public void setToAccountId(long toAccountId) { this.toAccountId = toAccountId; } public BigDecimal getTxAmount() { return txAmount; } public void setTxAmount(BigDecimal txAmount) { this.txAmount = txAmount; } public String getTxNotes() { return txNotes; } public void setTxNotes(String txNotes) { this.txNotes = txNotes; } public BigDecimal getFromAccountEndingBal() { return fromAccountEndingBal; } public void setFromAccountEndingBal(BigDecimal fromAccountEndingBal) { this.fromAccountEndingBal = fromAccountEndingBal; } public BigDecimal getToAccountEndingBal() { return toAccountEndingBal; } public void setToAccountEndingBal(BigDecimal toAccountEndingBal) { this.toAccountEndingBal = toAccountEndingBal; } public String getFitid() { return fitid; } public void setFitid(String fitid) { this.fitid = fitid; } public Long getParentTxId() { return parentTxId; } public void setParentTxId(Long parentTxId) { this.parentTxId = parentTxId; } public int getIsParent() { return isParent; } public void setIsParent(int isParent) { this.isParent = isParent; } // Interface methods - FManEntity public String getPKColumnName() { return "txId"; } public Object getPK() { return getTxId(); } public void setPK(Object pk) { setTxId((Long) pk); } public TableMapper getTableMapper() { return new TransactionMapper(); } }
b676ca1e339156209675a60c7104a1cbc7281788
37eee1f6801162655207df8e9f8429a126309513
/src/A_校招笔试汇总/便利蜂3_20笔试/Main_store.java
f1b79dfcd0724e323d4210d3920bf9e235ca72af
[]
no_license
Ilovezpy/Leetcode
647d8f8a30e885eaac70446bf6afd1c206ca2f50
f53a2ee0a109a0c9c71b07f6d10eec0c54fdb059
refs/heads/master
2023-06-02T02:20:01.323678
2021-06-19T09:04:53
2021-06-19T09:04:53
284,881,120
2
0
null
null
null
null
UTF-8
Java
false
false
1,553
java
package A_校招笔试汇总.便利蜂3_20笔试; import java.util.Scanner; /** * @author zhao peng yu * @version 1.0 * @date 2021/3/20 14:17 * * ac 73% 呜呜菜鸡!!! */ public class Main_store { private static StringBuilder stringBuilder = new StringBuilder(); public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (cin.hasNextLine()){ String news = cin.nextLine(); String olds = cin.nextLine(); String[] splitNew = news.split(","); String[] splitOld = olds.split(","); int count = 0; while (count<splitNew.length && count<splitOld.length){ String[] splitn = splitNew[count].split("-"); String[] splito = splitOld[count].split("-"); if (!splitn[1].equals(splito[1])){ String a = "modify-"+ splitn[0] + ","; stringBuilder.append(a); } count++; } while (count<splitNew.length){ String a = "delete-"+splitNew[count].split("-")[0] + ","; stringBuilder.append(a); count++; } while (count<splitOld.length){ String a = "add-"+splitOld[count].split("-")[0] + ","; stringBuilder.append(a); count++; } String res = stringBuilder.toString(); System.out.println(res.substring(0, res.length() - 1)); } } }
6a77808fb7fded9259efb1e0e2ce6d6dafd60dcc
2f30dcd7d4fcdd8d7b1d8d170b3bc1971053c96c
/app/modules/cluster/workers/PushNotificationThread.java
0315e9fe89fe4e9914eef5f14b5aa7f2005a778e
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
btnguyen2k/png
232b963bec00250bb694b5e522eea0de5d393d17
3a5bde869086eef73ea7dbd409b69d853bc3e1b5
refs/heads/master
2021-01-09T06:38:47.404023
2016-07-08T09:47:29
2016-07-08T09:47:29
61,389,180
1
0
null
null
null
null
UTF-8
Java
false
false
4,035
java
package modules.cluster.workers; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.HashSet; import java.util.Set; import org.apache.commons.lang3.StringUtils; import com.github.ddth.queue.IQueueMessage; import com.notnoop.apns.APNS; import com.notnoop.apns.ApnsService; import com.notnoop.apns.PayloadBuilder; import bo.app.AppBo; import bo.app.IAppDao; import bo.pushtoken.PushTokenBo; import modules.cluster.BaseQueueThread; import modules.registry.IRegistry; import play.Logger; import queue.message.BaseMessage; import queue.message.DeliverPushNotificationMessage; import utils.PngConstants; import utils.PngUtils; /** * Thread to process messages in push-notification queue. * * @author Thanh Nguyen <[email protected]> * @since 0.1.0 */ public class PushNotificationThread extends BaseQueueThread { public PushNotificationThread(IRegistry registry) { super(PushNotificationThread.class.getSimpleName(), registry, registry.getQueuePushNotifications()); } private boolean deliverPushNotification(DeliverPushNotificationMessage msg) { IAppDao appDao = getRegistry().getAppDao(); AppBo app = appDao.getApp(msg.getAppId()); if (app == null) { Logger.error("App [" + msg.getAppId() + "] not found!"); return false; } PushTokenBo[] pushTokens = msg.getPushTokens(); if (pushTokens == null || pushTokens.length == 0) { Logger.error("Invalid message: push token list is empty!"); return false; } String payload; { PayloadBuilder payloadBuilder = APNS.newPayload().alertBody(msg.getContent()); String title = msg.getTitle(); if (!StringUtils.isBlank(title)) { payloadBuilder.alertTitle(title); } payload = payloadBuilder.build(); } ApnsService apnsService = null; try { // build ApnsService try (ByteArrayInputStream bais = new ByteArrayInputStream(app.getIOSP12ContentRaw())) { apnsService = APNS.newService().withCert(bais, app.getIOSP12Password()) .withAppleDestination(true).build(); } catch (IOException e) { Logger.error(e.getMessage(), e); } Set<String> tokens = new HashSet<>(); for (PushTokenBo pushToken : pushTokens) { if (StringUtils.equalsIgnoreCase(pushToken.getOs(), PngConstants.OS_IOS)) { tokens.add(pushToken.getToken()); } else { Logger.warn( "Push notification does not support this OS/Platform: " + pushToken); } if (tokens.size() == 10) { apnsService.push(tokens, payload); tokens = new HashSet<>(); } } if (tokens.size() > 0) { apnsService.push(tokens, payload); } } finally { if (apnsService != null) { apnsService.stop(); } } return true; } /** * {@inheritDoc} */ @Override protected boolean processQueueMessage(IQueueMessage queueMsg) { Object data = queueMsg.qData(); if (data instanceof byte[]) { BaseMessage baseMsg = PngUtils.fromBytes((byte[]) data, BaseMessage.class); if (Logger.isDebugEnabled()) { Logger.debug("\tMessage from queue [" + baseMsg.getClass().getSimpleName() + "]: " + baseMsg); } if (baseMsg instanceof DeliverPushNotificationMessage) { return deliverPushNotification((DeliverPushNotificationMessage) baseMsg); } } else { if (Logger.isDebugEnabled()) { Logger.debug("\tMessage from queue: " + data); } } return false; } }
cd705058f5f0b04f563e217dee18b960185f2876
def95c33c947d72b9e98ff4bd4e284bca55587ee
/src/main/java/com/compomics/util/io/PklFile.java
b82c60da66a758f757dbe27956183f1d204e7131
[ "Apache-2.0" ]
permissive
tzaeschke/compomics-utilities
fb3c6af9a9c9c466a2f71ac81092483e0dd420b5
1fdb82e0b8e77902c1587c1621c764398eae8c03
refs/heads/master
2022-06-09T22:49:23.874262
2020-04-30T23:54:45
2020-04-30T23:54:45
261,005,852
0
0
null
2020-05-03T19:32:21
2020-05-03T19:32:21
null
UTF-8
Java
false
false
5,291
java
package com.compomics.util.io; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.TreeSet; /** * Contains information about the contents of one PKL file. * * @author Harald Barsnes */ public class PklFile { /** * The precursor charge. */ private int precurorCharge; /** * The precursor m/z. */ private double precursorMz; /** * The precursor intensity. */ private double precursorIntensity; /** * The m/z values. */ private double[] mzValues; /** * The intensity values. */ private double[] intensityValues; /** * The file name. */ private String fileName; /** * The spectrum file ID. */ private String spectrumFileId; /** * Parse a PKL file and store the details in the PKLFile object. * * @param pklFile the file to parse * @throws IOException if an IOException occurs */ public PklFile(File pklFile) throws IOException { if(pklFile.isDirectory()){ throw new IOException("File is a directory!"); } if(!pklFile.getAbsolutePath().toLowerCase().endsWith(".pkl")){ throw new IOException("File is not a PKL file!"); } FileReader f = new FileReader(pklFile); BufferedReader b = new BufferedReader(f); fileName = pklFile.getName(); spectrumFileId = pklFile.getName().substring(0, pklFile.getName().length() - 4); // read precursor details String precursorLine = b.readLine(); String[] precursorDetails = precursorLine.split("\t"); if(precursorDetails.length != 3){ throw new IOException("File is not a PKL file - incorrect number of precursor paramaters!"); } precursorMz = new Double(precursorDetails[0]); precursorIntensity = new Double(precursorDetails[1]); precurorCharge = new Integer(precursorDetails[2]); HashMap<Double, Double> peaks = new HashMap<Double, Double>(); String peakLine = b.readLine(); while (peakLine != null) { String[] peakDetails = peakLine.split("\t"); if(peakDetails.length != 2){ throw new IOException("File is not a PKL file - incorrect number of peak paramaters!"); } peaks.put(new Double(peakDetails[0]), new Double(peakDetails[1])); peakLine = b.readLine(); } // sort the values in increasing order TreeSet treeSet = new TreeSet(); treeSet.clear(); treeSet.addAll(peaks.keySet()); Iterator treeSetIterator = treeSet.iterator(); Double tempMz; mzValues = new double[peaks.size()]; intensityValues = new double[peaks.size()]; int peakCounter = 0; while (treeSetIterator.hasNext()) { tempMz = (Double) treeSetIterator.next(); mzValues[peakCounter] = tempMz; intensityValues[peakCounter++] = peaks.get(tempMz); } b.close(); f.close(); } /** * @return the precurorCharge */ public int getPrecurorCharge() { return precurorCharge; } /** * @param precurorCharge the precurorCharge to set */ public void setPrecurorCharge(int precurorCharge) { this.precurorCharge = precurorCharge; } /** * @return the precursorMz */ public double getPrecursorMz() { return precursorMz; } /** * @param precursorMz the precursorMz to set */ public void setPrecursorMz(double precursorMz) { this.precursorMz = precursorMz; } /** * @return the precursorIntensity */ public double getPrecursorIntensity() { return precursorIntensity; } /** * @param precursorIntensity the precursorIntensity to set */ public void setPrecursorIntensity(double precursorIntensity) { this.precursorIntensity = precursorIntensity; } /** * @return the mzValues */ public double[] getMzValues() { return mzValues; } /** * @param mzValues the mzValues to set */ public void setMzValues(double[] mzValues) { this.mzValues = mzValues; } /** * @return the intensityValues */ public double[] getIntensityValues() { return intensityValues; } /** * @param intensityValues the intensityValues to set */ public void setIntensityValues(double[] intensityValues) { this.intensityValues = intensityValues; } /** * @return the fileName */ public String getFileName() { return fileName; } /** * @param fileName the fileName to set */ public void setFileName(String fileName) { this.fileName = fileName; } /** * @return the spectrumFileId */ public String getSpectrumFileId() { return spectrumFileId; } /** * @param spectrumFileId the spectrumFileId to set */ public void setSpectrumFileId(String spectrumFileId) { this.spectrumFileId = spectrumFileId; } }
[ "harald.barsnes@f644b618-123a-11df-8689-7786f20063ad" ]
harald.barsnes@f644b618-123a-11df-8689-7786f20063ad
37ff8a2ce719d54bb6cd4b3118ef0759e150953f
57464f110b04ccba11cf205252b3dc0eba4d7cf3
/app/src/main/java/com/xiaolanba/passenger/module/market/MarketFragment.java
f37c24a325ccfcdd86adf49ea08e5fda784268bb
[]
no_license
W2009-Cai/ElectCigar
f1e4b26683fed8aab08058da2b102a7739675c15
8cea63c86c558939ed129f0c590afa2b7d8325a9
refs/heads/master
2020-03-17T17:11:17.934051
2018-05-17T07:44:08
2018-05-17T07:44:08
133,778,351
1
0
null
null
null
null
UTF-8
Java
false
false
3,980
java
package com.xiaolanba.passenger.module.market; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageButton; import android.widget.TextView; import com.xiaolanba.commonlib.fresco.FrescoUtil; import com.xiaolanba.passenger.common.base.BaseFragment; import com.xiaolanba.passenger.common.bean.BaseBean; import com.xiaolanba.passenger.common.bean.MultiShopList; import com.xiaolanba.passenger.common.view.LoadingNodataLayout; import com.xiaolanba.passenger.module.market.adapter.MarketMainAdapter; import com.xiaolanba.passenger.module.market.presenter.ShopPresenter; import com.xiaolanba.passenger.module.market.presenter.contract.ShopContract; import com.xlb.elect.cigar.R; import java.util.ArrayList; import java.util.List; /** * @author xutingz * @E-mail [email protected] * @date 2018/05/02 */ public class MarketFragment extends BaseFragment implements ShopContract.ViewControl{ private RecyclerView mRecyclerView; private MarketMainAdapter mAdapter; private ImageButton mRightImg; private LoadingNodataLayout mNodtaLayout; private ShopPresenter mPresenter = new ShopPresenter(this); @Override public void setContentView() { setContentView(R.layout.fragment_market); } @Override public void findView() { TextView mTitle = (TextView) findViewById(R.id.title_txt); mTitle.setText("商城"); findViewById(R.id.left_img_btn).setVisibility(View.GONE); mNodtaLayout = (LoadingNodataLayout) findViewById(R.id.nodata_layout); mRightImg = (ImageButton) findViewById(R.id.right_img_btn); mRightImg.setVisibility(View.VISIBLE); mRightImg.setImageResource(R.drawable.nav_icon_shopping); mRightImg.setOnClickListener(this); mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); GridLayoutManager gridLayoutManager = new GridLayoutManager(context, 3); gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { return mAdapter.getItemViewType(position) == MarketMainAdapter.VIEW_TYPE_SHOPS ? 1 : 3; } }); mRecyclerView.setLayoutManager(gridLayoutManager); mRecyclerView.addOnScrollListener(FrescoUtil.getPauseOnScrollListener()); mAdapter = new MarketMainAdapter(context); mRecyclerView.setAdapter(mAdapter); } @Override public void initData() { mNodtaLayout.setVisibility(View.VISIBLE); mNodtaLayout.setIsLoadingUi(true); mPresenter.getShopIndexList(); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.right_img_btn: showToast("点击了购物车"); break; } } @Override public void onShopIndexList(boolean isSuccess, int code, String message, MultiShopList lists) { if (isSuccess){ if (lists != null&& lists.getTotalSize() >0){ mNodtaLayout.setVisibility(View.GONE); if (lists.lease != null ){ List<BaseBean> list = new ArrayList<>(); list.addAll(lists.lease); mAdapter.setRentalList(list); } if (lists.sales != null ){ List<BaseBean> list = new ArrayList<>(); list.addAll(lists.sales); mAdapter.setLampList(list); } if (lists.show != null ){ List<BaseBean> list = new ArrayList<>(); list.addAll(lists.show); mAdapter.setBuyerShowList(list); } } else { mNodtaLayout.setIsLoadingUi(false); } } else { mNodtaLayout.setIsLoadingUi(false); } } }
ea2993c18191003871a5a91615f280390ea45785
183dc3c758fb3524d1dee545d14c165b75af30d9
/src/main/java/transcoder/Transcoder.java
9a2fcfc23e8ff86a9b994f1e886def632316ba3d
[]
no_license
cyan9212/Network_Poker
2aa47cbf356a7e0973930d99a7a73d6cde64e54c
e809c71c5a0d6083249111a29cd29aaada5bf48b
refs/heads/master
2020-05-16T16:32:09.043469
2019-04-24T06:46:57
2019-04-24T06:46:57
183,165,207
0
0
null
null
null
null
UTF-8
Java
false
false
143
java
package transcoder; import java.io.IOException; public interface Transcoder { void transcode(String src, String tgt) throws IOException; }
6725628f48a0ee6118021eea6b44700fffa71eeb
c1649ec9e0b4eec94010dc9acd81d6d1cf44557d
/parentTest/src/main/java/com/main/test/normal/collection/TestMap.java
1d327010ee8b4a79a8de28bc4dfb9bc3b7db2110
[]
no_license
loveofyou1/workLearning
e1325d36673cc5710dc0cb20b1f958423f8f2f6a
8329cec9bfb6fbe263e8fc9701b276429ff9d3ee
refs/heads/master
2022-11-20T20:44:09.782891
2020-12-07T01:19:38
2020-12-07T01:19:38
125,325,214
0
1
null
2022-11-16T12:35:01
2018-03-15T06:55:01
Java
UTF-8
Java
false
false
829
java
package com.main.test.normal.collection; import java.util.HashMap; import java.util.Map; /** * map删除数据测试 * * @author Dean * @create 2018/8/31 */ public class TestMap { public static void main(String[] args) { Map<String, String> map = new HashMap<>(); map.put("1", "a"); map.put("2", "b"); map.put("3", "c"); String key = "3"; if (map.containsKey(key)) { map.remove(key); } for (Map.Entry entry : map.entrySet()) { System.out.println(entry.getKey() + "=" + entry.getValue()); } for (String value : map.values()) { System.out.println(value); } for (String key1 : map.keySet()) { System.out.println(key1); } } }
d6d625be49d06467c317bad5b2d94cb600917b1f
ec2b483eb4313f1843f3483c574d4ab7406f53ae
/sqfx/core/src/org/squirrelsql/session/sql/tablesearch/SearchResultHandler.java
5851836ad5aacdc43586978d88a3124ac67ad0e5
[]
no_license
Bartman0/SQuirreLSQL
cd813a48fac8b7b653da9b8e8689eddd1568bfde
c53798894835c6b16f18a256d56c8e7846d5f2e1
refs/heads/master
2021-01-01T04:12:14.816599
2016-04-10T19:22:22
2016-04-10T19:22:22
57,206,180
0
1
null
null
null
null
UTF-8
Java
false
false
6,565
java
package org.squirrelsql.session.sql.tablesearch; import javafx.scene.control.TableView; import javafx.stage.Stage; import org.squirrelsql.services.*; import org.squirrelsql.table.ColumnHandle; import org.squirrelsql.table.TableLoader; public class SearchResultHandler { private String _currentCboEditorText; private TableSearchType _currentSearchType; private boolean _caseSensitive; private SearchResult _searchResult = new SearchResult(); private TableLoader _resultTableLoader; private MessageHandler _mh = new MessageHandler(getClass(), MessageHandlerDestination.MESSAGE_PANEL); private I18n _i18n = new I18n(getClass()); public SearchResultHandler(TableLoader resultTableLoader) { _resultTableLoader = resultTableLoader; } public void find(boolean forward, String cboEditorText, TableSearchType searchType, boolean caseSensitive) { if(searchCriteriaChanged(cboEditorText, searchType, caseSensitive)) { _currentCboEditorText = cboEditorText; _currentSearchType = searchType; _caseSensitive = caseSensitive; _searchResult.reset(); } SearchCell startCell = _searchResult.getStartCell(_resultTableLoader, forward); if (forward) { int startCol = startCell.getCol(); for (int row = startCell.getRow(); row < _resultTableLoader.size(); row++) { for (int col = startCol; col < _resultTableLoader.getColumnCount(); col++) { if(matches(_resultTableLoader.getCellAsString(row, col))) { setMatchAndScroll(row, col); return; } } startCol = 0; } } else { int startCol = startCell.getCol(); for (int row = startCell.getRow(); row >= 0; row--) { for (int col = startCol; col >= 0 ; col--) { if(matches(_resultTableLoader.getCellAsString(row, col))) { setMatchAndScroll(row, col); return; } } startCol = _resultTableLoader.getColumnCount() - 1; } } if (forward) { _mh.info(_i18n.t("search.reached.end")); } else { _mh.info(_i18n.t("search.reached.begin")); } _searchResult.resetCurrentMatchCell(); } private void setMatchAndScroll(int row, int colModelIndex) { int colViewIndex = _resultTableLoader.getColumnViewIndex(colModelIndex); _searchResult.setCurrentMatchCell(row, colViewIndex); _resultTableLoader.getTableView().scrollTo(row); _resultTableLoader.getTableView().scrollToColumnIndex(colViewIndex); _resultTableLoader.getTableView().refresh(); } private boolean searchCriteriaChanged(String cboEditorText, TableSearchType searchType, boolean caseSensitive) { if(Utils.compareRespectEmpty(cboEditorText, _currentCboEditorText) && searchType.equals(_currentSearchType) && caseSensitive == _caseSensitive) { return false; } return true; } public void highlightAll(String cboEditorText, TableSearchType searchType, boolean caseSensitive) { _currentCboEditorText = cboEditorText; _currentSearchType = searchType; _caseSensitive = caseSensitive; _searchResult.reset(); int matchCount = 0; for (int row = 0; row < _resultTableLoader.size(); row++) { for (int col = 0; col < _resultTableLoader.getColumnCount(); col++) { if(matches(_resultTableLoader.getCellAsString(row, col))) { ++ matchCount; _searchResult.setCurrentMatchCell(row, _resultTableLoader.getColumnViewIndex(col)); } } } _mh.info(_i18n.t("match.count.found", matchCount)); _searchResult.resetCurrentMatchCell(); _resultTableLoader.getTableView().refresh(); } public void unhighlightAll() { _searchResult.reset(); _resultTableLoader.getTableView().refresh(); } private boolean matches(String cellData) { if(false == _caseSensitive) { if (TableSearchType.REG_EX != _currentSearchType) { _currentCboEditorText = _currentCboEditorText.toLowerCase(); } cellData = cellData.toLowerCase(); } switch (_currentSearchType) { case CONTAINS: return cellData.contains(_currentCboEditorText); case STARTS_WITH: return cellData.startsWith(_currentCboEditorText); case ENDS_WITH: return cellData.endsWith(_currentCboEditorText); case REG_EX: return cellData.matches(_currentCboEditorText); } throw new IllegalArgumentException("Unknown search type " + _currentSearchType); } public void showSearchResultInOwnTable(String cboEditorText, TableSearchType searchType, boolean caseSensitive) { _currentCboEditorText = cboEditorText; _currentSearchType = searchType; _caseSensitive = caseSensitive; _searchResult.reset(); TableLoader tl = new TableLoader(); for (ColumnHandle columnHandle : _resultTableLoader.getColumnHandles()) { tl.addColumn(columnHandle.getHeader()); } for (int row = 0; row < _resultTableLoader.size(); row++) { for (int col = 0; col < _resultTableLoader.getColumnCount(); col++) { if(matches(_resultTableLoader.getCellAsString(row, col))) { tl.addRow(_resultTableLoader.getRows().get(row)); break; } } } SearchResultHandler handler = new SearchResultHandler(tl); TableView tv = new TableView(); tl.load(tv); handler.highlightAll(cboEditorText, searchType, caseSensitive); Stage dlg = GuiUtils.createNonModalDialog(tv, new Pref(getClass()), 500, 300, "showSearchResultInOwnTable"); dlg.setTitle(_i18n.t("search.result.in.own.table", searchType, cboEditorText)); dlg.show(); } public void setActive(boolean b) { if (b) { _resultTableLoader.getSquirrelDefaultTableCellChannel().setSearchMatchCheck((valueToRender, cell) -> _searchResult.getSearchMatch(valueToRender, cell)); } else { unhighlightAll(); _resultTableLoader.getSquirrelDefaultTableCellChannel().setSearchMatchCheck(null); } } }
9ed1067af59f7bd0873d9fda53b1ae7ea60c1899
aa74ecf8895ea301902eaa16189b770b78ef8a71
/src/com/android/settings/turbo/StatusBarTemperature.java
4a66a7cf34002bc5a548d50caf88200a2903e854
[ "Apache-2.0" ]
permissive
Abimaxmi/packages_apps_Settings
cd75266adf402ac334e5d8819337b37b3f8cf462
a36d26f8d38bcb35e5dabbdfa166a7a986ffc354
refs/heads/m6.0.1
2021-01-18T17:40:08.115503
2012-12-09T21:59:15
2016-04-26T14:11:14
57,192,033
0
0
null
2016-04-27T07:10:56
2016-04-27T07:10:56
null
UTF-8
Java
false
false
8,585
java
/* * Copyright (C) 2016 TurboROM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.turbo; import android.content.Context; import android.content.ContentResolver; import android.content.res.Resources; import android.os.Bundle; import android.os.UserHandle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceScreen; import android.preference.SwitchPreference; import android.provider.Settings; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.preference.SeekBarPreference; import com.android.settings.Utils; import com.android.internal.logging.MetricsLogger; import java.util.Locale; import android.text.TextUtils; import android.view.View; import com.android.internal.logging.MetricsLogger; import net.margaritov.preference.colorpicker.ColorPickerPreference; public class StatusBarTemperature extends SettingsPreferenceFragment implements OnPreferenceChangeListener { private static final String STATUS_BAR_TEMPERATURE_STYLE = "status_bar_temperature_style"; private static final String STATUS_BAR_TEMPERATURE = "status_bar_temperature"; private static final String PREF_STATUS_BAR_WEATHER_COLOR = "status_bar_weather_color"; private static final String PREF_STATUS_BAR_WEATHER_SIZE = "status_bar_weather_size"; private static final String PREF_STATUS_BAR_WEATHER_FONT_STYLE = "status_bar_weather_font_style"; private ListPreference mStatusBarTemperature; private ListPreference mStatusBarTemperatureStyle; private ColorPickerPreference mStatusBarTemperatureColor; private SeekBarPreference mStatusBarTemperatureSize; private ListPreference mStatusBarTemperatureFontStyle; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.statusbar_temperature); PreferenceScreen prefSet = getPreferenceScreen(); // Temperature mStatusBarTemperature = (ListPreference) findPreference(STATUS_BAR_TEMPERATURE); int temperatureShow = Settings.System.getInt(getContentResolver(), Settings.System.STATUS_BAR_SHOW_WEATHER_TEMP, 0); mStatusBarTemperature.setValue(String.valueOf(temperatureShow)); mStatusBarTemperature.setSummary(mStatusBarTemperature.getEntry()); mStatusBarTemperature.setOnPreferenceChangeListener(this); mStatusBarTemperatureStyle = (ListPreference) findPreference(STATUS_BAR_TEMPERATURE_STYLE); int temperatureStyle = Settings.System.getInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_TEMP_STYLE, 0); mStatusBarTemperatureStyle.setValue(String.valueOf(temperatureStyle)); mStatusBarTemperatureStyle.setSummary(mStatusBarTemperatureStyle.getEntry()); mStatusBarTemperatureStyle.setOnPreferenceChangeListener(this); mStatusBarTemperatureColor = (ColorPickerPreference) findPreference(PREF_STATUS_BAR_WEATHER_COLOR); mStatusBarTemperatureColor.setOnPreferenceChangeListener(this); int intColor = Settings.System.getInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_COLOR, 0xffffffff); String hexColor = String.format("#%08x", (0xffffffff & intColor)); mStatusBarTemperatureColor.setSummary(hexColor); mStatusBarTemperatureColor.setNewPreviewColor(intColor); mStatusBarTemperatureSize = (SeekBarPreference) findPreference(PREF_STATUS_BAR_WEATHER_SIZE); mStatusBarTemperatureSize.setValue(Settings.System.getInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_SIZE, 14)); mStatusBarTemperatureSize.setOnPreferenceChangeListener(this); mStatusBarTemperatureFontStyle = (ListPreference) findPreference(PREF_STATUS_BAR_WEATHER_FONT_STYLE); mStatusBarTemperatureFontStyle.setOnPreferenceChangeListener(this); mStatusBarTemperatureFontStyle.setValue(Integer.toString(Settings.System.getInt(getActivity() .getContentResolver(), Settings.System.STATUS_BAR_WEATHER_FONT_STYLE, 0))); mStatusBarTemperatureFontStyle.setSummary(mStatusBarTemperatureFontStyle.getEntry()); enableStatusBarTemperatureDependents(); } @Override protected int getMetricsCategory() { return MetricsLogger.DONT_TRACK_ME_BRO; } @Override public void onResume() { super.onResume(); } @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { return super.onPreferenceTreeClick(preferenceScreen, preference); } @Override public boolean onPreferenceChange(Preference preference, Object objValue) { if (preference == mStatusBarTemperature) { int temperatureShow = Integer.valueOf((String) objValue); int index = mStatusBarTemperature.findIndexOfValue((String) objValue); Settings.System.putInt(getContentResolver(), Settings.System.STATUS_BAR_SHOW_WEATHER_TEMP, temperatureShow); mStatusBarTemperature.setSummary( mStatusBarTemperature.getEntries()[index]); enableStatusBarTemperatureDependents(); return true; } else if (preference == mStatusBarTemperatureStyle) { int temperatureStyle = Integer.valueOf((String) objValue); int index = mStatusBarTemperatureStyle.findIndexOfValue((String) objValue); Settings.System.putInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_TEMP_STYLE, temperatureStyle); mStatusBarTemperatureStyle.setSummary( mStatusBarTemperatureStyle.getEntries()[index]); return true; } else if (preference == mStatusBarTemperatureColor) { String hex = ColorPickerPreference.convertToARGB( Integer.valueOf(String.valueOf(objValue))); preference.setSummary(hex); int intHex = ColorPickerPreference.convertToColorInt(hex); Settings.System.putInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_COLOR, intHex); return true; } else if (preference == mStatusBarTemperatureSize) { int width = ((Integer)objValue).intValue(); Settings.System.putInt(getContentResolver(), Settings.System.STATUS_BAR_WEATHER_SIZE, width); return true; } else if (preference == mStatusBarTemperatureFontStyle) { int val = Integer.parseInt((String) objValue); int index = mStatusBarTemperatureFontStyle.findIndexOfValue((String) objValue); Settings.System.putInt(getActivity().getContentResolver(), Settings.System.STATUS_BAR_WEATHER_FONT_STYLE, val); mStatusBarTemperatureFontStyle.setSummary(mStatusBarTemperatureFontStyle.getEntries()[index]); return true; } return false; } private void enableStatusBarTemperatureDependents() { int temperatureShow = Settings.System.getInt(getActivity() .getContentResolver(), Settings.System.STATUS_BAR_SHOW_WEATHER_TEMP,0); if (temperatureShow == 0) { mStatusBarTemperatureStyle.setEnabled(false); mStatusBarTemperatureColor.setEnabled(false); mStatusBarTemperatureSize.setEnabled(false); mStatusBarTemperatureFontStyle.setEnabled(false); } else { mStatusBarTemperatureStyle.setEnabled(true); mStatusBarTemperatureColor.setEnabled(true); mStatusBarTemperatureSize.setEnabled(true); mStatusBarTemperatureFontStyle.setEnabled(true); } } }
958dde23e157014dee790c8bf150ceaf48e0eb72
efff0b34aef6a75ba02908f5bda7a015f4efeaca
/src/day1/Exam.java
24cebd4b95b1b6b757701a2cf595200cf0bf8985
[]
no_license
JUNGYUMI/DIGITAL-JAVA
95d16004755d0070ed34b982fc45691efcc23aec
c0cd51f14ae2b8c5005f3e22b43b869794e5733e
refs/heads/master
2022-11-14T10:39:32.185066
2020-07-07T08:12:33
2020-07-07T08:12:33
256,374,873
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package day1; import java.util.Scanner; public class Exam { public static void main(String[] args) { // 콘솔에서 정수를 입력받아 변수에 저장 후 콘솔에 변수 값을 출력하는 코드를 작성하세요. Scanner scan = new Scanner(System.in); int num; System.out.println("정수를 입력하세요 : "); num = scan.nextInt(); System.out.println("입력한 정수 : " + num); scan.close(); } }
a6a5b6a5e1a72da74f866bc10561e8f48ba6ffb6
07b3f13dc00a642e74d8af80e6d89f4d73300932
/src/com/bridgeit/Utility/Utility.java
9472756e92d953f5a134e75117c6911be3db1b44
[]
no_license
supriyakumawat/supriya1
8e9248ac325112e4ed439a4c2849bda9ae525960
19ac8d30ba6622af502d8d15cdfec530117ea86c
refs/heads/master
2021-09-07T21:46:48.415995
2018-03-01T13:28:22
2018-03-01T13:28:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,879
java
package com.bridgeit.Utility; import java.util.Random; import java.util.Scanner; public class Utility { static Scanner sc=new Scanner(System.in); public static void leapyear(int year) { if((year%400==0) || (year%4==0)) { System.out.println("Given year is leap year"); } else { System.out.println("Given year is not a Leap year"); } } public static void PowerOf(int base) { int exponant=1; while(exponant<=base) { System.out.println("2 ^ "+exponant + "=" +Math.pow(2, exponant)); /*System.out.println("3 ^ "+exponant + "=" + Math.pow(3, exponant));*/ exponant++; } } public static void powerWithout(int base) { int n=1; System.out.println(">> Enter a range : "); int exponant=sc.nextInt(); for(int i=0;i<=exponant;i++) { // wrong n=n*base; System.out.println("2 ^ "+i+n); } } public static void headVsTail(int flips) { Random r=new Random(); double headcount=0.0; double tailcount=0.0; double perhead=0.0; double pertail=0.0; for(int i=0;i<=flips;i++) { if(r.nextInt(100)%2==0) { headcount++; } else { tailcount++; } } System.out.println("Percenatge of head count is : "+headcount/100*100); System.out.println("Percenatge of Tail count is : "+tailcount/100*100); } public static void primeFact(int num) { Scanner sc=new Scanner(System.in); System.out.println(">> Enter a Number : "); num=sc.nextInt(); while(num%2==0) { System.out.println(2 + " "); num=num/2; } for (int i = 3; i <= Math.sqrt(num); i+= 2) { while (num%i == 0) { System.out.print(i + " "); num /= i; } } if (num > 2) { System.out.print(num); } } public static void distance(int x2,int y2) { int x=0;int y=0; double distance=Math.sqrt((x2-x)+(y2-y)); System.out.println("Equvalent Distance Is : "+distance); } public static void intArray() { System.out.println(">> Enter the size of rowes & Columns :"); int row=sc.nextInt(); int column=sc.nextInt(); System.out.println(">> Size of Rows = "+row); System.out.println(">> Size of Columns = "+column); System.out.println("Enter the values for an Array : "); int i,j; int a[][]=new int[row][column]; for(i=0;i<row;i++) { for(j=0;j<column;j++) { a[i][j]=sc.nextInt(); } } System.out.println(">> Integer Matric A is : "); int b[][]=new int[row][column]; for(i=0;i<row;i++) { for(j=0;j<column;j++) { System.out.print(" "+a[i][j]); } System.out.println(); } } public static void doubleArray() { System.out.println(">> Enter the size of rowes & Columns :"); int row2=sc.nextInt(); int column2=sc.nextInt(); System.out.println(">> Size of Rows = "+row2); System.out.println(">> Size of Columns = "+column2); System.out.println("Enter the values for an Array : "); int i,j; double b[][]=new double[row2][column2]; for(i=0;i<row2;i++) { for(j=0;j<column2;j++) { b[i][j]=sc.nextInt(); } } System.out.println(">> Double Matric B is : "); //b[][]=new int[row2][column2]; for(i=0;i<row2;i++) { for(j=0;j<column2;j++) { System.out.print(" "+b[i][j]); } System.out.println(); } } public static void booleanArray() { System.out.println(">> Enter the size of rowes & Columns :"); int row2=sc.nextInt(); int column2=sc.nextInt(); System.out.println(">> Size of Rows = "+row2); System.out.println(">> Size of Columns = "+column2); System.out.println("Enter the values for an Array : "); int i,j; boolean c[][]=new boolean[row2][column2]; for(i=0;i<row2;i++) { for(j=0;j<column2;j++) { c[i][j]=sc.nextBoolean(); } } System.out.println(">> Boolean Matric C is : "); //b[][]=new int[row2][column2]; for(i=0;i<row2;i++) { for(j=0;j<column2;j++) { System.out.print(" "+c[i][j]); } System.out.println(); } } }
d165599a2eb9e3c77bcfc2484540af4f4a2a62f7
ce62c03a0c4a171615cdaee5308c9d818c7659e2
/hedwig-common/src/test/java/com/yhd/arch/zone/ZoneTest.java
41f98d51061211b3670335bf73f894aa1132a341
[]
no_license
www6v/hed-wig
d0ef639818aca741f7fd9125c0d586de12eef300
55aab4dbf62dbb88177b806777666cf281121fbe
refs/heads/master
2020-04-05T20:07:32.550953
2019-04-15T14:40:29
2019-04-15T14:40:29
157,165,200
0
0
null
null
null
null
UTF-8
Java
false
false
2,433
java
/** * */ package com.yhd.arch.zone; import com.yihaodian.architecture.hedwig.common.util.ZkUtil; import com.yihaodian.architecture.zkclient.ZkClient; import junit.framework.TestCase; import org.apache.zookeeper.data.Stat; /** * @author root * */ public class ZoneTest extends TestCase { ZkClient client; @Override protected void setUp() throws Exception { super.setUp(); client = ZkUtil.getZkClientInstance(); } public void testWriteZone() { Zone z1 = new Zone(TestConstant.ZONE_JQ, "JinQiao", "IDC", "IDC_SH", "ddddddddddddddd"); z1.getZkClusterMap().put(ZkClusterUsage.SOA, "192.168.8.34:2181,192.168.8.35:2181,192.168.8.36:2181"); z1.getZkClusterMap().put(ZkClusterUsage.CACHE, "192.168.8.34:2181,192.168.8.35:2181,192.168.8.36:2181"); Zone z2 = new Zone(TestConstant.ZONE_BJ, "Beijing", "IDC", "IDC_BJ", "ddddddddddddddd"); z2.getZkClusterMap().put(ZkClusterUsage.SOA, "192.168.8.28:2181,192.168.8.37:2181,192.168.8.39:2181"); z1.getZkClusterMap().put(ZkClusterUsage.CACHE, "192.168.8.28:2181,192.168.8.37:2181,192.168.8.39:2181"); Zone z3 = new Zone(TestConstant.ZONE_NH, "Nanhui", "IDC", "IDC_SH", "ddddddddddddddd"); z3.getZkClusterMap().put(ZkClusterUsage.SOA, "10.161.144.77:2181,10.161.144.78:2181,10.161.144.79:2181"); z1.getZkClusterMap().put(ZkClusterUsage.CACHE, "10.161.144.77:2181,10.161.144.78:2181,10.161.144.79:2181"); writeZone(z1); writeZone(z2); writeZone(z3); } private void writeZone(Zone zone) { String path = ZoneConstants.ZONE_PATH + "/" + zone.getName(); if (!client.exists(path)) { client.createPersistent(path, true); } Stat s = client.writeData(path, zone); System.out.println(s.getDataLength()); } public void testContainer() { System.out.println("soaZk" + ZoneContainer.getInstance().getZkClient(TestConstant.ZONE_JQ, ZkClusterUsage.SOA)); System.out.println("kiraZk" + ZoneContainer.getInstance().getZkClient(TestConstant.ZONE_JQ, ZkClusterUsage.SCHEDULER)); } public void testWriteLocalZoneName() { client.writeData(ZoneConstants.ZONE_ROOT, TestConstant.ZONE_NH); } public void testGetLocalZone() { String l = ZoneContainer.getInstance().getLocalZoneName(); System.out.println(l); // ZoneContainer.getInstance().getZkClient(l, ZkClusterUsage.SOA); } public void testGetAllZone() { System.out.println(ZoneContainer.getInstance().getAllZoneName()); } }
6ad9d5623eb765e16c0ea6fdc3827060998370fa
f59b3767942a232d29b7e136aa4335432e500960
/android/app/src/main/java/com/reactnativedemo/react/view/MyTextViewManager.java
14c688c524c937130eaf89968617cc2019a24681
[]
no_license
QYQ/ReactnativeDemo
44e9b9dffcded014ab1641a5f410eb79f1565fc5
1b20de7e828f66ef90241152520b17248a2e1ec9
refs/heads/master
2016-08-12T14:35:21.666441
2016-01-26T09:52:29
2016-01-26T09:52:29
50,419,450
0
1
null
null
null
null
UTF-8
Java
false
false
859
java
package com.reactnativedemo.react.view; import android.graphics.Color; import com.facebook.react.bridge.Callback; import com.facebook.react.uimanager.ReactProp; import com.facebook.react.uimanager.SimpleViewManager; import com.facebook.react.uimanager.ThemedReactContext; /** * Created by kent on 2016/1/21. */ public class MyTextViewManager extends SimpleViewManager<MyReactTextView> { private static final String COMPONENT_NAME = "MyTextView"; @Override public String getName() { return COMPONENT_NAME; } @Override protected MyReactTextView createViewInstance(ThemedReactContext reactContext) { return new MyReactTextView(reactContext); } @ReactProp(name = "text") public void setText(MyReactTextView view, String src){ view.setTextColor(Color.BLACK); view.setText(src); } }
01d6ca129116142471f12ab329e39d748d5c5642
7c6807182b72d9f4f4e86f002c6706d360cc5f83
/src/main/java/com/bug/influx/controller/AppController.java
ebcad0a3131eb60b98d20c5d5e60316938ad8e5c
[]
no_license
razvanbugariu/influxdb
ddf4bfd44695e0f6698120660a614c5a9733ccb6
362643214b6917c57994dd27dacd0f317705ca61
refs/heads/master
2023-04-16T08:31:47.477911
2021-05-01T10:31:07
2021-05-01T10:31:07
363,206,865
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.bug.influx.controller; import com.bug.influx.service.InfluxDbService; import com.fasterxml.jackson.core.JsonProcessingException; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(value = "/app", produces = MediaType.APPLICATION_JSON_VALUE) public class AppController { private final InfluxDbService influxDbService; public AppController(InfluxDbService influxDbService) { this.influxDbService = influxDbService; } @GetMapping public String getAll(@RequestParam(value = "start", required = false) Long start, @RequestParam(value = "stop", required = false) Long stop) throws JsonProcessingException { return influxDbService.getAll(start, stop); } @PostMapping("/{price}") public void write(@PathVariable("price") String price) { influxDbService.write("POST", price); } }
51228069fb22670fd919899b8775a41de1dee8aa
d2c3e880306d1ed85e7d2f4663300fbef1cbda37
/src/controllers/CountryController.java
8691e52e8b7efb73b213cbc77fdf868a79ff1ae6
[]
no_license
budiarti25/Bootcamp-17-Part-2
cfca705a9f453cf0415acc59f17164d7dafb18b3
459c2a6d00e1af312cbc2668748e488415c3f7da
refs/heads/master
2020-03-24T20:01:37.873696
2018-07-31T16:13:27
2018-07-31T16:13:27
142,955,802
0
0
null
null
null
null
UTF-8
Java
false
false
3,384
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 controllers; import daos.CountryDAO; import daos.RegionDAO; import entities.Country; import entities.Region; import java.sql.Connection; import java.util.List; /** * * @author budiarti */ public class CountryController {//jembatan antara view dan dao private CountryDAO countryDAO;//tamabhkan contructor tak berparameter private RegionDAO rdao; public CountryController() { this.countryDAO = new CountryDAO(); } public CountryController(Connection connection) { this.countryDAO = new CountryDAO(connection); this.rdao = new RegionDAO(connection); } /** * fungsi untuk menyimpan data * @param countryId * @param countryName * @param regionId * @return countryDAO.insert menambahkan data pada region */ public boolean save(String countryId, String countryName, String region){ // Region region1=(Region) this.rdao.getById(Integer.parseInt(region)); // return this.countryDAO.insert(new Country(countryId, countryName, region1)); return this.countryDAO.insert(new Country(countryId, countryName, new Region(Integer.parseInt(region), ""))); } /** * megubah data yg sudah tersimpan * @param countryId * @param countryName * @param region * @return countryDAO.udpate menambahkan data pada region */ public boolean edit(String countryId, String countryName, String region){ // Region region1=(Region) this.rdao.getById(Integer.parseInt(region)); // return this.countryDAO.update(new Country(countryId, countryName, region1)); return this.countryDAO.update(new Country(countryId, countryName, new Region(Integer.parseInt(region), ""))); } /** * * @param countryId * @return countryDAO.delete menghapus data pada country */ public boolean drop(String countryId){ return this.countryDAO.delete(countryId); } /** * * @return countryDAO.getAll memanggil semua data dan disimpan pada list<object> */ public List<Object[]> binding(){ return this.countryDAO.getAll(); } /** * * @param category * @param sort * @return countryDAO.getAllSort memanggil semua data dan disimpan pada list<object> berdasarkan parameter tertentu */ public List<Object[]> bindingSort(String category, String sort){ return this.countryDAO.getAllSort(category, sort); } /** * * @param category * @param data * @return countryDAO.search melakukan pencarian data dan disimpan pada list<object> berdasarkan parameter tertentu */ public List<Object[]> find(String category, String data){ return this.countryDAO.search(category, data); } /** * * @param countryId * @return countryDAO.getById melakukan pemanggilan data dan disimpan pada object berdasarkan parameter countryId */ public Object findBy(String countryId){ return this.countryDAO.getById(countryId); } }
[ "budiarti@budiarti-PC" ]
budiarti@budiarti-PC
d497ecf792ff5dd71165bf330c8713529192da7d
ed636b71e70cd4489052935934748c3019ed56b6
/src/main/java/by/choiceTours/controller/HomeController.java
c1c4b83606189cb121479b6af0e89fcb19883c05
[]
no_license
IvashkevichYury/choiceTours
dac642f1eb49f4e6629899343dd12470a2abdaf2
59c1d23d6ee00fc82d9b20a0662d772bd08ba16f
refs/heads/master
2023-06-14T13:20:28.703200
2021-07-08T15:14:24
2021-07-08T15:14:24
383,172,332
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package by.choiceTours.controller; import by.choiceTours.service.MyUserService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller @RequestMapping() @RequiredArgsConstructor public class HomeController { private final MyUserService userService; @GetMapping("/home") public ModelAndView homePage(ModelAndView model, @RequestParam(defaultValue = "User") String name) { model.addObject("name", name); model.setViewName("home"); return model; } @GetMapping("/checkUser") public ModelAndView checkUser(ModelAndView model) { model.addObject("users", userService.getAll()); model.setViewName("userList"); return model; } }
422fd976edafa5f5bace3e115890b2a906b07ea6
10f927c13086b3b91f8501ac02eeacd149d837f2
/src/utsuazarashi/app/UtsuAzarashi.java
c9c11789261ba0d6acaebcbfeaf59a24617d3bf4
[]
no_license
noqisofon/UtsuAzarashi
b5cd6d1c5d8dc153beabae4d38ef4fa1d0534cc3
9f37ce8b94bd36fa23321c570885d47d116ef95d
refs/heads/master
2021-01-19T21:29:40.987182
2012-03-03T07:25:03
2012-03-03T07:25:03
3,608,853
0
0
null
null
null
null
UTF-8
Java
false
false
5,326
java
package utsuazarashi.app; import java.io.*; import java.util.*; import org.codehaus.jackson.map.*; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.*; import org.eclipse.swt.events.*; import org.eclipse.swt.widgets.*; import twitter4j.*; import twitter4j.auth.*; /** * @author rihine * */ public class UtsuAzarashi { /** * */ public UtsuAzarashi() { } /** * */ private void createContents() { TwitterFactory factory = new TwitterFactory(); display = new Display(); main_window = new Shell( display ); tweet_text = new Text( main_window, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL ); twitter = factory.getInstance(); // // main_window // main_window.setLayout( new GridLayout( 1, true ) ); main_window.setText( "欝アザラシ" ); main_window.setSize( 320, 240 ); // // tweet_text // GridData grid_data1 = new GridData(); grid_data1.horizontalAlignment = GridData.FILL; grid_data1.verticalAlignment = GridData.FILL; grid_data1.grabExcessHorizontalSpace = true; grid_data1.grabExcessVerticalSpace = true; tweet_text.setLayoutData( grid_data1 ); // // tweet_button // tweet_button = new Button( main_window, SWT.NULL ); tweet_button.setText( "ついーと" ); tweet_button.addSelectionListener( new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent se) { // TODO Auto-generated method stub } @Override public void widgetSelected(SelectionEvent se) { String text = tweet_text.getText(); if ( text.length() == 0 ) { showMessageBox( "つぶやく内容が無いよ" ); return ; } tweet( text ); tweet_text.setText( "" ); } } ); GridData grid_data2 = new GridData(); grid_data2.horizontalAlignment = GridData.END; grid_data2.verticalAlignment = GridData.BEGINNING; grid_data2.grabExcessHorizontalSpace = false; grid_data2.grabExcessVerticalSpace = false; tweet_button.setLayoutData( grid_data2 ); // // twitter // twitter.setOAuthConsumer( TwitterConfig.CONSUMER_KEY, TwitterConfig.CONSUMER_SECRET ); File path = new File( System.getProperty( "user.home" ) + "/.config/UtsuAzarashi" ); File file = new File( path, "user.json" ); AccessToken access_token = null; if ( !file.exists() ) { PinEntryDialog dialog = new PinEntryDialog( main_window ); access_token = dialog.open(); } else { access_token = emisssionAccessToken( path ); } twitter.setOAuthAccessToken( access_token ); } /** * */ public void run() { createContents(); main_window.open(); main_window.layout(); while ( !main_window.isDisposed() ) { if ( !this.display.readAndDispatch() ) { this.display.sleep(); } } this.display.dispose(); } /** * */ public static void main(String[] args) { UtsuAzarashi progn = new UtsuAzarashi(); progn.run(); } /** * */ private int showMessageBox(String text) { MessageBox message_box = new MessageBox( main_window ); message_box.setMessage( text ); return message_box.open(); } /** * */ private Status tweet(String tweeting_text) { Status status = null; try { status = twitter.updateStatus( tweeting_text ); } catch ( TwitterException e ) { e.printStackTrace(); return null; } return status; } /** * */ private static AccessToken emisssionAccessToken(File path) { AccessToken access_token = null; ObjectMapper mapper = new ObjectMapper(); Map<String, Object> data = null; File file = new File( path, "user.json" ); if ( file.exists() ) { try { data = mapper.readValue( file, Map.class ); } catch ( IOException ie ) { ie.printStackTrace(); return null; } } else { return null; } String screen_name = (String)data.get( "screenName" ); System.out.println( "screen name is " + screen_name ); file = new File( path, screen_name + ".json" ); if ( file.exists() ) { try { data = mapper.readValue( file, Map.class ); } catch ( IOException ie ) { ie.printStackTrace(); return null; } } else { return null; } access_token = new AccessToken( (String)data.get( "token" ), (String)data.get( "tokenSecret" ) ); return access_token; } private Display display; private Shell main_window; private Text tweet_text; private Button tweet_button; private Twitter twitter; }
e388a1e54c24f9c20d9c5e14804f4eca276ffd84
4d6901ef05c2e12f8baa8a6ee13abe6b5e3aa8f0
/src/main/java/com/park/FirstjdbcApplication.java
bf14e7959a4b2f83a26a8940aaf42be6361ab970
[ "Apache-2.0" ]
permissive
jingxiaohu/pybWeiXin
f85580978cc749ea7162168aa897222a6faa2955
20db855770d67ca9562ac41f047d37c1574ee4ad
refs/heads/master
2021-08-23T05:16:37.031943
2017-12-03T15:33:30
2017-12-03T15:33:30
112,835,808
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.park; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @RestController @ServletComponentScan public class FirstjdbcApplication { // @Autowired // User_infoDao user_infoDao; // @Autowired // UserInfoBiz userInfoBiz; // @RequestMapping("/") // String home() throws Exception { // User_info user_info = userInfoBiz.returnUserInfo(); // return "电话号码是:" + user_info.ui_tel; // } public static void main(String[] args) { SpringApplication.run(FirstjdbcApplication.class, args); } }
c0bb0d94f9d84d349296ca7d33314ef31eba5ca6
c8d8f81462eb9153077b7d7ed5e2104c8d1abe52
/mobile-app-ws/src/main/java/com/udemy/app/ws/ui/model/request/PasswordResetRequestModel.java
17da68cd7f15ea1a69383adbd02bfaca472c3e69
[]
no_license
ShT51/PetREST
1f3705fc9297d1355651ccd39e7072cf144fa007
4e5b9ed8bf5fa2332e4b5911b667e254b6e26b82
refs/heads/master
2022-12-30T03:06:12.946567
2020-04-27T08:26:01
2020-04-27T08:26:01
258,467,181
0
0
null
2020-10-13T21:28:07
2020-04-24T09:30:09
Java
UTF-8
Java
false
false
249
java
package com.udemy.app.ws.ui.model.request; public class PasswordResetRequestModel { private String email; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
63e26ff6b93cb02508ec6791da1f3f9a7a38d0de
1c697c12e2b1bb2be112b5c3a3b4fc8b3b8db656
/taotao/taotao-manager/taotao-manager-service/src/main/java/com/taotao/service/impl/ContentServiceImpl.java
a3150778fb80b0d55dd342656a58995f04e2830e
[]
no_license
LWABCD/gite
e5f3b35e385847bfc7230ac4e57af1929caa4259
b3b979e279ca0172d763a2fbaa00e07feb12fa6d
refs/heads/master
2022-12-17T02:09:47.915224
2019-10-23T07:11:31
2019-10-23T07:11:31
185,753,312
2
0
null
2022-12-16T05:01:21
2019-05-09T07:57:51
JavaScript
UTF-8
Java
false
false
1,858
java
package com.taotao.service.impl; import java.util.Date; import java.util.List; import org.apache.http.client.HttpClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.taotao.common.pojo.EUDataGridResult; import com.taotao.common.pojo.TaotaoResult; import com.taotao.common.utils.HttpClientUtil; import com.taotao.mapper.TbContentMapper; import com.taotao.pojo.TbContent; import com.taotao.pojo.TbContentExample; import com.taotao.service.ContentService; /** * 商品内容服务 * @author LWABCD * */ @Service public class ContentServiceImpl implements ContentService { @Autowired private TbContentMapper contentMapper; @Value("${REST_BASE_URL}") private String REST_BASE_URL; @Value("${REST_CONTENT_SYNC_URL}") private String REST_CONTENT_SYNC_URL; @Override public EUDataGridResult getContentList(long id, int page, int rows) { TbContentExample example=new TbContentExample(); //分页 PageHelper.startPage(page,rows); List<TbContent> list=contentMapper.selectByExample(example); //创建一个返回值对象 EUDataGridResult result=new EUDataGridResult(); result.setRows(list); PageInfo<TbContent> pageInfo=new PageInfo<>(list); result.setTotal(pageInfo.getTotal()); return result; } @Override public TaotaoResult insertContent(TbContent content) { content.setCreated(new Date()); content.setUpdated(new Date()); contentMapper.insert(content); System.out.println(REST_BASE_URL+REST_CONTENT_SYNC_URL); //添加缓存同步逻辑 try { HttpClientUtil.doGet(REST_BASE_URL+REST_CONTENT_SYNC_URL); } catch (Exception e) { e.printStackTrace(); } return TaotaoResult.ok(); } }
f928ceb9ea508038d82500e8b90f5ed5e4ef44b0
edbdb1c0fa0798161a28dabc0f21e157b078ac09
/FinalProject/app/src/free/java/com/udacity/gradle/builditbigger/AdUtils.java
427b35079d7de2688e00805915e5f374233c8692
[ "MIT" ]
permissive
neviscom/ud867
812a42c3064a8a23f7c8ff5549494f34a2cda37e
c71a63eceaed51d62f958e754e67eb29fa7ac05b
refs/heads/master
2020-05-29T08:40:47.182952
2016-10-12T09:23:25
2016-10-12T09:23:25
69,884,525
0
0
null
2016-10-03T15:34:52
2016-10-03T15:34:52
null
UTF-8
Java
false
false
745
java
package com.udacity.gradle.builditbigger; import android.view.View; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; /** * @author Nikita Simonov */ public final class AdUtils { public static void loadAd(View root) { AdView mAdView = (AdView) root.findViewById(R.id.adView); // Create an ad request. Check logcat output for the hashed device ID to // get test ads on a physical device. e.g. // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device." AdRequest adRequest = new AdRequest.Builder() .addTestDevice(AdRequest.DEVICE_ID_EMULATOR) .build(); mAdView.loadAd(adRequest); } }
d0614dbb4ae7ab70ca95a35ed9ed1b1924c7e7b9
42fc38bac6a17912e9463d81308c6a3b7b7fcd82
/src/test/java/com/hdgh0g/bostongenetest/api/v1/controllers/AdminSupportControllerTest.java
bc779e726d93223557882657b1be078ff574bc54
[]
no_license
Hdgh0g/bostongenetest
db1c5dae53f5d88c65f1ee99861f688dfaa3de03
6a9d51d7645a87cad25e04108d1f3e54534bdeed
refs/heads/master
2020-03-28T07:30:35.263916
2018-09-10T05:14:28
2018-09-10T05:14:28
147,906,402
1
0
null
2018-09-10T05:14:29
2018-09-08T06:04:31
Java
UTF-8
Java
false
false
6,081
java
package com.hdgh0g.bostongenetest.api.v1.controllers; import com.hdgh0g.bostongenetest.api.v1.requests.AnswerRequest; import com.hdgh0g.bostongenetest.api.v1.responses.BasicListAppealResponse; import com.hdgh0g.bostongenetest.domain.Appeal; import com.hdgh0g.bostongenetest.domain.AppealStatus; import com.hdgh0g.bostongenetest.domain.TranslationStatus; import com.hdgh0g.bostongenetest.exceptions.ApiException; import com.hdgh0g.bostongenetest.exceptions.ApiExceptionCode; import com.hdgh0g.bostongenetest.repositories.AppealRepositoryTest; import com.hdgh0g.bostongenetest.security.Role; import com.hdgh0g.bostongenetest.security.SecurityConfig; import com.hdgh0g.bostongenetest.service.AppealService; import com.hdgh0g.bostongenetest.service.MessagePropertiesService; import com.hdgh0g.bostongenetest.testutils.web.WebTestUtils; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.Matchers; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import org.springframework.data.web.config.EnableSpringDataWebSupport; import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import java.util.Arrays; import java.util.Collections; import java.util.Optional; import java.util.UUID; @RunWith(SpringRunner.class) @WebMvcTest(AdminSupportController.class) @MockBean(MessagePropertiesService.class) @Import(SecurityConfig.class) @EnableSpringDataWebSupport public class AdminSupportControllerTest { @Autowired private MockMvc mvc; @MockBean private AppealService appealService; @Test @WithMockUser public void testAdminEndpointAsUser() { WebTestUtils.given(mvc) .get(AdminSupportController.PATH) .then() .statusCode(HttpStatus.FORBIDDEN.value()); } @Test public void testEndpointWithoutAuthorization() { WebTestUtils.given(mvc) .get(AdminSupportController.PATH) .then() .statusCode(HttpStatus.UNAUTHORIZED.value()); } @Test @WithMockUser(roles = Role.ADMIN) public void testAppealListWithoutParam() { WebTestUtils.given(mvc) .get(AdminSupportController.PATH) .then() .statusCode(HttpStatus.OK.value()); Mockito.verify(appealService) .getAllAppealsByStatus(org.mockito.Matchers.eq(Collections.singletonList(AppealStatus.OPEN)), Mockito.any()); } @Test @WithMockUser(roles = Role.ADMIN) public void testAppealListWithAllStatuses() { Mockito.doReturn(Collections.singletonList(AppealRepositoryTest.testAppeal())) .when(appealService).getAllAppealsByStatus(Mockito.any(), Mockito.any()); WebTestUtils.given(mvc) .param("status", (Object[]) AppealStatus.values()) .get(AdminSupportController.PATH) .then() .statusCode(HttpStatus.OK.value()) .body("text[0].length()", Matchers.is(BasicListAppealResponse.PREVIEW_TEXT_LIMIT)); Mockito.verify(appealService) .getAllAppealsByStatus(org.mockito.Matchers.eq(Arrays.asList(AppealStatus.values())), Mockito.any()); } @Test @WithMockUser(roles = Role.ADMIN) public void testAllInfoByAppeal() { UUID uuid = UUID.randomUUID(); Appeal appeal = AppealRepositoryTest.testAppeal(); appeal.setTranslation(AppealRepositoryTest.testTranslation()); Mockito.doReturn(Optional.of(appeal)).when(appealService).findAppealById(uuid); WebTestUtils.given(mvc) .get(AdminSupportController.PATH + "/{uuid}", uuid) .then() .statusCode(HttpStatus.OK.value()) .body("translationStatus", Matchers.is(TranslationStatus.TRANSLATED.name())) .body("username", Matchers.is(appeal.getUsername())) .body("text", Matchers.is(appeal.getTranslation().getTranslatedText())); } @Test @WithMockUser(roles = Role.ADMIN) public void testAllInfoNotFound() { Mockito.doReturn(Optional.empty()).when(appealService).findAppealById(Mockito.any()); WebTestUtils.given(mvc) .get(AdminSupportController.PATH + "/{uuid}", UUID.randomUUID()) .then() .statusCode(HttpStatus.NOT_FOUND.value()); } @Test @WithMockUser(roles = Role.ADMIN, username = "admin") public void testPostAnswer() throws ApiException { AnswerRequest request = testAnswerRequest(); WebTestUtils.given(mvc) .body(request) .post(AdminSupportController.PATH + "/answer") .then() .statusCode(HttpStatus.NO_CONTENT.value()); Mockito.verify(appealService).addAnswer(org.mockito.Matchers.eq(request), org.mockito.Matchers.eq("admin")); } @Test @WithMockUser(roles = Role.ADMIN) public void testErrorPostAnswer() throws ApiException { AnswerRequest request = testAnswerRequest(); Mockito.doThrow(new ApiException(ApiExceptionCode.ALREADY_ANSWERED)).when(appealService).addAnswer(Mockito.any(), Mockito.any()); WebTestUtils.given(mvc) .body(request) .post(AdminSupportController.PATH + "/answer") .then() .statusCode(HttpStatus.BAD_REQUEST.value()); } private AnswerRequest testAnswerRequest() { AnswerRequest request = new AnswerRequest(); request.setText(RandomStringUtils.randomAlphabetic(500)); request.setAppealId(UUID.randomUUID()); return request; } }
e6b80346b8de884e40409ba80c44315aed6cf9be
f9caed2a83812b8f5bb8aaac5445718e98bf3706
/TT Chen CSE148 Lecture 15 File IO/src/objectIO/Student.java
46d255a18763e4158c1bbf7efc1e3ac036054379
[]
no_license
abrarabdur/CSE148
117905149ca8476d160273defc960a8920fdc869
e8621b02da66cc854bea3d4fb07225ff6fec3647
refs/heads/master
2021-08-23T21:37:33.579834
2017-12-06T17:06:20
2017-12-06T17:06:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package objectIO; import java.io.Serializable; public class Student extends Person implements Serializable { private String name; private String id; public Student(String name, String id, String gender) { super(gender); this.name = name; this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId() { return id; } public void setId(String id) { this.id = id; } @Override public String toString() { return "Student [name=" + name + ", id=" + id + ", gender=" + getGender() + "]"; } }
be93fba01c71db03053c981b4821cbe0cabaecfc
a1eb1bf8ff1e17958c6d4b5b8a416ba89ddb4137
/Drive Green/Server/src/lk/ijse/DG/service/customImpl/TestServiceImpl.java
7a76ac903a0199425ce36c906153461afb31537c
[]
no_license
sandun23/Emission-Test-System
70fa2caa315fd4f595048187a2e555db4444cdd9
af461b2522598ce37c59aaf5ee967b8076aa2e50
refs/heads/master
2022-01-07T17:14:40.653000
2019-01-05T11:25:49
2019-01-05T11:25:49
164,208,148
1
0
null
null
null
null
UTF-8
Java
false
false
2,467
java
package lk.ijse.DG.service.customImpl; import lk.ijse.DG.business.BusinessFactory; import lk.ijse.DG.business.custom.TestBO; import lk.ijse.DG.business.custom.TesterBO; import lk.ijse.DG.dto.TestDTO; import lk.ijse.DG.dto.TesterDTO; import lk.ijse.DG.observer.Observer; import lk.ijse.DG.reservation.ReservationImpl; import lk.ijse.DG.service.TestService; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.util.ArrayList; import java.util.List; public class TestServiceImpl extends UnicastRemoteObject implements TestService { TestBO testBO = BusinessFactory.getInstance().getBusiness(BusinessFactory.BusinessTypes.TEST); private static ArrayList<Observer> allTestsObserver = new ArrayList <>(); public static ReservationImpl<TestService> testServiceReservation = new ReservationImpl <>(); public TestServiceImpl() throws RemoteException { } @Override public boolean saveTest(TestDTO testDTO) throws Exception { notifyAllObserver(testDTO.getTid()+" "+"Test Has Complete"); return testBO.saveTest(testDTO); } @Override public boolean updateTest(TestDTO testDTO) throws Exception { return false; } @Override public boolean deleteTest(TestDTO testDTO) throws Exception { return false; } @Override public TestDTO searchTest(String name) throws Exception { return null; } @Override public List<TestDTO> getAllTests() throws Exception { return null; } @Override public void register(Observer observer) throws Exception { allTestsObserver.add(observer); } @Override public void unregister(Observer observer) throws Exception { allTestsObserver.remove(observer); } @Override public void notifyAllObserver(String message) throws Exception { for (Observer observer : allTestsObserver){ new Thread(new Runnable() { @Override public void run() { try{ observer.update(message); } catch (Exception e) { e.printStackTrace(); } } }).start(); } } @Override public boolean reserved(Object id) throws Exception { return false; } @Override public boolean released(Object id) throws Exception { return false; } }
fe033e2f1785c6aa27a10399e3090c8aaa588b55
41b873ef151168deaae2bbc200f3bafe76bf0036
/src/main/java/com/muh_api/muh_api/Service/MevzuatServiceImp.java
990b0a7b2b37fee5ae562eabfe56a013e16c0d7a
[]
no_license
fatihdrn/muh_api
93f42b4797e4e1062f324ac2fcab5bcc276ca73f
8f94be9a64ac0138905844b6f3d7ae99e4fbebbb
refs/heads/master
2022-11-13T23:55:17.297266
2020-07-06T12:17:08
2020-07-06T12:17:08
268,062,544
0
0
null
null
null
null
UTF-8
Java
false
false
870
java
package com.muh_api.muh_api.Service; import com.muh_api.muh_api.DAO.MevzuatDAOImp; import com.muh_api.muh_api.Entity.Mevzuat1; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service public class MevzuatServiceImp implements MevzuatService{ private MevzuatDAOImp mevzuatDAOImp; public MevzuatServiceImp(MevzuatDAOImp themevzuatDAOImp){ mevzuatDAOImp=themevzuatDAOImp; } @Override @Transactional public void mevzuatEkle(Mevzuat1 mevzuat1) { mevzuatDAOImp.mevzuatEkle(mevzuat1); } @Override @Transactional public void mevzuatDelete(int id) { mevzuatDAOImp.mevzuatDelete(id); } @Override @Transactional public List<Mevzuat1> findMevzuats() { return mevzuatDAOImp.findMevzuats(); } }
9c7a7fff9ee81d773c46fbaf748e3bcfa87bd1d4
323f203bbcd3ec56827ba546a3f2212e800346cd
/photo-manager-bot/src/main/java/com/kideya/photomanagerbot/botapi/commands/subscribe_processing/CommandProcessor.java
9634338c76249924d254e1d12e13e71e65d3400f
[]
no_license
kideya-team/photo-manager-services
cc848c3073656a99e1029f618d78490fdddd16f7
f0d4dbe4cded1d5ffce801e748179d08dc6fd9f0
refs/heads/main
2023-07-18T06:26:57.198858
2021-09-08T10:34:59
2021-09-08T10:34:59
402,786,309
0
0
null
2021-09-08T10:35:00
2021-09-03T13:51:45
Java
UTF-8
Java
false
false
325
java
package com.kideya.photomanagerbot.botapi.commands.subscribe_processing; import org.springframework.stereotype.Component; import org.telegram.telegrambots.meta.api.methods.BotApiMethod; import org.telegram.telegrambots.meta.api.objects.Update; public interface CommandProcessor { BotApiMethod<?> process(Update update); }
0b843db412c20daa2401d4fbb358809e2b6327fa
c4d39be01643a9ecc2e447ffe557ff4bc8003f30
/app/src/main/java/com/naestech/f_tleave/Apply_Leave_Frag.java
df6e8eb3d6328bf5ff2ce19af756ca64fbb57a23
[]
no_license
prasanthandroiddeveloper/leaveApp
4f7acacca5fceed1a7275421dddca7a0be030140
cf71f9a57e15b83d85c4d2d4a4c5817d1765fea7
refs/heads/master
2020-12-12T05:13:51.378877
2020-01-15T09:53:50
2020-01-15T09:53:50
234,050,625
0
0
null
null
null
null
UTF-8
Java
false
false
18,781
java
package com.naestech.f_tleave; import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.net.Uri; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.google.android.material.snackbar.Snackbar; import com.google.firebase.FirebaseApp; import com.naestech.f_tleave.utils.Config; import com.naestech.f_tleave.utils.Date_Picker_Dialog; import com.naestech.f_tleave.utils.Utils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import static com.naestech.f_tleave.utils.Config.LEAVEINSERTDATA; import static com.naestech.f_tleave.utils.Config.UPDATERSN; public class Apply_Leave_Frag extends Fragment { public Apply_Leave_Frag() { } SharedPrefs sp; List<String> spnamelist,idslist,fcmlist; Button singlebtn,multiplebtn,submit; LinearLayout mullyt,sllyt,fllyt,tllyt,asgnlyt; String Fromdate,Todate,btnType,rsn,permission_hrs, dept_name,ename,Suppname,ltype,fetch_fcm,permsn_hrs,Todaydate,stainsrt,fetch_email; int Dpt_Id,userid; TextView FromTv,ToTv,tv,Adminname,fulltv,halftv,weektv,subtv; EditText reason,hrs; Progress_Dialog pdialog; RelativeLayout rlyt; long minDate = System.currentTimeMillis() - 1000; String FromDate,ToDate; Dialog subdlg; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_apply_leave, container, false); Objects.requireNonNull(getActivity()).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE ); FirebaseApp.initializeApp(getActivity()); pdialog = new Progress_Dialog(getActivity()); pdialog.setCancelable(false); Objects.requireNonNull(pdialog.getWindow()).setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); FromDate = Utils.DatetoStr(System.currentTimeMillis(),0); ToDate = Utils.DatetoStr(System.currentTimeMillis()+86400000L,0); // blyt = view.findViewById(R.id.btnllyt); submit = view.findViewById(R.id.submit); rlyt = view.findViewById(R.id.RLlyt); singlebtn = view.findViewById(R.id.singlebtn); multiplebtn = view.findViewById(R.id.multiplebtn); mullyt = view.findViewById(R.id.multiplellyt); tv = view.findViewById(R.id.tv); hrs = view.findViewById(R.id.hrs); fllyt=view.findViewById(R.id.fllyt); tllyt=view.findViewById(R.id.tllyt); asgnlyt= view.findViewById(R.id.AsgnLyt); reason = view.findViewById(R.id.reasonEt); Adminname = view.findViewById(R.id.ANameTv); sp = new SharedPrefs(getActivity()); Dpt_Id = Integer.parseInt(sp.getUId()); ename = sp.getUName(); userid = sp.getUTypeId(); dept_name = sp.getdeptname(); fetch_email = sp.getemail(); Log.i("Did", String.valueOf(Dpt_Id)); getspindata(); multiplebtn.setOnClickListener(v -> { btnType = "multiple"; stainsrt = "Pending"; multiplebtn.setBackgroundResource(R.drawable.select); singlebtn.setBackgroundResource(R.drawable.btn_gradient); fllyt.setVisibility(View.VISIBLE); reason.setVisibility(View.VISIBLE); asgnlyt.setVisibility(View.VISIBLE); tllyt.setVisibility(View.VISIBLE); hrs.setVisibility(View.GONE); if(FromTv != null ){ FromTv.setText(""); } if(ToTv != null ){ ToTv.setText(""); } if(reason != null){ reason.setText(""); } }); submit.setOnClickListener(v -> { rsn = reason.getText().toString(); permission_hrs = hrs.getText().toString(); Fromdate = FromTv.getText().toString(); Todate = ToTv.getText().toString(); ltype = ""; //todo changed here 06-12-2019 if(btnType.equals("single")){ subdlg=new Dialog(getActivity()); subdlg.setContentView(R.layout.slctleave); Objects.requireNonNull(subdlg.getWindow()).setLayout(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT); subdlg.show(); fulltv=subdlg.findViewById(R.id.fulldayTV); halftv=subdlg.findViewById(R.id.halfdayTV); weektv=subdlg.findViewById(R.id.woffTV); subtv=subdlg.findViewById(R.id.subTV); fulltv.setOnClickListener(view1 -> { ltype = "fullday"; stainsrt = "Pending"; fulltv.setBackgroundResource(R.drawable.select); halftv.setBackgroundResource(R.drawable.btn_day); weektv.setBackgroundResource(R.drawable.btn_day); }); halftv.setOnClickListener(view1 -> { ltype = "halfday"; stainsrt = "Pending"; halftv.setBackgroundResource(R.drawable.select); fulltv.setBackgroundResource(R.drawable.btn_day); weektv.setBackgroundResource(R.drawable.btn_day); }); weektv.setOnClickListener(view1 -> { ltype = "weekoff"; stainsrt="Pending"; weektv.setBackgroundResource(R.drawable.select); halftv.setBackgroundResource(R.drawable.btn_day); fulltv.setBackgroundResource(R.drawable.btn_day); }); subtv.setOnClickListener(view1 -> { if(Utils.isNullOrEmpty(Suppname)){ Utils.makeToast(getActivity(), "Lead not Assigned"); } else { getdata2(); } }); } else{ if(Utils.isNullOrEmpty(Suppname)){ Utils.makeToast(getActivity(), "Lead not Assigned"); } else { getdata2(); } } }); fllyt.setOnClickListener(v -> { submit.setVisibility(View.VISIBLE); stdate(); }); FromTv = view.findViewById(R.id.fromTV); ToTv = view.findViewById(R.id.toTV); singlebtn.setOnClickListener(v -> { btnType = "single"; asgnlyt.setVisibility(View.VISIBLE); singlebtn.setBackgroundResource(R.drawable.select); multiplebtn.setBackgroundResource(R.drawable.btn_gradient); fllyt.setVisibility(View.VISIBLE); tllyt.setVisibility(View.GONE); tv.setBackgroundColor(Color.WHITE); reason.setVisibility(View.VISIBLE); if(FromTv != null ){ FromTv.setText(""); } if(reason != null){ reason.setText(""); } }); Todaydate = String.valueOf(android.text.format.DateFormat.format("dd-MM-yyyy", new java.util.Date())); return view; } public void stdate() { minDate = System.currentTimeMillis() - 1000; new Date_Picker_Dialog(getActivity(),minDate,System.currentTimeMillis() - 1000+31536000000L).DateDialog(sdate -> { FromDate = sdate; Calendar newcal = Calendar.getInstance(); newcal.setTime(Utils.StrtoDate(0,sdate)); newcal.add(Calendar.DATE, 1); minDate = newcal.getTimeInMillis(); ToDate = Utils.DatetoStr(newcal.getTime(),0); FromTv.setText(Utils.ChangeDateFormat(FromDate,9)); if(btnType.equals("multiple")){ etdate(); } }); } public void etdate() { Calendar newcal = Calendar.getInstance(); newcal.setTime(Utils.StrtoDate(0,FromDate)); newcal.add(Calendar.DATE, 1); minDate = newcal.getTimeInMillis(); new Date_Picker_Dialog(getActivity(),minDate,System.currentTimeMillis() - 1000+31536000000L).DateDialog(sdate -> { ToDate = sdate; ToTv.setText(Utils.ChangeDateFormat(ToDate,9)); }); } private void getspindata() { spnamelist = new ArrayList<>(); idslist = new ArrayList<>(); fcmlist = new ArrayList<>(); StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.GETSPINNERDATA, response -> { Log.i("resp1",response); try { JSONArray jarr = new JSONArray(response); for (int i = 0; i < jarr.length(); i++) { JSONObject json = jarr.getJSONObject(i); Suppname = json.getString("asgn_to"); Adminname.setText(Suppname); } getfcmtoken(); } catch (JSONException e) { Toast.makeText(getActivity(), "Something went wrong", Toast.LENGTH_SHORT).show(); } }, error -> { Toast.makeText(getActivity(), "Something went wrong.", Toast.LENGTH_LONG).show(); }) { @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("empname", ename); Log.i("spparams", String.valueOf(params)); return params; } }; RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } private void getfcmtoken(){ StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.FETCHFCMTOKEN, response -> { Log.i("t",response); try { JSONArray jarry = new JSONArray(response); for(int i=0;i<jarry.length();i++){ JSONObject jobj = jarry.getJSONObject(i); fetch_fcm = jobj.getString("fcm_token"); Log.i("fetch_fcm",fetch_fcm); } } catch (JSONException e) { e.printStackTrace(); } }, error -> { Toast.makeText(getActivity(),"something went wrong Try again 2",Toast.LENGTH_SHORT).show(); }) { @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("Suppname", Suppname); Log.i("iparams", String.valueOf(params)); return params; } }; stringRequest.setShouldCache(false); RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } private void getnot() { pdialog.show(); StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.GETNOT, response -> { pdialog.dismiss(); Log.i("sr",response); }, error -> { Toast.makeText(getActivity(),"something went wrong Try again 1",Toast.LENGTH_SHORT).show(); }) { @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("id", String.valueOf(userid)); params.put("fcm_token", fetch_fcm); params.put("S_date", Fromdate); params.put("e_name", ename); params.put("freason", rsn); params.put("T_date", Todate); Log.i("ja", String.valueOf(params)); return params; } }; stringRequest.setShouldCache(false); RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } private void getdata2() { Fromdate = FromTv.getText().toString(); Todate = ToTv.getText().toString(); pdialog.show(); StringRequest stringRequest = new StringRequest(Request.Method.POST,Config.GETDATA,response -> { pdialog.dismiss(); Log.i("fetchres",response); if(!(response.equals("No Result"))){ Toast.makeText(getActivity()," Already applied leave for this date",Toast.LENGTH_SHORT).show(); if(btnType.equals("single")){ subdlg.dismiss(); } try { JSONArray jarry = new JSONArray(response); for(int i=0;i<jarry.length();i++){ JSONObject jobj = jarry.getJSONObject(i); String stats = jobj.getString("status"); Log.i("status",stats); if( stats.equals("Not Approved") || stats.equals("Pending") ){ Snackbar snackbar = Snackbar.make(rlyt, "Leave Not Approved So Sent notofication ", Snackbar.LENGTH_LONG); snackbar.show(); getupdatersn(); } } } catch (JSONException e) { e.printStackTrace(); } }else{ if(Suppname!=null){ insertrow();} else{ Utils.makeToast(getActivity(),"Lead Not Assigned"); } } },error -> { }){ @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("f_name",ename); params.put("f_id", String.valueOf(userid)); params.put("date",Fromdate ); Log.i("fpar", String.valueOf(params)); return params; } }; RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } private void getupdatersn() { pdialog.show(); StringRequest stringRequest = new StringRequest(Request.Method.POST, UPDATERSN, response -> { pdialog.dismiss(); reason.setText(""); hrs.setText(""); FromTv.setText(""); ToTv.setText(""); submit.setVisibility(View.GONE); getnot(); Log.i("rsnRsp", response); }, error -> { Toast.makeText(getActivity(), "Something went wrong.", Toast.LENGTH_LONG).show(); }) { @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("name",ename); params.put("id", String.valueOf(userid)); params.put("date", Fromdate); params.put("reason", rsn); //params.put("type", btnType); Log.i("par", String.valueOf(params)); return params; } }; RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } private void insertrow() { pdialog.show(); if(btnType.equals("single")){ if(Fromdate.equals("") || rsn.length() == 0 || Suppname == null || ltype.equals("")){ pdialog.dismiss(); subdlg.dismiss(); Snackbar snackbar = Snackbar.make(rlyt, "Fields should not be empty", Snackbar.LENGTH_LONG); snackbar.show(); }else{ insertdata(); } }else { if(Fromdate.equals("") || rsn.length() == 0 || Suppname == null ){ pdialog.dismiss(); Snackbar snackbar = Snackbar.make(rlyt, "Fields should not be empty", Snackbar.LENGTH_LONG); snackbar.show(); }else{ insertdata(); } } } private void insertdata() { pdialog.show(); getnot(); // getmail(); StringRequest stringRequest = new StringRequest(Request.Method.POST, LEAVEINSERTDATA, response -> { pdialog.dismiss(); Log.i("ServerResponse", response); if(btnType.equals("single")){ subdlg.dismiss(); } reason.setText(""); hrs.setText(""); FromTv.setText(""); ToTv.setText(""); Dialog dialog = new Dialog(Objects.requireNonNull(getActivity())); dialog.setContentView(R.layout.textview_layout); ((TextView)dialog.findViewById(R.id.txt)).setText("You have sucessfully Applied Leave"+" "+Fromdate+" "+Todate); dialog.show(); }, error -> { Toast.makeText(getActivity(), "Something went wrong.", Toast.LENGTH_LONG).show(); }) { @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<>(); params.put("type", btnType); params.put("dept_id", String.valueOf(Dpt_Id)); params.put("FDate", Fromdate); params.put("reason", rsn); params.put("apr_by", Suppname); params.put("TDate", Todate); params.put("status",stainsrt); params.put("user_id", String.valueOf(userid)); params.put("ltype", (ltype!=null) ? ltype:" "); Log.i("par", String.valueOf(params)); return params; } }; RequestQueue requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getActivity())); requestQueue.add(stringRequest); } }
5c08cfd0b07636191b40e7d9d1b41592b1157cd3
d664922140376541680caeff79873f21f64eb5aa
/branches/results-pus/GAP/src/net/sf/gap/ui/UserInterface.java
d4ebb19976880b271840c67a562e93daa53e7740
[]
no_license
gnovelli/gap
7d4b6e2eb7e1c0e62e86d26147c5de9c558d62f7
fd1cac76504d10eb96294a768833a9bdb102e66f
refs/heads/master
2021-01-10T20:11:00.977571
2012-02-23T20:19:44
2012-02-23T20:19:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,349
java
/* **************************************************************************************** * Copyright © Giovanni Novelli * All Rights Reserved. **************************************************************************************** * * Title: GAP Simulator * Description: GAP (Grid Agents Platform) Toolkit for Modeling and Simulation * of Mobile Agents on Grids * License: GPL - http://www.gnu.org/copyleft/gpl.html * * UserInterface.java * * Created on 4 March 2007, 13.51 by Giovanni Novelli * * $Id: UserInterface.java 275 2008-01-27 10:39:07Z gnovelli $ * */ package net.sf.gap.ui; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; /** * * @author Giovanni Novelli */ public class UserInterface extends javax.swing.JFrame { /** * */ private static final long serialVersionUID = -8687484659669194891L; /** Creates new form UserInterface */ public UserInterface(String title) { super(title); initComponents(); initConsole(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code // <editor-fold defaultstate="collapsed" desc=" Generated Code // ">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); console = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); console.setColumns(20); console.setFont(new java.awt.Font("Monospaced", 0, 10)); console.setRows(5); jScrollPane1.setViewportView(console); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout( jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING).addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 738, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING).addComponent( jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout( getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout .setVerticalGroup(layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING).addGroup( layout.createSequentialGroup().addGap(29, 29, 29) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); pack(); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextArea console; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; // End of variables declaration//GEN-END:variables private ConsoleOutputStream outputStream = null; private PrintStream printStream = null; private OutputStream copy = null; private void initConsole() { this.installConsole(); } public synchronized void updateConsole() { jScrollPane1.getVerticalScrollBar().setValue( jScrollPane1.getVerticalScrollBar().getMaximum()); } public void setCopyOutputStream(OutputStream c) { setCopy(c); } public OutputStream getOutputStream() { if (outputStream == null) outputStream = new ConsoleOutputStream(this, System.out); return outputStream; } public PrintStream getPrintStream() { if (printStream == null) printStream = new PrintStream(getOutputStream(), true); return printStream; } public void installConsole() { System.setOut(getPrintStream()); System.setErr(getPrintStream()); } // WARNING - doesn't correctly translate bytes to chars. private class ConsoleOutputStream extends OutputStream { OutputStream orig; UserInterface ui; public ConsoleOutputStream(UserInterface ui, OutputStream o) { orig = o; this.ui = ui; } @Override public void write(int b) throws IOException { orig.write(b); if (getCopy() != null) getCopy().write(b); byte[] buf = new byte[1]; buf[0] = (byte) b; console.append(new String(buf)); ui.updateConsole(); } @Override public void write(byte[] b, int off, int len) throws IOException { orig.write(b, off, len); if (getCopy() != null) getCopy().write(b, off, len); console.append(new String(b, off, len)); ui.updateConsole(); } } public void setOutputStream(ConsoleOutputStream outputStream) { this.outputStream = outputStream; } public void setPrintStream(PrintStream printStream) { this.printStream = printStream; } public OutputStream getCopy() { return copy; } public void setCopy(OutputStream copy) { this.copy = copy; } }
ca3fbedea692f8916325f5e33473e59f6d12c54d
b4ae03966728e322929f2b23e674ec45fd896fe1
/src/main/java/bit/Bit16_07.java
fd1c734f510e1be8157249d3141e0accca30ebd8
[]
no_license
markey92/leetcode
21b4024cdffa4685ee583f6da0d766d5b8bcd6fe
c6efae4ca1dfd94da56442c2b049333ca7cff4dd
refs/heads/master
2022-02-10T15:16:50.279446
2022-01-16T02:23:40
2022-01-16T02:23:40
210,847,391
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package bit; /** * @ProjectName: leetcode * @Package: bit * @ClassName: Bit16_07 * @Author: markey * @Description: * @Date: 2020/6/1 21:49 * @Version: 1.0 */ public class Bit16_07 { public int maximum(int a, int b) { //方法1:使用两个数相减的正负号 ,来确定大小 //a-b两数相减二进制首位是符号:若首位是0,则a大,返回arr[0],即a;否则首位是1,说明b返回arr[1] //求首位:(a-b)>>>63 (无符号移63位,将首位,也就是符号位移到最后) //a-b可能回数值过大,int 无法表示,转为long // int [] arr={a,b}; // return arr[(int)(((long)a - b)>>> 63)]; //方法2:根据提示求,k // int k = (int)(((long)a - (long)b) >> 63) & 1;//得符号位,若为1:说明是负数,a小,b 大 int k = (int)(((long)a - (long)b) >>> 63); return b * k + a * (k ^ 1);//0或1 } }
e12841cf1f8a706057b0de3dccc75a4611c80888
1a562f67e4ab435ac5ff3bf702592cea114d8831
/2/Desarrollo entorno servidor/Evaluacion - 3/Ejercicios/tutorial-spring/demo/src/main/java/com/losenlaces/demo/services/ChickenBreastsService.java
2ad1c254c1402c401a9905d9e1d8ee4a4544ff0f
[]
no_license
ericmoros/Desarrollo-web
cf5f5a28b2a1030c0c7cbd6e116f218e43a9259e
dc20af9c71bacb389fa2b3edf8135ed66db9c0ed
refs/heads/master
2023-01-12T21:03:22.144409
2020-10-01T19:21:58
2020-10-01T19:21:58
103,789,109
3
2
null
2023-01-05T01:57:56
2017-09-16T22:58:48
HTML
UTF-8
Java
false
false
1,008
java
package com.losenlaces.demo.services; import java.util.List; import com.losenlaces.demo.models.ChickenBreast; import com.losenlaces.demo.repositories.ChickenBreastsRepository; import org.springframework.stereotype.Service; /** * ChickenBreasts */ @Service public class ChickenBreastsService { private ChickenBreastsRepository ChickenBreastsRepository; public ChickenBreastsService(ChickenBreastsRepository chickenBreastsRepository) { this.ChickenBreastsRepository = chickenBreastsRepository; } public List<ChickenBreast> GetAll() { return ChickenBreastsRepository.findAll(); } public void RemoveAll() { ChickenBreastsRepository.deleteAll(); } public List<ChickenBreast> SaveAll(List<ChickenBreast> chickenBreasts) { return ChickenBreastsRepository.saveOrUpdateAll(chickenBreasts); } public ChickenBreast Get(Integer chickenBreastId) { return ChickenBreastsRepository.findByChickenBreastId(chickenBreastId); } }
4dc428dcbab4a014e5dae3b7bbbab65d3da3ebbb
e42e9118f25d6558443a784f73205c46952c70e4
/client/Ping/src/com/num/activities/DataCapActivity.java
b1f11f30e5f73e922148cd37e0fea64c383312fa
[]
no_license
msp8955/myspeedtest_old
14f2c1fca81337bccec886fc97c6eca7707e24c2
c58cf0ed0099c7d8db7ee46ead23ea491f75de23
refs/heads/master
2021-01-20T23:21:16.717346
2014-09-05T16:33:49
2014-09-05T16:33:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,859
java
package com.num.activities; import com.num.R; import com.num.helpers.UserDataHelper; import com.num.utils.PreferencesUtil; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; public class DataCapActivity extends Activity { private Activity activity; private RadioGroup radioGroup; private int[] limit_val= {-1,0,-2,250,500,750,1000,2000,9999}; private String[] limit_text = {"Don't have one","Don't know","Prepaid","250 MB","500 MB","750 MB","1 GB","2 GB","More than 2GB"}; private boolean force = false; private UserDataHelper userhelp; private Button saveButton, skipButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); userhelp = new UserDataHelper(this); activity = this; try{ force = extras.getBoolean("force"); } catch (Exception e){ force = false; } //Skip if data is already present if(!force && PreferencesUtil.contains("dataLimit", this)){ finish(); Intent myIntent = null; if(!PreferencesUtil.contains("emailData", activity)){ myIntent = new Intent(activity, EmailActivity.class); } else { myIntent = new Intent(activity, MainActivity.class); } startActivity(myIntent); } setContentView(R.layout.activity_data_cap); int cap = userhelp.getDataCap(); radioGroup = (RadioGroup) findViewById(R.id.data_cap_radio_group); LinearLayout.LayoutParams rg = new RadioGroup.LayoutParams( RadioGroup.LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); for(int i=0; i<limit_text.length; i++){ RadioButton radiobutton = new RadioButton(this); radiobutton.setText(limit_text[i]); radiobutton.setId(i); radiobutton.setTextColor(Color.GRAY); if(cap==limit_val[i]) radiobutton.setChecked(true); radioGroup.addView(radiobutton, rg); } saveButton = (Button) findViewById(R.id.data_cap_save_button); skipButton = (Button) findViewById(R.id.data_cap_skip_button); saveButton.setOnClickListener(new OnClickListener(){ public void onClick(View v) { int checkedRadioButton = radioGroup.getCheckedRadioButtonId(); if(checkedRadioButton<0) return; userhelp.setDataCap(limit_val[checkedRadioButton]); finish(); Intent myIntent; if(force){ finishActivity(0); return; } else{ if(!PreferencesUtil.contains("emailData", activity)){ myIntent = new Intent(v.getContext(), EmailActivity.class); } else { myIntent = new Intent(v.getContext(), MainActivity.class); } } myIntent.putExtra("force", force); startActivity(myIntent); } }); skipButton.setOnClickListener(new OnClickListener(){ public void onClick(View v) { if(!PreferencesUtil.contains("dataLimit", DataCapActivity.this)){ userhelp.setDataCap(limit_val[0]); //default to "don't know" } finish(); if(force){ finishActivity(0); return; } else{ Intent myIntent = null; if(!PreferencesUtil.contains("emailData", activity)){ myIntent = new Intent(v.getContext(), EmailActivity.class); } else { myIntent = new Intent(v.getContext(), MainActivity.class); } myIntent.putExtra("force", force); startActivity(myIntent); } } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.data_cap, menu); return true; } }
caabe312ae76327d4a9a54a6cff47beb7fb59168
04958d0d39014d929402f11671cbae2f0aea010d
/mytaxi/src/main/java/com/example/richie/mytaxi/BookCab.java
2542b58546e85517762aea109c302c72044a7147
[]
no_license
siddharthchugh/Tabs
5cd86b9a78bd76d089cabd51b6d6150126ffd36b
0822645bb29c2cc3dac16a75c122528f9dca0b35
refs/heads/master
2021-01-10T03:17:01.028961
2015-09-27T14:26:41
2015-09-27T14:26:41
43,249,517
0
0
null
null
null
null
UTF-8
Java
false
false
1,874
java
package com.example.richie.mytaxi; import android.content.Intent; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.app.NavUtils; import android.support.v4.app.TaskStackBuilder; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; public class BookCab extends ActionBarActivity { Toolbar tb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_book_cab); tb = (android.support.v7.widget.Toolbar)findViewById(R.id.toolBar); setSupportActionBar(tb); getSupportActionBar().setDisplayHomeAsUpEnabled(true); Cab_fragment session = new Cab_fragment(); FragmentManager manage = getSupportFragmentManager(); FragmentTransaction tran = manage.beginTransaction().add(R.id.bookCab,session,""); tran.commit(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_book_cab, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement switch (id){ case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } }
675e73ea5489f1dfffe03cf7674b3353608e6431
f6c5ffac1013c15f8d8c46feed1767b30578f5c1
/q07/Q08.java
c5226b970a015d5be3d31abec88224cfb6ab2cb3
[]
no_license
cjy-code/SSang_Yong_Q
bf1f226cfad348c09a8768a5f3b5f033e1d09ad7
483b5cc9226b3433e6a2878eb79fe15c0fbea645
refs/heads/master
2023-01-08T21:46:18.126146
2020-11-08T13:04:08
2020-11-08T13:04:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.test.question.q07; public class Q08 { public static void main(String[] args) { String str = ""; for(int num= 2; num<= 100; num++) { for(int j =2; j <=num; j++) { if(num != j && num % j ==0)break; if(num == j) { str += num; str += ", "; } }//for(j) }///for(i) System.out.println(str); } }
bc033f275b45690b331d083d9c318308083242b6
c3ff4dccabffb2f6910e08b08793317a8c9c797c
/modules/models/app/models/Proconsorcio/Sequenciador.java
67e111a7930de0f6447544486b106a2e782555e2
[]
no_license
xdevelsistemas/xDevPlayApp
a671f184d664dae246787352db0547091e24e176
5cf000068c53964f7eba8b8cc001d97501050ffb
refs/heads/master
2021-01-01T17:21:39.626706
2015-01-28T06:09:27
2015-01-28T06:09:27
20,509,511
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package models.Proconsorcio; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * Created by claytonsantosdasilva on 22/07/14. */ @Entity public class Sequenciador { @Id @GeneratedValue @Column(name = "ID") public Long id; }
cdb70532be067c90ed3b43b0904c262940f20988
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_flink_new2/Nicad_t1_flink_new27387.java
b8d068a0851ba17883d6f2900039b7088f28f913
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
614
java
// clone pairs:27436:90% // 42694:flink/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointingStatistics.java public class Nicad_t1_flink_new27387 { public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CheckpointingStatistics that = (CheckpointingStatistics) o; return Objects.equals(counts, that.counts) && Objects.equals(summary, that.summary) && Objects.equals(latestCheckpoints, that.latestCheckpoints) && Objects.equals(history, that.history); } }
0ad46679afe758646bf4a0961333edb4fc18c80c
447520f40e82a060368a0802a391697bc00be96f
/apks/malware/app91/source/android/support/v7/internal/view/menu/MenuPresenter.java
4fba97f6e8c232b37bea529413e1b611ea1ee5f7
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
1,102
java
package android.support.v7.internal.view.menu; import android.content.Context; import android.os.Parcelable; import android.view.ViewGroup; public abstract interface MenuPresenter { public abstract boolean collapseItemActionView(MenuBuilder paramMenuBuilder, MenuItemImpl paramMenuItemImpl); public abstract boolean expandItemActionView(MenuBuilder paramMenuBuilder, MenuItemImpl paramMenuItemImpl); public abstract boolean flagActionItems(); public abstract int getId(); public abstract MenuView getMenuView(ViewGroup paramViewGroup); public abstract void initForMenu(Context paramContext, MenuBuilder paramMenuBuilder); public abstract void onCloseMenu(MenuBuilder paramMenuBuilder, boolean paramBoolean); public abstract void onRestoreInstanceState(Parcelable paramParcelable); public abstract Parcelable onSaveInstanceState(); public abstract boolean onSubMenuSelected(SubMenuBuilder paramSubMenuBuilder); public abstract void setCallback(MenuPresenter.Callback paramCallback); public abstract void updateMenuView(boolean paramBoolean); }
edf0a8d0d010b93938f07a851269da701a4ec30d
e897fe3bc60b9f6987463d18354711f3428748e2
/src/java/Controle/AlunosControl.java
29fe941f4636dd44221ef3b01b0bddd2298dd542
[]
no_license
gmdiias/SistemaEscolar
b6feab92ae72d8def419312fe65a3163d11e4931
4884e95fc9eed01b477e62a25519976e07c6db79
refs/heads/master
2021-08-23T12:46:55.242895
2017-12-04T23:51:11
2017-12-04T23:51:11
105,603,246
0
2
null
null
null
null
UTF-8
Java
false
false
5,179
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 Controle; import Entidades.Aluno; import Modelo.AlunoDAO; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import java.io.Serializable; import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; /** * * @author Gustavo Mendonça */ @Named(value = "alunosControl") @SessionScoped public class AlunosControl implements Serializable { private Aluno aluno = new Aluno(); private AlunoDAO modelo = new AlunoDAO(); private List<Aluno> alunos; private ValidaControl valida = new ValidaControl(); private String raAlunoBusca; private String idTurma; public AlunosControl() { } public String addAluno(){ if(valida.cpfValida(aluno.getCpf())){ modelo.addAluno(aluno); resetaCampos(); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Adicionado", "Sucesso") ); return "consultaAlunos"; } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Erro!", "CPF inválido!")); } return ""; } public List<Aluno> listarAlunos(){ alunos = modelo.getAlunos(); resetaCampos(); return alunos; } public List<Aluno> listarAlunosDel(){ alunos = modelo.getAlunosDel(); resetaCampos(); return alunos; } public String updateAluno(){ if(valida.cpfValida(aluno.getCpf())){ modelo.atualizaAluno(aluno); resetaCampos(); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Atualizado", "Sucesso") ); return "consultaAlunos"; } else { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Erro!", "CPF inválido!")); } return ""; } public String matriculaAluno(){ int id = Integer.parseInt(idTurma); modelo.matriculaAluno(aluno, id); resetaCampos(); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Matriculado", "Sucesso") ); return "consultaAlunos"; } public String removerMatricula(){ modelo.matriculaAluno(aluno, 0); resetaCampos(); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Matriculado", "Sucesso") ); return "consultaAlunos"; } public String buscarAluno(){ int ra; ra = Integer.valueOf(raAlunoBusca); resetaCampos(); aluno = modelo.getAlunoBusca(ra); System.out.println("Pessoa buscada"); if(aluno == null){ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "ID não encontrado!", "ID não encontrado!")); aluno = new Aluno(); return "consultaAlunos"; } return "editarAluno"; } public String deleteAluno(){ modelo.deleteAluno(aluno); resetaCampos(); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Deletado", "Sucesso") ); return "consultaAlunos"; } public String carregarAluno(Aluno a){ aluno = a; return "editarAluno"; } public String retornaAluno(Aluno a){ modelo.retornaAluno(a); FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null, new FacesMessage("Aluno Reativado", "Sucesso") ); resetaCampos(); return "consultaAlunos"; } public Aluno getAluno() { return aluno; } public void setAluno(Aluno aluno) { this.aluno = aluno; } public AlunoDAO getModelo() { return modelo; } public void setModelo(AlunoDAO modelo) { this.modelo = modelo; } public String getRaAlunoBusca() { return raAlunoBusca; } public void setRaAlunoBusca(String raAlunoBusca) { this.raAlunoBusca = raAlunoBusca; } public String getIdTurma() { return idTurma; } public void setIdTurma(String idTurma) { this.idTurma = idTurma; } public void resetaCampos(){ aluno.setNome(null); aluno.setDataNascimento(null); aluno.setCpf(null); aluno.setRg(null); aluno.setSexo(null); aluno.setTelefone(null); aluno.setEndereco(null); aluno.setEmail(null); aluno.setSenha(null); aluno.setCpfResp(null); aluno.setNomeCompResp(null); aluno.setTelefoneResp(null); aluno.setDataNascResp(null); raAlunoBusca = null; } }
b68ce5a151c1b8d918b288abc822ed8f772982ee
f5f149e85f22cb675d8c4ac046e1f29676fdb289
/src/main/java/ImageHoster/controller/ImageController.java
e359a57037164adc10a57dde57d12e17b91940c9
[]
no_license
Rajat0023/ImageUploader
7e051c40c0024315a4a4b669b1c446d300a771ee
f6630c3f7df502bce72f8662c4b21e88c947a641
refs/heads/master
2020-05-05T07:34:53.142199
2019-04-07T14:39:11
2019-04-07T14:39:11
179,830,510
0
0
null
2019-04-07T14:37:24
2019-04-06T12:26:58
Java
UTF-8
Java
false
false
12,074
java
package ImageHoster.controller; import ImageHoster.model.Comment; import ImageHoster.model.Image; import ImageHoster.model.Tag; import ImageHoster.model.User; import ImageHoster.service.ImageService; import ImageHoster.service.TagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.*; @Controller public class ImageController { @Autowired private ImageService imageService; @Autowired private TagService tagService; //This method displays all the images in the user home page after successful login @RequestMapping("images") public String getUserImages(Model model) { List<Image> images = imageService.getAllImages(); model.addAttribute("images", images); return "images"; } //This method is called when the details of the specific image with corresponding title are to be displayed //The logic is to get the image from the databse with corresponding title. After getting the image from the database the details are shown //First receive the dynamic parameter in the incoming request URL in a string variable 'title' and also the Model type object //Call the getImageByTitle() method in the business logic to fetch all the details of that image //Add the image in the Model type object with 'image' as the key //Return 'images/image.html' file //Also now you need to add the tags of an image in the Model type object //Here a list of tags is added in the Model type object //this list is then sent to 'images/image.html' file and the tags are displayed /* Here, The ImageId is dynamically received from the URI using @PathVariable Annotation so that Multiple Images having same title can be easily fetched using a unique ImageId and navigated */ @RequestMapping("/images/{imageId}/{title}") public String showImage(@PathVariable("imageId") Integer imageId, Model model) { Image image = imageService.getImage(imageId); model.addAttribute("image", image); model.addAttribute("tags", image.getTags()); List<Comment> comments = image.getComments(); // Getting the list of comments belonging to a particular image model.addAttribute("comments",comments); // Adding attribute with key as "comments" in the model object return "images/image"; } //This controller method is called when the request pattern is of type 'images/upload' //The method returns 'images/upload.html' file @RequestMapping("/images/upload") public String newImage() { return "images/upload"; } //This controller method is called when the request pattern is of type 'images/upload' and also the incoming request is of POST type //The method receives all the details of the image to be stored in the database, and now the image will be sent to the business logic to be persisted in the database //After you get the imageFile, set the user of the image by getting the logged in user from the Http Session //Convert the image to Base64 format and store it as a string in the 'imageFile' attribute //Set the date on which the image is posted //After storing the image, this method directs to the logged in user homepage displaying all the images //Get the 'tags' request parameter using @RequestParam annotation which is just a string of all the tags //Store all the tags in the database and make a list of all the tags using the findOrCreateTags() method //set the tags attribute of the image as a list of all the tags returned by the findOrCreateTags() method @RequestMapping(value = "/images/upload", method = RequestMethod.POST) public String createImage(@RequestParam("file") MultipartFile file, @RequestParam("tags") String tags, Image newImage, HttpSession session) throws IOException { User user = (User) session.getAttribute("loggeduser"); newImage.setUser(user); String uploadedImageData = convertUploadedFileToBase64(file); newImage.setImageFile(uploadedImageData); List<Tag> imageTags = findOrCreateTags(tags); newImage.setTags(imageTags); newImage.setDate(new Date()); imageService.uploadImage(newImage); return "redirect:/images"; } //This controller method is called when the request pattern is of type 'editImage' //This method fetches the image with the corresponding id from the database and adds it to the model with the key as 'image' //The method then returns 'images/edit.html' file wherein you fill all the updated details of the image //The method first needs to convert the list of all the tags to a string containing all the tags separated by a comma and then add this string in a Model type object //This string is then displayed by 'edit.html' file as previous tags of an image @RequestMapping(value = "/editImage") public String editImage(@RequestParam("imageId") Integer imageId, Model model,HttpSession session) { Image image = imageService.getImage(imageId); String tags = convertTagsToString(image.getTags()); model.addAttribute("image", image); model.addAttribute("tags", tags); User user = (User) session.getAttribute("loggeduser"); /* Checking if the Owner of the image is same as the current logged in user, If not, then an error message is displayed If the owner of the Image and the logged in user are the same, and then images/edit view is returned */ if (image.getUser().getId()!=user.getId()) { String error = "Only the owner of the image can edit the image"; model.addAttribute("editError", error); model.addAttribute("tags",image.getTags()); List<Comment> comments = image.getComments(); model.addAttribute("comments",comments); return "images/image"; } else { return "images/edit"; } } //This controller method is called when the request pattern is of type 'images/edit' and also the incoming request is of PUT type //The method receives the imageFile, imageId, updated image, along with the Http Session //The method adds the new imageFile to the updated image if user updates the imageFile and adds the previous imageFile to the new updated image if user does not choose to update the imageFile //Set an id of the new updated image //Set the user using Http Session //Set the date on which the image is posted //Call the updateImage() method in the business logic to update the image //Direct to the same page showing the details of that particular updated image /* The method also receives tags parameter which is a string of all the tags separated by a comma using the annotation @RequestParam The method converts the string to a list of all the tags using findOrCreateTags() method and sets the tags attribute of an image as a list of all the tags */ @RequestMapping(value = "/editImage", method = RequestMethod.PUT) public String editImageSubmit(@RequestParam("file") MultipartFile file, @RequestParam("imageId") Integer imageId, @RequestParam("tags") String tags, Image updatedImage, HttpSession session) throws IOException { Image image = imageService.getImage(imageId); String updatedImageData = convertUploadedFileToBase64(file); List<Tag> imageTags = findOrCreateTags(tags); if (updatedImageData.isEmpty()) updatedImage.setImageFile(image.getImageFile()); else { updatedImage.setImageFile(updatedImageData); } updatedImage.setId(imageId); User user = (User) session.getAttribute("loggeduser"); updatedImage.setUser(user); updatedImage.setTags(imageTags); updatedImage.setDate(new Date()); imageService.updateImage(updatedImage); return "redirect:/images/"; // + updatedImage.getTitle(); } //This controller method is called when the request pattern is of type 'deleteImage' and also the incoming request is of DELETE type //The method calls the deleteImage() method in the business logic passing the id of the image to be deleted //Looks for a controller method with request mapping of type '/images' @RequestMapping(value = "/deleteImage", method = RequestMethod.DELETE) public String deleteImageSubmit(@RequestParam(name = "imageId") Integer imageId,Model model,HttpSession session) { Image image = imageService.getImage(imageId); model.addAttribute("image", image); model.addAttribute("tags", image.getTags()); User user = (User) session.getAttribute("loggeduser"); /* Checking if the Owner of the image is same as the current logged in user, If not, then an error message is displayed and the user is not allowed to Delete the image. If the owner of the Image and the logged in user are the same, and then the user can delete the images and then the view is Redirected to images.html page (To prevent duplicate copy of the view to be returned) */ if (image.getUser().getId() != user.getId()) { String error = "Only the owner of the image can delete the image"; model.addAttribute("deleteError", error); List<Comment> comments = image.getComments(); model.addAttribute("comments",comments); return "/images/image"; } else { imageService.deleteImage(imageId); return "redirect:/images"; } } //This method converts the image to Base64 format private String convertUploadedFileToBase64(MultipartFile file) throws IOException { return Base64.getEncoder().encodeToString(file.getBytes()); } //findOrCreateTags() method has been implemented, which returns the list of tags after converting the ‘tags’ string to a list of all the tags and also stores the tags in the database if they do not exist in the database. Observe the method and complete the code where required for this method. //Try to get the tag from the database using getTagByName() method. If tag is returned, you need not to store that tag in the database, and if null is returned, you need to first store that tag in the database and then the tag is added to a list //After adding all tags to a list, the list is returned private List<Tag> findOrCreateTags(String tagNames) { StringTokenizer st = new StringTokenizer(tagNames, ","); List<Tag> tags = new ArrayList<Tag>(); while (st.hasMoreTokens()) { String tagName = st.nextToken().trim(); Tag tag = tagService.getTagByName(tagName); if (tag == null) { Tag newTag = new Tag(tagName); tag = tagService.createTag(newTag); } tags.add(tag); } return tags; } //The method receives the list of all tags //Converts the list of all tags to a single string containing all the tags separated by a comma //Returns the string private String convertTagsToString(List<Tag> tags) { StringBuilder tagString = new StringBuilder(); try { for (int i = 0; i <= tags.size() - 2; i++) { tagString.append(tags.get(i).getName()).append(","); } Tag lastTag = tags.get(tags.size() - 1); tagString.append(lastTag.getName()); }catch (ArrayIndexOutOfBoundsException e) { } return tagString.toString(); } }
4099499de03f360d55d8281c924cc989f690204b
32cd70512c7a661aeefee440586339211fbc9efd
/aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/package-info.java
1a381d2e4d495d82293e265c41bd78de5cf6922b
[ "Apache-2.0" ]
permissive
twigkit/aws-sdk-java
7409d949ce0b0fbd061e787a5b39a93db7247d3d
0b8dd8cf5e52ad7ae57acd2ce7a584fd83a998be
refs/heads/master
2020-04-03T16:40:16.625651
2018-05-04T12:05:14
2018-05-04T12:05:14
60,255,938
0
1
Apache-2.0
2018-05-04T12:48:26
2016-06-02T10:40:53
Java
UTF-8
Java
false
false
8,657
java
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ /** * <p>The AWS Application Discovery Service helps Systems Integrators quickly and reliably plan application migration projects by automatically identifying applications running in on-premises data centers, their associated dependencies, and their performance profile.</p> <p> Planning data center migrations can involve thousands of workloads that are often deeply interdependent. Application discovery and dependency mapping are important early first steps in the migration process, but difficult to perform at scale due to the lack of automated tools.</p> <p>The AWS Application Discovery Service automatically collects configuration and usage data from servers to develop a list of applications, how they perform, and how they are interdependent. This information is securely retained in an AWS Application Discovery Service database which you can export as a CSV file into your preferred visualization tool or cloud migration solution to help reduce the complexity and time in planning your cloud migration.</p> <p>The Application Discovery Service is currently available for preview. Only customers who are engaged with <a href="https://aws.amazon.com/professional-services/">AWS Professional Services</a> or a certified AWS partner can use the service. To see the list of certified partners and request access to the Application Discovery Service, complete the following <a href="http://aws.amazon.com/application-discovery/preview/">preview form</a>.</p> <p>This API reference provides descriptions, syntax, and usage examples for each of the actions and data types for the Discovery Service. The topic for each action shows the API request parameters and the response. Alternatively, you can use one of the AWS SDKs to access an API that is tailored to the programming language or platform that you're using. For more information, see <a href="http://aws.amazon.com/tools/#SDKs">AWS SDKs</a>.</p> <p>This guide is intended for use with the <a href="http://docs.aws.amazon.com/application-discovery/latest/userguide/what-is-appdiscovery.html"> <i>AWS Discovery Service User Guide</i> </a>.</p> <p>The following are short descriptions of each API action, organized by function.</p> <p> <b>Managing AWS Agents Using the Application Discovery Service</b> </p> <p>An AWS agent is software that you install on on-premises servers and virtual machines that are targeted for discovery and migration. Agents run on Linux and Windows Server and collect server configuration and activity information about your applications and infrastructure. Specifically, agents collect the following information and send it to the Application Discovery Service using Secure Sockets Layer (SSL) encryption:</p> <ul> <li> <p>User information (user name, home directory)</p> </li> <li> <p>Group information (name)</p> </li> <li> <p>List of installed packages</p> </li> <li> <p>List of kernel modules</p> </li> <li> <p>All create and stop process events</p> </li> <li> <p>DNS queries</p> </li> <li> <p>NIC information</p> </li> <li> <p>TCP/UDP process listening ports</p> </li> <li> <p>TCPV4/V6 connections</p> </li> <li> <p>Operating system information</p> </li> <li> <p>System performance</p> </li> <li> <p>Process performance</p> </li> </ul> <p>The Application Discovery Service API includes the following actions to manage AWS agents:</p> <ul> <li> <p> <i>StartDataCollectionByAgentIds</i>: Instructs the specified agents to start collecting data. The Application Discovery Service takes several minutes to receive and process data after you initiate data collection.</p> </li> <li> <p> <i>StopDataCollectionByAgentIds</i>: Instructs the specified agents to stop collecting data.</p> </li> <li> <p> <i>DescribeAgents</i>: Lists AWS agents by ID or lists all agents associated with your user account if you did not specify an agent ID. The output includes agent IDs, IP addresses, media access control (MAC) addresses, agent health, host name where the agent resides, and the version number of each agent.</p> </li> </ul> <p> <b>Querying Configuration Items</b> </p> <p>A <i>configuration item</i> is an IT asset that was discovered in your data center by an AWS agent. When you use the Application Discovery Service, you can specify filters and query specific configuration items. The service supports Server, Process, and Connection configuration items. This means you can specify a value for the following keys and query your IT assets:</p> <p class="title"> <b>Server</b> </p> <ul> <li> <p>server.HostName</p> </li> <li> <p>server.osName</p> </li> <li> <p>server.osVersion</p> </li> <li> <p>server.configurationId</p> </li> <li> <p>server.agentId</p> </li> </ul> <p class="title"> <b>Process</b> </p> <ul> <li> <p>process.name</p> </li> <li> <p>process.CommandLine</p> </li> <li> <p>process.configurationId</p> </li> <li> <p>server.hostName</p> </li> <li> <p>server.osName</p> </li> <li> <p>server.osVersion</p> </li> <li> <p>server.configurationId</p> </li> <li> <p>server.agentId</p> </li> </ul> <p class="title"> <b>Connection</b> </p> <ul> <li> <p>connection.sourceIp</p> </li> <li> <p>connection.sourcePort</p> </li> <li> <p>connection.destinationIp</p> </li> <li> <p>connection.destinationPort</p> </li> <li> <p>sourceProcess.configurationId</p> </li> <li> <p>sourceProcess.commandLine</p> </li> <li> <p>sourceProcess.name</p> </li> <li> <p>destinationProcessId.configurationId</p> </li> <li> <p>destinationProcess.commandLine</p> </li> <li> <p>destinationProcess.name</p> </li> <li> <p>sourceServer.configurationId</p> </li> <li> <p>sourceServer.hostName</p> </li> <li> <p>sourceServer.osName</p> </li> <li> <p>sourceServer.osVersion</p> </li> <li> <p>destinationServer.configurationId</p> </li> <li> <p>destinationServer.hostName</p> </li> <li> <p>destinationServer.osName</p> </li> <li> <p>destinationServer.osVersion</p> </li> </ul> <p>The Application Discovery Service includes the following actions for querying configuration items. </p> <ul> <li> <p> <i>DescribeConfigurations</i>: Retrieves a list of attributes for a specific configuration ID. For example, the output for a <i>server</i> configuration item includes a list of attributes about the server, including host name, operating system, number of network cards, etc.</p> </li> <li> <p> <i>ListConfigurations</i>: Retrieves a list of configuration items according to the criteria you specify in a filter. The filter criteria identify relationship requirements. For example, you can specify filter criteria of process.name with values of <i>nginx</i> and <i>apache</i>.</p> </li> </ul> <p> <b>Tagging Discovered Configuration Items</b> </p> <p>You can tag discovered configuration items. Tags are metadata that help you categorize IT assets in your data center. Tags use a <i>key</i>-<i>value</i> format. For example, <code>{"key": "serverType", "value": "webServer"}</code>. </p> <ul> <li> <p> <i>CreateTags</i>: Creates one or more tags for a configuration items.</p> </li> <li> <p> <i>DescribeTags</i>: Retrieves a list of configuration items that are tagged with a specific tag. <i>Or</i>, retrieves a list of all tags assigned to a specific configuration item.</p> </li> <li> <p> <i>DeleteTags</i>: Deletes the association between a configuration item and one or more tags.</p> </li> </ul> <p> <b>Exporting Data</b> </p> <p>You can export data as a CSV file to an Amazon S3 bucket or into your preferred visualization tool or cloud migration solution to help reduce the complexity and time in planning your cloud migration.</p> <ul> <li> <p> <i>ExportConfigurations</i>: Exports all discovered configuration data to an Amazon S3 bucket. Data includes tags and tag associations, processes, connections, servers, and system performance. This API returns an export ID which you can query using the GetExportStatus API.</p> </li> <li> <p> <i>DescribeExportConfigurations</i>: Gets the status of the data export. When the export is complete, the service returns an Amazon S3 URL where you can download CSV files that include the data.</p> </li> </ul> */ package com.amazonaws.services.applicationdiscovery;
8df69c530b08ac5aff9d5ac3d84520c850a46c2a
b816dc7764ccf515c74e87ea39709638e46d36ac
/Missito/app/src/main/java/ch/mitto/missito/ui/tabs/chats/ChatsFragment.java
303754519c95ad2f5b107f8e3e1c7b93ff2cee0f
[]
no_license
eyalmnm/Missito_AND
6b0d2f567b01879855276373a2f6bfc4632131a1
d99da630f9231fa072b1c1577f3243ab509d6ce8
refs/heads/master
2020-03-17T03:08:31.323871
2018-05-13T09:20:40
2018-05-13T09:20:40
133,221,846
0
0
null
null
null
null
UTF-8
Java
false
false
9,000
java
package ch.mitto.missito.ui.tabs.chats; import android.ch.mitto.missito.R; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import com.miguelcatalan.materialsearchview.MaterialSearchView; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import ch.mitto.missito.db.model.MessageRec; import ch.mitto.missito.ui.tabs.chats.model.Chat; import ch.mitto.missito.util.RealmDBHelper; import static ch.mitto.missito.net.broker.MQTTConnectionManager.MSG_STATUS_UPDATE_EVENT; import static ch.mitto.missito.net.broker.MQTTConnectionManager.NEW_STATUS_UPDATE_EVENT; import static ch.mitto.missito.util.NotificationHelper.INCOMING_MESSAGE_SAVED; import static ch.mitto.missito.util.NotificationHelper.KEY_MESSAGE; import static ch.mitto.missito.util.NotificationHelper.NEW_TYPING_UID_KEY; import static ch.mitto.missito.util.NotificationHelper.NEW_TYPING_NOTIFICATION; public class ChatsFragment extends Fragment { private static final long REFRESH_INTERVAL = DateUtils.MINUTE_IN_MILLIS; @BindView(R.id.recyclerview_chats) RecyclerView recyclerView; private List<Chat> allChats; private String currentFilter = ""; private ChatsAdapter adapter; MaterialSearchView.OnQueryTextListener onSearchItemClickListener = new MaterialSearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public boolean onQueryTextChange(String newText) { currentFilter = newText.toLowerCase(); adapter.setItems(filterChats(allChats, currentFilter)); return true; } }; private MaterialSearchView searchView; private Listener listener; private Handler typingHandler = new Handler(); private Handler chatUpdateHandler; private HashMap<String, Runnable> typingRunnables = new HashMap<>(); public ChatsFragment() { // Required empty public constructor } private BroadcastReceiver typingNotificationReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String from = intent.getExtras().getString(NEW_TYPING_UID_KEY); if (typingRunnables.containsKey(from)) { typingHandler.removeCallbacks(typingRunnables.get(from)); typingRunnables.remove(from); } final Chat chat = adapter.getChat(from); if (from != null && chat != null) { chat.isTyping = true; adapter.notifyDataSetChanged(); Runnable runnable = new Runnable() { @Override public void run() { chat.isTyping = false; adapter.notifyDataSetChanged(); typingRunnables.remove(from); } }; typingRunnables.put(from, runnable); typingHandler.postDelayed(runnable, 5000); } } }; public static ChatsFragment newInstance() { return new ChatsFragment(); } private BroadcastReceiver newMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final MessageRec incomingMessage = (MessageRec) intent.getExtras() .getSerializable(KEY_MESSAGE); // TODO: should we consider deviceId? if (typingRunnables.containsKey(incomingMessage.senderUid)) { final Chat chat = adapter.getChat(incomingMessage.senderUid); chat.isTyping = false; adapter.notifyDataSetChanged(); typingHandler.removeCallbacksAndMessages(typingRunnables.get(incomingMessage.senderUid)); typingRunnables.remove(incomingMessage.senderUid); } updateChat(); } }; private BroadcastReceiver statusUpdateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { updateChat(); } }; private void updateChat() { allChats = RealmDBHelper.getChats(); adapter.updateChats(allChats); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LocalBroadcastManager.getInstance(getContext()).registerReceiver(newMessageReceiver, new IntentFilter(INCOMING_MESSAGE_SAVED)); LocalBroadcastManager.getInstance(getContext()).registerReceiver(typingNotificationReceiver, new IntentFilter(NEW_TYPING_NOTIFICATION)); LocalBroadcastManager.getInstance(getContext()).registerReceiver(statusUpdateReceiver, new IntentFilter(MSG_STATUS_UPDATE_EVENT)); LocalBroadcastManager.getInstance(getContext()).registerReceiver(statusUpdateReceiver, new IntentFilter(NEW_STATUS_UPDATE_EVENT)); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_chats, container, false); ButterKnife.bind(this, rootView); startUpdateHandler(); setHasOptionsMenu(true); searchView = (MaterialSearchView) getActivity().findViewById(R.id.search_view); allChats = RealmDBHelper.getChats(); adapter = new ChatsAdapter(allChats, new ChatsAdapter.Listener() { @Override public void onChatSelected(Chat chat) { listener.onChatSelected(chat); } }); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); return rootView; } private List<Chat> filterChats(List<Chat> chats, String filter) { List<Chat> result = new ArrayList<>(); for (Chat chat : chats) { if (chat.participants.get(0).name.toLowerCase().contains(filter)) { result.add(chat); } } return result; } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof Listener) { listener = (Listener) context; } else { throw new RuntimeException(context.toString() + " must implement Listener"); } } private void startUpdateHandler() { if (chatUpdateHandler != null) { return; } chatUpdateHandler = new Handler(); chatUpdateHandler.postDelayed(new Runnable() { @Override public void run() { chatUpdateHandler.postDelayed(this, REFRESH_INTERVAL); if (adapter != null) { updateChat(); } } }, REFRESH_INTERVAL); } private void stopUpdateHandler() { if (chatUpdateHandler != null) { chatUpdateHandler.removeCallbacksAndMessages(null); chatUpdateHandler = null; } } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu, menu); MenuItem searchMenuItem = menu.findItem(R.id.action_search); searchView.setMenuItem(searchMenuItem); searchView.closeSearch(); searchView.setOnQueryTextListener(onSearchItemClickListener); super.onCreateOptionsMenu(menu, inflater); } @Override public void onResume() { super.onResume(); if (adapter != null) { allChats = RealmDBHelper.getChats(); adapter.setItems(allChats); adapter.notifyDataSetChanged(); } } @Override public void onDetach() { super.onDetach(); listener = null; LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(newMessageReceiver); LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(typingNotificationReceiver); LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(statusUpdateReceiver); stopUpdateHandler(); } public interface Listener { void onChatSelected(Chat chat); } }
c829f626b3b374a5892f750fa35c796c2299bf59
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-config/src/main/java/com/aliyuncs/config/model/v20200907/DeactiveAggregateConfigRulesRequest.java
52bb4a3d6f8e719bb424e21f6b4b95d2cfa8e65c
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
2,006
java
/* * 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.aliyuncs.config.model.v20200907; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.config.Endpoint; /** * @author auto create * @version */ public class DeactiveAggregateConfigRulesRequest extends RpcAcsRequest<DeactiveAggregateConfigRulesResponse> { private String configRuleIds; private String aggregatorId; public DeactiveAggregateConfigRulesRequest() { super("Config", "2020-09-07", "DeactiveAggregateConfigRules"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getConfigRuleIds() { return this.configRuleIds; } public void setConfigRuleIds(String configRuleIds) { this.configRuleIds = configRuleIds; if(configRuleIds != null){ putQueryParameter("ConfigRuleIds", configRuleIds); } } public String getAggregatorId() { return this.aggregatorId; } public void setAggregatorId(String aggregatorId) { this.aggregatorId = aggregatorId; if(aggregatorId != null){ putQueryParameter("AggregatorId", aggregatorId); } } @Override public Class<DeactiveAggregateConfigRulesResponse> getResponseClass() { return DeactiveAggregateConfigRulesResponse.class; } }
7bed29050f8cfb0ddb5c90bdcaee0bc318cf9c7e
b14fb7ba1ef97e25c3a0e61a7b34b7d86d6ba41d
/app/src/main/java/com/apcachef/model/contactUs/PostQueryRequest.java
45ce8689f9cc4d6c9c5d7a84cabc97508a45ef15
[]
no_license
MinakshiKamboj/ApcaChef1
8f576035157392c34f8b2ba1f5015b9858b7f844
a82094ec8fa398201de0b28a942c09418bc66e50
refs/heads/master
2023-05-13T00:13:02.984972
2021-06-05T06:00:19
2021-06-05T06:00:19
374,033,336
0
0
null
null
null
null
UTF-8
Java
false
false
972
java
package com.apcachef.model.contactUs; import com.google.gson.annotations.SerializedName; public class PostQueryRequest{ @SerializedName("email_id") private String emailId; @SerializedName("fname") private String fname; @SerializedName("lname") private String lname; @SerializedName("phone_num") private int phoneNum; @SerializedName("message") private String message; public void setEmailId(String emailId){ this.emailId = emailId; } public String getEmailId(){ return emailId; } public void setFname(String fname){ this.fname = fname; } public String getFname(){ return fname; } public void setLname(String lname){ this.lname = lname; } public String getLname(){ return lname; } public void setPhoneNum(int phoneNum){ this.phoneNum = phoneNum; } public int getPhoneNum(){ return phoneNum; } public void setMessage(String message){ this.message = message; } public String getMessage(){ return message; } }
8612ee6d6fcf98a3975f1de34cfeae4a8433acb4
a4f3f9283b004938ed069fa88c77b04550d6eb16
/src/main/java/com/dy/javaclient/utils/Log.java
72099b79afa84a9e9be1712f2d45c80b5ed67faa
[]
no_license
horsewan/im
91979048607ee167bd636a7318ecc4eb2b21c4a6
ac4c2704e36208e054aa2d003d859a42a6f29c3c
refs/heads/master
2022-05-28T08:45:02.683888
2019-09-11T08:55:42
2019-09-11T08:55:42
202,458,874
0
0
null
2022-05-20T21:05:45
2019-08-15T02:22:41
Java
UTF-8
Java
false
false
5,257
java
package com.dy.javaclient.utils; import javax.swing.*; import javax.swing.text.MutableAttributeSet; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import java.awt.*; import java.util.Date; /** * Swing实现的日志显示工具,方便调试代码。 * * @author Jack Jiang, 2008 */ public class Log { /** 日志输出级别 */ public final static int INFO=1,PROMPT=2,DEBUG=3,WARN=4,ERROR=5,FETAL=6; public final static int DEST_TEXT_COM = 7,DEST_RICH_TEXT_COM = 8,DEST_CONSOLE = 9; private int logDestType=-1; /** 允许的日志输出级别(该级别及其以下级别的日志都不会被输出) */ private int logLevel=-1; private JTextPane richTextDest; private JTextArea textDest; private static Log instance = null; public static Log getInstance() { if(instance == null) instance = new Log(null, -1); return instance; } public Log(Object dest,int logLevel) { this.logLevel=logLevel; this.setLogDest(dest); } public Log setLogDest(Object dest) { if(dest==null) this.logDestType=DEST_CONSOLE; else { if(dest instanceof JTextPane) { this.logDestType=DEST_RICH_TEXT_COM; richTextDest=(JTextPane)dest; } else if(dest instanceof JTextArea) { this.logDestType=DEST_TEXT_COM; textDest=(JTextArea)dest; } else System.out.println("不支持的日志输出目的地!"); } return this; } public int getLogLevel() { return logLevel; } public Log setLogLevel(int logLevel) { this.logLevel = logLevel; return this; } /** * INFO * * @param msg */ public static void i(String tag, String msg) { i(tag, msg, null); } public static void i(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.INFO, ex); } /** * PROMPT * * @param msg */ public static void p(String tag, String msg) { p(tag, msg, null); } public static void p(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.PROMPT, ex); } /** * DEBUG * * @param msg */ public static void d(String tag, String msg) { d(tag, msg, null); } public static void d(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.DEBUG, ex); } /** * WARN * * @param msg */ public static void w(String tag, String msg) { w(tag, msg, null); } public static void w(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.WARN, ex); } /** * ERROR * * @param msg */ public static void e(String tag, String msg) { e(tag, msg, null); } public static void e(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.ERROR, ex); } /** * FETAL * * @param msg */ public static void f(String tag, String msg) { f(tag, msg, null); } public static void f(String tag, String msg, Exception ex) { Log.getInstance().log(msg, Log.FETAL, ex); } /** * 日志输出. * * @param msg * @param level */ public void log(String msg,int level) { this.log(msg, level, null); } /** * 日志输出. * * @param msg * @param level */ public void log(String msg,int level, Exception ex) { String lv=""; Color fc=Color.black; switch(level) { case INFO: fc=new Color(153,204,0); lv="INFO"; break; case PROMPT: fc=new Color(0, 255, 0); lv="PROMPT"; break; case DEBUG: fc=new Color(255,204,153); lv="DEBUG"; break; case WARN: fc=Color.pink; lv="WARN"; break; case ERROR: fc=Color.red; lv="ERROR"; break; case FETAL: fc=Color.red; lv="FETAL"; break; } if(level>logLevel) { String txt=" "+lv+" - "+msg+(ex == null?"":"("+ex.getMessage()+")")+" ["+(new Date().toLocaleString())+"]\r\n"; if(logDestType==DEST_RICH_TEXT_COM) { try { Log.append(fc, txt, richTextDest); richTextDest.setCaretPosition(richTextDest.getDocument().getLength()); } catch(Exception e) { // e.printStackTrace(); } } else if(logDestType==DEST_TEXT_COM) textDest.append(txt); else if(logDestType==DEST_CONSOLE) System.out.print(txt); else { //未知日志目的地类型 } if(ex != null) ex.printStackTrace(); } } /** * 添加字符串到目标JTextPane中,并设定字符串颜色(注意目前仅仅是实现设置颜色). * @param c 文本颜色 * @param s 文本内容 * @param p 目标面板 */ public static void append(final Color c, final String s, final JTextPane p) { // 以下代码因会从独立的Thread中调用,所以需要借用SwingUtilities.invokeLater(), // 否则会报错:”Exception in thread "Thread-22" java.lang.Error: Interrupted attempt to aquire write lock“ Runnable runnable = new Runnable() { public void run(){ try { MutableAttributeSet sa = new SimpleAttributeSet(); StyleConstants.setForeground(sa, c); int len = p.getDocument().getLength(); p.getDocument().insertString(len, s, sa); } catch (Exception e) { e.printStackTrace(); } } }; SwingUtilities.invokeLater(runnable); } }
7bf3f2f5b38ec48e39552fe3cae7010300c6da27
854ab07089c998e48994d1223736e0bbfcf7788a
/ImageMultipartUploader.java
7ebe063afb2a48e9cb4a8350bf35d591c148829c
[]
no_license
deydebaditya/wolfsburgRetail
a3303f830b4b7ea67ec8a07f597c10cfabff8361
e7ec1c7d0549978e3bc23afdf31ae189ec159d0a
refs/heads/master
2021-04-29T22:41:36.096671
2018-02-15T15:02:28
2018-02-15T15:02:28
121,642,535
0
0
null
null
null
null
UTF-8
Java
false
false
4,248
java
package com.wolfsburgsolutions.myapplication; import android.content.Context; import android.graphics.Bitmap; import android.util.Base64; import android.util.Log; import android.widget.Toast; import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.request.JsonObjectRequest; //import com.android.volley.request.SimpleMultiPartRequest; import com.android.volley.toolbox.Volley; import org.json.JSONException; import org.json.JSONObject; import java.io.ByteArrayOutputStream; /** * Created by Debaditya on 12/14/2017. */ public class ImageMultipartUploader { private String url; private String image_name; private String image; private Context baseContext; private Bitmap imageBitmap; ImageMultipartUploader(String url, String image_name, String image, Bitmap imageBitmap, Context baseContext){ this.url = url; this.image_name = image_name; this.image = image; this.baseContext = baseContext; this.imageBitmap = imageBitmap; } /* NOT USED CURRENTLY protected void uploadImage(){ SimpleMultiPartRequest smr = new SimpleMultiPartRequest(Request.Method.POST, url, new Response.Listener<String>(){ @Override public void onResponse(String response) { Log.d("Response_Image",response); try{ JSONObject jsonObject = new JSONObject(response); String message = jsonObject.getString("message"); Toast.makeText(baseContext, message, Toast.LENGTH_SHORT).show(); }catch (JSONException e){ e.printStackTrace(); Toast.makeText(baseContext, "JSON Error", Toast.LENGTH_SHORT).show(); } } }, new Response.ErrorListener(){ @Override public void onErrorResponse(VolleyError error) { Toast.makeText(baseContext, error.getMessage(), Toast.LENGTH_SHORT).show(); } }); smr.addFile(image_name,image); ApplicationHelper.getInstance().addToRequestQueue(smr); } */ protected void startImageUpload(){ final JSONObject jsonObject = new JSONObject(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); imageBitmap.compress(Bitmap.CompressFormat.JPEG,100,byteArrayOutputStream); String encodedImage = Base64.encodeToString(byteArrayOutputStream.toByteArray(), Base64.DEFAULT); try{ jsonObject.put("name",image_name); jsonObject.put("image",encodedImage); } catch(JSONException e){ e.printStackTrace(); } JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,url,jsonObject, new Response.Listener<JSONObject>(){ @Override public void onResponse(JSONObject response) { Log.e("Response",response.toString()); try{ if(response.get("uploadDone").toString().equals("UPLOAD_SUCC")) Toast.makeText(baseContext,"Image Uploaded successfully!",Toast.LENGTH_SHORT).show(); else Toast.makeText(baseContext,"Image Upload failed!",Toast.LENGTH_SHORT).show(); } catch(JSONException e){ e.printStackTrace(); } } }, new Response.ErrorListener(){ @Override public void onErrorResponse(VolleyError error) { Log.e("Response",error.toString()); } }); jsonObjectRequest.setRetryPolicy(new DefaultRetryPolicy(5000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); Volley.newRequestQueue(baseContext).add(jsonObjectRequest); } }
5f0e8d4ae252b527f55d38894bd856acbdb018ce
865a88ffcb421aadc843dc8013cbe5bac56e4d77
/I.C.E/FirebaseApp/app/src/main/java/com/example/firebaseapp/Retrofit/Clouds.java
f1c325161774a9ccb760f2ada56f22c5e2690d0b
[]
no_license
Aidan-McErLEAN/Emergency_App
0d3262f344bd9200caa7eba018763646b8d68f1b
f8db0f18dad7ed6ad3a4b71476b60153e81c1bad
refs/heads/main
2023-06-29T23:16:18.462092
2021-07-22T19:34:35
2021-07-22T19:34:35
388,573,409
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.example.firebaseapp.Retrofit; import com.google.gson.annotations.SerializedName; public class Clouds { @SerializedName("all") String all; public String getCloud() { return all; } public void setCloud(String temp) { this.all = temp; } }
46ac9a2c055abaeced38235d219723141c3e0661
b33f1706ab2984380657d172dc0e2a909bd2bcbc
/app/src/main/java/com/example/sow_a/textbook/metier/Etudiant.java
b183c06daae37e7f965822ec9b20bf8f932c4279
[]
no_license
abousow123/Textbook
1dfadbf94f7dded2866909d38612b8dec0912550
f1ccf7953031d61535e858cf9f1a5ec1121f5f2f
refs/heads/master
2021-07-07T02:59:39.213102
2017-09-26T15:46:02
2017-09-26T15:46:02
104,538,470
0
0
null
null
null
null
UTF-8
Java
false
false
1,841
java
package com.example.sow_a.textbook.metier; /** * Created by sow-a on 8/11/17. */ public class Etudiant { private String nom ; private String prenom ; private int telephone,id ; private String sexe ; private String email ; private String formation ; //private int _id ; //Constructeur public Etudiant(String nom, String prenom, String sexe,int telephone, String email,int id) { this.nom = nom; this.prenom = prenom; this.sexe = sexe; this.telephone = telephone; this.email = email; this.id = id ; } // gettters and setters public String getNom() { return nom; } public String toString(){ return "Nom: "+this.nom + "\n"+"Prenom: "+this.prenom + "\n" + "Telephone: " + this.telephone + " ans \n" + "Sexe : " + this.sexe + "\nEmail: "+ this.email ; } public void setNom(String nom) { this.nom = nom; } public String getPrenom() { return prenom; } public void setPrenom(String prenom) { this.prenom = prenom; } public int getTelephone() { return telephone; } public void setTelephone(int telephone) { this.telephone = telephone; } public String getSexe() { return sexe; } public void setSexe(String sexe) { this.sexe = sexe; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFormation() { return formation; } public void setFormation(String formation) { this.formation = formation; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
c13a897c9b6de11e13e7f086af412fd199b7116c
52ea960c1bdd9a2939a236da956c892bb013978b
/src/main/java/io/sporkpgm/region/Region.java
31d774438ae5ef8ffa769ce3644088febfd6b1ae
[]
no_license
hfoxy/SporkPGM
7400510414196c22ce85a24c67b18ae6fb66894d
346de7996b6a1b77040f713731d6e41cc892b0ae
refs/heads/master
2021-05-12T00:00:41.613764
2014-04-03T02:29:49
2014-04-03T02:29:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,912
java
package io.sporkpgm.region; import com.google.common.collect.Lists; import io.sporkpgm.region.types.BlockRegion; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.util.Vector; import java.util.ArrayList; import java.util.List; public abstract class Region { private String name; public Region(String name) { this.name = name; } public String getName() { return name; } public abstract boolean isInside(BlockRegion block); public boolean isInside(BlockRegion block, boolean log) { return isInside(block); } public boolean isInside(double x, double y, double z) { return isInside(new BlockRegion(x, y, z)); } public boolean isInside(Location location) { return isInside(location.getX(), location.getY(), location.getZ()); } public boolean isInside(Vector vector) { return isInside(vector.getX(), vector.getY(), vector.getZ()); } public boolean isInside(Material material, World world) { for(BlockRegion region : getValues()) { if(region.getMaterial(world) == material) { return true; } } return false; } public boolean isAboveOrBelow(BlockRegion check) { return isAbove(check) || isBelow(check); } public boolean isAboveOrBelow(double x, double y, double z) { return isAboveOrBelow(new BlockRegion(x, y, z)); } public boolean isAboveOrBelow(Location location) { return isAboveOrBelow(location.getX(), location.getY(), location.getZ()); } public abstract boolean isAbove(BlockRegion check); public boolean isAbove(double x, double y, double z) { return isAbove(new BlockRegion(x, y, z)); } public boolean isAbove(Location location) { return isAbove(location.getX(), location.getY(), location.getZ()); } public abstract boolean isBelow(BlockRegion check); public boolean isBelow(double x, double y, double z) { return isBelow(new BlockRegion(x, y, z)); } public boolean isBelow(Location location) { return isBelow(location.getX(), location.getY(), location.getZ()); } public abstract List<BlockRegion> getValues(); public List<BlockRegion> getValues(Material type, World world) { List<BlockRegion> blocks = new ArrayList<>(); for(BlockRegion region : getValues()) { Block block = region.getBlock(world); if(block.getType() == type) { blocks.add(region); } } return blocks; } public List<BlockRegion> getValues(Material[] types, World world) { List<BlockRegion> blocks = new ArrayList<>(); for(BlockRegion region : getValues()) { Block block = region.getBlock(world); for(Material material : types) { if(material == block.getType()) { blocks.add(region); break; } } } return blocks; } public List<BlockRegion> getValues(Material type, int damage, World world) { List<BlockRegion> blocks = new ArrayList<>(); for(BlockRegion region : getValues()) { Block block = region.getBlock(world); if(block.getType() == type && block.getData() == damage) { blocks.add(region); } } return blocks; } public List<Entity> getEntities(World world) { List<Entity> entities = new ArrayList<>(); for(Entity entity : world.getEntities()) { if(isInside(entity.getLocation())) { entities.add(entity); } } return entities; } public List<Entity> getEntities(Class<? extends Entity> type, World world) { return getEntities(new Class[]{type}, world); } public List<Entity> getEntities(List<Class<? extends Entity>> types, World world) { List<Entity> entities = new ArrayList<>(); for(Entity entity : world.getEntities()) { if(types.contains(entity.getClass()) && isInside(entity.getLocation())) { entities.add(entity); } } return entities; } public List<Entity> getEntities(Class<? extends Entity>[] classes, World world) { return getEntities(Lists.newArrayList(classes), world); } }
f535b3957e165948dde035b14acefff3d3666e78
7988542e8e81af19ad4f5a306b9cfd39879f005d
/search-server/src/main/java/com/wd/cloud/searchserver/comm/MapFascade.java
197e21ac506259580c2bcc2b8ae0d130b6e8bba4
[]
no_license
javaContent/api-root
16d4b1d088c1daff91597a9857c49303216b6d33
4dc728a3efcb5a688e4b61b4bd9b9c5dd3e2984e
refs/heads/master
2020-03-29T21:38:04.799619
2018-09-21T07:10:24
2018-09-21T07:10:24
150,377,890
2
0
null
null
null
null
UTF-8
Java
false
false
486
java
package com.wd.cloud.searchserver.comm; import java.util.HashMap; public class MapFascade<V> extends HashMap<String, V> { /** * */ private static final long serialVersionUID = 1L; public MapFascade() { super(15); } @Override public V put(String key, V value) { String[] keyArr = key.split(";"); if (keyArr.length > 1) { for (String k : keyArr) { super.put(k, value); } return value; } else { return super.put(key, value); } } }
0b13ff2903fb27c34cd4d3affef28d0ef2ad326c
a871f95fd9e3b67978befb324845a5b7c0781a40
/src/main/java/com/beugenio/AtividadeSpring/resources/exception/ResourceExceptionHandler.java
5331dfe48b389158e174c1f58485cad199363d4b
[]
no_license
TheGrUbA/AtividadeSpring
4ad405dc9663e381b8bfd56979b35e4bcfa6c5f7
56b555ab3c9c3a6d0c99c6057ac72779ea439811
refs/heads/master
2020-03-28T08:18:21.724223
2018-09-12T01:29:31
2018-09-12T01:29:31
147,956,800
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package com.beugenio.AtividadeSpring.resources.exception; import javax.servlet.http.HttpServletRequest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import com.beugenio.AtividadeSpring.services.exceptions.ObjectNotFoundException; @ControllerAdvice public class ResourceExceptionHandler { @ExceptionHandler(ObjectNotFoundException.class) public ResponseEntity<StandardError> objectNotFound(ObjectNotFoundException e, HttpServletRequest request) { StandardError err = new StandardError(HttpStatus.NOT_FOUND.value(), e.getMessage(), System.currentTimeMillis()); return ResponseEntity.status(HttpStatus.NOT_FOUND).body(err); } }
d75fb5f40cca196a060d2997fedda50ae9d1a5ea
abe428bbd951dce704caa4103d75bea180b4dd05
/src/test/java/ua/com/hav/acc/BootAccV101ApplicationTests.java
112820406cb4b98d736673c6f22bded7f8c62193
[]
no_license
kharchal/boot-acc-v1_01
cff24157d68e61c4fc39427ae902fc27acd5bd22
235302846198bc87d0374aeb0c8c9901f222d3ad
refs/heads/master
2021-09-06T06:39:37.232549
2018-02-03T09:38:37
2018-02-03T09:38:37
115,423,123
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package ua.com.hav.acc; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class BootAccV101ApplicationTests { @Test public void contextLoads() { } }
38c97a588b62a76aff707de4e686dc825c729042
c8aa789c6e10485780ff5aa8cac3ef9e8d2d5063
/src/main/java/com/tajawal/bussiness_object/FlightsSearchBO.java
148eb01e17212074aa1918546acfeb9b22126968
[]
no_license
hanets/code-challange
957e62046c7d9ece1cf60b7c4cf80e61e8d31fdf
ddd0da2158e529300504bbbc60e076c4ae865f77
refs/heads/master
2023-05-09T18:56:48.289122
2019-11-29T07:50:49
2019-11-29T07:50:49
224,802,567
0
0
null
2023-05-09T18:37:54
2019-11-29T07:43:46
Java
UTF-8
Java
false
false
1,574
java
package com.tajawal.bussiness_object; import com.tajawal.page_object.FlightsPage; import com.tajawal.page_object.FlightsResultsPage; import com.tajawal.page_object.HomePage; import org.testng.Assert; import org.testng.asserts.SoftAssert; import java.util.List; public class FlightsSearchBO { public static FlightsResultsPage openRandomFlightResultPage() { FlightsPage flightsPage = new HomePage().clickFlightButton(); //todo generate random data return flightsPage.waitPageLoad() .enterOrigin("DXB", "Dubai International Airport") .enterTo("AMM", "Queen Alia International Airport") .clickSearch(); } public static void verifyPriceSorted(List<String> priceList) { Assert.assertTrue(priceList.size() > 1, "price list size is " + priceList.size()); SoftAssert softAssert = new SoftAssert(); for (int i = 0; i < priceList.size(); i++) { String price = priceList.get(i); softAssert.assertTrue(price.startsWith("AED "), "currency should be AED. actual " + price); if (i != priceList.size() - 1) { String priceNext = priceList.get(i + 1); softAssert.assertTrue(priceToNumber(price) <= priceToNumber(priceNext), "price is not sorted " + price + " is more than " + priceNext); } } softAssert.assertAll(); } private static int priceToNumber(String price) { return Integer.parseInt(price.replace("AED ", "").replace(",", "")); } }
d6a1e0f66d818d7eee01be3f97261d3a775c84fb
677c4f6e8276485254ed8fa5d9a1395d78507063
/app/src/main/java/com/lixin/amuseadjacent/photoView/PhotoViewAttacher.java
1dca0d5f47923925c30457155b2a2743952f6b16
[]
no_license
led-os/doulin
0ee140d725d082235c3a431555b69ece6abaa900
84541e65a9fb3cdad2b67934d3ff761cf1bc5a83
refs/heads/master
2021-09-26T16:14:22.493465
2018-10-31T14:31:19
2018-10-31T14:31:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
33,682
java
/******************************************************************************* * Copyright 2011, 2012 Chris Banes. * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.lixin.amuseadjacent.photoView; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.Matrix.ScaleToFit; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.View.OnLongClickListener; import android.view.ViewParent; import android.view.ViewTreeObserver; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import com.lixin.amuseadjacent.photoView.gestures.OnGestureListener; import com.lixin.amuseadjacent.photoView.gestures.PhotoGestureDetector; import com.lixin.amuseadjacent.photoView.gestures.VersionedGestureDetector; import com.lixin.amuseadjacent.photoView.scrollerproxy.ScrollerProxy; import java.lang.ref.WeakReference; import static android.view.MotionEvent.ACTION_CANCEL; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; public class PhotoViewAttacher implements IPhotoView, View.OnTouchListener, OnGestureListener, ViewTreeObserver.OnGlobalLayoutListener { // let debug flag be dynamic, but still Proguard can be used to remove from // release builds static final Interpolator sInterpolator = new AccelerateDecelerateInterpolator(); int ZOOM_DURATION = DEFAULT_ZOOM_DURATION; static final int EDGE_NONE = -1; static final int EDGE_LEFT = 0; static final int EDGE_RIGHT = 1; static final int EDGE_BOTH = 2; private float mMinScale = DEFAULT_MIN_SCALE; private float mMidScale = DEFAULT_MID_SCALE; private float mMaxScale = DEFAULT_MAX_SCALE; private boolean mAllowParentInterceptOnEdge = true; private static void checkZoomLevels(float minZoom, float midZoom, float maxZoom) { if (minZoom >= midZoom) { throw new IllegalArgumentException( "MinZoom has to be less than MidZoom"); } else if (midZoom >= maxZoom) { throw new IllegalArgumentException( "MidZoom has to be less than MaxZoom"); } } /** * @return true if the ImageView exists, and it's Drawable existss */ private static boolean hasDrawable(ImageView imageView) { return null != imageView && null != imageView.getDrawable(); } /** * @return true if the ScaleType is supported. */ private static boolean isSupportedScaleType(final ScaleType scaleType) { if (null == scaleType) { return false; } switch (scaleType) { case MATRIX: throw new IllegalArgumentException(scaleType.name() + " is not supported in PhotoView"); default: return true; } } /** * Set's the ImageView's ScaleType to Matrix. */ private static void setImageViewScaleTypeMatrix(ImageView imageView) { /** * PhotoView sets it's own ScaleType to Matrix, then diverts all calls * setScaleType to this.setScaleType automatically. */ if (null != imageView && !(imageView instanceof IPhotoView)) { if (!ScaleType.MATRIX.equals(imageView.getScaleType())) { imageView.setScaleType(ScaleType.MATRIX); } } } private WeakReference<ImageView> mImageView; // Gesture Detectors private GestureDetector mGestureDetector; private PhotoGestureDetector mScaleDragDetector; // These are set so we don't keep allocating them on the heap private final Matrix mBaseMatrix = new Matrix(); private final Matrix mDrawMatrix = new Matrix(); private final Matrix mSuppMatrix = new Matrix(); private final RectF mDisplayRect = new RectF(); private final float[] mMatrixValues = new float[9]; // Listeners private OnMatrixChangedListener mMatrixChangeListener; private OnPhotoTapListener mPhotoTapListener; private OnViewTapListener mViewTapListener; private OnLongClickListener mLongClickListener; private int mIvTop, mIvRight, mIvBottom, mIvLeft; private FlingRunnable mCurrentFlingRunnable; private int mScrollEdge = EDGE_BOTH; private boolean mZoomEnabled; private ScaleType mScaleType = ScaleType.FIT_CENTER; public PhotoViewAttacher(ImageView imageView) { mImageView = new WeakReference<ImageView>(imageView); imageView.setDrawingCacheEnabled(true); imageView.setOnTouchListener(this); ViewTreeObserver observer = imageView.getViewTreeObserver(); if (null != observer) observer.addOnGlobalLayoutListener(this); // Make sure we using MATRIX Scale Type setImageViewScaleTypeMatrix(imageView); if (imageView.isInEditMode()) { return; } // Create Gesture Detectors... mScaleDragDetector = VersionedGestureDetector.newInstance( imageView.getContext(), this); mGestureDetector = new GestureDetector(imageView.getContext(), new GestureDetector.SimpleOnGestureListener() { // forward long click listener @Override public void onLongPress(MotionEvent e) { if (null != mLongClickListener) { mLongClickListener.onLongClick(getImageView()); } } }); mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this)); // Finally, update the UI so that we're zoomable setZoomable(true); } @Override public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener newOnDoubleTapListener) { if (newOnDoubleTapListener != null) this.mGestureDetector.setOnDoubleTapListener(newOnDoubleTapListener); else this.mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this)); } @Override public boolean canZoom() { return mZoomEnabled; } /** * Clean-up the resources attached to this object. This needs to be called when the ImageView is * no longer used. A good example is from {@link View#onDetachedFromWindow()} or * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using * {@link uk.co.senab.photoview.PhotoView}. */ @SuppressWarnings("deprecation") public void cleanup() { if (null == mImageView) { return; // cleanup already done } final ImageView imageView = mImageView.get(); if (null != imageView) { // Remove this as a global layout listener ViewTreeObserver observer = imageView.getViewTreeObserver(); if (null != observer && observer.isAlive()) { observer.removeGlobalOnLayoutListener(this); } // Remove the ImageView's reference to this imageView.setOnTouchListener(null); // make sure a pending fling runnable won't be run cancelFling(); } if (null != mGestureDetector) { mGestureDetector.setOnDoubleTapListener(null); } // Clear listeners too mMatrixChangeListener = null; mPhotoTapListener = null; mViewTapListener = null; // Finally, clear ImageView mImageView = null; } @Override public RectF getDisplayRect() { checkMatrixBounds(); return getDisplayRect(getDrawMatrix()); } @Override public boolean setDisplayMatrix(Matrix finalMatrix) { if (finalMatrix == null) throw new IllegalArgumentException("Matrix cannot be null"); ImageView imageView = getImageView(); if (null == imageView) return false; if (null == imageView.getDrawable()) return false; mSuppMatrix.set(finalMatrix); setImageViewMatrix(getDrawMatrix()); checkMatrixBounds(); return true; } /** * @deprecated use {@link #setRotationTo(float)} */ @Override public void setPhotoViewRotation(float degrees) { mSuppMatrix.setRotate(degrees % 360); checkAndDisplayMatrix(); } @Override public void setRotationTo(float degrees) { mSuppMatrix.setRotate(degrees % 360); checkAndDisplayMatrix(); } @Override public void setRotationBy(float degrees) { mSuppMatrix.postRotate(degrees % 360); checkAndDisplayMatrix(); } public ImageView getImageView() { ImageView imageView = null; if (null != mImageView) { imageView = mImageView.get(); } // If we don't have an ImageView, call cleanup() if (null == imageView) { cleanup(); } return imageView; } @Override @Deprecated public float getMinScale() { return getMinimumScale(); } @Override public float getMinimumScale() { return mMinScale; } @Override @Deprecated public float getMidScale() { return getMediumScale(); } @Override public float getMediumScale() { return mMidScale; } @Override @Deprecated public float getMaxScale() { return getMaximumScale(); } @Override public float getMaximumScale() { return mMaxScale; } @Override public float getScale() { return (float) Math.sqrt((float) Math.pow(getValue(mSuppMatrix, Matrix.MSCALE_X), 2) + (float) Math.pow(getValue(mSuppMatrix, Matrix.MSKEW_Y), 2)); } @Override public ScaleType getScaleType() { return mScaleType; } @Override public void onDrag(float dx, float dy) { if (mScaleDragDetector.isScaling()) { return; // Do not drag if we are already scaling } ImageView imageView = getImageView(); mSuppMatrix.postTranslate(dx, dy); checkAndDisplayMatrix(); /** * Here we decide whether to let the ImageView's parent to start taking * over the touch event. * * First we check whether this function is enabled. We never want the * parent to take over if we're scaling. We then check the edge we're * on, and the direction of the scroll (i.e. if we're pulling against * the edge, aka 'overscrolling', let the parent take over). */ ViewParent parent = imageView.getParent(); if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling()) { if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) { if (null != parent) parent.requestDisallowInterceptTouchEvent(false); } } else { if (null != parent) { parent.requestDisallowInterceptTouchEvent(true); } } } @Override public void onFling(float startX, float startY, float velocityX, float velocityY) { ImageView imageView = getImageView(); mCurrentFlingRunnable = new FlingRunnable(imageView.getContext()); mCurrentFlingRunnable.fling(getImageViewWidth(imageView), getImageViewHeight(imageView), (int) velocityX, (int) velocityY); imageView.post(mCurrentFlingRunnable); } @Override public void onGlobalLayout() { ImageView imageView = getImageView(); if (null != imageView) { if (mZoomEnabled) { final int top = imageView.getTop(); final int right = imageView.getRight(); final int bottom = imageView.getBottom(); final int left = imageView.getLeft(); /** * We need to check whether the ImageView's bounds have changed. * This would be easier if we targeted API 11+ as we could just use * View.OnLayoutChangeListener. Instead we have to replicate the * work, keeping track of the ImageView's bounds and then checking * if the values change. */ if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) { // Update our base matrix, as the bounds have changed updateBaseMatrix(imageView.getDrawable()); // Update values as something has changed mIvTop = top; mIvRight = right; mIvBottom = bottom; mIvLeft = left; } } else { updateBaseMatrix(imageView.getDrawable()); } } } @Override public void onScale(float scaleFactor, float focusX, float focusY) { if (getScale() < mMaxScale || scaleFactor < 1f) { mSuppMatrix.postScale(scaleFactor, scaleFactor, focusX, focusY); checkAndDisplayMatrix(); } } @Override public boolean onTouch(View v, MotionEvent ev) { boolean handled = false; if (mZoomEnabled && hasDrawable((ImageView) v)) { ViewParent parent = v.getParent(); switch (ev.getAction()) { case ACTION_DOWN: // First, disable the Parent from intercepting the touch // event if (null != parent) parent.requestDisallowInterceptTouchEvent(true); else // If we're flinging, and the user presses down, cancel // fling cancelFling(); break; case ACTION_CANCEL: case ACTION_UP: // If the user has zoomed less than min scale, zoom back // to min scale if (getScale() < mMinScale) { RectF rect = getDisplayRect(); if (null != rect) { v.post(new AnimatedZoomRunnable(getScale(), mMinScale, rect.centerX(), rect.centerY())); handled = true; } } break; } // Try the Scale/Drag detector if (null != mScaleDragDetector && mScaleDragDetector.onTouchEvent(ev)) { handled = true; } // Check to see if the user double tapped if (null != mGestureDetector && mGestureDetector.onTouchEvent(ev)) { handled = true; } } return handled; } @Override public void setAllowParentInterceptOnEdge(boolean allow) { mAllowParentInterceptOnEdge = allow; } @Override @Deprecated public void setMinScale(float minScale) { setMinimumScale(minScale); } @Override public void setMinimumScale(float minimumScale) { checkZoomLevels(minimumScale, mMidScale, mMaxScale); mMinScale = minimumScale; } @Override @Deprecated public void setMidScale(float midScale) { setMediumScale(midScale); } @Override public void setMediumScale(float mediumScale) { checkZoomLevels(mMinScale, mediumScale, mMaxScale); mMidScale = mediumScale; } @Override @Deprecated public void setMaxScale(float maxScale) { setMaximumScale(maxScale); } @Override public void setMaximumScale(float maximumScale) { checkZoomLevels(mMinScale, mMidScale, maximumScale); mMaxScale = maximumScale; } @Override public void setOnLongClickListener(OnLongClickListener listener) { mLongClickListener = listener; } @Override public void setOnMatrixChangeListener(OnMatrixChangedListener listener) { mMatrixChangeListener = listener; } @Override public void setOnPhotoTapListener(OnPhotoTapListener listener) { mPhotoTapListener = listener; } @Override public OnPhotoTapListener getOnPhotoTapListener() { return mPhotoTapListener; } @Override public void setOnViewTapListener(OnViewTapListener listener) { mViewTapListener = listener; } @Override public OnViewTapListener getOnViewTapListener() { return mViewTapListener; } @Override public void setScale(float scale) { setScale(scale, false); } @Override public void setScale(float scale, boolean animate) { ImageView imageView = getImageView(); if (null != imageView) { setScale(scale, (imageView.getRight()) / 2, (imageView.getBottom()) / 2, animate); } } @Override public void setScale(float scale, float focalX, float focalY, boolean animate) { ImageView imageView = getImageView(); if (null != imageView) { // Check to see if the scale is within bounds if (scale < mMinScale || scale > mMaxScale) { return; } if (animate) { imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY)); } else { mSuppMatrix.setScale(scale, scale, focalX, focalY); checkAndDisplayMatrix(); } } } @Override public void setScaleType(ScaleType scaleType) { if (isSupportedScaleType(scaleType) && scaleType != mScaleType) { mScaleType = scaleType; // Finally update update(); } } @Override public void setZoomable(boolean zoomable) { mZoomEnabled = zoomable; update(); } public void update() { ImageView imageView = getImageView(); if (null != imageView) { if (mZoomEnabled) { // Make sure we using MATRIX Scale Type setImageViewScaleTypeMatrix(imageView); // Update the base matrix using the current drawable updateBaseMatrix(imageView.getDrawable()); } else { // Reset the Matrix... resetMatrix(); } } } @Override public Matrix getDisplayMatrix() { return new Matrix(getDrawMatrix()); } public Matrix getDrawMatrix() { mDrawMatrix.set(mBaseMatrix); mDrawMatrix.postConcat(mSuppMatrix); return mDrawMatrix; } private void cancelFling() { if (null != mCurrentFlingRunnable) { mCurrentFlingRunnable.cancelFling(); mCurrentFlingRunnable = null; } } /** * Helper method that simply checks the Matrix, and then displays the result */ private void checkAndDisplayMatrix() { if (checkMatrixBounds()) { setImageViewMatrix(getDrawMatrix()); } } private void checkImageViewScaleType() { ImageView imageView = getImageView(); /** * PhotoView's getScaleType() will just divert to this.getScaleType() so * only call if we're not attached to a PhotoView. */ if (null != imageView && !(imageView instanceof IPhotoView)) { if (!ScaleType.MATRIX.equals(imageView.getScaleType())) { throw new IllegalStateException( "The ImageView's ScaleType has been changed since attaching a PhotoViewAttacher"); } } } private boolean checkMatrixBounds() { final ImageView imageView = getImageView(); if (null == imageView) { return false; } final RectF rect = getDisplayRect(getDrawMatrix()); if (null == rect) { return false; } final float height = rect.height(), width = rect.width(); float deltaX = 0, deltaY = 0; final int viewHeight = getImageViewHeight(imageView); if (height <= viewHeight) { switch (mScaleType) { case FIT_START: deltaY = -rect.top; break; case FIT_END: deltaY = viewHeight - height - rect.top; break; default: deltaY = (viewHeight - height) / 2 - rect.top; break; } } else if (rect.top > 0) { deltaY = -rect.top; } else if (rect.bottom < viewHeight) { deltaY = viewHeight - rect.bottom; } final int viewWidth = getImageViewWidth(imageView); if (width <= viewWidth) { switch (mScaleType) { case FIT_START: deltaX = -rect.left; break; case FIT_END: deltaX = viewWidth - width - rect.left; break; default: deltaX = (viewWidth - width) / 2 - rect.left; break; } mScrollEdge = EDGE_BOTH; } else if (rect.left > 0) { mScrollEdge = EDGE_LEFT; deltaX = -rect.left; } else if (rect.right < viewWidth) { deltaX = viewWidth - rect.right; mScrollEdge = EDGE_RIGHT; } else { mScrollEdge = EDGE_NONE; } // Finally actually translate the matrix mSuppMatrix.postTranslate(deltaX, deltaY); return true; } /** * Helper method that maps the supplied Matrix to the current Drawable * * @param matrix - Matrix to map Drawable against * @return RectF - Displayed Rectangle */ private RectF getDisplayRect(Matrix matrix) { ImageView imageView = getImageView(); if (null != imageView) { Drawable d = imageView.getDrawable(); if (null != d) { mDisplayRect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); matrix.mapRect(mDisplayRect); return mDisplayRect; } } return null; } public Bitmap getVisibleRectangleBitmap() { ImageView imageView = getImageView(); return imageView == null ? null : imageView.getDrawingCache(); } @Override public void setZoomTransitionDuration(int milliseconds) { if (milliseconds < 0) milliseconds = DEFAULT_ZOOM_DURATION; this.ZOOM_DURATION = milliseconds; } @Override public IPhotoView getIPhotoViewImplementation() { return this; } /** * Helper method that 'unpacks' a Matrix and returns the required value * * @param matrix - Matrix to unpack * @param whichValue - Which value from Matrix.M* to return * @return float - returned value */ private float getValue(Matrix matrix, int whichValue) { matrix.getValues(mMatrixValues); return mMatrixValues[whichValue]; } /** * Resets the Matrix back to FIT_CENTER, and then displays it.s */ private void resetMatrix() { mSuppMatrix.reset(); setImageViewMatrix(getDrawMatrix()); checkMatrixBounds(); } private void setImageViewMatrix(Matrix matrix) { ImageView imageView = getImageView(); if (null != imageView) { checkImageViewScaleType(); imageView.setImageMatrix(matrix); // Call MatrixChangedListener if needed if (null != mMatrixChangeListener) { RectF displayRect = getDisplayRect(matrix); if (null != displayRect) { mMatrixChangeListener.onMatrixChanged(displayRect); } } } } /** * Calculate Matrix for FIT_CENTER * * @param d - Drawable being displayed */ private void updateBaseMatrix(Drawable d) { ImageView imageView = getImageView(); if (null == imageView || null == d) { return; } final float viewWidth = getImageViewWidth(imageView); final float viewHeight = getImageViewHeight(imageView); final int drawableWidth = d.getIntrinsicWidth(); final int drawableHeight = d.getIntrinsicHeight(); mBaseMatrix.reset(); final float widthScale = viewWidth / drawableWidth; final float heightScale = viewHeight / drawableHeight; if (mScaleType == ScaleType.CENTER) { mBaseMatrix.postTranslate((viewWidth - drawableWidth) / 2F, (viewHeight - drawableHeight) / 2F); } else if (mScaleType == ScaleType.CENTER_CROP) { float scale = Math.max(widthScale, heightScale); mBaseMatrix.postScale(scale, scale); mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F, (viewHeight - drawableHeight * scale) / 2F); } else if (mScaleType == ScaleType.CENTER_INSIDE) { float scale = Math.min(1.0f, Math.min(widthScale, heightScale)); mBaseMatrix.postScale(scale, scale); mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F, (viewHeight - drawableHeight * scale) / 2F); } else { RectF mTempSrc = new RectF(0, 0, drawableWidth, drawableHeight); RectF mTempDst = new RectF(0, 0, viewWidth, viewHeight); switch (mScaleType) { case FIT_CENTER: mBaseMatrix .setRectToRect(mTempSrc, mTempDst, ScaleToFit.CENTER); break; case FIT_START: mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.START); break; case FIT_END: mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.END); break; case FIT_XY: mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.FILL); break; default: break; } } resetMatrix(); } private int getImageViewWidth(ImageView imageView) { if (null == imageView) return 0; return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight(); } private int getImageViewHeight(ImageView imageView) { if (null == imageView) return 0; return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom(); } /** * Interface definition for a callback to be invoked when the internal Matrix has changed for * this View. * * @author Chris Banes */ public static interface OnMatrixChangedListener { /** * Callback for when the Matrix displaying the Drawable has changed. This could be because * the View's bounds have changed, or the user has zoomed. * * @param rect - Rectangle displaying the Drawable's new bounds. */ void onMatrixChanged(RectF rect); } /** * Interface definition for a callback to be invoked when the Photo is tapped with a single * tap. * * @author Chris Banes */ public static interface OnPhotoTapListener { /** * A callback to receive where the user taps on a photo. You will only receive a callback if * the user taps on the actual photo, tapping on 'whitespace' will be ignored. * * @param view - View the user tapped. * @param x - where the user tapped from the of the Drawable, as percentage of the * Drawable width. * @param y - where the user tapped from the top of the Drawable, as percentage of the * Drawable height. */ void onPhotoTap(View view, float x, float y); } /** * Interface definition for a callback to be invoked when the ImageView is tapped with a single * tap. * * @author Chris Banes */ public static interface OnViewTapListener { /** * A callback to receive where the user taps on a ImageView. You will receive a callback if * the user taps anywhere on the view, tapping on 'whitespace' will not be ignored. * * @param view - View the user tapped. * @param x - where the user tapped from the left of the View. * @param y - where the user tapped from the top of the View. */ void onViewTap(View view, float x, float y); } private class AnimatedZoomRunnable implements Runnable { private final float mFocalX, mFocalY; private final long mStartTime; private final float mZoomStart, mZoomEnd; public AnimatedZoomRunnable(final float currentZoom, final float targetZoom, final float focalX, final float focalY) { mFocalX = focalX; mFocalY = focalY; mStartTime = System.currentTimeMillis(); mZoomStart = currentZoom; mZoomEnd = targetZoom; } @Override public void run() { ImageView imageView = getImageView(); if (imageView == null) { return; } float t = interpolate(); float scale = mZoomStart + t * (mZoomEnd - mZoomStart); float deltaScale = scale / getScale(); mSuppMatrix.postScale(deltaScale, deltaScale, mFocalX, mFocalY); checkAndDisplayMatrix(); // We haven't hit our target scale yet, so post ourselves again if (t < 1f) { Compat.postOnAnimation(imageView, this); } } private float interpolate() { float t = 1f * (System.currentTimeMillis() - mStartTime) / ZOOM_DURATION; t = Math.min(1f, t); t = sInterpolator.getInterpolation(t); return t; } } private class FlingRunnable implements Runnable { private final ScrollerProxy mScroller; private int mCurrentX, mCurrentY; public FlingRunnable(Context context) { mScroller = ScrollerProxy.getScroller(context); } public void cancelFling() { mScroller.forceFinished(true); } public void fling(int viewWidth, int viewHeight, int velocityX, int velocityY) { final RectF rect = getDisplayRect(); if (null == rect) { return; } final int startX = Math.round(-rect.left); final int minX, maxX, minY, maxY; if (viewWidth < rect.width()) { minX = 0; maxX = Math.round(rect.width() - viewWidth); } else { minX = maxX = startX; } final int startY = Math.round(-rect.top); if (viewHeight < rect.height()) { minY = 0; maxY = Math.round(rect.height() - viewHeight); } else { minY = maxY = startY; } mCurrentX = startX; mCurrentY = startY; // If we actually can move, fling the scroller if (startX != maxX || startY != maxY) { mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY, 0, 0); } } @Override public void run() { if (mScroller.isFinished()) { return; // remaining post that should not be handled } ImageView imageView = getImageView(); if (null != imageView && mScroller.computeScrollOffset()) { final int newX = mScroller.getCurrX(); final int newY = mScroller.getCurrY(); mSuppMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY); setImageViewMatrix(getDrawMatrix()); mCurrentX = newX; mCurrentY = newY; // Post On animation Compat.postOnAnimation(imageView, this); } } } }