file_id
int64
1
215k
content
stringlengths
7
454k
repo
stringlengths
6
113
path
stringlengths
6
251
3,013
package pages.klantportaal; import com.microsoft.playwright.Locator; import com.microsoft.playwright.Page; public class MijnTakenPage { public final static String PAGE_URL = "/taken"; public final Locator takenCard; public final Locator geenTakenVoorDeHuidigeGebruiker; public final Locator takenOphalenFoutmelding; private final Page page; public MijnTakenPage(Page page) { this.page = page; takenCard = page.locator("//a[@class='denhaag-action denhaag-action--single']").first(); geenTakenVoorDeHuidigeGebruiker = page.locator("//p[text()='Er zijn geen openstaande taken.']"); takenOphalenFoutmelding = page.locator("//p[contains(., 'Er is een fout opgetreden')]"); } }
CommonGround-Testing/zgw-playwright-base
src/main/java/pages/klantportaal/MijnTakenPage.java
3,014
package myconext.security; import lombok.SneakyThrows; import myconext.crypto.KeyGenerator; import myconext.geo.GeoLocation; import myconext.mail.MailBox; import myconext.manage.ServiceProviderResolver; import myconext.repository.AuthenticationRequestRepository; import myconext.repository.UserLoginRepository; import myconext.repository.UserRepository; import myconext.shibboleth.ShibbolethPreAuthenticatedProcessingFilter; import myconext.shibboleth.ShibbolethUserDetailService; import myconext.shibboleth.mock.MockShibbolethFilter; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; import org.springframework.core.env.Profiles; import org.springframework.core.io.Resource; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter; import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider; import saml.model.SAMLConfiguration; import saml.model.SAMLIdentityProvider; import saml.model.SAMLServiceProvider; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import static java.util.stream.Collectors.toList; @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class SecurityConfiguration { private static final Log LOG = LogFactory.getLog(SecurityConfiguration.class); @Configuration @Order(1) @EnableConfigurationProperties(IdentityProviderMetaData.class) public static class SamlSecurity extends WebSecurityConfigurerAdapter { private final GuestIdpAuthenticationRequestFilter guestIdpAuthenticationRequestFilter; public SamlSecurity(@Value("${private_key_path}") Resource privateKeyPath, @Value("${certificate_path}") Resource certificatePath, @Value("${idp_entity_id}") String idpEntityId, @Value("${sp_entity_id}") String spEntityId, @Value("${sp_entity_metadata_url}") String spMetaDataUrl, @Value("${saml_metadata_base_path}") String samlMetadataBasePath, @Value("${idp_redirect_url}") String redirectUrl, @Value("${remember_me_max_age_seconds}") int rememberMeMaxAge, @Value("${nudge_eduid_app_days}") int nudgeAppDays, @Value("${remember_me_question_asked_days}") int rememberMeQuestionAskedDays, @Value("${secure_cookie}") boolean secureCookie, @Value("${email.magic-link-url}") String magicLinkUrl, @Value("${account_linking_context_class_ref.linked_institution}") String linkedInstitution, @Value("${account_linking_context_class_ref.validate_names}") String validateNames, @Value("${account_linking_context_class_ref.affiliation_student}") String affiliationStudent, @Value("${account_linking_context_class_ref.profile_mfa}") String profileMfa, @Value("${linked_accounts.expiry-duration-days-non-validated}") long expiryNonValidatedDurationDays, @Value("${sso_mfa_duration_seconds}") long ssoMFADurationSeconds, @Value("${mobile_app_rp_entity_id}") String mobileAppROEntityId, @Value("${feature.default_remember_me}") boolean featureDefaultRememberMe, @Value("${feature.requires_signed_authn_request}") boolean requiresSignedAuthnRequest, AuthenticationRequestRepository authenticationRequestRepository, UserRepository userRepository, UserLoginRepository userLoginRepository, GeoLocation geoLocation, MailBox mailBox, ServiceProviderResolver serviceProviderResolver, IdentityProviderMetaData identityProviderMetaData, CookieValueEncoder cookieValueEncoder) { String[] keys = this.getKeys(certificatePath, privateKeyPath); final List<SAMLServiceProvider> serviceProviders = new ArrayList<>(); List<String> spEntityIdentifiers = commaSeparatedToList(spEntityId); List<String> spMetaDataUrls = commaSeparatedToList(spMetaDataUrl); for (int i = 0; i < spEntityIdentifiers.size(); i++) { serviceProviders.add(new SAMLServiceProvider(spEntityIdentifiers.get(i), spMetaDataUrls.get(i))); } SAMLConfiguration configuration = new SAMLConfiguration( new SAMLIdentityProvider(keys[0], keys[1], idpEntityId), serviceProviders, requiresSignedAuthnRequest ); this.guestIdpAuthenticationRequestFilter = new GuestIdpAuthenticationRequestFilter( redirectUrl, serviceProviderResolver, authenticationRequestRepository, userRepository, userLoginRepository, geoLocation, rememberMeMaxAge, nudgeAppDays, rememberMeQuestionAskedDays, secureCookie, magicLinkUrl, mailBox, expiryNonValidatedDurationDays, ssoMFADurationSeconds, mobileAppROEntityId, featureDefaultRememberMe, configuration, identityProviderMetaData, cookieValueEncoder ); } private List<String> commaSeparatedToList(String spEntityId) { return Arrays.stream(spEntityId.split(",")).map(String::trim).collect(toList()); } @Override protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .antMatchers("/saml/guest-idp/**") .and() .csrf() .disable() .addFilterBefore(this.guestIdpAuthenticationRequestFilter, AbstractPreAuthenticatedProcessingFilter.class ) .authorizeRequests() .antMatchers("/**").hasRole("GUEST"); } @SneakyThrows private String[] getKeys(Resource certificatePath, Resource privateKeyPath) { String privateKey; String certificate; if (privateKeyPath.exists() && certificatePath.exists()) { privateKey = read(privateKeyPath); certificate = read(certificatePath); } else { String[] keys = KeyGenerator.generateKeys(); privateKey = keys[0]; certificate = keys[1]; } return new String[]{certificate, privateKey}; } private String read(Resource resource) throws IOException { LOG.info("Reading resource: " + resource.getFilename()); return IOUtils.toString(resource.getInputStream(), Charset.defaultCharset()); } } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { //because Autowired this will end up in the global ProviderManager PreAuthenticatedAuthenticationProvider authenticationProvider = new PreAuthenticatedAuthenticationProvider(); authenticationProvider.setPreAuthenticatedUserDetailsService(new ShibbolethUserDetailService()); auth.authenticationProvider(authenticationProvider); } @Order @Configuration public static class InternalSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter { private final Environment environment; private final UserRepository userRepository; private final ServiceProviderResolver serviceProviderResolver; private final String mijnEduIDEntityId; public InternalSecurityConfigurationAdapter(Environment environment, UserRepository userRepository, ServiceProviderResolver serviceProviderResolver, @Value("${mijn_eduid_entity_id}") String mijnEduIDEntityId) { this.environment = environment; this.userRepository = userRepository; this.serviceProviderResolver = serviceProviderResolver; this.mijnEduIDEntityId = mijnEduIDEntityId; } @Override public void configure(WebSecurity web) { web.ignoring().antMatchers( "/internal/**", "/myconext/api/idp/**", "/myconext/api/sp/create-from-institution", "/myconext/api/sp/create-from-institution/**" ); } @Override protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .antMatchers("/myconext/api/sp/**", "/startSSO", "/tiqr/sp/**") .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED) .and() .csrf() .disable() .addFilterBefore( new ShibbolethPreAuthenticatedProcessingFilter( authenticationManagerBean(), userRepository, serviceProviderResolver, mijnEduIDEntityId), AbstractPreAuthenticatedProcessingFilter.class ) .authorizeRequests() .antMatchers("/**").hasRole("GUEST"); if (environment.acceptsProfiles(Profiles.of("test", "test2", "dev"))) { //we can't use @Profile, because we need to add it before the real filter http.addFilterBefore(new MockShibbolethFilter(), ShibbolethPreAuthenticatedProcessingFilter.class); } } } @Configuration @Order(2) public static class AppSecurity extends WebSecurityConfigurerAdapter { @Value("${attribute_aggregation.user}") private String attributeAggregationUser; @Value("${attribute_aggregation.password}") private String attributeAggregationPassword; @Value("${attribute_manipulation.user}") private String attributeManipulationUser; @Value("${attribute_manipulation.password}") private String attributeManipulationPassword; @Override protected void configure(HttpSecurity http) throws Exception { String[] antPatterns = { "/myconext/api/attribute-aggregation/**", "/myconext/api/attribute-manipulation/**", "/myconext/api/system/**" }; http.requestMatchers() .antMatchers(antPatterns) .and() .csrf() .disable() .authorizeRequests() .antMatchers(antPatterns) .authenticated() .and() .httpBasic() .and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth .inMemoryAuthentication() .withUser(attributeAggregationUser) .password("{noop}" + attributeAggregationPassword) .roles("attribute-aggregation", "system") .and() .withUser(attributeManipulationUser) .password("{noop}" + attributeManipulationPassword) .roles("attribute-manipulation"); } } @Configuration @Order(3) public static class JWTSecurityConfig extends WebSecurityConfigurerAdapter { @Value("${eduid_api.oidcng_introspection_uri}") private String introspectionUri; @Value("${eduid_api.oidcng_client_id}") private String clientId; @Value("${eduid_api.oidcng_secret}") private String secret; @Override public void configure(WebSecurity web) { web.ignoring().antMatchers( "/mobile/api/idp/create", "/mobile/api/mobile/oidc/redirect", "/mobile/api/create-from-mobile-api" ); } @Override protected void configure(HttpSecurity http) throws Exception { String[] antPatterns = {"/myconext/api/eduid/**", "/mobile/**"}; http .requestMatchers() .antMatchers(antPatterns) .and() .authorizeRequests(authz -> authz .antMatchers("/myconext/api/eduid/eppn").hasAuthority("SCOPE_eduid.nl/eppn") .antMatchers("/myconext/api/eduid/eduid").hasAuthority("SCOPE_eduid.nl/eduid") .antMatchers("/myconext/api/eduid/links").hasAuthority("SCOPE_eduid.nl/links") .antMatchers("/mobile/**").hasAuthority("SCOPE_eduid.nl/mobile") .anyRequest().authenticated()) .oauth2ResourceServer(oauth2 -> oauth2.opaqueToken(token -> token .introspectionUri(introspectionUri) .introspectionClientCredentials(clientId, secret))); } } }
OpenConext/OpenConext-myconext
myconext-server/src/main/java/myconext/security/SecurityConfiguration.java
3,015
public class Alleen { public static String mijnZin; public static void zegDeZinTrut() { System.out.println(mijnZin); } }
cwout/Faceless
First Intro OO/OOP Example/Alleen.java
3,016
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hellotvxlet; import java.util.TimerTask; /** * * @author student Jolita Grazyte */ public class MijnTimer extends TimerTask{ HelloTVXlet xlet; public MijnTimer(HelloTVXlet xlet) { this.xlet = xlet; } public void run() { //System.out.println("Tick"); xlet.callback(); } }
MTA-Digital-Broadcast-2/T-Grazyte-Jolita-Van-Roy-Thomas-1-Project-MHP
project/GAME/src/hellotvxlet/MijnTimer.java
3,017
package controller; import java.util.ArrayList; import javax.json.Json; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; import model.Klas; import model.Opleiding; import model.Student; import server.Conversation; import server.Handler; public class StudentController { private Opleiding informatieSysteem; /** * De StudentController klasse moet alle student-gerelateerde aanvragen * afhandelen. Methode handle() kijkt welke URI is opgevraagd en laat * dan de juiste methode het werk doen. Je kunt voor elke nieuwe URI * een nieuwe methode schrijven. * * @param infoSys - het toegangspunt tot het domeinmodel */ public StudentController(Opleiding infoSys) { informatieSysteem = infoSys; } /** * Deze methode haalt eerst de opgestuurde JSON-data op. Daarna worden * de benodigde gegevens uit het domeinmodel gehaald. Deze gegevens worden * dan weer omgezet naar JSON en teruggestuurd naar de Polymer-GUI! * * @param conversation - alle informatie over het request * @return */ public JsonArrayBuilder mijnMedestudenten(Student student) { //String klasCode = student.getMijnKlas().getKlasCode(); // klascode van de student opzoeken Klas klas = informatieSysteem.getKlasBijStudent(student); ArrayList<Student> studentenVanKlas = informatieSysteem.getStudentenVanKlas(klas.getKlasCode()); // medestudenten opzoeken JsonArrayBuilder jab = Json.createArrayBuilder(); // Uiteindelijk gaat er een array... for (Student s : studentenVanKlas) { // met daarin voor elke medestudent een JSON-object... if (s.getGebruikersNaam().equals(student.getGebruikersNaam())) // behalve de student zelf... continue; else { jab.add(Json.createObjectBuilder() .add("naam", s.getGebruikersNaam())); } } return jab; } }
FullCount/PrIS
src/controller/StudentController.java
3,018
package ambiorix.gui; import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; import java.util.Iterator; import java.util.Vector; import javax.swing.JComponent; import ambiorix.spelbord.PionBasis; import ambiorix.spelbord.TegelBasis; import ambiorix.util.Punt; /** * De klasse die een tegel weergeeft. * Men kan er pionnen op toevoegen. * @author Jens * */ public class Tegel_Gui extends JComponent implements MouseListener, MouseMotionListener, TegelVeldComponent { private static final long serialVersionUID = 1898186744968544521L; @Override public void update(Graphics g) { paint(g); } private BufferedImage mijnAfbeelding = null; private Vector<TegelLuisteraar> tegelKlikLuisteraars; private Vector<Punt> gebiedenTeTekenen; private Vector<Pion_Gui> mijnPionnen; private Vector<Punt> mijnPionPunten; private TegelBasis tegel; private Punt p; public Tegel_Gui(TegelBasis t) { String fileNaam = t.getType().getAfbeelding(); mijnAfbeelding = AfbeeldingLader.geefAfbeelding(fileNaam); this.addMouseListener(this); this.addMouseMotionListener(this); tegelKlikLuisteraars = new Vector<TegelLuisteraar>(); gebiedenTeTekenen = new Vector<Punt>(); mijnPionnen = new Vector<Pion_Gui>(); mijnPionPunten = new Vector<Punt>(); tegel = t; p = new Punt(0, 0); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Rectangle rec = this.getBounds(); Graphics2D g2 = (Graphics2D) g; int rot = tegel.getRotatie(); g2.rotate(Math.toRadians(rot), 50, 50); g2.drawImage(mijnAfbeelding, 0, 0, rec.width, rec.height, null); g2.rotate(-Math.toRadians(rot), 50, 50); AlphaComposite ap = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .3f); g2.setComposite(ap); g2.setColor(Color.red); float tb = tegel.getTerreinBreedte(); float th = tegel.getTerreinHoogte(); for (Punt p : gebiedenTeTekenen) { // g2.drawRect((rec.width + 1)/tb * p.getX(), (rec.height + 1)/tb * // p.getY(), 98/tb, 98/tb); g2.fillRect(Math.round((rec.width) / tb * p.getY()), Math .round((rec.height) / th * p.getX()), (int) Math .ceil(100.0f / tb), (int) Math.ceil(100.0f / th)); } AlphaComposite ap2 = AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 1.0f); g2.setComposite(ap2); int aantalPionnen = this.mijnPionnen.size(); for (int i = 0; i < aantalPionnen; i++) { BufferedImage mijnPionImg = null; mijnPionImg = mijnPionnen.get(i).geefAfbeelding(); Punt p = mijnPionPunten.get(i); g2.drawImage(mijnPionImg, Math.round((rec.width) / tb * p.getY()), Math.round((rec.height) / th * p.getX()), (int) Math .ceil(100.0f / tb), (int) Math.ceil(100.0f / th), null); } } public void zetPos(int x, int y) { p.setX(x); p.setY(y); this.setBounds(x * 100, y * 100, 100, 100); } @Override public void mouseClicked(MouseEvent e) { Iterator<TegelLuisteraar> it = tegelKlikLuisteraars.iterator(); TegelGebeurtenis tg = new TegelGebeurtenis(); tg.tegel = this.tegel; tg.tegelX = p.getX(); tg.tegelY = p.getY(); tg.tegelPixelX = e.getX(); tg.tegelPixelY = e.getY(); tg.me = e; Punt p = new Punt((int) ((tg.tegelPixelY / 100f) * tg.tegel .getTerreinHoogte()), (int) ((tg.tegelPixelX / 100f) * tg.tegel .getTerreinBreedte())); tg.terrein = tg.tegel.getTerrein(p); while (it.hasNext()) { (it.next()).geklikt(tg); } } public int getXPos() { return p.getX(); } public void setXPos(int x) { p.setX(x); } public int getYPos() { return p.getY(); } public void setYPos(int y) { p.setY(y); } public Punt getPos() { return p; } public TegelBasis getTegel() { return tegel; } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } public void addTegelKlikLuisteraar(TegelLuisteraar tkl) { tegelKlikLuisteraars.add(tkl); } public void addGebiedTeTekenen(Punt positie) { this.gebiedenTeTekenen.add(positie); } public void wisGebiedenTeTekenen() { gebiedenTeTekenen.clear(); } public void voegPionToe(Pion_Gui pion, Punt pos) { mijnPionnen.add(pion); mijnPionPunten.add(pos); this.repaint(); this.revalidate(); } @Override public Punt geefPositie() { return p; } @Override public void mouseDragged(MouseEvent arg0) { } @Override public void mouseMoved(MouseEvent e) { Iterator<TegelLuisteraar> it = tegelKlikLuisteraars.iterator(); TegelGebeurtenis tg = new TegelGebeurtenis(); tg.tegel = this.tegel; tg.tegelX = p.getX(); tg.tegelY = p.getY(); tg.tegelPixelX = e.getX(); tg.tegelPixelY = e.getY(); tg.me = e; while (it.hasNext()) { (it.next()).bewogen(tg); } } public void verwijderPion(PionBasis pion) { int index = -1; int i = 0; for (Pion_Gui pg : this.mijnPionnen) { if (pg.getPion() == pion) index = i; i++; } if (index != -1) { mijnPionnen.remove(index); mijnPionPunten.remove(index); repaint(); } } }
oliviersels/ambiorix
ambiorix/src/ambiorix/gui/Tegel_Gui.java
3,019
package com.thunderunited.meterstand; import java.util.ArrayList; import java.util.HashMap; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.Menu; import android.widget.ListView; import android.widget.SimpleAdapter; public class Mijnoverzicht extends Activity { private static final String DATA_PATH = Environment .getExternalStorageDirectory() + "/" + ScanActivity.class.getPackage().getName() + "/"; private String DB_NAME = DATA_PATH + "/foto.db"; private String TABLE_NAME = "handmatig"; private ListView listView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mijnoverzicht); listView = (ListView) findViewById(R.id.listView1); ArrayList<HashMap<String, String>> searchResults = openDatabase(); SimpleAdapter arrayAdapter = new SimpleAdapter(this, searchResults, R.layout.custom_row_view, new String[] { "soortMeter", "soortStand", "stand", "datum" }, new int[] { R.id.soortMeter, R.id.soortStand, R.id.stand, R.id.datum }); listView.setAdapter(arrayAdapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.mijnoverzicht, menu); return true; } ArrayList<HashMap<String, String>> openDatabase() { SQLiteDatabase myDb = openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null); Cursor c = myDb.rawQuery( "SELECT _id, soortMeter, stand, soortStand, datum FROM " + TABLE_NAME + " ORDER BY datum DESC", null); ArrayList<HashMap<String, String>> mArrayList = new ArrayList<HashMap<String, String>>(); c.moveToFirst(); while (!c.isAfterLast()) { HashMap<String, String> map = new HashMap<String, String>(); map.put("soortMeter", "Soort meter: " + c.getString(c.getColumnIndex("soortMeter"))); map.put("soortStand", "Soort stand: " + c.getString(c.getColumnIndex("soortStand"))); map.put("stand", "Stand: " + c.getString(c.getColumnIndex("stand"))); map.put("datum", "Datum: " + c.getString(c.getColumnIndex("datum"))); mArrayList.add(map); c.moveToNext(); } for (int i = 0; i < mArrayList.size(); i++) { Log.e("array: ", mArrayList.get(i).toString()); } myDb.close(); return mArrayList; } }
Thunder-United/ocr-test
src/com/thunderunited/meterstand/Mijnoverzicht.java
3,020
/* * SPDX-FileCopyrightText: 2021 Atos * SPDX-License-Identifier: EUPL-1.2+ */ package net.atos.client.zgw.ztc.model; import java.net.URI; import java.time.Period; import javax.json.bind.annotation.JsonbCreator; import javax.json.bind.annotation.JsonbProperty; import net.atos.client.zgw.shared.model.Archiefnominatie; /** * */ public class Resultaattype { public static final int OMSCHRIJVING_MAX_LENGTH = 20; public static final int RESULTAATTYPEOMSCHRIJVING_MAX_LENGTH = 1000; /** * URL-referentie naar dit object. * Dit is de unieke identificatie en locatie van dit object. */ private URI url; /** * URL-referentie naar het ZAAKTYPE van ZAAKen waarin resultaten van dit RESULTAATTYPE bereikt kunnen worden. */ private URI zaaktype; /** * Omschrijving van de aard van resultaten van het RESULTAATTYPE. * maxLength: {@link Resultaattype#OMSCHRIJVING_MAX_LENGTH} */ private String omschrijving; /** * Algemeen gehanteerde omschrijving van de aard van resultaten van het RESULTAATTYPE. * Dit moet een URL-referentie zijn naar de referenlijst van generieke resultaattypeomschrijvingen. * Im ImZTC heet dit 'omschrijving generiek' * maxLength: {@link Resultaattype#RESULTAATTYPEOMSCHRIJVING_MAX_LENGTH} */ private String resultaattypeomschrijving; /** * Waarde van de omschrijving-generiek referentie (attribuut `omschrijving`) */ private String omschrijvingGeneriek; /** * URL-referentie naar de, voor het archiefregime bij het RESULTAATTYPE relevante, * categorie in de Selectielijst Archiefbescheiden (RESULTAAT in de Selectielijst API) van de voor het ZAAKTYPE verantwoordelijke overheidsorganisatie. */ private URI selectielijstklasse; /** * Een toelichting op dit RESULTAATTYPE en het belang hiervan voor ZAAKen waarin een resultaat van dit RESULTAATTYPE wordt geselecteerd. */ private String toelichting; /** * anduiding die aangeeft of ZAAKen met een resultaat van dit RESULTAATTYPE blijvend moeten worden bewaard of (op termijn) moeten worden vernietigd. * Indien niet expliciet opgegeven wordt dit gevuld vanuit de selectielijst. */ private Archiefnominatie archiefnominatie; /** * De termijn, na het vervallen van het bedrjfsvoeringsbelang, waarna het zaakdossier (de ZAAK met alle bijbehorende INFORMATIEOBJECTen) van een ZAAK * met een resultaat van dit RESULTAATTYPE vernietigd of overgebracht (naar een archiefbewaarplaats) moet worden. * Voor te vernietigen dossiers betreft het de in die Selectielijst genoemde bewaartermjn. * Voor blijvend te bewaren zaakdossiers betreft het de termijn vanaf afronding van de zaak tot overbrenging (de procestermijn is dan nihil). */ private Period archiefactietermijn; private BrondatumArchiefprocedure brondatumArchiefprocedure; /** * Constructor for PATCH request */ public Resultaattype() { } /** * Constructor with required attributes for POST and PUT request */ public Resultaattype(final URI zaaktype, final String omschrijving, final String resultaattypeomschrijving, final URI selectielijstklasse) { this.zaaktype = zaaktype; this.omschrijving = omschrijving; this.resultaattypeomschrijving = resultaattypeomschrijving; this.selectielijstklasse = selectielijstklasse; } /** * Constructor with readOnly attributes for GET response */ @JsonbCreator public Resultaattype(@JsonbProperty("url") final URI url, @JsonbProperty("omschrijvingGeneriek") final String omschrijvingGeneriek) { this.url = url; this.omschrijvingGeneriek = omschrijvingGeneriek; } public URI getUrl() { return url; } public URI getZaaktype() { return zaaktype; } public void setZaaktype(final URI zaaktype) { this.zaaktype = zaaktype; } public String getOmschrijving() { return omschrijving; } public void setOmschrijving(final String omschrijving) { this.omschrijving = omschrijving; } public String getResultaattypeomschrijving() { return resultaattypeomschrijving; } public void setResultaattypeomschrijving(final String resultaattypeomschrijving) { this.resultaattypeomschrijving = resultaattypeomschrijving; } public String getOmschrijvingGeneriek() { return omschrijvingGeneriek; } public URI getSelectielijstklasse() { return selectielijstklasse; } public void setSelectielijstklasse(final URI selectielijstklasse) { this.selectielijstklasse = selectielijstklasse; } public String getToelichting() { return toelichting; } public void setToelichting(final String toelichting) { this.toelichting = toelichting; } public Archiefnominatie getArchiefnominatie() { return archiefnominatie; } public void setArchiefnominatie(final Archiefnominatie archiefnominatie) { this.archiefnominatie = archiefnominatie; } public Period getArchiefactietermijn() { return archiefactietermijn; } public void setArchiefactietermijn(final Period archiefactietermijn) { this.archiefactietermijn = archiefactietermijn; } public BrondatumArchiefprocedure getBrondatumArchiefprocedure() { return brondatumArchiefprocedure; } public void setBrondatumArchiefprocedure(final BrondatumArchiefprocedure brondatumArchiefprocedure) { this.brondatumArchiefprocedure = brondatumArchiefprocedure; } }
NL-AMS-LOCGOV/zaakafhandelcomponent
src/main/java/net/atos/client/zgw/ztc/model/Resultaattype.java
3,021
package nl.hu.husacct.game31.userinterface; import java.awt.Component; import java.util.*; import javax.swing.border.LineBorder; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTable; import nl.hu.husacct.game31.domein.ComputerSpeler; import nl.hu.husacct.game31.domein.Deelname; import nl.hu.husacct.game31.domein.Kaart; import nl.hu.husacct.game31.domein.Spel; import nl.hu.husacct.game31.domein.SpelRonde; import nl.hu.husacct.game31.domein.Tafel; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.FlowLayout; /** * This code was generated using CloudGarden's Jigloo * SWT/Swing GUI Builder, which is free for non-commercial * use. If Jigloo is being used commercially (ie, by a * for-profit company or business) then you should purchase * a license - please visit www.cloudgarden.com for details. */ public class TheMainPanel extends javax.swing.JPanel { private JPanel scrollPanels; private JButton allesWisselenButton; private JButton wisselenButton; private JButton overslaanButton; private JButton passenButton; private JPanel knoppenPanel; private JPanel deTafelPanel; private JPanel mijnHandPanel; private JTable spelersTable; private JPopupMenu wisselenMenu; private JTable eventsTable; private JScrollPane playerPanel, eventsPanel; private Spel hetSpel; private Tafel deTafel; private boolean eersteRonde = true; private JButton tafelKaart1Button; private JButton tafelKaart2Button; private JButton tafelKaart3Button; private JButton handKaart1Button; private JButton handKaart2Button; private JButton handKaart3Button; private boolean tk1Selected; private boolean tk2Selected; private boolean tk3Selected; private boolean hk1Selected; private boolean hk2Selected; private boolean hk3Selected; public TheMainPanel() { initGUI(); this.setVisible(true); } /** * Initializes the GUI. * Auto-generated code - any changes you make will disappear. */ public void initGUI(){ try { preInitGUI(); mijnHandPanel = new JPanel(); deTafelPanel = new JPanel(); knoppenPanel = new JPanel(); passenButton = new JButton(); overslaanButton = new JButton(); wisselenButton = new JButton(); allesWisselenButton = new JButton(); scrollPanels = new JPanel(); this.setLayout(null); this.setPreferredSize(new java.awt.Dimension(700,525)); this.setOpaque(false); FlowLayout mijnHandPanelLayout = new FlowLayout(); mijnHandPanel.setLayout(mijnHandPanelLayout); mijnHandPanelLayout.setAlignment(FlowLayout.CENTER); mijnHandPanelLayout.setHgap(5); mijnHandPanelLayout.setVgap(5); mijnHandPanel.setPreferredSize(new java.awt.Dimension(421,195)); mijnHandPanel.setOpaque(false); mijnHandPanel.setBounds(new java.awt.Rectangle(233,20,421,195)); this.add(mijnHandPanel); FlowLayout deTafelPanelLayout = new FlowLayout(); deTafelPanel.setLayout(deTafelPanelLayout); deTafelPanelLayout.setAlignment(FlowLayout.CENTER); deTafelPanelLayout.setHgap(5); deTafelPanelLayout.setVgap(5); deTafelPanel.setPreferredSize(new java.awt.Dimension(421,195)); deTafelPanel.setOpaque(false); deTafelPanel.setBounds(new java.awt.Rectangle(239,296,421,195)); this.add(deTafelPanel); knoppenPanel.setVisible(true); knoppenPanel.setPreferredSize(new java.awt.Dimension(500,50)); knoppenPanel.setOpaque(false); knoppenPanel.setBounds(new java.awt.Rectangle(200,229,500,50)); this.add(knoppenPanel); passenButton.setEnabled(false); passenButton.setText("Passen"); passenButton.setPreferredSize(new java.awt.Dimension(79,26)); passenButton.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); passenButton.setOpaque(false); knoppenPanel.add(passenButton); passenButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { passenButtonActionPerformed(evt); } }); overslaanButton.setEnabled(false); overslaanButton.setText("Overslaan"); overslaanButton.setPreferredSize(new java.awt.Dimension(81,26)); overslaanButton.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); overslaanButton.setOpaque(false); knoppenPanel.add(overslaanButton); overslaanButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { overslaanButtonActionPerformed(evt); } }); wisselenButton.setEnabled(false); wisselenButton.setText("Wisselen"); wisselenButton.setPreferredSize(new java.awt.Dimension(88,26)); wisselenButton.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); wisselenButton.setOpaque(false); knoppenPanel.add(wisselenButton); wisselenButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { wisselenButtonActionPerformed(evt); } }); allesWisselenButton.setEnabled(false); allesWisselenButton.setText("Alles Wisselen"); allesWisselenButton.setPreferredSize(new java.awt.Dimension(94,26)); allesWisselenButton.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); allesWisselenButton.setOpaque(false); knoppenPanel.add(allesWisselenButton); allesWisselenButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { allesWisselenButtonActionPerformed(evt); } }); scrollPanels.setLayout(null); scrollPanels.setVisible(true); scrollPanels.setPreferredSize(new java.awt.Dimension(200,528)); scrollPanels.setOpaque(false); scrollPanels.setBounds(new java.awt.Rectangle(-1,0,200,528)); this.add(scrollPanels); postInitGUI(); } catch (Exception e) { e.printStackTrace(); } } /** Add your pre-init code in here */ public void preInitGUI(){ } /** Add your post-init code in here */ public void postInitGUI(){ buildSpelersTable(); } private void buildSpelersTable() { scrollPanels.removeAll(); //Build tableHeader Vector spelersTableHeader = new Vector(); spelersTableHeader.addElement("Naam"); spelersTableHeader.addElement("Fices"); //Build tablecontents Vector spelersTableData = new Vector(); if (hetSpel != null) { SpelRonde huidigeRonde = hetSpel.getHuidigeSpelRonde(); Vector deelnemers = huidigeRonde.geefDeelnames(); for(Enumeration e = deelnemers.elements(); e.hasMoreElements();) { Deelname d1 = (Deelname) e.nextElement(); Vector tabelRij = new Vector(); tabelRij.addElement(d1.getSpeler().geefNaam()); tabelRij.addElement("" + d1.getSpeler().geefFiches()); System.out.println(d1.getSpeler().geefFiches()); spelersTableData.addElement(tabelRij); } } spelersTable = new JTable(spelersTableData, spelersTableHeader){ public Component prepareRenderer (TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer( renderer, row, column); // We want renderer component to be // transparent so background image is visible if( c instanceof JComponent ) ((JComponent)c).setOpaque(false); return c; } }; spelersTable.setOpaque(false); TableColumn kolom1 = spelersTable.getColumnModel().getColumn(1); kolom1.setPreferredWidth(20); playerPanel = null; playerPanel = new JScrollPane(spelersTable); playerPanel.getViewport().setOpaque(false); playerPanel.setBounds(new java.awt.Rectangle(0,0,200,529)); scrollPanels.add(playerPanel); playerPanel.setOpaque(false); } public void startSpel(Spel hetSpel) { allesWisselenButton.setEnabled(true); wisselenButton.setEnabled(true); overslaanButton.setEnabled(true); passenButton.setEnabled(true); this.hetSpel = hetSpel; this.deTafel = hetSpel.getTafel(); eersteBeurt(); } public void eersteBeurt() { eersteRonde = true; deTafelPanel.removeAll(); deTafelPanel.setVisible(false); mijnHandPanel.removeAll(); mijnHandPanel.setVisible(false); buildSpelersTable(); bouwDeTafel(); deTafelPanel.add(tafelKaart1Button); deTafelPanel.add(tafelKaart2Button); deTafelPanel.add(tafelKaart3Button); bouwHand(); mijnHandPanel.add(handKaart1Button); mijnHandPanel.add(handKaart2Button); mijnHandPanel.add(handKaart3Button); deTafelPanel.repaint(); mijnHandPanel.repaint(); deTafelPanel.setVisible(true); mijnHandPanel.setVisible(true); eersteRonde = false; if(!(hetSpel.getHuidigeSpelRonde().getActiveDeelname().getSpeler() instanceof ComputerSpeler)) { int sure = JOptionPane.showConfirmDialog(this, "Wilt u alle kaarten wisselen met die van de tafel?", "?", JOptionPane.OK_CANCEL_OPTION); if(sure == 0) { hetSpel.ruil3Kaart(); } else { allesWisselenButton.setEnabled(false); deTafelPanel.removeAll(); deTafelPanel.setVisible(false); bouwDeTafel(); deTafelPanel.add(tafelKaart1Button); deTafelPanel.add(tafelKaart2Button); deTafelPanel.add(tafelKaart3Button); deTafelPanel.repaint(); deTafelPanel.setVisible(true); } } } public void updateScherm() { allesWisselenButton.setEnabled(true); SpelRonde huidigeRonde = hetSpel.getHuidigeSpelRonde(); deTafelPanel.removeAll(); deTafelPanel.setVisible(false); mijnHandPanel.removeAll(); mijnHandPanel.setVisible(false); buildSpelersTable(); bouwDeTafel(); deTafelPanel.add(tafelKaart1Button); deTafelPanel.add(tafelKaart2Button); deTafelPanel.add(tafelKaart3Button); bouwHand(); mijnHandPanel.add(handKaart1Button); mijnHandPanel.add(handKaart2Button); mijnHandPanel.add(handKaart3Button); deTafelPanel.repaint(); mijnHandPanel.repaint(); deTafelPanel.setVisible(true); mijnHandPanel.setVisible(true); if(!(hetSpel.getHuidigeSpelRonde().getActiveDeelname().getSpeler() instanceof ComputerSpeler)) { JOptionPane.showMessageDialog(this, "Het is de beurt van " + hetSpel.getHuidigeSpelRonde().getActiveDeelname().getSpeler().geefNaam() + ".", "Volgende speler", JOptionPane.WARNING_MESSAGE ); } } public void bouwDeTafel() { if(!eersteRonde) { Vector deKaarten = deTafel.getKaarten(); Kaart kaart1 = (Kaart) deKaarten.get(0); Kaart kaart2 = (Kaart) deKaarten.get(1); Kaart kaart3 = (Kaart) deKaarten.get(2); tafelKaart1Button = new JButton(); tafelKaart2Button = new JButton(); tafelKaart3Button = new JButton(); tafelKaart1Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK1ActionPerformed(evt); } }); tafelKaart2Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK2ActionPerformed(evt); } }); tafelKaart3Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK3ActionPerformed(evt); } }); tafelKaart1Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart1.geefGifAdr())))); tafelKaart2Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart2.geefGifAdr())))); tafelKaart3Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart3.geefGifAdr())))); tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); } else { tafelKaart1Button = new JButton(); tafelKaart2Button = new JButton(); tafelKaart3Button = new JButton(); tafelKaart1Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK1ActionPerformed(evt); } }); tafelKaart2Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK2ActionPerformed(evt); } }); tafelKaart3Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { tK3ActionPerformed(evt); } }); tafelKaart1Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("main/resources/kaarten/blank.jpg")))); tafelKaart2Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("main/resources/kaarten/blank.jpg")))); tafelKaart3Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("main/resources/kaarten/blank.jpg")))); tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); } } public void bouwHand() { handKaart1Button = new JButton(); handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart1Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { hK1ActionPerformed(evt); } }); handKaart2Button = new JButton(); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { hK2ActionPerformed(evt); } }); handKaart3Button = new JButton(); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { hK3ActionPerformed(evt); } }); //Haal de huidige deelnemer zijn kaarten op. SpelRonde huidigeRonde = hetSpel.getHuidigeSpelRonde(); Deelname huidigeDeelname = huidigeRonde.getActiveDeelname(); Vector deKaarten = huidigeDeelname.getKaarten(); Kaart kaart1 = (Kaart) deKaarten.get(0); Kaart kaart2 = (Kaart) deKaarten.get(1); Kaart kaart3 = (Kaart) deKaarten.get(2); handKaart1Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart1.geefGifAdr())))); handKaart2Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart2.geefGifAdr())))); handKaart3Button.add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(kaart3.geefGifAdr())))); } /** Auto-generated event handler method */ protected void passenButtonActionPerformed(ActionEvent evt){ int sure = JOptionPane.showConfirmDialog(this, "Weet u zeker dat u wilt passen?", "Check", JOptionPane.OK_CANCEL_OPTION); if(sure == 0) { System.out.println("Passen"); hetSpel.pas(); } } /** Auto-generated event handler method */ protected void overslaanButtonActionPerformed(ActionEvent evt){ hetSpel.doorSchuiven(); } /** Auto-generated event handler method */ protected void wisselenButtonActionPerformed(ActionEvent evt){ if((hk1Selected || hk2Selected || hk3Selected) && (tk1Selected || tk2Selected || tk3Selected)) { int handKaart = 0; if(hk1Selected) { handKaart = 1; } else if(hk2Selected) { handKaart = 2; } else if(hk3Selected) { handKaart = 3; } handKaart--; SpelRonde huidigeRonde = hetSpel.getHuidigeSpelRonde(); Deelname huidigeDeelname = huidigeRonde.getActiveDeelname(); Vector deKaarten = huidigeDeelname.getKaarten(); Kaart deHandKaart = (Kaart) deKaarten.get(handKaart); int tafelKaart = 0; if(tk1Selected) { tafelKaart = 1; } else if(tk2Selected) { tafelKaart = 2; } else if(tk3Selected) { tafelKaart = 3; } tafelKaart--; Vector deTafelKaarten = deTafel.getKaarten(); Kaart deTafelKaart = (Kaart) deTafelKaarten.get(tafelKaart); hetSpel.ruil1Kaart(deHandKaart, deTafelKaart); } else { JOptionPane.showMessageDialog(this,"U moet 1 kaart van uw hand en 1 kaart van de tafel hiervoor selecteren.", "Error", JOptionPane.ERROR_MESSAGE); } } /** Auto-generated event handler method */ protected void allesWisselenButtonActionPerformed(ActionEvent evt){ int sure = JOptionPane.showConfirmDialog(this, "Weet u zeker dat u alle kaarten wil wisselen?", "Check", JOptionPane.OK_CANCEL_OPTION); if(sure == 0) { hetSpel.ruil3Kaart(); } } protected void hK1ActionPerformed(ActionEvent evt){ mijnHandPanel.setVisible(false); if(hk1Selected) { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); hk1Selected = false; hk2Selected = false; hk3Selected = false; } else { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); hk1Selected = true; hk2Selected = false; hk3Selected = false; } mijnHandPanel.repaint(); mijnHandPanel.setVisible(true); } protected void hK2ActionPerformed(ActionEvent evt){ mijnHandPanel.setVisible(false); if(hk2Selected) { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); hk1Selected = false; hk2Selected = false; hk3Selected = false; } else { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); hk1Selected = false; hk2Selected = true; hk3Selected = false; } mijnHandPanel.repaint(); mijnHandPanel.setVisible(true); } protected void hK3ActionPerformed(ActionEvent evt){ mijnHandPanel.setVisible(false); if(hk3Selected) { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); hk1Selected = false; hk2Selected = false; hk3Selected = false; } else { handKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); handKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); hk1Selected = false; hk2Selected = false; hk3Selected = true; } mijnHandPanel.repaint(); mijnHandPanel.setVisible(true); } protected void tK1ActionPerformed(ActionEvent evt){ deTafelPanel.setVisible(false); if(tk1Selected) { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tk1Selected = false; tk2Selected = false; tk3Selected = false; } else { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tk1Selected = true; tk2Selected = false; tk3Selected = false; } deTafelPanel.repaint(); deTafelPanel.setVisible(true); } protected void tK2ActionPerformed(ActionEvent evt){ deTafelPanel.setVisible(false); if(tk2Selected) { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tk1Selected = false; tk2Selected = false; tk3Selected = false; } else { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tk1Selected = false; tk2Selected = true; tk3Selected = false; } deTafelPanel.repaint(); deTafelPanel.setVisible(true); } protected void tK3ActionPerformed(ActionEvent evt){ deTafelPanel.setVisible(false); if(tk3Selected) { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tk1Selected = false; tk2Selected = false; tk3Selected = false; } else { tafelKaart1Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart2Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false)); tafelKaart3Button.setBorder(new LineBorder(new java.awt.Color(0,0,0), 3, false)); tk1Selected = false; tk2Selected = false; tk3Selected = true; } deTafelPanel.repaint(); deTafelPanel.setVisible(true); } }
HUSACCT/SaccWithHusacctExample_Maven
src/main/java/nl/hu/husacct/game31/userinterface/TheMainPanel.java
3,022
import java.util.ArrayList; public class Persoon { private String naam; private double budget; private ArrayList<Game> mijnGames; public Persoon(String naam, double budget) { this.naam = naam; this.budget = budget; this.mijnGames = new ArrayList<Game>(); } /** * Toont het budget van wat er binnen de parameter van de geïnstantieerde. * Object van Class is ingevoerd. * @return Huidige budget. */ public double getBudget() { return budget; } /** * Biedt de mogelijkheid om te kunnen zien of de game wel of niet is verkocht aan persoon.<br><br> * Als het budget van persoon hoger is dan de huidige waarde van de game en de persoon heeft * dat game nog niet tot zijn bezit, dan wordt deze aan de persoon verkocht waardoor ook automatisch * deze aan het lijst mijnGames wordt toegevoegd en de waarde van budget van persoon waarde afgetrokken * met het huidige budget van de game waardoor er een nieuwe waarde in het budget wordt gezet. * @param game Huidige waarde van game. * @return true als de game wordt verkocht, anders false. */ public boolean koop(Game game) { if (getBudget() >= game.huidigeWaarde() && !mijnGames.contains(game)) { budget -= game.huidigeWaarde(); mijnGames.add(game); return true; } return false; } /** * Biedt de mogelijkheid om te kunnen zien dat het game aan een andere persoon wordt verkocht.<br><br> * Als eerste persoon de game bevat en de tweede persoon deze niet in bezit heeft en voldoende budget * heeft deze te kopen, wordt de game van eerste persoon verkocht aan het tweede persoon waardoor * het budget van de eerste persoon stijgt en die van de tweede persoon daalt in huidige waarde. * @param game De game zelf, naam en het huidige waarde. * @param koper Andere persoon. * @return true als de game wordt verkocht, anders false. */ public boolean verkoop(Game game, Persoon koper) { if (mijnGames.contains(game) && koper.getBudget() >= game.huidigeWaarde() && !koper.mijnGames.contains(game)) { mijnGames.remove(game); koper.budget -= game.huidigeWaarde(); budget += game.huidigeWaarde(); koper.mijnGames.add(game); return true; } return false; } @Override public String toString() { StringBuilder sGames= new StringBuilder(); for (Game mijnGame : mijnGames) { sGames.append("\n").append(mijnGame); } return naam + " heeft een budget van \u20AC" + String.format("%.2f", budget) + " en bezit de volgende games:" + sGames ; } }
yannick-coolen/SchoolAssignment_Games
src/Persoon.java
3,023
/* * Copyright (C) 2021 B3Partners B.V. * * SPDX-License-Identifier: MIT * */ package nl.b3p.brmo.bag2.loader.cli; import static nl.b3p.brmo.bgt.loader.Utils.formatTimeSince; import static org.apache.commons.io.FileUtils.byteCountToDisplaySize; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.CookieManager; import java.net.CookiePolicy; import java.net.URI; import java.net.URLEncoder; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Stream; import nl.b3p.brmo.bag2.loader.BAG2Database; import nl.b3p.brmo.bag2.loader.BAG2LoaderUtils; import nl.b3p.brmo.bag2.loader.BAG2ProgressReporter; import nl.b3p.brmo.util.ResumingInputStream; import nl.b3p.brmo.util.http.HttpStartRangeInputStreamProvider; import nl.b3p.brmo.util.http.wrapper.Java11HttpClientWrapper; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONArray; import org.json.JSONObject; import picocli.CommandLine.Command; import picocli.CommandLine.ExitCode; import picocli.CommandLine.Mixin; import picocli.CommandLine.Option; import picocli.CommandLine.ParentCommand; @Command(name = "mutaties", mixinStandardHelpOptions = true) public class BAG2MutatiesCommand { private static final Log log = LogFactory.getLog(BAG2MutatiesCommand.class); @ParentCommand private BAG2LoaderMain parent; public void setParent(BAG2LoaderMain parent) { this.parent = parent; } private static final String KADASTER_LOGIN_URL = "https://mijn.kadaster.nl/security/login.do"; // Artikelnummer 2529 is dagmutaties // (https://www.kadaster.nl/-/handleiding-soap-service-bag-2.0-extract) public static final String LVBAG_BESTANDEN_API_URL = "https://bag.kadaster.nl/lvbag/bag-bestanden/api/bestanden"; @Command(name = "download", sortOptions = false) public int download( @Option(names = "--no-delete", negatable = true) boolean noDelete, @Option(names = "--kadaster-user") String kadasterUser, @Option(names = "--kadaster-password") String kadasterPassword, @Option(names = "--url", defaultValue = LVBAG_BESTANDEN_API_URL) String url, @Option(names = "--query-params", defaultValue = "artikelnummers=2529") String queryParams, @Option(names = "--path", defaultValue = "") String downloadPath, @Option(names = "--mirror-base-url") String mirrorBaseUrl, @Option( names = {"-h", "--help"}, usageHelp = true) boolean showHelp) throws Exception { log.info(BAG2LoaderUtils.getUserAgent()); Instant start = Instant.now(); CookieManager kadasterCookieManager = new CookieManager(null, CookiePolicy.ACCEPT_ALL); mijnKadasterLogin(URI.create(url), kadasterUser, kadasterPassword, kadasterCookieManager); JSONArray bestanden = getBagBestanden(url, queryParams, kadasterCookieManager); log.info("Aantal beschikbare bestanden: " + bestanden.length()); List<JSONObject> toDownload = new ArrayList<>(); for (int i = 0; i < bestanden.length(); i++) { JSONObject bestand = bestanden.getJSONObject(i); File f = Path.of(downloadPath, bestand.getString("naam")).toFile(); if (!f.exists() || f.length() != bestand.getLong("grootte")) { toDownload.add(bestand); } } if (!noDelete) { deleteZipFilesNotInBestanden(downloadPath, bestanden); } long totalBytes = toDownload.stream().map(bestand -> bestand.getLong("grootte")).reduce(Long::sum).orElse(0L); log.info( String.format( "Aantal te downloaden naar directory \"%s\": %d bestanden (%s)", Path.of(downloadPath).toAbsolutePath(), toDownload.size(), byteCountToDisplaySize(totalBytes))); int count = 0; long bytesRead = 0; for (JSONObject bestand : toDownload) { url = bestand.getString("url"); String name = bestand.getString("naam"); try (ResumingInputStream input = new ResumingInputStream( new HttpStartRangeInputStreamProvider( URI.create(url), new Java11HttpClientWrapper( HttpClient.newBuilder().cookieHandler(kadasterCookieManager)))); OutputStream out = new FileOutputStream(Path.of(downloadPath, name).toFile())) { log.info( String.format( "Bestand %2d/%d (%.1f%%): downloaden %s...", ++count, toDownload.size(), (100.0 / totalBytes) * bytesRead, name)); IOUtils.copyLarge(input, out); } bytesRead += bestand.getLong("grootte"); } if (!toDownload.isEmpty()) { String msg = ""; if (mirrorBaseUrl != null) { for (int i = 0; i < bestanden.length(); i++) { JSONObject bestand = bestanden.getJSONObject(i); String name = bestand.getString("naam"); bestand.put("url", URI.create(mirrorBaseUrl).resolve(name)); } File bestandenJSONMirror = Path.of(downloadPath, "bestanden.json").toFile(); try (OutputStream out = new FileOutputStream(bestandenJSONMirror)) { IOUtils.write(bestanden.toString(2), out, StandardCharsets.UTF_8); msg = String.format( ", JSON voor mirror \"%s\" geschreven naar \"%s\"", mirrorBaseUrl, bestandenJSONMirror); } } log.info("Alle bestanden gedownload in " + formatTimeSince(start) + msg); } return ExitCode.OK; } @Command(name = "apply", sortOptions = false) public int apply( @Mixin BAG2DatabaseOptions dbOptions, @Mixin BAG2ProgressOptions progressOptions, @Option(names = "--kadaster-user") String kadasterUser, @Option(names = "--kadaster-password") String kadasterPassword, @Option(names = "--url", defaultValue = LVBAG_BESTANDEN_API_URL) String url, @Option(names = "--query-params", defaultValue = "artikelnummers=2529") String queryParams, @Option( names = {"-h", "--help"}, usageHelp = true) boolean showHelp) throws Exception { log.info(BAG2LoaderUtils.getUserAgent()); Instant start = Instant.now(); CookieManager kadasterCookieManager = new CookieManager(null, CookiePolicy.ACCEPT_ALL); mijnKadasterLogin(URI.create(url), kadasterUser, kadasterPassword, kadasterCookieManager); JSONArray bestanden = getBagBestanden(url, queryParams, kadasterCookieManager); log.info("Aantal beschikbare bestanden: " + bestanden.length()); List<String> urls = new ArrayList<>(); for (int i = 0; i < bestanden.length(); i++) { JSONObject bestand = bestanden.getJSONObject(i); urls.add(bestand.getString("url")); } try (BAG2Database db = parent.getBAG2Database(dbOptions)) { BAG2ProgressReporter progressReporter = progressOptions.isConsoleProgressEnabled() ? new BAG2ConsoleProgressReporter() : new BAG2ProgressReporter(); parent.applyMutaties( db, dbOptions, new BAG2LoadOptions(), progressReporter, urls.toArray(String[]::new), kadasterCookieManager); log.info("Alle mutatiebestanden verwerkt in " + formatTimeSince(start)); return ExitCode.OK; } } private static void mijnKadasterLogin( URI forUri, String username, String password, CookieManager cookieManager) throws IOException, InterruptedException { if (!forUri.getHost().endsWith("kadaster.nl")) { return; } if (username == null || password == null) { throw new IllegalArgumentException("Gebruikersnaam en wachtwoord zijn verplicht"); } HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(KADASTER_LOGIN_URL)) .header("Content-Type", "application/x-www-form-urlencoded") .POST( HttpRequest.BodyPublishers.ofString( String.format( "user=%s&password=%s", URLEncoder.encode(username, StandardCharsets.UTF_8), URLEncoder.encode(password, StandardCharsets.UTF_8)))) .build(); HttpClient httpClient = HttpClient.newBuilder().cookieHandler(cookieManager).build(); HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString()); if (response.statusCode() != 302) { throw new IllegalArgumentException( String.format("Fout bij inloggen op Mijn Kadaster met gebruikersnaam \"%s\"", username)); } Map<String, List<String>> cookies = cookieManager.get(URI.create(KADASTER_LOGIN_URL), new HashMap<>()); Optional<String> kadasterTicketIdCookie = cookies.getOrDefault("Cookie", List.of()).stream() .filter(c -> c.startsWith("KadasterTicketId=")) .findFirst(); if (kadasterTicketIdCookie.isEmpty()) { throw new IllegalArgumentException("Geen KadasterTicketId cookie ontvangen na inloggen"); } } private static JSONArray getBagBestanden( String url, String queryParams, CookieManager kadasterCookieManager) throws Exception { url = url + "?" + queryParams; log.info("Opvragen bestanden JSON vanaf URL " + url); HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url)).build(); HttpClient httpClient = HttpClient.newBuilder().cookieHandler(kadasterCookieManager).build(); HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString()); JSONArray bestanden; try { bestanden = new JSONArray(response.body()); } catch (Exception e) { throw new Exception("Fout bij parsen BAG bestanden JSON, body: " + response.body(), e); } return bestanden; } private static void deleteZipFilesNotInBestanden(String downloadPath, JSONArray bestanden) throws IOException { final Set<String> names = new HashSet<>(); for (int i = 0; i < bestanden.length(); i++) { names.add(bestanden.getJSONObject(i).getString("naam")); } try (Stream<Path> stream = Files.list(Path.of(downloadPath))) { stream .filter( p -> !Files.isDirectory(p) && p.getFileName().toString().endsWith(".zip") && !names.contains(p.getFileName().toString())) .forEach( p -> { log.info("Verwijderen ZIP bestand niet in bestandenlijst: " + p.getFileName()); try { Files.delete(p); } catch (Exception e) { log.error( String.format("Fout bij verwijderen ZIP bestand %s: %s", p.getFileName(), e)); } }); } } }
B3Partners/brmo
bag2-loader/src/main/java/nl/b3p/brmo/bag2/loader/cli/BAG2MutatiesCommand.java
3,025
package model; import java.util.ArrayList; public class Docent { private String gebruikersNaam; private String wachtwoord; private ArrayList<Vak> mijnVakken; public Docent(String gbNm, String ww) { mijnVakken = new ArrayList<Vak>(); gebruikersNaam = gbNm; wachtwoord = ww; } public String getGebruikersNaam() { return gebruikersNaam; } public boolean controleerWachtwoord(String ww) { return wachtwoord.equals(ww); } public void voegVakToe(Vak nwV) { if(mijnVakken.contains(nwV)) { mijnVakken.add(nwV); } } public ArrayList<Vak> getVakken() { return mijnVakken; } }
Gundraub/PrIS
src/model/Docent.java
3,026
package nl.dusdavidgames.kingdomfactions.modules.mine; import java.util.List; import org.bukkit.Location; import org.bukkit.Material; import lombok.Getter; import lombok.Setter; import nl.dusdavidgames.kingdomfactions.KingdomFactionsPlugin; import nl.dusdavidgames.kingdomfactions.modules.mine.command.MineCommand; import nl.dusdavidgames.kingdomfactions.modules.mine.listeners.PlayerTeleportEventListener; import nl.dusdavidgames.kingdomfactions.modules.mine.listeners.PortalProtection; import nl.dusdavidgames.kingdomfactions.modules.mine.listeners.PortalTravelEventListener; import nl.dusdavidgames.kingdomfactions.modules.mine.listeners.WorldProtection; import nl.dusdavidgames.kingdomfactions.modules.player.player.online.KingdomFactionsPlayer; public class MineModule { private static @Getter @Setter MineModule instance; public MineModule() { setInstance(this); new MineCommand("kingdomfactions.command.mine", "zet de mijn spawn", "[kingdom]", false, false).registerCommand();; KingdomFactionsPlugin.getInstance().registerListener(new PortalTravelEventListener()); KingdomFactionsPlugin.getInstance().registerListener(new PortalProtection()); KingdomFactionsPlugin.getInstance().registerListener(new WorldProtection()); KingdomFactionsPlugin.getInstance().registerListener(new PlayerTeleportEventListener()); } public boolean isMinePortal(Location location) { return(location.getBlock().getType() == Material.PORTAL); } public boolean containsMinePortal(List<Location> locations) { Location loc = null; for(Location l : locations) { if(isMinePortal(l)) { loc = l; } } return loc != null; } public void teleportToMineWorld(KingdomFactionsPlayer player) { } }
ddg-server/KingdomFactions
src/nl/dusdavidgames/kingdomfactions/modules/mine/MineModule.java
3,027
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Tuin { public static void main(String[] args) throws IOException { // Enter data using BufferReader BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Zonnescherm zonnescherm = new Zonnescherm(); System.out.println("Welkom in mijn tuin."); Sproeier slangetje = new Sproeier(); TuinDomotica slimmeSchakelaar = new TuinDomotica(); String input = ""; System.out.println("Regent het (JA/NEE)"); slimmeSchakelaar.setRegen(reader.readLine().equalsIgnoreCase("JA")); slimmeSchakelaar.activate(); do { System.out.println("Regen installatie staat op" + slimmeSchakelaar.getSlimmeschakelaar()); System.out.println("Wilt u de toestand van de verlichting weten?"); if(reader.readLine().equalsIgnoreCase("JA")) System.out.println("Het tuinverlichting staat " + (slimmeSchakelaar.getLicht().isLicht() ? "aan" : "uit")); System.out.println("Wilt u de toestand van het zonnescherm-weerstand weten?"); if(reader.readLine().equalsIgnoreCase("JA")) System.out.println("De weerstand is " + zonnescherm.getWeerstand()); System.out.print("Wilt u stoppen (JA/NEE)"); input = reader.readLine(); } while (!input.equalsIgnoreCase("JA")); System.out.println(slangetje.getHoseBrand()); } }
AVANS-SWEN2/tuinieren-kempen-2173481-haberka-dawidek-2176292
Tuin.java
3,028
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Tuin { public static void main(String[] args) throws IOException { // Enter data using BufferReader BufferedReader reader = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Welkom in mijn tuin."); Sproeier slangetje = new Sproeier(); TuinDomotica slimmeSchakelaar = new TuinDomotica(); String input = ""; do { System.out.println("Regen installatie staat op"+ slimmeSchakelaar.getSlimmeschakelaar()); System.out.println("Regent het (JA/NEE)"); input = reader.readLine(); slimmeSchakelaar.setRegen(input.equalsIgnoreCase("JA")); System.out.print("Wilt u stoppen (JA/NEE)"); input = reader.readLine(); } while (!input.equalsIgnoreCase("JA")); System.out.println(slangetje.getHoseBrand()); } }
AVANS-SWEN2/tuinieren-Martien_Reuvers-Tim_Macek
Tuin.java
3,029
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Tuin { public static void main(String[] args) throws IOException { // Enter data using BufferReader BufferedReader reader = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Welkom in mijn tuin."); Sproeier slangetje = new Sproeier(); TuinDomotica slimmeSchakelaar = new TuinDomotica(); TuinVerlichting verlichting = new TuinVerlichting(); String input = ""; do { System.out.println("Regen installatie staat op "+ slimmeSchakelaar.getSlimmeschakelaar()); System.out.println("Regent het (JA/NEE)"); input = reader.readLine(); slimmeSchakelaar.setRegen(input.equalsIgnoreCase("JA")); System.out.println("Is het daglicht? (JA/NEE)"); input = reader.readLine(); verlichting.setDaglicht(input.equalsIgnoreCase("NEE")); verlichting.verlichtingState(); System.out.print("Wilt u stoppen (JA/NEE)"); input = reader.readLine(); } while (!input.equalsIgnoreCase("JA")); System.out.println(slangetje.getHoseBrand()); } }
AVANS-SWEN2/tuinieren-timo-eva-super-team
Tuin.java
3,031
package controller; import java.util.ArrayList; import javax.json.Json; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; import model.Docent; import model.PrIS; import model.Vak; import server.Conversation; import server.Handler; public class DocentController implements Handler { private PrIS informatieSysteem; /** * De DocentController klasse moet alle docent-gerelateerde aanvragen * afhandelen. Methode handle() kijkt welke URI is opgevraagd en laat * dan de juiste methode het werk doen. Je kunt voor elke nieuwe URI * een nieuwe methode schrijven. * * @param infoSys - het toegangspunt tot het domeinmodel */ public DocentController(PrIS infoSys) { informatieSysteem = infoSys; } public void handle(Conversation conversation) { if (conversation.getRequestedURI().startsWith("/docent/mijnvakken")) { mijnVakken(conversation); } } /** * Deze methode haalt eerst de opgestuurde JSON-data op. Daarna worden * de benodigde gegevens uit het domeinmodel gehaald. Deze gegevens worden * dan weer omgezet naar JSON en teruggestuurd naar de Polymer-GUI! * * @param conversation - alle informatie over het request */ private void mijnVakken(Conversation conversation) { JsonObject jsonObjectIn = (JsonObject) conversation.getRequestBodyAsJSON(); String gebruikersnaam = jsonObjectIn.getString("username"); Docent docent = informatieSysteem.getDocent(gebruikersnaam); // Docent-object ophalen! ArrayList<Vak> vakken = docent.getVakken(); // Vakken van de docent ophalen! JsonArrayBuilder jab = Json.createArrayBuilder(); // En uiteindelijk gaat er een JSON-array met... for (Vak v : vakken) { jab.add(Json.createObjectBuilder() // daarin voor elk vak een JSON-object... .add("vakcode", v.getVakCode()) .add("vaknaam", v.getVakNaam())); } conversation.sendJSONMessage(jab.build().toString()); // terug naar de Polymer-GUI! } }
Gundraub/PrIS
src/controller/DocentController.java
3,033
/* * Copyright (c) 2015 iLexiconn * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ package net.ilexiconn.magister.container; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import net.ilexiconn.magister.util.HttpUtil; import net.ilexiconn.magister.util.LogUtil; import java.io.IOException; import java.io.Serializable; public class School implements Serializable { @SerializedName("Id") public String id; @SerializedName("Name") public String name; @SerializedName("Url") public String url; public static School[] findSchool(String s) { if (s.length() <= 3) { return new School[]{}; } try { return new Gson().fromJson(HttpUtil.httpGet("https://mijn.magister.net/api/schools?filter=" + s), School[].class); } catch (IOException e) { LogUtil.printError("Unable to finish request", e); return new School[]{}; } } }
iLexiconn/Magister.java
src/main/java/net/ilexiconn/magister/container/School.java
3,034
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.*; import javax.swing.JOptionPane; /** * Write a description of class controleBoot here. * * @author (your name) * @version (a version number or a date) */ public class controleBoot extends controleHavenObjecten { boolean geklikt = false; boolean geselecteerd = false; boolean varen = true; int mx = 0; int my = 0; double currentX; double currentY; double vaarSnelheid = 0.06; controleBootCirkel cirkel = null; BoegNummer boegNummer = null; int destinationID = 0; int destinationX; int laadLosTijd = 600; Loodser mijnLoodser = null; int havenNr = 0; public controleBoot() { } public enum Status { BINNENVAREN, OMLAAG, WACHTENOPLOODS, NAARHAVENX, NAARHAVENY, AANGEMEERD, UITHAVENY, UITHAVENX, OMHOOG, WEGVAREN, IDLE } Status bootStatus = Status.BINNENVAREN; public void act() { //maak boegnummer if(boegNummer == null) { boegNummer = new BoegNummer(); getWorld().addObject(boegNummer, 0, 0); } /* //klikken op boten if (Greenfoot.mouseClicked(this) == true && geklikt == false && getY() < 24) { geklikt = true; cirkel = new controleBootCirkel(); getWorld().addObject(cirkel, getX(), getY()); } else if (Greenfoot.mouseClicked(this) && geklikt == true) { //destination = EEN HAVEN geklikt = false; getWorld().removeObject(cirkel); } else if(Greenfoot.mouseClicked(null) && geklikt == true) //als je ergens anders klikt, deselect alle boten { geklikt = false; getWorld().removeObject(cirkel); } */ if(bootStatus == Status.BINNENVAREN) { currentX += vaarSnelheid; if(getX() == 32) { turn(90); bootStatus = Status.OMLAAG; } } else if(bootStatus == Status.OMLAAG) { if(isRouteVrij("omlaag")) { currentY += vaarSnelheid; } if(verloren()) { int reply = JOptionPane.showConfirmDialog(null, "Helaas, u heeft verloren. Wilt u nog een keer spelen?", "Verloren!", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.YES_OPTION){ getWorld().removeObject(this); Greenfoot.setWorld(new Controlecentrum()); return; } else if(reply == JOptionPane.NO_OPTION){ Greenfoot.setWorld(new Menu()); return; } } if(getY() == 10) { bootStatus = Status.WACHTENOPLOODS; } } else if(bootStatus == Status.WACHTENOPLOODS) { if(isRouteVrij("omlaag") && getY() < 24) { currentY += vaarSnelheid; } else { //VERLOREN } //deselecteer als je geselecteerd bent en stil staat if(getY() == 24 && geselecteerd && destinationID == 0 && getOneObjectAtOffset(0, 0, Loodser.class) == null) { setGeselecteerd(false); } if(getY() == 24 && destinationID != 0) { //turn naar goede kant turn(-90 * linksOfRechts(destinationID)); //zoek x positie van de haven destinationX = getDestinationXPos(destinationID); getWorld().removeObject(cirkel); bootStatus = Status.NAARHAVENX; } } else if(bootStatus == Status.NAARHAVENX) { //ga naar goede kant currentX += vaarSnelheid * linksOfRechts(destinationID); //TODO als de haven x is bereikt, ga naar de Y van de haven if(getX() == destinationX) { turn(90 * linksOfRechts(destinationID)); bootStatus = Status.NAARHAVENY; } } else if(bootStatus == Status.NAARHAVENY) { //if(currentY < 37.0) //{ currentY += vaarSnelheid; //} if(getY() == 37) { turn(180); //zet de boot in haven op true List<Haven> havenList = getWorld().getObjects(Haven.class); for(int i = 0; i < havenList.size(); i++) { if(havenList.get(i).getID() == destinationID) { havenList.get(i).setBootInHaven(true); } } havenNr = destinationID; setDestinationID(0); mijnLoodser = null; bootStatus = Status.AANGEMEERD; } } else if(bootStatus == Status.AANGEMEERD) { if(laadLosTijd == 0) { setImage("images/controle_Bootv2_leeg.png"); getWorld().removeObject(boegNummer); if(Greenfoot.mouseClicked(this)) { //zet bootInHaven op false List<Haven> havenList = getWorld().getObjects(Haven.class); for(int i = 0; i < havenList.size(); i++) { if(havenList.get(i).getID() == havenNr) { havenList.get(i).setBootInHaven(false); } } bootStatus = Status.UITHAVENY; } } else { laadLosTijd--; } } else if(bootStatus == Status.UITHAVENY) { currentY -= vaarSnelheid; if(getY() == 27) { if(getX() <= 34) { turn(90); } else { turn(-90); } bootStatus = Status.UITHAVENX; } } else if(bootStatus == Status.UITHAVENX) { //ga naar goede kant if(getX() <= 34) { currentX += vaarSnelheid; } else { currentX -= vaarSnelheid; } if(getX() == 34) { if(this.getRotation() == 0) { turn(-90); } else if(this.getRotation() == 180) { turn(90); } bootStatus = Status.OMHOOG; } } else if(bootStatus == Status.OMHOOG) { if(isRouteVrij("omhoog")) { currentY -= vaarSnelheid; } if(getY() == 4) { turn(90); bootStatus = Status.WEGVAREN; } } else if(bootStatus == Status.WEGVAREN) { currentX += vaarSnelheid; } //beweeg cirkel mee if(cirkel != null) { cirkel.setPosition((int)currentX, (int)currentY); } //beweeg boegnummer mee if(bootStatus == Status.BINNENVAREN || bootStatus == Status.OMLAAG || bootStatus == Status.WACHTENOPLOODS || bootStatus == Status.NAARHAVENX || bootStatus == Status.NAARHAVENY) { boegNummer.setPosition((int)currentX, (int)currentY); } //beweeg loodser mee if(mijnLoodser != null) { mijnLoodser.setPosition((int)currentX, (int)currentY); } setLocation((int)currentX, (int)currentY); } public int linksOfRechts(int havenID) { int kant; if(havenID < 6) { kant = -1; } else { kant = 1; } return kant; } public boolean isGeklikt() { return geklikt; } public void setDestinationID(int id) { destinationID = id; if(id == 0) { boegNummer.setBoegNummer(""); } else { boegNummer.setBoegNummer(Integer.toString(id)); } } public void acceptLoodser(Loodser loodser) { mijnLoodser = loodser; setDestinationID(loodser.loodserID); } public int getDestinationID() { return destinationID; } public int getDestinationXPos(int id) { int position = 47; List<Haven> havens = getWorld().getObjects(Haven.class); for(int i = 0; i < havens.size();i++) { Haven haven = havens.get(i); if(haven.getID() == id) { position = haven.getX(); } } return position; } public boolean isRouteVrij(String richting) { boolean vrij = true; /* boolean onderNiks = true; List<controleBoot> bootList = getWorld().getObjectsAt(getX(), getY(), controleBoot.class); for(int i = 0; i < bootList.size(); i++) { if(bootList.get(i) != this) { onderNiks = false; } }*/ int y = 1; if(richting == "omlaag") { y = 1; } else if(richting == "omhoog") { y = -1; } if(getOneObjectAtOffset(0, y, controleBoot.class) == null && getOneObjectAtOffset(0, 2 * y, controleBoot.class) == null && getOneObjectAtOffset(0, 3 * y, controleBoot.class) == null) { vrij = true; } else { vrij = false; } return vrij; } public void setGeselecteerd(boolean var) { if(var) { geselecteerd = true; cirkel = new controleBootCirkel(); getWorld().addObject(cirkel, getX(), getY()); } else { geselecteerd = false; getWorld().removeObject(cirkel); } } public boolean isGeselecteerd() { return geselecteerd; } public Status getStatus() { return bootStatus; } public boolean verloren() { boolean verloren = false; if(getOneObjectAtOffset(0, 3, controleBoot.class) != null && getOneObjectAtOffset(0, 7, controleBoot.class) != null && getOneObjectAtOffset(0, 11, controleBoot.class) != null) { verloren = true; } return verloren; } }
JARRS/game
Main/Port of Rotterdam/controleBoot.java
3,035
/** Automatically generated file. DO NOT MODIFY */ package armijn.vink.numberviewanimation; public final class BuildConfig { public final static boolean DEBUG = true; }
Armijn/NumberViewAnimation
gen/armijn/vink/numberviewanimation/BuildConfig.java
3,036
package nl.mrwouter.minetopiafarms.commands; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import net.citizensnpcs.api.event.DespawnReason; import net.citizensnpcs.npc.skin.Skin; import net.citizensnpcs.npc.skin.SkinnableEntity; import net.citizensnpcs.trait.SkinTrait; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabExecutor; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; import nl.mrwouter.minetopiafarms.Main; import nl.mrwouter.minetopiafarms.utils.Updat3r; import nl.mrwouter.minetopiafarms.utils.Utils; import org.bukkit.util.StringUtil; public class MTFarmsCMD implements TabExecutor { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (!sender.hasPermission("minetopiafarms.hulp")) { sender.sendMessage(Utils.color("&4ERROR: &cJe mist de permissie minetopiafarms.hulp")); return true; } if (args.length == 1 && args[0].equalsIgnoreCase("update")) { Updat3r.Update update; try { update = Updat3r.getInstance().getLatestCached().get(); } catch (Exception ex) { ex.printStackTrace(); sender.sendMessage(Utils.color("&cEr is geen update beschikbaar!")); return true; } if (update == null || !update.isNewer()) { sender.sendMessage(Utils.color("&cEr is geen update beschikbaar!")); return true; } sender.sendMessage(Utils.color("&3We gaan de update nu installeren!")); Updat3r.getInstance().downloadLatest(update.getDownloadLink(), Main.getPlugin()); for (Player player : Bukkit.getOnlinePlayers()) { player.kickPlayer("Installing update.."); } Bukkit.getScheduler().runTask(Main.getPlugin(), Bukkit::reload); return true; } else if (args.length == 1 && args[0].equalsIgnoreCase("spawnnpc")) { if (Bukkit.getPluginManager().getPlugin("Citizens") == null) { sender.sendMessage(Utils.color("&4ERROR: &cCitizens is hiervoor benodigd!")); return true; } if (!(sender instanceof Player)) { sender.sendMessage(Utils.color("&4ERROR: &cJe moet een speler zijn om dit te doen!")); return true; } Player player = (Player) sender; NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, Main.getMessage("NPC.Name")); npc.spawn(player.getLocation()); SkinTrait trait = npc.getOrAddTrait(SkinTrait.class); trait.setSkinName(Main.getMessage("NPC.Skin.Name"), true); npc.despawn(DespawnReason.PENDING_RESPAWN); npc.spawn(player.getLocation()); sender.sendMessage(Utils.color("&3NPC gespanwed op jouw huidige locatie!")); } else { sender.sendMessage(Utils.color("&bUitleg: &3Voer de command uit bij een region die (bijv.) een farm moet worden.")); sender.sendMessage(Utils.color("&3Houthakkers: \n&3&3/rg flag &b<Region> &3minetopiafarms houthakker")); sender.sendMessage(Utils.color("&3Mijnwerker: \n&3&3/rg flag &b<Region> &3minetopiafarms mijn")); sender.sendMessage(Utils.color("&3Boer: \n&3&3/rg flag &b<Region> &3minetopiafarms farm")); sender.sendMessage(" "); sender.sendMessage(Utils.color("&3Spawn een verkoop NPC: \n&b/mtfarms spawnnpc")); sender.sendMessage(" "); sender.sendMessage(Utils.color("&3Sloop op regions met MinetopiaFarms flag: &bminetopiafarms.bypassregions")); } return true; } @Override public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] args) { if(args.length == 1){ return getApplicableTabCompleters(args[0], Arrays.asList("spawnnpc", "update")); } return null; } public ArrayList<String> getApplicableTabCompleters(String arg, List<String> completions) { return StringUtil.copyPartialMatches(arg, completions, new ArrayList<String>(completions.size())); } }
MinetopiaSDB/MinetopiaFarms
src/main/java/nl/mrwouter/minetopiafarms/commands/MTFarmsCMD.java
3,037
package nl.mrwouter.minetopiafarms.events; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import nl.minetopiasdb.api.playerdata.PlayerManager; import nl.mrwouter.minetopiafarms.Main; import nl.mrwouter.minetopiafarms.utils.CustomFlags; import nl.mrwouter.minetopiafarms.utils.Utils; public class BlockBreaker implements Listener { @EventHandler public void onBreak(BlockBreakEvent e) { Player p = e.getPlayer(); if (CustomFlags.hasFlag(e.getBlock().getLocation()) && (!p.hasPermission("minetopiafarms.bypassregions") && p.getGameMode() != GameMode.CREATIVE)) { e.setCancelled(true); } if (e.getBlock().getType().toString().contains("_ORE") && CustomFlags.hasFlag(e.getBlock().getLocation())) { if (p.getGameMode() == GameMode.CREATIVE) { p.sendMessage(Main.getMessage("Creative")); return; } if (Main.getPlugin().getConfig().getBoolean("PrefixEnabled") && !PlayerManager.getOnlinePlayer(e.getPlayer().getUniqueId()).getPrefix().equalsIgnoreCase("Mijnwerker")) { e.getPlayer().sendMessage(Main.getMessage("BeroepNodig").replaceAll("<Beroep>", "mijnwerker")); e.setCancelled(true); return; } if (!e.getPlayer().getInventory().getItemInMainHand().getType().toString().contains("PICKAXE")) { e.getPlayer().sendMessage(Main.getMessage("ToolNodig").replaceAll("<Tool>", "houweel")); e.setCancelled(true); return; } if (!CustomFlags.isAllowed(e.getBlock().getLocation(), "mijn")) { p.sendMessage(Main.getMessage("GeenRegion").replaceAll("<Tag>", "mijn")); e.setCancelled(true); return; } Material blockType = e.getBlock().getType().toString().contains("REDSTONE_ORE") ? Material.REDSTONE_ORE : e.getBlock().getType(); e.setCancelled(true); if (Main.getPlugin().getConfig().get("scheduler.miner." + blockType.name()) == null) { p.sendMessage(Main.getMessage("MateriaalOnbekend")); e.setCancelled(true); return; } e.getPlayer().getInventory().addItem(new ItemStack(blockType, 1)); e.getBlock().getDrops().clear(); Utils.ores.put(e.getBlock().getLocation(), e.getBlock().getType()); e.getBlock().getLocation().getBlock().setType(Material.COBBLESTONE); Utils.handleToolDurability(e.getPlayer()); Bukkit.getScheduler().runTaskLater(Main.getPlugin(), () -> { e.getBlock().setType(blockType); Utils.ores.remove(e.getBlock().getLocation()); }, Main.getPlugin().getConfig().getInt("scheduler.miner." + blockType.name())); } } }
MinetopiaSDB/MinetopiaFarms
src/main/java/nl/mrwouter/minetopiafarms/events/BlockBreaker.java
3,038
package origami; import org.scijava.nativelib.DefaultJniExtractor; import java.io.*; public class OrigamiJniExtractor extends DefaultJniExtractor { public OrigamiJniExtractor(Class<?> libraryJarClass) throws IOException { super(libraryJarClass); } private String sh(String cmd) { String o = null; try { Process p = Runtime.getRuntime().exec(cmd); BufferedReader b = new BufferedReader(new InputStreamReader(p.getInputStream())); String r; while ((r = b.readLine()) != null) o += r; } catch (Exception e) { o = "error"; } return o; } @Override public File extractJni(String libPath, String libname) throws IOException { System.out.println("Loading:" + libname + " from:" + libPath); if (libPath.equalsIgnoreCase("natives/linux_arm64/")) { String uname = sh("uname -a"); boolean check = uname.contains("nvidia"); if(check) { return super.extractJni("natives/linux_arm64_nvidia", libname); } else { return super.extractJni(libPath, libname); } } else { return super.extractJni(libPath, libname); } } }
hellonico/origami
java/origami/OrigamiJniExtractor.java
3,039
package binding; import javafx.scene.text.Text; public class Controller { private Model model; private int index; final private String[] messagelist = { "Hallo, dit is het eerste bericht uit de lijst.", "Vakantie", "Huiswerk maken", "naar de Kroeg", "Groetjes", "Opa en Oma een kaart sturen", "Credits aan Jantien geven!", "nu eindelijk echt aan mijn huiswerk beginnen!", "Enjoy yourself", "Biertje drinken met Kenneth!", "YEET!", "passive agrresive postIT notes", "Kom maar door!", "Dat is zo!", "Weird flex but OK" }; public Controller(Model model) { this.index = 0; this.model = model; } public void bindText(Text textfield) { textfield.textProperty().bind(this.model.nameProperty()); } public void push() { model.push(messagelist[index]); index++; index %= messagelist.length; } }
Avans/AII-Informatica-Essentials
Architectuur/Software/MVC/src/binding/Controller.java
3,040
package mijnlieff.MainMenu; import mijnlieff.BoardPicker.BoardPickerCompanion; import mijnlieff.Companion; import mijnlieff.Mijnlieff; import mijnlieff.ServerClient.Client; import mijnlieff.ServerClient.Player; import mijnlieff.ServerClient.ServerTasks.AwaitResponseTask; import mijnlieff.ServerClient.ServerTasks.QueueTask; import mijnlieff.WaitScreen.WaitGameStartScreen.WaitGameStartScreenCompanion; import mijnlieff.WaitScreen.WaitQueueScreen.WaitQueueScreenCompanion; import javafx.beans.Observable; import javafx.beans.property.Property; import javafx.collections.FXCollections; import javafx.concurrent.Worker; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.ListView; import java.util.ArrayList; public class MainMenuCompanion implements Companion { private Mijnlieff mijnlieff; private Client client; @FXML public ListView<Player> listView; @FXML public Button refresh; @FXML public Button challenge; @FXML public Button enqueue; @FXML public Label errorLabel; public MainMenuCompanion(Mijnlieff mijnlieff, Client client) { this.mijnlieff = mijnlieff; this.client = client; } public void initialize() { errorLabel.setVisible(false); refresh.setOnAction((e) -> refresh_press()); challenge.setOnAction((e) -> challenge_press()); enqueue.setOnAction((e) -> enqueue()); refresh_press(); } public void updateListView(Observable o) { QueueTask task = (QueueTask) ((Property) o).getBean(); if (task.getState().equals(Worker.State.SUCCEEDED)) { ArrayList<Player> players = task.getValue(); listView.setItems(FXCollections.observableList(players)); listView.refresh(); } } private void refresh_press() { errorLabel.setVisible(false); QueueTask task = client.getQueueTask(); task.stateProperty().addListener(this::updateListView); new Thread(task).start(); } private void challenge_press() { errorLabel.setVisible(false); if (listView.getSelectionModel().getSelectedItem() != null) { AwaitResponseTask task = client.getAwaitResponseTask("C " + listView.getSelectionModel().getSelectedItem().toString()); task.stateProperty().addListener((e) -> challenge(e)); new Thread(task).start(); } else { errorLabel.setText("You should choose an opponent"); errorLabel.setVisible(true); } } private void challenge(Observable o) { AwaitResponseTask task = (AwaitResponseTask) ((Property) o).getBean(); if (task.getState().equals(Worker.State.SUCCEEDED)) { String response = task.getValue(); if (response.split(" ")[1].equals("T")) { mijnlieff.openWindow("/mijnlieff/BoardPicker/BoardPicker.fxml", new BoardPickerCompanion(mijnlieff, client)); } else { mijnlieff.openWindow("/mijnlieff/WaitScreen/WaitGameStartScreen/WaitGameStartScreen.fxml", new WaitGameStartScreenCompanion(mijnlieff, client)); } } } private void enqueue() { mijnlieff.openWindow("/mijnlieff/WaitScreen/WaitQueueScreen/WaitQueueScreen.fxml", new WaitQueueScreenCompanion(mijnlieff, client)); } }
FKD13/Meinlieff-Part2
src/mijnlieff/MainMenu/MainMenuCompanion.java
3,041
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference // Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2018.12.31 at 10:32:54 AM CET // package nl.b3p.topnl.top50nl; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * Java class for TypeFunctioneelGebiedT50Type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <p> * * <pre> * &lt;simpleType name="TypeFunctioneelGebiedT50Type"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="arboretum"/> * &lt;enumeration value="bedrijventerrein"/> * &lt;enumeration value="begraafplaats"/> * &lt;enumeration value="bungalowpark"/> * &lt;enumeration value="camping, kampeerterrein"/> * &lt;enumeration value="circuit"/> * &lt;enumeration value="crossbaan"/> * &lt;enumeration value="dierentuin, safaripark"/> * &lt;enumeration value="emplacement"/> * &lt;enumeration value="erebegraafplaats"/> * &lt;enumeration value="gaswinning"/> * &lt;enumeration value="groeve"/> * &lt;enumeration value="haven"/> * &lt;enumeration value="heemtuin"/> * &lt;enumeration value="helikopterlandingsterrein"/> * &lt;enumeration value="jachthaven"/> * &lt;enumeration value="mijn"/> * &lt;enumeration value="militair oefengebied, schietterrein"/> * &lt;enumeration value="mosselbank"/> * &lt;enumeration value="natuurgebied, natuurreservaat"/> * &lt;enumeration value="oliewinning"/> * &lt;enumeration value="openluchtmuseum"/> * &lt;enumeration value="openluchttheater"/> * &lt;enumeration value="park"/> * &lt;enumeration value="pinetum"/> * &lt;enumeration value="productie-installatie"/> * &lt;enumeration value="recreatiegebied"/> * &lt;enumeration value="renbaan"/> * &lt;enumeration value="skibaan"/> * &lt;enumeration value="sluizencomplex"/> * &lt;enumeration value="sportterrein, sportcomplex"/> * &lt;enumeration value="stortplaats"/> * &lt;enumeration value="tennispark"/> * &lt;enumeration value="verzorgingsplaats"/> * &lt;enumeration value="vliegveld, luchthaven"/> * &lt;enumeration value="volkstuinen"/> * &lt;enumeration value="wildwissel"/> * &lt;enumeration value="windturbinepark"/> * &lt;enumeration value="woonwagencentrum"/> * &lt;enumeration value="zandwinning"/> * &lt;enumeration value="zenderpark"/> * &lt;enumeration value="zoutwinning"/> * &lt;enumeration value="zuiveringsinstallatie"/> * &lt;enumeration value="zweefvliegveldterrein"/> * &lt;enumeration value="ijsbaan"/> * &lt;/restriction> * &lt;/simpleType> * </pre> */ @XmlType( name = "TypeFunctioneelGebiedT50Type", namespace = "http://register.geostandaarden.nl/gmlapplicatieschema/top50nl/1.1.1") @XmlEnum public enum TypeFunctioneelGebiedT50Type { @XmlEnumValue("arboretum") ARBORETUM("arboretum"), @XmlEnumValue("bedrijventerrein") BEDRIJVENTERREIN("bedrijventerrein"), @XmlEnumValue("begraafplaats") BEGRAAFPLAATS("begraafplaats"), @XmlEnumValue("bungalowpark") BUNGALOWPARK("bungalowpark"), @XmlEnumValue("camping, kampeerterrein") CAMPING_KAMPEERTERREIN("camping, kampeerterrein"), @XmlEnumValue("circuit") CIRCUIT("circuit"), @XmlEnumValue("crossbaan") CROSSBAAN("crossbaan"), @XmlEnumValue("dierentuin, safaripark") DIERENTUIN_SAFARIPARK("dierentuin, safaripark"), @XmlEnumValue("emplacement") EMPLACEMENT("emplacement"), @XmlEnumValue("erebegraafplaats") EREBEGRAAFPLAATS("erebegraafplaats"), @XmlEnumValue("gaswinning") GASWINNING("gaswinning"), @XmlEnumValue("groeve") GROEVE("groeve"), @XmlEnumValue("haven") HAVEN("haven"), @XmlEnumValue("heemtuin") HEEMTUIN("heemtuin"), @XmlEnumValue("helikopterlandingsterrein") HELIKOPTERLANDINGSTERREIN("helikopterlandingsterrein"), @XmlEnumValue("jachthaven") JACHTHAVEN("jachthaven"), @XmlEnumValue("mijn") MIJN("mijn"), @XmlEnumValue("militair oefengebied, schietterrein") MILITAIR_OEFENGEBIED_SCHIETTERREIN("militair oefengebied, schietterrein"), @XmlEnumValue("mosselbank") MOSSELBANK("mosselbank"), @XmlEnumValue("natuurgebied, natuurreservaat") NATUURGEBIED_NATUURRESERVAAT("natuurgebied, natuurreservaat"), @XmlEnumValue("oliewinning") OLIEWINNING("oliewinning"), @XmlEnumValue("openluchtmuseum") OPENLUCHTMUSEUM("openluchtmuseum"), @XmlEnumValue("openluchttheater") OPENLUCHTTHEATER("openluchttheater"), @XmlEnumValue("park") PARK("park"), @XmlEnumValue("pinetum") PINETUM("pinetum"), @XmlEnumValue("productie-installatie") PRODUCTIE_INSTALLATIE("productie-installatie"), @XmlEnumValue("recreatiegebied") RECREATIEGEBIED("recreatiegebied"), @XmlEnumValue("renbaan") RENBAAN("renbaan"), @XmlEnumValue("skibaan") SKIBAAN("skibaan"), @XmlEnumValue("sluizencomplex") SLUIZENCOMPLEX("sluizencomplex"), @XmlEnumValue("sportterrein, sportcomplex") SPORTTERREIN_SPORTCOMPLEX("sportterrein, sportcomplex"), @XmlEnumValue("stortplaats") STORTPLAATS("stortplaats"), @XmlEnumValue("tennispark") TENNISPARK("tennispark"), @XmlEnumValue("verzorgingsplaats") VERZORGINGSPLAATS("verzorgingsplaats"), @XmlEnumValue("vliegveld, luchthaven") VLIEGVELD_LUCHTHAVEN("vliegveld, luchthaven"), @XmlEnumValue("volkstuinen") VOLKSTUINEN("volkstuinen"), @XmlEnumValue("wildwissel") WILDWISSEL("wildwissel"), @XmlEnumValue("windturbinepark") WINDTURBINEPARK("windturbinepark"), @XmlEnumValue("woonwagencentrum") WOONWAGENCENTRUM("woonwagencentrum"), @XmlEnumValue("zandwinning") ZANDWINNING("zandwinning"), @XmlEnumValue("zenderpark") ZENDERPARK("zenderpark"), @XmlEnumValue("zoutwinning") ZOUTWINNING("zoutwinning"), @XmlEnumValue("zuiveringsinstallatie") ZUIVERINGSINSTALLATIE("zuiveringsinstallatie"), @XmlEnumValue("zweefvliegveldterrein") ZWEEFVLIEGVELDTERREIN("zweefvliegveldterrein"), @XmlEnumValue("ijsbaan") IJSBAAN("ijsbaan"); private final String value; TypeFunctioneelGebiedT50Type(String v) { value = v; } public String value() { return value; } public static TypeFunctioneelGebiedT50Type fromValue(String v) { for (TypeFunctioneelGebiedT50Type c : TypeFunctioneelGebiedT50Type.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
B3Partners/brmo
brmo-topnl-loader/src/main/java/nl/b3p/topnl/top50nl/TypeFunctioneelGebiedT50Type.java
3,042
package blackjackdomain; import java.util.ArrayList; public class BlackJackBank extends BlackJackSpeler { ArrayList <BlackJackKaart> hand = null; int credits = 0; boolean heeftBlackJack = false; String naam = "Bank"; int score = 0; public BlackJackBank (){ mijnInit(); } public void mijnInit(){ ArrayList <BlackJackKaart> hand = new ArrayList <BlackJackKaart> (); this.hand=hand; } public String getNaam(){ return naam; } public int getScore(){ return score; } public void setScore(int punten){ score = punten; } public void addKAART (BlackJackKaart kaart){ hand.add(kaart); } public BlackJackKaart getKAART (int index){ BlackJackKaart kaart = hand.get(index); return kaart; } public void clearHand (){ hand.clear(); } public int handLengte(){ return hand.size(); } }
Mandiax/GameSuite
GameSuiteMain/src/blackjackdomain/BlackJackBank.java
3,043
package application; public class Client { private static final String[] feedback = {"Zoveel geld zit er niet in mijn/nspaarvarken, kan het niet anders?", "De kwaliteitswaarde is te laag!", "Er mist naar mijn gevoel nog iets...", "Goed gedaan, ga zo door!"}; private int budget, quality; private String picName; private String name, description; private Mission[] missions = new Mission[5]; public Client(String name, String description, int budget, int quality, Mission[] missions) { this.name = name; this.description = description; this.budget = budget; this.quality = quality; this.missions = missions; this.picName = name.replace(" ", "_"); } public String getName() { return name; } public String getDescription() { return description; } public void setBudget(int budget) { this.budget = budget; } public int getBudget() { return budget; } public void setQuality(int quality) { this.quality = quality; } public int getQuality() { return quality; } public String getPicName() { return picName; } public String getFeedback(int index) { return feedback[index]; } public Mission[] getMissions() { return missions; } }
Borroot/hoppenbrouwers-the-game
src/application/Client.java
3,044
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference // Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.12.07 at 02:40:39 PM CET // package nl.b3p.topnl.top100nl; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * Java class for TypeFunctioneelGebiedT100Type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <p> * * <pre> * &lt;simpleType name="TypeFunctioneelGebiedT100Type"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="arboretum"/> * &lt;enumeration value="bedrijventerrein"/> * &lt;enumeration value="begraafplaats"/> * &lt;enumeration value="bungalowpark"/> * &lt;enumeration value="camping, kampeerterrein"/> * &lt;enumeration value="circuit"/> * &lt;enumeration value="crossbaan"/> * &lt;enumeration value="dierentuin, safaripark"/> * &lt;enumeration value="emplacement"/> * &lt;enumeration value="erebegraafplaats"/> * &lt;enumeration value="gaswinning"/> * &lt;enumeration value="groeve"/> * &lt;enumeration value="haven"/> * &lt;enumeration value="heemtuin"/> * &lt;enumeration value="helikopterlandingsterrein"/> * &lt;enumeration value="jachthaven"/> * &lt;enumeration value="mijn"/> * &lt;enumeration value="militair oefengebied, schietterrein"/> * &lt;enumeration value="mosselbank"/> * &lt;enumeration value="natuurgebied, natuurreservaat"/> * &lt;enumeration value="oliewinning"/> * &lt;enumeration value="openluchtmuseum"/> * &lt;enumeration value="openluchttheater"/> * &lt;enumeration value="park"/> * &lt;enumeration value="pinetum"/> * &lt;enumeration value="productie-installatie"/> * &lt;enumeration value="recreatiegebied"/> * &lt;enumeration value="renbaan"/> * &lt;enumeration value="skibaan"/> * &lt;enumeration value="sluizencomplex"/> * &lt;enumeration value="sportterrein, sportcomplex"/> * &lt;enumeration value="stortplaats"/> * &lt;enumeration value="tennispark"/> * &lt;enumeration value="verzorgingsplaats"/> * &lt;enumeration value="vliegveld, luchthaven"/> * &lt;enumeration value="volkstuinen"/> * &lt;enumeration value="wildwissel"/> * &lt;enumeration value="windturbinepark"/> * &lt;enumeration value="woonwagencentrum"/> * &lt;enumeration value="zandwinning"/> * &lt;enumeration value="zenderpark"/> * &lt;enumeration value="zoutwinning"/> * &lt;enumeration value="zuiveringsinstallatie"/> * &lt;enumeration value="zweefvliegveldterrein"/> * &lt;enumeration value="ijsbaan"/> * &lt;/restriction> * &lt;/simpleType> * </pre> */ @XmlType( name = "TypeFunctioneelGebiedT100Type", namespace = "http://register.geostandaarden.nl/gmlapplicatieschema/top100nl/1.1.0") @XmlEnum public enum TypeFunctioneelGebiedT100Type { @XmlEnumValue("arboretum") ARBORETUM("arboretum"), @XmlEnumValue("bedrijventerrein") BEDRIJVENTERREIN("bedrijventerrein"), @XmlEnumValue("begraafplaats") BEGRAAFPLAATS("begraafplaats"), @XmlEnumValue("bungalowpark") BUNGALOWPARK("bungalowpark"), @XmlEnumValue("camping, kampeerterrein") CAMPING_KAMPEERTERREIN("camping, kampeerterrein"), @XmlEnumValue("circuit") CIRCUIT("circuit"), @XmlEnumValue("crossbaan") CROSSBAAN("crossbaan"), @XmlEnumValue("dierentuin, safaripark") DIERENTUIN_SAFARIPARK("dierentuin, safaripark"), @XmlEnumValue("emplacement") EMPLACEMENT("emplacement"), @XmlEnumValue("erebegraafplaats") EREBEGRAAFPLAATS("erebegraafplaats"), @XmlEnumValue("gaswinning") GASWINNING("gaswinning"), @XmlEnumValue("groeve") GROEVE("groeve"), @XmlEnumValue("haven") HAVEN("haven"), @XmlEnumValue("heemtuin") HEEMTUIN("heemtuin"), @XmlEnumValue("helikopterlandingsterrein") HELIKOPTERLANDINGSTERREIN("helikopterlandingsterrein"), @XmlEnumValue("jachthaven") JACHTHAVEN("jachthaven"), @XmlEnumValue("mijn") MIJN("mijn"), @XmlEnumValue("militair oefengebied, schietterrein") MILITAIR_OEFENGEBIED_SCHIETTERREIN("militair oefengebied, schietterrein"), @XmlEnumValue("mosselbank") MOSSELBANK("mosselbank"), @XmlEnumValue("natuurgebied, natuurreservaat") NATUURGEBIED_NATUURRESERVAAT("natuurgebied, natuurreservaat"), @XmlEnumValue("oliewinning") OLIEWINNING("oliewinning"), @XmlEnumValue("openluchtmuseum") OPENLUCHTMUSEUM("openluchtmuseum"), @XmlEnumValue("openluchttheater") OPENLUCHTTHEATER("openluchttheater"), @XmlEnumValue("park") PARK("park"), @XmlEnumValue("pinetum") PINETUM("pinetum"), @XmlEnumValue("productie-installatie") PRODUCTIE_INSTALLATIE("productie-installatie"), @XmlEnumValue("recreatiegebied") RECREATIEGEBIED("recreatiegebied"), @XmlEnumValue("renbaan") RENBAAN("renbaan"), @XmlEnumValue("skibaan") SKIBAAN("skibaan"), @XmlEnumValue("sluizencomplex") SLUIZENCOMPLEX("sluizencomplex"), @XmlEnumValue("sportterrein, sportcomplex") SPORTTERREIN_SPORTCOMPLEX("sportterrein, sportcomplex"), @XmlEnumValue("stortplaats") STORTPLAATS("stortplaats"), @XmlEnumValue("tennispark") TENNISPARK("tennispark"), @XmlEnumValue("verzorgingsplaats") VERZORGINGSPLAATS("verzorgingsplaats"), @XmlEnumValue("vliegveld, luchthaven") VLIEGVELD_LUCHTHAVEN("vliegveld, luchthaven"), @XmlEnumValue("volkstuinen") VOLKSTUINEN("volkstuinen"), @XmlEnumValue("wildwissel") WILDWISSEL("wildwissel"), @XmlEnumValue("windturbinepark") WINDTURBINEPARK("windturbinepark"), @XmlEnumValue("woonwagencentrum") WOONWAGENCENTRUM("woonwagencentrum"), @XmlEnumValue("zandwinning") ZANDWINNING("zandwinning"), @XmlEnumValue("zenderpark") ZENDERPARK("zenderpark"), @XmlEnumValue("zoutwinning") ZOUTWINNING("zoutwinning"), @XmlEnumValue("zuiveringsinstallatie") ZUIVERINGSINSTALLATIE("zuiveringsinstallatie"), @XmlEnumValue("zweefvliegveldterrein") ZWEEFVLIEGVELDTERREIN("zweefvliegveldterrein"), @XmlEnumValue("ijsbaan") IJSBAAN("ijsbaan"); private final String value; TypeFunctioneelGebiedT100Type(String v) { value = v; } public String value() { return value; } public static TypeFunctioneelGebiedT100Type fromValue(String v) { for (TypeFunctioneelGebiedT100Type c : TypeFunctioneelGebiedT100Type.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
B3Partners/brmo
brmo-topnl-loader/src/main/java/nl/b3p/topnl/top100nl/TypeFunctioneelGebiedT100Type.java
3,046
package data; import java.util.Random; public class Uitspraak { private static String[] uitspraken = { "Pleur op.", "Doe zelf effe lekker normaal.", "Doe eens normaal man.", "Mevrouw de voorzitter, dit is natuurlijk gelul van een dronken aarbei.", "Medicijnen kunnen de kwaliteit van leven spectaculair verbeteren en zelfs mensen genezen. Maar ze zijn ongekend duur en dreigen daarmee te leiden tot onbetaalbare zorg.", "Mijn oproep is, was en blijft dat andere politieke partijen zaken zullen moeten doen met de PVV.", "Roken is ook heel lang normaal gevonden, maar geleidelijk is er steeds meer weerstand tegen ontstaan. Met de auto moet hetzelfde gebeuren: het is vies en ongezond.", "Er moet wel op tijd geleverd worden, anders krijgen we weer die sporthallen.", "Volgens de meest optimistische schatting kost het de Russen 60 uur om in Riga te staan. Als je in Den Haag woont klinkt dat ver weg. In Riga denken ze daar anders over.", "Laat dit een wake-upcall zijn. Veel mensen snappen Europa niet meer. Ze ergeren zich aan de regels die over ons worden uitgestort.", "Reden temeer voor geen versnelde toetreding tot de EU.", "Hij heeft nog steeds die rare gedachten. We willen hem niet bij de gewone gevangenen hebben.", "Een ordentelijk proces is belangrijker dan een datum.", "Ik dacht: who the fuck zijn jullie? Je kent me niet, alleen maar van de tv. Je hebt nog niet eens met me gesproken.", "De dag dat ik mijn moeder naar een verpleeghuis bracht, was de verdrietigste dag van mijn leven.", "Ik heb gezegd dat als het mijn verantwoordelijkheid was geweest, ik ze voor de zekerheid had gesloten.", "Minder! Minder! Minder!", "Nog maximaal 365 dagen tot aan de volgende verkiezingen voor de Tweede Kamer.", "Europa is in het hart getroffen.", "We moeten niet voor elke poep en scheet een referendum organiseren. Dan wordt de democratie een grapje.", "Wij geloven erin dat jij wijs en verstandig genoeg bent om door dit spel heen te prikken. Trap er dus niet in!", "Het is heel moeilijk om vertrouwen te houden in een minister wanneer je keer op keer ziet dat er achteraf toch net weer iets meer blijkt te zijn dan hij aanvankelijk beweerde.", "We staan klaar als een fitte bokser om het Nederlands belang centraal te stellen.", "Als je dingen wil veranderen, doe dat dan geleidelijk. Niet op de manier waarop RTL het doet. Daarmee vermoord je het Sinterklaasfeest", "Het is heel bijzonder dat de staatssecretaris van belastingzaken de Belastingdienst onder curatele stelt, want wie is er nu eigenlijk verantwoordelijk voor die Belastingdienst? ", "Wat de Amerikanen kunnen, dat kunnen wij ook. En daarom zal dat zeker een enorme stimulans zijn voor partijen als de mijne om hiermee door te gaan" }; private static Random rnd = new Random();; public static String getUitspraak() { int foo = rnd.nextInt(uitspraken.length); return uitspraken[foo]; } }
bart314/tweedekamer
data/Uitspraak.java
3,047
package core; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; class BFME2 { static String buildLanguage(String language) { String languagePath = null; switch (language) { case "Deutsch": languagePath = "/Meine Die Schlacht um Mittelerde™ II-Dateien"; break; case "English": languagePath = "/My Battle for Middle-earth(tm) II Files"; break; case "Español": languagePath = "/Mis archivos de La Batalla por la Tierra Media™ II"; break; case "Français": languagePath = "/La Bataille pour la Terre du Milieu ™ II"; break; case "Italiano": languagePath = "/File de La Battaglia per la Terra di Mezzo™ II"; break; case "Nederlands": languagePath = "/Mijn Battle for Middle-earth™ II-bestanden"; break; case "Norsk": languagePath = "/Mine Kampen om Midgard™ II-filer"; break; case "Polski": languagePath = "/Moje pliki Bitwy o Śródziemie™ II"; break; case "Svenska": languagePath = "/Mina Slaget om Midgård™ II-filer"; break; } return languagePath; } static void createOptions(String fullPath, String resolution) throws FileNotFoundException, UnsupportedEncodingException { PrintWriter writer = new PrintWriter(fullPath + "\\Options.ini", "UTF-8"); writer.println("AllHealthBars = yes"); writer.println("AmbientVolume = 50.000000"); writer.println("AudioLOD = Low"); writer.println("Brightness = 50"); writer.println("FlashTutorial = 0"); writer.println("GameSpyIPAddress = 0"); writer.println("HasSeenLogoMovies = yes"); writer.println("IdealStaticGameLOD = Low"); writer.println("MovieVolume = 70.000000"); writer.println("MusicVolume = 70.000000"); writer.println("Resolution = " + resolution); writer.println("SFXVolume = 70.000000"); writer.println("ScrollFactor = 50"); writer.println("SendDelay = no"); writer.println("StaticGameLOD = Low"); writer.println("TimesInGame = 152"); writer.println("UseEAX3 = no"); writer.println("VoiceVolume = 70.000000"); writer.close(); } }
jcoester/bfme-resfix
src/core/BFME2.java
3,048
public class challenge1 { public static void main(String[] args) { String name = "Rein"; int age = 36; System.out.println("Hallo, mijn naam is " + name + " en ik ben " + age + " jaar awesome."); String firstName = "Rein"; String lastName = "Onlein"; int characters = firstName.length() + lastName.length(); System.out.println("The number of characters in my full name is " + characters); } }
reinonlein/wateengast
websites/java/challenge1.java
3,049
package armijn.vink.numberviewanimation; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; import armijn.vink.numberviewanimation.fonts.Roboto; public class NumberView extends View { private final Interpolator mInterpolator; private Paint mPaint; private final Path mPath; // Numbers currently shown. private int mCurrent = 0; private int mNext = 1; // Frame of transition between current and next frames. private int mFrame = 0; private float[][][] mPoints; private float[][][] mControlPoint1; private float[][][] mControlPoint2; private int textColor; private float strokeSize; private float viewSize; private String font; public NumberView(Context context, AttributeSet attrs) { super(context, attrs); init(attrs); setWillNotDraw(false); mInterpolator = new AccelerateDecelerateInterpolator(); // A new paint with the style as stroke. mPaint = new Paint(); Roboto roboto = new Roboto(textColor, strokeSize*3); mPoints = Roboto.getMpoints(); mControlPoint1 = Roboto.getMcontrolpoint1(); mControlPoint2 = Roboto.getMcontrolpoint2(); mPaint = roboto.getPaint(); if(font.equals("roboto_thin")){ mPaint.setStrokeWidth(strokeSize*3); }else if(font.equals("roboto_light")){ mPaint.setStrokeWidth(strokeSize*6); }else if(font.equals("roboto_regular")){ mPaint.setStrokeWidth(strokeSize*9); }else if(font.equals("roboto_medium")){ mPaint.setStrokeWidth(strokeSize*12); }else if(font.equals("roboto_bold")){ mPaint.setStrokeWidth(strokeSize*15); }else if(font.equals("roboto_black")){ mPaint.setStrokeWidth(strokeSize*18); } mPath = new Path(); } private void init(AttributeSet attrs) { TypedArray ta=getContext().obtainStyledAttributes(attrs, R.styleable.NumberViewAttr); //set custom attr try { textColor = ta.getColor(R.styleable.NumberViewAttr_android_textColor, Color.BLACK); strokeSize = ta.getDimensionPixelSize(R.styleable.NumberViewAttr_strokeSize, 5); viewSize = ta.getDimensionPixelSize(R.styleable.NumberViewAttr_viewSize, 250); font = ta.getString(R.styleable.NumberViewAttr_font); if(font == null){ font = "roboto_regular"; } viewSize = (viewSize/250); strokeSize = (viewSize); } finally { ta.recycle(); } } @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); // Frames 0, 1 is the first pause. // Frames 9, 10 is the last pause. // Constrain current frame to be between 0 and 6. final int currentFrame; if (mFrame < 2) { currentFrame = 0; } else if (mFrame > 8) { currentFrame = 6; } else { currentFrame = mFrame - 2; } // A factor of the difference between current // and next frame based on interpolation. // Only 6 frames are used between the transition. final float factor = mInterpolator.getInterpolation(currentFrame / 6.0f); // Reset the path. mPath.reset(); final float[][] current = mPoints[mCurrent]; final float[][] next = mPoints[mNext]; final float[][] curr1 = mControlPoint1[mCurrent]; final float[][] next1 = mControlPoint1[mNext]; final float[][] curr2 = mControlPoint2[mCurrent]; final float[][] next2 = mControlPoint2[mNext]; // First point. mPath.moveTo((current[0][0]*viewSize) + (((next[0][0]*viewSize) - (current[0][0]*viewSize)) * factor), (current[0][1]*viewSize) + (((next[0][1]*viewSize) - (current[0][1]*viewSize)) * factor)); // Rest of the points connected as bezier curve. for (int i = 1; i < 5; i++) { mPath.cubicTo((curr1[i-1][0]*viewSize) + (((next1[i-1][0]*viewSize) - (curr1[i-1][0]*viewSize)) * factor), (curr1[i-1][1]*viewSize) + (((next1[i-1][1]*viewSize) - (curr1[i-1][1]*viewSize)) * factor), (curr2[i-1][0]*viewSize) + (((next2[i-1][0]*viewSize) - (curr2[i-1][0]*viewSize)) * factor), (curr2[i-1][1]*viewSize) + (((next2[i-1][1]*viewSize) - (curr2[i-1][1]*viewSize)) * factor), (current[i][0]*viewSize) + (((next[i][0]*viewSize) - (current[i][0]*viewSize)) * factor), (current[i][1]*viewSize) + (((next[i][1]*viewSize) - (current[i][1]*viewSize)) * factor)); } // Draw the path. canvas.drawPath(mPath, mPaint); // Next frame. mFrame++; // Each number change has 10 frames. Reset. if (mFrame == 10) { // Reset to zerro. mFrame = 0; mCurrent = mNext; mNext++; // Reset to zerro. if (mNext == 10) { mNext = 0; } } // Callback for the next frame. postInvalidateDelayed(50); } }
Armijn/NumberViewAnimation
src/armijn/vink/numberviewanimation/NumberView.java
3,050
package plugins.forum; public class Alert { ForumModel model; public final String ERROR = "ERROR"; public final String SUCCESS = "SUCCESS"; public final String WARNING = "WARNING"; public final String LOGIN_FAILED = "LOGIN_FAILED"; public final String LOGIN_SUCCESS = "LOGIN_SUCCESS"; public final String ACCOUNT_NOT_ACTIVATED = "ACCOUNT_NOT_ACTIVATED"; public final String ACCOUNT_ALREADY_ACTIVATED = "ACCOUNT_ALREADY_ACTIVATED"; public final String NEW_TOPIC_SUCCESS = "NEW_TOPIC_SUCCESS"; public final String NEW_TOPIC_DUPLICATE = "NEW_TOPIC_DUPLICATE"; public final String REGISTRATION_SUCCESS = "REGISTRATION_SUCCESS"; public final String UPDATE_ACCOUNT_SUCCESS = "UPDATE_ACCOUNT_SUCCESS"; public final String EMAIL_FAILED = "EMAIL_FAILED"; public final String EMAIL_EXISTS = "EMAIL_EXISTS"; public final String RESEND_PASSWORD_SUCCESS = "RESEND_PASSWORD_SUCCESS"; public final String EMAIL_RESEND_FAILURE = "EMAIL_RESEND_FAILURE"; public final String FEEDBACK_SUCCESS = "FEEDBACK_SUCCESS"; public final String FEEDBACK_FAILED = "FEEDBACK_FAILED"; public final String PRODUCT_UNKNOWN = "PRODUCT_UNKNOWN"; public final String ERROR_MULTIPLE_PRODUCTS_SAME_NAME = "ERROR_MULTIPLE_PRODUCTS_SAME_NAME"; public final String CONSUMPTION_ADDED = "PRODUCT_ADDED"; public final String CONSUMPTIONS_REMOVED = "CONSUMPTIONS_REMOVED"; public final String AMOUNT_CHANGED = "AMOUNT_CHANGED"; public final String AMOUNT_CHANGED_ERROR_SELECTION_TOO_BIG = "AMOUNT_CHANGED_ERROR_SELECTION_TOO_BIG"; public final String CONSUMPTION_UPDATED_NO_AMOUNT_ERROR = "CONSUMPTION_UPDATED_NO_AMOUNT_ERROR"; public final String CONSUMPTION_NOT_UPDATED_EQUAL_AMOUNT_WARNING = "CONSUMPTION_NOT_UPDATED_EQUAL_AMOUNT_WARNING"; public final String DISH_REMOVED = "DISH_REMOVED"; public final String INGREDIENT_REMOVED = "INGREDIENT_REMOVED"; public final String INGREDIENT_ADDED = "INGREDIENT_ADDED"; public final String REMOVE_WEIGHTED_FOOD_FAILED = "REMOVE_WEIGHTED_FOOD_FAILED"; public final String WEIGHTED_FOOD_AMOUNT_UPDATED = "WEIGHTED_FOOD_AMOUNT_UPDATE"; public final String WEIGHTED_FOOD_AMOUNT_UPDATE_FAILED = "WEIGHTED_FOOD_AMOUNT_UPDATE_FAILED"; private boolean show = false; private int showCount = 0; // Unfortunately, Molgenis loads screen twice, // after which we remove the message private String type = ERROR; private String title = "Onbekende fout"; private String body = "Neem aub contact met ons op als deze fout zich blijft voordoen."; public Alert(ForumModel forumModel) { model = forumModel; } public void setMessageType(String type) { this.showCount = 0; if (WEIGHTED_FOOD_AMOUNT_UPDATE_FAILED.equals(type)) { this.type = ERROR; this.title = "Aangepassen hoeveelheid mislukt!"; this.body = ""; } else if (WEIGHTED_FOOD_AMOUNT_UPDATED.equals(type)) { this.type = SUCCESS; this.title = "Je hebt de hoeveelheid aangepast!"; this.body = ""; } else if (REMOVE_WEIGHTED_FOOD_FAILED.equals(type)) { this.type = ERROR; this.title = "Verwijderen mislukt!"; this.body = ""; } else if (INGREDIENT_ADDED.equals(type)) { this.type = SUCCESS; this.title = "Je hebt een ingredi&euml;nt toegevoegd!"; this.body = ""; } else if (INGREDIENT_REMOVED.equals(type)) { this.type = SUCCESS; this.title = "Je hebt een ingredi&euml;nt verwijderd!"; this.body = ""; } else if (DISH_REMOVED.equals(type)) { this.type = SUCCESS; this.title = "Je hebt een gerecht verwijderd!"; this.body = ""; } else if (CONSUMPTION_NOT_UPDATED_EQUAL_AMOUNT_WARNING.equals(type)) { this.type = WARNING; this.title = "Niets veranderd!"; this.body = "Je wilde de hoeveelheid aanpassen, maar hebt dat niet gedaan. Probeer het nog eens :-)"; } else if (CONSUMPTION_UPDATED_NO_AMOUNT_ERROR.equals(type)) { this.type = ERROR; this.title = "Aanpassen hoeveelheid mislukt!"; this.body = "Je hebt geen (juiste) hoeveelheid ingevuld bij Porties of Gewicht. Gebruik getallen zoals '1.2' of '1,2' of '100'."; } else if (AMOUNT_CHANGED.equals(type)) { this.type = SUCCESS; this.title = "Je hebt de hoeveelheid van je consumptie aangepast!"; this.body = ""; } else if (AMOUNT_CHANGED_ERROR_SELECTION_TOO_BIG.equals(type)) { this.type = ERROR; this.title = "Aanpassen hoeveelheid mislukt!"; this.body = "Je had meerdere consumpties tegelijk geselecteerd. Selecteer 1 consumptie en pas de hoeveelheid aan."; } else if (CONSUMPTIONS_REMOVED.equals(type)) { this.type = SUCCESS; this.title = "Consumptie verwijderd!"; this.body = ""; } else if (CONSUMPTION_ADDED.equals(type)) { this.type = SUCCESS; this.title = "Voeding toevoegen gelukt!"; this.body = ""; } else if (ERROR_MULTIPLE_PRODUCTS_SAME_NAME.equals(type)) { this.type = ERROR; this.title = "Voedingsaanduiding dubbelzinnig"; this.body = "Er zijn meerdere producten/gerechten bekend met dezelfde naam. Wij weten dus niet welke u bedoelt. Geef de producten/gerechten verschillende namen."; } else if (PRODUCT_UNKNOWN.equals(type)) { this.type = ERROR; this.title = "Voeding onbekend!"; this.body = "De voeding die u probeert op te slaan is onbekend. Probeer het nog eens."; } else if (FEEDBACK_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "Feedback verstuurd!"; this.body = ""; } else if (FEEDBACK_FAILED.equals(type)) { this.type = ERROR; this.title = "Feedback versturen mislukt!"; this.body = "Om onbekende oorzaak is het niet gelukt om je feedback te versturen."; } else if (UPDATE_ACCOUNT_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "Je hebt je gegevens bijgewerkt!"; this.body = ""; } else if (ACCOUNT_ALREADY_ACTIVATED.equals(type)) { this.type = ERROR; this.title = "Je account is al geactiveerd!"; this.body = "Log in met je e-mailadres en wachtwoord. Ben je je wachtwoord vergeten? Klik dan op 'toesturen', in de tekst onder de 'Log-in'-knop."; } else if (ACCOUNT_NOT_ACTIVATED.equals(type)) { this.type = ERROR; this.title = "Activeer eerst je account!"; this.body = "Inloggen is mislukt omdat je je account nog niet geactiveerd hebt.<BR><BR>Nadat je aanmelding hebben we je een email met een activatielink gestuurd. Klik eerst op die link!"; } else if (REGISTRATION_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "Je bent aangemeld!"; this.body = "We hebben je een email gestuurd met een activatielink.<BR><BR><I><B>Pas op!</B> Het kan zijn dat deze e-mail bij je 'ongewenste berichten' of 'spam' terecht gekomen is.</I>"; } else if (EMAIL_RESEND_FAILURE.equals(type)) { this.type = ERROR; this.title = "Mislukt!"; this.body = "Het lukte ons niet om je een email met je gegevens te sturen. Heb je het juiste e-mailadres ingevoerd?<BR><BR> Als deze problemen blijven aanhouden, vertel ons dan dat wij iets fout doen via 'Feedback' svp. Hartelijk dank!"; } else if (RESEND_PASSWORD_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "E-mail versturen gelukt!"; this.body = "We hebben je account uitgezet en je een email met een nieuwe activatielink gestuurd. Hiermee kun je inloggen. Daarna kun je je wachtwoord wijzigen via 'Mijn gegevens'."; } else if (EMAIL_EXISTS.equals(type)) { this.type = ERROR; this.title = "Dit e-mailadres betaat al!"; this.body = "We hebben je account uitgezet en je een email met een nieuwe activatielink gestuurd. Hiermee kun je inloggen. Daarna kun je je wachtwoord wijzigen via 'Mijn gegevens'."; } else if (EMAIL_FAILED.equals(type)) { this.type = ERROR; this.title = "Email sturen mislukt!"; this.body = "Gebruik een bestaand e-mailadres. Deed je dat al? Vertel ons dan dat wij iets fout doen via 'Feedback' svp. Hartelijk dank!"; } else if (LOGIN_FAILED.equals(type)) { this.type = ERROR; this.title = "Inloggen mislukt!"; this.body = "Controleer je e-mailadres en wachtwoord. Ben je je wachtwoord vergeten? Klik dan op 'toesturen', in de tekst onder de 'Log-in'-knop."; } else if (LOGIN_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "Je bent ingelogd!"; this.body = ""; } else if (NEW_TOPIC_SUCCESS.equals(type)) { this.type = SUCCESS; this.title = "U hebt een nieuw onderwerp geplaatst."; this.body = "Het staat bovenaan de lijst"; } else if (NEW_TOPIC_DUPLICATE.equals(type)) { this.type = ERROR; this.title = "Deze titel bestaat al!"; this.body = "Gaat het hier om een nieuw onderwerp? Pas dan je titel aan.<BR><BR> Gaat het hier niet om een nieuw onderwerp? Ga dan 'terug' en plaats je bericht bij de desbetreffende titel."; } else { this.title = "Onbekende fout"; this.body = "Neem aub contact met ons op als deze fout zich blijft voordoen."; } this.show = true; } public boolean show() { return this.show; } public boolean isError() { return ERROR.equals(this.type); } public boolean isSuccess() { return SUCCESS.equals(this.type); } public String getTitle() { return this.title; } /** * return body of alert AND set show to false * * @return */ public String getBody() { this.showCount++; if (2 == this.showCount) this.clear(); return this.body; } public void clear() { this.showCount = 0; this.show = false; } }
molgenis/molgenis-app-autobetes
TODO/handwritten/java/plugins/forum/Alert.java
3,051
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Tuin { public static void main(String[] args) throws IOException { // Enter data using BufferReader BufferedReader reader = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Welkom in mijn tuin."); Sproeier slangetje = new Sproeier(); TuinDomotica slimmeSchakelaar = new TuinDomotica(); String input = ""; do { System.out.println("Regen installatie staat op"+ slimmeSchakelaar.getSlimmeschakelaar()); System.out.println("Regent het (JA/NEE)"); input = reader.readLine(); slimmeSchakelaar.setRegen(input.equalsIgnoreCase("JA")); System.out.print("Wilt u stoppen (JA/NEE)"); input = reader.readLine(); } while (!input.equalsIgnoreCase("JA")); System.out.println(slangetje.getHoseBrand()); } }
AVANS-SWEN2/tuinieren-wk1-tuinieren-anas-daan
Tuin.java
3,052
package model; public class Student { private String gebruikersNaam; private String wachtwoord; private Klas mijnKlas; private String studentNummer; private String voornaam; private String tussenvoegsel; private String achternaam; public Student(String gbNm, String ww) { gebruikersNaam = gbNm; wachtwoord = ww; } public void setVoornaam(String vN) { voornaam = vN; } public String getVoornaam() { return voornaam; } public void setTussenvoegsel(String tsv) { tussenvoegsel = tsv; } public String getTussenvoegsel() { return tussenvoegsel; } public void setAchternaam(String aN) { achternaam = aN; } public String getAchternaam() { return achternaam; } public String getGebruikersNaam() { return gebruikersNaam; } public boolean controleerWachtwoord(String ww) { return ww.equals(wachtwoord); } public void setMijnKlas(Klas k) { mijnKlas = k; } public Klas getMijnKlas() { return mijnKlas; } public void setStudentNummer(String studNum) { studentNummer = studNum; } public String getStudentNummer() { return studentNummer; } @Override public boolean equals(Object obj) { boolean result = obj instanceof Student; Student stObj = (Student)obj; result = result && stObj.getGebruikersNaam().equals(gebruikersNaam); result = result && stObj.controleerWachtwoord(wachtwoord); result = result && stObj.getMijnKlas().equals(mijnKlas); result = result && stObj.getStudentNummer().equals(studentNummer); result = result && stObj.getVoornaam().equals(voornaam); result = result && stObj.getTussenvoegsel().equals(tussenvoegsel); result = result && stObj.getAchternaam().equals(achternaam); return result; } public String toString() { String naam = voornaam + " "; if(!tussenvoegsel.equals("")) naam += tussenvoegsel + " "; naam += achternaam; String result = naam + " - " + studentNummer + " - " + mijnKlas.getKlasCode(); return result; } }
Gundraub/PrIS
src/model/Student.java
3,053
package blackjackdomain; import java.awt.Dimension; import java.awt.Toolkit; public class BlackJackStatisch { private static final int BJKAARTSIZEX = 72; private static final int BJKAARTSIZEY = 96; private static final int BJRANDEN = 30; private static final int BJSCHERMX = 1024; private static final int BJSCHERMY = 768; private float BJREFACTORWAARDEX = 1.0F; private float BJREFACTORWAARDEY = 1.0F; public int KAARTSIZEX = 0; public int KAARTSIZEY = 0; public int RANDENX = 0; public int RANDENY = 0; public int SCHERMX = 0; public int SCHERMY = 0; public BlackJackStatisch(){ mijnInit(); } public void mijnInit(){ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); BJREFACTORWAARDEX = dim.width / 1024; BJREFACTORWAARDEY = dim.height / 768; KAARTSIZEX = (int)(BJKAARTSIZEX*BJREFACTORWAARDEX); KAARTSIZEY = (int)(BJKAARTSIZEY*BJREFACTORWAARDEY); RANDENX = (int)(BJRANDEN*BJREFACTORWAARDEX); RANDENY = (int)(BJRANDEN*BJREFACTORWAARDEY); SCHERMX = (int)(BJSCHERMX*BJREFACTORWAARDEX); SCHERMY = (int)(BJSCHERMY*BJREFACTORWAARDEY); } }
Mandiax/GameSuite
GameSuiteMain/src/blackjackdomain/BlackJackStatisch.java
3,054
package nl.zeesoft.zsds.dialogs.dutch; import nl.zeesoft.zsds.dialogs.StateAccuracyHandler; public class DutchStateAccuracyHandler extends StateAccuracyHandler { @Override protected String getExactly() { return "precies"; } @Override protected String getAbout() { return "ongeveer"; } @Override protected String getBusyResponse() { return "Ik kan op dit moment mijn test resultaten niet verkrijgen."; } @Override protected String getJsonRequestFailedResponse() { return "Het is me niet gelukt mijn test resultaten te verkrijgen."; } @Override protected String getAccuracyIncreasedResponse() { return "Mijn nauwkeurigheid is toegenomen ten opzichte van mijn base line."; } @Override protected String getAccuracyUnchangedResponse() { return "Mijn nauwkeurigheid is ongewijzigd ten opzichte van mijn base line."; } @Override protected String getAccuracyDecreasedResponse() { return "Mijn nauwkeurigheid is afgenomen ten opzichte van mijn base line."; } }
DyzLecticus/Zeesoft
V3.0/ZSDS/src/nl/zeesoft/zsds/dialogs/dutch/DutchStateAccuracyHandler.java
3,055
package blackjackdomain; import java.util.ArrayList; public class BlackJackGebruiker extends BlackJackSpeler{ int credits = 0; boolean heeftBlackJack = false; ArrayList <BlackJackKaart> hand = null; String naam = null; int inzet = 0; int score = 0; public BlackJackGebruiker (){ mijnInit(); } public void mijnInit(){ credits = 500; ArrayList <BlackJackKaart> hand = new ArrayList <BlackJackKaart> (); this.hand=hand; } public String getNaam(){ return naam; } public void setNaam(String naam){ this.naam = naam; } public int getCredits() { return credits; } public void setCredits(int inzet) { credits = credits - inzet; } public int getInzet (){ return inzet; } public void setInzet(int inzet){ this.inzet = inzet; this.setCredits(inzet); } public boolean getHeeftBlackJack(){ return heeftBlackJack; } public void setHeeftBlackJack(){ heeftBlackJack = true; } public void setResetBlackJack(){ heeftBlackJack = false; } public int getScore(){ return score; } public void setScore(int punten){ score = punten; } public void addKAART (BlackJackKaart kaart){ hand.add(kaart); } public BlackJackKaart getKAART (int index){ hand.get(index); return (hand.get(index)); } public void clearHand (){ hand.clear(); } public int handLengte(){ return hand.size(); } }
Mandiax/GameSuite
GameSuiteMain/src/blackjackdomain/BlackJackGebruiker.java
3,056
package nl.zeesoft.zsd.entity.complex.dutch; import nl.zeesoft.zdk.ZStringSymbolParser; import nl.zeesoft.zsd.BaseConfiguration; import nl.zeesoft.zsd.EntityValueTranslator; import nl.zeesoft.zsd.dialog.dialogs.GenericHandshake; import nl.zeesoft.zsd.entity.complex.ComplexObject; import nl.zeesoft.zsd.entity.complex.ComplexVariable; public class DutchName extends ComplexObject { @Override public String getLanguage() { return BaseConfiguration.LANG_NLD; } @Override public String getType() { return BaseConfiguration.TYPE_NAME; } @Override public double getMatchThreshold() { return 0.3D; } @Override public String getInternalValueForVariable(ComplexVariable var,String prefix,String value) { String r = ""; if (var.name.equals(GenericHandshake.VARIABLE_FIRSTNAME) || var.name.equals(GenericHandshake.VARIABLE_LASTNAME)) { r = value.substring(0,1).toUpperCase() + value.substring(1); r = super.getInternalValueForVariable(var,prefix,r); } else { r = super.getInternalValueForVariable(var,prefix,value); } return r; } @Override public void initialize(EntityValueTranslator translator) { addVariable(GenericHandshake.VARIABLE_FIRSTNAME,BaseConfiguration.TYPE_ALPHABETIC); addVariable(GenericHandshake.VARIABLE_PREPOSITION,BaseConfiguration.TYPE_PREPOSITION); addVariable(GenericHandshake.VARIABLE_LASTNAME,BaseConfiguration.TYPE_ALPHABETIC); addGenericPatterns("{firstName} {preposition} {lastName}"); addGenericPatterns("{firstName} {lastName}"); addGenericPatterns("{firstName}"); addSpecificPatterns("voornaam", "{firstName}"); addSpecificPatterns("achternaam", "{preposition} {lastName}"); addSpecificPatterns("achternaam", "{lastName}"); super.initialize(translator); } private void addGenericPatterns(String variables) { addPattern(new ZStringSymbolParser("Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Ik heet " + variables + "."),""); addPattern(new ZStringSymbolParser("Ik ben " + variables + "."),""); addPattern(new ZStringSymbolParser("Hoe heet je? " + variables + "."),""); addPattern(new ZStringSymbolParser("Hoe heet jij? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie ben jij? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie bent u? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is je naam? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is jouw naam? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is uw naam? " + variables + "."),""); addPattern(new ZStringSymbolParser("Hoe heet je? Ik heet " + variables + "."),""); addPattern(new ZStringSymbolParser("Hoe heet jij? Ik heet " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie ben jij? Ik ben " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie bent u? Ik ben " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is je naam? Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is jouw naam? Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is uw naam? Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie ben jij? Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie bent u? Mijn naam is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie ben jij? Ik heet " + variables + "."),""); addPattern(new ZStringSymbolParser("Wie bent u? Ik heet " + variables + "."),""); addPattern(new ZStringSymbolParser(variables + " is mijn naam."),""); addPattern(new ZStringSymbolParser(variables + " heet ik."),""); addPattern(new ZStringSymbolParser(variables + " ben ik."),""); } private void addSpecificPatterns(String name, String variables) { addPattern(new ZStringSymbolParser("Wat is je " + name + "? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is jouw " + name + "? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is uw " + name + "? " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is je " + name + "? Mijn " + name + " is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is jouw " + name + "? Mijn " + name + " is " + variables + "."),""); addPattern(new ZStringSymbolParser("Wat is uw " + name + "? Mijn " + name + " is " + variables + "."),""); addPattern(new ZStringSymbolParser(variables + " is mijn " + name + "."),""); } }
DyzLecticus/Zeesoft
V3.0/ZSD/src/nl/zeesoft/zsd/entity/complex/dutch/DutchName.java
3,057
package Zeeslag; import java.util.Arrays; import java.util.List; /** * Ship class */ public class Ship { private static final List<String> SHIP_TYPES = Arrays.asList("Patrouilleschip", "Mijnenjager", "Slagschip", "Vliegdekschip"); public static final String PATROUILLESCHIP = "Patrouilleschip"; public static final String MIJNENJAGER = "Mijnenjager"; public static final String SLAGSCHIP = "Slagschip"; public static final String VLIEGDEKSCHIP = "Vliegdekschip"; private String type; private int length; private String representation; // Representation of the ship (first letter of the type) //---------------------------CONSTRUCTOR------------------------------------ /** * Constructor for the ship class * @param type * @throws ShipNotAvailableException */ public Ship(String type) throws ShipNotAvailableException { if (SHIP_TYPES.contains(type)) { this.type = type; this.length = calculateLength(type); this.representation = String.valueOf(type.charAt(0)); // Get the first letter of the type } else { throw new ShipNotAvailableException("Invalid ship type: " + type); } } //---------------------------GETTERS------------------------------------ public String getType() { return type; } public int getLength() { return length; } public String getRepresentation() { return representation; } //---------------------------METHODS------------------------------------ /** * Calculate the length of the ship based on the type * @param type * @return */ private int calculateLength(String type) { // You can define the lengths for each ship type as needed switch (type) { case "Patrouilleschip": return 2; case "Mijnenjager": return 3; case "Slagschip": return 4; case "Vliegdekschip": return 6; default: return 0; // or throw an exception for unknown ship types } } //-------------------------------OVERRIDES-------------------------------- @Override public String toString() { return this.type + " (" + this.representation + ")"; } }
coolstavo/ISY-Carioca-ITVC2S1
Zeeslag/Ship.java
3,058
package nl.haroid.webclient; import nl.haroid.common.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author Ruud de Jong */ public final class HaringHnImpl extends AbstractHaring { private static final Logger LOGGER = LoggerFactory.getLogger(HaringHnImpl.class); private static final String HOST = "www.hollandsnieuwe.nl"; private static final String RELATIVE_URL_START = "/mijn_hollandsnieuwe"; private static final String RELATIVE_URL_VERBRUIK = "/myaccount/subscriptionPurchaseCurrentUsageDataFeed.jsp?index=0&status=ACTIVE&profileId="; @Override protected String getHost() { return HOST; } @Override protected String getRelativeStartUrl() { return RELATIVE_URL_START; } @Override protected String getRelativeVerbruikUrl() { return RELATIVE_URL_VERBRUIK; } @Override protected String vindTegoed(String body) { String tegoedIndicator = "minuten"; String tegoedBedrag = Utils.substringBetween(body, "<span class=\"usage\"><span class=\"amount\">", "</span>"); String[] strongList = Utils.substringsBetween(body, "<strong>", "</strong>"); String tegoed = null; if (strongList != null) { for (String strongItem : strongList) { if (Utils.contains(strongItem, tegoedIndicator)) { LOGGER.debug("Gevonden strongItem: " + strongItem); String filterItem = Utils.deleteWhitespace(strongItem); tegoed = Utils.substringBefore(filterItem, tegoedIndicator); } } } LOGGER.info("Gevonden tegoed bedrag: " + tegoedBedrag); return tegoed; } }
biker-ruud/haroid
core/src/main/java/nl/haroid/webclient/HaringHnImpl.java
3,059
/* * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is "Simplenlg". * * The Initial Developer of the Original Code is Ehud Reiter, Albert Gatt and Dave Westwater. * Portions created by Ehud Reiter, Albert Gatt and Dave Westwater are Copyright (C) 2010-11 The University of Aberdeen. All Rights Reserved. * * Contributor(s): Ehud Reiter, Albert Gatt, Dave Wewstwater, Roman Kutlak, Margaret Mitchell, Pierre-Luc Vaudry. */ package simplenlg.features.dutch; /** * <p> * An enumeration representing the types of pronoun. The pronoun type is recorded * in the {@code DutchLexicalFeature.PRONOUN_TYPE} feature and applies to pronouns. * </p> * * @author vaudrypl, rfdj * */ public enum PronounType { /** * Personal pronoun. For example, <em>hij</em>. */ PERSONAL, /** * Special personal pronoun. For example, <em>er</em>. * These personal pronouns have special behaviors. */ SPECIAL_PERSONAL, /** * Numeral pronoun. For example, <em>twee</em>. */ NUMERAL, /** * Possessive pronoun. For example, <em>mijn</em>. */ POSSESSIVE, /** * Demonstrative pronoun. For example, <em>dit</em>. */ DEMONSTRATIVE, /** * Relative pronoun. For example, <em>die</em>. */ RELATIVE, /** * Interrogative pronoun. For example, <em>wie</em>. */ INTERROGATIVE, /** * Indefinite pronoun. For example, <em>alle</em>. */ INDEFINITE, /** * Reflexive pronoun. In Dutch: <em>zich</em>. */ REFLEXIVE; }
rfdj/SimpleNLG-NL
src/main/java/simplenlg/features/dutch/PronounType.java
3,060
package repairshop; import java.sql.SQLOutput; import java.util.ArrayList; import java.io.Serializable; public class Klant implements Serializable{ private static final long serialVersionUID = 1L; private String naam; private String voornaam; private String telefoon; private String email; private ArrayList<Item> mijnItems = new ArrayList<>(); public Klant(String naam, String voornaam, String telefoon, String email) { this.naam = naam; this.voornaam = voornaam; this.telefoon = telefoon; this.email = email; } public double kortingscoupon(Item i){ double korting = 0; if (i.getPrijsReparatie()>50){ korting = i.getPrijsReparatie()*0.95; } else if (i.getPrijsReparatie()>=100){ korting=i.getPrijsReparatie()*0.90; } else { System.out.println("sorry je betaalt te weinig geen korting"); korting=i.getPrijsReparatie(); } return korting; } public void addItem(Item i) { mijnItems.add(i); } public void showItems() { System.out.println(mijnItems); } public ArrayList<Item> searchItem(String status) { ArrayList<Item> foundItems = new ArrayList<>(); int teller=0; for (Item mijnItem : mijnItems) { if (mijnItem.getStatus() == status) { teller++; foundItems.add(mijnItem); } } if (teller==0){ System.out.println("sorry niks gevonden"); } else { System.out.println(teller+ " items gevonden"); } return foundItems; } public void betaling(Item i){ double betaalprijs = i.getPrijsReparatie(); double btw = 0.21; betaalprijs+= betaalprijs*btw; System.out.println("de prijs die je ga moeten betalen bij afhaling bedraagt "+betaalprijs+"$"); } public String getNaam() { return naam; } public void setNaam(String naam) { this.naam = naam; } public String getVoornaam() { return voornaam; } public void setVoornaam(String voornaam) { this.voornaam = voornaam; } public String getTelefoon() { return telefoon; } public void setTelefoon(String telefoon) { this.telefoon = telefoon; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public ArrayList<Item> getMijnItems() { return mijnItems; } public void setMijnItems(ArrayList<Item> mijnItems) { this.mijnItems = mijnItems; } @Override public String toString() { return "Naam:" + naam + "\nVoornaam: " + voornaam + "\nTelefoon: " + telefoon + "\nEmail: " + email + "\nItems:" + mijnItems; } }
kristofmoons/repairshop
src/repairshop/Klant.java
3,061
package QienApp.qien.controller; import QienApp.qien.domein.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class MailService { @Autowired GebruikerRepository<Gebruiker> gebruikerRepository; @Autowired EmailCfg emailCfg; //@Autowired //EmailBericht emailBericht; public void mailVersturen(long contactpersoonId, long urendeclaratieId){ Optional<Gebruiker> contactpersoon = gebruikerRepository.findById(contactpersoonId); Gebruiker b = contactpersoon.orElse(null); // Create a mail sender JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); mailSender.setHost(this.emailCfg.getHost()); mailSender.setPort(this.emailCfg.getPort()); mailSender.setUsername(this.emailCfg.getUsername()); mailSender.setPassword(this.emailCfg.getPassword()); // Create an email instance SimpleMailMessage mailMessage = new SimpleMailMessage(); mailMessage.setFrom("[email protected]"); mailMessage.setTo(b.getEmail()); mailMessage.setSubject("Goedkeuring vereist voor Qien trainee"); mailMessage.setText( "Beste " + b.getVoornaam() + " " + b.getAchternaam() + "," + "\n\n" + "Ik heb mijn uren ingevuld. Dit is inzichtelijk via deze link: " + "https://qienurenapp.brandlift.nl/landing.html" + urendeclaratieId + "Wil je dit controleren en vervolgens accorderen." + "\n\n" + "Alvast bedankt en een mooie werkdag!\n\n" + "Groet," + "\n\n" + "Qien" ); // Send mail mailSender.send(mailMessage); System.out.println("Mail sent"); } }
dhs02/QienApp
src/main/java/QienApp/qien/controller/MailService.java
3,062
import java.util.ArrayList; public class Persoon { private String naam; private double budget; private ArrayList<Game> mijnGames; public Persoon(String naam, double budget) { this.naam = naam; this.budget = budget; this.mijnGames = new ArrayList<Game>(); } public double getBudget() { return budget; } //koop(g), maar dat kan alleen als hij voldoende budget heeft en als hij die game nog niet bezit public boolean koop(Game g) { if (getBudget() >= g.huidigeWaarde()) { if (mijnGames.contains(g)) { return false; } else { mijnGames.add(g); budget = budget - g.huidigeWaarde(); return true; } } return false; } //verkoop(g, koper), maar alleen als hij die game zelf heeft, // als de koper de game nog niet heeft en als de koper voldoende budget heeft! public boolean verkoop(Game g, Persoon koper) { if (!mijnGames.contains(g)) { return false; } else { if (koper.koop(g)) { mijnGames.remove(g); budget = budget + g.huidigeWaarde(); return true; }else{ return false; }}} // Toevoeging Leon voor Practicum 6B public ArrayList<Game> bepaalGamesNietInBezit(ArrayList<Game> arrayOfGames){ ArrayList<Game> resultingGames = new ArrayList<>(); for (int i = 0; i < arrayOfGames.size(); i++){ if (!mijnGames.contains(arrayOfGames.get(i))){ resultingGames.add(arrayOfGames.get(i)); } } return resultingGames; } //Einde toevoeging Leon public String toString() { String txt = ""; int Count = this.mijnGames.size(); for (Game game : this.mijnGames) { if (Count > 1) { txt += game.toString() + "\n"; Count = Count - 1; } else { txt += game.toString(); } } if (mijnGames.size() == 0) { return (naam + " heeft een budget van €" + String.format("%.2f", budget) + " en bezit de volgende games:"); } else return (naam + " heeft een budget van €" + String.format("%.2f", budget) + " en bezit de volgende games:\n" + txt); } public Game zoekGameOpNaam(String input) { for (Game g : this.mijnGames) { if (g.getNaam().equals(input)) { return (g); } } return null; } }
LegendWolf-Dev/Practicum6
src/Persoon.java
3,063
/** * LanguageTool, a natural language style checker * Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ package org.languagetool.tokenizers.nl; import org.junit.Test; import org.languagetool.language.Dutch; import org.languagetool.tokenizers.SRXSentenceTokenizer; /** * * * @author Daniel Naber * @author Adapted by R. Baars for Dutch * @author Pander OpenTaal added examples from Wikipedia and Taaladvies */ public class DutchSRXSentenceTokenizerTest { private final SRXSentenceTokenizer stokenizer = new SRXSentenceTokenizer(new Dutch()); @Test public void testTokenize() { // NOTE: sentences here need to end with a space character so they // have correct whitespace when appended: testSplit("Dit is een zin."); testSplit("Dit is een zin. ", "Nog een."); testSplit("Een zin! ", "Nog een."); testSplit("Een zin... ", "Nog een."); testSplit("Op http://www.test.de vind je een website."); testSplit("De brief is op 3-10 gedateerd."); testSplit("De brief is op 31-1 gedateerd."); testSplit("De breif is op 3-10-2000 gedateerd."); testSplit("Vandaag is het 13-12-2004."); testSplit("Op 24.09 begint het."); testSplit("Om 17:00 begint het."); testSplit("In paragraaf 3.9.1 is dat beschreven."); testSplit("Januari jl. is dat vastgelegd."); testSplit("Appel en pruimen enz. werden gekocht."); testSplit("De afkorting n.v.t. betekent niet van toepassing."); testSplit("Bla et al. blah blah."); testSplit("Dat is,, of het is bla."); testSplit("Dat is het.. ", "Zo gaat het verder."); testSplit("Dit hier is een(!) zin."); testSplit("Dit hier is een(!!) zin."); testSplit("Dit hier is een(?) zin."); testSplit("Dit hier is een(???) zin."); testSplit("Dit hier is een(???) zin."); testSplit("Als voetballer wordt hij nooit een prof. ", "Maar prof. N.A.W. Th.Ch. Janssen wordt dat wel."); // TODO, zin na dubbele punt testSplit("Dat was het: helemaal niets."); testSplit("Dat was het: het is een nieuwe zin."); // https://nl.wikipedia.org/wiki/Aanhalingsteken testSplit("Jan zei: \"Hallo.\""); testSplit("Jan zei: ?Hallo.?"); testSplit("?Hallo,? zei Jan, ?waar ga je naartoe??"); testSplit("?Gisteren?, zei Jan, ?was het veel beter weer.?"); testSplit("Jan zei: ?Annette zei ?Hallo?.?"); testSplit("Jan zei: ?Annette zei ?Hallo?.?"); testSplit("Jan zei: ?Annette zei ?Hallo?.?"); testSplit("Wegens zijn ?ziekte? hoefde hij niet te werken."); testSplit("de letter ?a?"); testSplit("het woord ?beta? is afkomstig van ..."); // http://taaladvies.net/taal/advies/vraag/11 testSplit("De voorzitter zei: 'Ik zie hier geen been in.'"); testSplit("De voorzitter zei: \"Ik zie hier geen been in.\""); testSplit("De koning zei: \"Ik herinner me nog dat iemand \'Vive la r\u00e9publique\' riep tijdens mijn eedaflegging.\""); testSplit("De koning zei: \'Ik herinner me nog dat iemand \"Vive la r\u00e9publique\" riep tijdens mijn eedaflegging.\'"); testSplit("De koning zei: 'Ik herinner me nog dat iemand 'Vive la r?publique' riep tijdens mijn eedaflegging.'"); testSplit("Otto dacht: wat een nare verhalen hoor je toch tegenwoordig."); // http://taaladvies.net/taal/advies/vraag/871 testSplit("'Ik vrees', zei Rob, 'dat de brug zal instorten.'"); testSplit("'Ieder land', aldus minister Powell, 'moet rekenschap afleggen over de wijze waarop het zijn burgers behandelt.'"); testSplit("'Zeg Rob,' vroeg Jolanda, 'denk jij dat de brug zal instorten?'"); testSplit("'Deze man heeft er niets mee te maken,' aldus korpschef Jan de Vries, 'maar hij heeft momenteel geen leven.'"); testSplit("'Ik vrees,' zei Rob, 'dat de brug zal instorten.'"); testSplit("'Ieder land,' aldus minister Powell, 'moet rekenschap afleggen over de wijze waarop het zijn burgers behandelt.'"); testSplit("'Zeg Rob,' vroeg Jolanda, 'denk jij dat de brug zal instorten?'"); testSplit("'Deze man heeft er niets mee te maken,' aldus korpschef Jan de Vries, 'maar hij heeft momenteel geen leven.'"); // http://taaladvies.net/taal/advies/vraag/872 testSplit("Zij antwoordde: 'Ik denk niet dat ik nog langer met je om wil gaan.'"); testSplit("Zij fluisterde iets van 'eeuwig trouw' en 'altijd blijven houden van'."); testSplit("'Heb je dat boek al gelezen?', vroeg hij."); testSplit("De auteur vermeldt: 'Deze opvatting van het vorstendom heeft lang doorgewerkt.'"); // http://taaladvies.net/taal/advies/vraag/1557 testSplit("'Gaat u zitten', zei zij. ", "'De dokter komt zo.'"); testSplit("'Mijn broer woont ook in Den Haag', vertelde ze. ", "'Hij woont al een paar jaar samen.'"); testSplit("'Je bent grappig', zei ze. ", "'Echt, ik vind je grappig.'"); testSplit("'Is Jan thuis?', vroeg Piet. ", "'Ik wil hem wat vragen.'"); testSplit("'Ik denk er niet over!', riep ze. ", "'Dat gaat echt te ver, hoor!'"); testSplit("'Ik vermoed', zei Piet, 'dat Jan al wel thuis is.'"); } }
STAMP-project/dspot-experiments
benchmark/validation/org/languagetool/tokenizers/nl/DutchSRXSentenceTokenizerTest.java
3,064
/* * SPDX-FileCopyrightText: 2022 Atos * SPDX-License-Identifier: EUPL-1.2+ */ package net.atos.zac.gebruikersvoorkeuren.model; public enum Werklijst { WERKVOORRAAD_ZAKEN, WERKVOORRAAD_TAKEN, MIJN_ZAKEN, MIJN_TAKEN, AFGEHANDELDE_ZAKEN, INBOX_DOCUMENTEN, ONTKOPPELDE_DOCUMENTEN, INBOX_PRODUCTAANVRAGEN, }
infonl/dimpact-zaakafhandelcomponent
src/main/java/net/atos/zac/gebruikersvoorkeuren/model/Werklijst.java
3,065
package nl.zeesoft.zsd.dialog.dialogs.dutch; import nl.zeesoft.zsd.BaseConfiguration; import nl.zeesoft.zsd.EntityValueTranslator; import nl.zeesoft.zsd.dialog.dialogs.GenericHandshake; public class DutchGenericHandshake extends GenericHandshake { private static final String EXAMPLE_OUTPUT = "Mijn naam is {selfName}."; public DutchGenericHandshake() { setLanguage(BaseConfiguration.LANG_NLD); } @Override public void initialize(EntityValueTranslator t) { addExample("Hallo.","Hallo. " + getOutput()); addExample("Hallo!","Hallo. " + getOutput()); addExample("Hoi.","Hoi. " + getOutput()); addExample("Hoi!","Hoi. " + getOutput()); addExample("Goedemorgen.","Goedemorgen. " + getOutput()); addExample("Goedemorgen!","Goedemorgen. " + getOutput()); addExample("Goedemiddag.","Goedemiddag. " + getOutput()); addExample("Goedemiddag!","Goedemiddag. " + getOutput()); addExample("Goedenavond.","Goedenavond. " + getOutput()); addExample("Goedenavond!","Goedenavond. " + getOutput()); addExample("Wie bent u?",getOutput()); addExample("Hoe heet u?",getOutput()); addExample("Wat is uw naam?",getOutput()); addExample("Wie ben jij?",getOutput()); addExample("Hoe heet jij?",getOutput()); addExample("Hoe heet je?",getOutput()); addExample("Wat is jouw naam?",getOutput()); addExample("Wat is je naam?",getOutput()); addVariable(VARIABLE_FIRSTNAME,BaseConfiguration.TYPE_ALPHABETIC,VARIABLE_FIRSTNAME,BaseConfiguration.TYPE_NAME); addVariablePrompt(VARIABLE_FIRSTNAME,"Wat is uw naam?"); addVariablePrompt(VARIABLE_FIRSTNAME,"Wat is uw voornaam?"); addVariable(VARIABLE_LASTNAME,BaseConfiguration.TYPE_ALPHABETIC,VARIABLE_LASTNAME,BaseConfiguration.TYPE_NAME); addVariablePrompt(VARIABLE_LASTNAME,"Wat is uw achternaam?"); addNextDialogVariable(); addVariablePrompt(VARIABLE_NEXT_DIALOG,"Wat kan ik voor u doen {fullName}?"); addVariablePrompt(VARIABLE_NEXT_DIALOG,"Hoe kan ik u helpen {fullName}?"); addVariable(VARIABLE_PREPOSITION,BaseConfiguration.TYPE_PREPOSITION,VARIABLE_PREPOSITION,BaseConfiguration.TYPE_NAME); addComplexPatterns(t,BaseConfiguration.TYPE_NAME); } protected String getOutput() { return EXAMPLE_OUTPUT; } }
DyzLecticus/Zeesoft
V3.0/ZSD/src/nl/zeesoft/zsd/dialog/dialogs/dutch/DutchGenericHandshake.java
3,066
package core; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; class BFME3 { static String buildLanguage(String language) { String languagePath = null; switch (language) { case "Deutsch": languagePath = "/Meine Der Herr der Ringe™, Aufstieg des Hexenkönigs™-Dateien"; break; case "English": languagePath = "/My The Lord of the Rings, The Rise of the Witch-king Files"; break; case "Español": languagePath = "/Mis archivos de El Señor de los Anillos, El Resurgir del Rey Brujo"; break; case "Français": languagePath = "/Mes fichiers de LSDA, L'Avènement du Roi-sorcier™"; break; case "Italiano": languagePath = "/File de Il Signore degli Anelli™ - L'Ascesa del Re Stregone™"; break; case "Nederlands": languagePath = "/Mijn The Lord of the Rings, The Rise of the Witch-king-bestanden"; break; case "Norsk": languagePath = "/Mine Ringenes Herre - Heksekongen-filer"; break; case "Polski": languagePath = "/Moje pliki gry Władca Pierścieni, Król Nazguli"; break; case "Russian": languagePath = "/Властелин Колец, Под знаменем Короля-чародея - Мои файлы"; break; case "Svenska": languagePath = "/Mina Ringarnas herre™ - Häxkungens tid™-filer"; break; } return languagePath; } static void createOptions(String fullPath, String resolution) throws FileNotFoundException, UnsupportedEncodingException { PrintWriter writer = new PrintWriter(fullPath + "\\Options.ini", "UTF-8"); writer.println("AllHealthBars = yes"); writer.println("AmbientVolume = 50.000000"); writer.println("AudioLOD = Low"); writer.println("Brightness = 50"); writer.println("FlashTutorial = 0"); writer.println("GameSpyIPAddress = 0"); writer.println("HasSeenLogoMovies = yes"); writer.println("IdealStaticGameLOD = VeryLow"); writer.println("MovieVolume = 70.000000"); writer.println("MusicVolume = 70.000000"); writer.println("Resolution = " + resolution); writer.println("SFXVolume = 70.000000"); writer.println("ScrollFactor = 50"); writer.println("SendDelay = no"); writer.println("StaticGameLOD = VeryLow"); writer.println("TimesInGame = 106"); writer.println("UseEAX3 = no"); writer.println("VoiceVolume = 70.000000"); writer.close(); } }
jcoester/bfme-resfix
src/core/BFME3.java
3,067
import java.util.Scanner; /** @author Elias De Hondt * 30/09/2022 */ public class Oefening1 { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String nogis = "ja"; // Dit is een while dat runt alt nogis == ja en of Ja of ... while (nogis.toLowerCase().equals("ja")) { // Hier worden een paar variabelen gedefinieerd. int aantalGebruikers = 0; int percentageExtreme = 0; int extreme = 0; int totaalVraag = 0; // Wat is je naam. System.out.print("Wat is je naam? "); String naam = keyboard.nextLine(); // Vraag 1. System.out.print("Het laatste wat ik doe -voor ’s avonds het licht uit gaat- is nog snel even kijken of er nog iets aan berichten, enz is binnengekomen op mijn smartphone.\n(Ja/Nee) "); String vraag1 = keyboard.nextLine(); if (vraag1.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 2. System.out.print("Het eerste wat ik doe -al ’s morgens het licht aangaat- is kijken of er berichten, enz zijn Het eerste wat ik doe -al ’s morgens het licht aangaat- is kijken of er berichten, enz zijn.\n(Ja/Nee) "); String vraag2 = keyboard.nextLine(); if (vraag2.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 3. System.out.print("Ik heb notificaties (die een geluidje/of een trilbeweging maken) geactiveerd op mijn smartphone.\n(Ja/Nee) "); String vraag3 = keyboard.nextLine(); if (vraag3.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 4. System.out.print("Wanneer ik merk dat er een notificatie op mijn smartphone is binnen gekomen, kijk ik binnen de minuut op mijn smartphone wat het precies is.\n(Ja/Nee) "); String vraag4 = keyboard.nextLine(); if (vraag4.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 5. System.out.print("Terwijl is naar een tv-reeks of film kijk op TV of computerscherm, gebruik ik één of meerdere keren mijn smartphone.\n(Ja/Nee) "); String vraag5 = keyboard.nextLine(); if (vraag5.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 6. System.out.print("Als ik alleen eet (ontbijt/lunch/diner) gebruik ik meermaals mijn smartphone tijdens de maaltijd.\n(Ja/Nee) "); String vraag6 = keyboard.nextLine(); if (vraag6.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 7. System.out.print("Als ik in gezelschap -familie, vrienden,… eet (ontbijt/lunch/diner) gebruik ik meermaals mijn smartphone tijdens de maaltijd.\n(Ja/Nee) "); String vraag7 = keyboard.nextLine(); if (vraag7.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 8. System.out.print("Als in -alleen- op straat loop doe ik dat met mijn smartphone in de hand en kijk ik geregeld naar het scherm.\n(Ja/Nee) "); String vraag8 = keyboard.nextLine(); if (vraag8.toLowerCase().equals("ja")) { totaalVraag += 1; } // Vraag 9. System.out.print("Als ik fiets of met de auto rij, durf ik wel eens de smartphone in de hand te nemen en naar het scherm te kijken.\n(Ja/Nee) "); String vraag9 = keyboard.nextLine(); if (vraag9.toLowerCase().equals("ja")) { totaalVraag += 1; } // Resultaat 1. if (totaalVraag == 0) { System.out.println("Je bent niet digitaal verslaafd " + naam + ". Houden zo!"); } // Resultaat 2. if (totaalVraag == 1 || totaalVraag == 2) { System.out.println("Je hebt een milde vorm van digitale verslaving " + naam + "."); } // Resultaat 3. if (totaalVraag == 3 || totaalVraag == 4 || totaalVraag == 5) { System.out.println("Je hebt een niet te onderschatten vorm van digitale verslaving " + naam + ". Leg jezelf wat beperkingen op"); } // Resultaat 4. if (totaalVraag == 6 || totaalVraag == 7 || totaalVraag == 8) { System.out.println("Je hebt een ernstige vorm van digitale verslaving " + naam + ". Overweeg om een digitale detox-cursus te volgen!"); // Teller. ++extreme; } // Resultaat 5. if (totaalVraag == 9 || totaalVraag == 10) { System.out.println("Je hebt een extreme vorm van digitale verslaving " + naam + ". Je hebt waarschijnlijk professionele hulp nodig!"); // Hier staat nog een vraag voor ernstige digitale verslaving. System.out.print("Hoeveel uur per dag zit je op je smartphone? "); int uurPerDagAantal = keyboard.nextInt(); System.out.println("==========================================================================="); double percentageVanEenDag = 100 / 24; double percentageErnstige = uurPerDagAantal * percentageVanEenDag; if (percentageErnstige >= 80) { System.out.println("Je spendeert " + percentageErnstige + "% van de dag aan je smartphone.\n Jouw verslaving vormt een gevaar voor jezelf en jouw omgeving. Zoek zo snel mogelijk hulp!!"); } if (percentageErnstige > 20 && percentageErnstige < 80) { System.out.println("Je spendeert " + percentageErnstige + "% van de dag aan je smartphone.\n Vreemd, ben je zeker dat je de enquête eerlijk ingevuld hebt? Wees eerlijk tegenover jezelf!"); } if (percentageErnstige <= 20) { System.out.println("'Je spendeert " + percentageErnstige + "% van de dag aan je smartphone.\n Vreemd, ben je zeker dat je de enquête eerlijk ingevuld hebt? Wees eerlijk tegenover jezelf!"); } // Teller. ++extreme; } keyboard.nextLine(); // Teller. ++aantalGebruikers; // Wat is het percentage van het aantal "extreme digitale verslaving". percentageExtreme = (extreme / aantalGebruikers) * 100; // Het overzichtsrapport. System.out.println("==========================================================================="); System.out.println("Deze enquête werd reeds door " + aantalGebruikers + " gebruikers ingevuld," + "\t\t\t\t\t\t =" ); System.out.println(percentageExtreme + "% hiervan had een ernstige of extreme vorm van digitale verslaving. \t ="); System.out.println("==========================================================================="); System.out.println("Dit waren de antwoorden op u vragen:\n" + "| Vraag 1 " + vraag1 + " | Vraag 2 " + vraag2 + " | Vraag 3 " + vraag3 + " |\n| Vraag 4 " + vraag4 + " | Vraag 5 " + vraag5 + " | Vraag 6 " + vraag6 + " |\n| Vraag 7 " + vraag7 + " | Vraag 8 " + vraag8 + " | Vraag 9 " + vraag9 + " |"); System.out.println("Je hebt in totaal " + totaalVraag + " keer \"ja\" beantwoord."); if (totaalVraag == 9 || totaalVraag == 10) { System.out.println(percentageExtreme + "van de dag zit je op je smartphone"); } System.out.println("==========================================================================="); System.out.print("Wil je de enquête nog is doen? (Ja/Nee) "); nogis = keyboard.nextLine(); } } }
EliasDeHondt/ComputerProgramming1-OOConcepts
W2P1/W2P1 Tutoring/src/Oefening1.java
3,068
package presentatie; import akka.actor.typed.ActorRef; import akka.actor.typed.ActorSystem; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.AbstractBehavior; import akka.actor.typed.javadsl.ActorContext; import akka.actor.typed.javadsl.Behaviors; import akka.actor.typed.javadsl.Receive; import java.time.Duration; import java.util.concurrent.TimeUnit; public class Marco extends AbstractBehavior<Marco.Bericht> { public interface Bericht {} private static class MarcoBegrijptReactieZo implements Bericht { public String string; public MarcoBegrijptReactieZo(String s) { this.string = s; } } public static Behavior<Marco.Bericht> create() { return Behaviors.setup(context -> new Marco(context)); } private boolean benalbezigOntvangen = false; public Marco(ActorContext<Bericht> context) { super(context); ActorRef<Bart.Bericht> bart = getContext().spawn(Bart.create(), "bartsNaam"); final Duration timeout = Duration.ofSeconds(10); getContext().getLog().info("Hey Bart, ik heb net Aurorus gerefactord kan je mijn code reviewen?"); context.ask( Bart.isKlaarMetCodeReview.class, bart, timeout, (ActorRef<Bart.isKlaarMetCodeReview> ref) -> new Bart.reviewMijnCodeAlsjeblieft(ref), (reactie, throwable) -> { if (reactie != null) { return new MarcoBegrijptReactieZo(reactie.string); } else { return new MarcoBegrijptReactieZo("Code Review failed?!"); } } ); try { TimeUnit.SECONDS.sleep(3); } catch (InterruptedException e) { e.printStackTrace(); } context.ask( Bart.isKlaarMetCodeReview.class, bart, timeout, (ActorRef<Bart.isKlaarMetCodeReview> ref) -> new Bart.reviewMijnCodeAlsjeblieft(ref), (reactie, throwable) -> { if (reactie != null) { return new MarcoBegrijptReactieZo(reactie.string); } else { return new MarcoBegrijptReactieZo("Code Review failed?!"); } } ); } @Override public Receive<Bericht> createReceive() { return newReceiveBuilder() .onMessage(MarcoBegrijptReactieZo.class, this::ontvangReactie) .build(); } private Behavior<Bericht> ontvangReactie(MarcoBegrijptReactieZo reactie) { getContext().getLog().info("Marco ontvangt reactie van Bart: " + reactie.string); return stopAlsDemoVoorbijIs(); } private Behavior<Bericht> stopAlsDemoVoorbijIs() { if (benalbezigOntvangen) { return Behaviors.stopped(); } else { this.benalbezigOntvangen = true; return this; } } public static void main(String[] args) { System.out.println("Hello all!"); ActorRef<Bericht> system = ActorSystem.create(Marco.create(), "presentatie-voorbeeld"); } }
ivi-vink/Akkamon
domain/src/main/java/presentatie/Marco.java
3,069
import java.util.Scanner; /* Dit was mijn eerste programma datum: .... Vragen: .... */ public class FirstProgram { public static void main(String[] args) { Scanner keyb = new Scanner(System.in); System.out.println("eerste getal ?"); String lineGetala = keyb.nextLine(); // deze aanpak is beter voor inlezen data via console int a = Integer.parseInt(lineGetala); System.out.println("tweede getal ?"); int b = keyb.nextInt(); int c = a + b; String result = "de som is:" + c; System.out.println(result); } }
UGent-FEB-IntroductionProgramming/CodeVoorbeeldenHOC_22-23
intro/FirstProgram.java
3,070
package com.kiliokuara.kuimivm.unidbg; import com.github.unidbg.Module; import com.kiliokuara.kuimivm.execute.StackTrace; import com.kiliokuara.kuimivm.KuimiMethod; import com.kiliokuara.kuimivm.KuimiObject; import com.kiliokuara.kuimivm.KuimiVM; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.reflect.Modifier; import java.util.ArrayList; public class KuimiJniMethodHandle { private static final MethodHandle ARRAY_LIST_NEW; private static final MethodHandle ARRAY_LIST_ADD; private static final MethodHandle NUMBER_LONG_VALUE; private static final MethodHandle NUMBER_INT_VALUE; private static final MethodHandle NUMBER_SHORT_VALUE; private static final MethodHandle NUMBER_BYTE_VALUE; private static final MethodHandle FLOAT_INT_BITS_TO_FLOAT; private static final MethodHandle DOUBLE_LONG_BITS_TO_DOUBLE; private static final MethodHandle KUIMI_VM_RESOLVE_OBJECT; private static final MethodHandle N2C, N2B; private static final MethodHandle RE_INVOKE; static { var lk = MethodHandles.lookup(); try { ARRAY_LIST_NEW = lk.findConstructor(ArrayList.class, MethodType.methodType(void.class)); ARRAY_LIST_ADD = MethodHandles.dropReturn(lk.findVirtual(ArrayList.class, "add", MethodType.methodType(boolean.class, Object.class))); NUMBER_LONG_VALUE = lk.findVirtual(Number.class, "longValue", MethodType.methodType(long.class)); NUMBER_INT_VALUE = lk.findVirtual(Number.class, "intValue", MethodType.methodType(int.class)); NUMBER_SHORT_VALUE = lk.findVirtual(Number.class, "shortValue", MethodType.methodType(short.class)); NUMBER_BYTE_VALUE = lk.findVirtual(Number.class, "byteValue", MethodType.methodType(byte.class)); FLOAT_INT_BITS_TO_FLOAT = lk.findStatic(Float.class, "intBitsToFloat", MethodType.methodType(float.class, int.class)); DOUBLE_LONG_BITS_TO_DOUBLE = lk.findStatic(Double.class, "longBitsToDouble", MethodType.methodType(double.class, long.class)); KUIMI_VM_RESOLVE_OBJECT = lk.findVirtual(KuimiVM.class, "resolveObject", MethodType.methodType(KuimiObject.class, int.class)); RE_INVOKE = lk.findStatic(KuimiJniMethodHandle.class, "reinvoke", MethodType.methodType(Number.class, KuimiUnidbgVM.class, KuimiMethod.class, long.class, ArrayList.class)); N2C = lk.findStatic(KuimiJniMethodHandle.class, "n2c", MethodType.methodType(char.class, Number.class)); N2B = lk.findStatic(KuimiJniMethodHandle.class, "n2b", MethodType.methodType(boolean.class, Number.class)); } catch (Throwable throwable) { throw new ExceptionInInitializerError(throwable); } } private static char n2c(Number i) { return (char) i.intValue(); } private static boolean n2b(Number i) { return i.intValue() != 0; } private static Number reinvoke(KuimiUnidbgVM vm, KuimiMethod method, long peer, ArrayList<?> args) { var st = (StackTrace) args.get(1); var isStatic = Modifier.isStatic(method.getModifiers()); Object[] nativeArgs = new Object[isStatic ? args.size() : args.size() - 1]; nativeArgs[0] = vm.getJNIEnv(); int argIndex; if (isStatic) { nativeArgs[1] = st.pushObject(method.getDeclaredClass()); argIndex = 2; } else { argIndex = 1; } args.remove(0); // KuimiVM args.remove(0); // StackTrace for (var arg : args) { if (arg instanceof Boolean bool) { nativeArgs[argIndex++] = bool ? VMConst.JNI_TRUE : VMConst.JNI_FALSE; } else if (arg instanceof KuimiObject<?> kobj) { nativeArgs[argIndex++] = st.pushObject(kobj); } else if (arg instanceof Number) { nativeArgs[argIndex++] = arg; } else { nativeArgs[argIndex++] = arg; } } var rsp = Module.emulateFunction(vm.emulator, peer, nativeArgs); if (st.throwable != null) return 0; return rsp; } public static MethodHandle invoker( KuimiMethod targetMethod, KuimiUnidbgVM vm, long peer ) { //(KuimiVM, StackTrace, <KuimiObject>, .....)R var mtType = targetMethod.flattenMethodHandleType(); // (ArrayList, KuimiVM, ArrayList, StackTrace, .....)V MethodHandle emptyModel = MethodHandles.identity(ArrayList.class); { var ptList = mtType.parameterList(); for (var i = ptList.size() - 1; i >= 0; i--) { emptyModel = MethodHandles.collectArguments(emptyModel, 1, ARRAY_LIST_ADD); } } { var mpx = new ArrayList<Class<?>>(); mpx.add(ArrayList.class); for (var ignored : mtType.parameterList()) { mpx.add(Object.class); } var newType = MethodType.methodType(ArrayList.class, mpx); int[] slots = new int[emptyModel.type().parameterCount()]; for (var i = 0; i < mtType.parameterCount(); i++) { slots[i * 2 + 2] = i + 1; } emptyModel = MethodHandles.permuteArguments(emptyModel, newType, slots); mpx.clear(); mpx.add(ArrayList.class); mpx.addAll(mtType.parameterList()); emptyModel = emptyModel.asType(MethodType.methodType(ArrayList.class, mpx)); emptyModel = MethodHandles.collectArguments(emptyModel, 0, ARRAY_LIST_NEW); } // emptyModel = ArgumentCollector var reinvoker = MethodHandles.insertArguments(RE_INVOKE, 0, vm, targetMethod, peer); emptyModel = MethodHandles.filterReturnValue(emptyModel, reinvoker); var rspType = mtType.returnType(); if (rspType == void.class) { emptyModel = MethodHandles.dropReturn(emptyModel); } else if (rspType == long.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_LONG_VALUE); } else if (rspType == int.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_INT_VALUE); } else if (rspType == short.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_SHORT_VALUE); } else if (rspType == byte.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_BYTE_VALUE); } else if (rspType == char.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, N2C); } else if (rspType == boolean.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, N2B); } else if (rspType == KuimiObject.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_INT_VALUE); emptyModel = MethodHandles.filterReturnValue(emptyModel, KUIMI_VM_RESOLVE_OBJECT.bindTo(vm.vm)); } else if (rspType == float.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_INT_VALUE); emptyModel = MethodHandles.filterReturnValue(emptyModel, FLOAT_INT_BITS_TO_FLOAT); } else if (rspType == double.class) { emptyModel = MethodHandles.filterReturnValue(emptyModel, NUMBER_LONG_VALUE); emptyModel = MethodHandles.filterReturnValue(emptyModel, DOUBLE_LONG_BITS_TO_DOUBLE); } else { throw new IllegalArgumentException("Unknown how to convert to " + rspType); } return emptyModel; } }
kiliokuara/KuimiVM
src/main/java/com/kiliokuara/kuimivm/unidbg/KuimiJniMethodHandle.java
3,071
package org.lucee.extension.search.lucene.analyzer; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.snowball.SnowballAnalyzer; /** * <p>Analyzer for Dutch language</p> * <p><a href="DutchAnalyzer.java.html"><i>View Source</i></a></p> * <p/> * */ public final class DanishAnalyzer extends Analyzer { private static SnowballAnalyzer analyzer; private String STOP_WORDS[] = { "de", "en", "van", "ik", "te", "dat", "die", "in", "een", "hij", "het", "niet", "zijn", "is", "was", "op", "aan", "met", "als", "voor", "had", "er", "maar", "om", "hem", "dan", "zou", "of", "wat", "mijn", "men", "dit", "zo", "door", "over", "ze", "zich", "bij", "ook", "tot", "je", "mij", "uit", "der", "daar", "haar", "naar", "heb", "hoe", "heeft", "hebben", "deze", "u", "want", "nog", "zal", "me", "zij", "nu", "ge", "geen", "omdat", "iets", "worden", "toch", "al", "waren", "veel", "meer", "doen", "toen", "moet", "ben", "zonder", "kan", "hun", "dus", "alles", "onder", "ja", "eens", "hier", "wie", "werd", "altijd", "doch", "wordt", "wezen", "kunnen", "ons", "zelf", "tegen", "na", "reeds", "wil", "kon", "niets", "uw", "iemand", "geweest", "andere" }; /** * Creates new instance of SpanishAnalyzer */ public DanishAnalyzer() { analyzer = new SnowballAnalyzer("Danish", STOP_WORDS); } public DanishAnalyzer(String stopWords[]) { analyzer = new SnowballAnalyzer("Danish", stopWords); } @Override public TokenStream tokenStream(String fieldName, Reader reader) { return analyzer.tokenStream(fieldName, reader); } }
lucee/extension-lucene
source/java/src/org/lucee/extension/search/lucene/analyzer/DanishAnalyzer.java
3,072
package com.company; //hier heb ik large class vermeden omdat ik in 'Dier' mijn template methode heb staan, waardoor ik het niet opnieuw in buffalo hoef te schrijven. //Hier implementeer ik de methodes uit dier. public class Buffallo extends Dier { @Override public String soort() { String soort = "water buffalo"; System.out.println("soort: "+soort); return soort; } @Override public int lengte() { int lengte = 260; System.out.println("lengte: "+lengte+"CM"); return lengte; } @Override public int KG() { int KG = 367; System.out.println("gewicht: "+KG+"KG"); return KG; } @Override public char geslacht() { char geslacht = 'M'; System.out.println("geslacht: "+geslacht); return geslacht; } }
KemalUzr/Object-oriented-programming-project
src/com/company/Buffallo.java
3,073
package plugins.forum; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import lmd.LmdUser; public class Small { public boolean sendActivationMail(LmdUser fu) { String subject= "Aanmelding"; // localhost:8080 -> voedingsdagboek.nl String message = "Beste " + fu.getFirstName() + ",<BR/><BR/>Je kunt nu je account activeren door op de onderstaande link te klikken.<BR/><A HREF=\"http://voedingsdagboek.nl/molgenis.do?__target=ForumPlugin&__action=activate&activationCode=" + fu.getActivationCode() + "\">Activeer mijn account en log in</A> (inloggen alleen eerste keer automatisch).<BR/><BR/><BR/>Hartelijke groeten en veel plezier,<BR/><BR/>Het Voedingsdagboek-team<BR/><BR/>PS Je kunt ook de volgende link in je browser kopieren/plakken: http://voedingsdagboek.nl/molgenis.do?__target=ForumPlugin&__action=activate&activationCode=" + fu.getActivationCode(); return sendMail(fu.getEmail(), subject, message); } public boolean sendFeedback(String subject, String message) { return sendMail("[email protected]", subject, message); } public boolean sendMail(String to, String subject, String message) { Properties props = new Properties(); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.socketFactory.port", "465"); props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.port", "465"); Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("[email protected]", "xxx"); } }); try { Message mimeMessage = new MimeMessage(session); mimeMessage.setFrom(new InternetAddress("[email protected]")); mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to)); mimeMessage.setSubject(subject); mimeMessage.setContent(message, "text/html"); Transport.send(mimeMessage); System.out.println("E-mail sturen gelukt!"); return true; } catch (MessagingException e) { return false; // throw new RuntimeException(e); } } }
molgenis/molgenis-app-autobetes
TODO/handwritten/java/plugins/forum/Small.java
3,074
package oefenTentamen; import javax.swing.*; import java.util.*; import java.awt.event.*; public class HoofdPaneel extends JPanel implements MouseListener, KeyListener { private ArrayList<KaartPaneel> mijnKaartLijst; private ArrayList<KaartPaneelController> mijnControllerLijst; public HoofdPaneel() { setLayout(null); addMouseListener(this); addKeyListener(this); setFocusable(true); mijnKaartLijst = new ArrayList<KaartPaneel>(); mijnControllerLijst = new ArrayList<KaartPaneelController>(); } @Override public void keyPressed(KeyEvent ke) { if(ke.getKeyCode() == KeyEvent.VK_D) { for(KaartPaneel kp : mijnKaartLijst) { remove(kp); repaint(); } } if(ke.getKeyCode() == KeyEvent.VK_I) { for(KaartPaneel kp : mijnKaartLijst) { add(kp); repaint(); } } if(ke.getKeyCode() == KeyEvent.VK_H) { for(KaartPaneelController kpc : mijnControllerLijst) { kpc.pleaseStart(); } } if(ke.getKeyCode() == KeyEvent.VK_E) { for(KaartPaneelController kpc : mijnControllerLijst) { kpc.pleaseStop(); } } } @Override public void keyReleased(KeyEvent ke) {} @Override public void keyTyped(KeyEvent ke) { System.out.println(ke.getKeyChar()); } @Override public void mouseClicked(MouseEvent me) {} @Override public void mouseEntered(MouseEvent me) { requestFocus(); } @Override public void mouseExited(MouseEvent me) {} @Override public void mousePressed(MouseEvent me) { KaartPaneel kp = new KaartPaneel( me.getX(), me.getY(), 50); KaartPaneelController kpc = new KaartPaneelController(kp); add(kp); mijnKaartLijst.add(kp); mijnControllerLijst.add(kpc); repaint(); } @Override public void mouseReleased(MouseEvent me) {} }
reshadf/Java
DeBasis/src/oefenTentamen/HoofdPaneel.java
3,075
package nl.haroid.webclient; import nl.haroid.common.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author Ruud de Jong */ public class HaringHnZakelijkImpl extends AbstractHaring { private static final Logger LOGGER = LoggerFactory.getLogger(HaringHnZakelijkImpl.class); private static final String HOST = "zakelijk.hollandsnieuwe.nl"; private static final String RELATIVE_URL_START = "/mijn_hollandsnieuwe"; private static final String RELATIVE_URL_VERBRUIK = "/myaccount/subscriptionPurchaseCurrentUsageDataFeed.jsp?index=0&status=ACTIVE&profileId="; @Override protected String getHost() { return HOST; } @Override protected String getRelativeStartUrl() { return RELATIVE_URL_START; } @Override protected String getRelativeVerbruikUrl() { return RELATIVE_URL_VERBRUIK; } @Override protected String vindTegoed(String body) { String tegoedIndicator = "minuten"; String tegoedBedrag = Utils.substringBetween(body, "<span class=\"usage\"><span class=\"amount\">", "</span>"); String[] strongList = Utils.substringsBetween(body, "<strong>", "</strong>"); String tegoed = null; if (strongList != null) { for (String strongItem : strongList) { if (Utils.contains(strongItem, tegoedIndicator)) { LOGGER.debug("Gevonden strongItem: " + strongItem); String filterItem = Utils.deleteWhitespace(strongItem); tegoed = Utils.substringBefore(filterItem, tegoedIndicator); } } } LOGGER.info("Gevonden tegoed bedrag: " + tegoedBedrag); return tegoed; } }
biker-ruud/haroid
core/src/main/java/nl/haroid/webclient/HaringHnZakelijkImpl.java
3,076
package com.xocs.ap.shop; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Persoon { private Set<Game> mijnGames = new HashSet<>(); private double saldo; private boolean heeftGame(Game game) { return mijnGames.contains(game); } }
robertxocs/hu_ap_voorbeelden
src/com/xocs/ap/shop/Persoon.java
3,077
package labyrint; import static java.lang.String.format; /** * @author Elias De Hondt * 17/10/2022 */ public class Speler { // Canstante public final int MAX_BREEDTE = 20; public final int MAX_HOOGTE = 20; // Attributen private int levens; private String naam; private int x; private int y; // Constructor public Speler() { // Default constructor this("Onbekend"); } public Speler(String naam) { this.naam = naam; this.levens = 3; // Bij het begin krijgt elke speler 3 levens. this.x = MAX_BREEDTE/2; this.y = MAX_HOOGTE/2; } // Methode public void setNaam(String naam) { // set ... if (!naam.isEmpty()) { this.naam = naam; } } public void setPositie(int x, int y) { // set ... if (this.x > 0 && this.x < MAX_BREEDTE) this.x = x; if (this.y > 0 && this.y < MAX_HOOGTE)this.y = y; } public String getNaam() { // get ... return this.naam; } public int getX() { // get ... return this.x; } public int getY() { // get ... return this.y; } public int getLevens() { // get ... return this.levens; } public void verplaats(int stapX, int stapY) { // get ... setPositie(this.x + stapX, this.y + stapY); } public void verpaats() { verplaats(+1, +1); } public void valAan() { if (this.levens > 0) levens--; } public boolean isDood() { return (levens <= 0); } @Override // @Override zortervoor dat Object.java niet mijn code overrede public String toString() { return format("Speler %s wandelt naar %d, %d en heeft %d levens", this.naam, this.x, this.y, this.levens); //return " "; } }
EliasDeHondt/ComputerProgramming1-OOConcepts
W5P1/W5P1 Speler/src/labyrint/Speler.java
3,078
/* * SPDX-FileCopyrightText: 2022 Atos * SPDX-License-Identifier: EUPL-1.2+ */ package net.atos.zac.gebruikersvoorkeuren.model; public enum DashboardCardId { MIJN_DOCUMENTEN_NIEUW, MIJN_TAKEN, MIJN_TAKEN_NIEUW, MIJN_ZAKEN, MIJN_ZAKEN_NIEUW, MIJN_ZAKEN_WAARSCHUWING }
infonl/dimpact-zaakafhandelcomponent
src/main/java/net/atos/zac/gebruikersvoorkeuren/model/DashboardCardId.java
3,079
/* * Copyright (c) 2016-2016 Bas van den Boom 'Z3r0byte' * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.ilexiconn.magister.container; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import net.ilexiconn.magister.util.HttpUtil; import net.ilexiconn.magister.util.LogUtil; import java.io.IOException; import java.io.Serializable; public class School implements Serializable { @SerializedName("Id") public String id; @SerializedName("Name") public String name; @SerializedName("Url") public String url; public static School[] findSchool(String s) { if (s.length() <= 3) { return new School[]{}; } try { return new Gson().fromJson(HttpUtil.httpGet("https://mijn.magister.net/api/schools?filter=" + s), School[].class); } catch (IOException e) { LogUtil.printError("Unable to finish request", e); return new School[]{}; } } }
Z3r0byte/Magistify
app/src/main/java/net/ilexiconn/magister/container/School.java
3,080
package blackjackdomain; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; /** * BlackJack * @author JJV * Gehanteerde spelregels in deze BlackJack versie: * - Verzekeren en Surrender zijn geen opties in dit spel * - AAS voor Bank telt altijd als 11 punten * - de AI-spelers kunnen niet verdubbelen of splitsen * - Splitsen voor de gebruiker is alleen mogelijk bij dezelfde kaart ongeacht de waarde (dus 2 Heren of 2 Boeren, niet bij 10, Boer of Boer, Vrouw) * - bij de AI is een AAS 1 of 11 punten afhankelijk van de situatie * - Een speler heeft BlackJack wanneer de eerste 2 kaarten 21 punten waard zijn && de Bank geen mogelijkheid tot BlackJack heeft * - Een AI-speler met BlackJack krijgt geen nieuwe kaarten. De Gebruiker kan wel kiezen om een kaart aan te nemen * - Een BlackJack wordt aan het einde uitgekeerd als 2* de inzet * - Met het kiezen van "Verdubbelen" (Knop: Dubbel) krijgt de speler automatisch nog 1 kaart */ public class BlackJackMain { private static final long serialVersionUID = 1L; ArrayList <BlackJackKaart> deck = null; ArrayList <BlackJackSpeler> spelersLijst = null; ArrayList <String> namenLijst = new ArrayList<String>( Arrays.asList("Jan", "Jozef", "Klaas", "Reimer", "Bert", "Hans", "Karel", "Remi", "Pieter", "Peter", "Koen", "Patricia", "Johanna", "Anna", "Kofi", "Silvio", "George", "Barack", "Mark", "Vladimir")); ArrayList <String> wisselLijst = new ArrayList <String>(); String naam = null; int aantalAI = 0; int aantalSpelers = 0; Random ran = new Random(); boolean isGesplitst = false; /** * @param naam; naam van de speler, aantalAI; aantal computertegenstanders * Constructor */ public BlackJackMain (String naam, int aantalAI){ this.aantalAI = aantalAI; this.naam = naam; mijnInit(); } /* * mijnInit; Vullen van de spelersLijst met op [0] de bank en op [1] de speler, de overige plaatsen worden gevuld met AI-spelers */ public void mijnInit(){ isGesplitst = false; ArrayList <BlackJackSpeler> spelersLijst = new ArrayList <BlackJackSpeler>(); this.spelersLijst = spelersLijst; spelersLijst.add(new BlackJackBank()); spelersLijst.add(new BlackJackGebruiker()); spelersLijst.get(1).setNaam(naam); for (int i=0; i<aantalAI; i++){ int keuzeNummer = ran.nextInt(namenLijst.size()); String keuzeNaam = namenLijst.get(keuzeNummer); namenLijst.remove(keuzeNummer); spelersLijst.add(new BlackJackAI()); spelersLijst.get(i+2).setNaam(keuzeNaam); } aantalSpelers = spelersLijst.size(); } /* * @param de inzet van de speler voor het begin van het spel, zoals gevraagd in de gui * na het controleren van de inzet begint de eersteRonde. Hierna worden de kaarten ook gemaakt. */ public boolean inZetten(int inzet){ mutatieLijst(); clearHand(); clearBlackJack(); if (spelersLijst.size()>2 && spelersLijst.get(spelersLijst.size()-1) instanceof BlackJackGebruiker){ spelersLijst.remove(spelersLijst.size()-1); aantalSpelers --; } spelersLijst.get(1).setInzet(0); BlackJackDeck blackJackKaarten = new BlackJackDeck(); deck = blackJackKaarten.maakDeck(aantalSpelers); if (inzet>0 && inzet <= spelersLijst.get(1).getCredits()){ spelersLijst.get(1).setInzet(inzet); for (int a=2; a<aantalSpelers; a++){ spelersLijst.get(a).setInzet(((int)Math.sqrt(spelersLijst.get(a).getCredits()))+(ran.nextInt(10))); } deelKaartenUit(); return true; } else { return false; } } /* * In de eersteRonde wordt aan de Bank 1 kaart uitgedeeld en aan de rest * van de spelers 2 kaarten. Hierbij wordt gekeken of de speler een BlackJack heeft * Na dit begin van het spel volgt de Ronde voor de AI */ public void deelKaartenUit(){ for (BlackJackSpeler a:spelersLijst){ if (a instanceof BlackJackBank){ geefKaart(spelersLijst.indexOf(a)); } else { geefKaart(spelersLijst.indexOf(a)); geefKaart(spelersLijst.indexOf(a)); if (a.getKAART(0).getWaarde()+ a.getKAART(1).getWaarde()==21 && spelersLijst.get(0).getKAART(0).getWaarde()<10){ a.setHeeftBlackJack(); } } } ronde(); } /* * In deze ronde berekent Main voor elke AI hoeveel kaarten deze afneemt * de totale score van de kaarten wordt berekend en opgeslagen in de instantie van de Speler */ public void ronde(){ for (int i=2; i<aantalSpelers; i++){ if (spelersLijst.get(i).getHeeftBlackJack()!= true){ int score = 0; int aantalAzen = 0; for (int b=0; b<spelersLijst.get(i).handLengte(); b++){ score = score + spelersLijst.get(i).getKAART(b).getWaarde(); if (spelersLijst.get(i).getKAART(b).getWaarde()==11){ aantalAzen ++; } } while (score-(aantalAzen*10)<17){ spelersLijst.get(i).addKAART(deck.get(0)); if (deck.get(0).getWaarde()==11){ aantalAzen ++; } score = score + deck.get(0).getWaarde(); deck.remove(0); } } } } public void hit(int spelerNummer){ geefKaart(spelerNummer); berekenScore(); } public void einde(){ int bankScore = spelersLijst.get(0).getKAART(0).getWaarde(); while (bankScore<17){ spelersLijst.get(0).addKAART(deck.get(0)); bankScore = bankScore + deck.get(0).getWaarde(); deck.remove(0); } berekenScore(); for (BlackJackSpeler g:spelersLijst){ if (g instanceof BlackJackAI){ int eindScore = g.getScore(); if ((eindScore>bankScore && eindScore <22)||(bankScore>21 && eindScore<22)){ g.setCredits(-2*g.getInzet()); } else if (eindScore==bankScore && eindScore <22){ g.setCredits(-1*g.getInzet()); } } else if (g instanceof BlackJackGebruiker){ int eindScore = g.getScore(); if ((eindScore>bankScore && eindScore <22)||(bankScore>21 && eindScore<22)){ spelersLijst.get(1).setCredits(-2*g.getInzet()); } else if (eindScore==bankScore && eindScore <22){ spelersLijst.get(1).setCredits(-1*g.getInzet()); } } } isGesplitst = false; } public void berekenScore(){ for (BlackJackSpeler b:spelersLijst){ int score = 0; if (b instanceof BlackJackBank){ for (int d=0; d<b.handLengte(); d++){ score = score + b.getKAART(d).getWaarde(); }} else{ int aantalAAS = 0; for (int d=0; d<b.handLengte(); d++){ score = score + b.getKAART(d).getWaarde(); if (b.getKAART(d).getWaarde()==11 && b.getHeeftBlackJack()!=true){ aantalAAS ++; } } while (score>21 && aantalAAS!=0){ score = score - 10; aantalAAS --; } } b.setScore(score); } } // HULPMETHODEN INTERN EN VOOR FRAME public void mutatieLijst (){ String wisselSpeler = null; for (int i=2; i<aantalSpelers; i++){ if (spelersLijst.get(i).getCredits()<15){ wisselSpeler = spelersLijst.get(i).getNaam(); wisselLijst.add(spelersLijst.get(i).getNaam()); spelersLijst.remove(i); int keuzeNummer = ran.nextInt(namenLijst.size()); String keuzeNaam = namenLijst.get(keuzeNummer); namenLijst.remove(keuzeNummer); spelersLijst.add(new BlackJackAI()); spelersLijst.get(spelersLijst.size()-1).setNaam(keuzeNaam); wisselLijst.add(spelersLijst.get(spelersLijst.size()-1).getNaam()); namenLijst.add(wisselSpeler); } } } public boolean splitsen (){ String kaart1 = spelersLijst.get(1).getKAART(0).toString().substring(1); String kaart2 = spelersLijst.get(1).getKAART(1).toString().substring(1); if (vraagHandLengte(1)== 2 && isGesplitst == false && kaart1.equals(kaart2)){ isGesplitst = true; spelersLijst.add(new BlackJackGebruiker()); spelersLijst.get(spelersLijst.size()-1).setNaam(naam+"GESPLITST"); spelersLijst.get(spelersLijst.size()-1).addKAART(spelersLijst.get(1).getKAART(1)); BlackJackKaart overzetter = spelersLijst.get(1).getKAART(0); spelersLijst.get(1).clearHand(); spelersLijst.get(1).addKAART(overzetter); spelersLijst.get(spelersLijst.size()-1).setInzet(spelersLijst.get(1).getInzet()); spelersLijst.get(spelersLijst.size()-1).setCredits(500-spelersLijst.get(1).getCredits()); spelersLijst.get(1).setInzet(spelersLijst.get(1).getInzet()); aantalSpelers++; return true; } else { return false;} } public void geefKaart(int spelerNummer){ spelersLijst.get(spelerNummer).addKAART(deck.get(0)); deck.remove(0); } public void clearWisselLijst(){ while (wisselLijst.size() != 0){ wisselLijst.remove(0); } } public String getWisselLijst(int spelerNummer){ return wisselLijst.get(spelerNummer); } public int getWisselLijstLengte(){ return wisselLijst.size(); } public void setSpelerCredits (int nummer, int credits){ spelersLijst.get(nummer).setCredits(credits); } public String getSpelerCredits(int nummer){ if (spelersLijst.get(nummer) instanceof BlackJackBank){ return ""; } else { return "" + spelersLijst.get(nummer).getCredits(); } } public String getSpelerInzet (int nummer){ if (spelersLijst.get(nummer) instanceof BlackJackBank){ return ""; } else { return "" + spelersLijst.get(nummer).getInzet(); } } public void setInzet (int spelerNummer, int inzet){ spelersLijst.get(spelerNummer).setInzet(inzet); } public int getAantalSpelers(){ return aantalSpelers; } public String getSpelerNaam(int nummer){ String Speler = spelersLijst.get(nummer).getNaam(); return Speler; } public int vraagHandLengte (int spelernummer){ return spelersLijst.get(spelernummer).handLengte(); } public BlackJackKaart vraagKAART(int spelernummer, int kaartnummer){ return spelersLijst.get(spelernummer).getKAART(kaartnummer); } public void clearHand(){ for (BlackJackSpeler p:spelersLijst){ p.clearHand(); } } public int vraagScore (int spelernummer){ berekenScore(); if (spelersLijst.get(spelernummer).getHeeftBlackJack()){ return 21; } else { return spelersLijst.get(spelernummer).getScore(); } } public boolean getHeeftBlackJack(int spelernummer){ return spelersLijst.get(spelernummer).getHeeftBlackJack(); } public void clearBlackJack(){ for (BlackJackSpeler a: spelersLijst){ a.setResetBlackJack(); } } public boolean isGesplitst(){ return isGesplitst; } public void setGesplitstFalse(){ isGesplitst = false; } public static void main(String[] args) { } }
Mandiax/GameSuite
GameSuiteMain/src/blackjackdomain/BlackJackMain.java
3,081
package Week7.Deel1.Step6; import java.util.ArrayList; interface Luiwammes { void wasAf(); } class Ouder implements Luiwammes { @Override public void wasAf(){ System.out.println("Ik heb het druk, maar laat ik toch maar even snel die vaat doen..."); } } class Kind implements Luiwammes { @Override public void wasAf(){ System.out.println("Ik heb geen zin in de vaat, maar laat ik mijn ouder toch maar blij maken..."); } } class Vaatwasser implements Luiwammes { @Override public void wasAf(){ System.out.println("Bzzz, drgghhg, wushush..... piep piep piep en klaar!"); } } public class Main { public static void main(String[] args) { ArrayList<Luiwammes> afwassers = new ArrayList<>(); afwassers.add(new Ouder()); afwassers.add(new Kind()); afwassers.add(new Vaatwasser()); for (Luiwammes afwasser : afwassers){ afwasser.wasAf(); } } }
joris2710/stepikopdrachten
src/Week7/Deel1/Step6/Main.java
3,082
package com.hz; public class Trump implements Observer { @Override // Dit is mijn brievenbus public void update(Subject s) { TrendingTopics tt = (TrendingTopics) s; String topic = tt.getTrendingTopic(); System.out.println("Make " + topic + " great again!"); } }
anieuwenhuize/sde_observer
src/com/hz/Trump.java
3,083
package proeftoets; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class VierkantTimerApp extends JFrame implements ActionListener { VierkantPaneel mijnPaneel; JButton linkerButton, rechterButton; JButton naarBovenButton, naarBenedenButton; public VierkantTimerApp() { setSize(300, 200); setTitle("Spelen met vierkanten"); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); linkerButton = new JButton("links"); rechterButton = new JButton("rechts"); naarBovenButton = new JButton("boven"); naarBenedenButton = new JButton("beneden"); linkerButton.addActionListener(this); rechterButton.addActionListener(this); naarBovenButton.addActionListener(this); naarBenedenButton.addActionListener(this); mijnPaneel = new VierkantPaneel(); add(linkerButton, BorderLayout.WEST); add(naarBovenButton, BorderLayout.NORTH); add(rechterButton, BorderLayout.EAST); add(naarBenedenButton, BorderLayout.SOUTH); add(mijnPaneel, BorderLayout.CENTER); setVisible(true); } public static void main(String[] args) { new VierkantTimerApp(); } public void actionPerformed(ActionEvent ae) { if(ae.getSource() == linkerButton) { mijnPaneel.setRichting(1); } if(ae.getSource() == rechterButton) { mijnPaneel.setRichting(3); } if(ae.getSource() == naarBovenButton) { mijnPaneel.setRichting(2); } if(ae.getSource() == naarBenedenButton) { mijnPaneel.setRichting(4); } } }
reshadf/Java
DeBasis/src/proeftoets/VierkantTimerApp.java
3,084
package nl.zeesoft.zsds.dialogs.dutch; import nl.zeesoft.zsd.BaseConfiguration; import nl.zeesoft.zsd.EntityValueTranslator; import nl.zeesoft.zsds.dialogs.StateAccuracy; public class DutchStateAccuracy extends StateAccuracy { private static final String EXAMPLE_OUTPUT_ACCURACY = "Mijn meest recente test resultaten geven aan dat ik {exact} {percentage} procent nauwkeurig ben."; public DutchStateAccuracy() { setLanguage(BaseConfiguration.LANG_NLD); setHandlerClassName(DutchStateAccuracyHandler.class.getName()); } @Override public void initialize(EntityValueTranslator t) { super.initialize(t); addExample("Hoe accuraat ben je?",EXAMPLE_OUTPUT_ACCURACY); addExample("Hoe nauwkeurig ben je?",EXAMPLE_OUTPUT_ACCURACY); addExample("Wat zijn je meest recente test resultaten?",EXAMPLE_OUTPUT_ACCURACY); } }
DyzLecticus/Zeesoft
V3.0/ZSDS/src/nl/zeesoft/zsds/dialogs/dutch/DutchStateAccuracy.java
3,085
/* * 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 Apppackage; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.sql.*; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFrame; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.category.BarRenderer; import org.jfree.data.jdbc.JDBCCategoryDataset; /** * * @author Willl_000 */ public class Table extends javax.swing.JFrame { static Statement mijnStat; public Connection con; /** * Creates new form Table */ public Table() throws ClassNotFoundException { initComponents(); /*try { //load the driver Class.forName("com.microsoft.sqlserver.jbdc.SQLServerDriver"); String connectionUrl = "jdbc:sqlserver://db4free.net:3306; databaseName=barbawapatest; user=barba; password=Ruggenmerg"; Connection con = DriverManager.getConnection(connectionUrl); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from FbComments"); ResultSetMetaData rsmdata = rs.getMetaData(); //store culumn number int columns = rsmdata.getColumnCount(); //set data into jTable DefaultTableModel dtm = new DefaultTableModel(); Vector columns_name = new Vector(); Vector data_rows = new Vector(); for (int i=1; i<columns; i++) { columns_name.addElement(rsmdata.getColumnName(1)); } dtm.setColumnIdentifiers(columns_name); while(rs.next()) { data_rows = new Vector(); for(int j=1; j<columns; j++) { data_rows.addElement(rs.getString(j)); } dtm.addRow(data_rows); } //pass default table object over into jtable fbComTable.setModel(dtm); } catch (SQLException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } */ } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jMenuBar2 = new javax.swing.JMenuBar(); jMenu3 = new javax.swing.JMenu(); jMenu4 = new javax.swing.JMenu(); searchbar = new javax.swing.JTextField(); Searchbutton = new javax.swing.JButton(); BackbuttonTable = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); fbComTable = new javax.swing.JTable(); toonDataB = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); textarea = new javax.swing.JTextArea(); jLabel2 = new javax.swing.JLabel(); commentCountLabel = new javax.swing.JLabel(); positiefCount = new javax.swing.JLabel(); negatiefCount = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); MainMenu = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenu3.setText("File"); jMenuBar2.add(jMenu3); jMenu4.setText("Edit"); jMenuBar2.add(jMenu4); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Searchbutton.setText("Zoeken"); Searchbutton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SearchbuttonActionPerformed(evt); } }); BackbuttonTable.setText("Terug"); BackbuttonTable.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { BackbuttonTableMouseClicked(evt); } }); fbComTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null} }, new String [] { "UserID", "Likes", "Datum", "Gedrag", "Commentaar" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(fbComTable); if (fbComTable.getColumnModel().getColumnCount() > 0) { fbComTable.getColumnModel().getColumn(0).setMaxWidth(200); fbComTable.getColumnModel().getColumn(1).setMaxWidth(50); fbComTable.getColumnModel().getColumn(2).setMaxWidth(75); fbComTable.getColumnModel().getColumn(3).setMaxWidth(200); } toonDataB.setText("Toon"); toonDataB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toonDataBActionPerformed(evt); } }); textarea.setEditable(false); textarea.setColumns(20); textarea.setRows(5); jScrollPane2.setViewportView(textarea); jLabel2.setText("Commentaar"); commentCountLabel.setText("Aantal Comments:"); positiefCount.setText("Positief:"); negatiefCount.setText("Negatief:"); jMenu1.setText("File"); MainMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK)); MainMenu.setText("Main"); MainMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MainMenuActionPerformed(evt); } }); jMenu1.add(MainMenu); jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK)); jMenuItem2.setText("Exit"); jMenu1.add(jMenuItem2); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGap(200, 200, 200) .addComponent(toonDataB, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(BackbuttonTable, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 562, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(commentCountLabel) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(searchbar, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE) .addComponent(jScrollPane2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Searchbutton)) .addComponent(positiefCount) .addComponent(negatiefCount)))) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel2) .addGap(194, 194, 194)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(searchbar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Searchbutton)) .addGap(27, 27, 27) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE) .addComponent(jScrollPane2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(commentCountLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(positiefCount) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(negatiefCount) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(BackbuttonTable, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(toonDataB)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void BackbuttonTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BackbuttonTableMouseClicked GraphChoose graphChoose = new GraphChoose(); graphChoose.setVisible(true); Table.this.dispose(); }//GEN-LAST:event_BackbuttonTableMouseClicked private void MainMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MainMenuActionPerformed LoginScreen loginScreen = new LoginScreen(); loginScreen.setVisible(true); Table.this.dispose(); }//GEN-LAST:event_MainMenuActionPerformed private void toonDataBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toonDataBActionPerformed try { //EXTERNE DATABASE_______________________ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String connectionUrl = "jdbc:sqlserver://db4free.net:3306; databaseName=barbawapatest; user=barba; password=Ruggenmerg"; Connection con = Database.Connectie.getConnection(); //Connection con = DriverManager.getConnection(connectionUrl); /* //LOKAAL DATABASE!!______________________ String connectionUrl = "jdbc:mysql://localhost/barbawapatest"; String driver = "com.mysql.jdbc.Driver"; try{ //Class.forName(driver); try{ con = DriverManager.getConnection(connectionUrl, "root", "root"); mijnStat = con.createStatement(); }catch (SQLException ex){ Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } */ //Create Connection.. Statement state = con.createStatement(); ResultSet rs = state.executeQuery("select * from FbComments"); ResultSetMetaData rsmdata = rs.getMetaData(); //store culumn number int columns = rsmdata.getColumnCount(); //set data into jTable DefaultTableModel dtm = new DefaultTableModel(); Vector columns_name = new Vector(); Vector data_rows = new Vector(); for (int i = 1; i < columns; i++) { columns_name.addElement(rsmdata.getColumnName(1)); } dtm.setColumnIdentifiers(columns_name); while (rs.next()) { data_rows = new Vector(); for (int j = 1; j < columns; j++) { data_rows.addElement(rs.getString(j)); } dtm.addRow(data_rows); } //pass default table object over into jtable fbComTable.setModel(dtm); } catch (ClassNotFoundException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_toonDataBActionPerformed private void SearchbuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchbuttonActionPerformed try { int comCount = 0; int pCount = 0; int nCount = 0; textarea.setText(""); Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String connectionUrl = "jdbc:sqlserver://db4free.net:3306; databaseName=barbawapatest; user=barba; password=Ruggenmerg"; Connection con = Database.Connectie.getConnection(); Statement state = con.createStatement(); ResultSet rs = state.executeQuery("select * from FbComments"); while (rs.next()) { if (rs.getString("commentBody").toLowerCase().contains(searchbar.getText().toLowerCase())) { textarea.append(rs.getString("commentBody") + "\n---------------------------------------------\n"); comCount++; if(rs.getString("mood").equals("Positief")){ pCount++; } else if(rs.getString("mood").equals("Negatief")){ nCount++; } } commentCountLabel.setText("Aantal Comments: " + comCount); positiefCount.setText("Positief: " + pCount); negatiefCount.setText("Negatief: " + nCount); } } catch (ClassNotFoundException | SQLException e) { } }//GEN-LAST:event_SearchbuttonActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Table.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Table.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Table.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Table.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { try { new Table().setVisible(true); } catch (ClassNotFoundException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton BackbuttonTable; private javax.swing.JMenuItem MainMenu; private javax.swing.JButton Searchbutton; private javax.swing.JLabel commentCountLabel; private javax.swing.JTable fbComTable; private javax.swing.JLabel jLabel2; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuBar jMenuBar2; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JLabel negatiefCount; private javax.swing.JLabel positiefCount; private javax.swing.JTextField searchbar; private javax.swing.JTextArea textarea; private javax.swing.JButton toonDataB; // End of variables declaration//GEN-END:variables }
Polleps/Barba_Wapa
src/Apppackage/Table.java
3,086
package domein; public class Handen implements Wapen{ @Override public void ValAan() { System.out.println("boem klets met mijn vuisten"); } }
GuusDb/javaASDoefs
DP/strategy pattern/src/domein/Handen.java
3,087
package nl.zeesoft.zids.database.model; import java.util.SortedMap; import java.util.TreeMap; import nl.zeesoft.zacs.database.model.Assignment; import nl.zeesoft.zacs.database.model.Control; import nl.zeesoft.zacs.database.model.Symbol; import nl.zeesoft.zacs.database.model.ZACSDataGenerator; import nl.zeesoft.zids.dialog.controller.CtrHanddruk; import nl.zeesoft.zids.dialog.controller.CtrHandshake; import nl.zeesoft.zids.dialog.pattern.PtnObject; import nl.zeesoft.zids.server.SvrControllerSelf; import nl.zeesoft.zodb.Messenger; import nl.zeesoft.zodb.database.DbRequestQueue; import nl.zeesoft.zodb.database.request.ReqAdd; import nl.zeesoft.zodb.database.request.ReqDataObject; import nl.zeesoft.zodb.database.request.ReqGet; import nl.zeesoft.zodb.database.request.ReqObject; import nl.zeesoft.zodb.event.EvtEvent; public class ZIDSDataGenerator extends ZACSDataGenerator { private ReqAdd addHumanRequest = new ReqAdd(ZIDSModel.HUMAN_CLASS_FULL_NAME); private ReqAdd addVariableTypeRequest = new ReqAdd(ZIDSModel.VARIABLE_TYPE_CLASS_FULL_NAME); private ReqGet getVariableTypeRequest = new ReqGet(ZIDSModel.VARIABLE_TYPE_CLASS_FULL_NAME); private ReqAdd addDialogRequest = new ReqAdd(ZIDSModel.DIALOG_CLASS_FULL_NAME); private ReqGet getDialogRequest = new ReqGet(ZIDSModel.DIALOG_CLASS_FULL_NAME); private ReqAdd addDialogExampleRequest = new ReqAdd(ZIDSModel.DIALOG_EXAMPLE_CLASS_FULL_NAME); private ReqAdd addDialogVariableRequest = new ReqAdd(ZIDSModel.DIALOG_VARIABLE_CLASS_FULL_NAME); private ReqGet getDialogVariableRequest = new ReqGet(ZIDSModel.DIALOG_VARIABLE_CLASS_FULL_NAME); private ReqAdd addDialogVariableExampleRequest = new ReqAdd(ZIDSModel.DIALOG_VARIABLE_EXAMPLE_CLASS_FULL_NAME); private ReqAdd addAssignmentRequest = new ReqAdd(ZIDSModel.ASSIGNMENT_CLASS_FULL_NAME); private Self self = null; private String selfPattern = null; public final static String VARIABLE_INTERACTING_HUMAN = "{INTERACTING_HUMAN}"; public final static String VARIABLE_INTERACTING_HUMAN_FULLNAME = "{INTERACTING_HUMAN_FULLNAME}"; public final static String EN_SELF_INTRODUCTION = "Self introduction"; public final static String EN_SELF_INTRODUCTION_CONTEXT = "selfIntroduction"; public final static String EN_SELF_INTRODUCTION_INTRO1 = "Hello, how can I be of service to you?"; public final static String EN_SELF_INTRODUCTION_INTRO2 = "Hello, what can I do for you?"; public final static String EN_SELF_INTRODUCTION_INTRO3 = "Hello, how may I help you?"; public final static String EN_SELF_INTRODUCTION_RETURN1 = "You're welcome."; public final static String EN_SELF_INTRODUCTION_RETURN2 = "No problem."; public final static String EN_SELF_INTRODUCTION_RETURN3 = "You are very welcome."; public final static String NL_SELF_INTRODUCTION = "Zelf introductie"; public final static String NL_SELF_INTRODUCTION_CONTEXT = "zelfIntroductie"; public final static String NL_SELF_INTRODUCTION_INTRO1 = "Hallo, wat kan ik voor u betekenen?"; public final static String NL_SELF_INTRODUCTION_INTRO2 = "Hallo, wat kan ik voor u doen?"; public final static String NL_SELF_INTRODUCTION_INTRO3 = "Hallo, kan ik u ergens mee helpen?"; public final static String NL_SELF_INTRODUCTION_RETURN1 = "Graag gedaan."; public final static String NL_SELF_INTRODUCTION_RETURN2 = "Geen probleem."; public final static String NL_SELF_INTRODUCTION_RETURN3 = "Alstublieft."; public final static String EN_HANDSHAKE = "Handshake"; public final static String EN_HANDSHAKE_CONTEXT = "handshake"; public final static String EN_HANDSHAKE_VAR_HUMAN = "{HANDSHAKE_HUMAN}"; public final static String EN_HANDSHAKE_VAR_FIRSTNAME = "{HANDSHAKE_FIRSTNAME}"; public final static String EN_HANDSHAKE_VAR_LASTNAME = "{HANDSHAKE_LASTNAME}"; public final static String EN_HANDSHAKE_VAR_PREPOSITION = "{HANDSHAKE_PREPOSITION}"; public final static String EN_HANDSHAKE_VAR_CONFIRMATION = "{HANDSHAKE_CONFIRMATION}"; public final static String EN_HANDSHAKE_VAR_HUMAN_CONTEXT = "handshakeHuman"; public final static String EN_HANDSHAKE_VAR_FIRSTNAME_CONTEXT = "handshakeFirstName"; public final static String EN_HANDSHAKE_VAR_LASTNAME_CONTEXT = "handshakeLastName"; public final static String EN_HANDSHAKE_VAR_PREPOSITION_CONTEXT = "handshakePreposition"; public final static String EN_HANDSHAKE_VAR_CONFIRMATION_CONTEXT = "handshakeConfirmation"; public final static String NL_HANDSHAKE = "Handdruk"; public final static String NL_HANDSHAKE_CONTEXT = "handdruk"; public final static String NL_HANDSHAKE_VAR_HUMAN = "{HANDDRUK_MENS}"; public final static String NL_HANDSHAKE_VAR_FIRSTNAME = "{HANDDRUK_VOORNAAM}"; public final static String NL_HANDSHAKE_VAR_LASTNAME = "{HANDDRUK_ACHTERNAAM}"; public final static String NL_HANDSHAKE_VAR_PREPOSITION = "{HANDDRUK_PREPOSITIE}"; public final static String NL_HANDSHAKE_VAR_CONFIRMATION = "{HANDDRUK_BEVESTIGING}"; public final static String NL_HANDSHAKE_VAR_HUMAN_CONTEXT = "handdrukMens"; public final static String NL_HANDSHAKE_VAR_FIRSTNAME_CONTEXT = "handdrukVoornaam"; public final static String NL_HANDSHAKE_VAR_LASTNAME_CONTEXT = "handdrukAchternaam"; public final static String NL_HANDSHAKE_VAR_PREPOSITION_CONTEXT = "handdrukPrepositie"; public final static String NL_HANDSHAKE_VAR_CONFIRMATION_CONTEXT = "handdrukBevestigin"; private SortedMap<String,Long> variableTypeNameIdMap = new TreeMap<String,Long>(); protected void addHumansToAddHumanRequest(ReqAdd addRequest) { addHumanToAddHumanRequest(addRequest,"Andre van der Zee",""); addHumanToAddHumanRequest(addRequest,"Noam Chomsky",""); addHumanToAddHumanRequest(addRequest,"Douglas Hofstadter",""); addHumanToAddHumanRequest(addRequest,"Daniel Dennet",""); addHumanToAddHumanRequest(addRequest,"Robert Hecht-Nielsen",""); } protected void addDialogsToAddDialogRequest(ReqAdd addRequest) { Dialog d = null; d = new Dialog(); d.setName(EN_SELF_INTRODUCTION); d.setContextSymbol(EN_SELF_INTRODUCTION_CONTEXT); addRequest.getObjects().add(new ReqDataObject(d.toDataObject())); d = new Dialog(); d.setName(NL_SELF_INTRODUCTION); d.setContextSymbol(NL_SELF_INTRODUCTION_CONTEXT); addRequest.getObjects().add(new ReqDataObject(d.toDataObject())); d = new Dialog(); d.setName(EN_HANDSHAKE); d.setContextSymbol(EN_HANDSHAKE_CONTEXT); d.setControllerClassName(CtrHandshake.class.getName()); addRequest.getObjects().add(new ReqDataObject(d.toDataObject())); d = new Dialog(); d.setName(NL_HANDSHAKE); d.setContextSymbol(NL_HANDSHAKE_CONTEXT); d.setControllerClassName(CtrHanddruk.class.getName()); addRequest.getObjects().add(new ReqDataObject(d.toDataObject())); } protected void addedDialog(Dialog d,ReqAdd addExampleRequest,ReqAdd addVariableRequest) { if (d.getName().equals(EN_SELF_INTRODUCTION)) { for (int i = 0; i < Symbol.LINE_END_SYMBOLS.length; i++) { String lineEnd = Symbol.LINE_END_SYMBOLS[i]; for (int i2 = 0; i2 < 5; i2++) { String greeting = "Hello"; if (i2==1) { greeting = "Hi"; } else if (i2==2) { greeting = "Good morning"; } else if (i2==3) { greeting = "Good afternoon"; } else if (i2==4) { greeting = "Good evening"; } addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,EN_SELF_INTRODUCTION_INTRO1); addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,EN_SELF_INTRODUCTION_INTRO2); addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,EN_SELF_INTRODUCTION_INTRO3); } for (int i2 = 0; i2 < 3; i2++) { String thankYou = "Thank you"; if (i2==1) { thankYou = "Thanks"; } else if (i2==2) { thankYou = "Thank you very much"; } addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,EN_SELF_INTRODUCTION_RETURN1); addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,EN_SELF_INTRODUCTION_RETURN2); addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,EN_SELF_INTRODUCTION_RETURN3); } } } else if (d.getName().equals(NL_SELF_INTRODUCTION)) { for (int i = 0; i < Symbol.LINE_END_SYMBOLS.length; i++) { String lineEnd = Symbol.LINE_END_SYMBOLS[i]; for (int i2 = 0; i2 < 5; i2++) { String greeting = "Hallo"; if (i2==1) { greeting = "Hoi"; } else if (i2==2) { greeting = "Goedemorgen"; } else if (i2==3) { greeting = "Goedemiddag"; } else if (i2==4) { greeting = "Goedenavond"; } addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,NL_SELF_INTRODUCTION_INTRO1); addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,NL_SELF_INTRODUCTION_INTRO2); addDialogExampleToRequestForDialogId(d.getId(),greeting + lineEnd,NL_SELF_INTRODUCTION_INTRO3); } for (int i2 = 0; i2 < 6; i2++) { String thankYou = "Dank je"; if (i2==1) { thankYou = "Dankjewel"; } else if (i2==2) { thankYou = "Dank je wel"; } else if (i2==3) { thankYou = "Dank u"; } else if (i2==3) { thankYou = "Dank u wel"; } else if (i2==4) { thankYou = "Dankuwel"; } else if (i2==5) { thankYou = "Bedankt"; } addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,NL_SELF_INTRODUCTION_RETURN1); addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,NL_SELF_INTRODUCTION_RETURN2); addDialogExampleToRequestForDialogId(d.getId(),thankYou + lineEnd,NL_SELF_INTRODUCTION_RETURN3); } } } else if (d.getName().equals(EN_HANDSHAKE)) { for (int i = 0; i < Symbol.LINE_END_SYMBOLS.length; i++) { String lineEnd = Symbol.LINE_END_SYMBOLS[i]; for (int i2 = 0; i2 < 4; i2++) { String name = EN_HANDSHAKE_VAR_HUMAN; String out = "Nice to interact with you again, " + EN_HANDSHAKE_VAR_HUMAN + "."; if (i2==1) { name = EN_HANDSHAKE_VAR_FIRSTNAME; out = "Nice to interact with you again, " + EN_HANDSHAKE_VAR_FIRSTNAME + "."; } else if (i2==2) { name = EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME; out = "Nice to meet you."; } else if (i2==3) { name = EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME; out = "Nice to meet you."; } if (!lineEnd.equals("?")) { addDialogExampleToRequestForDialogId(d.getId(),"It's " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"It is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"My name is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I am " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I'm " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Greetings my name is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Greetings, my name is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Greetings I am " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Greetings, I'm " + name + lineEnd,out); } else { addDialogExampleToRequestForDialogId(d.getId(),"My name is " + name + ", what's yours" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"My name is " + name + ", what is yours" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I am " + name + ", who are you" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I'm " + name + ", who are you"+ lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"My name is " + name + lineEnd + " what's yours" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"My name is " + name + lineEnd + " what is yours" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I am " + name + lineEnd + " who are you" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"I'm " + name + lineEnd + " who are you"+ lineEnd,out); } } } addDialogVariableToRequestForDialogId(d.getId(),EN_HANDSHAKE_VAR_FIRSTNAME,PtnObject.TYPE_ALPHABETIC,EN_HANDSHAKE_VAR_FIRSTNAME_CONTEXT, "My name is " + selfPattern + ", what is yours?", "I am " + selfPattern + ", what is yours?", "I am " + selfPattern + ", who are you?" ); addDialogVariableToRequestForDialogId(d.getId(),EN_HANDSHAKE_VAR_LASTNAME,PtnObject.TYPE_ALPHABETIC,EN_HANDSHAKE_VAR_LASTNAME_CONTEXT, "What is your lastname?","What's your lastname?","Your lastname?" ); addDialogVariableToRequestForDialogId(d.getId(),EN_HANDSHAKE_VAR_CONFIRMATION,PtnObject.TYPE_CONFIRMATION,EN_HANDSHAKE_VAR_CONFIRMATION_CONTEXT, "Would you like me to rememeber you for future interactions?", "Do you want me to remember you for future interactions?", "Shall I rememeber you for future interactions?" ); addDialogVariableToRequestForDialogId(d.getId(),EN_HANDSHAKE_VAR_PREPOSITION,PtnObject.TYPE_PREPOSITION,EN_HANDSHAKE_VAR_PREPOSITION_CONTEXT, "What is your prepostion?","What's your prepostion?","Your lastname preposition?" ); addDialogVariableToRequestForDialogId(d.getId(),EN_HANDSHAKE_VAR_HUMAN,PtnObject.TYPE_OBJECT,EN_HANDSHAKE_VAR_HUMAN_CONTEXT, "My name is " + selfPattern + ", what is yours?", "I am " + selfPattern + ", what is yours?", "I am " + selfPattern + ", who are you?" ); } else if (d.getName().equals(NL_HANDSHAKE)) { for (int i = 0; i < Symbol.LINE_END_SYMBOLS.length; i++) { String lineEnd = Symbol.LINE_END_SYMBOLS[i]; for (int i2 = 0; i2 < 4; i2++) { String name = NL_HANDSHAKE_VAR_HUMAN; String out = "Leuk om weer met u een interactie aan te gaan, " + NL_HANDSHAKE_VAR_HUMAN + "."; if (i2==1) { name = NL_HANDSHAKE_VAR_FIRSTNAME; out = "Leuk om weer met u een interactie aan te gaan, " + NL_HANDSHAKE_VAR_FIRSTNAME + "."; } else if (i2==2) { name = NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_LASTNAME; out = "Aangenaam."; } else if (i2==3) { name = NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME; out = "Aangenaam."; } if (!lineEnd.equals("?")) { addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik ben " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik heet " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet, mijn naam is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet, ik ben " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet, ik heet " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet mijn naam is " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet ik ben " + name + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Gegroet ik heet " + name + lineEnd,out); } else { addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is de uwe" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is die van u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is uw naam" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is de jouwe" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is die van jouw" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),name + ", wat is jouw naam" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik ben " + name + ", wie bent u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik ben " + name + ", wie ben jij" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik heet " + name + ", hoe heet u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik heet " + name + ", hoe heet jij" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is de uwe" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is die van u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is uw naam" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is de jouwe" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is die van jouw" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Mijn naam is " + name + lineEnd + " wat is jouw naam" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik ben " + name + lineEnd + " wie bent u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik ben " + name + lineEnd + " wie ben je" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik heet " + name + lineEnd + " hoe heet u" + lineEnd,out); addDialogExampleToRequestForDialogId(d.getId(),"Ik heet " + name + lineEnd + " hoe heet je" + lineEnd,out); } } } addDialogVariableToRequestForDialogId(d.getId(),NL_HANDSHAKE_VAR_FIRSTNAME,PtnObject.TYPE_ALPHABETIC,NL_HANDSHAKE_VAR_FIRSTNAME_CONTEXT, "Mijn naam is " + selfPattern + ", wat is die van u?", "Ik heet " + selfPattern + ", hoe heet u?", "I ben " + selfPattern + ", wie bent u?" ); addDialogVariableToRequestForDialogId(d.getId(),NL_HANDSHAKE_VAR_LASTNAME,PtnObject.TYPE_ALPHABETIC,NL_HANDSHAKE_VAR_LASTNAME_CONTEXT, "Wat is uw achternaam?","Wat is uw volledige achternaam?","Uw achternaam?" ); addDialogVariableToRequestForDialogId(d.getId(),NL_HANDSHAKE_VAR_CONFIRMATION,PtnObject.TYPE_CONFIRMATION,NL_HANDSHAKE_VAR_CONFIRMATION_CONTEXT, "Wilt u dat ik u onthoud voor toekomstige interacties?", "Moet ik u onthouden voor toekomstige interacties?", "zal ik u onthouden voor toekomstige interacties?" ); addDialogVariableToRequestForDialogId(d.getId(),NL_HANDSHAKE_VAR_PREPOSITION,PtnObject.TYPE_PREPOSITION,NL_HANDSHAKE_VAR_PREPOSITION_CONTEXT, "What is uw prepositie?","Wat is uw achternaam prepositie?","Uw achternaam prepositie?" ); addDialogVariableToRequestForDialogId(d.getId(),NL_HANDSHAKE_VAR_HUMAN,PtnObject.TYPE_OBJECT,NL_HANDSHAKE_VAR_HUMAN_CONTEXT, "Mijn naam is " + selfPattern + ", wat is die van u?", "Ik heet " + selfPattern + ", hoe heet u?", "I ben " + selfPattern + ", wie bent u?" ); } } protected void addedDialogVariable(DialogVariable dv,ReqAdd addVariableExampleRequest) { for (int i = 0; i < Symbol.LINE_END_SYMBOLS.length; i++) { String lineEnd = Symbol.LINE_END_SYMBOLS[i]; if (!lineEnd.equals("?")) { addDialogVariableExampleToRequestForDialogVariable(dv,dv.getCode() + lineEnd); // ENGLISH if (dv.getCode().equals(EN_HANDSHAKE_VAR_HUMAN) || dv.getCode().equals(EN_HANDSHAKE_VAR_FIRSTNAME)) { addDialogVariableExampleToRequestForDialogVariable(dv,"My name is " + EN_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"I am " + EN_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"My name is " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"My name is " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"I am " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"I am " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_FIRSTNAME + " " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); } else if (dv.getCode().equals(EN_HANDSHAKE_VAR_LASTNAME)) { addDialogVariableExampleToRequestForDialogVariable(dv,EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,EN_HANDSHAKE_VAR_LASTNAME + ", " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"My lastname is " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"My lastname is " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"My lastname is " + EN_HANDSHAKE_VAR_LASTNAME + ", " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_LASTNAME + ", " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_PREPOSITION + " " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_LASTNAME + ", " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); } else if (dv.getCode().equals(EN_HANDSHAKE_VAR_PREPOSITION)) { addDialogVariableExampleToRequestForDialogVariable(dv,"My preposition is " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It's " + EN_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"It is " + EN_HANDSHAKE_VAR_LASTNAME + lineEnd); // DUTCH } else if (dv.getCode().equals(NL_HANDSHAKE_VAR_HUMAN) || dv.getCode().equals(NL_HANDSHAKE_VAR_FIRSTNAME)) { addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn naam is " + NL_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Ik ben " + NL_HANDSHAKE_VAR_HUMAN + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn naam is " + NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn naam is " + NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Ik ben " + NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Ik ben " + NL_HANDSHAKE_VAR_FIRSTNAME + " " + NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); } else if (dv.getCode().equals(NL_HANDSHAKE_VAR_LASTNAME)) { addDialogVariableExampleToRequestForDialogVariable(dv,NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,NL_HANDSHAKE_VAR_LASTNAME + ", " + NL_HANDSHAKE_VAR_PREPOSITION + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn achternaam is " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn achternaam is " + NL_HANDSHAKE_VAR_PREPOSITION + " " + NL_HANDSHAKE_VAR_LASTNAME + lineEnd); addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn achternaam is " + NL_HANDSHAKE_VAR_LASTNAME + ", " + NL_HANDSHAKE_VAR_PREPOSITION + lineEnd); } else if (dv.getCode().equals(NL_HANDSHAKE_VAR_PREPOSITION)) { addDialogVariableExampleToRequestForDialogVariable(dv,"Mijn prepositie is " + NL_HANDSHAKE_VAR_PREPOSITION + lineEnd); } } } } @Override protected boolean installExamplesAndAssignments() { return false; } @Override protected boolean installCrawlers() { return false; } @Override protected Control createControlObject() { Control control = super.createControlObject(); control.setAutoReactivate(false); control.setCountSymbolMaximum(2000); control.setSkipCountMaxStructSyms(false); control.setLevelFireBase(500); control.setDoAssignments(false); control.setAssignmentPauzeMSecs(0); control.setAssignmentReloadSecs(0); control.setStateHistoryMaximum(60); return control; } @Override protected void generateInitialData() { super.generateInitialData(); Messenger.getInstance().debug(this,"Generating initial ZIDS data ..."); // Add self self = SvrControllerSelf.getInstance().getSelf(); selfPattern = PtnObject.TYPE_OBJECT + "_" + ZIDSModel.SELF_CLASS_FULL_NAME + ":" + self.getId(); // Add humans setDone(false); addHumanRequest.addSubscriber(this); addHumansToAddHumanRequest(addHumanRequest); DbRequestQueue.getInstance().addRequest(addHumanRequest,this); waitTillDone("Generating initial ZIDS data was interrupted"); // Add assignment setDone(false); Assignment as = new Assignment(); as.setName(ZIDSModel.SESSION_HANDLING_ASSIGNMENT_NAME); as.setLogExtended(true); as.setContextDynamic(true); as.setCorrectInput(true); addAssignmentRequest.getObjects().add(new ReqDataObject(as.toDataObject())); addAssignmentRequest.addSubscriber(this); DbRequestQueue.getInstance().addRequest(addAssignmentRequest,this); waitTillDone("Generating initial ZIDS data was interrupted"); // Add dialogs setDone(false); addVariableTypeRequest.addSubscriber(this); for (int i = 0; i<PtnObject.TYPES.length; i++) { VariableType vt = new VariableType(); vt.setName(PtnObject.TYPES[i]); addVariableTypeRequest.getObjects().add(new ReqDataObject(vt.toDataObject())); } DbRequestQueue.getInstance().addRequest(addVariableTypeRequest,this); waitTillDone("Generating initial ZIDS data was interrupted"); Messenger.getInstance().debug(this,"Generated initial ZIDS data"); } @Override protected void handleRequestEvent(ReqObject request, EvtEvent evt) { if (request.hasError()) { Messenger.getInstance().error(this,"Error executing request: " + request.getErrors().get(0).getMessage() + ", class: " + request.getClassName()); setDone(true); } else if (request==addHumanRequest) { setDone(true); } else if (request==addVariableTypeRequest) { getVariableTypeRequest.addSubscriber(this); getVariableTypeRequest.getProperties().add(ReqGet.ALL_PROPERTIES); DbRequestQueue.getInstance().addRequest(getVariableTypeRequest,this); } else if (request==getVariableTypeRequest) { for (ReqDataObject object: getVariableTypeRequest.getObjects()) { VariableType vt = new VariableType(); vt.fromDataObject(object.getDataObject()); variableTypeNameIdMap.put(vt.getName(),vt.getId()); } addDialogsToAddDialogRequest(addDialogRequest); addDialogRequest.addSubscriber(this); DbRequestQueue.getInstance().addRequest(addDialogRequest,this); } else if (request==addDialogRequest) { getDialogRequest.addSubscriber(this); getDialogRequest.getProperties().add(ReqGet.ALL_PROPERTIES); DbRequestQueue.getInstance().addRequest(getDialogRequest,this); } else if (request==getDialogRequest) { for (ReqDataObject object: getDialogRequest.getObjects()) { Dialog d = new Dialog(); d.fromDataObject(object.getDataObject()); addedDialog(d,addDialogExampleRequest,addDialogVariableRequest); } addDialogExampleRequest.addSubscriber(this); DbRequestQueue.getInstance().addRequest(addDialogExampleRequest,this); } else if (request==addDialogExampleRequest) { addDialogExampleRequest.getObjects().clear(); addDialogVariableRequest.addSubscriber(this); DbRequestQueue.getInstance().addRequest(addDialogVariableRequest,this); } else if (request==addDialogVariableRequest) { addDialogVariableRequest.getObjects().clear(); getDialogVariableRequest.addSubscriber(this); getDialogVariableRequest.getProperties().add(ReqGet.ALL_PROPERTIES); DbRequestQueue.getInstance().addRequest(getDialogVariableRequest,this); } else if (request==getDialogVariableRequest) { for (ReqDataObject object: getDialogVariableRequest.getObjects()) { DialogVariable dv = new DialogVariable(); dv.fromDataObject(object.getDataObject()); addedDialogVariable(dv,addDialogVariableExampleRequest); } addDialogVariableExampleRequest.addSubscriber(this); DbRequestQueue.getInstance().addRequest(addDialogVariableExampleRequest,this); } else if (request==addDialogVariableExampleRequest) { addDialogVariableExampleRequest.getObjects().clear(); setDone(true); } else if (request==addAssignmentRequest) { setDone(true); } } protected void addDialogExampleToRequestForDialogId(long dialogId, String input, String output) { DialogExample de = new DialogExample(); de.setDialogId(dialogId); de.setInput(new StringBuilder(input)); de.setOutput(new StringBuilder(output)); addDialogExampleRequest.getObjects().add(new ReqDataObject(de.toDataObject())); } protected void addDialogVariableToRequestForDialogId(long dialogId, String code,String type,String contextSymbol,String prompt1,String prompt2,String prompt3) { DialogVariable dv = new DialogVariable(); dv.setDialogId(dialogId); dv.setContextSymbol(contextSymbol); dv.setPrompt1(new StringBuilder(prompt1)); dv.setPrompt2(new StringBuilder(prompt2)); dv.setPrompt3(new StringBuilder(prompt3)); dv.setCode(code); dv.setTypeId(variableTypeNameIdMap.get(type)); addDialogVariableRequest.getObjects().add(new ReqDataObject(dv.toDataObject())); } protected void addDialogVariableExampleToRequestForDialogVariable(DialogVariable variable, String output) { addDialogVariableExampleToRequestForDialogVariableId(variable.getId(),variable.getPrompt1().toString(),output); if (variable.getPrompt2().length()>0) { addDialogVariableExampleToRequestForDialogVariableId(variable.getId(),variable.getPrompt2().toString(),output); } if (variable.getPrompt3().length()>0) { addDialogVariableExampleToRequestForDialogVariableId(variable.getId(),variable.getPrompt3().toString(),output); } } private void addDialogVariableExampleToRequestForDialogVariableId(long variableId, String input, String output) { DialogVariableExample dve = new DialogVariableExample(); dve.setVariableId(variableId); dve.setInput(new StringBuilder(input)); dve.setOutput(new StringBuilder(output)); addDialogVariableExampleRequest.getObjects().add(new ReqDataObject(dve.toDataObject())); } protected final void addHumanToAddHumanRequest(ReqAdd addRequest,String name,String emailAddress) { Human human = new Human(); human.setName(name); human.setEmailAddress(emailAddress); addRequest.getObjects().add(new ReqDataObject(human.toDataObject())); } }
DyzLecticus/Zeesoft
V2.0/ZIDS/src/nl/zeesoft/zids/database/model/ZIDSDataGenerator.java
3,088
package views; import enumerations.GameState; import enumerations.Role; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.layout.HBox; import models.Competition; import models.Game; import views.components.GameCell; import java.util.Objects; import java.util.function.Predicate; public class GameListView extends View { @FXML private HBox comboBox; @FXML private SplitPane lists; @FXML private Accordion gameLists; @FXML private Accordion compGameLists; @FXML private TextField filterField; @FXML private ListView<Game> myCompGamesList; @FXML private ListView<Game> myGamesList; @FXML private ListView<Game> allGamesList; @FXML private ListView<Game> allCompGamesList; @FXML private TitledPane myCompGamesPane; @FXML private TitledPane myGamesPane; @FXML private TitledPane allCompGamesPane; @FXML private TitledPane allGamesPane; @FXML private ChoiceBox<GameState> gameStateBox; @FXML private ChoiceBox<Role> userRoleBox; private FilteredList<Game> filteredGames; private Predicate<Game> filterText, filterComp, filterUser; public void refresh() { setChoiceBoxes(); setViewingMode(false, null); applyViewingMode(false); showCompGames(competitionController.getSelectedCompetition(), false); myGamesList.refresh(); allCompGamesList.refresh(); allGamesList.refresh(); myCompGamesList.refresh(); } @Override public void clear() { } @Override public void constructor() { userRoleBox.prefWidthProperty().bind(comboBox.widthProperty().divide(2)); gameStateBox.prefWidthProperty().bind(comboBox.widthProperty().divide(2)); filteredGames = new FilteredList<>(gameController.getGames()); gameStateBox.getItems().setAll(GameState.PLAYING, GameState.FINISHED, GameState.RESIGNED); setChoiceBoxes(); //define the filters for different lists filterText = game -> game.toString().toLowerCase().contains(filterField.getText().toLowerCase()); filterComp = game -> competitionController.getSelectedCompetition() != null && competitionController.getSelectedCompetition().getGames().contains(game); filterUser = game -> game.getPlayers().contains(session.getCurrentUser()); //when player changes to observer or player hide and show proper stuff in view userRoleBox.setOnAction(event -> applyViewingMode(true)); //add listener to gameStateBox and search field that filters the games when changed gameStateBox.setOnAction(event -> filter(gameStateBox.getValue())); filterField.textProperty().addListener(observable -> filter(gameStateBox.getValue())); //add action listeners to lists myGamesList.setOnMouseClicked(event -> selectGame(myGamesList.getSelectionModel().getSelectedItem())); allGamesList.setOnMouseClicked(event -> selectGame(allGamesList.getSelectionModel().getSelectedItem())); myCompGamesList.setOnMouseClicked(event -> selectGame(myCompGamesList.getSelectionModel().getSelectedItem())); allCompGamesList.setOnMouseClicked(event -> selectGame(allCompGamesList.getSelectionModel().getSelectedItem())); //fill all lists and select default viewing mode allGamesList.setItems(filteredGames); myGamesList.setItems(filteredGames.filtered(filterUser)); applyViewingMode(true); setViewingMode(true, null); showCompGames(null, false); //set custom cell allGamesList.setCellFactory(param -> new GameCell(session.getCurrentUser())); myGamesList.setCellFactory(param -> new GameCell(session.getCurrentUser())); myCompGamesList.setCellFactory(param -> new GameCell(session.getCurrentUser())); allCompGamesList.setCellFactory(param -> new GameCell(session.getCurrentUser())); //when a competition is selected elsewhere(and has games/users, show or hide the lists, and update titles competitionController.selectedCompetitionProperty() .addListener((o, oldValue, newValue) -> { if (!Objects.equals(newValue, oldValue)) showCompGames(newValue, true); }); } private void applyViewingMode(boolean isNew) { gameController.setCurrentRole(userRoleBox.getValue()); if (isNew) showAllPanes(false); if (userRoleBox.getValue() == Role.PLAYER) { showAllPanes(false); gameStateBox.setVisible(false); gameStateBox.getSelectionModel().select(GameState.PLAYING); gameLists.setExpandedPane(myGamesPane); compGameLists.setExpandedPane(myCompGamesPane); } else if (userRoleBox.getValue() == Role.OBSERVER && isNew) { showAllPanes(true); gameStateBox.getSelectionModel().select(GameState.FINISHED); gameStateBox.setVisible(true); gameLists.setExpandedPane(allGamesPane); compGameLists.setExpandedPane(allCompGamesPane); } } private void showAllPanes(boolean showAll) { if (showAll) { compGameLists.getPanes().add(allCompGamesPane); gameLists.getPanes().add(allGamesPane); } else { compGameLists.getPanes().remove(allCompGamesPane); gameLists.getPanes().remove(allGamesPane); } } private void showCompGames(Competition newValue, boolean isNew) { if (newValue != null && !newValue.getPlayers().isEmpty()) { if (!lists.getItems().contains(compGameLists)) lists.getItems().add(compGameLists); allCompGamesPane.setText("Alle spellen binnen: " + newValue.toString()); allCompGamesList.setItems(filteredGames.filtered(filterComp)); myCompGamesPane.setText("Mijn spellen binnen: " + newValue.toString()); myCompGamesList.setItems(filteredGames.filtered(filterComp.and(filterUser))); if (isNew) { lists.setDividerPosition(0, 0.5); compGameLists.setExpandedPane(myCompGamesPane); } } else lists.getItems().remove(compGameLists); } private void setChoiceBoxes() { ObservableList<Role> roles = session.getCurrentUser().getRoles() .filtered(role -> role == Role.OBSERVER || role == Role.PLAYER) .sorted(); if (userRoleBox.getItems().size() != roles.size()) { Role previous = userRoleBox.getValue(); userRoleBox.getItems().setAll(roles); setViewingMode(false, previous); } } private void setViewingMode(boolean firstTime, Role select) { if (firstTime) { if (session.getCurrentUser().hasRole(Role.PLAYER)) userRoleBox.getSelectionModel().select(Role.PLAYER); else userRoleBox.getSelectionModel().select(Role.OBSERVER); } else { if (!session.getCurrentUser().hasRole(Role.OBSERVER)) userRoleBox.getSelectionModel().select(Role.PLAYER); if (!session.getCurrentUser().hasRole(Role.PLAYER)) userRoleBox.getSelectionModel().select(Role.OBSERVER); if (select != null) userRoleBox.getSelectionModel().select(select); } } private void filter(GameState state) { filteredGames.setPredicate(filterText.and(game -> game.getGameState() == state)); } private void selectGame(Game game) { if (game != null) { gameController.setSelectedGame(game); gameController.loadGame(gameController.getSelectedGame()); gameController.setSelectedTurn(game.getLastTurn()); parent.reload(); parent.setContent(parent.gameBoardView); parent.setTab(parent.gameControlView); } } }
InteNs/WordFeud-Groep-J
src/views/GameListView.java
3,089
import javax.swing.*; import javax.swing.Timer; import javax.swing.border.Border; import javax.swing.border.LineBorder; import javax.xml.crypto.Data; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.util.*; import java.util.concurrent.TimeUnit; /** * Created by casde on 9-6-2016. */ public class MemoryClient extends JPanel implements Finals { private ArrayList<ArrayList<Card>> board; private ArrayList<Card> selectedCards; private ArrayList<Integer> cardColors; private DataOutputStream toServer; private DataInputStream fromServer; private int cardNr; private boolean myTurn; private int nrOfEmptyRows; private boolean twoCardsSelected; private int noot = 3000; private JTextArea area; private String text; private int playerNr; private long oldTime = 0; private final double animationTimer; private MyTimer timer; private int i; public MemoryClient() { setLayout(null); area = new JTextArea(); area.setEditable(false); area.setBounds(450,0,430,440); Border border = new LineBorder(Color.BLACK); area.setBorder(border); selectedCards = new ArrayList<>(); board = new ArrayList<>(); board.add(new ArrayList<Card>()); myTurn = false; animationTimer = 1000; addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if(myTurn) { int x = e.getX(); int y = e.getY(); //System.out.println("CLICKED AT: " + x + "----" + y); getSelectedCard(x, y); sendMove(x, y); } } }); connectToServer(); text = " Hoi speler: " + playerNr; area.setText(text); this.add(area); new Timer(1000, e -> repaint()).start(); setPreferredSize(new Dimension(800,800)); setVisible(true); //new Timer(1000/60, e -> checkIfTurn()).start(); } public void connectToServer() { try { // Create a socket to connect to the server Socket socket = new Socket("localhost", 1337); // Create an input stream to receive data from the server fromServer = new DataInputStream(socket.getInputStream()); // Create an output stream to send data to the server toServer = new DataOutputStream(socket.getOutputStream()); // Get notification from the server int player = fromServer.readInt(); System.out.println(" i am player " + player); // Am I player 1 or 2? if (player == PLAYER1) { playerNr = 1; area.setText(text + "wachten op speler 2"); cardColors = new ArrayList<Integer>(); for(int i = 0; i < 16; i++) { cardColors.add(fromServer.readInt()); } twoCardsSelected = false; cardNr = 0; createRecursiveBoard(0,0,100,100); // The other player has joined new Thread(new ClientListener(socket)).start(); } else if (player == PLAYER2) { playerNr = 2; System.out.println("Player2"); cardColors = new ArrayList<Integer>(); for(int ii = 0; ii < 16; ii++) { cardColors.add(fromServer.readInt()); } //Collections.shuffle(cardColors); System.out.println("creating board"); createRecursiveBoard(0,0,100,100); twoCardsSelected = false; cardNr = 0; System.out.println("Player 2"); area.setText(text + "wachten op speler 1"); new Thread(new ClientListener(socket)).start(); } } catch (Exception e) { e.printStackTrace(); } } public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; nrOfEmptyRows = 0; Iterator<ArrayList<Card>> it = board.iterator(); { while(it.hasNext()) { ArrayList<Card> cards = it.next(); if (cards.isEmpty()) { nrOfEmptyRows++; } else { for (Card card : cards) { card.draw(g2); } } } } } public void createRecursiveBoard(int x, int y, int width, int height) { if(y == 4) { } else if(x == 3) { board.get(y).add(new Card(x * width + x * 10, y * height + y * 10, 100,100,cardColors.get(cardNr))); cardNr++; x = 0; y++; board.add(new ArrayList<>()); createRecursiveBoard(x,y,width,height); } else { board.get(y).add(new Card(x * width + x * 10, y * height + y * 10, 100,100,cardColors.get(cardNr))); cardNr++; x++; createRecursiveBoard(x, y, width, height); } } public static void main(String[] arg) { MemoryClient panel = new MemoryClient(); JFrame frame = new JFrame("MemoryClient player " + panel.getPlayerNr()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(panel); frame.setSize(new Dimension(800,800)); frame.setVisible(true); } private void receiveMove() throws IOException { // Get the other player's move int x = fromServer.readInt(); int y = fromServer.readInt(); System.out.println(x + "----" + y + " received"); getSelectedCard(x,y); } private void sendMove(int x, int y){ try { toServer.writeInt(x); // Send the selected row toServer.writeInt(y); // Send the selected column System.out.println(x + " ----- " + y + " send "); } catch(Exception e) { e.printStackTrace(); } } public void getSelectedCard(int x, int y) { if (nrOfEmptyRows == 4) { } for (ArrayList<Card> cards : board) { for (Card card : cards) { if (card.getRect().contains(x, y)) { if (!twoCardsSelected) { if (!selectedCards.contains(card)) { card.flip(); selectedCards.add(card); repaint(); checkCards(); break; } } } } } } Timer flipTimer = null; public void checkCards() { if (selectedCards.size() >= 2) { flipTimer = new Timer(100, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { flipTimer.stop(); twoCardsSelected = true; Card card1 = selectedCards.get(0); Card card2 = selectedCards.get(1); if (card1.compareTo(card2) == 1) { selectedCards.clear(); board.get(card1.getY()).remove(card1); board.get(card2.getY()).remove(card2); if (myTurn) { noot = MATCH_FOUND; toServer.writeInt(noot); //toServer.writeInt(20); System.out.println("MATCH_FOUND"); } twoCardsSelected = false; } else { card1.flip(); card2.flip(); if (myTurn) { noot = NO_MATCH_FOUND; toServer.writeInt(noot); //toServer.writeInt(20); System.out.println("MATCH_NOT_FOUND"); } selectedCards.clear(); twoCardsSelected = false; } toServer.writeInt(IS_CHECKED); }catch(Exception ew){ew.printStackTrace();} } }); flipTimer.start(); } } public int getPlayerNr() { return playerNr; } class ClientListener implements Runnable { private Socket clientSocket; public ClientListener(Socket socket) { this.clientSocket = socket; } @Override public void run() { try { while(true) { fromServer = new DataInputStream(clientSocket.getInputStream()); int status = fromServer.readInt(); if (status == MY_TURN) { System.out.println(" myturn "); area.setText(text + " \n het is mijn beurt"); myTurn = true; } if (status == OPPONTENT_TURN) { area.setText(text + " \n het is niet mijn beurt"); System.out.println(" oppontents turn "); myTurn = false; receiveMove(); receiveMove(); } if(status == DRAW) { int myScore = fromServer.readInt(); int opponentScore = fromServer.readInt(); area.setText(text + " \n mijn score: " + myScore); area.setText(area.getText() + " \n tegenstanders score: " + opponentScore); area.setText(area.getText() + " \n gelijkspel"); System.out.println("player1 won"); } if (status == PLAYER1_WON) { int myScore = fromServer.readInt(); int opponentScore = fromServer.readInt(); area.setText(text + " \n mijn score: " + myScore); area.setText(area.getText() + " \n tegenstanders score: " + opponentScore); area.setText(area.getText() + " \n speler 1 heeft gewonnen"); System.out.println("player1 won"); } if (status == PLAYER2_WON) { int myScore = fromServer.readInt(); int opponentScore = fromServer.readInt(); area.setText(text + " \n mijn score: " + myScore); area.setText(area.getText() + " \n tegenstanders score: " + opponentScore); area.setText(area.getText() + " \n speler 2 heeft gewonnen"); System.out.println(" player2 won"); } } } catch(Exception e){e.printStackTrace();} } } }
Joshua-Latusia/Memory
src/MemoryClient.java
3,090
/** * Copyright (c) 2010-2023 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ package org.openhab.binding.windcentrale.internal.dto; import org.eclipse.jdt.annotation.NonNullByDefault; /** * Provides the details required for getting tokens using SRP from the Windcentrale Cognito user pool. * * @see https://mijn.windcentrale.nl/api/v0/labels/key?domain=mijn.windcentrale.nl * * @author Wouter Born - Initial contribution */ @NonNullByDefault public class KeyResponse { public String clientId = ""; public String region = ""; public String userPoolId = ""; }
digitaldan/openhab-addons
bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/dto/KeyResponse.java
3,091
package eu.newsreader.eventcoreference.naf; import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.tdb.TDBFactory; import eu.kyotoproject.kaf.KafEvent; import eu.kyotoproject.kaf.KafFactuality; import eu.kyotoproject.kaf.KafParticipant; import eu.kyotoproject.kaf.KafSaxParser; import eu.newsreader.eventcoreference.objects.NafMention; import eu.newsreader.eventcoreference.objects.PerspectiveObject; import eu.newsreader.eventcoreference.objects.SemActor; import eu.newsreader.eventcoreference.objects.SemObject; import eu.newsreader.eventcoreference.output.JenaSerialization; import eu.newsreader.eventcoreference.util.FrameTypes; import eu.newsreader.eventcoreference.util.RoleLabels; import eu.newsreader.eventcoreference.util.Util; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.riot.RDFFormat; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Vector; /** * Created by piek on 11/03/15. */ public class GetPerspectiveRelations { static public boolean FILTERA0 = true; static public void main (String[] args) { String comFrameFile = "/Code/vu/newsreader/EventCoreference/newsreader-vm/vua-eventcoreference_v2_2014/resources/communication.txt"; String contextualFrameFile = "/Code/vu/newsreader/EventCoreference/newsreader-vm/vua-eventcoreference_v2_2014/resources/contextual.txt"; String grammaticalFrameFile = "/Code/vu/newsreader/EventCoreference/newsreader-vm/vua-eventcoreference_v2_2014/resources/grammatical.txt"; Vector<String> communicationVector = Util.ReadFileToStringVector(comFrameFile); Vector<String> grammaticalVector = Util.ReadFileToStringVector(grammaticalFrameFile); Vector<String> contextualVector = Util.ReadFileToStringVector(contextualFrameFile); String project = "test"; String nafFilePath = ""; //nafFilePath = args[0]; nafFilePath = "/Users/piek/Desktop/NWR/NWR-DATA/LN_cars_NAF-2003_1001-2000/2003/1/1"; KafSaxParser kafSaxParser = new KafSaxParser(); ArrayList<File> files = Util.makeRecursiveFileList(new File(nafFilePath)); for (int i = 0; i < files.size(); i++) { File file = files.get(i); kafSaxParser.parseFile(file); String baseUri = kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; ArrayList<SemObject> semActors = new ArrayList<SemObject>(); ArrayList<SemObject> semEvents = new ArrayList<SemObject>(); String entityUri = ResourcesUri.nwrdata+project+"/entities/"; if (!baseUri.toLowerCase().startsWith("http")) { baseUri = ResourcesUri.nwrdata + project + "/" + kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; } GetSemFromNaf.processNafFileForEventCoreferenceSets(baseUri, kafSaxParser, semEvents); GetSemFromNaf.processNafFileForEntityCoreferenceSets(entityUri, baseUri, kafSaxParser, semActors); GetSemFromNaf.processSrlForRemainingFramenetRoles(project, kafSaxParser, semActors); ArrayList<PerspectiveObject> perspectives = getPerspective(baseUri, kafSaxParser, semEvents, contextualVector, communicationVector, grammaticalVector); perspectives = selectSourceEntityToPerspectives(kafSaxParser, perspectives, semActors); for (int j = 0; j < perspectives.size(); j++) { PerspectiveObject perspectiveObject = perspectives.get(j); // System.out.println("perspectiveObject.toString() = " + perspectiveObject.toString()); } } } /** * @Get perspective objects from sources in the text * @param kafSaxParser * @param semActors * @return */ static public ArrayList<PerspectiveObject> getSourcePerspectives (KafSaxParser kafSaxParser, ArrayList<SemObject> semActors, ArrayList<SemObject> semEvents, NafSemParameters nafSemParameters) { String baseUri = kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; if (!baseUri.toLowerCase().startsWith("http")) { baseUri = ResourcesUri.nwrdata + nafSemParameters.getPROJECT() + "/" + kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; } ArrayList<PerspectiveObject> perspectiveObjects = getPerspective(baseUri, kafSaxParser, semEvents, nafSemParameters.getContextualVector(), nafSemParameters.getSourceVector(), nafSemParameters.getGrammaticalVector()); if (FILTERA0) perspectiveObjects = selectSourceEntityToPerspectives(kafSaxParser, perspectiveObjects, semActors); else augmentPerspectivesWithSourceEntity(kafSaxParser, perspectiveObjects, semActors); return perspectiveObjects; } /** * @Get perspective objects assigned to authors, publisher, magazine, which is represented through the document itself * @param kafSaxParser * @param perspectiveObjects * @return */ static public ArrayList<PerspectiveObject> getAuthorPerspectives (KafSaxParser kafSaxParser,String project, ArrayList<PerspectiveObject> perspectiveObjects) { String url = kafSaxParser.getKafMetaData().getUrl(); if (!url.toLowerCase().startsWith("http")) { url = ResourcesUri.nwrdata + project + "/" + kafSaxParser.getKafMetaData().getUrl(); } String baseUrl = url + GetSemFromNaf.ID_SEPARATOR; SemActor semActor = new SemActor(SemObject.ENTITY); semActor.setId(url); ArrayList<PerspectiveObject> authorPerspectiveObjects = new ArrayList<PerspectiveObject>(); for (int i = 0; i < kafSaxParser.getKafEventArrayList().size(); i++) { KafEvent kafEvent = kafSaxParser.getKafEventArrayList().get(i); kafEvent.setTokenStrings(kafSaxParser); NafMention eventMention = Util.getNafMentionForTermIdArrayList(baseUrl, kafSaxParser, kafEvent.getSpanIds()); boolean hasPerspective = false; for (int j = 0; j < perspectiveObjects.size(); j++) { PerspectiveObject perspectiveObject = perspectiveObjects.get(j); for (int k = 0; k < perspectiveObject.getTargetEventMentions().size(); k++) { NafMention nafMention = perspectiveObject.getTargetEventMentions().get(k); if (nafMention.sameMention(eventMention)) { hasPerspective = true; break; } } } if (!hasPerspective) { //// we need to add the values here since we do not consider the SemEvent but the mention itself eventMention.addFactuality(kafSaxParser); eventMention.addOpinion(kafSaxParser); PerspectiveObject perspectiveObject = new PerspectiveObject(); perspectiveObject.setDocumentUri(baseUrl); perspectiveObject.setSourceEntity(semActor); /// this is not the document itself perspectiveObject.setPredicateId(kafEvent.getId()); perspectiveObject.setEventString(kafEvent.getTokenString()); perspectiveObject.setPredicateConcepts(kafEvent.getExternalReferences()); perspectiveObject.setPredicateSpanIds(kafEvent.getSpanIds()); perspectiveObject.setNafMention(baseUrl, kafSaxParser, kafEvent.getSpanIds()); perspectiveObject.addTargetEventMention(eventMention); // System.out.println("eventMention.getFactuality().size() = " + eventMention.getFactuality().size()); for (int p = 0; p < perspectiveObject.getTargetEventMentions().size(); p++) { NafMention mention = perspectiveObject.getTargetEventMentions().get(p); for (int j = 0; j < mention.getFactuality().size(); j++) { KafFactuality kafFactuality = mention.getFactuality().get(j); // System.out.println("kafFactuality.getPrediction() = " + kafFactuality.getPrediction()); } } authorPerspectiveObjects.add(perspectiveObject); } } return authorPerspectiveObjects; } static boolean authorPerspective (KafSaxParser kafSaxParser, String tokenString) { /// English if (tokenString.equalsIgnoreCase("i")) return true; if (tokenString.equalsIgnoreCase("we")) return true; if (tokenString.equalsIgnoreCase("us")) return true; if (tokenString.equalsIgnoreCase("me")) return true; if (tokenString.equalsIgnoreCase("our")) return true; if (tokenString.equalsIgnoreCase("mine")) return true; if (tokenString.equalsIgnoreCase("my")) return true; /// Dutch if (tokenString.equalsIgnoreCase("ik")) return true; if (tokenString.equalsIgnoreCase("we")) return true; if (tokenString.equalsIgnoreCase("wij")) return true; if (tokenString.equalsIgnoreCase("ons")) return true; if (tokenString.equalsIgnoreCase("onze")) return true; if (tokenString.equalsIgnoreCase("mijn")) return true; if (tokenString.equalsIgnoreCase("mij")) return true; if (tokenString.equalsIgnoreCase("me")) return true; return false; } static public void getPerspective(KafSaxParser kafSaxParser, ArrayList<PerspectiveObject> perspectives, ArrayList<SemObject> semEvents, NafSemParameters nafSemParameters) { String baseUri = kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; if (!baseUri.toLowerCase().startsWith("http")) { baseUri = ResourcesUri.nwrdata + nafSemParameters.getPROJECT() + "/" + kafSaxParser.getKafMetaData().getUrl() + GetSemFromNaf.ID_SEPARATOR; } ArrayList<PerspectiveObject> perspectiveObjects = getPerspective(baseUri,kafSaxParser, semEvents, nafSemParameters.getContextualVector(), nafSemParameters.getSourceVector(), nafSemParameters.getGrammaticalVector()); perspectives.addAll(perspectiveObjects); } static public ArrayList<PerspectiveObject> getPerspective (String baseUri, KafSaxParser kafSaxParser, ArrayList<SemObject> semEvents, Vector<String> contextualVector, Vector<String> communicationVector, Vector<String> grammaticalVector) { ArrayList<PerspectiveObject> perspectiveObjectArrayList = new ArrayList<PerspectiveObject>(); for (int i = 0; i < kafSaxParser.getKafEventArrayList().size(); i++) { KafEvent kafEvent = kafSaxParser.getKafEventArrayList().get(i); kafEvent.setTokenStrings(kafSaxParser); String lemma = kafSaxParser.getLemma(kafEvent.getSpanIds()); String eventType = FrameTypes.getEventTypeString(lemma, kafEvent.getExternalReferences(), contextualVector, communicationVector, grammaticalVector); if (!eventType.isEmpty()) { if (eventType.equalsIgnoreCase(FrameTypes.SOURCE)) { KafParticipant sourceParticipant = new KafParticipant(); KafParticipant targetParticipant = new KafParticipant(); /// next we get the A0 and message roles for (int k = 0; k < kafEvent.getParticipants().size(); k++) { KafParticipant kafParticipant = kafEvent.getParticipants().get(k); if (RoleLabels.hasSourceTarget(kafParticipant, communicationVector)) { targetParticipant = kafParticipant; } else if (RoleLabels.isPRIMEPARTICIPANT(kafParticipant.getRole())) { sourceParticipant = kafParticipant; } } // if (sourceParticipant!=null && targetParticipant !=null) { // System.out.println("targetParticipant.toString() = " + targetParticipant.toString()); sourceParticipant.setTokenStrings(kafSaxParser); targetParticipant.setTokenStrings(kafSaxParser); if (!authorPerspective(kafSaxParser, sourceParticipant.getTokenString())) { //// first person pronoun references are attributed to the author PerspectiveObject perspectiveObject = new PerspectiveObject(); perspectiveObject.setDocumentUri(baseUri); perspectiveObject.setPredicateId(kafEvent.getId()); perspectiveObject.setEventString(kafEvent.getTokenString()); perspectiveObject.setPredicateConcepts(kafEvent.getExternalReferences()); perspectiveObject.setPredicateSpanIds(kafEvent.getSpanIds()); perspectiveObject.setSource(sourceParticipant); perspectiveObject.setTarget(targetParticipant); perspectiveObject.setCueMention(baseUri, kafSaxParser, kafEvent.getSpanIds()); perspectiveObject.setNafMention(baseUri, kafSaxParser, kafEvent.getSpanIds()); for (int j = 0; j < semEvents.size(); j++) { SemObject semEvent = semEvents.get(j); for (int k = 0; k < semEvent.getNafMentions().size(); k++) { NafMention nafMention = semEvent.getNafMentions().get(k); /// the factuality and sentiment are already assigned to the nafMention when building the SemEvent object if (!Collections.disjoint(targetParticipant.getSpanIds(), nafMention.getTermsIds())) { perspectiveObject.addTargetEventMention(nafMention); } } } perspectiveObjectArrayList.add(perspectiveObject); //} } else { ////first person pronouns are skipped and left to the author perspectives } } else { //System.out.println("eventType = " + eventType); } } } return perspectiveObjectArrayList; } static public HashMap<String, ArrayList<PerspectiveObject>> getPerspectiveMap (String baseUri, KafSaxParser kafSaxParser, ArrayList<SemObject> semEvents, Vector<String> contextualVector, Vector<String> communicationVector, Vector<String> grammaticalVector) { HashMap<String, ArrayList<PerspectiveObject>> perspectiveObjectHashMap = new HashMap<String, ArrayList<PerspectiveObject>>(); for (int i = 0; i < kafSaxParser.getKafEventArrayList().size(); i++) { KafEvent kafEvent = kafSaxParser.getKafEventArrayList().get(i); kafEvent.setTokenStrings(kafSaxParser); String lemma = kafSaxParser.getLemma(kafEvent.getSpanIds()); String eventType = FrameTypes.getEventTypeString(lemma,kafEvent.getExternalReferences(), contextualVector, communicationVector, grammaticalVector); if (!eventType.isEmpty()) { if (eventType.equalsIgnoreCase(FrameTypes.SOURCE)) { KafParticipant sourceParticipant = new KafParticipant(); KafParticipant targetParticipant = new KafParticipant(); /// next we get the A0 and message roles for (int k = 0; k < kafEvent.getParticipants().size(); k++) { KafParticipant kafParticipant = kafEvent.getParticipants().get(k); if (RoleLabels.hasSourceTarget(kafParticipant, communicationVector)) { targetParticipant = kafParticipant; } else if (RoleLabels.isPRIMEPARTICIPANT(kafParticipant.getRole())) { sourceParticipant = kafParticipant; } } // if (sourceParticipant!=null && targetParticipant !=null) { // System.out.println("targetParticipant.toString() = " + targetParticipant.toString()); sourceParticipant.setTokenStrings(kafSaxParser); targetParticipant.setTokenStrings(kafSaxParser); PerspectiveObject perspectiveObject = new PerspectiveObject(); perspectiveObject.setDocumentUri(baseUri); perspectiveObject.setPredicateId(kafEvent.getId()); perspectiveObject.setEventString(kafEvent.getTokenString()); perspectiveObject.setPredicateConcepts(kafEvent.getExternalReferences()); perspectiveObject.setPredicateSpanIds(kafEvent.getSpanIds()); perspectiveObject.setSource(sourceParticipant); perspectiveObject.setTarget(targetParticipant); perspectiveObject.setCueMention(baseUri, kafSaxParser, kafEvent.getSpanIds()); perspectiveObject.setNafMention(baseUri, kafSaxParser, kafEvent.getSpanIds()); for (int j = 0; j < semEvents.size(); j++) { SemObject semEvent = semEvents.get(j); for (int k = 0; k < semEvent.getNafMentions().size(); k++) { NafMention nafMention = semEvent.getNafMentions().get(k); if (!Collections.disjoint(targetParticipant.getSpanIds(), nafMention.getTermsIds())) { perspectiveObject.addTargetEventMention(nafMention); } } } /*for (int j = 0; j < kafSaxParser.getKafEventArrayList().size(); j++) { if (j!=i) { KafEvent event = kafSaxParser.getKafEventArrayList().get(j); if (!Collections.disjoint(targetParticipant.getSpanIds(), event.getSpanIds())) { /// this event is embedded inside the target NafMention nafMention = Util.getNafMentionForTermIdArrayList(baseUri, kafSaxParser, event.getSpanIds()); //nafMention.addFactuality(kafSaxParser); /// already done when SemEvent is created perspectiveObject.addTargetEventMention(nafMention); } } }*/ for (int j = 0; j < perspectiveObject.getTargetEventMentions().size(); j++) { NafMention nafMention = perspectiveObject.getTargetEventMentions().get(j); if (perspectiveObjectHashMap.containsKey(nafMention.toString())) { ArrayList<PerspectiveObject> perspectiveObjectArrayList = perspectiveObjectHashMap.get(nafMention.toString()); perspectiveObjectArrayList.add(perspectiveObject); perspectiveObjectHashMap.put(nafMention.toString(), perspectiveObjectArrayList); } else { ArrayList<PerspectiveObject> perspectiveObjectArrayList = new ArrayList<PerspectiveObject>(); perspectiveObjectArrayList.add(perspectiveObject); perspectiveObjectHashMap.put(nafMention.toString(), perspectiveObjectArrayList); } } //} } } } return perspectiveObjectHashMap; } /** * Filters perspectives to select those that match with a given actor * @param kafSaxParser * @param perspectives * @param actors * @return */ static public ArrayList<PerspectiveObject> selectSourceEntityToPerspectives (KafSaxParser kafSaxParser, ArrayList<PerspectiveObject> perspectives, ArrayList<SemObject> actors) { ArrayList<PerspectiveObject> sourcePerspectives = new ArrayList<PerspectiveObject>(); for (int i = 0; i < perspectives.size(); i++) { PerspectiveObject perspectiveObject = perspectives.get(i); for (int j = 0; j < actors.size(); j++) { SemObject semActor = actors.get(j); if (Util.matchAllSpansOfAnObjectMentionOrTheRoleHead(kafSaxParser, perspectiveObject.getSource(), semActor)) { // System.out.println("semObject.getURI() = " + semActor.getURI()); perspectiveObject.setSourceEntity((SemActor)semActor); sourcePerspectives.add(perspectiveObject); } else { // System.out.println("perspectiveObject.Source = " + perspectiveObject.getSourceEntity().getURI()); } } } return sourcePerspectives; } /** * Filters perspectives to select those that match with a given actor * @param kafSaxParser * @param perspectives * @param actors * @return */ static public void augmentPerspectivesWithSourceEntity (KafSaxParser kafSaxParser, ArrayList<PerspectiveObject> perspectives, ArrayList<SemObject> actors) { for (int i = 0; i < perspectives.size(); i++) { PerspectiveObject perspectiveObject = perspectives.get(i); for (int j = 0; j < actors.size(); j++) { SemObject semActor = actors.get(j); if (Util.matchAllSpansOfAnObjectMentionOrTheRoleHead(kafSaxParser, perspectiveObject.getSource(), semActor)) { // System.out.println("semObject.getURI() = " + semActor.getURI()); perspectiveObject.setSourceEntity((SemActor)semActor); } else { // System.out.println("perspectiveObject.Source = " + perspectiveObject.getSource()); } } } } public static void perspectiveRelationsToTrig (String pathToTrigFile, ArrayList<PerspectiveObject> perspectiveObjects) { try { OutputStream fos = new FileOutputStream(pathToTrigFile); Dataset ds = TDBFactory.createDataset(); Model defaultModel = ds.getDefaultModel(); //ResourcesUri.prefixModel(defaultModel); // Model provenanceModel = ds.getNamedModel("http://www.newsreader-project.eu/perspective"); ResourcesUri.prefixModelGaf(defaultModel); String attrBase = pathToTrigFile+"_"; JenaSerialization.addJenaPerspectiveObjects(attrBase, ResourcesUri.grasp, "wasAttributedTo", perspectiveObjects, 1); RDFDataMgr.write(fos, ds, RDFFormat.TRIG_PRETTY); fos.close(); } catch (IOException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } public static void perspectiveRelationsToTrig (String pathToTrigFile, KafSaxParser kafSaxParser, String project, ArrayList<PerspectiveObject> sourcePerspectiveObjects, ArrayList<PerspectiveObject> authorPerspectiveObjects) { try { OutputStream fos = new FileOutputStream(pathToTrigFile); Dataset ds = TDBFactory.createDataset(); Model defaultModel = ds.getDefaultModel(); ResourcesUri.prefixModelGaf(defaultModel); ResourcesUri.prefixModelNwr(defaultModel); defaultModel.setNsPrefix("rdf", ResourcesUri.rdf); defaultModel.setNsPrefix("rdfs", ResourcesUri.rdfs); String docId = kafSaxParser.getKafMetaData().getUrl().replaceAll("#", "HASH"); if (!docId.toLowerCase().startsWith("http")) { docId = ResourcesUri.nwrdata + project + "/" + docId; } JenaSerialization.addDocMetaData(docId, kafSaxParser, project); String attrBase = kafSaxParser.getKafMetaData().getUrl()+"_"+"s"; JenaSerialization.addJenaPerspectiveObjects(attrBase, ResourcesUri.grasp, "wasAttributedTo", sourcePerspectiveObjects, 1); attrBase = kafSaxParser.getKafMetaData().getUrl()+"_"+"d"; JenaSerialization.addJenaPerspectiveObjects(attrBase, ResourcesUri.prov, "wasDerivedFrom", authorPerspectiveObjects, sourcePerspectiveObjects.size()+1); RDFDataMgr.write(fos, ds, RDFFormat.TRIG_PRETTY); fos.close(); } catch (IOException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } public static void perspectiveRelationsToTrigStream (OutputStream fos, String uri, ArrayList<PerspectiveObject> perspectiveObjects) { Dataset ds = TDBFactory.createDataset(); Model defaultModel = ds.getDefaultModel(); ResourcesUri.prefixModel(defaultModel); // Model provenanceModel = ds.getNamedModel("http://www.newsreader-project.eu/perspective"); ResourcesUri.prefixModelGaf(defaultModel); String attrBase = uri+"_"; JenaSerialization.addJenaPerspectiveObjects(attrBase, ResourcesUri.grasp,"wasAttributedTo", perspectiveObjects, 1); RDFDataMgr.write(fos, ds, RDFFormat.TRIG_PRETTY); } }
cltl/EventCoreference
src/main/java/eu/newsreader/eventcoreference/naf/GetPerspectiveRelations.java
3,092
import java.util.*; //DIJKSTRA //https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-in-java-using-priorityqueue/ class Pad implements Comparable<Pad> { public int som; public int afstand; public int x; public int y; Pad(int somC, int afstandC, int xC, int yC){ som=somC; afstand=afstandC; x=xC; y=yC; } @Override public int compareTo(Pad that) { return this.som != that.som ? Integer.compare(this.som, that.som) : Integer.compare(this.afstand, that.afstand); } } class Vergelijk{ boolean compareTo(Pad links, Pad rechts) { return links.som != rechts.som ? links.som > rechts.som : links.afstand > rechts.afstand; } } class Mijnenveld{ int[][]veld; int rijen; int kolommen; int lengte; int aantalMijnen; Mijnenveld(int[][] veld, int rijen, int kolommen){ this.veld=veld; this.rijen=rijen; this.kolommen=kolommen; } Pad dijkstra() { boolean[][] alGebruikt = new boolean[rijen][kolommen]; PriorityQueue<Pad> prioriteit = new PriorityQueue<Pad>(); for(int i=0; i<rijen; i++) { prioriteit.add(new Pad(0, 0, -1, i)); } while(prioriteit.peek().x != kolommen-1) { Pad p = prioriteit.peek(); prioriteit.poll(); if (p.x < 0 || !alGebruikt[p.y][p.x]) { if(p.x >= 0) alGebruikt[p.y][p.x] = true; prioriteit.add( new Pad(p.som + veld[p.y][p.x + 1], p.afstand + 1, p.x + 1, p.y)); if (p.x > 0) prioriteit.add( new Pad(p.som + veld[p.y][p.x - 1], p.afstand + 1, p.x - 1, p.y)); if (p.x >= 0 && p.y > 0) prioriteit.add( new Pad(p.som + veld[p.y - 1][p.x], p.afstand + 1, p.x, p.y - 1)); if (p.x >= 0 && p.y < rijen - 1) prioriteit.add( new Pad(p.som + veld[p.y + 1][p.x], p.afstand + 1, p.x, p.y + 1)); } } return prioriteit.peek(); } } public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //inlezen int aantalTestGevallen = Integer.parseInt(sc.nextLine()); for(int i=0; i<aantalTestGevallen; i++) { int rijen = Integer.parseInt(sc.next()); int kolommen = Integer.parseInt(sc.next()); int[][] veld = new int[rijen][kolommen]; for(int r=0; r<rijen; r++) { for(int k=0; k<kolommen; k++) { veld[r][k] = Integer.parseInt(sc.next()); } } //start berekenen Mijnenveld mijnen = new Mijnenveld(veld, rijen, kolommen); Pad oplossing = mijnen.dijkstra(); System.out.println(i+1 + " " + oplossing.afstand + " " + oplossing.som); } sc.close(); } }
Waterboy1602/DatastructurenEnAlgoritmen_VPW
Mijnenveld/src/Main.java
3,093
/* * * http://www.idevelopment.info/data/Programming/java/PROGRAMMING_Java_Programming.shtml */ package arrayBasis; /** * * @author Martijn */ public class Array1 { public static int[] ExampleArray1; //Ook de String[] onvangt een array van waardes public static int[] mijnArr = new int[24]; public static void main(String[] args) { //System.out.println(mijnArr[0]); // Array declaratie en creatie van object in twee stappen int[] intArray = {2, 3, 5, 7, 11}; for (int i:intArray){ System.out.println(i); } for (int i=0;i<intArray.length;i++){ System.out.println(intArray[i]); } // Array declaratie en creatie van object in een stap // Array declaratie, constructie en initialisatie in een stap String[] Array1 = { "E.coli", "C.elegans", "D.melanogaster", "M.musculus", "A.thaliana" }; Array1[2] = "X.leavis"; for (String s : Array1) { System.out.print(s + "\t"); } System.out.println(""); String[] Array2 = Array1; Array1[1] = "Q.robur"; Array2[2] = "S.lycopersicum"; for (String s : Array1) { System.out.print(s + "\t"); } System.out.println(""); for (String s : Array2) { System.out.print(s + "\t"); } System.out.println(""); Array2[1] = "P.anua"; //System.out.println(Array1==Array2); //System.out.println(Array1[1]); //Maak een kopie van de array String[] copiedArray = new String[5]; System.arraycopy(Array1, 0, copiedArray, 0, Array1.length); Array1[0] = "U.dioica"; //System.out.println(Array1[0]); //System.out.println(copiedArray[0]); int[][] xy = new int[10][10]; int[][][][] i = new int[10][10][10][10]; i[7][4][2][9] = 8; //Controleer gelijkheid //System.out.println(Array1.equals(copiedArray)); int xmax = 10; int ymax = 10; boolean[][][][] ExampleArray2D = new boolean[xmax][ymax][xmax][ymax]; ExampleArray2D[0][0][0][0] = true; } }
hanbioinformatica/owe6a
Week2_arrays/src/arrayBasis/Array1.java
3,094
package com.example.demo.controller; import com.example.demo.model.Person; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import java.util.ArrayList; @Controller public class HomeController { @GetMapping("/") public String sayHello(Model model) { ArrayList<Person> lijstje = new ArrayList<>(); lijstje.add(new Person("Klaas",64)); lijstje.add(new Person("Duncan", 28)); lijstje.add(new Person("Victor",49)); Person p = new Person("Piet",30); model.addAttribute("lijstje", lijstje); model.addAttribute("message","Hello World"); model.addAttribute("person", p); model.addAttribute("title","Dit is mijn title"); return "welcome"; } }
rootdevelop/spring-mvc-example
src/main/java/com/example/demo/controller/HomeController.java
3,095
/* * Copyright (C) 2019-2022 LitterBox contributors * * This file is part of LitterBox. * * LitterBox is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * LitterBox is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LitterBox. If not, see <http://www.gnu.org/licenses/>. */ package de.uni_passau.fim.se2.litterbox.analytics.smells; import de.uni_passau.fim.se2.litterbox.analytics.AbstractIssueFinder; import de.uni_passau.fim.se2.litterbox.analytics.Hint; import de.uni_passau.fim.se2.litterbox.analytics.Issue; import de.uni_passau.fim.se2.litterbox.analytics.IssueType; import de.uni_passau.fim.se2.litterbox.ast.model.ActorDefinition; import de.uni_passau.fim.se2.litterbox.ast.model.Program; import de.uni_passau.fim.se2.litterbox.ast.model.Script; import de.uni_passau.fim.se2.litterbox.ast.model.StmtList; import de.uni_passau.fim.se2.litterbox.ast.model.event.Never; import de.uni_passau.fim.se2.litterbox.ast.model.expression.Expression; import de.uni_passau.fim.se2.litterbox.ast.model.identifier.Qualified; import de.uni_passau.fim.se2.litterbox.ast.model.identifier.StrId; import de.uni_passau.fim.se2.litterbox.ast.model.metadata.block.NoBlockMetadata; import de.uni_passau.fim.se2.litterbox.ast.model.procedure.ProcedureDefinition; import de.uni_passau.fim.se2.litterbox.ast.model.statement.ExpressionStmt; import de.uni_passau.fim.se2.litterbox.ast.model.variable.ScratchList; import de.uni_passau.fim.se2.litterbox.ast.model.variable.Variable; import de.uni_passau.fim.se2.litterbox.ast.parser.symboltable.ExpressionListInfo; import de.uni_passau.fim.se2.litterbox.ast.parser.symboltable.VariableInfo; import de.uni_passau.fim.se2.litterbox.utils.Preconditions; import java.util.*; /** * Checks if there are unused variables. */ public class UnusedVariable extends AbstractIssueFinder { public static final String NAME = "unused_variables"; public static final String NAME_LIST = "unused_variables_list"; private static final String[] MY_VARIABLE_LANGUAGES = {"meine Variable", "исхатәу аҽеиҭак", "my variable", "متغيري", "мая зменная", "моята променлива", "la meva variable", "گۆڕاوەکەم", "moje proměnná", "fy " + "newidyn", "min variabel", "η μεταβλητή μου", "mi variable", "minu muutuja", "nire aldagaia", "متغیر من", "muuttujani", "ma variable", "m'athróg", "an caochladair agam", "a miña variábel", "המשתנה שלי", "moja " + "varijabla", "az én változóm", "variabel saya", "la mia variabile", "へんすう", "変数", "ჩემი ცვლადი", "អថេរខ្ញុំ", "나의 변수", "mano kintamasis", "mans mainīgais", "taku taurangi", "min variabel", "mijn " + "variabele", "min variabel", "moja zmienna", "minha variável", "a minha variável", "toʾoku variable", "variabila mea", "моя переменная", "premenná", "moja spremenljivka", "моја променљива", "min variabel", "kibadilika changu", "ตัวแปรของฉัน", "değişkenim", "моя змінна", "mening o'zgaruvchim", "biến của tôi", "我的变量", "i-variable yami"}; private List<Qualified> variableCalls; private boolean insideProcedure; private boolean insideScript; private Map<String, VariableInfo> varMap; private Map<String, ExpressionListInfo> listMap; @Override public Set<Issue> check(Program program) { Preconditions.checkNotNull(program); this.program = program; issues = new LinkedHashSet<>(); varMap = program.getSymbolTable().getVariables(); listMap = program.getSymbolTable().getLists(); variableCalls = new ArrayList<>(); program.accept(this); checkVariables(); return issues; } private void checkVariables() { List<ActorDefinition> actors = program.getActorDefinitionList().getDefinitions(); for (Map.Entry<String, VariableInfo> entry : varMap.entrySet()) { VariableInfo curr = entry.getValue(); String actorName = curr.getActor(); String name = curr.getVariableName(); boolean currFound = false; for (int i = 0; i < variableCalls.size() && !currFound; i++) { if (variableCalls.get(i).getFirst().getName().equals(actorName) && variableCalls.get(i).getSecond().getName().getName().equals(name)) { currFound = true; break; } } if (!currFound && !Arrays.asList(MY_VARIABLE_LANGUAGES).contains(name)) { for (ActorDefinition actor : actors) { if (actor.getIdent().getName().equals(actorName)) { currentActor = actor; break; } } Qualified qualified = new Qualified(new StrId(actorName), new Variable(new StrId(name))); Hint hint = new Hint(getName()); hint.setParameter(Hint.HINT_VARIABLE, name); addScriptWithIssueFor(qualified, hint); } } for (Map.Entry<String, ExpressionListInfo> entry : listMap.entrySet()) { ExpressionListInfo curr = entry.getValue(); String actorName = curr.getActor(); String name = curr.getVariableName(); boolean currFound = false; for (int i = 0; i < variableCalls.size() && !currFound; i++) { if (variableCalls.get(i).getFirst().getName().equals(actorName) && variableCalls.get(i).getSecond().getName().getName().equals(name)) { currFound = true; break; } } if (!currFound) { for (ActorDefinition actor : actors) { if (actor.getIdent().getName().equals(actorName)) { currentActor = actor; break; } } Qualified qualified = new Qualified(new StrId(actorName), new ScratchList(new StrId(name))); Hint hint = new Hint(NAME_LIST); hint.setParameter(Hint.HINT_VARIABLE, name); addScriptWithIssueFor(qualified, hint); } } } private void addScriptWithIssueFor(Expression expr, Hint hint) { Script theScript = new Script(new Never(), new StmtList(Arrays.asList(new ExpressionStmt(expr)))); addIssueForSynthesizedScript(theScript, expr, new NoBlockMetadata(), hint); } @Override public void visit(ProcedureDefinition node) { insideProcedure = true; super.visit(node); insideProcedure = false; } @Override public void visit(Script node) { insideScript = true; super.visit(node); insideScript = false; } @Override public void visit(Qualified node) { if (insideProcedure || insideScript) { variableCalls.add(node); } visitChildren(node); } @Override public String getName() { return NAME; } @Override public IssueType getIssueType() { return IssueType.SMELL; } @Override public Collection<String> getHintKeys() { List<String> keys = new ArrayList<>(); keys.add(NAME); keys.add(NAME_LIST); return keys; } }
se2p/LitterBox
src/main/java/de/uni_passau/fim/se2/litterbox/analytics/smells/UnusedVariable.java
3,096
import java.util.HashMap; import java.util.Map; public final class bqg implements byp { private static final Map a = new HashMap(); private static final Map b = new HashMap(); private static final Map c = new HashMap(); public bqg() { a.put(bvh.a, "Akkoord en betalen"); a.put(bvh.b, "& overige"); a.put(bvh.c, "Verificatie"); a.put(bvh.d, "Achterzijde"); a.put(bvh.e, "Alternatief"); a.put(bvh.f, "Annuleren"); a.put(bvh.g, "American Express"); a.put(bvh.h, "Carta Aura"); a.put(bvh.i, "Carte Aurore"); a.put(bvh.j, "Carta Prepagata PayPal"); a.put(bvh.k, "Carte Bancaire"); a.put(bvh.l, "Cofinoga"); a.put(bvh.m, "Delta"); a.put(bvh.n, "Discover"); a.put(bvh.o, "Electron"); a.put(bvh.p, "JCB"); a.put(bvh.q, "Maestro"); a.put(bvh.r, "MasterCard"); a.put(bvh.s, "Postepay"); a.put(bvh.t, "4 étoiles"); a.put(bvh.u, "Tarjeta Aurora"); a.put(bvh.v, "Visa"); a.put(bvh.w, "Betaalmethode wijzigen"); a.put(bvh.x, "Betaalrekening"); a.put(bvh.y, "Dit apparaat wordt gecontroleerd…"); a.put(bvh.z, "Kaartgegevens wissen"); a.put(bvh.A, "Bevestigen"); a.put(bvh.B, "Weet u zeker dat u uw kaartgegevens wilt wissen?"); a.put(bvh.C, "Van kaart afschrijven"); a.put(bvh.D, "Weet u zeker dat u wilt uitloggen bij PayPal?"); a.put(bvh.E, "Betalen"); a.put(bvh.F, "Akkoord"); a.put(bvh.G, "Rekening gemaakt op"); a.put(bvh.H, "Rekeningstatus"); a.put(bvh.I, "Rekeningtype"); a.put(bvh.J, "Adres"); a.put(bvh.K, "Leeftijdsgroep"); a.put(bvh.L, "Geboortedatum"); a.put(bvh.M, "E-mailadres"); a.put(bvh.N, "Volledige naam"); a.put(bvh.O, "Geslacht"); a.put(bvh.P, "Taal"); a.put(bvh.Q, "Gebied"); a.put(bvh.R, "Telefoon"); a.put(bvh.S, "Tijdzone"); a.put(bvh.T, "Deel het volgende: %s."); a.put(bvh.U, "Betaal supersnel."); a.put(bvh.V, "%s vraagt u om:"); a.put(bvh.W, "Deel de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalmethoden</a>."); a.put(bvh.X, "Betaalopties weergeven zodat u er een kunt kiezen."); a.put(bvh.Y, "<a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen bij %2$s die u met PayPal betaalt. U geeft PayPal opdracht alle door %3$s verzochte bedragen te betalen."); a.put(bvh.Z, "toestemming te verlenen onze klantenkaart aan uw PayPal Wallet toe te voegen en deze te beheren."); a.put(bvh.aa, "Ga akkoord met het <a href='%2$s'>Privacybeleid</a> en de <a href='%3$s'>Gebruikersovereenkomst</a> van %1$s."); a.put(bvh.ab, "Sta toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); a.put(bvh.ac, "Sta toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); a.put(bvh.ad, "Toestemming"); a.put(bvh.ae, "E-mail"); a.put(bvh.af, "Proefgegevens"); a.put(bvh.ag, "Sandbox"); a.put(bvh.ah, "Vervaldatum"); a.put(bvh.ai, "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen de betaalmethoden die beschikbaar zijn voor gebruik.</p>"); a.put(bvh.aj, "Wachtwoord vergeten?"); a.put(bvh.ak, "Van"); a.put(bvh.al, "Welke betaalmethode wilt u gebruiken voor toekomstige betalingen aan %1$s?"); a.put(bvh.am, "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Uw standaardbetaalbron wordt gebruikt voor toekomstige PayPal-betalingen van deze webwinkel.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening. Ga vervolgens naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> en verwijder deze webwinkel uit de lijst.</p><p>Het gedeelte Terugkerende betaling van de <a href='%s'>PayPal Gebruikersovereenkomst</a> is van toepassing.</p><p>Deze app kan een kleine testtransactie simuleren om te controleren of er betalingen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p>"); a.put(bvh.an, "Interne fout"); a.put(bvh.ao, "<p>Door op de knop hieronder te klikken, ga ik akkoord met de voorwaarden van de <a href='%1$s'>PayPal Gebruikersovereenkomst</a>·en verklaar ik dat ik voldoe aan de Japanse wetten en voorschriften, inclusief met betrekking tot sancties op betalingen aan Noord-Korea en Iran overeenkomstig de <a href='%2$s'>Foreign Exchange and Foreign Trade Act</a>, bij het voltooien van de transactie.</p>"); a.put(bvh.ap, "Inloggen"); a.put(bvh.aq, "Inloggen met PayPal"); a.put(bvh.ar, "Uitloggen"); a.put(bvh.as, "Uitloggen"); a.put(bvh.at, "OK"); a.put(bvh.au, "Wachtwoord"); a.put(bvh.av, "PayPal Achteraf Betalen"); a.put(bvh.aw, "Betalen met"); a.put(bvh.ax, "Betalen met creditcard"); a.put(bvh.ay, "PayPal-saldo"); a.put(bvh.az, "PayPal-krediet"); a.put(bvh.aA, "Telefoon"); a.put(bvh.aB, "Pincode"); a.put(bvh.aC, "Voorkeursbetaalmethode"); a.put(bvh.aD, "PayPal beschermt uw <a href='%s'>privacy</a> en financiële gegevens."); a.put(bvh.aE, "Bezig met verwerking"); a.put(bvh.aF, "Kaart onthouden"); a.put(bvh.aG, "Betaalverzoek"); a.put(bvh.aH, "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); a.put(bvh.aI, "Spaarrekening"); a.put(bvh.aJ, "Geld overmaken"); a.put(bvh.aK, "Er is een probleem opgetreden bij de communicatie met de PayPal-servers. Probeer het opnieuw."); a.put(bvh.aL, "Log opnieuw in bij PayPal."); a.put(bvh.aM, "Sessie verlopen"); a.put(bvh.aN, "Verzendadres"); a.put(bvh.aO, "Nieuw bij PayPal? Rekening openen"); a.put(bvh.aP, "Ingelogd blijven"); a.put(bvh.aQ, "Systeemfout (%s). Probeer het later opnieuw."); a.put(bvh.aR, "Probeer het opnieuw"); a.put(bvh.aS, "Inloggen is niet mogelijk, omdat voor uw rekening twee-factor verificatie is ingeschakeld"); a.put(bvh.aT, "Beveiligingscode"); a.put(bvh.aU, "Stuur een sms naar uw telefoon. De zescijferige code die u ontvangt is 5 minuten geldig."); a.put(bvh.aV, "Sms wordt gestuurd"); a.put(bvh.aW, "Voer de zescijferige beveiligingscode in"); a.put(bvh.aX, "Uw mobiele nummer"); a.put(bvh.aY, "Sms sturen"); a.put(bvh.aZ, "Sms opnieuw sturen"); a.put(bvh.ba, "Inloggen is niet mogelijk, omdat voor uw rekening twee-factor verificatie is ingeschakeld Ga naar de PayPal-website om uw beveiligingssleutel te activeren."); a.put(bvh.bb, "Betalingen vanaf dit apparaat zijn niet toegestaan."); a.put(bvh.bc, "Ongeautoriseerd apparaat"); a.put(bvh.bd, "Betalingen aan deze webwinkel zijn niet toegestaan (ongeldig client-id)"); a.put(bvh.be, "Ongeldige webwinkel"); a.put(bvh.bf, "Er is een probleem opgetreden bij de verwerking van uw betaling. Probeer het opnieuw."); a.put(bvh.bg, "Niet-herkende bron"); a.put(bvh.bh, "Onze excuses"); a.put(bvh.bi, "Uw bestelling"); a.put(bvh.bj, "Kaart verwijderen?"); a.put(bvh.bk, "Toestemming mislukt"); a.put(bvh.bl, "Verbinding mislukt"); a.put(bvh.bm, "Inloggen mislukt"); a.put(bvh.bn, "Inloggen met wachtwoord"); a.put(bvh.bo, "Inloggen met pincode"); a.put(bvh.bp, "Even geduld…"); a.put(bvh.bq, "Betaling mislukt"); a.put(bvh.br, "Scannen"); a.put(bvh.bs, "Onjuiste beveiligingscode. Probeer het opnieuw."); a.put(bvh.bt, "Via"); a.put(bvh.bu, "Systeemfout. Probeer het later opnieuw."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|AT", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|BE", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|BG", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|CH", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|CY", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|CZ", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|DE", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|DK", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalmethoden</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|EE", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|ES", "Deel gegevens over de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|FI", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|GB", "Deel de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|GR", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|HU", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|IE", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|IT", "Deel de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|LI", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|LT", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|LU", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|LV", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|MT", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|NL", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|NO", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalmethoden</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|PL", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalbronnen</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|PT", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|SE", "Deel gegevens van de aan uw PayPal-rekening gekoppelde <a href='%1$s'>betaalmethoden</a>."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|SI", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|SK", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|SM", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS|VA", "Namens u de <a href='%1$s'>betaalbronnen</a> delen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|AU", "<p><a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen bij %2$s die u met PayPal betaalt. U geeft PayPal opdracht alle door %3$s verzochte bedragen te betalen.</p><p>Zie de <a href='https://www.paypal.com/webapps/mpp/ua/recurringpymts-full'>PayPal-overeenkomst voor terugkerende betalingen en facturen</a> voor meer informatie.</p>"); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|CN", "<p><a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen bij %2$s die u met PayPal betaalt. U geeft PayPal opdracht alle door %3$s verzochte bedragen te betalen.</p><p>Zie de <a href='https://cms.paypal.com/c2/cgi-bin/?cmd=_render-content&content_ID=ua/UserAgreement_full'>PayPal-overeenkomst voor terugkerende betalingen en facturen</a> voor meer informatie.</p>"); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|MY", "<a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen die u met PayPal betaalt. U geeft PayPal toestemming en opdracht alle bedragen te betalen."); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|NZ", "<a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen die u met PayPal betaalt. U geeft PayPal toestemming en opdracht alle bedragen te betalen."); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|SG", "<a href='%1$s'>Geef toestemming</a> voor toekomstige aankopen die u met PayPal betaalt. U geeft PayPal toestemming en opdracht alle bedragen te betalen."); b.put("CONSENT_AGREEMENT_FUTURE_PAYMENTS|US", "Geef vooraf toestemming voor toekomstige betalingen met uw PayPal-rekening zodat u niet steeds hoeft in te loggen. <a href='%1$s'>Zie de aanvullende voorwaarden</a> over onder andere de betaalmethoden en hoe u toekomstige betalingen kunt annuleren."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|AT", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|BE", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|CH", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|DE", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|GB", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|NL", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_REQUEST_MONEY|PL", "Sta %2$s toe om namens u een <a href='%1$s'>betaalverzoek</a> te doen totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|AT", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|BE", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|CH", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|DE", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|GB", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|NL", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("CONSENT_AGREEMENT_SEND_MONEY|PL", "Sta %2$s toe om namens u <a href='%1$s'>geld over te maken</a> totdat u de toestemming intrekt."); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|AT", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|BE", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen de gegevens over de betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|BG", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|CH", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|CY", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|CZ", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|DE", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|EE", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|ES", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|FI", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|GR", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|HU", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|IE", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|IT", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|LI", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|LT", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|LU", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|LV", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|MT", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|NL", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen de gegevens over de betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|PL", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen de gegevens over de betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|PT", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|SI", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|SK", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|SM", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FINANCIAL_INSTRUMENTS_LEGAL_DETAILS|VA", "<h1><strong>betaalmethoden</strong></h1><p>PayPal deelt alleen uw betaalbronnen die beschikbaar zijn voor gebruik.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|AU", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren ter controle dat er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode (uw PayPal-saldo, gekoppelde bankrekening of creditcard, in die volgorde) wordt gebruikt om voor aankopen met PayPal te betalen. Als het saldo van uw standaardbetaalmethode ontoereikend is voor de aankoop, kan uw bank of creditcardmaatschappij kosten in rekening brengen.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> te gaan, op <strong>Rekeninginstellingen</strong> te klikken en op <strong>Wijzigen</strong> naast ‘Inloggen met PayPal’ te klikken.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|BR", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>We gebruiken uw PayPal-saldo of primaire creditcard om voor aankopen met PayPal te betalen.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|CN", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren ter controle dat er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|GB", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Uw standaardbetaalbron wordt gebruikt voor toekomstige PayPal-betalingen van deze webwinkel.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening. Ga vervolgens naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> en verwijder deze webwinkel uit de lijst.</p><p>Het gedeelte Terugkerende betaling van de <a href='%s'>PayPal Gebruikersovereenkomst</a> is van toepassing.</p><p>Deze app kan een kleine testtransactie simuleren om te controleren of er betalingen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|HK", "<h1><strong>Autorisatie voor toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze autorisatie annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Zie het gedeelte ‘Vooraf goedgekeurde betalingen’ in de <a href='%s'>PayPal Gebruikersovereenkomst</a> voor meer informatie.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|JP", "<h1><strong>Autorisatie voor toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze autorisatie annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Zie het gedeelte ‘Vooraf goedgekeurde betalingen’ in de <a href='%s'>PayPal Gebruikersovereenkomst</a> voor meer informatie.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|MX", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>We gebruiken uw PayPal-saldo of primaire creditcard om voor aankopen met PayPal te betalen.</p><p>U kunt deze overeenkomst annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|MY", "<h1><strong>Autorisatie voor toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze autorisatie annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Zie het gedeelte ‘Vooraf goedgekeurde betalingen’ in de <a href='%s'>PayPal Gebruikersovereenkomst</a> voor meer informatie.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|NZ", "<h1><strong>Autorisatie voor toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze autorisatie annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Zie het gedeelte ‘Vooraf goedgekeurde betalingen’ in de <a href='%s'>PayPal Gebruikersovereenkomst</a> voor meer informatie.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|SG", "<h1><strong>Autorisatie voor toekomstige betalingen</strong></h1><p>Deze app kan een kleine testtransactie simuleren om te controleren of er in de toekomst bedragen kunnen worden afgeschreven van uw PayPal-rekening. Er wordt niet daadwerkelijk geld afgeschreven.</p><p>Uw standaardbetaalmethode wordt gebruikt om aankopen met PayPal te betalen.</p><p>U kunt deze autorisatie annuleren door in te loggen op uw PayPal-rekening, naar <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Zie het gedeelte ‘Vooraf goedgekeurde betalingen’ in de <a href='%s'>PayPal Gebruikersovereenkomst</a> voor meer informatie.</p>"); b.put("FUTURE_PAYMENT_LEGAL_DETAILS|US", "<h1><strong>Overeenkomst toekomstige betalingen</strong></h1><p>PayPal gebruikt eerst uw PayPal-saldo om voor uw aankoop te betalen. Als uw saldo ontoereikend is om voor het totaalbedrag te betalen, worden in volgorde eerst uw bankrekening, creditcard en vervolgens een uitgestelde bankbetaling gebruikt.</p><p>U kunt deze overeenkomst annuleren door naar www.paypal.com <strong>Profiel</strong> &gt; <strong>Rekeninginstellingen</strong> &gt; <strong>Inloggen met PayPal</strong> te gaan en deze webwinkel uit de lijst te halen.</p><p>Het kan zijn dat u een kleine betaling moet autoriseren om het mogelijk te maken dat er in de toekomst bedragen van uw PayPal-rekening kunnen worden afgeschreven. De autorisatie wordt geannuleerd en er wordt niets afgeschreven.</p>"); b.put("LOG_IN_TO_PAYPAL|AU", "Inloggen met PayPal"); b.put("LOG_IN_TO_PAYPAL|GB", "Inloggen met PayPal"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|AD", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|AL", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|AT", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de partner gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en op het instellingenicoontje te klikken. Ga naar <strong>Beveiliging</strong>, selecteer <strong>Inloggen met PayPal</strong> en verwijder deze partner.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|AU", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|BA", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|BE", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> te gaan bij uw <strong>Profiel</strong>-instellingen en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|BG", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|CH", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de partner gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en op het instellingenicoontje te klikken. Ga naar <strong>Beveiliging</strong>, selecteer <strong>Inloggen met PayPal</strong> en verwijder deze partner.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|CY", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|CZ", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|DE", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de partner gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en op het instellingenicoontje te klikken. Ga naar <strong>Beveiliging</strong>, selecteer <strong>Inloggen met PayPal</strong> en verwijder deze partner.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|DK", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|EE", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|ES", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen, in de rechterbovenhoek op het instellingenicoontje te klikken, de optie <strong>Veilig handelen</strong> te kiezen, <strong>Inloggen met PayPal</strong> te selecteren en de webwinkel te verwijderen. Als u de klassieke website nog gebruikt, gaat u naar <strong>Mijn profiel</strong> &gt; <strong>Rekeninggegevens</strong> &gt; <strong>Inloggen met PayPal</strong> en verwijdert u de webwinkel.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|FI", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|GB", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de partner gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en via de <strong>Profiel</strong>-instellingen naar <strong>Inloggen met PayPal</strong> te gaan en deze partner te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|GR", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|HR", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|HU", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|IE", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|IS", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|IT", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.it in te loggen en via <strong>Profiel</strong>, <strong>Beveiliging</strong> naar de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|LI", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|LT", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|LU", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|LV", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|MT", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|NL", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> te gaan bij uw <strong>Profiel</strong>-instellingen en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|NO", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|PL", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> te gaan bij uw <strong>Profiel</strong>-instellingen en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|PT", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|RO", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|RU", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de partner gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.ru in te loggen, in de rechterbovenhoek op het instellingenicoontje te klikken, het tabblad <strong>Beveiliging</strong> te kiezen en deze partner te verwijderen bij de optie <strong>Inloggen met PayPal</strong>.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de partner.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|SE", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|SI", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|SK", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|SM", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|TR", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com.tr in te loggen, in de rechterbovenhoek op het instellingenicoontje te klikken, het tabblad <strong>Beveiliging</strong> te kiezen en deze partner te verwijderen bij de optie <strong>Inloggen met PayPal</strong>.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|UA", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|US", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op uw PayPal-rekening in te loggen en naar de optie <strong>Inloggen met PayPal</strong> onder <strong>Profiel</strong>-instellingen te gaan en deze webwinkel te verwijderen.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|VA", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); b.put("REQUEST_OR_SEND_MONEY_LEGAL_DETAILS|ZA", "<h1><strong>%s</strong></h1><p>Alle relevante transactiegegevens worden met de webwinkel gedeeld.</p><p>U kunt de toestemming intrekken door op paypal.com in te loggen en bij <strong>Profiel</strong>, <strong>Beveiliging</strong>, de optie <strong>Inloggen met PayPal</strong> te zoeken en deze webwinkel te verwijderen.</p><p>PayPal is niet verantwoordelijk voor handelingen of fouten van de webwinkel.</p>"); c.put("AMOUNT_MISMATCH", "Het totaalbedrag van items in het winkelwagentje komt niet overeen met het verkoopbedrag."); c.put("AUTHORIZATION_ALREADY_COMPLETED", "Deze autorisatie is al voltooid."); c.put("AUTHORIZATION_CANNOT_BE_VOIDED", "Autorisatie heeft status die niet ongeldig kan worden gemaakt."); c.put("AUTHORIZATION_EXPIRED", "Autorisatie is vervallen."); c.put("AUTHORIZATION_ID_DOES_NOT_EXIST", "De gevraagde autorisatiereferentie bestaat niet."); c.put("AUTHORIZATION_VOIDED", "Autorisatie is ongeldig gemaakt."); c.put("CANNOT_REAUTH_CHILD_AUTHORIZATION", "Herautorisatie is alleen mogelijk van de oorspronkelijke autorisatie, niet van een herautorisatie."); c.put("CANNOT_REAUTH_INSIDE_HONOR_PERIOD", "Herautorisatie is niet toegestaan binnen de betaalperiode."); c.put("CAPTURE_AMOUNT_LIMIT_EXCEEDED", "Het bedrag overschrijdt de toegestane limiet."); c.put("CARD_TOKEN_PAYER_MISMATCH", "Toegang tot opgeslagen kaartgegevens mislukt."); c.put("CREDIT_CARD_CVV_CHECK_FAILED", "De kaartgegevens zijn ongeldig. Corrigeer ze en verzend ze opnieuw."); c.put("CREDIT_CARD_REFUSED", "Kaart afgewezen."); c.put("CURRENCY_MISMATCH", "De valuta van de overboeking moet hetzelfde zijn als de autorisatievaluta."); c.put("CURRENCY_NOT_ALLOWED", "Deze valuta wordt op dit moment niet door PayPal ondersteund."); c.put("DATA_RETRIEVAL", "Systeemfout. Probeer het later opnieuw."); c.put("DUPLICATE_REQUEST_ID", "Systeemfout. Probeer het later opnieuw."); c.put("EXPIRED_CREDIT_CARD", "Kaart is verlopen"); c.put("EXPIRED_CREDIT_CARD_TOKEN", "De gegevens van deze kaart staan niet meer bij ons geregistreerd.\nVerzend de opnieuw."); c.put("FEATURE_UNSUPPORTED_FOR_PAYEE", "Functie wordt niet door leverancier ondersteund."); c.put("FULL_REFUND_NOT_ALLOWED_AFTER_PARTIAL_REFUND", "Deze transactie is al gedeeltelijk terugbetaald."); c.put("IMMEDIATE_PAY_NOT_SUPPORTED", "Direct betalen wordt niet ondersteund."); c.put("INSTRUMENT_DECLINED", "De door u geselecteerde betaalmethode is niet geaccepteerd. Kies een andere betaalmethode."); c.put("INSUFFICIENT_FUNDS", "Koper kan niet betalen - te laag saldo"); c.put("INTERNAL_SERVICE_ERROR", "Systeemfout. Probeer het later opnieuw."); c.put("INVALID_ACCOUNT_NUMBER", "Dat rekeningnummer bestaat niet."); c.put("INVALID_ARGUMENT", "Transactie geweigerd vanwege ongeldig argument."); c.put("INVALID_CITY_STATE_ZIP", "Combinatie plaats/staat/postcode ongeldig"); c.put("INVALID_FACILITATOR_CONFIGURATION", "Deze transactie kan niet worden verwerkt vanwege een ongeldige facilitator-configuratie."); c.put("INVALID_PAYER_ID", "Systeemfout: (ongeldige betalersreferentie). Probeer het later opnieuw."); c.put("INVALID_RESOURCE_ID", "Systeemfout. Probeer het later opnieuw."); c.put("PAYEE_ACCOUNT_INVALID", "E-mailadres van rekening leverancier is niet bevestigd."); c.put("PAYEE_ACCOUNT_LOCKED_OR_CLOSED", "Deze leverancier kan op dit moment geen betalingen ontvangen."); c.put("PAYEE_ACCOUNT_NO_CONFIRMED_EMAIL", "E-mailadres van rekening leverancier is niet bevestigd."); c.put("PAYEE_ACCOUNT_RESTRICTED", "Deze leverancier kan op dit moment geen betalingen ontvangen."); c.put("PAYER_ACCOUNT_LOCKED_OR_CLOSED", "Uw rekening is vergrendeld of gesloten."); c.put("PAYER_ACCOUNT_RESTRICTED", "Uw rekening is beperkt."); c.put("PAYER_CANNOT_PAY", "Deze transactie kunt u niet met PayPal betalen."); c.put("PAYER_EMPTY_BILLING_ADDRESS", "Voor creditcardtransacties die niet via PayPal verlopen is er een factuuradres nodig."); c.put("PAYER_ID_MISSING_FOR_CARD_TOKEN", "Toegang tot opgeslagen kaartgegevens mislukt."); c.put("PAYMENT_APPROVAL_EXPIRED", "Betaalgoedkeuring is vervallen."); c.put("PAYMENT_EXPIRED", "De betaling is vervallen."); c.put("PAYMENT_NOT_APPROVED_FOR_EXECUTION", "De betaler heeft de betaling niet goedgekeurd."); c.put("PAYMENT_REQUEST_ID_INVALID", "De referentie voor dit PayPal-verzoek is ongeldig. Probeer het later opnieuw."); c.put("PAYMENT_STATE_INVALID", "Dit verzoek is ongeldig ten gevolge van de huidige status van de betaling."); c.put("PERMISSION_DENIED", "Geen toestemming voor de gevraagde bewerking."); c.put("REFUND_EXCEEDED_TRANSACTION_AMOUNT", "De gevraagde terugbetaling is hoger dan het bedrag van de oorspronkelijke transactie."); c.put("REFUND_TIME_LIMIT_EXCEEDED", "Deze transactie is te oud voor terugbetaling."); c.put("REQUIRED_SCOPE_MISSING", "Systeemfout. Probeer het later opnieuw."); c.put("TOO_MANY_REAUTHORIZATIONS", "Er zijn geen herautorisaties meer toegestaan voor deze autorisatie."); c.put("TRANSACTION_ALREADY_REFUNDED", "Deze transactie is al terugbetaald."); c.put("TRANSACTION_LIMIT_EXCEEDED", "Het bedrag overschrijdt de toegestane limiet."); c.put("TRANSACTION_REFUSED", "De transactie is geweigerd."); c.put("TRANSACTION_REFUSED_BY_PAYPAL_RISK", "De transactie is geweigerd."); c.put("TRANSACTION_REFUSED_PAYEE_PREFERENCE", "Het profiel van de webwinkel is ingesteld om bepaalde transacties automatisch te weigeren."); c.put("UNKNOWN_ERROR", "Systeemfout. Probeer het later opnieuw."); c.put("UNSUPPORTED_PAYEE_COUNTRY", "Er is geen ondersteuning voor uw land."); c.put("VALIDATION_ERROR", "De betalingsgegevens zijn ongeldig. Corrigeer ze en verzend ze opnieuw."); c.put("ORDER_ALREADY_COMPLETED", "Bestelling is al ongeldig gemaakt, verlopen of voltooid."); c.put("MAXIMUM_ALLOWED_AUTHORIZATION_REACHED_FOR_ORDER", "Het maximale aantal toegestane autorisaties voor de bestelling is bereikt."); c.put("ORDER_VOIDED", "Uw bestelling is ongeldig gemaakt."); c.put("ORDER_CANNOT_BE_VOIDED", "De bestelling heeft een status die verhindert dat deze ongeldig kan worden gemaakt."); c.put("INVALID_EXPERIENCE_PROFILE_ID", "Systeemfout. Probeer het later opnieuw."); c.put("UNAUTHORIZED_PAYMENT", "Deze webwinkel accepteert dit type betalingen niet."); c.put("DCC_UNSUPPORTED_CURRENCY_CC_TYPE", "Valuta niet ondersteund voor type creditcard."); c.put("DCC_CC_TYPE_NOT_SUPPORTED", "Kaarttype wordt niet ondersteund."); c.put("ADDRESS_ADDITION_ERROR", "Er is een fout opgetreden bij het toevoegen van het verzendadres aan de PayPal-rekening."); c.put("DUPLICATE_TRANSACTION", "Dubbele transactie."); c.put("INVALID_SHIPPING_ADDRESS", "Het verstrekte verzendadres is ongeldig."); c.put("PAYMENT_CREATION_ERROR", "Er is een probleem opgetreden bij het instellen van deze betaling. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_EXPIRED_PAYMENT_CARD", "Er is een probleem opgetreden bij het instellen van deze betaling - uw kaart is verlopen. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_INSTANT_PAYMENT_REQUIRED", "Er is een probleem opgetreden bij het instellen van deze betaling - er is een directe betaling vereist, zoals met een creditcard. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_NEED_CONFIRMED_CARD", "Er is een probleem opgetreden bij het instellen van deze betaling - de kaart moet worden bevestigd. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_NEED_PHONE_NUMBER", "Er is een probleem opgetreden bij het instellen van deze betaling - voor deze app is het nodig een telefoon aan uw rekening toe te voegen. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_NEED_VALID_FUNDING_INSTRUMENT", "Er is een probleem opgetreden bij het instellen van deze betaling - rekening heeft een geldige betaalbron zoals een bank- of betaalkaart nodig. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_NEGATIVE_BALANCE", "Er is een probleem opgetreden bij het instellen van deze betaling - u bent uw saldo nog een bedrag verschuldigd. Ga naar de PayPal-website om uw rekening te controleren."); c.put("PAYMENT_CREATION_ERROR_SENDING_LIMIT_REACHED", "Er is een probleem opgetreden bij het instellen van deze betaling - u heeft uw verzendlimiet bereikt. Ga naar de PayPal-website om uw rekening te controleren."); c.put("AUTH_RC_RISK_FAILURE", "Afgewezen wegens risico"); c.put("AUTH_RC_OFAC_BLOCKED_IP", "Client niet goedgekeurd."); c.put("AUTH_RC_IP_COMPLIANCE_FAILURE", "Client niet goedgekeurd."); c.put("invalid_user", "Gebruikersnaam/wachtwoord onjuist Probeer het opnieuw."); c.put("locked_user", "Uw PayPal-rekening is tijdelijk geblokkeerd. Probeer het later opnieuw of ga naar www.paypal.com om de blokkade direct op te heffen."); c.put("max_attempts_exceeded", "Te veel mislukte inlogpogingen. Probeer het later opnieuw."); c.put("invalid_request", "Er is een fout opgetreden."); c.put("unauthorized_client", "Verzoek niet goedgekeurd"); c.put("access_denied", "Verzoek niet goedgekeurd"); c.put("unsupported_response_type", "Er is een fout opgetreden."); c.put("invalid_scope", "Verzoek niet goedgekeurd"); c.put("server_error", "Systeemfout. Probeer het later opnieuw."); c.put("temporarily_unavailable", "Systeemfout. Probeer het later opnieuw."); c.put("stepup_required", "U kunt op dit moment niet inloggen. Probeer het later opnieuw of ga naar www.paypal.com om eventuele beveiligingsproblemen met uw PayPal-rekening af te handelen."); } public final String a() { return "nl"; } public final String a(String paramString) { return (String)c.get(paramString); } } /* Location: * Qualified Name: bqg * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
reverseengineeringer/com.ubercab
src/bqg.java
3,097
/******************************************************************************* * Copyright (C) 2013 Open Universiteit Nederland * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. * * Contributors: Stefaan Ternier ******************************************************************************/ package org.celstec.arlearn2.xmpp; import java.io.IOException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.appengine.api.xmpp.JID; import com.google.appengine.api.xmpp.Message; import com.google.appengine.api.xmpp.MessageBuilder; import com.google.appengine.api.xmpp.PresenceShow; import com.google.appengine.api.xmpp.PresenceType; import com.google.appengine.api.xmpp.XMPPService; import com.google.appengine.api.xmpp.XMPPServiceFactory; @Deprecated public class XMPPReceiverServlet extends HttpServlet { public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { XMPPService xmpp = XMPPServiceFactory.getXMPPService(); Message message = xmpp.parseMessage(req); JID fromJid = message.getFromJid(); String body = message.getBody(); JID toJid = new JID("[email protected]/arlearn"); //XMPPService xmppService = XMPPServiceFactory.getXMPPService(); xmpp.sendPresence( toJid, PresenceType.AVAILABLE, PresenceShow.NONE, "Dit is mijn status"); Message msg = new MessageBuilder() .asXml(true) .withRecipientJids( toJid) .withBody("Dit is een bericht voor stefaan op android") .build(); xmpp.sendMessage(msg); } }
WELTEN/dojo-ibl
src/main/java/org/celstec/arlearn2/xmpp/XMPPReceiverServlet.java
3,098
public class Vriend implements Contact{ public void DagAangepast(String text) { System.out.println("Mijn rooster is nu aangepast naar"); System.out.println(text); System.out.println("ik ga niet meer"); } }
skptjan/ObserverPattern
src/Vriend.java
3,099
package railo.runtime.search.lucene2.analyzer; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.snowball.SnowballAnalyzer; /** * <p>Analyzer for Dutch language</p> * <p><a href="DutchAnalyzer.java.html"><i>View Source</i></a></p> * <p/> * */ public final class DanishAnalyzer extends Analyzer { private static SnowballAnalyzer analyzer; private String STOP_WORDS[] = { "de", "en", "van", "ik", "te", "dat", "die", "in", "een", "hij", "het", "niet", "zijn", "is", "was", "op", "aan", "met", "als", "voor", "had", "er", "maar", "om", "hem", "dan", "zou", "of", "wat", "mijn", "men", "dit", "zo", "door", "over", "ze", "zich", "bij", "ook", "tot", "je", "mij", "uit", "der", "daar", "haar", "naar", "heb", "hoe", "heeft", "hebben", "deze", "u", "want", "nog", "zal", "me", "zij", "nu", "ge", "geen", "omdat", "iets", "worden", "toch", "al", "waren", "veel", "meer", "doen", "toen", "moet", "ben", "zonder", "kan", "hun", "dus", "alles", "onder", "ja", "eens", "hier", "wie", "werd", "altijd", "doch", "wordt", "wezen", "kunnen", "ons", "zelf", "tegen", "na", "reeds", "wil", "kon", "niets", "uw", "iemand", "geweest", "andere" }; /** * Creates new instance of SpanishAnalyzer */ public DanishAnalyzer() { analyzer = new SnowballAnalyzer("Danish", STOP_WORDS); } public DanishAnalyzer(String stopWords[]) { analyzer = new SnowballAnalyzer("Danish", stopWords); } @Override public TokenStream tokenStream(String fieldName, Reader reader) { return analyzer.tokenStream(fieldName, reader); } }
blueriver/railo
railo-java/railo-core/src/railo/runtime/search/lucene2/analyzer/DanishAnalyzer.java
3,100
package armijn.vink.numberviewanimation.fonts; import android.graphics.Paint; public class Roboto { private Paint mPaint; // The 5 end points. (Note: The last end point is the first end point of the next segment. private static final float[][][] mPoints = { {{59, 100}, {100, 29.3f}, {141, 100}, {100, 170.66f}, {59, 100}}, // 0 {{79.27f, 37.18f}, {120.73f, 29.11f}, {120.73f, 170.89f}, {120.73f, 170.89f}, {120.73f, 170.89f}}, //1 {{58.5f, 69.97f}, {100, 30.25f}, {127.75f, 86.25f}, {61.25f, 169}, {144, 169}}, // 2 {{61.38f, 65.38f}, {102.38f, 29.66f}, {86.24f, 98.63f}, {102.17f, 170.17f}, {59, 131.54f}}, // 3 {{148.75f, 130.21f}, {51.25f, 130.21f}, {120.75f, 28.96f}, {120.75f, 171.04f}, {120.75f, 171.04f}}, //4 {{134.8f, 30.79f}, {71, 30.79f}, {63.8f, 101.79f}, {138.5f, 126.79f}, {61.8f, 134.04f}}, // 5 {{127.91f, 39.79f}, {65.66f, 59.05f}, {61.41f, 116.29f}, {138.66f, 127.79f}, {62.5f, 128.89f}}, // 6 {{57.25f, 34}, {146.84f, 34}, {88.5f, 174}, {88.5f, 174}, {88.5f, 176}}, // 7 {{99.83f, 100}, {99.83f, 19.11f}, {99.83f, 100}, {99.83f, 180.89f}, {99.83f, 100}}, // 8 {{145.5f, 67.5f}, {53.5f, 67.5f}, {145.5f, 67.5f}, {65.82f, 175.35f}, {65.82f, 175.35f}} // 9 }; // The set of the "first" control points of each segment. private static final float[][][] mControlPoint1 = { {{59, 55.75f}, {131.5f, 29.3f}, {141 , 143.75f}, {68, 170.66f}}, // 0 {{79.27f, 37.18f}, {120.73f, 29.11f}, {120.73f, 170.89f}, {120.73f, 170.89f}}, // 1 {{57.83f, 39.5f}, {133f, 31.5f}, {114.8f, 109.5f}, {61.25f, 169}}, // 2 {{60, 38.5f}, {149.33f, 28.83f}, {156.67f, 97.66f}, {83, 170f}}, // 3 {{148.75f, 130.21f}, {51.25f, 130.21f}, {120.75f, 28.96f}, {120.75f, 171.04f}}, // 4 {{134.8f, 30.79f}, {71, 30.79f}, {89.66f, 67.66f}, {133, 185f}}, // 5 {{96f, 25.33f}, {60.16f, 72.83f}, {61f, 184.66f}, {138.16f, 77.66f}}, // 6 {{57.25f, 34}, {98.5f, 89}, {88.5f, 174.16f}, {88.5f, 174.16f}}, // 7 {{41, 99.83f}, {163.33f, 19.11f}, {41, 99.83f}, {162.3f, 180.3f}}, // 8 {{145.6f, 133.6f}, {53.7f, 0}, {145.6f, 133.6f}, {27.6f, 159}} // 9 }; // The set of the "second" control points of each segment. private static final float[][][] mControlPoint2 = { {{68, 29.3f}, {141, 55.75f}, {131.5f, 170.66f}, {59, 143.75f}}, // 0 {{79.27f, 37.18f}, {120.73f, 29.11f}, {120.73f, 170.89f}, {120.73f, 170.89f}}, // 1 {{80.3f, 29.3f}, {139.8f, 65}, {61.25f, 169}, {144, 169}}, // 2 {{86.66f, 29.832f}, {150.66f, 97.66f}, {151.165f, 170.33f}, {58f, 162}}, // 3 {{148.75f, 130.21f}, {51.25f, 130.21f}, {120.75f, 28.96f}, {120.75f, 171.04f}}, // 4 {{71.5f, 30.79f}, {63.8f, 101.79f}, {141.66f, 83}, {61.66f, 179.33f}}, // 5 {{72.5f, 38.83f}, {61.3f, 92.66f}, {138.49f, 177.33f}, {61.9f, 75.66f}}, // 6 {{57.25f, 34}, {88.5f, 174.16f}, {88.5f, 174.16f}, {88.5f, 174.16f}}, // 7 {{41, 19.22f}, {162.3f, 99.83f}, {41, 180.3f}, {163.33f, 99.83f}}, // 8 {{54, 132}, {145, -8}, {152, 203}, {65.82f, 175.35f}} // 9 }; public Roboto(int textColor, float strokeSize) { // A new paint with the style as stroke. setPaint(new Paint()); getPaint().setAntiAlias(true); getPaint().setColor(textColor); getPaint().setStrokeWidth(strokeSize); getPaint().setStrokeCap(Paint.Cap.SQUARE); getPaint().setStrokeJoin(Paint.Join.BEVEL); getPaint().setStyle(Paint.Style.STROKE); } public Paint getPaint() { return mPaint; } public void setPaint(Paint mPaint) { this.mPaint = mPaint; } public static float[][][] getMpoints() { return mPoints; } public static float[][][] getMcontrolpoint1() { return mControlPoint1; } public static float[][][] getMcontrolpoint2() { return mControlPoint2; } }
Armijn/NumberViewAnimation
src/armijn/vink/numberviewanimation/fonts/Roboto.java
3,101
// ANTLR GENERATED CODE: DO NOT EDIT package org.elasticsearch.painless.antlr; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.RuleContext; import org.antlr.v4.runtime.RuntimeMetaData; import org.antlr.v4.runtime.Vocabulary; import org.antlr.v4.runtime.VocabularyImpl; import org.antlr.v4.runtime.atn.ATN; import org.antlr.v4.runtime.atn.ATNDeserializer; import org.antlr.v4.runtime.atn.LexerATNSimulator; import org.antlr.v4.runtime.atn.PredictionContextCache; import org.antlr.v4.runtime.dfa.DFA; @SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue" }) public abstract class SuggestLexer extends Lexer { static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int WS = 1, COMMENT = 2, LBRACK = 3, RBRACK = 4, LBRACE = 5, RBRACE = 6, LP = 7, RP = 8, DOT = 9, NSDOT = 10, COMMA = 11, SEMICOLON = 12, IF = 13, IN = 14, ELSE = 15, WHILE = 16, DO = 17, FOR = 18, CONTINUE = 19, BREAK = 20, RETURN = 21, NEW = 22, TRY = 23, CATCH = 24, THROW = 25, THIS = 26, INSTANCEOF = 27, BOOLNOT = 28, BWNOT = 29, MUL = 30, DIV = 31, REM = 32, ADD = 33, SUB = 34, LSH = 35, RSH = 36, USH = 37, LT = 38, LTE = 39, GT = 40, GTE = 41, EQ = 42, EQR = 43, NE = 44, NER = 45, BWAND = 46, XOR = 47, BWOR = 48, BOOLAND = 49, BOOLOR = 50, COND = 51, COLON = 52, ELVIS = 53, REF = 54, ARROW = 55, FIND = 56, MATCH = 57, INCR = 58, DECR = 59, ASSIGN = 60, AADD = 61, ASUB = 62, AMUL = 63, ADIV = 64, AREM = 65, AAND = 66, AXOR = 67, AOR = 68, ALSH = 69, ARSH = 70, AUSH = 71, OCTAL = 72, HEX = 73, INTEGER = 74, DECIMAL = 75, STRING = 76, REGEX = 77, TRUE = 78, FALSE = 79, NULL = 80, ATYPE = 81, TYPE = 82, ID = 83, UNKNOWN = 84, DOTINTEGER = 85, DOTID = 86; public static final int AFTER_DOT = 1; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; public static String[] modeNames = { "DEFAULT_MODE", "AFTER_DOT" }; private static String[] makeRuleNames() { return new String[] { "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", "DOT", "NSDOT", "COMMA", "SEMICOLON", "IF", "IN", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", "INSTANCEOF", "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", "RSH", "USH", "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "XOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "ELVIS", "REF", "ARROW", "FIND", "MATCH", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", "DECIMAL", "STRING", "REGEX", "TRUE", "FALSE", "NULL", "ATYPE", "TYPE", "ID", "UNKNOWN", "DOTINTEGER", "DOTID" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, null, null, "'{'", "'}'", "'['", "']'", "'('", "')'", "'.'", "'?.'", "','", "';'", "'if'", "'in'", "'else'", "'while'", "'do'", "'for'", "'continue'", "'break'", "'return'", "'new'", "'try'", "'catch'", "'throw'", "'this'", "'instanceof'", "'!'", "'~'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<<'", "'>>'", "'>>>'", "'<'", "'<='", "'>'", "'>='", "'=='", "'==='", "'!='", "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'?:'", "'::'", "'->'", "'=~'", "'==~'", "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", "'%='", "'&='", "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, null, null, null, null, "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", "DOT", "NSDOT", "COMMA", "SEMICOLON", "IF", "IN", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", "INSTANCEOF", "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", "RSH", "USH", "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "XOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "ELVIS", "REF", "ARROW", "FIND", "MATCH", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", "DECIMAL", "STRING", "REGEX", "TRUE", "FALSE", "NULL", "ATYPE", "TYPE", "ID", "UNKNOWN", "DOTINTEGER", "DOTID" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** * @deprecated Use {@link #VOCABULARY} instead. */ @Deprecated public static final String[] tokenNames; static { tokenNames = new String[_SYMBOLIC_NAMES.length]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = VOCABULARY.getLiteralName(i); if (tokenNames[i] == null) { tokenNames[i] = VOCABULARY.getSymbolicName(i); } if (tokenNames[i] == null) { tokenNames[i] = "<INVALID>"; } } } @Override @Deprecated public String[] getTokenNames() { return tokenNames; } @Override public Vocabulary getVocabulary() { return VOCABULARY; } /** Is the preceding {@code /} a the beginning of a regex (true) or a division (false). */ protected abstract boolean isSlashRegex(); protected abstract boolean isType(String text); public SuggestLexer(CharStream input) { super(input); _interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); } @Override public String getGrammarFileName() { return "SuggestLexer.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public String[] getChannelNames() { return channelNames; } @Override public String[] getModeNames() { return modeNames; } @Override public ATN getATN() { return _ATN; } @Override public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { case 30: return DIV_sempred((RuleContext) _localctx, predIndex); case 76: return REGEX_sempred((RuleContext) _localctx, predIndex); case 81: return TYPE_sempred((RuleContext) _localctx, predIndex); } return true; } private boolean DIV_sempred(RuleContext _localctx, int predIndex) { switch (predIndex) { case 0: return isSlashRegex() == false; } return true; } private boolean REGEX_sempred(RuleContext _localctx, int predIndex) { switch (predIndex) { case 1: return isSlashRegex(); } return true; } private boolean TYPE_sempred(RuleContext _localctx, int predIndex) { switch (predIndex) { case 2: return isType(getText()); } return true; } public static final String _serializedATN = "\u0004\u0000V\u0265\u0006\uffff\uffff\u0006\uffff\uffff\u0002\u0000\u0007" + "\u0000\u0002\u0001\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007" + "\u0003\u0002\u0004\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007" + "\u0006\u0002\u0007\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n" + "\u0007\n\u0002\u000b\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002" + "\u000e\u0007\u000e\u0002\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002" + "\u0011\u0007\u0011\u0002\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002" + "\u0014\u0007\u0014\u0002\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002" + "\u0017\u0007\u0017\u0002\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002" + "\u001a\u0007\u001a\u0002\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002" + "\u001d\u0007\u001d\u0002\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002" + " \u0007 \u0002!\u0007!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002" + "%\u0007%\u0002&\u0007&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002" + "*\u0007*\u0002+\u0007+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002" + "/\u0007/\u00020\u00070\u00021\u00071\u00022\u00072\u00023\u00073\u0002" + "4\u00074\u00025\u00075\u00026\u00076\u00027\u00077\u00028\u00078\u0002" + "9\u00079\u0002:\u0007:\u0002;\u0007;\u0002<\u0007<\u0002=\u0007=\u0002" + ">\u0007>\u0002?\u0007?\u0002@\u0007@\u0002A\u0007A\u0002B\u0007B\u0002" + "C\u0007C\u0002D\u0007D\u0002E\u0007E\u0002F\u0007F\u0002G\u0007G\u0002" + "H\u0007H\u0002I\u0007I\u0002J\u0007J\u0002K\u0007K\u0002L\u0007L\u0002" + "M\u0007M\u0002N\u0007N\u0002O\u0007O\u0002P\u0007P\u0002Q\u0007Q\u0002" + "R\u0007R\u0002S\u0007S\u0002T\u0007T\u0002U\u0007U\u0001\u0000\u0004\u0000" + "\u00b0\b\u0000\u000b\u0000\f\u0000\u00b1\u0001\u0000\u0001\u0000\u0001" + "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0005\u0001\u00ba\b\u0001\n" + "\u0001\f\u0001\u00bd\t\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001" + "\u0001\u0001\u0001\u0005\u0001\u00c4\b\u0001\n\u0001\f\u0001\u00c7\t\u0001" + "\u0001\u0001\u0001\u0001\u0003\u0001\u00cb\b\u0001\u0001\u0001\u0001\u0001" + "\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004" + "\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007" + "\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001\t\u0001" + "\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001" + "\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001" + "\u000e\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001" + "\u000f\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001" + "\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001" + "\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0013\u0001" + "\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0014\u0001" + "\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001" + "\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016\u0001" + "\u0016\u0001\u0016\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001" + "\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001" + "\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001" + "\u0019\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001" + "\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001" + "\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d\u0001" + "\u001e\u0001\u001e\u0001\u001e\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001" + "!\u0001!\u0001\"\u0001\"\u0001\"\u0001#\u0001#\u0001#\u0001$\u0001$\u0001" + "$\u0001$\u0001%\u0001%\u0001&\u0001&\u0001&\u0001\'\u0001\'\u0001(\u0001" + "(\u0001(\u0001)\u0001)\u0001)\u0001*\u0001*\u0001*\u0001*\u0001+\u0001" + "+\u0001+\u0001,\u0001,\u0001,\u0001,\u0001-\u0001-\u0001.\u0001.\u0001" + "/\u0001/\u00010\u00010\u00010\u00011\u00011\u00011\u00012\u00012\u0001" + "3\u00013\u00014\u00014\u00014\u00015\u00015\u00015\u00016\u00016\u0001" + "6\u00017\u00017\u00017\u00018\u00018\u00018\u00018\u00019\u00019\u0001" + "9\u0001:\u0001:\u0001:\u0001;\u0001;\u0001<\u0001<\u0001<\u0001=\u0001" + "=\u0001=\u0001>\u0001>\u0001>\u0001?\u0001?\u0001?\u0001@\u0001@\u0001" + "@\u0001A\u0001A\u0001A\u0001B\u0001B\u0001B\u0001C\u0001C\u0001C\u0001" + "D\u0001D\u0001D\u0001D\u0001E\u0001E\u0001E\u0001E\u0001F\u0001F\u0001" + "F\u0001F\u0001F\u0001G\u0001G\u0004G\u01ba\bG\u000bG\fG\u01bb\u0001G\u0003" + "G\u01bf\bG\u0001H\u0001H\u0001H\u0004H\u01c4\bH\u000bH\fH\u01c5\u0001" + "H\u0003H\u01c9\bH\u0001I\u0001I\u0001I\u0005I\u01ce\bI\nI\fI\u01d1\tI" + "\u0003I\u01d3\bI\u0001I\u0003I\u01d6\bI\u0001J\u0001J\u0001J\u0005J\u01db" + "\bJ\nJ\fJ\u01de\tJ\u0003J\u01e0\bJ\u0001J\u0001J\u0004J\u01e4\bJ\u000b" + "J\fJ\u01e5\u0003J\u01e8\bJ\u0001J\u0001J\u0003J\u01ec\bJ\u0001J\u0004" + "J\u01ef\bJ\u000bJ\fJ\u01f0\u0003J\u01f3\bJ\u0001J\u0003J\u01f6\bJ\u0001" + "K\u0001K\u0001K\u0001K\u0001K\u0001K\u0005K\u01fe\bK\nK\fK\u0201\tK\u0001" + "K\u0001K\u0001K\u0001K\u0001K\u0001K\u0001K\u0005K\u020a\bK\nK\fK\u020d" + "\tK\u0001K\u0003K\u0210\bK\u0001L\u0001L\u0001L\u0001L\u0004L\u0216\b" + "L\u000bL\fL\u0217\u0001L\u0001L\u0005L\u021c\bL\nL\fL\u021f\tL\u0001L" + "\u0001L\u0001M\u0001M\u0001M\u0001M\u0001M\u0001N\u0001N\u0001N\u0001" + "N\u0001N\u0001N\u0001O\u0001O\u0001O\u0001O\u0001O\u0001P\u0001P\u0001" + "P\u0001P\u0004P\u0237\bP\u000bP\fP\u0238\u0001Q\u0001Q\u0001Q\u0001Q\u0005" + "Q\u023f\bQ\nQ\fQ\u0242\tQ\u0001Q\u0001Q\u0001R\u0001R\u0005R\u0248\bR" + "\nR\fR\u024b\tR\u0001S\u0001S\u0001S\u0001S\u0001T\u0001T\u0001T\u0005" + "T\u0254\bT\nT\fT\u0257\tT\u0003T\u0259\bT\u0001T\u0001T\u0001U\u0001U" + "\u0005U\u025f\bU\nU\fU\u0262\tU\u0001U\u0001U\u0005\u00bb\u00c5\u01ff" + "\u020b\u0217\u0000V\u0002\u0001\u0004\u0002\u0006\u0003\b\u0004\n\u0005" + "\f\u0006\u000e\u0007\u0010\b\u0012\t\u0014\n\u0016\u000b\u0018\f\u001a" + "\r\u001c\u000e\u001e\u000f \u0010\"\u0011$\u0012&\u0013(\u0014*\u0015" + ",\u0016.\u00170\u00182\u00194\u001a6\u001b8\u001c:\u001d<\u001e>\u001f" + "@ B!D\"F#H$J%L&N\'P(R)T*V+X,Z-\\.^/`0b1d2f3h4j5l6n7p8r9t:v;x<z=|>~?\u0080" + "@\u0082A\u0084B\u0086C\u0088D\u008aE\u008cF\u008eG\u0090H\u0092I\u0094" + "J\u0096K\u0098L\u009aM\u009cN\u009eO\u00a0P\u00a2Q\u00a4R\u00a6S\u00a8" + "T\u00aaU\u00acV\u0002\u0000\u0001\u0013\u0003\u0000\t\n\r\r \u0002\u0000" + "\n\n\r\r\u0001\u000007\u0002\u0000LLll\u0002\u0000XXxx\u0003\u000009A" + "Faf\u0001\u000019\u0001\u000009\u0006\u0000DDFFLLddffll\u0002\u0000EE" + "ee\u0002\u0000++--\u0004\u0000DDFFddff\u0002\u0000\"\"\\\\\u0002\u0000" + "\'\'\\\\\u0001\u0000\n\n\u0002\u0000\n\n//\u0007\u0000UUcciilmssuuxx\u0003" + "\u0000AZ__az\u0004\u000009AZ__az\u0286\u0000\u0002\u0001\u0000\u0000\u0000" + "\u0000\u0004\u0001\u0000\u0000\u0000\u0000\u0006\u0001\u0000\u0000\u0000" + "\u0000\b\u0001\u0000\u0000\u0000\u0000\n\u0001\u0000\u0000\u0000\u0000" + "\f\u0001\u0000\u0000\u0000\u0000\u000e\u0001\u0000\u0000\u0000\u0000\u0010" + "\u0001\u0000\u0000\u0000\u0000\u0012\u0001\u0000\u0000\u0000\u0000\u0014" + "\u0001\u0000\u0000\u0000\u0000\u0016\u0001\u0000\u0000\u0000\u0000\u0018" + "\u0001\u0000\u0000\u0000\u0000\u001a\u0001\u0000\u0000\u0000\u0000\u001c" + "\u0001\u0000\u0000\u0000\u0000\u001e\u0001\u0000\u0000\u0000\u0000 \u0001" + "\u0000\u0000\u0000\u0000\"\u0001\u0000\u0000\u0000\u0000$\u0001\u0000" + "\u0000\u0000\u0000&\u0001\u0000\u0000\u0000\u0000(\u0001\u0000\u0000\u0000" + "\u0000*\u0001\u0000\u0000\u0000\u0000,\u0001\u0000\u0000\u0000\u0000." + "\u0001\u0000\u0000\u0000\u00000\u0001\u0000\u0000\u0000\u00002\u0001\u0000" + "\u0000\u0000\u00004\u0001\u0000\u0000\u0000\u00006\u0001\u0000\u0000\u0000" + "\u00008\u0001\u0000\u0000\u0000\u0000:\u0001\u0000\u0000\u0000\u0000<" + "\u0001\u0000\u0000\u0000\u0000>\u0001\u0000\u0000\u0000\u0000@\u0001\u0000" + "\u0000\u0000\u0000B\u0001\u0000\u0000\u0000\u0000D\u0001\u0000\u0000\u0000" + "\u0000F\u0001\u0000\u0000\u0000\u0000H\u0001\u0000\u0000\u0000\u0000J" + "\u0001\u0000\u0000\u0000\u0000L\u0001\u0000\u0000\u0000\u0000N\u0001\u0000" + "\u0000\u0000\u0000P\u0001\u0000\u0000\u0000\u0000R\u0001\u0000\u0000\u0000" + "\u0000T\u0001\u0000\u0000\u0000\u0000V\u0001\u0000\u0000\u0000\u0000X" + "\u0001\u0000\u0000\u0000\u0000Z\u0001\u0000\u0000\u0000\u0000\\\u0001" + "\u0000\u0000\u0000\u0000^\u0001\u0000\u0000\u0000\u0000`\u0001\u0000\u0000" + "\u0000\u0000b\u0001\u0000\u0000\u0000\u0000d\u0001\u0000\u0000\u0000\u0000" + "f\u0001\u0000\u0000\u0000\u0000h\u0001\u0000\u0000\u0000\u0000j\u0001" + "\u0000\u0000\u0000\u0000l\u0001\u0000\u0000\u0000\u0000n\u0001\u0000\u0000" + "\u0000\u0000p\u0001\u0000\u0000\u0000\u0000r\u0001\u0000\u0000\u0000\u0000" + "t\u0001\u0000\u0000\u0000\u0000v\u0001\u0000\u0000\u0000\u0000x\u0001" + "\u0000\u0000\u0000\u0000z\u0001\u0000\u0000\u0000\u0000|\u0001\u0000\u0000" + "\u0000\u0000~\u0001\u0000\u0000\u0000\u0000\u0080\u0001\u0000\u0000\u0000" + "\u0000\u0082\u0001\u0000\u0000\u0000\u0000\u0084\u0001\u0000\u0000\u0000" + "\u0000\u0086\u0001\u0000\u0000\u0000\u0000\u0088\u0001\u0000\u0000\u0000" + "\u0000\u008a\u0001\u0000\u0000\u0000\u0000\u008c\u0001\u0000\u0000\u0000" + "\u0000\u008e\u0001\u0000\u0000\u0000\u0000\u0090\u0001\u0000\u0000\u0000" + "\u0000\u0092\u0001\u0000\u0000\u0000\u0000\u0094\u0001\u0000\u0000\u0000" + "\u0000\u0096\u0001\u0000\u0000\u0000\u0000\u0098\u0001\u0000\u0000\u0000" + "\u0000\u009a\u0001\u0000\u0000\u0000\u0000\u009c\u0001\u0000\u0000\u0000" + "\u0000\u009e\u0001\u0000\u0000\u0000\u0000\u00a0\u0001\u0000\u0000\u0000" + "\u0000\u00a2\u0001\u0000\u0000\u0000\u0000\u00a4\u0001\u0000\u0000\u0000" + "\u0000\u00a6\u0001\u0000\u0000\u0000\u0000\u00a8\u0001\u0000\u0000\u0000" + "\u0001\u00aa\u0001\u0000\u0000\u0000\u0001\u00ac\u0001\u0000\u0000\u0000" + "\u0002\u00af\u0001\u0000\u0000\u0000\u0004\u00ca\u0001\u0000\u0000\u0000" + "\u0006\u00ce\u0001\u0000\u0000\u0000\b\u00d0\u0001\u0000\u0000\u0000\n" + "\u00d2\u0001\u0000\u0000\u0000\f\u00d4\u0001\u0000\u0000\u0000\u000e\u00d6" + "\u0001\u0000\u0000\u0000\u0010\u00d8\u0001\u0000\u0000\u0000\u0012\u00da" + "\u0001\u0000\u0000\u0000\u0014\u00de\u0001\u0000\u0000\u0000\u0016\u00e3" + "\u0001\u0000\u0000\u0000\u0018\u00e5\u0001\u0000\u0000\u0000\u001a\u00e7" + "\u0001\u0000\u0000\u0000\u001c\u00ea\u0001\u0000\u0000\u0000\u001e\u00ed" + "\u0001\u0000\u0000\u0000 \u00f2\u0001\u0000\u0000\u0000\"\u00f8\u0001" + "\u0000\u0000\u0000$\u00fb\u0001\u0000\u0000\u0000&\u00ff\u0001\u0000\u0000" + "\u0000(\u0108\u0001\u0000\u0000\u0000*\u010e\u0001\u0000\u0000\u0000," + "\u0115\u0001\u0000\u0000\u0000.\u0119\u0001\u0000\u0000\u00000\u011d\u0001" + "\u0000\u0000\u00002\u0123\u0001\u0000\u0000\u00004\u0129\u0001\u0000\u0000" + "\u00006\u012e\u0001\u0000\u0000\u00008\u0139\u0001\u0000\u0000\u0000:" + "\u013b\u0001\u0000\u0000\u0000<\u013d\u0001\u0000\u0000\u0000>\u013f\u0001" + "\u0000\u0000\u0000@\u0142\u0001\u0000\u0000\u0000B\u0144\u0001\u0000\u0000" + "\u0000D\u0146\u0001\u0000\u0000\u0000F\u0148\u0001\u0000\u0000\u0000H" + "\u014b\u0001\u0000\u0000\u0000J\u014e\u0001\u0000\u0000\u0000L\u0152\u0001" + "\u0000\u0000\u0000N\u0154\u0001\u0000\u0000\u0000P\u0157\u0001\u0000\u0000" + "\u0000R\u0159\u0001\u0000\u0000\u0000T\u015c\u0001\u0000\u0000\u0000V" + "\u015f\u0001\u0000\u0000\u0000X\u0163\u0001\u0000\u0000\u0000Z\u0166\u0001" + "\u0000\u0000\u0000\\\u016a\u0001\u0000\u0000\u0000^\u016c\u0001\u0000" + "\u0000\u0000`\u016e\u0001\u0000\u0000\u0000b\u0170\u0001\u0000\u0000\u0000" + "d\u0173\u0001\u0000\u0000\u0000f\u0176\u0001\u0000\u0000\u0000h\u0178" + "\u0001\u0000\u0000\u0000j\u017a\u0001\u0000\u0000\u0000l\u017d\u0001\u0000" + "\u0000\u0000n\u0180\u0001\u0000\u0000\u0000p\u0183\u0001\u0000\u0000\u0000" + "r\u0186\u0001\u0000\u0000\u0000t\u018a\u0001\u0000\u0000\u0000v\u018d" + "\u0001\u0000\u0000\u0000x\u0190\u0001\u0000\u0000\u0000z\u0192\u0001\u0000" + "\u0000\u0000|\u0195\u0001\u0000\u0000\u0000~\u0198\u0001\u0000\u0000\u0000" + "\u0080\u019b\u0001\u0000\u0000\u0000\u0082\u019e\u0001\u0000\u0000\u0000" + "\u0084\u01a1\u0001\u0000\u0000\u0000\u0086\u01a4\u0001\u0000\u0000\u0000" + "\u0088\u01a7\u0001\u0000\u0000\u0000\u008a\u01aa\u0001\u0000\u0000\u0000" + "\u008c\u01ae\u0001\u0000\u0000\u0000\u008e\u01b2\u0001\u0000\u0000\u0000" + "\u0090\u01b7\u0001\u0000\u0000\u0000\u0092\u01c0\u0001\u0000\u0000\u0000" + "\u0094\u01d2\u0001\u0000\u0000\u0000\u0096\u01df\u0001\u0000\u0000\u0000" + "\u0098\u020f\u0001\u0000\u0000\u0000\u009a\u0211\u0001\u0000\u0000\u0000" + "\u009c\u0222\u0001\u0000\u0000\u0000\u009e\u0227\u0001\u0000\u0000\u0000" + "\u00a0\u022d\u0001\u0000\u0000\u0000\u00a2\u0232\u0001\u0000\u0000\u0000" + "\u00a4\u023a\u0001\u0000\u0000\u0000\u00a6\u0245\u0001\u0000\u0000\u0000" + "\u00a8\u024c\u0001\u0000\u0000\u0000\u00aa\u0258\u0001\u0000\u0000\u0000" + "\u00ac\u025c\u0001\u0000\u0000\u0000\u00ae\u00b0\u0007\u0000\u0000\u0000" + "\u00af\u00ae\u0001\u0000\u0000\u0000\u00b0\u00b1\u0001\u0000\u0000\u0000" + "\u00b1\u00af\u0001\u0000\u0000\u0000\u00b1\u00b2\u0001\u0000\u0000\u0000" + "\u00b2\u00b3\u0001\u0000\u0000\u0000\u00b3\u00b4\u0006\u0000\u0000\u0000" + "\u00b4\u0003\u0001\u0000\u0000\u0000\u00b5\u00b6\u0005/\u0000\u0000\u00b6" + "\u00b7\u0005/\u0000\u0000\u00b7\u00bb\u0001\u0000\u0000\u0000\u00b8\u00ba" + "\t\u0000\u0000\u0000\u00b9\u00b8\u0001\u0000\u0000\u0000\u00ba\u00bd\u0001" + "\u0000\u0000\u0000\u00bb\u00bc\u0001\u0000\u0000\u0000\u00bb\u00b9\u0001" + "\u0000\u0000\u0000\u00bc\u00be\u0001\u0000\u0000\u0000\u00bd\u00bb\u0001" + "\u0000\u0000\u0000\u00be\u00cb\u0007\u0001\u0000\u0000\u00bf\u00c0\u0005" + "/\u0000\u0000\u00c0\u00c1\u0005*\u0000\u0000\u00c1\u00c5\u0001\u0000\u0000" + "\u0000\u00c2\u00c4\t\u0000\u0000\u0000\u00c3\u00c2\u0001\u0000\u0000\u0000" + "\u00c4\u00c7\u0001\u0000\u0000\u0000\u00c5\u00c6\u0001\u0000\u0000\u0000" + "\u00c5\u00c3\u0001\u0000\u0000\u0000\u00c6\u00c8\u0001\u0000\u0000\u0000" + "\u00c7\u00c5\u0001\u0000\u0000\u0000\u00c8\u00c9\u0005*\u0000\u0000\u00c9" + "\u00cb\u0005/\u0000\u0000\u00ca\u00b5\u0001\u0000\u0000\u0000\u00ca\u00bf" + "\u0001\u0000\u0000\u0000\u00cb\u00cc\u0001\u0000\u0000\u0000\u00cc\u00cd" + "\u0006\u0001\u0000\u0000\u00cd\u0005\u0001\u0000\u0000\u0000\u00ce\u00cf" + "\u0005{\u0000\u0000\u00cf\u0007\u0001\u0000\u0000\u0000\u00d0\u00d1\u0005" + "}\u0000\u0000\u00d1\t\u0001\u0000\u0000\u0000\u00d2\u00d3\u0005[\u0000" + "\u0000\u00d3\u000b\u0001\u0000\u0000\u0000\u00d4\u00d5\u0005]\u0000\u0000" + "\u00d5\r\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005(\u0000\u0000\u00d7" + "\u000f\u0001\u0000\u0000\u0000\u00d8\u00d9\u0005)\u0000\u0000\u00d9\u0011" + "\u0001\u0000\u0000\u0000\u00da\u00db\u0005.\u0000\u0000\u00db\u00dc\u0001" + "\u0000\u0000\u0000\u00dc\u00dd\u0006\b\u0001\u0000\u00dd\u0013\u0001\u0000" + "\u0000\u0000\u00de\u00df\u0005?\u0000\u0000\u00df\u00e0\u0005.\u0000\u0000" + "\u00e0\u00e1\u0001\u0000\u0000\u0000\u00e1\u00e2\u0006\t\u0001\u0000\u00e2" + "\u0015\u0001\u0000\u0000\u0000\u00e3\u00e4\u0005,\u0000\u0000\u00e4\u0017" + "\u0001\u0000\u0000\u0000\u00e5\u00e6\u0005;\u0000\u0000\u00e6\u0019\u0001" + "\u0000\u0000\u0000\u00e7\u00e8\u0005i\u0000\u0000\u00e8\u00e9\u0005f\u0000" + "\u0000\u00e9\u001b\u0001\u0000\u0000\u0000\u00ea\u00eb\u0005i\u0000\u0000" + "\u00eb\u00ec\u0005n\u0000\u0000\u00ec\u001d\u0001\u0000\u0000\u0000\u00ed" + "\u00ee\u0005e\u0000\u0000\u00ee\u00ef\u0005l\u0000\u0000\u00ef\u00f0\u0005" + "s\u0000\u0000\u00f0\u00f1\u0005e\u0000\u0000\u00f1\u001f\u0001\u0000\u0000" + "\u0000\u00f2\u00f3\u0005w\u0000\u0000\u00f3\u00f4\u0005h\u0000\u0000\u00f4" + "\u00f5\u0005i\u0000\u0000\u00f5\u00f6\u0005l\u0000\u0000\u00f6\u00f7\u0005" + "e\u0000\u0000\u00f7!\u0001\u0000\u0000\u0000\u00f8\u00f9\u0005d\u0000" + "\u0000\u00f9\u00fa\u0005o\u0000\u0000\u00fa#\u0001\u0000\u0000\u0000\u00fb" + "\u00fc\u0005f\u0000\u0000\u00fc\u00fd\u0005o\u0000\u0000\u00fd\u00fe\u0005" + "r\u0000\u0000\u00fe%\u0001\u0000\u0000\u0000\u00ff\u0100\u0005c\u0000" + "\u0000\u0100\u0101\u0005o\u0000\u0000\u0101\u0102\u0005n\u0000\u0000\u0102" + "\u0103\u0005t\u0000\u0000\u0103\u0104\u0005i\u0000\u0000\u0104\u0105\u0005" + "n\u0000\u0000\u0105\u0106\u0005u\u0000\u0000\u0106\u0107\u0005e\u0000" + "\u0000\u0107\'\u0001\u0000\u0000\u0000\u0108\u0109\u0005b\u0000\u0000" + "\u0109\u010a\u0005r\u0000\u0000\u010a\u010b\u0005e\u0000\u0000\u010b\u010c" + "\u0005a\u0000\u0000\u010c\u010d\u0005k\u0000\u0000\u010d)\u0001\u0000" + "\u0000\u0000\u010e\u010f\u0005r\u0000\u0000\u010f\u0110\u0005e\u0000\u0000" + "\u0110\u0111\u0005t\u0000\u0000\u0111\u0112\u0005u\u0000\u0000\u0112\u0113" + "\u0005r\u0000\u0000\u0113\u0114\u0005n\u0000\u0000\u0114+\u0001\u0000" + "\u0000\u0000\u0115\u0116\u0005n\u0000\u0000\u0116\u0117\u0005e\u0000\u0000" + "\u0117\u0118\u0005w\u0000\u0000\u0118-\u0001\u0000\u0000\u0000\u0119\u011a" + "\u0005t\u0000\u0000\u011a\u011b\u0005r\u0000\u0000\u011b\u011c\u0005y" + "\u0000\u0000\u011c/\u0001\u0000\u0000\u0000\u011d\u011e\u0005c\u0000\u0000" + "\u011e\u011f\u0005a\u0000\u0000\u011f\u0120\u0005t\u0000\u0000\u0120\u0121" + "\u0005c\u0000\u0000\u0121\u0122\u0005h\u0000\u0000\u01221\u0001\u0000" + "\u0000\u0000\u0123\u0124\u0005t\u0000\u0000\u0124\u0125\u0005h\u0000\u0000" + "\u0125\u0126\u0005r\u0000\u0000\u0126\u0127\u0005o\u0000\u0000\u0127\u0128" + "\u0005w\u0000\u0000\u01283\u0001\u0000\u0000\u0000\u0129\u012a\u0005t" + "\u0000\u0000\u012a\u012b\u0005h\u0000\u0000\u012b\u012c\u0005i\u0000\u0000" + "\u012c\u012d\u0005s\u0000\u0000\u012d5\u0001\u0000\u0000\u0000\u012e\u012f" + "\u0005i\u0000\u0000\u012f\u0130\u0005n\u0000\u0000\u0130\u0131\u0005s" + "\u0000\u0000\u0131\u0132\u0005t\u0000\u0000\u0132\u0133\u0005a\u0000\u0000" + "\u0133\u0134\u0005n\u0000\u0000\u0134\u0135\u0005c\u0000\u0000\u0135\u0136" + "\u0005e\u0000\u0000\u0136\u0137\u0005o\u0000\u0000\u0137\u0138\u0005f" + "\u0000\u0000\u01387\u0001\u0000\u0000\u0000\u0139\u013a\u0005!\u0000\u0000" + "\u013a9\u0001\u0000\u0000\u0000\u013b\u013c\u0005~\u0000\u0000\u013c;" + "\u0001\u0000\u0000\u0000\u013d\u013e\u0005*\u0000\u0000\u013e=\u0001\u0000" + "\u0000\u0000\u013f\u0140\u0005/\u0000\u0000\u0140\u0141\u0004\u001e\u0000" + "\u0000\u0141?\u0001\u0000\u0000\u0000\u0142\u0143\u0005%\u0000\u0000\u0143" + "A\u0001\u0000\u0000\u0000\u0144\u0145\u0005+\u0000\u0000\u0145C\u0001" + "\u0000\u0000\u0000\u0146\u0147\u0005-\u0000\u0000\u0147E\u0001\u0000\u0000" + "\u0000\u0148\u0149\u0005<\u0000\u0000\u0149\u014a\u0005<\u0000\u0000\u014a" + "G\u0001\u0000\u0000\u0000\u014b\u014c\u0005>\u0000\u0000\u014c\u014d\u0005" + ">\u0000\u0000\u014dI\u0001\u0000\u0000\u0000\u014e\u014f\u0005>\u0000" + "\u0000\u014f\u0150\u0005>\u0000\u0000\u0150\u0151\u0005>\u0000\u0000\u0151" + "K\u0001\u0000\u0000\u0000\u0152\u0153\u0005<\u0000\u0000\u0153M\u0001" + "\u0000\u0000\u0000\u0154\u0155\u0005<\u0000\u0000\u0155\u0156\u0005=\u0000" + "\u0000\u0156O\u0001\u0000\u0000\u0000\u0157\u0158\u0005>\u0000\u0000\u0158" + "Q\u0001\u0000\u0000\u0000\u0159\u015a\u0005>\u0000\u0000\u015a\u015b\u0005" + "=\u0000\u0000\u015bS\u0001\u0000\u0000\u0000\u015c\u015d\u0005=\u0000" + "\u0000\u015d\u015e\u0005=\u0000\u0000\u015eU\u0001\u0000\u0000\u0000\u015f" + "\u0160\u0005=\u0000\u0000\u0160\u0161\u0005=\u0000\u0000\u0161\u0162\u0005" + "=\u0000\u0000\u0162W\u0001\u0000\u0000\u0000\u0163\u0164\u0005!\u0000" + "\u0000\u0164\u0165\u0005=\u0000\u0000\u0165Y\u0001\u0000\u0000\u0000\u0166" + "\u0167\u0005!\u0000\u0000\u0167\u0168\u0005=\u0000\u0000\u0168\u0169\u0005" + "=\u0000\u0000\u0169[\u0001\u0000\u0000\u0000\u016a\u016b\u0005&\u0000" + "\u0000\u016b]\u0001\u0000\u0000\u0000\u016c\u016d\u0005^\u0000\u0000\u016d" + "_\u0001\u0000\u0000\u0000\u016e\u016f\u0005|\u0000\u0000\u016fa\u0001" + "\u0000\u0000\u0000\u0170\u0171\u0005&\u0000\u0000\u0171\u0172\u0005&\u0000" + "\u0000\u0172c\u0001\u0000\u0000\u0000\u0173\u0174\u0005|\u0000\u0000\u0174" + "\u0175\u0005|\u0000\u0000\u0175e\u0001\u0000\u0000\u0000\u0176\u0177\u0005" + "?\u0000\u0000\u0177g\u0001\u0000\u0000\u0000\u0178\u0179\u0005:\u0000" + "\u0000\u0179i\u0001\u0000\u0000\u0000\u017a\u017b\u0005?\u0000\u0000\u017b" + "\u017c\u0005:\u0000\u0000\u017ck\u0001\u0000\u0000\u0000\u017d\u017e\u0005" + ":\u0000\u0000\u017e\u017f\u0005:\u0000\u0000\u017fm\u0001\u0000\u0000" + "\u0000\u0180\u0181\u0005-\u0000\u0000\u0181\u0182\u0005>\u0000\u0000\u0182" + "o\u0001\u0000\u0000\u0000\u0183\u0184\u0005=\u0000\u0000\u0184\u0185\u0005" + "~\u0000\u0000\u0185q\u0001\u0000\u0000\u0000\u0186\u0187\u0005=\u0000" + "\u0000\u0187\u0188\u0005=\u0000\u0000\u0188\u0189\u0005~\u0000\u0000\u0189" + "s\u0001\u0000\u0000\u0000\u018a\u018b\u0005+\u0000\u0000\u018b\u018c\u0005" + "+\u0000\u0000\u018cu\u0001\u0000\u0000\u0000\u018d\u018e\u0005-\u0000" + "\u0000\u018e\u018f\u0005-\u0000\u0000\u018fw\u0001\u0000\u0000\u0000\u0190" + "\u0191\u0005=\u0000\u0000\u0191y\u0001\u0000\u0000\u0000\u0192\u0193\u0005" + "+\u0000\u0000\u0193\u0194\u0005=\u0000\u0000\u0194{\u0001\u0000\u0000" + "\u0000\u0195\u0196\u0005-\u0000\u0000\u0196\u0197\u0005=\u0000\u0000\u0197" + "}\u0001\u0000\u0000\u0000\u0198\u0199\u0005*\u0000\u0000\u0199\u019a\u0005" + "=\u0000\u0000\u019a\u007f\u0001\u0000\u0000\u0000\u019b\u019c\u0005/\u0000" + "\u0000\u019c\u019d\u0005=\u0000\u0000\u019d\u0081\u0001\u0000\u0000\u0000" + "\u019e\u019f\u0005%\u0000\u0000\u019f\u01a0\u0005=\u0000\u0000\u01a0\u0083" + "\u0001\u0000\u0000\u0000\u01a1\u01a2\u0005&\u0000\u0000\u01a2\u01a3\u0005" + "=\u0000\u0000\u01a3\u0085\u0001\u0000\u0000\u0000\u01a4\u01a5\u0005^\u0000" + "\u0000\u01a5\u01a6\u0005=\u0000\u0000\u01a6\u0087\u0001\u0000\u0000\u0000" + "\u01a7\u01a8\u0005|\u0000\u0000\u01a8\u01a9\u0005=\u0000\u0000\u01a9\u0089" + "\u0001\u0000\u0000\u0000\u01aa\u01ab\u0005<\u0000\u0000\u01ab\u01ac\u0005" + "<\u0000\u0000\u01ac\u01ad\u0005=\u0000\u0000\u01ad\u008b\u0001\u0000\u0000" + "\u0000\u01ae\u01af\u0005>\u0000\u0000\u01af\u01b0\u0005>\u0000\u0000\u01b0" + "\u01b1\u0005=\u0000\u0000\u01b1\u008d\u0001\u0000\u0000\u0000\u01b2\u01b3" + "\u0005>\u0000\u0000\u01b3\u01b4\u0005>\u0000\u0000\u01b4\u01b5\u0005>" + "\u0000\u0000\u01b5\u01b6\u0005=\u0000\u0000\u01b6\u008f\u0001\u0000\u0000" + "\u0000\u01b7\u01b9\u00050\u0000\u0000\u01b8\u01ba\u0007\u0002\u0000\u0000" + "\u01b9\u01b8\u0001\u0000\u0000\u0000\u01ba\u01bb\u0001\u0000\u0000\u0000" + "\u01bb\u01b9\u0001\u0000\u0000\u0000\u01bb\u01bc\u0001\u0000\u0000\u0000" + "\u01bc\u01be\u0001\u0000\u0000\u0000\u01bd\u01bf\u0007\u0003\u0000\u0000" + "\u01be\u01bd\u0001\u0000\u0000\u0000\u01be\u01bf\u0001\u0000\u0000\u0000" + "\u01bf\u0091\u0001\u0000\u0000\u0000\u01c0\u01c1\u00050\u0000\u0000\u01c1" + "\u01c3\u0007\u0004\u0000\u0000\u01c2\u01c4\u0007\u0005\u0000\u0000\u01c3" + "\u01c2\u0001\u0000\u0000\u0000\u01c4\u01c5\u0001\u0000\u0000\u0000\u01c5" + "\u01c3\u0001\u0000\u0000\u0000\u01c5\u01c6\u0001\u0000\u0000\u0000\u01c6" + "\u01c8\u0001\u0000\u0000\u0000\u01c7\u01c9\u0007\u0003\u0000\u0000\u01c8" + "\u01c7\u0001\u0000\u0000\u0000\u01c8\u01c9\u0001\u0000\u0000\u0000\u01c9" + "\u0093\u0001\u0000\u0000\u0000\u01ca\u01d3\u00050\u0000\u0000\u01cb\u01cf" + "\u0007\u0006\u0000\u0000\u01cc\u01ce\u0007\u0007\u0000\u0000\u01cd\u01cc" + "\u0001\u0000\u0000\u0000\u01ce\u01d1\u0001\u0000\u0000\u0000\u01cf\u01cd" + "\u0001\u0000\u0000\u0000\u01cf\u01d0\u0001\u0000\u0000\u0000\u01d0\u01d3" + "\u0001\u0000\u0000\u0000\u01d1\u01cf\u0001\u0000\u0000\u0000\u01d2\u01ca" + "\u0001\u0000\u0000\u0000\u01d2\u01cb\u0001\u0000\u0000\u0000\u01d3\u01d5" + "\u0001\u0000\u0000\u0000\u01d4\u01d6\u0007\b\u0000\u0000\u01d5\u01d4\u0001" + "\u0000\u0000\u0000\u01d5\u01d6\u0001\u0000\u0000\u0000\u01d6\u0095\u0001" + "\u0000\u0000\u0000\u01d7\u01e0\u00050\u0000\u0000\u01d8\u01dc\u0007\u0006" + "\u0000\u0000\u01d9\u01db\u0007\u0007\u0000\u0000\u01da\u01d9\u0001\u0000" + "\u0000\u0000\u01db\u01de\u0001\u0000\u0000\u0000\u01dc\u01da\u0001\u0000" + "\u0000\u0000\u01dc\u01dd\u0001\u0000\u0000\u0000\u01dd\u01e0\u0001\u0000" + "\u0000\u0000\u01de\u01dc\u0001\u0000\u0000\u0000\u01df\u01d7\u0001\u0000" + "\u0000\u0000\u01df\u01d8\u0001\u0000\u0000\u0000\u01e0\u01e7\u0001\u0000" + "\u0000\u0000\u01e1\u01e3\u0003\u0012\b\u0000\u01e2\u01e4\u0007\u0007\u0000" + "\u0000\u01e3\u01e2\u0001\u0000\u0000\u0000\u01e4\u01e5\u0001\u0000\u0000" + "\u0000\u01e5\u01e3\u0001\u0000\u0000\u0000\u01e5\u01e6\u0001\u0000\u0000" + "\u0000\u01e6\u01e8\u0001\u0000\u0000\u0000\u01e7\u01e1\u0001\u0000\u0000" + "\u0000\u01e7\u01e8\u0001\u0000\u0000\u0000\u01e8\u01f2\u0001\u0000\u0000" + "\u0000\u01e9\u01eb\u0007\t\u0000\u0000\u01ea\u01ec\u0007\n\u0000\u0000" + "\u01eb\u01ea\u0001\u0000\u0000\u0000\u01eb\u01ec\u0001\u0000\u0000\u0000" + "\u01ec\u01ee\u0001\u0000\u0000\u0000\u01ed\u01ef\u0007\u0007\u0000\u0000" + "\u01ee\u01ed\u0001\u0000\u0000\u0000\u01ef\u01f0\u0001\u0000\u0000\u0000" + "\u01f0\u01ee\u0001\u0000\u0000\u0000\u01f0\u01f1\u0001\u0000\u0000\u0000" + "\u01f1\u01f3\u0001\u0000\u0000\u0000\u01f2\u01e9\u0001\u0000\u0000\u0000" + "\u01f2\u01f3\u0001\u0000\u0000\u0000\u01f3\u01f5\u0001\u0000\u0000\u0000" + "\u01f4\u01f6\u0007\u000b\u0000\u0000\u01f5\u01f4\u0001\u0000\u0000\u0000" + "\u01f5\u01f6\u0001\u0000\u0000\u0000\u01f6\u0097\u0001\u0000\u0000\u0000" + "\u01f7\u01ff\u0005\"\u0000\u0000\u01f8\u01f9\u0005\\\u0000\u0000\u01f9" + "\u01fe\u0005\"\u0000\u0000\u01fa\u01fb\u0005\\\u0000\u0000\u01fb\u01fe" + "\u0005\\\u0000\u0000\u01fc\u01fe\b\f\u0000\u0000\u01fd\u01f8\u0001\u0000" + "\u0000\u0000\u01fd\u01fa\u0001\u0000\u0000\u0000\u01fd\u01fc\u0001\u0000" + "\u0000\u0000\u01fe\u0201\u0001\u0000\u0000\u0000\u01ff\u0200\u0001\u0000" + "\u0000\u0000\u01ff\u01fd\u0001\u0000\u0000\u0000\u0200\u0202\u0001\u0000" + "\u0000\u0000\u0201\u01ff\u0001\u0000\u0000\u0000\u0202\u0210\u0005\"\u0000" + "\u0000\u0203\u020b\u0005\'\u0000\u0000\u0204\u0205\u0005\\\u0000\u0000" + "\u0205\u020a\u0005\'\u0000\u0000\u0206\u0207\u0005\\\u0000\u0000\u0207" + "\u020a\u0005\\\u0000\u0000\u0208\u020a\b\r\u0000\u0000\u0209\u0204\u0001" + "\u0000\u0000\u0000\u0209\u0206\u0001\u0000\u0000\u0000\u0209\u0208\u0001" + "\u0000\u0000\u0000\u020a\u020d\u0001\u0000\u0000\u0000\u020b\u020c\u0001" + "\u0000\u0000\u0000\u020b\u0209\u0001\u0000\u0000\u0000\u020c\u020e\u0001" + "\u0000\u0000\u0000\u020d\u020b\u0001\u0000\u0000\u0000\u020e\u0210\u0005" + "\'\u0000\u0000\u020f\u01f7\u0001\u0000\u0000\u0000\u020f\u0203\u0001\u0000" + "\u0000\u0000\u0210\u0099\u0001\u0000\u0000\u0000\u0211\u0215\u0005/\u0000" + "\u0000\u0212\u0213\u0005\\\u0000\u0000\u0213\u0216\b\u000e\u0000\u0000" + "\u0214\u0216\b\u000f\u0000\u0000\u0215\u0212\u0001\u0000\u0000\u0000\u0215" + "\u0214\u0001\u0000\u0000\u0000\u0216\u0217\u0001\u0000\u0000\u0000\u0217" + "\u0218\u0001\u0000\u0000\u0000\u0217\u0215\u0001\u0000\u0000\u0000\u0218" + "\u0219\u0001\u0000\u0000\u0000\u0219\u021d\u0005/\u0000\u0000\u021a\u021c" + "\u0007\u0010\u0000\u0000\u021b\u021a\u0001\u0000\u0000\u0000\u021c\u021f" + "\u0001\u0000\u0000\u0000\u021d\u021b\u0001\u0000\u0000\u0000\u021d\u021e" + "\u0001\u0000\u0000\u0000\u021e\u0220\u0001\u0000\u0000\u0000\u021f\u021d" + "\u0001\u0000\u0000\u0000\u0220\u0221\u0004L\u0001\u0000\u0221\u009b\u0001" + "\u0000\u0000\u0000\u0222\u0223\u0005t\u0000\u0000\u0223\u0224\u0005r\u0000" + "\u0000\u0224\u0225\u0005u\u0000\u0000\u0225\u0226\u0005e\u0000\u0000\u0226" + "\u009d\u0001\u0000\u0000\u0000\u0227\u0228\u0005f\u0000\u0000\u0228\u0229" + "\u0005a\u0000\u0000\u0229\u022a\u0005l\u0000\u0000\u022a\u022b\u0005s" + "\u0000\u0000\u022b\u022c\u0005e\u0000\u0000\u022c\u009f\u0001\u0000\u0000" + "\u0000\u022d\u022e\u0005n\u0000\u0000\u022e\u022f\u0005u\u0000\u0000\u022f" + "\u0230\u0005l\u0000\u0000\u0230\u0231\u0005l\u0000\u0000\u0231\u00a1\u0001" + "\u0000\u0000\u0000\u0232\u0236\u0003\u00a4Q\u0000\u0233\u0234\u0003\n" + "\u0004\u0000\u0234\u0235\u0003\f\u0005\u0000\u0235\u0237\u0001\u0000\u0000" + "\u0000\u0236\u0233\u0001\u0000\u0000\u0000\u0237\u0238\u0001\u0000\u0000" + "\u0000\u0238\u0236\u0001\u0000\u0000\u0000\u0238\u0239\u0001\u0000\u0000" + "\u0000\u0239\u00a3\u0001\u0000\u0000\u0000\u023a\u0240\u0003\u00a6R\u0000" + "\u023b\u023c\u0003\u0012\b\u0000\u023c\u023d\u0003\u00a6R\u0000\u023d" + "\u023f\u0001\u0000\u0000\u0000\u023e\u023b\u0001\u0000\u0000\u0000\u023f" + "\u0242\u0001\u0000\u0000\u0000\u0240\u023e\u0001\u0000\u0000\u0000\u0240" + "\u0241\u0001\u0000\u0000\u0000\u0241\u0243\u0001\u0000\u0000\u0000\u0242" + "\u0240\u0001\u0000\u0000\u0000\u0243\u0244\u0004Q\u0002\u0000\u0244\u00a5" + "\u0001\u0000\u0000\u0000\u0245\u0249\u0007\u0011\u0000\u0000\u0246\u0248" + "\u0007\u0012\u0000\u0000\u0247\u0246\u0001\u0000\u0000\u0000\u0248\u024b" + "\u0001\u0000\u0000\u0000\u0249\u0247\u0001\u0000\u0000\u0000\u0249\u024a" + "\u0001\u0000\u0000\u0000\u024a\u00a7\u0001\u0000\u0000\u0000\u024b\u0249" + "\u0001\u0000\u0000\u0000\u024c\u024d\t\u0000\u0000\u0000\u024d\u024e\u0001" + "\u0000\u0000\u0000\u024e\u024f\u0006S\u0000\u0000\u024f\u00a9\u0001\u0000" + "\u0000\u0000\u0250\u0259\u00050\u0000\u0000\u0251\u0255\u0007\u0006\u0000" + "\u0000\u0252\u0254\u0007\u0007\u0000\u0000\u0253\u0252\u0001\u0000\u0000" + "\u0000\u0254\u0257\u0001\u0000\u0000\u0000\u0255\u0253\u0001\u0000\u0000" + "\u0000\u0255\u0256\u0001\u0000\u0000\u0000\u0256\u0259\u0001\u0000\u0000" + "\u0000\u0257\u0255\u0001\u0000\u0000\u0000\u0258\u0250\u0001\u0000\u0000" + "\u0000\u0258\u0251\u0001\u0000\u0000\u0000\u0259\u025a\u0001\u0000\u0000" + "\u0000\u025a\u025b\u0006T\u0002\u0000\u025b\u00ab\u0001\u0000\u0000\u0000" + "\u025c\u0260\u0007\u0011\u0000\u0000\u025d\u025f\u0007\u0012\u0000\u0000" + "\u025e\u025d\u0001\u0000\u0000\u0000\u025f\u0262\u0001\u0000\u0000\u0000" + "\u0260\u025e\u0001\u0000\u0000\u0000\u0260\u0261\u0001\u0000\u0000\u0000" + "\u0261\u0263\u0001\u0000\u0000\u0000\u0262\u0260\u0001\u0000\u0000\u0000" + "\u0263\u0264\u0006U\u0002\u0000\u0264\u00ad\u0001\u0000\u0000\u0000#\u0000" + "\u0001\u00b1\u00bb\u00c5\u00ca\u01bb\u01be\u01c5\u01c8\u01cf\u01d2\u01d5" + "\u01dc\u01df\u01e5\u01e7\u01eb\u01f0\u01f2\u01f5\u01fd\u01ff\u0209\u020b" + "\u020f\u0215\u0217\u021d\u0238\u0240\u0249\u0255\u0258\u0260\u0003\u0006" + "\u0000\u0000\u0002\u0001\u0000\u0002\u0000\u0000"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); } } }
elastic/elasticsearch
modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/SuggestLexer.java
3,102
/* * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.core.type; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import java.util.stream.Collectors; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.core.annotation.MergedAnnotations; /** * Interface that defines abstract access to the annotations of a specific * class, in a form that does not require that class to be loaded yet. * * @author Juergen Hoeller * @author Mark Fisher * @author Phillip Webb * @author Sam Brannen * @since 2.5 * @see StandardAnnotationMetadata * @see org.springframework.core.type.classreading.MetadataReader#getAnnotationMetadata() * @see AnnotatedTypeMetadata */ public interface AnnotationMetadata extends ClassMetadata, AnnotatedTypeMetadata { /** * Get the fully-qualified class names of all annotation types that are * <em>directly present</em> on the underlying class. * @return the annotation type names */ default Set<String> getAnnotationTypes() { return getAnnotations().stream() .filter(MergedAnnotation::isDirectlyPresent) .map(annotation -> annotation.getType().getName()) .collect(Collectors.toCollection(LinkedHashSet::new)); } /** * Get the fully-qualified class names of all meta-annotation types that are * <em>present</em> on the given annotation type on the underlying class. * @param annotationName the fully-qualified class name of the annotation * type to look for meta-annotations on * @return the meta-annotation type names, or an empty set if none found */ default Set<String> getMetaAnnotationTypes(String annotationName) { MergedAnnotation<?> annotation = getAnnotations().get(annotationName, MergedAnnotation::isDirectlyPresent); if (!annotation.isPresent()) { return Collections.emptySet(); } return MergedAnnotations.from(annotation.getType()).stream() .map(mergedAnnotation -> mergedAnnotation.getType().getName()) .collect(Collectors.toCollection(LinkedHashSet::new)); } /** * Determine whether an annotation of the given type is <em>directly present</em> * on the underlying class. * @param annotationName the fully-qualified class name of the annotation * type to look for * @return {@code true} if a matching annotation is directly present */ default boolean hasAnnotation(String annotationName) { return getAnnotations().isDirectlyPresent(annotationName); } /** * Determine whether the underlying class has an annotation that is itself * annotated with the meta-annotation of the given type. * @param metaAnnotationName the fully-qualified class name of the * meta-annotation type to look for * @return {@code true} if a matching meta-annotation is present */ default boolean hasMetaAnnotation(String metaAnnotationName) { return getAnnotations().get(metaAnnotationName, MergedAnnotation::isMetaPresent).isPresent(); } /** * Determine whether the underlying class has any methods that are * annotated (or meta-annotated) with the given annotation type. * @param annotationName the fully-qualified class name of the annotation * type to look for */ default boolean hasAnnotatedMethods(String annotationName) { return !getAnnotatedMethods(annotationName).isEmpty(); } /** * Retrieve the method metadata for all methods that are annotated * (or meta-annotated) with the given annotation type. * <p>For any returned method, {@link MethodMetadata#isAnnotated} will * return {@code true} for the given annotation type. * @param annotationName the fully-qualified class name of the annotation * type to look for * @return a set of {@link MethodMetadata} for methods that have a matching * annotation. The return value will be an empty set if no methods match * the annotation type. */ Set<MethodMetadata> getAnnotatedMethods(String annotationName); /** * Retrieve the method metadata for all user-declared methods on the * underlying class, preserving declaration order as far as possible. * @return a set of {@link MethodMetadata} * @since 6.0 */ Set<MethodMetadata> getDeclaredMethods(); /** * Factory method to create a new {@link AnnotationMetadata} instance * for the given class using standard reflection. * @param type the class to introspect * @return a new {@link AnnotationMetadata} instance * @since 5.2 */ static AnnotationMetadata introspect(Class<?> type) { return StandardAnnotationMetadata.from(type); } }
spring-projects/spring-framework
spring-core/src/main/java/org/springframework/core/type/AnnotationMetadata.java
3,103
/* * 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.kafka.connect.data; import java.util.Objects; /** * A composite containing a {@link Schema} and associated value */ public class SchemaAndValue { private final Schema schema; private final Object value; public static final SchemaAndValue NULL = new SchemaAndValue(null, null); public SchemaAndValue(Schema schema, Object value) { this.value = value; this.schema = schema; } public Schema schema() { return schema; } public Object value() { return value; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SchemaAndValue that = (SchemaAndValue) o; return Objects.equals(schema, that.schema) && Objects.equals(value, that.value); } @Override public int hashCode() { return Objects.hash(schema, value); } @Override public String toString() { return "SchemaAndValue{" + "schema=" + schema + ", value=" + value + '}'; } }
apache/kafka
connect/api/src/main/java/org/apache/kafka/connect/data/SchemaAndValue.java
3,104
package mindustry.entities.comp; import arc.func.*; import arc.math.*; import arc.math.geom.*; import arc.math.geom.QuadTree.*; import mindustry.annotations.Annotations.*; import mindustry.entities.*; import mindustry.gen.*; @Component abstract class HitboxComp implements Posc, Sized, QuadTreeObject{ @Import float x, y; transient float lastX, lastY, deltaX, deltaY, hitSize; @Override public void update(){ } @Override public void add(){ updateLastPosition(); } @Override public void afterRead(){ updateLastPosition(); } @Override public float hitSize(){ return hitSize; } void getCollisions(Cons<QuadTree> consumer){ } void updateLastPosition(){ deltaX = x - lastX; deltaY = y - lastY; lastX = x; lastY = y; } void collision(Hitboxc other, float x, float y){ } float deltaLen(){ return Mathf.len(deltaX, deltaY); } float deltaAngle(){ return Mathf.angle(deltaX, deltaY); } boolean collides(Hitboxc other){ return true; } @Override public void hitbox(Rect rect){ rect.setCentered(x, y, hitSize, hitSize); } public void hitboxTile(Rect rect){ //tile hitboxes are never bigger than a tile, otherwise units get stuck float size = Math.min(hitSize * 0.66f, 7.8f); //TODO: better / more accurate version is //float size = hitSize * 0.85f; //- for tanks? rect.setCentered(x, y, size, size); } }
Anuken/Mindustry
core/src/mindustry/entities/comp/HitboxComp.java
3,105
package edu.stanford.nlp.pipeline; import edu.stanford.nlp.ling.CoreAnnotation; import edu.stanford.nlp.ling.CoreAnnotations; import edu.stanford.nlp.ling.CoreLabel; import edu.stanford.nlp.process.Morphology; import edu.stanford.nlp.util.ArraySet; import edu.stanford.nlp.util.CoreMap; import edu.stanford.nlp.util.logging.Redwood; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Set; /** * This class will add the lemmas of all the words to the Annotation. * It assumes that the Annotation already contains the tokenized words as * a {@code List<CoreLabel>} for a list of sentences under the * {@code SentencesAnnotation.class} key. * The Annotator adds lemma information to each CoreLabel, * in the LemmaAnnotation.class. * * @author Jenny Finkel */ public class MorphaAnnotator implements Annotator { /** A logger for this class */ private static final Redwood.RedwoodChannels log = Redwood.channels(MorphaAnnotator.class); private boolean VERBOSE = false; private static final String[] prep = {"abroad", "across", "after", "ahead", "along", "aside", "away", "around", "back", "down", "forward", "in", "off", "on", "over", "out", "round", "together", "through", "up"}; private static final List<String> particles = Arrays.asList(prep); public MorphaAnnotator() { this(true); } public MorphaAnnotator(boolean verbose) { VERBOSE = verbose; } @Override public void annotate(Annotation annotation) { if (VERBOSE) { log.info("Finding lemmas ..."); } Morphology morphology = new Morphology(); if (annotation.containsKey(CoreAnnotations.SentencesAnnotation.class)) { for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) { List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class); //log.info("Lemmatizing sentence: " + tokens); for (CoreLabel token : tokens) { String text = token.get(CoreAnnotations.TextAnnotation.class); String posTag = token.get(CoreAnnotations.PartOfSpeechAnnotation.class); addLemma(morphology, CoreAnnotations.LemmaAnnotation.class, token, text, posTag); } } } else { throw new RuntimeException("Unable to find words/tokens in: " + annotation); } } private static void addLemma(Morphology morpha, Class<? extends CoreAnnotation<String>> ann, CoreMap map, String word, String tag) { if ( ! tag.isEmpty()) { String phrasalVerb = phrasalVerb(morpha, word, tag); if (phrasalVerb == null) { map.set(ann, morpha.lemma(word, tag)); } else { map.set(ann, phrasalVerb); } } else { map.set(ann, morpha.stem(word)); } } /** If a token is a phrasal verb with an underscore between a verb and a * particle, return the phrasal verb lemmatized. If not, return null */ private static String phrasalVerb(Morphology morpha, String word, String tag) { // must be a verb and contain an underscore assert(word != null); assert(tag != null); if(!tag.startsWith("VB") || !word.contains("_")) return null; // check whether the last part is a particle String[] verb = word.split("_"); if(verb.length != 2) return null; String particle = verb[1]; if(particles.contains(particle)) { String base = verb[0]; String lemma = morpha.lemma(base, tag); return lemma + '_' + particle; } return null; } @Override public Set<Class<? extends CoreAnnotation>> requires() { return Collections.unmodifiableSet(new ArraySet<>(Arrays.asList( CoreAnnotations.TextAnnotation.class, CoreAnnotations.TokensAnnotation.class, CoreAnnotations.SentencesAnnotation.class, CoreAnnotations.PartOfSpeechAnnotation.class ))); } @Override public Set<Class<? extends CoreAnnotation>> requirementsSatisfied() { return Collections.singleton(CoreAnnotations.LemmaAnnotation.class); } }
stanfordnlp/CoreNLP
src/edu/stanford/nlp/pipeline/MorphaAnnotator.java
3,106
package org.ppsspp.ppsspp; // Note that the display* methods are in NativeRenderer.java public class NativeApp { public static final int DEVICE_ID_DEFAULT = 0; public static final int DEVICE_ID_KEYBOARD = 1; public static final int DEVICE_ID_MOUSE = 2; public static final int DEVICE_ID_PAD_0 = 10; public static final int DEVICE_TYPE_MOBILE = 0; public static final int DEVICE_TYPE_TV = 1; public static final int DEVICE_TYPE_DESKTOP = 2; public static final int DEVICE_TYPE_VR = 3; public static native void init(String model, int deviceType, String languageRegion, String apkPath, String dataDir, String externalStorageDir, String extFilesDir, String nativeLibDir, String additionalStorageDirs, String cacheDir, String shortcutParam, int androidVersion, String board); public static native void audioInit(); public static native void audioShutdown(); public static native void audioConfig(int optimalFramesPerBuffer, int optimalSampleRate); public static native void audioRecording_SetSampleRate(int sampleRate); public static native void audioRecording_Start(); public static native void audioRecording_Stop(); public static native void computeDesiredBackbufferDimensions(); public static native int getDesiredBackbufferWidth(); public static native int getDesiredBackbufferHeight(); public static native void setDisplayParameters(int display_xres, int display_yres, int dpi, float refreshRate); public static native void backbufferResize(int bufferWidth, int bufferHeight, int format); public static native boolean isLandscape(); public static native boolean isAtTopLevel(); // These have Android semantics: Resume is always called on bootup, after init public static native void pause(); public static native void resume(); public static native void shutdown(); public static native boolean keyDown(int deviceId, int key, boolean isRepeat); public static native boolean keyUp(int deviceId, int key); public static native void joystickAxis(int deviceId, int []axis, float []value, int count); public static native boolean mouseWheelEvent(float x, float y); // Sensor/input data. These are asynchronous, beware! public static native void touch(float x, float y, int data, int pointerId); public static native void accelerometer(float x, float y, float z); public static native void mouseDelta(float x, float y); public static native void sendMessageFromJava(String msg, String arg); public static native void sendRequestResult(int seqID, boolean result, String value, int iValue); public static native String queryConfig(String queryName); public static native int getSelectedCamera(); public static native int getDisplayFramerateMode(); public static native void setGpsDataAndroid(long time, float hdop, float latitude, float longitude, float altitude, float speed, float bearing); public static native void setSatInfoAndroid(short index, short id, short elevation, short azimuth, short snr, short good); public static native void pushCameraImageAndroid(byte[] image); // Wrappers public static void reportException(Exception e, String data) { String str = e.toString() + "\n" + e.getMessage() + "\n"; if (data != null) { str += data + "\n"; } // could also use import android.util.Log; String stackTrace = Log.getStackTraceString(exception); int count = 0; for (StackTraceElement ste : e.getStackTrace()) { str += ste + "\n"; // Only bother with the top of the stack. if (count > 3) { break; } count++; } NativeApp.sendMessageFromJava("exception", str); } public static void reportError(String errorStr) { NativeApp.sendMessageFromJava("exception", errorStr); } }
hrydgard/ppsspp
android/src/org/ppsspp/ppsspp/NativeApp.java
3,107
package com.baeldung.tika; import java.io.IOException; import java.io.InputStream; import org.apache.tika.Tika; import org.apache.tika.detect.DefaultDetector; import org.apache.tika.detect.Detector; import org.apache.tika.exception.TikaException; import org.apache.tika.metadata.Metadata; import org.apache.tika.mime.MediaType; import org.apache.tika.parser.AutoDetectParser; import org.apache.tika.parser.ParseContext; import org.apache.tika.parser.Parser; import org.apache.tika.sax.BodyContentHandler; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; public class TikaAnalysis { public static String detectDocTypeUsingDetector(InputStream stream) throws IOException { Detector detector = new DefaultDetector(); Metadata metadata = new Metadata(); MediaType mediaType = detector.detect(stream, metadata); return mediaType.toString(); } public static String detectDocTypeUsingFacade(InputStream stream) throws IOException { Tika tika = new Tika(); String mediaType = tika.detect(stream); return mediaType; } public static String extractContentUsingParser(InputStream stream) throws IOException, TikaException, SAXException { Parser parser = new AutoDetectParser(); ContentHandler handler = new BodyContentHandler(); Metadata metadata = new Metadata(); ParseContext context = new ParseContext(); parser.parse(stream, handler, metadata, context); return handler.toString(); } public static String extractContentUsingFacade(InputStream stream) throws IOException, TikaException { Tika tika = new Tika(); String content = tika.parseToString(stream); return content; } public static Metadata extractMetadatatUsingParser(InputStream stream) throws IOException, SAXException, TikaException { Parser parser = new AutoDetectParser(); ContentHandler handler = new BodyContentHandler(); Metadata metadata = new Metadata(); ParseContext context = new ParseContext(); parser.parse(stream, handler, metadata, context); return metadata; } public static Metadata extractMetadatatUsingFacade(InputStream stream) throws IOException, TikaException { Tika tika = new Tika(); Metadata metadata = new Metadata(); tika.parse(stream, metadata); return metadata; } }
eugenp/tutorials
text-processing-libraries-modules/apache-tika/src/main/java/com/baeldung/tika/TikaAnalysis.java
3,108
/* ### * IP: GHIDRA * * 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 ghidra.app.plugin.core.analysis; import java.util.ArrayList; import java.util.List; import ghidra.app.cmd.data.CreateDataCmd; import ghidra.app.services.*; import ghidra.app.util.importer.MessageLog; import ghidra.framework.options.Options; import ghidra.program.model.address.Address; import ghidra.program.model.address.AddressSetView; import ghidra.program.model.data.*; import ghidra.program.model.listing.BookmarkType; import ghidra.program.model.listing.Program; import ghidra.program.model.mem.Memory; import ghidra.util.bytesearch.*; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; public class EmbeddedMediaAnalyzer extends AbstractAnalyzer { private static final String NAME = "Embedded Media"; private static final String DESCRIPTION = "Finds embedded media data types (ie png, gif, jpeg, wav)"; private static final String OPTION_NAME_CREATE_BOOKMARKS = "Create Analysis Bookmarks"; private static final String OPTION_DESCRIPTION_CREATE_BOOKMARKS = "If checked, an analysis bookmark will be created at each location where embedded media data is identified."; private static final boolean OPTION_DEFAULT_CREATE_BOOKMARKS_ENABLED = true; private boolean createBookmarksEnabled = OPTION_DEFAULT_CREATE_BOOKMARKS_ENABLED; public EmbeddedMediaAnalyzer() { super(NAME, DESCRIPTION, AnalyzerType.BYTE_ANALYZER); setDefaultEnablement(true); setPriority(AnalysisPriority.BLOCK_ANALYSIS); setSupportsOneTimeAnalysis(); } @Override public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) throws CancelledException { Memory memory = program.getMemory(); AddressSetView validMemorySet = memory.getLoadedAndInitializedAddressSet(); AddressSetView searchSet = set.intersect(validMemorySet); if (searchSet.isEmpty()) { return false; // no valid addresses to search } MemoryBytePatternSearcher searcher = new MemoryBytePatternSearcher("Embedded Media"); List<Address> foundMedia = new ArrayList<>(); addByteSearchPattern(searcher, program, foundMedia, new GifDataType(), "GIF 87", GifDataType.MAGIC_87, GifDataType.GIFMASK); addByteSearchPattern(searcher, program, foundMedia, new GifDataType(), "GIF 89", GifDataType.MAGIC_89, GifDataType.GIFMASK); addByteSearchPattern(searcher, program, foundMedia, new PngDataType(), "PNG", PngDataType.MAGIC, PngDataType.MASK); addByteSearchPattern(searcher, program, foundMedia, new JPEGDataType(), "JPEG", JPEGDataType.MAGIC, JPEGDataType.MAGIC_MASK); addByteSearchPattern(searcher, program, foundMedia, new WAVEDataType(), "WAVE", WAVEDataType.MAGIC, WAVEDataType.MAGIC_MASK); addByteSearchPattern(searcher, program, foundMedia, new MIDIDataType(), "MIDI", MIDIDataType.MAGIC, MIDIDataType.MAGIC_MASK); addByteSearchPattern(searcher, program, foundMedia, new AUDataType(), "AU", AUDataType.MAGIC, AUDataType.MAGIC_MASK); addByteSearchPattern(searcher, program, foundMedia, new AIFFDataType(), "AIFF", AIFFDataType.MAGIC_AIFF, AIFFDataType.MAGIC_MASK); addByteSearchPattern(searcher, program, foundMedia, new AIFFDataType(), "AIFC", AIFFDataType.MAGIC_AIFC, AIFFDataType.MAGIC_MASK); searcher.search(program, searchSet, monitor); return foundMedia.size() > 0; } private void addByteSearchPattern(MemoryBytePatternSearcher searcher, Program program, List<Address> foundMedia, DataType mediaDT, String mediaName, byte[] bytes, byte[] mask) { if (bytes == null) { return; } GenericMatchAction<DataType> action = new GenericMatchAction<DataType>(mediaDT) { @Override public void apply(Program prog, Address addr, Match match) { //See if it is already an applied media data type if (!program.getListing().isUndefined(addr, addr)) { return; } try { CreateDataCmd cmd = new CreateDataCmd(addr, mediaDT); if (cmd.applyTo(program)) { if (createBookmarksEnabled) { program.getBookmarkManager().setBookmark(addr, BookmarkType.ANALYSIS, "Embedded Media", "Found " + mediaName + " Embedded Media"); } foundMedia.add(addr); } } //If media does not apply correctly then it is not really a that media data type or there is other data in the way catch (Exception e) { // Not a valid embedded media or no room to apply it so just ignore it and skip it } } }; GenericByteSequencePattern<DataType> genericByteMatchPattern = new GenericByteSequencePattern<DataType>(bytes, mask, action); searcher.addPattern(genericByteMatchPattern); } @Override public void registerOptions(Options options, Program program) { options.registerOption(OPTION_NAME_CREATE_BOOKMARKS, createBookmarksEnabled, null, OPTION_DESCRIPTION_CREATE_BOOKMARKS); } @Override public void optionsChanged(Options options, Program program) { createBookmarksEnabled = options.getBoolean(OPTION_NAME_CREATE_BOOKMARKS, createBookmarksEnabled); } }
NationalSecurityAgency/ghidra
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/EmbeddedMediaAnalyzer.java
3,109
package org.signal.imageeditor.core.model; import android.animation.ValueAnimator; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import androidx.annotation.Nullable; final class AlphaAnimation { private final static Interpolator interpolator = new LinearInterpolator(); final static AlphaAnimation NULL_1 = new AlphaAnimation(1); private final float from; private final float to; private final Runnable invalidate; private final boolean canAnimate; private float animatedFraction; private AlphaAnimation(float from, float to, @Nullable Runnable invalidate) { this.from = from; this.to = to; this.invalidate = invalidate; this.canAnimate = invalidate != null; } private AlphaAnimation(float fixed) { this(fixed, fixed, null); } static AlphaAnimation animate(float from, float to, @Nullable Runnable invalidate) { if (invalidate == null) { return new AlphaAnimation(to); } if (from != to) { AlphaAnimation animationMatrix = new AlphaAnimation(from, to, invalidate); animationMatrix.start(); return animationMatrix; } else { return new AlphaAnimation(to); } } private void start() { if (canAnimate && invalidate != null) { ValueAnimator animator = ValueAnimator.ofFloat(from, to); animator.setDuration(200); animator.setInterpolator(interpolator); animator.addUpdateListener(animation -> { animatedFraction = (float) animation.getAnimatedValue(); invalidate.run(); }); animator.start(); } } float getValue() { if (!canAnimate) return to; return animatedFraction; } }
signalapp/Signal-Android
image-editor/lib/src/main/java/org/signal/imageeditor/core/model/AlphaAnimation.java
3,110
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * 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.pentaho.di.core; import java.math.BigDecimal; import java.util.Date; import org.pentaho.di.core.exception.KettlePluginException; import org.pentaho.di.core.exception.KettleValueException; import org.pentaho.di.core.injection.InjectionTypeConverter; import org.pentaho.di.core.row.RowDataUtil; import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.row.value.ValueMetaFactory; import org.pentaho.di.core.row.value.ValueMetaNone; import org.pentaho.di.repository.LongObjectId; import org.pentaho.di.repository.ObjectId; public class RowMetaAndData implements Cloneable { private RowMetaInterface rowMeta; private Object[] data; public RowMetaAndData() { clear(); } /** * @param rowMeta * @param data */ public RowMetaAndData( RowMetaInterface rowMeta, Object... data ) { this.rowMeta = rowMeta; this.data = data; } @Override public RowMetaAndData clone() { RowMetaAndData c = new RowMetaAndData(); c.rowMeta = rowMeta.clone(); try { c.data = rowMeta.cloneRow( data ); } catch ( KettleValueException e ) { throw new RuntimeException( "Problem with clone row detected in RowMetaAndData", e ); } return c; } @Override public String toString() { try { return rowMeta.getString( data ); } catch ( KettleValueException e ) { return rowMeta.toString() + ", error presenting data: " + e.toString(); } } /** * @return the data */ public Object[] getData() { return data; } /** * @param data * the data to set */ public void setData( Object[] data ) { this.data = data; } /** * @return the rowMeta */ public RowMetaInterface getRowMeta() { return rowMeta; } /** * @param rowMeta * the rowMeta to set */ public void setRowMeta( RowMetaInterface rowMeta ) { this.rowMeta = rowMeta; } @Override public int hashCode() { try { return rowMeta.hashCode( data ); } catch ( KettleValueException e ) { throw new RuntimeException( "Row metadata and data: unable to calculate hashcode because of a data conversion problem", e ); } } @Override public boolean equals( Object obj ) { try { return rowMeta.compare( data, ( (RowMetaAndData) obj ).getData() ) == 0; } catch ( KettleValueException e ) { throw new RuntimeException( "Row metadata and data: unable to compare rows because of a data conversion problem", e ); } } public void addValue( ValueMetaInterface valueMeta, Object valueData ) { if ( valueMeta.isInteger() && ( valueData instanceof ObjectId ) ) { valueData = new LongObjectId( (ObjectId) valueData ).longValue(); } data = RowDataUtil.addValueData( data, rowMeta.size(), valueData ); rowMeta.addValueMeta( valueMeta ); } public void addValue( String valueName, int valueType, Object valueData ) { ValueMetaInterface v; try { v = ValueMetaFactory.createValueMeta( valueName, valueType ); } catch ( KettlePluginException e ) { v = new ValueMetaNone( valueName ); } addValue( v, valueData ); } public void clear() { rowMeta = new RowMeta(); data = new Object[] {}; } public long getInteger( String valueName, long def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getInteger( idx, def ); } public long getInteger( int index, long def ) throws KettleValueException { Long number = rowMeta.getInteger( data, index ); if ( number == null ) { return def; } return number.longValue(); } public Long getInteger( String valueName ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return rowMeta.getInteger( data, idx ); } public Long getInteger( int index ) throws KettleValueException { return rowMeta.getInteger( data, index ); } public double getNumber( String valueName, double def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getNumber( idx, def ); } public double getNumber( int index, double def ) throws KettleValueException { Double number = rowMeta.getNumber( data, index ); if ( number == null ) { return def; } return number.doubleValue(); } public Date getDate( String valueName, Date def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getDate( idx, def ); } public Date getDate( int index, Date def ) throws KettleValueException { Date date = rowMeta.getDate( data, index ); if ( date == null ) { return def; } return date; } public BigDecimal getBigNumber( String valueName, BigDecimal def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getBigNumber( idx, def ); } public BigDecimal getBigNumber( int index, BigDecimal def ) throws KettleValueException { BigDecimal number = rowMeta.getBigNumber( data, index ); if ( number == null ) { return def; } return number; } public boolean getBoolean( String valueName, boolean def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getBoolean( idx, def ); } public boolean getBoolean( int index, boolean def ) throws KettleValueException { Boolean b = rowMeta.getBoolean( data, index ); if ( b == null ) { return def; } return b.booleanValue(); } public String getString( String valueName, String def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getString( idx, def ); } public String getString( int index, String def ) throws KettleValueException { String string = rowMeta.getString( data, index ); if ( string == null ) { return def; } return string; } public byte[] getBinary( String valueName, byte[] def ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } return getBinary( idx, def ); } public byte[] getBinary( int index, byte[] def ) throws KettleValueException { byte[] bin = rowMeta.getBinary( data, index ); if ( bin == null ) { return def; } return bin; } public int compare( RowMetaAndData compare, int[] is, boolean[] bs ) throws KettleValueException { return rowMeta.compare( data, compare.getData(), is ); } public boolean isNumeric( int index ) { return rowMeta.getValueMeta( index ).isNumeric(); } public int size() { return rowMeta.size(); } public ValueMetaInterface getValueMeta( int index ) { return rowMeta.getValueMeta( index ); } public boolean isEmptyValue( String valueName ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } ValueMetaInterface metaType = rowMeta.getValueMeta( idx ); // find by source value type switch ( metaType.getType() ) { case ValueMetaInterface.TYPE_STRING: return rowMeta.getString( data, idx ) == null; case ValueMetaInterface.TYPE_BOOLEAN: return rowMeta.getBoolean( data, idx ) == null; case ValueMetaInterface.TYPE_INTEGER: return rowMeta.getInteger( data, idx ) == null; case ValueMetaInterface.TYPE_NUMBER: return rowMeta.getNumber( data, idx ) == null; case ValueMetaInterface.TYPE_BIGNUMBER: return rowMeta.getBigNumber( data, idx ) == null; case ValueMetaInterface.TYPE_BINARY: return rowMeta.getBinary( data, idx ) == null; case ValueMetaInterface.TYPE_DATE: case ValueMetaInterface.TYPE_TIMESTAMP: return rowMeta.getDate( data, idx ) == null; case ValueMetaInterface.TYPE_INET: return rowMeta.getString( data, idx ) == null; } throw new KettleValueException( "Unknown source type: " + metaType.getTypeDesc() ); } /** * Converts string value into specified type. Used for constant injection. */ public static Object getStringAsJavaType( String vs, Class<?> destinationType, InjectionTypeConverter converter ) throws KettleValueException { if ( String.class.isAssignableFrom( destinationType ) ) { return converter.string2string( vs ); } else if ( int.class.isAssignableFrom( destinationType ) ) { return converter.string2intPrimitive( vs ); } else if ( Integer.class.isAssignableFrom( destinationType ) ) { return converter.string2integer( vs ); } else if ( long.class.isAssignableFrom( destinationType ) ) { return converter.string2longPrimitive( vs ); } else if ( Long.class.isAssignableFrom( destinationType ) ) { return converter.string2long( vs ); } else if ( boolean.class.isAssignableFrom( destinationType ) ) { return converter.string2booleanPrimitive( vs ); } else if ( Boolean.class.isAssignableFrom( destinationType ) ) { return converter.string2boolean( vs ); } else if ( destinationType.isEnum() ) { return converter.string2enum( destinationType, vs ); } else { throw new RuntimeException( "Wrong value conversion to " + destinationType ); } } /** * Returns value as specified java type using converter. Used for metadata injection. */ public Object getAsJavaType( String valueName, Class<?> destinationType, InjectionTypeConverter converter ) throws KettleValueException { int idx = rowMeta.indexOfValue( valueName ); if ( idx < 0 ) { throw new KettleValueException( "Unknown column '" + valueName + "'" ); } ValueMetaInterface metaType = rowMeta.getValueMeta( idx ); // find by source value type switch ( metaType.getType() ) { case ValueMetaInterface.TYPE_STRING: String vs = rowMeta.getString( data, idx ); return getStringAsJavaType( vs, destinationType, converter ); case ValueMetaInterface.TYPE_BOOLEAN: Boolean vb = rowMeta.getBoolean( data, idx ); if ( String.class.isAssignableFrom( destinationType ) ) { return converter.boolean2string( vb ); } else if ( int.class.isAssignableFrom( destinationType ) ) { return converter.boolean2intPrimitive( vb ); } else if ( Integer.class.isAssignableFrom( destinationType ) ) { return converter.boolean2integer( vb ); } else if ( long.class.isAssignableFrom( destinationType ) ) { return converter.boolean2longPrimitive( vb ); } else if ( Long.class.isAssignableFrom( destinationType ) ) { return converter.boolean2long( vb ); } else if ( boolean.class.isAssignableFrom( destinationType ) ) { return converter.boolean2booleanPrimitive( vb ); } else if ( Boolean.class.isAssignableFrom( destinationType ) ) { return converter.boolean2boolean( vb ); } else if ( destinationType.isEnum() ) { return converter.boolean2enum( destinationType, vb ); } else { throw new RuntimeException( "Wrong value conversion to " + destinationType ); } case ValueMetaInterface.TYPE_INTEGER: Long vi = rowMeta.getInteger( data, idx ); if ( String.class.isAssignableFrom( destinationType ) ) { return converter.integer2string( vi ); } else if ( int.class.isAssignableFrom( destinationType ) ) { return converter.integer2intPrimitive( vi ); } else if ( Integer.class.isAssignableFrom( destinationType ) ) { return converter.integer2integer( vi ); } else if ( long.class.isAssignableFrom( destinationType ) ) { return converter.integer2longPrimitive( vi ); } else if ( Long.class.isAssignableFrom( destinationType ) ) { return converter.integer2long( vi ); } else if ( boolean.class.isAssignableFrom( destinationType ) ) { return converter.integer2booleanPrimitive( vi ); } else if ( Boolean.class.isAssignableFrom( destinationType ) ) { return converter.integer2boolean( vi ); } else if ( destinationType.isEnum() ) { return converter.integer2enum( destinationType, vi ); } else { throw new RuntimeException( "Wrong value conversion to " + destinationType ); } case ValueMetaInterface.TYPE_NUMBER: Double vn = rowMeta.getNumber( data, idx ); if ( String.class.isAssignableFrom( destinationType ) ) { return converter.number2string( vn ); } else if ( int.class.isAssignableFrom( destinationType ) ) { return converter.number2intPrimitive( vn ); } else if ( Integer.class.isAssignableFrom( destinationType ) ) { return converter.number2integer( vn ); } else if ( long.class.isAssignableFrom( destinationType ) ) { return converter.number2longPrimitive( vn ); } else if ( Long.class.isAssignableFrom( destinationType ) ) { return converter.number2long( vn ); } else if ( boolean.class.isAssignableFrom( destinationType ) ) { return converter.number2booleanPrimitive( vn ); } else if ( Boolean.class.isAssignableFrom( destinationType ) ) { return converter.number2boolean( vn ); } else if ( destinationType.isEnum() ) { return converter.number2enum( destinationType, vn ); } else { throw new RuntimeException( "Wrong value conversion to " + destinationType ); } } throw new KettleValueException( "Unknown conversion from " + metaType.getTypeDesc() + " into " + destinationType ); } public void removeValue( String valueName ) throws KettleValueException { int index = rowMeta.indexOfValue( valueName ); if ( index < 0 ) { throw new KettleValueException( "Unable to find '" + valueName + "' in the row" ); } removeValue( index ); } public void removeValue( int index ) { rowMeta.removeValueMeta( index ); data = RowDataUtil.removeItem( data, index ); } public void mergeRowMetaAndData( RowMetaAndData rowMetaAndData, String originStepName ) { int originalMetaSize = rowMeta.size(); rowMeta.mergeRowMeta( rowMetaAndData.getRowMeta(), originStepName ); data = RowDataUtil.addRowData( data, originalMetaSize, rowMetaAndData.getData() ); } }
pentaho/pentaho-kettle
core/src/main/java/org/pentaho/di/core/RowMetaAndData.java
3,111
package com.twitter.search.earlybird.partition; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import com.twitter.search.core.earlybird.index.EarlybirdIndexSegmentData; public class SegmentIndexStats { private EarlybirdIndexSegmentData segmentData; private final AtomicLong indexSizeOnDiskInBytes = new AtomicLong(0); private final AtomicInteger partialUpdateCount = new AtomicInteger(0); private final AtomicInteger outOfOrderUpdateCount = new AtomicInteger(0); private Optional<Integer> savedStatusCount = Optional.empty(); private Optional<Integer> savedDeletesCount = Optional.empty(); public void setSegmentData(EarlybirdIndexSegmentData segmentData) { this.segmentData = segmentData; } /** * We'd like to be able to return the last counts after we unload a segment from memory. */ public void unsetSegmentDataAndSaveCounts() { savedStatusCount = Optional.of(getStatusCount()); savedDeletesCount = Optional.of(getDeleteCount()); segmentData = null; } /** * Returns the number of deletes processed by this segment. */ public int getDeleteCount() { if (segmentData != null) { return segmentData.getDeletedDocs().numDeletions(); } else { return savedDeletesCount.orElse(0); } } /** * Return the number of documents in this segment. */ public int getStatusCount() { if (segmentData != null) { return segmentData.numDocs(); } else { return savedStatusCount.orElse(0); } } public long getIndexSizeOnDiskInBytes() { return indexSizeOnDiskInBytes.get(); } public void setIndexSizeOnDiskInBytes(long value) { indexSizeOnDiskInBytes.set(value); } public int getPartialUpdateCount() { return partialUpdateCount.get(); } public void incrementPartialUpdateCount() { partialUpdateCount.incrementAndGet(); } public void setPartialUpdateCount(int value) { partialUpdateCount.set(value); } public int getOutOfOrderUpdateCount() { return outOfOrderUpdateCount.get(); } public void incrementOutOfOrderUpdateCount() { outOfOrderUpdateCount.incrementAndGet(); } public void setOutOfOrderUpdateCount(int value) { outOfOrderUpdateCount.set(value); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Indexed ").append(getStatusCount()).append(" documents, "); sb.append(getDeleteCount()).append(" deletes, "); sb.append(getPartialUpdateCount()).append(" partial updates, "); sb.append(getOutOfOrderUpdateCount()).append(" out of order udpates. "); sb.append("Index size: ").append(getIndexSizeOnDiskInBytes()); return sb.toString(); } }
twitter/the-algorithm
src/java/com/twitter/search/earlybird/partition/SegmentIndexStats.java
3,112
package org.telegram.ui.Cells; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; import android.text.style.RelativeSizeSpan; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.DocumentObject; import org.telegram.messenger.Emoji; import org.telegram.messenger.FileLoader; import org.telegram.messenger.ImageLocation; import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MessageObject; import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.SvgHelper; import org.telegram.messenger.UserObject; import org.telegram.tgnet.TLObject; import org.telegram.tgnet.TLRPC; import org.telegram.tgnet.tl.TL_stories; import org.telegram.ui.ActionBar.SimpleTextView; import org.telegram.ui.ActionBar.Theme; import org.telegram.ui.Components.AnimatedEmojiDrawable; import org.telegram.ui.Components.AvatarDrawable; import org.telegram.ui.Components.BackupImageView; import org.telegram.ui.Components.CubicBezierInterpolator; import org.telegram.ui.Components.DotDividerSpan; import org.telegram.ui.Components.LayoutHelper; import org.telegram.ui.Components.MessageSeenCheckDrawable; import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble; import org.telegram.messenger.LocaleController; import org.telegram.ui.Components.StatusBadgeComponent; import org.telegram.ui.Stories.StoriesUtilities; public class ReactedUserHolderView extends FrameLayout { public boolean drawDivider; int currentAccount; public static int STYLE_DEFAULT = 0; public static int STYLE_STORY = 1; public BackupImageView avatarView; SimpleTextView titleView; SimpleTextView subtitleView; BackupImageView reactView; public BackupImageView storyPreviewView; public int storyId; AvatarDrawable avatarDrawable = new AvatarDrawable(); View overlaySelectorView; StatusBadgeComponent statusBadgeComponent; public final static int ITEM_HEIGHT_DP = 50; public final static int STORY_ITEM_HEIGHT_DP = 58; Theme.ResourcesProvider resourcesProvider; int style; public long dialogId; public StoriesUtilities.AvatarStoryParams params; public void openStory(long dialogId, Runnable onDone) { } public static final MessageSeenCheckDrawable seenDrawable = new MessageSeenCheckDrawable(R.drawable.msg_mini_checks, Theme.key_windowBackgroundWhiteGrayText); public static final MessageSeenCheckDrawable reactDrawable = new MessageSeenCheckDrawable(R.drawable.msg_reactions, Theme.key_windowBackgroundWhiteGrayText, 16, 16, 5.66f); public static final MessageSeenCheckDrawable repostDrawable = new MessageSeenCheckDrawable(R.drawable.mini_repost_story, Theme.key_stories_circle1); public static final MessageSeenCheckDrawable forwardDrawable = new MessageSeenCheckDrawable(R.drawable.mini_forward_story, Theme.key_stories_circle1); public ReactedUserHolderView(int style, int currentAccount, @NonNull Context context, Theme.ResourcesProvider resourcesProvider) { this(style, currentAccount, context, resourcesProvider, true); } public ReactedUserHolderView(int style, int currentAccount, @NonNull Context context, Theme.ResourcesProvider resourcesProvider, boolean useOverlaySelector) { super(context); this.style = style; this.currentAccount = currentAccount; this.resourcesProvider = resourcesProvider; this.params = new StoriesUtilities.AvatarStoryParams(false, resourcesProvider) { @Override public void openStory(long dialogId, Runnable onDone) { ReactedUserHolderView.this.openStory(dialogId, onDone); } }; setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, AndroidUtilities.dp(ITEM_HEIGHT_DP))); int avatarSize = style == STYLE_STORY ? 48 : 34; avatarView = new BackupImageView(context) { @Override protected void onDraw(Canvas canvas) { if (style == STYLE_STORY) { params.originalAvatarRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); StoriesUtilities.drawAvatarWithStory(dialogId, canvas, getImageReceiver(), params); } else { super.onDraw(canvas); } } @Override public boolean onTouchEvent(MotionEvent event) { return params.checkOnTouchEvent(event, this); } }; avatarView.setRoundRadius(AndroidUtilities.dp(avatarSize)); addView(avatarView, LayoutHelper.createFrameRelatively(avatarSize, avatarSize, Gravity.START | Gravity.CENTER_VERTICAL, 10, 0, 0, 0)); if (style == STYLE_STORY) { setClipChildren(false); } titleView = new SimpleTextView(context) { @Override public boolean setText(CharSequence value) { value = Emoji.replaceEmoji(value, getPaint().getFontMetricsInt(), AndroidUtilities.dp(14), false); return super.setText(value); } }; NotificationCenter.listenEmojiLoading(titleView); titleView.setTextSize(16); titleView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem, resourcesProvider)); titleView.setEllipsizeByGradient(true); titleView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); titleView.setRightPadding(AndroidUtilities.dp(30)); titleView.setTranslationX(LocaleController.isRTL ? AndroidUtilities.dp(30) : 0); titleView.setRightDrawableOutside(true); float topMargin = style == STYLE_STORY ? 7.66f : 5.33f; float leftMargin = style == STYLE_STORY ? 73 : 55; addView(titleView, LayoutHelper.createFrameRelatively(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL_HORIZONTAL | Gravity.TOP, leftMargin, topMargin, 12, 0)); statusBadgeComponent = new StatusBadgeComponent(this); titleView.setDrawablePadding(AndroidUtilities.dp(3)); titleView.setRightDrawable(statusBadgeComponent.getDrawable()); subtitleView = new SimpleTextView(context); subtitleView.setTextSize(13); subtitleView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText, resourcesProvider)); subtitleView.setEllipsizeByGradient(true); subtitleView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); subtitleView.setTranslationX(LocaleController.isRTL ? AndroidUtilities.dp(30) : 0); topMargin = style == STYLE_STORY ? 24f : 19f; addView(subtitleView, LayoutHelper.createFrameRelatively(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL_HORIZONTAL | Gravity.TOP, leftMargin, topMargin , 20, 0)); reactView = new BackupImageView(context); addView(reactView, LayoutHelper.createFrameRelatively(24, 24, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 12, 0)); storyPreviewView = new BackupImageView(context); addView(storyPreviewView, LayoutHelper.createFrameRelatively(22, 35, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 12, 0)); if (useOverlaySelector) { overlaySelectorView = new View(context); overlaySelectorView.setBackground(Theme.getSelectorDrawable(false)); addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT)); } } public void setUserReaction(TLRPC.User user, TLRPC.Chat chat, TLRPC.Reaction reaction, boolean like, long date, TL_stories.StoryItem storyItem, boolean isForward, boolean dateIsSeen, boolean animated) { TLObject u = user; if (u == null) { u = chat; } if (u == null) { return; } int colorFilter = Theme.getColor(style == STYLE_STORY ? Theme.key_windowBackgroundWhiteBlackText : Theme.key_chats_verifiedBackground, resourcesProvider); statusBadgeComponent.updateDrawable(user, chat, colorFilter, false); avatarDrawable.setInfo(currentAccount, u); if (user != null) { dialogId = user.id; titleView.setText(UserObject.getUserName(user)); } else { dialogId = -chat.id; titleView.setText(chat.title); } Drawable thumb = avatarDrawable; if (user != null) { if (user.photo != null && user.photo.strippedBitmap != null) { thumb = user.photo.strippedBitmap; } } else { if (chat.photo != null && chat.photo.strippedBitmap != null) { thumb = chat.photo.strippedBitmap; } } avatarView.setImage(ImageLocation.getForUserOrChat(u, ImageLocation.TYPE_SMALL), "50_50", thumb, u); String contentDescription; boolean hasReactImage = false; if (like) { reactView.setAnimatedEmojiDrawable(null); hasReactImage = true; Drawable likeDrawableFilled = ContextCompat.getDrawable(getContext(), R.drawable.media_like_active).mutate(); reactView.setColorFilter(new PorterDuffColorFilter(0xFFFF2E38, PorterDuff.Mode.MULTIPLY)); reactView.setImageDrawable(likeDrawableFilled); contentDescription = LocaleController.formatString("AccDescrLike", R.string.AccDescrLike); } else if (reaction != null) { ReactionsLayoutInBubble.VisibleReaction visibleReaction = ReactionsLayoutInBubble.VisibleReaction.fromTLReaction(reaction); if (visibleReaction.emojicon != null) { reactView.setAnimatedEmojiDrawable(null); TLRPC.TL_availableReaction r = MediaDataController.getInstance(currentAccount).getReactionsMap().get(visibleReaction.emojicon); if (r != null) { SvgHelper.SvgDrawable svgThumb = DocumentObject.getSvgThumb(r.static_icon.thumbs, Theme.key_windowBackgroundGray, 1.0f); reactView.setImage(ImageLocation.getForDocument(r.center_icon), "40_40_lastreactframe", "webp", svgThumb, r); hasReactImage = true; } else { reactView.setImageDrawable(null); } reactView.setColorFilter(null); } else { AnimatedEmojiDrawable drawable = new AnimatedEmojiDrawable(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, currentAccount, visibleReaction.documentId); drawable.setColorFilter(Theme.getAnimatedEmojiColorFilter(resourcesProvider)); reactView.setAnimatedEmojiDrawable(drawable); hasReactImage = true; } contentDescription = LocaleController.formatString("AccDescrReactedWith", R.string.AccDescrReactedWith, titleView.getText(), visibleReaction.emojicon != null ? visibleReaction.emojicon : reaction); } else { reactView.setAnimatedEmojiDrawable(null); reactView.setImageDrawable(null); contentDescription = LocaleController.formatString("AccDescrPersonHasSeen", R.string.AccDescrPersonHasSeen, titleView.getText()); } if (storyItem != null) { storyId = storyItem.id; if (storyItem.media != null && storyItem.media.photo != null) { final TLRPC.PhotoSize photoSize = FileLoader.getClosestPhotoSizeWithSize(storyItem.media.photo.sizes, 35, false, null, true); storyPreviewView.setImage(ImageLocation.getForPhoto(photoSize, storyItem.media.photo), "22_35", null, null, -1, storyItem); } else if (storyItem.media != null && storyItem.media.document != null) { final TLRPC.PhotoSize photoSize = FileLoader.getClosestPhotoSizeWithSize(storyItem.media.document.thumbs, 35, false, null, true); storyPreviewView.setImage(ImageLocation.getForDocument(photoSize, storyItem.media.document), "22_35", null, null, -1, storyItem); } storyPreviewView.setRoundRadius(AndroidUtilities.dp(3.33f)); if (date <= 0) { date = storyItem.date; } } else { storyId = -1; storyPreviewView.setImageDrawable(null); } if (date != 0) { contentDescription += " " + LocaleController.formatSeenDate(date); } setContentDescription(contentDescription); if (date != 0) { subtitleView.setVisibility(View.VISIBLE); MessageSeenCheckDrawable drawable; if (storyItem != null) { drawable = isForward ? forwardDrawable : repostDrawable; } else if (dateIsSeen) { drawable = seenDrawable; } else { drawable = reactDrawable; } SpannableStringBuilder ssb = new SpannableStringBuilder(); ssb.append(drawable.getSpanned(getContext(), resourcesProvider)); ssb.append(LocaleController.formatSeenDate(date)); if (!isForward && storyItem != null && !TextUtils.isEmpty(storyItem.caption)) { ssb.append(" "); ssb.append("."); DotDividerSpan dotSpan = new DotDividerSpan(); dotSpan.setSize(2.33333f); dotSpan.setTopPadding(AndroidUtilities.dp(5)); ssb.setSpan(dotSpan, ssb.length() - 1, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ssb.append(" "); int index = ssb.length(); ssb.append(LocaleController.getString(R.string.StoryRepostCommented)); ssb.setSpan(new RelativeSizeSpan(.95f), index, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } else if (!isForward && storyItem != null && storyItem.fwd_from != null && storyItem.fwd_from.modified) { ssb.append(" "); ssb.append("."); DotDividerSpan dotSpan = new DotDividerSpan(); dotSpan.setSize(2.33333f); dotSpan.setTopPadding(AndroidUtilities.dp(5)); ssb.setSpan(dotSpan, ssb.length() - 1, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ssb.append(" "); int index = ssb.length(); ssb.append("edited"); ssb.setSpan(new RelativeSizeSpan(.95f), index, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } subtitleView.setText(ssb); subtitleView.setTranslationY(!dateIsSeen ? AndroidUtilities.dp(-1) : 0); titleView.setTranslationY(0); if (animated) { titleView.setTranslationY(AndroidUtilities.dp(9)); titleView.animate().translationY(0); subtitleView.setAlpha(0); subtitleView.animate().alpha(1f); } } else { subtitleView.setVisibility(View.GONE); titleView.setTranslationY(AndroidUtilities.dp(9)); } titleView.setRightPadding(AndroidUtilities.dp(hasReactImage ? 30 : 0)); titleView.setTranslationX(hasReactImage && LocaleController.isRTL ? AndroidUtilities.dp(30) : 0); ((MarginLayoutParams) subtitleView.getLayoutParams()).rightMargin = AndroidUtilities.dp(hasReactImage && !LocaleController.isRTL ? 12 + 24 : 12); subtitleView.setTranslationX(hasReactImage && LocaleController.isRTL ? AndroidUtilities.dp(30) : 0); } public void setUserReaction(TLRPC.MessagePeerReaction reaction) { if (reaction == null) { return; } TLRPC.User user = null; TLRPC.Chat chat = null; long dialogId = MessageObject.getPeerId(reaction.peer_id); if (dialogId > 0) { user = MessagesController.getInstance(currentAccount).getUser(dialogId); } else { chat = MessagesController.getInstance(currentAccount).getChat(-dialogId); } setUserReaction(user, chat, reaction.reaction, false, reaction.date, null, false, reaction.dateIsSeen, false); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int h = style == STYLE_DEFAULT ? ITEM_HEIGHT_DP : STORY_ITEM_HEIGHT_DP; super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(h), MeasureSpec.EXACTLY)); } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.setEnabled(true); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); statusBadgeComponent.onAttachedToWindow(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); statusBadgeComponent.onDetachedFromWindow(); params.onDetachFromWindow(); } public void setObject(TLRPC.User user, long date, boolean b) { } private float alphaInternal = 1f; private ValueAnimator alphaAnimator; public void animateAlpha(float alpha, boolean animated) { if (alphaAnimator != null) { alphaAnimator.cancel(); alphaAnimator = null; } if (animated) { alphaAnimator = ValueAnimator.ofFloat(alphaInternal, alpha); alphaAnimator.addUpdateListener(anm -> { alphaInternal = (float) anm.getAnimatedValue(); invalidate(); }); alphaAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { alphaInternal = alpha; invalidate(); } }); alphaAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT); alphaAnimator.setDuration(420); alphaAnimator.start(); } else { alphaInternal = alpha; invalidate(); } } public float getAlphaInternal() { return alphaInternal; } @Override protected void dispatchDraw(Canvas canvas) { boolean restore = false; if (alphaInternal < 1) { canvas.saveLayerAlpha(0, 0, getWidth(), getHeight(), (int) (0xFF * alphaInternal), Canvas.ALL_SAVE_FLAG); restore = true; } super.dispatchDraw(canvas); if (drawDivider) { float leftMargin = AndroidUtilities.dp(style == STYLE_STORY ? 73 : 55); if (LocaleController.isRTL) { canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - leftMargin, getMeasuredHeight() - 1, Theme.getThemePaint(Theme.key_paint_divider, resourcesProvider)); } else { canvas.drawLine(leftMargin, getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, Theme.getThemePaint(Theme.key_paint_divider, resourcesProvider)); } } if (restore) { canvas.restore(); } } public Theme.ResourcesProvider getResourcesProvider() { return resourcesProvider; } }
DrKLO/Telegram
TMessagesProj/src/main/java/org/telegram/ui/Cells/ReactedUserHolderView.java
3,113
package cn.hutool.core.annotation.scanner; import cn.hutool.core.annotation.AnnotationUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ClassUtil; import cn.hutool.core.util.ObjectUtil; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; /** * 扫描注解类上存在的注解,支持处理枚举实例或枚举类型 * 需要注意,当待解析是枚举类时,有可能与{@link TypeAnnotationScanner}冲突 * * @author huangchengxing * @see TypeAnnotationScanner */ public class MetaAnnotationScanner implements AnnotationScanner { /** * 获取当前注解的元注解后,是否继续递归扫描的元注解的元注解 */ private final boolean includeSupperMetaAnnotation; /** * 构造一个元注解扫描器 * * @param includeSupperMetaAnnotation 获取当前注解的元注解后,是否继续递归扫描的元注解的元注解 */ public MetaAnnotationScanner(boolean includeSupperMetaAnnotation) { this.includeSupperMetaAnnotation = includeSupperMetaAnnotation; } /** * 构造一个元注解扫描器,默认在扫描当前注解上的元注解后,并继续递归扫描元注解 */ public MetaAnnotationScanner() { this(true); } /** * 判断是否支持扫描该注解元素,仅当注解元素是{@link Annotation}接口的子类{@link Class}时返回{@code true} * * @param annotatedEle {@link AnnotatedElement},可以是Class、Method、Field、Constructor、ReflectPermission * @return 是否支持扫描该注解元素 */ @Override public boolean support(AnnotatedElement annotatedEle) { return (annotatedEle instanceof Class && ClassUtil.isAssignable(Annotation.class, (Class<?>) annotatedEle)); } /** * 获取注解元素上的全部注解。调用该方法前,需要确保调用{@link #support(AnnotatedElement)}返回为true * * @param annotatedEle {@link AnnotatedElement},可以是Class、Method、Field、Constructor、ReflectPermission * @return 注解 */ @Override public List<Annotation> getAnnotations(AnnotatedElement annotatedEle) { final List<Annotation> annotations = new ArrayList<>(); scan( (index, annotation) -> annotations.add(annotation), annotatedEle, annotation -> ObjectUtil.notEqual(annotation, annotatedEle) ); return annotations; } /** * 按广度优先扫描指定注解上的元注解,对扫描到的注解与层级索引进行操作 * * @param consumer 当前层级索引与操作 * @param annotatedEle {@link AnnotatedElement},可以是Class、Method、Field、Constructor、ReflectPermission * @param filter 过滤器 */ @SuppressWarnings("unchecked") @Override public void scan(BiConsumer<Integer, Annotation> consumer, AnnotatedElement annotatedEle, Predicate<Annotation> filter) { filter = ObjectUtil.defaultIfNull(filter, a -> t -> true); Set<Class<? extends Annotation>> accessed = new HashSet<>(); final Deque<List<Class<? extends Annotation>>> deque = CollUtil.newLinkedList(CollUtil.newArrayList((Class<? extends Annotation>) annotatedEle)); int distance = 0; do { final List<Class<? extends Annotation>> annotationTypes = deque.removeFirst(); for (final Class<? extends Annotation> type : annotationTypes) { final List<Annotation> metaAnnotations = Stream.of(type.getAnnotations()) .filter(a -> !AnnotationUtil.isJdkMetaAnnotation(a.annotationType())) .filter(filter) .collect(Collectors.toList()); for (final Annotation metaAnnotation : metaAnnotations) { consumer.accept(distance, metaAnnotation); } accessed.add(type); List<Class<? extends Annotation>> next = metaAnnotations.stream() .map(Annotation::annotationType) .filter(t -> !accessed.contains(t)) .collect(Collectors.toList()); if (CollUtil.isNotEmpty(next)) { deque.addLast(next); } } distance++; } while (includeSupperMetaAnnotation && !deque.isEmpty()); } }
dromara/hutool
hutool-core/src/main/java/cn/hutool/core/annotation/scanner/MetaAnnotationScanner.java
3,114
package test; public class JavaClass { public void instanceMethod() {} public static void staticMethod() {} }
JetBrains/kotlin
compiler/testData/loadJava/compiledJavaAndKotlin/MixedPackage/JavaClass.java
3,115
/* * Copyright (C) 2019 The Dagger 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 dagger.hilt.processor.internal.root; import static dagger.internal.codegen.extension.DaggerStreams.toImmutableList; import static java.util.Comparator.comparing; import androidx.room.compiler.processing.XFiler.Mode; import androidx.room.compiler.processing.XProcessingEnv; import com.google.common.base.Joiner; import com.google.common.base.Utf8; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.squareup.javapoet.AnnotationSpec; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import dagger.hilt.processor.internal.ClassNames; import dagger.hilt.processor.internal.Processors; import java.io.IOException; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Optional; import java.util.Set; import javax.lang.model.element.Modifier; /** Generates a Dagger component or subcomponent interface. */ final class ComponentGenerator { private static final Joiner JOINER = Joiner.on("."); private static final Comparator<ClassName> SIMPLE_NAME_SORTER = Comparator.comparing((ClassName c) -> JOINER.join(c.simpleNames())) .thenComparing(ClassName::compareTo); private static final Comparator<TypeName> TYPE_NAME_SORTER = comparing(TypeName::toString); private final XProcessingEnv processingEnv; private final ClassName name; private final Optional<ClassName> superclass; private final ImmutableList<ClassName> modules; private final ImmutableList<TypeName> entryPoints; private final ImmutableCollection<ClassName> scopes; private final ImmutableList<AnnotationSpec> extraAnnotations; private final ClassName componentAnnotation; private final Optional<TypeSpec> componentBuilder; public ComponentGenerator( XProcessingEnv processingEnv, ClassName name, Optional<ClassName> superclass, Set<? extends ClassName> modules, Set<? extends TypeName> entryPoints, ImmutableCollection<ClassName> scopes, ImmutableList<AnnotationSpec> extraAnnotations, ClassName componentAnnotation, Optional<TypeSpec> componentBuilder) { this.processingEnv = processingEnv; this.name = name; this.superclass = superclass; this.modules = modules.stream().sorted(SIMPLE_NAME_SORTER).collect(toImmutableList()); this.entryPoints = entryPoints.stream().sorted(TYPE_NAME_SORTER).collect(toImmutableList()); this.scopes = scopes; this.extraAnnotations = extraAnnotations; this.componentAnnotation = componentAnnotation; this.componentBuilder = componentBuilder; } public TypeSpec.Builder typeSpecBuilder() throws IOException { TypeSpec.Builder builder = TypeSpec.classBuilder(name) // Public because components from a scope below must reference to create .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .addAnnotation(getComponentAnnotation()); componentBuilder.ifPresent(builder::addType); scopes.forEach(builder::addAnnotation); addEntryPoints(builder); superclass.ifPresent(builder::superclass); builder.addAnnotations(extraAnnotations); return builder; } /** Returns the component annotation with the list of modules to install for the component. */ private AnnotationSpec getComponentAnnotation() { AnnotationSpec.Builder builder = AnnotationSpec.builder(componentAnnotation); modules.forEach(module -> builder.addMember("modules", "$T.class", module)); return builder.build(); } /** * Adds entry points to the component. * * See b/140979968. If the entry points exceed 65763 bytes, we have to partition them to avoid the * limit. To be safe, we split at 60000 bytes. */ private void addEntryPoints(TypeSpec.Builder builder) throws IOException { int currBytes = 0; List<Integer> partitionIndexes = new ArrayList<>(); partitionIndexes.add(0); for (int i = 0; i < entryPoints.size(); i++) { // This over estimates the actual length because it includes the fully qualified name (FQN). // TODO(bcorso): Have a better way to estimate the upper bound. For example, most types will // not include the FQN, but we'll have to consider all of the different subtypes of TypeName, // simple name collisions, etc... int nextBytes = Utf8.encodedLength(entryPoints.get(i).toString()); // To be safe, we split at 60000 to account for the component name, spaces, commas, etc... if (currBytes + nextBytes > 60000) { partitionIndexes.add(i); currBytes = 0; } currBytes += nextBytes; } partitionIndexes.add(entryPoints.size()); if (partitionIndexes.size() <= 2) { // No extra partitions are needed, so just add all of the entrypoints as is. builder.addSuperinterfaces(entryPoints); } else { // Create interfaces for each partition. // The partitioned interfaces will be added to the component instead of the real entry points. for (int i = 1; i < partitionIndexes.size(); i++) { int startIndex = partitionIndexes.get(i - 1); int endIndex = partitionIndexes.get(i); builder.addSuperinterface( createPartitionInterface(entryPoints.subList(startIndex, endIndex), i)); } } } private ClassName createPartitionInterface(List<TypeName> partition, int partitionIndex) throws IOException { // TODO(bcorso): Nest the partion inside the HiltComponents wrapper rather than appending name ClassName partitionName = Processors.append( Processors.getEnclosedClassName(name), "_EntryPointPartition" + partitionIndex); TypeSpec.Builder builder = TypeSpec.interfaceBuilder(partitionName) .addModifiers(Modifier.ABSTRACT) .addSuperinterfaces(partition); Processors.addGeneratedAnnotation(builder, processingEnv, ClassNames.ROOT_PROCESSOR.toString()); processingEnv .getFiler() .write(JavaFile.builder(name.packageName(), builder.build()).build(), Mode.Isolating); return partitionName; } }
google/dagger
java/dagger/hilt/processor/internal/root/ComponentGenerator.java
3,116
package cn.binarywang.wx.miniapp.api; import cn.binarywang.wx.miniapp.bean.analysis.*; import me.chanjar.weixin.common.error.WxErrorException; import java.util.Date; import java.util.List; /** * 小程序数据分析相关接口 * 文档:https://mp.weixin.qq.com/debug/wxadoc/dev/api/analysis.html * * @author <a href="https://github.com/charmingoh">Charming</a> * @since 2018-04-28 */ public interface WxMaAnalysisService { /** * 查询概况趋势 * 温馨提示:小程序接口目前只能查询一天的数据,即 beginDate 和 endDate 一样 * * @param beginDate 开始日期 * @param endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return 概况趋势 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ List<WxMaSummaryTrend> getDailySummaryTrend(Date beginDate, Date endDate) throws WxErrorException; /** * 获取日访问趋势 * 温馨提示:小程序接口目前只能查询一天的数据,即 beginDate 和 endDate 一样 * * @param beginDate 开始日期 * @param endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return 日访问趋势 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ List<WxMaVisitTrend> getDailyVisitTrend(Date beginDate, Date endDate) throws WxErrorException; /** * 获取周访问趋势 * 限定查询一个自然周的数据,时间必须按照自然周的方式输入: 如:20170306(周一), 20170312(周日) * * @param beginDate 开始日期,为周一日期 * @param endDate 结束日期,为周日日期,限定查询一周数据 * @return 周访问趋势(每项数据都是一个自然周汇总) * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ List<WxMaVisitTrend> getWeeklyVisitTrend(Date beginDate, Date endDate) throws WxErrorException; /** * 获取月访问趋势 * 限定查询一个自然月的数据,时间必须按照自然月的方式输入: 如:20170201(月初), 20170228(月末) * * @param beginDate 开始日期,为自然月第一天 * @param endDate 结束日期,为自然月最后一天,限定查询一个月数据 * @return 月访问趋势(每项数据都是一个自然月汇总) * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ List<WxMaVisitTrend> getMonthlyVisitTrend(Date beginDate, Date endDate) throws WxErrorException; /** * 获取访问分布 * (此接口目前只能查询一天的数据,即 beginDate 和 endDate 一样) * * @param beginDate 开始日期,为周一日期 * @param endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return 访问分布 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ WxMaVisitDistribution getVisitDistribution(Date beginDate, Date endDate) throws WxErrorException; /** * 日留存 * (此接口目前只能查询一天的数据,即 beginDate 和 endDate 一样) * * @param beginDate 开始日期,为周一日期 * @param endDate 结束日期,限定查询 1 天数据,endDate 允许设置的最大值为昨日 * @return 日留存 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ WxMaRetainInfo getDailyRetainInfo(Date beginDate, Date endDate) throws WxErrorException; /** * 周留存 * 限定查询一个自然周的数据,时间必须按照自然周的方式输入: 如:20170306(周一), 20170312(周日) * * @param beginDate 开始日期,为周一日期 * @param endDate 结束日期,为周日日期,限定查询一周数据 * @return 周留存 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException; /** * 月留存 * 限定查询一个自然月的数据,时间必须按照自然月的方式输入: 如:20170201(月初), 20170228(月末) * * @param beginDate 开始日期,为自然月第一天 * @param endDate 结束日期,为自然月最后一天,限定查询一个月数据 * @return 月留存 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ WxMaRetainInfo getMonthlyRetainInfo(Date beginDate, Date endDate) throws WxErrorException; /** * 获取访问页面数据 * 温馨提示:此接口目前只能查询一天的数据,即 beginDate 和 endDate 一样 * * @param beginDate 开始日期 * @param endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日 * @return 访问页面数据 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ List<WxMaVisitPage> getVisitPage(Date beginDate, Date endDate) throws WxErrorException; /** * 获取小程序新增或活跃用户的画像分布数据 * 时间范围支持昨天、最近7天、最近30天。 * 其中,新增用户数为时间范围内首次访问小程序的去重用户数, * 活跃用户数为时间范围内访问过小程序的去重用户数。 * 画像属性包括用户年龄、性别、省份、城市、终端类型、机型。 * * @param beginDate 开始日期 * @param endDate 结束日期,开始日期与结束日期相差的天数限定为0/6/29,分别表示查询最近1/7/30天数据,end_date允许设置的最大值为昨日 * @return 小程序新增或活跃用户的画像分布数据 * @throws WxErrorException 获取失败时抛出,具体错误码请看文档 */ WxMaUserPortrait getUserPortrait(Date beginDate, Date endDate) throws WxErrorException; }
Wechat-Group/WxJava
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaAnalysisService.java