blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
โŒ€
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
be02bf5a0161b33b229a81179cf550cc0ac7aa60
dd49191aaf72cc1ade79ebdc6979adf29814a9ab
/src/main/java/com/dwiveddi/kafka/ConsumerDemoGroups.java
51be5d68cfc374d28c20d0595bfe0fa06c61c24e
[]
no_license
quasi-coder/kafka-basics
3b229374073c51188b110f5b1c76a0a2fde67515
eeb71595f4888e93ab398e7de50c99ddb63fe784
refs/heads/master
2022-12-18T18:12:14.744558
2020-09-17T10:20:57
2020-09-17T10:20:57
296,021,038
0
0
null
null
null
null
UTF-8
Java
false
false
2,019
java
package com.dwiveddi.kafka; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.serialization.StringDeserializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.time.Duration; import java.util.Arrays; import java.util.Properties; public class ConsumerDemoGroups { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(ConsumerDemoGroups.class.getName()); String bootstrapServers = "localhost:9092"; String groupId = "my-fifth-application"; String topic = "first_topic"; //create consumer configs Properties properties = new Properties(); properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,bootstrapServers); properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG, groupId); properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); //create consumer KafkaConsumer<String,String> consumer = new KafkaConsumer<String, String>(properties); //subscribe consumer to our topic(s) //consumer.subscribe(Collections.singleton(topic)); consumer.subscribe(Arrays.asList(topic)); //poll for new data while(true){ ConsumerRecords<String,String> records = consumer.poll(Duration.ofMillis(100)); for (ConsumerRecord<String, String> record: records){ logger.info("Key: "+ record.key()+", Value: "+ record.value()); logger.info("Partition: "+ record.partition()+", Offset: "+ record.offset()); } } } }
5b50ba1e7b6cd7e89fce0d8f1487e7d4a712086a
abde124c008ad422884db415dfa4ac59788a7057
/app/src/main/java/com/example/premraj/maps/MapsActivity.java
48292b9fffd75a3cd86c09df2d8c248af4f431c9
[]
no_license
harshpv07/Maps
688a5ae651c96457096e71f3925e7adf85c10375
d725f7357f2dd1a59e1f178e8b9b5dba7ce2f904
refs/heads/master
2020-03-23T03:43:56.348733
2018-07-15T17:39:13
2018-07-15T17:39:13
141,045,900
0
0
null
null
null
null
UTF-8
Java
false
false
2,811
java
package com.example.premraj.maps; import android.Manifest; import android.content.pm.PackageManager; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // TODO: Consider calling // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for ActivityCompat#requestPermissions for more details. return; } mMap.setMyLocationEnabled(true); } }
6f67e556fd75aa7d9b11d28ab7aa13bc8d21047e
5180dd9467aee859483fb2238ca5632767bb313b
/app/src/main/java/ivanrudyk/com/open_weather_api/model/ForecastTransction.java
73a48f5e80caae8664b5fa0311db6c616a9462b8
[]
no_license
vasterlord/OpenWeatherMapApi
1ce707966e36a79451a2545a9ce4e730d300e891
9fb493b704b67a2e1f59614b2848046a07abd509
refs/heads/master
2021-01-14T13:21:14.019739
2016-09-20T12:39:44
2016-09-20T12:39:44
68,701,028
0
0
null
null
null
null
UTF-8
Java
false
false
351
java
package ivanrudyk.com.open_weather_api.model; /** * Created by Ivan on 19.08.2016. */ public class ForecastTransction { private static Forecast forecast; public static Forecast getForecast() { return forecast; } public static void setForecast(Forecast forecast) { ForecastTransction.forecast = forecast; } }
9735d6d66686a851852a668eeb02f4f4137f3988
797b16abbdfb8eae4dd279544d4224fed24659ee
/src/main/java/com/xuptbbs/mblog/modules/service/RolePermissionService.java
854b0cceded56db9521189dd6a185688c8dfcde0
[]
no_license
OnlyGky/com.xuptbbs.mblog
a1b1755e96e48c80b15fed1e2382fb90d37576c8
8985979bd49756e03035edddba9e8b45647eb241
refs/heads/master
2023-05-09T14:03:49.206455
2021-05-24T14:48:50
2021-05-24T14:48:50
370,380,808
0
0
null
null
null
null
UTF-8
Java
false
false
431
java
package com.xuptbbs.mblog.modules.service; import com.xuptbbs.mblog.modules.entity.Permission; import com.xuptbbs.mblog.modules.entity.RolePermission; import java.util.List; import java.util.Set; /** * @author - ygk * @create - 2021/5/18 */ public interface RolePermissionService { List<Permission> findPermissions(long roleId); void deleteByRoleId(long roleId); void add(Set<RolePermission> rolePermissions); }
5289ea31c4dbeaf4241d30702ee83b88fc74e40b
88ae2a61082ccc7d29af302304b5951db1a56cb9
/src/main/java/com/family/demotest/dao/domain/DomainDaoImpl.java
4a1632e1954e1fa37181580e4a717afbe3887a2b
[]
no_license
chent0902/demotest
c4ace7b974f607ddb09ee24a79d9e196a2ba5696
90944465540c4d1286e66d73cf0310d826fce2a5
refs/heads/master
2020-05-15T01:12:38.261294
2019-04-18T05:56:00
2019-04-18T05:56:00
182,024,897
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package com.family.demotest.dao.domain; import org.springframework.stereotype.Repository; import com.family.base01.dao.DaoSupport; import com.family.demotest.entity.DomainModel; /** * * @author wujf * */ @Repository("domain.dao") public class DomainDaoImpl extends DaoSupport<DomainModel> implements DomainDao { private static final String FIND_BY_CHANNEL_NO = " o.channelNo=? and "+UN_DELETE; @Override protected Class<DomainModel> getModelClass() { return DomainModel.class; } @Override public DomainModel findByChannelNo(String channelNo) { return findOne(newQueryBuilder().where(FIND_BY_CHANNEL_NO).setCacheEnable(true), new Object[]{channelNo}); } }
ef2eedfb42df597feb975b56a7f1e34709718e43
547bcc712dd4eac9b3f6a2c2df3155e30d864080
/BIZ_hong/src/programing_5๊ฐ•/์˜์ˆ˜์ฆ_์ถœ๋ ฅ_3.java
556587a77ff197dbf0a1800aeb1c80943e6d56bc
[]
no_license
betodo/polytech
d01cfccb076df289d6a879101b555e7e5ac13660
69979786b85d8595e56f586fe087e64c9a1823bd
refs/heads/master
2020-08-04T06:47:38.758235
2019-10-01T08:07:12
2019-10-01T08:07:12
212,043,733
0
0
null
null
null
null
UHC
Java
false
false
5,153
java
package programing_5๊ฐ•; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class ์˜์ˆ˜์ฆ_์ถœ๋ ฅ_3 { public static void main(String[] args) { // TODO Auto-generated method stub //์„ ์–ธ //ํ’ˆ๋ชฉ String[] itemName = {"์ดˆ์ฝ”ํŒŒ์ด","๋ฐ”๋‚˜๋‚˜์šฐ์œ ","๊ฑดํฌ๋„","์˜ค๋ Œ์ง€์ฃผ์Šค","์ดˆ์ฝ”์—๋ชฝ","ํŒŒ๊น€์น˜", "ํ’€๋ฌด์›์น˜์ฆˆ&์น˜์ฆˆ","์ŠคํŒ๋ฐ˜ํŒ”ํ‹ฐ","์„œ์šธ์šฐ์œ ","์–ผ๊ฐˆ์ด๊น€์น˜","๋ฌผํ‹ฐ์Šˆ 100๋งค", "ํŒ”๋„์™•๋šœ๊ป‘","์‚ฌ๊ณผ 1kg","ํ”„๋ง๊ธ€์Šค BBQ","[๋…ธ๋ธŒ๋ Œ๋“œ]์ƒ์ˆ˜ 2L","์˜ฌ๋ฆฌ๋ธŒ ์งœํŒŒ๊ฒŒํ‹ฐ", "CJ ํ–‡๋ฐ˜","ํฌ๋ฆฌ๋„ฅ์Šค 3๊ฒน 3๋กค","์œ ํ•œ๋ฝ์Šค 1.5L","[ํ™ˆ์Šคํƒ€]์š•์‹ค์„ธ์ •์šฉ","๋‚จ์„ฑ ๋ฆฐ๋„จ์…”์ธ ", "์ด์ฒœ์Œ€ 2kg","๋ธ”๋ฃจ์ถฉ์น˜์ผ€์–ด ์น˜์•ฝ","[๋…ธ๋ธŒ๋žœ๋“œ]์ˆ˜์„ธ๋ฏธ3p","๊ณ ๋ฌด์žฅ๊ฐ‘","์šธ์ƒดํ‘ธ", "[๋…ธ๋ธŒ๋žœ๋“œ]์ข…์ดํ˜ธ์ผ","์ƒคํ”„๋ž€","[์•„๋””๋‹ค์Šค]์Šˆํผ์Šคํƒ€","๋‹น๊ทผ"}; //๊ฐ€๊ฒฉ int[] price = {12343780,15000,2980,4900,1000,2530,3310,5000,13300,1700,100,990,1440,4250,2750, 9800,5180,900,9900,9800,5000,4060,10130,3500,25000,800,20000,550,4560,520}; //์ˆ˜๋Ÿ‰ int[] num ={2,100,2,4,1,3,1,5,1,1,1,7,4,2,2, 8,1,1,1,2,1,2,1,3,2,6,9,1,5,1}; //๋ฉด์„ธ์œ ๋ฌด boolean[] taxFree ={false,false,true,false,false,true,false,false,true,true,false,false,true,false,false, false,false,false,false,false,false,true,false,false,false,false,false,false,false,true}; // ๊ณ„์‚ฐ // ๋ฉด์„ธ์ƒํ’ˆ ์ด๊ฐ€๊ฒฉ int taxFree_totalPrice=0; for (int i =0 ; i <itemName.length ; i++) { if (taxFree[i] == true) { taxFree_totalPrice = taxFree_totalPrice + price[i]*num[i]; } } // ์ „์ƒํ’ˆ ์ด๊ฐ€๊ฒฉ int totalPrice =0; for (int i =0 ; i <itemName.length ; i++) { totalPrice = totalPrice + price[i]*num[i]; } // ๊ณผ์„ธ์ƒํ’ˆ ์ด๊ฐ€๊ฒฉ(๋ฉด์„ธ์ƒํ’ˆ ์ด๊ฐ€๊ฒฉ - ์ „์ƒํ’ˆ ์ด๊ฐ€๊ฒฉ) int beforeTaxPrice = totalPrice - taxFree_totalPrice; // ์„ธ๊ธˆ๊ณ„์‚ฐ double taxRate = 10; int taxBase; int tax; if (beforeTaxPrice/(100+taxRate)==(int)(beforeTaxPrice/(100+taxRate))) {//์†Œ์ˆ˜์  ์•ˆ๋‚˜์˜ค๊ณ  ๋‚˜๋ˆ ๋–จ์–ด์ง tax = (int)(beforeTaxPrice/(100+taxRate)*taxRate);//์„ธ๊ธˆ๊ตฌํ•˜๋Š” ๊ณต์‹ }else { tax = (int)(beforeTaxPrice/(100+taxRate)*taxRate)+1;//์†Œ์ˆ˜์  ๋‚˜์˜ด //์„ธ๊ธˆ ์†Œ์ˆ˜์  ๋‚˜์˜ค๋ฉด ์„ธ๊ธˆ์„ 1์›์˜ฌ๋ฆฌ๊ณ  //์†Œ์ˆ˜์  ์ ˆ์‚ญ ์ฒ˜๋ฆฌ } taxBase = beforeTaxPrice - tax;//๊ณผ์„ธ๊ธˆ์•ก // double x; // ๊ณผ์„ธ ๋ฐ˜์˜ฌ๋ฆผ ์ฒ˜๋ฆฌ // x = (beforeTaxPrice / (1 + taxRate / 100));// ๊ณผ์„ธ๋ฐ˜์˜ฌ๋ฆผ ์œ„ํ•ด ๋”๋ธ”ํ˜• ๋ณ€์ˆ˜ ์„ ์–ธ // if ((x * 10) % 10 >= 5) // x = (int) x + 1;// ์†Œ์ˆ˜์ 1์ž๋ฆฌ 5์ด์ƒ์ด๋ฉด ๋ฐ˜์˜ฌ๋ฆผ // // taxBase = (int) x; // ๊ณผ์„ธ (int๊ฐ’ ์ทจํ•˜๊ธฐ) // tax = beforeTaxPrice - taxBase;// ์„ธ๊ธˆ //์ถœ๋ ฅ DecimalFormat df = new DecimalFormat("###,###,###,###,###"); SimpleDateFormat sdf1 = new SimpleDateFormat("YYYY-MM-dd HH:mm"); Calendar calt = Calendar.getInstance(); System.out.println(" ์ด๋งˆํŠธ ์ฃฝ์ „์  (031)888-1234"); System.out.println(" emart 206-86-50913์ด๊ฐˆ์ˆ˜"); System.out.println(" ์šฉ์ธ๊ตฌ ์ˆ˜์ง€์‹œ ํฌ์€๋Œ€๋กœ 552"); System.out.println(); System.out.println("์˜์ˆ˜์ฆ ๋ฏธ์ง€์ฐธ์‹œ ๊ตํ™˜/ํ™˜๋ถˆ ๋ถˆ๊ฐ€(30์ผ์ด๋‚ด)"); System.out.println("๊ตํ™˜/ํ™˜๋ถˆ ๊ตฌ๋งค์ ์—์„œ ๊ฐ€๋Šฅ(๊ฒฐ์ œ์นด๋“œ์ง€์ฐธ)"); System.out.println("์ฒดํฌ์นด๋“œ/์‹ ์šฉ์นด๋“œ ์ฒญ๊ตฌ์ทจ์†Œ ๋ฐ˜์˜์€"); System.out.println("์ตœ๋Œ€ 3~5์ผ ์†Œ์š” (์ฃผ๋ง,๊ณตํœด์ผ์ œ์™ธ)"); System.out.println(); System.out.printf("[๊ตฌ ๋งค]%s %24s\n",sdf1.format(calt.getTime()),"POS:0009-2418"); System.out.println("------------------------------------------------"); // ์ด 48์นธ System.out.printf("%4s%21s%3s%8s\n"," ์ƒ ํ’ˆ ๋ช…","๋‹จ ๊ฐ€","์ˆ˜๋Ÿ‰","๊ธˆ ์•ก"); System.out.println("------------------------------------------------"); //ํ•ญ๋ชฉ์ถœ๋ ฅ String star = null; for (int i =0 ; i <itemName.length ; i++) { //๋ฉด์„ธ๋ฌผํ’ˆ ๋ณ„ํ‘œ์ฐ๊ธฐ if (taxFree[i] == true) {star ="*";} else {star ="";} System.out.printf("%02d%-2s%s",i+1,star,itemName[i]); //ํ’ˆ๋ชฉ๋ช…๋’ค ๊ณต๋ฐฑ์ฐ๊ธฐ for (int blank =0 ; blank <19-itemName[i].getBytes().length ; blank++) { //๋ฐ”์ดํŠธ๋ฅผ ์–ป์–ด ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋žญ์Šคํ•จ-int๊ฐ’ ๋ฐ›์Œ System.out.printf("%s"," "); }// //๋‚˜๋จธ์ง€ ๋‹จ๊ฐ€ ์ˆ˜๋Ÿ‰ ๊ธˆ์•ก ์ฐ๊ธฐ System.out.printf("%10s%4s%11s\n",df.format(price[i]),num[i], df.format(price[i]*num[i])); } System.out.println(); System.out.printf("%22s%22s\n","(*)๋ฉด ์„ธ ๋ฌผ ํ’ˆ",df.format(taxFree_totalPrice)); System.out.printf("%22s%22s\n","๊ณผ ์„ธ ๋ฌผ ํ’ˆ",df.format(taxBase)); System.out.printf("%23s%22s\n","๋ถ€ ๊ณผ ์„ธ",df.format(tax)); System.out.printf("%24s%22s\n","ํ•ฉ ๊ณ„",df.format(totalPrice)); System.out.printf("๊ฒฐ ์ œ ๋Œ€ ์ƒ ๊ธˆ ์•ก%31s\n",df.format(totalPrice)); System.out.println("------------------------------------------------"); System.out.printf("0024 ํ•˜ ๋‚˜%37s\n","5417**8890/07850246"); System.out.printf("์นด๋“œ๊ฒฐ์ œ%37s\n","์ผ์‹œ๋ถˆ / "+df.format(totalPrice)); System.out.println("------------------------------------------------"); } }
7a58f8d42a4e42752db847cf1c5769e8cef0d444
ff20a09cfffe123f307e6ec1c822159488b0465e
/serveurclient/serveur/Authentification.java
9101c2db17777d5d3350bedbde0921fca46c37b6
[]
no_license
mouss1912/GestionRessources
844c2905c885ec2690133cbdf0d7796254aaf9f3
a74133a222457642b6a860dd6222795629cea2ad
refs/heads/master
2023-02-08T15:17:58.354213
2020-12-30T08:33:59
2020-12-30T08:33:59
298,415,843
0
0
null
null
null
null
UTF-8
Java
false
false
1,749
java
import java.net.*; import java.util.NoSuchElementException; import java.util.Scanner; import java.io.*; public class Authentification implements Runnable { private Socket socket; private PrintWriter out = null; private BufferedReader in = null; private String login = "zero", pass = null; public boolean authentifier = false; public Thread t2; public Authentification(Socket s){ socket = s; } public void run() { try { in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintWriter(socket.getOutputStream()); while(!authentifier){ out.println("Entrez votre login :"); out.flush(); login = in.readLine(); out.println("Entrez votre mot de passe :"); out.flush(); pass = in.readLine(); if(isValid(login, pass)){ out.println("connecte"); System.out.println(login +" vient de se connecter "); out.flush(); authentifier = true; } else {out.println("erreur"); out.flush();} } t2 = new Thread(new Chat_ClientServeur(socket, login)); t2.start(); } catch (IOException e) { System.err.println(login+" ne rรฉpond pas !"); } } private static boolean isValid(String login, String pass) { boolean connexion = false; try { Scanner sc = new Scanner(new File("zero.txt")); while(sc.hasNext()){ System.out.println(login+" "+pass+" xx "+sc.nextLine()); if(sc.nextLine().equals(login+" "+pass)){ connexion=true; break; } } } catch (FileNotFoundException e) { System.err.println("Le fichier n'existe pas !"); } return connexion; } }
a91e92403d9c7bc21a90d2cd151c6f3a00aeceeb
2c72a8050eb1f58543addee3a7a6e5e5a3641670
/gulimall-order/src/main/java/com/example/gulimall/order/entity/OrderEntity.java
5d66ce941e9c01dd00bba9c2a569ac1bb4e180aa
[ "Apache-2.0" ]
permissive
ZLin98/gulimall
2d44b4d47a77878157d06ecf667a5320e37cd055
449fdf4243a91513e57bc2554e9fc89413ed2264
refs/heads/main
2023-08-09T12:23:53.546019
2021-09-19T07:22:52
2021-09-19T07:22:52
400,522,723
0
0
null
null
null
null
UTF-8
Java
false
false
3,319
java
package com.example.gulimall.order.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * ่ฎขๅ• * * @author zl * @email * @date 2021-09-03 19:53:02 */ @Data @TableName("oms_order") public class OrderEntity implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId private Long id; /** * member_id */ private Long memberId; /** * ่ฎขๅ•ๅท */ private String orderSn; /** * ไฝฟ็”จ็š„ไผ˜ๆƒ ๅˆธ */ private Long couponId; /** * create_time */ private Date createTime; /** * ็”จๆˆทๅ */ private String memberUsername; /** * ่ฎขๅ•ๆ€ป้ข */ private BigDecimal totalAmount; /** * ๅบ”ไป˜ๆ€ป้ข */ private BigDecimal payAmount; /** * ่ฟ่ดน้‡‘้ข */ private BigDecimal freightAmount; /** * ไฟƒ้”€ไผ˜ๅŒ–้‡‘้ข๏ผˆไฟƒ้”€ไปทใ€ๆปกๅ‡ใ€้˜ถๆขฏไปท๏ผ‰ */ private BigDecimal promotionAmount; /** * ็งฏๅˆ†ๆŠตๆ‰ฃ้‡‘้ข */ private BigDecimal integrationAmount; /** * ไผ˜ๆƒ ๅˆธๆŠตๆ‰ฃ้‡‘้ข */ private BigDecimal couponAmount; /** * ๅŽๅฐ่ฐƒๆ•ด่ฎขๅ•ไฝฟ็”จ็š„ๆŠ˜ๆ‰ฃ้‡‘้ข */ private BigDecimal discountAmount; /** * ๆ”ฏไป˜ๆ–นๅผใ€1->ๆ”ฏไป˜ๅฎ๏ผ›2->ๅพฎไฟก๏ผ›3->้“ถ่”๏ผ› 4->่ดงๅˆฐไป˜ๆฌพ๏ผ›ใ€‘ */ private Integer payType; /** * ่ฎขๅ•ๆฅๆบ[0->PC่ฎขๅ•๏ผ›1->app่ฎขๅ•] */ private Integer sourceType; /** * ่ฎขๅ•็Šถๆ€ใ€0->ๅพ…ไป˜ๆฌพ๏ผ›1->ๅพ…ๅ‘่ดง๏ผ›2->ๅทฒๅ‘่ดง๏ผ›3->ๅทฒๅฎŒๆˆ๏ผ›4->ๅทฒๅ…ณ้—ญ๏ผ›5->ๆ— ๆ•ˆ่ฎขๅ•ใ€‘ */ private Integer status; /** * ็‰ฉๆตๅ…ฌๅธ(้…้€ๆ–นๅผ) */ private String deliveryCompany; /** * ็‰ฉๆตๅ•ๅท */ private String deliverySn; /** * ่‡ชๅŠจ็กฎ่ฎคๆ—ถ้—ด๏ผˆๅคฉ๏ผ‰ */ private Integer autoConfirmDay; /** * ๅฏไปฅ่Žทๅพ—็š„็งฏๅˆ† */ private Integer integration; /** * ๅฏไปฅ่Žทๅพ—็š„ๆˆ้•ฟๅ€ผ */ private Integer growth; /** * ๅ‘็ฅจ็ฑปๅž‹[0->ไธๅผ€ๅ‘็ฅจ๏ผ›1->็”ตๅญๅ‘็ฅจ๏ผ›2->็บธ่ดจๅ‘็ฅจ] */ private Integer billType; /** * ๅ‘็ฅจๆŠฌๅคด */ private String billHeader; /** * ๅ‘็ฅจๅ†…ๅฎน */ private String billContent; /** * ๆ”ถ็ฅจไบบ็”ต่ฏ */ private String billReceiverPhone; /** * ๆ”ถ็ฅจไบบ้‚ฎ็ฎฑ */ private String billReceiverEmail; /** * ๆ”ถ่ดงไบบๅง“ๅ */ private String receiverName; /** * ๆ”ถ่ดงไบบ็”ต่ฏ */ private String receiverPhone; /** * ๆ”ถ่ดงไบบ้‚ฎ็ผ– */ private String receiverPostCode; /** * ็œไปฝ/็›ด่พ–ๅธ‚ */ private String receiverProvince; /** * ๅŸŽๅธ‚ */ private String receiverCity; /** * ๅŒบ */ private String receiverRegion; /** * ่ฏฆ็ป†ๅœฐๅ€ */ private String receiverDetailAddress; /** * ่ฎขๅ•ๅค‡ๆณจ */ private String note; /** * ็กฎ่ฎคๆ”ถ่ดง็Šถๆ€[0->ๆœช็กฎ่ฎค๏ผ›1->ๅทฒ็กฎ่ฎค] */ private Integer confirmStatus; /** * ๅˆ ้™ค็Šถๆ€ใ€0->ๆœชๅˆ ้™ค๏ผ›1->ๅทฒๅˆ ้™คใ€‘ */ private Integer deleteStatus; /** * ไธ‹ๅ•ๆ—ถไฝฟ็”จ็š„็งฏๅˆ† */ private Integer useIntegration; /** * ๆ”ฏไป˜ๆ—ถ้—ด */ private Date paymentTime; /** * ๅ‘่ดงๆ—ถ้—ด */ private Date deliveryTime; /** * ็กฎ่ฎคๆ”ถ่ดงๆ—ถ้—ด */ private Date receiveTime; /** * ่ฏ„ไปทๆ—ถ้—ด */ private Date commentTime; /** * ไฟฎๆ”นๆ—ถ้—ด */ private Date modifyTime; }
f5ea3492409dc0004ca78e9bd5e6cc76764b3e61
80d32e12ffc52bb5742b76339887554a1c8af132
/runtime/runtime/master/src/main/java/es/bsc/mobile/runtime/types/profile/CoreProfile.java
b5d7148a771a44e4b56822d1581db6e32b0e6614
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
flordan/WACCPD
b16d97799bc142b8e89716f9313166978f1cae14
6a80bb079b5ce037221bf657e13b27672c7d82b8
refs/heads/master
2020-04-17T15:26:40.435582
2017-09-19T16:19:53
2017-09-19T16:19:53
166,698,932
0
0
null
null
null
null
UTF-8
Java
false
false
3,297
java
/* * Copyright 2008-2016 Barcelona Supercomputing Center (www.bsc.es) * * 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 es.bsc.mobile.runtime.types.profile; import es.bsc.mobile.types.JobProfile; import es.bsc.mobile.types.calc.MinMax; public class CoreProfile { private final int coreId; private final int numParams; private final MinMax[] inParamsSize; private final MinMax[] outParamsSize; private final MinMax inTargetSize; private final MinMax outTargetSize; private final MinMax resultSize; public CoreProfile(int coreId, int numParams) { this.coreId = coreId; this.numParams = numParams; inTargetSize = new MinMax(); outTargetSize = new MinMax(); resultSize = new MinMax(); inParamsSize = new MinMax[numParams]; outParamsSize = new MinMax[numParams]; for (int i = 0; i < numParams; i++) { inParamsSize[i] = new MinMax(); outParamsSize[i] = new MinMax(); } } public int getCoreId() { return coreId; } public int getNumParams() { return numParams; } public MinMax getParamInSize(int paramId) { return inParamsSize[paramId]; } public MinMax getParamOutSize(int paramId) { return outParamsSize[paramId]; } public MinMax getTargetInSize() { return inTargetSize; } public MinMax getTargetOutSize() { return outTargetSize; } public MinMax getResultSize() { return resultSize; } public void registerProfiledJob(JobProfile jp) { for (int i = 0; i < numParams; i++) { inParamsSize[i].newValue(jp.getParamsSize(true, i)); outParamsSize[i].newValue(jp.getParamsSize(false, i)); } inTargetSize.newValue(jp.getTargetSize(true)); outTargetSize.newValue(jp.getTargetSize(false)); resultSize.newValue(jp.getResultSize()); } public String dump(String prefix) { StringBuilder sb = new StringBuilder(); sb.append(prefix).append("\t IN Sizes\n"); for (int i = 0; i < numParams; i++) { sb.append(prefix).append("\t\t Param ").append(i).append("\t").append(inParamsSize[i]).append("\n"); } sb.append(prefix).append("\t\tTarget \t").append(inTargetSize).append("\n"); sb.append(prefix).append("\t OUT Sizes\n"); for (int i = 0; i < numParams; i++) { sb.append(prefix).append("\t\t Param ").append(i).append("\t").append(outParamsSize[i]).append("\n"); } sb.append(prefix).append("\t\tTarget \t").append(outTargetSize).append("\n"); sb.append(prefix).append("\t\tResult \t").append(resultSize).append("\n"); return sb.toString(); } }
59382cc642693ee965cebe7b017064287cdbe8a6
a08eeb3ba2149069ee080459a721fa6b1dc70fc4
/src/main/java/com/fishmart/controller/ApplicationController.java
9c46caea0790fa31c5fe9836d216a4bf77586d2b
[]
no_license
kumaruragonda/fishmart
15388d80cfb38a4ca83ce0bdc00c44193a9f4229
1cec3a32bc4b4cb0b7968e6771ba931013529b9b
refs/heads/master
2021-04-29T01:08:40.014094
2017-01-15T14:52:42
2017-01-15T14:52:42
77,785,369
0
0
null
null
null
null
UTF-8
Java
false
false
3,491
java
package com.fishmart.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.fishmart.configuration.AppConfiguration; import com.fishmart.model.Category; import com.fishmart.model.OrderDetails; import com.fishmart.model.Product; import com.fishmart.service.CategoryService; import com.fishmart.service.OrderDetailsService; import com.fishmart.service.ProductService; @Controller @RequestMapping("/") public class ApplicationController { @Autowired OrderDetailsService service; @Autowired ProductService productService; @Autowired CategoryService categoryService; @RequestMapping(method = RequestMethod.GET) public String getHomePage(ModelMap model) { //List<Category> categoryList = categoryService.findAll(); List<Product> productList = productService.findAll(); for(Product order:productList){ System.out.println(order); } List<Category> categoryList =categoryService.findAll(); Map<String, ArrayList<String>> productCategoryList = new LinkedHashMap<String, ArrayList<String>>(); Map<Integer,String> productmap = new HashMap<Integer, String>(); for(Category cat:categoryList){ //System.out.println(cat); Iterator<Product> itr=cat.getProductDetails().iterator(); ArrayList<String> arraylist = new ArrayList<String>(); while(itr.hasNext()){ //Integer productId=itr.next().getProductId(); //String productName=itr.next().getProductName(); arraylist.add(itr.next().getProductName()); if(productCategoryList.containsKey(cat.getCategoryName())){ productCategoryList.put(cat.getCategoryName(), arraylist); }else{ productCategoryList.put(cat.getCategoryName(), arraylist); } } } List<OrderDetails> orderDetailsList =service.findAll(); for(OrderDetails order:orderDetailsList){ System.out.println(order); } model.addAttribute("orderDetailsList", orderDetailsList); model.addAttribute("productList", productList); model.addAttribute("productCategoryList", productCategoryList); return "welcome"; } @RequestMapping(value = "/contact", method = RequestMethod.GET) public String sayHelloAgain(ModelMap model) { //model.addAttribute("greeting", "Hello World Again, from Spring 4 MVC"); return "contact-information"; } @RequestMapping(value = "/shoppingCart", method = RequestMethod.GET) public String getShoppingCart(ModelMap model) { //model.addAttribute("greeting", "Hello World Again, from Spring 4 MVC"); return "shopping-cart"; } @RequestMapping(value = "/checkout", method = RequestMethod.GET) public String getCheckoutPage(ModelMap model) { //model.addAttribute("greeting", "Hello World Again, from Spring 4 MVC"); return "checkout"; } @RequestMapping(value = "/fishList", method = RequestMethod.GET) public String getFishList(ModelMap model) { //model.addAttribute("greeting", "Hello World Again, from Spring 4 MVC"); return "fish-list"; } }
82d30fca18611255eeb00ef430ebd76afc4c81ec
904776c4647ad0a1a28c125fd92ead0d22541a71
/GUI-Projekte/JavaMusterloesungen/VererbungBauernhof2Kap10/Kuh.java
50f6946b576fe3f011c09238ec149d853a241e72
[]
no_license
micaelN/ZHAWProgrammieren
cc4a121e3a1370fbcebc4ae16e26bbfd00a864a4
546eeb194fe25d6f604f72ebede5f4645dc64430
refs/heads/master
2021-06-01T07:59:53.612217
2015-12-07T11:25:50
2015-12-07T11:25:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
656
java
package VererbungBauernhof2Kap10; public class Kuh implements Tier, Comparable<Kuh> { private String name; private int gewicht; public Kuh(String name, int gewicht) { this.name = name; this.gewicht = gewicht; } @Override public int compareTo(Kuh o) { // return this.getName().compareTo(o.getName()); return this.getGewicht() - o.getGewicht(); } /** * @return the name */ public String getName() { return name; } /** * @return the gewicht */ public int getGewicht() { return gewicht; } @Override public void gibLaut() { System.out.println("Muuuuuuhhhhhhh"); } }
e5fa59e7ec471c0cb29c06416be940d285c4de0f
f0329e7d6b39706fd3e7598b693adc6e831f7095
/coffeeorderapp/src/main/java/au/com/philology/coffeeorderapp/activities/ActivitySettingsCloudOrdersFilter.java
a5477db280ab8e7e1ade1b85f874df4343f66f4a
[]
no_license
ricol/CoffeeOrderApp
d0d9b4bc0413a4305493eaa4afc65b1bbfbd62cd
1734bec2166919e39d81f297c22be9907677fef8
refs/heads/master
2022-12-04T05:03:49.417200
2020-04-15T10:15:38
2020-04-15T10:15:38
290,414,586
0
0
null
null
null
null
UTF-8
Java
false
false
13,893
java
package au.com.philology.coffeeorderapp.activities; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.RadioGroup; import android.widget.Toast; import java.util.ArrayList; import java.util.Date; import au.com.philology.coffeeorderapp.R; import au.com.philology.coffeeorderapp.database.CardReaderIdentifier; import au.com.philology.coffeeorderapp.database.CloudOrderFilter; import au.com.philology.coffeeorderapp.database.CloudOrderFilter.Filter_Type; import au.com.philology.coffeeorderapp.database.InterestedCardReaderID; import au.com.philology.coffeeorderapp.datasource.cloudorders.ICloudOrderDelegate; import au.com.philology.coffeeorderapp.datasource.cloudorders.TheCloudOrdersService; import au.com.philology.coffeeorderapp.dialogs.EditCardReaderDialog; import au.com.philology.controls.AutoSelectListView; import au.com.philology.dialogs.DialogConfirm; import au.com.philology.dialogs.IDialogConfirmDelegate; public class ActivitySettingsCloudOrdersFilter extends BasicActivity implements android.widget.RadioGroup.OnCheckedChangeListener, IDialogConfirmDelegate, ICloudOrderDelegate { static final int TAG_ADD_CARD_READER_ID = 100; static final int TAG_DELETE_CARD_READER_ID = 101; ArrayAdapter<String> mArrayInterestedIdentifiers, mArrayAllAvailableIdentifers; Button btnAdd, btnRemove, btnEditTag, btnAddto, btnAddAllTo, btnRemoveFrom, btnRemoveAllFrom; RadioGroup rgFilters; AutoSelectListView lvInterestedIdentifiers, lvAllAvailableIdentifiers; LinearLayout theLinearLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.settings_cloud_orders_filter); this.btnAdd = (Button) this.findViewById(R.id.btnAdd); this.btnAdd.setOnClickListener(this); this.btnRemove = (Button) this.findViewById(R.id.btnRemove); this.btnRemove.setOnClickListener(this); this.btnEditTag = (Button) this.findViewById(R.id.btnEditTag); this.btnEditTag.setOnClickListener(this); this.btnAddto = (Button) this.findViewById(R.id.btnAddTo); this.btnAddto.setOnClickListener(this); this.btnAddAllTo = (Button) this.findViewById(R.id.btnAddAllTo); this.btnAddAllTo.setOnClickListener(this); this.btnRemoveFrom = (Button) this.findViewById(R.id.btnRemoveFrom); this.btnRemoveFrom.setOnClickListener(this); this.btnRemoveAllFrom = (Button) this.findViewById(R.id.btnRemoveAllFrom); this.btnRemoveAllFrom.setOnClickListener(this); this.rgFilters = (RadioGroup) this.findViewById(R.id.rgFilter); this.theLinearLayout = (LinearLayout) this.findViewById(R.id.theLinearLayout); this.lvInterestedIdentifiers = (AutoSelectListView) this.findViewById(R.id.lvIdentifiers); this.mArrayInterestedIdentifiers = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_activated_1); this.lvInterestedIdentifiers.setAdapter(this.mArrayInterestedIdentifiers); this.lvInterestedIdentifiers.setChoiceMode(ListView.CHOICE_MODE_SINGLE); this.lvAllAvailableIdentifiers = (AutoSelectListView) this.findViewById(R.id.lvAllDetectedIdentifiers); this.mArrayAllAvailableIdentifers = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_activated_1); this.lvAllAvailableIdentifiers.setAdapter(this.mArrayAllAvailableIdentifers); this.lvAllAvailableIdentifiers.setChoiceMode(ListView.CHOICE_MODE_SINGLE); TheCloudOrdersService.getSharedInstance().addDelegate(this); boolean bIsFilterInterested = CloudOrderFilter.isFilterInterested(); int checked = bIsFilterInterested ? 1 : 0; View theView = this.rgFilters.getChildAt(checked); this.rgFilters.clearCheck(); this.rgFilters.check(theView.getId()); this.rgFilters.setOnCheckedChangeListener(this); this.checkAgainstId(this.rgFilters.getCheckedRadioButtonId()); ArrayList<CardReaderIdentifier> allCardReaderIDs = CardReaderIdentifier.getAll(); for (CardReaderIdentifier aObject : allCardReaderIDs) this.addAvailableIdentifier(aObject.identifier, false); ArrayList<InterestedCardReaderID> all = InterestedCardReaderID.getAll(); for (InterestedCardReaderID aObject : all) { this.removeAvailableIdentifier(aObject.interestedId, false); this.addInterestedIdentifier(aObject.interestedId); } } @Override protected void onResume() { super.onResume(); this.imgBtnInfor.setVisibility(View.INVISIBLE); this.imgBtnIcon.setVisibility(View.INVISIBLE); this.imgBtnHome.setVisibility(View.INVISIBLE); TheCloudOrdersService.getSharedInstance().addDelegate(this); } @Override protected void onPause() { super.onPause(); TheCloudOrdersService.getSharedInstance().removeDelegate(this); } @Override public void finish() { super.finish(); TheCloudOrdersService.getSharedInstance().removeDelegate(this); } @Override public void onClick(View v) { super.onClick(v); if (v.equals(this.btnAdd)) { DialogConfirm aDialog = new DialogConfirm(this, "Please type the identifier", "", true, R.layout.input_dialog, this, TAG_ADD_CARD_READER_ID); aDialog.show(); } else if (v.equals(this.btnRemove)) { int index = this.lvAllAvailableIdentifiers.getCheckedItemPosition(); if (index > -1 && index < this.mArrayAllAvailableIdentifers.getCount()) { DialogConfirm aDialog = new DialogConfirm(this, "Confirm", "Delete the card reader identifier?", false, 0, this, TAG_DELETE_CARD_READER_ID); aDialog.theData = index; aDialog.show(); } else Toast.makeText(this, "Please select an item first!", Toast.LENGTH_LONG).show(); } else if (v.equals(this.btnEditTag)) { int index = this.lvAllAvailableIdentifiers.getCheckedItemPosition(); if (index > -1 && index < this.mArrayAllAvailableIdentifers.getCount()) { String identifier = this.mArrayAllAvailableIdentifers.getItem(index); EditCardReaderDialog aDialog = new EditCardReaderDialog(this, null, identifier); aDialog.show(); } else Toast.makeText(this, "Please select an item first!", Toast.LENGTH_LONG).show(); } else if (v.equals(this.btnAddto)) { int index = this.lvAllAvailableIdentifiers.getCheckedItemPosition(); if (index > -1 && index < this.mArrayAllAvailableIdentifers.getCount()) { String text = this.mArrayAllAvailableIdentifers.getItem(index); this.addInterestedIdentifier(text); this.removeAvailableIdentifier(index, false); } else Toast.makeText(this, "No more available identifires to add!\nPlease scan a card on a device to add one.", Toast.LENGTH_LONG).show(); } else if (v.equals(this.btnAddAllTo)) { if (this.mArrayAllAvailableIdentifers.getCount() <= 0) { Toast.makeText(this, "No more available identifiers to add!\nPlease scan a card on a device to add one.", Toast.LENGTH_LONG).show(); return; } while (this.mArrayAllAvailableIdentifers.getCount() > 0) { String text = this.mArrayAllAvailableIdentifers.getItem(0); this.removeAvailableIdentifier(0, false); this.addInterestedIdentifier(text); } } else if (v.equals(this.btnRemoveFrom)) { int index = this.lvInterestedIdentifiers.getCheckedItemPosition(); if (index > -1 && index < this.mArrayInterestedIdentifiers.getCount()) { String text = this.mArrayInterestedIdentifiers.getItem(index); this.removeInterestedIdentifier(index); this.addAvailableIdentifier(text, false); } else Toast.makeText(this, "No more interested identifiers to move.", Toast.LENGTH_LONG).show(); } else if (v.equals(this.btnRemoveAllFrom)) { if (this.mArrayInterestedIdentifiers.getCount() <= 0) { Toast.makeText(this, "No more interested identifiers to move.", Toast.LENGTH_LONG).show(); return; } while (this.mArrayInterestedIdentifiers.getCount() > 0) { String text = this.mArrayInterestedIdentifiers.getItem(0); this.removeInterestedIdentifier(0); this.addAvailableIdentifier(text, false); } } } @Override public void onCheckedChanged(RadioGroup group, int checkedId) { this.checkAgainstId(checkedId); } void checkAgainstId(int checkedId) { View object = this.rgFilters.findViewById(checkedId); View All = this.rgFilters.getChildAt(0); this.theLinearLayout.setVisibility(All.equals(object) ? View.INVISIBLE : View.VISIBLE); this.btnAdd.setVisibility(this.theLinearLayout.getVisibility()); this.btnRemove.setVisibility(this.theLinearLayout.getVisibility()); this.btnEditTag.setVisibility(this.theLinearLayout.getVisibility()); CloudOrderFilter.updateCloudOrderFilter(All.equals(object) ? Filter_Type.FILTER_ALL : Filter_Type.FILTER_INTERESTED, new Date().getTime()); } @Override public void dialogConfirmOnOk(DialogConfirm theDialog, View theContentView) { if (theDialog.tag == TAG_ADD_CARD_READER_ID) { EditText etContent = (EditText) theContentView.findViewById(R.id.etContent); if (etContent != null) { String text = etContent.getText().toString(); this.addAvailableIdentifier(text, true); } } else if (theDialog.tag == TAG_DELETE_CARD_READER_ID) { Object data = theDialog.theData; if (data instanceof Integer) { int index = (Integer) data; this.removeAvailableIdentifier(index, true); } } } @Override public void dialogConfirmOnCancel(DialogConfirm theDialog, View theContentView) { } @Override public void cloudOrderDataReceived(String data) { } @Override public void cloudOrderStarted() { } @Override public void cloudOrderEnded() { } @Override public void cloudOrderNewOrder(String deviceId, String tagId) { final String id = deviceId; runOnUiThread(new Runnable() { @Override public void run() { addAvailableIdentifier(id, true); } }); } void addInterestedIdentifier(String text) { if (text == null) return; if (text.equalsIgnoreCase("")) return; if (this.mArrayInterestedIdentifiers.getPosition(text) <= -1) this.mArrayInterestedIdentifiers.add(text); InterestedCardReaderID.insertInterestedId(text, new Date().getTime()); this.lvInterestedIdentifiers.autoSelect(this.mArrayInterestedIdentifiers.getPosition(text)); } void removeInterestedIdentifier(String text) { int index = this.mArrayInterestedIdentifiers.getPosition(text); if (index > -1 && index < this.mArrayInterestedIdentifiers.getCount()) { InterestedCardReaderID.removeInterestedId(text); this.mArrayInterestedIdentifiers.remove(text); this.lvInterestedIdentifiers.autoSelect(index); } } void removeInterestedIdentifier(int index) { if (index > -1 && index < this.mArrayInterestedIdentifiers.getCount()) { String text = this.mArrayInterestedIdentifiers.getItem(index); if (text != null) { this.removeInterestedIdentifier(text); } } } void addAvailableIdentifier(String text, boolean addToDB) { if (text == null) return; if (text.equalsIgnoreCase("")) return; if (this.mArrayAllAvailableIdentifers.getPosition(text) <= -1) this.mArrayAllAvailableIdentifers.add(text); if (addToDB) CardReaderIdentifier.insert(text, "", "", 0, new Date().getTime()); this.lvAllAvailableIdentifiers.autoSelect(this.mArrayAllAvailableIdentifers.getPosition(text)); } void removeAvailableIdentifier(String text, boolean deleteFromDB) { int index = this.mArrayAllAvailableIdentifers.getPosition(text); if (index > -1 && index < this.mArrayAllAvailableIdentifers.getCount()) { this.mArrayAllAvailableIdentifers.remove(text); this.lvAllAvailableIdentifiers.autoSelect(index); if (deleteFromDB) { CardReaderIdentifier.remove(text); } } } void removeAvailableIdentifier(int index, boolean deleteFromDB) { if (index > -1 && index < this.mArrayAllAvailableIdentifers.getCount()) { String text = this.mArrayAllAvailableIdentifers.getItem(index); if (text != null) { this.removeAvailableIdentifier(text, deleteFromDB); } } } }
ab713ec9de665414a651811e47db8cb196348958
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_473/Testnull_47274.java
f8fcc8caea729f7f09497bfeaa050d1f3f404ee4
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_473; import static org.junit.Assert.*; public class Testnull_47274 { private final Productionnull_47274 production = new Productionnull_47274("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
4bc8063da1f8d9628a5ffd8b3571af4df6fa3c36
8f8d9c60b9a9a8cecd4b9e1f159850406ee7beb5
/app/src/main/java/com/example/sober_philer/studyui/day16_fab_hide_show/BehaviorFab.java
1b18bac860b71182c7cde262cf669ab4a6baa00b
[]
no_license
LiuLinXin/StudyUI
fe0e231115d62ee11ecc2b060b412ca2e92157d2
9db2c499dc2d183b130357ab02becf3d98fb0421
refs/heads/master
2021-10-25T06:34:02.802727
2019-04-02T10:18:21
2019-04-02T10:18:21
111,983,373
0
0
null
null
null
null
UTF-8
Java
false
false
2,226
java
package com.example.sober_philer.studyui.day16_fab_hide_show; import android.content.Context; import android.support.annotation.NonNull; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; /** * Created by sober_philer on 2018/1/27. * description: */ public class BehaviorFab extends FloatingActionButton.Behavior { private boolean isShow = true; public BehaviorFab(Context context, AttributeSet attributeSet){ super(context,attributeSet); } @Override public boolean onStartNestedScroll( @NonNull CoordinatorLayout coordinatorLayout, @NonNull FloatingActionButton child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) { boolean b = axes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type); return b; // return super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type); } @Override public void onNestedScroll( @NonNull CoordinatorLayout coordinatorLayout, @NonNull FloatingActionButton child, @NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type) { super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type); if (dyConsumed > 10 && isShow) { hide(child); isShow = false; } else if (dyConsumed < -10 && !isShow) { show(child); isShow = true; } } private void hide(View view) { ViewCompat.animate(view).scaleX(0f).scaleY(0f).setDuration(500).setInterpolator(new AccelerateInterpolator()).start(); } private void show(View view) { ViewCompat.animate(view).scaleX(1f).scaleY(1f).setDuration(500).setInterpolator(new DecelerateInterpolator()).start(); } }
2a2fa5f1c9a5b128724d0d9fbfc2349d1a00709d
e756c0b6e0e697807dbaf05413ab64bbf95b22b7
/gpsTest1/buttonTest1/gen/com/example/buttontest1/R.java
c58095a2cb5aa7d18896c260449f58f7af504b20
[]
no_license
duncanbeggs/workout-warrior
7ae53230b55585b4eec29f0518a61dc30cb7b122
f08639110740c88f40f430e245e2967e00c0dd79
refs/heads/master
2021-01-19T16:24:53.688004
2014-05-30T03:21:31
2014-05-30T03:21:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,643
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.example.buttontest1; public final class R { public static final class attr { } public static final class dimen { /** Default screen margins, per the Android Design guidelines. Customize dimensions originally defined in res/values/dimens.xml (such as screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. */ public static final int activity_horizontal_margin=0x7f040000; public static final int activity_vertical_margin=0x7f040001; } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int action_settings=0x7f080004; public static final int textLat=0x7f080001; public static final int textLong=0x7f080003; public static final int textView1=0x7f080000; public static final int textView3=0x7f080002; } public static final class layout { public static final int activity_main=0x7f030000; } public static final class menu { public static final int main=0x7f070000; } public static final class string { public static final int action_settings=0x7f050001; public static final int app_name=0x7f050000; public static final int hello_world=0x7f050002; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f060001; } }
14a9170e2d7f9597ad5565f63062c0be4cce1328
f27905fa30c43e7441670c21a1fa83a679d652a2
/app/src/main/java/com/huateng/phone/collection/utils/CrashAppUtil.java
24976a78a1323b914b1fd43432a0e71168e30a95
[]
no_license
JQHxx/CollecttionApp
255bf1c2e6327615fffcbba81095a3f70411e74b
ecea46860bb4f8c6ab536c3a4310e1262570fc09
refs/heads/master
2022-11-29T18:41:06.306869
2020-08-06T07:07:52
2020-08-06T07:07:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,007
java
package com.huateng.phone.collection.utils; /** * author: yichuan * Created on: 2020/6/10 16:03 * description: */ import android.annotation.SuppressLint; import android.app.ActivityManager; import android.content.Context; import android.os.Process; import android.os.SystemClock; import android.telephony.TelephonyManager; import android.util.Log; import com.tools.utils.FileUtils; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import java.util.HashMap; import java.util.Map; import static android.content.Context.TELEPHONY_SERVICE; /** * @since ๅˆ›ๅปบๆ—ถ้—ด 2017/1/10. * <br><b>ๆ•่Žทๅผ‚ๅธธไฟกๆฏ</b></br> */ public class CrashAppUtil implements Thread.UncaughtExceptionHandler { private Thread.UncaughtExceptionHandler mDefaultHandler;// ็ณป็ปŸ้ป˜่ฎค็š„UncaughtExceptionๅค„็†็ฑป @SuppressLint("StaticFieldLeak") private static CrashAppUtil INSTANCE;// CrashHandlerๅฎžไพ‹ private Context mContext;// ็จ‹ๅบ็š„Contextๅฏน่ฑก private Map<String, String> info = new HashMap<>();// ็”จๆฅๅญ˜ๅ‚จ่ฎพๅค‡ไฟกๆฏๅ’Œๅผ‚ๅธธไฟกๆฏ private String name = ""; private String versionCode = ""; // private int publishProcess = 0;//ๅ‘ๅธƒ่ฟ›็จ‹ // private int loginProcess = 0;//็™ปๅฝ•่ฟ›็จ‹ // private int settingProcess = 0;//่ฎพ็ฝฎ่ฟ›็จ‹ /** * ไฟ่ฏๅชๆœ‰ไธ€ไธชCrashHandlerๅฎžไพ‹ */ private CrashAppUtil() { } /** * ่Žทๅ–CrashHandlerๅฎžไพ‹ ,ๅ•ไพ‹ๆจกๅผ */ public static CrashAppUtil getInstance() { if (INSTANCE == null) { synchronized (CrashAppUtil.class) { if (INSTANCE == null) { INSTANCE = new CrashAppUtil(); } } } return INSTANCE; } /** * ๅˆๅง‹ๅŒ– * * @param context ไธŠไธ‹ๆ–‡ */ public void init(Context context, String name, String versionCode, int process) { mContext = context; this.name = name; this.versionCode = versionCode; mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();// ่Žทๅ–็ณป็ปŸ้ป˜่ฎค็š„UncaughtExceptionๅค„็†ๅ™จ Thread.setDefaultUncaughtExceptionHandler(this);// ่ฎพ็ฝฎ่ฏฅCrashHandlerไธบ็จ‹ๅบ็š„้ป˜่ฎคๅค„็†ๅ™จ // if ("com.circle.youyu:loginandregister".equals(name)) { // loginProcess = process; // } else if ("com.circle.youyu:publishimage".equals(name)) { // publishProcess = process; // } else if ("com.circle.youyu:setinfo".equals(name)) { // settingProcess = process; // } } /** * ๅฝ“UncaughtExceptionๅ‘็”Ÿๆ—ถไผš่ฝฌๅ…ฅ่ฏฅ้‡ๅ†™็š„ๆ–นๆณ•ๆฅๅค„็† */ public void uncaughtException(Thread thread, final Throwable ex) { try { if (!handleException(ex) && mDefaultHandler != null) { // ๅฆ‚ๆžœ่‡ชๅฎšไน‰็š„ๆฒกๆœ‰ๅค„็†ๅˆ™่ฎฉ็ณป็ปŸ้ป˜่ฎค็š„ๅผ‚ๅธธๅค„็†ๅ™จๆฅๅค„็† mDefaultHandler.uncaughtException(thread, ex); } else { Log.i("nb", "้”™่ฏฏๆœชๅค„็†"); } } catch (Exception e) { e.printStackTrace(); } } /** * ่‡ชๅฎšไน‰้”™่ฏฏๅค„็†,ๆ”ถ้›†้”™่ฏฏไฟกๆฏ ๅ‘้€้”™่ฏฏๆŠฅๅ‘Š็ญ‰ๆ“ไฝœๅ‡ๅœจๆญคๅฎŒๆˆ. * * @param ex ๅผ‚ๅธธไฟกๆฏ * @return true ๅฆ‚ๆžœๅค„็†ไบ†่ฏฅๅผ‚ๅธธไฟกๆฏ;ๅฆๅˆ™่ฟ”ๅ›žfalse. */ @SuppressLint("MissingPermission") private boolean handleException(Throwable ex) { Log.i("nb","่Žทๅ–ๅˆฐๅผ‚ๅธธ:"+ex.getMessage()); if (ex == null) return false; // new Thread() { // public void run() { // Looper.prepare(); // ToastUtil.showShortToast(mContext, "ๅ‡บไบ†็‚นๅฐ้—ฎ้ข˜๏ผŒๆญฃๅœจๅŠ ็ดงไฟฎๅค๏ผ"); // Looper.loop(); // } // }.start(); // ๆ”ถ้›†่ฎพๅค‡ๅ‚ๆ•ฐไฟกๆฏ collectDeviceInfo(mContext, versionCode); // ๅ‘้€ๅ †ๆ ˆไฟกๆฏ sendMessage(ex); if ("com.huateng.phone.collection".equals(name)) { // mContext.sendBroadcast(new Intent("mainThreadClose")); // LogUtil.info("Yang", "้—ช้€€"); // if (0 != publishProcess) {//ๅ…ณ้—ญๅ‘ๅธƒ่ฟ›็จ‹ // android.os.Process.killProcess(publishProcess); // } // if (0 != loginProcess) {//ๅ…ณ้—ญ็™ปๅฝ•่ฟ›็จ‹ // android.os.Process.killProcess(loginProcess); // } // if (0 != settingProcess) {//ๅ…ณ้—ญ่ฎพ็ฝฎ่ฟ›็จ‹ // android.os.Process.killProcess(settingProcess); // } android.os.Process.killProcess(Process.myPid()); System.exit(0); } else { if (mContext != null) { SystemClock.sleep(3000); ActivityManager activityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); if (activityManager != null){ activityManager.killBackgroundProcesses(name); System.exit(0); } } } return true; } /** * ๆ”ถ้›†่ฎพๅค‡ๅ‚ๆ•ฐไฟกๆฏ * * @param context ไธŠไธ‹ๆ–‡ * @param version_num ๅฝ“ๅ‰็š„็‰ˆๆœฌๅท */ private void collectDeviceInfo(Context context, String version_num) { if (context == null) { return; } String phone_type = android.os.Build.MODEL; // ๆ‰‹ๆœบๅž‹ๅท String system_version = android.os.Build.VERSION.RELEASE;//็ณป็ปŸ็‰ˆๆœฌ String sdk_version = android.os.Build.VERSION.SDK;//sdk็‰ˆๆœฌ if (phone_type == null){ phone_type = ""; } if (system_version == null){ system_version = ""; } if (sdk_version == null){ sdk_version = ""; } info.put("phone_type", phone_type); info.put("system_version", system_version); info.put("sdk_version", sdk_version); info.put("code_num", version_num); TelephonyManager mTm = (TelephonyManager) context.getSystemService(TELEPHONY_SERVICE); if (mTm != null) { @SuppressLint({"HardwareIds", "MissingPermission"}) String telPhone = mTm.getLine1Number(); if (telPhone == null){ telPhone = ""; } info.put("tel_phone", telPhone); } } /** * ๅฐ†ๅ †ๆ ˆไฟกๆฏๅ‘้€ๅˆฐๆœๅŠกๅ™จ * * @param ex Throwable */ private void sendMessage(Throwable ex) { if (info != null){ StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> entry : info.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); sb.append(key).append("=").append(value).append("\r\n"); } Writer writer = new StringWriter(); PrintWriter pw = new PrintWriter(writer); ex.printStackTrace(pw); Throwable cause = ex.getCause(); // ๅพช็Žฏ็€ๆŠŠๆ‰€ๆœ‰็š„ๅผ‚ๅธธไฟกๆฏๅ†™ๅ…ฅwriterไธญ while (cause != null) { cause.printStackTrace(pw); cause = cause.getCause(); } pw.close();// ่ฎฐๅพ—ๅ…ณ้—ญ String result = writer.toString(); sb.append(result); String errorMsg = sb.toString(); //ๅฐ†ๆ–‡ไปถๅ†™ๅ…ฅๅˆฐๆœฌๅœฐ String filePath = FileUtils.createFilePath("collection_app_crash", System.currentTimeMillis() + "_log.txt"); boolean flag = FileUtils.writeFile(filePath, errorMsg, false); Log.i("nb","flag = " + flag); SystemClock.sleep(3000); } } }
fb6e2de671eee20fa6f118b28b3f5c2909700fd6
494837669ad12b8665a21c6a6cf284931dd62954
/trunk/Web Duc/java/dao/BankInfoFacadeLocal.java
8e7169c13ee4d706fb41f01701284868a5416abb
[]
no_license
BGCX067/f1203t0-sem4-eproject-svn-to-git
17865d1d37cf820face5431f4f43ef20b62aa462
30a61f31e693f6122ff190a4542a8a937749a8a5
refs/heads/master
2016-09-01T08:52:04.248683
2015-12-28T14:44:56
2015-12-28T14:44:56
48,851,007
0
0
null
null
null
null
UTF-8
Java
false
false
529
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package dao; import java.util.List; import javax.ejb.Local; import model.BankInfo; /** * * @author Duc */ @Local public interface BankInfoFacadeLocal { void create(BankInfo bankInfo); void edit(BankInfo bankInfo); void remove(BankInfo bankInfo); BankInfo find(Object id); List<BankInfo> findAll(); List<BankInfo> findRange(int[] range); int count(); }
64464b6266a858b5746cc764951eb22ddcdd06f4
3933edacea0df075e3f63c4aa8a53da0dd539a19
/common/src/main/java/com/taurusxi/androidcommon/view/ColorAnimationView.java
7d53e9751a509177abb7be9356b9c9fedce0f791
[]
no_license
TaurusXi/AndroidCommon
bdae1dcc4c9a333fe4c3fc08df7fc7f39bb10ccf
2c0feb16c23092fa202bbd94880691d74f27717e
refs/heads/master
2016-09-06T16:19:53.365828
2015-03-21T08:18:55
2015-03-21T08:18:55
32,625,013
1
1
null
null
null
null
UTF-8
Java
false
false
5,276
java
package com.taurusxi.androidcommon.view; import android.animation.Animator; import android.animation.ArgbEvaluator; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.widget.FrameLayout; /** * Created on 15/2/12. * * @author xicheng * @email [email protected] * @github https://github.com/TaurusXi */ public class ColorAnimationView extends FrameLayout implements ValueAnimator.AnimatorUpdateListener, Animator.AnimatorListener { private int[] colors; public int[] getColors() { return colors; } public void setColors(int[] colors) { this.colors = colors; } private static final int DURATION = 3000; ValueAnimator colorAnim = null; private PageChangeListener mPageChangeListener; ViewPager.OnPageChangeListener onPageChangeListener; public void setOnPageChangeListener(ViewPager.OnPageChangeListener onPageChangeListener) { this.onPageChangeListener = onPageChangeListener; } /** * ่ฟ™ๆ˜ฏไฝ ๅ”ฏไธ€้œ€่ฆๅ…ณๅฟƒ็š„ๆ–นๆณ• * @param mViewPager ไฝ ๅฟ…้กปๅœจ่ฎพ็ฝฎ Viewpager ็š„ Adapter ่ฟ™ๅŽ๏ผŒๆ‰่ƒฝ่ฐƒ็”จ่ฟ™ไธชๆ–นๆณ•ใ€‚ * @param obj ,่ฟ™ไธชobjๅฎž็Žฐไบ† ColorAnimationView.OnPageChangeListener ๏ผŒๅฎž็Žฐๅ›ž่ฐƒ * @param count ,viewpagerๅญฉๅญ็š„ๆ•ฐ้‡ * @param colors int... colors ๏ผŒไฝ ้œ€่ฆ่ฎพ็ฝฎ็š„้ขœ่‰ฒๅ˜ๅŒ–ๅ€ผ~~ ๅฆ‚ไฝ•ไฝ ไผ ไบบ ็ฉบ๏ผŒ้‚ฃไนˆ่งฆๅ‘้ป˜่ฎค่ฎพ็ฝฎ็š„้ขœ่‰ฒๅŠจ็”ป * */ /** * This is the only method you need care about. * * @param mViewPager ,you need set the adpater before you call this. * @param count ,this param set the count of the viewpaper's child * @param colors ,this param set the change color use (int... colors), * so,you could set any length if you want.And by default. * if you set nothing , don't worry i have already creat * a default good change color! */ public void setmViewPager(ViewPager mViewPager, int count, int[] colors) { if (mViewPager.getAdapter() == null) { throw new IllegalStateException( "ViewPager does not have adapter instance."); } mPageChangeListener.setViewPagerChildCount(count); mViewPager.setOnPageChangeListener(mPageChangeListener); setColors(colors); } public ColorAnimationView(Context context) { this(context, null, 0); } public ColorAnimationView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ColorAnimationView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mPageChangeListener = new PageChangeListener(); } private void seek(long seekTime) { if (colorAnim == null) { createAnimation(); } colorAnim.setCurrentPlayTime(seekTime); } private void createAnimation() { if (colorAnim == null) { colorAnim = ObjectAnimator.ofInt(this, "backgroundColor", colors); colorAnim.setEvaluator(new ArgbEvaluator()); colorAnim.setDuration(DURATION); colorAnim.addUpdateListener(this); } } @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { } @Override public void onAnimationCancel(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } @Override public void onAnimationUpdate(ValueAnimator animation) { invalidate(); // long playtime = colorAnim.getCurrentPlayTime(); } private class PageChangeListener implements ViewPager.OnPageChangeListener { private int viewPagerChildCount; public void setViewPagerChildCount(int viewPagerChildCount) { this.viewPagerChildCount = viewPagerChildCount; } public int getViewPagerChildCount() { return viewPagerChildCount; } @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { int count = getViewPagerChildCount() - 1; if (count != 0) { float length = (position + positionOffset) / count; int progress = (int) (length * DURATION); ColorAnimationView.this.seek(progress); } // call the method by default if (onPageChangeListener != null) { onPageChangeListener.onPageScrolled(position, positionOffset, positionOffsetPixels); } } @Override public void onPageSelected(int position) { if (onPageChangeListener != null) { onPageChangeListener.onPageSelected(position); } } @Override public void onPageScrollStateChanged(int state) { if (onPageChangeListener != null) { onPageChangeListener.onPageScrollStateChanged(state); } } } }
d2144af37ab7285e24964913368159237d6e8429
fdbe7ae2cf66afd34b275583441da8b7c437ae8f
/app/src/main/java/com/example/lijinfeng/eses/colorful/setter/ViewGroupSetter.java
1f5dfaffcf816a50bf4192cbfaf203eeba5bd726
[]
no_license
jinfengli/Eses
93ba178c90b4aa8ed6a36fe3cbf32a0fa725c9e3
cbe25ced7e13d79dcd4d632c7ee51341fdc5cb2e
refs/heads/master
2021-01-17T10:59:23.398263
2016-06-16T08:23:18
2016-06-16T08:23:18
41,034,793
0
0
null
null
null
null
UTF-8
Java
false
false
5,506
java
package com.example.lijinfeng.eses.colorful.setter; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; import android.content.res.Resources.Theme; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; /** * ViewGroup็ฑปๅž‹็š„Setter,็”จไบŽไฟฎๆ”นListViewใ€RecyclerView็ญ‰ViewGroup็ฑปๅž‹็š„Item * View,ๆ ธๅฟƒๆ€ๆƒณไธบ้ๅކๆฏไธชItem Viewไธญ็š„ๅญๆŽงไปถ,็„ถๅŽๆ นๆฎ็”จๆˆท็ป‘ๅฎš็š„view * idไธŽๅฑžๆ€งๆฅๅฐ†Viewไฟฎๆ”นไธบๅฝ“ๅ‰Themeไธ‹็š„ๆœ€ๆ–ฐๅฑžๆ€งๅ€ผ๏ผŒ่พพๅˆฐViewGroupๆŽงไปถ็š„ๆข่‚คๆ•ˆๆžœใ€‚ * * TODO : ColorไธŽDrawable็š„่ฎพ่ฎก้—ฎ้ข˜,ๆ˜ฏๅฆ้œ€่ฆไฟฎๆ”นไธบๆกฅๆŽฅๆจกๅผ {@see ViewBackgroundColorSetter}ใ€ * {@see ViewBackgroundDrawableSetter} * * @author mrsimple * */ public class ViewGroupSetter extends ViewSetter { /** * ListView็š„ๅญ่ฏ•ๅ›พ็š„Setter */ protected Set<ViewSetter> mItemViewSetters = new HashSet<ViewSetter>(); /** * * @param targetView * @param resId */ public ViewGroupSetter(ViewGroup targetView, int resId) { super(targetView, resId); } public ViewGroupSetter(ViewGroup targetView) { super(targetView, 0); } /** * ่ฎพ็ฝฎView็š„่ƒŒๆ™ฏ่‰ฒ * * @param viewId * @param colorId * @return */ public ViewGroupSetter childViewBgColor(int viewId, int colorId) { mItemViewSetters.add(new ViewBackgroundColorSetter(viewId, colorId)); return this; } /** * ่ฎพ็ฝฎView็š„drawable่ƒŒๆ™ฏ * * @param viewId * @param drawableId * @return */ public ViewGroupSetter childViewBgDrawable(int viewId, int drawableId) { mItemViewSetters.add(new ViewBackgroundDrawableSetter(viewId, drawableId)); return this; } /** * ่ฎพ็ฝฎๆ–‡ๆœฌ้ขœ่‰ฒ,ๅ› ๆญคView็š„็ฑปๅž‹ๅฟ…้กปไธบTextViewๆˆ–่€…ๅ…ถๅญ็ฑป * * @param viewId * @param colorId * @return */ public ViewGroupSetter childViewTextColor(int viewId, int colorId) { mItemViewSetters.add(new TextColorSetter(viewId, colorId)); return this; } @Override public void setValue(Theme newTheme, int themeId) { mView.setBackgroundColor(getColor(newTheme)); // ๆธ…็ฉบAbsListView็š„ๅ…ƒ็ด  clearListViewRecyclerBin(mView); // ๆธ…็ฉบRecyclerView clearRecyclerViewRecyclerBin(mView); // ไฟฎๆ”นๆ‰€ๆœ‰ๅญๅ…ƒ็ด ็š„็›ธๅ…ณๅฑžๆ€ง changeChildenAttrs((ViewGroup) mView, newTheme, themeId); } /** * * @param viewId * @return */ private View findViewById(View rootView, int viewId) { View targetView = rootView.findViewById(viewId); Log.d("", "### viewgroup find view : " + targetView); return targetView; } /** * ไฟฎๆ”นๅญ่ง†ๅ›พ็š„ๅฏนๅบ”ๅฑžๆ€ง * * @param viewGroup * @param newTheme * @param themeId */ private void changeChildenAttrs(ViewGroup viewGroup, Theme newTheme, int themeId) { int childCount = viewGroup.getChildCount(); for (int i = 0; i < childCount; i++) { View childView = viewGroup.getChildAt(i); // ๆทฑๅบฆ้ๅކ if (childView instanceof ViewGroup) { changeChildenAttrs((ViewGroup) childView, newTheme, themeId); } // ้ๅކๅญๅ…ƒ็ด ไธŽ่ฆไฟฎๆ”น็š„ๅฑžๆ€ง,ๅฆ‚ๆžœ็›ธๅŒ้‚ฃไนˆๅˆ™ไฟฎๆ”นๅญView็š„ๅฑžๆ€ง for (ViewSetter setter : mItemViewSetters) { // ๆฏๆฌก้ƒฝ่ฆไปŽViewGroupไธญๆŸฅๆ‰พๆ•ฐๆฎ setter.mView = findViewById(viewGroup, setter.mViewId); Log.e("", "### childView : " + childView + ", id = " + childView.getId()); Log.e("", "### setter view : " + setter.mView + ", id = " + setter.getViewId()); if (childView.getId() == setter.getViewId()) { setter.setValue(newTheme, themeId); Log.e("", "@@@ ไฟฎๆ”นๆ–ฐ็š„ๅฑžๆ€ง: " + childView); } } } } private void clearListViewRecyclerBin(View rootView) { if (rootView instanceof AbsListView) { try { Field localField = AbsListView.class .getDeclaredField("mRecycler"); localField.setAccessible(true); Method localMethod = Class.forName( "android.widget.AbsListView$RecycleBin") .getDeclaredMethod("clear", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(localField.get(rootView), new Object[0]); Log.e("", "### ๆธ…็ฉบAbsListView็š„RecycerBin "); } catch (NoSuchFieldException e1) { e1.printStackTrace(); } catch (ClassNotFoundException e2) { e2.printStackTrace(); } catch (NoSuchMethodException e3) { e3.printStackTrace(); } catch (IllegalAccessException e4) { e4.printStackTrace(); } catch (InvocationTargetException e5) { e5.printStackTrace(); } } } private void clearRecyclerViewRecyclerBin(View rootView) { if (rootView instanceof RecyclerView) { try { Field localField = RecyclerView.class .getDeclaredField("mRecycler"); localField.setAccessible(true); Method localMethod = Class.forName( "android.support.v7.widget.RecyclerView$Recycler") .getDeclaredMethod("clear", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(localField.get(rootView), new Object[0]); Log.e("", "### ๆธ…็ฉบRecyclerView็š„Recycer "); rootView.invalidate(); } catch (NoSuchFieldException e1) { e1.printStackTrace(); } catch (ClassNotFoundException e2) { e2.printStackTrace(); } catch (NoSuchMethodException e3) { e3.printStackTrace(); } catch (IllegalAccessException e4) { e4.printStackTrace(); } catch (InvocationTargetException e5) { e5.printStackTrace(); } } } }
87d6beae852955e2cb118833574126f8b8265e71
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_09dbec77dc3956d046812225aa4a3a22147c0f2b/RPCCopy/30_09dbec77dc3956d046812225aa4a3a22147c0f2b_RPCCopy_s.java
08b300197489c99b08679921ed9ae4d267399faa
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,236
java
/** * */ package com.google.gwt.user.server.rpc; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import com.google.gwt.user.client.rpc.SerializationException; /** * Encapsulation of both RPCCopy for GWT 1.4 and GWT 1.5 * (damned invokeAndEncodeResponse !!!!!) * * @author bruno.marchesson */ public class RPCCopy { //---- // Enumeration //---- /** * GWT Version */ enum Version { GWT14, GWT15 } //---- // Attributes //---- /** * The current GWT version */ protected Version _version; //---- // Singleton //---- /** * The unique instance of the singleton */ private static RPCCopy _instance = null; /** * @return the unique instance of the singleton */ public static RPCCopy getInstance() { if (_instance == null) { _instance = new RPCCopy(); } return _instance; } //------------------------------------------------------------------------- // // Constructor // //------------------------------------------------------------------------- /** * Private constructor of the singleton */ private RPCCopy() { _version = Version.GWT15; // GWT version detection, based on RPC method parsing // (findInterfaceMethod is present in GWT 1.4 and not 1.5) // try { Method[] methods = RPC.class.getDeclaredMethods(); for (int index = 0; index < methods.length; index++) { if ("findInterfaceMethod".equals(methods[index].getName())) { _version = Version.GWT14; break; } } } catch (SecurityException e) { e.printStackTrace(); } System.out.println(_version.toString()); } //------------------------------------------------------------------------- // // Encapsulated methods // //------------------------------------------------------------------------- /** * Decode request method */ public RPCRequest decodeRequest(String encodedRequest, Class type, SerializationPolicyProvider serializationPolicyProvider) { if (_version == Version.GWT14) { return RPCCopy_GWT14.decodeRequest(encodedRequest, type, serializationPolicyProvider); } else { return RPCCopy_GWT15.decodeRequest(encodedRequest, type, serializationPolicyProvider); } } /** * Invoke method * @throws InvocationTargetException * @throws SerializationException */ public Object invoke(Object target, Method serviceMethod, Object[] args, SerializationPolicy serializationPolicy) throws SerializationException, InvocationTargetException { if (_version == Version.GWT14) { return RPCCopy_GWT14.invoke(target, serviceMethod, args, serializationPolicy); } else { return RPCCopy_GWT15.invoke(target, serviceMethod, args, serializationPolicy); } } /** * Encode successful response method. * @throws SerializationException */ public String encodeResponseForSuccess(Method serviceMethod, Object object, SerializationPolicy serializationPolicy) throws SerializationException { if (_version == Version.GWT14) { return RPCCopy_GWT14.encodeResponseForSuccess(serviceMethod, object, serializationPolicy); } else { return RPCCopy_GWT15.encodeResponseForSuccess(serviceMethod, object, serializationPolicy); } } /** * Encode failure response method. * @throws SerializationException */ public String encodeResponseForFailure(Method serviceMethod, Throwable cause, SerializationPolicy serializationPolicy) throws SerializationException { if (_version == Version.GWT14) { return RPCCopy_GWT14.encodeResponseForFailure(serviceMethod, cause, serializationPolicy); } else { return RPCCopy_GWT15.encodeResponseForFailure(serviceMethod, cause, serializationPolicy); } } }
64f6157e4bf46baef1c27e4242a8d66ad2c1e0bf
d537bd2cd8ba4e38e85d917117a3e262eb82b1b8
/src/main/java/com/codrest/teriser/developers/EmailConverter.java
9b067b5818d2689db06332ac52c43c1594fb371a
[]
no_license
Kasania/teriser
e0f1cf32bb7a6c1a227d74dec1c8dfcf79fd03b9
e21fcb5ff0e95fb9bb532f2973a9d490d39815ec
refs/heads/master
2023-09-06T02:50:34.112634
2021-11-17T15:24:46
2021-11-17T15:24:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
/* * EmailConverter.java * Author : ๋ฐ•์ฐฌํ˜• * Created Date : 2021-08-01 */ package com.codrest.teriser.developers; import javax.persistence.AttributeConverter; import javax.persistence.Converter; @Converter public class EmailConverter implements AttributeConverter<Email, String> { @Override public String convertToDatabaseColumn(Email attribute) { if(attribute == null){ return null; } return attribute.getAddress(); } @Override public Email convertToEntityAttribute(String dbData) { if(dbData == null || dbData.isEmpty()){ return null; } return Email.of(dbData); } }
44749bd7334be8dbd059f64625a4e73244810f75
b2600ddbb41618bffe31529411a84166f16ce896
/record_web/src/main/java/com/idstaa/tm/config/MybatisConfig.java
a9354226bc7a2f0ef9dde71b2ba8380fb8ce647e
[]
no_license
xjdm/idstaa_tm_record
850d46eb7728618a3ff8faa3d6d431e8f356a45f
b17f30e592ffcebe14354c2b76db48c1abb6e441
refs/heads/master
2023-07-12T08:41:53.482140
2021-08-07T07:38:55
2021-08-07T07:38:55
351,279,958
0
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
package com.idstaa.tm.config; import com.alibaba.druid.pool.DruidDataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.sql.DataSource; /** * @author chenjie * @date 2021/3/24 23:07 */ @Configuration public class MybatisConfig { @Autowired private DataSourceProperties dataSourceProperties; @Bean(name = "dataSource") public DataSource dataSource() { DruidDataSource dataSource = new DruidDataSource(); dataSource.setUrl(dataSourceProperties.getUrl()); System.out.println(dataSourceProperties.getUrl()); dataSource.setDriverClassName(dataSourceProperties.getDriverClassName()); dataSource.setUsername(dataSourceProperties.getUsername()); dataSource.setPassword(dataSourceProperties.getPassword()); return dataSource; } }
90f3d3dbd4859637dcb3fb37bc4d7ed94eea35c5
a91d6a4ff140bfb77e0d1b903a0006bcd58fdc21
/news-spring/src/main/java/com/example/newsspring/controller/MainController.java
ca2ecbb2882a95f0e423f0d40d65cc6fabc21183
[ "Apache-2.0" ]
permissive
zhadan13/nix-java-course
fa64e2c21e6f51e214d48997df9ccf2a5b3427c3
a10bb207fc26e827aac8525cd36f07fc804b2f27
refs/heads/main
2023-04-26T05:50:57.862425
2021-05-24T12:49:45
2021-05-24T12:49:45
344,434,050
0
0
null
null
null
null
UTF-8
Java
false
false
520
java
package com.example.newsspring.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller public class MainController { @GetMapping("/") public String home(Model model) { model.addAttribute("title", "Main page"); return "home"; } @GetMapping("/about") public String about(Model model) { model.addAttribute("title", "About page"); return "about"; } }
2de186b54f4998bac9c484f2a108bb8da52e70fc
81ea7cbe4ef5aaca652c41c4e833b23d048112b1
/serverudpchat/UDPEcho.java
0098894fc3f39f3693dca64039217b572cfdb8a9
[]
no_license
Alessandro-Cuomo-Peano-5A/chatUDP
ffce38a2130382ea75823f11213e37da060f455a
9f722475f389e0f173a27566bfbcd16d3fcb7e88
refs/heads/master
2020-08-27T06:58:33.603776
2019-11-16T11:43:24
2019-11-16T11:43:24
217,277,223
0
0
null
2019-10-24T10:56:10
2019-10-24T10:56:10
null
UTF-8
Java
false
false
4,570
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 serverudpecho; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Cuomo Alessandro */ //utilizzo la classe Clients per memorizzare indirizzo e porta dei clients che si collegano al server //questo poi mi servira' per poter inviare i messaggi ricevuti da un client a tutti i client connessi class Clients { InetAddress addr; int port; public Clients(InetAddress addr, int port) { this.addr = addr; this.port = port; } } //modifico la classe UDPecho usata dal server echo per uso con la chat public class UDPEcho implements Runnable { private DatagramSocket socket; Clients client = new Clients(InetAddress.getByName("0.0.0.0"), 0); public UDPEcho(int port) throws SocketException, UnknownHostException { //avvio il socket per ricevere pacchetti inviati dai vari client socket = new DatagramSocket(port); } public void run() { ArrayList<String> diecimex = new ArrayList<String>(); DatagramPacket answer; //datagram usato per creare il pacchetto di risposta byte[] buffer = new byte[8192]; //buffer per contenere il messaggio ricevuto o da inviare // creo un un datagramma UDP usando il buffer come contenitore per i messaggi DatagramPacket request = new DatagramPacket(buffer, buffer.length); //uso hashmap per memorizzare i vari client connessi al server HashMap<String, Clients> clients = new HashMap<String, Clients>(); //creo un clientID formato da indirizzo e porta IP trasformati in stringa String clientID; //la stringa con il messaggio ricevuto String message; while (!Thread.interrupted()){ try { socket.receive(request); //mi metto in attesa di ricevere pacchetto da un clinet client.addr = request.getAddress(); //e memorizzo indirizzo client.port = request.getPort(); //e porta //genero quindi il clientID del client cha ha inviato il pacchetto appena ricevuto clientID = client.addr.getHostAddress() + client.port; System.out.println(clientID); //verifico se il client e' gia' conosciuto o se e' la prima volta che invia un pacchetto if(clients.get(clientID) == null) { //nel caso sia la prima volta lo inserisco nella lista clients.put(clientID, new Clients(client.addr, client.port)); for(int i=0; i<diecimex.size();i++) { answer = new DatagramPacket(diecimex.get(i).getBytes(), diecimex.get(i).getBytes().length, client.addr, client.port); socket.send(answer); } } System.out.println(clients); message = new String(request.getData(), 0, request.getLength(), "ISO-8859-1"); if(message == "quit") { //client si e' rimosso da chat, lo rimuovo da lista dei client connessi clients.remove(clientID); } if(diecimex.size()<10) diecimex.add(message); else { diecimex.remove(message); diecimex.add(message); } //invio il messaggio ricevuto a tutti i client connessi al server for(Clients clnt: clients.values()) { // costruisco il datagram di risposta usando il messaggio appena ricevuto e inviandolo a ogni client connesso answer = new DatagramPacket(request.getData(), request.getLength(), clnt.addr, clnt.port); socket.send(answer); } } catch (IOException ex) { Logger.getLogger(UDPEcho.class.getName()).log(Level.SEVERE, null, ex); } } } }
40ab2c1e469dd0d7362caa2b06c15a6ec7689192
f2f9a6faf83d766b8608c458a0405a56ba466a89
/FundTransfer/src/main/java/com/bank/web/controller/FundController.java
14826ca9c6db2916af9ccee9c78ccd8db1fd60e1
[]
no_license
Vasugi-P/ProjectsDownload
b46512ff267fec84d0a925d8a5673ec70f968ff1
2c648ad8dfd009da096acbad5eebf129298bebd9
refs/heads/main
2023-02-22T02:00:35.675338
2021-01-19T06:56:59
2021-01-19T06:56:59
330,887,337
0
0
null
null
null
null
UTF-8
Java
false
false
1,622
java
package com.bank.web.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.bank.dto.Deposit; import com.bank.exception.FundTransferLimitExceededException; import com.bank.exception.InsufficientAmountException; import com.bank.service.AccountService; import com.bank.dto.*; @RestController public class FundController { @Autowired private AccountService accountService; @PostMapping(value = "/bank/account/acc") public ResponseEntity<Void>withdraw(@RequestBody Deposit deposit ) throws InsufficientAmountException { accountService.withdraw(deposit.getAccountNumber(),deposit.getAmount()); return new ResponseEntity<Void>(HttpStatus.OK); } @PostMapping(value = "/bank/account") public ResponseEntity<Void>deposit(@RequestBody Deposit deposit ) { accountService.deposit(deposit.getAccountNumber(),deposit.getAmount()); return new ResponseEntity<Void>(HttpStatus.OK); } @PutMapping(value = "/bank/account") public ResponseEntity<Void>FundTransfer(@RequestBody FundTransfer req )throws FundTransferLimitExceededException { accountService.fundTransfer(req.getFromAccountNumber(),req.getToAccountNumber(),req.getAmount()); return new ResponseEntity<Void>(HttpStatus.OK); } }
d4d5d1b526997ca5479917bfeda048a3ef15d07c
2c3d9d126345b56694d3f4804b23e69626646d94
/app/src/main/java/com/p2pone0224/view/randomLayout/RandomLayout.java
e7850d888ca6a2291a767a1b1d4f954f20bffaa0
[]
no_license
tianxuewei1016/P2POne0224
afb4e668cd855980d941ae003c57237b237547d6
8fd84ba3f82187392e604215a19c28dc37aba617
refs/heads/master
2021-01-11T13:53:46.586835
2017-06-26T11:40:44
2017-06-26T11:40:44
94,878,234
0
0
null
null
null
null
UTF-8
Java
false
false
11,678
java
package com.p2pone0224.view.randomLayout; import android.content.Context; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Random; import java.util.Set; public class RandomLayout extends ViewGroup { private Random mRdm; /** * Xๅˆ†ๅธƒ่ง„ๅˆ™ๆ€ง๏ผŒ่ฏฅๅ€ผ่ถŠ้ซ˜๏ผŒๅญviewๅœจxๆ–นๅ‘็š„ๅˆ†ๅธƒ่ถŠ่ง„ๅˆ™ใ€ๅนณๅ‡ใ€‚ๆœ€ๅฐๅ€ผไธบ1ใ€‚ */ private int mXRegularity; /** * Yๅˆ†ๅธƒ่ง„ๅˆ™ๆ€ง๏ผŒ่ฏฅๅ€ผ่ถŠ้ซ˜๏ผŒๅญviewๅœจyๆ–นๅ‘็š„ๅˆ†ๅธƒ่ถŠ่ง„ๅˆ™ใ€ๅนณๅ‡ใ€‚ๆœ€ๅฐๅ€ผไธบ1ใ€‚ */ private int mYRegularity; /** * ๅŒบๅŸŸไธชๆ•ฐ */ private int mAreaCount; /** * ๅŒบๅŸŸ็š„ไบŒ็ปดๆ•ฐ็ป„ */ private int[][] mAreaDensity; /** * ๅญ˜ๆ”พๅทฒ็ป็กฎๅฎšไฝ็ฝฎ็š„View */ private Set<View> mFixedViews; /** * ๆไพ›ๅญView็š„adapter */ private Adapter mAdapter; /** * ่ฎฐๅฝ•่ขซๅ›žๆ”ถ็š„View๏ผŒไปฅไพฟ้‡ๅคๅˆฉ็”จ */ private List<View> mRecycledViews; /** * ๆ˜ฏๅฆๅทฒ็ปlayout */ private boolean mLayouted; /** * ่ฎก็ฎ—้‡ๅ ๆ—ถๅ€™็š„้—ด่ท */ private int mOverlapAdd = 2; /** * ๆž„้€ ๆ–นๆณ• */ public RandomLayout(Context context) { super(context); init(); } /** * ๅˆๅง‹ๅŒ–ๆ–นๆณ• */ private void init() { mLayouted = false; mRdm = new Random(); setRegularity(1, 1); mFixedViews = new HashSet<View>(); mRecycledViews = new LinkedList<View>(); } public boolean hasLayouted() { return mLayouted; } /** * ่ฎพ็ฝฎmXRegularityๅ’ŒmXRegularity๏ผŒ็กฎๅฎšๅŒบๅŸŸ็š„ไธชๆ•ฐ */ public void setRegularity(int xRegularity, int yRegularity) { if (xRegularity > 1) { this.mXRegularity = xRegularity; } else { this.mXRegularity = 1; } if (yRegularity > 1) { this.mYRegularity = yRegularity; } else { this.mYRegularity = 1; } this.mAreaCount = mXRegularity * mYRegularity;//ไธชๆ•ฐ็ญ‰ไบŽxๆ–นๅ‘็š„ไธชๆ•ฐ*yๆ–นๅ‘็š„ไธชๆ•ฐ this.mAreaDensity = new int[mYRegularity][mXRegularity];//ๅญ˜ๆ”พๅŒบๅŸŸ็š„ไบŒ็ปดๆ•ฐ็ป„ } /** * ่ฎพ็ฝฎๆ•ฐๆฎๆบ */ public void setAdapter(Adapter adapter) { this.mAdapter = adapter; } /** * ้‡ๆ–ฐ่ฎพ็ฝฎๅŒบๅŸŸ๏ผŒๆŠŠๆ‰€ๆœ‰็š„ๅŒบๅŸŸ่ฎฐๅฝ•้ƒฝๅฝ’0 */ private void resetAllAreas() { mFixedViews.clear(); for (int i = 0; i < mYRegularity; i++) { for (int j = 0; j < mXRegularity; j++) { mAreaDensity[i][j] = 0; } } } /** * ๆŠŠๅค็”จ็š„ViewๅŠ ๅ…ฅ้›†ๅˆ๏ผŒๆ–ฐๅŠ ๅ…ฅ็š„ๆ”พๅ…ฅ้›†ๅˆ็ฌฌไธ€ไธชใ€‚ */ private void pushRecycler(View scrapView) { if (null != scrapView) { mRecycledViews.add(0, scrapView); } } /** * ๅ–ๅ‡บๅค็”จ็š„View๏ผŒไปŽ้›†ๅˆ็š„็ฌฌไธ€ไธชไฝ็ฝฎๅ–ๅ‡บ */ private View popRecycler() { final int size = mRecycledViews.size(); if (size > 0) { return mRecycledViews.remove(0); } else { return null; } } /** * ไบง็”ŸๅญView๏ผŒ่ฟ™ไธชๅฐฑๆ˜ฏlistViewๅค็”จ็š„็ฎ€ๅŒ–็‰ˆ๏ผŒไฝ†ๆ˜ฏๅŽŸ็†ไธ€ๆ ท */ private void generateChildren() { if (null == mAdapter) { return; } // ๅ…ˆๆŠŠๅญViewๅ…จ้ƒจๅญ˜ๅ…ฅ้›†ๅˆ final int childCount = super.getChildCount(); for (int i = childCount - 1; i >= 0; i--) { pushRecycler(super.getChildAt(i)); } // ๅˆ ้™คๆ‰€ๆœ‰ๅญView super.removeAllViewsInLayout(); // ๅพ—ๅˆฐAdapterไธญ็š„ๆ•ฐๆฎ้‡ final int count = mAdapter.getCount(); for (int i = 0; i < count; i++) { //ไปŽ้›†ๅˆไธญๅ–ๅ‡บไน‹ๅ‰ๅญ˜ๅ…ฅ็š„ๅญView View convertView = popRecycler(); //ๆŠŠ่ฏฅๅญViewไฝœไธบadapter็š„getView็š„ๅކๅฒViewไผ ๅ…ฅ๏ผŒๅพ—ๅˆฐ่ฟ”ๅ›ž็š„View View newChild = mAdapter.getView(i, convertView); if (newChild != convertView) {//ๅฆ‚ๆžœๅ‘็”Ÿไบ†ๅค็”จ๏ผŒ้‚ฃไนˆnewChildๅบ”่ฏฅ็ญ‰ไบŽconvertView // ่ฟ™่ฏดๆ˜Žๆฒกๅ‘็”Ÿๅค็”จ๏ผŒๆ‰€ไปฅ้‡ๆ–ฐๆŠŠ่ฟ™ไธชๆฒก็”จๅˆฐ็š„ๅญViewๅญ˜ๅ…ฅ้›†ๅˆไธญ pushRecycler(convertView); } //่ฐƒ็”จ็ˆถ็ฑป็š„ๆ–นๆณ•ๆŠŠๅญViewๆทปๅŠ ่ฟ›ๆฅ super.addView(newChild, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); } } /** * ้‡ๆ–ฐๅˆ†้…ๅŒบๅŸŸ */ public void redistribute() { resetAllAreas();//้‡ๆ–ฐ่ฎพ็ฝฎๅŒบๅŸŸ requestLayout(); } /** * ้‡ๆ–ฐๆ›ดๆ–ฐๅญView */ public void refresh() { resetAllAreas();//้‡ๆ–ฐๅˆ†้…ๅŒบๅŸŸ generateChildren();//้‡ๆ–ฐไบง็”ŸๅญView requestLayout(); } /** * ้‡ๅ†™็ˆถ็ฑป็š„removeAllViews */ @Override public void removeAllViews() { super.removeAllViews();//ๅ…ˆๅˆ ้™คๆ‰€ๆœ‰View resetAllAreas();//้‡ๆ–ฐ่ฎพ็ฝฎๆ‰€ๆœ‰ๅŒบๅŸŸ } /** * ็กฎๅฎšๅญView็š„ไฝ็ฝฎ๏ผŒ่ฟ™ไธชๅฐฑๆ˜ฏๅŒบๅŸŸๅˆ†ๅธƒ็š„ๅ…ณ้”ฎ */ @Override public void onLayout(boolean changed, int l, int t, int r, int b) { final int count = getChildCount(); // ็กฎๅฎš่‡ช่บซ็š„ๅฎฝ้ซ˜ int thisW = r - l - this.getPaddingLeft() - this.getPaddingRight(); int thisH = b - t - this.getPaddingTop() - this.getPaddingBottom(); // ่‡ช่บซๅ†…ๅฎนๅŒบๅŸŸ็š„ๅณ่พนๅ’Œไธ‹่พน int contentRight = r - getPaddingRight(); int contentBottom = b - getPaddingBottom(); // ๆŒ‰็…ง้กบๅบๅญ˜ๆ”พๆŠŠๅŒบๅŸŸๅญ˜ๆ”พๅˆฐ้›†ๅˆไธญ List<Integer> availAreas = new ArrayList<Integer>(mAreaCount); for (int i = 0; i < mAreaCount; i++) { availAreas.add(i); } int areaCapacity = (count + 1) / mAreaCount + 1; //ๅŒบๅŸŸๅฏ†ๅบฆ๏ผŒ่กจ็คบไธ€ไธชๅŒบๅŸŸๅ†…ๅฏไปฅๆ”พๅ‡ ไธชView๏ผŒ+1่กจ็คบ่‡ณๅฐ‘่ฆๆ”พไธ€ไธช int availAreaCount = mAreaCount; //ๅฏ็”จ็š„ๅŒบๅŸŸไธชๆ•ฐ for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == View.GONE) { // goneๆމ็š„viewๆ˜ฏไธๅ‚ไธŽๅธƒๅฑ€ continue; } if (!mFixedViews.contains(child)) {//mFixedViews็”จไบŽๅญ˜ๆ”พๅทฒ็ป็กฎๅฎšๅฅฝไฝ็ฝฎ็š„View๏ผŒๅญ˜ๅˆฐไบ†ๅฐฑๆฒกๅฟ…่ฆๅ†ๆฌกๅญ˜ๆ”พ LayoutParams params = (LayoutParams) child.getLayoutParams(); // ๅ…ˆๆต‹้‡ๅญView็š„ๅคงๅฐ int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(this.getMeasuredWidth(), MeasureSpec.AT_MOST);//ไธบๅญViewๅ‡†ๅค‡ๆต‹้‡็š„ๅ‚ๆ•ฐ int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(this.getMeasuredHeight(), MeasureSpec.AT_MOST); child.measure(childWidthMeasureSpec, childHeightMeasureSpec); // ๅญViewๆต‹้‡ไน‹ๅŽ็š„ๅฎฝๅ’Œ้ซ˜ int childW = child.getMeasuredWidth(); int childH = child.getMeasuredHeight(); // ็”จ่‡ช่บซ็š„้ซ˜ๅบฆๅŽป้™คไปฅๅˆ†้…ๅ€ผ๏ผŒๅฏไปฅ็ฎ—ๅ‡บๆฏไธ€ไธชๅŒบๅŸŸ็š„ๅฎฝๅ’Œ้ซ˜ float colW = thisW / (float) mXRegularity; float rowH = thisH / (float) mYRegularity; while (availAreaCount > 0) { //ๅฆ‚ๆžœไฝฟ็”จๅŒบๅŸŸๅคงไบŽ0๏ผŒๅฐฑๅฏไปฅไธบๅญViewๅฐ่ฏ•ๅˆ†้… int arrayIdx = mRdm.nextInt(availAreaCount);//้šๆœบไธ€ไธชlistไธญ็š„ไฝ็ฝฎ int areaIdx = availAreas.get(arrayIdx);//ๅ†ๆ นๆฎlistไธญ็š„ไฝ็ฝฎ่Žทๅ–ไธ€ไธชๅŒบๅŸŸ็ผ–ๅท int col = areaIdx % mXRegularity;//่ฎก็ฎ—ๅ‡บๅœจไบŒ็ปดๆ•ฐ็ป„ไธญ็š„ไฝ็ฝฎ int row = areaIdx / mXRegularity; if (mAreaDensity[row][col] < areaCapacity) {// ๅŒบๅŸŸๅฏ†ๅบฆๆœช่ถ…่ฟ‡้™ๅฎš๏ผŒๅฐ†view็ฝฎๅ…ฅ่ฏฅๅŒบๅŸŸ int xOffset = (int) colW - childW; //ๅŒบๅŸŸๅฎฝๅบฆ ๅ’Œ ๅญView็š„ๅฎฝๅบฆๅทฎๅ€ผ๏ผŒๅทฎๅ€ผๅฏไปฅ็”จๆฅๅšๅŒบๅŸŸๅ†…็š„ไฝ็ฝฎ้šๆœบ if (xOffset <= 0) { xOffset = 1; } int yOffset = (int) rowH - childH; if (yOffset <= 0) { yOffset = 1; } // ็กฎๅฎšๅทฆ่พน๏ผŒ็ญ‰ไบŽๅŒบๅŸŸๅฎฝๅบฆ*ๅทฆ่พน็š„ๅŒบๅŸŸ params.mLeft = getPaddingLeft() + (int) (colW * col + mRdm.nextInt(xOffset)); int rightEdge = contentRight - childW; if (params.mLeft > rightEdge) {//ๅŠ ไธŠๅญView็š„ๅฎฝๅบฆๅŽไธ่ƒฝ่ถ…ๅ‡บๅณ่พน็•Œ params.mLeft = rightEdge; } params.mRight = params.mLeft + childW; params.mTop = getPaddingTop() + (int) (rowH * row + mRdm.nextInt(yOffset)); int bottomEdge = contentBottom - childH; if (params.mTop > bottomEdge) {//ๅŠ ไธŠๅญView็š„ๅฎฝๅบฆๅŽไธ่ƒฝ่ถ…ๅ‡บๅณ่พน็•Œ params.mTop = bottomEdge; } params.mBottom = params.mTop + childH; if (!isOverlap(params)) {//ๅˆคๆ–ญๆ˜ฏๅฆๅ’Œๅˆซ็š„View้‡ๅ ไบ† mAreaDensity[row][col]++;//ๆฒกๆœ‰้‡ๅ ๏ผŒๆŠŠ่ฏฅๅŒบๅŸŸ็š„ๅฏ†ๅบฆๅŠ 1 child.layout(params.mLeft, params.mTop, params.mRight, params.mBottom);//ๅธƒๅฑ€ๅญView mFixedViews.add(child);//ๆทปๅŠ ๅˆฐๅทฒ็ปๅธƒๅฑ€็š„้›†ๅˆไธญ break; } else {//ๅฆ‚ๆžœ้‡ๅ ไบ†๏ผŒๆŠŠ่ฏฅๅŒบๅŸŸ็งป้™ค๏ผŒ availAreas.remove(arrayIdx); availAreaCount--; } } else {// ๅŒบๅŸŸๅฏ†ๅบฆ่ถ…่ฟ‡้™ๅฎš๏ผŒๅฐ†่ฏฅๅŒบๅŸŸไปŽๅฏ้€‰ๅŒบๅŸŸไธญ็งป้™ค availAreas.remove(arrayIdx); availAreaCount--; } } } } mLayouted = true; } /** * ่ฎก็ฎ—ไธคไธชViewๆ˜ฏๅฆ้‡ๅ ๏ผŒๅฆ‚ๆžœ้‡ๅ ๏ผŒ้‚ฃไนˆไป–ไปฌไน‹้—ดไธ€ๅฎšๆœ‰ไธ€ไธช็ŸฉๅฝขๅŒบๅŸŸๆ˜ฏๅ…ฑๆœ‰็š„ */ private boolean isOverlap(LayoutParams params) { int l = params.mLeft - mOverlapAdd; int t = params.mTop - mOverlapAdd; int r = params.mRight + mOverlapAdd; int b = params.mBottom + mOverlapAdd; Rect rect = new Rect(); for (View v : mFixedViews) { int vl = v.getLeft() - mOverlapAdd; int vt = v.getTop() - mOverlapAdd; int vr = v.getRight() + mOverlapAdd; int vb = v.getBottom() + mOverlapAdd; rect.left = Math.max(l, vl); rect.top = Math.max(t, vt); rect.right = Math.min(r, vr); rect.bottom = Math.min(b, vb); if (rect.right >= rect.left && rect.bottom >= rect.top) { return true; } } return false; } /** * ๅ†…้ƒจ็ฑปใ€ๆŽฅๅฃ */ public static interface Adapter { public abstract int getCount(); public abstract View getView(int position, View convertView); } public static class LayoutParams extends ViewGroup.LayoutParams { private int mLeft; private int mRight; private int mTop; private int mBottom; public LayoutParams(ViewGroup.LayoutParams source) { super(source); } public LayoutParams(int w, int h) { super(w, h); } } }
95cc8f641de8497cd4ab90dc3576b91a3232869d
fff45c6172a07813aa77b62aeedbf677a2970d60
/org.opentosca.iaengine.service.impl/src/org/opentosca/iaengine/service/impl/IAEngineCapabilityChecker.java
902ead8d605ebf24f566fb59a84144e61a36c37b
[ "Apache-2.0" ]
permissive
jojow/opentosca-container
e749e5428801f31690ad8876be21abb41e2c6b92
fddb5668c7be4b6b6985f2a110897a0d151b4d39
refs/heads/master
2021-01-21T07:45:00.836643
2015-08-21T11:38:45
2015-08-21T11:40:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,768
java
package org.opentosca.iaengine.service.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.opentosca.core.capability.service.ICoreCapabilityService; import org.opentosca.core.model.capability.provider.ProviderType; import org.opentosca.iaengine.plugins.service.IIAEnginePluginService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * Copyright 2012 IAAS University of Stuttgart <br> * <br> * <p> * Analyzes a given list of Implementation Artifacts if they are deployable, * meaning checking if the Required Capabilities of the Implemenation Artifacts * are met by the container and/or available plug-ins. * </p> * <p> * There are two main private methods that check if any capabilites are met by * the container and respectively by any bound plug-in. The supplied list of all * Implementation Artifacts is modified accordingly. Meaning that any * Implementation Artifact that is not deployable, is removed from this list and * is added to the list of failed Implementation Artifacts. * </p> * * * @author Michael Zimmermann - [email protected] * @author Nedim Karaoguz - [email protected] * * @TODO: Comments! * */ public class IAEngineCapabilityChecker { private final static Logger LOG = LoggerFactory.getLogger(IAEngineCapabilityChecker.class); /** * * Removes Container and PlanCapabilities from the requiredCapabilities * List. * * @param capabilityService * @param requiredCapabilities * @return left Capabilities. */ public static List<String> removeConAndPlanCaps(ICoreCapabilityService capabilityService, List<String> requiredCapabilities) { if (!requiredCapabilities.isEmpty()) { List<String> conAndPlanCaps = IAEngineCapabilityChecker.getConAndPlanCaps(capabilityService); for (Iterator<String> itReqCaps = requiredCapabilities.iterator(); itReqCaps.hasNext();) { String reqCap = itReqCaps.next(); if (conAndPlanCaps.contains(reqCap)) { itReqCaps.remove(); } } } return requiredCapabilities; } /** * Checks if RequiredCapabilities are met by chosen plugin. * * @param requiredCapabilities * @param plugin * @return if all RequiredCapabilities are met. */ public static boolean capabilitiesAreMet(List<String> requiredCapabilities, IIAEnginePluginService plugin) { if (!requiredCapabilities.isEmpty()) { List<String> requiredCaps = requiredCapabilities; List<String> providedCaps = plugin.getCapabilties(); for (Iterator<String> itrequiredCaps = requiredCaps.iterator(); itrequiredCaps.hasNext();) { String reqCap = itrequiredCaps.next(); if (providedCaps.contains(reqCap)) { itrequiredCaps.remove(); } } return requiredCaps.isEmpty(); } return true; } /** * Gets Container and PlanCapabilities from the CoreCapabilitiyService. * * @param capabilityService * @return Container and PlanCapabilities in one merged list. */ private static List<String> getConAndPlanCaps(ICoreCapabilityService capabilityService) { List<String> conAndPlanCaps = new ArrayList<String>(); IAEngineCapabilityChecker.LOG.debug("Trying to get ContainerCapabilities and PlanCapabilities from CoreCapabilityService."); List<String> containerCaps = capabilityService.getCapabilities(ProviderType.CONTAINER.toString(), ProviderType.CONTAINER); Map<String, List<String>> planPluginsCaps = capabilityService.getCapabilities(ProviderType.PLAN_PLUGIN); conAndPlanCaps.addAll(containerCaps); for (String planPlugin : planPluginsCaps.keySet()) { conAndPlanCaps.addAll(planPluginsCaps.get(planPlugin)); } return conAndPlanCaps; } }
e2cd2239929f13bc46c2cb2f35b4df5f723a9b6d
5d3f5f46c7ddc0ddecb35a64e6fd7bcc17a5ec0c
/LR1/src/GeneralClasses/IntegerArray.java
79ff80d56dd5373e9bc180c4b4c05112a966c3a6
[]
no_license
ArtyomSysaS/NURE-Java-SE-laboratoty-works-2018
1d1cc9279d3e250c40a1a6634853d7f1f65af26c
76c87d527317ea8578a80ae06ba7d1cb184ad6c8
refs/heads/master
2020-04-09T03:12:26.550772
2018-12-01T18:17:45
2018-12-01T18:17:45
159,973,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,163
java
/* ----------------------------- | By Artyom Sysa | | | | 07.10.2018 | ----------------------------- */ package GeneralClasses; import java.util.Arrays; import java.util.Random; public class IntegerArray { protected int[] array; public IntegerArray(int size) { this.array = new int[size]; fill(0); } public IntegerArray(int size, int fillValue) { this.array = new int[size]; fill(fillValue); } public IntegerArray(int size, int minValue, int maxValue) { this.array = new int[size]; fill(minValue, maxValue); } private void fill(int fillValue) { Arrays.fill(this.array, fillValue); } private void fill(int minValue, int maxValue) { Random random = new Random(); for (int i = 0; i < this.array.length; i++) { this.array[i] = random.ints(minValue, maxValue + 1).limit(1).findFirst().getAsInt(); } } @Override public String toString() { return Arrays.toString(this.array); } }
7a550fc884efafb97d541f13edf80ffe433eaf1e
2437c9eadfae6449b3b5dba2890ad891d4a154d8
/My_LMS/src/main/java/com/yildirimbayrakci/enums_and_constants/BookStatus.java
af4b76820c069f3665cb689ce3a92437fe1b2b7d
[ "MIT" ]
permissive
yildirim2189/Library_Management_System-Java_Swing
3f4f546f411fc849c52df5bde56dea798fe1b62a
28e8da2cb4034c68b2f6e80924e8d7e39d8aa0e8
refs/heads/master
2022-07-07T12:48:48.152216
2019-12-15T17:14:22
2019-12-15T17:14:22
228,094,459
1
0
MIT
2022-02-10T00:27:53
2019-12-14T21:57:37
Java
UTF-8
Java
false
false
596
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.yildirimbayrakci.enums_and_constants; /** * * @author YILDIRIM */ public enum BookStatus { MEVCUT("MEVCUT"), REZERVE("REZERVE"), ODUNC_ALINMIS("ร–DรœNร‡ ALINMIลž"), KAYIP("KAYIP"); private final String displayName; private BookStatus(String displayName) { this.displayName = displayName; } public String displayName(){ return displayName; } }
4d4e243a70adb2580e8e947414069207ca5010c4
a217123228e3015da161eebb1848bd39081e7095
/marathon-javafx/marathon-javafx-recorder/src/main/java/net/sourceforge/marathon/javafxrecorder/component/RFXSpinner.java
d9734615d9352c19ea7e2a9f99adc65986130b9c
[ "Apache-2.0" ]
permissive
matamehta/marathonv5
7455c90817e7b9bcb07e9fc88ceddbe5890b35e6
abb640eb2a447a45560351f4c77113a052064688
refs/heads/master
2021-01-25T14:49:33.496503
2018-02-12T07:06:56
2018-02-12T07:06:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,903
java
/******************************************************************************* * Copyright 2016 Jalian Systems Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package net.sourceforge.marathon.javafxrecorder.component; import java.util.logging.Logger; import javafx.geometry.Point2D; import javafx.scene.Node; import javafx.scene.control.Spinner; import net.sourceforge.marathon.javafxrecorder.IJSONRecorder; import net.sourceforge.marathon.javafxrecorder.JSONOMapConfig; public class RFXSpinner extends RFXComponent { public static final Logger LOGGER = Logger.getLogger(RFXSpinner.class.getName()); private String oldValue; public RFXSpinner(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder) { super(source, omapConfig, point, recorder); } @Override public void focusGained(RFXComponent prev) { oldValue = getSpinnerText((Spinner<?>) node); } @Override public void focusLost(RFXComponent next) { Spinner<?> spinner = (Spinner<?>) node; String currentValue = getSpinnerText(spinner); if (!currentValue.equals(oldValue)) { recorder.recordSelect(this, currentValue); } } @Override public String _getText() { return getSpinnerText((Spinner<?>) node); } }
8bb13d3b32f581eb8751c1d91dacb8e50638db7d
18e0a6e1a20701006c2f3cdc7b3856240d2294ca
/src/main/java/ch/heigvd/amt/stack/application/identitymgmt/profile/UpdateUserCommand.java
47d764f6dd79262f185f0e32ffab5236ef242eed
[]
no_license
AMT-Project/project_1
d58b796e6d22f36b4e6c0e6fffb3155ab18689e0
81dc7a3864293d861d3f22242d768bc18bb308f5
refs/heads/master
2023-02-22T03:37:31.938700
2021-01-24T20:30:22
2021-01-24T20:30:22
296,572,239
0
1
null
2021-01-24T13:44:23
2020-09-18T09:12:58
Java
UTF-8
Java
false
false
517
java
package ch.heigvd.amt.stack.application.identitymgmt.profile; import ch.heigvd.amt.stack.domain.person.PersonId; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @Builder @Getter @EqualsAndHashCode public class UpdateUserCommand { private PersonId uuid; private String username; private String newEmail; private String oldEmail; private String newFirstname; private String newLastname; private String oldPasswordClear; private String newPasswordClear; }
089736fa93f78d9059d57590d764fb4d0469d210
44601bc35afd6dd15111c68233c5906ad7b1a277
/zuul-service/src/main/java/com/stackroute/zuulservice/filter/PreFilter.java
1693974a87299f6981792fc429e290cf3b9e9c80
[]
no_license
marydan/Micro-services-sample
9d61cd93b0f8e97ca48e399e159cea8248efe183
77c4d2796f30e9bda16caed4a4e83da5128189cf
refs/heads/master
2022-11-19T22:23:58.768330
2020-07-17T11:39:34
2020-07-17T11:39:34
280,406,968
0
0
null
null
null
null
UTF-8
Java
false
false
927
java
package com.stackroute.zuulservice.filter; import javax.servlet.http.HttpServletRequest; import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants; import com.netflix.zuul.ZuulFilter; import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.exception.ZuulException; public class PreFilter extends ZuulFilter { @Override public boolean shouldFilter() { return true; } @Override public Object run() throws ZuulException { HttpServletRequest httpRequest = RequestContext.getCurrentContext().getRequest(); System.out.println("Request Method:" + httpRequest.getMethod()); System.out.println("Requested URL :" + httpRequest.getRequestURL().toString()); return null; } @Override public String filterType() { // TODO Auto-generated method stub return "pre-filter"; } @Override public int filterOrder() { return FilterConstants.PRE_DECORATION_FILTER_ORDER; } }
88c655e11db2f96a699aaeb9ec7c92aa92849ed0
9b48690625a20010c1a7bad32ea3663551538f01
/src/main/java/com/socket/test/c/ServerHandler.java
107e5d7ff73be9c5bc92ac52e77f084b7efb2d5c
[]
no_license
kamilbemowski/sockets
078bedc6ba9307cee6808e244ea08906890397a9
4e0ca7d8569e94e51df8aeb08fae8343a9d73c0e
refs/heads/master
2021-01-02T08:32:45.233310
2015-06-09T22:05:03
2015-06-09T22:05:03
37,155,989
0
0
null
null
null
null
UTF-8
Java
false
false
824
java
package com.socket.test.c; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.ReferenceCountUtil; /** * Created by kamil on 09.06.15. */ public class ServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { ByteBuf in = (ByteBuf) msg; try { while (in.isReadable()) { System.out.print((char) in.readByte()); System.out.flush(); } } finally { ReferenceCountUtil.release(msg); } } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } }
6b7bb35ef63a44921072bedb082c1c3e2072c497
38b44685d5bb46c3d0fb0754ae37cdfdde36108e
/src/ca/mcgill/ecse211/project/WifiSetup.java
8705aec1f16fecf74e8c9d2fda066d018c04cf8c
[]
no_license
Tempeus/Design-Principles-and-Methods-Design_Project
0dd5f829a377b1cfb57c6c9e0eb893078ece2d08
13eb15a45d02d8e13c8972001a0af85a96e1d109
refs/heads/master
2022-04-23T14:56:47.091331
2020-04-06T19:33:54
2020-04-06T19:33:54
246,872,201
0
0
null
null
null
null
UTF-8
Java
false
false
246
java
package ca.mcgill.ecse211.project; /** * This class is responsible in obtaining inputs from wifi network * @author Kevin * */ public class WifiSetup { /** * This method is used to get inputs */ public void getInput() { } }
42b44046cbc3faabc8fea9b32bb359b4f6e417a1
e5e048f1716e5d8e92023b6a9d4f80d9e6bd366b
/src/main/java/com/opengamma/analytics/math/minimization/ParameterLimitsTransformTestCase.java
7568eae6026553e0bf30c93070ea521849222301
[ "Apache-2.0" ]
permissive
jerome79/Analytics
e4dd03ae9d95a67f7ff36fb75bd5e268b87f2547
71ab1c7a88ed851c50a8de87af000155666f4894
refs/heads/master
2020-04-09T17:24:30.623733
2015-08-17T10:01:27
2015-08-17T10:01:27
42,441,934
1
0
null
2015-09-14T10:19:57
2015-09-14T10:19:56
null
UTF-8
Java
false
false
2,966
java
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.math.minimization; import static org.testng.AssertJUnit.assertEquals; import cern.jet.random.engine.MersenneTwister; import cern.jet.random.engine.MersenneTwister64; import cern.jet.random.engine.RandomEngine; import org.testng.annotations.Test; import com.opengamma.analytics.math.statistics.distribution.NormalDistribution; import com.opengamma.analytics.math.statistics.distribution.ProbabilityDistribution; /** * Abstract test. */ @Test public abstract class ParameterLimitsTransformTestCase { protected static final RandomEngine RANDOM = new MersenneTwister64(MersenneTwister.DEFAULT_SEED); protected static final ProbabilityDistribution<Double> NORMAL = new NormalDistribution(0, 1, RANDOM); protected void assertRoundTrip(final ParameterLimitsTransform transform, final double modelParam) { final double fp = transform.transform(modelParam); final double mp = transform.inverseTransform(fp); assertEquals(modelParam, mp, 1e-8); } // reverse protected void assertReverseRoundTrip(final ParameterLimitsTransform transform, final double fitParam) { final double mp = transform.inverseTransform(fitParam); final double fp = transform.transform(mp); assertEquals(fitParam, fp, 1e-8); } protected void assertGradientRoundTrip(final ParameterLimitsTransform transform, final double modelParam) { final double g = transform.transformGradient(modelParam); final double fp = transform.transform(modelParam); final double gInv = transform.inverseTransformGradient(fp); assertEquals(g, 1.0 / gInv, 1e-8); } protected void assertGradient(final ParameterLimitsTransform transform, final double modelParam) { final double eps = 1e-5; final double g = transform.transformGradient(modelParam); double fdg; try { final double down = transform.transform(modelParam - eps); final double up = transform.transform(modelParam + eps); fdg = (up - down) / 2 / eps; } catch (final IllegalArgumentException e) { final double fp = transform.transform(modelParam); try { final double up = transform.transform(modelParam + eps); fdg = (up - fp) / eps; } catch (final IllegalArgumentException e2) { final double down = transform.transform(modelParam - eps); fdg = (fp - down) / eps; } } assertEquals(g, fdg, 1e-6); } protected void assertInverseGradient(final ParameterLimitsTransform transform, final double fitParam) { final double eps = 1e-5; final double g = transform.inverseTransformGradient(fitParam); double fdg; final double down = transform.inverseTransform(fitParam - eps); final double up = transform.inverseTransform(fitParam + eps); fdg = (up - down) / 2 / eps; assertEquals(g, fdg, 1e-6); } }
c4f16b7e769d36262a99256816d241359713dc0b
c7712048b8883c2a81ea9f2b1f512cf1c77760fa
/src/main/java/com/ework/upms/server/i18n/I18nTest.java
52f60196e13a618c3451ceda68e1496587a7c359
[]
no_license
shangjianan2/NormalTechnology
958af966bb3e94bc910dd64b0a6baeb994c5075b
bddf57b3184dc74e737162f12e25c895bcf970c6
refs/heads/main
2023-01-21T16:07:51.801266
2020-11-29T02:19:05
2020-11-29T02:19:05
312,932,430
0
1
null
null
null
null
UTF-8
Java
false
false
828
java
package com.ework.upms.server.i18n; import org.springframework.context.support.ReloadableResourceBundleMessageSource; import java.util.Locale; public class I18nTest { private ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource; // public ReloadableResourceBundleMessageSource getReloadableResourceBundleMessageSource() { // return reloadableResourceBundleMessageSource; // } public void setReloadableResourceBundleMessageSource(ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource) { this.reloadableResourceBundleMessageSource = reloadableResourceBundleMessageSource; } public String getMessage(String code, Object[] args, Locale locale) { return this.reloadableResourceBundleMessageSource.getMessage(code, args, locale); } }
1f51bdbb45cc9ff1762839c37d954913597ba487
ddcfc13a77114a6dc8f2040888acb94cd9f5578a
/Server/zal/src/main/java/com/example/zal/config/RestAuthEntryPoint.java
8815f703aeda3182844864ba02bd117740edbadf
[]
no_license
boguszpawlowski/zpo2
7be45cae8adbab3d1f553cca0e13cd62de22b13f
94c0e95574c57fd9eabc810c34ef65581c64d412
refs/heads/master
2020-04-10T07:18:43.951158
2018-12-07T21:36:04
2018-12-07T21:36:04
160,877,499
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package com.example.zal.config; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.stereotype.Component; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Component public final class RestAuthEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized user"); } }
20f8f5a9d5e627ebb2b02ae787c2540fd6580b02
27bc10cb4a0257391bf11ab7051b7865e3a4a1cd
/ccsf/cs111a_sp18/homeworks/muni/lopez.java
3f4e2e0614df0f4bfd1f57f33b3d927d011e3a38
[]
no_license
radishpower/CCSF
0e62ff6c0a803dd91a50cfdbd652eb59f98830f6
79459c34d0063b3062ad3813544f1e25d203c16c
refs/heads/master
2021-01-20T10:01:00.567468
2018-02-20T04:53:51
2018-02-20T04:53:51
90,315,049
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
import java.util.Scanner;class Main{ public static void main(String args[]) { String muni; int riders, days; double avg; Scanner consoleIn = new Scanner (System.in); System.out.println("Welcome to the Muni Ridership Calculator."); System.out.print("Which Muni line did you survey?"); muni = consoleIn.nextLine(); System.out.print("How many days did you survey ridership? "); days = consoleIn.nextInt(); System.out.print("How many riders did you count? "); riders = consoleIn.nextInt(); avg = riders/(double)days; System.out.printf("According to your survey, an average of %,.2f",avg); System.out.printf( " people rode the %s per day.", muni); }}
f5b087c2691de27755f48a330732dd4f37db2105
35b912f5eb963ab386c78628e506b596248d828d
/hello-spring-mvc/src/main/java/com/fengquanwei/hello/spring/mvc/config/MyRootConfig.java
b200fa1a68619a3354b7b10f8182b38c6d1d6c49
[]
no_license
fengquanwei/hello
4ab71e847fe3d6a17ef58c4475bd9d81253ca389
0f7bee60d76632e87c3af762854f9403e958afb4
refs/heads/master
2021-07-10T21:18:35.953138
2018-10-07T10:04:46
2018-10-07T10:04:46
133,108,066
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package com.fengquanwei.hello.spring.mvc.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.web.servlet.config.annotation.EnableWebMvc; /** * Spring ๅบ”็”จไธŠไธ‹ๆ–‡ * * @author fengquanwei * @create 2018/6/4 11:52 **/ @Configuration @ComponentScan(basePackages = {"com.fengquanwei.hello.spring.mvc"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = EnableWebMvc.class)}) public class MyRootConfig { }
c86a274f68e5b00764e182fdbb3bc8f3658ed621
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/13/13_e44fa3c3a5f3917f088cf28b29b7c4978bb2ef74/TcpPinger/13_e44fa3c3a5f3917f088cf28b29b7c4978bb2ef74_TcpPinger_s.java
44d132f2dd00ab7cd5d61e3b0c44922bc58c32dd
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,183
java
import java.net.*; import java.text.*; /** This class does TCP-based pinging of a remote destination using a specific port @author Steven Pigeon <[email protected]> */ public class TcpPinger implements Pinger { /** Holds the last collected times */ private String m_tcp_times; /** A reference to ClientInfo */ private ClientInfo m_info; /** Returns the last collected times as a String. <p>The output is structured as follows <p>protocol addr:port nb_sent nb_received timeout [times]+ <p>for example: <p><tt>TCP 132.204.24.179:50 10 0 1000 !6.713ms !4.896ms !3.770ms !4.588ms !8.609ms * !21.504ms !3.359ms !8.367ms !3.439ms</tt> @return The last collected times */ public String getLastPings() { return m_tcp_times; } public void clearPings() { m_tcp_times = ""; } /** Pings an external IP address using the default port (80). */ public int ping(InetAddress addr) throws InterruptedException { return ping(addr, 80); } /** Pings an external IP address using a specific port. A string containing the summary and times gathered is constructed, and accessible through TCP_Ping.getLastPings() after having called ping(). If an error occured, getLastPings() is undefined (may contain previous call's values). <p>The output is structured as follows <p>protocol addr:port nb_sent nb_received timeout [times]+ <p>and times may be prefixed by ! if the connection is refused or fails rapidly, * (without time, just * alone) if it timed out, and prefixed by ? if some other error occured @see TcpPinger#getLastPings() @see TcpPinger#clearPings() @param addr The address to ping @param port The port to ping @return 0 (for compatibility with other pinger-classes that return the exit code) */ public int ping(InetAddress addr, int port) throws InterruptedException { DecimalFormat format = new DecimalFormat("0.000"); InetSocketAddress sock_addr = new InetSocketAddress(addr,port); String times = ""; int fails = 0; for (int p = 0; p < m_info.getNumberOfPings(); p++) { Socket ping_socket = new Socket(); String prefix = " "; if (p != 0) { // Sleep half a second Thread.sleep(500); } boolean timed_out = false; long start = System.nanoTime(); try { ping_socket.connect(sock_addr, m_info.getTCPTimeOut()); } catch (ConnectException e) { fails++; prefix = " !"; } catch (SocketTimeoutException e) { fails++; prefix = " *"; timed_out = true; } catch (Exception e) { fails++; prefix = " ?"; } long stop = System.nanoTime(); // if the connection was refused/quick error'd : it has ! as a prefix // if the connection timed out, it is shown as * (without time) // if some other error occured, it is prefixed with ? // times += prefix + (timed_out ? "" : format.format((stop-start) / 1.0e6f) + "ms" ); } // The string returned is structured as follows: // protocol addr:port sent received timeoutvalue [ times ]+ // m_tcp_times = "TCP " + addr.toString().split("/")[1] + ":" + port + " " + m_info.getNumberOfPings() + " " + (m_info.getNumberOfPings()-fails) + " " + m_info.getTCPTimeOut() + times; return 0; } /** Creates a TcpPinger (linked to a ClientInfo configuration) @param this_info A reference to a ClientInfo @see ClientInfo */ public TcpPinger(ClientInfo this_info) { m_tcp_times = ""; m_info = this_info; } }
3d54f39bd45acd617c6cb17c1904e0b57bb3142b
d315b1b172113c22924f986324f33ad4f8961d04
/nachos/machine/Lib.java
da55e9d1888eb6afffd11b1cf9b7625dbbf3fe62
[ "MIT-Modern-Variant" ]
permissive
ideaPeng/MyNachos
691768bd3924181791815d03389339b5581d5219
fd4afc33a0bc05be4a41a7dc98aa7cb80c8e3e83
refs/heads/master
2016-08-10T22:01:52.955186
2015-11-19T02:51:14
2015-11-19T02:51:14
46,061,624
0
0
null
null
null
null
UTF-8
Java
false
false
19,516
java
// PART OF THE MACHINE SIMULATION. DO NOT CHANGE. package nachos.machine; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.PrivilegedAction; import java.util.Random; /** * Thrown when an assertion fails. */ class AssertionFailureError extends Error { AssertionFailureError() { super(); } AssertionFailureError(String message) { super(message); } } /** * Provides miscellaneous library routines. */ public final class Lib { /** * Prevent instantiation. */ private Lib() { } private static Random random = null; /** * Seed the random number generater. May only be called once. * * @param randomSeed * the seed for the random number generator. */ public static void seedRandom(long randomSeed) { assertTrue(random == null); random = new Random(randomSeed); } /** * Return a random integer between 0 and <i>range - 1</i>. Must not be * called before <tt>seedRandom()</tt> seeds the random number generator. * * @param range * a positive value specifying the number of possible return * values. * @return a random integer in the specified range. */ public static int random(int range) { assertTrue(range > 0); return random.nextInt(range); } /** * Return a random double between 0.0 (inclusive) and 1.0 (exclusive). * * @return a random double between 0.0 and 1.0. */ public static double random() { return random.nextDouble(); } /** * Asserts that <i>expression</i> is <tt>true</tt>. If not, then Nachos * exits with an error message. * * @param expression * the expression to assert. */ public static void assertTrue(boolean expression) { if (!expression) throw new AssertionFailureError(); } /** * Asserts that <i>expression</i> is <tt>true</tt>. If not, then Nachos * exits with the specified error message. * * @param expression * the expression to assert. * @param message * the error message. */ public static void assertTrue(boolean expression, String message) { if (!expression) throw new AssertionFailureError(message); } /** * Asserts that this call is never made. Same as <tt>assertTrue(false)</tt>. */ public static void assertNotReached() { assertTrue(false); } /** * Asserts that this call is never made, with the specified error messsage. * Same as <tt>assertTrue(false, message)</tt>. * * @param message * the error message. */ public static void assertNotReached(String message) { assertTrue(false, message); } /** * Print <i>message</i> if <i>flag</i> was enabled on the command line. To * specify which flags to enable, use the -d command line option. For * example, to enable flags a, c, and e, do the following: * * <p> * * <pre> * nachos -d ace * </pre> * * <p> * Nachos uses several debugging flags already, but you are encouraged to * add your own. * * @param flag * the debug flag that must be set to print this message. * @param message * the debug message. */ public static void debug(char flag, String message) { if (test(flag)) System.out.println(message); } /** * Tests if <i>flag</i> was enabled on the command line. * * @param flag * the debug flag to test. * * @return <tt>true</tt> if this flag was enabled on the command line. */ public static boolean test(char flag) { if (debugFlags == null) return false; else if (debugFlags[(int) '+']) return true; else if (flag >= 0 && flag < 0x80 && debugFlags[(int) flag]) return true; else return false; } /** * Enable all the debug flags in <i>flagsString</i>. * * @param flagsString * the flags to enable. */ public static void enableDebugFlags(String flagsString) { if (debugFlags == null) debugFlags = new boolean[0x80]; char[] newFlags = flagsString.toCharArray(); for (int i = 0; i < newFlags.length; i++) { char c = newFlags[i]; if (c >= 0 && c < 0x80) debugFlags[(int) c] = true; } } /** Debug flags specified on the command line. */ private static boolean debugFlags[]; /** * Read a file, verifying that the requested number of bytes is read, and * verifying that the read operation took a non-zero amount of time. * * @param file * the file to read. * @param position * the file offset at which to start reading. * @param buf * the buffer in which to store the data. * @param offset * the buffer offset at which storing begins. * @param length * the number of bytes to read. */ public static void strictReadFile(OpenFile file, int position, byte[] buf, int offset, int length) { long startTime = Machine.timer().getTime(); assertTrue(file.read(position, buf, offset, length) == length); long finishTime = Machine.timer().getTime(); assertTrue(finishTime > startTime); } /** * Load an entire file into memory. * * @param file * the file to load. * @return an array containing the contents of the entire file, or * <tt>null</tt> if an error occurred. */ public static byte[] loadFile(OpenFile file) { int startOffset = file.tell(); int length = file.length(); if (length < 0) return null; byte[] data = new byte[length]; file.seek(0); int amount = file.read(data, 0, length); file.seek(startOffset); if (amount == length) return data; else return null; } /** * Take a read-only snapshot of a file. * * @param file * the file to take a snapshot of. * @return a read-only snapshot of the file. */ public static OpenFile cloneFile(OpenFile file) { OpenFile clone = new ArrayFile(loadFile(file)); clone.seek(file.tell()); return clone; } /** * Convert a short into its little-endian byte string representation. * * @param array * the array in which to store the byte string. * @param offset * the offset in the array where the string will start. * @param value * the value to convert. */ public static void bytesFromShort(byte[] array, int offset, short value) { array[offset + 0] = (byte) ((value >> 0) & 0xFF); array[offset + 1] = (byte) ((value >> 8) & 0xFF); } /** * Convert an int into its little-endian byte string representation. * * @param array * the array in which to store the byte string. * @param offset * the offset in the array where the string will start. * @param value * the value to convert. */ public static void bytesFromInt(byte[] array, int offset, int value) { array[offset + 0] = (byte) ((value >> 0) & 0xFF); array[offset + 1] = (byte) ((value >> 8) & 0xFF); array[offset + 2] = (byte) ((value >> 16) & 0xFF); array[offset + 3] = (byte) ((value >> 24) & 0xFF); } /** * Convert an int into its little-endian byte string representation, and * return an array containing it. * * @param value * the value to convert. * @return an array containing the byte string. */ public static byte[] bytesFromInt(int value) { byte[] array = new byte[4]; bytesFromInt(array, 0, value); return array; } /** * Convert an int into a little-endian byte string representation of the * specified length. * * @param array * the array in which to store the byte string. * @param offset * the offset in the array where the string will start. * @param length * the number of bytes to store (must be 1, 2, or 4). * @param value * the value to convert. */ public static void bytesFromInt(byte[] array, int offset, int length, int value) { assertTrue(length == 1 || length == 2 || length == 4); switch (length) { case 1: array[offset] = (byte) value; break; case 2: bytesFromShort(array, offset, (short) value); break; case 4: bytesFromInt(array, offset, value); break; } } /** * Convert to a short from its little-endian byte string representation. * * @param array * the array containing the byte string. * @param offset * the offset of the byte string in the array. * @return the corresponding short value. */ public static short bytesToShort(byte[] array, int offset) { return (short) ((((short) array[offset + 0] & 0xFF) << 0) | (((short) array[offset + 1] & 0xFF) << 8)); } /** * Convert to an unsigned short from its little-endian byte string * representation. * * @param array * the array containing the byte string. * @param offset * the offset of the byte string in the array. * @return the corresponding short value. */ public static int bytesToUnsignedShort(byte[] array, int offset) { return (((int) bytesToShort(array, offset)) & 0xFFFF); } /** * Convert to an int from its little-endian byte string representation. * * @param array * the array containing the byte string. * @param offset * the offset of the byte string in the array. * @return the corresponding int value. */ public static int bytesToInt(byte[] array, int offset) { return (int) ((((int) array[offset + 0] & 0xFF) << 0) | (((int) array[offset + 1] & 0xFF) << 8) | (((int) array[offset + 2] & 0xFF) << 16) | (((int) array[offset + 3] & 0xFF) << 24)); } /** * Convert to an int from a little-endian byte string representation of the * specified length. * * @param array * the array containing the byte string. * @param offset * the offset of the byte string in the array. * @param length * the length of the byte string. * @return the corresponding value. */ public static int bytesToInt(byte[] array, int offset, int length) { assertTrue(length == 1 || length == 2 || length == 4); switch (length) { case 1: return array[offset]; case 2: return bytesToShort(array, offset); case 4: return bytesToInt(array, offset); default: return -1; } } /** * Convert to a string from a possibly null-terminated array of bytes. * * @param array * the array containing the byte string. * @param offset * the offset of the byte string in the array. * @param length * the maximum length of the byte string. * @return a string containing the specified bytes, up to and not including * the null-terminator (if present). */ public static String bytesToString(byte[] array, int offset, int length) { int i; for (i = 0; i < length; i++) { if (array[offset + i] == 0) break; } return new String(array, offset, i); } /** * Mask out and shift a bit substring. * * @param bits * the bit string. * @param lowest * the first bit of the substring within the string. * @param size * the number of bits in the substring. * @return the substring. */ public static int extract(int bits, int lowest, int size) { if (size == 32) return (bits >> lowest); else return ((bits >> lowest) & ((1 << size) - 1)); } /** * Mask out and shift a bit substring. * * @param bits * the bit string. * @param lowest * the first bit of the substring within the string. * @param size * the number of bits in the substring. * @return the substring. */ public static long extract(long bits, int lowest, int size) { if (size == 64) return (bits >> lowest); else return ((bits >> lowest) & ((1L << size) - 1)); } /** * Mask out and shift a bit substring; then sign extend the substring. * * @param bits * the bit string. * @param lowest * the first bit of the substring within the string. * @param size * the number of bits in the substring. * @return the substring, sign-extended. */ public static int extend(int bits, int lowest, int size) { int extra = 32 - (lowest + size); return ((extract(bits, lowest, size) << extra) >> extra); } /** * Test if a bit is set in a bit string. * * @param flag * the flag to test. * @param bits * the bit string. * @return <tt>true</tt> if <tt>(bits & flag)</tt> is non-zero. */ public static boolean test(long flag, long bits) { return ((bits & flag) != 0); } /** * Creates a padded upper-case string representation of the integer argument * in base 16. * * @param i * an integer. * @return a padded upper-case string representation in base 16. */ public static String toHexString(int i) { return toHexString(i, 8); } /** * Creates a padded upper-case string representation of the integer argument * in base 16, padding to at most the specified number of digits. * * @param i * an integer. * @param pad * the minimum number of hex digits to pad to. * @return a padded upper-case string representation in base 16. */ public static String toHexString(int i, int pad) { String result = Integer.toHexString(i).toUpperCase(); while (result.length() < pad) result = "0" + result; return result; } /** * Divide two non-negative integers, round the quotient up to the nearest * integer, and return it. * * @param a * the numerator. * @param b * the denominator. * @return <tt>ceiling(a / b)</tt>. */ public static int divRoundUp(int a, int b) { assertTrue(a >= 0 && b > 0); return ((a + (b - 1)) / b); } /** * Load and return the named class, or return <tt>null</tt> if the class * could not be loaded. * * @param className * the name of the class to load. * @return the loaded class, or <tt>null</tt> if an error occurred. */ public static Class tryLoadClass(String className) { try { return ClassLoader.getSystemClassLoader().loadClass(className); } catch (Throwable e) { return null; } } /** * Load and return the named class, terminating Nachos on any error. * * @param className * the name of the class to load. * @return the loaded class. */ public static Class loadClass(String className) { try { return ClassLoader.getSystemClassLoader().loadClass(className); } catch (Throwable e) { Machine.terminate(e); return null; } } /** * Create and return a new instance of the named class, using the * constructor that takes no arguments. * * @param className * the name of the class to instantiate. * @return a new instance of the class. */ public static Object constructObject(String className) { try { // kamil - workaround for Java 1.4 // Thanks to Ka-Hing Cheung for the suggestion. // Fixed for Java 1.5 by geels Class[] param_types = new Class[0]; Object[] params = new Object[0]; return loadClass(className).getConstructor(param_types).newInstance(params); } catch (Throwable e) { Machine.terminate(e); return null; } } /** * Verify that the specified class extends or implements the specified * superclass. * * @param cls * the descendant class. * @param superCls * the ancestor class. */ public static void checkDerivation(Class<?> cls, Class<?> superCls) { Lib.assertTrue(superCls.isAssignableFrom(cls)); } /** * Verifies that the specified class is public and not abstract, and that a * constructor with the specified signature exists and is public. * * @param cls * the class containing the constructor. * @param parameterTypes * the list of parameters. */ public static void checkConstructor(Class cls, Class[] parameterTypes) { try { Lib.assertTrue(Modifier.isPublic(cls.getModifiers()) && !Modifier.isAbstract(cls.getModifiers())); Constructor constructor = cls.getConstructor(parameterTypes); Lib.assertTrue(Modifier.isPublic(constructor.getModifiers())); } catch (Exception e) { Lib.assertNotReached(); } } /** * Verifies that the specified class is public, and that a non-static method * with the specified name and signature exists, is public, and returns the * specified type. * * @param cls * the class containing the non-static method. * @param methodName * the name of the non-static method. * @param parameterTypes * the list of parameters. * @param returnType * the required return type. */ public static void checkMethod(Class cls, String methodName, Class[] parameterTypes, Class returnType) { try { Lib.assertTrue(Modifier.isPublic(cls.getModifiers())); Method method = cls.getMethod(methodName, parameterTypes); Lib.assertTrue(Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers())); Lib.assertTrue(method.getReturnType() == returnType); } catch (Exception e) { Lib.assertNotReached(); } } /** * Verifies that the specified class is public, and that a static method * with the specified name and signature exists, is public, and returns the * specified type. * * @param cls * the class containing the static method. * @param methodName * the name of the static method. * @param parameterTypes * the list of parameters. * @param returnType * the required return type. */ public static void checkStaticMethod(Class cls, String methodName, Class[] parameterTypes, Class returnType) { try { Lib.assertTrue(Modifier.isPublic(cls.getModifiers())); Method method = cls.getMethod(methodName, parameterTypes); Lib.assertTrue(Modifier.isPublic(method.getModifiers()) && Modifier.isStatic(method.getModifiers())); Lib.assertTrue(method.getReturnType() == returnType); } catch (Exception e) { Lib.assertNotReached(); } } /** * Verifies that the specified class is public, and that a non-static field * with the specified name and type exists, is public, and is not final. * * @param cls * the class containing the field. * @param fieldName * the name of the field. * @param fieldType * the required type. */ public static void checkField(Class cls, String fieldName, Class fieldType) { try { Lib.assertTrue(Modifier.isPublic(cls.getModifiers())); Field field = cls.getField(fieldName); Lib.assertTrue(field.getType() == fieldType); Lib.assertTrue(Modifier.isPublic(field.getModifiers()) && !Modifier.isStatic(field.getModifiers()) && !Modifier.isFinal(field.getModifiers())); } catch (Exception e) { Lib.assertNotReached(); } } /** * Verifies that the specified class is public, and that a static field with * the specified name and type exists and is public. * * @param cls * the class containing the static field. * @param fieldName * the name of the static field. * @param fieldType * the required type. */ public static void checkStaticField(Class cls, String fieldName, Class fieldType) { try { Lib.assertTrue(Modifier.isPublic(cls.getModifiers())); Field field = cls.getField(fieldName); Lib.assertTrue(field.getType() == fieldType); Lib.assertTrue(Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())); } catch (Exception e) { Lib.assertNotReached(); } } }
1506c4815723883106d675d8d64b3055d6237c0d
053214273564e08b120ab3e548bb3c181a914d4c
/app/build/generated/source/r/debug/android/support/v7/mediarouter/R.java
c98e66001d477aa87279f9838e51e085063a1c0d
[]
no_license
theinizio/barberland
8c695f25568dbcca0d8ae5ab42cf1804f0e0dffa
d0a43a917a8f0a73a43d1a3e06ca158e4349d8b2
refs/heads/master
2021-01-18T17:25:38.144800
2015-06-25T10:14:53
2015-06-25T10:14:53
35,275,361
0
0
null
null
null
null
UTF-8
Java
false
false
72,731
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package android.support.v7.mediarouter; public final class R { public static final class anim { public static final int abc_fade_in = 0x7f040000; public static final int abc_fade_out = 0x7f040001; public static final int abc_grow_fade_in_from_bottom = 0x7f040002; public static final int abc_shrink_fade_out_from_bottom = 0x7f040003; public static final int abc_slide_in_bottom = 0x7f040004; public static final int abc_slide_in_top = 0x7f040005; public static final int abc_slide_out_bottom = 0x7f040006; public static final int abc_slide_out_top = 0x7f040007; } public static final class attr { public static final int actionBarDivider = 0x7f010079; public static final int actionBarItemBackground = 0x7f01007a; public static final int actionBarPopupTheme = 0x7f010073; public static final int actionBarSize = 0x7f010078; public static final int actionBarSplitStyle = 0x7f010075; public static final int actionBarStyle = 0x7f010074; public static final int actionBarTabBarStyle = 0x7f01006f; public static final int actionBarTabStyle = 0x7f01006e; public static final int actionBarTabTextStyle = 0x7f010070; public static final int actionBarTheme = 0x7f010076; public static final int actionBarWidgetTheme = 0x7f010077; public static final int actionButtonStyle = 0x7f010091; public static final int actionDropDownStyle = 0x7f01008c; public static final int actionLayout = 0x7f01004b; public static final int actionMenuTextAppearance = 0x7f01007b; public static final int actionMenuTextColor = 0x7f01007c; public static final int actionModeBackground = 0x7f01007f; public static final int actionModeCloseButtonStyle = 0x7f01007e; public static final int actionModeCloseDrawable = 0x7f010081; public static final int actionModeCopyDrawable = 0x7f010083; public static final int actionModeCutDrawable = 0x7f010082; public static final int actionModeFindDrawable = 0x7f010087; public static final int actionModePasteDrawable = 0x7f010084; public static final int actionModePopupWindowStyle = 0x7f010089; public static final int actionModeSelectAllDrawable = 0x7f010085; public static final int actionModeShareDrawable = 0x7f010086; public static final int actionModeSplitBackground = 0x7f010080; public static final int actionModeStyle = 0x7f01007d; public static final int actionModeWebSearchDrawable = 0x7f010088; public static final int actionOverflowButtonStyle = 0x7f010071; public static final int actionOverflowMenuStyle = 0x7f010072; public static final int actionProviderClass = 0x7f01004d; public static final int actionViewClass = 0x7f01004c; public static final int activityChooserViewStyle = 0x7f010098; public static final int background = 0x7f010013; public static final int backgroundSplit = 0x7f010015; public static final int backgroundStacked = 0x7f010014; public static final int barSize = 0x7f010031; public static final int buttonBarButtonStyle = 0x7f010093; public static final int buttonBarStyle = 0x7f010092; public static final int closeIcon = 0x7f010054; public static final int closeItemLayout = 0x7f010023; public static final int collapseContentDescription = 0x7f0100c3; public static final int collapseIcon = 0x7f0100c2; public static final int color = 0x7f01002b; public static final int colorAccent = 0x7f0100b3; public static final int colorButtonNormal = 0x7f0100b7; public static final int colorControlActivated = 0x7f0100b5; public static final int colorControlHighlight = 0x7f0100b6; public static final int colorControlNormal = 0x7f0100b4; public static final int colorPrimary = 0x7f0100b1; public static final int colorPrimaryDark = 0x7f0100b2; public static final int colorSwitchThumbNormal = 0x7f0100b8; public static final int commitIcon = 0x7f010058; public static final int contentInsetEnd = 0x7f01001e; public static final int contentInsetLeft = 0x7f01001f; public static final int contentInsetRight = 0x7f010020; public static final int contentInsetStart = 0x7f01001d; public static final int customNavigationLayout = 0x7f010016; public static final int disableChildrenWhenDisabled = 0x7f01005f; public static final int displayOptions = 0x7f01000c; public static final int divider = 0x7f010012; public static final int dividerHorizontal = 0x7f010097; public static final int dividerPadding = 0x7f010035; public static final int dividerVertical = 0x7f010096; public static final int drawableSize = 0x7f01002d; public static final int drawerArrowStyle = 0x7f010000; public static final int dropDownListViewStyle = 0x7f0100a9; public static final int dropdownListPreferredItemHeight = 0x7f01008d; public static final int editTextBackground = 0x7f01009e; public static final int editTextColor = 0x7f01009d; public static final int elevation = 0x7f010021; public static final int expandActivityOverflowButtonDrawable = 0x7f010025; public static final int externalRouteEnabledDrawable = 0x7f010049; public static final int gapBetweenBars = 0x7f01002e; public static final int goIcon = 0x7f010055; public static final int height = 0x7f010001; public static final int hideOnContentScroll = 0x7f01001c; public static final int homeAsUpIndicator = 0x7f010090; public static final int homeLayout = 0x7f010017; public static final int icon = 0x7f010010; public static final int iconifiedByDefault = 0x7f010052; public static final int indeterminateProgressStyle = 0x7f010019; public static final int initialActivityCount = 0x7f010024; public static final int isLightTheme = 0x7f010002; public static final int itemPadding = 0x7f01001b; public static final int layout = 0x7f010051; public static final int listChoiceBackgroundIndicator = 0x7f0100b0; public static final int listPopupWindowStyle = 0x7f0100aa; public static final int listPreferredItemHeight = 0x7f0100a4; public static final int listPreferredItemHeightLarge = 0x7f0100a6; public static final int listPreferredItemHeightSmall = 0x7f0100a5; public static final int listPreferredItemPaddingLeft = 0x7f0100a7; public static final int listPreferredItemPaddingRight = 0x7f0100a8; public static final int logo = 0x7f010011; public static final int maxButtonHeight = 0x7f0100c0; public static final int measureWithLargestChild = 0x7f010033; public static final int mediaRouteButtonStyle = 0x7f010003; public static final int mediaRouteConnectingDrawable = 0x7f010004; public static final int mediaRouteOffDrawable = 0x7f010005; public static final int mediaRouteOnDrawable = 0x7f010006; public static final int mediaRoutePauseDrawable = 0x7f010007; public static final int mediaRoutePlayDrawable = 0x7f010008; public static final int mediaRouteSettingsDrawable = 0x7f010009; public static final int middleBarArrowSize = 0x7f010030; public static final int navigationContentDescription = 0x7f0100c5; public static final int navigationIcon = 0x7f0100c4; public static final int navigationMode = 0x7f01000b; public static final int overlapAnchor = 0x7f01004f; public static final int paddingEnd = 0x7f0100c7; public static final int paddingStart = 0x7f0100c6; public static final int panelBackground = 0x7f0100ad; public static final int panelMenuListTheme = 0x7f0100af; public static final int panelMenuListWidth = 0x7f0100ae; public static final int popupMenuStyle = 0x7f01009b; public static final int popupPromptView = 0x7f01005e; public static final int popupTheme = 0x7f010022; public static final int popupWindowStyle = 0x7f01009c; public static final int preserveIconSpacing = 0x7f01004e; public static final int progressBarPadding = 0x7f01001a; public static final int progressBarStyle = 0x7f010018; public static final int prompt = 0x7f01005c; public static final int queryBackground = 0x7f01005a; public static final int queryHint = 0x7f010053; public static final int searchIcon = 0x7f010056; public static final int searchViewStyle = 0x7f0100a3; public static final int selectableItemBackground = 0x7f010094; public static final int selectableItemBackgroundBorderless = 0x7f010095; public static final int showAsAction = 0x7f01004a; public static final int showDividers = 0x7f010034; public static final int showText = 0x7f010066; public static final int spinBars = 0x7f01002c; public static final int spinnerDropDownItemStyle = 0x7f01008f; public static final int spinnerMode = 0x7f01005d; public static final int spinnerStyle = 0x7f01008e; public static final int splitTrack = 0x7f010065; public static final int state_above_anchor = 0x7f010050; public static final int submitBackground = 0x7f01005b; public static final int subtitle = 0x7f01000d; public static final int subtitleTextAppearance = 0x7f0100ba; public static final int subtitleTextStyle = 0x7f01000f; public static final int suggestionRowLayout = 0x7f010059; public static final int switchMinWidth = 0x7f010063; public static final int switchPadding = 0x7f010064; public static final int switchStyle = 0x7f01009f; public static final int switchTextAppearance = 0x7f010062; public static final int textAllCaps = 0x7f010029; public static final int textAppearanceLargePopupMenu = 0x7f01008a; public static final int textAppearanceListItem = 0x7f0100ab; public static final int textAppearanceListItemSmall = 0x7f0100ac; public static final int textAppearanceSearchResultSubtitle = 0x7f0100a1; public static final int textAppearanceSearchResultTitle = 0x7f0100a0; public static final int textAppearanceSmallPopupMenu = 0x7f01008b; public static final int textColorSearchUrl = 0x7f0100a2; public static final int theme = 0x7f0100c1; public static final int thickness = 0x7f010032; public static final int thumbTextPadding = 0x7f010061; public static final int title = 0x7f01000a; public static final int titleMarginBottom = 0x7f0100bf; public static final int titleMarginEnd = 0x7f0100bd; public static final int titleMarginStart = 0x7f0100bc; public static final int titleMarginTop = 0x7f0100be; public static final int titleMargins = 0x7f0100bb; public static final int titleTextAppearance = 0x7f0100b9; public static final int titleTextStyle = 0x7f01000e; public static final int toolbarNavigationButtonStyle = 0x7f01009a; public static final int toolbarStyle = 0x7f010099; public static final int topBottomBarArrowSize = 0x7f01002f; public static final int track = 0x7f010060; public static final int voiceIcon = 0x7f010057; public static final int windowActionBar = 0x7f010067; public static final int windowActionBarOverlay = 0x7f010068; public static final int windowActionModeOverlay = 0x7f010069; public static final int windowFixedHeightMajor = 0x7f01006d; public static final int windowFixedHeightMinor = 0x7f01006b; public static final int windowFixedWidthMajor = 0x7f01006a; public static final int windowFixedWidthMinor = 0x7f01006c; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f070000; public static final int abc_action_bar_embed_tabs_pre_jb = 0x7f070001; public static final int abc_action_bar_expanded_action_views_exclusive = 0x7f070002; public static final int abc_config_actionMenuItemAllCaps = 0x7f070003; public static final int abc_config_allowActionMenuItemTextWithIcon = 0x7f070004; public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = 0x7f070005; } public static final class color { public static final int abc_background_cache_hint_selector_material_dark = 0x7f080053; public static final int abc_background_cache_hint_selector_material_light = 0x7f080054; public static final int abc_input_method_navigation_guard = 0x7f080002; public static final int abc_primary_text_disable_only_material_dark = 0x7f080055; public static final int abc_primary_text_disable_only_material_light = 0x7f080056; public static final int abc_primary_text_material_dark = 0x7f080057; public static final int abc_primary_text_material_light = 0x7f080058; public static final int abc_search_url_text = 0x7f080059; public static final int abc_search_url_text_normal = 0x7f080003; public static final int abc_search_url_text_pressed = 0x7f080004; public static final int abc_search_url_text_selected = 0x7f080005; public static final int abc_secondary_text_material_dark = 0x7f08005a; public static final int abc_secondary_text_material_light = 0x7f08005b; public static final int accent_material_dark = 0x7f080006; public static final int accent_material_light = 0x7f080007; public static final int background_floating_material_dark = 0x7f080008; public static final int background_floating_material_light = 0x7f080009; public static final int background_material_dark = 0x7f08000a; public static final int background_material_light = 0x7f08000b; public static final int bright_foreground_disabled_material_dark = 0x7f08000c; public static final int bright_foreground_disabled_material_light = 0x7f08000d; public static final int bright_foreground_inverse_material_dark = 0x7f08000e; public static final int bright_foreground_inverse_material_light = 0x7f08000f; public static final int bright_foreground_material_dark = 0x7f080010; public static final int bright_foreground_material_light = 0x7f080011; public static final int button_material_dark = 0x7f080012; public static final int button_material_light = 0x7f080013; public static final int dim_foreground_disabled_material_dark = 0x7f08001e; public static final int dim_foreground_disabled_material_light = 0x7f08001f; public static final int dim_foreground_material_dark = 0x7f080020; public static final int dim_foreground_material_light = 0x7f080021; public static final int highlighted_text_material_dark = 0x7f080023; public static final int highlighted_text_material_light = 0x7f080024; public static final int hint_foreground_material_dark = 0x7f080025; public static final int hint_foreground_material_light = 0x7f080026; public static final int link_text_material_dark = 0x7f080028; public static final int link_text_material_light = 0x7f080029; public static final int material_blue_grey_800 = 0x7f08002a; public static final int material_blue_grey_900 = 0x7f08002b; public static final int material_blue_grey_950 = 0x7f08002c; public static final int material_deep_teal_200 = 0x7f08002d; public static final int material_deep_teal_500 = 0x7f08002e; public static final int primary_dark_material_dark = 0x7f080032; public static final int primary_dark_material_light = 0x7f080033; public static final int primary_material_dark = 0x7f080034; public static final int primary_material_light = 0x7f080035; public static final int primary_text_default_material_dark = 0x7f080036; public static final int primary_text_default_material_light = 0x7f080037; public static final int primary_text_disabled_material_dark = 0x7f080038; public static final int primary_text_disabled_material_light = 0x7f080039; public static final int ripple_material_dark = 0x7f08003b; public static final int ripple_material_light = 0x7f08003c; public static final int secondary_text_default_material_dark = 0x7f08003d; public static final int secondary_text_default_material_light = 0x7f08003e; public static final int secondary_text_disabled_material_dark = 0x7f08003f; public static final int secondary_text_disabled_material_light = 0x7f080040; public static final int switch_thumb_normal_material_dark = 0x7f080042; public static final int switch_thumb_normal_material_light = 0x7f080043; } public static final class dimen { public static final int abc_action_bar_default_height_material = 0x7f090000; public static final int abc_action_bar_default_padding_material = 0x7f090001; public static final int abc_action_bar_icon_vertical_padding_material = 0x7f090002; public static final int abc_action_bar_progress_bar_size = 0x7f090003; public static final int abc_action_bar_stacked_max_height = 0x7f090004; public static final int abc_action_bar_stacked_tab_max_width = 0x7f090005; public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f090006; public static final int abc_action_bar_subtitle_top_margin_material = 0x7f090007; public static final int abc_action_button_min_height_material = 0x7f090008; public static final int abc_action_button_min_width_material = 0x7f090009; public static final int abc_action_button_min_width_overflow_material = 0x7f09000a; public static final int abc_button_inset_horizontal_material = 0x7f09000b; public static final int abc_button_inset_vertical_material = 0x7f09000c; public static final int abc_button_padding_horizontal_material = 0x7f09000d; public static final int abc_button_padding_vertical_material = 0x7f09000e; public static final int abc_config_prefDialogWidth = 0x7f09000f; public static final int abc_control_corner_material = 0x7f090010; public static final int abc_control_inset_material = 0x7f090011; public static final int abc_control_padding_material = 0x7f090012; public static final int abc_dropdownitem_icon_width = 0x7f090013; public static final int abc_dropdownitem_text_padding_left = 0x7f090014; public static final int abc_dropdownitem_text_padding_right = 0x7f090015; public static final int abc_panel_menu_list_width = 0x7f090016; public static final int abc_search_view_preferred_width = 0x7f090017; public static final int abc_search_view_text_min_width = 0x7f090018; public static final int abc_text_size_body_1_material = 0x7f090019; public static final int abc_text_size_body_2_material = 0x7f09001a; public static final int abc_text_size_button_material = 0x7f09001b; public static final int abc_text_size_caption_material = 0x7f09001c; public static final int abc_text_size_display_1_material = 0x7f09001d; public static final int abc_text_size_display_2_material = 0x7f09001e; public static final int abc_text_size_display_3_material = 0x7f09001f; public static final int abc_text_size_display_4_material = 0x7f090020; public static final int abc_text_size_headline_material = 0x7f090021; public static final int abc_text_size_large_material = 0x7f090022; public static final int abc_text_size_medium_material = 0x7f090023; public static final int abc_text_size_menu_material = 0x7f090024; public static final int abc_text_size_small_material = 0x7f090025; public static final int abc_text_size_subhead_material = 0x7f090026; public static final int abc_text_size_subtitle_material_toolbar = 0x7f090027; public static final int abc_text_size_title_material = 0x7f090028; public static final int abc_text_size_title_material_toolbar = 0x7f090029; public static final int dialog_fixed_height_major = 0x7f09002f; public static final int dialog_fixed_height_minor = 0x7f090030; public static final int dialog_fixed_width_major = 0x7f090031; public static final int dialog_fixed_width_minor = 0x7f090032; public static final int disabled_alpha_material_dark = 0x7f090033; public static final int disabled_alpha_material_light = 0x7f090034; public static final int mr_media_route_controller_art_max_height = 0x7f090036; } public static final class drawable { public static final int abc_ab_share_pack_mtrl_alpha = 0x7f020000; public static final int abc_btn_check_material = 0x7f020001; public static final int abc_btn_check_to_on_mtrl_000 = 0x7f020002; public static final int abc_btn_check_to_on_mtrl_015 = 0x7f020003; public static final int abc_btn_default_mtrl_shape = 0x7f020004; public static final int abc_btn_radio_material = 0x7f020005; public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f020006; public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f020007; public static final int abc_btn_rating_star_off_mtrl_alpha = 0x7f020008; public static final int abc_btn_rating_star_on_mtrl_alpha = 0x7f020009; public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f02000a; public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f02000b; public static final int abc_cab_background_internal_bg = 0x7f02000c; public static final int abc_cab_background_top_material = 0x7f02000d; public static final int abc_cab_background_top_mtrl_alpha = 0x7f02000e; public static final int abc_edit_text_material = 0x7f02000f; public static final int abc_ic_ab_back_mtrl_am_alpha = 0x7f020010; public static final int abc_ic_clear_mtrl_alpha = 0x7f020011; public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f020012; public static final int abc_ic_go_search_api_mtrl_alpha = 0x7f020013; public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f020014; public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f020015; public static final int abc_ic_menu_moreoverflow_mtrl_alpha = 0x7f020016; public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f020017; public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f020018; public static final int abc_ic_menu_share_mtrl_alpha = 0x7f020019; public static final int abc_ic_search_api_mtrl_alpha = 0x7f02001a; public static final int abc_ic_voice_search_api_mtrl_alpha = 0x7f02001b; public static final int abc_item_background_holo_dark = 0x7f02001c; public static final int abc_item_background_holo_light = 0x7f02001d; public static final int abc_list_divider_mtrl_alpha = 0x7f02001e; public static final int abc_list_focused_holo = 0x7f02001f; public static final int abc_list_longpressed_holo = 0x7f020020; public static final int abc_list_pressed_holo_dark = 0x7f020021; public static final int abc_list_pressed_holo_light = 0x7f020022; public static final int abc_list_selector_background_transition_holo_dark = 0x7f020023; public static final int abc_list_selector_background_transition_holo_light = 0x7f020024; public static final int abc_list_selector_disabled_holo_dark = 0x7f020025; public static final int abc_list_selector_disabled_holo_light = 0x7f020026; public static final int abc_list_selector_holo_dark = 0x7f020027; public static final int abc_list_selector_holo_light = 0x7f020028; public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f020029; public static final int abc_popup_background_mtrl_mult = 0x7f02002a; public static final int abc_ratingbar_full_material = 0x7f02002b; public static final int abc_spinner_mtrl_am_alpha = 0x7f02002c; public static final int abc_spinner_textfield_background_material = 0x7f02002d; public static final int abc_switch_thumb_material = 0x7f02002e; public static final int abc_switch_track_mtrl_alpha = 0x7f02002f; public static final int abc_tab_indicator_material = 0x7f020030; public static final int abc_tab_indicator_mtrl_alpha = 0x7f020031; public static final int abc_textfield_activated_mtrl_alpha = 0x7f020032; public static final int abc_textfield_default_mtrl_alpha = 0x7f020033; public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f020034; public static final int abc_textfield_search_default_mtrl_alpha = 0x7f020035; public static final int abc_textfield_search_material = 0x7f020036; public static final int ic_cast_dark = 0x7f02005f; public static final int ic_cast_disabled_light = 0x7f020060; public static final int ic_cast_light = 0x7f020061; public static final int ic_cast_off_light = 0x7f020062; public static final int ic_cast_on_0_light = 0x7f020063; public static final int ic_cast_on_1_light = 0x7f020064; public static final int ic_cast_on_2_light = 0x7f020065; public static final int ic_cast_on_light = 0x7f020066; public static final int ic_media_pause = 0x7f020068; public static final int ic_media_play = 0x7f020069; public static final int ic_media_route_disabled_mono_dark = 0x7f02006a; public static final int ic_media_route_off_mono_dark = 0x7f02006b; public static final int ic_media_route_on_0_mono_dark = 0x7f02006c; public static final int ic_media_route_on_1_mono_dark = 0x7f02006d; public static final int ic_media_route_on_2_mono_dark = 0x7f02006e; public static final int ic_media_route_on_mono_dark = 0x7f02006f; public static final int ic_pause_dark = 0x7f020070; public static final int ic_pause_light = 0x7f020071; public static final int ic_play_dark = 0x7f020072; public static final int ic_play_light = 0x7f020073; public static final int ic_setting_dark = 0x7f020078; public static final int ic_setting_light = 0x7f020079; public static final int mr_ic_audio_vol = 0x7f020084; public static final int mr_ic_media_route_connecting_mono_dark = 0x7f020085; public static final int mr_ic_media_route_connecting_mono_light = 0x7f020086; public static final int mr_ic_media_route_mono_dark = 0x7f020087; public static final int mr_ic_media_route_mono_light = 0x7f020088; public static final int mr_ic_pause_dark = 0x7f020089; public static final int mr_ic_pause_light = 0x7f02008a; public static final int mr_ic_play_dark = 0x7f02008b; public static final int mr_ic_play_light = 0x7f02008c; public static final int mr_ic_settings_dark = 0x7f02008d; public static final int mr_ic_settings_light = 0x7f02008e; } public static final class id { public static final int action_bar = 0x7f0a0049; public static final int action_bar_activity_content = 0x7f0a0000; public static final int action_bar_container = 0x7f0a0048; public static final int action_bar_root = 0x7f0a0044; public static final int action_bar_spinner = 0x7f0a0001; public static final int action_bar_subtitle = 0x7f0a0037; public static final int action_bar_title = 0x7f0a0036; public static final int action_context_bar = 0x7f0a004a; public static final int action_menu_divider = 0x7f0a0002; public static final int action_menu_presenter = 0x7f0a0003; public static final int action_mode_bar = 0x7f0a0046; public static final int action_mode_bar_stub = 0x7f0a0045; public static final int action_mode_close_button = 0x7f0a0038; public static final int activity_chooser_view_content = 0x7f0a0039; public static final int always = 0x7f0a001e; public static final int art = 0x7f0a0079; public static final int beginning = 0x7f0a0016; public static final int buttons = 0x7f0a007d; public static final int checkbox = 0x7f0a0041; public static final int collapseActionView = 0x7f0a001f; public static final int decor_content_parent = 0x7f0a0047; public static final int default_activity_button = 0x7f0a003c; public static final int default_control_frame = 0x7f0a0078; public static final int dialog = 0x7f0a0023; public static final int disableHome = 0x7f0a000e; public static final int disconnect = 0x7f0a007e; public static final int dropdown = 0x7f0a0024; public static final int edit_query = 0x7f0a004b; public static final int end = 0x7f0a0017; public static final int expand_activities_button = 0x7f0a003a; public static final int expanded_menu = 0x7f0a0040; public static final int home = 0x7f0a0005; public static final int homeAsUp = 0x7f0a000f; public static final int icon = 0x7f0a003e; public static final int ifRoom = 0x7f0a0020; public static final int image = 0x7f0a003b; public static final int listMode = 0x7f0a000b; public static final int list_item = 0x7f0a003d; public static final int media_route_control_frame = 0x7f0a0077; public static final int media_route_list = 0x7f0a0073; public static final int middle = 0x7f0a0018; public static final int never = 0x7f0a0021; public static final int none = 0x7f0a0010; public static final int normal = 0x7f0a000c; public static final int play_pause = 0x7f0a007a; public static final int progress_circular = 0x7f0a0006; public static final int progress_horizontal = 0x7f0a0007; public static final int radio = 0x7f0a0043; public static final int route_name = 0x7f0a0075; public static final int search_badge = 0x7f0a004d; public static final int search_bar = 0x7f0a004c; public static final int search_button = 0x7f0a004e; public static final int search_close_btn = 0x7f0a0053; public static final int search_edit_frame = 0x7f0a004f; public static final int search_go_btn = 0x7f0a0055; public static final int search_mag_icon = 0x7f0a0050; public static final int search_plate = 0x7f0a0051; public static final int search_src_text = 0x7f0a0052; public static final int search_voice_btn = 0x7f0a0056; public static final int settings = 0x7f0a0076; public static final int shortcut = 0x7f0a0042; public static final int showCustom = 0x7f0a0011; public static final int showHome = 0x7f0a0012; public static final int showTitle = 0x7f0a0013; public static final int split_action_bar = 0x7f0a0008; public static final int stop = 0x7f0a007f; public static final int submit_area = 0x7f0a0054; public static final int subtitle = 0x7f0a007c; public static final int tabMode = 0x7f0a000d; public static final int text_wrapper = 0x7f0a007b; public static final int title = 0x7f0a003f; public static final int title_bar = 0x7f0a0074; public static final int up = 0x7f0a000a; public static final int useLogo = 0x7f0a0014; public static final int withText = 0x7f0a0022; public static final int wrap_content = 0x7f0a0025; } public static final class integer { public static final int abc_config_activityDefaultDur = 0x7f0b0000; public static final int abc_config_activityShortDur = 0x7f0b0001; public static final int abc_max_action_buttons = 0x7f0b0002; } public static final class layout { public static final int abc_action_bar_title_item = 0x7f030000; public static final int abc_action_bar_up_container = 0x7f030001; public static final int abc_action_bar_view_list_nav_layout = 0x7f030002; public static final int abc_action_menu_item_layout = 0x7f030003; public static final int abc_action_menu_layout = 0x7f030004; public static final int abc_action_mode_bar = 0x7f030005; public static final int abc_action_mode_close_item_material = 0x7f030006; public static final int abc_activity_chooser_view = 0x7f030007; public static final int abc_activity_chooser_view_list_item = 0x7f030008; public static final int abc_expanded_menu_layout = 0x7f030009; public static final int abc_list_menu_item_checkbox = 0x7f03000a; public static final int abc_list_menu_item_icon = 0x7f03000b; public static final int abc_list_menu_item_layout = 0x7f03000c; public static final int abc_list_menu_item_radio = 0x7f03000d; public static final int abc_popup_menu_item_layout = 0x7f03000e; public static final int abc_screen_content_include = 0x7f03000f; public static final int abc_screen_simple = 0x7f030010; public static final int abc_screen_simple_overlay_action_mode = 0x7f030011; public static final int abc_screen_toolbar = 0x7f030012; public static final int abc_search_dropdown_item_icons_2line = 0x7f030013; public static final int abc_search_view = 0x7f030014; public static final int abc_simple_dropdown_hint = 0x7f030015; public static final int mr_media_route_chooser_dialog = 0x7f03001e; public static final int mr_media_route_controller_material_dialog_b = 0x7f03001f; public static final int mr_media_route_list_item = 0x7f030020; public static final int support_simple_spinner_dropdown_item = 0x7f03002e; } public static final class string { public static final int abc_action_bar_home_description = 0x7f0c0000; public static final int abc_action_bar_home_description_format = 0x7f0c0001; public static final int abc_action_bar_home_subtitle_description_format = 0x7f0c0002; public static final int abc_action_bar_up_description = 0x7f0c0003; public static final int abc_action_menu_overflow_description = 0x7f0c0004; public static final int abc_action_mode_done = 0x7f0c0005; public static final int abc_activity_chooser_view_see_all = 0x7f0c0006; public static final int abc_activitychooserview_choose_application = 0x7f0c0007; public static final int abc_searchview_description_clear = 0x7f0c0008; public static final int abc_searchview_description_query = 0x7f0c0009; public static final int abc_searchview_description_search = 0x7f0c000a; public static final int abc_searchview_description_submit = 0x7f0c000b; public static final int abc_searchview_description_voice = 0x7f0c000c; public static final int abc_shareactionprovider_share_with = 0x7f0c000d; public static final int abc_shareactionprovider_share_with_application = 0x7f0c000e; public static final int abc_toolbar_collapse_description = 0x7f0c000f; public static final int mr_media_route_button_content_description = 0x7f0c003e; public static final int mr_media_route_chooser_searching = 0x7f0c003f; public static final int mr_media_route_chooser_title = 0x7f0c0040; public static final int mr_media_route_controller_disconnect = 0x7f0c0041; public static final int mr_media_route_controller_pause = 0x7f0c0042; public static final int mr_media_route_controller_play = 0x7f0c0043; public static final int mr_media_route_controller_settings_description = 0x7f0c0044; public static final int mr_media_route_controller_stop = 0x7f0c0045; public static final int mr_system_route_name = 0x7f0c0046; public static final int mr_user_route_category_name = 0x7f0c0047; } public static final class style { public static final int Animation_AppCompat_DropDownUp = 0x7f0d0000; public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0d0002; public static final int Base_TextAppearance_AppCompat = 0x7f0d0003; public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0d0004; public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0d0005; public static final int Base_TextAppearance_AppCompat_Button = 0x7f0d0006; public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0d0007; public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0d0008; public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0d0009; public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0d000a; public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0d000b; public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0d000c; public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0d000d; public static final int Base_TextAppearance_AppCompat_Large = 0x7f0d000e; public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0d000f; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0d0010; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0d0011; public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0d0012; public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0d0013; public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0d0014; public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0d0015; public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0d0016; public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0d0017; public static final int Base_TextAppearance_AppCompat_Small = 0x7f0d0018; public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0d0019; public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0d001a; public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0d001b; public static final int Base_TextAppearance_AppCompat_Title = 0x7f0d001c; public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0d001d; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0d001e; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0d001f; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0d0020; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0d0021; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0d0022; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0d0023; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0d0024; public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0d0025; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0d0026; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0d0027; public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0d0028; public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0d0029; public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0d002a; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0d002b; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0d002c; public static final int Base_ThemeOverlay_AppCompat = 0x7f0d0037; public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0d0038; public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0d0039; public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0d003a; public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0d003b; public static final int Base_Theme_AppCompat = 0x7f0d002d; public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0d002e; public static final int Base_Theme_AppCompat_Dialog = 0x7f0d002f; public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0d0031; public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0d0030; public static final int Base_Theme_AppCompat_Light = 0x7f0d0032; public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0d0033; public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0d0034; public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0d0036; public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0d0035; public static final int Base_V11_Theme_AppCompat = 0x7f0d00fc; public static final int Base_V11_Theme_AppCompat_Dialog = 0x7f0d00fd; public static final int Base_V11_Theme_AppCompat_Light = 0x7f0d00fe; public static final int Base_V11_Theme_AppCompat_Light_Dialog = 0x7f0d00ff; public static final int Base_V14_Theme_AppCompat = 0x7f0d0100; public static final int Base_V14_Theme_AppCompat_Dialog = 0x7f0d0101; public static final int Base_V14_Theme_AppCompat_Light = 0x7f0d0102; public static final int Base_V14_Theme_AppCompat_Light_Dialog = 0x7f0d0103; public static final int Base_V21_Theme_AppCompat = 0x7f0d0104; public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0d0105; public static final int Base_V21_Theme_AppCompat_Light = 0x7f0d0106; public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0d0107; public static final int Base_V7_Theme_AppCompat = 0x7f0d003c; public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0d003d; public static final int Base_V7_Theme_AppCompat_Light = 0x7f0d003e; public static final int Base_Widget_AppCompat_ActionBar = 0x7f0d003f; public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0d0040; public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0d0041; public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0d0042; public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0d0043; public static final int Base_Widget_AppCompat_ActionButton = 0x7f0d0044; public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0d0045; public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0d0046; public static final int Base_Widget_AppCompat_ActionMode = 0x7f0d0047; public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0d0048; public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0d0049; public static final int Base_Widget_AppCompat_Button = 0x7f0d004a; public static final int Base_Widget_AppCompat_Button_Small = 0x7f0d004b; public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0d004c; public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0d004d; public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0d004e; public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0d004f; public static final int Base_Widget_AppCompat_EditText = 0x7f0d0050; public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0d0051; public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0d0052; public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0d0053; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0d0054; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0d0055; public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0d0056; public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0d0057; public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0d0058; public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0d0059; public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0d005a; public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0d005b; public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0d005c; public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0d005d; public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0d005e; public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0d005f; public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0d0060; public static final int Base_Widget_AppCompat_RatingBar = 0x7f0d0061; public static final int Base_Widget_AppCompat_SearchView = 0x7f0d0062; public static final int Base_Widget_AppCompat_Spinner = 0x7f0d0063; public static final int Base_Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0d0064; public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0d0065; public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0d0066; public static final int Base_Widget_AppCompat_Toolbar = 0x7f0d0067; public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0d0068; public static final int Platform_AppCompat = 0x7f0d006c; public static final int Platform_AppCompat_Dialog = 0x7f0d006d; public static final int Platform_AppCompat_Light = 0x7f0d006e; public static final int Platform_AppCompat_Light_Dialog = 0x7f0d006f; public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0d0070; public static final int RtlOverlay_Widget_AppCompat_ActionButton_CloseMode = 0x7f0d0071; public static final int RtlOverlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0d0072; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0d0073; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0d0074; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0d0075; public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0d007b; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0d0076; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0d0077; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0d0078; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0d0079; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0d007a; public static final int TextAppearance_AppCompat = 0x7f0d007e; public static final int TextAppearance_AppCompat_Body1 = 0x7f0d007f; public static final int TextAppearance_AppCompat_Body2 = 0x7f0d0080; public static final int TextAppearance_AppCompat_Button = 0x7f0d0081; public static final int TextAppearance_AppCompat_Caption = 0x7f0d0082; public static final int TextAppearance_AppCompat_Display1 = 0x7f0d0083; public static final int TextAppearance_AppCompat_Display2 = 0x7f0d0084; public static final int TextAppearance_AppCompat_Display3 = 0x7f0d0085; public static final int TextAppearance_AppCompat_Display4 = 0x7f0d0086; public static final int TextAppearance_AppCompat_Headline = 0x7f0d0087; public static final int TextAppearance_AppCompat_Inverse = 0x7f0d0088; public static final int TextAppearance_AppCompat_Large = 0x7f0d0089; public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0d008a; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0d008b; public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0d008c; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0d008d; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0d008e; public static final int TextAppearance_AppCompat_Medium = 0x7f0d008f; public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0d0090; public static final int TextAppearance_AppCompat_Menu = 0x7f0d0091; public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0d0092; public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0d0093; public static final int TextAppearance_AppCompat_Small = 0x7f0d0094; public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0d0095; public static final int TextAppearance_AppCompat_Subhead = 0x7f0d0096; public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0d0097; public static final int TextAppearance_AppCompat_Title = 0x7f0d0098; public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0d0099; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0d009a; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0d009b; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0d009c; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0d009d; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0d009e; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0d009f; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0d00a0; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0d00a1; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0d00a2; public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0d00a3; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0d00a4; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0d00a5; public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0d00a6; public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0d00a7; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0d00a8; public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0d00a9; public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0d00aa; public static final int ThemeOverlay_AppCompat = 0x7f0d00b8; public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0d00b9; public static final int ThemeOverlay_AppCompat_Dark = 0x7f0d00ba; public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0d00bb; public static final int ThemeOverlay_AppCompat_Light = 0x7f0d00bc; public static final int Theme_AppCompat = 0x7f0d00ab; public static final int Theme_AppCompat_CompactMenu = 0x7f0d00ac; public static final int Theme_AppCompat_Dialog = 0x7f0d00ad; public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0d00ae; public static final int Theme_AppCompat_Light = 0x7f0d00af; public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0d00b0; public static final int Theme_AppCompat_Light_Dialog = 0x7f0d00b1; public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0d00b2; public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0d00b3; public static final int Theme_AppCompat_NoActionBar = 0x7f0d00b4; public static final int Theme_MediaRouter = 0x7f0d00b6; public static final int Theme_MediaRouter_Light = 0x7f0d00b7; public static final int Widget_AppCompat_ActionBar = 0x7f0d00c1; public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0d00c2; public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0d00c3; public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0d00c4; public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0d00c5; public static final int Widget_AppCompat_ActionButton = 0x7f0d00c6; public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0d00c7; public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0d00c8; public static final int Widget_AppCompat_ActionMode = 0x7f0d00c9; public static final int Widget_AppCompat_ActivityChooserView = 0x7f0d00ca; public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0d00cb; public static final int Widget_AppCompat_Button = 0x7f0d00cc; public static final int Widget_AppCompat_Button_Small = 0x7f0d00cd; public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0d00ce; public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0d00cf; public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0d00d0; public static final int Widget_AppCompat_EditText = 0x7f0d00d1; public static final int Widget_AppCompat_Light_ActionBar = 0x7f0d00d2; public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0d00d3; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0d00d4; public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0d00d5; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0d00d6; public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0d00d7; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0d00d8; public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0d00d9; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0d00da; public static final int Widget_AppCompat_Light_ActionButton = 0x7f0d00db; public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0d00dc; public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0d00dd; public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0d00de; public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0d00df; public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0d00e0; public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0d00e1; public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0d00e2; public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0d00e3; public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0d00e4; public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0d00e5; public static final int Widget_AppCompat_Light_SearchView = 0x7f0d00e6; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0d00e7; public static final int Widget_AppCompat_ListPopupWindow = 0x7f0d00e8; public static final int Widget_AppCompat_ListView_DropDown = 0x7f0d00e9; public static final int Widget_AppCompat_ListView_Menu = 0x7f0d00ea; public static final int Widget_AppCompat_PopupMenu = 0x7f0d00eb; public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0d00ec; public static final int Widget_AppCompat_PopupWindow = 0x7f0d00ed; public static final int Widget_AppCompat_ProgressBar = 0x7f0d00ee; public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0d00ef; public static final int Widget_AppCompat_RatingBar = 0x7f0d00f0; public static final int Widget_AppCompat_SearchView = 0x7f0d00f1; public static final int Widget_AppCompat_Spinner = 0x7f0d00f2; public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0d00f3; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0d00f4; public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0d00f5; public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0d00f6; public static final int Widget_AppCompat_Toolbar = 0x7f0d00f7; public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0d00f8; public static final int Widget_MediaRouter_Light_MediaRouteButton = 0x7f0d00f9; public static final int Widget_MediaRouter_MediaRouteButton = 0x7f0d00fa; } public static final class styleable { public static final int[] ActionBar = { 0x7f010001, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022, 0x7f010090 }; public static final int[] ActionBarLayout = { 0x010100b3 }; public static final int ActionBarLayout_android_layout_gravity = 0; public static final int ActionBar_background = 10; public static final int ActionBar_backgroundSplit = 12; public static final int ActionBar_backgroundStacked = 11; public static final int ActionBar_contentInsetEnd = 21; public static final int ActionBar_contentInsetLeft = 22; public static final int ActionBar_contentInsetRight = 23; public static final int ActionBar_contentInsetStart = 20; public static final int ActionBar_customNavigationLayout = 13; public static final int ActionBar_displayOptions = 3; public static final int ActionBar_divider = 9; public static final int ActionBar_elevation = 24; public static final int ActionBar_height = 0; public static final int ActionBar_hideOnContentScroll = 19; public static final int ActionBar_homeAsUpIndicator = 26; public static final int ActionBar_homeLayout = 14; public static final int ActionBar_icon = 7; public static final int ActionBar_indeterminateProgressStyle = 16; public static final int ActionBar_itemPadding = 18; public static final int ActionBar_logo = 8; public static final int ActionBar_navigationMode = 2; public static final int ActionBar_popupTheme = 25; public static final int ActionBar_progressBarPadding = 17; public static final int ActionBar_progressBarStyle = 15; public static final int ActionBar_subtitle = 4; public static final int ActionBar_subtitleTextStyle = 6; public static final int ActionBar_title = 1; public static final int ActionBar_titleTextStyle = 5; public static final int[] ActionMenuItemView = { 0x0101013f }; public static final int ActionMenuItemView_android_minWidth = 0; public static final int[] ActionMenuView = { }; public static final int[] ActionMode = { 0x7f010001, 0x7f01000e, 0x7f01000f, 0x7f010013, 0x7f010015, 0x7f010023 }; public static final int ActionMode_background = 3; public static final int ActionMode_backgroundSplit = 4; public static final int ActionMode_closeItemLayout = 5; public static final int ActionMode_height = 0; public static final int ActionMode_subtitleTextStyle = 2; public static final int ActionMode_titleTextStyle = 1; public static final int[] ActivityChooserView = { 0x7f010024, 0x7f010025 }; public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1; public static final int ActivityChooserView_initialActivityCount = 0; public static final int[] CompatTextView = { 0x7f010029 }; public static final int CompatTextView_textAllCaps = 0; public static final int[] DrawerArrowToggle = { 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032 }; public static final int DrawerArrowToggle_barSize = 6; public static final int DrawerArrowToggle_color = 0; public static final int DrawerArrowToggle_drawableSize = 2; public static final int DrawerArrowToggle_gapBetweenBars = 3; public static final int DrawerArrowToggle_middleBarArrowSize = 5; public static final int DrawerArrowToggle_spinBars = 1; public static final int DrawerArrowToggle_thickness = 7; public static final int DrawerArrowToggle_topBottomBarArrowSize = 4; public static final int[] LinearLayoutCompat = { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x7f010012, 0x7f010033, 0x7f010034, 0x7f010035 }; public static final int[] LinearLayoutCompat_Layout = { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 }; public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0; public static final int LinearLayoutCompat_Layout_android_layout_height = 2; public static final int LinearLayoutCompat_Layout_android_layout_weight = 3; public static final int LinearLayoutCompat_Layout_android_layout_width = 1; public static final int LinearLayoutCompat_android_baselineAligned = 2; public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3; public static final int LinearLayoutCompat_android_gravity = 0; public static final int LinearLayoutCompat_android_orientation = 1; public static final int LinearLayoutCompat_android_weightSum = 4; public static final int LinearLayoutCompat_divider = 5; public static final int LinearLayoutCompat_dividerPadding = 8; public static final int LinearLayoutCompat_measureWithLargestChild = 6; public static final int LinearLayoutCompat_showDividers = 7; public static final int[] ListPopupWindow = { 0x010102ac, 0x010102ad }; public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0; public static final int ListPopupWindow_android_dropDownVerticalOffset = 1; public static final int[] MediaRouteButton = { 0x0101013f, 0x01010140, 0x7f010049 }; public static final int MediaRouteButton_android_minHeight = 1; public static final int MediaRouteButton_android_minWidth = 0; public static final int MediaRouteButton_externalRouteEnabledDrawable = 2; public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }; public static final int MenuGroup_android_checkableBehavior = 5; public static final int MenuGroup_android_enabled = 0; public static final int MenuGroup_android_id = 1; public static final int MenuGroup_android_menuCategory = 3; public static final int MenuGroup_android_orderInCategory = 4; public static final int MenuGroup_android_visible = 2; public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d }; public static final int MenuItem_actionLayout = 14; public static final int MenuItem_actionProviderClass = 16; public static final int MenuItem_actionViewClass = 15; public static final int MenuItem_android_alphabeticShortcut = 9; public static final int MenuItem_android_checkable = 11; public static final int MenuItem_android_checked = 3; public static final int MenuItem_android_enabled = 1; public static final int MenuItem_android_icon = 0; public static final int MenuItem_android_id = 2; public static final int MenuItem_android_menuCategory = 5; public static final int MenuItem_android_numericShortcut = 10; public static final int MenuItem_android_onClick = 12; public static final int MenuItem_android_orderInCategory = 6; public static final int MenuItem_android_title = 7; public static final int MenuItem_android_titleCondensed = 8; public static final int MenuItem_android_visible = 4; public static final int MenuItem_showAsAction = 13; public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x7f01004e }; public static final int MenuView_android_headerBackground = 4; public static final int MenuView_android_horizontalDivider = 2; public static final int MenuView_android_itemBackground = 5; public static final int MenuView_android_itemIconDisabledAlpha = 6; public static final int MenuView_android_itemTextAppearance = 1; public static final int MenuView_android_verticalDivider = 3; public static final int MenuView_android_windowAnimationStyle = 0; public static final int MenuView_preserveIconSpacing = 7; public static final int[] PopupWindow = { 0x01010176, 0x7f01004f }; public static final int[] PopupWindowBackgroundState = { 0x7f010050 }; public static final int PopupWindowBackgroundState_state_above_anchor = 0; public static final int PopupWindow_android_popupBackground = 0; public static final int PopupWindow_overlapAnchor = 1; public static final int[] SearchView = { 0x010100da, 0x0101011f, 0x01010220, 0x01010264, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054, 0x7f010055, 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b }; public static final int SearchView_android_focusable = 0; public static final int SearchView_android_imeOptions = 3; public static final int SearchView_android_inputType = 2; public static final int SearchView_android_maxWidth = 1; public static final int SearchView_closeIcon = 7; public static final int SearchView_commitIcon = 11; public static final int SearchView_goIcon = 8; public static final int SearchView_iconifiedByDefault = 5; public static final int SearchView_layout = 4; public static final int SearchView_queryBackground = 13; public static final int SearchView_queryHint = 6; public static final int SearchView_searchIcon = 9; public static final int SearchView_submitBackground = 14; public static final int SearchView_suggestionRowLayout = 12; public static final int SearchView_voiceIcon = 10; public static final int[] Spinner = { 0x010100af, 0x010100d4, 0x01010175, 0x01010176, 0x01010262, 0x010102ac, 0x010102ad, 0x7f01005c, 0x7f01005d, 0x7f01005e, 0x7f01005f }; public static final int Spinner_android_background = 1; public static final int Spinner_android_dropDownHorizontalOffset = 5; public static final int Spinner_android_dropDownSelector = 2; public static final int Spinner_android_dropDownVerticalOffset = 6; public static final int Spinner_android_dropDownWidth = 4; public static final int Spinner_android_gravity = 0; public static final int Spinner_android_popupBackground = 3; public static final int Spinner_disableChildrenWhenDisabled = 10; public static final int Spinner_popupPromptView = 9; public static final int Spinner_prompt = 7; public static final int Spinner_spinnerMode = 8; public static final int[] SwitchCompat = { 0x01010124, 0x01010125, 0x01010142, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066 }; public static final int[] SwitchCompatTextAppearance = { 0x01010095, 0x01010098, 0x7f010029 }; public static final int SwitchCompatTextAppearance_android_textColor = 1; public static final int SwitchCompatTextAppearance_android_textSize = 0; public static final int SwitchCompatTextAppearance_textAllCaps = 2; public static final int SwitchCompat_android_textOff = 1; public static final int SwitchCompat_android_textOn = 0; public static final int SwitchCompat_android_thumb = 2; public static final int SwitchCompat_showText = 9; public static final int SwitchCompat_splitTrack = 8; public static final int SwitchCompat_switchMinWidth = 6; public static final int SwitchCompat_switchPadding = 7; public static final int SwitchCompat_switchTextAppearance = 5; public static final int SwitchCompat_thumbTextPadding = 4; public static final int SwitchCompat_track = 3; public static final int[] Theme = { 0x01010057, 0x010100ae, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070, 0x7f010071, 0x7f010072, 0x7f010073, 0x7f010074, 0x7f010075, 0x7f010076, 0x7f010077, 0x7f010078, 0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c, 0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080, 0x7f010081, 0x7f010082, 0x7f010083, 0x7f010084, 0x7f010085, 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096, 0x7f010097, 0x7f010098, 0x7f010099, 0x7f01009a, 0x7f01009b, 0x7f01009c, 0x7f01009d, 0x7f01009e, 0x7f01009f, 0x7f0100a0, 0x7f0100a1, 0x7f0100a2, 0x7f0100a3, 0x7f0100a4, 0x7f0100a5, 0x7f0100a6, 0x7f0100a7, 0x7f0100a8, 0x7f0100a9, 0x7f0100aa, 0x7f0100ab, 0x7f0100ac, 0x7f0100ad, 0x7f0100ae, 0x7f0100af, 0x7f0100b0, 0x7f0100b1, 0x7f0100b2, 0x7f0100b3, 0x7f0100b4, 0x7f0100b5, 0x7f0100b6, 0x7f0100b7, 0x7f0100b8 }; public static final int Theme_actionBarDivider = 20; public static final int Theme_actionBarItemBackground = 21; public static final int Theme_actionBarPopupTheme = 14; public static final int Theme_actionBarSize = 19; public static final int Theme_actionBarSplitStyle = 16; public static final int Theme_actionBarStyle = 15; public static final int Theme_actionBarTabBarStyle = 10; public static final int Theme_actionBarTabStyle = 9; public static final int Theme_actionBarTabTextStyle = 11; public static final int Theme_actionBarTheme = 17; public static final int Theme_actionBarWidgetTheme = 18; public static final int Theme_actionButtonStyle = 44; public static final int Theme_actionDropDownStyle = 39; public static final int Theme_actionMenuTextAppearance = 22; public static final int Theme_actionMenuTextColor = 23; public static final int Theme_actionModeBackground = 26; public static final int Theme_actionModeCloseButtonStyle = 25; public static final int Theme_actionModeCloseDrawable = 28; public static final int Theme_actionModeCopyDrawable = 30; public static final int Theme_actionModeCutDrawable = 29; public static final int Theme_actionModeFindDrawable = 34; public static final int Theme_actionModePasteDrawable = 31; public static final int Theme_actionModePopupWindowStyle = 36; public static final int Theme_actionModeSelectAllDrawable = 32; public static final int Theme_actionModeShareDrawable = 33; public static final int Theme_actionModeSplitBackground = 27; public static final int Theme_actionModeStyle = 24; public static final int Theme_actionModeWebSearchDrawable = 35; public static final int Theme_actionOverflowButtonStyle = 12; public static final int Theme_actionOverflowMenuStyle = 13; public static final int Theme_activityChooserViewStyle = 51; public static final int Theme_android_windowAnimationStyle = 1; public static final int Theme_android_windowIsFloating = 0; public static final int Theme_buttonBarButtonStyle = 46; public static final int Theme_buttonBarStyle = 45; public static final int Theme_colorAccent = 78; public static final int Theme_colorButtonNormal = 82; public static final int Theme_colorControlActivated = 80; public static final int Theme_colorControlHighlight = 81; public static final int Theme_colorControlNormal = 79; public static final int Theme_colorPrimary = 76; public static final int Theme_colorPrimaryDark = 77; public static final int Theme_colorSwitchThumbNormal = 83; public static final int Theme_dividerHorizontal = 50; public static final int Theme_dividerVertical = 49; public static final int Theme_dropDownListViewStyle = 68; public static final int Theme_dropdownListPreferredItemHeight = 40; public static final int Theme_editTextBackground = 57; public static final int Theme_editTextColor = 56; public static final int Theme_homeAsUpIndicator = 43; public static final int Theme_listChoiceBackgroundIndicator = 75; public static final int Theme_listPopupWindowStyle = 69; public static final int Theme_listPreferredItemHeight = 63; public static final int Theme_listPreferredItemHeightLarge = 65; public static final int Theme_listPreferredItemHeightSmall = 64; public static final int Theme_listPreferredItemPaddingLeft = 66; public static final int Theme_listPreferredItemPaddingRight = 67; public static final int Theme_panelBackground = 72; public static final int Theme_panelMenuListTheme = 74; public static final int Theme_panelMenuListWidth = 73; public static final int Theme_popupMenuStyle = 54; public static final int Theme_popupWindowStyle = 55; public static final int Theme_searchViewStyle = 62; public static final int Theme_selectableItemBackground = 47; public static final int Theme_selectableItemBackgroundBorderless = 48; public static final int Theme_spinnerDropDownItemStyle = 42; public static final int Theme_spinnerStyle = 41; public static final int Theme_switchStyle = 58; public static final int Theme_textAppearanceLargePopupMenu = 37; public static final int Theme_textAppearanceListItem = 70; public static final int Theme_textAppearanceListItemSmall = 71; public static final int Theme_textAppearanceSearchResultSubtitle = 60; public static final int Theme_textAppearanceSearchResultTitle = 59; public static final int Theme_textAppearanceSmallPopupMenu = 38; public static final int Theme_textColorSearchUrl = 61; public static final int Theme_toolbarNavigationButtonStyle = 53; public static final int Theme_toolbarStyle = 52; public static final int Theme_windowActionBar = 2; public static final int Theme_windowActionBarOverlay = 3; public static final int Theme_windowActionModeOverlay = 4; public static final int Theme_windowFixedHeightMajor = 8; public static final int Theme_windowFixedHeightMinor = 6; public static final int Theme_windowFixedWidthMajor = 5; public static final int Theme_windowFixedWidthMinor = 7; public static final int[] Toolbar = { 0x010100af, 0x01010140, 0x7f01000a, 0x7f01000d, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010022, 0x7f0100b9, 0x7f0100ba, 0x7f0100bb, 0x7f0100bc, 0x7f0100bd, 0x7f0100be, 0x7f0100bf, 0x7f0100c0, 0x7f0100c1, 0x7f0100c2, 0x7f0100c3, 0x7f0100c4, 0x7f0100c5 }; public static final int Toolbar_android_gravity = 0; public static final int Toolbar_android_minHeight = 1; public static final int Toolbar_collapseContentDescription = 19; public static final int Toolbar_collapseIcon = 18; public static final int Toolbar_contentInsetEnd = 5; public static final int Toolbar_contentInsetLeft = 6; public static final int Toolbar_contentInsetRight = 7; public static final int Toolbar_contentInsetStart = 4; public static final int Toolbar_maxButtonHeight = 16; public static final int Toolbar_navigationContentDescription = 21; public static final int Toolbar_navigationIcon = 20; public static final int Toolbar_popupTheme = 8; public static final int Toolbar_subtitle = 3; public static final int Toolbar_subtitleTextAppearance = 10; public static final int Toolbar_theme = 17; public static final int Toolbar_title = 2; public static final int Toolbar_titleMarginBottom = 15; public static final int Toolbar_titleMarginEnd = 13; public static final int Toolbar_titleMarginStart = 12; public static final int Toolbar_titleMarginTop = 14; public static final int Toolbar_titleMargins = 11; public static final int Toolbar_titleTextAppearance = 9; public static final int[] View = { 0x010100da, 0x7f0100c6, 0x7f0100c7 }; public static final int[] ViewStubCompat = { 0x010100d0, 0x010100f2, 0x010100f3 }; public static final int ViewStubCompat_android_id = 0; public static final int ViewStubCompat_android_inflatedId = 2; public static final int ViewStubCompat_android_layout = 1; public static final int View_android_focusable = 0; public static final int View_paddingEnd = 2; public static final int View_paddingStart = 1; } }
019490e757ccb1b760c70ef7e34f0070d77743eb
c258b0af8c8a17fa6a0e7710c0936c37363a8260
/src/main/java/com/yunxi/stamper/entity/ApplicationKeeper.java
65c897fd0557a041e3d623a6020c7584d9ffb9fd
[]
no_license
huyc-decent/stamper
7852687064e60ac8892f9a539c9c61ed7ad1b7ea
99c3ba1e7e650560beba5213bc2d54bd58518682
refs/heads/main
2023-04-11T22:55:58.760273
2021-05-17T12:09:29
2021-05-17T12:09:29
368,167,441
0
0
null
null
null
null
UTF-8
Java
false
false
6,919
java
package com.yunxi.stamper.entity; import javax.persistence.*; import java.io.Serializable; import java.util.Date; @Table(name = "application_keeper") public class ApplicationKeeper implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name = "org_id") private Integer orgId; /** * ๅ…ณ่”็”ณ่ฏทๅ•id */ @Column(name = "application_id") private Integer applicationId; /** * ่ฟ™ๆก่ฎฐๅฝ•ๅค„็†ไบบ(็ฎก็ซ ไบบ)id */ @Column(name = "keeper_id") private Integer keeperId; /** * ๆŽˆๆƒไบบๅ็งฐ */ @Column(name = "keeper_name") private String keeperName; /** * ๆ‰€็ฎก็†็š„็ซ  */ @Column(name = "device_id") private Integer deviceId; /** * ๅฐ็ซ ๅ็งฐ */ @Column(name = "device_name") private String deviceName; /** * 1:ๆŽˆๆƒไธญ 2:ๆŽˆๆƒๅŒๆ„ 3:ๆŽˆๆƒๆ‹’็ป 4:ๅทฒๅคฑๆ•ˆ */ private Integer status; /** * ๅฎกๆ‰น่Š‚็‚นid */ @Column(name = "node_id") private Integer nodeId; /** * ๆ„่งๅค‡ๆณจ */ private String suggest; /** * ๅค„็†ๆ—ถ้—ด */ private Date time; @Column(name = "create_date") private Date createDate; @Column(name = "update_date") private Date updateDate; @Column(name = "delete_date") private Date deleteDate; private static final long serialVersionUID = 1L; /** * @return id */ public Integer getId() { return id; } /** * @param id */ public void setId(Integer id) { this.id = id; } /** * @return org_id */ public Integer getOrgId() { return orgId; } /** * @param orgId */ public void setOrgId(Integer orgId) { this.orgId = orgId; } /** * ่Žทๅ–ๅ…ณ่”็”ณ่ฏทๅ•id * * @return application_id - ๅ…ณ่”็”ณ่ฏทๅ•id */ public Integer getApplicationId() { return applicationId; } /** * ่ฎพ็ฝฎๅ…ณ่”็”ณ่ฏทๅ•id * * @param applicationId ๅ…ณ่”็”ณ่ฏทๅ•id */ public void setApplicationId(Integer applicationId) { this.applicationId = applicationId; } /** * ่Žทๅ–่ฟ™ๆก่ฎฐๅฝ•ๅค„็†ไบบ(็ฎก็ซ ไบบ)id * * @return keeper_id - ่ฟ™ๆก่ฎฐๅฝ•ๅค„็†ไบบ(็ฎก็ซ ไบบ)id */ public Integer getKeeperId() { return keeperId; } /** * ่ฎพ็ฝฎ่ฟ™ๆก่ฎฐๅฝ•ๅค„็†ไบบ(็ฎก็ซ ไบบ)id * * @param keeperId ่ฟ™ๆก่ฎฐๅฝ•ๅค„็†ไบบ(็ฎก็ซ ไบบ)id */ public void setKeeperId(Integer keeperId) { this.keeperId = keeperId; } /** * ่Žทๅ–ๆŽˆๆƒไบบๅ็งฐ * * @return keeper_name - ๆŽˆๆƒไบบๅ็งฐ */ public String getKeeperName() { return keeperName; } /** * ่ฎพ็ฝฎๆŽˆๆƒไบบๅ็งฐ * * @param keeperName ๆŽˆๆƒไบบๅ็งฐ */ public void setKeeperName(String keeperName) { this.keeperName = keeperName; } /** * ่Žทๅ–ๆ‰€็ฎก็†็š„็ซ  * * @return device_id - ๆ‰€็ฎก็†็š„็ซ  */ public Integer getDeviceId() { return deviceId; } /** * ่ฎพ็ฝฎๆ‰€็ฎก็†็š„็ซ  * * @param deviceId ๆ‰€็ฎก็†็š„็ซ  */ public void setDeviceId(Integer deviceId) { this.deviceId = deviceId; } /** * ่Žทๅ–ๅฐ็ซ ๅ็งฐ * * @return device_name - ๅฐ็ซ ๅ็งฐ */ public String getDeviceName() { return deviceName; } /** * ่ฎพ็ฝฎๅฐ็ซ ๅ็งฐ * * @param deviceName ๅฐ็ซ ๅ็งฐ */ public void setDeviceName(String deviceName) { this.deviceName = deviceName; } /** * ่Žทๅ–1:ๆŽˆๆƒไธญ 2:ๆŽˆๆƒๅŒๆ„ 3:ๆŽˆๆƒๆ‹’็ป 4:ๅทฒๅคฑๆ•ˆ * * @return status - 1:ๆŽˆๆƒไธญ 2:ๆŽˆๆƒๅŒๆ„ 3:ๆŽˆๆƒๆ‹’็ป 4:ๅทฒๅคฑๆ•ˆ */ public Integer getStatus() { return status; } /** * ่ฎพ็ฝฎ1:ๆŽˆๆƒไธญ 2:ๆŽˆๆƒๅŒๆ„ 3:ๆŽˆๆƒๆ‹’็ป 4:ๅทฒๅคฑๆ•ˆ * * @param status 1:ๆŽˆๆƒไธญ 2:ๆŽˆๆƒๅŒๆ„ 3:ๆŽˆๆƒๆ‹’็ป 4:ๅทฒๅคฑๆ•ˆ */ public void setStatus(Integer status) { this.status = status; } /** * ่Žทๅ–ๅฎกๆ‰น่Š‚็‚นid * * @return node_id - ๅฎกๆ‰น่Š‚็‚นid */ public Integer getNodeId() { return nodeId; } /** * ่ฎพ็ฝฎๅฎกๆ‰น่Š‚็‚นid * * @param nodeId ๅฎกๆ‰น่Š‚็‚นid */ public void setNodeId(Integer nodeId) { this.nodeId = nodeId; } /** * ่Žทๅ–ๆ„่งๅค‡ๆณจ * * @return suggest - ๆ„่งๅค‡ๆณจ */ public String getSuggest() { return suggest; } /** * ่ฎพ็ฝฎๆ„่งๅค‡ๆณจ * * @param suggest ๆ„่งๅค‡ๆณจ */ public void setSuggest(String suggest) { this.suggest = suggest; } /** * ่Žทๅ–ๅค„็†ๆ—ถ้—ด * * @return time - ๅค„็†ๆ—ถ้—ด */ public Date getTime() { return time; } /** * ่ฎพ็ฝฎๅค„็†ๆ—ถ้—ด * * @param time ๅค„็†ๆ—ถ้—ด */ public void setTime(Date time) { this.time = time; } /** * @return create_date */ public Date getCreateDate() { return createDate; } /** * @param createDate */ public void setCreateDate(Date createDate) { this.createDate = createDate; } /** * @return update_date */ public Date getUpdateDate() { return updateDate; } /** * @param updateDate */ public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } /** * @return delete_date */ public Date getDeleteDate() { return deleteDate; } /** * @param deleteDate */ public void setDeleteDate(Date deleteDate) { this.deleteDate = deleteDate; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", orgId=").append(orgId); sb.append(", applicationId=").append(applicationId); sb.append(", keeperId=").append(keeperId); sb.append(", keeperName=").append(keeperName); sb.append(", deviceId=").append(deviceId); sb.append(", deviceName=").append(deviceName); sb.append(", status=").append(status); sb.append(", nodeId=").append(nodeId); sb.append(", suggest=").append(suggest); sb.append(", time=").append(time); sb.append(", createDate=").append(createDate); sb.append(", updateDate=").append(updateDate); sb.append(", deleteDate=").append(deleteDate); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
6ceb5f0b5ede6f9255bf423ed529b28038456597
7a720d8496be69fe547a34891b0e49289cc133a2
/src/day07_ForLoop/Q04.java
ac19d6ee615d5535a3d42202f8359c3099caccc6
[]
no_license
yamangokhan/Summer2021Practice
e06300a5acf744e4ac47a0cdf7dccae06db2b896
bb81f7b7d5bae479707c3efe707d062485fe85c2
refs/heads/master
2023-07-31T22:32:58.837266
2021-09-09T20:31:27
2021-09-09T20:31:27
null
0
0
null
null
null
null
ISO-8859-9
Java
false
false
726
java
package day07_ForLoop; import java.util.Scanner; public class Q04 { public static void main(String[] args) { // kullanฤฑcฤฑdan 5 adet sayฤฑ isteyiniz. // bu sayฤฑlardan 5 ile 10 arasฤฑndakiler hariรง diฤŸerlerinin toplamฤฑnฤฑ bulunuz. // bu soruyu continue kullanarak รงรถzรผnรผz. Scanner scan = new Scanner (System.in); int sum= 0; for (int i = 1; i <= 5; i++) { System.out.print("lรผtfen bir sayฤฑ giriniz: "); int sayi = scan.nextInt(); if (sayi>=5 && sayi<10) { System.err.println("GirdiฤŸiniz sayฤฑ 5 ile 10 arasฤฑnda olduฤŸundan toplama yapฤฑlmamaktadฤฑr."); continue; }else { sum+=sayi; } } System.out.println("Sayฤฑlarฤฑn toplamฤฑ : "+sum); scan.close(); } }
9963bdd45ff8d71fabe3c67fe51c99339c7ddc7e
cfa1edcdddfc7ca207009b3951b16fb698481864
/05.Java Blog/src/main/java/softuniBlog/entity/User.java
f4f5c67e3782cc156c8c27599f717c356edf228e
[]
no_license
stanislavkozlovski/software-technologies
8f415c47fc3730de3665f3e6c7dd3c468cdcbc20
4470aa14a59b542b436dfb1c59397b3bea5101c5
refs/heads/master
2021-06-09T04:58:32.649060
2016-11-24T15:32:23
2016-11-24T15:32:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,390
java
package softuniBlog.entity; import org.springframework.data.annotation.*; import javax.persistence.*; import javax.persistence.Id; import javax.persistence.Transient; import java.util.HashSet; import java.util.Set; /** * Created by Netherblood on 11/22/2016. */ @Entity @Table(name = "users") public class User { private Set<Article> articles; private Set<Role> roles; @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name="users_roles") public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } private Integer id; private String email; private String fullName; private String password; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getId() { return id; } @Column(name = "email", unique = true, nullable = false) public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Column(name = "fullName", nullable = false) public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } @Column(name = "password", length = 60,nullable = false) public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public void setId(Integer id) { this.id = id; } @OneToMany(mappedBy = "author") public Set<Article> getArticles() { return articles; } public void setArticles(Set<Article> articles) { this.articles = articles; } public User(String email, String fullName, String password) { this.email = email; this.fullName = fullName; this.password = password; this.roles = new HashSet<>(); this.articles = new HashSet<>(); } public User(){} // BECAUSE JAVA public void addRole(Role role) { this.roles.add(role); } @Transient public boolean isAdmin() { return this.getRoles().stream().anyMatch(role -> role.getName().equals("ROLE_ADMIN")); } @Transient public boolean isAuthor(Article givenArticle) { // MIGHT NOT WORK return this.getId().equals(givenArticle.getAuthor().getId()); } }
c38a0e7358dc3f1164e1396106ec21c14870cbf0
6ad0313f4be5cbc34a0124f4d99a2aef9ce2758d
/app/src/main/java/edu/ggc/it/map/MapActivity.java
16fd998097083114ede4d885ec1f5eaf498f9b67
[]
no_license
SeanBrightman/ggc-connect2
c27320ca11f017ba2bf40ec0b52f67d2e2735a29
35a0ac27df624b5738c99c02a33e55c8ffc1c819
refs/heads/master
2020-12-25T10:42:03.531725
2015-02-08T18:35:11
2015-02-08T18:35:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,535
java
package edu.ggc.it.map; import edu.ggc.it.R; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.PointF; import android.graphics.drawable.Drawable; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.location.LocationProvider; import android.os.Bundle; import android.provider.Settings; import android.util.Log; import android.view.MotionEvent; /** * @author Andrew F. Lynch * <p/> * This class is intended to show the location of the device on GGC Campus. * This class works by getting the GPS data then passing it to a {@link MapActivity} * that has a background image and current location redDot icon the show where the * phone is on campus. */ public class MapActivity extends Activity { private Context context = this; private LocationManager locationManager; private GGCLocationListener ggcLocactionListener; private MapView mapView; /** * MapActivity has an image of GGC that helps users know where they are. */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mapView = new MapView(context); setContentView(mapView); setUpGPS(); } /** * This method is a helper method hand some of the math from MotionEvents. * * @param event * @return float */ private float spaceBetweenTwoFingers(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return (float) Math.sqrt(x * x + y * y); } /** * This method is a helper method hand some of the math from MotionEvents. * * @param event * @return float */ private void midPointBetweenTwoFingers(PointF point, MotionEvent event) { float x = event.getX(0) + event.getX(1); float y = event.getY(0) + event.getY(1); point.set(x / 2, y / 2); } /** * This method sets up the PGS objects and handles the case if the user has not yet turned on the GPS on the device. * * @param void * @return void */ protected void setUpGPS() { locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); final boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!gpsEnabled) { enableLocationSettings();// } LocationProvider provider = locationManager.getProvider(LocationManager.GPS_PROVIDER); ggcLocactionListener = new GGCLocationListener(); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 10, ggcLocactionListener); } /** * This method is called when device dose not have the GPS enabled. It prompts the user to turn on the GPS * and opens up an activity that can turn on the GPS. * * @param void * @return void */ private void enableLocationSettings() { Intent settingsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(settingsIntent); } /** * This method cancels the GPS update request. */ protected void onStop() { super.onStop(); locationManager.removeUpdates(ggcLocactionListener); } @Override public void onBackPressed() { super.onBackPressed(); setContentView(R.layout.activity_empty); if (locationManager != null) locationManager.removeUpdates(ggcLocactionListener); Drawable d = mapView.getBackground(); if (d != null) d.setCallback(null); mapView.setOnTouchListener(null); mapView = null; } /** * This class implements {@link LocationListener} to be able to receive GPS data * it gathers the data then converts the data into meters off set from the center of GGC * it then passed this data to {@link MapView} so it can update the redDot location icon. * * @author andrew */ private class GGCLocationListener implements LocationListener { @Override public void onLocationChanged(Location location) { float lonLong = (float) location.getLongitude(); ; float lat = (float) (float) location.getLatitude(); Log.d("GPS", "lat " + lat + " long " + lonLong); int lon = (int) (lonLong * 1000000); int lati = (int) (lat * 1000000); float longitude = (float) (lon / 1000000.0); float latitude = (float) (lati / 1000000.0); float longOffSet = (float) (84.002993 + longitude); float latiOffSet = (float) (latitude - 33.979813) * -1; //33.981 float metersLonOffSet = (float) (longOffSet * 98000);// 1.409// 30.920 // 92406.653 float metersLatiOffSet = (float) (latiOffSet * 87000);//4.70 // 30.860 // 110921.999 mapView.setRedDotXY(metersLonOffSet, metersLatiOffSet); } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } } }
5b92238a7dbbc309a6fc4f18cf20b1b747cc7ad5
5ad6425e87be9038355d897d10fd91a8821af100
/jc-timer/src/pl/vdl/azbest/timer/gui/SWTTimer.java
c0380e09a6525d586f966149d3290e1894cde255
[]
no_license
azawisza/jc-timer
cbecdfe717932aaa68452771e205304a1ee0819b
b92e0bc3ed5de59d9d75c4e48e30e0a32c017270
refs/heads/master
2020-05-17T07:55:47.077851
2008-12-09T01:01:49
2008-12-09T01:01:49
33,726,111
0
0
null
null
null
null
UTF-8
Java
false
false
16,390
java
/* This file is part of JCTimer JCTimer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. JCTimer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with JCTimer. If not, see <http://www.gnu.org/licenses/>. author: azbest.pro ([email protected]) */ package pl.vdl.azbest.timer.gui; import org.apache.log4j.Logger; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Tray; import org.eclipse.swt.widgets.TrayItem; import org.eclipse.swt.SWT; import pl.vdl.azbest.timer.Conf; import pl.vdl.azbest.timer.cmd.Cmd_CaptureClipboardToFile; import pl.vdl.azbest.timer.cmd.Cmd_blogClipboardContent; import pl.vdl.azbest.timer.cmd.Cmd_blogOpenSettingsWindow; import pl.vdl.azbest.timer.cmd.Cmd_openNewAlarmShell; import pl.vdl.azbest.timer.cmd.Cmd_uiClearTestCollector; import pl.vdl.azbest.timer.cmd.Cmd_uiOpenDataTableShell; import pl.vdl.azbest.timer.cmd.Cmd_uiOpenStatWindow; import pl.vdl.azbest.timer.cmd.Cmd_uiOpenTestSettingsWindow; import pl.vdl.azbest.timer.cmd.Cmd_uiPause; import pl.vdl.azbest.timer.cmd.Cmd_uiRestart; import pl.vdl.azbest.timer.cmd.Cmd_uiSaveToFile; import pl.vdl.azbest.timer.cmd.Cmd_uiStart; import pl.vdl.azbest.timer.cmd.Cmd_uiStop; import pl.vdl.azbest.timer.cmd.Command; import pl.vdl.azbest.timer.cmd.Invoker; import pl.vdl.azbest.timer.cmd.Stop; import pl.vdl.azbest.timer.counter.worker.TestQuestDataCollector; import pl.vdl.azbest.timer.counter.worker.TimeStatistics; import pl.vdl.azbest.timer.gui.composite.Cmp_Buttons; import pl.vdl.azbest.timer.gui.composite.Cmp_Clock; import pl.vdl.azbest.timer.gui.composite.Cmp_progressBar; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; public class SWTTimer extends SWTElement { // private Shell sShell = null; // // @jve:decl-index=0:visual-constraint="282,183" Composite composite1 = null; private Logger logger = Logger.getLogger(getClass().getName()); Composite composite2 = null; Composite composite4 = null; Composite composite5 = null; Composite composite3 = null; private Menu menuBar = null; private Menu submenu = null; /** * This method initializes sShell */ @Override protected void createSShell() { sShell = new Shell(SWT.BORDER | SWT.SHELL_TRIM | SWT.ON_TOP); sShell.setText("JCTimer"); WIN_HEIGHT = 250; WIN_WIDTH = 300; sShell.setSize(new Point(300, 250)); sShell.setLayout(new GridLayout()); menuBar = new Menu(sShell, SWT.BAR); MenuItem submenuItem = new MenuItem(menuBar, SWT.CASCADE); submenuItem.setText("File"); submenu = new Menu(submenuItem); MenuItem check = new MenuItem(submenu, SWT.CHECK); check.setText("RESET button"); MenuItem push1 = new MenuItem(submenu, SWT.PUSH); push1.setText("Save ..."); MenuItem push4 = new MenuItem(submenu, SWT.PUSH); push4.setText("Data browser"); @SuppressWarnings("unused") MenuItem separator1 = new MenuItem(submenu, SWT.SEPARATOR); MenuItem push = new MenuItem(submenu, SWT.PUSH); push.setText("Statistics"); MenuItem push5 = new MenuItem(submenu, SWT.PUSH); push5.setText("02:30 progress bar"); //Cmd_uiClearTestCollector MenuItem push6 = new MenuItem(submenu, SWT.PUSH); push6.setText("Add alarm"); push6 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_openNewAlarmShell(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); push5 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Shl_ProgressBar bar = new Shl_ProgressBar(); bar.openSWTWidget(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); push .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiOpenStatWindow(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); push4 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiOpenDataTableShell(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); submenuItem.setMenu(submenu); check .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Shell_RestartButton.getInstance() .openSWTWidgetSingleton( Conf.getInstance().isRButtonOpened()); Conf.getInstance().setRButtonOpened(true); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); push1 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { FileDialog fd = new FileDialog(sShell, SWT.SAVE); fd.setFilterExtensions(new String[] { ".txt" }); fd.open(); String path = fd.getFilterPath() + System.getProperty("file.separator") + fd.getFileName(); logger.info(path + "\n" + TestQuestDataCollector.getInstance() .getTableDataAsHTMLTable()); Command c = new Cmd_uiSaveToFile(TestQuestDataCollector .getInstance().getTableDataAsHTMLTable(), path); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); sShell.setMenuBar(menuBar); sShell.addShellListener(new org.eclipse.swt.events.ShellAdapter() { @Override public void shellClosed(org.eclipse.swt.events.ShellEvent e) { Stop.perform(); } }); MenuItem push7 = new MenuItem(submenu, SWT.PUSH); push7.setText("Test settings"); push7 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiOpenTestSettingsWindow(); Invoker.getInstance().addCommand(c); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); // Cmd_uiClearTestCollector MenuItem push8 = new MenuItem(submenu, SWT.PUSH); push8.setText("Clear data."); push8 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiClearTestCollector(); Invoker.getInstance().addCommand(c); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); MenuItem push9 = new MenuItem(submenu, SWT.PUSH); push9.setText("Open Blog settings"); push9 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_blogOpenSettingsWindow(); Invoker.getInstance().addCommand(c); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); init(); } private void init() { createComposite2(); createComposite1(); createComposite3(); // createComposite4(); // createComposite5(); lockSWTWidgetSize(); setSWTWidgetPositionCenetr(0, 0); Conf.getInstance().setDisplay(sShell.getDisplay()); GUIFacade.getInstance().setSwTimer(this); tryIt(); } private void createComposite2() { GridData gridData1 = new GridData(); gridData1.horizontalAlignment = GridData.FILL; gridData1.grabExcessHorizontalSpace = true; gridData1.grabExcessVerticalSpace = true; gridData1.verticalAlignment = GridData.FILL; composite2 = new Cmp_Clock(sShell, SWT.NONE); composite2.setLayout(new GridLayout()); composite2.setLayoutData(gridData1); } private void createComposite1() { GridData gridData1 = new GridData(); gridData1.horizontalAlignment = GridData.FILL; gridData1.grabExcessHorizontalSpace = true; gridData1.grabExcessVerticalSpace = true; gridData1.verticalAlignment = GridData.FILL; composite1 = new Cmp_Buttons(sShell, SWT.NONE); composite1.setLayout(new GridLayout()); composite1.setLayoutData(gridData1); } private void createComposite3() { GridData gridData1 = new GridData(); gridData1.horizontalAlignment = GridData.FILL; gridData1.grabExcessHorizontalSpace = true; gridData1.grabExcessVerticalSpace = true; gridData1.verticalAlignment = GridData.FILL; composite3 = new Cmp_progressBar(sShell, SWT.NONE); composite3.setLayout(new GridLayout()); composite3.setLayoutData(gridData1); } private void tryIt() { Tray appTray = display.getSystemTray(); Image trayImg = new Image(display, "tary_icon.gif"); TrayItem item = new TrayItem(appTray, SWT.NONE); item.setImage(trayImg); final Menu menu = new Menu(sShell, SWT.POP_UP); MenuItem menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Open window"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { sShell.setMinimized(false); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.SEPARATOR); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Start"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiStart(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Stop"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiStop(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Pause"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiPause(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Restart"); @SuppressWarnings("unused") MenuItem separator = new MenuItem(menu, SWT.SEPARATOR); MenuItem push2 = new MenuItem(menu, SWT.PUSH); push2.setText("Show stat"); push2 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiOpenStatWindow(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); MenuItem push3 = new MenuItem(menu, SWT.PUSH); push3.setText("Reset stat"); push3 .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { TimeStatistics.getInstance().reset(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command c = new Cmd_uiRestart(); Invoker.getInstance().addCommand(c); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); item.addListener(SWT.MenuDetect, new Listener() { public void handleEvent(Event event) { menu.setVisible(true); } }); item.addListener(SWT.MouseDoubleClick, new Listener() { public void handleEvent(Event event) { menu.setVisible(true); } }); menuItem = new MenuItem(menu, SWT.SEPARATOR); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Restore All"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { sShell.setMinimized(false); GUIFacade.getInstance().maxmizeAll(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Minimalize All"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { sShell.setMinimized(true); GUIFacade.getInstance().minimalizeAll(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Capture image"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command cmd = new Cmd_CaptureClipboardToFile(); Invoker.getInstance().addCommand(cmd); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); menuItem = new MenuItem(menu, SWT.PUSH); menuItem.setText("Blog clippboard content"); menuItem .addSelectionListener(new org.eclipse.swt.events.SelectionListener() { public void widgetSelected( org.eclipse.swt.events.SelectionEvent e) { Command cmd = new Cmd_blogClipboardContent(); Invoker.getInstance().addCommand(cmd); Invoker.getInstance().execute(); } public void widgetDefaultSelected( org.eclipse.swt.events.SelectionEvent e) { } }); } public void settitleClock(String titleClock) { sShell.setText(titleClock); } }
[ "azbest.pro@dfc7f85e-c589-11dd-bdf1-993be837f8bb" ]
azbest.pro@dfc7f85e-c589-11dd-bdf1-993be837f8bb
3f15a9acbd8a0dddf9dc0df50da457cc09aa5d44
1824d246dda152aac0d12a564aa08b48e2c32d08
/src/kernel/abstractions/src/test/java/com/x3platform/digitalNumber/DigitalNumberContextTests.java
59bed6dcbad49eab888f40e38b14422b0bfc60a1
[]
no_license
x3platform/x-general-framework
a73de5b5663a2fa6f655a95789a2881103bf02cd
916e6ae50fcb702784270148a7ead6e9fa3cd5c0
refs/heads/master
2022-07-07T20:18:24.568171
2019-08-11T14:53:23
2019-08-11T14:53:23
106,936,008
0
0
null
2022-06-17T02:24:39
2017-10-14T14:48:15
Java
UTF-8
Java
false
false
1,053
java
package com.x3platform.digitalnumber; import static org.junit.Assert.assertNotNull; 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 DigitalNumberContextTests { @Test public void testLoad() { assertNotNull("DigitalNumberService is not null.", DigitalNumberContext.getInstance().getDigitalNumberService()); } @Test public void testGenerate() { String result = DigitalNumberContext.generate("Key_Guid"); assertNotNull("result is not null.", result); result = DigitalNumberContext.generate("test2"); assertNotNull("result is not null.", result); result = DigitalNumberContext.generate("test3"); assertNotNull("result is not null.", result); } @Test public void testGenerateDailyIncrement() { String result = DigitalNumberContext.generate("test3"); assertNotNull("result is not null.", result); } }
b92820a0ca9f1779972267577a43624bd1344e8d
240b19a46bbbdabfe884117cd1c62313a84463be
/app/src/main/java/com/uni/learningchess/Seccion3Ejerc5.java
984daf3b487ae3e711282ede7c115b7aaf9186c3
[]
no_license
wangzigeng2004/LearningChess
3e5ef1632240dccc30b4d68bff2bc8af4cfc6e8e
fbb145c6cdaccbe0089c819a1561b5b31e6053fb
refs/heads/master
2023-01-19T11:52:53.175905
2020-11-24T08:00:56
2020-11-24T08:00:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,106
java
package com.uni.learningchess; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.AdapterView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; import java.util.Random; import static com.uni.learningchess.Pieza.Color.BLANCO; public class Seccion3Ejerc5 extends Seccion3BaseActivity { Random fila, columna; String[] Columnas = new String[]{"A", "B", "C", "D", "E", "F", "G", "H"}; Spinner spnColumnas, spnFilas; private VistaAvatar avatar; private int filaSeleccionada, columnaSeleccionada, aciertos = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout tablero = findViewById(R.id.tableroSeccio3); tablero.removeView(findViewById(R.id.ejercicio1)); tablero.removeView(findViewById(R.id.ejercicio2)); tablero.removeView(findViewById(R.id.ejercicio3)); tablero.removeView(findViewById(R.id.ejercicio4)); LinearLayout linearLayout = findViewById(R.id.ejercicio5); linearLayout.setVisibility(View.VISIBLE); avatar = getAvatar(); avatar.habla(R.raw.ingresacoordenada); SelecionarUbicacionPieza(); } private void SelecionarUbicacionPieza() { retiraPiezas(); fila = new Random(); filaSeleccionada = fila.nextInt(8);//8 filas columna = new Random(); columnaSeleccionada = columna.nextInt(8);//8 columnas Pieza pieza = new Pieza(randomEnum(Pieza.Tipo.class), randomEnum(Pieza.Color.class), Columnas[columnaSeleccionada] + (filaSeleccionada + 1)); colocaPieza(pieza); colocarColumna(); colocarFila(); TextView tvTitulo = findViewById(R.id.textoSeccion3Ejerc5Titulo); Animation animSequential; animSequential = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.animacion_rotar_elemento); tvTitulo.startAnimation(animSequential); } /** * Metodo para obtener de manera aleatoria un valor del enum recibido. Uso: randomEnum(Clase.Enum.class) * @param clazz El Enum. * @param <T> ?? * @return El enum que agarro de modo aleatorio. */ public static <T extends Enum<?>> T randomEnum(Class<T> clazz){ int x = new Random().nextInt(clazz.getEnumConstants().length); return clazz.getEnumConstants()[x]; } public void colocaPieza(Pieza pieza) { int idImageView = getResources().getIdentifier(pieza.getCoordenada(), "id", getPackageName()); ImageView imageView = findViewById(idImageView); int idDrawablePieza = getDrawablePieza(pieza); imageView.setImageResource(idDrawablePieza); Log.d("Ajedrez", "tipo=" + pieza.getTipo() + " color=" + pieza.getColor() + " coordenada=" + pieza.getCoordenada() + " getResourceName(idImageView)=" + getResources().getResourceName(idImageView)); } public int getDrawablePieza(Pieza pieza) { int idDrawable = 0; if (pieza.getColor() == BLANCO) { switch (pieza.getTipo()) { case PEON: idDrawable = R.drawable.peon_blanco; break; case CABALLO: idDrawable = R.drawable.caballo_blanco; break; case ALFIL: idDrawable = R.drawable.alfil_blanco; break; case TORRE: idDrawable = R.drawable.torre_blanca; break; case DAMA: idDrawable = R.drawable.dama_blanca; break; case REY: idDrawable = R.drawable.rey_blanco; break; } } else { switch (pieza.getTipo()) { case PEON: idDrawable = R.drawable.peon_negro; break; case CABALLO: idDrawable = R.drawable.caballo_negro; break; case ALFIL: idDrawable = R.drawable.alfil_negro; break; case TORRE: idDrawable = R.drawable.torre_negra; break; case DAMA: idDrawable = R.drawable.dama_negra; break; case REY: idDrawable = R.drawable.rey_negro; break; } } return idDrawable; } protected void retiraPiezas() { LinearLayout tabla = findViewById(R.id.tabla); for (int f = 1, iMax = tabla.getChildCount() - 1; f < iMax; f++) { View vista = tabla.getChildAt(f); if (vista instanceof LinearLayout) { LinearLayout linea = (LinearLayout) vista; for (int c = 1, jMax = linea.getChildCount() - 1; c < jMax; c++) { ImageView imagen = (ImageView) linea.getChildAt(c); imagen.setImageDrawable(null); if (esCuadriculaNegra(imagen)) { imagen.setBackgroundResource(R.color.cuadriculaNegra); } else { imagen.setBackgroundResource(R.color.cuadriculaBlanca); } } } } } private void Ejercicio() { String fil = spnFilas.getSelectedItem().toString(); String col = spnColumnas.getSelectedItem().toString(); // si ambos campos tiene texto if (fil.length() == 1 && col.length() == 1) { int NumFila = Integer.parseInt(fil); //verifica repuesta correcta if (NumFila == (filaSeleccionada + 1) && col.equalsIgnoreCase(Columnas[columnaSeleccionada])) { if (aciertos < 1) { avatar.reproduceEfectoSonido(VistaAvatar.EfectoSonido.MOVIMIENTO_CORRECTO); avatar.mueveCejas(VistaAvatar.MovimientoCejas.ARQUEAR); avatar.lanzaAnimacion(VistaAvatar.Animacion.MOVIMIENTO_CORRECTO); avatar.habla(R.raw.ok_has_acertado, new VistaAvatar.OnAvatarHabla() { @Override public void onTerminaHabla() { avatar.reproduceEfectoSonido(VistaAvatar.EfectoSonido.TIC_TAC); empiezaCuentaAtras(); SelecionarUbicacionPieza(); } }); aciertos++; } else { avatar.lanzaAnimacion(VistaAvatar.Animacion.EJERCICIO_SUPERADO); avatar.reproduceEfectoSonido(VistaAvatar.EfectoSonido.EJERCICIO_SUPERADO); avatar.habla(R.raw.excelente_completaste_ejercicios, new VistaAvatar.OnAvatarHabla() { @Override public void onTerminaHabla() { finish(); } }); } } else { avatar.lanzaAnimacion(VistaAvatar.Animacion.MOVIMIENTO_INCORRECTO); avatar.reproduceEfectoSonido(VistaAvatar.EfectoSonido.MOVIMIENTO_INCORRECTO); avatar.mueveCejas(VistaAvatar.MovimientoCejas.FRUNCIR); avatar.habla(R.raw.mal_intenta_otra_vez, new VistaAvatar.OnAvatarHabla() { @Override public void onTerminaHabla() { avatar.reproduceEfectoSonido(VistaAvatar.EfectoSonido.TIC_TAC); empiezaCuentaAtras(); } }); } } } public void colocarColumna() { spnColumnas = findViewById(R.id.spnColumnas_s3e5); spnColumnas.setSelection(0); spnColumnas.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Ejercicio(); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); } public void colocarFila() { spnFilas = findViewById(R.id.spnFilas_s3e5); spnFilas.setSelection(0); spnFilas.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Ejercicio(); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); } @Override public void onResume() { super.onResume(); avatar.reanudar(); } @Override public void onPause() { super.onPause(); } }
266f725f819fc1c78d31727f0d0b6a3c6b4d05eb
2c80e53b332d91c40df6cd04c72b72008cfc97bb
/WhatsChat/src/user/ImageUtil.java
155c4beddec8c4cb8f24bc1ebd55f0e09012cd0d
[]
no_license
16SIC063U/T4-2107-WhatsChat
95b8f2eaec92b1be821f0c9b8abad84fbb693c22
a196640ff099921821474c68fc670f858bce490f
refs/heads/master
2021-04-28T10:33:21.637573
2018-03-01T13:25:53
2018-03-01T13:25:53
122,068,267
0
1
null
null
null
null
UTF-8
Java
false
false
2,441
java
package user; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import javax.imageio.ImageIO; public class ImageUtil { public static String IMAGE_PATH = "users/username_"; // User folder that store other user images public static String getUserFolderPath(String username) { return IMAGE_PATH + username + "/"; } // Delete user folder public static void deleteUserFolder(String username) { File userFolder = new File(getUserFolderPath(username)); String[] entries = userFolder.list(); if (entries != null) { for (String s : entries) { File currentFile = new File(userFolder.getPath(), s); currentFile.delete(); } } userFolder.delete(); } public static File createFile(String fileName, byte[] byteArray) { File file = new File(fileName); try (FileOutputStream fos = new FileOutputStream(fileName)) { fos.write(byteArray); fos.close(); return file; } catch (IOException e) { System.out.println("Unable to create file"); e.printStackTrace(); } return null; } public static byte[] fileToByte(File imgFile) { BufferedImage originalImage; try { originalImage = ImageIO.read(imgFile); int IMG_WIDTH = 512; int IMG_CLAHEIGHT = 512; BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_CLAHEIGHT, BufferedImage.TYPE_INT_RGB); Graphics2D g = resizedImage.createGraphics(); g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_CLAHEIGHT, null); g.dispose(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(resizedImage, "jpg", baos); baos.flush(); byte[] imageInByte = baos.toByteArray(); baos.close(); return imageInByte; } catch (IOException e) { System.out.println("Error reducing image file size"); return null; } } public static File byteToFile(File fileToWrite, byte[] fileByte) { // Write reduced image to file try (FileOutputStream fos = new FileOutputStream(fileToWrite)) { fos.write(fileByte); fos.close(); return fileToWrite; } catch (IOException e) { System.out.println("error reducing file size"); e.printStackTrace(); return null; } } public static File reduceImageSize(File imgFile) { byte[] fileByte = fileToByte(imgFile); if (fileByte == null) { return null; } return byteToFile(imgFile, fileByte); } }
321fd6b4d186baaef5f0ecf73ebb98480b12ffdd
22bd4c76bcb080231fe1b876db5ef2df0c85ab61
/src/main/java/com/jblog/repository/package-info.java
2d2f1d31b92436702ee28880c4870d0b8de2b35d
[]
no_license
olegbezk/jblog
da9d87742cccaaba4433ad5ec897b8608d1585b1
61cb79050f3f91b59d7f3096960c52dc439eb9a9
refs/heads/master
2021-01-25T14:22:38.892073
2018-03-03T12:12:47
2018-03-03T12:12:47
123,688,824
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
/** * Spring Data JPA repositories. */ package com.jblog.repository;
f6df34235caf50f6643614330683b4c2de6a59c7
e6356bebcc294ef7c8af2f828ebdbcf34fb1cf95
/3 survey-handover_mhub@a7072cb1c04/service/src/main/java/com/mainlevel/monitoring/survey/service/model/ResultQuestion.java
b6cd89203a540da54e86918ee89aa0ec302bf3e0
[]
no_license
kondwa/nape-backend
e7a0a9df042a8d2fe3c24ff65e7eb58ae276bb04
3d877a05707177081a0fb14ae0728363261cb74b
refs/heads/master
2023-02-11T02:49:44.226746
2021-01-07T11:11:32
2021-01-07T11:11:32
327,583,710
0
0
null
null
null
null
UTF-8
Java
false
false
667
java
/* * ReportingPeriodDTO.java - v1.0.0 - 17.04.2016 * Copyright 2016, Reiner Hoppe. All rights reserved. */ package com.mainlevel.monitoring.survey.service.model; import java.util.List; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.ToString; /** * Represents one question in survey result. */ @Builder @AllArgsConstructor @NoArgsConstructor @Data @EqualsAndHashCode(callSuper = false) @ToString(callSuper = false) public class ResultQuestion { private String name; private List<ResultAnswer> answers; private List<ResultRow> rows; }
5fe4ed4e07e99d5d3ccdb4dd6e24b9364936e525
20e7ac62e6ae7494ac17d05fc94f5e283e2b93c0
/SistemaKumon/WEB-INF/classes/CambiarAyudante.java
e707a8639b2414deda5417f814f7225c98dd11aa
[]
no_license
schimal12/SistemaKumon
7a83faf36acbcebd0bfa5af57ae2bd4d7e2c12be
b326a8c76c004a06951b06564daeb00a29e62e8f
refs/heads/master
2021-01-01T03:34:39.489922
2016-05-23T21:33:54
2016-05-23T21:33:54
59,520,092
0
0
null
null
null
null
UTF-8
Java
false
false
2,735
java
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; public class CambiarAyudante extends HttpServlet{ public void doGet(HttpServletRequest request,HttpServletResponse response){ try{ String logged = (String) getServletContext().getAttribute("logged"); if(logged != null){ if(logged.equals("false")){ RequestDispatcher dips = getServletContext().getRequestDispatcher("/ayudante.jsp"); if(dips != null){ dips.forward(request,response); } }else{ RequestDispatcher dips = getServletContext().getRequestDispatcher("/error.jsp"); if(dips != null){ dips.forward(request,response); } } }else{ logged = "false"; getServletContext().setAttribute("logged",logged); RequestDispatcher dips = getServletContext().getRequestDispatcher("/ayudante.jsp"); if(dips != null){ dips.forward(request,response); } } }catch(Exception e){ e.printStackTrace(); } } public void doPost(HttpServletRequest request,HttpServletResponse response){ try{ HttpSession sesion = request.getSession(true); String nombre = (String) sesion.getAttribute("nombreAy"); String usuarioA = (String) sesion.getAttribute("usuarioAy"); String fecha = (String) sesion.getAttribute("fechaRegAy"); String horaEnt = request.getParameter("HoraEntradaC"); String horaSal = request.getParameter("HoraSalidaC"); String resultado = ""; String usuario = getServletContext().getInitParameter("usuario"); String pass = getServletContext().getInitParameter("pass"); Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/kumon"; Connection con = DriverManager.getConnection(url,usuario,pass); Statement stat = con.createStatement(); if(!(horaEnt.equals("")) && !(horaSal.equals(""))){ stat.executeUpdate("UPDATE ayudante SET HoraEntrada = \"" + horaEnt + "\", HoraSalida = \"" + horaSal + "\" WHERE Nombre=\"" + nombre + "\" AND Usuario=\"" + usuarioA + "\" AND FechaR=\"" + fecha + "\";"); resultado = "El registro ha sido actualizado."; }else{ resultado = "No ha llenado todos los campos para modificar el registro."; } stat.close(); con.close(); request.setAttribute("resultado", resultado); sesion.setAttribute("buscado", ""); sesion.setAttribute("nombreAy", ""); sesion.setAttribute("usuarioAy", ""); sesion.setAttribute("fechaRegAy", ""); RequestDispatcher disp = getServletContext().getRequestDispatcher("/ayudante.jsp"); if(disp != null){ disp.forward(request,response); } }catch(Exception e){ e.printStackTrace(); } } }
834fc98fb16b73b7d017f3ece53eb821e031d06e
38c1fb1b6289890f7f8da8fe1b9af33170528773
/app/src/androidTest/java/com/example/farmera/ExampleInstrumentedTest.java
c09cfcb308120ccacd6892f74f5b910a2c6539e2
[]
no_license
devika-vinay/Farmera-v1.1.1
93897738b70c68c168871be0a051408afec1849f
3b90c07149084abcf4e9be6f6f1ec40556d80a59
refs/heads/master
2023-05-15T02:17:54.246717
2021-06-01T07:40:33
2021-06-01T07:40:33
372,549,093
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.example.farmera; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.farmera", appContext.getPackageName()); } }
e5792991b970db3c13713dd13c7dea4186721b6e
3a5985651d77a31437cfdac25e594087c27e93d6
/contrib-demo/xacml/netbeans-module/src/xacmlmodule/project/customizer/SEPluginProjectCustomizerModel.java
acad91d40b363c4f5cbb0517c12293344ddfe5a9
[]
no_license
vitalif/openesb-components
a37d62133d81edb3fdc091abd5c1d72dbe2fc736
560910d2a1fdf31879e3d76825edf079f76812c7
refs/heads/master
2023-09-04T14:40:55.665415
2016-01-25T13:12:22
2016-01-25T13:12:33
48,222,841
0
5
null
null
null
null
UTF-8
Java
false
false
4,564
java
/* * SEPluginProjectCustomizerModel.java * */ package xacmlmodule.project.customizer; import java.io.IOException; import javax.swing.ButtonModel; import javax.swing.text.Document; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectManager; import xacmlmodule.project.SEPluginProjectProperties; import org.netbeans.spi.project.support.ant.AntProjectHelper; import org.netbeans.spi.project.support.ant.EditableProperties; import org.netbeans.spi.project.support.ant.PropertyEvaluator; import org.netbeans.spi.project.support.ant.ReferenceHelper; import org.netbeans.spi.project.support.ant.ui.StoreGroup; import org.openide.ErrorManager; import org.openide.filesystems.FileObject; import org.openide.util.Mutex; import org.openide.util.MutexException; /** * * @author chikkala */ public class SEPluginProjectCustomizerModel { private Project mProject; private AntProjectHelper mAntPrjHelper; private ReferenceHelper mRefHelper; private StoreGroup mPrjPropsStore; private Document mSUTargetModel; private Document mSUNameModel; private Document mSUDescModel; private Document mSUZipModel; private ButtonModel mSUZipCompressModel; private Document mBuildFilesExcludesModel; /** Creates a new instance of Customizer UI Model and initializes it */ public SEPluginProjectCustomizerModel(Project project, AntProjectHelper antProjectHelper, ReferenceHelper refHelper) { this.mProject = project; this.mAntPrjHelper = antProjectHelper; this.mRefHelper = refHelper; this.mPrjPropsStore = new StoreGroup(); init(); } public Document getSUTargetModel() { return this.mSUTargetModel; } public Document getSUNameModel() { return this.mSUNameModel; } public Document getSUDescriptionModel() { return this.mSUDescModel; } public Document getSUZipModel() { return this.mSUZipModel; } public ButtonModel getJarCompressModel() { return this.mSUZipCompressModel; } public Document getBuildFilesExcludesModel() { return this.mBuildFilesExcludesModel; } /** Initializes the visual models */ private void init() { // initialize visual models from project properties PropertyEvaluator evaluator = this.mAntPrjHelper.getStandardPropertyEvaluator(); // cutomizer-general this.mSUTargetModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_TARGET_NAME); this.mSUNameModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_NAME); this.mSUDescModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_DESCRIPTION); // customizer-package this.mSUZipModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_ZIP); this.mSUZipCompressModel = this.mPrjPropsStore.createToggleButtonModel( evaluator, SEPluginProjectProperties.JAR_COMPRESS ); this.mBuildFilesExcludesModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.BUILD_FILES_EXCLUDES); } /** Save visual models to project properties and other metadata */ public void save() { try { // Store properties @SuppressWarnings("unchecked") Boolean result = (Boolean) ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction() { final FileObject projectDir = mAntPrjHelper.getProjectDirectory(); public Object run() throws IOException { //TODO: regenreate any project build script and project metadata if required. // store project properties. storeProperties(); return Boolean.TRUE; } }); // and save project if required. if (result == Boolean.TRUE) { ProjectManager.getDefault().saveProject(mProject); } } catch (MutexException e) { ErrorManager.getDefault().notify((IOException)e.getException()); } catch ( IOException ex ) { ErrorManager.getDefault().notify( ex ); } } private void storeProperties() throws IOException { EditableProperties projectProperties = mAntPrjHelper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); this.mPrjPropsStore.store(projectProperties); } }
70809266f44523a62de2a2d00c5382ef5fb7769e
bf10722704842901c7095771c60c3187bbefb7fa
/app/src/main/java/com/example/administrator/testapp/GetBarcodeActivity.java
b394d1d45f0c416691aff76cd4de0e3f14f605b5
[]
no_license
hyeonsulee01/TestApp
9ae5cb9e9f089026f54ed4b50d44bb2928003b94
6ee06417f688c35dcbe945f576d1f754a58028bc
refs/heads/master
2020-04-03T19:12:28.297827
2018-11-16T11:40:36
2018-11-16T11:40:36
155,513,117
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package com.example.administrator.testapp; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; public class GetBarcodeActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } public class BarcodeClass{ } }
e95923483be67ab464bd34b4bd2f16f3eafa8f79
61602d4b976db2084059453edeafe63865f96ec5
/com/umeng/socialize/UmengTool.java
7a5d0a4a5feaf43facc1c772842449dcf52da697
[]
no_license
ZoranLi/thunder
9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0
0778679ef03ba1103b1d9d9a626c8449b19be14b
refs/heads/master
2020-03-20T23:29:27.131636
2018-06-19T06:43:26
2018-06-19T06:43:26
137,848,886
12
1
null
null
null
null
UTF-8
Java
false
false
34,221
java
package com.umeng.socialize; import android.app.AlertDialog.Builder; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.net.Uri; import android.text.TextUtils; import android.widget.Toast; import com.tencent.mm.opensdk.channel.MMessageActV2; import com.umeng.socialize.PlatformConfig.APPIDPlatform; import com.umeng.socialize.bean.SHARE_MEDIA; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; public class UmengTool { private static final char[] HEX_CHAR = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; final class AnonymousClass1 implements OnClickListener { final /* synthetic */ Context val$context; final /* synthetic */ String val$url; AnonymousClass1(String str, Context context) { this.val$url = str; this.val$context = context; } public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface = new Intent(); dialogInterface.setAction("android.intent.action.VIEW"); dialogInterface.setData(Uri.parse(this.val$url)); this.val$context.startActivity(dialogInterface); } } public static void getSignature(Context context) { String packageName = context.getPackageName(); if (TextUtils.isEmpty(packageName)) { Toast.makeText(context, "ๅบ”็”จ็จ‹ๅบ็š„ๅŒ…ๅไธ่ƒฝไธบ็ฉบ๏ผ", 0).show(); return; } try { PackageInfo packageInfo = context.getPackageManager().getPackageInfo(packageName, 64); String signatureDigest = getSignatureDigest(packageInfo); StringBuilder stringBuilder = new StringBuilder("ๅŒ…ๅ๏ผš"); stringBuilder.append(packageName); stringBuilder.append("\n็ญพๅ:"); stringBuilder.append(signatureDigest.toLowerCase()); stringBuilder.append("\nfacebook keyhash:"); stringBuilder.append(facebookHashKey(packageInfo)); showDialog(context, stringBuilder.toString()); } catch (Context context2) { context2.printStackTrace(); } } public static String getCertificateSHA1Fingerprint(PackageInfo packageInfo) { CertificateFactory instance; X509Certificate x509Certificate; InputStream byteArrayInputStream = new ByteArrayInputStream(packageInfo.signatures[0].toByteArray()); try { instance = CertificateFactory.getInstance("X509"); } catch (CertificateException e) { e.printStackTrace(); instance = null; } try { x509Certificate = (X509Certificate) instance.generateCertificate(byteArrayInputStream); } catch (CertificateException e2) { e2.printStackTrace(); x509Certificate = null; } try { return byte2HexFormatted(MessageDigest.getInstance("SHA1").digest(x509Certificate.getEncoded())); } catch (NoSuchAlgorithmException e3) { e3.printStackTrace(); return null; } catch (CertificateEncodingException e4) { e4.printStackTrace(); return null; } } private static String byte2HexFormatted(byte[] bArr) { StringBuilder stringBuilder = new StringBuilder(bArr.length * 2); for (int i = 0; i < bArr.length; i++) { String toHexString = Integer.toHexString(bArr[i]); int length = toHexString.length(); if (length == 1) { StringBuilder stringBuilder2 = new StringBuilder("0"); stringBuilder2.append(toHexString); toHexString = stringBuilder2.toString(); } if (length > 2) { toHexString = toHexString.substring(length - 2, length); } stringBuilder.append(toHexString.toUpperCase()); if (i < bArr.length - 1) { stringBuilder.append(':'); } } return stringBuilder.toString(); } private static java.lang.String facebookHashKey(android.content.pm.PackageInfo r2) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r2 = r2.signatures; Catch:{ NoSuchAlgorithmException -> 0x001e } r0 = r2.length; Catch:{ NoSuchAlgorithmException -> 0x001e } if (r0 <= 0) goto L_0x001e; Catch:{ NoSuchAlgorithmException -> 0x001e } L_0x0005: r0 = 0; Catch:{ NoSuchAlgorithmException -> 0x001e } r2 = r2[r0]; Catch:{ NoSuchAlgorithmException -> 0x001e } r1 = "SHA"; Catch:{ NoSuchAlgorithmException -> 0x001e } r1 = java.security.MessageDigest.getInstance(r1); Catch:{ NoSuchAlgorithmException -> 0x001e } r2 = r2.toByteArray(); Catch:{ NoSuchAlgorithmException -> 0x001e } r1.update(r2); Catch:{ NoSuchAlgorithmException -> 0x001e } r2 = r1.digest(); Catch:{ NoSuchAlgorithmException -> 0x001e } r2 = android.util.Base64.encodeToString(r2, r0); Catch:{ NoSuchAlgorithmException -> 0x001e } return r2; L_0x001e: r2 = 0; return r2; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.facebookHashKey(android.content.pm.PackageInfo):java.lang.String"); } public static void showDialog(Context context, String str) { new Builder(context).setTitle("ๅ‹็›ŸDebugๆจกๅผ่‡ชๆฃ€").setMessage(str).setPositiveButton("ๅ…ณ้—ญ", null).show(); } public static void showDialogWithURl(Context context, String str, String str2) { new Builder(context).setTitle("ๅ‹็›ŸDebugๆจกๅผ่‡ชๆฃ€").setMessage(str).setPositiveButton("ๅ…ณ้—ญ", null).setNeutralButton("่งฃๅ†ณๆ–นๆกˆ", new AnonymousClass1(str2, context)).show(); } public static void getREDICRECT_URL(Context context) { showDialog(context, getStrRedicrectUrl()); } public static String getStrRedicrectUrl() { return ((APPIDPlatform) PlatformConfig.configs.get(SHARE_MEDIA.SINA)).redirectUrl; } public static String getSignatureDigest(PackageInfo packageInfo) { if (packageInfo.signatures.length <= 0) { return ""; } packageInfo = packageInfo.signatures[0]; MessageDigest messageDigest = null; try { messageDigest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return toHexString(messageDigest.digest(packageInfo.toByteArray())); } private static String toHexString(byte[] bArr) { char[] cArr = new char[(bArr.length * 2)]; for (int i = 0; i < bArr.length; i++) { byte b = bArr[i]; int i2 = i * 2; cArr[i2] = HEX_CHAR[(b >>> 4) & 15]; cArr[i2 + 1] = HEX_CHAR[b & 15]; } return new String(cArr); } public static String checkWxBySelf(Context context) { PackageManager packageManager; NameNotFoundException e; String signatureDigest; Class cls; String packageName = context.getPackageName(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(packageName); stringBuilder.append(MMessageActV2.DEFAULT_ENTRY_CLASS_NAME); String stringBuilder2 = stringBuilder.toString(); PackageInfo packageInfo = null; try { packageManager = context.getPackageManager(); try { packageInfo = packageManager.getPackageInfo(packageName, 64); } catch (NameNotFoundException e2) { e = e2; e.printStackTrace(); signatureDigest = getSignatureDigest(packageInfo); cls = Class.forName(stringBuilder2); if (cls == null) { context = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context.append(signatureDigest.toLowerCase()); context.append("\nๅŒ…ๅ๏ผš"); context.append(packageName); context.append("\nๆฒกๆœ‰้…็ฝฎๅพฎไฟกๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return context.toString(); } if (Config.isUmengWx.booleanValue()) { if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } if (!cls.getSuperclass().toString().contains("com.umeng.weixin")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } } else if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } else { if (!cls.getSuperclass().toString().contains("com.umeng.socialize")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } } try { packageManager.getActivityInfo(new ComponentName(context.getPackageName(), stringBuilder2), null); context = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context.append(signatureDigest.toLowerCase()); context.append("\nๅŒ…ๅ๏ผš"); context.append(packageName); context.append("\nActivityๅพฎไฟก้…็ฝฎๆญฃ็กฎ"); return context.toString(); } catch (Context context2) { context2.printStackTrace(); context2 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context2.append(signatureDigest.toLowerCase()); context2.append("\nๅŒ…ๅ๏ผš"); context2.append(packageName); context2.append("\nๆฒกๆœ‰้…็ฝฎๅพฎไฟกๅ›ž่ฐƒactivityๆฒกๆœ‰ๅœจManifestไธญ้…็ฝฎ"); return context2.toString(); } } } catch (NameNotFoundException e3) { e = e3; packageManager = null; e.printStackTrace(); signatureDigest = getSignatureDigest(packageInfo); cls = Class.forName(stringBuilder2); if (cls == null) { if (Config.isUmengWx.booleanValue()) { if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } if (cls.getSuperclass().toString().contains("com.umeng.socialize")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } } else if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } else { if (cls.getSuperclass().toString().contains("com.umeng.weixin")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } } packageManager.getActivityInfo(new ComponentName(context2.getPackageName(), stringBuilder2), null); context2 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context2.append(signatureDigest.toLowerCase()); context2.append("\nๅŒ…ๅ๏ผš"); context2.append(packageName); context2.append("\nActivityๅพฎไฟก้…็ฝฎๆญฃ็กฎ"); return context2.toString(); } context2 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context2.append(signatureDigest.toLowerCase()); context2.append("\nๅŒ…ๅ๏ผš"); context2.append(packageName); context2.append("\nๆฒกๆœ‰้…็ฝฎๅพฎไฟกๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return context2.toString(); } signatureDigest = getSignatureDigest(packageInfo); try { cls = Class.forName(stringBuilder2); if (cls == null) { context2 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context2.append(signatureDigest.toLowerCase()); context2.append("\nๅŒ…ๅ๏ผš"); context2.append(packageName); context2.append("\nๆฒกๆœ‰้…็ฝฎๅพฎไฟกๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return context2.toString(); } if (Config.isUmengWx.booleanValue()) { if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } if (cls.getSuperclass().toString().contains("com.umeng.weixin")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏ็ฒพ็ฎ€็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.weixin.callback.WXCallbackActivity"; } } else if (cls.getSuperclass() != null) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } else { if (cls.getSuperclass().toString().contains("com.umeng.socialize")) { return "WXEntryActivity้…็ฝฎไธๆญฃ็กฎ๏ผŒๆ‚จไฝฟ็”จ็š„ๆ˜ฏๅฎŒๆ•ด็‰ˆ๏ผŒ่ฏทไฝฟWXEntryActivity็ปงๆ‰ฟcom.umeng.socialize.weixin.view.WXCallbackActivity"; } } packageManager.getActivityInfo(new ComponentName(context2.getPackageName(), stringBuilder2), null); context2 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context2.append(signatureDigest.toLowerCase()); context2.append("\nๅŒ…ๅ๏ผš"); context2.append(packageName); context2.append("\nActivityๅพฎไฟก้…็ฝฎๆญฃ็กฎ"); return context2.toString(); } catch (Context context22) { context22.printStackTrace(); context22 = new StringBuilder("่ฏทๆฃ€ๆŸฅๅพฎไฟกๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); context22.append(signatureDigest.toLowerCase()); context22.append("\nๅŒ…ๅ๏ผš"); context22.append(packageName); context22.append("\nๆฒกๆœ‰้…็ฝฎๅพฎไฟกๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return context22.toString(); } } public static void checkWx(Context context) { showDialog(context, checkWxBySelf(context)); } public static String checkSinaBySelf(Context context) { String packageName = context.getPackageName(); try { context = context.getPackageManager().getPackageInfo(packageName, 64); } catch (Context context2) { context2.printStackTrace(); context2 = null; } context2 = getSignatureDigest(context2); StringBuilder stringBuilder; try { if (Class.forName("com.sina.weibo.sdk.share.WbShareTransActivity") == null) { stringBuilder = new StringBuilder("่ฏทๆฃ€ๆŸฅsinaๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); stringBuilder.append(context2.toLowerCase()); stringBuilder.append("\nๅŒ…ๅ๏ผš"); stringBuilder.append(packageName); stringBuilder.append("\nๅ›ž่ฐƒๅœฐๅ€๏ผš"); stringBuilder.append(getStrRedicrectUrl()); stringBuilder.append("\nๆฒกๆœ‰้…็ฝฎๆ–ฐๆตชๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return stringBuilder.toString(); } stringBuilder = new StringBuilder("่ฏทๆฃ€ๆŸฅsinaๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); stringBuilder.append(context2.toLowerCase()); stringBuilder.append("\nๅŒ…ๅ๏ผš"); stringBuilder.append(packageName); stringBuilder.append("\nๅ›ž่ฐƒๅœฐๅ€๏ผš"); stringBuilder.append(getStrRedicrectUrl()); stringBuilder.append("ๆ–ฐๆตช้…็ฝฎๆญฃ็กฎ"); return stringBuilder.toString(); } catch (ClassNotFoundException e) { e.printStackTrace(); stringBuilder = new StringBuilder("่ฏทๆฃ€ๆŸฅsinaๅŽๅฐๆณจๅ†Œ็ญพๅ๏ผš"); stringBuilder.append(context2.toLowerCase()); stringBuilder.append("\nๅŒ…ๅ๏ผš"); stringBuilder.append(packageName); stringBuilder.append("\nๅ›ž่ฐƒๅœฐๅ€๏ผš"); stringBuilder.append(getStrRedicrectUrl()); stringBuilder.append("ๆฒกๆœ‰้…็ฝฎๆ–ฐๆตชๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); return stringBuilder.toString(); } } public static void checkSina(Context context) { showDialog(context, checkSinaBySelf(context)); } public static void checkAlipay(Context context) { String packageName = context.getPackageName(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(packageName); stringBuilder.append(".apshare.ShareEntryActivity"); try { if (Class.forName(stringBuilder.toString()) == null) { showDialog(context, "ๆฒกๆœ‰้…็ฝฎๆ”ฏไป˜ๅฎๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); } else { showDialog(context, "ๆ”ฏไป˜ๅฎ้…็ฝฎๆญฃ็กฎ"); } } catch (ClassNotFoundException e) { showDialog(context, "ๆฒกๆœ‰้…็ฝฎๆ”ฏไป˜ๅฎๅ›ž่ฐƒactivityๆˆ–้…็ฝฎไธๆญฃ็กฎ"); e.printStackTrace(); } } @android.annotation.TargetApi(9) public static java.lang.String checkFBByself(android.content.Context r5) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r0 = ""; r1 = new android.content.ComponentName; Catch:{ NameNotFoundException -> 0x0086 } r2 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x0086 } r3 = "com.umeng.facebook.FacebookActivity"; Catch:{ NameNotFoundException -> 0x0086 } r1.<init>(r2, r3); Catch:{ NameNotFoundException -> 0x0086 } r2 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x0086 } r3 = 0; Catch:{ NameNotFoundException -> 0x0086 } r2.getActivityInfo(r1, r3); Catch:{ NameNotFoundException -> 0x0086 } r1 = new android.content.ComponentName; Catch:{ NameNotFoundException -> 0x0083 } r2 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x0083 } r4 = "com.umeng.facebook.FacebookContentProvider"; Catch:{ NameNotFoundException -> 0x0083 } r1.<init>(r2, r4); Catch:{ NameNotFoundException -> 0x0083 } r2 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x0083 } r2.getProviderInfo(r1, r3); Catch:{ NameNotFoundException -> 0x0083 } r1 = r5.getPackageManager(); Catch:{ Exception -> 0x0080 } r2 = r5.getPackageName(); Catch:{ Exception -> 0x0080 } r3 = 128; // 0x80 float:1.794E-43 double:6.32E-322; Catch:{ Exception -> 0x0080 } r1 = r1.getApplicationInfo(r2, r3); Catch:{ Exception -> 0x0080 } if (r1 == 0) goto L_0x0044; Catch:{ Exception -> 0x0080 } L_0x0037: r1 = r1.metaData; Catch:{ Exception -> 0x0080 } r2 = "com.facebook.sdk.ApplicationId"; Catch:{ Exception -> 0x0080 } r1 = r1.get(r2); Catch:{ Exception -> 0x0080 } if (r1 != 0) goto L_0x0044; Catch:{ Exception -> 0x0080 } L_0x0041: r5 = "ๆฒกๆœ‰ๅœจAndroidManifestไธญ้…็ฝฎfacebook็š„appid"; Catch:{ Exception -> 0x0080 } return r5; L_0x0044: r1 = r5.getResources(); r2 = "facebook_app_id"; r3 = "string"; r4 = r5.getPackageName(); r1 = r1.getIdentifier(r2, r3, r4); if (r1 > 0) goto L_0x0059; L_0x0056: r0 = "ๆฒกๆœ‰ๆ‰พๅˆฐfacebook_app_id๏ผŒfacebook็š„idๅฟ…้กปๅ†™ๅœจstringๆ–‡ไปถไธญไธ”ๅๅญ—ๅฟ…้กป็”จfacebook_app_id"; goto L_0x007f; L_0x0059: r1 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x007b } r5 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x007b } r2 = 64; Catch:{ NameNotFoundException -> 0x007b } r5 = r1.getPackageInfo(r5, r2); Catch:{ NameNotFoundException -> 0x007b } r1 = new java.lang.StringBuilder; Catch:{ NameNotFoundException -> 0x007b } r2 = "facebook ้…็ฝฎๆญฃ็กฎ๏ผŒ่ฏทๆฃ€ๆŸฅfbๅŽๅฐ็ญพๅ:"; Catch:{ NameNotFoundException -> 0x007b } r1.<init>(r2); Catch:{ NameNotFoundException -> 0x007b } r5 = facebookHashKey(r5); Catch:{ NameNotFoundException -> 0x007b } r1.append(r5); Catch:{ NameNotFoundException -> 0x007b } r5 = r1.toString(); Catch:{ NameNotFoundException -> 0x007b } r0 = r5; goto L_0x007f; L_0x007b: r5 = move-exception; r5.printStackTrace(); L_0x007f: return r0; L_0x0080: r5 = "ๆฒกๆœ‰ๅœจAndroidManifestไธญ้…็ฝฎfacebook็š„appid"; return r5; L_0x0083: r5 = "ๆฒกๆœ‰ๅœจAndroidManifest.xmlไธญ้…็ฝฎcom.umeng.facebook.FacebookContentProvider,่ฏท้˜…่ฏปๅ‹็›Ÿๅฎ˜ๆ–นๆ–‡ๆกฃ"; return r5; L_0x0086: r5 = "ๆฒกๆœ‰ๅœจAndroidManifest.xmlไธญ้…็ฝฎcom.umeng.facebook.FacebookActivity,่ฏท้˜…่ฏปๅ‹็›Ÿๅฎ˜ๆ–นๆ–‡ๆกฃ"; return r5; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.checkFBByself(android.content.Context):java.lang.String"); } public static java.lang.String checkQQByself(android.content.Context r5) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r0 = "com.tencent.tauth.AuthActivity"; r1 = "com.tencent.connect.common.AssistActivity"; r2 = com.umeng.socialize.Config.isUmengQQ; r2 = r2.booleanValue(); if (r2 == 0) goto L_0x0010; L_0x000c: r0 = "com.umeng.qq.tencent.AuthActivity"; r1 = "com.umeng.qq.tencent.AssistActivity"; L_0x0010: r2 = new android.content.ComponentName; Catch:{ NameNotFoundException -> 0x00df } r3 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x00df } r2.<init>(r3, r0); Catch:{ NameNotFoundException -> 0x00df } r3 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x00df } r4 = 0; Catch:{ NameNotFoundException -> 0x00df } r3.getActivityInfo(r2, r4); Catch:{ NameNotFoundException -> 0x00df } r0 = new android.content.ComponentName; Catch:{ NameNotFoundException -> 0x00c3 } r2 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x00c3 } r0.<init>(r2, r1); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x00c3 } r2.getActivityInfo(r0, r4); Catch:{ NameNotFoundException -> 0x00c3 } r0 = "android.permission.WRITE_EXTERNAL_STORAGE"; Catch:{ NameNotFoundException -> 0x00c3 } r3 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x00c3 } r0 = r2.checkPermission(r0, r3); Catch:{ NameNotFoundException -> 0x00c3 } if (r0 != 0) goto L_0x003e; Catch:{ NameNotFoundException -> 0x00c3 } L_0x003d: r4 = 1; Catch:{ NameNotFoundException -> 0x00c3 } L_0x003e: if (r4 == 0) goto L_0x00c0; Catch:{ NameNotFoundException -> 0x00c3 } L_0x0040: r0 = new android.content.Intent; Catch:{ NameNotFoundException -> 0x00c3 } r0.<init>(); Catch:{ NameNotFoundException -> 0x00c3 } r2 = "android.intent.action.VIEW"; Catch:{ NameNotFoundException -> 0x00c3 } r0.setAction(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = "android.intent.category.DEFAULT"; Catch:{ NameNotFoundException -> 0x00c3 } r0.addCategory(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = "android.intent.category.BROWSABLE"; Catch:{ NameNotFoundException -> 0x00c3 } r0.addCategory(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = com.umeng.socialize.bean.SHARE_MEDIA.QQ; Catch:{ NameNotFoundException -> 0x00c3 } r2 = com.umeng.socialize.PlatformConfig.getPlatform(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = (com.umeng.socialize.PlatformConfig.APPIDPlatform) r2; Catch:{ NameNotFoundException -> 0x00c3 } if (r2 == 0) goto L_0x00bd; Catch:{ NameNotFoundException -> 0x00c3 } L_0x005e: r3 = r2.appId; Catch:{ NameNotFoundException -> 0x00c3 } r3 = android.text.TextUtils.isEmpty(r3); Catch:{ NameNotFoundException -> 0x00c3 } if (r3 != 0) goto L_0x00bd; Catch:{ NameNotFoundException -> 0x00c3 } L_0x0066: r3 = new java.lang.StringBuilder; Catch:{ NameNotFoundException -> 0x00c3 } r4 = "tencent"; Catch:{ NameNotFoundException -> 0x00c3 } r3.<init>(r4); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r2.appId; Catch:{ NameNotFoundException -> 0x00c3 } r3.append(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = ":"; Catch:{ NameNotFoundException -> 0x00c3 } r3.append(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r3.toString(); Catch:{ NameNotFoundException -> 0x00c3 } r2 = android.net.Uri.parse(r2); Catch:{ NameNotFoundException -> 0x00c3 } r0.setData(r2); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r5.getPackageManager(); Catch:{ NameNotFoundException -> 0x00c3 } r3 = 64; Catch:{ NameNotFoundException -> 0x00c3 } r0 = r2.queryIntentActivities(r0, r3); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r0.size(); Catch:{ NameNotFoundException -> 0x00c3 } if (r2 <= 0) goto L_0x00ba; Catch:{ NameNotFoundException -> 0x00c3 } L_0x0092: r0 = r0.iterator(); Catch:{ NameNotFoundException -> 0x00c3 } L_0x0096: r2 = r0.hasNext(); Catch:{ NameNotFoundException -> 0x00c3 } if (r2 == 0) goto L_0x00b7; Catch:{ NameNotFoundException -> 0x00c3 } L_0x009c: r2 = r0.next(); Catch:{ NameNotFoundException -> 0x00c3 } r2 = (android.content.pm.ResolveInfo) r2; Catch:{ NameNotFoundException -> 0x00c3 } r3 = r2.activityInfo; Catch:{ NameNotFoundException -> 0x00c3 } if (r3 == 0) goto L_0x0096; Catch:{ NameNotFoundException -> 0x00c3 } L_0x00a6: r2 = r2.activityInfo; Catch:{ NameNotFoundException -> 0x00c3 } r2 = r2.packageName; Catch:{ NameNotFoundException -> 0x00c3 } r3 = r5.getPackageName(); Catch:{ NameNotFoundException -> 0x00c3 } r2 = r2.equals(r3); Catch:{ NameNotFoundException -> 0x00c3 } if (r2 == 0) goto L_0x0096; Catch:{ NameNotFoundException -> 0x00c3 } L_0x00b4: r5 = "qq้…็ฝฎๆญฃ็กฎ"; Catch:{ NameNotFoundException -> 0x00c3 } return r5; L_0x00b7: r5 = "qq้…็ฝฎไธๆญฃ็กฎ๏ผŒAndroidManifestไธญAuthActivity็š„dataไธญ่ฆๅŠ ๅ…ฅ่‡ชๅทฑ็š„qqๅบ”็”จid"; return r5; L_0x00ba: r5 = "qq้…็ฝฎไธๆญฃ็กฎ๏ผŒAndroidManifestไธญAuthActivity็š„dataไธญ่ฆๅŠ ๅ…ฅ่‡ชๅทฑ็š„qqๅบ”็”จid"; return r5; L_0x00bd: r5 = "qq้…็ฝฎไธๆญฃ็กฎ๏ผŒๆฒกๆœ‰ๆฃ€ๆต‹ๅˆฐqq็š„id้…็ฝฎ"; return r5; L_0x00c0: r5 = "qq ๆƒ้™้…็ฝฎไธๆญฃ็กฎ๏ผŒ็ผบๅฐ‘android.permission.WRITE_EXTERNAL_STORAGE"; return r5; L_0x00c3: r5 = new java.lang.StringBuilder; r0 = "ๆฒกๆœ‰ๅœจAndroidManifest.xmlไธญๆฃ€ๆต‹ๅˆฐ"; r5.<init>(r0); r5.append(r1); r0 = ",่ฏทๅŠ ไธŠ"; r5.append(r0); r5.append(r1); r0 = ",่ฏฆ็ป†ไฟกๆฏ่ฏทๆŸฅ็œ‹ๅฎ˜็ฝ‘ๆ–‡ๆกฃ."; r5.append(r0); r5 = r5.toString(); return r5; L_0x00df: r5 = new java.lang.StringBuilder; r1 = "ๆฒกๆœ‰ๅœจAndroidManifest.xmlไธญๆฃ€ๆต‹ๅˆฐ"; r5.<init>(r1); r5.append(r0); r1 = ",่ฏทๅŠ ไธŠ"; r5.append(r1); r5.append(r0); r0 = ",ๅนถ้…็ฝฎ<data android:scheme=\"tencentappid\" />,่ฏฆ็ป†ไฟกๆฏ่ฏทๆŸฅ็œ‹ๅฎ˜็ฝ‘ๆ–‡ๆกฃ."; r5.append(r0); r5 = r5.toString(); return r5; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.checkQQByself(android.content.Context):java.lang.String"); } public static java.lang.String checkVKByself(android.content.Context r3) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r0 = r3.getPackageName(); r3 = r3.getPackageManager(); r1 = android.text.TextUtils.isEmpty(r0); if (r1 == 0) goto L_0x0011; L_0x000e: r3 = "ๅŒ…ๅไธบ็ฉบ"; return r3; L_0x0011: r1 = 64; r3 = r3.getPackageInfo(r0, r1); Catch:{ NameNotFoundException -> 0x0032 } r3 = getCertificateSHA1Fingerprint(r3); Catch:{ NameNotFoundException -> 0x0032 } r0 = new java.lang.StringBuilder; Catch:{ NameNotFoundException -> 0x0032 } r1 = "ไฝ ไฝฟ็”จ็š„็ญพๅ๏ผš"; Catch:{ NameNotFoundException -> 0x0032 } r0.<init>(r1); Catch:{ NameNotFoundException -> 0x0032 } r1 = ":"; Catch:{ NameNotFoundException -> 0x0032 } r2 = ""; Catch:{ NameNotFoundException -> 0x0032 } r3 = r3.replace(r1, r2); Catch:{ NameNotFoundException -> 0x0032 } r0.append(r3); Catch:{ NameNotFoundException -> 0x0032 } r3 = r0.toString(); Catch:{ NameNotFoundException -> 0x0032 } return r3; L_0x0032: r3 = "็ญพๅ่Žทๅ–ๅคฑ่ดฅ"; return r3; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.checkVKByself(android.content.Context):java.lang.String"); } public static java.lang.String checkLinkin(android.content.Context r2) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r0 = r2.getPackageName(); r2.getPackageManager(); r0 = android.text.TextUtils.isEmpty(r0); if (r0 == 0) goto L_0x0010; L_0x000d: r2 = "ๅŒ…ๅไธบ็ฉบ"; return r2; L_0x0010: r0 = r2.getPackageManager(); Catch:{ NameNotFoundException -> 0x0031 } r2 = r2.getPackageName(); Catch:{ NameNotFoundException -> 0x0031 } r1 = 64; Catch:{ NameNotFoundException -> 0x0031 } r2 = r0.getPackageInfo(r2, r1); Catch:{ NameNotFoundException -> 0x0031 } r0 = new java.lang.StringBuilder; Catch:{ NameNotFoundException -> 0x0031 } r1 = "้ข†่‹ฑ ้…็ฝฎๆญฃ็กฎ๏ผŒ่ฏทๆฃ€ๆŸฅ้ข†่‹ฑๅŽๅฐ็ญพๅ:"; Catch:{ NameNotFoundException -> 0x0031 } r0.<init>(r1); Catch:{ NameNotFoundException -> 0x0031 } r2 = facebookHashKey(r2); Catch:{ NameNotFoundException -> 0x0031 } r0.append(r2); Catch:{ NameNotFoundException -> 0x0031 } r2 = r0.toString(); Catch:{ NameNotFoundException -> 0x0031 } return r2; L_0x0031: r2 = "็ญพๅ่Žทๅ–ๅคฑ่ดฅ"; return r2; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.checkLinkin(android.content.Context):java.lang.String"); } public static java.lang.String checkKakao(android.content.Context r2) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException */ /* r0 = r2.getPackageName(); r2.getPackageManager(); r0 = android.text.TextUtils.isEmpty(r0); if (r0 == 0) goto L_0x0010; L_0x000d: r2 = "ๅŒ…ๅไธบ็ฉบ"; return r2; L_0x0010: r0 = r2.getPackageManager(); Catch:{ NameNotFoundException -> 0x0031 } r2 = r2.getPackageName(); Catch:{ NameNotFoundException -> 0x0031 } r1 = 64; Catch:{ NameNotFoundException -> 0x0031 } r2 = r0.getPackageInfo(r2, r1); Catch:{ NameNotFoundException -> 0x0031 } r0 = new java.lang.StringBuilder; Catch:{ NameNotFoundException -> 0x0031 } r1 = "kakao ้…็ฝฎๆญฃ็กฎ๏ผŒ่ฏทๆฃ€ๆŸฅkakaoๅŽๅฐ็ญพๅ:"; Catch:{ NameNotFoundException -> 0x0031 } r0.<init>(r1); Catch:{ NameNotFoundException -> 0x0031 } r2 = facebookHashKey(r2); Catch:{ NameNotFoundException -> 0x0031 } r0.append(r2); Catch:{ NameNotFoundException -> 0x0031 } r2 = r0.toString(); Catch:{ NameNotFoundException -> 0x0031 } return r2; L_0x0031: r2 = "็ญพๅ่Žทๅ–ๅคฑ่ดฅ"; return r2; */ throw new UnsupportedOperationException("Method not decompiled: com.umeng.socialize.UmengTool.checkKakao(android.content.Context):java.lang.String"); } public static void checkQQ(Context context) { showDialog(context, checkQQByself(context)); } public static void checkFacebook(Context context) { showDialog(context, checkFBByself(context)); } public static void checkVK(Context context) { showDialog(context, checkVKByself(context)); } }
8468bf4dc1df796f1504a23caf6538cacaeedcab
fb0766429ef0c8179514894aaa404f3bde952da8
/src/zscaler/ExtractReuters.java
8195c371c59d86696dc73b6e1c21cf9764e42aab
[]
no_license
codeitGeek/Practice
b52aeb685c01e35b082578978a2fb661d59d997a
63586347941203e5b011271494d926824dbf956b
refs/heads/master
2020-05-21T12:14:59.480815
2019-09-05T05:33:31
2019-09-05T05:33:31
186,050,034
0
0
null
null
null
null
UTF-8
Java
false
false
8,470
java
package zscaler; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Split the Reuters SGML documents into Simple Text files containing: Title, Date, Dateline, Body */ public class ExtractReuters { private Path reutersDir; private Path outputDir; private Path nonFinOutputDir; List<String> interested_topics; public ExtractReuters(Path reutersDir, Path outputDir, Path nonFinOutputDir ) throws IOException { this.reutersDir = reutersDir; this.outputDir = outputDir; this.nonFinOutputDir=nonFinOutputDir; System.out.println("Deleting all files in " + outputDir); interested_topics=new ArrayList<String>(); addTopics(); } public void addTopics(){ interested_topics.add("earn"); interested_topics.add("income"); interested_topics.add("instal-debt"); interested_topics.add("interest"); interested_topics.add("bop"); interested_topics.add("money-fx"); interested_topics.add("money-supply"); interested_topics.add("trade"); interested_topics.add("cpi"); interested_topics.add("wpi"); interested_topics.add("gnp"); interested_topics.add("reserves"); interested_topics.add("lei"); interested_topics.add("dlr"); interested_topics.add("austdlr"); interested_topics.add("hk"); interested_topics.add("singdlr"); interested_topics.add("nzdlr"); interested_topics.add("can"); interested_topics.add("stg"); interested_topics.add("dmk"); interested_topics.add("yen"); interested_topics.add("sfr"); interested_topics.add("ffr"); interested_topics.add("bfr"); interested_topics.add("dfl"); interested_topics.add("lit"); interested_topics.add("dkr"); interested_topics.add("nkr"); interested_topics.add("skr"); interested_topics.add("mexpeso"); interested_topics.add("cruzado"); interested_topics.add("austral"); interested_topics.add("saudiyal"); interested_topics.add("rand"); interested_topics.add("ringgit"); interested_topics.add("escudo"); interested_topics.add("peseta"); interested_topics.add("drachma"); interested_topics.add("acq"); } public void extract() throws IOException { long count = 0; try (DirectoryStream<Path> stream = Files.newDirectoryStream(reutersDir, "*.sgm")) { for (Path sgmFile : stream) { extractFile(sgmFile); count++; } } if (count == 0) { System.err.println("No .sgm files in " + reutersDir); } } Pattern EXTRACTION_PATTERN = Pattern .compile("<TOPICS>(.*?)</TOPICS>|<BODY>(.*?)</BODY>"); private static String[] META_CHARS = { "&", "<", ">", "\"", "'" }; private static String[] META_CHARS_SERIALIZATIONS = { "&amp;", "&lt;", "&gt;", "&quot;", "&apos;" }; /** * Override if you wish to change what is extracted */ protected void extractFile(Path sgmFile) { try (BufferedReader reader = Files.newBufferedReader(sgmFile, StandardCharsets.UTF_8)) { StringBuilder buffer = new StringBuilder(1024); StringBuilder outBuffer = new StringBuilder(1024); String line = null; int fdocNumber = 0; int ndocNumber = 0; while ((line = reader.readLine()) != null) { // when we see a closing reuters tag, flush the file if (line.indexOf("</REUTERS") == -1) { // Replace the SGM escape sequences buffer.append(line).append(' ');// accumulate the strings for now, // then apply regular expression to // get the pieces, } else { // Extract the relevant pieces and write to a file in the output dir Matcher matcher = EXTRACTION_PATTERN.matcher(buffer); boolean matchFound=false; while (matcher.find()) { for (int i = 1; i <= matcher.groupCount(); i++) { if(i==1){ String match=matcher.group(i); if(match!=null && ! match.isEmpty()){ String topics[]=matcher.group(i).split("</D>"); for(int k=0;k<topics.length;k++){ //String topic=topics[k].substring(1); if(topics[k]!=null && !topics[k].isEmpty()) { String topic=topics[k].substring(3, topics[k].length()); // System.out.println(topic); if(interested_topics.contains(topic)){ matchFound=true; } //outBuffer.append(topic); //outBuffer.append(System.lineSeparator()).append(System.lineSeparator()); } else{//System.out.println("NULL1"); } } } else{ //System.out.println("NULL"); } } else if(i!=1){ if (matcher.group(i) != null ) { outBuffer.append(matcher.group(i)); outBuffer.append(System.lineSeparator()).append(System.lineSeparator()); } } } } String out = outBuffer.toString(); for (int i = 0; i < META_CHARS_SERIALIZATIONS.length; i++) { out = out.replaceAll(META_CHARS_SERIALIZATIONS[i], META_CHARS[i]); } if(matchFound && !out.isEmpty() && out!=null && !out.equals("") && !out.equals("null")){ Path outFile = outputDir.resolve(sgmFile.getFileName() + "-" + (fdocNumber++) + ".txt"); // System.out.println("Writing " + outFile); try (BufferedWriter writer = Files.newBufferedWriter(outFile, StandardCharsets.UTF_8)) { writer.write(out); } outBuffer.setLength(0); buffer.setLength(0); } else if(!matchFound && !out.isEmpty() && out!=null && !out.equals("") && !out.equals("null")){ Path outFile = nonFinOutputDir.resolve(sgmFile.getFileName() + "-" + (ndocNumber++) + ".txt"); // System.out.println("Writing " + outFile); try (BufferedWriter writer = Files.newBufferedWriter(outFile, StandardCharsets.UTF_8)) { writer.write(out); } outBuffer.setLength(0); buffer.setLength(0); } } } } catch (IOException e) { throw new RuntimeException(e); } } public static void main(String[] args) throws Exception { // if (args.length != 2) { // usage("Wrong number of arguments ("+args.length+")"); // return; // } /** * We have to keep on changing the .sgm directory because there is some error in reut2-017 .sgm file which causes an exception . Hence , I have put reut2-001.sgm file in /reut2-001 dir * and so on. */ Path reutersDir = Paths.get("/Users/hemali/Zscaler/reuters21578/reut2-021"); if (!Files.exists(reutersDir)) { usage("Cannot find Path to Reuters SGM files ("+reutersDir+")"); return; } // First, extract to a tmp directory and only if everything succeeds, rename // to output directory. Path outputDir = Paths.get("/Users/hemali/Zscaler/reuters21578txt/fin"); Path nonFinDir = Paths.get("/Users/hemali/Zscaler/reuters21578txt/nonfin"); //if(!Files.exists(outputDir)) //Files.createDirectories(outputDir); //if(!Files.exists(outputDir)) //Files.createDirectories(nonFinDir); ExtractReuters extractor = new ExtractReuters(reutersDir, outputDir,nonFinDir); extractor.extract(); // Now rename to requested output dir //Files.move(outputDir, Paths.get("/Users/hemali/Zscaler/reuters21578txt/fin"), StandardCopyOption.ATOMIC_MOVE); //Files.move(nonFinDir, Paths.get("/Users/hemali/Zscaler/reuters21578txt/nonfin"), StandardCopyOption.ATOMIC_MOVE); } private static void usage(String msg) { System.err.println("Usage: "+msg+" :: java -cp <...> org.apache.lucene.benchmark.utils.ExtractReuters <Path to Reuters SGM files> <Output Path>"); } }
b6c67949d13fbf9c4d5cc4e8e67cc3e2d597042d
eea2cff8e68d6d0010fc5044e4ba0858e67108fc
/app/src/main/java/com/attendance/courses/CoursesActivity.java
3533cc8da705e1e98a15f2ee328311e8d63fbb4e
[ "MIT" ]
permissive
lpq29743/Attendance
22ff39b2dec68e0a05b7782a49f2d0b177d5bac9
49f48b78881ec6803ed2641b231fb2587a910dde
refs/heads/master
2021-01-20T06:53:58.297936
2017-12-19T05:15:14
2017-12-19T05:15:14
83,878,812
5
4
null
null
null
null
UTF-8
Java
false
false
5,970
java
package com.attendance.courses; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.attendance.R; import com.attendance.data.Course; import com.attendance.login.LoginActivity; import com.attendance.coursedetail.CourseDetailActivity; import com.attendance.util.SharedFileUtil; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by peiqin on 7/28/2016. */ public class CoursesActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, SwipeRefreshLayout.OnRefreshListener, CoursesContract.View { @BindView(R.id.empty_tv) TextView mEmptyTv; @BindView(R.id.course_lv) ListView mCourseLv; @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.drawer_layout) DrawerLayout drawer; @BindView(R.id.nav_view) NavigationView navigationView; @BindView(R.id.refresh_layout) SwipeRefreshLayout mSwipeRefreshLayout; private CoursesAdapter coursesAdapter; private SharedFileUtil sharedFileUtil; private CoursesContract.Presenter presenter; @Override protected void onPrepareDialog(int id, Dialog dialog, Bundle args) { super.onPrepareDialog(id, dialog, args); } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initView(); presenter = new CoursesPresenter(this); presenter.getCourseList(); } private void initView() { ButterKnife.bind(this); toolbar.setTitle(R.string.course_list); setSupportActionBar(toolbar); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); if (drawer != null) drawer.addDrawerListener(toggle); toggle.syncState(); navigationView.setNavigationItemSelectedListener(this); View headerLayout = navigationView.getHeaderView(0); sharedFileUtil = new SharedFileUtil(); String username = sharedFileUtil.getString("username"); ((TextView) headerLayout.findViewById(R.id.name_tv)).setText(R.string.fake_teacher);; ((TextView) headerLayout.findViewById(R.id.username_tv)).setText(username); initContentView(); } private void initContentView() { initSwipeLayout(); initListView(); } private void initSwipeLayout() { mSwipeRefreshLayout.setOnRefreshListener(this); mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); mSwipeRefreshLayout.setDistanceToTriggerSync(200); mSwipeRefreshLayout.setSize(SwipeRefreshLayout.DEFAULT); } private void initListView() { coursesAdapter = new CoursesAdapter(this); mCourseLv.setAdapter(coursesAdapter); mEmptyTv.setText(getString(R.string.teacher_add_course)); mCourseLv.setEmptyView(mEmptyTv); //ListView็‚นๅ‡ปไบ‹ไปถ mCourseLv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String courseName = ((Course) coursesAdapter.getItem(position)).getName(); Intent intent = new Intent(CoursesActivity.this, CourseDetailActivity.class); intent.putExtra("name", courseName); startActivityForResult(intent, 0); } }); } @Override public void onRefresh() { presenter.getCourseList(); } @Override public void setPresenter(CoursesContract.Presenter presenter) { this.presenter = presenter; } @Override public void showTip(String tip) { Toast.makeText(this, tip, Toast.LENGTH_SHORT).show(); } @Override public void startRefresh() { mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(true); } }); } @Override public void stopRefresh() { mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(false); } }); } @Override public void getCourseSuccess() { coursesAdapter.setCourseList(); coursesAdapter.notifyDataSetChanged(); } @Override public void onBackPressed() { if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.logout) { sharedFileUtil.putBoolean("hasLogin", false); Intent intent = new Intent(this, LoginActivity.class); startActivity(intent); finish(); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } drawer.closeDrawer(GravityCompat.START); return true; } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { presenter.getCourseList(); } }
063933130f573687710315d9d49f6d7a8e324d37
571b9a1a41f6794413821754d05abb593588df2a
/src/poovistaPropia/fraseChar.java
047a9e2a4e0910aadaec2ecd97286226a8873422
[]
no_license
cibertp/poo-de-todo
575b59c6f28c66fa70e740ce088fbca7673b38d5
2c445aa827d0b018dfdf0d7b533de7dc4917d704
refs/heads/master
2021-01-22T08:19:19.040480
2017-02-14T04:19:08
2017-02-14T04:19:08
81,893,100
0
0
null
null
null
null
UTF-8
Java
false
false
4,180
java
package poovistaPropia; import javax.swing.JOptionPane; /** * * @author Cibert_Poet */ public class fraseChar extends javax.swing.JInternalFrame { public fraseChar() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); txtfrase = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); btnSalir = new javax.swing.JButton(); jLabel1.setText("frases"); jButton1.setText("calcular"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); btnSalir.setText("salir"); btnSalir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSalirActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(67, 67, 67) .addComponent(jLabel1) .addGap(87, 87, 87) .addComponent(txtfrase, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 50, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGap(127, 127, 127) .addComponent(jButton1) .addGap(47, 47, 47) .addComponent(btnSalir) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(24, 24, 24) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtfrase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(btnSalir)) .addContainerGap(25, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try { //declaracion de las varibles String frase = ""; char caracter[] = new char[frase.length()]; frase = txtfrase.getText(); for (int i = 0; i < frase.length(); i++) { caracter[i] = frase.charAt(i); //cada carater de la fras= con charat decimos dame la posicion de i // System.out.println(caracter[i]); // txtMensaje.setText(Character.toString( caracter[i])); JOptionPane.showMessageDialog(this, caracter[i]); } } catch (Exception e) { System.out.println(""+e.getMessage()); } }//GEN-LAST:event_jButton1ActionPerformed private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed this.dispose(); }//GEN-LAST:event_btnSalirActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnSalir; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JTextField txtfrase; // End of variables declaration//GEN-END:variables }
[ "Cibert_Poet@CIBERT_POET" ]
Cibert_Poet@CIBERT_POET
974c829a21ccfdb0b572423558454d79e0e323fd
38610ac1caf50647ad391a27d653d7a724e73905
/src/main/test/ua/training/model/dao/implementation/JDBCUserDaoTest.java
0c2477c5ccd102cccaf32445c4173dcfc2925b7f
[]
no_license
Dean4iq/Railway-ticket-office
dc0d6b8941d473f516c8b9769ebd2537d2a0dfb9
ce6d27d0fccae098e41dad96754ed7969dbbe134
refs/heads/master
2020-04-13T11:13:36.773445
2019-01-12T22:58:22
2019-01-12T22:58:22
163,167,933
0
0
null
null
null
null
UTF-8
Java
false
false
2,877
java
package ua.training.model.dao.implementation; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; import ua.training.model.dao.UserDao; import ua.training.model.entity.User; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.when; public class JDBCUserDaoTest { @Mock Connection connection = Mockito.mock(Connection.class); @Mock ResultSet resultSet = Mockito.mock(ResultSet.class); @Mock PreparedStatement preparedStatement = Mockito.mock(PreparedStatement.class); private UserDao userDao; private User user1; private User user2; @Before public void setUp() throws Exception { user1 = new User(); user2 = null; user1.setLogin("WillWillSmithSmith"); user1.setPassword("WillSmith"); user1.setName("Will"); user1.setLastName("Smith"); user1.setNameUA("ะฃั–ะปะป"); user1.setLastNameUA("ะšะพะฒะฐะปัŒ"); user1.setAdmin(false); when(connection.prepareStatement(anyString())).thenReturn(preparedStatement); when(preparedStatement.executeUpdate()).thenReturn(1); when(preparedStatement.executeQuery()).thenReturn(resultSet); when(resultSet.next()).thenReturn(true).thenReturn(true).thenReturn(false); when(resultSet.getString("login")).thenReturn(user1.getLogin()); when(resultSet.getString("password")).thenReturn(user1.getPassword()); when(resultSet.getString("name")).thenReturn(user1.getName()); when(resultSet.getString("last_name")).thenReturn(user1.getLastName()); when(resultSet.getString("name_ua")).thenReturn(user1.getNameUA()); when(resultSet.getString("last_name_ua")).thenReturn(user1.getLastNameUA()); when(resultSet.getBoolean("admin")).thenReturn(user1.isAdmin()); userDao = new JDBCUserDao(connection); } @Test(expected = IllegalArgumentException.class) public void createWithIllegalArgument() throws SQLException { userDao.create(user2); } @Test public void findById() { User user = userDao.findById("CrocodileMan"); assertEquals(user1, user); } @Test public void findAllNotEmpty() { List<User> userList = userDao.findAll(); assertTrue(userList.size() > 0); } @Test public void findAllExactlySize() { List<User> userList = userDao.findAll(); assertEquals(2, userList.size()); } @Test public void findAll() { List<User> userList = userDao.findAll(); assertEquals(userList.get(0), user1); } }
bd22b9fb660f8d1e83551a9fa45c7b02dba5ac15
1c56595e54e3a785ea36d932613146015396c008
/springframework_3_0_hanb_978-89-7914-887-9/ch01-01/src/main/java/sample2/MessageBeanEn.java
6df438b58563e1ea0426f0e701d33bb87a6fc2d9
[]
no_license
movingmt/insideofbook
32f1aa0375e39cdfe1142ac3cf0aecc3fb05f6f8
f4332bb2cfa663cebfce7d8a50d8c2d0c38b0b54
refs/heads/master
2021-01-18T19:58:57.963612
2014-11-12T06:23:44
2014-11-12T06:23:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
164
java
package sample2; public class MessageBeanEn implements MessageBean { @Override public String sayHello(String ์ด๋ฆ„) { return "Hello, " + ์ด๋ฆ„ + "!"; } }
bf527547a89bba04e15acae455300f77b6c195ff
7202404a858cce43c0d16b13b2dd97d389bca7dd
/src/main/java/com/jiechuang/wx/service/impl/OrderServiceImpl.java
3b04e37f752f078d89f9175ed6fa8fbf87155a98
[]
no_license
jsjdsplj/WX
ac2f9e5dfebe926f3b9489006e390f108bedf115
bd13a54cb230e499fad5b13ac7d1917e66a07f5e
refs/heads/master
2021-08-31T03:59:01.232870
2017-12-20T08:53:40
2017-12-20T08:53:40
114,864,954
0
0
null
null
null
null
UTF-8
Java
false
false
8,561
java
package com.jiechuang.wx.service.impl; import com.jiechuang.wx.converter.OrderMastertoOrderDTOConvert; import com.jiechuang.wx.dao.OrderDetaildao; import com.jiechuang.wx.dao.OrderMasterdao; import com.jiechuang.wx.dataobject.OrderDetail; import com.jiechuang.wx.dataobject.OrderMaster; import com.jiechuang.wx.dataobject.ProductInfo; import com.jiechuang.wx.dto.CartDTO; import com.jiechuang.wx.dto.OrderDTO; import com.jiechuang.wx.enums.OrderStatusEnum; import com.jiechuang.wx.enums.PayStatusEnum; import com.jiechuang.wx.enums.ResulEnum; import com.jiechuang.wx.exception.SellException; import com.jiechuang.wx.service.OrderService; import com.jiechuang.wx.service.ProductService; import com.jiechuang.wx.service.WebSocket; import com.jiechuang.wx.util.KeyUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.stream.Collector; import java.util.stream.Collectors; /** * @Author: lijie * @Date: 12:33 2017/11/5 */ @Service @Slf4j public class OrderServiceImpl implements OrderService{ @Autowired private ProductService productService; @Autowired private OrderDetaildao orderDetaildao; @Autowired private OrderMasterdao orderMasterdao; @Autowired private WebSocket webSocket; //@Autowired //private PushMessageImpl pushMessage; @Override @Transactional public OrderDTO create(OrderDTO orderDTO) { String orderId=KeyUtil.genUniqueKey(); BigDecimal orderAmount=new BigDecimal(BigInteger.ZERO); //1.ๆŸฅ่ฏขๅ•†ๅ“๏ผˆๆ•ฐ้‡๏ผŒไปทๆ ผ๏ผ‰ for(OrderDetail orderDetail:orderDTO.getOrderDetailList()){ ProductInfo productInfo= productService.findOne(orderDetail.getProductId()); if(productInfo==null){ throw new SellException(ResulEnum.product_not_exist); } //2.่ฎก็ฎ—ๆ€ปไปท orderAmount=productInfo.getProductPrice() .multiply(new BigDecimal(orderDetail.getProductQuantity())) .add(orderAmount); //3.่ฎขๅ•่ฏฆๆƒ…ๅ…ฅๅบ“ orderDetail.setDetailId(KeyUtil.genUniqueKey()); orderDetail.setOrderId(orderId); BeanUtils.copyProperties(productInfo,orderDetail); orderDetaildao.save(orderDetail); } //3.่ฎขๅ•ๆ‰€ๆœ‰ๅ…ฅๅบ“๏ผˆOrderMaster) OrderMaster orderMaster=new OrderMaster(); orderDTO.setOrderId(orderId); BeanUtils.copyProperties(orderDTO,orderMaster); orderMaster.setOrderAmount(orderAmount); orderMasterdao.save(orderMaster); //4.ๆ‰ฃๅบ“ๅญ˜ List<CartDTO> cartDTOList= orderDTO.getOrderDetailList().stream().map(e -> new CartDTO(e.getProductId(),e.getProductQuantity())) .collect(Collectors.toList()); productService.decreaseStock(cartDTOList); //ๅ‘้€websocketๆถˆๆฏ webSocket.sendMessage(orderDTO.getOrderId()); return orderDTO; } @Override public OrderDTO findOne(String orderId) { OrderMaster orderMaster=orderMasterdao.findOne(orderId); if(orderMaster==null){ throw new SellException(ResulEnum.ORDER_NOT_EXIST); } List<OrderDetail> orderDetailList=orderDetaildao.findByOrderId(orderId); if(CollectionUtils.isEmpty(orderDetailList)){ throw new SellException(ResulEnum.ORDERDETAIL_NOT_EXIT); } OrderDTO orderDTO=new OrderDTO(); BeanUtils.copyProperties(orderMaster,orderDTO); orderDTO.setOrderDetailList(orderDetailList); return orderDTO; } @Override public Page<OrderDTO> findList(String buyerOpenid, Pageable pageable) { Page<OrderMaster> orderMasterPage=orderMasterdao.findByBuyerOpenid(buyerOpenid,pageable); List<OrderDTO> orderDTOList=OrderMastertoOrderDTOConvert.convert(orderMasterPage.getContent()); return new PageImpl<OrderDTO>(orderDTOList,pageable,orderMasterPage.getTotalElements()); } @Override @Transactional public OrderDTO cancel(OrderDTO orderDTO) { OrderMaster orderMaster=new OrderMaster(); //ๅˆคๆ–ญ่ฎขๅ•็š„็Šถๆ€ if(!orderDTO.getOrderStatus().equals(OrderStatusEnum.NEW.getCode())){ log.error("ใ€ๅ–ๆถˆ่ฎขๅ•ใ€‘orderId={},orderStatus={}",orderDTO.getOrderId(),orderDTO.getOrderStatus()); throw new SellException(ResulEnum.ORDER_STATUS_ERROR); } //ไฟฎๆ”น่ฎขๅ•็Šถๆ€ orderDTO.setOrderStatus(OrderStatusEnum.CANCEL.getCode()); BeanUtils.copyProperties(orderDTO,orderMaster); OrderMaster updateResult=orderMasterdao.save(orderMaster); if(updateResult==null){ log.error("ใ€ๅ–ๆถˆ่ฎขๅ•ใ€‘ๆ›ดๆ–ฐๅคฑ่ดฅ๏ผŒoderMaster={}",orderMaster); throw new SellException(ResulEnum.ORDER_UPDATE_FAIL); } //่ฟ”่ฟ˜ๅบ“ๅญ˜ if(CollectionUtils.isEmpty(orderDTO.getOrderDetailList())){ log.error("ใ€ๅ–ๆถˆ่ฎขๅ•ใ€‘ๆ— ๅ•†ๅ“่ฏฆๆƒ…๏ผŒodderDTO={}",orderDTO); throw new SellException(ResulEnum.ORDER_DETAIL_EMPTY); } List<CartDTO> cartDTOList=orderDTO.getOrderDetailList().stream() .map(e->new CartDTO(e.getProductId(),e.getProductQuantity())) .collect(Collectors.toList()); productService.increaseStock(cartDTOList); //ๅฆ‚ๆžœๅทฒๆ”ฏไป˜ๅˆ™้€€ๆฌพ if(orderDTO.getPayStatus().equals(PayStatusEnum.SUCCESS.getCode())){ //TODO } return orderDTO; } @Override @Transactional public OrderDTO finish(OrderDTO orderDTO) { //ๅˆคๆ–ญ่ฎขๅ•็Šถๆ€ if(!orderDTO.getPayStatus().equals(OrderStatusEnum.NEW.getCode())){ log.error("ใ€ๅฎŒ็ป“่ฎขๅ•ใ€‘่ฎขๅ•็Šถๆ€ไธๆญฃ็กฎ๏ผŒorderId={},orderStatus={}",orderDTO.getOrderId(),orderDTO.getOrderStatus()); throw new SellException(ResulEnum.ORDER_STATUS_ERROR); } //ไฟฎๆ”น่ฎขๅ•็Šถๆ€ orderDTO.setOrderStatus(OrderStatusEnum.FINISHED.getCode()); OrderMaster orderMaster=new OrderMaster(); BeanUtils.copyProperties(orderDTO,orderMaster); OrderMaster updateResult=orderMasterdao.save(orderMaster); if(updateResult==null){ log.error("ใ€ๅฎŒ็ป“่ฎขๅ•ใ€‘ๆ›ดๆ–ฐๅคฑ่ดฅ๏ผŒorderMaster={}",orderMaster); throw new SellException(ResulEnum.ORDER_UPDATE_FAIL); } //่ฟ™้‡Œ็š„ๅผ‚ๅธธ็›ดๆŽฅ่ขซๆ•ๆ‰ไบ†๏ผŒไธ่ขซๆŠ›ๅ‡บ๏ผŒไธไผšๅ›žๆปš // pushMessage.orderStatus(orderDTO); return orderDTO; } @Override @Transactional public OrderDTO paid(OrderDTO orderDTO) { //ๅˆคๆ–ญ่ฎขๅ•็Šถๆ€ if(!orderDTO.getOrderStatus().equals(OrderStatusEnum.NEW.getCode())){ log.error("ใ€่ฎขๅ•ๆ”ฏไป˜ใ€‘่ฎขๅ•็Šถๆ€ไธๆญฃ็กฎ๏ผŒorderId={},orderStatus={}",orderDTO.getOrderId(),orderDTO.getOrderStatus()); throw new SellException(ResulEnum.ORDER_STATUS_ERROR); } //ๅˆคๆ–ญๆ”ฏไป˜็Šถๆ€ if(!orderDTO.getPayStatus().equals(PayStatusEnum.WAIT.getCode())){ log.error("ใ€่ฎขๅ•ๆ”ฏไป˜ใ€‘่ฎขๅ•ๆ”ฏไป˜็Šถๆ€ไธๆญฃ็กฎ๏ผŒorderDTO={}",orderDTO); throw new SellException(ResulEnum.ORDER_PAY_STATUS_ERROR); } //ไฟฎๆ”นๆ”ฏไป˜็Šถๆ€ orderDTO.setPayStatus(PayStatusEnum.SUCCESS.getCode()); OrderMaster orderMaster=new OrderMaster(); BeanUtils.copyProperties(orderDTO,orderMaster); OrderMaster updateResult=orderMasterdao.save(orderMaster); if(updateResult==null){ log.error("ใ€่ฎขๅ•ๆ”ฏไป˜ใ€‘ๆ›ดๆ–ฐๅคฑ่ดฅ๏ผŒorderMaster={}",orderMaster); throw new SellException(ResulEnum.ORDER_UPDATE_FAIL); } return orderDTO; } @Override public Page<OrderDTO> findList(Pageable pageable) { Page<OrderMaster> orderMasterPage=orderMasterdao.findAll(pageable); List<OrderDTO> orderDTOList=OrderMastertoOrderDTOConvert.convert(orderMasterPage.getContent()); return new PageImpl<>(orderDTOList,pageable,orderMasterPage.getTotalElements()); } }
d5afcf23b3087842eba185543db17919d93ce230
c8aa57d1eb4590621a99ba7d7d278d98b2524bd3
/src/main/java/tools/Size.java
91579d25666db7497bfc1f004e5c543d606635e1
[]
no_license
VSergey/SpeedTestJavaCollections
f8b8fa03d74f7d48cd9d24d02a0eba774b8ab80b
83414ad2f443ceda477fb4417a42e262c555fb66
refs/heads/master
2021-01-11T21:17:55.570025
2017-03-21T14:40:23
2017-03-21T14:40:23
78,759,193
1
0
null
null
null
null
UTF-8
Java
false
false
141
java
package tools; import java.lang.annotation.*; @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Size { }
406145f039e392ffd9c5f55c58af8bf945f71743
7855b0ebb3ff8fbc9a99d1da385728d60f48dd9f
/src/main/java/lt/justassub/adventofcode/year2020/day19/Day19.java
1bd2c84280efce904d89eee7d325f677845d1e7a
[]
no_license
justassub/Advent-Of-Code-2020-Java
906893afb5e56c2bf23f8f36cabf896384b2ce26
05b7144f23cfca4f9b48d65269d8c34802d66e77
refs/heads/master
2023-02-05T13:57:20.204905
2020-12-25T09:07:46
2020-12-25T09:07:46
323,270,377
0
0
null
2020-12-25T09:07:47
2020-12-21T08:07:15
Java
UTF-8
Java
false
false
1,474
java
package lt.justassub.adventofcode.year2020.day19; import lt.justassub.adventofcode.year2020.Main2020; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; public class Day19 extends Main2020<String, String, Long, Long> { @Override protected Long part1(String input) { String[] splitInput = input.split( "\n" + "\n"); List<String> messages = Stream.of(splitInput[1].split("\n")).collect(Collectors.toList()); String validators = splitInput[0]; Map<Long, MessageValidator> rules = Day19Util.fillRulesWithInformation(validators); MessageValidator validatorZero = rules.get(0L); long count = 0; for (String message : messages) { try { String answer = validatorZero.validate(message); if (validatorZero.validate(message) != null && answer.equals("")) { count++; } } catch (NotValidException e) { throw new RuntimeException("Should not happen"); } } return count; } @Override protected Long part2(String input) { return null; } public static void main(String[] args) { Day19 day19 = new Day19(); String content = day19.getFileContent().collect(Collectors.joining("\n")); System.out.println(day19.part1(content)); } }
efc40bd9bd33ef2ab58b26b9a06f59d77955facc
5ef920e429de134936ebdd010f78855456217a54
/app/src/main/java/com/java/unnamedbookproject/model/Book.java
7cf5f06d98c49c6ccbe7ab25ede2ca8889ca81cc
[]
no_license
EkaterinaMitrofanova/BookProject
59374073cb710815e03f859133ac0c3f57a0720c
4ea9842ce16a2821b3b0ce535e7de53c3db8ea65
refs/heads/master
2021-01-01T04:43:25.094682
2017-07-18T16:04:23
2017-07-18T16:04:23
97,234,856
0
0
null
null
null
null
UTF-8
Java
false
false
1,873
java
package com.java.unnamedbookproject.model; import java.io.Serializable; import java.util.List; public class Book implements Serializable{ private String id; private String cover = ""; private String name; private String link; private String price; private String author; private List<Comment> comments = null; public Book() { } public Book(String id, String cover, String name, String link, String price) { this.id = id; this.cover = cover; this.name = name; this.link = link; this.price = price; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getCover() { return cover; } public void setCover(String cover) { this.cover = cover; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public List<Comment> getComments() { return comments; } public void setComments(List<Comment> comments) { this.comments = comments; } @Override public String toString() { return "bookProject.Book{" + "id='" + id + '\'' + ", cover='" + cover + '\'' + ", name='" + name + '\'' + ", link='" + link + '\'' + ", price='" + price + '\'' + '}'; } }
f76bff144b6c89b42cec162d3f6999a09470ad77
4b0ea2403b197bab0639258275274bc7c5117df5
/code/entity/m/MTeamMonthlyReports.java
b0111058010ebd8cf50541f02f2a94c75398c042
[]
no_license
zhouxiupeng/AutoCodeByTableStructure
581666814d4f9af9264f7b96e5933b72958a25d3
84eaa43f88cbbbb27645f978b1bf9bc59d83f3c4
refs/heads/master
2021-09-17T20:20:39.369814
2018-07-05T00:27:09
2018-07-05T00:27:09
114,629,066
1
0
null
null
null
null
UTF-8
Java
false
false
6,371
java
package com.yundong.m1_core.entity; import java.util.Date; import java.io.Serializable; /** * ใ€็ฎก็†ๅ›ข้˜Ÿๆฏๆœˆ็š„็ปŸ่ฎกใ€‘ๆŒไน…ๅŒ–ๅฏน่ฑก ๆ•ฐๆฎๅบ“่กจ๏ผšm_team_monthly_reports * * @author ไปฃ็ ่‡ชๅŠจ็”Ÿๆˆ [email protected] * @date 2018-04 * */ public class MTeamMonthlyReports implements Serializable { public static final long serialVersionUID = 1L; // private Long muid; // ๅฝ’ๆกฃๆ—ถ้—ด[yyyyMM] private String archivingTime; // ๅˆ›ๅปบๆ—ถ้—ด private Date createTime; // ไธŠไผ ๆ•ฐ้‡ private Long uploadCount; // ไธ‹่ฝฝๆ•ฐ private Long downloadCount; // ็ญ”่ฐขไบบๆ•ฐ private Integer thanksNumber; // ็ญ”่ฐข้‡‘้ข private Long thanksAmount; // ๆ”ถ็›Š private Long profitAll; // ๅŸน่‚ฒๅฅ–้‡‘ private Long cultivationAmount; // ่พ…ๅฏผๆดฅ่ดด private Long coachAmount; // ๆˆๆ•ˆๅฅ–้‡‘ private Long resultsAmount; // ๆดปๅŠจไบบๅŠ› private Integer activeManpower; // ไธ€ไปฃๅŸน่‚ฒไบบ private Integer oneTrainingEducation; // ไธคไปฃๅŸน่‚ฒไบบ private Integer twoTrainingEducation; /** ่Žทๅ– */ public Long getMuid() { return muid; } /** ่ฎพ็ฝฎ */ public void setMuid(Long muid) { this.muid = muid; } /** ่Žทๅ– ๅฝ’ๆกฃๆ—ถ้—ด[yyyyMM] */ public String getArchivingTime() { return archivingTime; } /** ่ฎพ็ฝฎ ๅฝ’ๆกฃๆ—ถ้—ด[yyyyMM] */ public void setArchivingTime(String archivingTime) { this.archivingTime = archivingTime; } /** ่Žทๅ– ๅˆ›ๅปบๆ—ถ้—ด */ public Date getCreateTime() { return createTime; } /** ่ฎพ็ฝฎ ๅˆ›ๅปบๆ—ถ้—ด */ public void setCreateTime(Date createTime) { this.createTime = createTime; } /** ่Žทๅ– ไธŠไผ ๆ•ฐ้‡ */ public Long getUploadCount() { return uploadCount; } /** ่ฎพ็ฝฎ ไธŠไผ ๆ•ฐ้‡ */ public void setUploadCount(Long uploadCount) { this.uploadCount = uploadCount; } /** ่Žทๅ– ไธ‹่ฝฝๆ•ฐ */ public Long getDownloadCount() { return downloadCount; } /** ่ฎพ็ฝฎ ไธ‹่ฝฝๆ•ฐ */ public void setDownloadCount(Long downloadCount) { this.downloadCount = downloadCount; } /** ่Žทๅ– ็ญ”่ฐขไบบๆ•ฐ */ public Integer getThanksNumber() { return thanksNumber; } /** ่ฎพ็ฝฎ ็ญ”่ฐขไบบๆ•ฐ */ public void setThanksNumber(Integer thanksNumber) { this.thanksNumber = thanksNumber; } /** ่Žทๅ– ็ญ”่ฐข้‡‘้ข */ public Long getThanksAmount() { return thanksAmount; } /** ่ฎพ็ฝฎ ็ญ”่ฐข้‡‘้ข */ public void setThanksAmount(Long thanksAmount) { this.thanksAmount = thanksAmount; } /** ่Žทๅ– ๆ”ถ็›Š */ public Long getProfitAll() { return profitAll; } /** ่ฎพ็ฝฎ ๆ”ถ็›Š */ public void setProfitAll(Long profitAll) { this.profitAll = profitAll; } /** ่Žทๅ– ๅŸน่‚ฒๅฅ–้‡‘ */ public Long getCultivationAmount() { return cultivationAmount; } /** ่ฎพ็ฝฎ ๅŸน่‚ฒๅฅ–้‡‘ */ public void setCultivationAmount(Long cultivationAmount) { this.cultivationAmount = cultivationAmount; } /** ่Žทๅ– ่พ…ๅฏผๆดฅ่ดด */ public Long getCoachAmount() { return coachAmount; } /** ่ฎพ็ฝฎ ่พ…ๅฏผๆดฅ่ดด */ public void setCoachAmount(Long coachAmount) { this.coachAmount = coachAmount; } /** ่Žทๅ– ๆˆๆ•ˆๅฅ–้‡‘ */ public Long getResultsAmount() { return resultsAmount; } /** ่ฎพ็ฝฎ ๆˆๆ•ˆๅฅ–้‡‘ */ public void setResultsAmount(Long resultsAmount) { this.resultsAmount = resultsAmount; } /** ่Žทๅ– ๆดปๅŠจไบบๅŠ› */ public Integer getActiveManpower() { return activeManpower; } /** ่ฎพ็ฝฎ ๆดปๅŠจไบบๅŠ› */ public void setActiveManpower(Integer activeManpower) { this.activeManpower = activeManpower; } /** ่Žทๅ– ไธ€ไปฃๅŸน่‚ฒไบบ */ public Integer getOneTrainingEducation() { return oneTrainingEducation; } /** ่ฎพ็ฝฎ ไธ€ไปฃๅŸน่‚ฒไบบ */ public void setOneTrainingEducation(Integer oneTrainingEducation) { this.oneTrainingEducation = oneTrainingEducation; } /** ่Žทๅ– ไธคไปฃๅŸน่‚ฒไบบ */ public Integer getTwoTrainingEducation() { return twoTrainingEducation; } /** ่ฎพ็ฝฎ ไธคไปฃๅŸน่‚ฒไบบ */ public void setTwoTrainingEducation(Integer twoTrainingEducation) { this.twoTrainingEducation = twoTrainingEducation; } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("MTeamMonthlyReports"); sb.append("{muid=").append(muid); sb.append(", archivingTime=").append(archivingTime); sb.append(", createTime=").append(createTime); sb.append(", uploadCount=").append(uploadCount); sb.append(", downloadCount=").append(downloadCount); sb.append(", thanksNumber=").append(thanksNumber); sb.append(", thanksAmount=").append(thanksAmount); sb.append(", profitAll=").append(profitAll); sb.append(", cultivationAmount=").append(cultivationAmount); sb.append(", coachAmount=").append(coachAmount); sb.append(", resultsAmount=").append(resultsAmount); sb.append(", activeManpower=").append(activeManpower); sb.append(", oneTrainingEducation=").append(oneTrainingEducation); sb.append(", twoTrainingEducation=").append(twoTrainingEducation); sb.append('}'); return sb.toString(); } /* public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof MTeamMonthlyReports) { MTeamMonthlyReports mTeamMonthlyReports = (MTeamMonthlyReports) obj; if (this.getMuid().equals(mTeamMonthlyReports.getMuid()) && this.getArchivingTime().equals(mTeamMonthlyReports.getArchivingTime())) { return true; } } return false; }*/ public int hashCode() { String pkStr = "" + this.getMuid() + this.getArchivingTime(); return pkStr.hashCode(); } }
c8f4604040d719aca715ccc10de92775a46e978c
fc6c7a82fcad534ddc06cb368d9209384f74a385
/1.JavaSyntax/src/com/javarush/task/task09/task0911/Solution.java
66939a6d3ce15bd369ffa359bd3edc288a213be9
[]
no_license
edmams789/JavaRushTasks
51d2cb4525b98f3e79718a58fb6301aa8eb43570
d8c8d33af04cd1ea67d846db1d0a435462fabd60
refs/heads/master
2023-05-05T12:20:34.636306
2021-05-19T14:45:35
2021-05-19T14:45:35
368,760,470
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package com.javarush.task.task09.task0911; import java.awt.*; import java.util.HashMap; /* ะ˜ัะบะปัŽั‡ะตะฝะธะต ะฟั€ะธ ั€ะฐะฑะพั‚ะต ั ะบะพะปะปะตะบั†ะธัะผะธ Map ะŸะตั€ะตั…ะฒะฐั‚ะธั‚ัŒ ะธัะบะปัŽั‡ะตะฝะธะต (ะธ ะฒั‹ะฒะตัั‚ะธ ะตะณะพ ะฝะฐ ัะบั€ะฐะฝ), ัƒะบะฐะทะฐะฒ ะตะณะพ ั‚ะธะฟ, ะฒะพะทะฝะธะบะฐัŽั‰ะตะต ะฟั€ะธ ะฒั‹ะฟะพะปะฝะตะฝะธะธ ะบะพะดะฐ: HashMap map = new HashMap(null); map.put(null, null); map.remove(null); ะขั€ะตะฑะพะฒะฐะฝะธั: 1. ะŸั€ะพะณั€ะฐะผะผะฐ ะดะพะปะถะฝะฐ ะฒั‹ะฒะพะดะธั‚ัŒ ัะพะพะฑั‰ะตะฝะธะต ะฝะฐ ัะบั€ะฐะฝ. 2. ะ’ ะฟั€ะพะณั€ะฐะผะผะต ะดะพะปะถะตะฝ ะฑั‹ั‚ัŒ ะฑะปะพะบ try-catch. 3. ะŸั€ะพะณั€ะฐะผะผะฐ ะดะพะปะถะฝะฐ ะพั‚ะปะฐะฒะปะธะฒะฐั‚ัŒ ะธัะบะปัŽั‡ะตะฝะธั ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ั‚ะธะฟะฐ, ะฐ ะฝะต ะฒัะต ะฒะพะทะผะพะถะฝั‹ะต (Exception). 4. ะ’ั‹ะฒะตะดะตะฝะฝะพะต ัะพะพะฑั‰ะตะฝะธะต ะดะพะปะถะฝะพ ัะพะดะตั€ะถะฐั‚ัŒ ั‚ะธะฟ ะฒะพะทะฝะธะบัˆะตะณะพ ะธัะบะปัŽั‡ะตะฝะธั. 5. ะ˜ะผะตัŽั‰ะธะนัั ะบะพะด ะฒ ะผะตั‚ะพะดะต main ะฝะต ัƒะดะฐะปัั‚ัŒ. */ public class Solution { public static void main(String[] args) throws Exception { //ะฝะฐะฟะธัˆะธั‚ะต ั‚ัƒั‚ ะฒะฐัˆ ะบะพะด try { HashMap<String, String> map = new HashMap<String, String>(null); map.put(null, null); map.remove(null); } //ะฝะฐะฟะธัˆะธั‚ะต ั‚ัƒั‚ ะฒะฐัˆ ะบะพะด catch (NullPointerException e) { System.out.println("NullPointerException has been caught"); } } }
7b66ff4d5d4ba287501130328988f863cd3bdf6b
c929675958d6c99df8649c8d033ed81263a710a1
/Chapter 3/SearchBarExample/Android/obj/Debug/android/src/searchbarexample/android/MainActivity.java
d70f6f42a418e11f9eb815d1f2028821e7fe8198
[]
no_license
niranjan-kmit/XamarindemoProjects
f4de0cfa981377608c2f7736685d662b6b591328
ff5c6abce9062df2260b461f2e642bb7901ad299
refs/heads/master
2016-09-05T20:35:37.064807
2015-03-10T18:58:04
2015-03-10T18:58:04
31,940,567
0
0
null
null
null
null
UTF-8
Java
false
false
1,265
java
package searchbarexample.android; public class MainActivity extends xamarin.forms.platform.android.AndroidActivity implements mono.android.IGCUserPeer { static final String __md_methods; static { __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" + ""; mono.android.Runtime.register ("SearchBarExample.Android.MainActivity, SearchBarExample.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", MainActivity.class, __md_methods); } public MainActivity () throws java.lang.Throwable { super (); if (getClass () == MainActivity.class) mono.android.TypeManager.Activate ("SearchBarExample.Android.MainActivity, SearchBarExample.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onCreate (android.os.Bundle p0) { n_onCreate (p0); } private native void n_onCreate (android.os.Bundle p0); java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
da1586bb0b6dd64c47cb26d727637e3d71c3f4bc
94ebfe9b2248b55997c77c6c42931addd58da499
/app/src/main/java/com/example/attaurrahman/timetableapp/activity/DrawerActivity.java
20349f0a1d5d5456d22c138d66fb162a658779cb
[]
no_license
Atta-Ur-Rahman/TimeTableApp
2f2dd5837fa0f440e47f3e73b636df97ae777cf6
70fb0316a60c5bf62422021ef9f84ab9b69fdd9a
refs/heads/master
2020-03-21T18:09:45.411316
2018-07-11T06:21:38
2018-07-11T06:21:38
138,875,797
0
0
null
null
null
null
UTF-8
Java
false
false
5,240
java
package com.example.attaurrahman.timetableapp.activity; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; import com.example.attaurrahman.timetableapp.R; import com.example.attaurrahman.timetableapp.fragment.LoginFragment; import com.example.attaurrahman.timetableapp.fragment.MainFragment; import com.example.attaurrahman.timetableapp.fragment.ProfileFragment; import com.example.attaurrahman.timetableapp.fragment.RescheduleFragment; import com.example.attaurrahman.timetableapp.fragment.SubjectFragment; import com.example.attaurrahman.timetableapp.uitils.Utilities; public class DrawerActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { android.support.v7.app.ActionBar actionBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_drawer); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); actionBar = getSupportActionBar(); Utilities.withOutBackStackConnectFragment(this, new MainFragment()); /* FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); */ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.addDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); View headerView = navigationView.getHeaderView(0); TextView tvHeaderName = headerView.findViewById(R.id.tv_nav_header_drawer_name); TextView tvHeaderEmail = headerView.findViewById(R.id.tv_header_drawer_email); tvHeaderName.setText(Utilities.getSharedPreferences(this).getString("name", "")); tvHeaderEmail.setText(Utilities.getSharedPreferences(this).getString("email", "")); } public void actionBarhide() { actionBar.hide(); } public void actionBarShow() { actionBar.show(); } @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.drawer, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement /* if (id == R.id.action_settings) { return true; }*/ return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_profile) { Utilities.withOutBackStackConnectFragment(this, new ProfileFragment()); } else if (id == R.id.nav_timetable) { Utilities.withOutBackStackConnectFragment(this, new MainFragment()); } else if (id == R.id.nav_subject) { Utilities.withOutBackStackConnectFragment(this, new SubjectFragment()); } else if (id == R.id.nav_reschedule) { Utilities.withOutBackStackConnectFragment(this, new RescheduleFragment()); } else if (id == R.id.nav_log_out) { Utilities.putValueInEditor(this).putBoolean("isLogin", false).commit(); startActivity(new Intent(DrawerActivity.this, MainActivity.class)); finish(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } }
315cd19e6b4888f4c9ec48b1916f19c9c44e7165
ff194f40e9ffee051627fdb28368b54a54658ceb
/httpclient/src/main/java/com/demo/components/HttpApplication.java
866f09009dc22f8e8a81f7ccbe5f0939c3595f23
[]
no_license
haoshuimofu/common-components-parent
481a0cab1db60a59c3ff9b6ebbf6d063a06951ee
8cc2cc8e41117b28b5282d538334b396106b3387
refs/heads/master
2023-08-31T02:14:46.265734
2023-08-30T16:09:21
2023-08-30T16:09:21
281,634,859
0
5
null
2023-04-27T09:12:55
2020-07-22T09:32:52
Java
UTF-8
Java
false
false
448
java
package com.demo.components; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; /** * @author wude * @date 2020/8/27 12:54 */ @SpringBootApplication public class HttpApplication { public static void main(String[] args) { ApplicationContext ctx = SpringApplication.run(HttpApplication.class, args); } }
a2e185af447bf04514fbad1974765d4413525101
5f72f3b90e56e68fcb2f48dd796ecc3a5fa63262
/src/java/ishare/testing/servlet/Config.java
ec4a24dc5b84084d32b62e877736f138d4b28ce7
[]
no_license
arixd/SynchronizeAzecPos
bfd9f9e642429a5454c9d6a71715785d9986d042
8e306146be5ee5e254731ea29c56611fa0623841
refs/heads/master
2021-06-30T16:06:46.616816
2017-09-17T16:05:32
2017-09-17T16:05:32
103,550,577
0
0
null
null
null
null
UTF-8
Java
false
false
575
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 ishare.testing.servlet; import java.io.IOException; import java.util.Properties; /** * * @author dadan */ public class Config { public static Properties getConfig() throws IOException { Properties config = new Properties(); config.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties")); return config; } }
3fbf1a80eb30c647dee3b2cc8cb0d97c0491a269
1201983ea3ed42014de85d9134f7174fe77f3f35
/yuicompressor-2.4.2/rhino1_6R7/src/org/yuimozilla/classfile/ClassFileWriter.java
e166aa992d17e2c84a49d26b5ae0d80f7d2ec3fe
[ "BSD-3-Clause" ]
permissive
thegreatape/slim
f398175a2b0b6a39c0ab5103e8904c19591b5534
b188c1a0a10871d9654b41487050afe794e6d974
refs/heads/master
2016-09-05T17:02:01.575534
2009-08-07T14:53:54
2009-08-07T14:53:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
108,674
java
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Rhino code, released * May 6, 1999. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1997-1999 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Roger Lawrence * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License Version 2 or later (the "GPL"), in which * case the provisions of the GPL are applicable instead of those above. If * you wish to allow use of your version of this file only under the terms of * the GPL and not to allow others to use your version of this file under the * MPL, indicate your decision by deleting the provisions above and replacing * them with the notice and other provisions required by the GPL. If you do * not delete the provisions above, a recipient may use your version of this * file under either the MPL or the GPL. * * ***** END LICENSE BLOCK ***** */ package org.mozilla.classfile; import org.yuimozilla.javascript.ObjToIntMap; import org.yuimozilla.javascript.ObjArray; import org.yuimozilla.javascript.UintMap; import java.io.*; /** * ClassFileWriter * * A ClassFileWriter is used to write a Java class file. Methods are * provided to create fields and methods, and within methods to write * Java bytecodes. * * @author Roger Lawrence */ public class ClassFileWriter { /** * Construct a ClassFileWriter for a class. * * @param className the name of the class to write, including * full package qualification. * @param superClassName the name of the superclass of the class * to write, including full package qualification. * @param sourceFileName the name of the source file to use for * producing debug information, or null if debug information * is not desired */ public ClassFileWriter(String className, String superClassName, String sourceFileName) { generatedClassName = className; itsConstantPool = new ConstantPool(this); itsThisClassIndex = itsConstantPool.addClass(className); itsSuperClassIndex = itsConstantPool.addClass(superClassName); if (sourceFileName != null) itsSourceFileNameIndex = itsConstantPool.addUtf8(sourceFileName); itsFlags = ACC_PUBLIC; } public final String getClassName() { return generatedClassName; } /** * Add an interface implemented by this class. * * This method may be called multiple times for classes that * implement multiple interfaces. * * @param interfaceName a name of an interface implemented * by the class being written, including full package * qualification. */ public void addInterface(String interfaceName) { short interfaceIndex = itsConstantPool.addClass(interfaceName); itsInterfaces.add(new Short(interfaceIndex)); } public static final short ACC_PUBLIC = 0x0001, ACC_PRIVATE = 0x0002, ACC_PROTECTED = 0x0004, ACC_STATIC = 0x0008, ACC_FINAL = 0x0010, ACC_SYNCHRONIZED = 0x0020, ACC_VOLATILE = 0x0040, ACC_TRANSIENT = 0x0080, ACC_NATIVE = 0x0100, ACC_ABSTRACT = 0x0400; /** * Set the class's flags. * * Flags must be a set of the following flags, bitwise or'd * together: * ACC_PUBLIC * ACC_PRIVATE * ACC_PROTECTED * ACC_FINAL * ACC_ABSTRACT * TODO: check that this is the appropriate set * @param flags the set of class flags to set */ public void setFlags(short flags) { itsFlags = flags; } static String getSlashedForm(String name) { return name.replace('.', '/'); } /** * Convert Java class name in dot notation into * "Lname-with-dots-replaced-by-slashes;" form suitable for use as * JVM type signatures. */ public static String classNameToSignature(String name) { int nameLength = name.length(); int colonPos = 1 + nameLength; char[] buf = new char[colonPos + 1]; buf[0] = 'L'; buf[colonPos] = ';'; name.getChars(0, nameLength, buf, 1); for (int i = 1; i != colonPos; ++i) { if (buf[i] == '.') { buf[i] = '/'; } } return new String(buf, 0, colonPos + 1); } /** * Add a field to the class. * * @param fieldName the name of the field * @param type the type of the field using ... * @param flags the attributes of the field, such as ACC_PUBLIC, etc. * bitwise or'd together */ public void addField(String fieldName, String type, short flags) { short fieldNameIndex = itsConstantPool.addUtf8(fieldName); short typeIndex = itsConstantPool.addUtf8(type); itsFields.add(new ClassFileField(fieldNameIndex, typeIndex, flags)); } /** * Add a field to the class. * * @param fieldName the name of the field * @param type the type of the field using ... * @param flags the attributes of the field, such as ACC_PUBLIC, etc. * bitwise or'd together * @param value an initial integral value */ public void addField(String fieldName, String type, short flags, int value) { short fieldNameIndex = itsConstantPool.addUtf8(fieldName); short typeIndex = itsConstantPool.addUtf8(type); ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, flags); field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), (short)0, (short)0, itsConstantPool.addConstant(value)); itsFields.add(field); } /** * Add a field to the class. * * @param fieldName the name of the field * @param type the type of the field using ... * @param flags the attributes of the field, such as ACC_PUBLIC, etc. * bitwise or'd together * @param value an initial long value */ public void addField(String fieldName, String type, short flags, long value) { short fieldNameIndex = itsConstantPool.addUtf8(fieldName); short typeIndex = itsConstantPool.addUtf8(type); ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, flags); field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), (short)0, (short)2, itsConstantPool.addConstant(value)); itsFields.add(field); } /** * Add a field to the class. * * @param fieldName the name of the field * @param type the type of the field using ... * @param flags the attributes of the field, such as ACC_PUBLIC, etc. * bitwise or'd together * @param value an initial double value */ public void addField(String fieldName, String type, short flags, double value) { short fieldNameIndex = itsConstantPool.addUtf8(fieldName); short typeIndex = itsConstantPool.addUtf8(type); ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, flags); field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), (short)0, (short)2, itsConstantPool.addConstant(value)); itsFields.add(field); } /** * Add Information about java variable to use when generating the local * variable table. * * @param name variable name. * @param type variable type as bytecode descriptor string. * @param startPC the starting bytecode PC where this variable is live, * or -1 if it does not have a Java register. * @param register the Java register number of variable * or -1 if it does not have a Java register. */ public void addVariableDescriptor(String name, String type, int startPC, int register) { int nameIndex = itsConstantPool.addUtf8(name); int descriptorIndex = itsConstantPool.addUtf8(type); int [] chunk = { nameIndex, descriptorIndex, startPC, register }; if (itsVarDescriptors == null) { itsVarDescriptors = new ObjArray(); } itsVarDescriptors.add(chunk); } /** * Add a method and begin adding code. * * This method must be called before other methods for adding code, * exception tables, etc. can be invoked. * * @param methodName the name of the method * @param type a string representing the type * @param flags the attributes of the field, such as ACC_PUBLIC, etc. * bitwise or'd together */ public void startMethod(String methodName, String type, short flags) { short methodNameIndex = itsConstantPool.addUtf8(methodName); short typeIndex = itsConstantPool.addUtf8(type); itsCurrentMethod = new ClassFileMethod(methodNameIndex, typeIndex, flags); itsMethods.add(itsCurrentMethod); } /** * Complete generation of the method. * * After this method is called, no more code can be added to the * method begun with <code>startMethod</code>. * * @param maxLocals the maximum number of local variable slots * (a.k.a. Java registers) used by the method */ public void stopMethod(short maxLocals) { if (itsCurrentMethod == null) throw new IllegalStateException("No method to stop"); fixLabelGotos(); itsMaxLocals = maxLocals; int lineNumberTableLength = 0; if (itsLineNumberTable != null) { // 6 bytes for the attribute header // 2 bytes for the line number count // 4 bytes for each entry lineNumberTableLength = 6 + 2 + (itsLineNumberTableTop * 4); } int variableTableLength = 0; if (itsVarDescriptors != null) { // 6 bytes for the attribute header // 2 bytes for the variable count // 10 bytes for each entry variableTableLength = 6 + 2 + (itsVarDescriptors.size() * 10); } int attrLength = 2 + // attribute_name_index 4 + // attribute_length 2 + // max_stack 2 + // max_locals 4 + // code_length itsCodeBufferTop + 2 + // exception_table_length (itsExceptionTableTop * 8) + 2 + // attributes_count lineNumberTableLength + variableTableLength; byte[] codeAttribute = new byte[attrLength]; int index = 0; int codeAttrIndex = itsConstantPool.addUtf8("Code"); index = putInt16(codeAttrIndex, codeAttribute, index); attrLength -= 6; // discount the attribute header index = putInt32(attrLength, codeAttribute, index); index = putInt16(itsMaxStack, codeAttribute, index); index = putInt16(itsMaxLocals, codeAttribute, index); index = putInt32(itsCodeBufferTop, codeAttribute, index); System.arraycopy(itsCodeBuffer, 0, codeAttribute, index, itsCodeBufferTop); index += itsCodeBufferTop; if (itsExceptionTableTop > 0) { index = putInt16(itsExceptionTableTop, codeAttribute, index); for (int i = 0; i < itsExceptionTableTop; i++) { ExceptionTableEntry ete = itsExceptionTable[i]; short startPC = (short)getLabelPC(ete.itsStartLabel); short endPC = (short)getLabelPC(ete.itsEndLabel); short handlerPC = (short)getLabelPC(ete.itsHandlerLabel); short catchType = ete.itsCatchType; if (startPC == -1) throw new IllegalStateException("start label not defined"); if (endPC == -1) throw new IllegalStateException("end label not defined"); if (handlerPC == -1) throw new IllegalStateException( "handler label not defined"); index = putInt16(startPC, codeAttribute, index); index = putInt16(endPC, codeAttribute, index); index = putInt16(handlerPC, codeAttribute, index); index = putInt16(catchType, codeAttribute, index); } } else { // write 0 as exception table length index = putInt16(0, codeAttribute, index); } int attributeCount = 0; if (itsLineNumberTable != null) attributeCount++; if (itsVarDescriptors != null) attributeCount++; index = putInt16(attributeCount, codeAttribute, index); if (itsLineNumberTable != null) { int lineNumberTableAttrIndex = itsConstantPool.addUtf8("LineNumberTable"); index = putInt16(lineNumberTableAttrIndex, codeAttribute, index); int tableAttrLength = 2 + (itsLineNumberTableTop * 4); index = putInt32(tableAttrLength, codeAttribute, index); index = putInt16(itsLineNumberTableTop, codeAttribute, index); for (int i = 0; i < itsLineNumberTableTop; i++) { index = putInt32(itsLineNumberTable[i], codeAttribute, index); } } if (itsVarDescriptors != null) { int variableTableAttrIndex = itsConstantPool.addUtf8("LocalVariableTable"); index = putInt16(variableTableAttrIndex, codeAttribute, index); int varCount = itsVarDescriptors.size(); int tableAttrLength = 2 + (varCount * 10); index = putInt32(tableAttrLength, codeAttribute, index); index = putInt16(varCount, codeAttribute, index); for (int i = 0; i < varCount; i++) { int[] chunk = (int[])itsVarDescriptors.get(i); int nameIndex = chunk[0]; int descriptorIndex = chunk[1]; int startPC = chunk[2]; int register = chunk[3]; int length = itsCodeBufferTop - startPC; index = putInt16(startPC, codeAttribute, index); index = putInt16(length, codeAttribute, index); index = putInt16(nameIndex, codeAttribute, index); index = putInt16(descriptorIndex, codeAttribute, index); index = putInt16(register, codeAttribute, index); } } itsCurrentMethod.setCodeAttribute(codeAttribute); itsExceptionTable = null; itsExceptionTableTop = 0; itsLineNumberTableTop = 0; itsCodeBufferTop = 0; itsCurrentMethod = null; itsMaxStack = 0; itsStackTop = 0; itsLabelTableTop = 0; itsFixupTableTop = 0; itsVarDescriptors = null; } /** * Add the single-byte opcode to the current method. * * @param theOpCode the opcode of the bytecode */ public void add(int theOpCode) { if (opcodeCount(theOpCode) != 0) throw new IllegalArgumentException("Unexpected operands"); int newStack = itsStackTop + stackChange(theOpCode); if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); if (DEBUGCODE) System.out.println("Add " + bytecodeStr(theOpCode)); addToCodeBuffer(theOpCode); itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } /** * Add a single-operand opcode to the current method. * * @param theOpCode the opcode of the bytecode * @param theOperand the operand of the bytecode */ public void add(int theOpCode, int theOperand) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(theOpCode) +", "+Integer.toHexString(theOperand)); } int newStack = itsStackTop + stackChange(theOpCode); if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); switch (theOpCode) { case ByteCode.GOTO : // fallthru... case ByteCode.IFEQ : case ByteCode.IFNE : case ByteCode.IFLT : case ByteCode.IFGE : case ByteCode.IFGT : case ByteCode.IFLE : case ByteCode.IF_ICMPEQ : case ByteCode.IF_ICMPNE : case ByteCode.IF_ICMPLT : case ByteCode.IF_ICMPGE : case ByteCode.IF_ICMPGT : case ByteCode.IF_ICMPLE : case ByteCode.IF_ACMPEQ : case ByteCode.IF_ACMPNE : case ByteCode.JSR : case ByteCode.IFNULL : case ByteCode.IFNONNULL : { if ((theOperand & 0x80000000) != 0x80000000) { if ((theOperand < 0) || (theOperand > 65535)) throw new IllegalArgumentException( "Bad label for branch"); } int branchPC = itsCodeBufferTop; addToCodeBuffer(theOpCode); if ((theOperand & 0x80000000) != 0x80000000) { // hard displacement addToCodeInt16(theOperand); } else { // a label int targetPC = getLabelPC(theOperand); if (DEBUGLABELS) { int theLabel = theOperand & 0x7FFFFFFF; System.out.println("Fixing branch to " + theLabel + " at " + targetPC + " from " + branchPC); } if (targetPC != -1) { int offset = targetPC - branchPC; addToCodeInt16(offset); } else { addLabelFixup(theOperand, branchPC + 1); addToCodeInt16(0); } } } break; case ByteCode.BIPUSH : if ((byte)theOperand != theOperand) throw new IllegalArgumentException("out of range byte"); addToCodeBuffer(theOpCode); addToCodeBuffer((byte)theOperand); break; case ByteCode.SIPUSH : if ((short)theOperand != theOperand) throw new IllegalArgumentException("out of range short"); addToCodeBuffer(theOpCode); addToCodeInt16(theOperand); break; case ByteCode.NEWARRAY : if (!(0 <= theOperand && theOperand < 256)) throw new IllegalArgumentException("out of range index"); addToCodeBuffer(theOpCode); addToCodeBuffer(theOperand); break; case ByteCode.GETFIELD : case ByteCode.PUTFIELD : if (!(0 <= theOperand && theOperand < 65536)) throw new IllegalArgumentException("out of range field"); addToCodeBuffer(theOpCode); addToCodeInt16(theOperand); break; case ByteCode.LDC : case ByteCode.LDC_W : case ByteCode.LDC2_W : if (!(0 <= theOperand && theOperand < 65536)) throw new IllegalArgumentException("out of range index"); if (theOperand >= 256 || theOpCode == ByteCode.LDC_W || theOpCode == ByteCode.LDC2_W) { if (theOpCode == ByteCode.LDC) { addToCodeBuffer(ByteCode.LDC_W); } else { addToCodeBuffer(theOpCode); } addToCodeInt16(theOperand); } else { addToCodeBuffer(theOpCode); addToCodeBuffer(theOperand); } break; case ByteCode.RET : case ByteCode.ILOAD : case ByteCode.LLOAD : case ByteCode.FLOAD : case ByteCode.DLOAD : case ByteCode.ALOAD : case ByteCode.ISTORE : case ByteCode.LSTORE : case ByteCode.FSTORE : case ByteCode.DSTORE : case ByteCode.ASTORE : if (!(0 <= theOperand && theOperand < 65536)) throw new IllegalArgumentException("out of range variable"); if (theOperand >= 256) { addToCodeBuffer(ByteCode.WIDE); addToCodeBuffer(theOpCode); addToCodeInt16(theOperand); } else { addToCodeBuffer(theOpCode); addToCodeBuffer(theOperand); } break; default : throw new IllegalArgumentException( "Unexpected opcode for 1 operand"); } itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } /** * Generate the load constant bytecode for the given integer. * * @param k the constant */ public void addLoadConstant(int k) { add(ByteCode.LDC, itsConstantPool.addConstant(k)); } /** * Generate the load constant bytecode for the given long. * * @param k the constant */ public void addLoadConstant(long k) { add(ByteCode.LDC2_W, itsConstantPool.addConstant(k)); } /** * Generate the load constant bytecode for the given float. * * @param k the constant */ public void addLoadConstant(float k) { add(ByteCode.LDC, itsConstantPool.addConstant(k)); } /** * Generate the load constant bytecode for the given double. * * @param k the constant */ public void addLoadConstant(double k) { add(ByteCode.LDC2_W, itsConstantPool.addConstant(k)); } /** * Generate the load constant bytecode for the given string. * * @param k the constant */ public void addLoadConstant(String k) { add(ByteCode.LDC, itsConstantPool.addConstant(k)); } /** * Add the given two-operand bytecode to the current method. * * @param theOpCode the opcode of the bytecode * @param theOperand1 the first operand of the bytecode * @param theOperand2 the second operand of the bytecode */ public void add(int theOpCode, int theOperand1, int theOperand2) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(theOpCode) +", "+Integer.toHexString(theOperand1) +", "+Integer.toHexString(theOperand2)); } int newStack = itsStackTop + stackChange(theOpCode); if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); if (theOpCode == ByteCode.IINC) { if (!(0 <= theOperand1 && theOperand1 < 65536)) throw new IllegalArgumentException("out of range variable"); if (!(0 <= theOperand2 && theOperand2 < 65536)) throw new IllegalArgumentException("out of range increment"); if (theOperand1 > 255 || theOperand2 < -128 || theOperand2 > 127) { addToCodeBuffer(ByteCode.WIDE); addToCodeBuffer(ByteCode.IINC); addToCodeInt16(theOperand1); addToCodeInt16(theOperand2); } else { addToCodeBuffer(ByteCode.WIDE); addToCodeBuffer(ByteCode.IINC); addToCodeBuffer(theOperand1); addToCodeBuffer(theOperand2); } } else if (theOpCode == ByteCode.MULTIANEWARRAY) { if (!(0 <= theOperand1 && theOperand1 < 65536)) throw new IllegalArgumentException("out of range index"); if (!(0 <= theOperand2 && theOperand2 < 256)) throw new IllegalArgumentException("out of range dimensions"); addToCodeBuffer(ByteCode.MULTIANEWARRAY); addToCodeInt16(theOperand1); addToCodeBuffer(theOperand2); } else { throw new IllegalArgumentException( "Unexpected opcode for 2 operands"); } itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } public void add(int theOpCode, String className) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(theOpCode) +", "+className); } int newStack = itsStackTop + stackChange(theOpCode); if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); switch (theOpCode) { case ByteCode.NEW : case ByteCode.ANEWARRAY : case ByteCode.CHECKCAST : case ByteCode.INSTANCEOF : { short classIndex = itsConstantPool.addClass(className); addToCodeBuffer(theOpCode); addToCodeInt16(classIndex); } break; default : throw new IllegalArgumentException( "bad opcode for class reference"); } itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } public void add(int theOpCode, String className, String fieldName, String fieldType) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(theOpCode) +", "+className+", "+fieldName+", "+fieldType); } int newStack = itsStackTop + stackChange(theOpCode); char fieldTypeChar = fieldType.charAt(0); int fieldSize = (fieldTypeChar == 'J' || fieldTypeChar == 'D') ? 2 : 1; switch (theOpCode) { case ByteCode.GETFIELD : case ByteCode.GETSTATIC : newStack += fieldSize; break; case ByteCode.PUTSTATIC : case ByteCode.PUTFIELD : newStack -= fieldSize; break; default : throw new IllegalArgumentException( "bad opcode for field reference"); } if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); short fieldRefIndex = itsConstantPool.addFieldRef(className, fieldName, fieldType); addToCodeBuffer(theOpCode); addToCodeInt16(fieldRefIndex); itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } public void addInvoke(int theOpCode, String className, String methodName, String methodType) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(theOpCode) +", "+className+", "+methodName+", " +methodType); } int parameterInfo = sizeOfParameters(methodType); int parameterCount = parameterInfo >>> 16; int stackDiff = (short)parameterInfo; int newStack = itsStackTop + stackDiff; newStack += stackChange(theOpCode); // adjusts for 'this' if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); switch (theOpCode) { case ByteCode.INVOKEVIRTUAL : case ByteCode.INVOKESPECIAL : case ByteCode.INVOKESTATIC : case ByteCode.INVOKEINTERFACE : { addToCodeBuffer(theOpCode); if (theOpCode == ByteCode.INVOKEINTERFACE) { short ifMethodRefIndex = itsConstantPool.addInterfaceMethodRef( className, methodName, methodType); addToCodeInt16(ifMethodRefIndex); addToCodeBuffer(parameterCount + 1); addToCodeBuffer(0); } else { short methodRefIndex = itsConstantPool.addMethodRef( className, methodName, methodType); addToCodeInt16(methodRefIndex); } } break; default : throw new IllegalArgumentException( "bad opcode for method reference"); } itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(theOpCode) +" stack = "+itsStackTop); } } /** * Generate code to load the given integer on stack. * * @param k the constant */ public void addPush(int k) { if ((byte)k == k) { if (k == -1) { add(ByteCode.ICONST_M1); } else if (0 <= k && k <= 5) { add((byte)(ByteCode.ICONST_0 + k)); } else { add(ByteCode.BIPUSH, (byte)k); } } else if ((short)k == k) { add(ByteCode.SIPUSH, (short)k); } else { addLoadConstant(k); } } public void addPush(boolean k) { add(k ? ByteCode.ICONST_1 : ByteCode.ICONST_0); } /** * Generate code to load the given long on stack. * * @param k the constant */ public void addPush(long k) { int ik = (int)k; if (ik == k) { addPush(ik); add(ByteCode.I2L); } else { addLoadConstant(k); } } /** * Generate code to load the given double on stack. * * @param k the constant */ public void addPush(double k) { if (k == 0.0) { // zero add(ByteCode.DCONST_0); if (1.0 / k < 0) { // Negative zero add(ByteCode.DNEG); } } else if (k == 1.0 || k == -1.0) { add(ByteCode.DCONST_1); if (k < 0) { add(ByteCode.DNEG); } } else { addLoadConstant(k); } } /** * Generate the code to leave on stack the given string even if the * string encoding exeeds the class file limit for single string constant * * @param k the constant */ public void addPush(String k) { int length = k.length(); int limit = itsConstantPool.getUtfEncodingLimit(k, 0, length); if (limit == length) { addLoadConstant(k); return; } // Split string into picies fitting the UTF limit and generate code for // StringBuffer sb = new StringBuffer(length); // sb.append(loadConstant(piece_1)); // ... // sb.append(loadConstant(piece_N)); // sb.toString(); final String SB = "java/lang/StringBuffer"; add(ByteCode.NEW, SB); add(ByteCode.DUP); addPush(length); addInvoke(ByteCode.INVOKESPECIAL, SB, "<init>", "(I)V"); int cursor = 0; for (;;) { add(ByteCode.DUP); String s = k.substring(cursor, limit); addLoadConstant(s); addInvoke(ByteCode.INVOKEVIRTUAL, SB, "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); add(ByteCode.POP); if (limit == length) { break; } cursor = limit; limit = itsConstantPool.getUtfEncodingLimit(k, limit, length); } addInvoke(ByteCode.INVOKEVIRTUAL, SB, "toString", "()Ljava/lang/String;"); } /** * Check if k fits limit on string constant size imposed by class file * format. * * @param k the string constant */ public boolean isUnderStringSizeLimit(String k) { return itsConstantPool.isUnderUtfEncodingLimit(k); } /** * Store integer from stack top into the given local. * * @param local number of local register */ public void addIStore(int local) { xop(ByteCode.ISTORE_0, ByteCode.ISTORE, local); } /** * Store long from stack top into the given local. * * @param local number of local register */ public void addLStore(int local) { xop(ByteCode.LSTORE_0, ByteCode.LSTORE, local); } /** * Store float from stack top into the given local. * * @param local number of local register */ public void addFStore(int local) { xop(ByteCode.FSTORE_0, ByteCode.FSTORE, local); } /** * Store double from stack top into the given local. * * @param local number of local register */ public void addDStore(int local) { xop(ByteCode.DSTORE_0, ByteCode.DSTORE, local); } /** * Store object from stack top into the given local. * * @param local number of local register */ public void addAStore(int local) { xop(ByteCode.ASTORE_0, ByteCode.ASTORE, local); } /** * Load integer from the given local into stack. * * @param local number of local register */ public void addILoad(int local) { xop(ByteCode.ILOAD_0, ByteCode.ILOAD, local); } /** * Load long from the given local into stack. * * @param local number of local register */ public void addLLoad(int local) { xop(ByteCode.LLOAD_0, ByteCode.LLOAD, local); } /** * Load float from the given local into stack. * * @param local number of local register */ public void addFLoad(int local) { xop(ByteCode.FLOAD_0, ByteCode.FLOAD, local); } /** * Load double from the given local into stack. * * @param local number of local register */ public void addDLoad(int local) { xop(ByteCode.DLOAD_0, ByteCode.DLOAD, local); } /** * Load object from the given local into stack. * * @param local number of local register */ public void addALoad(int local) { xop(ByteCode.ALOAD_0, ByteCode.ALOAD, local); } /** * Load "this" into stack. */ public void addLoadThis() { add(ByteCode.ALOAD_0); } private void xop(int shortOp, int op, int local) { switch (local) { case 0: add(shortOp); break; case 1: add(shortOp + 1); break; case 2: add(shortOp + 2); break; case 3: add(shortOp + 3); break; default: add(op, local); } } public int addTableSwitch(int low, int high) { if (DEBUGCODE) { System.out.println("Add "+bytecodeStr(ByteCode.TABLESWITCH) +" "+low+" "+high); } if (low > high) throw new IllegalArgumentException("Bad bounds: "+low+' '+ high); int newStack = itsStackTop + stackChange(ByteCode.TABLESWITCH); if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); int entryCount = high - low + 1; int padSize = 3 & ~itsCodeBufferTop; // == 3 - itsCodeBufferTop % 4 int N = addReservedCodeSpace(1 + padSize + 4 * (1 + 2 + entryCount)); int switchStart = N; itsCodeBuffer[N++] = (byte)ByteCode.TABLESWITCH; while (padSize != 0) { itsCodeBuffer[N++] = 0; --padSize; } N += 4; // skip default offset N = putInt32(low, itsCodeBuffer, N); putInt32(high, itsCodeBuffer, N); itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+bytecodeStr(ByteCode.TABLESWITCH) +" stack = "+itsStackTop); } return switchStart; } public final void markTableSwitchDefault(int switchStart) { setTableSwitchJump(switchStart, -1, itsCodeBufferTop); } public final void markTableSwitchCase(int switchStart, int caseIndex) { setTableSwitchJump(switchStart, caseIndex, itsCodeBufferTop); } public final void markTableSwitchCase(int switchStart, int caseIndex, int stackTop) { if (!(0 <= stackTop && stackTop <= itsMaxStack)) throw new IllegalArgumentException("Bad stack index: "+stackTop); itsStackTop = (short)stackTop; setTableSwitchJump(switchStart, caseIndex, itsCodeBufferTop); } public void setTableSwitchJump(int switchStart, int caseIndex, int jumpTarget) { if (!(0 <= jumpTarget && jumpTarget <= itsCodeBufferTop)) throw new IllegalArgumentException("Bad jump target: "+jumpTarget); if (!(caseIndex >= -1)) throw new IllegalArgumentException("Bad case index: "+caseIndex); int padSize = 3 & ~switchStart; // == 3 - switchStart % 4 int caseOffset; if (caseIndex < 0) { // default label caseOffset = switchStart + 1 + padSize; } else { caseOffset = switchStart + 1 + padSize + 4 * (3 + caseIndex); } if (!(0 <= switchStart && switchStart <= itsCodeBufferTop - 4 * 4 - padSize - 1)) { throw new IllegalArgumentException( switchStart+" is outside a possible range of tableswitch" +" in already generated code"); } if ((0xFF & itsCodeBuffer[switchStart]) != ByteCode.TABLESWITCH) { throw new IllegalArgumentException( switchStart+" is not offset of tableswitch statement"); } if (!(0 <= caseOffset && caseOffset + 4 <= itsCodeBufferTop)) { // caseIndex >= -1 does not guarantee that caseOffset >= 0 due // to a possible overflow. throw new IllegalArgumentException( "Too big case index: "+caseIndex); } // ALERT: perhaps check against case bounds? putInt32(jumpTarget - switchStart, itsCodeBuffer, caseOffset); } public int acquireLabel() { int top = itsLabelTableTop; if (itsLabelTable == null || top == itsLabelTable.length) { if (itsLabelTable == null) { itsLabelTable = new int[MIN_LABEL_TABLE_SIZE]; }else { int[] tmp = new int[itsLabelTable.length * 2]; System.arraycopy(itsLabelTable, 0, tmp, 0, top); itsLabelTable = tmp; } } itsLabelTableTop = top + 1; itsLabelTable[top] = -1; return top | 0x80000000; } public void markLabel(int label) { if (!(label < 0)) throw new IllegalArgumentException("Bad label, no biscuit"); label &= 0x7FFFFFFF; if (label > itsLabelTableTop) throw new IllegalArgumentException("Bad label"); if (itsLabelTable[label] != -1) { throw new IllegalStateException("Can only mark label once"); } itsLabelTable[label] = itsCodeBufferTop; } public void markLabel(int label, short stackTop) { markLabel(label); itsStackTop = stackTop; } public void markHandler(int theLabel) { itsStackTop = 1; markLabel(theLabel); } private int getLabelPC(int label) { if (!(label < 0)) throw new IllegalArgumentException("Bad label, no biscuit"); label &= 0x7FFFFFFF; if (!(label < itsLabelTableTop)) throw new IllegalArgumentException("Bad label"); return itsLabelTable[label]; } private void addLabelFixup(int label, int fixupSite) { if (!(label < 0)) throw new IllegalArgumentException("Bad label, no biscuit"); label &= 0x7FFFFFFF; if (!(label < itsLabelTableTop)) throw new IllegalArgumentException("Bad label"); int top = itsFixupTableTop; if (itsFixupTable == null || top == itsFixupTable.length) { if (itsFixupTable == null) { itsFixupTable = new long[MIN_FIXUP_TABLE_SIZE]; }else { long[] tmp = new long[itsFixupTable.length * 2]; System.arraycopy(itsFixupTable, 0, tmp, 0, top); itsFixupTable = tmp; } } itsFixupTableTop = top + 1; itsFixupTable[top] = ((long)label << 32) | fixupSite; } private void fixLabelGotos() { byte[] codeBuffer = itsCodeBuffer; for (int i = 0; i < itsFixupTableTop; i++) { long fixup = itsFixupTable[i]; int label = (int)(fixup >> 32); int fixupSite = (int)fixup; int pc = itsLabelTable[label]; if (pc == -1) { // Unlocated label throw new RuntimeException(); } // -1 to get delta from instruction start int offset = pc - (fixupSite - 1); if ((short)offset != offset) { throw new RuntimeException ("Program too complex: too big jump offset"); } codeBuffer[fixupSite] = (byte)(offset >> 8); codeBuffer[fixupSite + 1] = (byte)offset; } itsFixupTableTop = 0; } /** * Get the current offset into the code of the current method. * * @return an integer representing the offset */ public int getCurrentCodeOffset() { return itsCodeBufferTop; } public short getStackTop() { return itsStackTop; } public void adjustStackTop(int delta) { int newStack = itsStackTop + delta; if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); itsStackTop = (short)newStack; if (newStack > itsMaxStack) itsMaxStack = (short)newStack; if (DEBUGSTACK) { System.out.println("After "+"adjustStackTop("+delta+")" +" stack = "+itsStackTop); } } private void addToCodeBuffer(int b) { int N = addReservedCodeSpace(1); itsCodeBuffer[N] = (byte)b; } private void addToCodeInt16(int value) { int N = addReservedCodeSpace(2); putInt16(value, itsCodeBuffer, N); } private int addReservedCodeSpace(int size) { if (itsCurrentMethod == null) throw new IllegalArgumentException("No method to add to"); int oldTop = itsCodeBufferTop; int newTop = oldTop + size; if (newTop > itsCodeBuffer.length) { int newSize = itsCodeBuffer.length * 2; if (newTop > newSize) { newSize = newTop; } byte[] tmp = new byte[newSize]; System.arraycopy(itsCodeBuffer, 0, tmp, 0, oldTop); itsCodeBuffer = tmp; } itsCodeBufferTop = newTop; return oldTop; } public void addExceptionHandler(int startLabel, int endLabel, int handlerLabel, String catchClassName) { if ((startLabel & 0x80000000) != 0x80000000) throw new IllegalArgumentException("Bad startLabel"); if ((endLabel & 0x80000000) != 0x80000000) throw new IllegalArgumentException("Bad endLabel"); if ((handlerLabel & 0x80000000) != 0x80000000) throw new IllegalArgumentException("Bad handlerLabel"); /* * If catchClassName is null, use 0 for the catch_type_index; which * means catch everything. (Even when the verifier has let you throw * something other than a Throwable.) */ short catch_type_index = (catchClassName == null) ? 0 : itsConstantPool.addClass(catchClassName); ExceptionTableEntry newEntry = new ExceptionTableEntry( startLabel, endLabel, handlerLabel, catch_type_index); int N = itsExceptionTableTop; if (N == 0) { itsExceptionTable = new ExceptionTableEntry[ExceptionTableSize]; } else if (N == itsExceptionTable.length) { ExceptionTableEntry[] tmp = new ExceptionTableEntry[N * 2]; System.arraycopy(itsExceptionTable, 0, tmp, 0, N); itsExceptionTable = tmp; } itsExceptionTable[N] = newEntry; itsExceptionTableTop = N + 1; } public void addLineNumberEntry(short lineNumber) { if (itsCurrentMethod == null) throw new IllegalArgumentException("No method to stop"); int N = itsLineNumberTableTop; if (N == 0) { itsLineNumberTable = new int[LineNumberTableSize]; } else if (N == itsLineNumberTable.length) { int[] tmp = new int[N * 2]; System.arraycopy(itsLineNumberTable, 0, tmp, 0, N); itsLineNumberTable = tmp; } itsLineNumberTable[N] = (itsCodeBufferTop << 16) + lineNumber; itsLineNumberTableTop = N + 1; } /** * Write the class file to the OutputStream. * * @param oStream the stream to write to * @throws IOException if writing to the stream produces an exception */ public void write(OutputStream oStream) throws IOException { byte[] array = toByteArray(); oStream.write(array); } private int getWriteSize() { int size = 0; if (itsSourceFileNameIndex != 0) { itsConstantPool.addUtf8("SourceFile"); } size += 8; //writeLong(FileHeaderConstant); size += itsConstantPool.getWriteSize(); size += 2; //writeShort(itsFlags); size += 2; //writeShort(itsThisClassIndex); size += 2; //writeShort(itsSuperClassIndex); size += 2; //writeShort(itsInterfaces.size()); size += 2 * itsInterfaces.size(); size += 2; //writeShort(itsFields.size()); for (int i = 0; i < itsFields.size(); i++) { size += ((ClassFileField)(itsFields.get(i))).getWriteSize(); } size += 2; //writeShort(itsMethods.size()); for (int i = 0; i < itsMethods.size(); i++) { size += ((ClassFileMethod)(itsMethods.get(i))).getWriteSize(); } if (itsSourceFileNameIndex != 0) { size += 2; //writeShort(1); attributes count size += 2; //writeShort(sourceFileAttributeNameIndex); size += 4; //writeInt(2); size += 2; //writeShort(itsSourceFileNameIndex); }else { size += 2; //out.writeShort(0); no attributes } return size; } /** * Get the class file as array of bytesto the OutputStream. */ public byte[] toByteArray() { int dataSize = getWriteSize(); byte[] data = new byte[dataSize]; int offset = 0; short sourceFileAttributeNameIndex = 0; if (itsSourceFileNameIndex != 0) { sourceFileAttributeNameIndex = itsConstantPool.addUtf8( "SourceFile"); } offset = putInt64(FileHeaderConstant, data, offset); offset = itsConstantPool.write(data, offset); offset = putInt16(itsFlags, data, offset); offset = putInt16(itsThisClassIndex, data, offset); offset = putInt16(itsSuperClassIndex, data, offset); offset = putInt16(itsInterfaces.size(), data, offset); for (int i = 0; i < itsInterfaces.size(); i++) { int interfaceIndex = ((Short)(itsInterfaces.get(i))).shortValue(); offset = putInt16(interfaceIndex, data, offset); } offset = putInt16(itsFields.size(), data, offset); for (int i = 0; i < itsFields.size(); i++) { ClassFileField field = (ClassFileField)itsFields.get(i); offset = field.write(data, offset); } offset = putInt16(itsMethods.size(), data, offset); for (int i = 0; i < itsMethods.size(); i++) { ClassFileMethod method = (ClassFileMethod)itsMethods.get(i); offset = method.write(data, offset); } if (itsSourceFileNameIndex != 0) { offset = putInt16(1, data, offset); // attributes count offset = putInt16(sourceFileAttributeNameIndex, data, offset); offset = putInt32(2, data, offset); offset = putInt16(itsSourceFileNameIndex, data, offset); } else { offset = putInt16(0, data, offset); // no attributes } if (offset != dataSize) { // Check getWriteSize is consistent with write! throw new RuntimeException(); } return data; } static int putInt64(long value, byte[] array, int offset) { offset = putInt32((int)(value >>> 32), array, offset); return putInt32((int)value, array, offset); } private static void badStack(int value) { String s; if (value < 0) { s = "Stack underflow: "+value; } else { s = "Too big stack: "+value; } throw new IllegalStateException(s); } /* Really weird. Returns an int with # parameters in hi 16 bits, and stack difference removal of parameters from stack and pushing the result (it does not take into account removal of this in case of non-static methods). If Java really supported references we wouldn't have to be this perverted. */ private static int sizeOfParameters(String pString) { int length = pString.length(); int rightParenthesis = pString.lastIndexOf(')'); if (3 <= length /* minimal signature takes at least 3 chars: ()V */ && pString.charAt(0) == '(' && 1 <= rightParenthesis && rightParenthesis + 1 < length) { boolean ok = true; int index = 1; int stackDiff = 0; int count = 0; stringLoop: while (index != rightParenthesis) { switch (pString.charAt(index)) { default: ok = false; break stringLoop; case 'J' : case 'D' : --stackDiff; // fall thru case 'B' : case 'S' : case 'C' : case 'I' : case 'Z' : case 'F' : --stackDiff; ++count; ++index; continue; case '[' : ++index; int c = pString.charAt(index); while (c == '[') { ++index; c = pString.charAt(index); } switch (c) { default: ok = false; break stringLoop; case 'J' : case 'D' : case 'B' : case 'S' : case 'C' : case 'I' : case 'Z' : case 'F' : --stackDiff; ++count; ++index; continue; case 'L': // fall thru } // fall thru case 'L' : { --stackDiff; ++count; ++index; int semicolon = pString.indexOf(';', index); if (!(index + 1 <= semicolon && semicolon < rightParenthesis)) { ok = false; break stringLoop; } index = semicolon + 1; continue; } } } if (ok) { switch (pString.charAt(rightParenthesis + 1)) { default: ok = false; break; case 'J' : case 'D' : ++stackDiff; // fall thru case 'B' : case 'S' : case 'C' : case 'I' : case 'Z' : case 'F' : case 'L' : case '[' : ++stackDiff; // fall thru case 'V' : break; } if (ok) { return ((count << 16) | (0xFFFF & stackDiff)); } } } throw new IllegalArgumentException( "Bad parameter signature: "+pString); } static int putInt16(int value, byte[] array, int offset) { array[offset + 0] = (byte)(value >>> 8); array[offset + 1] = (byte)value; return offset + 2; } static int putInt32(int value, byte[] array, int offset) { array[offset + 0] = (byte)(value >>> 24); array[offset + 1] = (byte)(value >>> 16); array[offset + 2] = (byte)(value >>> 8); array[offset + 3] = (byte)value; return offset + 4; } /** * Number of operands accompanying the opcode. */ static int opcodeCount(int opcode) { switch (opcode) { case ByteCode.AALOAD: case ByteCode.AASTORE: case ByteCode.ACONST_NULL: case ByteCode.ALOAD_0: case ByteCode.ALOAD_1: case ByteCode.ALOAD_2: case ByteCode.ALOAD_3: case ByteCode.ARETURN: case ByteCode.ARRAYLENGTH: case ByteCode.ASTORE_0: case ByteCode.ASTORE_1: case ByteCode.ASTORE_2: case ByteCode.ASTORE_3: case ByteCode.ATHROW: case ByteCode.BALOAD: case ByteCode.BASTORE: case ByteCode.BREAKPOINT: case ByteCode.CALOAD: case ByteCode.CASTORE: case ByteCode.D2F: case ByteCode.D2I: case ByteCode.D2L: case ByteCode.DADD: case ByteCode.DALOAD: case ByteCode.DASTORE: case ByteCode.DCMPG: case ByteCode.DCMPL: case ByteCode.DCONST_0: case ByteCode.DCONST_1: case ByteCode.DDIV: case ByteCode.DLOAD_0: case ByteCode.DLOAD_1: case ByteCode.DLOAD_2: case ByteCode.DLOAD_3: case ByteCode.DMUL: case ByteCode.DNEG: case ByteCode.DREM: case ByteCode.DRETURN: case ByteCode.DSTORE_0: case ByteCode.DSTORE_1: case ByteCode.DSTORE_2: case ByteCode.DSTORE_3: case ByteCode.DSUB: case ByteCode.DUP: case ByteCode.DUP2: case ByteCode.DUP2_X1: case ByteCode.DUP2_X2: case ByteCode.DUP_X1: case ByteCode.DUP_X2: case ByteCode.F2D: case ByteCode.F2I: case ByteCode.F2L: case ByteCode.FADD: case ByteCode.FALOAD: case ByteCode.FASTORE: case ByteCode.FCMPG: case ByteCode.FCMPL: case ByteCode.FCONST_0: case ByteCode.FCONST_1: case ByteCode.FCONST_2: case ByteCode.FDIV: case ByteCode.FLOAD_0: case ByteCode.FLOAD_1: case ByteCode.FLOAD_2: case ByteCode.FLOAD_3: case ByteCode.FMUL: case ByteCode.FNEG: case ByteCode.FREM: case ByteCode.FRETURN: case ByteCode.FSTORE_0: case ByteCode.FSTORE_1: case ByteCode.FSTORE_2: case ByteCode.FSTORE_3: case ByteCode.FSUB: case ByteCode.I2B: case ByteCode.I2C: case ByteCode.I2D: case ByteCode.I2F: case ByteCode.I2L: case ByteCode.I2S: case ByteCode.IADD: case ByteCode.IALOAD: case ByteCode.IAND: case ByteCode.IASTORE: case ByteCode.ICONST_0: case ByteCode.ICONST_1: case ByteCode.ICONST_2: case ByteCode.ICONST_3: case ByteCode.ICONST_4: case ByteCode.ICONST_5: case ByteCode.ICONST_M1: case ByteCode.IDIV: case ByteCode.ILOAD_0: case ByteCode.ILOAD_1: case ByteCode.ILOAD_2: case ByteCode.ILOAD_3: case ByteCode.IMPDEP1: case ByteCode.IMPDEP2: case ByteCode.IMUL: case ByteCode.INEG: case ByteCode.IOR: case ByteCode.IREM: case ByteCode.IRETURN: case ByteCode.ISHL: case ByteCode.ISHR: case ByteCode.ISTORE_0: case ByteCode.ISTORE_1: case ByteCode.ISTORE_2: case ByteCode.ISTORE_3: case ByteCode.ISUB: case ByteCode.IUSHR: case ByteCode.IXOR: case ByteCode.L2D: case ByteCode.L2F: case ByteCode.L2I: case ByteCode.LADD: case ByteCode.LALOAD: case ByteCode.LAND: case ByteCode.LASTORE: case ByteCode.LCMP: case ByteCode.LCONST_0: case ByteCode.LCONST_1: case ByteCode.LDIV: case ByteCode.LLOAD_0: case ByteCode.LLOAD_1: case ByteCode.LLOAD_2: case ByteCode.LLOAD_3: case ByteCode.LMUL: case ByteCode.LNEG: case ByteCode.LOR: case ByteCode.LREM: case ByteCode.LRETURN: case ByteCode.LSHL: case ByteCode.LSHR: case ByteCode.LSTORE_0: case ByteCode.LSTORE_1: case ByteCode.LSTORE_2: case ByteCode.LSTORE_3: case ByteCode.LSUB: case ByteCode.LUSHR: case ByteCode.LXOR: case ByteCode.MONITORENTER: case ByteCode.MONITOREXIT: case ByteCode.NOP: case ByteCode.POP: case ByteCode.POP2: case ByteCode.RETURN: case ByteCode.SALOAD: case ByteCode.SASTORE: case ByteCode.SWAP: case ByteCode.WIDE: return 0; case ByteCode.ALOAD: case ByteCode.ANEWARRAY: case ByteCode.ASTORE: case ByteCode.BIPUSH: case ByteCode.CHECKCAST: case ByteCode.DLOAD: case ByteCode.DSTORE: case ByteCode.FLOAD: case ByteCode.FSTORE: case ByteCode.GETFIELD: case ByteCode.GETSTATIC: case ByteCode.GOTO: case ByteCode.GOTO_W: case ByteCode.IFEQ: case ByteCode.IFGE: case ByteCode.IFGT: case ByteCode.IFLE: case ByteCode.IFLT: case ByteCode.IFNE: case ByteCode.IFNONNULL: case ByteCode.IFNULL: case ByteCode.IF_ACMPEQ: case ByteCode.IF_ACMPNE: case ByteCode.IF_ICMPEQ: case ByteCode.IF_ICMPGE: case ByteCode.IF_ICMPGT: case ByteCode.IF_ICMPLE: case ByteCode.IF_ICMPLT: case ByteCode.IF_ICMPNE: case ByteCode.ILOAD: case ByteCode.INSTANCEOF: case ByteCode.INVOKEINTERFACE: case ByteCode.INVOKESPECIAL: case ByteCode.INVOKESTATIC: case ByteCode.INVOKEVIRTUAL: case ByteCode.ISTORE: case ByteCode.JSR: case ByteCode.JSR_W: case ByteCode.LDC: case ByteCode.LDC2_W: case ByteCode.LDC_W: case ByteCode.LLOAD: case ByteCode.LSTORE: case ByteCode.NEW: case ByteCode.NEWARRAY: case ByteCode.PUTFIELD: case ByteCode.PUTSTATIC: case ByteCode.RET: case ByteCode.SIPUSH: return 1; case ByteCode.IINC: case ByteCode.MULTIANEWARRAY: return 2; case ByteCode.LOOKUPSWITCH: case ByteCode.TABLESWITCH: return -1; } throw new IllegalArgumentException("Bad opcode: "+opcode); } /** * The effect on the operand stack of a given opcode. */ static int stackChange(int opcode) { // For INVOKE... accounts only for popping this (unless static), // ignoring parameters and return type switch (opcode) { case ByteCode.DASTORE: case ByteCode.LASTORE: return -4; case ByteCode.AASTORE: case ByteCode.BASTORE: case ByteCode.CASTORE: case ByteCode.DCMPG: case ByteCode.DCMPL: case ByteCode.FASTORE: case ByteCode.IASTORE: case ByteCode.LCMP: case ByteCode.SASTORE: return -3; case ByteCode.DADD: case ByteCode.DDIV: case ByteCode.DMUL: case ByteCode.DREM: case ByteCode.DRETURN: case ByteCode.DSTORE: case ByteCode.DSTORE_0: case ByteCode.DSTORE_1: case ByteCode.DSTORE_2: case ByteCode.DSTORE_3: case ByteCode.DSUB: case ByteCode.IF_ACMPEQ: case ByteCode.IF_ACMPNE: case ByteCode.IF_ICMPEQ: case ByteCode.IF_ICMPGE: case ByteCode.IF_ICMPGT: case ByteCode.IF_ICMPLE: case ByteCode.IF_ICMPLT: case ByteCode.IF_ICMPNE: case ByteCode.LADD: case ByteCode.LAND: case ByteCode.LDIV: case ByteCode.LMUL: case ByteCode.LOR: case ByteCode.LREM: case ByteCode.LRETURN: case ByteCode.LSTORE: case ByteCode.LSTORE_0: case ByteCode.LSTORE_1: case ByteCode.LSTORE_2: case ByteCode.LSTORE_3: case ByteCode.LSUB: case ByteCode.LXOR: case ByteCode.POP2: return -2; case ByteCode.AALOAD: case ByteCode.ARETURN: case ByteCode.ASTORE: case ByteCode.ASTORE_0: case ByteCode.ASTORE_1: case ByteCode.ASTORE_2: case ByteCode.ASTORE_3: case ByteCode.ATHROW: case ByteCode.BALOAD: case ByteCode.CALOAD: case ByteCode.D2F: case ByteCode.D2I: case ByteCode.FADD: case ByteCode.FALOAD: case ByteCode.FCMPG: case ByteCode.FCMPL: case ByteCode.FDIV: case ByteCode.FMUL: case ByteCode.FREM: case ByteCode.FRETURN: case ByteCode.FSTORE: case ByteCode.FSTORE_0: case ByteCode.FSTORE_1: case ByteCode.FSTORE_2: case ByteCode.FSTORE_3: case ByteCode.FSUB: case ByteCode.GETFIELD: case ByteCode.IADD: case ByteCode.IALOAD: case ByteCode.IAND: case ByteCode.IDIV: case ByteCode.IFEQ: case ByteCode.IFGE: case ByteCode.IFGT: case ByteCode.IFLE: case ByteCode.IFLT: case ByteCode.IFNE: case ByteCode.IFNONNULL: case ByteCode.IFNULL: case ByteCode.IMUL: case ByteCode.INVOKEINTERFACE: // case ByteCode.INVOKESPECIAL: // but needs to account for case ByteCode.INVOKEVIRTUAL: // pops 'this' (unless static) case ByteCode.IOR: case ByteCode.IREM: case ByteCode.IRETURN: case ByteCode.ISHL: case ByteCode.ISHR: case ByteCode.ISTORE: case ByteCode.ISTORE_0: case ByteCode.ISTORE_1: case ByteCode.ISTORE_2: case ByteCode.ISTORE_3: case ByteCode.ISUB: case ByteCode.IUSHR: case ByteCode.IXOR: case ByteCode.L2F: case ByteCode.L2I: case ByteCode.LOOKUPSWITCH: case ByteCode.LSHL: case ByteCode.LSHR: case ByteCode.LUSHR: case ByteCode.MONITORENTER: case ByteCode.MONITOREXIT: case ByteCode.POP: case ByteCode.PUTFIELD: case ByteCode.SALOAD: case ByteCode.TABLESWITCH: return -1; case ByteCode.ANEWARRAY: case ByteCode.ARRAYLENGTH: case ByteCode.BREAKPOINT: case ByteCode.CHECKCAST: case ByteCode.D2L: case ByteCode.DALOAD: case ByteCode.DNEG: case ByteCode.F2I: case ByteCode.FNEG: case ByteCode.GETSTATIC: case ByteCode.GOTO: case ByteCode.GOTO_W: case ByteCode.I2B: case ByteCode.I2C: case ByteCode.I2F: case ByteCode.I2S: case ByteCode.IINC: case ByteCode.IMPDEP1: case ByteCode.IMPDEP2: case ByteCode.INEG: case ByteCode.INSTANCEOF: case ByteCode.INVOKESTATIC: case ByteCode.L2D: case ByteCode.LALOAD: case ByteCode.LNEG: case ByteCode.NEWARRAY: case ByteCode.NOP: case ByteCode.PUTSTATIC: case ByteCode.RET: case ByteCode.RETURN: case ByteCode.SWAP: case ByteCode.WIDE: return 0; case ByteCode.ACONST_NULL: case ByteCode.ALOAD: case ByteCode.ALOAD_0: case ByteCode.ALOAD_1: case ByteCode.ALOAD_2: case ByteCode.ALOAD_3: case ByteCode.BIPUSH: case ByteCode.DUP: case ByteCode.DUP_X1: case ByteCode.DUP_X2: case ByteCode.F2D: case ByteCode.F2L: case ByteCode.FCONST_0: case ByteCode.FCONST_1: case ByteCode.FCONST_2: case ByteCode.FLOAD: case ByteCode.FLOAD_0: case ByteCode.FLOAD_1: case ByteCode.FLOAD_2: case ByteCode.FLOAD_3: case ByteCode.I2D: case ByteCode.I2L: case ByteCode.ICONST_0: case ByteCode.ICONST_1: case ByteCode.ICONST_2: case ByteCode.ICONST_3: case ByteCode.ICONST_4: case ByteCode.ICONST_5: case ByteCode.ICONST_M1: case ByteCode.ILOAD: case ByteCode.ILOAD_0: case ByteCode.ILOAD_1: case ByteCode.ILOAD_2: case ByteCode.ILOAD_3: case ByteCode.JSR: case ByteCode.JSR_W: case ByteCode.LDC: case ByteCode.LDC_W: case ByteCode.MULTIANEWARRAY: case ByteCode.NEW: case ByteCode.SIPUSH: return 1; case ByteCode.DCONST_0: case ByteCode.DCONST_1: case ByteCode.DLOAD: case ByteCode.DLOAD_0: case ByteCode.DLOAD_1: case ByteCode.DLOAD_2: case ByteCode.DLOAD_3: case ByteCode.DUP2: case ByteCode.DUP2_X1: case ByteCode.DUP2_X2: case ByteCode.LCONST_0: case ByteCode.LCONST_1: case ByteCode.LDC2_W: case ByteCode.LLOAD: case ByteCode.LLOAD_0: case ByteCode.LLOAD_1: case ByteCode.LLOAD_2: case ByteCode.LLOAD_3: return 2; } throw new IllegalArgumentException("Bad opcode: "+opcode); } /* * Number of bytes of operands generated after the opcode. * Not in use currently. */ /* int extra(int opcode) { switch (opcode) { case ByteCode.AALOAD: case ByteCode.AASTORE: case ByteCode.ACONST_NULL: case ByteCode.ALOAD_0: case ByteCode.ALOAD_1: case ByteCode.ALOAD_2: case ByteCode.ALOAD_3: case ByteCode.ARETURN: case ByteCode.ARRAYLENGTH: case ByteCode.ASTORE_0: case ByteCode.ASTORE_1: case ByteCode.ASTORE_2: case ByteCode.ASTORE_3: case ByteCode.ATHROW: case ByteCode.BALOAD: case ByteCode.BASTORE: case ByteCode.BREAKPOINT: case ByteCode.CALOAD: case ByteCode.CASTORE: case ByteCode.D2F: case ByteCode.D2I: case ByteCode.D2L: case ByteCode.DADD: case ByteCode.DALOAD: case ByteCode.DASTORE: case ByteCode.DCMPG: case ByteCode.DCMPL: case ByteCode.DCONST_0: case ByteCode.DCONST_1: case ByteCode.DDIV: case ByteCode.DLOAD_0: case ByteCode.DLOAD_1: case ByteCode.DLOAD_2: case ByteCode.DLOAD_3: case ByteCode.DMUL: case ByteCode.DNEG: case ByteCode.DREM: case ByteCode.DRETURN: case ByteCode.DSTORE_0: case ByteCode.DSTORE_1: case ByteCode.DSTORE_2: case ByteCode.DSTORE_3: case ByteCode.DSUB: case ByteCode.DUP2: case ByteCode.DUP2_X1: case ByteCode.DUP2_X2: case ByteCode.DUP: case ByteCode.DUP_X1: case ByteCode.DUP_X2: case ByteCode.F2D: case ByteCode.F2I: case ByteCode.F2L: case ByteCode.FADD: case ByteCode.FALOAD: case ByteCode.FASTORE: case ByteCode.FCMPG: case ByteCode.FCMPL: case ByteCode.FCONST_0: case ByteCode.FCONST_1: case ByteCode.FCONST_2: case ByteCode.FDIV: case ByteCode.FLOAD_0: case ByteCode.FLOAD_1: case ByteCode.FLOAD_2: case ByteCode.FLOAD_3: case ByteCode.FMUL: case ByteCode.FNEG: case ByteCode.FREM: case ByteCode.FRETURN: case ByteCode.FSTORE_0: case ByteCode.FSTORE_1: case ByteCode.FSTORE_2: case ByteCode.FSTORE_3: case ByteCode.FSUB: case ByteCode.I2B: case ByteCode.I2C: case ByteCode.I2D: case ByteCode.I2F: case ByteCode.I2L: case ByteCode.I2S: case ByteCode.IADD: case ByteCode.IALOAD: case ByteCode.IAND: case ByteCode.IASTORE: case ByteCode.ICONST_0: case ByteCode.ICONST_1: case ByteCode.ICONST_2: case ByteCode.ICONST_3: case ByteCode.ICONST_4: case ByteCode.ICONST_5: case ByteCode.ICONST_M1: case ByteCode.IDIV: case ByteCode.ILOAD_0: case ByteCode.ILOAD_1: case ByteCode.ILOAD_2: case ByteCode.ILOAD_3: case ByteCode.IMPDEP1: case ByteCode.IMPDEP2: case ByteCode.IMUL: case ByteCode.INEG: case ByteCode.IOR: case ByteCode.IREM: case ByteCode.IRETURN: case ByteCode.ISHL: case ByteCode.ISHR: case ByteCode.ISTORE_0: case ByteCode.ISTORE_1: case ByteCode.ISTORE_2: case ByteCode.ISTORE_3: case ByteCode.ISUB: case ByteCode.IUSHR: case ByteCode.IXOR: case ByteCode.L2D: case ByteCode.L2F: case ByteCode.L2I: case ByteCode.LADD: case ByteCode.LALOAD: case ByteCode.LAND: case ByteCode.LASTORE: case ByteCode.LCMP: case ByteCode.LCONST_0: case ByteCode.LCONST_1: case ByteCode.LDIV: case ByteCode.LLOAD_0: case ByteCode.LLOAD_1: case ByteCode.LLOAD_2: case ByteCode.LLOAD_3: case ByteCode.LMUL: case ByteCode.LNEG: case ByteCode.LOR: case ByteCode.LREM: case ByteCode.LRETURN: case ByteCode.LSHL: case ByteCode.LSHR: case ByteCode.LSTORE_0: case ByteCode.LSTORE_1: case ByteCode.LSTORE_2: case ByteCode.LSTORE_3: case ByteCode.LSUB: case ByteCode.LUSHR: case ByteCode.LXOR: case ByteCode.MONITORENTER: case ByteCode.MONITOREXIT: case ByteCode.NOP: case ByteCode.POP2: case ByteCode.POP: case ByteCode.RETURN: case ByteCode.SALOAD: case ByteCode.SASTORE: case ByteCode.SWAP: case ByteCode.WIDE: return 0; case ByteCode.ALOAD: case ByteCode.ASTORE: case ByteCode.BIPUSH: case ByteCode.DLOAD: case ByteCode.DSTORE: case ByteCode.FLOAD: case ByteCode.FSTORE: case ByteCode.ILOAD: case ByteCode.ISTORE: case ByteCode.LDC: case ByteCode.LLOAD: case ByteCode.LSTORE: case ByteCode.NEWARRAY: case ByteCode.RET: return 1; case ByteCode.ANEWARRAY: case ByteCode.CHECKCAST: case ByteCode.GETFIELD: case ByteCode.GETSTATIC: case ByteCode.GOTO: case ByteCode.IFEQ: case ByteCode.IFGE: case ByteCode.IFGT: case ByteCode.IFLE: case ByteCode.IFLT: case ByteCode.IFNE: case ByteCode.IFNONNULL: case ByteCode.IFNULL: case ByteCode.IF_ACMPEQ: case ByteCode.IF_ACMPNE: case ByteCode.IF_ICMPEQ: case ByteCode.IF_ICMPGE: case ByteCode.IF_ICMPGT: case ByteCode.IF_ICMPLE: case ByteCode.IF_ICMPLT: case ByteCode.IF_ICMPNE: case ByteCode.IINC: case ByteCode.INSTANCEOF: case ByteCode.INVOKEINTERFACE: case ByteCode.INVOKESPECIAL: case ByteCode.INVOKESTATIC: case ByteCode.INVOKEVIRTUAL: case ByteCode.JSR: case ByteCode.LDC2_W: case ByteCode.LDC_W: case ByteCode.NEW: case ByteCode.PUTFIELD: case ByteCode.PUTSTATIC: case ByteCode.SIPUSH: return 2; case ByteCode.MULTIANEWARRAY: return 3; case ByteCode.GOTO_W: case ByteCode.JSR_W: return 4; case ByteCode.LOOKUPSWITCH: // depends on alignment case ByteCode.TABLESWITCH: // depends on alignment return -1; } throw new IllegalArgumentException("Bad opcode: "+opcode); } */ private static String bytecodeStr(int code) { if (DEBUGSTACK || DEBUGCODE) { switch (code) { case ByteCode.NOP: return "nop"; case ByteCode.ACONST_NULL: return "aconst_null"; case ByteCode.ICONST_M1: return "iconst_m1"; case ByteCode.ICONST_0: return "iconst_0"; case ByteCode.ICONST_1: return "iconst_1"; case ByteCode.ICONST_2: return "iconst_2"; case ByteCode.ICONST_3: return "iconst_3"; case ByteCode.ICONST_4: return "iconst_4"; case ByteCode.ICONST_5: return "iconst_5"; case ByteCode.LCONST_0: return "lconst_0"; case ByteCode.LCONST_1: return "lconst_1"; case ByteCode.FCONST_0: return "fconst_0"; case ByteCode.FCONST_1: return "fconst_1"; case ByteCode.FCONST_2: return "fconst_2"; case ByteCode.DCONST_0: return "dconst_0"; case ByteCode.DCONST_1: return "dconst_1"; case ByteCode.BIPUSH: return "bipush"; case ByteCode.SIPUSH: return "sipush"; case ByteCode.LDC: return "ldc"; case ByteCode.LDC_W: return "ldc_w"; case ByteCode.LDC2_W: return "ldc2_w"; case ByteCode.ILOAD: return "iload"; case ByteCode.LLOAD: return "lload"; case ByteCode.FLOAD: return "fload"; case ByteCode.DLOAD: return "dload"; case ByteCode.ALOAD: return "aload"; case ByteCode.ILOAD_0: return "iload_0"; case ByteCode.ILOAD_1: return "iload_1"; case ByteCode.ILOAD_2: return "iload_2"; case ByteCode.ILOAD_3: return "iload_3"; case ByteCode.LLOAD_0: return "lload_0"; case ByteCode.LLOAD_1: return "lload_1"; case ByteCode.LLOAD_2: return "lload_2"; case ByteCode.LLOAD_3: return "lload_3"; case ByteCode.FLOAD_0: return "fload_0"; case ByteCode.FLOAD_1: return "fload_1"; case ByteCode.FLOAD_2: return "fload_2"; case ByteCode.FLOAD_3: return "fload_3"; case ByteCode.DLOAD_0: return "dload_0"; case ByteCode.DLOAD_1: return "dload_1"; case ByteCode.DLOAD_2: return "dload_2"; case ByteCode.DLOAD_3: return "dload_3"; case ByteCode.ALOAD_0: return "aload_0"; case ByteCode.ALOAD_1: return "aload_1"; case ByteCode.ALOAD_2: return "aload_2"; case ByteCode.ALOAD_3: return "aload_3"; case ByteCode.IALOAD: return "iaload"; case ByteCode.LALOAD: return "laload"; case ByteCode.FALOAD: return "faload"; case ByteCode.DALOAD: return "daload"; case ByteCode.AALOAD: return "aaload"; case ByteCode.BALOAD: return "baload"; case ByteCode.CALOAD: return "caload"; case ByteCode.SALOAD: return "saload"; case ByteCode.ISTORE: return "istore"; case ByteCode.LSTORE: return "lstore"; case ByteCode.FSTORE: return "fstore"; case ByteCode.DSTORE: return "dstore"; case ByteCode.ASTORE: return "astore"; case ByteCode.ISTORE_0: return "istore_0"; case ByteCode.ISTORE_1: return "istore_1"; case ByteCode.ISTORE_2: return "istore_2"; case ByteCode.ISTORE_3: return "istore_3"; case ByteCode.LSTORE_0: return "lstore_0"; case ByteCode.LSTORE_1: return "lstore_1"; case ByteCode.LSTORE_2: return "lstore_2"; case ByteCode.LSTORE_3: return "lstore_3"; case ByteCode.FSTORE_0: return "fstore_0"; case ByteCode.FSTORE_1: return "fstore_1"; case ByteCode.FSTORE_2: return "fstore_2"; case ByteCode.FSTORE_3: return "fstore_3"; case ByteCode.DSTORE_0: return "dstore_0"; case ByteCode.DSTORE_1: return "dstore_1"; case ByteCode.DSTORE_2: return "dstore_2"; case ByteCode.DSTORE_3: return "dstore_3"; case ByteCode.ASTORE_0: return "astore_0"; case ByteCode.ASTORE_1: return "astore_1"; case ByteCode.ASTORE_2: return "astore_2"; case ByteCode.ASTORE_3: return "astore_3"; case ByteCode.IASTORE: return "iastore"; case ByteCode.LASTORE: return "lastore"; case ByteCode.FASTORE: return "fastore"; case ByteCode.DASTORE: return "dastore"; case ByteCode.AASTORE: return "aastore"; case ByteCode.BASTORE: return "bastore"; case ByteCode.CASTORE: return "castore"; case ByteCode.SASTORE: return "sastore"; case ByteCode.POP: return "pop"; case ByteCode.POP2: return "pop2"; case ByteCode.DUP: return "dup"; case ByteCode.DUP_X1: return "dup_x1"; case ByteCode.DUP_X2: return "dup_x2"; case ByteCode.DUP2: return "dup2"; case ByteCode.DUP2_X1: return "dup2_x1"; case ByteCode.DUP2_X2: return "dup2_x2"; case ByteCode.SWAP: return "swap"; case ByteCode.IADD: return "iadd"; case ByteCode.LADD: return "ladd"; case ByteCode.FADD: return "fadd"; case ByteCode.DADD: return "dadd"; case ByteCode.ISUB: return "isub"; case ByteCode.LSUB: return "lsub"; case ByteCode.FSUB: return "fsub"; case ByteCode.DSUB: return "dsub"; case ByteCode.IMUL: return "imul"; case ByteCode.LMUL: return "lmul"; case ByteCode.FMUL: return "fmul"; case ByteCode.DMUL: return "dmul"; case ByteCode.IDIV: return "idiv"; case ByteCode.LDIV: return "ldiv"; case ByteCode.FDIV: return "fdiv"; case ByteCode.DDIV: return "ddiv"; case ByteCode.IREM: return "irem"; case ByteCode.LREM: return "lrem"; case ByteCode.FREM: return "frem"; case ByteCode.DREM: return "drem"; case ByteCode.INEG: return "ineg"; case ByteCode.LNEG: return "lneg"; case ByteCode.FNEG: return "fneg"; case ByteCode.DNEG: return "dneg"; case ByteCode.ISHL: return "ishl"; case ByteCode.LSHL: return "lshl"; case ByteCode.ISHR: return "ishr"; case ByteCode.LSHR: return "lshr"; case ByteCode.IUSHR: return "iushr"; case ByteCode.LUSHR: return "lushr"; case ByteCode.IAND: return "iand"; case ByteCode.LAND: return "land"; case ByteCode.IOR: return "ior"; case ByteCode.LOR: return "lor"; case ByteCode.IXOR: return "ixor"; case ByteCode.LXOR: return "lxor"; case ByteCode.IINC: return "iinc"; case ByteCode.I2L: return "i2l"; case ByteCode.I2F: return "i2f"; case ByteCode.I2D: return "i2d"; case ByteCode.L2I: return "l2i"; case ByteCode.L2F: return "l2f"; case ByteCode.L2D: return "l2d"; case ByteCode.F2I: return "f2i"; case ByteCode.F2L: return "f2l"; case ByteCode.F2D: return "f2d"; case ByteCode.D2I: return "d2i"; case ByteCode.D2L: return "d2l"; case ByteCode.D2F: return "d2f"; case ByteCode.I2B: return "i2b"; case ByteCode.I2C: return "i2c"; case ByteCode.I2S: return "i2s"; case ByteCode.LCMP: return "lcmp"; case ByteCode.FCMPL: return "fcmpl"; case ByteCode.FCMPG: return "fcmpg"; case ByteCode.DCMPL: return "dcmpl"; case ByteCode.DCMPG: return "dcmpg"; case ByteCode.IFEQ: return "ifeq"; case ByteCode.IFNE: return "ifne"; case ByteCode.IFLT: return "iflt"; case ByteCode.IFGE: return "ifge"; case ByteCode.IFGT: return "ifgt"; case ByteCode.IFLE: return "ifle"; case ByteCode.IF_ICMPEQ: return "if_icmpeq"; case ByteCode.IF_ICMPNE: return "if_icmpne"; case ByteCode.IF_ICMPLT: return "if_icmplt"; case ByteCode.IF_ICMPGE: return "if_icmpge"; case ByteCode.IF_ICMPGT: return "if_icmpgt"; case ByteCode.IF_ICMPLE: return "if_icmple"; case ByteCode.IF_ACMPEQ: return "if_acmpeq"; case ByteCode.IF_ACMPNE: return "if_acmpne"; case ByteCode.GOTO: return "goto"; case ByteCode.JSR: return "jsr"; case ByteCode.RET: return "ret"; case ByteCode.TABLESWITCH: return "tableswitch"; case ByteCode.LOOKUPSWITCH: return "lookupswitch"; case ByteCode.IRETURN: return "ireturn"; case ByteCode.LRETURN: return "lreturn"; case ByteCode.FRETURN: return "freturn"; case ByteCode.DRETURN: return "dreturn"; case ByteCode.ARETURN: return "areturn"; case ByteCode.RETURN: return "return"; case ByteCode.GETSTATIC: return "getstatic"; case ByteCode.PUTSTATIC: return "putstatic"; case ByteCode.GETFIELD: return "getfield"; case ByteCode.PUTFIELD: return "putfield"; case ByteCode.INVOKEVIRTUAL: return "invokevirtual"; case ByteCode.INVOKESPECIAL: return "invokespecial"; case ByteCode.INVOKESTATIC: return "invokestatic"; case ByteCode.INVOKEINTERFACE: return "invokeinterface"; case ByteCode.NEW: return "new"; case ByteCode.NEWARRAY: return "newarray"; case ByteCode.ANEWARRAY: return "anewarray"; case ByteCode.ARRAYLENGTH: return "arraylength"; case ByteCode.ATHROW: return "athrow"; case ByteCode.CHECKCAST: return "checkcast"; case ByteCode.INSTANCEOF: return "instanceof"; case ByteCode.MONITORENTER: return "monitorenter"; case ByteCode.MONITOREXIT: return "monitorexit"; case ByteCode.WIDE: return "wide"; case ByteCode.MULTIANEWARRAY: return "multianewarray"; case ByteCode.IFNULL: return "ifnull"; case ByteCode.IFNONNULL: return "ifnonnull"; case ByteCode.GOTO_W: return "goto_w"; case ByteCode.JSR_W: return "jsr_w"; case ByteCode.BREAKPOINT: return "breakpoint"; case ByteCode.IMPDEP1: return "impdep1"; case ByteCode.IMPDEP2: return "impdep2"; } } return ""; } final char[] getCharBuffer(int minimalSize) { if (minimalSize > tmpCharBuffer.length) { int newSize = tmpCharBuffer.length * 2; if (minimalSize > newSize) { newSize = minimalSize; } tmpCharBuffer = new char[newSize]; } return tmpCharBuffer; } private static final int LineNumberTableSize = 16; private static final int ExceptionTableSize = 4; private final static long FileHeaderConstant = 0xCAFEBABE0003002DL; // Set DEBUG flags to true to get better checking and progress info. private static final boolean DEBUGSTACK = false; private static final boolean DEBUGLABELS = false; private static final boolean DEBUGCODE = false; private String generatedClassName; private ExceptionTableEntry itsExceptionTable[]; private int itsExceptionTableTop; private int itsLineNumberTable[]; // pack start_pc & line_number together private int itsLineNumberTableTop; private byte[] itsCodeBuffer = new byte[256]; private int itsCodeBufferTop; private ConstantPool itsConstantPool; private ClassFileMethod itsCurrentMethod; private short itsStackTop; private short itsMaxStack; private short itsMaxLocals; private ObjArray itsMethods = new ObjArray(); private ObjArray itsFields = new ObjArray(); private ObjArray itsInterfaces = new ObjArray(); private short itsFlags; private short itsThisClassIndex; private short itsSuperClassIndex; private short itsSourceFileNameIndex; private static final int MIN_LABEL_TABLE_SIZE = 32; private int[] itsLabelTable; private int itsLabelTableTop; // itsFixupTable[i] = (label_index << 32) | fixup_site private static final int MIN_FIXUP_TABLE_SIZE = 40; private long[] itsFixupTable; private int itsFixupTableTop; private ObjArray itsVarDescriptors; private char[] tmpCharBuffer = new char[64]; } final class ExceptionTableEntry { ExceptionTableEntry(int startLabel, int endLabel, int handlerLabel, short catchType) { itsStartLabel = startLabel; itsEndLabel = endLabel; itsHandlerLabel = handlerLabel; itsCatchType = catchType; } int itsStartLabel; int itsEndLabel; int itsHandlerLabel; short itsCatchType; } final class ClassFileField { ClassFileField(short nameIndex, short typeIndex, short flags) { itsNameIndex = nameIndex; itsTypeIndex = typeIndex; itsFlags = flags; itsHasAttributes = false; } void setAttributes(short attr1, short attr2, short attr3, int index) { itsHasAttributes = true; itsAttr1 = attr1; itsAttr2 = attr2; itsAttr3 = attr3; itsIndex = index; } int write(byte[] data, int offset) { offset = ClassFileWriter.putInt16(itsFlags, data, offset); offset = ClassFileWriter.putInt16(itsNameIndex, data, offset); offset = ClassFileWriter.putInt16(itsTypeIndex, data, offset); if (!itsHasAttributes) { // write 0 attributes offset = ClassFileWriter.putInt16(0, data, offset); } else { offset = ClassFileWriter.putInt16(1, data, offset); offset = ClassFileWriter.putInt16(itsAttr1, data, offset); offset = ClassFileWriter.putInt16(itsAttr2, data, offset); offset = ClassFileWriter.putInt16(itsAttr3, data, offset); offset = ClassFileWriter.putInt16(itsIndex, data, offset); } return offset; } int getWriteSize() { int size = 2 * 3; if (!itsHasAttributes) { size += 2; } else { size += 2 + 2 * 4; } return size; } private short itsNameIndex; private short itsTypeIndex; private short itsFlags; private boolean itsHasAttributes; private short itsAttr1, itsAttr2, itsAttr3; private int itsIndex; } final class ClassFileMethod { ClassFileMethod(short nameIndex, short typeIndex, short flags) { itsNameIndex = nameIndex; itsTypeIndex = typeIndex; itsFlags = flags; } void setCodeAttribute(byte codeAttribute[]) { itsCodeAttribute = codeAttribute; } int write(byte[] data, int offset) { offset = ClassFileWriter.putInt16(itsFlags, data, offset); offset = ClassFileWriter.putInt16(itsNameIndex, data, offset); offset = ClassFileWriter.putInt16(itsTypeIndex, data, offset); // Code attribute only offset = ClassFileWriter.putInt16(1, data, offset); System.arraycopy(itsCodeAttribute, 0, data, offset, itsCodeAttribute.length); offset += itsCodeAttribute.length; return offset; } int getWriteSize() { return 2 * 4 + itsCodeAttribute.length; } private short itsNameIndex; private short itsTypeIndex; private short itsFlags; private byte[] itsCodeAttribute; } final class ConstantPool { ConstantPool(ClassFileWriter cfw) { this.cfw = cfw; itsTopIndex = 1; // the zero'th entry is reserved itsPool = new byte[ConstantPoolSize]; itsTop = 0; } private static final int ConstantPoolSize = 256; private static final byte CONSTANT_Class = 7, CONSTANT_Fieldref = 9, CONSTANT_Methodref = 10, CONSTANT_InterfaceMethodref = 11, CONSTANT_String = 8, CONSTANT_Integer = 3, CONSTANT_Float = 4, CONSTANT_Long = 5, CONSTANT_Double = 6, CONSTANT_NameAndType = 12, CONSTANT_Utf8 = 1; int write(byte[] data, int offset) { offset = ClassFileWriter.putInt16((short)itsTopIndex, data, offset); System.arraycopy(itsPool, 0, data, offset, itsTop); offset += itsTop; return offset; } int getWriteSize() { return 2 + itsTop; } int addConstant(int k) { ensure(5); itsPool[itsTop++] = CONSTANT_Integer; itsTop = ClassFileWriter.putInt32(k, itsPool, itsTop); return (short)(itsTopIndex++); } int addConstant(long k) { ensure(9); itsPool[itsTop++] = CONSTANT_Long; itsTop = ClassFileWriter.putInt64(k, itsPool, itsTop); int index = itsTopIndex; itsTopIndex += 2; return index; } int addConstant(float k) { ensure(5); itsPool[itsTop++] = CONSTANT_Float; int bits = Float.floatToIntBits(k); itsTop = ClassFileWriter.putInt32(bits, itsPool, itsTop); return itsTopIndex++; } int addConstant(double k) { ensure(9); itsPool[itsTop++] = CONSTANT_Double; long bits = Double.doubleToLongBits(k); itsTop = ClassFileWriter.putInt64(bits, itsPool, itsTop); int index = itsTopIndex; itsTopIndex += 2; return index; } int addConstant(String k) { int utf8Index = 0xFFFF & addUtf8(k); int theIndex = itsStringConstHash.getInt(utf8Index, -1); if (theIndex == -1) { theIndex = itsTopIndex++; ensure(3); itsPool[itsTop++] = CONSTANT_String; itsTop = ClassFileWriter.putInt16(utf8Index, itsPool, itsTop); itsStringConstHash.put(utf8Index, theIndex); } return theIndex; } boolean isUnderUtfEncodingLimit(String s) { int strLen = s.length(); if (strLen * 3 <= MAX_UTF_ENCODING_SIZE) { return true; } else if (strLen > MAX_UTF_ENCODING_SIZE) { return false; } return strLen == getUtfEncodingLimit(s, 0, strLen); } /** * Get maximum i such that <tt>start <= i <= end</tt> and * <tt>s.substring(start, i)</tt> fits JVM UTF string encoding limit. */ int getUtfEncodingLimit(String s, int start, int end) { if ((end - start) * 3 <= MAX_UTF_ENCODING_SIZE) { return end; } int limit = MAX_UTF_ENCODING_SIZE; for (int i = start; i != end; i++) { int c = s.charAt(i); if (0 != c && c <= 0x7F) { --limit; } else if (c < 0x7FF) { limit -= 2; } else { limit -= 3; } if (limit < 0) { return i; } } return end; } short addUtf8(String k) { int theIndex = itsUtf8Hash.get(k, -1); if (theIndex == -1) { int strLen = k.length(); boolean tooBigString; if (strLen > MAX_UTF_ENCODING_SIZE) { tooBigString = true; } else { tooBigString = false; // Ask for worst case scenario buffer when each char takes 3 // bytes ensure(1 + 2 + strLen * 3); int top = itsTop; itsPool[top++] = CONSTANT_Utf8; top += 2; // skip length char[] chars = cfw.getCharBuffer(strLen); k.getChars(0, strLen, chars, 0); for (int i = 0; i != strLen; i++) { int c = chars[i]; if (c != 0 && c <= 0x7F) { itsPool[top++] = (byte)c; } else if (c > 0x7FF) { itsPool[top++] = (byte)(0xE0 | (c >> 12)); itsPool[top++] = (byte)(0x80 | ((c >> 6) & 0x3F)); itsPool[top++] = (byte)(0x80 | (c & 0x3F)); } else { itsPool[top++] = (byte)(0xC0 | (c >> 6)); itsPool[top++] = (byte)(0x80 | (c & 0x3F)); } } int utfLen = top - (itsTop + 1 + 2); if (utfLen > MAX_UTF_ENCODING_SIZE) { tooBigString = true; } else { // Write back length itsPool[itsTop + 1] = (byte)(utfLen >>> 8); itsPool[itsTop + 2] = (byte)utfLen; itsTop = top; theIndex = itsTopIndex++; itsUtf8Hash.put(k, theIndex); } } if (tooBigString) { throw new IllegalArgumentException("Too big string"); } } return (short)theIndex; } private short addNameAndType(String name, String type) { short nameIndex = addUtf8(name); short typeIndex = addUtf8(type); ensure(5); itsPool[itsTop++] = CONSTANT_NameAndType; itsTop = ClassFileWriter.putInt16(nameIndex, itsPool, itsTop); itsTop = ClassFileWriter.putInt16(typeIndex, itsPool, itsTop); return (short)(itsTopIndex++); } short addClass(String className) { int theIndex = itsClassHash.get(className, -1); if (theIndex == -1) { String slashed = className; if (className.indexOf('.') > 0) { slashed = ClassFileWriter.getSlashedForm(className); theIndex = itsClassHash.get(slashed, -1); if (theIndex != -1) { itsClassHash.put(className, theIndex); } } if (theIndex == -1) { int utf8Index = addUtf8(slashed); ensure(3); itsPool[itsTop++] = CONSTANT_Class; itsTop = ClassFileWriter.putInt16(utf8Index, itsPool, itsTop); theIndex = itsTopIndex++; itsClassHash.put(slashed, theIndex); if (className != slashed) { itsClassHash.put(className, theIndex); } } } return (short)theIndex; } short addFieldRef(String className, String fieldName, String fieldType) { FieldOrMethodRef ref = new FieldOrMethodRef(className, fieldName, fieldType); int theIndex = itsFieldRefHash.get(ref, -1); if (theIndex == -1) { short ntIndex = addNameAndType(fieldName, fieldType); short classIndex = addClass(className); ensure(5); itsPool[itsTop++] = CONSTANT_Fieldref; itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); theIndex = itsTopIndex++; itsFieldRefHash.put(ref, theIndex); } return (short)theIndex; } short addMethodRef(String className, String methodName, String methodType) { FieldOrMethodRef ref = new FieldOrMethodRef(className, methodName, methodType); int theIndex = itsMethodRefHash.get(ref, -1); if (theIndex == -1) { short ntIndex = addNameAndType(methodName, methodType); short classIndex = addClass(className); ensure(5); itsPool[itsTop++] = CONSTANT_Methodref; itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); theIndex = itsTopIndex++; itsMethodRefHash.put(ref, theIndex); } return (short)theIndex; } short addInterfaceMethodRef(String className, String methodName, String methodType) { short ntIndex = addNameAndType(methodName, methodType); short classIndex = addClass(className); ensure(5); itsPool[itsTop++] = CONSTANT_InterfaceMethodref; itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); return (short)(itsTopIndex++); } void ensure(int howMuch) { if (itsTop + howMuch > itsPool.length) { int newCapacity = itsPool.length * 2; if (itsTop + howMuch > newCapacity) { newCapacity = itsTop + howMuch; } byte[] tmp = new byte[newCapacity]; System.arraycopy(itsPool, 0, tmp, 0, itsTop); itsPool = tmp; } } private ClassFileWriter cfw; private static final int MAX_UTF_ENCODING_SIZE = 65535; private UintMap itsStringConstHash = new UintMap(); private ObjToIntMap itsUtf8Hash = new ObjToIntMap(); private ObjToIntMap itsFieldRefHash = new ObjToIntMap(); private ObjToIntMap itsMethodRefHash = new ObjToIntMap(); private ObjToIntMap itsClassHash = new ObjToIntMap(); private int itsTop; private int itsTopIndex; private byte itsPool[]; } final class FieldOrMethodRef { FieldOrMethodRef(String className, String name, String type) { this.className = className; this.name = name; this.type = type; } public boolean equals(Object obj) { if (!(obj instanceof FieldOrMethodRef)) { return false; } FieldOrMethodRef x = (FieldOrMethodRef)obj; return className.equals(x.className) && name.equals(x.name) && type.equals(x.type); } public int hashCode() { if (hashCode == -1) { int h1 = className.hashCode(); int h2 = name.hashCode(); int h3 = type.hashCode(); hashCode = h1 ^ h2 ^ h3; } return hashCode; } private String className; private String name; private String type; private int hashCode = -1; }
375a17b8bdd4106d0acc0519242824a6716c7207
052f537114ddcd89f3a6c164cd376803637c96a9
/server/src/com/growcontrol/common/meta/MetaListener.java
f2d662e33a38cf7b3f3b05ee1684fe45c864ef80
[]
no_license
MasterCATZ/GrowControl
70ae600460dfd79eb4fbdf58589db2623be6c944
d317dfe996acdfe5616030dbbd98ed7d38c20978
refs/heads/master
2021-01-15T23:45:36.679911
2015-07-31T07:17:30
2015-07-31T07:17:30
39,931,252
0
0
null
2015-07-31T07:17:30
2015-07-30T04:28:19
Java
UTF-8
Java
false
false
200
java
package com.growcontrol.common.meta; import com.poixson.commonjava.EventListener.xListener; public interface MetaListener extends xListener { public void onMetaEvent(final MetaEvent event); }
e30bcc5ee8ac6aa10ca6d673ca0971fc06110b85
4068bfae10bdf240804ec426a24f94af398890c7
/guns-admin/src/main/java/com/stylefeng/guns/modular/ccc/service/impl/AutoPartsServiceImpl.java
6e0aa5fee552f81a7a56db3517f8d611342c6758
[ "Apache-2.0" ]
permissive
csg103/ccc
a1ed93cba262ec4bd70b4cf97b55bcd61b4f7b9d
4317a27260a2b85e0033838cb8161c06ce5ec55c
refs/heads/master
2020-05-23T20:39:01.232560
2019-05-16T02:40:27
2019-05-16T02:40:33
186,935,600
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.stylefeng.guns.modular.ccc.service.impl; import com.stylefeng.guns.modular.system.model.AutoParts; import com.stylefeng.guns.modular.system.dao.AutoPartsMapper; import com.stylefeng.guns.modular.ccc.service.IAutoPartsService; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * ้›ถ้ƒจไปถ ๆœๅŠกๅฎž็Žฐ็ฑป * </p> * * @author zhaokai * @since 2019-03-12 */ @Service public class AutoPartsServiceImpl extends ServiceImpl<AutoPartsMapper, AutoParts> implements IAutoPartsService { }
fd1fefedbbdd95489e3ea99e44a53fb350dc3951
9d18517b51e3b28e6ae607f63eb6b1b96581800b
/src/random_problem_solving/QueensAttack.java
c12ace65947aba41647f8b5b769006969a401e87
[]
no_license
iamshivamrathore/PracticeQuestion
ea74ed4962c0f41f5f6fd74933ff0fb8d6f8d6f5
85c08cfd16a96c144f5193a9c74ccb67954126bf
refs/heads/master
2020-03-22T12:49:52.812715
2019-12-15T21:15:10
2019-12-15T21:15:10
140,065,106
0
0
null
null
null
null
UTF-8
Java
false
false
4,278
java
package random_problem_solving; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Scanner; import java.util.Set; public class QueensAttack { static int queensAttack(int n, int k, int r_q, int c_q, int[][] obstacles) { r_q--; c_q--; Map<Integer, Set<Integer>> map = new HashMap<>(); for (int i = 0; i < obstacles.length; i++) { int x = obstacles[i][0] - 1; int y = obstacles[i][1] - 1; if (map.containsKey(x)) { map.get(x).add(y); } else { Set<Integer> set = new HashSet<>(); set.add(y); map.put(x, set); } } // System.out.println("Map : " + map); int bottomLeft = calcBottomLeft(n, r_q, c_q, map); // System.out.println("Bottom Left : " + bottomLeft); int bottomRight = calcBottomRight(n, r_q, c_q, map); // System.out.println("Bottom Right: " + bottomRight); int topLeft = calcTopLeft(n, r_q, c_q, map); // System.out.println("Top Left : " + topLeft); int topRight = calcTopRight(n, r_q, c_q, map); // System.out.println("Top Right: " + topRight); int top = calcTop(n, r_q, c_q, map); // System.out.println("Top : " + top); int bottom = calcBottom(n, r_q, c_q, map); // System.out.println("Bottom : " + bottom); int left = calcLeft(n, r_q, c_q, map); // System.out.println("Left : " + left); int right = calcRight(n, r_q, c_q, map); // System.out.println("Right : " + right); return bottomLeft + bottomRight + topLeft + topRight + top + bottom + left + right; } static int calcBottomLeft(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q - 1, j = c_q - 1; i >= 0 && j >= 0; i--, j--) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcBottomRight(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q - 1, j = c_q + 1; i >= 0 && j < n; i--, j++) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcTopRight(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q + 1, j = c_q + 1; i < n && j < n; i++, j++) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcTopLeft(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q + 1, j = c_q - 1; i < n && j >= 0; i++, j--) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcLeft(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q, j = c_q - 1; j >= 0; j--) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcRight(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q, j = c_q + 1; j < n; j++) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcTop(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q + 1, j = c_q; i < n; i++) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } static int calcBottom(int n, int r_q, int c_q, Map<Integer, Set<Integer>> map) { int result = 0; for (int i = r_q - 1, j = c_q; i >= 0; i--) { if (map.containsKey(i) && map.get(i).contains(j)) { return result; } else { result++; } } return result; } public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int n = s.nextInt(); int k = s.nextInt(); int r_q = s.nextInt(); int c_q = s.nextInt(); int obstacles[][] = new int[k][2]; for (int i = 0; i < k; i++) { obstacles[i][0] = s.nextInt(); obstacles[i][1] = s.nextInt(); } s.close(); int result = queensAttack(n, k, r_q, c_q, obstacles); System.out.println("Result : " + result); } }
aa86b95db84e3d94f21cae0236a97e8603778533
4b8730e44af46df5d780c4c34b84ea97c657579e
/app/src/main/java/br/com/jsmaker/thesimpsons/event/PersonagemEvent.java
3c623be193696abec9e6dcf05891a71d877a0318
[]
no_license
jacsonsantos/app-meetup-gdg
bf48836d78eb120c4fd4c58c4996b7342c3ec14e
f1f969a25c305be11272f500914c59e456ff4d86
refs/heads/master
2021-01-24T03:12:50.276268
2018-02-26T16:51:23
2018-02-26T16:51:23
122,882,386
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package br.com.jsmaker.thesimpsons.event; import java.util.List; import br.com.jsmaker.thesimpsons.model.Personagem; /** * Created by jacson on 26/02/18. */ public class PersonagemEvent { private List<Personagem> listaPersonagens; public PersonagemEvent(List<Personagem> listaPersonagens){ this.listaPersonagens = listaPersonagens; } public List<Personagem> getListaPersonagens() { return listaPersonagens; } public void setListaPersonagens(List<Personagem> listaPersonagens) { this.listaPersonagens = listaPersonagens; } }
bedfa2d8f095ffc8cbd2c38965da6fa3def06442
7d57eca479043bc644ace3910e19064ef177f866
/src/main/java/org/itstep/domain/entity/CustomUser.java
cddee900ca1a40051e4851f4b958b6404bd0fe48
[]
no_license
kukuyashnyy/hw-spring-formatter-validator
d323664e84a539fe5e7710efbd166fb41ec8a7f2
f4fdefa4d6fc839296a2ffdfc8dcdf5062d0224e
refs/heads/master
2023-04-03T01:41:41.139174
2021-03-22T21:16:03
2021-03-22T21:16:03
349,568,753
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package org.itstep.domain.entity; import lombok.*; import javax.persistence.*; @Entity @Table(name = "custom_users") @Data @NoArgsConstructor @RequiredArgsConstructor public class CustomUser { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @NonNull private String login; @NonNull private String password; }
629821f7a371ff90bf421b267e7f04a8c4003457
824ca0e78025a5f231c8b27acc200b1f7363287b
/ConcurrencyControl/src/com/bill/example/TaskWithResult.java
1fb230ec6986be89017edff47ca02ebe5ee416ba
[]
no_license
lber19535/TinkingInJava
211a24f7318ef6bdbb4e439b0bde5b9c05fddfd7
31f729efc47da7b17959f512edcc15112e38a69e
refs/heads/master
2020-12-24T13:52:16.985319
2014-12-30T08:06:28
2014-12-30T08:06:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
623
java
package com.bill.example; import java.util.Random; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; /** * Created by Bill on 2014/12/22. */ public class TaskWithResult implements Callable<String> { private int taskId; private int waitTime; public TaskWithResult(int taskId) { Random rand = new Random(System.nanoTime()); this.waitTime = rand.nextInt(5); this.taskId = taskId; } @Override public String call() throws Exception { TimeUnit.SECONDS.sleep(waitTime); return "result with " + taskId + " watit " + waitTime; } }
5787069403dc27e7bd9ab42628a178e19f604eb6
e4d04a8393293eb9c064d98915aacbf4d2f86364
/src/servlet/quit.java
55febdeae116727751e9e926cdd6604ab25e42d2
[]
no_license
xiaowenjie0722/crm
3fced3a9cc211958186bcbb47b7150b3db39b1ce
df4160a38e6e09b6746f87ccec2cb2213284b947
refs/heads/master
2020-09-07T20:58:28.359133
2019-11-11T07:01:09
2019-11-11T07:01:09
220,911,488
1
0
null
null
null
null
UTF-8
Java
false
false
1,561
java
package servlet; import util.OutputUtil; import util.TimeUtil; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.File; import java.io.IOException; @WebServlet("/quit") public class quit extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session=req.getSession(); int limit_id=(int)session.getAttribute("id"); File file=new File(req.getServletContext().getRealPath("")+limit_id+"_log.txt"); if (!file.exists()){ file.createNewFile(); } try { String log = TimeUtil.time() + " ็”จๆˆท๏ผš" + session.getAttribute("name") + " ็ผ–ๅท๏ผš" + session.getAttribute("id") + " ๆ“ไฝœ๏ผš้€€ๅ‡บ็™ปๅฝ•" ; System.out.println(log); OutputUtil.output(log, req.getServletContext().getRealPath("") + limit_id+"_log.txt"); } catch (Exception e) { System.out.println("ๅ†™ๅ…ฅๆ—ฅๅฟ—ๆ–‡ไปถๅผ‚ๅธธ" + e.getMessage()); } session.invalidate(); req.getRequestDispatcher("login.jsp").forward(req,resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { super.doPost(req, resp); } }
2627ab22da966276f316399552be15a06c1ed5cf
691df4367943c833f08f2ebf4efb3301a0ae6c59
/APPInfo/src/cn/appsys/controller/Backend_userLoginController.java
a74a3f631e25f1ad500a61fb1c6ddef1800988fa
[]
no_license
ZhangZZF/APPInfoSystem
a0453c25a9b899051ffa4eafc46108f41794a3cf
8ff2da0cdc834e9f5879cbdd57a892f2ae69c904
refs/heads/master
2021-05-10T08:29:41.028943
2018-01-26T01:41:05
2018-01-26T01:41:05
118,891,194
0
0
null
null
null
null
UTF-8
Java
false
false
1,502
java
package cn.appsys.controller; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import cn.appsys.pojo.Backend_user; import cn.appsys.pojo.Dev_user; import cn.appsys.service.Backend_user.Backend_userService; import cn.appsys.tools.Constants; @Controller public class Backend_userLoginController { private Logger logger=Logger.getLogger(Backend_userLoginController.class); @Resource private Backend_userService backend_userService; //็‚นๅ‡ปๅŽๅฐ่ทณ่ฝฌๅˆฐ็™ปๅฝ•้กต้ข @RequestMapping(value="/backenddologin") public String dologin(){ return "/backendlogin"; } //็™ปๅฝ•้ชŒ่ฏ @RequestMapping(value="/backendlogin",method=RequestMethod.POST) public String dologin(@RequestParam String userCode, @RequestParam String userPassword, HttpServletRequest request, HttpSession session)throws Exception{ Backend_user backend_user=backend_userService.login(userCode, userPassword); if (null!=backend_user) { session.setAttribute(Constants.USER_SESSION, backend_user); return "/backend/main"; }else{ request.setAttribute("error", "็”จๆˆทๅๆˆ–ๅฏ†็ ไธๆญฃ็กฎ"); return "/backendlogin"; } } }
[ "Administrator@PC-20170730GYMU" ]
Administrator@PC-20170730GYMU
dcbaa0b6aa02281fabec69979707f24e2967367e
0b26aac6cb5103a25ee1cf73663a3e0adff780b4
/kubernetes/src/test/java/io/kubernetes/client/openapi/models/ExtensionsV1beta1SupplementalGroupsStrategyOptionsTest.java
c860562fd82fdb90c9735e96f3f05b7be7d078f4
[ "Apache-2.0" ]
permissive
wings-software/java
b7b551989aaf6a943b0f9bf26c4e030ddc6a99f6
ec60b5246a444631fb1a2c72bda6bfb901679bef
refs/heads/master
2020-09-20T14:28:47.084448
2019-12-18T20:41:46
2019-12-18T20:41:46
224,510,803
1
0
Apache-2.0
2019-12-18T20:41:47
2019-11-27T20:21:05
null
UTF-8
Java
false
false
1,718
java
/* * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.15.6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package io.kubernetes.client.openapi.models; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.kubernetes.client.openapi.models.ExtensionsV1beta1IDRange; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** * Model tests for ExtensionsV1beta1SupplementalGroupsStrategyOptions */ public class ExtensionsV1beta1SupplementalGroupsStrategyOptionsTest { private final ExtensionsV1beta1SupplementalGroupsStrategyOptions model = new ExtensionsV1beta1SupplementalGroupsStrategyOptions(); /** * Model tests for ExtensionsV1beta1SupplementalGroupsStrategyOptions */ @Test public void testExtensionsV1beta1SupplementalGroupsStrategyOptions() { // TODO: test ExtensionsV1beta1SupplementalGroupsStrategyOptions } /** * Test the property 'ranges' */ @Test public void rangesTest() { // TODO: test ranges } /** * Test the property 'rule' */ @Test public void ruleTest() { // TODO: test rule } }
730feb2252f27023b40c5e67e9b3afd1c0ab2107
a8abdd3257b0ecc80f58a0da719b3ddad37b7daa
/src/main/java/com/designpattern/designpattern/singleton/v3/InnerClassSingletonTest.java
9bf2cd146cf64daa11446c25b9175345f660ab11
[]
no_license
developerhyy/designpattern
bc866a1c53ca906a159030c980de8d06f303bbf2
5bfba9ba685121f8bba1f55d613b571e402e4b0a
refs/heads/master
2022-06-23T00:21:53.633558
2020-03-03T15:55:10
2020-03-03T15:55:10
244,670,278
0
0
null
2022-06-21T02:54:54
2020-03-03T15:20:41
Java
UTF-8
Java
false
false
2,674
java
package com.designpattern.designpattern.singleton.v3; import java.io.*; import java.lang.reflect.InvocationTargetException; /** * @author ่…พ่ฎฏ่ฏพๅ ‚-ๅ›พ็ตๅญฆ้™ข ้ƒญๅ˜‰ * @Slogan ่‡ดๆ•ฌๅคงๅธˆ๏ผŒ่‡ดๆ•ฌๆœชๆฅ็š„ไฝ  */ public class InnerClassSingletonTest { public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException { // InnerClassSingleton instance=InnerClassSingleton.getInstance(); // InnerClassSingleton instance1=InnerClassSingleton.getInstance(); // // System.out.println(instance==instance1); // System.out.println(InnerClassSingleton.name); // Constructor<InnerClassSingleton> declaredConstructor=InnerClassSingleton.class.getDeclaredConstructor(); // declaredConstructor.setAccessible( true ); // InnerClassSingleton innerClassSingleton=declaredConstructor.newInstance(); // InnerClassSingleton instance=InnerClassSingleton.getInstance(); // // System.out.println(innerClassSingleton==instance); InnerClassSingleton instance=InnerClassSingleton.getInstance(); // try(ObjectOutputStream oos=new ObjectOutputStream( new FileOutputStream( "instance" ) )) { // oos.writeObject( instance ); // } try (ObjectInputStream ois=new ObjectInputStream( new FileInputStream( "instance" ) )) { InnerClassSingleton innerClassSingleton=(InnerClassSingleton) ois.readObject(); System.out.println( innerClassSingleton == instance ); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } class InnerClassSingleton implements Serializable { // private static final long serialVersionUID = 6922639953390195232L; // private static final long serialVersionUID = 42L; public static String name="yyy"; public static String name1="yyy"; public static String name2="yyy"; static { System.out.println( " InnerClassSingleton " ); // 1 } private InnerClassSingleton() { if (SingletonHolder.instance != null) { throw new RuntimeException( " ไธๅ…่ฎธๅคšไธชๅฎžไพ‹ใ€‚" ); } } public static InnerClassSingleton getInstance() { return SingletonHolder.instance; } Object readResolve() throws ObjectStreamException { return SingletonHolder.instance; } private static class SingletonHolder { private static InnerClassSingleton instance=new InnerClassSingleton(); static { System.out.println( " SingletonHolder " );// 2 } } }
6abda91ceb0790419923b23fd99adc50e69560fb
c7506de457032236390ecfffeedb2a6f462d5be9
/e3managerservice/src/main/java/cn/e3mall/service/impl/ItemServiceImpl.java
bf533988b4a97a2f21da2844f1791c585829a591
[]
no_license
yclvergil/pj
541de175acc8e09edc157783625250afac13b9a2
b5688cc2c5c963c31e0d50d87fc4caf76d697bb4
refs/heads/master
2021-01-20T00:27:23.971130
2017-04-23T09:02:47
2017-04-23T09:02:47
89,129,611
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package cn.e3mall.service.impl; import cn.e3mall.mapper.TbItemMapper; import cn.e3mall.pojo.TbItem; import cn.e3mall.service.ItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * Created by cl on 2017/4/23. */ @Service public class ItemServiceImpl implements ItemService { @Autowired private TbItemMapper itemMapper; @Override public TbItem getItemById(long itemId) { //ๆ นๆฎไธป้”ฎๆŸฅ่ฏข TbItem item = itemMapper.selectByPrimaryKey(itemId); return item; } }
40ef99e33eeffd70f1ef18e3e73788579677bd9c
8b24ebd2a50f9b05698bf415811335ae41761e69
/src/campsg/zhongchou/filter/UserFilter.java
bfe99f22f61968adc470410ec5c1497ce28af1e7
[]
no_license
thirdkiller/CrowdFounding
b026323fdfb3b2c3ac84e70c4cdab44a74cf00f3
1c5062ac9a664b8a455375dfbc01b675c787d30f
refs/heads/master
2020-06-04T04:49:38.320504
2019-05-27T15:31:31
2019-05-27T15:31:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,034
java
package campsg.zhongchou.filter;/** * @author ไฝœ่€… E-mail: * @date ๅˆ›ๅปบๆ—ถ้—ด๏ผš2016ๅนด12ๆœˆ15ๆ—ฅ ไธ‹ๅˆ8:57:13 * @version 1.0 * @parameter * @since * @return */ import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import campsg.zhongchou.constant.Constants; import campsg.zhongchou.entity.User; public class UserFilter implements Filter { //ๅฏไปฅๅ…้ชŒ่ฏ็š„url้“พๆŽฅ็พค private String checked = null; @Override public void destroy() { // TODO Auto-generated method stub } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // TODO Auto-generated method stub //่ฝฌๆขHttpServletRequest็š„็ฑปๅž‹ HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; //่Žทๅ–ๅฝ“ๅ‰่ฏทๆฑ‚URL๏ผŒๆฒกๆœ‰ๅ…ถไป–๏ผŒๆฒกๆœ‰ๅ…ถไป–ๅ‚ๆ•ฐ String url = req.getRequestURI(); //ๅˆคๆ–ญURLๆ˜ฏๅฆ้œ€่ฆๆ‰ง่กŒ็™ป้™†็Šถๆ€ไฟกๆฏ้ชŒ่ฏใ€‚ๅฆ‚ๆžœไธ้œ€่ฆ ๅˆ™็›ดๆŽฅ้€š่ฟ‡ if(!isChecked(url)){ chain.doFilter(request, response); return; } //ๅฆ‚ๆžœ็”จๆˆทๅทฒ็™ปๅฝ•๏ผŒๅˆ™้€š่ฟ‡้ชŒ่ฏ User user = (User)req.getSession().getAttribute(Constants.USER_KEY); if(user != null){ chain.doFilter(request, response); return; } resp.sendRedirect("include/login.jsp?re="+url); } @Override public void init(FilterConfig config) throws ServletException { // TODO Auto-generated method stub checked = config.getInitParameter("checked"); } private boolean isChecked(String url){ //่Žทๅ–ๆ‰€ๆœ‰้š็ง่ต„ๆบ String[] checkedArray = checked.split(";"); for(String memeber : checkedArray){ if(url.indexOf(memeber) >= 0) return true; } return false; } }
2bea5e101cf4ae91341616cb6df94abdf0262260
9daf24bb6c26e50564ffa6bfebd0bf2372784d68
/RavenEye/src/com/reality/ImageLoader.java
2f76a9e79de11762d7c491f33e1858c31c6d2829
[]
no_license
mckayhdavis/raveneye
eb310a87be6c6c60fa4a57cb6006c6c8d9500776
b9b3934711ea8611dc60aec668ee64d48ac3cecf
refs/heads/master
2021-01-10T07:32:43.470090
2011-04-20T15:09:09
2011-04-20T15:09:09
36,013,702
0
0
null
null
null
null
UTF-8
Java
false
false
7,426
java
package com.reality; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.HashMap; import java.util.Stack; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.view.animation.Animation; import android.view.animation.RotateAnimation; import android.widget.ImageView; import android.widget.ImageView.ScaleType; public class ImageLoader { // TODO: caching of the images is not necessary and probably shouldn't be // done in this case. // the simplest in-memory cache implementation. This should be replaced with // something like SoftReference or BitmapOptions.inPurgeable(since 1.6) private final HashMap<String, Bitmap> cache = new HashMap<String, Bitmap>(); private File cacheDir; public final Drawable defaultDrawable; public final String url; private final RotateAnimation mRotate; public ImageLoader(Context context, String remotePath) { this(context, remotePath, null); } public ImageLoader(Context context, String remotePath, Drawable defaultDrawable) { // Make the background thead low priority. This way it will not affect // the UI performance photoLoaderThread.setPriority(Thread.NORM_PRIORITY - 1); // Find the dir to save cached images if (android.os.Environment.getExternalStorageState().equals( android.os.Environment.MEDIA_MOUNTED)) { cacheDir = new File( android.os.Environment.getExternalStorageDirectory(), "RavenImageCache"); } else { cacheDir = context.getCacheDir(); } if (!cacheDir.exists()) { cacheDir.mkdirs(); } mRotate = new RotateAnimation(0f, 3600f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); mRotate.setDuration(10000); mRotate.setRepeatMode(Animation.RESTART); mRotate.setRepeatCount(Animation.INFINITE); this.defaultDrawable = defaultDrawable; this.url = remotePath; } public boolean DisplayImage(String url, ImageView imageView) { if (url != null) { if (cache.containsKey(url)) { imageView.clearAnimation(); imageView.setScaleType(ScaleType.CENTER_CROP); imageView.setImageBitmap(cache.get(url)); } else { queuePhoto(url, imageView); imageView.startAnimation(mRotate); imageView.setScaleType(ScaleType.CENTER); imageView.setImageDrawable(defaultDrawable); } return true; } imageView.clearAnimation(); imageView.setImageDrawable(null); return false; } private void queuePhoto(String url, ImageView imageView) { // This ImageView may be used for other images before. So there may be // some old tasks in the queue. We need to discard them. photosQueue.clean(imageView); PhotoToLoad p = new PhotoToLoad(url, imageView); synchronized (photosQueue.photosToLoad) { photosQueue.photosToLoad.push(p); photosQueue.photosToLoad.notifyAll(); } // start thread if it's not started yet if (photoLoaderThread.getState() == Thread.State.NEW) photoLoaderThread.start(); } private Bitmap getBitmap(String url) { // I identify images by hashcode. Not a perfect solution, good for the // demo. String filename = String.valueOf(url.hashCode()); File f = new File(cacheDir, filename); // from SD cache Bitmap b = decodeFile(f); if (b != null) return b; // from web try { Bitmap bitmap = null; InputStream is = new URL(this.url + url).openStream(); OutputStream os = new FileOutputStream(f); CopyStream(is, os); os.close(); bitmap = decodeFile(f); return bitmap; } catch (Exception ex) { ex.printStackTrace(); return null; } } // decodes image and scales it to reduce memory consumption private Bitmap decodeFile(File f) { try { // decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); // Find the correct scale value. It should be the power of 2. final int REQUIRED_SIZE = 70; int width_tmp = o.outWidth, height_tmp = o.outHeight; int scale = 1; while (true) { if (width_tmp / 2 < REQUIRED_SIZE || height_tmp / 2 < REQUIRED_SIZE) break; width_tmp /= 2; height_tmp /= 2; scale *= 2; } // decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { } return null; } // Task for the queue private class PhotoToLoad { public String url; public ImageView imageView; public PhotoToLoad(String u, ImageView i) { url = u; imageView = i; } } private final PhotosQueue photosQueue = new PhotosQueue(); public void stopThread() { photoLoaderThread.interrupt(); } // stores list of photos to download class PhotosQueue { private Stack<PhotoToLoad> photosToLoad = new Stack<PhotoToLoad>(); // removes all instances of this ImageView public void clean(ImageView image) { for (int j = 0; j < photosToLoad.size();) { if (photosToLoad.get(j).imageView == image) photosToLoad.remove(j); else ++j; } } } private class PhotosLoader extends Thread { public void run() { try { while (true) { // thread waits until there are any images to load in the // queue if (photosQueue.photosToLoad.size() == 0) synchronized (photosQueue.photosToLoad) { photosQueue.photosToLoad.wait(); } if (photosQueue.photosToLoad.size() != 0) { PhotoToLoad photoToLoad; synchronized (photosQueue.photosToLoad) { photoToLoad = photosQueue.photosToLoad.pop(); } Bitmap bmp = getBitmap(photoToLoad.url); cache.put(photoToLoad.url, bmp); Object tag = photoToLoad.imageView.getTag(); // if (tag != null // && ((String) tag).equals(photoToLoad.url)) { BitmapDisplayer bd = new BitmapDisplayer(bmp, photoToLoad.imageView); Activity a = (Activity) photoToLoad.imageView .getContext(); a.runOnUiThread(bd); // } } if (Thread.interrupted()) break; } } catch (InterruptedException e) { // allow thread to exit } } } private final PhotosLoader photoLoaderThread = new PhotosLoader(); // Used to display bitmap in the UI thread class BitmapDisplayer implements Runnable { Bitmap bitmap; ImageView imageView; public BitmapDisplayer(Bitmap b, ImageView i) { bitmap = b; imageView = i; } public void run() { imageView.clearAnimation(); if (bitmap != null) { imageView.setScaleType(ScaleType.CENTER_CROP); imageView.setImageBitmap(bitmap); } else { imageView.setImageDrawable(null); } } } public void clearCache() { // clear memory cache cache.clear(); // clear SD cache File[] files = cacheDir.listFiles(); for (File f : files) { f.delete(); } } public static void CopyStream(InputStream is, OutputStream os) { final int buffer_size = 1024; try { byte[] bytes = new byte[buffer_size]; for (;;) { int count = is.read(bytes, 0, buffer_size); if (count == -1) break; os.write(bytes, 0, count); } } catch (Exception ex) { } } }
[ "[email protected]@b3cfcf5c-2840-5ab7-0707-f21b9f603a1d" ]
[email protected]@b3cfcf5c-2840-5ab7-0707-f21b9f603a1d
bb0485d7f263bd2fa1c9475d727c64a51a39d165
8a8f0fb90a5462a2f37496f2c9af536ae6144888
/app/src/main/java/felipe/sp/br/teste_android/view/MainActivity.java
cbcd4d0334f54da74586ff9e6f32fa19b6d00a11
[]
no_license
felipe11xx/TesteAndroid
9ddce103519ed1cc0131d0c95caf67783aa7b62f
b78f2b223c45196f4b86f6c7936b1a90f826b477
refs/heads/master
2023-08-19T10:14:10.967816
2018-06-08T22:29:05
2018-06-08T22:29:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
548
java
package felipe.sp.br.teste_android.view; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; import android.widget.TextView; import felipe.sp.br.teste_android.R; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
28b48eb731c8802db69081c26ec1356d31132a02
8f1ca952f92363ee59cd48db3abcc8a18791fe68
/src/cn/shawadika/dao/UserDao.java
628c3c1f2451206efe24d792ece1a42769080b50
[]
no_license
fzlinjianhui/OurClass_2
eb1c5ac60c48f09b45638675a888429b1bc11d22
d6f664a7970037c4eca1f6658512ecf638d7780b
refs/heads/master
2021-01-10T11:08:41.619875
2019-08-06T00:50:45
2019-08-06T00:50:45
54,037,434
1
0
null
null
null
null
UTF-8
Java
false
false
301
java
package cn.shawadika.dao; import cn.shawadika.entity.User; public interface UserDao { //ๆ’ๅ…ฅ็”จๆˆท public void insertUser(User user); //ๆŸฅ่ฏขๆ‰€ๆœ‰็”จๆˆท public User findAllUser(); //็™ปๅฝ•ๆ“ไฝœ public User login(User user); //ไฟฎๆ”น็”จๆˆทไฟกๆฏ public void changeUserInfo(User user); }
415766b304912325f4cd0855e32653eb0ad69632
7a6e17eebaeb110c0f52752aef47216530616ec8
/src/Break.java
cf52e07190ded69767c5f747d2bc576f6bea4151
[]
no_license
MaorMa/ComputerAndNetworkSecurity
f7b3bc4a793fe66c9f04793aeb4f68c96a76865d
7139e9ab8ec0edf37013987d27a04f9dade3e72a
refs/heads/master
2020-05-01T11:31:58.307333
2019-03-26T21:23:10
2019-03-26T21:23:10
177,445,380
0
0
null
null
null
null
UTF-8
Java
false
false
7,324
java
import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.security.SecureRandom; import java.util.LinkedList; /** * This class responsible for break the algorithm */ public class Break { private String cypherLocation; private String messageLocation; private String outputLocation; private LinkedList<byte[][]> cypher; //include all the message in format of [4][4] matrix private LinkedList<byte[][]> keys;//include all the keys in format of [4][4] matrix private LinkedList<byte[][]> byteMsg; //include all the message in format of [4][4] matrix private byte[] newKeys; public Break(String cypherLocation, String messageLocation, String outputLocation) { this.messageLocation = messageLocation; this.cypherLocation = cypherLocation; this.outputLocation = outputLocation; this.keys = new LinkedList<>(); this.cypher = new LinkedList<>(); this.byteMsg = new LinkedList<>(); getMatrix(getRandomKey()); getMatrix(getRandomKey()); getMatrix(cypherLocation); getMatrix(messageLocation); AesBreak(); } /** * This method create random key * * @return random key */ public byte[] getRandomKey() { SecureRandom random = new SecureRandom(); byte[] randomKey = new byte[16]; random.nextBytes(randomKey); return randomKey; } /** * get matrix of cypher text * @param location */ private void getMatrix(String location) { File file = new File(location); byte[][] array; byte[] fileContent = new byte[0]; try { fileContent = Files.readAllBytes(file.toPath()); } catch (IOException e) { e.printStackTrace(); } int startIndex = 0; for (int j = 1; j <= fileContent.length / 16; j++) { int endIndex = 16 * j; array = SwithDirection(fileContent, startIndex); startIndex = endIndex; //if inputLocation than add to byteMsg if (location.equals(this.cypherLocation)) { this.cypher.add(array); //if keyLocation than add to keys } if (location.equals(this.messageLocation)) { this.byteMsg.add(array); } } } /** * This method set byteMsg LinkedList and keys LinkedList */ private void getMatrix(byte[] key) { byte[][] array; int startIndex = 0; for (int j = 1; j <= key.length / 16; j++) { int endIndex = 16 * j; array = SwithDirection(key, startIndex); startIndex = endIndex; this.keys.add(array); } } /** * This method implement add round key scenario * * @param key - given key * @param message - given message * result = message XOR key */ public void addRoundKey(byte[][] key, byte[][] message) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { byte value = message[i][j]; byte value2 = key[i][j]; message[i][j] = (byte) (value ^ value2); } } } /** * This method get original byte array and switch direction into 4X4 matrix * * @param fileContent - the original byte array * @param startIndex - if the message is more than 16 byte, thant start index will be at first 0, then 16, then 32 etc. * @return 4X4 inverted matrix */ private static byte[][] SwithDirection(byte[] fileContent, int startIndex) { byte[][] messageMatrix = new byte[4][4]; for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { messageMatrix[i][j] = fileContent[startIndex]; startIndex++; } } return messageMatrix; } /** * This method implement shift rows scenario * * @param message - to shift */ public void regulerShiftRows(byte[][] message) { //second row byte a = message[1][0]; byte b = message[1][1]; byte c = message[1][2]; byte d = message[1][3]; message[1][0] = b; message[1][1] = c; message[1][2] = d; message[1][3] = a; //third row a = message[2][0]; b = message[2][1]; c = message[2][2]; d = message[2][3]; message[2][0] = c; message[2][1] = d; message[2][2] = a; message[2][3] = b; //fourth row a = message[3][1]; b = message[3][2]; c = message[3][3]; d = message[3][0]; message[3][0] = c; message[3][1] = d; message[3][2] = a; message[3][3] = b; } /** * This method implement shift rows scenario * * @param message - to shift */ public void shiftRows(byte[][] message) { //second row byte a = message[1][0]; byte b = message[1][1]; byte c = message[1][2]; byte d = message[1][3]; message[1][1] = a; message[1][2] = b; message[1][3] = c; message[1][0] = d; //third row a = message[2][0]; b = message[2][1]; c = message[2][2]; d = message[2][3]; message[2][2] = a; message[2][3] = b; message[2][0] = c; message[2][1] = d; //fourth row a = message[3][1]; b = message[3][2]; c = message[3][3]; d = message[3][0]; message[3][3] = d; message[3][0] = a; message[3][1] = b; message[3][2] = c; } /** * This method decrypet using Aes algorithm 3 times * Using shiftRows and addRoundKey */ private void AesBreak() { int index; for(byte[][] msg : this.byteMsg) { //iterate over all the keys for (byte[][] key : this.keys) { this.regulerShiftRows(msg); //shif rows this.addRoundKey(key, msg); } } for (byte[][] msg : this.byteMsg) { this.regulerShiftRows(msg); } for (byte[][] msg : this.byteMsg) { for(byte[][] cyp: this.cypher) { this.addRoundKey(cyp, msg); } } this.keys.add(this.byteMsg.get(0)); //setCypher index = 0; this.newKeys = new byte[16*3]; for(byte[][]key:keys) { for (int i = 0; i < key.length; i++) { for (int j = 0; j < key[0].length; j++) { this.newKeys[index] = key[j][i]; index++; } } } writeToDisk(); } /** * This method write plain text to disk */ private void writeToDisk() { try { Files.write(Paths.get(this.outputLocation), this.newKeys); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { Break b = new Break("C:\\Users\\Maor\\Desktop\\files\\cipher_long","C:\\Users\\Maor\\Desktop\\files\\message_long", "C:\\Users\\Maor\\Desktop\\files\\newkeys"); } }
471540dacfec8872cc4bc79b9631111c76d6849c
c8766a5160770bb440d5ffb386e9723288399ceb
/TeamProject/src/admin/book/action/BuyProAction.java
3867779a48400131081f3313ead6348e5147c0a1
[]
no_license
dnjsrud3407/TeemProject
06c8fc6969701c4b3e118e089a2e333e29c90d90
02c67d3253713aa15e8ccb2280b0544cfb88584d
refs/heads/master
2022-12-09T22:18:47.526617
2020-04-24T02:06:49
2020-04-24T02:06:49
240,448,436
0
2
null
2022-12-05T11:52:59
2020-02-14T07:05:35
Java
UTF-8
Java
false
false
663
java
package admin.book.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import action.Action; import admin.book.svc.BuyProService; import vo.ActionForward; public class BuyProAction implements Action { @Override public ActionForward execute(HttpServletRequest request, HttpServletResponse response) throws Exception { ActionForward forward = null; BuyProService buyProService = new BuyProService(); buyProService.buy(); forward = new ActionForward(); forward.setPath("BuyList.abook"); forward.setRedirect(true); return forward; } }
[ "giga@DESKTOP-HAVSALG" ]
giga@DESKTOP-HAVSALG
08b8f57ce5582a4f1948d166d64adb5dfa1b5408
5747faca8e4da6ad5bd6efdd8354198270413821
/android/app/src/main/java/com/example/turtle/MainActivity.java
d489addf7a4f6c444e2f96a55d167d64bdccc807
[]
no_license
iPieter/turtle_expense_tracker
2490136559b05d99030e62a168a4371093ed6cc4
d9b1a95a0b9f8812a8b28b793e0a45908f5886db
refs/heads/master
2020-03-20T18:45:08.887891
2018-08-30T14:12:59
2018-08-30T14:12:59
137,602,607
2
1
null
2018-08-30T14:13:00
2018-06-16T18:40:28
Dart
UTF-8
Java
false
false
364
java
package com.example.turtle; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
627d49faaa83701f444668cac7d8c352c4a7fe0e
b3fb5f4400e308631887b1bbdef8a7dac735d262
/tenny1028/ActionListeners/pasteActionListener.java
4d543473b6864a3f30ba8be87c1912d2b26d2773
[ "BSD-3-Clause" ]
permissive
DrOverbuild/WordShuffler
9e4756c975e88cfd9746a24815a91426e9045cb2
d41f6a14c3f1d14b942c9b21f82b39d48b967cef
refs/heads/master
2020-12-25T23:26:58.044615
2013-11-08T01:35:03
2013-11-08T01:35:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package tenny1028.ActionListeners; import tenny1028.MainFrame; import java.awt.*; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; public class pasteActionListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); try { String result = (String) clipboard.getData(DataFlavor.stringFlavor); MainFrame.Field.setText(MainFrame.Field.getText() + result); MainFrame.Field.requestFocus(); MainFrame.Field.selectAll(); } catch (UnsupportedFlavorException ex) { System.out.println("UnsupportedFlavorException"); } catch (IOException ex) { System.out.println("IOException"); } } }
887abfa6fa65cb6cff9cf2ec2b963f231a2f80b5
5b5fbbbe841401902cf4893eec0251d747ae29b4
/here/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/recyclerview/R.java
fc5351d9b78f0490dd420e06b81f8fcacc47faeb
[]
no_license
tt-stack/android
8d924a78ecd526a36f7938c4340fabc8c3f7ec21
7aafcdb84a3e3d7aa23e03c6a01cbf5058d7c230
refs/heads/master
2022-12-10T07:54:33.130367
2020-09-01T15:43:36
2020-09-01T15:43:36
293,316,451
0
0
null
null
null
null
UTF-8
Java
false
false
15,789
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.recyclerview; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f030028; public static final int fastScrollEnabled = 0x7f030143; public static final int fastScrollHorizontalThumbDrawable = 0x7f030144; public static final int fastScrollHorizontalTrackDrawable = 0x7f030145; public static final int fastScrollVerticalThumbDrawable = 0x7f030146; public static final int fastScrollVerticalTrackDrawable = 0x7f030147; public static final int font = 0x7f03015d; public static final int fontProviderAuthority = 0x7f03015f; public static final int fontProviderCerts = 0x7f030160; public static final int fontProviderFetchStrategy = 0x7f030161; public static final int fontProviderFetchTimeout = 0x7f030162; public static final int fontProviderPackage = 0x7f030163; public static final int fontProviderQuery = 0x7f030164; public static final int fontStyle = 0x7f030165; public static final int fontVariationSettings = 0x7f030166; public static final int fontWeight = 0x7f030167; public static final int layoutManager = 0x7f0301b9; public static final int recyclerViewStyle = 0x7f030281; public static final int reverseLayout = 0x7f030286; public static final int spanCount = 0x7f0302ab; public static final int stackFromEnd = 0x7f0302b1; public static final int ttcIndex = 0x7f030342; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f0500c3; public static final int notification_icon_bg_color = 0x7f0500c4; public static final int ripple_material_light = 0x7f0500d1; public static final int secondary_text_default_material_light = 0x7f0500d3; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f060054; public static final int compat_button_inset_vertical_material = 0x7f060055; public static final int compat_button_padding_horizontal_material = 0x7f060056; public static final int compat_button_padding_vertical_material = 0x7f060057; public static final int compat_control_corner_material = 0x7f060058; public static final int compat_notification_large_icon_max_height = 0x7f060059; public static final int compat_notification_large_icon_max_width = 0x7f06005a; public static final int fastscroll_default_thickness = 0x7f06008c; public static final int fastscroll_margin = 0x7f06008d; public static final int fastscroll_minimum_range = 0x7f06008e; public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f060097; public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f060098; public static final int item_touch_helper_swipe_escape_velocity = 0x7f060099; public static final int notification_action_icon_size = 0x7f060152; public static final int notification_action_text_size = 0x7f060153; public static final int notification_big_circle_margin = 0x7f060154; public static final int notification_content_margin_start = 0x7f060155; public static final int notification_large_icon_height = 0x7f060156; public static final int notification_large_icon_width = 0x7f060157; public static final int notification_main_column_padding_top = 0x7f060158; public static final int notification_media_narrow_margin = 0x7f060159; public static final int notification_right_icon_size = 0x7f06015a; public static final int notification_right_side_padding_top = 0x7f06015b; public static final int notification_small_icon_background_padding = 0x7f06015c; public static final int notification_small_icon_size_as_large = 0x7f06015d; public static final int notification_subtext_size = 0x7f06015e; public static final int notification_top_pad = 0x7f06015f; public static final int notification_top_pad_large_text = 0x7f060160; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f0700a5; public static final int notification_bg = 0x7f0700a6; public static final int notification_bg_low = 0x7f0700a7; public static final int notification_bg_low_normal = 0x7f0700a8; public static final int notification_bg_low_pressed = 0x7f0700a9; public static final int notification_bg_normal = 0x7f0700aa; public static final int notification_bg_normal_pressed = 0x7f0700ab; public static final int notification_icon_background = 0x7f0700ac; public static final int notification_template_icon_bg = 0x7f0700ad; public static final int notification_template_icon_low_bg = 0x7f0700ae; public static final int notification_tile_bg = 0x7f0700af; public static final int notify_panel_notification_icon_bg = 0x7f0700b0; } public static final class id { private id() {} public static final int accessibility_action_clickable_span = 0x7f08000f; public static final int accessibility_custom_action_0 = 0x7f080010; public static final int accessibility_custom_action_1 = 0x7f080011; public static final int accessibility_custom_action_10 = 0x7f080012; public static final int accessibility_custom_action_11 = 0x7f080013; public static final int accessibility_custom_action_12 = 0x7f080014; public static final int accessibility_custom_action_13 = 0x7f080015; public static final int accessibility_custom_action_14 = 0x7f080016; public static final int accessibility_custom_action_15 = 0x7f080017; public static final int accessibility_custom_action_16 = 0x7f080018; public static final int accessibility_custom_action_17 = 0x7f080019; public static final int accessibility_custom_action_18 = 0x7f08001a; public static final int accessibility_custom_action_19 = 0x7f08001b; public static final int accessibility_custom_action_2 = 0x7f08001c; public static final int accessibility_custom_action_20 = 0x7f08001d; public static final int accessibility_custom_action_21 = 0x7f08001e; public static final int accessibility_custom_action_22 = 0x7f08001f; public static final int accessibility_custom_action_23 = 0x7f080020; public static final int accessibility_custom_action_24 = 0x7f080021; public static final int accessibility_custom_action_25 = 0x7f080022; public static final int accessibility_custom_action_26 = 0x7f080023; public static final int accessibility_custom_action_27 = 0x7f080024; public static final int accessibility_custom_action_28 = 0x7f080025; public static final int accessibility_custom_action_29 = 0x7f080026; public static final int accessibility_custom_action_3 = 0x7f080027; public static final int accessibility_custom_action_30 = 0x7f080028; public static final int accessibility_custom_action_31 = 0x7f080029; public static final int accessibility_custom_action_4 = 0x7f08002a; public static final int accessibility_custom_action_5 = 0x7f08002b; public static final int accessibility_custom_action_6 = 0x7f08002c; public static final int accessibility_custom_action_7 = 0x7f08002d; public static final int accessibility_custom_action_8 = 0x7f08002e; public static final int accessibility_custom_action_9 = 0x7f08002f; public static final int action_container = 0x7f080038; public static final int action_divider = 0x7f08003a; public static final int action_image = 0x7f08003b; public static final int action_text = 0x7f080041; public static final int actions = 0x7f080042; public static final int async = 0x7f08004e; public static final int blocking = 0x7f080058; public static final int chronometer = 0x7f08006a; public static final int dialog_button = 0x7f080088; public static final int forever = 0x7f0800af; public static final int icon = 0x7f0800bd; public static final int icon_group = 0x7f0800be; public static final int info = 0x7f0800c5; public static final int italic = 0x7f0800c7; public static final int item_touch_helper_previous_elevation = 0x7f0800c8; public static final int line1 = 0x7f0800d0; public static final int line3 = 0x7f0800d1; public static final int normal = 0x7f08010f; public static final int notification_background = 0x7f080110; public static final int notification_main_column = 0x7f080111; public static final int notification_main_column_container = 0x7f080112; public static final int right_icon = 0x7f08012e; public static final int right_side = 0x7f08012f; public static final int tag_accessibility_actions = 0x7f08016a; public static final int tag_accessibility_clickable_spans = 0x7f08016b; public static final int tag_accessibility_heading = 0x7f08016c; public static final int tag_accessibility_pane_title = 0x7f08016d; public static final int tag_screen_reader_focusable = 0x7f08016e; public static final int tag_transition_group = 0x7f08016f; public static final int tag_unhandled_key_event_manager = 0x7f080170; public static final int tag_unhandled_key_listeners = 0x7f080171; public static final int text = 0x7f080176; public static final int text2 = 0x7f080177; public static final int time = 0x7f080186; public static final int title = 0x7f080187; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f090015; } public static final class layout { private layout() {} public static final int custom_dialog = 0x7f0b001f; public static final int notification_action = 0x7f0b005b; public static final int notification_action_tombstone = 0x7f0b005c; public static final int notification_template_custom_big = 0x7f0b0063; public static final int notification_template_icon_group = 0x7f0b0064; public static final int notification_template_part_chronometer = 0x7f0b0068; public static final int notification_template_part_time = 0x7f0b0069; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0f007f; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f100161; public static final int TextAppearance_Compat_Notification_Info = 0x7f100162; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f100164; public static final int TextAppearance_Compat_Notification_Time = 0x7f100167; public static final int TextAppearance_Compat_Notification_Title = 0x7f100169; public static final int Widget_Compat_NotificationActionContainer = 0x7f100253; public static final int Widget_Compat_NotificationActionText = 0x7f100254; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030028 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f03015f, 0x7f030160, 0x7f030161, 0x7f030162, 0x7f030163, 0x7f030164 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f03015d, 0x7f030165, 0x7f030166, 0x7f030167, 0x7f030342 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; public static final int[] RecyclerView = { 0x10100c4, 0x10100eb, 0x10100f1, 0x7f030143, 0x7f030144, 0x7f030145, 0x7f030146, 0x7f030147, 0x7f0301b9, 0x7f030286, 0x7f0302ab, 0x7f0302b1 }; public static final int RecyclerView_android_orientation = 0; public static final int RecyclerView_android_clipToPadding = 1; public static final int RecyclerView_android_descendantFocusability = 2; public static final int RecyclerView_fastScrollEnabled = 3; public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 4; public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 5; public static final int RecyclerView_fastScrollVerticalThumbDrawable = 6; public static final int RecyclerView_fastScrollVerticalTrackDrawable = 7; public static final int RecyclerView_layoutManager = 8; public static final int RecyclerView_reverseLayout = 9; public static final int RecyclerView_spanCount = 10; public static final int RecyclerView_stackFromEnd = 11; } }
f734cc07bff5c9d3496273612b8e395379d87a21
73fb1288107ea09f2c658f2f1fac64e0dbe86766
/app/src/main/java/com/minhvu/proandroid/sqlite/database/models/data/TextStyleContract.java
82704b7ee3c90336547d14da6128eb5b5d2d8f24
[]
no_license
vmvu/mvnotepad
3ae3479fc2a6a7dd5d18a78a5cff4b6c68058225
5fd4a8f67002120acb09288034e276ab31de1d59
refs/heads/master
2021-09-07T11:32:50.021727
2018-02-22T10:37:22
2018-02-22T10:37:22
104,105,054
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.minhvu.proandroid.sqlite.database.models.data; import android.net.Uri; import android.provider.BaseColumns; /** * Created by vomin on 1/12/2018. */ public class TextStyleContract implements Contract { public static final String path_ttypeoftext = "typeoftext"; public static final class TextStyleEntry implements BaseColumns { public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(path_ttypeoftext).build(); public static final String DATABASE_TABLE = "text_style"; public static final String COL_NAME = "name"; public static final String DEFAULT_SORT_ORDER = _ID + " ASC"; public static String[] getColumnsName() { return new String[]{_ID, COL_NAME}; } } }
dff76940771f2fa1d34d0aa69dfb2367132176f6
5a076617e29016fe75d6421d235f22cc79f8f157
/androidtalk_2010_11_17ใ€Sundy็ณปๅˆ—ใ€‘ๅ…จ็œ‹ๆ‡‚ไบ†-ๅŠ ไธคๅนด็ป้ชŒ-่ฏญ้Ÿณๆœ—่ฏป-่ฏญ้Ÿณ่ฏ†ๅˆซ-่ฏญ้Ÿณ/Study/TextOpration.java
fbacc0cad4d98d6bb7c00dca2b9f90afdf7699ef
[]
no_license
dddddttttt/androidsourcecodes
516b8c79cae7f4fa71b97a2a470eab52844e1334
3d13ab72163bbeed2ef226a476e29ca79766ea0b
refs/heads/master
2020-08-17T01:38:54.095515
2018-04-08T15:17:24
2018-04-08T15:17:24
null
0
0
null
null
null
null
GB18030
Java
false
false
2,532
java
package com.androidtalk; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Arrays; import android.util.Log; public final class TextOpration { // ไธŽ็ผ–็ ๆ ผๅผๆœ‰ๅ…ณ private final static String ENC_UTF16BE = "UTF-16BE"; private final static String ENC_UTF8 = "UTF-8"; private final static String ENC_GB2312 = "GB2312"; private File _file; //ไธŽๆ–‡ไปถๆ“ไฝœๆœ‰ๅ…ณ็š„ๅ˜้‡ private String fullBookName; // ๅ…จ่ทฏๅพ„ไนฆๅ private String bookName; // ๆ— ่ทฏๅพ„ไนฆๅ private long bookSize; // size of the book private InputStream fis; private String bookFormat; // ๆ–‡ไปถๆ ผๅผ public TextOpration(String fileName) { setFullBookName(fileName); byte[] headOfBook = new byte[3]; try { _file = new File(fileName); bookSize = _file.length(); fis = new FileInputStream(_file); fis.read(headOfBook); //่ฏปๆ–‡ไปถๅคดไธ‰ไธชๅญ—่Š‚๏ผŒๅˆคๆ–ญๆ–‡ไปถ็ผ–็ ๆ ผๅผ fis.close(); fis = null; } catch (IOException ioe) { ioe.printStackTrace(); } // ๅˆคๆ–ญ็ผ–็ ๆ ผๅผ if ((headOfBook[0] == -2) && (headOfBook[1] == -1)) { bookFormat = ENC_UTF16BE; } else if ((headOfBook[0] == -1) && (headOfBook[1] == -2)) { bookFormat = ENC_UTF16BE; } else if ((headOfBook[0] == -17) && (headOfBook[1] == -69) &&(headOfBook[2] == -65)) { bookFormat = ENC_UTF8; // UTF8 with BOM } else { bookFormat = ENC_GB2312; } } public String getStringFromFile() { try { StringBuffer sBuffer = new StringBuffer(); fis = new FileInputStream(_file); InputStreamReader inputStreamReader = new InputStreamReader(fis, bookFormat); BufferedReader in = new BufferedReader(inputStreamReader); if(!_file.exists()) { return null; } while (in.ready()) { sBuffer.append(in.readLine() + "\n"); } in.close(); return sBuffer.toString(); } catch (Exception e) { e.printStackTrace(); } return null; } private void Erro(String str){ Log.d("TAG", str); } public long getBookSize() { return bookSize; } public void setFullBookName(String fileName){ fullBookName = fileName; int i = fileName.lastIndexOf('/') + 1; int t = fileName.lastIndexOf('.'); bookName = fileName.substring(i, t); } public String getBookName() { return bookName; } }
f6f491af6441f33507e2806587f5c0fd7ddca416
71071f98d05549b67d4d6741e8202afdf6c87d45
/files/Spring_XD/XD-2831/spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/DefaultModuleDeploymentPropertiesProvider.java
14cc6a6463dc7097fc06a4364d22e6c1b838ce7a
[]
no_license
Sun940201/SpringSpider
0adcdff1ccfe9ce37ba27e31b22ca438f08937ad
ff2fc7cea41e8707389cb62eae33439ba033282d
refs/heads/master
2022-12-22T09:01:54.550976
2018-06-01T06:31:03
2018-06-01T06:31:03
128,649,779
1
0
null
2022-12-16T00:51:27
2018-04-08T14:30:30
Java
UTF-8
Java
false
false
2,354
java
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.xd.dirt.server; import java.util.HashMap; import java.util.Map; import org.springframework.xd.dirt.core.DeploymentUnit; import org.springframework.xd.dirt.util.DeploymentPropertiesUtility; import org.springframework.xd.module.ModuleDeploymentProperties; import org.springframework.xd.module.ModuleDescriptor; /** * Default implementation that retrieves the {@link ModuleDeploymentProperties} for the given * {@link ModuleDescriptor}. * * @author Ilayaperumal Gopinathan */ public class DefaultModuleDeploymentPropertiesProvider implements ModuleDeploymentPropertiesProvider<ModuleDeploymentProperties> { /** * Cache of module deployment properties. */ private final Map<ModuleDescriptor.Key, ModuleDeploymentProperties> mapDeploymentProperties = new HashMap<ModuleDescriptor.Key, ModuleDeploymentProperties>(); /** * DeploymentUnit (stream/job) to create module deployment properties for. */ private final DeploymentUnit deploymentUnit; /** * * @param deploymentUnit deployment unit (stream/job) to create module properties for */ public DefaultModuleDeploymentPropertiesProvider(DeploymentUnit deploymentUnit) { this.deploymentUnit = deploymentUnit; } /** * {@inheritDoc} */ @Override public ModuleDeploymentProperties propertiesForDescriptor(ModuleDescriptor moduleDescriptor) { ModuleDescriptor.Key key = moduleDescriptor.createKey(); ModuleDeploymentProperties properties = mapDeploymentProperties.get(key); if (properties == null) { properties = DeploymentPropertiesUtility.createModuleDeploymentProperties( deploymentUnit.getDeploymentProperties(), moduleDescriptor); mapDeploymentProperties.put(key, properties); } return properties; } }
62aaf714a49ee904faf2e11e4ddd2966aeb152cb
e2171b39bda4e993c7fa745e522cf253e4279bd5
/NewFinalGame/src/game/SuperObjectDraw.java
f566f9f5e7bb8ea340ab0fa33cdc3c7d21a8639e
[]
no_license
henry0427/finalexam10802
7bbe2ab67b4a17a8f417967d728190459089dfde
347a3cc6760fcaf98eba3cf9f675c40c883357aa
refs/heads/master
2020-05-25T03:14:14.387022
2019-06-03T17:55:22
2019-06-03T17:55:22
187,596,183
0
0
null
null
null
null
UTF-8
Java
false
false
54
java
package game; public class SuperObjectDraw { }
288de3676eb1228fa5fd1f4127efbebeb1241494
3d2eebc40768e4dce0b7c71a54de24ee95d2ef8d
/src/main/java/com/kubewarrior/checkout/domain/Product.java
ba53c14ce1f42b92e7e2102bf11df9b5ac51c91a
[]
no_license
eshop-micro-demo/checkout
56112889fbc6b3cb4d494ebfce6bcae6d73a2d2e
b49bed4933459d1526dd1e021128792b58443b45
refs/heads/main
2023-07-12T02:10:58.706263
2021-05-28T18:14:06
2021-05-28T18:14:06
369,109,189
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
package com.kubewarrior.checkout.domain; public class Product { private long id; private String name; private float price; private String imgUrl; private int stockCount; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getStockCount() { return stockCount; } public void setStockCount(int stockCount) { this.stockCount = stockCount; } public String getImgUrl() { return imgUrl; } public void setImgUrl(String imgUrl) { this.imgUrl = imgUrl; } public float getPrice() { return price; } public void setPrice(float price) { this.price = price; } }
48debac1943158fe70e4fd158d566b36c5539ff2
394718e333ea43f14ce41230d1c60108de482607
/src/PulsDAO.java
c6a62241b71b9b00b61c064b57f5c3b924c6e68e
[]
no_license
robe92/Platform
1c586b3a2972aa08b4549ad25f028f88aa0f0107
8cd8fc2aa10b98aa46a2719e4008d430f2645335
refs/heads/master
2022-10-08T11:08:53.193821
2020-06-12T07:23:07
2020-06-12T07:23:07
271,555,708
0
0
null
null
null
null
UTF-8
Java
false
false
164
java
import java.util.List; public interface PulsDAO { String save(PulsDTO PulsDTO); void savebatch(List<PulsDTO> batch); PulsDTO load(PulsDTO PulsDTO); }
33ae222d9dce41b1961b22e6e33f6e0b5674b874
c313ffec9929a05eab7d77ac101c974d1804113f
/TabularAlgorithm.java
9a86c59dcec6cae85f0f0656b0644bfb088442e7
[]
no_license
JoshHumpherys/NumberTheory
afadcef009b9a557fb2132e0d5b6d8615c5dbdc9
1dc373edc5a9cba96ad7167cabbdef021b907b45
refs/heads/master
2021-01-17T04:21:25.401790
2017-02-28T02:51:32
2017-02-28T02:51:32
82,942,104
0
0
null
null
null
null
UTF-8
Java
false
false
2,447
java
import java.util.List; public abstract class TabularAlgorithm { protected String[] labels; protected List<int[]> rows; protected abstract String[] getLabels(); protected abstract List<int[]> getRows(); protected static final int mod(int a, int b) { return (a % b + b) % b; } protected void printTable() { String[] labels = getLabels(); List<int[]> rows = getRows(); int[] maxWidthOfColumns = new int[labels.length]; for(int i = 0; i < labels.length; i++) { int maxWidth = labels[i].length(); for(int j = 0; j < rows.size(); j++) { int currentWidth = String.valueOf(rows.get(j)[i]).length(); if(currentWidth > maxWidth) { maxWidth = currentWidth; } } maxWidthOfColumns[i] = maxWidth; } String[] spaces = new String[12]; spaces[0] = ""; for(int i = 1; i < 12; i++) { spaces[i] = spaces[i - 1] + " "; } StringBuilder header = new StringBuilder(); for(int i = 0; i < labels.length; i++) { header.append(" " + getNumSpaces(spaces, Math.max(maxWidthOfColumns[i] - labels[i].length(), 0)) + labels[i] + " " + (i == labels.length - 1 ? "" : "|")); } System.out.println(header); StringBuilder dashes = new StringBuilder(); for(int i = 0; i < header.length(); i++) { dashes.append("-"); } System.out.println(dashes); StringBuilder headerFormatBuilder = new StringBuilder(); for(int i = 0; i < labels.length; i++) { headerFormatBuilder.append(" %" + maxWidthOfColumns[i] + "d " + (i != labels.length - 1 ? "|" : "")); } headerFormatBuilder.append("%n"); String headerFormat = headerFormatBuilder.toString(); for(int i = 0; i < rows.size(); i++) { int[] row = rows.get(i); for(int j = 0; j < row.length; j++) { System.out.printf(" %" + maxWidthOfColumns[j] + "d " + (j != labels.length - 1 ? "|" : "%n"), row[j]); } } } private static String getNumSpaces(String[] spaces, int n) { StringBuilder space = new StringBuilder(spaces[Math.min(n, spaces.length - 1)]); for(int i = spaces.length; i <= n; i++) { space.append(" "); } return space.toString(); } }