blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
299ab2e63562b52ad500dadabd0e5024640980f8
363eb37f93198905f14e326f65759af6c462fb1b
/src/net/cobem/grizzly/misc/DateHandler.java
70905435710959fbe126edad35b02fd7b003a8a2
[]
no_license
habboarchive/Grizzly
fdbb09dacda40195030461d829176ee1d8d545ca
3635691f0b281d96552d154ccb5fcc88d4785cfd
refs/heads/master
2022-08-15T01:47:54.788050
2012-11-10T16:39:34
2012-11-10T16:39:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package net.cobem.grizzly.misc; import java.util.Date; public class DateHandler { public int GetDateFrom(Date DateTime, DateFormat Format) { switch(Format) { case Seconds: { return (int) ((new Date().getTime() - DateTime.getTime()) / 1000); } case Minutes: { return 0; } case Hours: { return 0; } } return 0; } }
85e1c4717583e2e76ee65bd92e31ce8c16439ad7
9980766dab0ebf350a2d8c93e15344c4b6b0f2a2
/src/main/java/com/mmonti/view/support/ProxySupport.java
1b98af8ce94615eeae7dd45a5de9f565319eb8f9
[]
no_license
mmonti/view-projections
1901e096ec89add2948b143a12748ab81defe8fd
da58e0fe75bd88b3486b08e3afddf216a8044786
refs/heads/master
2021-01-23T11:39:51.054683
2017-09-06T16:24:56
2017-09-06T16:24:56
102,631,913
0
0
null
null
null
null
UTF-8
Java
false
false
1,899
java
package com.mmonti.view.support; import com.mmonti.view.DefaultInvocationHandler; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Arrays; import java.util.stream.Stream; /** * @author mmonti */ public class ProxySupport { /** * * @param handler * @param ifaces * @param <T> * @return */ public static <T> T simpleProxy(final InvocationHandler handler, final Class<?> ... ifaces) { final Class<?>[] allInterfaces = Stream.of(ifaces).distinct().toArray(Class<?>[]::new); return (T) Proxy.newProxyInstance(ifaces[0].getClassLoader(), allInterfaces, handler); } /** * * @param iface * @param target * @param <T> * @return */ public static <T> T passThroughProxy(final T target, final Class<? extends T> iface) { return simpleProxy(new PassThroughInvocationHandler(target), iface); } /** * * @param targetValue * @return */ public static boolean isProxy(final Object targetValue) { return Proxy.isProxyClass(targetValue.getClass()); } /** * Pass-through Invocation Handler */ public static class PassThroughInvocationHandler implements InvocationHandler { /** * */ private final Object target; /** * * @param target */ public PassThroughInvocationHandler(final Object target) { this.target = target; } /** * * @param proxy * @param method * @param args * @return * @throws Throwable */ @Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { return method.invoke(target, args); } } }
ec616713ebffa67970df5059061f60706f72b6db
fa081a547cba53919b2b2b59613916c56d153927
/app/src/main/java/vn/com/kidy/view/widget/decorators/MySelectorDecorator.java
1451895681ab51ff0d390bb4b5e1f6b500b149ed
[]
no_license
hoangpn412/Kidy-Parent
ad42f9012c9460758ba197820bad6585901a7e2b
ec57368c2a57effdcecdeb0e9b2c67eb03bd88ef
refs/heads/master
2020-03-16T17:28:11.382373
2018-05-10T01:47:41
2018-05-10T01:47:41
132,833,569
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package vn.com.kidy.view.widget.decorators; import android.app.Activity; import android.graphics.drawable.Drawable; import com.prolificinteractive.materialcalendarview.CalendarDay; import com.prolificinteractive.materialcalendarview.DayViewDecorator; import com.prolificinteractive.materialcalendarview.DayViewFacade; import vn.com.kidy.R; /** * Use a custom selector */ public class MySelectorDecorator implements DayViewDecorator { private final Drawable drawable; public MySelectorDecorator(Activity context) { drawable = context.getResources().getDrawable(R.drawable.cirle_orange); } @Override public boolean shouldDecorate(CalendarDay day) { return true; } @Override public void decorate(DayViewFacade view) { view.setSelectionDrawable(drawable); } }
f1fc737121e05a613f8e2de0a3e30337480bbae5
7cc175b638964f2729640a83751bf8ddb390caa3
/app/src/main/java/com/jag0292/popularmovies/fragments/MovieDetailFragment.java
140448947bd8c8fecd7bfc8df392140229623aaa
[]
no_license
jalvarez92/Popular-Movies
4a85830d210ce1162a749ae0c72e95951f9f4126
fa0fcd6a715449f0db83fb29ddb385593b859a22
refs/heads/master
2021-01-10T10:29:48.258152
2016-04-15T04:02:47
2016-04-15T04:02:47
55,745,241
0
0
null
null
null
null
UTF-8
Java
false
false
3,868
java
package com.jag0292.popularmovies.fragments; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.jag0292.popularmovies.R; import com.jag0292.popularmovies.models.Movie; import com.squareup.picasso.Picasso; /** * A simple {@link Fragment} subclass. * Use the {@link MovieDetailFragment#newInstance} factory method to * create an instance of this fragment. */ public class MovieDetailFragment extends Fragment { private static final String ARG_PARAM_MOVIE_TITLE = "movie_title"; private static final String ARG_PARAM_POSTER_URL = "poster_url"; private static final String ARG_PARAM_SYNOPSIS = "synopsis"; private static final String ARG_PARAM_USER_RATING = "user_rating"; private static final String ARG_PARAM_RELEASE_DATE = "release_date"; private ImageView mImageViewMoviePoster; private TextView mTextViewMovieTitle; private TextView mTextViewUserRating; private TextView mTextViewReleaseDate; private TextView mTextViewSynopsis; private String mParamMovieTitle; private String mParamPosterUrl; private String mParamSynopsis; private Float mParamUserRating; private String mParamReleaseDate; public MovieDetailFragment() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @return A new instance of fragment MovieDetailFragment. */ // TODO: Rename and change types and number of parameters public static MovieDetailFragment newInstance(Movie pMovie) { MovieDetailFragment fragment = new MovieDetailFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM_MOVIE_TITLE, pMovie.mTitle); args.putString(ARG_PARAM_POSTER_URL, pMovie.mPosterURL); args.putString(ARG_PARAM_SYNOPSIS, pMovie.mSynopsis); args.putFloat(ARG_PARAM_USER_RATING, pMovie.mUserRating); args.putString(ARG_PARAM_RELEASE_DATE, pMovie.mReleaseDate); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParamMovieTitle = getArguments().getString(ARG_PARAM_MOVIE_TITLE); mParamPosterUrl = getArguments().getString(ARG_PARAM_POSTER_URL); mParamSynopsis = getArguments().getString(ARG_PARAM_SYNOPSIS); mParamUserRating = getArguments().getFloat(ARG_PARAM_USER_RATING); mParamReleaseDate = getArguments().getString(ARG_PARAM_RELEASE_DATE); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_movie_detail, container, false); mTextViewMovieTitle = (TextView) view.findViewById(R.id.textViewMovieTitle); mTextViewMovieTitle.setText(mParamMovieTitle); mTextViewUserRating = (TextView) view.findViewById(R.id.textViewUserRating); mTextViewUserRating.setText(mParamUserRating+""); mTextViewReleaseDate = (TextView) view.findViewById(R.id.textViewReleaseDate); mTextViewReleaseDate.setText(mParamReleaseDate); mTextViewSynopsis = (TextView) view.findViewById(R.id.textViewSynopsis); mTextViewSynopsis.setText(mParamSynopsis); mImageViewMoviePoster = (ImageView) view.findViewById(R.id.imageViewMoviePoster); Picasso.with(getActivity()).load(mParamPosterUrl).into(mImageViewMoviePoster); return view; } }
d601f305d20995164ec16423a9139014224e3856
1764b571370c8e9f7533bb657d5d0c015946da23
/javaseworkspace00/jdk8feature00/src/com/interfacedef/C.java
ef79e6473e83098398448fabaa75602106c888d7
[]
no_license
tangnew/history-project
bbdea7933409ceedef9fcd997f83731fa19c115e
7cbe1374491bcf2aa672aade0f12f0d1540d1899
refs/heads/master
2020-03-19T04:12:22.370139
2018-06-02T10:42:13
2018-06-02T10:42:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
243
java
package com.interfacedef; public class C implements A, B { @Override public void sayHello() { System.out.println("c"); } public static void main(String[] args) { A a = new C(); a.sayHello(); B b = new C(); b.sayHello(); } }
892929c1c9719ad30ffba90f32c7befa6927b7f8
cdee2fd05c4c309f219d304497b0379854ccbdff
/Sesion-08/Ejemplo-02/sonarqube/src/main/java/org/bedu/testing/demo/monitoreo/controllers/MensajeController.java
5ba43d021a3a6a08fdce52097b10563730c31506
[]
no_license
PerlaGCastillo/C2-Java-Testing
bf2b75b828354e723e3eb71c7a367f44ecbfacb2
45ca4edc902e20f1fb9cbc03b4f3fcd4afa8e238
refs/heads/master
2020-11-26T02:06:42.575078
2019-11-18T14:10:13
2019-11-18T14:10:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,825
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 org.bedu.testing.demo.monitoreo.controllers; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import org.bedu.testing.demo.monitoreo.entitys.Establecimiento; import org.bedu.testing.demo.monitoreo.entitys.Mensaje; import org.bedu.testing.demo.monitoreo.entitys.Usuario; import org.bedu.testing.demo.monitoreo.services.EstablecimientoService; import org.bedu.testing.demo.monitoreo.services.MensajeService; import org.bedu.testing.demo.monitoreo.services.SaveMensajeService; import org.bedu.testing.demo.monitoreo.services.UsuarioService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import lombok.AllArgsConstructor; import lombok.Data; import lombok.RequiredArgsConstructor; /** * * @author cypunk */ @RequiredArgsConstructor(onConstructor_ = { @Autowired }) @RequestMapping(value = "/mensaje", produces = APPLICATION_JSON_VALUE) @RestController public class MensajeController { private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yy"); @Data private static class MensajeInputDTO { String mensaje; Long idEstablecimiento; } @Data @AllArgsConstructor private static class MensajeOutputDTO { Long id; String mensaje; String usuario; String perfil; String fecha; boolean leido; } private final MensajeService mensajeService; private final SaveMensajeService saveMensajeService; private final UsuarioService usuarioService; private final EstablecimientoService establecimientoService; @PostMapping(value = "/", consumes = APPLICATION_JSON_VALUE) public Mensaje enviarMensaje(@RequestBody MensajeInputDTO mensaje) { return saveMensajeService.nuevoMensaje(mensaje.mensaje, mensaje.idEstablecimiento); } @PutMapping(value = "/{idMensaje}") public Mensaje cambiarEstatusMensaje(@PathVariable Long idMensaje) { return mensajeService.cambiarEstatusMensaje(idMensaje); } @GetMapping("/usuario/{idUsuario}") public List<Mensaje> obtenerMensajesPorUsuario(@PathVariable Long idUsuario) { Usuario usuario = usuarioService.obtenerUsuarioPorId(idUsuario); return mensajeService.obtenerMensajesPorUsuario(usuario); } @GetMapping("/") public Page<Mensaje> obtenerTodosLosMensajes(@RequestParam int size, @RequestParam int page) { return mensajeService.obtenertodosLosMensajes(page, size); } @GetMapping("/estatus/{estatus}") public Page<Mensaje> obtenerMensajesPorEstatus(@PathVariable boolean estatus, @RequestParam int size, @RequestParam int page) { return mensajeService.obtenertodosLosMensajesPorEstatus(estatus, page, size); } @GetMapping("/establecimiento/{idEstablecimiento}") public List<MensajeOutputDTO> obtenerMensajesPorEstablecimientos(@PathVariable Long idEstablecimiento) { return formatearMensajes(obtenerMensajes(idEstablecimiento)); } private List<MensajeOutputDTO> formatearMensajes(List<Mensaje> mensajes) { List<MensajeOutputDTO> mensajesFormateados = new ArrayList<>(); for (Mensaje m : mensajes) { String nombre = String.format("%s %s", m.getUsuario().getNombre(), m.getUsuario().getApellidoPaterno()); String perfil = m.getUsuario().getPerfil().getDescripcion(); MensajeOutputDTO mf = new MensajeOutputDTO(m.getIdMensaje(), m.getMensaje(), nombre, perfil, m.getFecha().format(FORMATTER), m.isLeido()); mensajesFormateados.add(mf); } return mensajesFormateados; } private List<Mensaje> obtenerMensajes(Long idEstablecimiento) { Establecimiento establecimiento = establecimientoService.obtenerEstablecimientoPorId(idEstablecimiento); return mensajeService.obtenerMensajesPorEstablecimiento(establecimiento); } @GetMapping("/{idEstablecimiento}/{estatus}") public List<Mensaje> obtenerMensajesPorEstablecimientosYEstatus(@PathVariable Long idEstablecimiento, @PathVariable boolean estatus) { Establecimiento establecimiento = establecimientoService.obtenerEstablecimientoPorId(idEstablecimiento); return mensajeService.obtenerMensajesPorEstablecimientoYEstatus(establecimiento, estatus); } }
350faa2ca7135754abf4532ecc92cb18d076bbeb
d46146fff05bce917140396b17580e67f249b00a
/src/main/java/com/agrobourse/dev/web/rest/PortefolioResource.java
473c16179ed94a7a12c84f72a3692211b544f9e9
[]
no_license
AhmedAltiad/Agrodev
c43bd71da57b85d95f44e533c8c6b062ca5dc43e
6039aca697845f12cbe3f8735bb459d2c27dafde
refs/heads/master
2021-01-18T12:56:52.083651
2017-07-07T10:11:44
2017-07-07T10:11:44
100,368,744
0
0
null
null
null
null
UTF-8
Java
false
false
5,941
java
package com.agrobourse.dev.web.rest; import com.codahale.metrics.annotation.Timed; import com.agrobourse.dev.domain.Portefolio; import com.agrobourse.dev.repository.PortefolioRepository; import com.agrobourse.dev.repository.search.PortefolioSearchRepository; import com.agrobourse.dev.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.StreamSupport; import static org.elasticsearch.index.query.QueryBuilders.*; /** * REST controller for managing Portefolio. */ @RestController @RequestMapping("/api") public class PortefolioResource { private final Logger log = LoggerFactory.getLogger(PortefolioResource.class); private static final String ENTITY_NAME = "portefolio"; private final PortefolioRepository portefolioRepository; private final PortefolioSearchRepository portefolioSearchRepository; public PortefolioResource(PortefolioRepository portefolioRepository, PortefolioSearchRepository portefolioSearchRepository) { this.portefolioRepository = portefolioRepository; this.portefolioSearchRepository = portefolioSearchRepository; } /** * POST /portefolios : Create a new portefolio. * * @param portefolio the portefolio to create * @return the ResponseEntity with status 201 (Created) and with body the new portefolio, or with status 400 (Bad Request) if the portefolio has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/portefolios") @Timed public ResponseEntity<Portefolio> createPortefolio(@RequestBody Portefolio portefolio) throws URISyntaxException { log.debug("REST request to save Portefolio : {}", portefolio); if (portefolio.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "A new portefolio cannot already have an ID")).body(null); } Portefolio result = portefolioRepository.save(portefolio); portefolioSearchRepository.save(result); return ResponseEntity.created(new URI("/api/portefolios/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /portefolios : Updates an existing portefolio. * * @param portefolio the portefolio to update * @return the ResponseEntity with status 200 (OK) and with body the updated portefolio, * or with status 400 (Bad Request) if the portefolio is not valid, * or with status 500 (Internal Server Error) if the portefolio couldnt be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/portefolios") @Timed public ResponseEntity<Portefolio> updatePortefolio(@RequestBody Portefolio portefolio) throws URISyntaxException { log.debug("REST request to update Portefolio : {}", portefolio); if (portefolio.getId() == null) { return createPortefolio(portefolio); } Portefolio result = portefolioRepository.save(portefolio); portefolioSearchRepository.save(result); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, portefolio.getId().toString())) .body(result); } /** * GET /portefolios : get all the portefolios. * * @return the ResponseEntity with status 200 (OK) and the list of portefolios in body */ @GetMapping("/portefolios") @Timed public List<Portefolio> getAllPortefolios() { log.debug("REST request to get all Portefolios"); List<Portefolio> portefolios = portefolioRepository.findAllWithEagerRelationships(); return portefolios; } /** * GET /portefolios/:id : get the "id" portefolio. * * @param id the id of the portefolio to retrieve * @return the ResponseEntity with status 200 (OK) and with body the portefolio, or with status 404 (Not Found) */ @GetMapping("/portefolios/{id}") @Timed public ResponseEntity<Portefolio> getPortefolio(@PathVariable Long id) { log.debug("REST request to get Portefolio : {}", id); Portefolio portefolio = portefolioRepository.findOneWithEagerRelationships(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(portefolio)); } /** * DELETE /portefolios/:id : delete the "id" portefolio. * * @param id the id of the portefolio to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/portefolios/{id}") @Timed public ResponseEntity<Void> deletePortefolio(@PathVariable Long id) { log.debug("REST request to delete Portefolio : {}", id); portefolioRepository.delete(id); portefolioSearchRepository.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } /** * SEARCH /_search/portefolios?query=:query : search for the portefolio corresponding * to the query. * * @param query the query of the portefolio search * @return the result of the search */ @GetMapping("/_search/portefolios") @Timed public List<Portefolio> searchPortefolios(@RequestParam String query) { log.debug("REST request to search Portefolios for query {}", query); return StreamSupport .stream(portefolioSearchRepository.search(queryStringQuery(query)).spliterator(), false) .collect(Collectors.toList()); } }
24690e64f5b577821dc89106dcbebc93b02def8b
ef72ed8a86bcdf9ec97fabd62a8e89a7f5508cfa
/src/list/Collection.java
a3fe0e15fbea491a424723e788d0455698ea118d
[]
no_license
zeezeewang/leetcode
4f250efc13f9b5c8d3e9d31b553fb1c8d8658db7
49840bbce8adedeeb146892c65cb550c168b33af
refs/heads/master
2020-03-22T05:14:09.542344
2018-07-03T09:47:35
2018-07-03T09:47:35
138,878,353
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package list; import java.util.Collection; import java.util.ArrayList; import java.util.Iterator; class TestCollection { public static void main(String[] args){ Collection c = new ArrayList(); c.add("a"); c.add("b"); c.add("c"); c.add("d"); Iterator it = c.iterator(); while(it.hasNext()){ System.out.println(it.next()); } } }
763f5619814adf2d39e10a9c41a738549af1e687
b03265411849180318ec688436a865cad99971da
/myLayoutTutorial/gen/com/example/mylayouttutorial/R.java
74ef4d64fe30376f5371a77bed2a8a92ac46bcf5
[]
no_license
syeed007/Android-mania
1c7941c114ff3a47d6ecfb9801382ec90d0b1a04
6dc3cf3d84baea8fce2dc1715c8bbd85c65d9f08
refs/heads/master
2016-09-06T01:52:59.914953
2015-03-18T19:45:13
2015-03-18T19:45:13
25,537,047
0
0
null
null
null
null
UTF-8
Java
false
false
182,339
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.mylayouttutorial; 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_slide_in_bottom=0x7f040002; public static final int abc_slide_in_top=0x7f040003; public static final int abc_slide_out_bottom=0x7f040004; public static final int abc_slide_out_top=0x7f040005; } public static final class array { public static final int layoutTypes_array=0x7f0c0000; } public static final class attr { /** Custom divider drawable to use for elements in the action bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarDivider=0x7f01000f; /** Custom item state list drawable background for action bar items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarItemBackground=0x7f010010; /** Size of the Action Bar, including the contextual bar used to present Action Modes. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionBarSize=0x7f01000e; /** Reference to a theme that should be used to inflate widgets and layouts destined for the action bar. Most of the time this will be a reference to the current theme, but when the action bar has a significantly different contrast profile than the rest of the activity the difference can become important. If this is set to @null the current theme will be used. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarSplitStyle=0x7f01000c; /** Reference to a style for the Action Bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarStyle=0x7f01000b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabBarStyle=0x7f010008; /** Default style for tabs within an action bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabStyle=0x7f010007; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabTextStyle=0x7f010009; /** Reference to a theme that should be used to inflate widgets and layouts destined for the action bar. Most of the time this will be a reference to the current theme, but when the action bar has a significantly different contrast profile than the rest of the activity the difference can become important. If this is set to @null the current theme will be used. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarWidgetTheme=0x7f01000d; /** Default action button style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionButtonStyle=0x7f010016; /** Default ActionBar dropdown style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionDropDownStyle=0x7f010047; /** An optional layout to be used as an action view. See {@link android.view.MenuItem#setActionView(android.view.View)} for more info. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionLayout=0x7f01004e; /** TextAppearance style that will be applied to text that appears within action menu items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionMenuTextAppearance=0x7f010011; /** Color for text that appears within action menu items. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int actionMenuTextColor=0x7f010012; /** Background drawable to use for action mode UI <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeBackground=0x7f01003c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCloseButtonStyle=0x7f01003b; /** Drawable to use for the close action mode button <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCloseDrawable=0x7f01003e; /** Drawable to use for the Copy action button in Contextual Action Bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCopyDrawable=0x7f010040; /** Drawable to use for the Cut action button in Contextual Action Bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCutDrawable=0x7f01003f; /** Drawable to use for the Find action button in WebView selection action modes <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeFindDrawable=0x7f010044; /** Drawable to use for the Paste action button in Contextual Action Bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModePasteDrawable=0x7f010041; /** PopupWindow style to use for action modes when showing as a window overlay. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModePopupWindowStyle=0x7f010046; /** Drawable to use for the Select all action button in Contextual Action Bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeSelectAllDrawable=0x7f010042; /** Drawable to use for the Share action button in WebView selection action modes <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeShareDrawable=0x7f010043; /** Background drawable to use for action mode UI in the lower split bar <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeSplitBackground=0x7f01003d; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeStyle=0x7f01003a; /** Drawable to use for the Web Search action button in WebView selection action modes <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeWebSearchDrawable=0x7f010045; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionOverflowButtonStyle=0x7f01000a; /** The name of an optional ActionProvider class to instantiate an action view and perform operations such as default action for that menu item. See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)} for more info. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionProviderClass=0x7f010050; /** The name of an optional View class to instantiate and use as an action view. See {@link android.view.MenuItem#setActionView(android.view.View)} for more info. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionViewClass=0x7f01004f; /** Default ActivityChooserView style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int activityChooserViewStyle=0x7f01006c; /** Specifies a background drawable for the action bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int background=0x7f01002f; /** Specifies a background drawable for the bottom component of a split action bar. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int backgroundSplit=0x7f010031; /** Specifies a background drawable for a second stacked row of the action bar. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int backgroundStacked=0x7f010030; /** A style that may be applied to Buttons placed within a LinearLayout with the style buttonBarStyle to form a button bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int buttonBarButtonStyle=0x7f010018; /** A style that may be applied to horizontal LinearLayouts to form a button bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int buttonBarStyle=0x7f010017; /** Specifies a layout for custom navigation. Overrides navigationMode. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int customNavigationLayout=0x7f010032; /** Whether this spinner should mark child views as enabled/disabled when the spinner itself is enabled/disabled. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int disableChildrenWhenDisabled=0x7f010054; /** Options affecting how the action bar is displayed. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr> <tr><td><code>showHome</code></td><td>0x2</td><td></td></tr> <tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr> <tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr> <tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr> <tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr> </table> */ public static final int displayOptions=0x7f010028; /** Specifies the drawable used for item dividers. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int divider=0x7f01002e; /** A drawable that may be used as a horizontal divider between visual elements. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dividerHorizontal=0x7f01001b; /** Size of padding on either end of a divider. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int dividerPadding=0x7f010056; /** A drawable that may be used as a vertical divider between visual elements. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dividerVertical=0x7f01001a; /** ListPopupWindow comaptibility <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dropDownListViewStyle=0x7f010021; /** The preferred item height for dropdown lists. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int dropdownListPreferredItemHeight=0x7f010048; /** The drawable to show in the button for expanding the activities overflow popup. <strong>Note:</strong> Clients would like to set this drawable as a clue about the action the chosen activity will perform. For example, if share activity is to be chosen the drawable should give a clue that sharing is to be performed. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int expandActivityOverflowButtonDrawable=0x7f01006b; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int height=0x7f010026; /** Specifies a drawable to use for the 'home as up' indicator. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int homeAsUpIndicator=0x7f010013; /** Specifies a layout to use for the "home" section of the action bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int homeLayout=0x7f010033; /** Specifies the drawable used for the application icon. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int icon=0x7f01002c; /** The default state of the SearchView. If true, it will be iconified when not in use and expanded when clicked. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int iconifiedByDefault=0x7f01005a; /** Specifies a style resource to use for an indeterminate progress spinner. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int indeterminateProgressStyle=0x7f010035; /** The maximal number of items initially shown in the activity list. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int initialActivityCount=0x7f01006a; /** Specifies whether the theme is light, otherwise it is dark. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int isLightTheme=0x7f010059; /** Specifies padding that should be applied to the left and right sides of system-provided items in the bar. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int itemPadding=0x7f010037; /** Drawable used as a background for selected list items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int listChoiceBackgroundIndicator=0x7f01004c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int listPopupWindowStyle=0x7f010022; /** The preferred list item height. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeight=0x7f01001c; /** A larger, more robust list item height. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeightLarge=0x7f01001e; /** A smaller, sleeker list item height. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeightSmall=0x7f01001d; /** The preferred padding along the left edge of list items. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemPaddingLeft=0x7f01001f; /** The preferred padding along the right edge of list items. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemPaddingRight=0x7f010020; /** Specifies the drawable used for the application logo. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int logo=0x7f01002d; /** The type of navigation to use. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr> <tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr> <tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr> </table> */ public static final int navigationMode=0x7f010027; /** Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int paddingEnd=0x7f010039; /** Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int paddingStart=0x7f010038; /** Default Panel Menu style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int panelMenuListTheme=0x7f01004b; /** Default Panel Menu width. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int panelMenuListWidth=0x7f01004a; /** Default PopupMenu style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int popupMenuStyle=0x7f010049; /** Reference to a layout to use for displaying a prompt in the dropdown for spinnerMode="dropdown". This layout must contain a TextView with the id {@code @android:id/text1} to be populated with the prompt text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int popupPromptView=0x7f010053; /** Specifies the horizontal padding on either end for an embedded progress bar. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int progressBarPadding=0x7f010036; /** Specifies a style resource to use for an embedded progress bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int progressBarStyle=0x7f010034; /** The prompt to display when the spinner's dialog is shown. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int prompt=0x7f010051; /** An optional query hint string to be displayed in the empty query field. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int queryHint=0x7f01005b; /** SearchView dropdown background <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchDropdownBackground=0x7f01005c; /** The list item height for search results. @hide <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int searchResultListItemHeight=0x7f010065; /** SearchView AutoCompleteTextView style <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewAutoCompleteTextView=0x7f010069; /** SearchView close button icon <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewCloseIcon=0x7f01005d; /** SearchView query refinement icon <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewEditQuery=0x7f010061; /** SearchView query refinement icon background <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewEditQueryBackground=0x7f010062; /** SearchView Go button icon <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewGoIcon=0x7f01005e; /** SearchView Search icon <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewSearchIcon=0x7f01005f; /** SearchView text field background for the left section <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewTextField=0x7f010063; /** SearchView text field background for the right section <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewTextFieldRight=0x7f010064; /** SearchView Voice button icon <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewVoiceIcon=0x7f010060; /** A style that may be applied to buttons or other selectable items that should react to pressed and focus states, but that do not have a clear visual border along the edges. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int selectableItemBackground=0x7f010019; /** How this item should display in the Action Bar, if present. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>never</code></td><td>0</td><td> Never show this item in an action bar, show it in the overflow menu instead. Mutually exclusive with "ifRoom" and "always". </td></tr> <tr><td><code>ifRoom</code></td><td>1</td><td> Show this item in an action bar if there is room for it as determined by the system. Favor this option over "always" where possible. Mutually exclusive with "never" and "always". </td></tr> <tr><td><code>always</code></td><td>2</td><td> Always show this item in an actionbar, even if it would override the system's limits of how much stuff to put there. This may make your action bar look bad on some screens. In most cases you should use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". </td></tr> <tr><td><code>withText</code></td><td>4</td><td> When this item is shown as an action in the action bar, show a text label with it even if it has an icon representation. </td></tr> <tr><td><code>collapseActionView</code></td><td>8</td><td> This item's action view collapses to a normal menu item. When expanded, the action view takes over a larger segment of its container. </td></tr> </table> */ public static final int showAsAction=0x7f01004d; /** Setting for which dividers to show. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>beginning</code></td><td>1</td><td></td></tr> <tr><td><code>middle</code></td><td>2</td><td></td></tr> <tr><td><code>end</code></td><td>4</td><td></td></tr> </table> */ public static final int showDividers=0x7f010055; /** Default Spinner style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int spinnerDropDownItemStyle=0x7f010058; /** Display mode for spinner options. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr> <tr><td><code>dropdown</code></td><td>1</td><td> Spinner options will be presented to the user as an inline dropdown anchored to the spinner widget itself. </td></tr> </table> */ public static final int spinnerMode=0x7f010052; /** Default Spinner style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int spinnerStyle=0x7f010057; /** Specifies subtitle text used for navigationMode="normal" <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int subtitle=0x7f010029; /** Specifies a style to use for subtitle text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int subtitleTextStyle=0x7f01002b; /** Present the text in ALL CAPS. This may use a small-caps form when available. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a boolean value, either "<code>true</code>" or "<code>false</code>". */ public static final int textAllCaps=0x7f01006d; /** Text color, typeface, size, and style for the text inside of a popup menu. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceLargePopupMenu=0x7f010014; /** The preferred TextAppearance for the primary text of list items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceListItem=0x7f010023; /** The preferred TextAppearance for the primary text of small list items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceListItemSmall=0x7f010024; /** Text color, typeface, size, and style for system search result subtitle. Defaults to primary inverse text color. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSearchResultSubtitle=0x7f010067; /** Text color, typeface, size, and style for system search result title. Defaults to primary inverse text color. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSearchResultTitle=0x7f010066; /** Text color, typeface, size, and style for small text inside of a popup menu. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSmallPopupMenu=0x7f010015; /** Text color for urls in search suggestions, used by things like global search <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int textColorSearchUrl=0x7f010068; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int title=0x7f010025; /** Specifies a style to use for title text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int titleTextStyle=0x7f01002a; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowActionBar=0x7f010000; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowActionBarOverlay=0x7f010001; /** A fixed height for the window along the major axis of the screen, that is, when in portrait. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowFixedHeightMajor=0x7f010006; /** A fixed height for the window along the minor axis of the screen, that is, when in landscape. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowFixedHeightMinor=0x7f010004; /** A fixed width for the window along the major axis of the screen, that is, when in landscape. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowFixedWidthMajor=0x7f010003; /** A fixed width for the window along the minor axis of the screen, that is, when in portrait. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowFixedWidthMinor=0x7f010005; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowSplitActionBar=0x7f010002; } public static final class bool { public static final int abc_action_bar_embed_tabs_pre_jb=0x7f060000; public static final int abc_action_bar_expanded_action_views_exclusive=0x7f060001; /** Whether action menu items should be displayed in ALLCAPS or not. Defaults to true. If this is not appropriate for specific locales it should be disabled in that locale's resources. */ public static final int abc_config_actionMenuItemAllCaps=0x7f060005; /** Whether action menu items should obey the "withText" showAsAction flag. This may be set to false for situations where space is extremely limited. Whether action menu items should obey the "withText" showAsAction. This may be set to false for situations where space is extremely limited. */ public static final int abc_config_allowActionMenuItemTextWithIcon=0x7f060004; public static final int abc_config_showMenuShortcutsWhenKeyboardPresent=0x7f060003; public static final int abc_split_action_bar_is_narrow=0x7f060002; } public static final class color { public static final int abc_search_url_text_holo=0x7f070003; public static final int abc_search_url_text_normal=0x7f070000; public static final int abc_search_url_text_pressed=0x7f070002; public static final int abc_search_url_text_selected=0x7f070001; } public static final class dimen { /** Default height of an action bar. Default height of an action bar. Default height of an action bar. Default height of an action bar. Default height of an action bar. */ public static final int abc_action_bar_default_height=0x7f080002; /** Vertical padding around action bar icons. Vertical padding around action bar icons. Vertical padding around action bar icons. Vertical padding around action bar icons. Vertical padding around action bar icons. */ public static final int abc_action_bar_icon_vertical_padding=0x7f080003; /** Size of the indeterminate Progress Bar Size of the indeterminate Progress Bar */ public static final int abc_action_bar_progress_bar_size=0x7f08000a; /** Maximum height for a stacked tab bar as part of an action bar */ public static final int abc_action_bar_stacked_max_height=0x7f080009; /** Maximum width for a stacked action bar tab. This prevents action bar tabs from becoming too wide on a wide screen when only a few are present. */ public static final int abc_action_bar_stacked_tab_max_width=0x7f080001; /** Bottom margin for action bar subtitles Bottom margin for action bar subtitles Bottom margin for action bar subtitles Bottom margin for action bar subtitles Bottom margin for action bar subtitles */ public static final int abc_action_bar_subtitle_bottom_margin=0x7f080007; /** Text size for action bar subtitles Text size for action bar subtitles Text size for action bar subtitles Text size for action bar subtitles Text size for action bar subtitles */ public static final int abc_action_bar_subtitle_text_size=0x7f080005; /** Top margin for action bar subtitles Top margin for action bar subtitles Top margin for action bar subtitles Top margin for action bar subtitles Top margin for action bar subtitles */ public static final int abc_action_bar_subtitle_top_margin=0x7f080006; /** Text size for action bar titles Text size for action bar titles Text size for action bar titles Text size for action bar titles Text size for action bar titles */ public static final int abc_action_bar_title_text_size=0x7f080004; /** Minimum width for an action button in the menu area of an action bar Minimum width for an action button in the menu area of an action bar Minimum width for an action button in the menu area of an action bar */ public static final int abc_action_button_min_width=0x7f080008; /** The maximum width we would prefer dialogs to be. 0 if there is no maximum (let them grow as large as the screen). Actual values are specified for -large and -xlarge configurations. see comment in values/config.xml see comment in values/config.xml */ public static final int abc_config_prefDialogWidth=0x7f080000; /** Width of the icon in a dropdown list */ public static final int abc_dropdownitem_icon_width=0x7f080010; /** Text padding for dropdown items */ public static final int abc_dropdownitem_text_padding_left=0x7f08000e; public static final int abc_dropdownitem_text_padding_right=0x7f08000f; public static final int abc_panel_menu_list_width=0x7f08000b; /** Preferred width of the search view. */ public static final int abc_search_view_preferred_width=0x7f08000d; /** Minimum width of the search view text entry area. Minimum width of the search view text entry area. Minimum width of the search view text entry area. Minimum width of the search view text entry area. */ public static final int abc_search_view_text_min_width=0x7f08000c; /** Default screen margins, per the Android Design guidelines. Example customization of dimensions originally defined in res/values/dimens.xml (such as screen margins) for screens with more than 820dp of available width. This would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). */ public static final int activity_horizontal_margin=0x7f080015; public static final int activity_vertical_margin=0x7f080016; /** The platform's desired fixed height for a dialog along the major axis (the screen is in portrait). This may be either a fraction or a dimension. The platform's desired fixed height for a dialog along the major axis (the screen is in portrait). This may be either a fraction or a dimension. The platform's desired fixed height for a dialog along the major axis (the screen is in portrait). This may be either a fraction or a dimension. */ public static final int dialog_fixed_height_major=0x7f080013; /** The platform's desired fixed height for a dialog along the minor axis (the screen is in landscape). This may be either a fraction or a dimension. The platform's desired fixed height for a dialog along the minor axis (the screen is in landscape). This may be either a fraction or a dimension. The platform's desired fixed height for a dialog along the minor axis (the screen is in landscape). This may be either a fraction or a dimension. */ public static final int dialog_fixed_height_minor=0x7f080014; /** The platform's desired fixed width for a dialog along the major axis (the screen is in landscape). This may be either a fraction or a dimension. The platform's desired fixed width for a dialog along the major axis (the screen is in landscape). This may be either a fraction or a dimension. The platform's desired fixed width for a dialog along the major axis (the screen is in landscape). This may be either a fraction or a dimension. */ public static final int dialog_fixed_width_major=0x7f080011; /** The platform's desired fixed width for a dialog along the minor axis (the screen is in portrait). This may be either a fraction or a dimension. The platform's desired fixed width for a dialog along the minor axis (the screen is in portrait). This may be either a fraction or a dimension. The platform's desired fixed width for a dialog along the minor axis (the screen is in portrait). This may be either a fraction or a dimension. */ public static final int dialog_fixed_width_minor=0x7f080012; } public static final class drawable { public static final int abc_ab_bottom_solid_dark_holo=0x7f020000; public static final int abc_ab_bottom_solid_light_holo=0x7f020001; public static final int abc_ab_bottom_transparent_dark_holo=0x7f020002; public static final int abc_ab_bottom_transparent_light_holo=0x7f020003; public static final int abc_ab_share_pack_holo_dark=0x7f020004; public static final int abc_ab_share_pack_holo_light=0x7f020005; public static final int abc_ab_solid_dark_holo=0x7f020006; public static final int abc_ab_solid_light_holo=0x7f020007; public static final int abc_ab_stacked_solid_dark_holo=0x7f020008; public static final int abc_ab_stacked_solid_light_holo=0x7f020009; public static final int abc_ab_stacked_transparent_dark_holo=0x7f02000a; public static final int abc_ab_stacked_transparent_light_holo=0x7f02000b; public static final int abc_ab_transparent_dark_holo=0x7f02000c; public static final int abc_ab_transparent_light_holo=0x7f02000d; public static final int abc_cab_background_bottom_holo_dark=0x7f02000e; public static final int abc_cab_background_bottom_holo_light=0x7f02000f; public static final int abc_cab_background_top_holo_dark=0x7f020010; public static final int abc_cab_background_top_holo_light=0x7f020011; public static final int abc_ic_ab_back_holo_dark=0x7f020012; public static final int abc_ic_ab_back_holo_light=0x7f020013; public static final int abc_ic_cab_done_holo_dark=0x7f020014; public static final int abc_ic_cab_done_holo_light=0x7f020015; public static final int abc_ic_clear=0x7f020016; public static final int abc_ic_clear_disabled=0x7f020017; public static final int abc_ic_clear_holo_light=0x7f020018; public static final int abc_ic_clear_normal=0x7f020019; public static final int abc_ic_clear_search_api_disabled_holo_light=0x7f02001a; public static final int abc_ic_clear_search_api_holo_light=0x7f02001b; public static final int abc_ic_commit_search_api_holo_dark=0x7f02001c; public static final int abc_ic_commit_search_api_holo_light=0x7f02001d; public static final int abc_ic_go=0x7f02001e; public static final int abc_ic_go_search_api_holo_light=0x7f02001f; public static final int abc_ic_menu_moreoverflow_normal_holo_dark=0x7f020020; public static final int abc_ic_menu_moreoverflow_normal_holo_light=0x7f020021; public static final int abc_ic_menu_share_holo_dark=0x7f020022; public static final int abc_ic_menu_share_holo_light=0x7f020023; public static final int abc_ic_search=0x7f020024; public static final int abc_ic_search_api_holo_light=0x7f020025; public static final int abc_ic_voice_search=0x7f020026; public static final int abc_ic_voice_search_api_holo_light=0x7f020027; public static final int abc_item_background_holo_dark=0x7f020028; public static final int abc_item_background_holo_light=0x7f020029; public static final int abc_list_divider_holo_dark=0x7f02002a; public static final int abc_list_divider_holo_light=0x7f02002b; public static final int abc_list_focused_holo=0x7f02002c; public static final int abc_list_longpressed_holo=0x7f02002d; public static final int abc_list_pressed_holo_dark=0x7f02002e; public static final int abc_list_pressed_holo_light=0x7f02002f; public static final int abc_list_selector_background_transition_holo_dark=0x7f020030; public static final int abc_list_selector_background_transition_holo_light=0x7f020031; public static final int abc_list_selector_disabled_holo_dark=0x7f020032; public static final int abc_list_selector_disabled_holo_light=0x7f020033; public static final int abc_list_selector_holo_dark=0x7f020034; public static final int abc_list_selector_holo_light=0x7f020035; public static final int abc_menu_dropdown_panel_holo_dark=0x7f020036; public static final int abc_menu_dropdown_panel_holo_light=0x7f020037; public static final int abc_menu_hardkey_panel_holo_dark=0x7f020038; public static final int abc_menu_hardkey_panel_holo_light=0x7f020039; public static final int abc_search_dropdown_dark=0x7f02003a; public static final int abc_search_dropdown_light=0x7f02003b; public static final int abc_spinner_ab_default_holo_dark=0x7f02003c; public static final int abc_spinner_ab_default_holo_light=0x7f02003d; public static final int abc_spinner_ab_disabled_holo_dark=0x7f02003e; public static final int abc_spinner_ab_disabled_holo_light=0x7f02003f; public static final int abc_spinner_ab_focused_holo_dark=0x7f020040; public static final int abc_spinner_ab_focused_holo_light=0x7f020041; public static final int abc_spinner_ab_holo_dark=0x7f020042; public static final int abc_spinner_ab_holo_light=0x7f020043; public static final int abc_spinner_ab_pressed_holo_dark=0x7f020044; public static final int abc_spinner_ab_pressed_holo_light=0x7f020045; public static final int abc_tab_indicator_ab_holo=0x7f020046; public static final int abc_tab_selected_focused_holo=0x7f020047; public static final int abc_tab_selected_holo=0x7f020048; public static final int abc_tab_selected_pressed_holo=0x7f020049; public static final int abc_tab_unselected_pressed_holo=0x7f02004a; public static final int abc_textfield_search_default_holo_dark=0x7f02004b; public static final int abc_textfield_search_default_holo_light=0x7f02004c; public static final int abc_textfield_search_right_default_holo_dark=0x7f02004d; public static final int abc_textfield_search_right_default_holo_light=0x7f02004e; public static final int abc_textfield_search_right_selected_holo_dark=0x7f02004f; public static final int abc_textfield_search_right_selected_holo_light=0x7f020050; public static final int abc_textfield_search_selected_holo_dark=0x7f020051; public static final int abc_textfield_search_selected_holo_light=0x7f020052; public static final int abc_textfield_searchview_holo_dark=0x7f020053; public static final int abc_textfield_searchview_holo_light=0x7f020054; public static final int abc_textfield_searchview_right_holo_dark=0x7f020055; public static final int abc_textfield_searchview_right_holo_light=0x7f020056; public static final int ic_launcher=0x7f020057; public static final int image1=0x7f020058; public static final int image10=0x7f020059; public static final int image11=0x7f02005a; public static final int image12=0x7f02005b; public static final int image2=0x7f02005c; public static final int image3=0x7f02005d; public static final int image4=0x7f02005e; public static final int image5=0x7f02005f; public static final int image6=0x7f020060; public static final int image7=0x7f020061; public static final int image8=0x7f020062; public static final int image9=0x7f020063; } public static final class id { public static final int action_bar=0x7f05001c; public static final int action_bar_activity_content=0x7f050015; public static final int action_bar_container=0x7f05001b; public static final int action_bar_overlay_layout=0x7f05001f; public static final int action_bar_root=0x7f05001a; public static final int action_bar_subtitle=0x7f050023; public static final int action_bar_title=0x7f050022; public static final int action_context_bar=0x7f05001d; public static final int action_menu_divider=0x7f050016; public static final int action_menu_presenter=0x7f050017; public static final int action_mode_close_button=0x7f050024; public static final int action_settings=0x7f050041; public static final int activity_chooser_view_content=0x7f050025; public static final int always=0x7f05000b; public static final int beginning=0x7f050011; public static final int cancel_button=0x7f050040; public static final int checkbox=0x7f05002d; public static final int collapseActionView=0x7f05000d; public static final int default_activity_button=0x7f050028; public static final int dialog=0x7f05000e; public static final int disableHome=0x7f050008; public static final int dropdown=0x7f05000f; public static final int edit_query=0x7f050030; public static final int end=0x7f050013; public static final int entry=0x7f05003e; public static final int expand_activities_button=0x7f050026; public static final int expanded_menu=0x7f05002c; public static final int gridview=0x7f05003c; public static final int home=0x7f050014; public static final int homeAsUp=0x7f050005; public static final int icon=0x7f05002a; public static final int ifRoom=0x7f05000a; public static final int image=0x7f050027; public static final int layout_list=0x7f05003d; public static final int listMode=0x7f050001; public static final int list_item=0x7f050029; public static final int middle=0x7f050012; public static final int never=0x7f050009; public static final int none=0x7f050010; public static final int normal=0x7f050000; public static final int ok_button=0x7f05003f; public static final int progress_circular=0x7f050018; public static final int progress_horizontal=0x7f050019; public static final int radio=0x7f05002f; public static final int search_badge=0x7f050032; public static final int search_bar=0x7f050031; public static final int search_button=0x7f050033; public static final int search_close_btn=0x7f050038; public static final int search_edit_frame=0x7f050034; public static final int search_go_btn=0x7f05003a; public static final int search_mag_icon=0x7f050035; public static final int search_plate=0x7f050036; public static final int search_src_text=0x7f050037; public static final int search_voice_btn=0x7f05003b; public static final int shortcut=0x7f05002e; public static final int showCustom=0x7f050007; public static final int showHome=0x7f050004; public static final int showTitle=0x7f050006; public static final int split_action_bar=0x7f05001e; public static final int submit_area=0x7f050039; public static final int tabMode=0x7f050002; public static final int title=0x7f05002b; public static final int top_action_bar=0x7f050020; public static final int up=0x7f050021; public static final int useLogo=0x7f050003; public static final int withText=0x7f05000c; } public static final class integer { /** The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. The maximum number of action buttons that should be permitted within an action bar/action mode. This will be used to determine how many showAsAction="ifRoom" items can fit. "always" items can override this. */ public static final int abc_max_action_buttons=0x7f090000; } public static final class layout { public static final int abc_action_bar_decor=0x7f030000; public static final int abc_action_bar_decor_include=0x7f030001; public static final int abc_action_bar_decor_overlay=0x7f030002; public static final int abc_action_bar_home=0x7f030003; public static final int abc_action_bar_tab=0x7f030004; public static final int abc_action_bar_tabbar=0x7f030005; public static final int abc_action_bar_title_item=0x7f030006; public static final int abc_action_bar_view_list_nav_layout=0x7f030007; public static final int abc_action_menu_item_layout=0x7f030008; public static final int abc_action_menu_layout=0x7f030009; public static final int abc_action_mode_bar=0x7f03000a; public static final int abc_action_mode_close_item=0x7f03000b; public static final int abc_activity_chooser_view=0x7f03000c; public static final int abc_activity_chooser_view_include=0x7f03000d; public static final int abc_activity_chooser_view_list_item=0x7f03000e; public static final int abc_expanded_menu_layout=0x7f03000f; public static final int abc_list_menu_item_checkbox=0x7f030010; public static final int abc_list_menu_item_icon=0x7f030011; public static final int abc_list_menu_item_layout=0x7f030012; public static final int abc_list_menu_item_radio=0x7f030013; public static final int abc_popup_menu_item_layout=0x7f030014; public static final int abc_search_dropdown_item_icons_2line=0x7f030015; public static final int abc_search_view=0x7f030016; public static final int abc_simple_decor=0x7f030017; public static final int activity_grid_layout=0x7f030018; public static final int activity_linear_layout=0x7f030019; public static final int activity_main=0x7f03001a; public static final int activity_relative_layout=0x7f03001b; public static final int activity_show_image=0x7f03001c; public static final int activity_table_layout=0x7f03001d; public static final int list_item=0x7f03001e; public static final int support_simple_spinner_dropdown_item=0x7f03001f; } public static final class menu { public static final int grid_layout=0x7f0d0000; public static final int linear_layout=0x7f0d0001; public static final int main=0x7f0d0002; public static final int relative_layout=0x7f0d0003; public static final int show_image=0x7f0d0004; public static final int table_layout=0x7f0d0005; } public static final class string { /** Content description for the action bar "home" affordance. [CHAR LIMIT=NONE] */ public static final int abc_action_bar_home_description=0x7f0a0001; /** Content description for the action bar "up" affordance. [CHAR LIMIT=NONE] */ public static final int abc_action_bar_up_description=0x7f0a0002; /** Content description for the action menu overflow button. [CHAR LIMIT=NONE] */ public static final int abc_action_menu_overflow_description=0x7f0a0003; /** Label for the "Done" button on the far left of action mode toolbars. */ public static final int abc_action_mode_done=0x7f0a0000; /** Title for a button to expand the list of activities in ActivityChooserView [CHAR LIMIT=25] */ public static final int abc_activity_chooser_view_see_all=0x7f0a000a; /** ActivityChooserView - accessibility support Description of the shwoing of a popup window with activities to choose from. [CHAR LIMIT=NONE] */ public static final int abc_activitychooserview_choose_application=0x7f0a0009; /** SearchView accessibility description for clear button [CHAR LIMIT=NONE] */ public static final int abc_searchview_description_clear=0x7f0a0006; /** SearchView accessibility description for search text field [CHAR LIMIT=NONE] */ public static final int abc_searchview_description_query=0x7f0a0005; /** SearchView accessibility description for search button [CHAR LIMIT=NONE] */ public static final int abc_searchview_description_search=0x7f0a0004; /** SearchView accessibility description for submit button [CHAR LIMIT=NONE] */ public static final int abc_searchview_description_submit=0x7f0a0007; /** SearchView accessibility description for voice button [CHAR LIMIT=NONE] */ public static final int abc_searchview_description_voice=0x7f0a0008; /** Description of the choose target button in a ShareActionProvider (share UI). [CHAR LIMIT=NONE] */ public static final int abc_shareactionprovider_share_with=0x7f0a000c; /** Description of a share target (both in the list of such or the default share button) in a ShareActionProvider (share UI). [CHAR LIMIT=NONE] */ public static final int abc_shareactionprovider_share_with_application=0x7f0a000b; public static final int action_settings=0x7f0a000f; public static final int app_name=0x7f0a000d; public static final int blue_string=0x7f0a0016; public static final int cancel_string=0x7f0a0028; public static final int ctrl_e_string=0x7f0a0025; public static final int ctrl_o_string=0x7f0a001d; public static final int ctrl_s_string=0x7f0a001f; public static final int ctrl_shift_s_string=0x7f0a0021; public static final int export_string=0x7f0a0024; public static final int green_string=0x7f0a0015; public static final int hello_world=0x7f0a000e; public static final int import_string=0x7f0a0023; /** String for relative layout */ public static final int ok_string=0x7f0a0027; /** String for table layout */ public static final int open_string=0x7f0a001c; public static final int quit_string=0x7f0a0026; /** Strings for linear layout */ public static final int red_string=0x7f0a0014; public static final int row_four__string=0x7f0a001b; public static final int row_one_string=0x7f0a0018; public static final int row_three_string=0x7f0a001a; public static final int row_two_string=0x7f0a0019; public static final int save_as_string=0x7f0a0020; public static final int save_string=0x7f0a001e; public static final int title_activity_grid_layout=0x7f0a0011; public static final int title_activity_linear_layout=0x7f0a0010; public static final int title_activity_relative_layout=0x7f0a0013; public static final int title_activity_show_image=0x7f0a002a; public static final int title_activity_table_layout=0x7f0a0012; public static final int type_here_string=0x7f0a0029; public static final int x_string=0x7f0a0022; public static final int yellow_string=0x7f0a0017; } 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=0x7f0b008b; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f0b008c; /** Mimic text appearance in select_dialog_item.xml */ public static final int TextAppearance_AppCompat_Base_CompactMenu_Dialog=0x7f0b0063; public static final int TextAppearance_AppCompat_Base_SearchResult=0x7f0b006d; public static final int TextAppearance_AppCompat_Base_SearchResult_Subtitle=0x7f0b006f; /** Search View result styles */ public static final int TextAppearance_AppCompat_Base_SearchResult_Title=0x7f0b006e; public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Large=0x7f0b0069; public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Small=0x7f0b006a; public static final int TextAppearance_AppCompat_Light_Base_SearchResult=0x7f0b0070; public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Subtitle=0x7f0b0072; /** TextAppearance.Holo.Light.SearchResult.* are private so we extend from the default versions instead (which are exactly the same). */ public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Title=0x7f0b0071; public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Large=0x7f0b006b; public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Small=0x7f0b006c; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle=0x7f0b0035; public static final int TextAppearance_AppCompat_Light_SearchResult_Title=0x7f0b0034; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large=0x7f0b0030; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small=0x7f0b0031; public static final int TextAppearance_AppCompat_SearchResult_Subtitle=0x7f0b0033; public static final int TextAppearance_AppCompat_SearchResult_Title=0x7f0b0032; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu=0x7f0b001a; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle=0x7f0b0006; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse=0x7f0b0008; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title=0x7f0b0005; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse=0x7f0b0007; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle=0x7f0b001e; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse=0x7f0b0020; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title=0x7f0b001d; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse=0x7f0b001f; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Menu=0x7f0b0054; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle=0x7f0b0056; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle_Inverse=0x7f0b0058; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title=0x7f0b0055; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title_Inverse=0x7f0b0057; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle=0x7f0b0051; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle_Inverse=0x7f0b0053; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title=0x7f0b0050; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title_Inverse=0x7f0b0052; public static final int TextAppearance_AppCompat_Widget_Base_DropDownItem=0x7f0b0061; public static final int TextAppearance_AppCompat_Widget_DropDownItem=0x7f0b0021; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large=0x7f0b002e; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small=0x7f0b002f; public static final int TextAppearance_Widget_AppCompat_Base_ExpandedMenu_Item=0x7f0b0062; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item=0x7f0b0028; /** Themes in the "Theme.AppCompat" family will contain an action bar by default. If Holo themes are available on the current platform version they will be used. A limited Holo-styled action bar will be provided on platform versions older than 3.0. (API 11) These theme declarations contain any version-independent specification. Items that need to vary based on platform version should be defined in the corresponding "Theme.Base" theme. Platform-independent theme providing an action bar in a dark-themed activity. */ public static final int Theme_AppCompat=0x7f0b0077; /** Menu/item attributes */ public static final int Theme_AppCompat_Base_CompactMenu=0x7f0b0083; public static final int Theme_AppCompat_Base_CompactMenu_Dialog=0x7f0b0084; /** Menu/item attributes */ public static final int Theme_AppCompat_CompactMenu=0x7f0b007c; public static final int Theme_AppCompat_CompactMenu_Dialog=0x7f0b007d; public static final int Theme_AppCompat_DialogWhenLarge=0x7f0b007a; /** Platform-independent theme providing an action bar in a light-themed activity. */ public static final int Theme_AppCompat_Light=0x7f0b0078; /** Platform-independent theme providing an action bar in a dark-themed activity. */ public static final int Theme_AppCompat_Light_DarkActionBar=0x7f0b0079; public static final int Theme_AppCompat_Light_DialogWhenLarge=0x7f0b007b; /** Base platform-dependent theme */ public static final int Theme_Base=0x7f0b007e; /** Base platform-dependent theme providing an action bar in a dark-themed activity. Base platform-dependent theme providing an action bar in a dark-themed activity. */ public static final int Theme_Base_AppCompat=0x7f0b0080; public static final int Theme_Base_AppCompat_Dialog_FixedSize=0x7f0b0087; public static final int Theme_Base_AppCompat_Dialog_Light_FixedSize=0x7f0b0088; public static final int Theme_Base_AppCompat_DialogWhenLarge=0x7f0b0085; /** As we have defined the theme in values-large (for compat) and values-large takes precedence over values-v14, we need to reset back to the Holo parent in values-large-v14. As the themes in values-v14 & values-large-v14 are exactly the same, these "double base" themes can be inherited from in both values-v14 and values-large-v14. */ public static final int Theme_Base_AppCompat_DialogWhenLarge_Base=0x7f0b0089; /** Base platform-dependent theme providing an action bar in a light-themed activity. Base platform-dependent theme providing an action bar in a light-themed activity. */ public static final int Theme_Base_AppCompat_Light=0x7f0b0081; /** Base platform-dependent theme providing a dark action bar in a light-themed activity. Base platform-dependent theme providing a dark action bar in a light-themed activity. */ public static final int Theme_Base_AppCompat_Light_DarkActionBar=0x7f0b0082; public static final int Theme_Base_AppCompat_Light_DialogWhenLarge=0x7f0b0086; public static final int Theme_Base_AppCompat_Light_DialogWhenLarge_Base=0x7f0b008a; /** Base platform-dependent theme providing a light-themed activity. */ public static final int Theme_Base_Light=0x7f0b007f; /** Styles in here can be extended for customisation in your application. Each utilises one of the Base styles. If Holo themes are available on the current platform version they will be used instead of the compat styles. */ public static final int Widget_AppCompat_ActionBar=0x7f0b0000; public static final int Widget_AppCompat_ActionBar_Solid=0x7f0b0002; public static final int Widget_AppCompat_ActionBar_TabBar=0x7f0b0011; public static final int Widget_AppCompat_ActionBar_TabText=0x7f0b0017; public static final int Widget_AppCompat_ActionBar_TabView=0x7f0b0014; public static final int Widget_AppCompat_ActionButton=0x7f0b000b; public static final int Widget_AppCompat_ActionButton_CloseMode=0x7f0b000d; public static final int Widget_AppCompat_ActionButton_Overflow=0x7f0b000f; public static final int Widget_AppCompat_ActionMode=0x7f0b001b; public static final int Widget_AppCompat_ActivityChooserView=0x7f0b0038; public static final int Widget_AppCompat_AutoCompleteTextView=0x7f0b0036; public static final int Widget_AppCompat_Base_ActionBar=0x7f0b003a; public static final int Widget_AppCompat_Base_ActionBar_Solid=0x7f0b003c; public static final int Widget_AppCompat_Base_ActionBar_TabBar=0x7f0b0045; public static final int Widget_AppCompat_Base_ActionBar_TabText=0x7f0b004b; public static final int Widget_AppCompat_Base_ActionBar_TabView=0x7f0b0048; /** Action Button Styles */ public static final int Widget_AppCompat_Base_ActionButton=0x7f0b003f; public static final int Widget_AppCompat_Base_ActionButton_CloseMode=0x7f0b0041; public static final int Widget_AppCompat_Base_ActionButton_Overflow=0x7f0b0043; public static final int Widget_AppCompat_Base_ActionMode=0x7f0b004e; public static final int Widget_AppCompat_Base_ActivityChooserView=0x7f0b0075; /** AutoCompleteTextView styles (for SearchView) */ public static final int Widget_AppCompat_Base_AutoCompleteTextView=0x7f0b0073; public static final int Widget_AppCompat_Base_DropDownItem_Spinner=0x7f0b005d; /** Popup Menu */ public static final int Widget_AppCompat_Base_ListPopupWindow=0x7f0b0065; /** Spinner Widgets */ public static final int Widget_AppCompat_Base_ListView_DropDown=0x7f0b005f; public static final int Widget_AppCompat_Base_ListView_Menu=0x7f0b0064; public static final int Widget_AppCompat_Base_PopupMenu=0x7f0b0067; public static final int Widget_AppCompat_Base_ProgressBar=0x7f0b005a; /** Progress Bar */ public static final int Widget_AppCompat_Base_ProgressBar_Horizontal=0x7f0b0059; /** Action Bar Spinner Widgets */ public static final int Widget_AppCompat_Base_Spinner=0x7f0b005b; public static final int Widget_AppCompat_DropDownItem_Spinner=0x7f0b0024; public static final int Widget_AppCompat_Light_ActionBar=0x7f0b0001; public static final int Widget_AppCompat_Light_ActionBar_Solid=0x7f0b0003; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse=0x7f0b0004; public static final int Widget_AppCompat_Light_ActionBar_TabBar=0x7f0b0012; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse=0x7f0b0013; public static final int Widget_AppCompat_Light_ActionBar_TabText=0x7f0b0018; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse=0x7f0b0019; public static final int Widget_AppCompat_Light_ActionBar_TabView=0x7f0b0015; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse=0x7f0b0016; public static final int Widget_AppCompat_Light_ActionButton=0x7f0b000c; public static final int Widget_AppCompat_Light_ActionButton_CloseMode=0x7f0b000e; public static final int Widget_AppCompat_Light_ActionButton_Overflow=0x7f0b0010; public static final int Widget_AppCompat_Light_ActionMode_Inverse=0x7f0b001c; public static final int Widget_AppCompat_Light_ActivityChooserView=0x7f0b0039; public static final int Widget_AppCompat_Light_AutoCompleteTextView=0x7f0b0037; public static final int Widget_AppCompat_Light_Base_ActionBar=0x7f0b003b; public static final int Widget_AppCompat_Light_Base_ActionBar_Solid=0x7f0b003d; public static final int Widget_AppCompat_Light_Base_ActionBar_Solid_Inverse=0x7f0b003e; public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar=0x7f0b0046; public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar_Inverse=0x7f0b0047; public static final int Widget_AppCompat_Light_Base_ActionBar_TabText=0x7f0b004c; public static final int Widget_AppCompat_Light_Base_ActionBar_TabText_Inverse=0x7f0b004d; public static final int Widget_AppCompat_Light_Base_ActionBar_TabView=0x7f0b0049; public static final int Widget_AppCompat_Light_Base_ActionBar_TabView_Inverse=0x7f0b004a; public static final int Widget_AppCompat_Light_Base_ActionButton=0x7f0b0040; public static final int Widget_AppCompat_Light_Base_ActionButton_CloseMode=0x7f0b0042; public static final int Widget_AppCompat_Light_Base_ActionButton_Overflow=0x7f0b0044; public static final int Widget_AppCompat_Light_Base_ActionMode_Inverse=0x7f0b004f; public static final int Widget_AppCompat_Light_Base_ActivityChooserView=0x7f0b0076; public static final int Widget_AppCompat_Light_Base_AutoCompleteTextView=0x7f0b0074; public static final int Widget_AppCompat_Light_Base_DropDownItem_Spinner=0x7f0b005e; public static final int Widget_AppCompat_Light_Base_ListPopupWindow=0x7f0b0066; public static final int Widget_AppCompat_Light_Base_ListView_DropDown=0x7f0b0060; public static final int Widget_AppCompat_Light_Base_PopupMenu=0x7f0b0068; public static final int Widget_AppCompat_Light_Base_Spinner=0x7f0b005c; public static final int Widget_AppCompat_Light_DropDownItem_Spinner=0x7f0b0025; public static final int Widget_AppCompat_Light_ListPopupWindow=0x7f0b002a; public static final int Widget_AppCompat_Light_ListView_DropDown=0x7f0b0027; public static final int Widget_AppCompat_Light_PopupMenu=0x7f0b002c; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar=0x7f0b0023; public static final int Widget_AppCompat_ListPopupWindow=0x7f0b0029; public static final int Widget_AppCompat_ListView_DropDown=0x7f0b0026; public static final int Widget_AppCompat_ListView_Menu=0x7f0b002d; public static final int Widget_AppCompat_PopupMenu=0x7f0b002b; public static final int Widget_AppCompat_ProgressBar=0x7f0b000a; public static final int Widget_AppCompat_ProgressBar_Horizontal=0x7f0b0009; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar=0x7f0b0022; } public static final class styleable { /** ============================================ Attributes used to style the Action Bar. These should be set on your theme; the default actionBarStyle will propagate them to the correct elements as needed. Please Note: when overriding attributes for an ActionBar style you must specify each attribute twice: once with the "android:" namespace prefix and once without. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBar_background com.example.mylayouttutorial:background}</code></td><td> Specifies a background drawable for the action bar.</td></tr> <tr><td><code>{@link #ActionBar_backgroundSplit com.example.mylayouttutorial:backgroundSplit}</code></td><td> Specifies a background drawable for the bottom component of a split action bar.</td></tr> <tr><td><code>{@link #ActionBar_backgroundStacked com.example.mylayouttutorial:backgroundStacked}</code></td><td> Specifies a background drawable for a second stacked row of the action bar.</td></tr> <tr><td><code>{@link #ActionBar_customNavigationLayout com.example.mylayouttutorial:customNavigationLayout}</code></td><td> Specifies a layout for custom navigation.</td></tr> <tr><td><code>{@link #ActionBar_displayOptions com.example.mylayouttutorial:displayOptions}</code></td><td> Options affecting how the action bar is displayed.</td></tr> <tr><td><code>{@link #ActionBar_divider com.example.mylayouttutorial:divider}</code></td><td> Specifies the drawable used for item dividers.</td></tr> <tr><td><code>{@link #ActionBar_height com.example.mylayouttutorial:height}</code></td><td> Specifies a fixed height.</td></tr> <tr><td><code>{@link #ActionBar_homeLayout com.example.mylayouttutorial:homeLayout}</code></td><td> Specifies a layout to use for the "home" section of the action bar.</td></tr> <tr><td><code>{@link #ActionBar_icon com.example.mylayouttutorial:icon}</code></td><td> Specifies the drawable used for the application icon.</td></tr> <tr><td><code>{@link #ActionBar_indeterminateProgressStyle com.example.mylayouttutorial:indeterminateProgressStyle}</code></td><td> Specifies a style resource to use for an indeterminate progress spinner.</td></tr> <tr><td><code>{@link #ActionBar_itemPadding com.example.mylayouttutorial:itemPadding}</code></td><td> Specifies padding that should be applied to the left and right sides of system-provided items in the bar.</td></tr> <tr><td><code>{@link #ActionBar_logo com.example.mylayouttutorial:logo}</code></td><td> Specifies the drawable used for the application logo.</td></tr> <tr><td><code>{@link #ActionBar_navigationMode com.example.mylayouttutorial:navigationMode}</code></td><td> The type of navigation to use.</td></tr> <tr><td><code>{@link #ActionBar_progressBarPadding com.example.mylayouttutorial:progressBarPadding}</code></td><td> Specifies the horizontal padding on either end for an embedded progress bar.</td></tr> <tr><td><code>{@link #ActionBar_progressBarStyle com.example.mylayouttutorial:progressBarStyle}</code></td><td> Specifies a style resource to use for an embedded progress bar.</td></tr> <tr><td><code>{@link #ActionBar_subtitle com.example.mylayouttutorial:subtitle}</code></td><td> Specifies subtitle text used for navigationMode="normal" </td></tr> <tr><td><code>{@link #ActionBar_subtitleTextStyle com.example.mylayouttutorial:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr> <tr><td><code>{@link #ActionBar_title com.example.mylayouttutorial:title}</code></td><td> Specifies title text used for navigationMode="normal" </td></tr> <tr><td><code>{@link #ActionBar_titleTextStyle com.example.mylayouttutorial:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr> </table> @see #ActionBar_background @see #ActionBar_backgroundSplit @see #ActionBar_backgroundStacked @see #ActionBar_customNavigationLayout @see #ActionBar_displayOptions @see #ActionBar_divider @see #ActionBar_height @see #ActionBar_homeLayout @see #ActionBar_icon @see #ActionBar_indeterminateProgressStyle @see #ActionBar_itemPadding @see #ActionBar_logo @see #ActionBar_navigationMode @see #ActionBar_progressBarPadding @see #ActionBar_progressBarStyle @see #ActionBar_subtitle @see #ActionBar_subtitleTextStyle @see #ActionBar_title @see #ActionBar_titleTextStyle */ public static final int[] ActionBar = { 0x7f010025, 0x7f010026, 0x7f010027, 0x7f010028, 0x7f010029, 0x7f01002a, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037 }; /** <p> @attr description Specifies a background drawable for the action bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:background */ public static final int ActionBar_background = 10; /** <p> @attr description Specifies a background drawable for the bottom component of a split action bar. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:backgroundSplit */ public static final int ActionBar_backgroundSplit = 12; /** <p> @attr description Specifies a background drawable for a second stacked row of the action bar. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:backgroundStacked */ public static final int ActionBar_backgroundStacked = 11; /** <p> @attr description Specifies a layout for custom navigation. Overrides navigationMode. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:customNavigationLayout */ public static final int ActionBar_customNavigationLayout = 13; /** <p> @attr description Options affecting how the action bar is displayed. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr> <tr><td><code>showHome</code></td><td>0x2</td><td></td></tr> <tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr> <tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr> <tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr> <tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr> </table> <p>This is a private symbol. @attr name com.example.mylayouttutorial:displayOptions */ public static final int ActionBar_displayOptions = 3; /** <p> @attr description Specifies the drawable used for item dividers. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:divider */ public static final int ActionBar_divider = 9; /** <p> @attr description Specifies a fixed height. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:height */ public static final int ActionBar_height = 1; /** <p> @attr description Specifies a layout to use for the "home" section of the action bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:homeLayout */ public static final int ActionBar_homeLayout = 14; /** <p> @attr description Specifies the drawable used for the application icon. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:icon */ public static final int ActionBar_icon = 7; /** <p> @attr description Specifies a style resource to use for an indeterminate progress spinner. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:indeterminateProgressStyle */ public static final int ActionBar_indeterminateProgressStyle = 16; /** <p> @attr description Specifies padding that should be applied to the left and right sides of system-provided items in the bar. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:itemPadding */ public static final int ActionBar_itemPadding = 18; /** <p> @attr description Specifies the drawable used for the application logo. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:logo */ public static final int ActionBar_logo = 8; /** <p> @attr description The type of navigation to use. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr> <tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr> <tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr> </table> <p>This is a private symbol. @attr name com.example.mylayouttutorial:navigationMode */ public static final int ActionBar_navigationMode = 2; /** <p> @attr description Specifies the horizontal padding on either end for an embedded progress bar. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:progressBarPadding */ public static final int ActionBar_progressBarPadding = 17; /** <p> @attr description Specifies a style resource to use for an embedded progress bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:progressBarStyle */ public static final int ActionBar_progressBarStyle = 15; /** <p> @attr description Specifies subtitle text used for navigationMode="normal" <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:subtitle */ public static final int ActionBar_subtitle = 4; /** <p> @attr description Specifies a style to use for subtitle text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:subtitleTextStyle */ public static final int ActionBar_subtitleTextStyle = 6; /** <p> @attr description Specifies title text used for navigationMode="normal" <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:title */ public static final int ActionBar_title = 0; /** <p> @attr description Specifies a style to use for title text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:titleTextStyle */ public static final int ActionBar_titleTextStyle = 5; /** Valid LayoutParams for views placed in the action bar as custom views. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBarLayout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr> </table> @see #ActionBarLayout_android_layout_gravity */ public static final int[] ActionBarLayout = { 0x010100b3 }; /** <p>This symbol is the offset where the {@link android.R.attr#layout_gravity} attribute's value can be found in the {@link #ActionBarLayout} array. @attr name android:layout_gravity */ public static final int ActionBarLayout_android_layout_gravity = 0; /** These attributes are meant to be specified and customized by the app. The system will read and apply them as needed. These attributes control properties of the activity window, such as whether an action bar should be present and whether it should overlay content. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBarWindow_windowActionBar com.example.mylayouttutorial:windowActionBar}</code></td><td></td></tr> <tr><td><code>{@link #ActionBarWindow_windowActionBarOverlay com.example.mylayouttutorial:windowActionBarOverlay}</code></td><td></td></tr> <tr><td><code>{@link #ActionBarWindow_windowFixedHeightMajor com.example.mylayouttutorial:windowFixedHeightMajor}</code></td><td> A fixed height for the window along the major axis of the screen, that is, when in portrait.</td></tr> <tr><td><code>{@link #ActionBarWindow_windowFixedHeightMinor com.example.mylayouttutorial:windowFixedHeightMinor}</code></td><td> A fixed height for the window along the minor axis of the screen, that is, when in landscape.</td></tr> <tr><td><code>{@link #ActionBarWindow_windowFixedWidthMajor com.example.mylayouttutorial:windowFixedWidthMajor}</code></td><td> A fixed width for the window along the major axis of the screen, that is, when in landscape.</td></tr> <tr><td><code>{@link #ActionBarWindow_windowFixedWidthMinor com.example.mylayouttutorial:windowFixedWidthMinor}</code></td><td> A fixed width for the window along the minor axis of the screen, that is, when in portrait.</td></tr> <tr><td><code>{@link #ActionBarWindow_windowSplitActionBar com.example.mylayouttutorial:windowSplitActionBar}</code></td><td></td></tr> </table> @see #ActionBarWindow_windowActionBar @see #ActionBarWindow_windowActionBarOverlay @see #ActionBarWindow_windowFixedHeightMajor @see #ActionBarWindow_windowFixedHeightMinor @see #ActionBarWindow_windowFixedWidthMajor @see #ActionBarWindow_windowFixedWidthMinor @see #ActionBarWindow_windowSplitActionBar */ public static final int[] ActionBarWindow = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006 }; /** <p>This symbol is the offset where the {@link com.example.mylayouttutorial.R.attr#windowActionBar} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name com.example.mylayouttutorial:windowActionBar */ public static final int ActionBarWindow_windowActionBar = 0; /** <p>This symbol is the offset where the {@link com.example.mylayouttutorial.R.attr#windowActionBarOverlay} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name com.example.mylayouttutorial:windowActionBarOverlay */ public static final int ActionBarWindow_windowActionBarOverlay = 1; /** <p> @attr description A fixed height for the window along the major axis of the screen, that is, when in portrait. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:windowFixedHeightMajor */ public static final int ActionBarWindow_windowFixedHeightMajor = 6; /** <p> @attr description A fixed height for the window along the minor axis of the screen, that is, when in landscape. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:windowFixedHeightMinor */ public static final int ActionBarWindow_windowFixedHeightMinor = 4; /** <p> @attr description A fixed width for the window along the major axis of the screen, that is, when in landscape. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:windowFixedWidthMajor */ public static final int ActionBarWindow_windowFixedWidthMajor = 3; /** <p> @attr description A fixed width for the window along the minor axis of the screen, that is, when in portrait. Can be either an absolute dimension or a fraction of the screen size in that dimension. <p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:windowFixedWidthMinor */ public static final int ActionBarWindow_windowFixedWidthMinor = 5; /** <p>This symbol is the offset where the {@link com.example.mylayouttutorial.R.attr#windowSplitActionBar} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name com.example.mylayouttutorial:windowSplitActionBar */ public static final int ActionBarWindow_windowSplitActionBar = 2; /** Attributes that can be used with a ActionMenuItemView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionMenuItemView_android_minWidth android:minWidth}</code></td><td></td></tr> </table> @see #ActionMenuItemView_android_minWidth */ public static final int[] ActionMenuItemView = { 0x0101013f }; /** <p>This symbol is the offset where the {@link android.R.attr#minWidth} attribute's value can be found in the {@link #ActionMenuItemView} array. @attr name android:minWidth */ public static final int ActionMenuItemView_android_minWidth = 0; /** Size of padding on either end of a divider. */ public static final int[] ActionMenuView = { }; /** Attributes that can be used with a ActionMode. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionMode_background com.example.mylayouttutorial:background}</code></td><td> Specifies a background for the action mode bar.</td></tr> <tr><td><code>{@link #ActionMode_backgroundSplit com.example.mylayouttutorial:backgroundSplit}</code></td><td> Specifies a background for the split action mode bar.</td></tr> <tr><td><code>{@link #ActionMode_height com.example.mylayouttutorial:height}</code></td><td> Specifies a fixed height for the action mode bar.</td></tr> <tr><td><code>{@link #ActionMode_subtitleTextStyle com.example.mylayouttutorial:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr> <tr><td><code>{@link #ActionMode_titleTextStyle com.example.mylayouttutorial:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr> </table> @see #ActionMode_background @see #ActionMode_backgroundSplit @see #ActionMode_height @see #ActionMode_subtitleTextStyle @see #ActionMode_titleTextStyle */ public static final int[] ActionMode = { 0x7f010026, 0x7f01002a, 0x7f01002b, 0x7f01002f, 0x7f010031 }; /** <p> @attr description Specifies a background for the action mode bar. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:background */ public static final int ActionMode_background = 3; /** <p> @attr description Specifies a background for the split action mode bar. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:backgroundSplit */ public static final int ActionMode_backgroundSplit = 4; /** <p> @attr description Specifies a fixed height for the action mode bar. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:height */ public static final int ActionMode_height = 0; /** <p> @attr description Specifies a style to use for subtitle text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:subtitleTextStyle */ public static final int ActionMode_subtitleTextStyle = 2; /** <p> @attr description Specifies a style to use for title text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:titleTextStyle */ public static final int ActionMode_titleTextStyle = 1; /** Attrbitutes for a ActivityChooserView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActivityChooserView_expandActivityOverflowButtonDrawable com.example.mylayouttutorial:expandActivityOverflowButtonDrawable}</code></td><td> The drawable to show in the button for expanding the activities overflow popup.</td></tr> <tr><td><code>{@link #ActivityChooserView_initialActivityCount com.example.mylayouttutorial:initialActivityCount}</code></td><td> The maximal number of items initially shown in the activity list.</td></tr> </table> @see #ActivityChooserView_expandActivityOverflowButtonDrawable @see #ActivityChooserView_initialActivityCount */ public static final int[] ActivityChooserView = { 0x7f01006a, 0x7f01006b }; /** <p> @attr description The drawable to show in the button for expanding the activities overflow popup. <strong>Note:</strong> Clients would like to set this drawable as a clue about the action the chosen activity will perform. For example, if share activity is to be chosen the drawable should give a clue that sharing is to be performed. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:expandActivityOverflowButtonDrawable */ public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1; /** <p> @attr description The maximal number of items initially shown in the activity list. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:initialActivityCount */ public static final int ActivityChooserView_initialActivityCount = 0; /** Attributes that can be used with a CompatTextView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #CompatTextView_textAllCaps com.example.mylayouttutorial:textAllCaps}</code></td><td> Present the text in ALL CAPS.</td></tr> </table> @see #CompatTextView_textAllCaps */ public static final int[] CompatTextView = { 0x7f01006d }; /** <p> @attr description Present the text in ALL CAPS. This may use a small-caps form when available. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:textAllCaps */ public static final int CompatTextView_textAllCaps = 0; /** Attributes that can be used with a LinearLayoutICS. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #LinearLayoutICS_divider com.example.mylayouttutorial:divider}</code></td><td> Drawable to use as a vertical divider between buttons.</td></tr> <tr><td><code>{@link #LinearLayoutICS_dividerPadding com.example.mylayouttutorial:dividerPadding}</code></td><td> Size of padding on either end of a divider.</td></tr> <tr><td><code>{@link #LinearLayoutICS_showDividers com.example.mylayouttutorial:showDividers}</code></td><td> Setting for which dividers to show.</td></tr> </table> @see #LinearLayoutICS_divider @see #LinearLayoutICS_dividerPadding @see #LinearLayoutICS_showDividers */ public static final int[] LinearLayoutICS = { 0x7f01002e, 0x7f010055, 0x7f010056 }; /** <p> @attr description Drawable to use as a vertical divider between buttons. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:divider */ public static final int LinearLayoutICS_divider = 0; /** <p> @attr description Size of padding on either end of a divider. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:dividerPadding */ public static final int LinearLayoutICS_dividerPadding = 2; /** <p> @attr description Setting for which dividers to show. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>beginning</code></td><td>1</td><td></td></tr> <tr><td><code>middle</code></td><td>2</td><td></td></tr> <tr><td><code>end</code></td><td>4</td><td></td></tr> </table> <p>This is a private symbol. @attr name com.example.mylayouttutorial:showDividers */ public static final int LinearLayoutICS_showDividers = 1; /** Base attributes that are available to all groups. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuGroup_android_checkableBehavior android:checkableBehavior}</code></td><td> Whether the items are capable of displaying a check mark.</td></tr> <tr><td><code>{@link #MenuGroup_android_enabled android:enabled}</code></td><td> Whether the items are enabled.</td></tr> <tr><td><code>{@link #MenuGroup_android_id android:id}</code></td><td> The ID of the group.</td></tr> <tr><td><code>{@link #MenuGroup_android_menuCategory android:menuCategory}</code></td><td> The category applied to all items within this group.</td></tr> <tr><td><code>{@link #MenuGroup_android_orderInCategory android:orderInCategory}</code></td><td> The order within the category applied to all items within this group.</td></tr> <tr><td><code>{@link #MenuGroup_android_visible android:visible}</code></td><td> Whether the items are shown/visible.</td></tr> </table> @see #MenuGroup_android_checkableBehavior @see #MenuGroup_android_enabled @see #MenuGroup_android_id @see #MenuGroup_android_menuCategory @see #MenuGroup_android_orderInCategory @see #MenuGroup_android_visible */ public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }; /** <p> @attr description Whether the items are capable of displaying a check mark. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#checkableBehavior}. @attr name android:checkableBehavior */ public static final int MenuGroup_android_checkableBehavior = 5; /** <p> @attr description Whether the items are enabled. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#enabled}. @attr name android:enabled */ public static final int MenuGroup_android_enabled = 0; /** <p> @attr description The ID of the group. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#id}. @attr name android:id */ public static final int MenuGroup_android_id = 1; /** <p> @attr description The category applied to all items within this group. (This will be or'ed with the orderInCategory attribute.) <p>This corresponds to the global attribute resource symbol {@link android.R.attr#menuCategory}. @attr name android:menuCategory */ public static final int MenuGroup_android_menuCategory = 3; /** <p> @attr description The order within the category applied to all items within this group. (This will be or'ed with the category attribute.) <p>This corresponds to the global attribute resource symbol {@link android.R.attr#orderInCategory}. @attr name android:orderInCategory */ public static final int MenuGroup_android_orderInCategory = 4; /** <p> @attr description Whether the items are shown/visible. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#visible}. @attr name android:visible */ public static final int MenuGroup_android_visible = 2; /** Base attributes that are available to all Item objects. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuItem_actionLayout com.example.mylayouttutorial:actionLayout}</code></td><td> An optional layout to be used as an action view.</td></tr> <tr><td><code>{@link #MenuItem_actionProviderClass com.example.mylayouttutorial:actionProviderClass}</code></td><td> The name of an optional ActionProvider class to instantiate an action view and perform operations such as default action for that menu item.</td></tr> <tr><td><code>{@link #MenuItem_actionViewClass com.example.mylayouttutorial:actionViewClass}</code></td><td> The name of an optional View class to instantiate and use as an action view.</td></tr> <tr><td><code>{@link #MenuItem_android_alphabeticShortcut android:alphabeticShortcut}</code></td><td> The alphabetic shortcut key.</td></tr> <tr><td><code>{@link #MenuItem_android_checkable android:checkable}</code></td><td> Whether the item is capable of displaying a check mark.</td></tr> <tr><td><code>{@link #MenuItem_android_checked android:checked}</code></td><td> Whether the item is checked.</td></tr> <tr><td><code>{@link #MenuItem_android_enabled android:enabled}</code></td><td> Whether the item is enabled.</td></tr> <tr><td><code>{@link #MenuItem_android_icon android:icon}</code></td><td> The icon associated with this item.</td></tr> <tr><td><code>{@link #MenuItem_android_id android:id}</code></td><td> The ID of the item.</td></tr> <tr><td><code>{@link #MenuItem_android_menuCategory android:menuCategory}</code></td><td> The category applied to the item.</td></tr> <tr><td><code>{@link #MenuItem_android_numericShortcut android:numericShortcut}</code></td><td> The numeric shortcut key.</td></tr> <tr><td><code>{@link #MenuItem_android_onClick android:onClick}</code></td><td> Name of a method on the Context used to inflate the menu that will be called when the item is clicked.</td></tr> <tr><td><code>{@link #MenuItem_android_orderInCategory android:orderInCategory}</code></td><td> The order within the category applied to the item.</td></tr> <tr><td><code>{@link #MenuItem_android_title android:title}</code></td><td> The title associated with the item.</td></tr> <tr><td><code>{@link #MenuItem_android_titleCondensed android:titleCondensed}</code></td><td> The condensed title associated with the item.</td></tr> <tr><td><code>{@link #MenuItem_android_visible android:visible}</code></td><td> Whether the item is shown/visible.</td></tr> <tr><td><code>{@link #MenuItem_showAsAction com.example.mylayouttutorial:showAsAction}</code></td><td> How this item should display in the Action Bar, if present.</td></tr> </table> @see #MenuItem_actionLayout @see #MenuItem_actionProviderClass @see #MenuItem_actionViewClass @see #MenuItem_android_alphabeticShortcut @see #MenuItem_android_checkable @see #MenuItem_android_checked @see #MenuItem_android_enabled @see #MenuItem_android_icon @see #MenuItem_android_id @see #MenuItem_android_menuCategory @see #MenuItem_android_numericShortcut @see #MenuItem_android_onClick @see #MenuItem_android_orderInCategory @see #MenuItem_android_title @see #MenuItem_android_titleCondensed @see #MenuItem_android_visible @see #MenuItem_showAsAction */ public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f01004d, 0x7f01004e, 0x7f01004f, 0x7f010050 }; /** <p> @attr description An optional layout to be used as an action view. See {@link android.view.MenuItem#setActionView(android.view.View)} for more info. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:actionLayout */ public static final int MenuItem_actionLayout = 14; /** <p> @attr description The name of an optional ActionProvider class to instantiate an action view and perform operations such as default action for that menu item. See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)} for more info. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:actionProviderClass */ public static final int MenuItem_actionProviderClass = 16; /** <p> @attr description The name of an optional View class to instantiate and use as an action view. See {@link android.view.MenuItem#setActionView(android.view.View)} for more info. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:actionViewClass */ public static final int MenuItem_actionViewClass = 15; /** <p> @attr description The alphabetic shortcut key. This is the shortcut when using a keyboard with alphabetic keys. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#alphabeticShortcut}. @attr name android:alphabeticShortcut */ public static final int MenuItem_android_alphabeticShortcut = 9; /** <p> @attr description Whether the item is capable of displaying a check mark. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#checkable}. @attr name android:checkable */ public static final int MenuItem_android_checkable = 11; /** <p> @attr description Whether the item is checked. Note that you must first have enabled checking with the checkable attribute or else the check mark will not appear. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#checked}. @attr name android:checked */ public static final int MenuItem_android_checked = 3; /** <p> @attr description Whether the item is enabled. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#enabled}. @attr name android:enabled */ public static final int MenuItem_android_enabled = 1; /** <p> @attr description The icon associated with this item. This icon will not always be shown, so the title should be sufficient in describing this item. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#icon}. @attr name android:icon */ public static final int MenuItem_android_icon = 0; /** <p> @attr description The ID of the item. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#id}. @attr name android:id */ public static final int MenuItem_android_id = 2; /** <p> @attr description The category applied to the item. (This will be or'ed with the orderInCategory attribute.) <p>This corresponds to the global attribute resource symbol {@link android.R.attr#menuCategory}. @attr name android:menuCategory */ public static final int MenuItem_android_menuCategory = 5; /** <p> @attr description The numeric shortcut key. This is the shortcut when using a numeric (e.g., 12-key) keyboard. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#numericShortcut}. @attr name android:numericShortcut */ public static final int MenuItem_android_numericShortcut = 10; /** <p> @attr description Name of a method on the Context used to inflate the menu that will be called when the item is clicked. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#onClick}. @attr name android:onClick */ public static final int MenuItem_android_onClick = 12; /** <p> @attr description The order within the category applied to the item. (This will be or'ed with the category attribute.) <p>This corresponds to the global attribute resource symbol {@link android.R.attr#orderInCategory}. @attr name android:orderInCategory */ public static final int MenuItem_android_orderInCategory = 6; /** <p> @attr description The title associated with the item. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#title}. @attr name android:title */ public static final int MenuItem_android_title = 7; /** <p> @attr description The condensed title associated with the item. This is used in situations where the normal title may be too long to be displayed. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#titleCondensed}. @attr name android:titleCondensed */ public static final int MenuItem_android_titleCondensed = 8; /** <p> @attr description Whether the item is shown/visible. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#visible}. @attr name android:visible */ public static final int MenuItem_android_visible = 4; /** <p> @attr description How this item should display in the Action Bar, if present. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>never</code></td><td>0</td><td> Never show this item in an action bar, show it in the overflow menu instead. Mutually exclusive with "ifRoom" and "always". </td></tr> <tr><td><code>ifRoom</code></td><td>1</td><td> Show this item in an action bar if there is room for it as determined by the system. Favor this option over "always" where possible. Mutually exclusive with "never" and "always". </td></tr> <tr><td><code>always</code></td><td>2</td><td> Always show this item in an actionbar, even if it would override the system's limits of how much stuff to put there. This may make your action bar look bad on some screens. In most cases you should use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". </td></tr> <tr><td><code>withText</code></td><td>4</td><td> When this item is shown as an action in the action bar, show a text label with it even if it has an icon representation. </td></tr> <tr><td><code>collapseActionView</code></td><td>8</td><td> This item's action view collapses to a normal menu item. When expanded, the action view takes over a larger segment of its container. </td></tr> </table> <p>This is a private symbol. @attr name com.example.mylayouttutorial:showAsAction */ public static final int MenuItem_showAsAction = 13; /** Attributes that can be used with a MenuView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuView_android_headerBackground android:headerBackground}</code></td><td> Default background for the menu header.</td></tr> <tr><td><code>{@link #MenuView_android_horizontalDivider android:horizontalDivider}</code></td><td> Default horizontal divider between rows of menu items.</td></tr> <tr><td><code>{@link #MenuView_android_itemBackground android:itemBackground}</code></td><td> Default background for each menu item.</td></tr> <tr><td><code>{@link #MenuView_android_itemIconDisabledAlpha android:itemIconDisabledAlpha}</code></td><td> Default disabled icon alpha for each menu item that shows an icon.</td></tr> <tr><td><code>{@link #MenuView_android_itemTextAppearance android:itemTextAppearance}</code></td><td> Default appearance of menu item text.</td></tr> <tr><td><code>{@link #MenuView_android_preserveIconSpacing android:preserveIconSpacing}</code></td><td> Whether space should be reserved in layout when an icon is missing.</td></tr> <tr><td><code>{@link #MenuView_android_verticalDivider android:verticalDivider}</code></td><td> Default vertical divider between menu items.</td></tr> <tr><td><code>{@link #MenuView_android_windowAnimationStyle android:windowAnimationStyle}</code></td><td> Default animations for the menu.</td></tr> </table> @see #MenuView_android_headerBackground @see #MenuView_android_horizontalDivider @see #MenuView_android_itemBackground @see #MenuView_android_itemIconDisabledAlpha @see #MenuView_android_itemTextAppearance @see #MenuView_android_preserveIconSpacing @see #MenuView_android_verticalDivider @see #MenuView_android_windowAnimationStyle */ public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x01010438 }; /** <p> @attr description Default background for the menu header. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#headerBackground}. @attr name android:headerBackground */ public static final int MenuView_android_headerBackground = 4; /** <p> @attr description Default horizontal divider between rows of menu items. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#horizontalDivider}. @attr name android:horizontalDivider */ public static final int MenuView_android_horizontalDivider = 2; /** <p> @attr description Default background for each menu item. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#itemBackground}. @attr name android:itemBackground */ public static final int MenuView_android_itemBackground = 5; /** <p> @attr description Default disabled icon alpha for each menu item that shows an icon. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#itemIconDisabledAlpha}. @attr name android:itemIconDisabledAlpha */ public static final int MenuView_android_itemIconDisabledAlpha = 6; /** <p> @attr description Default appearance of menu item text. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#itemTextAppearance}. @attr name android:itemTextAppearance */ public static final int MenuView_android_itemTextAppearance = 1; /** <p> @attr description Whether space should be reserved in layout when an icon is missing. <p>This is a private symbol. @attr name android:preserveIconSpacing */ public static final int MenuView_android_preserveIconSpacing = 7; /** <p> @attr description Default vertical divider between menu items. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#verticalDivider}. @attr name android:verticalDivider */ public static final int MenuView_android_verticalDivider = 3; /** <p> @attr description Default animations for the menu. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#windowAnimationStyle}. @attr name android:windowAnimationStyle */ public static final int MenuView_android_windowAnimationStyle = 0; /** Attributes that can be used with a SearchView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #SearchView_android_imeOptions android:imeOptions}</code></td><td> The IME options to set on the query text field.</td></tr> <tr><td><code>{@link #SearchView_android_inputType android:inputType}</code></td><td> The input type to set on the query text field.</td></tr> <tr><td><code>{@link #SearchView_android_maxWidth android:maxWidth}</code></td><td> An optional maximum width of the SearchView.</td></tr> <tr><td><code>{@link #SearchView_iconifiedByDefault com.example.mylayouttutorial:iconifiedByDefault}</code></td><td> The default state of the SearchView.</td></tr> <tr><td><code>{@link #SearchView_queryHint com.example.mylayouttutorial:queryHint}</code></td><td> An optional query hint string to be displayed in the empty query field.</td></tr> </table> @see #SearchView_android_imeOptions @see #SearchView_android_inputType @see #SearchView_android_maxWidth @see #SearchView_iconifiedByDefault @see #SearchView_queryHint */ public static final int[] SearchView = { 0x0101011f, 0x01010220, 0x01010264, 0x7f01005a, 0x7f01005b }; /** <p> @attr description The IME options to set on the query text field. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#imeOptions}. @attr name android:imeOptions */ public static final int SearchView_android_imeOptions = 2; /** <p> @attr description The input type to set on the query text field. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#inputType}. @attr name android:inputType */ public static final int SearchView_android_inputType = 1; /** <p> @attr description An optional maximum width of the SearchView. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#maxWidth}. @attr name android:maxWidth */ public static final int SearchView_android_maxWidth = 0; /** <p> @attr description The default state of the SearchView. If true, it will be iconified when not in use and expanded when clicked. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:iconifiedByDefault */ public static final int SearchView_iconifiedByDefault = 3; /** <p> @attr description An optional query hint string to be displayed in the empty query field. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:queryHint */ public static final int SearchView_queryHint = 4; /** Attributes that can be used with a Spinner. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #Spinner_android_dropDownHorizontalOffset android:dropDownHorizontalOffset}</code></td><td> Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown".</td></tr> <tr><td><code>{@link #Spinner_android_dropDownSelector android:dropDownSelector}</code></td><td> List selector to use for spinnerMode="dropdown" display.</td></tr> <tr><td><code>{@link #Spinner_android_dropDownVerticalOffset android:dropDownVerticalOffset}</code></td><td> Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown".</td></tr> <tr><td><code>{@link #Spinner_android_dropDownWidth android:dropDownWidth}</code></td><td> Width of the dropdown in spinnerMode="dropdown".</td></tr> <tr><td><code>{@link #Spinner_android_gravity android:gravity}</code></td><td> Gravity setting for positioning the currently selected item.</td></tr> <tr><td><code>{@link #Spinner_android_popupBackground android:popupBackground}</code></td><td> Background drawable to use for the dropdown in spinnerMode="dropdown".</td></tr> <tr><td><code>{@link #Spinner_disableChildrenWhenDisabled com.example.mylayouttutorial:disableChildrenWhenDisabled}</code></td><td> Whether this spinner should mark child views as enabled/disabled when the spinner itself is enabled/disabled.</td></tr> <tr><td><code>{@link #Spinner_popupPromptView com.example.mylayouttutorial:popupPromptView}</code></td><td> Reference to a layout to use for displaying a prompt in the dropdown for spinnerMode="dropdown".</td></tr> <tr><td><code>{@link #Spinner_prompt com.example.mylayouttutorial:prompt}</code></td><td> The prompt to display when the spinner's dialog is shown.</td></tr> <tr><td><code>{@link #Spinner_spinnerMode com.example.mylayouttutorial:spinnerMode}</code></td><td> Display mode for spinner options.</td></tr> </table> @see #Spinner_android_dropDownHorizontalOffset @see #Spinner_android_dropDownSelector @see #Spinner_android_dropDownVerticalOffset @see #Spinner_android_dropDownWidth @see #Spinner_android_gravity @see #Spinner_android_popupBackground @see #Spinner_disableChildrenWhenDisabled @see #Spinner_popupPromptView @see #Spinner_prompt @see #Spinner_spinnerMode */ public static final int[] Spinner = { 0x010100af, 0x01010175, 0x01010176, 0x01010262, 0x010102ac, 0x010102ad, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054 }; /** <p> @attr description Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". <p>This corresponds to the global attribute resource symbol {@link android.R.attr#dropDownHorizontalOffset}. @attr name android:dropDownHorizontalOffset */ public static final int Spinner_android_dropDownHorizontalOffset = 4; /** <p> @attr description List selector to use for spinnerMode="dropdown" display. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#dropDownSelector}. @attr name android:dropDownSelector */ public static final int Spinner_android_dropDownSelector = 1; /** <p> @attr description Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". <p>This corresponds to the global attribute resource symbol {@link android.R.attr#dropDownVerticalOffset}. @attr name android:dropDownVerticalOffset */ public static final int Spinner_android_dropDownVerticalOffset = 5; /** <p> @attr description Width of the dropdown in spinnerMode="dropdown". <p>This corresponds to the global attribute resource symbol {@link android.R.attr#dropDownWidth}. @attr name android:dropDownWidth */ public static final int Spinner_android_dropDownWidth = 3; /** <p> @attr description Gravity setting for positioning the currently selected item. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#gravity}. @attr name android:gravity */ public static final int Spinner_android_gravity = 0; /** <p> @attr description Background drawable to use for the dropdown in spinnerMode="dropdown". <p>This corresponds to the global attribute resource symbol {@link android.R.attr#popupBackground}. @attr name android:popupBackground */ public static final int Spinner_android_popupBackground = 2; /** <p> @attr description Whether this spinner should mark child views as enabled/disabled when the spinner itself is enabled/disabled. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:disableChildrenWhenDisabled */ public static final int Spinner_disableChildrenWhenDisabled = 9; /** <p> @attr description Reference to a layout to use for displaying a prompt in the dropdown for spinnerMode="dropdown". This layout must contain a TextView with the id {@code @android:id/text1} to be populated with the prompt text. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:popupPromptView */ public static final int Spinner_popupPromptView = 8; /** <p> @attr description The prompt to display when the spinner's dialog is shown. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:prompt */ public static final int Spinner_prompt = 6; /** <p> @attr description Display mode for spinner options. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr> <tr><td><code>dropdown</code></td><td>1</td><td> Spinner options will be presented to the user as an inline dropdown anchored to the spinner widget itself. </td></tr> </table> <p>This is a private symbol. @attr name com.example.mylayouttutorial:spinnerMode */ public static final int Spinner_spinnerMode = 7; /** These are the standard attributes that make up a complete theme. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #Theme_actionDropDownStyle com.example.mylayouttutorial:actionDropDownStyle}</code></td><td> Default ActionBar dropdown style.</td></tr> <tr><td><code>{@link #Theme_dropdownListPreferredItemHeight com.example.mylayouttutorial:dropdownListPreferredItemHeight}</code></td><td> The preferred item height for dropdown lists.</td></tr> <tr><td><code>{@link #Theme_listChoiceBackgroundIndicator com.example.mylayouttutorial:listChoiceBackgroundIndicator}</code></td><td> Drawable used as a background for selected list items.</td></tr> <tr><td><code>{@link #Theme_panelMenuListTheme com.example.mylayouttutorial:panelMenuListTheme}</code></td><td> Default Panel Menu style.</td></tr> <tr><td><code>{@link #Theme_panelMenuListWidth com.example.mylayouttutorial:panelMenuListWidth}</code></td><td> Default Panel Menu width.</td></tr> <tr><td><code>{@link #Theme_popupMenuStyle com.example.mylayouttutorial:popupMenuStyle}</code></td><td> Default PopupMenu style.</td></tr> </table> @see #Theme_actionDropDownStyle @see #Theme_dropdownListPreferredItemHeight @see #Theme_listChoiceBackgroundIndicator @see #Theme_panelMenuListTheme @see #Theme_panelMenuListWidth @see #Theme_popupMenuStyle */ public static final int[] Theme = { 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c }; /** <p> @attr description Default ActionBar dropdown style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:actionDropDownStyle */ public static final int Theme_actionDropDownStyle = 0; /** <p> @attr description The preferred item height for dropdown lists. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:dropdownListPreferredItemHeight */ public static final int Theme_dropdownListPreferredItemHeight = 1; /** <p> @attr description Drawable used as a background for selected list items. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:listChoiceBackgroundIndicator */ public static final int Theme_listChoiceBackgroundIndicator = 5; /** <p> @attr description Default Panel Menu style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:panelMenuListTheme */ public static final int Theme_panelMenuListTheme = 4; /** <p> @attr description Default Panel Menu width. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:panelMenuListWidth */ public static final int Theme_panelMenuListWidth = 3; /** <p> @attr description Default PopupMenu style. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>This is a private symbol. @attr name com.example.mylayouttutorial:popupMenuStyle */ public static final int Theme_popupMenuStyle = 2; /** Attributes that can be used with a View. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #View_android_focusable android:focusable}</code></td><td> Boolean that controls whether a view can take focus.</td></tr> <tr><td><code>{@link #View_paddingEnd com.example.mylayouttutorial:paddingEnd}</code></td><td> Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.</td></tr> <tr><td><code>{@link #View_paddingStart com.example.mylayouttutorial:paddingStart}</code></td><td> Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.</td></tr> </table> @see #View_android_focusable @see #View_paddingEnd @see #View_paddingStart */ public static final int[] View = { 0x010100da, 0x7f010038, 0x7f010039 }; /** <p> @attr description Boolean that controls whether a view can take focus. By default the user can not move focus to a view; by setting this attribute to true the view is allowed to take focus. This value does not impact the behavior of directly calling {@link android.view.View#requestFocus}, which will always request focus regardless of this view. It only impacts where focus navigation will try to move focus. <p>This corresponds to the global attribute resource symbol {@link android.R.attr#focusable}. @attr name android:focusable */ public static final int View_android_focusable = 0; /** <p> @attr description Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:paddingEnd */ public static final int View_paddingEnd = 2; /** <p> @attr description Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>This is a private symbol. @attr name com.example.mylayouttutorial:paddingStart */ public static final int View_paddingStart = 1; }; }
2e29ed0425364cc43567a9794a1626f80215a759
a2075161efc65487d9a03daf644d2fc045cee604
/src/main/java/pages/LoginPage.java
7943fa3269c8c9d8a2bf0d1f67d2858f4ee088a0
[]
no_license
quhanqing/SecondMaven
d10f3ba2270762404468799393e065438a8f6ccf
b24bd718870e9d2fc28941e4b75a253dfd5e7a17
refs/heads/master
2022-07-07T22:18:21.356133
2019-06-25T14:03:06
2019-06-25T14:03:06
193,330,025
0
0
null
2022-06-29T17:28:09
2019-06-23T09:36:00
Java
UTF-8
Java
false
false
602
java
package pages; import org.openqa.selenium.WebDriver; public class LoginPage { public static String loginxPath="//*[@id=\"git-nav-user-bar\"]/a[2]"; public static String userNameId="user_login"; public static String userPasswordId="user_password"; public static String loginBtn="commit"; public static String basePath=System.getProperty("user.dir"); public static String filePath=basePath+"/src/test/TestData/测试数据_用户表.xlsx"; public static String sheetName="用户表"; public static int rowNum=2; public static int nameColum=1; public static int passwordColum=2; }
[ "quhanqing3113" ]
quhanqing3113
1a7a5c262dbb1bd4fcc2ed3f3cf3c5059d5888b1
9e83412faaca96519e3ccc3cc3963c801ef6aafa
/src/com/mobzilla/entity/SpecsBean.java
d3be9df9d0a00c72939b7cc964cfb49ee992552d
[]
no_license
Shreya-23/mobzilla
40d7d2c720ed4a9e8a9ea6db079800751b423558
603f899466e09e638dee707faa4350a27af8fa80
refs/heads/master
2020-03-23T20:00:11.186079
2018-07-23T13:08:02
2018-07-23T13:08:02
142,015,189
0
0
null
null
null
null
UTF-8
Java
false
false
1,756
java
package com.mobzilla.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="product_specs") public class SpecsBean { @Id @Column(name="product_id") private int productId; @Column(name="general") private String general; @Column(name="design") private String design; @Column(name="display") private String display; @Column(name="hardware") private String hardware; @Column(name="software") private String software; @Column(name="camera") private String camera; @Column(name="battery") private String battery; public int getProductId() { return productId; } public void setProductId(int productId) { this.productId = productId; } public String getGeneral() { return general; } public void setGeneral(String general) { this.general = general; } public String getDesign() { return design; } public void setDesign(String design) { this.design = design; } public String getDisplay() { return display; } public void setDisplay(String display) { this.display = display; } public String getHardware() { return hardware; } public void setHardware(String hardware) { this.hardware = hardware; } public String getSoftware() { return software; } public void setSoftware(String software) { this.software = software; } public String getCamera() { return camera; } public void setCamera(String camera) { this.camera = camera; } public String getBattery() { return battery; } public void setBattery(String battery) { this.battery = battery; } }
[ "LTI@Infva07032" ]
LTI@Infva07032
bcfa7efbbf926570b67da7db0962d7c5eca92520
08ddfa8153c7d34dee42861aa190f318a73de0c6
/src/main/java/ua/nure/kn/voroniuk/db/HsqldbUserDao.java
373576f0b88c0470c7f7ad60e9b86ec5dd23cfbc
[]
no_license
NUREKN17-JAVA/krystyna.voroniuk
896fb320014e31c45b22b71fb0a40f8aba20758c
c80ba29b82352ef7b6c3e4e253ad8fa75517a594
refs/heads/master
2020-09-08T18:01:11.938538
2019-12-27T22:01:35
2019-12-27T22:01:35
212,541,790
0
0
null
null
null
null
UTF-8
Java
false
false
6,564
java
package ua.nure.kn.voroniuk.db; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Collection; import java.util.LinkedList; import ua.nure.kn.voroniuk.usermanagement.User; import ua.nure.kn.voroniuk.db.DatabaseException; class HsqldbUserDao implements Dao<User> { private static final String SELECT_ALL_QUERY = "SELECT * FROM users"; private static final String INSERT_QUERY = "INSERT INTO users(firstname, lastname, dateOfBirth) VALUES (?, ?, ?)"; private ConnectionFactory connectionFactory; private final String FIND_BY_ID = "SELECT * FROM USERS WHERE id = ?"; private final String DELETE_USER = "DELETE FROM USERS WHERE id = ?"; private final String UPDATE_USER = "UPDATE USERS SET firstname = ?, lastname = ?, dateofbirth = ? WHERE id = ?"; private static final String SELECT_BY_NAMES = "SELECT id, firstname, lastname, dateofbirth FROM users WHERE firstname = ? AND lastname = ?"; public HsqldbUserDao() { } public HsqldbUserDao(ConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; } @Override public User create(User entity) throws DatabaseException { try { Connection connection = connectionFactory.getConnection(); PreparedStatement statement = connection.prepareStatement(INSERT_QUERY); statement.setString(1, entity.getFirstName()); statement.setString(2, entity.getLastName()); statement.setDate(3, new Date(entity.getDateOfBirth().getTime())); int numberOfRow = statement.executeUpdate(); if (numberOfRow != 1) { throw new DatabaseException("Number of inserted rows: " + numberOfRow); } CallableStatement callableStatement = connection.prepareCall("call IDENTITY()"); ResultSet key = callableStatement.executeQuery(); if (key.next()) { entity.setId(new Long(key.getLong(1))); } key.close(); callableStatement.close(); statement.close(); connection.close(); return entity; } catch (SQLException e) { throw new DatabaseException(e); } } @Override public void update(User entity) throws DatabaseException { try { Connection connection = connectionFactory.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(UPDATE_USER); preparedStatement.setString(1, entity.getFirstName()); preparedStatement.setString(2, entity.getLastName()); preparedStatement.setDate(3, new Date(entity.getDateOfBirth() .getTime())); preparedStatement.setLong(4, entity.getId()); int insertedRows = preparedStatement.executeUpdate(); if (insertedRows != 1) { throw new DatabaseException("Number of inserted rows: " + insertedRows); } connection.close(); preparedStatement.close(); } catch (DatabaseException | SQLException e) { throw new DatabaseException(e.toString()); } } @Override public void delete(User entity) throws DatabaseException { try { Connection connection = connectionFactory.getConnection(); PreparedStatement statement = connection.prepareStatement(DELETE_USER); statement.setLong(1, entity.getId()); int removedRows = statement.executeUpdate(); if (removedRows != 1) { throw new DatabaseException("Number of removed rows: " + removedRows); } connection.close(); statement.close(); } catch (SQLException e) { throw new DatabaseException(e); } } @Override public User find(Long id) throws DatabaseException { User user = null; try { Connection connection = connectionFactory.getConnection(); PreparedStatement statement = connection.prepareStatement(FIND_BY_ID); statement.setLong(1, id); ResultSet resultSet = statement.executeQuery(); if (resultSet.next()) { user = new User(); user.setId(resultSet.getLong(1)); user.setFirstName(resultSet.getString(2)); user.setLastName(resultSet.getString(3)); user.setDateOfBirth(resultSet.getDate(4)); } connection.close(); statement.close(); resultSet.close(); } catch (SQLException e) { throw new DatabaseException(e); } return user; } @Override public Collection<User> findAll() throws DatabaseException { try { Collection<User> result = new LinkedList<>(); Connection connection = connectionFactory.getConnection(); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(SELECT_ALL_QUERY); while(resultSet.next()) { User user = new User(); user.setId(resultSet.getLong(1)); user.setFirstName(resultSet.getString(2)); user.setLastName(resultSet.getString(3)); user.setDateOfBirth(resultSet.getDate(4)); result.add(user); } //close resources connection.close(); statement.close(); return result; } catch(SQLException e) { throw new DatabaseException(e); } } public ConnectionFactory getConnectionFactory() { return connectionFactory; } @Override public void setConnectionFactory(ConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; } @Override public Collection<User> find(String firstName, String lastName) throws DatabaseException { Collection result = new LinkedList(); try { Connection connection = connectionFactory.getConnection(); PreparedStatement statement = connection.prepareStatement(SELECT_BY_NAMES); statement.setString(1, firstName); statement.setString(2, lastName); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { User user = new User(); user.setId(new Long(resultSet.getLong(1))); user.setFirstName(resultSet.getString(2)); user.setLastName(resultSet.getString(3)); user.setDateOfBirth(resultSet.getDate(4)); result.add(user); } } catch (DatabaseException e) { // TODO Auto-generated catch block throw e; } catch (SQLException e) { // TODO Auto-generated catch block throw new DatabaseException(e); } return result; } }
e6c1e52d3ac5075b9c1d81c23c9fe440206423ad
f173f1de6b7f4863c1a17fbd261a55238d262c91
/src/main/java/com/kali/QuadraticForm.java
d970d0cb30003363277379cef0715cccb3e60a26
[]
no_license
vijayjatam/JavaPrograms
856ff031bb756a45803da60d0bb1015bf2f5b264
1e01b1455034d119ee900eb3f96f2321e981600b
refs/heads/master
2020-04-28T08:33:06.152505
2019-03-09T17:10:58
2019-03-09T17:10:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,649
java
package com.kali; import java.util.Scanner; public class QuadraticForm { public static void main(String[] args) { Quadratic(); } public static void Quadratic() { String existedForm = "1112,1113,1114,1115,1116,1117,1122,1123,1124,1125,1126,1127,1128,1129,11210,11211,11212,11213,11214,1133,1134,1135,1136,1222,1223,1224,1225,12261227,1233,1234,1235,1236,1237,1238,1239,12310,1244,1245,1246,1247,1248,1249,12410,12411,12412,12413,12414,1256,1257,1258,159,12510"; // calulate("11210"); Scanner scan = new Scanner(System.in); System.out.println("Enter number"); int number = scan.nextInt(); String[] eachForm = existedForm.split(","); for (int i = 0; i < eachForm.length; i++) { if (number == calulate(eachForm[i])) { System.out.println(number + " is equal to sum of squares of " + eachForm[i]); } } } public static int calulate(String eachForm) { int finalSquerValue = 0; if (eachForm.length() != 5) { for (int i = 0; i < eachForm.length(); i++) { finalSquerValue = finalSquerValue + (int) (Math.pow(Double.parseDouble(new Character(eachForm.charAt(i)).toString()), 2)); } } else { for (int i = 0; i < eachForm.length() - 2; i++) { finalSquerValue = finalSquerValue + (int) (Math.pow(Double.parseDouble(new Character(eachForm.charAt(i)).toString()), 2)); } finalSquerValue = finalSquerValue + (int) (Math.pow(Double.parseDouble(eachForm.substring(3)), 2)); } return finalSquerValue; } }
cfe728ade8c88684e33ba3f73d2bc300aa15dca5
4c7654af0cb145fbfe1a26d8f29cda053020042e
/SaveButton.java
80cf0760fc07043f0e970f57c790f51855cf77db
[]
no_license
mrschnabel/Dorm-Designer
9808c8409d17b985310f03fed7bf387a5fe5e177
bf547f837eb32960957f89239a0c360f86be0564
refs/heads/master
2022-04-25T07:21:19.214168
2020-04-19T01:00:29
2020-04-19T01:00:29
256,884,854
0
0
null
null
null
null
UTF-8
Java
false
false
4,965
java
import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; //////////////////// ALL ASSIGNMENTS INCLUDE THIS SECTION ///////////////////// // // Title: Dorm Designer 4000 // Files: CreateBedButton.java // Course: CS 300 Spring Semester 2018 // // Author: Vincent Angellotti // Email: [email protected] // Lecturer's Name: Mouna Kacem // //////////////////// PAIR PROGRAMMERS COMPLETE THIS SECTION /////////////////// // // Partner Name: Matt Schnabel // Partner Email: [email protected] // Lecturer's Name: Alexander Brooks // // VERIFY THE FOLLOWING BY PLACING AN X NEXT TO EACH TRUE STATEMENT: // __x_ Write-up states that pair programming is allowed for this assignment. // __x_ We have both read and understand the course Pair Programming Policy. // _x__ We have registered our team prior to the team registration deadline. // ///////////////////////////// CREDIT OUTSIDE HELP ///////////////////////////// // // Students who get help from sources other than their partner must fully // acknowledge and credit those sources of help here. Instructors and TAs do // not need to be credited here, but tutors, friends, relatives, room mates // strangers, etc do. If you received no outside help from either type of // source, then please explicitly indicate NONE. // // Persons: (identify each person and describe their help in detail) // Online Sources: (identify each URL and describe their assistance in detail) // /////////////////////////////// 80 COLUMNS WIDE /////////////////////////////// /* * This class is used to create a button that has the ability to save the locations of objects in the room. */ public class SaveButton { private static final int WIDTH = 96; private static final int HEIGHT = 32; private PApplet processing; private float[] position; private String label; /* * The SaveButton constructor is used to initialize the location and label of the button. */ public SaveButton(float x, float y, PApplet processing) { this.position = new float[2]; position[0] = x; position[1] = y; this.processing = processing; this.label = "Save Room"; } /* * When update() is called, the button is either colored with a darker shade of gray(corresponding to the mouse being over it) * or it is colored with a lighter shade of gray(the mouse is not over it). */ public void update() { if (isMouseOver() == true) { processing.fill(100); processing.rect(602, 8, 698, 40); } else { processing.fill(200); processing.rect(602, 8, 698, 40); } processing.fill(0); processing.text(label, 650, 24); } /* * The mouseDown() method first determines whether or not the mouse is over the save button when pressed down. * If true, a new file is created that will be used to save the locations of the objects in the room. * The type, x-coordinate, y-coordinate, and number of rotations are obtained and then written into the file for each existing * object. */ public void mouseDown(Furniture[] furniture) throws IOException { if (isMouseOver() == true) { String fileName = "RoomData.ddd"; System.out.println("Saving"); FileOutputStream fileByteStream = null; PrintWriter outFS = null; fileByteStream = new FileOutputStream(fileName);//creating new file outFS = new PrintWriter(fileByteStream);//creating new printer to write to file for (int i = 0; i < furniture.length; i++) {//the object's location and type are written to the file if the object exists if (furniture[i] == null) { outFS.print("\n"); } else { outFS.println(furniture[i].getType() + ":" + furniture[i].getPosition0() + "," + furniture[i].getPosition1() + "," + furniture[i].getRotations()); } } outFS.flush(); outFS.close();//closing the printWriter } else { } } /* * This method checks to see if the mouse is over a furniture object when pressed down. * The method returns either true or false, depending on whether the mouse is over an object or not. */ public boolean isMouseOver() { if (((processing.mouseX > position[0] - WIDTH / 2) && (processing.mouseX < position[0] + WIDTH / 2))//checks if mouse is within the dimensions of the object && ((processing.mouseY > position[1] - HEIGHT / 2) && (processing.mouseY < position[1] + HEIGHT / 2))) { return true; } else { return false; } } }
2fbd8b2f523ac08ddb2b6a0307b710d17238e61b
15f9164b078e792bee4598ca8d301371288776e1
/WebApiAutomation/src/test/java/BodyTestWithJackson.java
7443866145df63144b10bff0cb80fb87779262f4
[]
no_license
Chaserich1/Selenium-Learning
10e3bbd28fff4c249a3971217f8999f40bf1eb78
65a2065c9e54f3f519f9fa802a5424ee49b1d6d1
refs/heads/master
2023-01-03T21:11:56.191544
2020-10-29T16:58:23
2020-10-29T16:58:23
298,554,849
1
0
null
null
null
null
UTF-8
Java
false
false
1,939
java
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import entities.NotFound; import entities.RateLimit; import entities.User; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.util.EntityUtils; import org.testng.annotations.Test; import java.io.IOException; import static org.testng.Assert.assertEquals; public class BodyTestWithJackson extends BaseTestClass { @Test public void returnsCorrectLogin() throws IOException { HttpGet get = new HttpGet(BASE_ENDPOINT + "/users/Chaserich1"); response = client.execute(get); User user = ResponseUtils.unmarshallGeneric(response, User.class); assertEquals(user.getLogin(), "Chaserich1"); } @Test public void returnsCorrectId() throws IOException { HttpGet get = new HttpGet(BASE_ENDPOINT + "/users/Chaserich1"); response = client.execute(get); User user = ResponseUtils.unmarshallGeneric(response, User.class); assertEquals(user.getId(), 50150341); } @Test public void notFoundMessageIsCorrect() throws IOException { HttpGet get = new HttpGet(BASE_ENDPOINT + "/nonexistingendpoint"); response = client.execute(get); NotFound notFoundMessage = ResponseUtils.unmarshallGeneric(response, NotFound.class); assertEquals(notFoundMessage.getMessage(), "Not Found"); } @Test public void correctRateLimitsAreSet() throws IOException { HttpGet get = new HttpGet(BASE_ENDPOINT + "/rate_limit"); response = client.execute(get); RateLimit rateLimits = ResponseUtils.unmarshallGeneric(response, RateLimit.class); assertEquals(rateLimits.getCoreLimit(), 60); assertEquals(rateLimits.getSearchLimit(), "10"); } }
b214cbda2447faca5c80b51cb4cac736524b4387
99b21a686b00c7b37d840ff6722f51b9009e0e64
/Algorithms and data structures/laboratory/lab10/list/iterable/ListDoubling.java
906d6a3b216e843741ac64b57d66cd325fa8484e
[]
no_license
syxanash/college-shtuff
fb46aedf11524a2c7099f041b77b9c4a47f7922c
6d8cc1260c0f9079b22c15c28995bbae54fa47f5
refs/heads/master
2023-04-29T07:16:57.961855
2023-04-20T20:40:54
2023-04-20T20:40:54
21,786,425
12
5
null
2017-08-16T20:26:02
2014-07-13T08:52:00
Java
UTF-8
Java
false
false
2,821
java
package lab10.list.iterable; import java.util.Iterator; import lab10.list.Indice; import lab10.list.Posizione; public class ListDoubling<T> implements Lista<T> { protected T[] L = (T[]) new Object[1]; protected int n; public boolean isEmpty() { return n == 0; } public boolean endList(Posizione p) { return n == ((Indice) p).indice; } public T readList(Posizione p) { if (!checkPosition(p)) throw new IndexOutOfBoundsException("Posizione non valida"); return (T) L[((Indice) p).indice]; } /* * writeList differisce da insert in quanto esegue solo una riscrittura * nella posizione p del valore e quindi una sostituizine del valore * attualmente presente nella lista */ public void writeList(T e, Posizione p) { if (!checkPosition(p)) throw new IndexOutOfBoundsException("Posizione non valida"); L[((Indice) p).indice] = e; } public Posizione firstList() { return new Indice(); } public Posizione succ(Posizione p) { if (endList(p)) throw new IndexOutOfBoundsException(((Indice) p).indice + " e' ultima posizione della lista"); // creiamo un nuova nuova posizione contente // un valore incrementato di una unita' rispetto // al valore presente come parametro formale del metodo Indice pos = new Indice(); pos.indice = ((Indice) p).indice + 1; return pos; } public Posizione pred(Posizione p) { if (isEmpty()) throw new IndexOutOfBoundsException(((Indice) p).indice + " e' prima posizione della lista"); Indice pos = new Indice(); pos.indice = ((Indice) p).indice - 1; return pos; } // aggiunge un elemento alla fine della lista public void insert(T e, Posizione p) { if (!checkPosition(p)) throw new IndexOutOfBoundsException( "Posizione di inserimento non valida"); for (int i = n; i > ((Indice) p).indice; i--) { L[i] = L[i - 1]; } L[((Indice) p).indice] = e; n++; if (n == L.length) { T[] temp = (T[]) new Object[L.length * 2]; for (int i = 0; i < n; i++) { temp[i] = L[i]; } L = temp; } } public void remove(Posizione p) { if (!checkPosition(p)) throw new IndexOutOfBoundsException( "Posizione di rimozione non valida"); for (int i = ((Indice) p).indice; i < n; i++) { L[i] = L[i + 1]; } n--; if (n > 1 && n == (L.length / 4)) { T[] temp = (T[]) new Object[L.length / 2]; for (int i = 0; i < n; i++) { temp[i] = L[i]; } L = temp; } } // metodo usato esclusivamente per controllare che la posizione // inserita come parametro rientri nei valori posizionali // dell'array effettivamente creato. protected boolean checkPosition(Posizione p) { if (((Indice) p).indice < 0 || ((Indice) p).indice > n) return false; else return true; } public Iterator iterator() { return new ListIterator(this); } }
8aa9025ac7ed2960ab502a647b4060b94dfee6e1
a17b9e588f6b52d08038628ec2ea56d2f9ad4c2b
/backend/src/main/java/be/ugent/vopro5/backend/datalayer/dataaccessobjects/serialization/OperatorMixin.java
1c6f1f9d9e31ccb0cbb8ff99431927c0f184504f
[ "MIT" ]
permissive
ghentlivinglab/Personalized-mobility-information-service-solution-1
4b0f3c26a98273f940d331949b815acdd687cc11
d24903bcca4a0fcb5e6702b35fa46d71f38b8d92
refs/heads/master
2020-04-06T06:56:43.858665
2016-08-23T08:15:45
2016-08-23T08:15:45
64,652,422
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package be.ugent.vopro5.backend.datalayer.dataaccessobjects.serialization; import be.ugent.vopro5.backend.businesslayer.businessentities.models.NotificationMedium; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** * Created by thibault on 4/4/16. */ public abstract class OperatorMixin { @JsonProperty("_id") public abstract UUID getIdentifier(); @JsonProperty("email") private NotificationMedium email; @JsonProperty("password") public abstract String getPassword(); @JsonCreator OperatorMixin(@JsonProperty("_id") UUID identifier, @JsonProperty("email") NotificationMedium email, @JsonProperty("password") String password ) { } }
5133dca0554c1df153f72840bf9968808b98a1e8
b95c36d120d427c8492f47620c5d194b41a79a92
/Final/app/src/main/java/com/example/chaulk/mac/Cart.java
1be53ce1cdc9032da62c54a82547f0b62b5b79f8
[]
no_license
ChamudiniAthukorala/UEE_Final_Project_MC
74f635f103f9a924cd5251440d369f3f9b97e85d
4ac03fc0109879d19067551007af6e19811c5ae9
refs/heads/master
2020-07-28T14:39:08.679519
2019-09-19T02:06:18
2019-09-19T02:06:18
209,441,592
0
0
null
null
null
null
UTF-8
Java
false
false
3,560
java
package com.example.chaulk.mac; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; public class Cart extends AppCompatActivity { ImageView carthome; ImageView cartsearchico; ImageView cartcartico; ImageView cartorderico; ImageView cartprofileico; TextView place; TextView edit; TextView change; TextView remove; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cart); carthome = findViewById(R.id.chomeico4); cartsearchico = findViewById(R.id.csearchico4); cartcartico = findViewById(R.id.ccartico4); cartorderico = findViewById(R.id.corderico4); cartprofileico = findViewById(R.id.cprofileico4); place = findViewById(R.id.carsubtotalfee); edit = findViewById(R.id.cartedit); change = findViewById(R.id.cartchange); remove = findViewById(R.id.textView47); carthome.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Home.class); startActivity(homeView); } }); cartsearchico.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Search.class); startActivity(homeView); } }); cartcartico.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Cart.class); startActivity(homeView); } }); cartorderico.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Orders.class); startActivity(homeView); } }); cartprofileico.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Profile.class); startActivity(homeView); } }); place.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, Track.class); startActivity(homeView); } }); edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, UpdateOrder.class); startActivity(homeView); } }); change.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, ChangePaymentMethod.class); startActivity(homeView); } }); remove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeView = new Intent(Cart.this, EmptyCart.class); startActivity(homeView); } }); } }
65db95dacb1b1ee8fbab6e32ec463c0714636cf3
4d6141641413957f016ce7696c750017a6a11edc
/mybatis02/src/test/java/bat/ke/qq/com/UserMapper.java
bca3d520e60456275fea88d03b9040a7e1241fac
[]
no_license
jianglil/mybatis
8e61d9e7efde454765a7b19eba2c804d5bbeec98
3593639956262bf54cdcfde7c0d1d41e4e428009
refs/heads/master
2022-12-08T15:51:37.413008
2020-09-07T06:57:28
2020-09-07T06:57:28
293,445,405
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
package bat.ke.qq.com; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; /** * 源码学院-Monkey * 只为培养BAT程序员而生 * http://bat.ke.qq.com * 往期视频加群:516212256 暗号:6 */ public interface UserMapper { @Results({ @Result(property ="name",column = "username") }) @Select("select * from User where id = #{id}") public User selectUser(Integer id); }
cf21c1f3b78edfe587cd8183cf97d3100c04dbc8
2f719f8f259e62ff0302dbd914f7b816edd66302
/LearnJSON/src/learning/Rates.java
f2a53ba655da8ac4546d71b998b6566d6c4e8156
[]
no_license
theoc-apps/learning_JSON
07af24552900a6d5201ba3a8c8705eb8934fa308
8a1eeac9b6fdebfe2e8fdb9dd5c1723a1a74a988
refs/heads/master
2021-01-22T03:01:18.748418
2014-05-06T06:50:13
2014-05-06T06:50:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package learning; import java.util.List; public class Rates{ private String rate; private String when; public String getRate(){ return this.rate; } public void setRate(String rate){ this.rate = rate; } public String getWhen(){ return this.when; } public void setWhen(String when){ this.when = when; } }
[ "Theodor@Theo-Laptop" ]
Theodor@Theo-Laptop
4a50507ad830e61f6af4dd7b62302065039e3a07
8d02a7e6a57eef99523632c2a992baa53cddb014
/src/main/java/PIM/WEBSERIVE/ACTIVITIE/STUDENT/Repository/AddressRepository.java
e815476d76c687a5294ba97905482e7001b9f910
[]
no_license
AlohaIndy/Panyapiway_Student_Activitie
28365c675158787a245b70d53c5614ca731c774a
0dc32f2c20c563be50cf7a3cc389e2f4f959b7c5
refs/heads/master
2021-05-10T15:37:42.715779
2018-02-04T10:54:10
2018-02-04T10:54:10
118,557,741
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package PIM.WEBSERIVE.ACTIVITIE.STUDENT.Repository; import org.springframework.data.jpa.repository.JpaRepository; import PIM.WEBSERIVE.ACTIVITIE.STUDENT.Model.Address; public interface AddressRepository extends JpaRepository<Address, Long>{ public Address findByPersonId(long personId); }
14310178433a6bc2ffe1a3c8d326000a3b18cacd
1f4ae54e0bf535af38c095410b7dcf7f7acbde95
/src/main/java/br/com/filipe/bean/DepartamentBean.java
ffd3850ceb00136d604e9ae71964862044f72148
[]
no_license
filipedosreis/SampleProject
8b23fae03936442032b271a407c1a6035b31e5b9
f243225672cf56616af936157b990de232a3a165
refs/heads/master
2021-01-13T01:48:26.233533
2017-02-12T03:24:20
2017-02-12T03:24:20
81,522,407
0
0
null
null
null
null
UTF-8
Java
false
false
3,754
java
package br.com.filipe.bean; import br.com.filipe.model.Departament; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import java.io.IOException; import java.util.List; /** * Created by [email protected] on 10/02/2017. */ @ManagedBean(name="departamentBean") @ViewScoped public class DepartamentBean { private List<Departament> departaments; private Departament selectedDepartament = new Departament(); @PostConstruct public void init() { Client c = Client.create(); WebResource wr = c.resource("http://localhost:8080/rest/departament/list"); ClientResponse response = wr.type("application/json").post(ClientResponse.class, null); String json = response.getEntity(String.class); final ObjectMapper mapper = new ObjectMapper(); List registros = null; try { registros = mapper.readValue(json, mapper.getTypeFactory().constructCollectionType(List.class, Departament.class)); } catch (IOException e) { e.printStackTrace(); } departaments = registros; } public void save(){ Client c = Client.create(); WebResource wr = c.resource("http://localhost:8080/rest/departament/save"); ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); ClientResponse response = null; try { String json = ow.writeValueAsString(selectedDepartament); response = wr.type("application/json").post(ClientResponse.class, json); } catch (JsonProcessingException e) { e.printStackTrace(); } if (!(response.getStatus() == 201 || response.getStatus() == 200)) { addMessage("Generic Error. Please try again."); return; } init(); addMessage("Succes operation"); } public void delete(){ Client c = Client.create(); WebResource wr = c.resource("http://localhost:8080/rest/departament/delete"); ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); ClientResponse response = null; try { String json = ow.writeValueAsString(selectedDepartament); response = wr.type("application/json").post(ClientResponse.class, json); } catch (JsonProcessingException e) { e.printStackTrace(); } if (!(response.getStatus() == 201 || response.getStatus() == 200)) { addMessage("You can't delete this departament, it are enable for users"); return; } init(); addMessage("Record deleted!"); } public List<Departament> getDepartaments() { return departaments; } public Departament getSelectedDepartament() { return selectedDepartament; } public void setSelectedDepartament(Departament selectedDepartament) { this.selectedDepartament = selectedDepartament; } public void reset(ActionEvent event) { this.selectedDepartament = new Departament(); } public void addMessage(String summary) { FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, summary, null); FacesContext.getCurrentInstance().addMessage(null, message); } }
facc3fafa325d6b66916e9e57be1257b4f8b06f4
ca0b6985b5ab5d6590ba6d79d7b5bf5941172953
/src/main/java/sql/SqlHelper.java
017c2f2ee7f25959a82013495138914772c78bc4
[]
no_license
VasilenkovDA/stom
d7bddc632a14a9942739f4bfaaee2e840f2d7147
9eb1f565de2413f4750d5d7792d823e973ddcab9
refs/heads/master
2022-12-25T22:34:35.980932
2020-10-13T13:56:43
2020-10-13T13:56:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,415
java
package sql; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class SqlHelper { private final ConnectionFactory connectionFactory; public SqlHelper(String url, String user, String pass) { connectionFactory = () -> DriverManager.getConnection(url, user, pass); } public void execute (String sql) throws Exception { execute(sql, PreparedStatement::execute); } public <T> T execute(String sql, SqlExecutor<T> executor) throws Exception { try (Connection conn = connectionFactory.getConnection()) { PreparedStatement ps = conn.prepareStatement(sql); return executor.execute(ps); } catch (SQLException e) { throw ExceptionUtil.convertException(e); } } // public <T> T transactionExecutor(SqlTransaction<T> executor) { // try (Connection conn = connectionFactory.getConnection()) { // try { // conn.setAutoCommit(false); // T res = executor.execute(conn); // conn.commit(); // return res; // } catch (SQLException e) { // conn.rollback(); // throw ExceptionUtil.convertException(e); // } // } catch (SQLException e) { // throw new StorageException(e); // } // // } }
08a02d5a69bb58323f2ed5401e1ba40fab7ed232
672e3119bdb839e67015fc2a4311866320873b50
/eclipse-plugin/src/com/pugsource/plugin/wizards/guide/MigrationGuideWizard.java
baa9def9ad15d22f742e7d62355e520e0157b657
[]
no_license
alberto-henrique-sousa/pug
aeba385b408c14e58911366e4c26c1b96b3be040
25b2aaf94ec2a69a9c846a606b78ca3bb91a5988
refs/heads/master
2023-06-22T15:47:30.092595
2021-07-22T16:38:34
2021-07-22T16:38:34
388,529,009
0
1
null
null
null
null
UTF-8
Java
false
false
2,436
java
/******************************************************************************* * Copyright 2013 Pug Framework. All Rights Reserved. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ package com.pugsource.plugin.wizards.guide; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.wb.internal.core.DesignerPlugin; import com.pugsource.plugin.wizards.Activator; /** * @author alberto */ public class MigrationGuideWizard extends Wizard implements INewWizard { //////////////////////////////////////////////////////////////////////////// // // Constructor // //////////////////////////////////////////////////////////////////////////// public MigrationGuideWizard() { setDefaultPageImageDescriptor(Activator.getImageDescriptor("wizards/crud/banner.png")); setWindowTitle("Migration Guide"); } //////////////////////////////////////////////////////////////////////////// // // Pages // //////////////////////////////////////////////////////////////////////////// @Override public void addPages() { addPage(new MigrationGuideWizardPage()); } //////////////////////////////////////////////////////////////////////////// // // INewWizard // //////////////////////////////////////////////////////////////////////////// public void init(IWorkbench workbench, IStructuredSelection selection) { } //////////////////////////////////////////////////////////////////////////// // // Finish // //////////////////////////////////////////////////////////////////////////// @Override public boolean performFinish() { try { return true; } catch (Throwable e) { DesignerPlugin.log(e); } return false; } }
11664f5e8a0b40d1c5fcd22ef6043c54495f2649
cc62d790437438d428d4705a6713a5ebefac0027
/cloudfoundry-operations/src/main/lombok/org/cloudfoundry/operations/applications/PushApplicationRequest.java
52efdec134f61a250b7ff011ac687e67d5e7e794
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
passpoon/cf-java-client
9d0d20efa7e5181852e21f2520bf90592b24d178
ffa91cba275c1285d52a1e7367c969909bc6e022
refs/heads/master
2020-12-28T23:34:59.050437
2016-03-15T17:32:20
2016-03-15T17:32:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,006
java
/* * Copyright 2013-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.cloudfoundry.operations.applications; import lombok.Builder; import lombok.Data; import org.cloudfoundry.Validatable; import org.cloudfoundry.ValidationResult; import java.io.InputStream; /** * The request options for the push application operation */ @Data public final class PushApplicationRequest implements Validatable { /** * The bits for the application * * @param application the bits for the application * @return the bits for the application */ private final InputStream application; /** * The buildpack for the application * * @param buildpack the buildpack for the application * @return the buildpack for the application */ private final String buildpack; /** * The custom start command for the application * * @param command the start command for the application * @return the start command for the application */ private final String command; /** * The disk quota for the application * * @param diskQuota the disk quota for the application * @return the disk quota for the application */ private final Integer diskQuota; /** * The Docker image for the application * * @param dockerImage the Docker image for the application * @return the Docker image for the application */ private final String dockerImage; /** * The domain for the application * * @param domain the domain for the application * @return the domain for the application */ private final String domain; /** * The health check type for the application e.g. 'port' or 'none' * * @param healthCheckType the health check type for the application * @return the health check type for the application */ private final String healthCheckType; /** * The host for the application * * @param host the host for the application * @return the host for the application */ private final String host; /** * The number of instances for the application * * @param instances the number of instances for the application * @return the number of instances for the application */ private final Integer instances; /** * The memory in MB for the application * * @param memory the memory in MB for the application * @return the memory in MB for the application */ private final Integer memory; /** * The name for the application * * @param name the name for the application * @return the name for the application */ private final String name; /** * Map the root domain to the application * * @param noHostname whether to map the root domain to the application * @return whether to map the root domain to the application */ private final Boolean noHostname; /** * Do not create a route for the application * * @param noRoute whether to create a route for the application * @return whether to create a route for the application */ private final Boolean noRoute; /** * Do not start the application after pushing * * @param noStart whether to start the application * @return whether to start the application */ private final Boolean noStart; /** * The path for the application * * @param path the path for the application * @return the path for the application */ private final String path; /** * Use a random route for the application * * @param randomRoute whether to use a random route for the application * @return whether to use a random route for the application */ private final Boolean randomRoute; /** * The route path for the application * * @param routePath the route path for the application * @return the route path for the application */ private final String routePath; /** * The stack for the application * * @param stack the stack for the application * @return the stack for the application */ private final String stack; /** * The startup timeout in seconds for the application * * @param timeout the startup timeout in seconds for the application * @return the startup timeout in seconds for the application */ private final Integer timeout; @Builder PushApplicationRequest(InputStream application, String buildpack, String command, Integer diskQuota, String dockerImage, String domain, String healthCheckType, String host, Integer instances, Integer memory, String name, Boolean noHostname, Boolean noRoute, Boolean noStart, String path, Boolean randomRoute, String routePath, Integer timeout, String stack) { this.application = application; this.buildpack = buildpack; this.command = command; this.diskQuota = diskQuota; this.dockerImage = dockerImage; this.domain = domain; this.healthCheckType = healthCheckType; this.host = host; this.instances = instances; this.memory = memory; this.name = name; this.noHostname = noHostname; this.noRoute = noRoute; this.noStart = noStart; this.path = path; this.randomRoute = randomRoute; this.routePath = routePath; this.timeout = timeout; this.stack = stack; } @Override public ValidationResult isValid() { ValidationResult.ValidationResultBuilder builder = ValidationResult.builder(); if (this.name == null) { builder.message("name must be specified"); } if (this.application == null) { builder.message("application bits must be specified"); } return builder.build(); } }
1c1159c6ef75d82d000ac4aeb65103fdebfd1cf2
92f75f65766402204ecbeaac6cece2a75bbf7c0d
/src/main/java/com/demotivirus/Day_060/service/TranslationDispatcher.java
5291b66f1b05e32a07d28ba1edc4b1fb69008621
[]
no_license
demotivirus/365_Days_Challenge
338139efe4f677ebb78abac4e4c674639ad78ab8
cfc25eb921dd59f9581a39bf00fb0fc15809e4bb
refs/heads/master
2023-07-21T19:04:26.927157
2021-09-07T20:25:29
2021-09-07T20:25:29
336,847,354
1
0
null
2021-09-07T20:20:42
2021-02-07T17:32:36
Java
UTF-8
Java
false
false
392
java
package com.demotivirus.Day_060.service; import com.demotivirus.Day_060.model.Eng; import com.demotivirus.Day_060.model.Rus; import java.util.List; public interface TranslationDispatcher { List<String> findAllEngToRusTranslations(Long engId); List<String> findAllRusToEngTranslations(Long rusId); Eng findFirstEngByWord(String word); Rus findFistRusByWord(String word); }
70773a54c2df29a2dabb1d25dccf08ae04361491
a8c9d271f7517c1c2102760543bf554932e43b81
/src/MyMath/functions/realizations/factories/MVFunctionFactory.java
a18eed0e83e89f8d639f861a662253bdbfffb021
[]
no_license
drabchuk/laba4_ppz
58b59d3662fcff1d2bc8ae029717e3bd8e8e2ab0
6830664a9da3a11a00eabf11df082710f07dcdf7
refs/heads/master
2021-01-12T10:18:29.791457
2016-12-14T01:53:29
2016-12-14T01:53:29
76,414,750
0
0
null
null
null
null
UTF-8
Java
false
false
16,328
java
package MyMath.functions.realizations.factories; import MyMath.functions.Function; import MyMath.functions.realizations.*; import MyMath.functions.realizations.operations.Operation; import MyMath.functions.realizations.operations.realizations.*; import java.util.*; /** * Created by Денис on 09.06.2016. */ public class MVFunctionFactory extends FunctionFactory { //origins private String interpretation; private HashMap<String, Var> vars = new HashMap<>(); private Operation func; //to build private HashSet<String> standardOperationSet = new HashSet<>(Arrays.asList(StandardOperationsSRC.literals)); @Override public Function buildFunction(String interpretation) throws Exception { this.interpretation = interpretation; Stack<Operation> varStack = new Stack<Operation>(); Stack<String> operationsStack = new Stack<String>(); String literal = ""; boolean inLiteralStatus = false; //to execute from cast to cast String interpretationInCasts = "(" + interpretation + ")"; if (interpretationInCasts.contains(">=")) { interpretationInCasts = interpretationInCasts.replaceAll(">=", ")>=("); interpretationInCasts = "(" + interpretationInCasts + ")"; } if (interpretationInCasts.contains("<=")) { interpretationInCasts = interpretationInCasts.replaceAll("<=", ")<=("); interpretationInCasts = "(" + interpretationInCasts + ")"; } if (interpretationInCasts.contains("==")) { interpretationInCasts = interpretationInCasts.replaceAll("==", ")==("); interpretationInCasts = "(" + interpretationInCasts + ")"; } char previousChar = '('; for (char c : interpretationInCasts.toCharArray()) { if (c == '(') { if (inLiteralStatus) { inLiteralStatus = false; if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } } operationsStack.add(String.valueOf(c)); literal = ""; } else if (c == ')') { if (inLiteralStatus) { inLiteralStatus = false; if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } } String op; try { while (!(op = operationsStack.pop()).equals("(")) { executeOperation(op, varStack, operationsStack); } } catch (EmptyStackException e) { System.out.println("Empty stack"); } literal = ""; } else if (c == '+') { String currentOperation = String.valueOf(c); if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } int currentPriority = priority(currentOperation); String op; while (priority(op = operationsStack.pop()) < currentPriority) { executeOperation(op, varStack, operationsStack); } operationsStack.push(op); operationsStack.push(currentOperation); literal = ""; } else if (c == '-') {//FIXME String currentOperation = String.valueOf(c); if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; //executeOperation("-", varStack, operationsStack); } if (previousChar == '(') { operationsStack.push("neg"); } else { int currentPriority = priority("+"); String op; while (priority(op = operationsStack.pop()) < currentPriority) { executeOperation(op, varStack, operationsStack); } operationsStack.push(op); operationsStack.push("+"); operationsStack.push("neg"); } literal = ""; // if (previousChar != '(') { // String currentOperation = "+"; // int currentPriority = priority(currentOperation); // String op; // while (priority(op = operationsStack.pop()) < currentPriority) { // executeOperation(op, varStack, operationsStack); // } // //operationsStack.push(op); // operationsStack.push("+"); // //operationsStack.push(String.valueOf(c)); // operationsStack.push("neg"); // } else { // //trying to fix // operationsStack.push("+"); // // // // operationsStack.push("neg"); // } literal = ""; } else if (c == '*') { String currentOperation = String.valueOf(c); if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } int currentPriority = priority(currentOperation); String op; while (priority(op = operationsStack.pop()) < currentPriority) { executeOperation(op, varStack, operationsStack); } operationsStack.push(op); operationsStack.push(currentOperation); literal = ""; } else if (c == '/') { String currentOperation = String.valueOf(c); if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } int currentPriority = priority(currentOperation); String op; while (priority(op = operationsStack.pop()) < currentPriority) { executeOperation(op, varStack, operationsStack); } operationsStack.push(op); operationsStack.push(String.valueOf(c)); literal = ""; } else if (c == '^') { String currentOperation = String.valueOf(c); if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } int currentPriority = priority(currentOperation); String op; while (priority(op = operationsStack.pop()) < currentPriority) { executeOperation(op, varStack, operationsStack); } operationsStack.push(op); operationsStack.push(String.valueOf(c)); literal = ""; } else if (c == 'd') { if (inLiteralStatus) { literal += "d"; if (standardOperationSet.contains(literal)) { operationsStack.push(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } else { operationsStack.add(String.valueOf(c)); literal = ""; } } else if (c == ' ') { if (inLiteralStatus) { if (standardOperationSet.contains(literal)) { operationsStack.add(literal); } else if (vars.containsKey(literal)) { varStack.push(vars.get(literal)); } else { try { double con = Double.parseDouble(literal); varStack.push(new Const(con)); } catch (NumberFormatException nfe) { vars.put(literal, new Var(literal)); varStack.push(vars.get(literal)); } } inLiteralStatus = false; } literal = ""; } else { literal += c; inLiteralStatus = true; } previousChar = c; } //FIXME to logger plz //System.out.println("Function created successfully."); func = varStack.pop(); return new FunctionMV( func , vars ); } private void executeOperation(String op, Stack<Operation> varStack, Stack<String> operationsStack) { if (op.equals("+")) { /*String operation_will_destroyed; if (!operationsStack.empty()) { while (!(operation_will_destroyed = operationsStack.pop()).equals("(")) { executeOperation(operation_will_destroyed, varStack, operationsStack); } }*/ Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new Sum(arg2, arg1)); } else if (op.equals("-")) { Operation arg = varStack.pop(); varStack.push(new Neg(arg)); //if (!operationsStack.peek().equals("(")) { operationsStack.push("+"); //} } else if (op.equals("neg")) { Operation arg = varStack.pop(); varStack.push(new Neg(arg)); } else if (op.equals("*")) { Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new Mult(arg2, arg1)); } else if (op.equals("/")) { Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new Div(arg2, arg1)); } else if (op.equals("d")) { Operation arg = varStack.pop(); varStack.push(new Dif(arg)); } else if (op.equals("^")) { Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new Pow(arg2, arg1)); } else if (op.equals("ln")) { Operation arg1 = varStack.pop(); varStack.push(new Ln(arg1)); } else if (op.equals("exp")) { Operation arg1 = varStack.pop(); varStack.push(new Exp(arg1)); } else if (op.equals("sin")) { Operation arg1 = varStack.pop(); varStack.push(new Sin(arg1)); } else if (op.equals("cos")) { Operation arg1 = varStack.pop(); varStack.push(new Cos(arg1)); } else if (op.equals("<=")) { Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new LessOrEqual(arg2, arg1)); } else if (op.equals(">=")) { Operation arg1 = varStack.pop(); Operation arg2 = varStack.pop(); varStack.push(new GraterOrEqual(arg2, arg1)); } } private int priority(String s) { if (s.equals("-") || s.equals("neg") || s.equals("d") || s.equals("ln") || s.equals("exp") || s.equals("sin") || s.equals("cos")) return 1; else if (s.equals("^")) return 2; else if (s.equals("*") || s.equals("/")) return 3; else if (s.equals("(") || (s.equals("<=") || (s.equals(">=")))) return 5; else return 4; } }
[ "denis,[email protected]" ]
321445db05ce352cd1e4d06e21a8c68203e1f36e
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project20/src/main/java/org/gradle/test/performance20_2/Production20_181.java
6f010a4a5d600111cfe1e4428a861556d80e453d
[]
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
305
java
package org.gradle.test.performance20_2; public class Production20_181 extends org.gradle.test.performance10_2.Production10_181 { private final String property; public Production20_181() { this.property = "foo"; } public String getProperty() { return property; } }
142b4c8b51828d64ddf7135ec82d5e0b2c18d204
826d39527dfd5718ce116742389090bc664f720a
/src/controle/telas/CadastrarMateriaPrima.java
b66946325a9128b180b0e953f0144395c056cff8
[ "Apache-2.0" ]
permissive
jpsacheti/manufatura-controle
d2c2c65f58a8785560ff740002c20d31e91cc3a2
7343ba7dc7e5fd9214d350b2cb8f13d00b0d7f08
refs/heads/master
2020-09-17T18:46:01.061125
2016-11-19T03:08:17
2016-11-19T03:08:17
67,941,760
0
0
null
null
null
null
UTF-8
Java
false
false
2,617
java
package controle.telas; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Button; public abstract class CadastrarMateriaPrima { protected Shell shell; private Shell pai; protected Text txtNome; private Group grpDadosDaMatriaprima; private Label lblPreo; protected Spinner spinnerQuantidadeInicial; protected Button btnGravar; protected Button btnCancelar; protected Spinner spinnerPreco; protected Combo comboUnid; public CadastrarMateriaPrima(Shell pai) { this.pai = pai; createContents(); } private void createContents() { shell = new Shell(pai, SWT.DIALOG_TRIM); shell.setSize(428, 221); shell.setText("Cadastro de matéria prima"); shell.setLayout(null); grpDadosDaMatriaprima = new Group(shell, SWT.NONE); grpDadosDaMatriaprima.setText("Dados da matéria prima"); grpDadosDaMatriaprima.setBounds(10, 12, 397, 139); Label lblNome = new Label(grpDadosDaMatriaprima, SWT.NONE); lblNome.setBounds(0, 3, 75, 17); lblNome.setAlignment(SWT.RIGHT); lblNome.setText("Nome"); txtNome = new Text(grpDadosDaMatriaprima, SWT.BORDER); txtNome.setBounds(81, 0, 293, 22); lblPreo = new Label(grpDadosDaMatriaprima, SWT.NONE); lblPreo.setText("Pre\u00E7o"); lblPreo.setAlignment(SWT.RIGHT); lblPreo.setBounds(0, 29, 75, 17); spinnerPreco = new Spinner(grpDadosDaMatriaprima, SWT.BORDER); spinnerPreco.setDigits(2); spinnerPreco.setMaximum(99999999); spinnerPreco.setBounds(81, 26, 128, 22); Label lblUnidade = new Label(grpDadosDaMatriaprima, SWT.NONE); lblUnidade.setText("Unidade"); lblUnidade.setAlignment(SWT.RIGHT); lblUnidade.setBounds(0, 59, 75, 17); comboUnid = new Combo(grpDadosDaMatriaprima, SWT.NONE); comboUnid.setBounds(81, 54, 293, 22); Label lblQUantidade = new Label(grpDadosDaMatriaprima, SWT.NONE); lblQUantidade.setText("Estoque"); lblQUantidade.setAlignment(SWT.RIGHT); lblQUantidade.setBounds(0, 94, 75, 17); spinnerQuantidadeInicial = new Spinner(grpDadosDaMatriaprima, SWT.BORDER); spinnerQuantidadeInicial.setMaximum(99999999); spinnerQuantidadeInicial.setDigits(2); spinnerQuantidadeInicial.setBounds(81, 91, 128, 22); btnGravar = new Button(shell, SWT.NONE); btnGravar.setBounds(242, 157, 82, 27); btnGravar.setText("Gravar"); btnCancelar = new Button(shell, SWT.NONE); btnCancelar.setText("Cancelar"); btnCancelar.setBounds(334, 157, 82, 27); } }
2d605dc016190776b4bbd5b71abd2345e51f8933
148d94860974b2f1282eb791adb3630005eb3743
/pinyougou-dao/src/main/java/com/hdm/mapper/TbAddressMapper.java
174506e6cff1039cb79626ba1762fc47b0853453
[]
no_license
huangmo2017/pinyougou-parent
5866d39b16bdbf9adf06cb38606aa15a1bcce0f5
2efd28874617a2a1f9b262670e643417e6fa1d67
refs/heads/master
2023-02-02T13:42:53.173419
2020-12-19T14:10:23
2020-12-19T14:10:23
322,583,877
0
0
null
null
null
null
UTF-8
Java
false
false
848
java
package com.hdm.mapper; import com.hdm.pojo.TbAddress; import com.hdm.pojo.TbAddressExample; import org.apache.ibatis.annotations.Param; import java.util.List; public interface TbAddressMapper { int countByExample(TbAddressExample example); int deleteByExample(TbAddressExample example); int deleteByPrimaryKey(Long id); int insert(TbAddress record); int insertSelective(TbAddress record); List<TbAddress> selectByExample(TbAddressExample example); TbAddress selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") TbAddress record, @Param("example") TbAddressExample example); int updateByExample(@Param("record") TbAddress record, @Param("example") TbAddressExample example); int updateByPrimaryKeySelective(TbAddress record); int updateByPrimaryKey(TbAddress record); }
61fd59272786c093afe653e15d7523673553141b
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
/sources/p421m/C8011r.java
8973332e81df68b2d213e330b3c1dc268fa7df3b
[]
no_license
shalviraj/greenlens
1c6608dca75ec204e85fba3171995628d2ee8961
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
refs/heads/main
2023-04-20T13:50:14.619773
2021-04-26T15:45:11
2021-04-26T15:45:11
361,799,768
0
0
null
null
null
null
UTF-8
Java
false
false
10,283
java
package p421m; import androidx.core.app.NotificationCompat; import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; import java.util.concurrent.ExecutorService; import p298d.p344x.p346c.C6888i; import p421m.p422m0.p426g.C7887e; /* renamed from: m.r */ public final class C8011r { /* renamed from: a */ public ExecutorService f16079a; /* renamed from: b */ public final ArrayDeque<C7887e.C7888a> f16080b = new ArrayDeque<>(); /* renamed from: c */ public final ArrayDeque<C7887e.C7888a> f16081c = new ArrayDeque<>(); /* renamed from: d */ public final ArrayDeque<C7887e> f16082d = new ArrayDeque<>(); /* renamed from: a */ public final synchronized void mo25821a() { Iterator<C7887e.C7888a> it = this.f16080b.iterator(); while (it.hasNext()) { it.next().f15706i.mo25621f(); } Iterator<C7887e.C7888a> it2 = this.f16081c.iterator(); while (it2.hasNext()) { it2.next().f15706i.mo25621f(); } Iterator<C7887e> it3 = this.f16082d.iterator(); while (it3.hasNext()) { it3.next().mo25621f(); } } /* renamed from: b */ public final <T> void mo25822b(Deque<T> deque, T t) { synchronized (this) { if (!deque.remove(t)) { throw new AssertionError("Call wasn't in-flight!"); } } mo25824d(); } /* renamed from: c */ public final void mo25823c(C7887e.C7888a aVar) { C6888i.m12438e(aVar, NotificationCompat.CATEGORY_CALL); aVar.f15704g.decrementAndGet(); mo25822b(this.f16081c, aVar); } /* JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) at java.base/java.util.Objects.checkIndex(Objects.java:372) at java.base/java.util.ArrayList.get(ArrayList.java:458) at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619) at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619) at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561) at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133) at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86) at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:598) at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133) at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86) at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:49) */ /* renamed from: d */ public final boolean mo25824d() { /* r15 = this; byte[] r0 = p421m.p422m0.C7867c.f15619a java.util.ArrayList r0 = new java.util.ArrayList r0.<init>() monitor-enter(r15) java.util.ArrayDeque<m.m0.g.e$a> r1 = r15.f16080b // Catch:{ all -> 0x00f4 } java.util.Iterator r1 = r1.iterator() // Catch:{ all -> 0x00f4 } java.lang.String r2 = "readyAsyncCalls.iterator()" p298d.p344x.p346c.C6888i.m12437d(r1, r2) // Catch:{ all -> 0x00f4 } L_0x0013: boolean r2 = r1.hasNext() // Catch:{ all -> 0x00f4 } if (r2 == 0) goto L_0x004a java.lang.Object r2 = r1.next() // Catch:{ all -> 0x00f4 } m.m0.g.e$a r2 = (p421m.p422m0.p426g.C7887e.C7888a) r2 // Catch:{ all -> 0x00f4 } java.util.ArrayDeque<m.m0.g.e$a> r3 = r15.f16081c // Catch:{ all -> 0x00f4 } int r3 = r3.size() // Catch:{ all -> 0x00f4 } r4 = 64 if (r3 < r4) goto L_0x002a goto L_0x004a L_0x002a: java.util.concurrent.atomic.AtomicInteger r3 = r2.f15704g // Catch:{ all -> 0x00f4 } int r3 = r3.get() // Catch:{ all -> 0x00f4 } r4 = 5 if (r3 < r4) goto L_0x0034 goto L_0x0013 L_0x0034: r1.remove() // Catch:{ all -> 0x00f4 } java.util.concurrent.atomic.AtomicInteger r3 = r2.f15704g // Catch:{ all -> 0x00f4 } r3.incrementAndGet() // Catch:{ all -> 0x00f4 } java.lang.String r3 = "asyncCall" p298d.p344x.p346c.C6888i.m12437d(r2, r3) // Catch:{ all -> 0x00f4 } r0.add(r2) // Catch:{ all -> 0x00f4 } java.util.ArrayDeque<m.m0.g.e$a> r3 = r15.f16081c // Catch:{ all -> 0x00f4 } r3.add(r2) // Catch:{ all -> 0x00f4 } goto L_0x0013 L_0x004a: monitor-enter(r15) // Catch:{ all -> 0x00f4 } java.util.ArrayDeque<m.m0.g.e$a> r1 = r15.f16081c // Catch:{ all -> 0x00f1 } int r1 = r1.size() // Catch:{ all -> 0x00f1 } java.util.ArrayDeque<m.m0.g.e> r2 = r15.f16082d // Catch:{ all -> 0x00f1 } int r2 = r2.size() // Catch:{ all -> 0x00f1 } int r1 = r1 + r2 monitor-exit(r15) // Catch:{ all -> 0x00f4 } r2 = 0 if (r1 <= 0) goto L_0x005e r1 = 1 goto L_0x005f L_0x005e: r1 = r2 L_0x005f: monitor-exit(r15) int r3 = r0.size() r4 = r2 L_0x0065: if (r4 >= r3) goto L_0x00f0 java.lang.Object r5 = r0.get(r4) m.m0.g.e$a r5 = (p421m.p422m0.p426g.C7887e.C7888a) r5 monitor-enter(r15) java.util.concurrent.ExecutorService r6 = r15.f16079a // Catch:{ all -> 0x00ed } if (r6 != 0) goto L_0x00a4 java.util.concurrent.ThreadPoolExecutor r6 = new java.util.concurrent.ThreadPoolExecutor // Catch:{ all -> 0x00ed } r8 = 0 r9 = 2147483647(0x7fffffff, float:NaN) r10 = 60 java.util.concurrent.TimeUnit r12 = java.util.concurrent.TimeUnit.SECONDS // Catch:{ all -> 0x00ed } java.util.concurrent.SynchronousQueue r13 = new java.util.concurrent.SynchronousQueue // Catch:{ all -> 0x00ed } r13.<init>() // Catch:{ all -> 0x00ed } java.lang.StringBuilder r7 = new java.lang.StringBuilder // Catch:{ all -> 0x00ed } r7.<init>() // Catch:{ all -> 0x00ed } java.lang.String r14 = p421m.p422m0.C7867c.f15625g // Catch:{ all -> 0x00ed } r7.append(r14) // Catch:{ all -> 0x00ed } java.lang.String r14 = " Dispatcher" r7.append(r14) // Catch:{ all -> 0x00ed } java.lang.String r7 = r7.toString() // Catch:{ all -> 0x00ed } java.lang.String r14 = "name" p298d.p344x.p346c.C6888i.m12438e(r7, r14) // Catch:{ all -> 0x00ed } m.m0.b r14 = new m.m0.b // Catch:{ all -> 0x00ed } r14.<init>(r7, r2) // Catch:{ all -> 0x00ed } r7 = r6 r7.<init>(r8, r9, r10, r12, r13, r14) // Catch:{ all -> 0x00ed } r15.f16079a = r6 // Catch:{ all -> 0x00ed } L_0x00a4: java.util.concurrent.ExecutorService r6 = r15.f16079a // Catch:{ all -> 0x00ed } p298d.p344x.p346c.C6888i.m12436c(r6) // Catch:{ all -> 0x00ed } monitor-exit(r15) java.util.Objects.requireNonNull(r5) java.lang.String r7 = "executorService" p298d.p344x.p346c.C6888i.m12438e(r6, r7) m.m0.g.e r7 = r5.f15706i m.c0 r7 = r7.f15701v m.r r7 = r7.f15460g byte[] r7 = p421m.p422m0.C7867c.f15619a r6.execute(r5) // Catch:{ RejectedExecutionException -> 0x00c0 } goto L_0x00e0 L_0x00be: r0 = move-exception goto L_0x00e3 L_0x00c0: r6 = move-exception java.io.InterruptedIOException r7 = new java.io.InterruptedIOException // Catch:{ all -> 0x00be } java.lang.String r8 = "executor rejected" r7.<init>(r8) // Catch:{ all -> 0x00be } r7.initCause(r6) // Catch:{ all -> 0x00be } m.m0.g.e r6 = r5.f15706i // Catch:{ all -> 0x00be } r6.mo25627l(r7) // Catch:{ all -> 0x00be } m.g r6 = r5.f15705h // Catch:{ all -> 0x00be } m.m0.g.e r8 = r5.f15706i // Catch:{ all -> 0x00be } r6.mo10630b(r8, r7) // Catch:{ all -> 0x00be } m.m0.g.e r6 = r5.f15706i m.c0 r6 = r6.f15701v m.r r6 = r6.f15460g r6.mo25823c(r5) L_0x00e0: int r4 = r4 + 1 goto L_0x0065 L_0x00e3: m.m0.g.e r1 = r5.f15706i m.c0 r1 = r1.f15701v m.r r1 = r1.f15460g r1.mo25823c(r5) throw r0 L_0x00ed: r0 = move-exception monitor-exit(r15) throw r0 L_0x00f0: return r1 L_0x00f1: r0 = move-exception monitor-exit(r15) // Catch:{ all -> 0x00f4 } throw r0 // Catch:{ all -> 0x00f4 } L_0x00f4: r0 = move-exception monitor-exit(r15) throw r0 */ throw new UnsupportedOperationException("Method not decompiled: p421m.C8011r.mo25824d():boolean"); } }
7e9b6ebad90275f8a272580a4eb30545c7fd09ba
e1d7eee2e02b1ecbd9e86ac1418b37698f2b25f3
/src/main/java/com/samupra/designpatterns/creation/abstractfactory/Main.java
9fb6741de05e7740936d795a6ee24963718b83a2
[ "MIT" ]
permissive
samupra/design-patterns-java
97e72381fe17ccecfc967a485c407c5f28648e38
2bde71b1df2f16cbe1a0077b593067671b6331d0
refs/heads/master
2020-03-22T16:17:12.464448
2018-07-14T07:17:47
2018-07-14T07:17:47
140,316,208
0
0
null
null
null
null
UTF-8
Java
false
false
689
java
package com.samupra.designpatterns.creation.abstractfactory; public class Main { enum FactoryType { PM_FACTORY, MOTIF_FACTORY } public static void main(String args[]){ FactoryType factoryType = FactoryType.valueOf(args[0].toUpperCase()); WidgetFactory widgetFactory; if(factoryType == FactoryType.MOTIF_FACTORY){ widgetFactory = new MotifWidgetFactory(); } else { widgetFactory = new PMWidgetFactory(); } ScrollBar scrollBar = widgetFactory.createScrollBar(); Window window = widgetFactory.createWindow(); scrollBar.printIdentity(); window.printIdentity(); } }
d222438360a403aaeb72ff61a1f2dbf2798fcd4a
869b608fae2770719dc37d6d01b557c1cc5300f9
/Customer.java
b5b543b145ffcdcbe72411203e9b3a8a13d911e9
[]
no_license
karmasherpa/Simulator
1ebeb84d4222a73c50fe49fdfdc24db6c348930a
017f6a04889eb9f6da6af4633c015dddd8df3e1f
refs/heads/master
2022-04-27T01:53:22.230207
2020-04-26T01:59:56
2020-04-26T01:59:56
258,916,104
0
0
null
null
null
null
UTF-8
Java
false
false
1,926
java
public class Customer extends Thread { private int customerNumber = 0; private Tellers tellers; private int avgServiceTime; public Customer(Tellers tellers, int avgServiceTime) { this.tellers = tellers; this.avgServiceTime = avgServiceTime; } @Override public void run() { int customerArrivalTime = generateCustomer(); int waitEndTime = waitInQueue(); serveCustomer(); Statistics.updateTotalWaitTime(waitEndTime - customerArrivalTime); } // Arrival of customer private int generateCustomer() { customerNumber = Statistics.getNextCustomerNumber(); int customerArrivalTime = Statistics.getEnvironmentTime() * 10; System.out.println("At time " + customerArrivalTime + ", customer " + customerNumber + " arrives in line"); return customerArrivalTime; } // Customer tries to acquire the semaphore in the Teller class private int waitInQueue() { // This call is blocking. As soon as the semaphore is acquired, customer starts being served tellers.getTeller(); int waitEndTime = Statistics.getEnvironmentTime() * 10; System.out.println("At time " + waitEndTime + ", customer " + customerNumber + " starts being served"); return waitEndTime; } private void serveCustomer() { try { // Service the customer based upon average service time Thread.sleep(Random_Int_Mean.random_int(avgServiceTime) * 1000); } catch (InterruptedException e) { e.printStackTrace(); } // After the customer is served, he releases the semaphore in Teller class and leaves the bank tellers.releaseTeller(); int serviceEndTime = Statistics.getEnvironmentTime() * 10; System.out.println("At time " + serviceEndTime + ", customer " + customerNumber + " leaves the bank"); } }
f7d5810b8961be38026811fd4adfa41af79054ca
e27d900485b7473e0b79fbe5df7a7ac889266e6c
/wx-client/src/main/java/cn/xco2o/cloud/wx/push/WxPush.java
f7b2cc2564a9fa6c5be5fe91b7084c992c8ccbeb
[]
no_license
clovedin/xco2o-cloud
2845ae780c796f8fcad27422043644b29e8c0550
7c5c2e0dd4a5539ef1cc7e3ccaaf603e3a4b0152
refs/heads/master
2021-01-24T19:23:34.235661
2017-09-05T13:49:40
2017-09-05T13:49:40
82,793,090
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package cn.xco2o.cloud.wx.push; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public class WxPush { @JacksonXmlProperty(localName="ToUserName") private String toUserName; @JacksonXmlProperty(localName="FromUserName") private String fromUserName; @JacksonXmlProperty(localName="CreateTime") private Long createTime; @JacksonXmlProperty(localName="MsgType") private String msgType; @JacksonXmlProperty(localName="Event") private String event; @JacksonXmlProperty(localName="EventKey") private String eventKey; public String getToUserName() { return toUserName; } public void setToUserName(String toUserName) { this.toUserName = toUserName; } public String getFromUserName() { return fromUserName; } public void setFromUserName(String fromUserName) { this.fromUserName = fromUserName; } public Long getCreateTime() { return createTime; } public void setCreateTime(Long createTime) { this.createTime = createTime; } public String getMsgType() { return msgType; } public void setMsgType(String msgType) { this.msgType = msgType; } public String getEvent() { return event; } public void setEvent(String event) { this.event = event; } public String getEventKey() { return eventKey; } public void setEventKey(String eventKey) { this.eventKey = eventKey; } }
5d4d0b1b14e2f026fe8a6fd2a42622ef21331bb1
27b218d245095f7cb51da14b7540b96a7cc873bc
/GestionAbsences/GestionAbsences/src/main/java/org/example/DAO/SpecialiteDao.java
704d227ef56708fe8b099b92c17015c589079e3a
[]
no_license
Fatima-Ezzahra-Zahid/Gestion-d-absence
117e4d96ed73593279ddd29dd981d53169c6e8fd
9e9a441e2b77b5c53cdbbc784ee190de8210ff9c
refs/heads/main
2023-03-04T10:41:15.476031
2021-02-11T14:00:54
2021-02-11T14:00:54
329,278,700
0
4
null
2021-02-09T22:23:59
2021-01-13T10:56:04
Mercury
UTF-8
Java
false
false
771
java
package org.example.DAO; import javafx.collections.ObservableList; import org.example.Model.Specialite; import java.sql.SQLException; import java.util.List; public interface SpecialiteDao { public List<Specialite> getAll() throws ClassNotFoundException, SQLException; public Specialite getById(int id) throws ClassNotFoundException, SQLException; public Specialite SaveSpecialite( String nomSpecialite, int nbrCompetence) throws ClassNotFoundException, SQLException; public void updateSpecialite( String nomSpecialite, int nbrCompetence , int id)throws ClassNotFoundException, SQLException; public void deleteById(String Specialite) throws ClassNotFoundException, SQLException; public ObservableList<Specialite> AfficheSpecialite(); }
1911781239f86bd37ca5f3881874e30550357aed
d6920bff5730bf8823315e15b0858c68a91db544
/android/ftsafe_0.7.04_source_from_jdcore/gnu/q2/lang/Q2Translator.java
ca7d2c6e89f1923c4b2004b250e65f8cc99ce3d9
[]
no_license
AppWerft/Ti.FeitianSmartcardReader
f862f9a2a01e1d2f71e09794aa8ff5e28264e458
48657e262044be3ae8b395065d814e169bd8ad7d
refs/heads/master
2020-05-09T10:54:56.278195
2020-03-17T08:04:07
2020-03-17T08:04:07
181,058,540
2
0
null
null
null
null
UTF-8
Java
false
false
6,929
java
package gnu.q2.lang; import gnu.expr.ApplyExp; import gnu.expr.Declaration; import gnu.expr.Expression; import gnu.expr.IfExp; import gnu.expr.LetExp; import gnu.expr.QuoteExp; import gnu.expr.ReferenceExp; import gnu.lists.LList; import gnu.lists.Pair; import java.util.ArrayList; import java.util.Stack; import kawa.lang.Translator; import kawa.standard.SchemeCompilation; public class Q2Translator extends SchemeCompilation { public Q2Translator(gnu.expr.Language language, gnu.text.SourceMessages messages, gnu.expr.NameLookup lexical) { super(language, messages, lexical); } public static Object partition(Object p, Translator tr) { Stack st = new Stack(); st.add(Operator.FENCE); Object larg = p; Pair prev = null; for (;;) { if ((p instanceof kawa.lang.SyntaxForm)) {} Operator op = null; Pair pp; Pair pp; if (!(p instanceof Pair)) { op = Operator.FENCE; pp = null; } else { pp = (Pair)p; Object obj = pp.getCar(); if (((obj instanceof gnu.mapping.Symbol)) && (!Q2.instance.selfEvaluatingSymbol(obj))) { Expression func = tr.rewrite(obj, true); Declaration decl; Object value; if (((func instanceof ReferenceExp)) && ((decl = ((ReferenceExp)func).getBinding()) != null) && (((value = decl.getConstantValue()) instanceof Operator))) { op = (Operator)value; } } } if (op != null) { if (prev == null) { larg = LList.Empty; } else if ((p instanceof Pair)) prev.setCdrBackdoor(LList.Empty); int stsz = st.size(); Operator topop = (Operator)st.get(stsz - 1); while (lprio <= rprio) { gnu.lists.PairWithPosition oppair = (gnu.lists.PairWithPosition)st.get(stsz - 2); if (((flags & 0x2) != 0) && (larg == LList.Empty)) { tr.error('e', "missing right operand after " + topop.getName(), oppair); } larg = topop.combine((LList)st.get(stsz - 3), larg, oppair); stsz -= 3; st.setSize(stsz); topop = (Operator)st.get(stsz - 1); } if (pp == null) break; st.add(larg); st.add(pp); st.add(op); larg = pp.getCdr(); prev = null; } else { prev = pp; } p = pp.getCdr(); } return larg; } public Expression makeBody(Expression[] exps) { int nlen = exps.length; for (int i = 0; i < nlen - 1; i++) { Expression exp = exps[i]; if ((exp instanceof IfExp)) { IfExp iexp = (IfExp)exp; if (iexp.getElseClause() == null) { Expression[] rest = new Expression[nlen - i - 1]; System.arraycopy(exps, i + 1, rest, 0, rest.length); iexp = new IfExp(iexp.getTest(), iexp.getThenClause(), makeBody(rest)); iexp.setLine(exp); if (i == 0) return iexp; Expression[] init = new Expression[i + 1]; System.arraycopy(exps, 0, init, 0, i); init[i] = iexp; return super.makeBody(init); } } } return super.makeBody(exps); } public void scanForm(Object st, gnu.expr.ScopeExp defs) { if ((st instanceof LList)) st = partition(st, this); if (st != LList.Empty) { super.scanForm(st, defs); } } public Expression rewrite(Object exp, boolean function) { if (exp == LList.Empty) return QuoteExp.voidExp; return super.rewrite(exp, function); } public Expression rewrite_pair(Pair p, boolean function) { Object partitioned = partition(p, this); if ((partitioned instanceof Pair)) { Pair pair = (Pair)partitioned; Object p_car = pair.getCar(); if (((p_car instanceof Pair)) && (((Pair)p_car).getCar() == gnu.kawa.lispexpr.LispLanguage.splice_sym)) { return new ApplyExp(gnu.kawa.functions.MakeSplice.quoteInstance, new Expression[] { rewrite_car((Pair)((Pair)p_car).getCdr(), function) }); } Expression exp = super.rewrite_pair(pair, function); ApplyExp app; if (((exp instanceof ApplyExp)) && (isApplyFunction((app = (ApplyExp)exp).getFunction()))) { exp = convertApply(app); } return exp; } return rewrite(partitioned, function); } public static boolean applyNullary(Expression exp) { if ((exp instanceof ReferenceExp)) { Declaration decl = Declaration.followAliases(((ReferenceExp)exp).getBinding()); if (decl != null) { if (decl.isProcedureDecl()) return true; if ((decl.getFlag(2048L)) && (decl.getFlag(16384L))) { gnu.bytecode.Type type = decl.getType(); if ("gnu.kawa.lispexpr.LangObjType" == type.getName()) return true; } } } if ((exp instanceof QuoteExp)) { Object val = exp.valueIfConstant(); return ((val instanceof gnu.bytecode.Type)) || ((val instanceof Class)); } return false; } public static Expression convertApply(ApplyExp exp) { Expression[] args = exp.getArgs(); int nargs = args.length; Expression arg0 = args[0]; if ((nargs == 1) && (!applyNullary(arg0))) { if (((arg0 instanceof IfExp)) && (((IfExp)arg0).getElseClause() == null)) { arg0 = new gnu.expr.BeginExp(args); } return arg0; } ArrayList<Expression> rargs = new ArrayList(); LetExp let = null; for (int i = 0; i < nargs; i++) { Expression arg = exp.getArg(i); Expression barg; Expression barg; if (((arg instanceof LetExp)) && (arg.getFlag(2)) && (let == null)) { barg = ((LetExp)arg).getBody(); } else barg = arg; if ((barg instanceof ApplyExp)) { ApplyExp aarg = (ApplyExp)barg; if (aarg.isAppendValues()) { if (arg != barg) let = (LetExp)arg; int naarg = aarg.getArgCount(); for (int j = 0; j < naarg; j++) { Expression xaarg = aarg.getArg(j); if ((xaarg instanceof gnu.expr.SetExp)) { xaarg = new ApplyExp(gnu.kawa.functions.MakeSplice.quoteInstance, new Expression[] { new gnu.expr.BeginExp(xaarg, QuoteExp.emptyExp) }); if ((firstSpliceArg == -1) || (firstSpliceArg > j)) { firstSpliceArg = j; } } rargs.add(xaarg); } continue; } } rargs.add(arg); } args = (Expression[])rargs.toArray(new Expression[rargs.size()]); gnu.mapping.Procedure proc = kawa.standard.Scheme.applyToArgs; exp.setFuncArgs(new QuoteExp(proc), args); if (let != null) { let.setBody(exp); return let; } return exp; } }
[ "“[email protected]“" ]
5404f3ca8a3120f231c7f6356a2c7e0e98ac029d
b889de8505e9d5b1fb08d06dbcd3df1366f944cc
/ReverseSplit.java
b84990a7b06dafaee74341f27bf023cdf7bb6bfb
[]
no_license
KimonnAravind/ReverseSplit
1eda6460dd43b3f6336ed4f428e60bce581f93f9
384379f1b5abfdd16530bff30b010e5ec944f5c4
refs/heads/master
2020-11-30T11:24:05.190975
2019-12-27T06:36:32
2019-12-27T06:36:32
230,387,374
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
import java.util.Scanner; public class ReverseSplit { public static void main(String[] args) { String str; Scanner in = new Scanner(System.in); System.out.println("Enter your String"); str = in.nextLine(); String[] token = str.split(""); for(int i=token.length-1; i>=0; i--) { System.out.print(token[i] + ""); } } }
0a5b7fd2897f6e608190906f5b02dc3cf8fc4233
f25da920c53c654d59f2adddfcb41d8abf81accb
/src/main/java/com/project/demoproject/model/Book.java
30b1ba3c30bfcdf221049303236be31f730b8f4d
[]
no_license
tejpolavarapu/Spring
a58bc23582b21154765b87a97345215488e2062f
90d138e0242cd33d054f46622d0c660a8fb99328
refs/heads/master
2020-12-12T21:47:09.045461
2020-01-16T04:43:31
2020-01-16T04:43:31
234,236,923
0
0
null
null
null
null
UTF-8
Java
false
false
2,278
java
package com.project.demoproject.model; import javax.persistence.*; import java.util.HashSet; import java.util.Objects; import java.util.Set; @Entity public class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String title; private String isbn; private String publisher; @ManyToMany @JoinTable(name = "author_book", joinColumns = @JoinColumn(name = "book_id"), inverseJoinColumns = @JoinColumn(name = " author_id")) private Set<Author> authors = new HashSet<>(); public Book() { } public Book(String title, String isbn, String publisher, Set<Author> authors) { this.title = title; this.isbn = isbn; this.publisher = publisher; this.authors = authors; } public Book(String title, String isbn, String publisher) { this.title = title; this.isbn = isbn; this.publisher = publisher; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getIsbn() { return isbn; } public void setIsbn(String isbn) { this.isbn = isbn; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public Set<Author> getAuthors() { return authors; } public void setAuthors(Set<Author> authors) { this.authors = authors; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Book book = (Book) o; return Objects.equals(id, book.id); } @Override public int hashCode() { return Objects.hash(id); } @Override public String toString() { return "Book{" + "id=" + id + ", title='" + title + '\'' + ", isbn='" + isbn + '\'' + ", publisher='" + publisher + '\'' + ", authors=" + authors + '}'; } }
7324bc5b365041f2dce2f738440f85c1ac35b377
fd45ab5ff5216e39794e0d52eb9daaf7d654bfac
/src/objects/DataObject.java
1c40ea9d6623e363e5eb81b511e4b69c867f3fc9
[]
no_license
loglamo/K-centersForClusteringGenes
956c4dcfc7828cb3c24f11d2ef78caa8bd829703
1476a6aaaed414a7b9d18645391b4119715cd544
refs/heads/master
2021-01-21T22:00:48.346926
2017-06-22T18:00:29
2017-06-22T18:00:29
95,140,696
0
0
null
null
null
null
UTF-8
Java
false
false
3,440
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 objects; import java.util.ArrayList; import objects.Feature; import readfile.ReadFile; /** * * @author LA */ public class DataObject { ArrayList decodeOfSet = decodeDataObject(); //chuyen moi xau gen thanh arraylist; public static ArrayList changeGene(String gene){ ArrayList newGene = new ArrayList(); for(int i=0;i < gene.length();i++){ newGene.add(gene.charAt(i)); } return newGene; } //chuyen toa do tung dong dataobject; public static ArrayList decodeALine(ArrayList list){ ArrayList feature = Feature.findFeature(); ArrayList codeALine = new ArrayList(); for(int i=0;i < list.size();i++){ ArrayList code = new ArrayList(); for(int k=0;k < feature.size();k++){ if(list.get(i) == feature.get(k))code.add(1); else code.add(0); } codeALine.add(code); } return codeALine; } //chuyen toa do tat ca cac dong; public static ArrayList decodeDataObject(){ String[] geneSet = Feature.changeSetToArray(); ArrayList set = ReadFile.readFile(); int a = set.size(); ArrayList decodeOfSet = new ArrayList(); for(int i=0;i < a;i++){ ArrayList line = changeGene(geneSet[i]); ArrayList decodeOfLine = decodeALine(line); decodeOfSet.add(decodeOfLine); } return decodeOfSet; } /* public static void main(String args[]){ ArrayList dataobject = decodeDataObject(); System.out.println(dataobject);*/ } /* public static String[] decode(char s){ ArrayList geneSet = Feature.getgeneSet();//tap gen String[] arrayOfString = Feature.changeSetToArray();//mang cac gen int a = arrayOfString[0].length();//do dai moi gen String[] featureString = changeFeatureList(); int l = featureString.length; String code = new String(); for(int k=0;k < l;k++){ if(s == featureString[k].charAt(0))code.charAt(k)= '0'; } } //public ArrayList decodeDataObject(){ //int a = geneSet.size(); //String[] arrayOfString = Feature.changeSetToArray(); //for(int i=0;i < geneSet.size();i++){ /*public String decode(char b){ String[] arrayOfString = Feature.changeSetToArray(); String decode = null; ArrayList feature = Feature.findFeature(); for(int i = 0;i < arrayOfString[0].length();i++){ for(int e=0;e < feature.size();e++){ if(arrayOfString[0].charAt(i) == feature.get(e))decode.charAt(e) == '1'; else decode.charAt(e) == '0'; } } return decode; } } public static void main(String args[]){ String[] dataObject = new String[200]; for(int m = 0;m < arrayOfString[0].length();m++){ dataObject[m] = decode(arrayOfString[0].charAt(m)); } arrayOfString.put(dataObject); } } }*/
bb3ba84d079c9021f6a1cd6bc45b84e0ed3528b1
da6b61bd46e9ad1b80d890b933f4dbe70a57e186
/src/test/java/com/demo/web/EmployeeControllerTest.java
7de52c0cbe3a6059379b8d787d639de6b02dc44b
[]
no_license
SatishMHiremath/SpringBootH2Integration
30c63a169ab0bfd21caf7862ac9b1c46fcd73177
ad3e2c2098adc5869c284ec3e94a4b546804e26d
refs/heads/master
2023-04-14T10:25:13.871969
2023-03-27T10:31:16
2023-03-27T10:31:16
106,277,057
0
0
null
null
null
null
UTF-8
Java
false
false
6,706
java
package com.demo.web; import static org.mockito.Mockito.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.when; import com.demo.exception.RecordNotFoundException; import com.demo.model.EmployeeEntity; import com.demo.service.EmployeeService; import java.util.ArrayList; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; @ContextConfiguration(classes = {EmployeeController.class}) @RunWith(SpringJUnit4ClassRunner.class) public class EmployeeControllerTest { @Autowired private EmployeeController employeeController; @MockBean private EmployeeService employeeService; /** * Method under test: {@link EmployeeController#getEmployeeById(Long)} */ @Test public void testGetEmployeeById() throws Exception { EmployeeEntity employeeEntity = new EmployeeEntity(); employeeEntity.setEmail("[email protected]"); employeeEntity.setFirstName("Jane"); employeeEntity.setId(1L); employeeEntity.setLastName("Doe"); when(employeeService.getEmployeeById((Long) any())).thenReturn(employeeEntity); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/employees/{id}", 1L); MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json;charset=UTF-8")) .andExpect(MockMvcResultMatchers.content() .string("{\"id\":1,\"firstName\":\"Jane\",\"lastName\":\"Doe\",\"email\":\"[email protected]\"}")); } /** * Method under test: {@link EmployeeController#getEmployeeById(Long)} */ @Test public void testGetEmployeeById2() throws Exception { when(employeeService.getEmployeeById((Long) any())).thenThrow(new RecordNotFoundException("An error occurred")); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/employees/{id}", 1L); ResultActions actualPerformResult = MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(requestBuilder); actualPerformResult.andExpect(MockMvcResultMatchers.status().isNotFound()); } /** * Method under test: {@link EmployeeController#createOrUpdateEmployee(EmployeeEntity)} */ @Test public void testCreateOrUpdateEmployee() throws Exception { when(employeeService.getAllEmployees()).thenReturn(new ArrayList<>()); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/employees"); MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json;charset=UTF-8")) .andExpect(MockMvcResultMatchers.content().string("[]")); } /** * Method under test: {@link EmployeeController#deleteEmployeeById(Long)} */ @Test public void testDeleteEmployeeById() throws Exception { doNothing().when(employeeService).deleteEmployeeById((Long) any()); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.delete("/employees/{id}", 1L); MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json;charset=UTF-8")) .andExpect(MockMvcResultMatchers.content().string("\"FORBIDDEN\"")); } /** * Method under test: {@link EmployeeController#deleteEmployeeById(Long)} */ @Test public void testDeleteEmployeeById2() throws Exception { doThrow(new RecordNotFoundException("An error occurred")).when(employeeService).deleteEmployeeById((Long) any()); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.delete("/employees/{id}", 1L); ResultActions actualPerformResult = MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(requestBuilder); actualPerformResult.andExpect(MockMvcResultMatchers.status().isNotFound()); } /** * Method under test: {@link EmployeeController#deleteEmployeeById(Long)} */ @Test public void testDeleteEmployeeById3() throws Exception { doNothing().when(employeeService).deleteEmployeeById((Long) any()); MockHttpServletRequestBuilder deleteResult = MockMvcRequestBuilders.delete("/employees/{id}", 1L); deleteResult.characterEncoding("Encoding"); MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(deleteResult) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json;charset=UTF-8")) .andExpect(MockMvcResultMatchers.content().string("\"FORBIDDEN\"")); } /** * Method under test: {@link EmployeeController#createOrUpdateEmployee(EmployeeEntity)} */ @Test public void testCreateOrUpdateEmployee2() throws Exception { when(employeeService.getAllEmployees()).thenReturn(new ArrayList<>()); MockHttpServletRequestBuilder getResult = MockMvcRequestBuilders.get("/employees"); getResult.characterEncoding("Encoding"); MockMvcBuilders.standaloneSetup(employeeController) .build() .perform(getResult) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json;charset=UTF-8")) .andExpect(MockMvcResultMatchers.content().string("[]")); } }
374ec7a796a3a0882351ea418a6195e5a3d06d7d
11a3b619e0a50f8d3bff9f6fce2de8c584c2993c
/work/work/Catalina/localhost/tour/org/apache/jsp/tag/web/util/newToday_tag.java
2e6a957b1667178ed82a0337da2e0a02c99b1d44
[]
no_license
grayblu/dynamicweb
179c83aa63808e661e7b1747f42fa622dcd7b67b
0498ce82252716e2a38b7db0644e64e951db8e63
refs/heads/master
2020-04-29T02:50:10.741673
2019-04-30T09:32:25
2019-04-30T09:32:25
175,785,247
0
0
null
null
null
null
UTF-8
Java
false
false
13,063
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/8.5.38 * Generated at: 2019-03-18 00:36:38 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.tag.web.util; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class newToday_tag extends javax.servlet.jsp.tagext.SimpleTagSupport implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; static { _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(3); _jspx_dependants.put("/WEB-INF/lib/jstl-1.2.jar", Long.valueOf(1552641747763L)); _jspx_dependants.put("jar:file:/C:/dynamicweb/work/wtpwebapps/tour/WEB-INF/lib/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153352682000L)); _jspx_dependants.put("jar:file:/C:/dynamicweb/work/wtpwebapps/tour/WEB-INF/lib/jstl-1.2.jar!/META-INF/fmt.tld", Long.valueOf(1153352682000L)); } private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = null; } private javax.servlet.jsp.JspContext jspContext; private java.io.Writer _jspx_sout; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public void setJspContext(javax.servlet.jsp.JspContext ctx) { super.setJspContext(ctx); java.util.ArrayList _jspx_nested = null; java.util.ArrayList _jspx_at_begin = null; java.util.ArrayList _jspx_at_end = null; this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(this, ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null); } public javax.servlet.jsp.JspContext getJspContext() { return this.jspContext; } private java.util.Date test; public java.util.Date getTest() { return this.test; } public void setTest(java.util.Date test) { this.test = test; jspContext.setAttribute("test", test); } public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { return _jsp_instancemanager; } private void _jspInit(javax.servlet.ServletConfig config) { _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config); _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config); _el_expressionfactory = _jspxFactory.getJspApplicationContext(config.getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(config); } public void _jspDestroy() { _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody.release(); _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); } public void doTag() throws javax.servlet.jsp.JspException, java.io.IOException { javax.servlet.jsp.PageContext _jspx_page_context = (javax.servlet.jsp.PageContext)jspContext; javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) _jspx_page_context.getRequest(); javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse) _jspx_page_context.getResponse(); javax.servlet.http.HttpSession session = _jspx_page_context.getSession(); javax.servlet.ServletContext application = _jspx_page_context.getServletContext(); javax.servlet.ServletConfig config = _jspx_page_context.getServletConfig(); javax.servlet.jsp.JspWriter out = jspContext.getOut(); _jspInit(config); jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,jspContext); if( getTest() != null ) _jspx_page_context.setAttribute("test", getTest()); try { out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); // fmt:formatDate org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag _jspx_th_fmt_005fformatDate_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag) _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag.class); boolean _jspx_th_fmt_005fformatDate_005f0_reused = false; try { _jspx_th_fmt_005fformatDate_005f0.setPageContext(_jspx_page_context); _jspx_th_fmt_005fformatDate_005f0.setParent(new javax.servlet.jsp.tagext.TagAdapter((javax.servlet.jsp.tagext.SimpleTag) this )); // /WEB-INF/tags/util/newToday.tag(6,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f0.setVar("today"); // /WEB-INF/tags/util/newToday.tag(6,0) name = pattern type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f0.setPattern("yyyy-MM-dd"); // /WEB-INF/tags/util/newToday.tag(6,0) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f0.setValue(new java.util.Date() ); int _jspx_eval_fmt_005fformatDate_005f0 = _jspx_th_fmt_005fformatDate_005f0.doStartTag(); if (_jspx_th_fmt_005fformatDate_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { throw new javax.servlet.jsp.SkipPageException(); } _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody.reuse(_jspx_th_fmt_005fformatDate_005f0); _jspx_th_fmt_005fformatDate_005f0_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_fmt_005fformatDate_005f0, _jsp_getInstanceManager(), _jspx_th_fmt_005fformatDate_005f0_reused); } out.write('\r'); out.write('\n'); if (_jspx_meth_fmt_005fformatDate_005f1(_jspx_page_context)) return; out.write('\r'); out.write('\n'); if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return; } catch( java.lang.Throwable t ) { if( t instanceof javax.servlet.jsp.SkipPageException ) throw (javax.servlet.jsp.SkipPageException) t; if( t instanceof java.io.IOException ) throw (java.io.IOException) t; if( t instanceof java.lang.IllegalStateException ) throw (java.lang.IllegalStateException) t; if( t instanceof javax.servlet.jsp.JspException ) throw (javax.servlet.jsp.JspException) t; throw new javax.servlet.jsp.JspException(t); } finally { jspContext.getELContext().putContext(javax.servlet.jsp.JspContext.class,super.getJspContext()); ((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile(); _jspDestroy(); } } private boolean _jspx_meth_fmt_005fformatDate_005f1(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // fmt:formatDate org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag _jspx_th_fmt_005fformatDate_005f1 = (org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag) _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag.class); boolean _jspx_th_fmt_005fformatDate_005f1_reused = false; try { _jspx_th_fmt_005fformatDate_005f1.setPageContext(_jspx_page_context); _jspx_th_fmt_005fformatDate_005f1.setParent(new javax.servlet.jsp.tagext.TagAdapter((javax.servlet.jsp.tagext.SimpleTag) this )); // /WEB-INF/tags/util/newToday.tag(8,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f1.setVar("testDay"); // /WEB-INF/tags/util/newToday.tag(8,0) name = pattern type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f1.setPattern("yyyy-MM-dd"); // /WEB-INF/tags/util/newToday.tag(8,0) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f1.setValue((java.util.Date) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${test}", java.util.Date.class, (javax.servlet.jsp.PageContext)this.getJspContext(), null)); int _jspx_eval_fmt_005fformatDate_005f1 = _jspx_th_fmt_005fformatDate_005f1.doStartTag(); if (_jspx_th_fmt_005fformatDate_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { throw new javax.servlet.jsp.SkipPageException(); } _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvar_005fvalue_005fpattern_005fnobody.reuse(_jspx_th_fmt_005fformatDate_005f1); _jspx_th_fmt_005fformatDate_005f1_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_fmt_005fformatDate_005f1, _jsp_getInstanceManager(), _jspx_th_fmt_005fformatDate_005f1_reused); } return false; } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); boolean _jspx_th_c_005fif_005f0_reused = false; try { _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent(new javax.servlet.jsp.tagext.TagAdapter((javax.servlet.jsp.tagext.SimpleTag) this )); // /WEB-INF/tags/util/newToday.tag(9,0) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${today==testDay }", boolean.class, (javax.servlet.jsp.PageContext)this.getJspContext(), null)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write("\t<span class=\"badge badge-pill badge-danger\">\r\n"); out.write("\t\t<i class=\"fas fa-tag\"></i> New\r\n"); out.write("\t</span>\r\n"); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { throw new javax.servlet.jsp.SkipPageException(); } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); _jspx_th_c_005fif_005f0_reused = true; } finally { org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_c_005fif_005f0, _jsp_getInstanceManager(), _jspx_th_c_005fif_005f0_reused); } return false; } }
f63b374fe05a746a09d6877ca7862fcf1595a7b6
2bdcc43e435468f915da01bf4ca4bfda5e93af29
/src/main/java/com/md/liveroom/Mp4Creator.java
378bd189a72c86906207b9289e67c078cde5d2b6
[]
no_license
ttytt1978/gimbridge
86c46e9615bca4c039a4525fbd72f436bd13e6d0
94e07ab04cad51e1697c66a774cf53fc7c8fdf54
refs/heads/master
2023-07-16T03:21:33.611347
2021-09-01T08:42:23
2021-09-01T08:42:23
397,049,325
0
0
null
null
null
null
UTF-8
Java
false
false
5,296
java
package com.md.liveroom; import org.bytedeco.javacpp.avcodec; import org.bytedeco.javacpp.avutil; import org.bytedeco.javacv.*; public class Mp4Creator { private String streamPushPath; private String mp4FilePath; private boolean exit; private Runnable worker; private FFmpegFrameGrabber grabber; private FFmpegFrameRecorder recorder; public Mp4Creator(String streamPushPath, String mp4FilePath) { this.streamPushPath = streamPushPath; this.mp4FilePath = mp4FilePath; } public void start() { exit=false; if(worker!=null) return; worker=createWorker(); new Thread(worker).start(); } public void stop() { exit=true; } private Runnable createWorker() { return new Runnable(){ @Override public void run() { grabber=new FFmpegFrameGrabber(streamPushPath); int audioChannels=1; int sampleRate=48000; grabber.setAudioChannels(audioChannels); grabber.setSampleRate(sampleRate); grabber.setFrameRate(30); try { grabber.start(); } catch (FrameGrabber.Exception e) { e.printStackTrace(); } recorder = new FFmpegFrameRecorder(mp4FilePath, 400, 300); // recorder.setInterleaved(true); recorder.setFormat("mp4"); recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264); //avcodec.AV_CODEC_ID_H264 //AV_CODEC_ID_MPEG4 recorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC); recorder.setFrameRate(30); recorder.setVideoBitrate(3*1024*1024); recorder.setVideoOption("tune", "zerolatency"); // recorder.setVideoOption("qp", "0"); /** * 权衡quality(视频质量)和encode speed(编码速度) values(值): * ultrafast(终极快),superfast(超级快), veryfast(非常快), faster(很快), fast(快), * medium(中等), slow(慢), slower(很慢), veryslow(非常慢) * ultrafast(终极快)提供最少的压缩(低编码器CPU)和最大的视频流大小;而veryslow(非常慢)提供最佳的压缩(高编码器CPU)的同时降低视频流的大小 * 参考:https://trac.ffmpeg.org/wiki/Encode/H.264 官方原文参考:-preset ultrafast * as the name implies provides for the fastest possible encoding. If * some tradeoff between quality and encode speed, go for the speed. * This might be needed if you are going to be transcoding multiple * streams on one machine. */ recorder.setVideoOption("preset", "ultrafast"); // recorder.setVideoCodecName("h264_amf"); // 不可变(固定)音频比特率 // recorder.setAudioOption("crf", "0"); // 最高质量 // recorder.setAudioQuality(0); // 音频比特率 recorder.setAudioBitrate(2*128*1024); // 音频采样率 recorder.setSampleRate(sampleRate); // 双通道(立体声) recorder.setAudioChannels(audioChannels); try { recorder.start(); } catch (FrameRecorder.Exception e) { e.printStackTrace(); } while(!exit) { Frame frame= null; try { frame = grabber.grab(); } catch (FrameGrabber.Exception e) { e.printStackTrace(); } if(frame==null) { System.out.println("---------------no frame grabbed..." ); continue; } avutil.AVFrame avframe=(avutil.AVFrame)frame.opaque;//把Frame直接强制转换为AVFrame long lastPts=avframe.pts(); long lastDts=avframe.pkt_dts(); long duration=avframe.pkt_duration();//+intervalDuration; long pos=avframe.pkt_pos(); // avframe.pkt_duration(duration); recorder.setTimestamp(frame.timestamp); try { recorder.record(frame); System.out.println("record one frame..."+frame.timestamp+" pts:"+lastPts+" dts:"+lastDts+" pos="+pos+" duration="+duration); }catch (Exception e) { } } try { grabber.stop(); grabber.release(); } catch (FrameGrabber.Exception e) { e.printStackTrace(); } try { recorder.stop(); recorder.release(); } catch (FrameRecorder.Exception e) { e.printStackTrace(); } } }; } }
000b17dd1d4ab56d69b76d993273b325f88b3193
8bc2dd6fb6b70c755a7d13152a0cba168a18d9a6
/myweb2/src/model/dao/emailDao.java
701fd3b7862d2e5dd9542af7c258a4b441df24ad
[]
no_license
Keleeyu/Colaeyu
6e618d8b3838991f8b7537f7d9b521889d9139af
548f436447deb126ebd16e22c9579aeee98c4958
refs/heads/master
2021-07-06T10:09:23.704693
2020-11-01T13:52:29
2020-11-01T13:52:29
202,832,727
1
0
null
null
null
null
GB18030
Java
false
false
1,045
java
package model.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import com.mysql.jdbc.PreparedStatement; import model.vo.Email; import model.vo.User; public class emailDao { public Email get(String emailstr) { // TODO Auto-generated method stub Email email = null; try { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/usersql?useuricode=true&character=utf-8","root",""); if(con != null) { System.out.println("Connect User Ok");//检查一下是否关联上MySQL } else { System.out.println("no email"); } String sql = "select email from t_user where email=?"; PreparedStatement pst = (PreparedStatement) con.prepareStatement(sql); pst.setNString(1,emailstr); ResultSet rs = pst.executeQuery(); if(rs.next()) { email = new Email(rs.getString("email")); } con.close(); } catch (Exception e) { } return email; } }
82fdb7668db57c3a1da6e3cbc0e0d23c3a2fb05b
b9c96c611f137d727c0fc08b0c9088a1ac38e90d
/src/main/java/com/lms/demo/repository/UserRepository.java
bc737c71bd85eda905baf8be2b7906dca5cecb8f
[]
no_license
iremashvili2000/Student-website
7fdadf7da794b94732a73ac6085b5204911a5e35
29a157b836032ab45ff3149e90208d487142230d
refs/heads/master
2023-03-17T14:54:37.198834
2021-03-10T10:11:08
2021-03-10T10:11:08
346,100,553
2
0
null
null
null
null
UTF-8
Java
false
false
327
java
package com.lms.demo.repository; import com.lms.demo.models.databasemoduls.User; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepository extends JpaRepository<User,Long> { User findByEmail(String email); void deleteUserById(long id); User findByUsername(String username); }
ca1bcfa4a56b7acb73db814af8d92a3078bcd416
9d5edaac9212b54592d53c12f08e6db8b5469f3e
/src/controllers/AppLoader.java
a4f297239c0d8a5a4db458988d3f507103309823
[]
no_license
JCMander/JordanIMS
ab36d7cd9e825615b5243c7f4e26e1a7a8a6256e
04861be5f13d08ab565143b834440728127228fb
refs/heads/master
2020-05-18T06:16:30.047811
2015-08-21T15:34:41
2015-08-21T15:34:41
37,851,216
3
0
null
null
null
null
UTF-8
Java
false
false
5,493
java
package controllers; import java.io.File; import java.util.ArrayList; import javax.swing.JOptionPane; import models.DatabaseConnection; import views.FrmTable; import views.PurchaseOrder; /** Main class **/ public class AppLoader { private static DatabaseConnection db; private static FrmTable frm; private static ArrayList<Integer> productID; private static ArrayList<String> productName; private static ArrayList<Integer> productQuantity; private static ArrayList<Integer> productThreshold; private static ArrayList<Integer> productWeight; private static ArrayList<Integer> productPrice; private static String stockListMessage = ""; private static String[] options = new String[2]; private static int viewReceipt; private static int[] maxStock; /** * Main class, this is used to run the application, from here FrmTable and Database Connection are called * **/ public static void main(String[] args) { /*smw = new SalesMetricsWriter(); smw.setSalesMetricsValue(new SalesMetricsValue(1, 15, 14, "Item1", 2.00)); smw.setSalesMetricsValue(new SalesMetricsValue(2, 24, 23, "Item2", 1.00)); smw.setSalesMetricsValue(new SalesMetricsValue(3, 36, 1, "Item3", 5.00)); smw.setSalesMetricsValue(new SalesMetricsValue(4, 46, 34, "Item4", 7.00)); smw.setSalesMetricsValue(new SalesMetricsValue(5, 44, 24, "Item5", 9.99)); smw.writeReport();*/ db = new DatabaseConnection(); frm = new FrmTable(); frm.pack(); frm.setLocationRelativeTo(null); db.accessDB(); db.readDB(); setProductID(db.getProductID()); setProductWeight(db.getProductWeight()); setProductQuantity(db.getProductQuantity()); setProductName(db.getProductName()); setProductThreshold(db.getProductThreshold()); setProductPrice(db.getProductPrice()); setMaxStock(new int[getProductID().size()]); for(int i =0; i<getProductID().size(); i++){ getMaxStock()[i] = (getProductThreshold().get(i)*4); } frm.setVisible(true); new PurchaseOrder(); makeTable(); } public static void stockListMessage(){ options[0] = new String("OK"); options[1] = new String("View Receipt"); /** Message to show when quantity is low code starts here**/ int msgcount =0; for(int i=0; i<getProductID().size(); i++){ if(getProductQuantity().get(i)<=getProductThreshold().get(i)){ stockListMessage = stockListMessage + getProductName().get(i) + " Quantity: " + getProductQuantity().get(i) + "\n"; msgcount++; db.updateDB(getProductID().get(i), getMaxStock()[i]); } } if(msgcount>0){ viewReceipt = JOptionPane.showOptionDialog(null, "The following products are low in quantity and so have been re-ordered:\n\n" + stockListMessage,"Low Stock Levels", 0,JOptionPane.INFORMATION_MESSAGE,null,options,null); } if(viewReceipt == 1){ try { if ((new File(PurchaseOrder.getFILE())).exists()) { Process p = Runtime .getRuntime() .exec("rundll32 url.dll,FileProtocolHandler " + PurchaseOrder.getFILE()); p.waitFor(); } else { JOptionPane.showMessageDialog(null, "This file does not exist"); } } catch (Exception ex) { ex.printStackTrace(); } } /** Message to show when quantity is low code ends here **/ } public static void makeTable(){ /** Make the table code starts here **/ for(int i=0; i<getProductID().size(); i++){ frm.addProductToTable(getProductID().get(i), getProductName().get(i), getProductQuantity().get(i), getProductThreshold().get(i)); } stockListMessage(); /** Make the table code ends here **/ } public void addProduct(int newid, String newname){ db.createEntry(newid, newname); } public void updateProduct(int id, int quantity){ db.updateDB(id, quantity); } public void updateThreshold(int id, int threshold){ db.updateDBThreshold(id, threshold); } public String getProductName(int name1){ return productName.get(name1-1); } public int getProductQuantity(int name1){ return productQuantity.get(name1-1); } public static ArrayList<Integer> getProductID() { return productID; } public static void setProductID(ArrayList<Integer> productID) { AppLoader.productID = productID; } public static ArrayList<String> getProductName() { return productName; } public static void setProductName(ArrayList<String> productName) { AppLoader.productName = productName; } public static ArrayList<Integer> getProductQuantity() { return productQuantity; } public static void setProductQuantity(ArrayList<Integer> productQuantity) { AppLoader.productQuantity = productQuantity; } public static ArrayList<Integer> getProductPrice() { return productPrice; } public static void setProductPrice(ArrayList<Integer> productPrice) { AppLoader.productPrice = productPrice; } public static ArrayList<Integer> getProductThreshold() { return productThreshold; } public static void setProductThreshold(ArrayList<Integer> productThreshold) { AppLoader.productThreshold = productThreshold; } public static ArrayList<Integer> getProductWeight() { return productWeight; } public static void setProductWeight(ArrayList<Integer> productWeight) { AppLoader.productWeight = productWeight; } public static int[] getMaxStock() { return maxStock; } public static void setMaxStock(int[] maxStock) { AppLoader.maxStock = maxStock; } }
ee40826f04f1a68f2d6baf18bdc51256e3ab0cfc
ebde8b1534b7d1414808093a88c612b3c9354774
/cat/src/main/java/cn/edu/sdjzu/xg/bysj/controller/basic/DepartmentController.java
42cad10f50818c0797fb38c23c2337ec25abe9e9
[]
no_license
m19862100530/xg201802104043
7a7abd753665a4f0b80d59a884923bbde42bd10c
0d63f661f4da978ec24148f2369edfd1d93aaa5f
refs/heads/master
2020-09-24T17:32:58.787590
2019-12-04T09:58:28
2019-12-04T09:58:28
225,763,528
0
0
null
null
null
null
UTF-8
Java
false
false
8,812
java
package cn.edu.sdjzu.xg.bysj.controller.basic; import cn.edu.sdjzu.xg.bysj.domain.Department; import cn.edu.sdjzu.xg.bysj.service.DepartmentService; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; import util.JSONUtil; 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 java.io.IOException; import java.sql.SQLException; import java.util.Collection; /** * 将所有方法组织在一个Controller(Servlet)中 */ @WebServlet("/department.ctl") public class DepartmentController extends HttpServlet { //请使用以下JSON测试增加功能(id为空) //{"description":"id为null的新系别","no":"05","remarks":""} //请使用以下JSON测试修改功能 //{"description":"修改id=1的系别","id":1,"no":"05","remarks":""} /** * POST, http://49.234.69.137:8080/department.ctl, 增加系别 * 增加一个系别对象:将来自前端请求的JSON对象,增加到数据库表中 * @param request 请求对象 * @param response 响应对象 * @throws ServletException * @throws IOException */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); //设置响应字符编码为UTF-8 response.setContentType("text/html;charset=UTF-8"); //根据request对象,获得代表参数的JSON字串 String department_json = JSONUtil.getJSON(request); //将JSON字串解析为Department对象 Department departmentToAdd = JSON.parseObject(department_json, Department.class); //前台没有为id赋值,此处模拟自动生成id。如果Dao能真正完成数据库操作,删除下一行。 //departmentToAdd.setId(4 + (int)(Math.random()*100)); //创建JSON对象message,以便往前端响应信息 JSONObject message = new JSONObject(); //在数据库表中增加Department对象 try { DepartmentService.getInstance().add(departmentToAdd); message.put("message", "增加成功"); }catch (SQLException e){ message.put("message", "数据库操作异常"); e.printStackTrace(); }catch(Exception e){ message.put("message", "网络异常"); } //响应message到前端 response.getWriter().println(message); } /** * DELETE, http://49.234.69.137:8080/department.ctl?id=1, 删除id=1的系别 * 删除一个系别对象:根据来自前端请求的id,删除数据库表中id的对应记录 * @param request * @param response * @throws ServletException * @throws IOException */ @Override protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //读取参数id String id_str = request.getParameter("id"); int id = Integer.parseInt(id_str); //设置响应字符编码为UTF-8 response.setContentType("text/html;charset=UTF-8"); //创建JSON对象message,以便往前端响应信息 JSONObject message = new JSONObject(); //到数据库表中删除对应的系别 try { DepartmentService.getInstance().delete(id); message.put("message", "删除成功"); }catch (SQLException e){ message.put("message", "数据库操作异常"); e.printStackTrace(); }catch(Exception e){ message.put("message", "网络异常"); } //响应message到前端 response.getWriter().println(message); } /** * PUT, http://49.234.69.137:8080/department.ctl, 修改系别 * * 修改一个系别对象:将来自前端请求的JSON对象,更新数据库表中相同id的记录 * @param request * @param response * @throws ServletException * @throws IOException */ @Override protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //设置请求字符编码为UTF-8 request.setCharacterEncoding("UTF-8"); String department_json = JSONUtil.getJSON(request); //将JSON字串解析为Department对象 Department departmentToAdd = JSON.parseObject(department_json, Department.class); //设置响应字符编码为UTF-8 response.setContentType("text/html;charset=UTF-8"); //创建JSON对象message,以便往前端响应信息 JSONObject message = new JSONObject(); //到数据库表修改Department对象对应的记录 try { DepartmentService.getInstance().update(departmentToAdd); message.put("message", "修改成功"); }catch (SQLException e){ message.put("message", "数据库操作异常"); e.printStackTrace(); }catch(Exception e){ message.put("message", "网络异常"); } //响应message到前端 response.getWriter().println(message); } /** * GET, http://49.234.69.137:8080/department.ctl?id=1, 查询id=1的系别 * GET, http://49.234.69.137:8080/department.ctl, 查询所有的系别 * 把一个或所有系别对象响应到前端 * @param request * @param response * @throws ServletException * @throws IOException */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //设置响应字符编码为UTF-8 response.setContentType("text/html;charset=UTF-8"); //读取参数id String id_str = request.getParameter("id"); String schoolId_str = request.getParameter("paraType"); //创建JSON对象message,以便往前端响应信息 JSONObject message = new JSONObject(); try { if (schoolId_str == null){ //如果id = null, 表示响应所有系别对象,否则响应id指定的系别对象 if (id_str == null) { responseDepartments(response); }else{ int id = Integer.parseInt(id_str); responseDepartment(id, response); } } else if (schoolId_str.equals("school")) { int schoolId = Integer.parseInt(id_str); responseDepartmentFromSchool(schoolId, response); } }catch (SQLException e){ message.put("message", "数据库操作异常"); //响应message到前端 response.getWriter().println(message); e.printStackTrace(); }catch(Exception e){ message.put("message", "网络异常"); //响应message到前端 response.getWriter().println(message); } //response.getWriter().println(message); } //响应拥有schooId系别对象 private void responseDepartmentFromSchool(int schoolId, HttpServletResponse response) throws ServletException, IOException, SQLException { //根据school的id查找所属的系 Collection<Department> departments = DepartmentService.getInstance().findAllBySchool(schoolId); //将对象转为json字符串 String department_json = JSON.toJSONString(departments, SerializerFeature.DisableCircularReferenceDetect); //响应message到前端 response.getWriter().println(department_json); } //响应一个系别对象 private void responseDepartment(int id, HttpServletResponse response) throws ServletException, IOException, SQLException { //根据id查找系别 Department department = DepartmentService.getInstance().find(id); String department_json = JSON.toJSONString(department); //响应department_json到前端 response.getWriter().println(department_json); } //响应所有系别对象 private void responseDepartments(HttpServletResponse response) throws ServletException, IOException, SQLException { //获得所有系别 Collection<Department> departments = DepartmentService.getInstance().findAll(); String departments_json = JSON.toJSONString(departments, SerializerFeature.DisableCircularReferenceDetect); //响应departments_json到前端 response.getWriter().println(departments_json); } }
aee7aa26b479465314d2f66ab3d084980d013a24
3d084c9c911554be747735ddef8e14bedb8acf6d
/dgManager/src/com/chinasoft/app/dao/UserDao.java
40282dc1156c27018fa443e1114aba69779b4610
[]
no_license
yzy-source/SSH-Development
63cf37fa1b55330986e7f51c62bd4d63eea917d9
71d4a36ecd9f156f92f7f6c78336b52486c3fa96
refs/heads/master
2021-04-10T13:55:28.630833
2020-03-21T09:43:23
2020-03-21T09:43:23
248,939,176
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
277
java
package com.chinasoft.app.dao; import java.util.List; import com.chinasoft.app.domain.Customer; public interface UserDao { //Óû§×¢²á public void userRegister(Customer customer); //Óû§µÇ¼ public List<Customer> userLogin(Customer user); }
f1082973c4974390e75aef8d1b4538b8e6cfc307
528fbb1a0dc2095346449d2c52ec59a711b793ab
/src/test/java/io/fusionauth/pem/PEMEncoderTest.java
b9429e2c743bc2efecdb1b6b995859c0743b9b9c
[ "Apache-2.0" ]
permissive
Mosect/fusionauth-jwt
d78f1ac5db69c81c3dbfc2c9ef4774b198dad226
8f6573f12f1b4aa26dc3c1bf6e696a4308e17297
refs/heads/master
2020-04-22T20:21:25.874709
2019-02-07T16:45:28
2019-02-07T16:45:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,880
java
/* * Copyright (c) 2018-2019, FusionAuth, All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ package io.fusionauth.pem; import io.fusionauth.pem.domain.PEM; import org.testng.annotations.Test; import java.math.BigInteger; import java.nio.file.Files; import java.nio.file.Paths; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; /** * @author Daniel DeGroff */ public class PEMEncoderTest { @Test public void ec() throws Exception { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC"); keyPairGenerator.initialize(256); KeyPair keyPair = keyPairGenerator.generateKeyPair(); String encodedPublicKey = PEM.encode(keyPair.getPublic()); assertNotNull(encodedPublicKey); assertTrue(encodedPublicKey.startsWith(PEM.X509_PUBLIC_KEY_PREFIX)); assertTrue(encodedPublicKey.endsWith(PEM.X509_PUBLIC_KEY_SUFFIX)); String encodedPrivateKey = PEM.encode(keyPair.getPrivate()); assertNotNull(encodedPrivateKey); assertTrue(encodedPrivateKey.startsWith(PEM.PKCS_8_PRIVATE_KEY_PREFIX)); assertTrue(encodedPrivateKey.endsWith(PEM.PKCS_8_PRIVATE_KEY_SUFFIX)); // Since we built our own key pair, the private key will not contain the public key PEM pem = PEM.decode(encodedPrivateKey); assertNotNull(pem.getPrivateKey()); assertNull(pem.getPublicKey()); // Try again, but provide both keys to encode into the PEM String encodedPrivateKey2 = PEM.encode(keyPair.getPrivate(), keyPair.getPublic()); assertNotNull(encodedPrivateKey2); PEM pem2 = PEM.decode(encodedPrivateKey2); assertNotNull(pem2.getPrivateKey()); assertNotNull(pem2.getPublicKey()); } @Test public void ec_backAndForth() throws Exception { // Start with openSSL PKCS#8 private key and X.509 public key String expectedPrivate = new String(Files.readAllBytes(Paths.get("src/test/resources/ec_private_prime256v1_p_256_openssl_pkcs8.pem"))).trim(); String expectedPublic = new String(Files.readAllBytes(Paths.get("src/test/resources/ec_public_prime256v1_p_256_openssl.pem"))).trim(); // Decode the private key to ensure we get both private and public keys out of the private PEM PEM pem = PEM.decode(expectedPrivate); assertNotNull(pem); assertNotNull(pem.getPrivateKey()); assertNotNull(pem.getPublicKey()); // Ensure the public key we extracted is correct ECPublicKey publicKey = pem.getPublicKey(); assertEquals(publicKey.getW().getAffineX(), new BigInteger("7676a6ec4ee9058b59c11c8e3038e02979ccd47fca46f20fa1b130d379d9038f", 16)); assertEquals(publicKey.getW().getAffineY(), new BigInteger("8abdebcea6831f8ec07c1b4f95ceb7eb0d121cb3d23c54cfa572fba97a0de510", 16)); // Re-encode the private key to PEM PKCS#8 format and ensure it equals the original String encodedPrivateKey = PEM.encode(pem.getPrivateKey()); assertEquals(encodedPrivateKey, expectedPrivate); // Re-encode the public key to PEM X.509 format and ensure it equals the original String encodedPublicKey = PEM.encode(pem.getPublicKey()); assertEquals(encodedPublicKey, expectedPublic); } @Test public void rsa() throws Exception { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); keyPairGenerator.initialize(2048); KeyPair keyPair = keyPairGenerator.generateKeyPair(); assertNotNull(keyPair.getPublic()); assertNotNull(keyPair.getPrivate()); String encodedPublicKey = PEM.encode(keyPair.getPublic()); assertNotNull(encodedPublicKey); assertTrue(encodedPublicKey.startsWith(PEM.X509_PUBLIC_KEY_PREFIX)); assertTrue(encodedPublicKey.endsWith(PEM.X509_PUBLIC_KEY_SUFFIX)); String encodedPrivateKey = PEM.encode(keyPair.getPrivate()); assertNotNull(encodedPrivateKey); assertTrue(encodedPrivateKey.startsWith(PEM.PKCS_8_PRIVATE_KEY_PREFIX)); assertTrue(encodedPrivateKey.endsWith(PEM.PKCS_8_PRIVATE_KEY_SUFFIX)); // Since the public RSA modulus and public exponent are always included in the private key, they should // be contained in the generated PEM PEM pem = PEM.decode(encodedPrivateKey); assertNotNull(pem.getPrivateKey()); assertNotNull(pem.getPublicKey()); } @Test public void rsa_backAndForth_pkcs_1() throws Exception { // Start externally created PKCS#1 private key and X.509 public key String expectedPrivate_pkcs_1 = new String(Files.readAllBytes(Paths.get("src/test/resources/rsa_private_key_2048_pkcs_1_control.pem"))).trim(); String expectedPrivate_pkcs_8 = new String(Files.readAllBytes(Paths.get("src/test/resources/rsa_private_key_2048_pkcs_8_control.pem"))).trim(); String expectedPublic = new String(Files.readAllBytes(Paths.get("src/test/resources/rsa_public_key_2048_x509_control.pem"))); // Decode the private key to ensure we get both private and public keys out of the private PEM PEM pem = PEM.decode(expectedPrivate_pkcs_1); assertNotNull(pem); assertNotNull(pem.getPrivateKey()); assertNotNull(pem.getPublicKey()); // Ensure the public key we extracted is correct RSAPublicKey publicKey = pem.getPublicKey(); String expectedModulus = "dd95ab518d18e8828dd6a238061c51d82ee81d516018f624777f2e1aad6340d4aa12f24570df770989b5ebf1bbf05005296ab0b096f75b1fa76f10e7e8bb4fe008542c1d47d0ad20eff8cb9250c01ef23cca138a96fa32bec5053d6b4dc652728792495ef90d295ff83a8d767baf5ff100ae43a36910f97e712bd722a518042b"; assertEquals(publicKey.getModulus(), new BigInteger(expectedModulus, 16)); assertEquals(publicKey.getPublicExponent(), BigInteger.valueOf(0x10001)); assertEquals(publicKey.getPublicExponent(), BigInteger.valueOf(65537)); // Re-encode the private key which started as PKCS#1 to PEM PKCS#8 format String encodedPrivateKey_pkcs_8 = PEM.encode(pem.getPrivateKey()); assertTrue(encodedPrivateKey_pkcs_8.startsWith(PEM.PKCS_8_PRIVATE_KEY_PREFIX)); // The PKCS#1 will not equal the PKCS#8 key assertNotEquals(encodedPrivateKey_pkcs_8, expectedPrivate_pkcs_1); assertEquals(encodedPrivateKey_pkcs_8, expectedPrivate_pkcs_8); // Re-encode the public key to PEM X.509 format and ensure it equals the original String encodedPublicKey = PEM.encode(pem.getPublicKey()); assertEquals(encodedPublicKey, expectedPublic); } @Test public void rsa_backAndForth_pkcs_8() throws Exception { // Start externally created PKCS#1 private key and X.509 public key String expectedPrivate = new String(Files.readAllBytes(Paths.get("src/test/resources/rsa_private_key_2048_pkcs_8_control.pem"))).trim(); String expectedPublic = new String(Files.readAllBytes(Paths.get("src/test/resources/rsa_public_key_2048_x509_control.pem"))).trim(); // Decode the private key to ensure we get both private and public keys out of the private PEM PEM pem = PEM.decode(expectedPrivate); assertNotNull(pem); assertNotNull(pem.getPrivateKey()); assertNotNull(pem.getPublicKey()); // Ensure the public key we extracted is correct RSAPublicKey publicKey = pem.getPublicKey(); String expectedModulus = "dd95ab518d18e8828dd6a238061c51d82ee81d516018f624777f2e1aad6340d4aa12f24570df770989b5ebf1bbf05005296ab0b096f75b1fa76f10e7e8bb4fe008542c1d47d0ad20eff8cb9250c01ef23cca138a96fa32bec5053d6b4dc652728792495ef90d295ff83a8d767baf5ff100ae43a36910f97e712bd722a518042b"; assertEquals(publicKey.getModulus(), new BigInteger(expectedModulus, 16)); assertEquals(publicKey.getPublicExponent(), BigInteger.valueOf(0x10001)); assertEquals(publicKey.getPublicExponent(), BigInteger.valueOf(65537)); // Re-encode the private to PEM PKCS#8 format String encodedPrivateKey_pkcs_8 = PEM.encode(pem.getPrivateKey()); assertTrue(encodedPrivateKey_pkcs_8.startsWith(PEM.PKCS_8_PRIVATE_KEY_PREFIX)); assertEquals(encodedPrivateKey_pkcs_8, expectedPrivate); // Re-encode the public key to PEM X.509 format and ensure it equals the original String encodedPublicKey = PEM.encode(pem.getPublicKey()); assertEquals(encodedPublicKey, expectedPublic); } }
77b76f0cd189c1f098b821e3c7ff333bda391f18
8672c679db29028660aa7236bda52dd5dadd4b6c
/Largest number in an array/Main.java
89c903bef0633410e092f6597c5f041e3a308707
[]
no_license
rakshith626/Playground
8157fc584d5cee9391e4150932060f75e979ee36
00210d64cb5a3d67cba1c4e73c82e2a6197fd844
refs/heads/master
2020-04-23T16:21:34.634340
2019-08-24T14:42:36
2019-08-24T14:42:36
171,295,775
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
import java.util.Scanner; class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); // Get the size of an array int arr_size = in.nextInt(); int arr[] = new int[arr_size]; // Get the array elements for(int idx = 0; idx <= arr_size - 1; idx++) { arr[idx] = in.nextInt(); } int max_no; // Compare first two elements in an array and find the largest element // Store the largest element in one variable if(arr[0] > arr[1]) { max_no = arr[0]; } else{ max_no = arr[1]; } // Scan each element in an array // Compare each element with largest element which is stored in that variable for(int idx = 2; idx <= arr_size - 1; idx++) { if(max_no < arr[idx]) { max_no = arr[idx]; } } System.out.println(max_no); } }
8d7ec7a6cc386f6033012badaff21f2e9eb343ea
0019ccfdd18eb984cf3908dcb087a21e5f8f45e8
/src/bd/inner/dormitory/util/ConnectionPool.java
f1e56521cc2a04047860d8bc390f731fbd1ed17b
[]
no_license
zhoukami/dormsystem
eba214ef692ad09fae7a46524f910ab547544992
785a65f346b51fc9d2ebefd2a4d391aa36dad5ad
refs/heads/master
2020-12-24T14:26:21.095516
2013-10-23T05:46:22
2013-10-23T05:55:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,919
java
package bd.inner.dormitory.util; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Enumeration; import java.util.Vector; public class ConnectionPool { private String jdbcDriver = null;// 数据库驱动 private String dbUrl = null; // 数据 URL private String dbUsername = null; // 数据库用户名 private String dbPassword = null; // 数据库用户密码 private String testTable = ""; // 测试连接是否可用的测试表名,默认没有测试表 private int initialConnections = 10; // 连接池的初始大小 private int incrementalConnections = 5;// 连接池自动增加的大小 private int maxConnections = 50; // 连接池最大的大小 private Vector<PooledConnection> connections = null; // 存放连接池中数据库连接的向量 , 初始时为 null // 它中存放的对象为 PooledConnection 型 /** * 构造函数 * @param jdbcDriver String JDBC 驱动类串 * @param dbUrl * String 数据库 URL * @param dbUsername * String 连接数据库用户名 * @param dbPassword * String 连接数据库用户的密码 */ public ConnectionPool(String jdbcDriver, String dbUrl, String dbUsername, String dbPassword) { this.jdbcDriver = jdbcDriver; this.dbUrl = dbUrl; this.dbUsername = dbUsername; this.dbPassword = dbPassword; } /** * 返回连接池的初始大小 * @return 初始连接池中可获得的连接数量 */ public int getInitialConnections() { return this.initialConnections; } /** * 设置连接池的初始大小 * @param 用于设置初始连接池中连接的数量 */ public void setInitialConnections(int initialConnections) { this.initialConnections = initialConnections; } /** * 返回连接池自动增加的大小 、 * @return 连接池自动增加的大小 */ public int getIncrementalConnections() { return this.incrementalConnections; } /** * 设置连接池自动增加的大小 * @param 连接池自动增加的大小 */ public void setIncrementalConnections(int incrementalConnections) { this.incrementalConnections = incrementalConnections; } /** * 返回连接池中最大的可用连接数量 * @return 连接池中最大的可用连接数量 */ public int getMaxConnections() { return this.maxConnections; } /** * 设置连接池中最大可用的连接数量 * @param 设置连接池中最大可用的连接数量值 */ public void setMaxConnections(int maxConnections) { this.maxConnections = maxConnections; } /** * 获取测试数据库表的名字 * @return 测试数据库表的名字 */ public String getTestTable() { return this.testTable; } /** * 设置测试表的名字 * @param testTable * String 测试表的名字 */ public void setTestTable(String testTable) { this.testTable = testTable; } /** * 创建一个数据库连接池,连接池中的可用连接的数量采用类成员 * initialConnections 中设置的值 */ public synchronized void createPool() throws Exception { // 确保连接池没有创建 // 如果连接池己经创建了,保存连接的向量 connections 不会为空 if (connections != null) { return; // 如果己经创建,则返回 } // 实例化 JDBC Driver 中指定的驱动类实例 Driver driver = (Driver) (Class.forName(this.jdbcDriver).newInstance()); DriverManager.registerDriver(driver); // 注册 JDBC 驱动程序 // 创建保存连接的向量 , 初始时有 0 个元素 connections = new Vector<>(); // 根据 initialConnections 中设置的值,创建连接。 createConnections(this.initialConnections); /* System.out.println(" 数据库连接池创建成功! "); */ } /** * 创建由 numConnections 指定数目的数据库连接 , 并把这些连接 * 放入 connections 向量中 * @param numConnections * 要创建的数据库连接的数目 */ // @SuppressWarnings("unchecked") private void createConnections(int numConnections) throws SQLException { // 循环创建指定数目的数据库连接 for (int x = 0; x < numConnections; x++) { // 是否连接池中的数据库连接的数量己经达到最大?最大值由类成员 maxConnections // 指出,如果 maxConnections 为 0 或负数,表示连接数量没有限制。 // 如果连接数己经达到最大,即退出。 if (this.maxConnections > 0 && this.connections.size() >= this.maxConnections) { break; } // add a new PooledConnection object to connections vector // 增加一个连接到连接池中(向量 connections 中) try { connections.addElement(new PooledConnection(newConnection())); } catch (SQLException e) { System.out.println(" 创建数据库连接失败! " + e.getMessage()); throw new SQLException(); } /* System.out.println(" 数据库连接己创建 ......"); */ } } /** * 创建一个新的数据库连接并返回它 * @return 返回一个新创建的数据库连接 */ private Connection newConnection() throws SQLException { // 创建一个数据库连接 Connection conn = DriverManager.getConnection(dbUrl, dbUsername, dbPassword); // 如果这是第一次创建数据库连接,即检查数据库,获得此数据库允许支持的 // 最大客户连接数目 // connections.size()==0 表示目前没有连接己被创建 if (connections.size() == 0) { DatabaseMetaData metaData = conn.getMetaData(); int driverMaxConnections = metaData.getMaxConnections(); // 数据库返回的 driverMaxConnections 若为 0 ,表示此数据库没有最大 // 连接限制,或数据库的最大连接限制不知道 // driverMaxConnections 为返回的一个整数,表示此数据库允许客户连接的数目 // 如果连接池中设置的最大连接数量大于数据库允许的连接数目 , 则置连接池的最大 // 连接数目为数据库允许的最大数目 if (driverMaxConnections > 0 && this.maxConnections > driverMaxConnections) { this.maxConnections = driverMaxConnections; } } return conn; // 返回创建的新的数据库连接 } /** * 通过调用 getFreeConnection() 函数返回一个可用的数据库连接 , * 如果当前没有可用的数据库连接,并且更多的数据库连接不能创 * 建(如连接池大小的限制),此函数等待一会再尝试获取。 * @return 返回一个可用的数据库连接对象 */ public synchronized Connection getConnection() throws SQLException { // 确保连接池己被创建 if (connections == null) { return null; // 连接池还没创建,则返回 null } Connection conn = getFreeConnection(); // 获得一个可用的数据库连接 // 如果目前没有可以使用的连接,即所有的连接都在使用中 while (conn == null) { // 等一会再试 wait(250); conn = getFreeConnection(); // 重新再试,直到获得可用的连接,如果 // getFreeConnection() 返回的为 null // 则表明创建一批连接后也不可获得可用连接 } return conn;// 返回获得的可用的连接 } /** * 本函数从连接池向量 connections 中返回一个可用的的数据库连接,如果 * 当前没有可用的数据库连接,本函数则根据 incrementalConnections 设置 * 的值创建几个数据库连接,并放入连接池中。 * 如果创建后,所有的连接仍都在使用中,则返回 null * @return 返回一个可用的数据库连接 */ private Connection getFreeConnection() throws SQLException { // 从连接池中获得一个可用的数据库连接 Connection conn = findFreeConnection(); if (conn == null) { // 如果目前连接池中没有可用的连接 // 创建一些连接 createConnections(incrementalConnections); // 重新从池中查找是否有可用连接 conn = findFreeConnection(); if (conn == null) { // 如果创建连接后仍获得不到可用的连接,则返回 null return null; } } return conn; } /** * 查找连接池中所有的连接,查找一个可用的数据库连接, * 如果没有可用的连接,返回 null * @return 返回一个可用的数据库连接 */ private Connection findFreeConnection() throws SQLException { Connection conn = null; PooledConnection pConn = null; // 获得连接池向量中所有的对象 Enumeration<PooledConnection> enumerate = connections.elements(); // 遍历所有的对象,看是否有可用的连接 while (enumerate.hasMoreElements()) { pConn = (PooledConnection) enumerate.nextElement(); if (!pConn.isBusy()) { // 如果此对象不忙,则获得它的数据库连接并把它设为忙 conn = pConn.getConnection(); pConn.setBusy(true); // 测试此连接是否可用 if (!testConnection(conn)) { // 如果此连接不可再用了,则创建一个新的连接, // 并替换此不可用的连接对象,如果创建失败,返回 null try { conn = newConnection(); } catch (SQLException e) { System.out.println(" 创建数据库连接失败! " + e.getMessage()); return null; } pConn.setConnection(conn); } break; // 己经找到一个可用的连接,退出 } } return conn;// 返回找到到的可用连接 } /** * 测试一个连接是否可用,如果不可用,关掉它并返回 false * 否则可用返回 true * @param conn * 需要测试的数据库连接 * @return 返回 true 表示此连接可用, false 表示不可用 */ private boolean testConnection(Connection conn) { try { // 判断测试表是否存在 if (testTable.equals("")) { // 如果测试表为空,试着使用此连接的 setAutoCommit() 方法 // 来判断连接否可用(此方法只在部分数据库可用,如果不可用 , // 抛出异常)。注意:使用测试表的方法更可靠 conn.setAutoCommit(true); } else {// 有测试表的时候使用测试表测试 // check if this connection is valid Statement stmt = conn.createStatement(); stmt.execute("select count(*) from " + testTable); } } catch (SQLException e) { // 上面抛出异常,此连接己不可用,关闭它,并返回 false; closeConnection(conn); return false; } // 连接可用,返回 true return true; } /** * 此函数返回一个数据库连接到连接池中,并把此连接置为空闲。 * 所有使用连接池获得的数据库连接均应在不使用此连接时返回它。 * @param 需返回到连接池中的连接对象 */ public void returnConnection(Connection conn) { // 确保连接池存在,如果连接没有创建(不存在),直接返回 if (connections == null) { System.out.println(" 连接池不存在,无法返回此连接到连接池中 !"); return; } PooledConnection pConn = null; Enumeration<PooledConnection> enumerate = connections.elements(); // 遍历连接池中的所有连接,找到这个要返回的连接对象 while (enumerate.hasMoreElements()) { pConn = (PooledConnection) enumerate.nextElement(); // 先找到连接池中的要返回的连接对象 if (conn == pConn.getConnection()) { // 找到了 , 设置此连接为空闲状态 pConn.setBusy(false); break; } } } /** * 刷新连接池中所有的连接对象 */ public synchronized void refreshConnections() throws SQLException { // 确保连接池己创新存在 if (connections == null) { System.out.println(" 连接池不存在,无法刷新 !"); return; } PooledConnection pConn = null; Enumeration<PooledConnection> enumerate = connections.elements(); while (enumerate.hasMoreElements()) { // 获得一个连接对象 pConn = (PooledConnection) enumerate.nextElement(); // 如果对象忙则等 5 秒 ,5 秒后直接刷新 if (pConn.isBusy()) { wait(5000); // 等 5 秒 } // 关闭此连接,用一个新的连接代替它。 closeConnection(pConn.getConnection()); pConn.setConnection(newConnection()); pConn.setBusy(false); } } /** * 关闭连接池中所有的连接,并清空连接池。 */ public synchronized void closeConnectionPool() throws SQLException { // 确保连接池存在,如果不存在,返回 if (connections == null) { System.out.println(" 连接池不存在,无法关闭 !"); return; } PooledConnection pConn = null; Enumeration<PooledConnection> enumerate = connections.elements(); while (enumerate.hasMoreElements()) { pConn = (PooledConnection) enumerate.nextElement(); // 如果忙,等 5 秒 if (pConn.isBusy()) { wait(5000); // 等 5 秒 } // 5 秒后直接关闭它 closeConnection(pConn.getConnection()); // 从连接池向量中删除它 connections.removeElement(pConn); } // 置连接池为空 connections = null; } /** * 关闭一个数据库连接 * @param 需要关闭的数据库连接 */ private void closeConnection(Connection conn) { try { conn.close(); } catch (SQLException e) { System.out.println(" 关闭数据库连接出错: " + e.getMessage()); } } /** * 使程序等待给定的毫秒数 * @param 给定的毫秒数 */ private void wait(int mSeconds) { try { Thread.sleep(mSeconds); } catch (InterruptedException e) { } } /** * 内部使用的用于保存连接池中连接对象的类 * 此类中有两个成员,一个是数据库的连接,另一个是指示此连接是否 * 正在使用的标志。 */ class PooledConnection { Connection connection = null;// 数据库连接 boolean busy = false; // 此连接是否正在使用的标志,默认没有正在使用 // 构造函数,根据一个 Connection 构告一个 PooledConnection 对象 public PooledConnection(Connection connection) { this.connection = connection; } // 返回此对象中的连接 public Connection getConnection() { return connection; } // 设置此对象的,连接 public void setConnection(Connection connection) { this.connection = connection; } // 获得对象连接是否忙 public boolean isBusy() { return busy; } // 设置对象的连接正在忙 public void setBusy(boolean busy) { this.busy = busy; } } }
f171020214bcd814466db605c738a81eefcb3503
32e15465c5ae289a665c603e2780c85dafbafcc7
/P0521_SimpleCursorAdapter/src/main/java/ru/startandroid/p0521_simplecursoradapter/MainActivity.java
4056d7c1035b22f1a73c3ab3ad754cf1f11a2bb2
[]
no_license
ExploiD2005/AndriodLessons
5a6de7629a51fa4a59a00fc2595428875e4f6a33
a4574acc83bd40325b80a95579efb0086434f99b
refs/heads/master
2020-12-20T18:33:55.646535
2020-01-25T13:16:35
2020-01-25T13:16:35
236,171,211
1
0
null
null
null
null
UTF-8
Java
false
false
3,030
java
package ru.startandroid.p0521_simplecursoradapter; import android.support.v7.app.AppCompatActivity; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import ru.startandroid.develop.p0521simplecursoradapter.DB; public class MainActivity extends AppCompatActivity { private static final int CM_DELETE_ID = 1; ListView lvData; DB db; SimpleCursorAdapter scAdapter; Cursor cursor; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // открываем подключение к БД db = new DB(this); db.open(); // получаем курсор cursor = db.getAllData(); startManagingCursor(cursor); // формируем столбцы сопоставления String[] from = new String[] { DB.COLUMN_IMG, DB.COLUMN_TXT }; int[] to = new int[] { R.id.ivImg, R.id.tvText }; // создааем адаптер и настраиваем список scAdapter = new SimpleCursorAdapter(this, R.layout.item, cursor, from, to); lvData = (ListView) findViewById(R.id.lvData); lvData.setAdapter(scAdapter); // добавляем контекстное меню к списку registerForContextMenu(lvData); } // обработка нажатия кнопки public void onButtonClick(View view) { // добавляем запись db.addRec("sometext " + (cursor.getCount() + 1), R.mipmap.ic_launcher); // обновляем курсор cursor.requery(); } public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.add(0, CM_DELETE_ID, 0, R.string.delete_record); } public boolean onContextItemSelected(MenuItem item) { if (item.getItemId() == CM_DELETE_ID) { // получаем из пункта контекстного меню данные по пункту списка AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) item.getMenuInfo(); // извлекаем id записи и удаляем соответствующую запись в БД db.delRec(acmi.id); // обновляем курсор cursor.requery(); return true; } return super.onContextItemSelected(item); } protected void onDestroy() { super.onDestroy(); // закрываем подключение при выходе db.close(); } }
1b9c4d5a4fc859f7a514e990e7ca5e7dc3bb1f3f
0277a0c856dcef31ce31d261a3feb685f865b9ce
/app/src/main/java/cn/sskbskdrin/demo/fragment/WebFragment.java
d0f10bedc31c7bc649ca175fcd2febeb6b83b139
[ "Apache-2.0" ]
permissive
sskbskdrin/Android-Pull-To-Anything
9897ae788e91887b43bfdf4a8cac393d1d05dc7b
50d36ca32ef7372756eafdc3cbd2b3f6d8ab6ba6
refs/heads/master
2021-01-18T20:58:59.987103
2019-03-15T07:51:57
2019-03-15T07:51:57
68,984,851
1
0
null
null
null
null
UTF-8
Java
false
false
1,153
java
package cn.sskbskdrin.demo.fragment; import android.webkit.WebView; import android.webkit.WebViewClient; import cn.sskbskdrin.demo.R; import cn.sskbskdrin.pull.PullLayout; import cn.sskbskdrin.pull.PullRefreshCallback; /** * Created by ayke on 2016/9/26 0026. */ public class WebFragment extends BaseFragment { WebView content; @Override protected int getLayoutId() { return R.layout.web_layout; } @Override protected void initView() { super.initView(); content = $(R.id.web_content); } @Override protected void initData() { mPullRefreshHolder.addPullRefreshCallback(PullLayout.Direction.TOP, new PullRefreshCallback() { @Override public void onUIRefreshBegin(PullLayout.Direction direction) { mRootView.postDelayed(new Runnable() { @Override public void run() { content.loadUrl("https://www.baidu.com/"); } }, 2000); } }); content.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { mPullRefreshHolder.refreshComplete(PullLayout.Direction.TOP); } }); mPullRefreshHolder.autoRefresh(PullLayout.Direction.TOP); } }
871445532ed69ab4ba473fb6314f1b9854bcca51
bad0e7c2b45558a3f30d4ffff86db2b97212d94e
/Java/src/com/liu/LeetApp/test/LA002_ThreeSumTest.java
9eafec6da3a1e67677a4e5db397de1e586e0584e
[]
no_license
Olddays/myExercise
eb199bc814b26a919ffea15979e129c2c1f94008
e9620cc0035de94d6b1789b21717ed236fc9069e
refs/heads/master
2021-06-25T06:31:46.290610
2020-08-02T13:49:28
2020-08-02T13:59:13
123,105,951
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package com.liu.LeetApp.test; import java.util.ArrayList; import static com.liu.LeetApp.exercise.LA002_ThreeSum.*; /** * Created by liu on 2016/11/27. */ public class LA002_ThreeSumTest { public static void main(String[] args) { int[] input = new int[]{-1, 0, 2, 1, -2, 1, -4}; ArrayList<ArrayList<Integer>> result; long startTime; long endTime; // 方案一是死循环,不进行测试 startTime = System.currentTimeMillis(); result = testMy2(input); endTime = System.currentTimeMillis(); System.out.println("getThreeSum my 2 during time " + (endTime - startTime)); for (ArrayList<Integer> item : result) { System.out.println("getThreeSum item"); for (int i : item) { System.out.println("getThreeSum i " + i); } } startTime = System.currentTimeMillis(); result = testMy3(input); endTime = System.currentTimeMillis(); System.out.println("getThreeSum my 3 during time " + (endTime - startTime)); for (ArrayList<Integer> item : result) { System.out.println("getThreeSum item"); for (int i : item) { System.out.println("getThreeSum i " + i); } } startTime = System.currentTimeMillis(); result = testAnswer(input); endTime = System.currentTimeMillis(); System.out.println("getThreeSum answer during time " + (endTime - startTime)); for (ArrayList<Integer> item : result) { System.out.println("getThreeSum item"); for (int i : item) { System.out.println("getThreeSum i " + i); } } } private static ArrayList<ArrayList<Integer>> testMy1(int[] input) { return getThreeSumMy1(input); } private static ArrayList<ArrayList<Integer>> testMy2(int[] input) { return getThreeSumMy2(input); } private static ArrayList<ArrayList<Integer>> testMy3(int[] input) { return getThreeSumMy3(input); } private static ArrayList<ArrayList<Integer>> testAnswer(int[] input) { return getThreeSumAnswer(input); } }
27e0069fe2d4d3c0c4a308d9aeccf47b99f7d9f2
3cf2ebcd9fdbaecd00492d27edf23ad3a11f5d2f
/ContactBook/src/main/java/com/cb/input/PhoneDtoInput.java
24d1bd3bde9be1e63a232fd98284fa3a4c7a746c
[]
no_license
Ronaldop819/New-Repository_Trilha_Matera_Java
648f329347d0481ceceb65f3a2f1ecf4cfa8a904
ac3ede1d3207b35feb04a4208bf4b26250462fc4
refs/heads/main
2023-03-23T15:38:57.596834
2021-03-17T11:32:07
2021-03-17T11:32:07
344,821,643
0
0
null
null
null
null
UTF-8
Java
false
false
332
java
package com.cb.input; import javax.validation.constraints.Size; import lombok.Data; @Data public class PhoneDtoInput { private String type; @Size(min=2, max=2, message="DDD must contain 2 digits") private String ddd; @Size(min=8, max=9, message="Phone must contain at least 8 and at most 9") private String number; }
a4bb4f3aa6ea90776a225ab0758f677ec4fd9a3a
a35d493ea994d6fa3591dbc61fb1b52f981d6648
/app/src/main/java/com/example/harmit/swooshcar/OfferRide2Activity.java
9ec77c6956ae97febbdf38465c8117dea6d8f4e5
[]
no_license
milanviradia/SwooshCar
90beaa4fb36a0207379db9080f3f6260d8b74b6f
876411a9ad72c03eab8fb17e1fb314572b855963
refs/heads/master
2020-09-27T16:14:48.795603
2020-01-31T05:58:58
2020-01-31T05:58:58
226,554,239
1
0
null
null
null
null
UTF-8
Java
false
false
9,921
java
package com.example.harmit.swooshcar; import android.app.DatePickerDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.app.TimePickerDialog; import android.content.Intent; import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.DatePicker; import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; import android.widget.TimePicker; import android.widget.Toast; import java.util.ArrayList; import java.util.HashMap; public class OfferRide2Activity extends AppCompatActivity { Spinner spseats, spluggage; ArrayList<String> arlist_seat, arlist_luggage; ArrayAdapter<String> adapter, adapter1; StringBuilder date,date1, time; int year, month, day, hour, minute; boolean aa; EditText cmnts; Button tp, datepicker; TextView tvprice; Button offerride1; String finalResult; String[] distan; String pickup_point; String destination_point; String duration; String distance; String journey_date; String journey_time; String seats; int price; String price2; String luggage; String comments; String HttpURL = "https://lardier-dawns.000webhostapp.com/offer_ride.php"; public static SharedPreferences sharedPreferences; public static SharedPreferences.Editor editor; String username; HashMap<String, String> hashMap = new HashMap<>(); HttpParse httpParse = new HttpParse(); ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_offer_ride2); getSupportActionBar().setTitle(""); getSupportActionBar().setDisplayHomeAsUpEnabled(true); sharedPreferences = getSharedPreferences("login_data",0); editor = sharedPreferences.edit(); Intent i = getIntent(); Bundle b = i.getExtras(); pickup_point = b.getString("origin"); destination_point = b.getString("destination"); duration = b.getString("duration"); distance = b.getString("distance"); username = sharedPreferences.getString("username",""); tvprice = (TextView) findViewById(R.id.price); price = Integer.parseInt(distance) * 3; tvprice.setText(price+""); datepicker = (Button) findViewById(R.id.datePicker); datepicker.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DatePickerDialog mDate = new DatePickerDialog(OfferRide2Activity.this, myDateListener, 2016, 2, 24); mDate.getDatePicker().setMinDate(System.currentTimeMillis() - 1000); mDate.show(); } }); tp = (Button) findViewById(R.id.timepicker); spseats = (Spinner) findViewById(R.id.seats); arlist_seat = new ArrayList<String>(); arlist_seat.add("1"); arlist_seat.add("2"); arlist_seat.add("3"); arlist_seat.add("4"); adapter = new ArrayAdapter<String>(OfferRide2Activity.this, R.layout.support_simple_spinner_dropdown_item, arlist_seat); spseats.setAdapter(adapter); spseats.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { seats = arlist_seat.get(i); } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); spluggage = (Spinner) findViewById(R.id.luggage); arlist_luggage = new ArrayList<String>(); arlist_luggage.add("No Luggage"); arlist_luggage.add("Medium Luggage"); arlist_luggage.add("Heavy Luggage"); adapter1 = new ArrayAdapter<String>(OfferRide2Activity.this, R.layout.support_simple_spinner_dropdown_item, arlist_luggage); spluggage.setAdapter(adapter1); spluggage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { luggage = arlist_luggage.get(i); } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); offerride1 = (Button) findViewById(R.id.offerride1); offerride1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { price = Integer.parseInt(tvprice.getText().toString()); price2 = String.valueOf(price); String[] pickup=pickup_point.split(","); String[] des=destination_point.split(","); cmnts = (EditText) findViewById(R.id.edcmnts); comments = cmnts.getText().toString(); // Toast.makeText(OfferRide2Activity.this, username+pickup_point+destination_point+duration+distance, Toast.LENGTH_LONG).show(); // Toast.makeText(OfferRide2Activity.this, journey_date+journey_time+seats+price, Toast.LENGTH_LONG).show(); // Toast.makeText(OfferRide2Activity.this, comments, Toast.LENGTH_LONG).show(); OfferRideFunctionClass offerRideFunctionClass = new OfferRideFunctionClass(); offerRideFunctionClass.execute(username,pickup[0], des[0], duration, distance, journey_date, journey_time, seats, price2, luggage, comments); } }); } @SuppressWarnings("deprecation") public void setDate(View view) { showDialog(1); Toast.makeText(getApplicationContext(), "select Date", Toast.LENGTH_SHORT).show(); } @SuppressWarnings("deprecation") public void setTime(View view) { showDialog(2); Toast.makeText(getApplicationContext(), "Select Time", Toast.LENGTH_SHORT).show(); } @Override @SuppressWarnings("deprecation") protected Dialog onCreateDialog(int id) { if (id == 1) { return new DatePickerDialog(this, myDateListener, year, month, day); } if (id == 2) { return new TimePickerDialog(this, myTimeListener, hour, minute, aa); } return null; } final DatePickerDialog.OnDateSetListener myDateListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int Year, int monthOfYear, int dayOfMonth) { year = Year; month = monthOfYear + 1; day = dayOfMonth; view.setMinDate(System.currentTimeMillis() - 1000); date = new StringBuilder().append(year).append("-").append(month).append("-").append(day); journey_date = date.toString(); date1 = new StringBuilder().append(day).append("-").append(month).append("-").append(year); datepicker.setText(date1.toString()); } }; private TimePickerDialog.OnTimeSetListener myTimeListener = new TimePickerDialog.OnTimeSetListener() { @Override public void onTimeSet(TimePicker arg0, int arg1, int arg2) { hour = arg1; minute = arg2; time = new StringBuilder().append(hour).append(":").append(minute).append(":").append("00"); journey_time = time.toString(); tp.setText(time); } }; public void increment(View view) { price = price + 10; display(price); } private void display(int p) { tvprice.setText(p+""); } public void decrement(View view) { if (price == 0) { display(price); } else { price = price - 10; display(price); } } class OfferRideFunctionClass extends AsyncTask<String, Void, String> { @Override protected void onPreExecute() { super.onPreExecute(); progressDialog = ProgressDialog.show(OfferRide2Activity.this, "Please Wait", "Posting Your Ride", true, true); } @Override protected void onPostExecute(String httpResponseMsg) { super.onPostExecute(httpResponseMsg); progressDialog.dismiss(); Toast.makeText(OfferRide2Activity.this, httpResponseMsg.toString(), Toast.LENGTH_LONG).show(); Intent intent = new Intent(OfferRide2Activity.this, MainActivity.class); startActivity(intent); OfferRide2Activity.this.finish(); } @Override protected String doInBackground(String... params) { hashMap.put("user_name", params[0]); hashMap.put("pickup_point", params[1]); hashMap.put("destination_point", params[2]); hashMap.put("duration", params[3]); hashMap.put("distance", params[4]); hashMap.put("date", params[5]); hashMap.put("time", params[6]); hashMap.put("seats_offered", params[7]); hashMap.put("price", params[8]); hashMap.put("luggage_size", params[9]); hashMap.put("comments", params[10]); finalResult = httpParse.postRequest(hashMap, HttpURL); return finalResult; } } }
5611f1fc23f49838a37667d664bbebf4ab4b60b1
c51cf7df94697f27851f97cf3146a0f92b274351
/app/src/main/java/chailei/com/qsbkapp/adapters/ShiInfoAdapter.java
beb1bbc39ad3f4fc25f6f2c839e43f52952d4ec8
[]
no_license
chailei9005/QsbkApp
3cd16aea13d2c477be0e1575937e581b8649c54b
919233fafd225e2f5952a234b18b9b9443443ec4
refs/heads/master
2021-01-10T13:28:29.894978
2016-01-04T03:31:22
2016-01-04T03:31:22
48,972,640
0
0
null
null
null
null
UTF-8
Java
false
false
5,927
java
package chailei.com.qsbkapp.adapters; import android.content.Context; import android.net.Uri; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import com.facebook.drawee.view.SimpleDraweeView; import java.util.ArrayList; import java.util.Collection; import java.util.List; import chailei.com.qsbkapp.R; import chailei.com.qsbkapp.entity.Entitys; import chailei.com.qsbkapp.entity.ItemData; /** * Created by Administrator on 16-1-2. */ public class ShiInfoAdapter extends BaseAdapter implements RadioGroup.OnCheckedChangeListener { private Context context; private List<Entitys.ItemsEntity> list; public View.OnClickListener onClickListener; public ShiInfoAdapter(Context context) { this.context = context; list = new ArrayList<>();//初始化list集合 一开始是空集合 等网络加载成功之后再添加数据 } public void setOnClickListener(View.OnClickListener onClickListener) { this.onClickListener = onClickListener; } @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null){ convertView = LayoutInflater.from(context).inflate(R.layout.item,parent,false); Log.d("parent",""+parent); convertView.setTag(new ViewHolder(convertView)); } ViewHolder holder = (ViewHolder) convertView.getTag(); Entitys.ItemsEntity items = list.get(position); ItemData data = new ItemData(); data.setId(items.getId()); if(items.getUser() !=null){ String user_name = items.getUser().getLogin(); holder.item_name.setText(user_name); data.setUser_name(user_name); String user_icon = items.getUser().getIcon(); holder.item_icon.setImageURI(Uri.parse(user_icon)); data.setUser_icon(user_icon); }else{ holder.item_name.setText("匿名用户"); holder.item_icon.setImageURI(Uri.parse("res:///"+R.mipmap.default_anonymous_users_avatar)); } String content = items.getContent(); data.setContent(content); holder.item_content.setText(content); if(items.getImage() != null){ holder.item_image.setVisibility(View.VISIBLE); String imageUrl = items.getImageUrl(); holder.item_image.setImageURI(Uri.parse(imageUrl)); data.setImage_url(imageUrl); List<Integer> s = items.getImage_size().getS(); Log.d("image","image"); holder.item_image.setAspectRatio(1.0f * s.get(0)/s.get(1)); }else if(items.getPic_url()!=null){ holder.item_image.setVisibility(View.VISIBLE); String pic_url = items.getPic_url(); holder.item_image.setImageURI(Uri.parse(pic_url)); data.setPic_url(pic_url); holder.item_image.setAspectRatio(1); }else{ holder.item_image.setVisibility(View.GONE); } holder.group.setOnCheckedChangeListener(this); int vote_count = items.getVotes().getUp(); data.setVote_count(vote_count); holder.item_smile.setText("好笑 " + String.valueOf(vote_count)); int comment_count = items.getComments_count(); data.setComment_count(comment_count); holder.item_comment.setText("评论 " + String.valueOf(comment_count)); int share_count = items.getShare_count(); data.setShare_count(share_count); holder.item_share.setText("分享 "+String.valueOf(share_count)); holder.linear.setTag(data); holder.linear.setOnClickListener(onClickListener); return convertView; } public void addAll(Collection<? extends Entitys.ItemsEntity> collection){ list.addAll(collection); notifyDataSetChanged(); } public void clearAll(){ list.clear(); } @Override public void onCheckedChanged(RadioGroup group, int checkedId) { } public static class ViewHolder{ private final SimpleDraweeView item_icon; private final TextView item_name; private final TextView item_content; private final TextView item_smile; private final TextView item_comment; private final TextView item_share; private final SimpleDraweeView item_image; private final RadioButton support; private final RadioButton unSupport; private final RadioGroup group; private final LinearLayout linear; public ViewHolder(View view){ item_icon = (SimpleDraweeView)view.findViewById(R.id.item_icon); item_name = (TextView) view.findViewById(R.id.item_name); item_content = (TextView) view.findViewById(R.id.item_content); item_smile = (TextView) view.findViewById(R.id.item_smile); item_comment = (TextView) view.findViewById(R.id.item_comment); item_share = (TextView) view.findViewById(R.id.item_share); item_image = (SimpleDraweeView) view.findViewById(R.id.item_image); linear = (LinearLayout) view.findViewById(R.id.item_linear); support = (RadioButton) view.findViewById(R.id.item_smile_icon); unSupport = (RadioButton) view.findViewById(R.id.item_no_smile_icon); group = (RadioGroup) view.findViewById(R.id.item_radio); } } }
[ "chl198912272hyj" ]
chl198912272hyj
6d3ab4984de538a87c034370ebd7f1311cb0b018
57c67aa726d1d0bd0a122f9d50a5076a4c43ed95
/ELTECinema-backend/src/test/java/hu/elte/inf/alkfejl/cinema/config/DatabaseConfigTest.java
29cb34c22f8c4a4a23c73d74181b4535faee44cf
[]
no_license
Bluecrack0/ELTECinema
68abc12500ddc2e97d03c110d72a875834b834b1
382fb4c00ae9778d180427852149032b1139c351
refs/heads/master
2021-05-15T23:38:50.030545
2018-01-03T09:36:44
2018-01-03T09:36:44
106,921,282
0
1
null
null
null
null
UTF-8
Java
false
false
1,730
java
package hu.elte.inf.alkfejl.cinema.config; import hu.elte.inf.alkfejl.cinema.model.*; //import org.apache.commons.dbcp.BasicDataSource; import org.hibernate.SessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBean; import javax.sql.DataSource; import java.util.Properties; @Configuration public class DatabaseConfigTest { private static Logger logger = LoggerFactory.getLogger(DatabaseConfigTest.class); @Autowired DataSource dataSource; @Bean LocalSessionFactoryBean sessionFactory() { LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean(); factoryBean.setDataSource(dataSource); factoryBean.setAnnotatedClasses(Movie.class, CinemaRoom.class, Screening.class, Actor.class, ConfirmationCode.class, User.class, Reservation.class, News.class); Properties hibernateProperties = hibernateProperties(); factoryBean.setHibernateProperties(hibernateProperties); return factoryBean; } @Autowired @Bean HibernateTransactionManager transactionManager(SessionFactory sessionFactory) { return new HibernateTransactionManager(sessionFactory); } private Properties hibernateProperties() { Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); return hibernateProperties; } }
2b27c748ad2b73b40b038a607092a9460799dcfb
bccb412254b3e6f35a5c4dd227f440ecbbb60db9
/hl7/model/V2_4/segment/BLG.java
845bdc7589cce314a97270af036134b66bc7b993
[]
no_license
nlp-lap/Version_Compatible_HL7_Parser
8bdb307aa75a5317265f730c5b2ac92ae430962b
9977e1fcd1400916efc4aa161588beae81900cfd
refs/heads/master
2021-03-03T15:05:36.071491
2020-03-09T07:54:42
2020-03-09T07:54:42
245,967,680
0
0
null
null
null
null
UHC
Java
false
false
9,962
java
package hl7.model.V2_4.segment; import hl7.bean.datastructure.DataStructure; import hl7.bean.message.MessageStructure; import hl7.bean.segment.Segment; import hl7.bean.table.Table; public class BLG extends hl7.model.V2_31.segment.BLG{ public static final String VERSION = "2.4"; public static int SIZE = 3; public DataStructure[][] components = new DataStructure[SIZE][]; public static DataStructure[] standard = new DataStructure[SIZE]; public static Table[] tables = new Table[SIZE]; public static String[] descriptions = new String[SIZE]; public static boolean[] required = new boolean[SIZE]; public static boolean[] optional = new boolean[SIZE]; public static boolean[] conditional = new boolean[SIZE]; public static boolean[] repeatable = new boolean[SIZE]; public static int[] minLength = new int[SIZE]; public static int[] maxLength = new int[SIZE]; static{ standard[0]=hl7.pseudo.datastructure.CCD.CLASS; standard[1]=hl7.bean.datastructure.primitive.ID.CLASS; standard[2]=hl7.pseudo.datastructure.CX.CLASS; tables[0]=hl7.model.V2_4.table.Table0100.getInstance(); tables[1]=hl7.model.V2_4.table.Table0122.getInstance(); tables[2]=null; descriptions[0]="WHEN_TO_CHARGE"; descriptions[1]="CHARGE_TYPE"; descriptions[2]="ACCOUNT_ID"; required[0]=false; required[1]=false; required[2]=false; optional[0]=true; optional[1]=true; optional[2]=true; conditional[0]=false; conditional[1]=false; conditional[2]=false; repeatable [0]=true; repeatable [1]=true; repeatable [2]=true; minLength[0]=0; minLength[1]=0; minLength[2]=0; maxLength[0]=40; maxLength[1]=50; maxLength[2]=100; } public BLG(){ type = Segment.BLG; } @Override public Segment cloneClass(String originalVersion, String setVersion) { hl7.pseudo.segment.BLG seg = new hl7.pseudo.segment.BLG(); seg.originalVersion = originalVersion; seg.setVersion = setVersion; return seg; } public void setVersion(String setVersion) { super.setVersion(setVersion); this.setVersion = setVersion; for(int i=0; i<components.length; i++){ DataStructure[] dataStructures = components[i]; for(int c=0; dataStructures!=null&&c<dataStructures.length; c++){ DataStructure dataStructure = components[i][c]; if(dataStructure!=null) dataStructure.setVersion(setVersion); } } } public void originalVersion(String originalVersion) { super.originalVersion(originalVersion); this.originalVersion = originalVersion; for(int i=0; i<components.length; i++){ DataStructure[] dataStructures = components[i]; for(int c=0; dataStructures!=null&&c<dataStructures.length; c++){ DataStructure dataStructure = components[i][c]; if(dataStructure!=null) dataStructure.originalVersion(originalVersion); } } } public DataStructure[][] getComponents(){ if(setVersion.equals(VERSION)){ return components; }else{ return super.getComponents(); } } private boolean compiled = false; //최초 컴파일 여부 확인 public void decode(String message) throws Exception { if(MessageStructure.getVersionCode(originalVersion)<MessageStructure.getVersionCode(VERSION)){ super.decode(message); }else{ compiled = true; //최초 컴파일 여부 확인 char separator = MessageStructure.FIELD_SEPARATOR; String[] comps = divide(message, separator); if(comps==null) return; for(int i=1; i<components.length&&comps!=null&&i<comps.length; i++){ //반복 메시지 처리 String[] messages = divide(comps[i], MessageStructure.REPEATITION_SEPARATOR); if(messages==null) continue; DataStructure[] dataStructures = new DataStructure[messages.length]; components[i-1] = dataStructures; for(int c=0; c<messages.length; c++){ components[i-1][c] = standard[i-1].cloneClass(originalVersion, setVersion); components[i-1][c].originalVersion(originalVersion); components[i-1][c].decode(messages[c]); } } } } /* ----------------------------------------------------------------- * 이전 버전으로 매핑 components:구버전, subComponents:신버전 * 신버전 메시지-->구버전 파서(상위호환) * ----------------------------------------------------------------- */ public static void backward(DataStructure[][] components, DataStructure[][] subComponents, String originalVersion, String setVersion, String prevVersion) throws Exception{ for(int i=0; subComponents!=null&&i<subComponents.length; i++){ if(i>=SIZE) break; if(subComponents[i]==null) continue; DataStructure[] subComps = new DataStructure[subComponents[i].length]; components[i] = subComps; for(int c=0; c<subComps.length; c++){ if(i==0) components[i][c] = subComponents[i][c]; if(i==1) components[i][c] = subComponents[i][c]; if(i==2) components[i][c] = subComponents[i][c]; if(components[i][c]==null) continue; components[i][c].depth(subComponents[i][c].depth); subComponents[i][c].setVersion(prevVersion); String data = subComponents[i][c].encode(); components[i][c].decode(data); } } } /* ----------------------------------------------------------------- * 이후 버전으로 매핑 components:구버전, subComponents:신버전 * 구버전 메시지-->신버전 파서(하위호환) * ----------------------------------------------------------------- */ public static void forward(DataStructure[][] components, DataStructure[][] subComponents, String originalVersion, String setVersion) throws Exception{ for(int i=0; components!=null&&i<components.length; i++){ if(components[i]==null) continue; DataStructure[] comps = new DataStructure[components[i].length]; subComponents[i] = comps; for(int c=0; c<comps.length; c++){ if(i==0) subComponents[i][c] = components[i][c]; if(i==1) subComponents[i][c] = components[i][c]; if(i==2) subComponents[i][c] = components[i][c]; if(components[i][c]==null) continue; subComponents[i][c].depth(components[i][c].depth); components[i][c].setVersion(originalVersion); String data = components[i][c].encode(); subComponents[i][c].decode(data); } } } public String encode() throws Exception{ seekOriginalVersion = true; //가장 마지막 메소드에서 위치찾기 옵션 설정 return encode(null); } public String encode(DataStructure[][] subComponents) throws Exception{ if(seekOriginalVersion&&MessageStructure.getVersionCode(originalVersion)<MessageStructure.getVersionCode(VERSION)){ //실제 버전의 위치 찾기 //실제 버전이 현재 위치가 아닐 때 //실제 버전 위치 찾아가기 return super.encode(null); }else{//실제 버전의 위치 찾기 seekOriginalVersion = false; //실제 버전이 현재 위치일 때 if(setVersion.equals(VERSION)){ //설정 버전의 위치 찾기 //설정 버전이 현재 위치일 때 String message = this.makeMessage(components, VERSION); return message; }else{ //설정 버전의 위치 찾기 //설정 버전이 현재 위치가 아닐 때 if(MessageStructure.getVersionCode(setVersion)<MessageStructure.getVersionCode(VERSION)){ //버전으로 이동 방향 찾기 //설정 버전이 현재 버전보다 낮을 때 (backward) //if(MessageStructure.getVersionCode(originalVersion)>=MessageStructure.getVersionCode(VERSION)){ hl7.model.V2_31.segment.BLG type = (hl7.model.V2_31.segment.BLG)this; type.backward(type.components, components, originalVersion, setVersion, VERSION); //} //설정 버전의 위치로 찾아가기 return super.encode(components); }else{ //버전으로 이동 방향 찾기 /*------------------------------------------------------------- *설정 버전이 현재 버전보다 높을 때(forward) *이후 버전으로 Casting 후 forward 호출 *마지막 버전은 생략 *----------------------------------------------------------------- */ encodeVersion = VERSION; return this.encodeForward(encodeVersion, setVersion); } } } } public String encodeForward(String encodeVersion, String setVersion) throws Exception{ //하위 버전으로 인코딩 시 해당 위치를 찾아 가도록 (메소드 오버라이딩 때문에 처음부터 다시 찾아가야 함) if(encodeVersion.equals(VERSION)){ hl7.model.V2_5.segment.BLG type = (hl7.model.V2_5.segment.BLG)this; type.forward(this.components, type.components, originalVersion, setVersion); encodeVersion = type.VERSION; if(encodeVersion.equals(setVersion)) return type.makeMessage(type.components, encodeVersion); else return encodeForward(encodeVersion, setVersion); }else{ return super.encodeForward(encodeVersion, setVersion); } } public String makeMessage(DataStructure[][] components, String version) throws Exception{ if(VERSION.equals(version)){ setCharacter(components, VERSION); String message = ""; boolean add = false; //뒤쪽에서 컴포넌트가 존재할 때 true char separator = MessageStructure.FIELD_SEPARATOR; for(int i=components.length-1; i>=0; i--){ DataStructure[] dataStructures = components[i]; if(dataStructures!=null || required[i]) add=true; //필수항목부터 추가 String component = ""; for(int c=0; dataStructures!=null&&c<dataStructures.length; c++){ if(!repeatable[i]&&c>0) continue; DataStructure comp = dataStructures[c]; if(comp==null) continue; String data = comp.encode(); if(data==null) data=""; if(maxLength[i]>0&&data.length()>maxLength[i]) data=data.substring(0, maxLength[i]); if(c>0) component += MessageStructure.REPEATITION_SEPARATOR; component += data; } if(add) message = component + ((message.length()>0)?separator:"") + message; } return (message.length()==0)?null:type+separator+message; }else{ return super.makeMessage(components, version); } } }
4acdde77f2e5922ea54d7a1e10db02286b24714f
38f2f4dc34946c560e96b44e061cb97ca55bc703
/Client.java
7a8e2ad676bbdadba7c131cd8ff1293c4ebfd438
[]
no_license
Hashmi1/Chess
ed640e5437fbe1877243c96c2fafdf7c9d8d2f90
f96cd99f52a7caadce6d7433322313cf7a86f445
refs/heads/master
2021-01-20T08:47:10.705185
2012-04-19T07:09:25
2012-04-19T07:09:25
4,072,589
1
1
null
null
null
null
UTF-8
Java
false
false
2,819
java
import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import javax.swing.JOptionPane; public class Client implements ClientInterface { Client() {} private ServerInterface ServerStub; public void register(String host) { try { Registry registry = LocateRegistry.getRegistry(host); ServerStub = (ServerInterface) registry.lookup("ServerInterface"); Client obj = new Client(); ClientInterface ClientStub = (ClientInterface) UnicastRemoteObject.exportObject(obj, 0); ServerStub.EstablishConnection(ClientStub); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Could not Connect. Make sure that you enter a valid IP-Address" + '\n' + "See Console for details." ,"Connection Error",JOptionPane.ERROR_MESSAGE); System.err.println("Client exception: " + e.toString()); e.printStackTrace(); GameState.exit(false); } } public void send(final Location oldLocation, final Location newLocation) { Thread thread = new Thread(new Runnable() { @Override public void run() { try { ServerStub.TellServer(oldLocation, newLocation); } catch (Exception e) { JOptionPane.showMessageDialog(null, e.getLocalizedMessage() + "." + '\n' + "See Console for details." ,"Connection Error",JOptionPane.ERROR_MESSAGE); System.err.println("Client exception: " + e.toString()); e.printStackTrace(); GameState.restartMessage(); } } }); thread.start(); } public void TellClient(Location oldLocation, Location newLocation) { Thread newMoveThread = new moveUnit(Board.getUnitAtLocation(oldLocation), newLocation); newMoveThread.start(); } public void TellServer(Location oldLocation, Location newLocation) { final Location oldLocation_fin = oldLocation; final Location newLocation_fin = newLocation; Thread moveThread = new Thread(new Runnable() { @Override public void run() { send(oldLocation_fin,newLocation_fin); } }); moveThread.start(); } /** Call when Server prematurel leaves the game. * * * */ public void SayGoodByeToServer() { Thread thread = new Thread(new Runnable() { @Override public void run() { try { ServerStub.SayGoodByeToServer(); } catch (RemoteException e) { // TODO Auto-generated catch block //e.printStackTrace(); } } }); thread.start(); } public void SayGoodByeToClient() throws RemoteException { JOptionPane.showMessageDialog(null, "Server (White) has left the game." ,"GoodBye",JOptionPane.INFORMATION_MESSAGE); GameState.restartMessage(); } }
8ad4c5ab9f0c61a4921d6a05007e554ab80b4993
a16b2a58625081530c089568e2b29f74e23f95a9
/orbe/src/main/java/orbe/model/io/LineStyleOXMLAdapter.java
3808ee3be534b3771e1246a6c87c66af70413831
[]
no_license
dcoraboeuf/orbe
440335b109dee2ee3db9ee2ab38430783e7a3dfb
dae644da030e5a5461df68936fea43f2f31271dd
refs/heads/master
2022-01-27T10:18:43.222802
2022-01-01T11:45:35
2022-01-01T11:45:35
178,600,867
0
0
null
2022-01-01T11:46:01
2019-03-30T19:13:13
Java
UTF-8
Java
false
false
801
java
/* * Created on Sep 17, 2007 */ package orbe.model.io; import net.sf.doolin.oxml.OXMLContext; import net.sf.doolin.oxml.adapter.OXMLAdapter; import net.sf.doolin.util.xml.DOMUtils; import orbe.model.OrbeMap; import orbe.model.style.StyleLine; import org.w3c.dom.Element; import org.w3c.dom.Node; public class LineStyleOXMLAdapter implements OXMLAdapter { public Object adapt(Node currentNode, String path, OXMLContext context) { Node styleNode = context.getXpath().selectSingleNode(currentNode, path); if (styleNode == null) { return null; } else { int id = DOMUtils.getIntAttribute((Element) styleNode, "id", true, 0); OrbeMap map = (OrbeMap) context.instanceGet("Map"); StyleLine styleLine = map.getSettings().getStyleLineList().getStyle(id); return styleLine; } } }
3c724366b1015212864de0fdeb6410f5f3187988
874af9c113566d44a410652a0fed0f0fb78f6727
/src/main/java/com/keranjangkita/repository/ItemMasterUnbarcodedRespository.java
01e4771b28a0632d29d608655339d8ec288b05f3
[]
no_license
arrdevs/ckk-core
dc8538ee4a57aac277c787c09ee3328846ddf0c3
698e01ea22c2344abd139d95f65bc8288f508c6a
refs/heads/master
2020-04-06T13:04:58.720922
2018-11-25T03:21:41
2018-11-25T03:21:41
157,483,209
0
0
null
null
null
null
UTF-8
Java
false
false
325
java
package com.keranjangkita.repository; import org.springframework.data.repository.PagingAndSortingRepository; import com.keranjangkita.model.ItemMaster; import com.keranjangkita.model.ItemMasterUnbarcode; public interface ItemMasterUnbarcodedRespository extends PagingAndSortingRepository<ItemMasterUnbarcode, String> { }
daa4c6eb9e6df3ded5f744aff3aec4ee2f683957
d322e3e191821d10bb2bd3138b8c3c50a14c8960
/testcodes/ControllerTest.java
032f2c9d450c06dad788719fe55ec35b39ed9df1
[]
no_license
arpitpandey0209/Group-6
19fb32035657e7144a7e5b524063de91478b37be
35f49dc753d209b851c8cfeba344d4795246153a
refs/heads/master
2021-01-17T22:42:43.755651
2014-11-23T02:34:47
2014-11-23T02:34:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class ControllerTest { /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { } /** * @throws java.lang.Exception */ @AfterClass public static void tearDownAfterClass() throws Exception { } /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { } @Test public void test() { fail("Not yet implemented"); } }
5f45a371ccb68913fad5a7aa81665a4ede798282
9c60e57882020abb26cf9fb1e65e6ca2a21f8602
/programmers/기지국설치.java
262c6690a095a609df3db46939b85bde4e623854
[]
no_license
Kim-Seongyoung/onlinejudge
73a7cca574971ed3716a9cbd4a2ffd22d9a9ada3
66ea3212393335f4d861b150a9a0bcff8fb4315a
refs/heads/master
2023-03-28T15:11:59.584428
2021-04-02T08:43:51
2021-04-02T08:43:51
273,191,321
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package programmers; public class 기지국설치 { public static void main(String[] args) { // TODO Auto-generated method stub } public int solution(int n, int[] stations, int w) { //40분 int answer = 0; int l = 2*w+1; int curr = 1; int pivot = 0; while (curr <= n) { if (pivot < stations.length) { if (curr < stations[pivot] - w) { answer++; curr += l; } else { curr = stations[pivot]+w + 1; pivot++; } }else { int temp = (n-curr)+1; int result = temp/l; if(temp%l!=0) { result++; } answer += result; break; } } return answer; } }
1fe83179c5abb4120472a11c521d29ed22be777a
0ed19d9a11af4dd40c76e8a3621ac9f266505f62
/src/captor/windowsystem/main/menubar/ProjectMenuListener.java
e2c9e174ea44026209a0bf2114d498b038f2ce41
[]
no_license
magsilva/captor
81be814d3d9275e06667b81b393fdd2047d7b842
4de27a81fc701aaa22eef7f0e2f51755cc0346b9
refs/heads/master
2021-01-18T14:09:46.700060
2015-01-23T01:16:14
2015-01-23T01:16:14
14,451,888
0
0
null
null
null
null
UTF-8
Java
false
false
2,667
java
package captor.windowsystem.main.menubar; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; import captor.lib.intl.MyIntl; import captor.modelsystem.Model; import captor.modelsystem.Project; import captor.projectsystem.ProjectSystem; import captor.windowsystem.projectmanager.saveas.SaveAsWindow; public class ProjectMenuListener implements ActionListener { private Model model; public ProjectMenuListener(Model model) { this.model = model; } //------------------------------------------------------------------------- public void actionPerformed (ActionEvent e) { if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_OPEN) ) { ProjectSystem pm = new ProjectSystem(model); pm.openProject(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_PROPERTIES) ) { ProjectSystem pm = new ProjectSystem(model); pm.showProperties(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_VALIDATE) ) { ProjectSystem pj = new ProjectSystem(model); pj.validate(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_SAVE) ) { model.getGui().getGuiView().setClearAllViews(true); ProjectSystem pj = new ProjectSystem(model); pj.save(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_SAVEAS) ) { //verificar o estado do projeto atual if ( model.getProject() == null ) { JOptionPane.showMessageDialog(model.getGui().getCaptorWindow(), MyIntl.MSG80); return; } if ( model.getProject().getStatus() == Project.CLOSED ) { JOptionPane.showMessageDialog(model.getGui().getCaptorWindow(), MyIntl.MSG80); return; } SaveAsWindow saw = new SaveAsWindow(model); saw.setVisible(true); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_CLEAN) ) { ProjectSystem pj = new ProjectSystem(model); pj.clean(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_CLOSE) ) { ProjectSystem pm = new ProjectSystem(model); pm.closeProject(); } else if ( e.getActionCommand().equals(MyIntl.SUBMENU_BAR_BUILD) ) { ProjectSystem pj = new ProjectSystem(model); pj.build(); } } //------------------------------------------------------------------------- }
[ "magsilva@af7bf151-d49d-4a85-9d03-aee0806bfb2f" ]
magsilva@af7bf151-d49d-4a85-9d03-aee0806bfb2f
46b9f8e6466029c56d383f15245fdd37af561d18
64865a00fd5dcfccf596f9f734b7898d34a4bbbb
/micservicecloud-api/src/main/java/com/xiaomin/vo/Dept.java
bf959ecfc7773ce57c27fc7b25378db95b938025
[]
no_license
lixiaomin9527/micservicecloud
47cdef4ed191b12dfb89dd2aad2a192e2c33fcc8
5b6349eb8710f145261d664eb9c04d277e26419b
refs/heads/master
2022-08-18T08:03:00.218925
2019-06-16T06:09:52
2019-06-16T06:11:14
192,157,481
0
0
null
2020-10-13T13:56:13
2019-06-16T06:21:30
Java
UTF-8
Java
false
false
707
java
package com.xiaomin.vo; import java.io.Serializable; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; public class Dept implements Serializable { private static final long serialVersionUID = 1L; private Long deptNo; private String dName; private String dbSource; public Long getDeptNo() { return deptNo; } public void setDeptNo(Long deptNo) { this.deptNo = deptNo; } public String getdName() { return dName; } public void setdName(String dName) { this.dName = dName; } public String getDbSource() { return dbSource; } public void setDbSource(String dbSource) { this.dbSource = dbSource; } }
2fed15f255d8e15dab358a2a632bc242245d42be
c7e25547dc70edd9eda50cb901ef7d56ebae4994
/java_project_2_master/Section3/Operators/src/academy/learnprogramming/Main.java
1bd8e2c5ecbd93485bfdb07a51259f61c86adce3
[]
no_license
James-Strom/Java_main
6a7d6b8ad0f7ce3a14994ca290e02d25de7d64c0
493d012ba758bed6889e50e19878397d41651e6d
refs/heads/main
2023-08-14T05:51:27.180686
2021-10-15T09:51:01
2021-10-15T09:51:01
380,944,825
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
package academy.learnprogramming; public class Main { public static void main(String[] args) { int result = 1 + 2; //1 + 2 = 3 System.out.println("1 + 2 = " + result); int previousResult = result; System.out.println("previousResult = " + previousResult); result = result - 1; // 3 - 1 = 2 System.out.println("3 - 1 = " + result); System.out.println("previousResult = " + previousResult); result = result * 10; // 2 * 10 = 20 System.out.println("2 * 10 = " + result); result = result / 5; // 20 / 5 = 4 System.out.println("20 / 5 = " + result); result = result % 3; // the remainder of (4 % 3) = 1 System.out.println("4 % 3 = " + result); // result = result + 1; result++; // 1 + 1 = 2 System.out.println("1 + 1 = " + result); result--; // 2 - 1 = 1 System.out.println("2 - 1 = " + result); // result = result = 2 result += 2; // 1 + 2 = 3 System.out.println("1 + 2 = " + result); // result = result * 10; result *= 10; // 3 * 10 = 30 System.out.println("3 * 10 = " + result); //result = result / 3 result /= 3; //30 / 3 = 10 System.out.println("30 / 3 = " + result); // result = result - 2 result -=2; // 10 - 2 = 8 System.out.println("10 - 2 = " + result); boolean isAlien = false; if (isAlien == false) { System.out.println("It is not an alien, "); System.out.println("\tand I am scared of aliens."); } int topScore = 80; if (topScore < 100) { System.out.println("You got the high score!"); } int secondTopScore = 60; if ((topScore > secondTopScore) && (topScore < 100)) { System.out.println("Greater than Second top score and less than 100"); } if ((topScore > 90) || (secondTopScore <= 90)) { System.out.println("Either one or both conditions are true"); } int newValue = 50; if (newValue == 50) { System.out.println("this is not an error"); } boolean isCar = false; if (isCar) { System.out.println("This is not supposed to happen"); } isCar = true; boolean wasCar = isCar ? true : false; if (wasCar) { System.out.println("wasCar is true"); } } }
b87cd733dbc1ccde4a51cf7732ca868f74b254bf
d70acdff82803610644ab3b740007dfccad1db19
/src/main/java/vvv/timesheet/service/UserService.java
1b504a7c99cbd5b90301075d8cafefaedba98404
[]
no_license
victorvashkevich/timesheet
45670416209a12686b5ac17fea9cf05877f0ac99
28e50d4eff881aefd517e920984a02049479d984
refs/heads/master
2022-12-21T06:01:05.225096
2020-04-08T12:48:45
2020-04-08T12:48:45
249,643,930
1
0
null
2022-12-16T15:28:39
2020-03-24T07:45:40
JavaScript
UTF-8
Java
false
false
211
java
package vvv.timesheet.service; import vvv.timesheet.model.User; import java.util.List; public interface UserService { User getById(String id); User getByName(String name); List<User> getUsers(); }
bae6774eb3deec0a05b2f7faf05322431e4b0b9e
2389c831bc8e2e86e812754dc6734d2b25320035
/src/com/gtc/os/service/UserService.java
985b5d9f8be04808e35862444b9aa37f60b27463
[]
no_license
AndyHun/miniGTC
bf6f97245dce348f6bac379d6e8c362bee355bfa
735b504291ab41e0b538b28661161244aa1717a4
refs/heads/master
2016-09-06T16:20:38.034747
2015-07-08T06:37:31
2015-07-08T06:37:31
11,495,481
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
/** * UserService.java Nov 7, 2012 * * Copyright 2012 General TECH , Inc. All rights reserved. */ package com.gtc.os.service; import com.gtc.core.service.BaseService; /** *@description * * @author AndyHun * @version 1.0 */ public interface UserService extends BaseService{ }
80917c7fbfea4217a15534a37993c4045ed57f5c
e7596e32cdba365ec6f5decf8e6823c44d2bd0a1
/Source/MyShop/src/entities/CtkhuyenMai.java
3b78a2b4594c17c349471fb28f92aafc2a7d3a4a
[]
no_license
NguyenDucHoangLong/Group_4_HTTTHD
31544d432f729621c3e96f6b71e7652b7caa9791
0f7dfa8aa33513802e9672d098ac936f29969314
refs/heads/master
2021-01-10T19:23:02.858971
2016-01-13T14:15:23
2016-01-13T14:15:59
42,974,471
0
1
null
null
null
null
UTF-8
Java
false
false
2,393
java
package entities; // Generated Dec 9, 2015 9:41:21 PM by Hibernate Tools 4.3.1.Final import java.util.Date; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * CtkhuyenMai generated by hbm2java */ @Entity @Table(name = "CTKhuyenMai") public class CtkhuyenMai implements java.io.Serializable { private CtkhuyenMaiId id; private SanPham sanPham; private Double chietKhau; private Date ngayBd; private Date ngayKt; public CtkhuyenMai() { } public CtkhuyenMai(CtkhuyenMaiId id, SanPham sanPham) { this.id = id; this.sanPham = sanPham; } public CtkhuyenMai(CtkhuyenMaiId id, SanPham sanPham, Double chietKhau, Date ngayBd, Date ngayKt) { this.id = id; this.sanPham = sanPham; this.chietKhau = chietKhau; this.ngayBd = ngayBd; this.ngayKt = ngayKt; } @EmbeddedId @AttributeOverrides({ @AttributeOverride(name = "maKm", column = @Column(name = "MaKM", nullable = false) ), @AttributeOverride(name = "maSp", column = @Column(name = "MaSP", nullable = false) ) }) public CtkhuyenMaiId getId() { return this.id; } public void setId(CtkhuyenMaiId id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "MaSP", nullable = false, insertable = false, updatable = false) public SanPham getSanPham() { return this.sanPham; } public void setSanPham(SanPham sanPham) { this.sanPham = sanPham; } @Column(name = "ChietKhau", precision = 53, scale = 0) public Double getChietKhau() { return this.chietKhau; } public void setChietKhau(Double chietKhau) { this.chietKhau = chietKhau; } @Temporal(TemporalType.DATE) @Column(name = "NgayBD", length = 10) public Date getNgayBd() { return this.ngayBd; } public void setNgayBd(Date ngayBd) { this.ngayBd = ngayBd; } @Temporal(TemporalType.DATE) @Column(name = "NgayKT", length = 10) public Date getNgayKt() { return this.ngayKt; } public void setNgayKt(Date ngayKt) { this.ngayKt = ngayKt; } }
467e7b138c22f2462662be67dabc6e8852e7ff40
69b94255070f09f35fe2086215f55c0d576745be
/GitToolBox/src/main/java/zielu/gittoolbox/ui/config/AbsoluteDateTimeStyleRenderer.java
2c41345314db400d12afc114734a1377f6b2a1b8
[ "CC-BY-3.0", "Apache-2.0" ]
permissive
panda2025/GitToolBox
f481979f968503bc3acc28918ef1cd01371886f7
6cd843f9b475c1c3ff8b6d13f221a6fe430342d5
refs/heads/master
2020-12-15T12:18:51.134291
2020-01-20T13:02:28
2020-01-20T13:02:28
235,100,807
1
0
Apache-2.0
2020-01-20T12:52:44
2020-01-20T12:52:43
null
UTF-8
Java
false
false
821
java
package zielu.gittoolbox.ui.config; import com.intellij.ui.ColoredListCellRenderer; import com.intellij.ui.SimpleTextAttributes; import java.util.Date; import javax.swing.JList; import org.jetbrains.annotations.NotNull; import zielu.gittoolbox.config.AbsoluteDateTimeStyle; public class AbsoluteDateTimeStyleRenderer extends ColoredListCellRenderer<AbsoluteDateTimeStyle> { private final Date now = new Date(); @Override protected void customizeCellRenderer(@NotNull JList<? extends AbsoluteDateTimeStyle> list, AbsoluteDateTimeStyle value, int index, boolean selected, boolean hasFocus) { append(value.getFormat().format(now)); if (value == AbsoluteDateTimeStyle.FROM_LOCALE) { append(" Default", SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES); } } }
f32638fb353e4ae0c3b80f6b7b11798a45c90318
a0bfbedac2c7b9bfd40d152eeeedb6b9fac9233c
/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperationsImpl.java
1bec2266858997c7df555d43bca0ba6bef85d436
[]
no_license
psiserver/accumulo-1.6.2
3535899c1afeb19f01bba4e1b095db6c5482de8f
93be98ceabdb5c5ee7b04c6391e68d0361168b59
refs/heads/master
2021-01-10T04:45:34.715954
2015-05-21T13:15:51
2015-05-21T13:15:51
36,014,863
0
0
null
null
null
null
UTF-8
Java
false
false
2,971
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.accumulo.core.client.mock; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.admin.ActiveCompaction; import org.apache.accumulo.core.client.admin.ActiveScan; import org.apache.accumulo.core.client.admin.InstanceOperations; import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader; class MockInstanceOperationsImpl implements InstanceOperations { MockAccumulo acu; public MockInstanceOperationsImpl(MockAccumulo acu) { this.acu = acu; } @Override public void setProperty(String property, String value) throws AccumuloException, AccumuloSecurityException { acu.setProperty(property, value); } @Override public void removeProperty(String property) throws AccumuloException, AccumuloSecurityException { acu.removeProperty(property); } @Override public Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException { return acu.systemProperties; } @Override public Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException { return acu.systemProperties; } @Override public List<String> getTabletServers() { return new ArrayList<String>(); } @Override public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException { return new ArrayList<ActiveScan>(); } @Override public boolean testClassLoad(String className, String asTypeName) throws AccumuloException, AccumuloSecurityException { try { AccumuloVFSClassLoader.loadClass(className, Class.forName(asTypeName)); } catch (ClassNotFoundException e) { e.printStackTrace(); return false; } return true; } @Override public List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException { return new ArrayList<ActiveCompaction>(); } @Override public void ping(String tserver) throws AccumuloException { } }
b6a5512653cf525a65de91864f68cf783fc6be04
b1817741d4a109a5d7f193fdb42c8168d29d6779
/app/src/main/java/com/example/kyoungae/myapplication/shipping/ShippingActivity.java
02c5a0775a488ce2553b7329af436e68203d5e36
[]
no_license
kty116/TBU2
6dc4432c22426a6d805048504040e386b567cb3e
90a8d3de9e16ee8cf9ad508d986477711ddbd4de
refs/heads/master
2021-05-06T00:53:19.713304
2017-12-15T06:58:04
2017-12-15T06:58:04
114,337,632
0
0
null
null
null
null
UTF-8
Java
false
false
17,883
java
package com.example.kyoungae.myapplication.shipping; import android.content.Intent; import android.databinding.DataBindingUtil; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.Toast; import com.example.kyoungae.myapplication.R; import com.example.kyoungae.myapplication.common.CommonLib; import com.example.kyoungae.myapplication.databinding.ActivityShippingBinding; import com.example.kyoungae.myapplication.dto.KeyDTO; import com.example.kyoungae.myapplication.event.MessageEvent; import com.example.kyoungae.myapplication.event.ShippingNextButtonEvent; import com.example.kyoungae.myapplication.lib.TheBayRestClient; import com.example.kyoungae.myapplication.login.LoginActivity; import com.example.kyoungae.myapplication.main.NoticeFragment; import com.example.kyoungae.myapplication.shipping.model.AddressModel; import com.example.kyoungae.myapplication.shipping.model.CategoryModel; import com.example.kyoungae.myapplication.shipping.model.ShippingCenterModel; import com.example.kyoungae.myapplication.shipping.model.ShippingProductModel; import com.loopj.android.http.JsonHttpResponseHandler; import com.loopj.android.http.RequestParams; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import cz.msebera.android.httpclient.Header; public class ShippingActivity extends AppCompatActivity implements View.OnClickListener { private ActivityShippingBinding binding; private PagerAdapter pagerAdapter; private boolean isMovePageThread = true; private String mUrl = "Acting/OrdReq_S.php"; // public static HashMap<Integer, ShippingProductModel> sProductModelHashMap; public static ArrayList<ShippingProductModel> sProductModelList; private String mCenterName; private String mAddress; private ArrayList<CategoryModel> mCategoryList; private AddressModel mAddressModel; private String mMemberName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = DataBindingUtil.setContentView(this, R.layout.activity_shipping); setTitle("배송대행신청"); setSupportActionBar(binding.toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); setData(); } public void setData() { RequestParams params = new RequestParams(); KeyDTO keyInfo = CommonLib.getKeyInfo(this); if (keyInfo != null) { params.put("AuthKey", keyInfo.getAuthKey()); params.put("MemCode", keyInfo.getMemberCode()); } // TODO: 2017-10-19 page name 수정 params.put("PageNm", "배송대행신청"); params.put("AppVer", Build.MODEL); params.put("ModelNo", Build.VERSION.RELEASE); try { getHttp(mUrl, params); } catch (JSONException e) { e.printStackTrace(); } } public void getHttp(String relativeUrl, RequestParams params) throws JSONException { TheBayRestClient.post(relativeUrl, params, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { // 받아온 JSONObject 자료 처리 Log.d("onAcceptSuccess: ", response.toString()); // TODO: 2017-10-19 데이터 받은거 수정 ArrayList<ShippingCenterModel> centerList = new ArrayList<>(); mCategoryList = new ArrayList<>(); try { String error = response.getString("RstNo"); if (error.equals("0")) { JSONArray centerArray = response.getJSONArray("Center"); JSONArray categoryArray = response.getJSONArray("CtmsItem"); Log.d("onSuccess: ", categoryArray.toString()); JSONArray addressArray = response.getJSONArray("MemAddr"); JSONArray memberInfo = response.getJSONArray("MemInf"); mMemberName = memberInfo.getJSONObject(0).getString("MemEnNm"); Log.d("onSuccess: ", addressArray.toString()); for (int i = 0; i < centerArray.length(); i++) { JSONObject object = centerArray.getJSONObject(i); Log.d("onAcceptSuccess: ", object.getString("CtrSeq").toString()); centerList.add(new ShippingCenterModel(object.getString("CtrSeq"), object.getString("CtrCd"), object.getString("CtrNm"), object.getString("CtrNmCn"), object.getString("Addr"))); mCenterName = centerList.get(i).getCtrNm(); mAddress = centerList.get(i).getAddr(); // binding.centerSelectButton.setText(acceptTermsList.get(i).getCtrNm()); // binding.addressText.setText(acceptTermsList.get(i).getAddr()); // String centerInfo = } for (int i = 0; i < categoryArray.length(); i++) { JSONObject object = categoryArray.getJSONObject(i); mCategoryList.add(new CategoryModel(object.getString("ArcSeq"), object.getString("KrArc"), object.getString("EnArc"))); } Log.d("onAcceptSuccess: ", addressArray.toString()); // Log.d("onSuccess: ",mCategoryList.toString()); // for (int i = 0; i < addressArray.length(); i++) { // JSONObject object = addressArray.getJSONObject(i); // if (object.getString("MainYn").equals("Y")) { // mAddressModel = new AddressModel(object.getString("AddrSeq"), object.getString("AdrsKr"), object.getString("AdrsEn"), object.getString("Zip"), // object.getString("Addr1"), object.getString("Addr2"), object.getString("Addr1En"), object.getString("Addr2En"), // object.getString("MobNo"), object.getString("RrnNo"), object.getString("RrnCd"), object.getString("MainYn")); // } // } //상품 리스트 선언 sProductModelList = new ArrayList<>(); for (int i = 0; i < 1; i++) { sProductModelList.add(new ShippingProductModel("", mMemberName, new CategoryModel(), "", "", "", "", "", "", "", "")); } setTabLayout(); } else { Toast.makeText(ShippingActivity.this, "로그인 정보가 틀립니다.", Toast.LENGTH_SHORT).show(); startActivity(new Intent(ShippingActivity.this, LoginActivity.class)); finish(); } } catch (JSONException e) { e.printStackTrace(); } } @Override public void onSuccess(int statusCode, Header[] headers, JSONArray response) { } @Override public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { // 통신 실패시 호출 되는 메소드 Toast.makeText(ShippingActivity.this, "서버와 통신에 실패했습니다.", Toast.LENGTH_SHORT).show(); Log.d("onFailure: ", throwable.toString()); Log.d("onFailure: ", responseString.toString()); } }); } // public void movePage() { // final Handler handler = new Handler(); // 현재 위치 //이동할 위치 // Thread thread = new Thread(new Runnable() { // @Override // public void run() { // while (isMovePageThread) { // try { // Thread.sleep(3000); // } catch (InterruptedException e) { // e.printStackTrace(); // } // handler.post(new Runnable() { // @Override // public void run() { // int getSelectedPosition = binding.viewPager.getCurrentItem(); //현재 위치 // int movePosition = getSelectedPosition + 1; //이동할 위치 // binding.viewPager.setCurrentItem(movePosition); // if (getSelectedPosition == 0 || getSelectedPosition == 1 || getSelectedPosition == 2) { // binding.viewPager.setCurrentItem(movePosition); // } else { // binding.viewPager.setCurrentItem(0,false); // // } // } // }); // } // } // }); // thread.start(); // } public void setTabLayout() { // Initializing the TabLayout binding.tabLayout.addTab(binding.tabLayout.newTab().setText("배송센터")); binding.tabLayout.addTab(binding.tabLayout.newTab().setText("상품정보")); binding.tabLayout.addTab(binding.tabLayout.newTab().setText("수취인정보")); binding.tabLayout.addTab(binding.tabLayout.newTab().setText("요청사항")); binding.tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); // Creating TabPagerAdapter adapter pagerAdapter = new PagerAdapter(getSupportFragmentManager(), binding.tabLayout.getTabCount()); binding.viewPager.setAdapter(pagerAdapter); binding.viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout)); // binding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { // @Override // public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { // // } // // @Override // public void onPageSelected(int position) { // if (position == 0) { //// AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) binding.toolbar.getLayoutParams(); //// params.setScrollFlags(0); //// binding.fab.show(); // } else if (position == 2) { //// AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) binding.toolbar.getLayoutParams(); //// params.setScrollFlags(8); //// binding.fab.show(); // } else if (position == 3) { //// AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) binding.toolbar.getLayoutParams(); //// params.setScrollFlags(0); //// binding.fab.show(); // } else { //// AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) binding.toolbar.getLayoutParams(); //// params.setScrollFlags(8); //// binding.fab.show(); // } // if (position ==5) { // binding.viewPager.set // try { // Thread.sleep(100); // } catch (InterruptedException e) { // e.printStackTrace(); // } // binding.viewPager.setCurrentItem(1); // binding.viewPager.setCurrentItem(1,false); // binding.viewPager.setCurrentItem(1,true); // binding.viewPager.setVerticalScrollbarPosition(1); // pagerAdapter.getItem(1); // Log.d("onPageSelected:", "dddddddddddd"); // }else if (position == 0){ // binding.viewPager.setCurrentItem(4,false); // } // // } // // @Override // public void onPageScrollStateChanged(int state) { // // } // }); // Set TabSelectedListener binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { binding.viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); // movePage(); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; default: return super.onOptionsItemSelected(item); } // if (getIntent().getStringExtra("member_name") != null) { // String mMemberName = getIntent().getStringExtra("member_name"); // // } } @Override public void onBackPressed() { if (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); } else { super.onBackPressed(); } } @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(MessageEvent event) { if (event instanceof ShippingNextButtonEvent) { int getSelectedPosition = binding.viewPager.getCurrentItem(); //현재 위치 int movePosition = getSelectedPosition + 1; //이동할 위치 binding.viewPager.setCurrentItem(movePosition); } // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, fragmentReplaceEvent.getFragment()).addToBackStack("null").commit(); // setTitle(fragmentReplaceEvent.getFragmentName()); // // } } @Override public void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override public void onStop() { super.onStop(); EventBus.getDefault().unregister(this); isMovePageThread = false; } @Override public void onClick(View v) { switch (v.getId()) { // case R.id.fab: // int getSelectedPosition = binding.tabLayout.getSelectedTabPosition(); //현재 위치 // int movePosition = getSelectedPosition + 1; //이동할 위치 // if (getSelectedPosition == 0 || getSelectedPosition == 1 || getSelectedPosition == 2) { // binding.viewPager.setCurrentItem(movePosition); // } } } public class PagerAdapter extends FragmentStatePagerAdapter { // Count number of tabs private int tabCount; NoticeFragment tabFragment; public PagerAdapter(FragmentManager fm, int tabCount) { super(fm); this.tabCount = tabCount; } @Override public Fragment getItem(int position) { // // Returning the current tabs switch (position) { case 0: ShippingCenterFragment tabFragment1 = ShippingCenterFragment.newInstance(mCenterName, mAddress); return tabFragment1; case 1: ProductInformationFragment tabFragment2 = ProductInformationFragment.newInstance(mCategoryList, mMemberName); return tabFragment2; case 2: RecieverInformationFragment tabFragment3 = RecieverInformationFragment.newInstance(mAddressModel); return tabFragment3; case 3: RequestsFragment tabFragment4 = new RequestsFragment(); return tabFragment4; default: return null; } // switch (position) { // case 0: // tabFragment = NoticeFragment.newInstance("3", "3"); // // return tabFragment; // case 1: // tabFragment = NoticeFragment.newInstance("0", "0"); // Log.d("getItem: ", "position : " + position); // notifyDataSetChanged(); // return tabFragment; // case 2: // tabFragment = NoticeFragment.newInstance("1", "1"); // return tabFragment; // case 3: // tabFragment = NoticeFragment.newInstance("2", "2"); // return tabFragment; // case 4: // tabFragment = NoticeFragment.newInstance("3", "3"); // return tabFragment; // case 5: // tabFragment = NoticeFragment.newInstance("0", "0"); // return tabFragment; // default: // return tabFragment; // } } @Override public int getCount() { return tabCount; } } }
8c5f14870d91aeeba4d6394ffaecbb2175c81147
37d921910abc93f80b856c2c715c7f75728497f3
/arrays/Maxofarray.java
85705bc437b3c7341cee307273c570b7c8580cf8
[]
no_license
vedashree7/WTN3
ace74c0beb13a168c263b631e19a4eecf280eab2
0ae3caa0e7fb8e89e20e06824dc897e68910cc9c
refs/heads/master
2022-11-11T12:14:57.469233
2020-07-04T02:10:29
2020-07-04T02:10:29
271,693,925
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
package com.wipro.arrays; public class Maxofarray { public static void main(String[] args) { int a=args.length; int i; int max=0,j; int arr[][] = new int[3][3]; if(a<9) { System.out.println("enter 9 values"); } if(a==9) { int k=0; for(i=0;i<3;i++) { for( j=0;j<3;j++) { arr[i][j]=Integer.parseInt(args[k]); k++; } } for(i=0;i<3;i++) { for( j=0;j<3;j++) { if(arr[i][j]>max) { max=arr[i][j]; } } } System.out.println(max); } } }
7ca17b19a01057a31b418c464e7a022697c4370f
90968759d63c1f2da80e8fa00969ebd11937f033
/src/main/java/com/textura/automation/tce/TestCaseEditor.java
50806982c9b785b9a68cf757858a700e12c45852
[]
no_license
Gowtham415/AutomationFramework
f712e51656f12318b517fdf7b88fe3dd6c2ee9d0
344a1a2c30a449e9f791db97e89f185f776ccd2b
refs/heads/master
2022-07-11T01:34:38.394837
2019-10-01T08:34:52
2019-10-01T08:34:52
212,048,486
0
0
null
2022-06-29T17:40:58
2019-10-01T08:36:23
Java
UTF-8
Java
false
false
12,128
java
package com.textura.automation.tce; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang3.ArrayUtils; import com.github.javaparser.JavaParser; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.stmt.BlockStmt; import com.github.javaparser.ast.stmt.Statement; import com.textura.framework.environment.Project; import com.textura.framework.utils.JavaHelpers; public class TestCaseEditor { static final String LOG_ANALYZER_OUTPUT_PATH = Project.pathAutomationArtifacts("LogAnalyzer/"); static final String LOG_ANALYZER_CASES_PATH = LOG_ANALYZER_OUTPUT_PATH + "testCaseList.txt"; static final String LOG_ANALYZER_TCG_LOG = LOG_ANALYZER_OUTPUT_PATH + "tcglog.log"; static List<String> testCasesToEdit = new ArrayList<String>(); static TreeSet<String> filesToSave = new TreeSet<String>(); public static void main(String[] args) throws Exception { // get the test cases that need to be edited testCasesToEdit = getCasesFromFile(LOG_ANALYZER_CASES_PATH); // Read testsuites File folder = new File("C:/Automation/Textura/CPM/src/test/java/com/textura/cpm/testsuites"); // "C:/Automation/Textura/CPM/src/test/java/com/textura/cpm/testsuites/administration/messages" // "C:/Automation/Textura/CPM/src/test/java/com/textura/cpm/testsuites/invoice/systemgeneratedinvoicenumbers" ArrayList<File> files = getFilesFromDir(folder); // parse files of the cases that need to be edited CompilationUnit cu = new CompilationUnit(); for (File in : files) { try { System.out.println("Parsing File " + in.getName() + "..."); replaceLinebreaks(in); cu = JavaParser.parse(in, Charset.defaultCharset()); // use MethodVisitor to edit cases cu.accept(new MethodVisitor(), null); } finally { // save the files that were added to the list of files to save if (filesToSave.contains(in.getName())) { System.out.println("Saving... " + in.getName()); Files.write(in.toPath(), cu.toString().getBytes()); } replaceLinebreakComments(in); } System.out.println("Done parsing " + in.getName()); } } static MethodDeclaration addStep(MethodDeclaration n, String containingStmt, String addStmtString) { return addStep(n, containingStmt, addStmtString, CompareMode.contains); } /** * Replaces $ markers with original values of regex matched string. * For example: * match = "selenium().ProjectHomePage.clickLink("asdf"); * regex = "selenium\(\)\.(.*)\.clickMenuLink\((.*)); * replacementString = "selenium().$1.clickMenuLink($2); * * This method will return * selenium().ProjectHomePage.clickMenuLink("asdf"); * * * @param match * The string that matched the regex * @param regex * The regex used to search * @param replacementString * The string with $ markers to be replaced by the original values * @return replacementString with $ markers replaced with original values from string */ private static String insertCapturedGroups(String match, String regex, String replacementString) { Matcher matcher = Pattern.compile(regex).matcher(match); int groups = matcher.groupCount(); String regexedStmtString = replacementString; if (matcher.find()) { for (int i = 1; i <= groups; i++) { try { String group = matcher.group(i); regexedStmtString = regexedStmtString.replaceAll("\\$" + i, group); } catch (Exception e) { e.printStackTrace(); } } } else { System.out.println("insertCapturedGroupsToString did not find a match... this is suspicious... String: '" + match + "' contain: '" + regex + "' add: '" + replacementString); } return regexedStmtString; } /* * adds addStmtString to method in the line after containingStmt if the result of compareMode.compare is true. * Comparemode can be contains or regex */ static MethodDeclaration addStep(MethodDeclaration n, String containingStmt, String addStmtString, CompareMode compareMode) { ArrayList<Integer> indexes = new ArrayList<Integer>(); indexes = getIndexWhereContains(n, containingStmt, compareMode); if (compareMode.equals(CompareMode.regex) && indexes.size() > 0 && addStmtString.contains("$")) { // capture group support for (int i = 0; i < indexes.size(); i++) { int index = indexes.get(i); String line = n.getBody().get().getStatement(index - 1).toString(); String regexedStmtString = insertCapturedGroups(line, containingStmt, addStmtString); Statement regexedStmt = JavaParser.parseStatement(regexedStmtString); n = addStepsAtIndexes(n, new ArrayList<Integer>(Arrays.asList(index)), regexedStmt); indexes = incrementCounts(i, indexes); } } else { Statement addStmt = JavaParser.parseStatement(addStmtString); n = addStepsAtIndexes(n, indexes, addStmt); } return n; } static MethodDeclaration addSteps(MethodDeclaration n, String containingStmt, String... addStmtStrings) { ArrayUtils.reverse(addStmtStrings); for (String addStmtString : addStmtStrings) { n = addStep(n, containingStmt, addStmtString); } return n; } static MethodDeclaration changeStep(MethodDeclaration n, String ogStmt, String changeStmtString) { ArrayList<Integer> indexes = new ArrayList<Integer>(); Statement changeStmt = JavaParser.parseStatement(changeStmtString); indexes = getIndexWhereContains(n, ogStmt); n = addStepsAtIndexes(n, indexes, changeStmt); return n; } static MethodDeclaration removeStep(MethodDeclaration n, String removeStepString) { n = removeStmts(n, removeStepString, CompareMode.contains); return n; } /* * Removes removeStepString from method n if comparemode.compare returns true. * CompareMode can be contains or regex */ static MethodDeclaration removeStep(MethodDeclaration n, String removeStepString, CompareMode compareMode) { n = removeStmts(n, removeStepString, compareMode); return n; } /* * adds addStmt to the method where */ private static MethodDeclaration addStepsAtIndexes(MethodDeclaration n, ArrayList<Integer> indexes, Statement addStmt) { BlockStmt body = n.getBody().get(); // go through the list of indexes and add the statement we want after all of the instances in indexes for (int i = 0; i < indexes.size(); i++) { body.addStatement(indexes.get(i), addStmt); // hella janky but it git's it dun indexes = incrementCounts(i, indexes); } return n; } private static ArrayList<Integer> getIndexWhereContains(MethodDeclaration n, String containingStmt) { return getIndexWhereContains(n, containingStmt, CompareMode.contains); } /* * gets list of indexes where it finds containingStmt */ private static ArrayList<Integer> getIndexWhereContains(MethodDeclaration n, String containingStmt, CompareMode comparer) { ArrayList<Integer> indexes = new ArrayList<Integer>(); BlockStmt body = n.getBody().get(); int index = 1; // starting at one so it inserts in the correct spot if (testCasesToEdit.contains(n.getNameAsString())) { // go through the lines of code in the method and see if they contain the text we want to change for (Statement s : body.getStatements()) { if (comparer.compare(s.toString(), containingStmt)) { // if the line does, add that line index to the indexes list indexes.add(index); // add the file that it came from to the list of files to save Node parent = n.getParentNode().get(); filesToSave.add(parent.getChildNodes().get(0).toString() + ".java"); } index++; } } return indexes; } private static MethodDeclaration removeStmts(MethodDeclaration n, String containingStmt) { return removeStmts(n, containingStmt, CompareMode.contains); } private static MethodDeclaration removeStmts(MethodDeclaration n, String containingStmt, CompareMode compareMode) { BlockStmt body = n.getBody().get(); if (testCasesToEdit.contains(n.getNameAsString())) { // go through the lines of code in the method and see if they contain the text we want to change for (int i = 0; i < body.getStatements().size(); i++) { Statement s = body.getStatement(i); if (compareMode.compare(s.toString(), containingStmt)) { s.remove(); i--; // add the file that it came from to the list of files to save Node parent = n.getParentNode().get(); filesToSave.add(parent.getChildNodes().get(0).toString() + ".java"); } } } return n; } /* * increments the counts of the all the nums in the array starting from int i */ private static ArrayList<Integer> incrementCounts(int i, ArrayList<Integer> incArray) { ArrayList<Integer> copyArray = (ArrayList<Integer>) incArray.clone(); for (int j = i; j < incArray.size(); j++) { copyArray.set(j, incArray.get(j) + 1); } return copyArray; } /* * replaces empty lines with a comment so that we can save them when they get parsed */ private static void replaceLinebreaks(File in) { String editFile = JavaHelpers.readFileAsString(in.toString()) .replaceAll("(?m)^\\s*$", "// this is actually a line break"); JavaHelpers.writeFile(in.toString(), editFile.toString()); } /* * replaces the comments put in by replaceLinebreaks(File in) with a blank line */ private static void replaceLinebreakComments(File in) { String editFile = JavaHelpers.readFileAsString(in.toString()) .replaceAll("// this is actually a line break", ""); JavaHelpers.writeFile(in.toString(), editFile.toString()); } /* * gets all file from a given directory, and all the files in that dir, recursively */ private static ArrayList<File> getFilesFromDir(File folder) { ArrayList<File> allFiles = new ArrayList<File>(); for (File file : folder.listFiles()) { // can edit which suites to exclude boolean exclude = !file.getName().equals("abstracttestsuite") && !file.getName().equals("datageneration"); if (file.isDirectory() && exclude) { allFiles.addAll(getFilesFromDir(file)); } else if (exclude) { allFiles.add(file); } } return allFiles; } private static ArrayList<File> getFilesFromDirectories(File... folders) { ArrayList<File> allFiles = new ArrayList<File>(); for (File folder : folders) { allFiles.addAll(getFilesFromDir(folder)); } return allFiles; } private static ArrayList<String> getCasesFromFile(String filePath) { ArrayList<String> testCasesFromFile = null; try { testCasesFromFile = new ArrayList<>(Files.readAllLines(Paths.get(filePath))); } catch (IOException e) { System.out.println("Failed to read file. Make sure to place the file containing test cases you want to update in directory:\n" + e.getMessage()); throw new RuntimeException(); } return testCasesFromFile; } /** * * Returns the name of the project being used in the testcase */ public static String getProjectName(MethodDeclaration n) { String containingStmt = "selenium().HomePage.clickLink(\""; BlockStmt body = n.getBody().get(); for (Statement s : body.getStatements()) { String statementString = s.toString(); if (statementString.contains(containingStmt)) { statementString = statementString.substring(statementString.indexOf(containingStmt)); int begin = statementString.indexOf("\"") + 1; int end = statementString.indexOf("\"", begin); return statementString.substring(begin, end); } } return ""; } /** * * @param n * method declaration * @param s * String to be searched for within method * @param comparer * CompareMode to be used to determine if method contains string * @return */ public static boolean doesMethodContainString(MethodDeclaration n, String s, CompareMode comparer) { String body = n.getBody().toString(); return comparer.compare(body, s); } }
d31dbc39eef311f943c3d0c37343944af72ea67d
6bf95f63bf72cce764f3418b2af13ab28653e266
/src/main/java/edu/epam/bookie/util/mail/MailSender.java
df51c0b85feea29bb5baefb7a58241baca0a0539
[]
no_license
AlexandrKhan/Bookie
788f85086230b6f5b02f64e5684140e636c4d2af
aba1f8bc7b02f168e4a89191aaf6d67116774c4c
refs/heads/main
2023-04-18T17:44:48.712461
2021-05-04T08:36:58
2021-05-04T08:36:58
334,975,091
0
0
null
null
null
null
UTF-8
Java
false
false
2,194
java
package edu.epam.bookie.util.mail; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import javax.mail.*; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Properties; public class MailSender { private static final Logger logger = LogManager.getLogger(MailSender.class); private static final String ENCODING = "utf-8"; private final String sendToEmail; private final String mailSubject; private final String mailText; private final Properties properties; private MimeMessage message; public MailSender(String sendToEmail, String mailSubject, String mailText, Properties properties) { this.sendToEmail = sendToEmail; this.mailSubject = mailSubject; this.mailText = mailText; this.properties = properties; } public void send() { try { initMessage(); Transport.send(message); } catch (AddressException e) { logger.error("Invalid email address: ", e); } catch (MessagingException e) { logger.error("Error generating or sending message: ", e); } } private void initMessage() throws MessagingException { Session mailSession; mailSession = createSession(properties); mailSession.setDebug(true); message = new MimeMessage(mailSession); message.setFrom("[email protected]"); message.setSubject(mailSubject); message.setText(mailText, ENCODING); message.setRecipient(Message.RecipientType.TO, new InternetAddress(sendToEmail)); } public Session createSession(Properties properties) { String userName = properties.getProperty("mail.user.name"); String userPassword = properties.getProperty("mail.user.password"); return Session.getDefaultInstance(properties, new javax.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userName,userPassword); } }); } }
7fdd69ba66989ab86ee3b3a6432eb6749356287b
71f402597bc3020b8c2b5b4bc81c950387e14a8b
/src/test/java/wysobj/InsertIntervalTest.java
8e94a6c04c5a39b64002aae2a16585c735e145c3
[]
no_license
wysobj/LeetCode
f1eec04b8b2faf03aee07496529af9e7080a601f
1bdc01666f821f5a8d94675ab92acdda5f15472d
refs/heads/master
2020-03-12T06:16:22.653599
2018-06-06T08:46:37
2018-06-06T08:46:37
130,481,636
0
0
null
null
null
null
UTF-8
Java
false
false
1,798
java
package wysobj; import org.junit.Test; import wysobj.InsertInterval; import wysobj.MergeIntervals; import wysobj.dataStructures.Interval; import java.util.LinkedList; import java.util.List; public class InsertIntervalTest { @Test public void testCase1() { List<Interval> intervals = new LinkedList<Interval>(); intervals.add(new Interval(1, 3)); intervals.add(new Interval(6, 9)); Interval inserted = new Interval(2, 5); InsertInterval ii = new InsertInterval(); List<Interval> result = ii.insert(intervals, inserted); assert (result.contains(new Interval(1, 5))); assert (result.contains(new Interval(6, 9))); assert (result.size() == 2); } @Test public void testCase2() { List<Interval> intervals = new LinkedList<Interval>(); intervals.add(new Interval(1, 2)); intervals.add(new Interval(3, 5)); intervals.add(new Interval(6, 7)); intervals.add(new Interval(8, 10)); intervals.add(new Interval(12, 16)); Interval inserted = new Interval(4, 8); InsertInterval ii = new InsertInterval(); List<Interval> result = ii.insert(intervals, inserted); assert (result.contains(new Interval(1, 2))); assert (result.contains(new Interval(3, 10))); assert (result.contains(new Interval(12, 16))); assert (result.size() == 3); } @Test public void testCase3() { List<Interval> intervals = new LinkedList<Interval>(); Interval inserted = new Interval(1, 5); InsertInterval ii = new InsertInterval(); List<Interval> result = ii.insert(intervals, inserted); assert (result.contains(new Interval(1, 5))); assert (result.size() == 1); } }
8d760efb33232c3062e81d04955127530af2e31a
aaf804aa197508b9093e3bd78b27edbf1cfdfffc
/mobile/src/main/java/com/app/ttfo/LockScreenActivity.java
1513f48d16028f8b31013c2610b27fe7893a56b4
[]
no_license
LiewJunTung/TTFO
eba7466a40988fdb405816c6f5951fcda6a64df8
722420c270af58e71a1d4d9a47c4e2e9658e763c
refs/heads/master
2021-01-17T17:13:14.958630
2014-09-18T05:58:52
2014-09-18T05:58:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,542
java
package com.app.ttfo; import android.app.Activity; import android.app.ActivityManager; import android.app.KeyguardManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import com.app.ttfo.receiver.MyAdminReceiver; import java.util.Timer; import java.util.TimerTask; import butterknife.InjectView; import de.greenrobot.event.EventBus; /** * Created by kevintanhongann on 9/17/14. */ public class LockScreenActivity extends Activity { private DevicePolicyManager mDevicePolicyManager; private ComponentName mComponentName; private static final int ADMIN_INTENT = 15; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lockscreen); mDevicePolicyManager = (DevicePolicyManager) getSystemService( Context.DEVICE_POLICY_SERVICE); mComponentName = new ComponentName(this, MyAdminReceiver.class); TextView tvStatus = (TextView) findViewById(R.id.textView_status); String description = "You need to activate device admin to continue"; boolean isAdmin = mDevicePolicyManager.isAdminActive(mComponentName); if (isAdmin) { KeyguardManager.KeyguardLock key; KeyguardManager km = (KeyguardManager)getSystemService(KEYGUARD_SERVICE); key = km.newKeyguardLock("IN"); key.disableKeyguard(); tvStatus.setText("TTFO is activated!"); } else { Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mComponentName); intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,description); startActivityForResult(intent, ADMIN_INTENT); Toast.makeText(getApplicationContext(), "Not Registered as admin", Toast.LENGTH_SHORT).show(); } Integer hour = EventBus.getDefault().getStickyEvent(Integer.class); /*if (hour != null) { new CountDownTimer(hour * 60 * 60 * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { Log.d("timeTillFinish", "timeTillFinish " + millisUntilFinished); } @Override public void onFinish() { //disable the lockscreen } }.start(); }*/ new Timer().schedule(new MyTimerClass(), 5000); } class MyTimerClass extends TimerTask { @Override public void run() { finish(); } } @Override public void onBackPressed() { } @Override protected void onPause() { super.onPause(); ActivityManager activityManager = (ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE); activityManager.moveTaskToFront(getTaskId(), 0); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(requestCode == ADMIN_INTENT){ if(resultCode == Activity.RESULT_OK){ mDevicePolicyManager.lockNow(); }else{ Toast.makeText(getApplicationContext(), "Not Registered as admin", Toast.LENGTH_SHORT).show(); } } } }
7d23908536a928be498cd9412d815919810ad904
e4fd4de3ab3611d64c2f1eff030255806ab42154
/app/src/androidTest/java/com/wrinth/english_is_easy/ApplicationTest.java
fbd8301321acdba306bdfef5ebfaa611c56cb910
[]
no_license
Wrinth/English_is_Easy
d018a6d58db1e816942d1cf5300e6910282f37f3
14d7366bc18ac13fafc7343be48a53877aeae375
refs/heads/master
2021-01-09T20:17:08.659334
2016-07-08T08:39:28
2016-07-08T08:39:28
62,872,019
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package com.wrinth.english_is_easy; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "Ho Yeung Lai" ]
Ho Yeung Lai
4bc01e4dc1f555944e9a97252e1fcd5692907660
f0fd8488397a5f9cdf28ed6fa1327dbc1500deaf
/MqttService/src/main/java/com/lkc/start/Connect.java
4d92234ed5ce43db8b57b13142932d09998b8a76
[]
no_license
dxlkc/com-wlw
1e28fe3057b6009516d3cb116394b11b0d237846
08c3852323648e1f16e344bb4108d92d64668a23
refs/heads/master
2021-06-13T14:49:10.791376
2019-11-02T13:13:58
2019-11-02T13:13:58
195,402,365
3
3
null
2021-06-04T02:04:08
2019-07-05T12:01:14
Java
UTF-8
Java
false
false
593
java
package com.lkc.start; import com.lkc.coap.Coap; import com.lkc.heartbeat.HeartBeat; import com.lkc.mqttUp.UpMqtt; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import javax.annotation.Resource; @Component public class Connect implements CommandLineRunner { @Resource private HeartBeat heartBeat; @Override public void run(String... args) throws Exception { //连接到mqtt代理服务器 UpMqtt.getInstance().firstconnect(); //轮询判断 设备连接状态 heartBeat.start(); } }
619037ee6a816a98d55816440f64e941afc83ee1
9d8621fab4ca11d5e45587584fb0acf3722496ec
/src/ch9/Subtracter.java
4b6626b18b84ecb90d114f8a69311362957cd7bb
[]
no_license
99dabi/javasource
423d37ac7bcd511620cef4e8274eddecd77122c5
9c6393f7b3038ceffdae8179980e2c070b00fd5a
refs/heads/master
2023-04-20T06:59:31.190809
2021-05-04T06:13:35
2021-05-04T06:13:35
357,107,886
0
0
null
null
null
null
UTF-8
Java
false
false
132
java
package ch9; public class Subtracter extends Calculator{ @Override int calc() { //두 수를 뺀 후 리턴 return a-b; } }
bce153dff6d1df29b0affaae840ee19da4807fec
e5d4e57f9856278b0f62d75f56b37dc8f4db46f5
/corelib/src/main/java/com/effortapp/corelib/net/converter/GsonResponseBodyConverter.java
786296d47998b270187f578586752231621901af
[]
no_license
mrvegazhou/androidMVP
8d85d7b5d3fc0b9e6983311124d5ddb46833649f
5aa4fec9b40fe23c09ba1f1bbdd9fb2c8c6442f6
refs/heads/main
2023-04-06T10:26:27.364379
2021-04-17T17:50:12
2021-04-17T17:50:12
346,536,470
1
0
null
null
null
null
UTF-8
Java
false
false
798
java
package com.effortapp.corelib.net.converter; import com.google.gson.Gson; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import java.io.IOException; import okhttp3.ResponseBody; import retrofit2.Converter; final class GsonResponseBodyConverter<T> implements Converter<ResponseBody, T> { private final Gson gson; private final TypeAdapter<T> adapter; GsonResponseBodyConverter(Gson gson, TypeAdapter<T> adapter) { this.gson = gson; this.adapter = adapter; } @Override public T convert(ResponseBody value) throws IOException { JsonReader jsonReader = gson.newJsonReader(value.charStream()); try { return adapter.read(jsonReader); } finally { value.close(); } } }
3d866c64343616b097e7910b1b779a282d7f4e8d
109c540e8fd7248ca17f4679e3666d8b95d1c6eb
/Boletin3_1/Boletin3_1/src/boletin3_1/Coche.java
6cde78e40c1b0ef37359618837b48fda1b6e0542
[]
no_license
jborrajorodriguez/Boletin3
630aa3800576290c52dcea7e862a8977c529ba72
124f67ced64d971b8222921891227f9b1503f3d9
refs/heads/master
2021-07-17T19:39:01.316336
2017-10-26T07:41:09
2017-10-26T07:41:09
108,377,537
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package boletin3_1; /** * @author jborrajorodriguez */ public class Coche { private int velocidade ; public Coche(){ velocidade =0 ; } public int getVelocidade(){ return velocidade; } public void acelerar(int incremento){ velocidade+=incremento; } public void frenar(int frenado){ velocidade-=frenado; } }
351a78663ce8cb40b8f524ffaf3524728e10bf75
ec6e12ce5386fe63dbc9148e17756bc0425da97d
/Lastversion/src/maze/gui/ComboListener.java
49124a705043610415c73256edfcc5a3c07f38aa
[]
no_license
IneSantos/Maze-game-Pacman
c813a267f6848cba6aa5bfbad3126bca35c2d625
4170c3f7dc4c498ae131ba54334eaf1c2ae869e8
refs/heads/master
2021-01-15T12:32:21.956409
2015-11-13T05:09:56
2015-11-13T05:09:56
34,208,211
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
package maze.gui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComboBox; public class ComboListener implements ActionListener{ public ComboListener(){ } @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); int temp = (int)cb.getSelectedIndex(); if(temp == 0) Application.menu.obj.dragonMoves = 0; else if (temp == 1) Application.menu.obj.dragonMoves = 5; else if (temp == 2) Application.menu.obj.dragonMoves = 6; } }
a65011c71d454cae13cba809edce0d715af10ba5
6f4764575e17202a27330e2f5b18d37d7b678bf4
/app/src/main/java/com/carsuper/coahr/mvp/contract/store/StoreEvaluateDetailContract.java
643a0180f734e8c95aeec37a7bade1dff1b5f3b8
[]
no_license
LEEHOR/Carsuper
732efb1bf79ba69da9d1b4b2e98d1edd374dab92
4e48bf2b2c882f2427a241af5682a103b7103fee
refs/heads/master
2020-04-14T10:08:03.510404
2019-07-08T11:05:21
2019-07-08T11:05:21
154,423,430
0
0
null
null
null
null
UTF-8
Java
false
false
2,052
java
package com.carsuper.coahr.mvp.contract.store; import com.carsuper.coahr.mvp.contract.base.BaseContract; import com.carsuper.coahr.mvp.model.bean.CommodityEvaluateDetailBeans; import com.carsuper.coahr.mvp.model.bean.DianZanBean; import com.carsuper.coahr.mvp.model.bean.EvaluateBean; import com.carsuper.coahr.mvp.model.bean.StoreEvaluateDetailBean; import java.util.Map; /** * Author: hengzwd on 2018/6/20. * Email:[email protected] */ public interface StoreEvaluateDetailContract { interface View extends BaseContract.View { void onGetEvaluateDetailSuccess(StoreEvaluateDetailBean bean); void onGetEvaluateDetailFailure(String failure); void onReplyDianZanSuccess(DianZanBean dianZanBean); void onReplyDianZanFailure(String failure); void onEvaluateDianzanSuccess(DianZanBean dianZanBean); void onEvaluateDianzanFailure(String failure); void onEvaluateSuccess(EvaluateBean bean); void onEvaluateFailure(String failure); } interface Presenter extends BaseContract.Presenter { void getEvaluateDetail(Map<String,String> map); void onGetEvaluateDetailSuccess(StoreEvaluateDetailBean bean); void onGetEvaluateDetailFailure(String failure); void replydianZan(Map<String,String> map); void onReplyDianZanSuccess(DianZanBean dianZanBean); void onReplyDianZanFailure(String failure); void evaluateDianzan(Map<String,String> map); void onEvaluateDianzanSuccess(DianZanBean dianZanBean); void onEvaluateDianzanFailure(String failure); void storeSecondEvaluate(Map<String,String> map); void onEvaluateSuccess(EvaluateBean bean); void onEvaluateFailure(String failure); } interface Model extends BaseContract.Model { void getEvaluateDetail(Map<String,String> map); void replydianZan(Map<String,String> map); void evaluateDianzan(Map<String,String> map); void storeSecondEvaluate(Map<String,String> map); } }
5191296ebee2990054db0fe9d58e049a13a42c5d
e63db9eaac8299c2bd16847f084c59cdd08cead6
/branches/ZCrawl/ZCrawl/src/java/org/zonales/crawlConfig/services/GetConfig.java
071b58c0192843eaa63d054729d96595c0764980
[]
no_license
BGCX261/zonales-svn-to-git
974432530b3358b0c2d774ed2f5e9472b5618ab8
8008a68284efc58fced9a5e042dd165da1e94f90
refs/heads/master
2021-01-18T14:38:22.068945
2015-08-25T15:43:33
2015-08-25T15:43:33
41,586,043
0
0
null
null
null
null
UTF-8
Java
false
false
224
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.zonales.crawlConfig.services; /** * * @author nacho */ public interface GetConfig extends BaseService { }
4c27367548f296c74f7950bdc25801c7aaf1f9ae
682002cd3f6000cb965f4fd6924839098c832636
/ssm/src/cn/mob/jekin/modal/impl/InfoServiceImpl.java
51d7b4e992ac53f1ffed7a1f6a530836b8921c32
[]
no_license
dzbjcnm/zhonghantao
790fde075419078b8ffe1588f30c317043c19107
5f4ce357a343b8c7686507610e08d4ac2700ffc7
refs/heads/master
2021-08-08T10:05:43.435638
2017-11-10T03:45:13
2017-11-10T03:45:13
110,189,906
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package cn.mob.jekin.modal.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.mob.jekin.dao.InfoMapper; import cn.mob.jekin.dao.UserMapper; import cn.mob.jekin.entity.Info; import cn.mob.jekin.modal.InfoService; @Service("infoService") public class InfoServiceImpl implements InfoService { @Autowired private InfoMapper infoMapper; @Override public int insert(Info entity) throws Exception { // TODO Auto-generated method stub return 0; } @Override public int update(Info entity) throws Exception { // TODO Auto-generated method stub return 0; } @Override public int delete(Info entity) throws Exception { // TODO Auto-generated method stub return 0; } @Override public Info select(Info entity) { // TODO Auto-generated method stub return null; } @Override public List<Info> getAll() { // TODO Auto-generated method stub return infoMapper.getAll(); } }
845a7ced795222c7c012a9e09a54046ce1fbfada
845e44da24afd187033af4ae37b1502531cc5b3b
/Hashcat.javaproj/src/application/ILookInStream.java
694b985f0a9ed70182c3a0356ee6ffbeb9c23969
[]
no_license
NorbertSomogyi/MoodernizeExamples
df75c2bdedfca30204e0717c057d90e989586c67
caaf0107200454eec36aeff1d97f7a669b1feedb
refs/heads/master
2022-12-27T23:33:27.112210
2020-10-04T22:31:51
2020-10-04T22:31:51
216,872,605
0
0
null
null
null
null
UTF-8
Java
false
false
15,444
java
package application; public class ILookInStream { private Object Look; private Object Skip; private Object Read; private Object Seek; public ILookInStream(Object Look, Object Skip, Object Read, Object Seek) { setLook(Look); setSkip(Skip); setRead(Read); setSeek(Seek); } public ILookInStream() { } /* 7zDec.c -- Decoding from 7z folder 2019-02-02 : Igor Pavlov : Public domain */ /* #define _7ZIP_PPMD_SUPPPORT */ public Object SzDecodeLzma(Object props, int propsSize, Object inSize, Object outBuffer, Object outSize, Object allocMain) { CLzmaDec state = new CLzmaDec(); SRes res = 0; { (state).setDic((null)); (state).setProbs((null)); } ; { int __result__ = (state.LzmaDec_AllocateProbs(props, propsSize, allocMain)); if (__result__ != 0) { return __result__; } } ; state.setDic(outBuffer); state.setDicBufSize(outSize); state.LzmaDec_Init(); Object generatedDicPos = state.getDicPos(); for (; /*Error: Unsupported expression*/; /*Error: Unsupported expression*/) { Object inBuf = (null); size_t lookahead = (1 << 18); if (lookahead > inSize) { lookahead = (size_t)inSize; } res = /*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, inBuf, lookahead); if (res != 0) { break; } { SizeT inProcessed = (SizeT)lookahead; SizeT dicPos = generatedDicPos; ELzmaStatus status = new ELzmaStatus(); res = state.LzmaDec_DecodeToDic(outSize, (Byte)inBuf, inProcessed, .LZMA_FINISH_END, status); lookahead -= inProcessed; inSize -= inProcessed; if (res != 0) { break; } if (status == .LZMA_STATUS_FINISHED_WITH_MARK) { if (outSize != generatedDicPos || inSize != 0) { res = 1; } break; } if (outSize == generatedDicPos && inSize == 0 && status == .LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK) { break; } if (inProcessed == 0 && dicPos == generatedDicPos) { res = 1; break; } res = /*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, inProcessed); if (res != 0) { break; } } } state.LzmaDec_FreeProbs(allocMain); return res; } public Object SzDecodeLzma2(Object[] props, int propsSize, Object inSize, Object outBuffer, Object outSize, Object allocMain) { CLzma2Dec state = new CLzma2Dec(); SRes res = 0; Object generatedDecoder = (state).getDecoder(); { (generatedDecoder).setDic((null)); (generatedDecoder).setProbs((null)); } ; if (propsSize != 1) { return 1; } { int __result__ = (state.Lzma2Dec_AllocateProbs(props[0], allocMain)); if (__result__ != 0) { return __result__; } } ; generatedDecoder.setDic(outBuffer); generatedDecoder.setDicBufSize(outSize); state.Lzma2Dec_Init(); for (; /*Error: Unsupported expression*/; /*Error: Unsupported expression*/) { Object inBuf = (null); size_t lookahead = (1 << 18); if (lookahead > inSize) { lookahead = (size_t)inSize; } res = /*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, inBuf, lookahead); if (res != 0) { break; } { SizeT inProcessed = (SizeT)lookahead; SizeT dicPos = generatedDecoder.getDicPos(); ELzmaStatus status = new ELzmaStatus(); res = state.Lzma2Dec_DecodeToDic(outSize, (Byte)inBuf, inProcessed, .LZMA_FINISH_END, status); lookahead -= inProcessed; inSize -= inProcessed; if (res != 0) { break; } if (status == .LZMA_STATUS_FINISHED_WITH_MARK) { if (outSize != generatedDecoder.getDicPos() || inSize != 0) { res = 1; } break; } if (inProcessed == 0 && dicPos == generatedDecoder.getDicPos()) { res = 1; break; } res = /*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, inProcessed); if (res != 0) { break; } } } generatedDecoder.LzmaDec_FreeProbs(allocMain); return res; } public Object SzDecodeCopy(Object inSize, Object outBuffer) { while (inSize > 0) { Object inBuf; size_t curSize = (1 << 18); if (curSize > inSize) { curSize = (size_t)inSize; } { int __result__ = (/*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, inBuf, curSize)); if (__result__ != 0) { return __result__; } } ; if (curSize == 0) { return 6; } /*Error: Function owner not recognized*//*Error: Function owner not recognized*/memcpy(outBuffer, inBuf, curSize); outBuffer += curSize; inSize -= curSize; { int __result__ = (/*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(inStream, curSize)); if (__result__ != 0) { return __result__; } } ; } return 0; } public Object SzFolder_Decode2(Object folder, Object[] propsData, Object[] unpackSizes, Object[] packPositions, Object startPos, Object outBuffer, Object outSize, Object allocMain, Object[][] tempBuf) { UInt32 ci = new UInt32(); SizeT[] tempSizes = new SizeT[]{0, 0, 0}; SizeT tempSize3 = 0; Byte tempBuf3 = 0; { int __result__ = (ModernizedCProgram.CheckSupportedFolder(folder)); if (__result__ != 0) { return __result__; } } ; Object generatedBufs = p.getBufs(); Object generatedLims = p.getLims(); Object generatedCode = (p).getCode(); Object generatedDest = p.getDest(); Object generatedDestLim = p.getDestLim(); Object generatedState = p.getState(); for (ci = 0; ci < folder.getNumCoders(); ci++) { CSzCoderInfo coder = folder.getCoders()[ci]; if (ModernizedCProgram.IS_MAIN_METHOD((UInt32)coder.getMethodID())) { UInt32 si = 0; UInt64 offset = new UInt64(); UInt64 inSize = new UInt64(); Byte outBufCur = outBuffer; SizeT outSizeCur = outSize; if (folder.getNumCoders() == 4) { UInt32[] indices = new UInt32[]{3, 2, 0}; UInt64 unpackSize = unpackSizes[ci]; si = indices[ci]; if (ci < 2) { Byte temp = new Byte(); outSizeCur = (SizeT)unpackSize; if (outSizeCur != unpackSize) { return 2; } temp = (Byte)/*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, outSizeCur); if (!temp && outSizeCur != 0) { return 2; } outBufCur = tempBuf[1 - ci] = temp; tempSizes[1 - ci] = outSizeCur; } else if (ci == 2) { if (unpackSize > /* check it */outSize) { return 5; } tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize); tempSize3 = outSizeCur = (SizeT)unpackSize; } else { return 4; } } offset = packPositions[si]; inSize = packPositions[(size_t)si + 1] - offset; { int __result__ = (ModernizedCProgram.LookInStream_SeekTo(inStream, startPos + offset)); if (__result__ != 0) { return __result__; } } ; if (coder.getMethodID() == 0) { if (inSize != /* check it */outSizeCur) { return 1; } { int __result__ = (inStream.SzDecodeCopy(inSize, outBufCur)); if (__result__ != 0) { return __result__; } } ; } else if (coder.getMethodID() == -1024) { { int __result__ = (inStream.SzDecodeLzma(propsData + coder.getPropsOffset(), coder.getPropsSize(), inSize, outBufCur, outSizeCur, allocMain)); if (__result__ != 0) { return __result__; } } ; } else if (coder.getMethodID() == -1024) { { int __result__ = (inStream.SzDecodeLzma2(propsData + coder.getPropsOffset(), coder.getPropsSize(), inSize, outBufCur, outSizeCur, allocMain)); if (__result__ != 0) { return __result__; } } ; } else { return 4; } } else if (coder.getMethodID() == -1024) { UInt64 offset = packPositions[1]; UInt64 s3Size = packPositions[2] - offset; if (ci != 3) { return 4; } tempSizes[2] = (SizeT)s3Size; if (tempSizes[2] != s3Size) { return 2; } tempBuf[2] = (Byte)/*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, tempSizes[2]); if (!tempBuf[2] && tempSizes[2] != 0) { return 2; } { int __result__ = (ModernizedCProgram.LookInStream_SeekTo(inStream, startPos + offset)); if (__result__ != 0) { return __result__; } } ; { int __result__ = (inStream.SzDecodeCopy(s3Size, tempBuf[2])); if (__result__ != 0) { return __result__; } } ; if ((tempSizes[0] & 3) != 0 || (tempSizes[1] & 3) != 0 || tempSize3 + tempSizes[0] + tempSizes[1] != outSize) { return 1; } { CBcj2Dec p = new CBcj2Dec(); generatedBufs[0] = tempBuf3; generatedLims[0] = tempBuf3 + tempSize3; generatedBufs[1] = tempBuf[0]; generatedLims[1] = tempBuf[0] + tempSizes[0]; generatedBufs[2] = tempBuf[1]; generatedLims[2] = tempBuf[1] + tempSizes[1]; generatedBufs[3] = tempBuf[2]; generatedLims[3] = tempBuf[2] + tempSizes[2]; p.setDest(outBuffer); p.setDestLim(outBuffer + outSize); p.Bcj2Dec_Init(); { int __result__ = (p.Bcj2Dec_Decode()); if (__result__ != 0) { return __result__; } } ; { int i; for (i = 0; i < 4; i++) { if (generatedBufs[i] != generatedLims[i]) { return 1; } } if (!(generatedCode == 0)) { return 1; } if (generatedDest != generatedDestLim || generatedState != .BCJ2_STREAM_MAIN) { return 1; } } } } else if (ci == 1) { if (coder.getMethodID() == 3) { if (coder.getPropsSize() != 1) { return 4; } { Byte[] state = new Byte(); ModernizedCProgram.Delta_Init(state); ModernizedCProgram.Delta_Decode(state, (int)(propsData[coder.getPropsOffset()]) + 1, outBuffer, outSize); } } else { if (coder.getPropsSize() != 0) { return 4; } switch (coder.getMethodID()) { case -1024: { UInt32 state = new UInt32(); { state = 0; } ; ModernizedCProgram.x86_Convert(outBuffer, outSize, 0, state, 0); break; } case -1024: ModernizedCProgram.SPARC_Convert(outBuffer, outSize, 0, 0); break; case -1024: ModernizedCProgram.IA64_Convert(outBuffer, outSize, 0, 0); break; case -1024: ModernizedCProgram.ARMT_Convert(outBuffer, outSize, 0, 0); break; case -1024: ModernizedCProgram.PPC_Convert(outBuffer, outSize, 0, 0); break; case -1024: ModernizedCProgram.ARM_Convert(outBuffer, outSize, 0, 0); break; default: return 4; } } } else { return 4; } } return 0; } public Object SzAr_DecodeFolder(Object p, Object folderIndex, Object startPos, Object outBuffer, Object outSize, Object allocMain) { SRes res = new SRes(); CSzFolder folder = new CSzFolder(); CSzData sd = new CSzData(); Byte data = p.getCodersData() + p.getFoCodersOffsets()[folderIndex]; sd.setData(data); sd.setSize(p.getFoCodersOffsets()[(size_t)folderIndex + 1] - p.getFoCodersOffsets()[folderIndex]); res = folder.SzGetNextFolderItem(sd); if (res != 0) { return res; } Object generatedSize = sd.getSize(); Object generatedUnpackStream = folder.getUnpackStream(); if (generatedSize != 0 || generatedUnpackStream != p.getFoToMainUnpackSizeIndex()[folderIndex] || outSize != ModernizedCProgram.SzAr_GetFolderUnpackSize(p, folderIndex)) { return 11; } { int i; Byte[] tempBuf = new Byte[]{0, 0, 0}; res = inStream.SzFolder_Decode2(folder, data, p.getCoderUnpackSizes()[p.getFoToCoderUnpackSizes()[folderIndex]], p.getPackPositions() + p.getFoStartPackStreamIndex()[folderIndex], startPos, outBuffer, (SizeT)outSize, allocMain, tempBuf); for (i = 0; i < 3; i++) { /*Error: Function owner not recognized*//*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, tempBuf[i]); } if (res == 0) { if (((p.getFolderCRCs()).getDefs() && ((p.getFolderCRCs()).getDefs()[(folderIndex) >> 3] & (-1024 >> ((folderIndex) & 7))) != 0)) { if (ModernizedCProgram.CrcCalc(outBuffer, outSize) != p.getFolderCRCs().getVals()[folderIndex]) { res = 3; } } } return res; } } public Object LookInStream_SeekRead_ForArc(Object offset, Object buf, Object size) { { int __result__ = (ModernizedCProgram.LookInStream_SeekTo(stream, offset)); if (__result__ != 0) { return __result__; } } ; return ModernizedCProgram.LookInStream_Read(stream, buf, size/* return LookInStream_Read2(stream, buf, size, SZ_ERROR_NO_ARCHIVE); */); } public Object SzArEx_Extract(Object p, Object fileIndex, Object blockIndex, Object tempBuf, Object outBufferSize, Object offset, Object outSizeProcessed, Object allocMain, Object allocTemp) { UInt32 folderIndex = p.getFileToFolder()[fileIndex]; SRes res = 0; offset = 0; outSizeProcessed = 0; if (folderIndex == (UInt32)-1) { /*Error: Function owner not recognized*//*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, tempBuf); blockIndex = folderIndex; tempBuf = (null); outBufferSize = 0; return 0; } if (tempBuf == (null) || blockIndex != folderIndex) { UInt64 unpackSizeSpec = ModernizedCProgram.SzAr_GetFolderUnpackSize(p.getDb(), folderIndex/* UInt64 unpackSizeSpec = p->UnpackPositions[p->FolderToFile[(size_t)folderIndex + 1]] - p->UnpackPositions[p->FolderToFile[folderIndex]]; */); size_t unpackSize = (size_t)unpackSizeSpec; if (unpackSize != unpackSizeSpec) { return 2; } blockIndex = folderIndex; /*Error: Function owner not recognized*//*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, tempBuf); tempBuf = (null); if (res == 0) { outBufferSize = unpackSize; if (unpackSize != 0) { tempBuf = (Byte)/*Error: Function owner not recognized*/ERROR_UNRECOGNIZED_FUNCTIONNAME(allocMain, unpackSize); if (tempBuf == (null)) { res = 2; } } if (res == 0) { res = inStream.SzAr_DecodeFolder(p.getDb(), folderIndex, p.getDataPos(), tempBuf, unpackSize, allocTemp); } } } if (res == 0) { UInt64 unpackPos = p.getUnpackPositions()[fileIndex]; offset = (size_t)(unpackPos - p.getUnpackPositions()[p.getFolderToFile()[folderIndex]]); outSizeProcessed = (size_t)(p.getUnpackPositions()[(size_t)fileIndex + 1] - unpackPos); if (offset + outSizeProcessed > outBufferSize) { return 11; } if (((p.getCRCs()).getDefs() && ((p.getCRCs()).getDefs()[(fileIndex) >> 3] & (-1024 >> ((fileIndex) & 7))) != 0)) { if (ModernizedCProgram.CrcCalc(tempBuf + offset, outSizeProcessed) != p.getCRCs().getVals()[fileIndex]) { res = 3; } } } return res; } public Object getLook() { return Look; } public void setLook(Object newLook) { Look = newLook; } public Object getSkip() { return Skip; } public void setSkip(Object newSkip) { Skip = newSkip; } public Object getRead() { return Read; } public void setRead(Object newRead) { Read = newRead; } public Object getSeek() { return Seek; } public void setSeek(Object newSeek) { Seek = newSeek; } }
836b87785c94ddb778a5b504fa312508f836ff3a
511c8706f1a451148bd78d4c9d42c20ea0947f7a
/src/Java/ClassesEMetodos/Exercicio1e2/ContaCorrente.java
e076ccc8a9fc94f985cd257bcbfeee2c6cb094a0
[]
no_license
mluizac/SicrediDesenvolveTech
863348c7d4e59517525649161165f3b36c41ab4b
ee0114995e03d6a8d80758c0323caf48f46bfc5a
refs/heads/master
2023-08-28T20:52:45.459940
2021-11-11T23:38:52
2021-11-11T23:38:52
427,169,103
0
0
null
null
null
null
UTF-8
Java
false
false
621
java
package Java.ClassesEMetodos.Exercicio1e2; public class ContaCorrente { //Atributos: private int nroConta; private double saldo = 0.0; //Construtor: public ContaCorrente(int n){ nroConta = n; } //Métodos public void deposito(double valor){ if(valor > 0) saldo += valor; //saldo = saldo + valor } public double retirada(double valor){ if(saldo - valor >= 0) saldo -= valor; return saldo; } public double getSaldo(){ return saldo; } public int getNroConta(){ return nroConta; } }
c0455c6fd012f5bdfb012e720e41203a328b70c5
dd117a175e225f96ecd3ac1ec197014f7f1eeadf
/Stepik/HW03/src/main/java/accounts/UserProfile.java
8c0b5ad040d4d5c04648b9ad30294cc77a2a5940
[]
no_license
ib1855/Homeworks
23486b151083afae4d6f538a15bf21805cc99a4f
1f7b7c451c6f1328498e24c6c6aa30faf5bca5bc
refs/heads/master
2022-12-21T20:00:19.737214
2020-09-30T23:50:17
2020-09-30T23:50:17
290,852,141
0
0
null
null
null
null
UTF-8
Java
false
false
952
java
package accounts; public class UserProfile { // private final String login; // private final String pass; // private final String email; private String login; private String pass; private String email; public UserProfile(){ } public UserProfile(String login, String pass, String email) { this.login = login; this.pass = pass; this.email = email; } public UserProfile(String login) { this.login = login; this.pass = login; this.email = login; } public String getLogin() { return login; } public String getPass() { return pass; } public String getEmail() { return email; } public void setLogin(String login) { this.login = login; } public void setPass(String pass) { this.pass = pass; } public void setEmail(String email) { this.email = email; } }
dc378c931b01ac910f750654e98977ebe5c64643
a744882fb7cf18944bd6719408e5a9f2f0d6c0dd
/sourcecode7/src/sun/security/pkcs11/wrapper/CK_SSL3_KEY_MAT_OUT.java
1f27d7dc860114f79aa53ac2f9541789943ec42a
[ "Apache-2.0" ]
permissive
hanekawasann/learn
a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33
eef678f1b8e14b7aab966e79a8b5a777cfc7ab14
refs/heads/master
2022-09-13T02:18:07.127489
2020-04-26T07:58:35
2020-04-26T07:58:35
176,686,231
0
0
Apache-2.0
2022-09-01T23:21:38
2019-03-20T08:16:05
Java
UTF-8
Java
false
false
4,986
java
/* * reserved comment block * DO NOT REMOVE OR ALTER! */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: * * "This product includes software developed by IAIK of Graz University of * Technology." * * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The names "Graz University of Technology" and "IAIK of Graz University of * Technology" must not be used to endorse or promote products derived from * this software without prior written permission. * * 5. Products derived from this software may not be called * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior * written permission of Graz University of Technology. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package sun.security.pkcs11.wrapper; /** * class CK_SSL3_KEY_MAT_OUT contains the resulting key handles and * initialization vectors after performing a C_DeriveKey function with the * CKM_SSL3_KEY_AND_MAC_DERIVE mechanism.<p> * <B>PKCS#11 structure:</B> * <PRE> * typedef struct CK_SSL3_KEY_MAT_OUT { * CK_OBJECT_HANDLE hClientMacSecret; * CK_OBJECT_HANDLE hServerMacSecret; * CK_OBJECT_HANDLE hClientKey; * CK_OBJECT_HANDLE hServerKey; * CK_BYTE_PTR pIVClient; * CK_BYTE_PTR pIVServer; * } CK_SSL3_KEY_MAT_OUT; * </PRE> * * @author Karl Scheibelhofer <[email protected]> * @author Martin Schlaeffer <[email protected]> */ public class CK_SSL3_KEY_MAT_OUT { /** * <B>PKCS#11:</B> * <PRE> * CK_OBJECT_HANDLE hClientMacSecret; * </PRE> */ public long hClientMacSecret; /** * <B>PKCS#11:</B> * <PRE> * CK_OBJECT_HANDLE hServerMacSecret; * </PRE> */ public long hServerMacSecret; /** * <B>PKCS#11:</B> * <PRE> * CK_OBJECT_HANDLE hClientKey; * </PRE> */ public long hClientKey; /** * <B>PKCS#11:</B> * <PRE> * CK_OBJECT_HANDLE hServerKey; * </PRE> */ public long hServerKey; /** * <B>PKCS#11:</B> * <PRE> * CK_BYTE_PTR pIVClient; * </PRE> */ public byte[] pIVClient; /** * <B>PKCS#11:</B> * <PRE> * CK_BYTE_PTR pIVServer; * </PRE> */ public byte[] pIVServer; /** * Returns the string representation of CK_SSL3_KEY_MAT_OUT. * * @return the string representation of CK_SSL3_KEY_MAT_OUT */ public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append(Constants.INDENT); buffer.append("hClientMacSecret: "); buffer.append(hClientMacSecret); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("hServerMacSecret: "); buffer.append(hServerMacSecret); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("hClientKey: "); buffer.append(hClientKey); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("hServerKey: "); buffer.append(hServerKey); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("pIVClient: "); buffer.append(Functions.toHexString(pIVClient)); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("pIVServer: "); buffer.append(Functions.toHexString(pIVServer)); //buffer.append(Constants.NEWLINE); return buffer.toString(); } }
b000103f3dc6a6b22a6bb4258d04a35500255963
d7e713c3208616ebb95b75ecf582babea72112ca
/app/src/main/java/com/quebix/bunachat/Model/Ad.java
181960104feebcfa7e461807f668606104962fee
[]
no_license
FiraolDida/BegTera
da5f1ee540767a3abfd7cac2bc44e53c23b651c7
dad8b0d637c9fd3a51ac41ea8e035102cf715395
refs/heads/master
2022-10-24T13:47:41.100028
2020-03-13T08:18:39
2020-03-13T08:18:39
210,799,018
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package com.quebix.bunachat.Model; public class Ad { private String image, name; private int testImage; public Ad() { } public Ad(String image, String name) { this.image = image; this.name = name; } public Ad(String name, int testImage) { this.name = name; this.testImage = testImage; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getTestImage() { return testImage; } public void setTestImage(int testImage) { this.testImage = testImage; } }
1c65dd7f866049874875270ebd273f1ff05d832c
82b87995e7b5080ec0ceaca3c9d0be49114ab48b
/hardwaremodule/src/main/java/com/ekek/hardwaremodule/entity/RequestAction.java
ff26021b4b835c756967eeb67b80be3d75d00753
[]
no_license
liangfeng2001/hob
7f99d8a6144d9cb406faa868fc87c90943f3517f
7702275f1b777b9aa509fd0e1d1b186701c5df69
refs/heads/master
2022-12-13T10:30:09.684837
2020-08-22T02:16:11
2020-08-22T02:16:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,412
java
package com.ekek.hardwaremodule.entity; /** * Rfid模块请求操作 * * Created by Samhung on 2017/9/3. */ public class RequestAction { public static final int REQUEST_ACTION_NO_OPERATION = -1; public static final int REQUEST_ACTION_OPERATE_MODULE = 0; /*****************************************************************************************/ /* */ /* 14443A */ /* */ /*****************************************************************************************/ /** * 请求认证14443A协议卡秘钥 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_AUTH_KEY = 1; /** * 请求激活14443A协议卡 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_ACTIVATE = 2; /** * 请求带参数激活14443A协议卡秘钥 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_ACTIVATE_WITH_PARAMETER = 3; /** * 请求读取14443A协议卡的块数据 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_READ_A = 4; /** * 请求写入数据到14443A协议卡的数据块 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_WRITE_A = 5; /** * 请求写入数据到Mifare Ultralight卡的数据块 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_WRITE_UL = 6; /** * 请求初始化电子钱包 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_INIT_VL = 7; /** * 请求操作电子钱包 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_OPERATE_VL = 8; /** * 请求备份电子钱包值 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_BAK_A = 9; /** * 请求读取电子钱包值 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_READ_VALUE = 10; /** * 请求卡片复位 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_RESET = 11; /** * 请求应答,使CPU卡进入ISO14443-4模式,返回卡片的ATS数据 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_ATS = 12; /** * 请求发送APDU指令,给14443-4模式下的CPU卡发送APDU指令 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_TPCL = 13; /** * 请求激活ISO14443B卡 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_ACTIVATE_B = 14; /** * 请求ISO14443B卡数据交互 * * */ public static final int REQUEST_ACTION_REQUEST_PICC_TRANSFER = 15; /*****************************************************************************************/ /* */ /* 15693 */ /* */ /*****************************************************************************************/ /** * 请求寻找15693协议的卡 * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_INVENTORY = 101; /** * 请求读取15693协议的卡的块数据 * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_READ_BLOCK = 102; /** * 请求写入数据到15693协议的卡的数据块 * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_WRITE_BLOCK = 103; /** * 请求锁定15693协议卡的数据块 * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_LOCK_BLOCK = 104; /** * 请求写入15693协议卡的AFI * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_WRITE_AFI = 105; /** * 请求锁定15693协议卡的AFI * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_LOCK_AFI = 106; /** * 请求写入15693协议卡的DSFID * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_WRITE_DSFID = 107; /** * 请求锁定15693协议卡的DSFID * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_LOCK_DSFID = 108; /** * 请求获取15693协议卡信息 * * */ public static final int REQUEST_ACTION_REQUEST_ISO15693_GET_SYS_INFOR = 109; /*****************************************************************************************/ /* */ /* Rfid module */ /* */ /*****************************************************************************************/ /** * Brd Rfid模块响应 * * */ public static final int REQUEST_ACTION_BRD_RFID_HARDWARE_RESPONSE = 1000; /** * 请求初始化Rfid模块 * * */ public static final int REQUEST_ACTION_REQUEST_INITIALIZE_HARDWARE = 1001; /** * 请求控制Rfid模块蜂鸣器响 * * */ public static final int REQUEST_ACTION_REQUEST_MODULE_SET_BUZZER = 1002; /** * 请求设置Rfid模块的波特率 * * */ public static final int REQUEST_ACTION_REQUEST_MODULE_SET_BAUDRATE = 1003; /** * 请求控制Rfid模块的LED闪烁 * * */ public static final int REQUEST_ACTION_REQUEST_MODULE_SET_LED = 1004; /** * 请求Rfid模块的进入休眠 * * */ public static final int REQUEST_ACTION_REQUEST_MODULE_SET_HALT = 1005; /** * 请求Rfid模块的从休眠恢复进入工作状态 * * */ public static final int REQUEST_ACTION_REQUEST_MODULE_SET_WAKE = 1006; /** * 请求打开设备 * * */ public static final int REQUEST_ACTION_BRD_RFID_OPEN_DEVICE = 1007; /** * 请求关闭设备 * * */ public static final int REQUEST_ACTION_BRD_RFID_CLOSE_DEVICE = 1008; }
d63e4b810d1fcfd0f24863b1a76d57cec0467861
3fbce646837d3e5ea0bec9f7fa005c7302efab4a
/src/WrongMeasurments.java
8d89b7c3c674cf605688a1934855e9bbc6eda770
[]
no_license
scpcho/JavaAdvanceSoftUni
d03f39d8a931f2e88ae1a1cf421db4e28aeb8eeb
f68e00a30a97e61783fe41457d4eeed79db22e2a
refs/heads/master
2023-03-28T03:04:07.153410
2021-03-26T14:21:44
2021-03-26T14:21:44
329,450,697
0
0
null
null
null
null
UTF-8
Java
false
false
3,021
java
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class WrongMeasurments { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = Integer.parseInt(scanner.nextLine()); int[][] matrix = new int[n][]; for (int row = 0; row < n; row++) { matrix[row] = readArray(scanner, "\\s+"); } int[] indexes = readArray(scanner, "\\s+"); int wrongValues = matrix[indexes[0]][indexes[1]]; ArrayList<int[]> fixInfo = new ArrayList<>(); for (int row = 0; row < matrix.length; row++) { for (int col = 0; col < matrix[row].length; col++) { if (matrix[row][col] == wrongValues) { int rightValue = calculateRightValue(matrix, row, col, wrongValues); fixInfo.add(new int[]{row, col, rightValue}); } } } for (int[] info : fixInfo) { matrix[info[0]][info[1]] = info[2]; } printMatrix(matrix); } private static void printMatrix(int[][] matrix) { for (int row = 0; row < matrix.length; row++) { for (int col = 0; col < matrix[row].length; col++) { System.out.print(matrix[row][col] + " "); } System.out.println(); } } private static int calculateRightValue(int[][] matrix, int row, int col, int wrongValues) { int rightValue = 0; if (isInBounds(matrix, row - 1, col) && matrix[row - 1][col] != wrongValues) { rightValue += matrix[row - 1][col]; } if (isInBounds(matrix, row + 1, col) && matrix[row + 1][col] != wrongValues) { rightValue += matrix[row + 1][col]; } if (isInBounds(matrix, row, col - 1) && matrix[row][col - 1] != wrongValues) { rightValue += matrix[row][col - 1]; } if (isInBounds(matrix, row, col + 1) && matrix[row][col + 1] != wrongValues) { rightValue += matrix[row][col + 1]; } return rightValue; } private static boolean isInBounds(int[][] matrix, int row, int col) { return row < matrix.length && row >= 0 && col < matrix[row].length && col >= 0; } private static boolean isOutOfBounds(int[][] matrix, int row, int col) { return !isInBounds(matrix, row, col); } private static int[] readArray(Scanner scanner, String pattern) { return Arrays.stream(scanner.nextLine() .split(pattern)) .mapToInt(Integer::parseInt) .toArray(); } private static void readMatrix(Scanner scanner, String pattern) { int[] rowsAndCols = readArray(scanner, pattern); int rows = rowsAndCols[0]; int cols = rowsAndCols[1]; int[][] matrix = new int[rows][cols]; for (int r = 0; r < matrix.length; r++) { matrix[r] = readArray(scanner, pattern); } } }
6cd413e3ed602f7d4864ae87e3dab6a8c344d10a
8058dd5875fb1f62a0a885ad8f83c14d2c092c3c
/app/src/main/java/com/hungth/cotoan/screen/ai/AIControler.java
57c8afd82619b12421a564fa26af581c4b6d104b
[]
no_license
hungth-1726/CoToanDoAn
739e55a018e90a4ba4cd1ff26f20066bda1101f8
eef475486e9511a436efc09067e88a8431a42ad4
refs/heads/master
2020-04-28T02:53:27.705352
2019-05-08T12:03:51
2019-05-08T12:03:51
174,915,046
0
0
null
2019-05-08T09:00:23
2019-03-11T02:56:23
Java
UTF-8
Java
false
false
63,835
java
package com.hungth.cotoan.screen.ai; import android.util.Log; import com.hungth.cotoan.data.model.AICell; import java.util.ArrayList; import java.util.List; import java.util.Random; public class AIControler { private boolean enableCong = false; private boolean enableTru = false; private boolean enableNhan = false; private boolean enableChia = false; private int doSau = 0; Random random = new Random(); // MainUi.AISuccess interfaceSuccess; String mauQuanCuaMay = "D"; public AIControler(List<String> dsPhepTinh, int level) { for (int i = 0; i < dsPhepTinh.size(); i++) { if (dsPhepTinh.get(i).equals(AIConfig.PT_CONG)) { enableCong = true; } if (dsPhepTinh.get(i).equals(AIConfig.PT_TRU)) { enableTru = true; } if (dsPhepTinh.get(i).equals(AIConfig.PT_NHAN)) { enableNhan = true; } if (dsPhepTinh.get(i).equals(AIConfig.PT_CHIA)) { enableChia = true; } } doSau = level; } // ham duoc goi de tim kiem nuoc di public int[] searchMove(String sTrangThai, String quanCoDiChuyen, int diemCuocConLai) { //quancodichuyen ;Quan co di chuyen o luot sau //tao note goc List<AICell> lstQuanxanh = new ArrayList<>(); // this.interfaceSuccess = interfaceSuccess; List<AICell> lstQuanDo = new ArrayList<>(); AICell[][] trangThaiBanCo = coverStringToLstCell(sTrangThai, lstQuanxanh, lstQuanDo); List<AINote> lstNoteCon = new ArrayList<>(); AINote noteGoc = new AINote(0, false, quanCoDiChuyen, trangThaiBanCo, diemCuocConLai, lstQuanxanh, lstQuanDo, lstNoteCon, null, 0); // Debug.Log("Hoan thanhsssssssssssss " + trangThaiBanCo[2, 0].typeQuanCo + "" + trangThaiBanCo[2, 0].giaTri); taoCayTroChoi(noteGoc); print(noteGoc); Log.d("######", "searchMove: "); // Debug.Log("Hoan thanh "+ trangThaiBanCo[2,0].typeQuanCo+""+ trangThaiBanCo[2, 0].giaTri); int[] result = duyetCay(noteGoc); // Debug.Log("Hoan thanh 22222222"); print(noteGoc); // interfaceSuccess.update(result); return result; } private void print(AINote aINote) { // Debug.Log("IN " + aINote.countLevel + " score " + aINote.scoreTrangThai); Log.d("######", "IN " + aINote.countLevel + " score " + aINote.scoreTrangThai); List<AINote> lstNoteCon = aINote.noteConS; if (lstNoteCon != null) { for (AINote note : lstNoteCon) { print(note); } } } private AICell[][] coverStringToLstCell(String value, List<AICell> lstQuanxanh, List<AICell> lstQuanDo) { AICell[][] lstCell = new AICell[9][11]; String[] tempNew = value.split("_"); for (int i = 0; i < tempNew.length; i++) { int xLocation = i % 9; int yLocation = i / 9; String sValue = tempNew[i]; char c1 = sValue.charAt(0); char c2 = sValue.charAt(1); AICell aICell = new AICell(xLocation, yLocation, String.valueOf(c1), Integer.valueOf(c2 + "")); lstCell[xLocation][yLocation] = aICell; //Debug.Log("X: " + xLocation + " Y:" + yLocation + " name" + lstCell[xLocation,yLocation].typeQuanCo+""+ lstCell[xLocation, yLocation].giaTri); if (String.valueOf(c1).equals(AIConfig.QUAN_DO)) { lstQuanDo.add(aICell); } else { lstQuanxanh.add(aICell); } } return lstCell; } private int tinhDiemTrangThaiBanCo(String quanDangDiChuyen, List<AICell> lstQuanDo, List<AICell> lstQuanXanh, AICell[][] trangThai, int diemCuocConLai) { int score = 0; //if (quanDangDiChuyen.equals(AIConfig.QUAN_DO)) { //tinh diem theo so quan co tren ban co for (AICell cellQuanDo : lstQuanDo) { score += cellQuanDo.giaTri * AIConfig.HS_NHAN_QUAN_CO; } for (AICell cellQuanXanh : lstQuanXanh) { score -= cellQuanXanh.giaTri * AIConfig.HS_NHAN_QUAN_CO; } //Kiem tra co the an quan doi phuong hay khong. Neu co the bang gia tri quan duoc an *7 int diemAnQuanDo = tinhDiemAnQuan(lstQuanDo, trangThai, diemCuocConLai); int diemAnQuanXanh = tinhDiemAnQuan(lstQuanXanh, trangThai, diemCuocConLai); score += diemAnQuanDo; score -= diemAnQuanXanh; // tinh diem bonus bao ve quan 0 String type01 = trangThai[4][1].typeQuanCo; String type02 = trangThai[4][9].typeQuanCo; if (type01.equals(quanDangDiChuyen)) { int bonus1 = tinhDiemBonus(type01, 0, trangThai); int bonus2 = tinhDiemBonus(type02, 1, trangThai); score += bonus1; score -= bonus2; } else { int bonus1 = tinhDiemBonus(type02, 1, trangThai); int bonus2 = tinhDiemBonus(type01, 0, trangThai); score += bonus1; score -= bonus2; } //} else { // //tinh diem theo so quan co tren ban co // foreach (AICell cellQuanDo in lstQuanDo) { // score -= cellQuanDo.giaTri * AIConfig.HS_NHAN_QUAN_CO; // } // foreach (AICell cellQuanXanh in lstQuanXanh) { // score += cellQuanXanh.giaTri * AIConfig.HS_NHAN_QUAN_CO; // } // //Kiem tra co the an quan doi phuong hay khong. Neu co the bang gia tri quan duoc an *7 // int diemAnQuanDo = tinhDiemAnQuan(lstQuanDo, trangThai, diemCuocConLai); // int diemAnQuanXanh = tinhDiemAnQuan(lstQuanXanh, trangThai, diemCuocConLai); // score -= diemAnQuanDo; // score += diemAnQuanXanh; // // tinh diem bonus bao ve quan 0 // String type01 = trangThai[4, 1].typeQuanCo; // String type02 = trangThai[4, 9].typeQuanCo; // if (type01.equals(quanDangDiChuyen)) { // int bonus1 = tinhDiemBonus(type01, 0, trangThai); // int bonus2 = tinhDiemBonus(type02, 1, trangThai); // score += bonus1; // score -= bonus2; // } else { // int bonus1 = tinhDiemBonus(type02, 1, trangThai); // int bonus2 = tinhDiemBonus(type01, 0, trangThai); // score += bonus1; // score -= bonus2; // } //} int a = random.nextInt(10); score += a; return score; } private int tinhDiemBonus(String typeQuan0, int indexQuan0, AICell[][] trangThai) { //index=0 --> vi tri 4,1, index =1--> vi tri 4,9 int score = 0; if (indexQuan0 == 0) { //quan0 duoi if (trangThai[3][0].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[3][1].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[3][2].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[4][2].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][2].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][1].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][0].typeQuanCo.equals(typeQuan0)) { score++; } } else { //quan0 tren if (trangThai[3][10].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[3][9].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[3][8].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[4][8].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][8].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][9].typeQuanCo.equals(typeQuan0)) { score++; } if (trangThai[5][10].typeQuanCo.equals(typeQuan0)) { score++; } } return score; } private int tinhDiemAnQuan(List<AICell> lstQuanTinh, AICell[][] trangThai, int diemCuocConLai) { int scoreAnQuan = 0; for (AICell cellQuan : lstQuanTinh) { int x = cellQuan.xLocation; int y = cellQuan.yLocation; String typeQuanCo = cellQuan.typeQuanCo; if (x == 4 && y == 1 || x == 4 && y == 9) { } else { //region kiem tra ben trai x--, y== if (x > 0) { if (trangThai[x - 1][y].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x - 1][y].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTrai(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x - count][y].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x - count][y].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben tren - trai x--, y++ if (x > 0 && y < 10) { if (trangThai[x - 1][y + 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x - 1][y + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTraiTren(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x - count][y + count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x - count][y + count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben tren x==, y++ if (y < 10) { if (trangThai[x][y + 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x][y + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTren(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x][y + count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x][y + count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben tren- phai y++, x++ if (x < 8 && y < 10) { if (trangThai[x + 1][y + 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x + 1][y + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTrenPhai(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x + count][y + count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x + count][y + count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben phai x++, y== if (x < 8) { if (trangThai[x + 1][y].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x + 1][y].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanPhai(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x + count][y].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x + count][y].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben phai ben duoi x++, y-- if (x < 8 && y > 0) { if (trangThai[x + 1][y - 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x + 1][y - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanPhaiDuoi(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x + count][y - count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x + count][y - count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben ben duoi x==, y--; if (y > 0) { if (trangThai[x][y - 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x][y - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanDuoi(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x][y - count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x][y - count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion //region kiem tra ben duoi- trai x--, y-- if (x > 0 && y > 0) { if (trangThai[x - 1][y - 1].typeQuanCo.equals(typeQuanCo)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = cellQuan.giaTri; int giaTri2 = trangThai[x - 1][y - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanDuoiTrai(trangThai, x, y, dsPt, typeQuanCo); if (count != -1) { count += 1; if (diemCuocConLai != -1 && diemCuocConLai - trangThai[x - count][y - count].giaTri <= 1) { scoreAnQuan += 500; } else { scoreAnQuan += trangThai[x - count][y - count].giaTri * AIConfig.HS_NHAN_AN_QUAN; } } } } //endregion } } return scoreAnQuan; } //region kiem tra an quan tra ve thu tu cua o co the an //return -1: khong an duoc private int kiemTraAnQuanTrai(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y==, x--; if (xlocation > 1) { xlocation -= 2; int count = 0; int max = findMax(giaTri); while (xlocation >= 0) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } if (count >= max) { return -1; } xlocation--; } return -1; } else { return -1; } } private int kiemTraAnQuanTraiTren(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y++, x--; if (xlocation > 1 && yLocation < 9) { xlocation -= 2; yLocation += 2; int count = 0; int max = findMax(giaTri); while (xlocation >= 0) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } xlocation--; yLocation++; if ((count >= max) || yLocation >= 10) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanTren(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y++, x==; if (yLocation < 9) { yLocation += 2; int count = 0; int max = findMax(giaTri); while (yLocation <= 10) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } yLocation++; if ((count >= max)) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanTrenPhai(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y++, x++; if (yLocation < 9 && xlocation < 7) { yLocation += 2; xlocation += 2; int count = 0; int max = findMax(giaTri); while (yLocation <= 10) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } yLocation++; xlocation++; if ((count >= max) || xlocation >= 8) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanPhai(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y==, x++; if (xlocation < 7) { xlocation += 2; int count = 0; int max = findMax(giaTri); while (xlocation <= 8) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } xlocation++; if ((count >= max)) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanPhaiDuoi(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y--, x++; if (xlocation < 7 && yLocation > 1) { xlocation += 2; yLocation -= 2; int count = 0; int max = findMax(giaTri); while (xlocation <= 8) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } xlocation++; yLocation--; if ((count >= max) || yLocation <= 0) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanDuoi(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y--, x==; if (yLocation > 1) { yLocation -= 2; int count = 0; int max = findMax(giaTri); while (yLocation >= 0) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } yLocation--; if ((count >= max)) { return -1; } } return -1; } else { return -1; } } private int kiemTraAnQuanDuoiTrai(AICell[][] trangThai, int xlocation, int yLocation, List<Integer> giaTri, String mauQuanDiChuyen) { //y--, x--; if (yLocation > 1 && xlocation > 1) { yLocation -= 2; xlocation -= 2; int count = 0; int max = findMax(giaTri); while (yLocation >= 0) { count++; if (!trangThai[xlocation][yLocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { if (!trangThai[xlocation][yLocation].typeQuanCo.equals(mauQuanDiChuyen)) { if (findIntInList(giaTri, count)) { return count; } return -1; } return -1; } yLocation--; xlocation--; if ((count >= max) || xlocation <= 0) { return -1; } } return -1; } else { return -1; } } private boolean findIntInList(List<Integer> lstValue, int value) { for (int temp : lstValue) { if (temp == value) { return true; } } return false; } private int findMax(List<Integer> lstValue) { int max = lstValue.get(0); for (int temp : lstValue) { if (temp > max) { max = temp; } } return max; } //endregion //region tao note Con private void taoCayTroChoi(AINote noteFather) { int countLevel = noteFather.countLevel; String quanCoDiChuyen = (noteFather.quanDiChuyen); List<AICell> lstQuanCoCanDi = new ArrayList<>(); if (quanCoDiChuyen.equals(AIConfig.QUAN_DO)) { lstQuanCoCanDi = noteFather.lstQuanDo; } else { lstQuanCoCanDi = noteFather.lstQuanXanh; } //Debug.Log("COUNT " + lstQuanCoCanDi.Count + "____" + quanCoDiChuyen); for (AICell quanCo : lstQuanCoCanDi) { //Debug.Log("vong for " + noteFather.countLevel + "_____" + quanCo.typeQuanCo + "" + quanCo.giaTri); //Kiem tra cac nuoc co the buoc chua tinh nuoc an List<AIConfig.Location> lstNuocDi = timNuocDi(quanCo.xLocation, quanCo.yLocation, quanCo.giaTri, noteFather.trangThaiBanCo); //Debug.Log("so nuoc di 1: " + lstNuocDi.Count); lstNuocDi.addAll(timCacNuocAnQuan(quanCo.xLocation, quanCo.yLocation, quanCo.giaTri, noteFather.trangThaiBanCo, quanCoDiChuyen)); //Debug.Log("so nuoc di 2: " + lstNuocDi.Count); for (AIConfig.Location location : lstNuocDi) { AINote note = taoNoteCon(noteFather, quanCo.xLocation, quanCo.yLocation, location.xLocation, location.yLocation, quanCoDiChuyen); noteFather.noteConS.add(note); if (note.countLevel < doSau) { taoCayTroChoi(note); } } } } //tim cac nuoc di co the co cua 1 quan co private List<AIConfig.Location> timNuocDi(int xlocation, int ylocation, int giaTri, AICell[][] trangThai) { List<AIConfig.Location> lstLocation = new ArrayList<>(); //kiem tra trai x-- y== for (int i = 1; i <= giaTri; i++) { if (xlocation - i >= 0) { if (trangThai[xlocation - i][ylocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { lstLocation.add(new AIConfig.Location(xlocation - i, ylocation)); } else { break; } } } //kiem tra trai -tren x-- y++ for (int i = 1; i <= giaTri; i++) { if (xlocation - i >= 0 && ylocation + i <= 10) { if (trangThai[xlocation - i][ylocation + i].typeQuanCo.equals(AIConfig.QUAN_TRONG)) { lstLocation.add(new AIConfig.Location(xlocation - i, ylocation + i)); } else { break; } } } //kiem tra tren x== y++ for (int i = 1; i <= giaTri; i++) { if (ylocation + i <= 10) { if (trangThai[xlocation][ylocation + i].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation, ylocation + i)); } else{ break; } } } //kiem tra tren phai x++ y++ for (int i = 1; i <= giaTri; i++) { if (xlocation + i <= 8 && ylocation + i <= 10) { if (trangThai[xlocation + i][ylocation + i].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation + i, ylocation + i)); } else{ break; } } } //kiem tra phai x++ y== for (int i = 1; i <= giaTri; i++) { if (xlocation + i <= 8) { if (trangThai[xlocation + i][ylocation].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation + i, ylocation)); } else{ break; } } } //kiem tra phai duoi x++ y-- for (int i = 1; i <= giaTri; i++) { if (xlocation + i <= 8 && ylocation - i >= 0) { if (trangThai[xlocation + i][ylocation - i].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation + i, ylocation - i)); } else{ break; } } } //kiem tra duoi x== y-- for (int i = 1; i <= giaTri; i++) { if (ylocation - i >= 0) { if (trangThai[xlocation][ylocation - i].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation, ylocation - i)); } else{ break; } } } //kiem tra duoi trai x-- y-- for (int i = 1; i <= giaTri; i++) { if (xlocation - i >= 0 && ylocation - i >= 0) { if (trangThai[xlocation - i][ylocation - i].typeQuanCo.equals(AIConfig.QUAN_TRONG)){ lstLocation.add(new AIConfig.Location(xlocation - i, ylocation - i)); } else{ break; } } } return lstLocation; } private List<AIConfig.Location> timCacNuocAnQuan(int xlocation, int ylocation, int giaTri, AICell[][] trangThai, String quanDuocDiChuyen) { List<AIConfig.Location> value = new ArrayList<>(); //region kiem tra trai x-- y== if (xlocation > 0) { if (trangThai[xlocation - 1][ylocation].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation - 1][ylocation].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanDuoiTrai(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation - count, ylocation); value.add(location); } } } //endregion //region kiem tra trai tren x-- y++ if (xlocation > 0 && ylocation < 10) { if (trangThai[xlocation - 1][ylocation + 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation - 1][ylocation + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTraiTren(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation - count, ylocation + count); value.add(location); } } } //endregion //region kiem tra tren x== y++ if (ylocation < 10) { if (trangThai[xlocation][ylocation + 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation][ylocation + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTren(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation, ylocation + count); value.add(location); } } } //endregion //region kiem tra tren phai x++ y++ if (xlocation < 8 && ylocation < 10) { if (trangThai[xlocation + 1][ylocation + 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation + 1][ylocation + 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanTrenPhai(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation + count, ylocation + count); value.add(location); } } } //endregion //region kiem tra phai x++ y== if (xlocation < 8) { if (trangThai[xlocation + 1][ylocation].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation + 1][ylocation].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanPhai(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation + count, ylocation); value.add(location); } } } //endregion //region kiem tra phai duoi x++ y-- if (xlocation < 8 && ylocation > 0) { if (trangThai[xlocation + 1][ylocation - 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation + 1][ylocation - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanPhaiDuoi(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation + count, ylocation - count); value.add(location); } } } //endregion //region kiem tra duoi x== y-- if (ylocation > 0) { if (trangThai[xlocation][ylocation - 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation][ylocation - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanDuoi(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation, ylocation - count); value.add(location); } } } //endregion // region kiem tra duoi trai x-- y-- if (xlocation > 0 && ylocation > 0) { if (trangThai[xlocation - 1][ylocation - 1].typeQuanCo.equals(quanDuocDiChuyen)) { List<Integer> dsPt = new ArrayList<>(); int giaTri1 = giaTri; int giaTri2 = trangThai[xlocation - 1][ylocation - 1].giaTri; if (enableCong) { int tempC = giaTri1 + giaTri2; dsPt.add(tempC % 10); } if (enableTru) { if (giaTri1 > giaTri2) { int tempT = giaTri1 - giaTri2; dsPt.add(tempT % 10); } } if (enableNhan) { int tempN = giaTri1 * giaTri2; dsPt.add(tempN % 10); } if (enableChia) { if (giaTri1 > giaTri2) { int tempCh = giaTri1 / giaTri2; dsPt.add(tempCh % 10); } } int count = kiemTraAnQuanDuoiTrai(trangThai, xlocation, ylocation, dsPt, quanDuocDiChuyen); if (count != -1) { count += 1; AIConfig.Location location = new AIConfig.Location(xlocation - count, ylocation - count); value.add(location); } } } //endregion return value; } //diChuyenQuanTaoNutMoi private AINote taoNoteCon(AINote noteFather, int x1, int y1, int x2, int y2, String quanDangDiChuyen) { int diemCuocConLai = -1; List<AICell> lstQuanxanh = new ArrayList<>(); List<AICell> lstQuanDo = new ArrayList<>(); AICell[][] trangThai = cloneTrangThaiBanCo(noteFather.trangThaiBanCo, lstQuanxanh, lstQuanDo); //region di chuyen quan co cap nhat trang thai ban co va sanh sach quan co int giaTriQC = trangThai[x1][y1].giaTri; String typeQc = trangThai[x1][y1].typeQuanCo; if (typeQc.equals(AIConfig.QUAN_DO)) { //di chuyen quan do int index = findQcInList(trangThai[x1][y1], lstQuanDo); if (index != -1) { lstQuanDo.remove(index); //Kiem tra an quan doi phuong if (trangThai[x2][y2].typeQuanCo.equals(daoNguocTypeQuanCo(typeQc))) { diemCuocConLai = noteFather.diemCuocConLai - trangThai[x2][y2].giaTri; int index2 = findQcInList(trangThai[x1][y1], lstQuanxanh); if (index2 != -1) { lstQuanxanh.remove(index); } } trangThai[x1][y1].giaTri = 0; trangThai[x1][y1].typeQuanCo = AIConfig.QUAN_TRONG; trangThai[x2][y2].giaTri = giaTriQC; trangThai[x2][y2].giaTri = giaTriQC; trangThai[x2][y2].typeQuanCo = typeQc; lstQuanDo.add(trangThai[x2][y2]); } } else { //di chuyen quan xanh --- khong co truong hop o co trong int index = findQcInList(trangThai[x1][y1], lstQuanxanh); if (index != -1) { lstQuanxanh.remove(index); //Kiem tra an quan doi phuong if (trangThai[x2][y2].typeQuanCo.equals(daoNguocTypeQuanCo(typeQc))) { diemCuocConLai = noteFather.diemCuocConLai - trangThai[x2][y2].giaTri; int index2 = findQcInList(trangThai[x1][y1], lstQuanDo); if (index2 != -1) { lstQuanDo.remove(index2); } trangThai[x1][y1].giaTri = 0; trangThai[x1][y1].typeQuanCo = AIConfig.QUAN_TRONG; trangThai[x2][y2].giaTri = giaTriQC; trangThai[x2][y2].typeQuanCo = typeQc; lstQuanxanh.add(trangThai[x2][y2]); } } } //endregion if (diemCuocConLai <= -1) { if (noteFather.diemCuocConLai != -1) { diemCuocConLai = 0; } else { diemCuocConLai = -1; } } int countLevel = noteFather.countLevel + 1; List<AINote> lstNoteCon = null; int score = 0; if (countLevel != doSau) { lstNoteCon = new ArrayList<>(); } else { score = tinhDiemTrangThaiBanCo(quanDangDiChuyen, lstQuanDo, lstQuanxanh, trangThai, diemCuocConLai); } AINote aINote = new AINote(score, false, daoNguocTypeQuanCo(quanDangDiChuyen), trangThai, diemCuocConLai, lstQuanxanh, lstQuanDo, lstNoteCon, noteFather, countLevel); return aINote; } private int findQcInList(AICell quanCo, List<AICell> listQuanCo) { for (int i = 0; i < listQuanCo.size(); i++) { if (listQuanCo.get(i).typeQuanCo.equals(quanCo.typeQuanCo) && listQuanCo.get(i).giaTri == quanCo.giaTri) { return i; } } return -1; } private AICell[][] cloneTrangThaiBanCo(AICell[][]trangThai, List<AICell> lstQuanxanh, List<AICell> lstQuanDo) { AICell[][] clone = new AICell[9][ 11]; for (int y = 0; y < 11; y++) { for (int x = 0; x < 9; x++) { clone[x][y] =new AICell(trangThai[x][ y]); } } for (int x = 0; x < 9; x++) { for (int y = 0; y < 11; y++) { if (clone[x][y].typeQuanCo.equals(AIConfig.QUAN_DO)){ lstQuanDo.add(new AICell(clone[x][ y])); } if (clone[x][y].typeQuanCo.equals(AIConfig.QUAN_XANH)){ lstQuanxanh.add(new AICell(clone[x][ y])); } } } return clone; } private String daoNguocTypeQuanCo(String typeQuanCo) { if (typeQuanCo.equals(AIConfig.QUAN_DO)) { return AIConfig.QUAN_XANH; } if (typeQuanCo.equals(AIConfig.QUAN_XANH)) { return AIConfig.QUAN_DO; } return AIConfig.QUAN_TRONG; } //endregion // region duyet cay private int[] duyetCay(AINote noteGoc) { AINote noteConTrai = getConTrai(noteGoc); AINote bestNote = satart(noteConTrai); List<AINote> lstCon = noteGoc.noteConS; AINote max = lstCon.get(0); for (AINote note : lstCon) { if (note.scoreTrangThai > max.scoreTrangThai) { max = note; } } String sold1 = cellToString(noteGoc.trangThaiBanCo); String snew = cellToString(max.trangThaiBanCo); int[] result = findIndexChanged(snew, sold1); return result; } private int[] findIndexChanged(String valueNew, String valueOld) { int[] result = new int[4]; String[] tempOld = valueOld.split("_"); String[] tempNew = valueNew.split("_"); if (tempOld.length == tempNew.length) { int oldI = -1, newI = -1; int[] tempIndex = new int[2]; tempIndex[0]=-1; tempIndex[1]=-1; int count = 0; for (int i = 0; i < tempNew.length; i++) { if (!tempNew[i].equals(tempOld[i])) { if (count >= 2) { result[0] = -1; result[1] = -1; result[2] = -1; result[3] = -1; return result; } tempIndex[count] = i; count++; } } if (tempNew[tempIndex[0]].equals("00") && !tempOld[tempIndex[0]].equals("00")) { oldI = tempIndex[0]; newI = tempIndex[1]; } else { oldI = tempIndex[1]; newI = tempIndex[0]; } result[0] = oldI % 9; result[1] = oldI / 9; result[2] = newI % 9; result[3] = newI / 9; } return result; } private AINote satart(AINote noteCon) { AINote noteFather = noteCon.noteFather; AINote bestNote = timGiaTriNote(noteFather); if (noteFather.noteFather != null) { satart(noteFather); } return bestNote; } private AINote getConTrai(AINote notGoc) { List<AINote> lstTemp = notGoc.noteConS; while (lstTemp.get(0).noteConS != null) { lstTemp = lstTemp.get(0).noteConS; } return lstTemp.get(0); } //private AINote findBestNote(AINote noteCon) { // AINote noteFather = getFather(noteCon); // List<AINote> lstTemp = noteFather.noteConS; // //kiem tra neu nut cha co countLevel +1 != do sau --> nut co vai tro lam ong/ dung for duyet dong thoi cac con // if (noteFather.countLevel + 1 != doSau) { // foreach(AINote noteTemp in lstTemp) { // if (!noteTemp.daDuyet) { // } // } // while // } else { // int value = findMaxMin(lstTemp, 1, false, 0); // noteFather.scoreTrangThai = value; // noteFather.daDuyet = true; // findBestNote(noteFather); // } // if (noteFather.countLevel % 2 == 0) { // //chia het cho 2 tim min // } else { // // chia su cho 2 tim max // } //} private AINote timGiaTriNote(AINote noteFather) { if (noteFather.countLevel + 1 != doSau) { List<AINote> lstNoteCon = noteFather.noteConS; //Debug.Log("So con note khac " + lstNoteCon.Count+" level "+ noteFather.countLevel); for (AINote noteTemp : lstNoteCon) { if (!noteTemp.daDuyet) { timGiaTriNote(noteTemp); } } if (noteFather.countLevel % 2 == 0) { int min = lstNoteCon.get(0).scoreTrangThai; int index = 0; for (int i = 0; i < lstNoteCon.size(); i++) { if (lstNoteCon.get(i).scoreTrangThai < min) { min = lstNoteCon.get(i).scoreTrangThai; index = i; } } noteFather.scoreTrangThai = min; noteFather.daDuyet = true; return lstNoteCon.get(index); } else { int max = lstNoteCon.get(0).scoreTrangThai; int index = 0; for (int i = 0; i < lstNoteCon.size(); i++) { if (lstNoteCon.get(i).scoreTrangThai > max) { max = lstNoteCon.get(i).scoreTrangThai; index = i; } } noteFather.scoreTrangThai = max; noteFather.daDuyet = true; return lstNoteCon.get(index); } } else { List<AINote> lstNoteCon = noteFather.noteConS; //Debug.Log("So con nkơt cuoi " + lstNoteCon.Count); if (lstNoteCon.size() > 0) { int max = lstNoteCon.get(0).scoreTrangThai; int index = 0; for (int i = 0; i < lstNoteCon.size(); i++) { if (lstNoteCon.get(i).scoreTrangThai > max) { max = lstNoteCon.get(i).scoreTrangThai; index = i; } } noteFather.scoreTrangThai = max; noteFather.daDuyet = true; return lstNoteCon.get(index); } return null; } } ////alpha bata cut //private void findMaxMin(AINote noteFather, int status, bool enableAlBe, int albe) { //status ==2: min , status==1 max // if (status == 1) { // //tim max // if (enableAlBe) { // //tim max voi gia tri nho hon albe neu lon hon gia tri nut cha bang albe ex: alb=3, find= 5 // if(noteFather.countLevel+1== doSau) { // if() // List<AINote> lstNoteCon = noteFather.noteConS; // int max = lstNoteCon[0].scoreTrangThai; // foreach (AINote note in lstNoteCon) { // if (note.scoreTrangThai > max) { // max = note.scoreTrangThai; // } // //kiem tra alpha // if (max > albe) { // noteFather.daDuyet = true; // noteFather.scoreTrangThai= max; // break; // } // } // } else { // //khong phai note gan cuoi // List<AINote> lstNoteCon = noteFather.noteConS; // if() // } // return max; // } else { // //tim max khong dieu kien // List<AINote> lstNoteCon = noteFather.noteConS; // int max = lstNoteCon[0].scoreTrangThai; // foreach (AINote note in lstNoteCon) { // if (note.scoreTrangThai > max) { // max = note.scoreTrangThai; // } // } // noteFather.noteFather.scoreTrangThai = max; // } // } else { // //tim min // if (enableAlBe) { // //tim min voi gia tri lon hon albe neu nho hon gia tri nut cha bang albe ex: alb= 5, find= 3 // int min = lstNoteCon[0].scoreTrangThai; // foreach (AINote note in lstNoteCon) { // if (note.scoreTrangThai < min) { // min = note.scoreTrangThai; // } // //kiem tra alpha // if (min < albe) { // return min; // } // } // return min; // } else { // //tim min khong dieu kien // int min = lstNoteCon[0].scoreTrangThai; // foreach (AINote note in lstNoteCon) { // if (note.scoreTrangThai < min) { // min = note.scoreTrangThai; // } // } // return min; // } // } //} //// /// private String cellToString(AICell[][]trangThai) { String value = ""; for (int y = 0; y < 11; y++) { for (int x = 0; x < 9; x++) { AICell temp = trangThai[x][ y]; switch (temp.typeQuanCo) { case AIConfig.QUAN_XANH: int va = temp.giaTri; value += AIConfig.QUAN_XANH + va; break; case AIConfig.QUAN_DO: int va1 = temp.giaTri; value += AIConfig.QUAN_DO + va1; break; case AIConfig.QUAN_TRONG: value += "00"; break; default: break; } value += "_"; } } String s = value.substring(0, value.length() - 1); return s; } //endregion }
6edba21d4b2b5ea900c496f573ab3e26f76959da
c90551930c84cac34a1de999f59c53aac5939416
/src/JDBC/jsp/Prem_duration.java
a86059b665b8f169e1a1b6f90975dcec929b4094
[]
no_license
sohamray19/InsurancePolicyManagement
a512d2554801a623c22790fc7b81f322d01f54ac
ec83ce245a2a18d41bb72a80783fb0a3e2d3269f
refs/heads/master
2020-03-12T20:14:28.865210
2018-09-28T11:51:24
2018-09-28T11:51:24
130,801,200
2
0
null
2018-04-24T05:33:20
2018-04-24T05:33:19
null
UTF-8
Java
false
false
1,152
java
package JDBC.jsp; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Prem_duration { public int p_dur(int pol_no) { int duration = 0; String sql1 = "select duration from policy where pol_no=?"; try { Connection conn = new Connect().myDBConnect(); PreparedStatement stmt1 = conn.prepareStatement(sql1); stmt1.setInt(1, pol_no); ResultSet rs1 = stmt1.executeQuery(); rs1.next(); duration= rs1.getInt(1); //System.out.println("Date:"+p_date); //return p_date; if (rs1 != null) { try { rs1.close(); } catch (SQLException e) { System.out.println(e); } } if (stmt1 != null) { try { stmt1.close(); } catch (SQLException e) { System.out.println(e); } } if (conn != null) { try { conn.close(); } catch (SQLException e) { System.out.println(e); } } } catch (Exception e) { System.out.println(e); } return duration; } /*public static void main(String args[]) { Date d=new prem_date().due_date(1,897456123); System.out.println("Key="+d); }*/ }
3d7e8bd6b5faa4293426cc3717aab01fc7980ce9
9c1b51edc223afb233393dde1901a7f598309f0f
/src/com/sownbanana/view/RangeSliderUI.java
20e3f606ff6269e432db9ec2006b890d009bbbad
[]
no_license
SownBanana/StoreManager
b218930665e1e58350cfabc4245f1dd07b4f5f0a
5a5bf564deb2c4bc1997b094392c41e526ef922c
refs/heads/master
2022-11-17T07:35:39.444022
2020-07-20T14:17:08
2020-07-20T14:17:08
268,108,461
0
0
null
null
null
null
UTF-8
Java
false
false
20,713
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.sownbanana.view; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.event.MouseEvent; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; import javax.swing.JComponent; import javax.swing.JSlider; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; /** * * @author ernieyu */ class RangeSliderUI extends BasicSliderUI { /** * Color of selected range. */ private Color rangeColor = Color.LIGHT_GRAY; /** * Location and size of thumb for upper value. */ private Rectangle upperThumbRect; /** * Indicator that determines whether upper thumb is selected. */ private boolean upperThumbSelected; /** * Indicator that determines whether lower thumb is being dragged. */ private transient boolean lowerDragging; /** * Indicator that determines whether upper thumb is being dragged. */ private transient boolean upperDragging; /** * Constructs a RangeSliderUI for the specified slider component. * * @param b RangeSlider */ public RangeSliderUI(RangeSlider b) { super(b); } /** * Installs this UI delegate on the specified component. */ @Override public void installUI(JComponent c) { upperThumbRect = new Rectangle(); super.installUI(c); } /** * Creates a listener to handle track events in the specified slider. */ @Override protected TrackListener createTrackListener(JSlider slider) { return new RangeTrackListener(); } /** * Creates a listener to handle change events in the specified slider. */ @Override protected ChangeListener createChangeListener(JSlider slider) { return new ChangeHandler(); } /** * Updates the dimensions for both thumbs. */ @Override protected void calculateThumbSize() { // Call superclass method for lower thumb size. super.calculateThumbSize(); // Set upper thumb size. upperThumbRect.setSize(thumbRect.width, thumbRect.height); } /** * Updates the locations for both thumbs. */ @Override protected void calculateThumbLocation() { // Call superclass method for lower thumb location. super.calculateThumbLocation(); // Adjust upper value to snap to ticks if necessary. if (slider.getSnapToTicks()) { int upperValue = slider.getValue() + slider.getExtent(); int snappedValue = upperValue; int majorTickSpacing = slider.getMajorTickSpacing(); int minorTickSpacing = slider.getMinorTickSpacing(); int tickSpacing = 0; if (minorTickSpacing > 0) { tickSpacing = minorTickSpacing; } else if (majorTickSpacing > 0) { tickSpacing = majorTickSpacing; } if (tickSpacing != 0) { // If it's not on a tick, change the value if ((upperValue - slider.getMinimum()) % tickSpacing != 0) { float temp = (float) (upperValue - slider.getMinimum()) / (float) tickSpacing; int whichTick = Math.round(temp); snappedValue = slider.getMinimum() + (whichTick * tickSpacing); } if (snappedValue != upperValue) { slider.setExtent(snappedValue - slider.getValue()); } } } // Calculate upper thumb location. The thumb is centered over its // value on the track. if (slider.getOrientation() == JSlider.HORIZONTAL) { int upperPosition = xPositionForValue(slider.getValue() + slider.getExtent()); upperThumbRect.x = upperPosition - (upperThumbRect.width / 2); upperThumbRect.y = trackRect.y; } else { int upperPosition = yPositionForValue(slider.getValue() + slider.getExtent()); upperThumbRect.x = trackRect.x; upperThumbRect.y = upperPosition - (upperThumbRect.height / 2); } } /** * Returns the size of a thumb. */ @Override protected Dimension getThumbSize() { return new Dimension(12, 12); } /** * Paints the slider. The selected thumb is always painted on top of the * other thumb. */ @Override public void paint(Graphics g, JComponent c) { super.paint(g, c); Rectangle clipRect = g.getClipBounds(); if (upperThumbSelected) { // Paint lower thumb first, then upper thumb. if (clipRect.intersects(thumbRect)) { paintLowerThumb(g); // paintThumb(g); } if (clipRect.intersects(upperThumbRect)) { paintUpperThumb(g); } } else { // Paint upper thumb first, then lower thumb. if (clipRect.intersects(upperThumbRect)) { paintUpperThumb(g); } if (clipRect.intersects(thumbRect)) { paintLowerThumb(g); // paintThumb(g); } } } /** * Paints the track. */ @Override public void paintTrack(Graphics g) { // Draw track. super.paintTrack(g); Rectangle trackBounds = trackRect; if (slider.getOrientation() == JSlider.HORIZONTAL) { // Determine position of selected range by moving from the middle // of one thumb to the other. int lowerX = thumbRect.x + (thumbRect.width / 2); int upperX = upperThumbRect.x + (upperThumbRect.width / 2); // Determine track position. int cy = (trackBounds.height / 2) - 2; // Save color and shift position. Color oldColor = g.getColor(); g.translate(trackBounds.x, trackBounds.y + cy); // Draw selected range. g.setColor(rangeColor); for (int y = 0; y <= 3; y++) { g.drawLine(lowerX - trackBounds.x, y, upperX - trackBounds.x, y); } // Restore position and color. g.translate(-trackBounds.x, -(trackBounds.y + cy)); g.setColor(oldColor); } else { // Determine position of selected range by moving from the middle // of one thumb to the other. int lowerY = thumbRect.x + (thumbRect.width / 2); int upperY = upperThumbRect.x + (upperThumbRect.width / 2); // Determine track position. int cx = (trackBounds.width / 2) - 2; // Save color and shift position. Color oldColor = g.getColor(); g.translate(trackBounds.x + cx, trackBounds.y); // Draw selected range. g.setColor(rangeColor); for (int x = 0; x <= 3; x++) { g.drawLine(x, lowerY - trackBounds.y, x, upperY - trackBounds.y); } // Restore position and color. g.translate(-(trackBounds.x + cx), -trackBounds.y); g.setColor(oldColor); } } /** * Overrides superclass method to do nothing. Thumb painting is handled * within the <code>paint()</code> method. */ @Override public void paintThumb(Graphics g) { // Do nothing. } /** * Paints the thumb for the lower value using the specified graphics object. */ private void paintLowerThumb(Graphics g) { Rectangle knobBounds = thumbRect; int w = knobBounds.width; int h = knobBounds.height; // Create graphics copy. Graphics2D g2d = (Graphics2D) g.create(); // Create default thumb shape. Shape thumbShape = createThumbShape(w - 5, h - 1); // Draw thumb. g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.translate(knobBounds.x, knobBounds.y); g2d.setColor(Color.WHITE); g2d.fill(thumbShape); g2d.setColor(Color.GRAY); g2d.draw(thumbShape); // Dispose graphics. g2d.dispose(); } /** * Paints the thumb for the upper value using the specified graphics object. */ private void paintUpperThumb(Graphics g) { Rectangle knobBounds = upperThumbRect; int w = knobBounds.width; int h = knobBounds.height; // Create graphics copy. Graphics2D g2d = (Graphics2D) g.create(); // Create default thumb shape. Shape thumbShape = createThumbShape(w - 6, h - 1); // Draw thumb. g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.translate(knobBounds.x, knobBounds.y); g2d.setColor(Color.GRAY); g2d.fill(thumbShape); g2d.setColor(Color.DARK_GRAY); g2d.draw(thumbShape); // Dispose graphics. g2d.dispose(); } /** * Returns a Shape representing a thumb. */ private Shape createThumbShape(int width, int height) { // Use circular shape. Rectangle2D shape = new Rectangle.Double(0, 0, width, height); return shape; } /** * Sets the location of the upper thumb, and repaints the slider. This is * called when the upper thumb is dragged to repaint the slider. The * <code>setThumbLocation()</code> method performs the same task for the * lower thumb. */ private void setUpperThumbLocation(int x, int y) { Rectangle upperUnionRect = new Rectangle(); upperUnionRect.setBounds(upperThumbRect); upperThumbRect.setLocation(x, y); SwingUtilities.computeUnion(upperThumbRect.x, upperThumbRect.y, upperThumbRect.width, upperThumbRect.height, upperUnionRect); slider.repaint(upperUnionRect.x, upperUnionRect.y, upperUnionRect.width, upperUnionRect.height); } /** * Moves the selected thumb in the specified direction by a block increment. * This method is called when the user presses the Page Up or Down keys. */ public void scrollByBlock(int direction) { synchronized (slider) { int blockIncrement = (slider.getMaximum() - slider.getMinimum()) / 10; if (blockIncrement <= 0 && slider.getMaximum() > slider.getMinimum()) { blockIncrement = 1; } int delta = blockIncrement * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL); if (upperThumbSelected) { int oldValue = ((RangeSlider) slider).getUpperValue(); ((RangeSlider) slider).setUpperValue(oldValue + delta); } else { int oldValue = slider.getValue(); slider.setValue(oldValue + delta); } } } /** * Moves the selected thumb in the specified direction by a unit increment. * This method is called when the user presses one of the arrow keys. */ public void scrollByUnit(int direction) { synchronized (slider) { int delta = 1 * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL); if (upperThumbSelected) { int oldValue = ((RangeSlider) slider).getUpperValue(); ((RangeSlider) slider).setUpperValue(oldValue + delta); } else { int oldValue = slider.getValue(); slider.setValue(oldValue + delta); } } } /** * Listener to handle model change events. This calculates the thumb * locations and repaints the slider if the value change is not caused by * dragging a thumb. */ public class ChangeHandler implements ChangeListener { public void stateChanged(ChangeEvent arg0) { if (!lowerDragging && !upperDragging) { calculateThumbLocation(); slider.repaint(); } } } /** * Listener to handle mouse movements in the slider track. */ public class RangeTrackListener extends TrackListener { @Override public void mousePressed(MouseEvent e) { if (!slider.isEnabled()) { return; } currentMouseX = e.getX(); currentMouseY = e.getY(); if (slider.isRequestFocusEnabled()) { slider.requestFocus(); } // Determine which thumb is pressed. If the upper thumb is // selected (last one dragged), then check its position first; // otherwise check the position of the lower thumb first. boolean lowerPressed = false; boolean upperPressed = false; if (upperThumbSelected || slider.getMinimum() == slider.getValue()) { if (upperThumbRect.contains(currentMouseX, currentMouseY)) { upperPressed = true; } else if (thumbRect.contains(currentMouseX, currentMouseY)) { lowerPressed = true; } } else { if (thumbRect.contains(currentMouseX, currentMouseY)) { lowerPressed = true; } else if (upperThumbRect.contains(currentMouseX, currentMouseY)) { upperPressed = true; } } // Handle lower thumb pressed. if (lowerPressed) { switch (slider.getOrientation()) { case JSlider.VERTICAL: offset = currentMouseY - thumbRect.y; break; case JSlider.HORIZONTAL: offset = currentMouseX - thumbRect.x; break; } upperThumbSelected = false; lowerDragging = true; return; } lowerDragging = false; // Handle upper thumb pressed. if (upperPressed) { switch (slider.getOrientation()) { case JSlider.VERTICAL: offset = currentMouseY - upperThumbRect.y; break; case JSlider.HORIZONTAL: offset = currentMouseX - upperThumbRect.x; break; } upperThumbSelected = true; upperDragging = true; return; } upperDragging = false; } @Override public void mouseReleased(MouseEvent e) { lowerDragging = false; upperDragging = false; slider.setValueIsAdjusting(false); super.mouseReleased(e); } @Override public void mouseDragged(MouseEvent e) { if (!slider.isEnabled()) { return; } currentMouseX = e.getX(); currentMouseY = e.getY(); if (lowerDragging) { slider.setValueIsAdjusting(true); moveLowerThumb(); } else if (upperDragging) { slider.setValueIsAdjusting(true); moveUpperThumb(); } } @Override public boolean shouldScroll(int direction) { return false; } /** * Moves the location of the lower thumb, and sets its corresponding * value in the slider. */ private void moveLowerThumb() { int thumbMiddle = 0; switch (slider.getOrientation()) { case JSlider.VERTICAL: int halfThumbHeight = thumbRect.height / 2; int thumbTop = currentMouseY - offset; int trackTop = trackRect.y; int trackBottom = trackRect.y + (trackRect.height - 1); int vMax = yPositionForValue(slider.getValue() + slider.getExtent()); // Apply bounds to thumb position. if (drawInverted()) { trackBottom = vMax; } else { trackTop = vMax; } thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight); thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight); setThumbLocation(thumbRect.x, thumbTop); // Update slider value. thumbMiddle = thumbTop + halfThumbHeight; slider.setValue(valueForYPosition(thumbMiddle)); break; case JSlider.HORIZONTAL: int halfThumbWidth = thumbRect.width / 2; int thumbLeft = currentMouseX - offset; int trackLeft = trackRect.x; int trackRight = trackRect.x + (trackRect.width - 1); int hMax = xPositionForValue(slider.getValue() + slider.getExtent()); // Apply bounds to thumb position. if (drawInverted()) { trackLeft = hMax; } else { trackRight = hMax; } thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth); thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth); setThumbLocation(thumbLeft, thumbRect.y); // Update slider value. thumbMiddle = thumbLeft + halfThumbWidth; slider.setValue(valueForXPosition(thumbMiddle)); break; default: return; } } /** * Moves the location of the upper thumb, and sets its corresponding * value in the slider. */ private void moveUpperThumb() { int thumbMiddle = 0; switch (slider.getOrientation()) { case JSlider.VERTICAL: int halfThumbHeight = thumbRect.height / 2; int thumbTop = currentMouseY - offset; int trackTop = trackRect.y; int trackBottom = trackRect.y + (trackRect.height - 1); int vMin = yPositionForValue(slider.getValue()); // Apply bounds to thumb position. if (drawInverted()) { trackTop = vMin; } else { trackBottom = vMin; } thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight); thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight); setUpperThumbLocation(thumbRect.x, thumbTop); // Update slider extent. thumbMiddle = thumbTop + halfThumbHeight; slider.setExtent(valueForYPosition(thumbMiddle) - slider.getValue()); break; case JSlider.HORIZONTAL: int halfThumbWidth = thumbRect.width / 2; int thumbLeft = currentMouseX - offset; int trackLeft = trackRect.x; int trackRight = trackRect.x + (trackRect.width - 1); int hMin = xPositionForValue(slider.getValue()); // Apply bounds to thumb position. if (drawInverted()) { trackRight = hMin; } else { trackLeft = hMin; } thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth); thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth); setUpperThumbLocation(thumbLeft, thumbRect.y); // Update slider extent. thumbMiddle = thumbLeft + halfThumbWidth; slider.setExtent(valueForXPosition(thumbMiddle) - slider.getValue()); break; default: return; } } } }
cde3e09ebe4f40b856ff2bb72735add470f46982
567047f6e07d5dc6f85dbd78bb80f6d00aa93258
/src/com/weixin/api/util/diy/MediaUtil.java
37fe7c9b4b54b837fbd9a9d415886aa2f0b36f32
[]
no_license
woodens/weixinapi
677847f642bd0fffcc2663f71e294fcd77939cd3
f828fe1f463be0f5d82186c5223a1f5b21dc4348
refs/heads/master
2021-06-14T10:36:48.029468
2016-08-22T15:54:54
2016-08-22T15:54:54
40,978,783
0
0
null
null
null
null
UTF-8
Java
false
false
6,414
java
package com.weixin.api.util.diy; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import net.sf.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.weixin.api.pojo.WeixinMedia; /** * 媒体文件工具类 * */ public class MediaUtil { private static Logger log = LoggerFactory.getLogger(MediaUtil.class); /** * 上传媒体文件 * * @param accessToken 接口访问凭证 * @param type 媒体文件类型(image、voice、video和thumb) * @param mediaFileUrl 媒体文件的url */ public static WeixinMedia uploadMedia(String accessToken, String type, String mediaFileUrl) { WeixinMedia weixinMedia = null; // 拼装请求地址 String uploadMediaUrl = "http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE"; uploadMediaUrl = uploadMediaUrl.replace("ACCESS_TOKEN", accessToken).replace("TYPE", type); // 定义数据分隔符 String boundary = "------------7da2e536604c8"; try { URL uploadUrl = new URL(uploadMediaUrl); HttpURLConnection uploadConn = (HttpURLConnection) uploadUrl.openConnection(); uploadConn.setDoOutput(true); uploadConn.setDoInput(true); uploadConn.setRequestMethod("POST"); // 设置请求头Content-Type uploadConn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary); // 获取媒体文件上传的输出流(往微信服务器写数据) OutputStream outputStream = uploadConn.getOutputStream(); URL mediaUrl = new URL(mediaFileUrl); HttpURLConnection meidaConn = (HttpURLConnection) mediaUrl.openConnection(); meidaConn.setDoOutput(true); meidaConn.setRequestMethod("GET"); // 从请求头中获取内容类型 String contentType = meidaConn.getHeaderField("Content-Type"); // 根据内容类型判断文件扩展名 String fileExt = CommonUtil.getFileExt(contentType); // 请求体开始 outputStream.write(("--" + boundary + "\r\n").getBytes()); outputStream.write(String.format("Content-Disposition: form-data; name=\"media\"; filename=\"file1%s\"\r\n", fileExt).getBytes()); outputStream.write(String.format("Content-Type: %s\r\n\r\n", contentType).getBytes()); // 获取媒体文件的输入流(读取文件) BufferedInputStream bis = new BufferedInputStream(meidaConn.getInputStream()); byte[] buf = new byte[8096]; int size = 0; while ((size = bis.read(buf)) != -1) { // 将媒体文件写到输出流(往微信服务器写数据) outputStream.write(buf, 0, size); } // 请求体结束 outputStream.write(("\r\n--" + boundary + "--\r\n").getBytes()); outputStream.close(); bis.close(); meidaConn.disconnect(); // 获取媒体文件上传的输入流(从微信服务器读数据) InputStream inputStream = uploadConn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); StringBuffer buffer = new StringBuffer(); String str = null; while ((str = bufferedReader.readLine()) != null) { buffer.append(str); } bufferedReader.close(); inputStreamReader.close(); // 释放资源 inputStream.close(); inputStream = null; uploadConn.disconnect(); // 使用JSON-lib解析返回结果 JSONObject jsonObject = JSONObject.fromObject(buffer.toString()); weixinMedia = new WeixinMedia(); weixinMedia.setType(jsonObject.getString("type")); // type等于thumb时的返回结果和其它类型不一样 if ("thumb".equals(type)) weixinMedia.setMediaId(jsonObject.getString("thumb_media_id")); else weixinMedia.setMediaId(jsonObject.getString("media_id")); weixinMedia.setCreatedAt(jsonObject.getInt("created_at")); } catch (Exception e) { weixinMedia = null; log.error("上传媒体文件失败:{}", e); } return weixinMedia; } /** * 下载媒体文件 * * @param accessToken 接口访问凭证 * @param mediaId 媒体文件标识 * @param savePath 文件在服务器上的存储路径 * @return */ public static String getMedia(String accessToken, String mediaId, String savePath) { String filePath = null; // 拼接请求地址 String requestUrl = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID"; requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace("MEDIA_ID", mediaId); System.out.println(requestUrl); try { URL url = new URL(requestUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setRequestMethod("GET"); if (!savePath.endsWith("/")) { savePath += "/"; } // 根据内容类型获取扩展名 String fileExt = CommonUtil.getFileExt(conn.getHeaderField("Content-Type")); // 将mediaId作为文件名 filePath = savePath + mediaId + fileExt; BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); FileOutputStream fos = new FileOutputStream(new File(filePath)); byte[] buf = new byte[8096]; int size = 0; while ((size = bis.read(buf)) != -1) fos.write(buf, 0, size); fos.close(); bis.close(); conn.disconnect(); log.info("下载媒体文件成功,filePath=" + filePath); } catch (Exception e) { filePath = null; log.error("下载媒体文件失败:{}", e); } return filePath; } public static void main(String args[]) { // 获取接口访问凭证 String accessToken = CommonUtil.getAccessToken("APPID", "APPSECRET").getAccessToken(); /** * 上传多媒体文件 */ WeixinMedia weixinMedia = uploadMedia(accessToken, "voice", "http://localhost:8080/weixinmpapi/test.mp3"); System.out.println(weixinMedia.getMediaId()); System.out.println(weixinMedia.getType()); System.out.println(weixinMedia.getCreatedAt()); /** * 下载多媒体文件 */ getMedia(accessToken, "N7xWhOGYSLWUMPzVcGnxKFbhXeD_lLT5sXxyxDGEsCzWIB2CcUijSeQOYjWLMpcn", "G:/download"); } }
[ "tombs@DESKTOP-0C990LP" ]
tombs@DESKTOP-0C990LP
d7789f2f85ec5e1e810e696af2a5130d2066bffc
b34bc4f39a868f1b794f7683fe8525fc2ac0ebe6
/microservice-eureka-server/src/main/java/com/sunny/microservice/eureka/service/EurekaServiceApplication.java
2d156b39f51fe59b7734034bd00cdad06eca9551
[]
no_license
sunnyday94/microservice-practice
0c405b3dbc68366dabc88f46ef209b4385847844
bf37ba6cbd767bf95f09c41f059d611bc87f25af
refs/heads/master
2020-03-07T03:04:12.789964
2018-04-18T14:02:05
2018-04-18T14:02:05
127,225,020
3
2
null
null
null
null
UTF-8
Java
false
false
565
java
package com.sunny.microservice.eureka.service; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication @EnableEurekaServer public class EurekaServiceApplication { public static void main(String[] args) throws Exception { new SpringApplicationBuilder(EurekaServiceApplication.class).web(WebApplicationType.SERVLET).run(args); } }
493ee5eea6b6e829525c8d0b2e36277cc5117a2e
af9adc5dbdd06fe940aa7e0e9bb497f74d98fee5
/app/src/main/java/com/ashraf/weather/photos/datalayer/remote/remoteRepository/getWeatherRepository/GetWeatherResponseDto.java
830219a8bf119b66cd30ab9e4f391d3d58c62bc3
[]
no_license
ashraf-atef/Weather-Photos
b16910da06a85689ce130eccecdd90451baedce6
96659b1d2eaa890f742f58442e86e166bf44de72
refs/heads/master
2021-05-14T07:12:48.628214
2018-01-06T21:22:28
2018-01-06T21:22:28
116,257,056
0
0
null
null
null
null
UTF-8
Java
false
false
636
java
package com.ashraf.weather.photos.datalayer.remote.remoteRepository.getWeatherRepository; import com.google.gson.annotations.SerializedName; import java.util.List; public class GetWeatherResponseDto { @SerializedName("main") Temperature temperature; List<Weather> weather; public Temperature getTemperature() { return temperature; } public void setTemperature(Temperature temperature) { this.temperature = temperature; } public List<Weather> getWeather() { return weather; } public void setWeather(List<Weather> weather) { this.weather = weather; } }
536cb163f21087042d927bc3a928ad3748d7501f
8b520857f318e36fd9e6f849a1772d24bf3d8e70
/Spring-Boot-STS/spring-boot-spring-data-query-method2/src/main/java/com/manish/javadev/service/EmployeeServiceImpl.java
c0ab0ca1109d27307e6a82d7d132cf43cf7277d6
[]
no_license
manishjavadev/all_spring_boot_and_hibernate
51cf002d9e727708ee09f4adaeaf604013261e63
327b1b5b90264b650448df2bafb7785b5a46e318
refs/heads/master
2023-04-07T10:33:55.550169
2021-04-18T01:34:49
2021-04-18T01:34:49
359,013,654
0
0
null
null
null
null
UTF-8
Java
false
false
927
java
package com.manish.javadev.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort.Direction; import org.springframework.stereotype.Service; import com.manish.javadev.dao.EmployeeServiceDao; import com.manish.javadev.model.Employee; @Service("employeeService") public class EmployeeServiceImpl implements EmployeeService { @Autowired EmployeeServiceDao employeeServiceDao; @Override public List<Employee> saveMultipleEmployee(List<Employee> employeeList) { return (List<Employee>) employeeServiceDao.saveAll(employeeList); } @Override public Slice<Employee> findEmployeeByCity(String city, Pageable pageable) { return employeeServiceDao.findEmployeeByCity(city, pageable); } }