blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
list
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
list
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
be286ca5fa6871e3ff1ae3768fab58b245d676de
5,549,097,756,118
065c7c392aeac9fdf950f51236f808d8835213bb
/src/test/java/lapr4/green/s2/core/n1970581/autodescriptionextensions/VersionTest.java
d933bd9a3733733560cffd254a86270f5acf5073
[]
no_license
PeFerreira98/LAPR4_2017
https://github.com/PeFerreira98/LAPR4_2017
f3089de74011e08e21c617c2b678c8b89f765172
283c42dfaf808af005accf2e91f863ab83fe8f7b
refs/heads/master
2020-03-29T07:57:23.962000
2017-06-19T12:54:57
2017-06-19T12:54:57
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 lapr4.green.s2.core.n1970581.autodescriptionextensions; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Hugo */ public class VersionTest { public VersionTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of equals method, of class Version. */ @Test public void testEquals() { System.out.println("equals"); Version v1 = new Version(1); Version v11 = new Version(1); Version v2 = new Version(2); assertEquals(v1, v1); assertEquals(v1, v11); assertFalse(v1.equals(v2)); assertFalse(v1.equals(null)); assertFalse(v1.equals(new Integer(12))); } /** * Test of toString method, of class Version. */ @Test public void testToString() { System.out.println("toString"); Version v1 = new Version(1); assertEquals(v1.toString(), "1"); } }
UTF-8
Java
1,505
java
VersionTest.java
Java
[ { "context": "port static org.junit.Assert.*;\n\n/**\n *\n * @author Hugo\n */\npublic class VersionTest {\n \n public Ve", "end": 438, "score": 0.9996565580368042, "start": 434, "tag": "NAME", "value": "Hugo" } ]
null
[]
/* * 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 lapr4.green.s2.core.n1970581.autodescriptionextensions; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Hugo */ public class VersionTest { public VersionTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of equals method, of class Version. */ @Test public void testEquals() { System.out.println("equals"); Version v1 = new Version(1); Version v11 = new Version(1); Version v2 = new Version(2); assertEquals(v1, v1); assertEquals(v1, v11); assertFalse(v1.equals(v2)); assertFalse(v1.equals(null)); assertFalse(v1.equals(new Integer(12))); } /** * Test of toString method, of class Version. */ @Test public void testToString() { System.out.println("toString"); Version v1 = new Version(1); assertEquals(v1.toString(), "1"); } }
1,505
0.576744
0.556146
77
18.545454
17.508102
79
false
false
0
0
0
0
0
0
0.350649
false
false
4
eadccf43eba42961cac9e767f60303ca641d5c40
4,440,996,223,448
7514c1f32a02360f102dd20dab47a8cabf29351c
/src/main/java/com/babybloom/web/model/bo/WeixinDecryptionBo.java
c4881923ee2afd188535c1777669023449c561b6
[]
no_license
tony-piao/app-baby-bloom-service
https://github.com/tony-piao/app-baby-bloom-service
ec4ab12c0e5310d4d8165a88d61888640c748fe9
7fb7ed746916523209eaddb48e47813187429a56
refs/heads/master
2022-07-06T05:23:39.578000
2019-07-06T14:34:01
2019-07-06T14:38:01
195,549,231
1
0
null
false
2022-06-21T01:24:52
2019-07-06T14:35:49
2019-07-06T14:39:16
2022-06-21T01:24:49
95
0
0
3
Java
false
false
package com.babybloom.web.model.bo; import lombok.Data; @Data public class WeixinDecryptionBo { private String openId; private String unionId; private String nickName; private String avatarUrl; private Byte gender; // 性别 0:未知、1:男、2:女 private String province; private String city; private String country; }
UTF-8
Java
379
java
WeixinDecryptionBo.java
Java
[]
null
[]
package com.babybloom.web.model.bo; import lombok.Data; @Data public class WeixinDecryptionBo { private String openId; private String unionId; private String nickName; private String avatarUrl; private Byte gender; // 性别 0:未知、1:男、2:女 private String province; private String city; private String country; }
379
0.683473
0.67507
16
20.3125
13.846113
43
false
false
0
0
0
0
0
0
0.625
false
false
4
266c3d12fc0987f40595f80922ff2619179ca7e7
28,140,625,760,182
e8506de36be28db1158a66f0a7b743315b4ded6a
/authentication-service/src/main/java/org/ncstudy/authentication/model/PasswordResetLinks.java
854a9d919572d29ced83564825c104e937e47ce1
[]
no_license
timkagreen/transporteye
https://github.com/timkagreen/transporteye
095714d1ae3f6a1e770f3517da5cae72c3313bf5
a471c2cfb2b9fb314cfc99462c797d7515ee00dd
refs/heads/master
2020-05-24T22:01:36.219000
2019-05-13T08:32:59
2019-05-13T08:32:59
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.ncstudy.authentication.model; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.sql.Timestamp; import java.util.UUID; @Entity @Table(name = "reset_links") public class PasswordResetLinks { @Id private Long userId; private UUID uuid; private Timestamp expiration; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public UUID getUuid() { return uuid; } public void setUuid(UUID uuid) { this.uuid = uuid; } public Timestamp getExpiration() { return expiration; } public void setExpiration(Timestamp expiration) { this.expiration = expiration; } }
UTF-8
Java
787
java
PasswordResetLinks.java
Java
[]
null
[]
package org.ncstudy.authentication.model; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.sql.Timestamp; import java.util.UUID; @Entity @Table(name = "reset_links") public class PasswordResetLinks { @Id private Long userId; private UUID uuid; private Timestamp expiration; public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public UUID getUuid() { return uuid; } public void setUuid(UUID uuid) { this.uuid = uuid; } public Timestamp getExpiration() { return expiration; } public void setExpiration(Timestamp expiration) { this.expiration = expiration; } }
787
0.659466
0.659466
40
18.674999
15.037266
53
false
false
0
0
0
0
0
0
0.375
false
false
4
738a430cfba6fd34093b8971df99ad1bec267303
19,335,942,825,427
9fda2ffae67a651d41ad69c7b28ee516d8e90888
/src/com/sollace/unicopia/network/RequestSpeciesPacket.java
c4c946f5150208dfdcaca58b7f038b1dbc3eb711
[]
no_license
killjoy1221/Unicopia
https://github.com/killjoy1221/Unicopia
c72d3a9fcc895e33edc737f1cb8321f2b671a9dd
6832e896d56d2169cd5f8b6c9451007d70408e7d
refs/heads/master
2020-04-29T14:01:06.470000
2018-05-21T17:02:18
2018-05-21T17:02:18
176,183,865
0
0
null
true
2019-03-18T01:34:28
2019-03-18T01:34:28
2019-03-17T22:01:31
2019-03-17T22:01:29
10,177
0
0
0
null
false
null
package com.sollace.unicopia.network; import net.minecraft.network.NetHandlerPlayServer; import com.blazeloader.api.network.IMessage; import com.blazeloader.api.network.IMessageHandler; import io.netty.buffer.ByteBuf; public class RequestSpeciesPacket implements IMessageHandler<RequestSpeciesPacket.Message, IMessage, NetHandlerPlayServer> { public IMessage onMessage(Message message, NetHandlerPlayServer handler) { return null; } public static class Message implements IMessage { public Message() {} public void fromBytes(ByteBuf buf) {} public void toBytes(ByteBuf buf) {} } }
UTF-8
Java
599
java
RequestSpeciesPacket.java
Java
[]
null
[]
package com.sollace.unicopia.network; import net.minecraft.network.NetHandlerPlayServer; import com.blazeloader.api.network.IMessage; import com.blazeloader.api.network.IMessageHandler; import io.netty.buffer.ByteBuf; public class RequestSpeciesPacket implements IMessageHandler<RequestSpeciesPacket.Message, IMessage, NetHandlerPlayServer> { public IMessage onMessage(Message message, NetHandlerPlayServer handler) { return null; } public static class Message implements IMessage { public Message() {} public void fromBytes(ByteBuf buf) {} public void toBytes(ByteBuf buf) {} } }
599
0.804674
0.804674
20
28.950001
31.339233
124
false
false
0
0
0
0
0
0
1.1
false
false
4
38ded85ffc2679c015f1938d477c5a8a5daab13b
30,434,138,322,449
5dc5cc08a08d84e6b8c2c8719425f862af07e799
/src/main/java/pl/mrmario/tutorials/spring/owczarek/cz26/implementations/UsersRepositoryImpl.java
ee0df5dead05deba75294fc9d94b1853c1c8e5f0
[]
no_license
MariuszMajewski/tutorials-spring-owczarek-cz.26
https://github.com/MariuszMajewski/tutorials-spring-owczarek-cz.26
886e12618e079dbda8b979d592c591bbade3c394
0461eda0f4ac71b2fa89a62efa7b969d19e21696
refs/heads/master
2020-03-19T03:01:05.163000
2018-06-01T07:50:34
2018-06-01T07:50:34
135,685,739
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pl.mrmario.tutorials.spring.owczarek.cz26.implementations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pl.mrmario.tutorials.spring.owczarek.cz26.api.Logger; import pl.mrmario.tutorials.spring.owczarek.cz26.api.UsersRepository; import pl.mrmario.tutorials.spring.owczarek.cz26.domain.User; @Service("usersRepository") public class UsersRepositoryImpl implements UsersRepository { @Autowired(required= false) private Logger logger; public User createUser(String name) { if(logger!=null) { logger.log("Tworzenie użytkownika " + name); } return new User(name); } public void setLogger(Logger logger) { this.logger = logger; } }
WINDOWS-1250
Java
730
java
UsersRepositoryImpl.java
Java
[]
null
[]
package pl.mrmario.tutorials.spring.owczarek.cz26.implementations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pl.mrmario.tutorials.spring.owczarek.cz26.api.Logger; import pl.mrmario.tutorials.spring.owczarek.cz26.api.UsersRepository; import pl.mrmario.tutorials.spring.owczarek.cz26.domain.User; @Service("usersRepository") public class UsersRepositoryImpl implements UsersRepository { @Autowired(required= false) private Logger logger; public User createUser(String name) { if(logger!=null) { logger.log("Tworzenie użytkownika " + name); } return new User(name); } public void setLogger(Logger logger) { this.logger = logger; } }
730
0.78738
0.776406
24
29.375
24.287878
69
false
false
0
0
0
0
0
0
1.25
false
false
4
3e7f638289f5806d7b2a58c2ac5ad2bc74c37f37
26,886,495,301,258
5c731cd0015b0b8b1416bf1226ad83214f6a7dd9
/sources/org.multicore-association.shim.edit/src/org/multicore_association/shim/edit/service/ShimValidationInjectService.java
149a09c5bc60241f4298eb5fba533179de349531
[ "MIT" ]
permissive
openshim/shim2
https://github.com/openshim/shim2
98cc2a6a1a748315dd0087c39d1b1e484bcb3c95
096b9e29e7cdde9f73d9f29b079dc7953852f4b9
refs/heads/master
2022-03-02T13:05:56.345000
2022-02-18T10:07:06
2022-02-18T10:07:06
232,504,385
3
3
MIT
false
2021-11-01T10:52:04
2020-01-08T07:26:14
2021-08-10T06:03:15
2021-11-01T10:52:03
170,064
1
2
1
Java
false
false
/* * Copyright (c) 2020 eSOL Co.,Ltd. * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ package org.multicore_association.shim.edit.service; import java.util.Arrays; import java.util.List; import org.eclipse.emf.ecp.view.spi.context.ViewModelContext; import org.eclipse.emf.ecp.view.spi.context.ViewModelService; import org.eclipse.emf.ecp.view.spi.validation.ValidationProvider; import org.eclipse.emf.ecp.view.spi.validation.ValidationService; import org.multicore_association.shim.edit.validator.AddressRangeAttributeValidationProvider; import org.multicore_association.shim.edit.validator.AddressSpaceReferenceValidationProvider; import org.multicore_association.shim.edit.validator.MasterComponentReferenceValidationProvider; import org.multicore_association.shim.edit.validator.NameAttributeValidationProvider; public class ShimValidationInjectService implements ViewModelService { private static List<ValidationProvider> validationProviders; static { validationProviders = Arrays.asList( new AddressRangeAttributeValidationProvider(), new AddressSpaceReferenceValidationProvider(), new MasterComponentReferenceValidationProvider(), new NameAttributeValidationProvider()); } private ValidationService validationService; @Override public void instantiate(ViewModelContext context) { validationService = context.getService(ValidationService.class); if (validationService != null) { validationProviders.forEach(validationService::addValidationProvider); } } @Override public void dispose() { if (validationService != null) { validationProviders.forEach(validationService::removeValidationProvider); } } @Override public int getPriority() { return 10; } }
UTF-8
Java
1,776
java
ShimValidationInjectService.java
Java
[]
null
[]
/* * Copyright (c) 2020 eSOL Co.,Ltd. * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ package org.multicore_association.shim.edit.service; import java.util.Arrays; import java.util.List; import org.eclipse.emf.ecp.view.spi.context.ViewModelContext; import org.eclipse.emf.ecp.view.spi.context.ViewModelService; import org.eclipse.emf.ecp.view.spi.validation.ValidationProvider; import org.eclipse.emf.ecp.view.spi.validation.ValidationService; import org.multicore_association.shim.edit.validator.AddressRangeAttributeValidationProvider; import org.multicore_association.shim.edit.validator.AddressSpaceReferenceValidationProvider; import org.multicore_association.shim.edit.validator.MasterComponentReferenceValidationProvider; import org.multicore_association.shim.edit.validator.NameAttributeValidationProvider; public class ShimValidationInjectService implements ViewModelService { private static List<ValidationProvider> validationProviders; static { validationProviders = Arrays.asList( new AddressRangeAttributeValidationProvider(), new AddressSpaceReferenceValidationProvider(), new MasterComponentReferenceValidationProvider(), new NameAttributeValidationProvider()); } private ValidationService validationService; @Override public void instantiate(ViewModelContext context) { validationService = context.getService(ValidationService.class); if (validationService != null) { validationProviders.forEach(validationService::addValidationProvider); } } @Override public void dispose() { if (validationService != null) { validationProviders.forEach(validationService::removeValidationProvider); } } @Override public int getPriority() { return 10; } }
1,776
0.811374
0.807995
54
31.907408
30.109226
96
false
false
0
0
0
0
0
0
1.314815
false
false
4
62a080d31db796c190ea3812ff3f338932f24c28
1,829,656,092,531
5d10ea5f068af16e05be2a3efbe50688dbea56ba
/src/main/java/midiblocks/Subject.java
03b8fb2da770ff3936f2e93f5bcfc3a6052935ec
[]
no_license
lisa-lt/engg2800-tp1
https://github.com/lisa-lt/engg2800-tp1
1473a417f69ca04c6edc0b758cf57946e00861ea
db7a8ecad249daf3e38c961445f73c092ca54f17
refs/heads/master
2020-03-08T12:47:24.713000
2018-04-05T00:19:10
2018-04-05T00:19:10
128,137,024
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package midiblocks; import scales.Note; /** * The subject interface allows observers to observe events generated by * the subject. * @author Lisa Liu-Thorrold * */ public interface Subject { void registerObserver(Observer observer); void removeObserver(Observer observer); void notifyObservers(Note note, Boolean noteOn); void removeAllObservers(); }
UTF-8
Java
396
java
Subject.java
Java
[ { "context": "e events generated by\r\n * the subject.\r\n * @author Lisa Liu-Thorrold\r\n *\r\n */\r\npublic interface Subject {\r\n void re", "end": 168, "score": 0.9998660683631897, "start": 151, "tag": "NAME", "value": "Lisa Liu-Thorrold" } ]
null
[]
package midiblocks; import scales.Note; /** * The subject interface allows observers to observe events generated by * the subject. * @author <NAME> * */ public interface Subject { void registerObserver(Observer observer); void removeObserver(Observer observer); void notifyObservers(Note note, Boolean noteOn); void removeAllObservers(); }
385
0.70202
0.70202
18
20.111111
20.853693
72
false
false
0
0
0
0
0
0
0.388889
false
false
4
ec8d43e6299c07b88596a0d684c0cce3e31bae72
26,611,617,409,649
e2a8bbc2d6c08d461036182d15a202d020a91586
/src/main/java/com/demo/entity/RigidEntity.java
302c8a7cec064d3306b64a25f3e14864d0a370aa
[]
no_license
hryungk/SuperPusheen
https://github.com/hryungk/SuperPusheen
5c670cd4ec3ecb7fbfc1b319e4db03e7ed575c79
818db33c61bd3943e00de51f1ab4baa428377a82
refs/heads/main
2023-08-14T20:57:32.099000
2021-10-18T06:14:17
2021-10-18T06:14:17
309,836,912
0
0
null
false
2021-10-18T06:14:08
2020-11-04T00:03:31
2021-02-03T00:04:04
2021-10-18T06:07:42
1,398
0
0
1
Java
false
false
package main.java.com.demo.entity; public class RigidEntity extends Entity { public RigidEntity () { super(); } }
UTF-8
Java
139
java
RigidEntity.java
Java
[]
null
[]
package main.java.com.demo.entity; public class RigidEntity extends Entity { public RigidEntity () { super(); } }
139
0.611511
0.611511
8
16.5
16.085709
45
false
false
0
0
0
0
0
0
0.25
false
false
2
15dde242e7e86fbe83c3caa7dd09f824931c8224
20,074,677,202,941
1c9a780d37789cad6070ad137b52356dd0c378e3
/com.oneguysolutions.generality/src/com/oneguysolutions/dialogs/NewValueItem.java
92e86438dccd466a8b05f965394c33d41e021ef1
[]
no_license
neowinx/generality
https://github.com/neowinx/generality
7a3d6a18fc1ace162090b2a9808179d196237a38
9541ade1ff2d2cfb4b34a63ff52f8b60aecc9dfa
refs/heads/master
2020-04-18T01:38:52.241000
2014-03-16T19:40:47
2014-03-16T19:40:47
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.oneguysolutions.dialogs; import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.graphics.Rectangle; public class NewValueItem extends Dialog { protected Object result; protected Shell shlNewSequenceItem; private Text text; private Button btnOk; private String texto = ""; public void setTexto(String texto){ this.texto = texto; } private boolean insertDoubleQuotes = true; /** * Create the dialog. * @param parent */ public NewValueItem(Shell parent) { super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); setText("Insert Item Sequence"); } /** * Create the dialog. * @param parent * @param style */ public NewValueItem(Shell parent, int style) { super(parent, style); setText("Insert Item Sequence"); } /** * Open the dialog. * @return the result */ public Object open() { createContents(); shlNewSequenceItem.open(); shlNewSequenceItem.layout(); Display display = getParent().getDisplay(); while (!shlNewSequenceItem.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return result; } /** * Create contents of the dialog. */ private void createContents() { shlNewSequenceItem = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); shlNewSequenceItem.setSize(373, 87); shlNewSequenceItem.setText("New Value"); shlNewSequenceItem.setLayout(new GridLayout(2, false)); Rectangle bounds = getParent().getBounds(); Rectangle rect = shlNewSequenceItem.getBounds(); int x = bounds.x + (bounds.width - rect.width) / 2; int y = bounds.y + (bounds.height - rect.height) / 2; shlNewSequenceItem.setLocation (x, y); Label lblValue = new Label(shlNewSequenceItem, SWT.NONE); lblValue.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblValue.setText("value"); text = new Text(shlNewSequenceItem, SWT.BORDER); text.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.keyCode == SWT.CR) closeAndReturnValue(); else if(insertDoubleQuotes && "1234567890.".indexOf(e.character) == -1 && text.equals("")){ text.setText("\"" + text.getText() + "\""); text.setSelection(text.getText().length() - 1); insertDoubleQuotes = false; } } }); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); text.setText(texto); new Label(shlNewSequenceItem, SWT.NONE); btnOk = new Button(shlNewSequenceItem, SWT.NONE); btnOk.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.character == SWT.CR) closeAndReturnValue(); } }); btnOk.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { closeAndReturnValue(); } }); btnOk.setText("Ok"); } public Button getBtnOk() { return btnOk; } private void closeAndReturnValue(){ result = text.getText() != null? text.getText() : ""; shlNewSequenceItem.close(); } }
UTF-8
Java
3,607
java
NewValueItem.java
Java
[]
null
[]
package com.oneguysolutions.dialogs; import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.graphics.Rectangle; public class NewValueItem extends Dialog { protected Object result; protected Shell shlNewSequenceItem; private Text text; private Button btnOk; private String texto = ""; public void setTexto(String texto){ this.texto = texto; } private boolean insertDoubleQuotes = true; /** * Create the dialog. * @param parent */ public NewValueItem(Shell parent) { super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); setText("Insert Item Sequence"); } /** * Create the dialog. * @param parent * @param style */ public NewValueItem(Shell parent, int style) { super(parent, style); setText("Insert Item Sequence"); } /** * Open the dialog. * @return the result */ public Object open() { createContents(); shlNewSequenceItem.open(); shlNewSequenceItem.layout(); Display display = getParent().getDisplay(); while (!shlNewSequenceItem.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return result; } /** * Create contents of the dialog. */ private void createContents() { shlNewSequenceItem = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); shlNewSequenceItem.setSize(373, 87); shlNewSequenceItem.setText("New Value"); shlNewSequenceItem.setLayout(new GridLayout(2, false)); Rectangle bounds = getParent().getBounds(); Rectangle rect = shlNewSequenceItem.getBounds(); int x = bounds.x + (bounds.width - rect.width) / 2; int y = bounds.y + (bounds.height - rect.height) / 2; shlNewSequenceItem.setLocation (x, y); Label lblValue = new Label(shlNewSequenceItem, SWT.NONE); lblValue.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblValue.setText("value"); text = new Text(shlNewSequenceItem, SWT.BORDER); text.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.keyCode == SWT.CR) closeAndReturnValue(); else if(insertDoubleQuotes && "1234567890.".indexOf(e.character) == -1 && text.equals("")){ text.setText("\"" + text.getText() + "\""); text.setSelection(text.getText().length() - 1); insertDoubleQuotes = false; } } }); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); text.setText(texto); new Label(shlNewSequenceItem, SWT.NONE); btnOk = new Button(shlNewSequenceItem, SWT.NONE); btnOk.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.character == SWT.CR) closeAndReturnValue(); } }); btnOk.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { closeAndReturnValue(); } }); btnOk.setText("Ok"); } public Button getBtnOk() { return btnOk; } private void closeAndReturnValue(){ result = text.getText() != null? text.getText() : ""; shlNewSequenceItem.close(); } }
3,607
0.675353
0.6687
131
25.534351
20.442545
95
false
false
0
0
0
0
0
0
2.267176
false
false
2
465f0aee7e3c618c00cc365eb0880a34a796893b
17,085,379,967,760
860d5f4fedcea03538122ca78049804dcfe56c2c
/assignments/A5_10181900241_唐瑞奇/mementoPatternTest/src/mementoPatternTest/Archive.java
dda9b087965958d8fb88d0af095aa93b12af11f6
[]
no_license
AidenHe2000/weibotwo
https://github.com/AidenHe2000/weibotwo
f96f1d977143bbad904647b761a7c0720a0bea56
90b0cd654cd36c6405c76de2bdd9d2fc9e069398
refs/heads/main
2023-06-03T00:29:10.456000
2021-06-13T07:29:37
2021-06-13T07:29:37
347,067,865
4
42
null
false
2021-06-15T06:16:49
2021-03-12T13:00:54
2021-06-13T07:30:35
2021-06-15T06:16:49
58,431
2
5
1
JavaScript
false
false
package mementoPatternTest; import java.util.ArrayList; import java.util.List; public class Archive { private List<ArchiveRecord> records = new ArrayList<ArchiveRecord>(); public void add(ArchiveRecord record) { records.add(record); } public ArchiveRecord get(int index) { return records.get(index); } }
UTF-8
Java
340
java
Archive.java
Java
[]
null
[]
package mementoPatternTest; import java.util.ArrayList; import java.util.List; public class Archive { private List<ArchiveRecord> records = new ArrayList<ArchiveRecord>(); public void add(ArchiveRecord record) { records.add(record); } public ArchiveRecord get(int index) { return records.get(index); } }
340
0.702941
0.702941
17
18
15.181258
40
false
false
0
0
0
0
0
0
1.176471
false
false
2
a2a11d900af56805ee77d00be1cccb64c3c79efb
30,494,267,865,284
303fc5afce3df984edbc7e477f474fd7aee3b48e
/fuentes/ucumari-server/src/main/java/com/wildc/ucumari/party/service/impl/PersonServiceImpl.java
32335217fa976432891892aa7d8fd0a9524b671d
[]
no_license
douit/erpventas
https://github.com/douit/erpventas
3624cbd55cb68b6d91677a493d6ef1e410392127
c53dc6648bd5a2effbff15e03315bab31e6db38b
refs/heads/master
2022-03-29T22:06:06.060000
2014-04-21T12:53:13
2014-04-21T12:53:13
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package com.wildc.ucumari.party.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.wildc.ucumari.party.dao.PersonRepository; import com.wildc.ucumari.party.model.Person; import com.wildc.ucumari.party.service.PersonService; /** * @author Cristian * */ @Service("personService") public class PersonServiceImpl implements PersonService { @Autowired private PersonRepository personRepository; /** * */ public PersonServiceImpl() { // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#load(java.io.Serializable) */ @Override public Person load(String id) { // TODO Auto-generated method stub return personRepository.findOne(id); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#update(java.io.Serializable) */ @Override public void update(Person entity) { // TODO Auto-generated method stub personRepository.save(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#save(java.io.Serializable) */ @Override public void save(Person entity) { // TODO Auto-generated method stub personRepository.save(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#delete(java.io.Serializable) */ @Override public void delete(Person entity) { // TODO Auto-generated method stub personRepository.delete(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#findAll() */ @Override public List<Person> findAll() { // TODO Auto-generated method stub return null; } public List<Person> findWorkers(){ /* * select per.* from party par, person per, party_relationship pr, role_type rt where per.PARTY_ID = par.PARTY_ID and par.PARTY_ID = pr.PARTY_ID_TO and pr.ROLE_TYPE_ID_TO = rt.ROLE_TYPE_ID and rt.PARENT_TYPE_ID = 'EMPLOYEE'; * */ String hql = "select entity.partyRole.party.person from PartyRelationship entity where entity.partyRole.roleType.parentTypeId = 'EMPLOYEE'"; return personRepository.ejecutarHQL(hql, null); } }
UTF-8
Java
2,359
java
PersonServiceImpl.java
Java
[ { "context": "ri.party.service.PersonService;\r\n\r\n/**\r\n * @author Cristian\r\n *\r\n */\r\n@Service(\"personService\")\r\npublic class", "end": 385, "score": 0.9998286366462708, "start": 377, "tag": "NAME", "value": "Cristian" } ]
null
[]
/** * */ package com.wildc.ucumari.party.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.wildc.ucumari.party.dao.PersonRepository; import com.wildc.ucumari.party.model.Person; import com.wildc.ucumari.party.service.PersonService; /** * @author Cristian * */ @Service("personService") public class PersonServiceImpl implements PersonService { @Autowired private PersonRepository personRepository; /** * */ public PersonServiceImpl() { // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#load(java.io.Serializable) */ @Override public Person load(String id) { // TODO Auto-generated method stub return personRepository.findOne(id); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#update(java.io.Serializable) */ @Override public void update(Person entity) { // TODO Auto-generated method stub personRepository.save(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#save(java.io.Serializable) */ @Override public void save(Person entity) { // TODO Auto-generated method stub personRepository.save(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#delete(java.io.Serializable) */ @Override public void delete(Person entity) { // TODO Auto-generated method stub personRepository.delete(entity); } /* (non-Javadoc) * @see com.wildc.ucumari.server.framework.service.UcumariServiceBase#findAll() */ @Override public List<Person> findAll() { // TODO Auto-generated method stub return null; } public List<Person> findWorkers(){ /* * select per.* from party par, person per, party_relationship pr, role_type rt where per.PARTY_ID = par.PARTY_ID and par.PARTY_ID = pr.PARTY_ID_TO and pr.ROLE_TYPE_ID_TO = rt.ROLE_TYPE_ID and rt.PARENT_TYPE_ID = 'EMPLOYEE'; * */ String hql = "select entity.partyRole.party.person from PartyRelationship entity where entity.partyRole.roleType.parentTypeId = 'EMPLOYEE'"; return personRepository.ejecutarHQL(hql, null); } }
2,359
0.710894
0.710894
86
25.430233
31.016327
142
false
false
0
0
0
0
0
0
1.104651
false
false
2
74037392c1bdcecd4aecba3f55c4edc62063bdd1
9,758,165,735,462
49546d8dface7c6f55e2658d6c5286bbbbfb153a
/com/google/api/services/sheets/v4/model/ExtendedValue.java
71bab4dd171b3773f598ed7bd24160197f53182e
[ "MIT" ]
permissive
XeonLyfe/Backdoored-1.7-Deobf-Source-Leak
https://github.com/XeonLyfe/Backdoored-1.7-Deobf-Source-Leak
257901da437959bbdb976025e1ff1057f98c49f1
942bb61216fbb47f7909372d5c733e13d103e0ed
refs/heads/master
2022-03-18T17:09:16.301000
2019-11-18T01:42:56
2019-11-18T01:42:56
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.google.api.services.sheets.v4.model; import com.google.api.client.json.GenericJson; import com.google.api.client.util.GenericData; import com.google.api.client.util.Key; public final class ExtendedValue extends GenericJson { @Key private Boolean boolValue; @Key private ErrorValue errorValue; @Key private String formulaValue; @Key private Double numberValue; @Key private String stringValue; public Boolean getBoolValue() { return this.boolValue; } public ExtendedValue setBoolValue(Boolean var1) { this.boolValue = var1; return this; } public ErrorValue getErrorValue() { return this.errorValue; } public ExtendedValue setErrorValue(ErrorValue var1) { this.errorValue = var1; return this; } public String getFormulaValue() { return this.formulaValue; } public ExtendedValue setFormulaValue(String var1) { this.formulaValue = var1; return this; } public Double getNumberValue() { return this.numberValue; } public ExtendedValue setNumberValue(Double var1) { this.numberValue = var1; return this; } public String getStringValue() { return this.stringValue; } public ExtendedValue setStringValue(String var1) { this.stringValue = var1; return this; } public ExtendedValue set(String var1, Object var2) { return (ExtendedValue)super.set(var1, var2); } public ExtendedValue clone() { return (ExtendedValue)super.clone(); } // $FF: synthetic method // $FF: bridge method public GenericJson set(String var1, Object var2) { return this.set(var1, var2); } // $FF: synthetic method // $FF: bridge method public GenericJson clone() { return this.clone(); } // $FF: synthetic method // $FF: bridge method public GenericData clone() { return this.clone(); } // $FF: synthetic method // $FF: bridge method public GenericData set(String var1, Object var2) { return this.set(var1, var2); } // $FF: synthetic method // $FF: bridge method public Object clone() throws CloneNotSupportedException { return this.clone(); } }
UTF-8
Java
2,231
java
ExtendedValue.java
Java
[]
null
[]
package com.google.api.services.sheets.v4.model; import com.google.api.client.json.GenericJson; import com.google.api.client.util.GenericData; import com.google.api.client.util.Key; public final class ExtendedValue extends GenericJson { @Key private Boolean boolValue; @Key private ErrorValue errorValue; @Key private String formulaValue; @Key private Double numberValue; @Key private String stringValue; public Boolean getBoolValue() { return this.boolValue; } public ExtendedValue setBoolValue(Boolean var1) { this.boolValue = var1; return this; } public ErrorValue getErrorValue() { return this.errorValue; } public ExtendedValue setErrorValue(ErrorValue var1) { this.errorValue = var1; return this; } public String getFormulaValue() { return this.formulaValue; } public ExtendedValue setFormulaValue(String var1) { this.formulaValue = var1; return this; } public Double getNumberValue() { return this.numberValue; } public ExtendedValue setNumberValue(Double var1) { this.numberValue = var1; return this; } public String getStringValue() { return this.stringValue; } public ExtendedValue setStringValue(String var1) { this.stringValue = var1; return this; } public ExtendedValue set(String var1, Object var2) { return (ExtendedValue)super.set(var1, var2); } public ExtendedValue clone() { return (ExtendedValue)super.clone(); } // $FF: synthetic method // $FF: bridge method public GenericJson set(String var1, Object var2) { return this.set(var1, var2); } // $FF: synthetic method // $FF: bridge method public GenericJson clone() { return this.clone(); } // $FF: synthetic method // $FF: bridge method public GenericData clone() { return this.clone(); } // $FF: synthetic method // $FF: bridge method public GenericData set(String var1, Object var2) { return this.set(var1, var2); } // $FF: synthetic method // $FF: bridge method public Object clone() throws CloneNotSupportedException { return this.clone(); } }
2,231
0.661587
0.651277
101
21.089109
17.987949
60
false
false
0
0
0
0
0
0
0.366337
false
false
2
edae536eb84a279b3e0a9e769cc3aab20fd1c48f
9,758,165,737,732
d0a7e6b37d20ff653e6daefe4984240c18269641
/acfun5_7/src/main/java/tv/acfun/core/view/player/bean/LiveVideoInfo.java
5bdb855b3869323f22fe513e665bd5f7721a5ac2
[]
no_license
HubertYoung/AcFun
https://github.com/HubertYoung/AcFun
3fbecdec57becae32b7cd917e4c15f16aeab95e8
e83c4a821e1dbeb7843af09d59755f3cd833e83a
refs/heads/master
2018-11-18T03:53:57.159000
2018-10-29T15:01:55
2018-10-29T15:02:01
146,857,138
6
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package tv.acfun.core.view.player.bean; import java.io.Serializable; public class LiveVideoInfo implements Serializable { private int danmakuId; private String title; private String url; private int vid; public String getTitle() { return this.title; } public void setTitle(String str) { this.title = str; } public int getVid() { return this.vid; } public void setVid(int i) { this.vid = i; } public int getDanmakuId() { return this.danmakuId; } public void setDanmakuId(int i) { this.danmakuId = i; } public String getUrl() { return this.url; } public void setUrl(String str) { this.url = str; } }
UTF-8
Java
752
java
LiveVideoInfo.java
Java
[]
null
[]
package tv.acfun.core.view.player.bean; import java.io.Serializable; public class LiveVideoInfo implements Serializable { private int danmakuId; private String title; private String url; private int vid; public String getTitle() { return this.title; } public void setTitle(String str) { this.title = str; } public int getVid() { return this.vid; } public void setVid(int i) { this.vid = i; } public int getDanmakuId() { return this.danmakuId; } public void setDanmakuId(int i) { this.danmakuId = i; } public String getUrl() { return this.url; } public void setUrl(String str) { this.url = str; } }
752
0.590426
0.590426
42
16.904762
14.499277
52
false
false
0
0
0
0
0
0
0.333333
false
false
2
31f17801640e034a854cfe504cc12e6e77886d63
19,696,720,021,909
c55753884b39db83b1f0465ecf79f875c7159a8a
/src/main/java/fr/hackchtx01/authentication/resource/TokenResource.java
06b1da622849ba14e6f160f11311b38da94d1e66
[]
no_license
sizvix/hackchtx01-psdp
https://github.com/sizvix/hackchtx01-psdp
be440bf1ad3d3cd83cdd260f84810ee3bf75fbeb
9811bfa20969e7b28c4caa85326a5f87f7422d0a
refs/heads/master
2022-11-08T03:21:09.952000
2016-03-13T09:01:17
2016-03-13T09:01:17
53,728,780
2
0
null
false
2022-10-12T19:56:05
2016-03-12T11:47:17
2016-03-12T16:44:14
2022-10-12T19:56:02
152
2
0
5
Java
false
false
package fr.hackchtx01.authentication.resource; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.GRANT_TYPE_NOT_IMPLEMENTED; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.INVALID_AUTHZ_CODE; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.INVALID_CLIENT_SECRET; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.MISSING_CLIENT_SECRET; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.UNKNOWN_CLIENT; import static fr.hackchtx01.infra.rest.error.Level.INFO; import static fr.hackchtx01.infra.rest.error.Level.WARNING; import static fr.hackchtx01.infra.util.error.CommonErrorCode.API_RESPONSE; import static java.util.Objects.requireNonNull; import static javax.ws.rs.core.Response.Status.BAD_REQUEST; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import java.util.UUID; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.apache.oltu.oauth2.as.issuer.MD5Generator; import org.apache.oltu.oauth2.as.issuer.OAuthIssuer; import org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl; import org.apache.oltu.oauth2.as.request.OAuthTokenRequest; import org.apache.oltu.oauth2.as.response.OAuthASResponse; import org.apache.oltu.oauth2.common.OAuth; import org.apache.oltu.oauth2.common.error.OAuthError; import org.apache.oltu.oauth2.common.exception.OAuthProblemException; import org.apache.oltu.oauth2.common.exception.OAuthSystemException; import org.apache.oltu.oauth2.common.message.OAuthResponse; import org.apache.oltu.oauth2.common.message.types.GrantType; import fr.hackchtx01.authentication.repository.OAuth2AccessTokenRepository; import fr.hackchtx01.authentication.repository.OAuth2AuthorizationCodeRepository; import fr.hackchtx01.client.app.ClientApp; import fr.hackchtx01.client.app.repository.ClientAppRepository; import fr.hackchtx01.infra.rest.error.WebApiException; import fr.hackchtx01.infra.util.ResourceUtil; import fr.hackchtx01.user.SecuredUser; import fr.hackchtx01.user.repository.SecuredUserRepository; @Path("/auth/token") @Api(value = "token") public class TokenResource { private final OAuth2AuthorizationCodeRepository authzCodeRepository; private final OAuth2AccessTokenRepository accessTokenRepository; private final ClientAppRepository clientAppRepository; private final SecuredUserRepository userRepository; public static final String INVALID_CLIENT_DESCRIPTION = "Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)."; @Inject public TokenResource(OAuth2AuthorizationCodeRepository authzCodeRepository, OAuth2AccessTokenRepository accessTokenRepository, ClientAppRepository clientAppRepository, SecuredUserRepository userRepository) { this.authzCodeRepository = requireNonNull(authzCodeRepository); this.accessTokenRepository = requireNonNull(accessTokenRepository); this.clientAppRepository = requireNonNull(clientAppRepository); this.userRepository = requireNonNull(userRepository); } @POST @Consumes("application/x-www-form-urlencoded") @Produces("application/json") @ApiOperation(value = "Get Oauth2 access token", notes = "This will can only be done by an authenticated client") @ApiImplicitParams({ @ApiImplicitParam(name = "grant_type", value = "Grant type", required = true, dataType = "string", paramType = "form", allowableValues = "authorization_code, password, refresh_token, client_credentials"), @ApiImplicitParam(name = "redirect_uri", value = "Redirect URI", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "client_id", value = "Client Id", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "client_secret", value = "Client Secret", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "code", value = "Authorization code", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "username", value = "User email adress", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "password", value = "User password", required = false, dataType = "string", paramType = "form"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Response with access token in payload"), @ApiResponse(code = 401, message = "Not authenticated") }) public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException { try { OAuthTokenRequest oauthRequest = new OAuthTokenRequest(request); OAuthResponse response = handleTokenRequest(oauthRequest); return Response.status(response.getResponseStatus()).entity(response.getBody()).build(); } catch(OAuthProblemException problem) { return handleOAuthProblem(problem); } catch(OAuthException oae) { return handleOAuthProblemResponse(oae.getResponse()); } } protected OAuthResponse handleTokenRequest(OAuthTokenRequest oauthRequest) throws OAuthSystemException { ClientApp clientApp = ensureClientExists(oauthRequest); UUID userId; GrantType grantType = extractGrantType(oauthRequest); switch (grantType) { case AUTHORIZATION_CODE : userId = authorizeWithCode(oauthRequest, clientApp); break; case PASSWORD : userId = authorizeWithPassword(oauthRequest); break; case REFRESH_TOKEN : //TODO implement OAuth2 refresh token grant case CLIENT_CREDENTIALS : //TODO implement OAuth2 client credentials grant default: throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, GRANT_TYPE_NOT_IMPLEMENTED.getDevReadableMessage(grantType.toString())); } String accessToken = generateAccessToken(userId); OAuthResponse response = OAuthASResponse.tokenResponse(HttpServletResponse.SC_OK).setAccessToken(accessToken).setExpiresIn("3600").buildJSONMessage(); return response; } private GrantType extractGrantType(OAuthTokenRequest oauthRequest) { String grantTypeParam = oauthRequest.getGrantType(); return GrantType.valueOf(grantTypeParam.toUpperCase()); } private ClientApp ensureClientExists(OAuthTokenRequest oauthRequest) { UUID clientId = ResourceUtil.getIdfromParam(OAuth.OAUTH_CLIENT_ID, oauthRequest.getParam(OAuth.OAUTH_CLIENT_ID)); ClientApp clientApp = clientAppRepository.getById(clientId); if (clientApp == null) { throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, UNKNOWN_CLIENT.getDevReadableMessage(clientId.toString())); } return clientApp; } private boolean checkClientSecret(ClientApp clientApp, String secret) { if (StringUtils.isBlank(secret)) { throw new WebApiException(BAD_REQUEST, INFO, API_RESPONSE, MISSING_CLIENT_SECRET); } String hashedSecret = clientAppRepository.hashSecret(secret, clientApp.getSalt()); return clientApp.getSecret().equals(hashedSecret); } private UUID authorizeWithCode(OAuthTokenRequest oauthRequest, ClientApp clientApp) throws OAuthSystemException { ensureTrustedClient(oauthRequest, clientApp); String authzCode = oauthRequest.getCode(); UUID userId = findUserIdByAuthCode(authzCode); if (userId == null) { throw new OAuthException(buildBadAuthCodeResponse(authzCode)); } authzCodeRepository.deleteByCode(authzCode); return userId; } private void ensureTrustedClient(OAuthTokenRequest oauthRequest, ClientApp clientApp) throws OAuthSystemException { String clientSecret = oauthRequest.getParam(OAuth.OAUTH_CLIENT_SECRET); if (!checkClientSecret(clientApp, clientSecret)) { throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, INVALID_CLIENT_SECRET.getDevReadableMessage(clientApp.getId().toString())); } } private UUID findUserIdByAuthCode(String authCode) { return authzCodeRepository.getUserIdByAuthorizationCode(authCode); } private UUID authorizeWithPassword(OAuthTokenRequest oauthRequest) throws OAuthSystemException { String userEmail = oauthRequest.getUsername(); String password = oauthRequest.getPassword(); SecuredUser foundUser = userRepository.getByEmail(userEmail); if (!checkUserPassword(foundUser, password)) { throw new OAuthException(buildInvalidUserPassResponse()); } return foundUser.getId(); } private boolean checkUserPassword(SecuredUser foundUser, String password) { String hashedPassword = userRepository.hashPassword(password, foundUser.getSalt()); return foundUser.getPassword().equals(hashedPassword); } protected String generateAccessToken(UUID userId) throws OAuthSystemException { OAuthIssuer oauthIssuer = new OAuthIssuerImpl(new MD5Generator()); String accessToken = oauthIssuer.accessToken(); accessTokenRepository.create(accessToken, userId); return accessToken; } private Response handleOAuthProblem(OAuthProblemException problem) throws OAuthSystemException { OAuthResponse response = OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST).error(problem).buildJSONMessage(); return handleOAuthProblemResponse(response); } private Response handleOAuthProblemResponse(OAuthResponse response) throws OAuthSystemException { return Response.status(response.getResponseStatus()).entity(response.getBody()).build(); } private OAuthResponse buildBadAuthCodeResponse(String authzCode) throws OAuthSystemException { return OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) .setError(OAuthError.TokenResponse.INVALID_GRANT).setErrorDescription(INVALID_AUTHZ_CODE.getDevReadableMessage(authzCode)) .buildJSONMessage(); } private OAuthResponse buildInvalidUserPassResponse() throws OAuthSystemException { return OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) .setError(OAuthError.TokenResponse.INVALID_GRANT).setErrorDescription("invalid username or password") .buildJSONMessage(); } }
UTF-8
Java
10,359
java
TokenResource.java
Java
[ { "context": "ramType = \"form\"),\n\t @ApiImplicitParam(name = \"username\", value = \"User email adress\", required = false, ", "end": 4562, "score": 0.9929777383804321, "start": 4554, "tag": "USERNAME", "value": "username" }, { "context": " @ApiImplicitParam(name = \"username\", value = \"User email adress\", required = false, dataType = \"string\", paramTyp", "end": 4591, "score": 0.8463916778564453, "start": 4574, "tag": "NAME", "value": "User email adress" }, { "context": " @ApiImplicitParam(name = \"password\", value = \"User password\", required = false, dataType = \"string\", paramTyp", "end": 4718, "score": 0.9986602663993835, "start": 4705, "tag": "PASSWORD", "value": "User password" }, { "context": "hRequest.getUsername();\n\t\tString password = oauthRequest.getPassword();\n\t\tSecuredUser foundUser = userRepository.getBy", "end": 8526, "score": 0.9534049034118652, "start": 8507, "tag": "PASSWORD", "value": "Request.getPassword" } ]
null
[]
package fr.hackchtx01.authentication.resource; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.GRANT_TYPE_NOT_IMPLEMENTED; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.INVALID_AUTHZ_CODE; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.INVALID_CLIENT_SECRET; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.MISSING_CLIENT_SECRET; import static fr.hackchtx01.authentication.resource.OAuthResourceErrorMessage.UNKNOWN_CLIENT; import static fr.hackchtx01.infra.rest.error.Level.INFO; import static fr.hackchtx01.infra.rest.error.Level.WARNING; import static fr.hackchtx01.infra.util.error.CommonErrorCode.API_RESPONSE; import static java.util.Objects.requireNonNull; import static javax.ws.rs.core.Response.Status.BAD_REQUEST; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import java.util.UUID; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.apache.oltu.oauth2.as.issuer.MD5Generator; import org.apache.oltu.oauth2.as.issuer.OAuthIssuer; import org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl; import org.apache.oltu.oauth2.as.request.OAuthTokenRequest; import org.apache.oltu.oauth2.as.response.OAuthASResponse; import org.apache.oltu.oauth2.common.OAuth; import org.apache.oltu.oauth2.common.error.OAuthError; import org.apache.oltu.oauth2.common.exception.OAuthProblemException; import org.apache.oltu.oauth2.common.exception.OAuthSystemException; import org.apache.oltu.oauth2.common.message.OAuthResponse; import org.apache.oltu.oauth2.common.message.types.GrantType; import fr.hackchtx01.authentication.repository.OAuth2AccessTokenRepository; import fr.hackchtx01.authentication.repository.OAuth2AuthorizationCodeRepository; import fr.hackchtx01.client.app.ClientApp; import fr.hackchtx01.client.app.repository.ClientAppRepository; import fr.hackchtx01.infra.rest.error.WebApiException; import fr.hackchtx01.infra.util.ResourceUtil; import fr.hackchtx01.user.SecuredUser; import fr.hackchtx01.user.repository.SecuredUserRepository; @Path("/auth/token") @Api(value = "token") public class TokenResource { private final OAuth2AuthorizationCodeRepository authzCodeRepository; private final OAuth2AccessTokenRepository accessTokenRepository; private final ClientAppRepository clientAppRepository; private final SecuredUserRepository userRepository; public static final String INVALID_CLIENT_DESCRIPTION = "Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)."; @Inject public TokenResource(OAuth2AuthorizationCodeRepository authzCodeRepository, OAuth2AccessTokenRepository accessTokenRepository, ClientAppRepository clientAppRepository, SecuredUserRepository userRepository) { this.authzCodeRepository = requireNonNull(authzCodeRepository); this.accessTokenRepository = requireNonNull(accessTokenRepository); this.clientAppRepository = requireNonNull(clientAppRepository); this.userRepository = requireNonNull(userRepository); } @POST @Consumes("application/x-www-form-urlencoded") @Produces("application/json") @ApiOperation(value = "Get Oauth2 access token", notes = "This will can only be done by an authenticated client") @ApiImplicitParams({ @ApiImplicitParam(name = "grant_type", value = "Grant type", required = true, dataType = "string", paramType = "form", allowableValues = "authorization_code, password, refresh_token, client_credentials"), @ApiImplicitParam(name = "redirect_uri", value = "Redirect URI", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "client_id", value = "Client Id", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "client_secret", value = "Client Secret", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "code", value = "Authorization code", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "username", value = "<NAME>", required = false, dataType = "string", paramType = "form"), @ApiImplicitParam(name = "password", value = "<PASSWORD>", required = false, dataType = "string", paramType = "form"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Response with access token in payload"), @ApiResponse(code = 401, message = "Not authenticated") }) public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException { try { OAuthTokenRequest oauthRequest = new OAuthTokenRequest(request); OAuthResponse response = handleTokenRequest(oauthRequest); return Response.status(response.getResponseStatus()).entity(response.getBody()).build(); } catch(OAuthProblemException problem) { return handleOAuthProblem(problem); } catch(OAuthException oae) { return handleOAuthProblemResponse(oae.getResponse()); } } protected OAuthResponse handleTokenRequest(OAuthTokenRequest oauthRequest) throws OAuthSystemException { ClientApp clientApp = ensureClientExists(oauthRequest); UUID userId; GrantType grantType = extractGrantType(oauthRequest); switch (grantType) { case AUTHORIZATION_CODE : userId = authorizeWithCode(oauthRequest, clientApp); break; case PASSWORD : userId = authorizeWithPassword(oauthRequest); break; case REFRESH_TOKEN : //TODO implement OAuth2 refresh token grant case CLIENT_CREDENTIALS : //TODO implement OAuth2 client credentials grant default: throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, GRANT_TYPE_NOT_IMPLEMENTED.getDevReadableMessage(grantType.toString())); } String accessToken = generateAccessToken(userId); OAuthResponse response = OAuthASResponse.tokenResponse(HttpServletResponse.SC_OK).setAccessToken(accessToken).setExpiresIn("3600").buildJSONMessage(); return response; } private GrantType extractGrantType(OAuthTokenRequest oauthRequest) { String grantTypeParam = oauthRequest.getGrantType(); return GrantType.valueOf(grantTypeParam.toUpperCase()); } private ClientApp ensureClientExists(OAuthTokenRequest oauthRequest) { UUID clientId = ResourceUtil.getIdfromParam(OAuth.OAUTH_CLIENT_ID, oauthRequest.getParam(OAuth.OAUTH_CLIENT_ID)); ClientApp clientApp = clientAppRepository.getById(clientId); if (clientApp == null) { throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, UNKNOWN_CLIENT.getDevReadableMessage(clientId.toString())); } return clientApp; } private boolean checkClientSecret(ClientApp clientApp, String secret) { if (StringUtils.isBlank(secret)) { throw new WebApiException(BAD_REQUEST, INFO, API_RESPONSE, MISSING_CLIENT_SECRET); } String hashedSecret = clientAppRepository.hashSecret(secret, clientApp.getSalt()); return clientApp.getSecret().equals(hashedSecret); } private UUID authorizeWithCode(OAuthTokenRequest oauthRequest, ClientApp clientApp) throws OAuthSystemException { ensureTrustedClient(oauthRequest, clientApp); String authzCode = oauthRequest.getCode(); UUID userId = findUserIdByAuthCode(authzCode); if (userId == null) { throw new OAuthException(buildBadAuthCodeResponse(authzCode)); } authzCodeRepository.deleteByCode(authzCode); return userId; } private void ensureTrustedClient(OAuthTokenRequest oauthRequest, ClientApp clientApp) throws OAuthSystemException { String clientSecret = oauthRequest.getParam(OAuth.OAUTH_CLIENT_SECRET); if (!checkClientSecret(clientApp, clientSecret)) { throw new WebApiException(BAD_REQUEST, WARNING, API_RESPONSE, INVALID_CLIENT_SECRET.getDevReadableMessage(clientApp.getId().toString())); } } private UUID findUserIdByAuthCode(String authCode) { return authzCodeRepository.getUserIdByAuthorizationCode(authCode); } private UUID authorizeWithPassword(OAuthTokenRequest oauthRequest) throws OAuthSystemException { String userEmail = oauthRequest.getUsername(); String password = oauth<PASSWORD>(); SecuredUser foundUser = userRepository.getByEmail(userEmail); if (!checkUserPassword(foundUser, password)) { throw new OAuthException(buildInvalidUserPassResponse()); } return foundUser.getId(); } private boolean checkUserPassword(SecuredUser foundUser, String password) { String hashedPassword = userRepository.hashPassword(password, foundUser.getSalt()); return foundUser.getPassword().equals(hashedPassword); } protected String generateAccessToken(UUID userId) throws OAuthSystemException { OAuthIssuer oauthIssuer = new OAuthIssuerImpl(new MD5Generator()); String accessToken = oauthIssuer.accessToken(); accessTokenRepository.create(accessToken, userId); return accessToken; } private Response handleOAuthProblem(OAuthProblemException problem) throws OAuthSystemException { OAuthResponse response = OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST).error(problem).buildJSONMessage(); return handleOAuthProblemResponse(response); } private Response handleOAuthProblemResponse(OAuthResponse response) throws OAuthSystemException { return Response.status(response.getResponseStatus()).entity(response.getBody()).build(); } private OAuthResponse buildBadAuthCodeResponse(String authzCode) throws OAuthSystemException { return OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) .setError(OAuthError.TokenResponse.INVALID_GRANT).setErrorDescription(INVALID_AUTHZ_CODE.getDevReadableMessage(authzCode)) .buildJSONMessage(); } private OAuthResponse buildInvalidUserPassResponse() throws OAuthSystemException { return OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) .setError(OAuthError.TokenResponse.INVALID_GRANT).setErrorDescription("invalid username or password") .buildJSONMessage(); } }
10,336
0.801332
0.794864
212
47.867924
42.476868
209
false
false
0
0
0
0
0
0
2.146226
false
false
2
2bce8718c9ecdbde60597c2e12c12d2e28ccc84e
12,635,793,790,406
38430fb43e1ea55d6f68e10f6930efddcf36ada2
/srchng.java
9cdbd8a728a9b645253fa6e960b22f206d3bfb82
[]
no_license
harish6163-k/Phase1Project
https://github.com/harish6163-k/Phase1Project
a9e8f2cf50974132f79ca4dcbaeefb4fe893b9fd
43f5c6f876271d2eea8e1a49d80c1b9befccaf6d
refs/heads/master
2022-11-24T12:43:57.352000
2020-08-02T10:11:47
2020-08-02T10:11:47
284,433,880
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.finalproject; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; public class srchng { public static void main(String[] args) throws IOException { String fileName = ""; try { // System.out.print("Please Enter the path-\t"); // BufferedReader filePathReader = new BufferedReader( // new InputStreamReader(System.in)); //path = filePathReader.readLine(); System.out.print("Please Enter file Name-\t"); BufferedReader fileNameReader = new BufferedReader( new InputStreamReader(System.in)); fileName = fileNameReader.readLine(); File directory = new File("C:\\Users\\hkammari\\Downloads\\Directory"); File[] listOfFiles = directory.listFiles(); for (File file : listOfFiles) { String name = file.getName(); if (name.equals(fileName)) { System.out.println("File Found"); return; } } System.out.println(fileName + " not found in " + " directory"); } catch (IOException e) { e.printStackTrace(); } } }
UTF-8
Java
1,496
java
srchng.java
Java
[ { "context": " File directory = new File(\"C:\\\\Users\\\\hkammari\\\\Downloads\\\\Directory\");\r\n ", "end": 869, "score": 0.6826254725456238, "start": 867, "tag": "USERNAME", "value": "hk" } ]
null
[]
package com.finalproject; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; public class srchng { public static void main(String[] args) throws IOException { String fileName = ""; try { // System.out.print("Please Enter the path-\t"); // BufferedReader filePathReader = new BufferedReader( // new InputStreamReader(System.in)); //path = filePathReader.readLine(); System.out.print("Please Enter file Name-\t"); BufferedReader fileNameReader = new BufferedReader( new InputStreamReader(System.in)); fileName = fileNameReader.readLine(); File directory = new File("C:\\Users\\hkammari\\Downloads\\Directory"); File[] listOfFiles = directory.listFiles(); for (File file : listOfFiles) { String name = file.getName(); if (name.equals(fileName)) { System.out.println("File Found"); return; } } System.out.println(fileName + " not found in " + " directory"); } catch (IOException e) { e.printStackTrace(); } } }
1,496
0.481952
0.481952
43
32.837208
26.857012
88
false
false
0
0
0
0
0
0
0.627907
false
false
2
e54699463efe393d43fd362822b84e51c61a5fa8
13,726,715,487,118
ebd127b7b58282c64d5262ed4cc06c4d8cc337d0
/src/main/java/com/sidd/redis/pubsub/RedisPubSubTester.java
8e7a0ffbcdb81586f8d7b267e5b47a1cdf3ef97a
[]
no_license
spatnaik77/redis-playground
https://github.com/spatnaik77/redis-playground
2e1b0ef75f673db34a2529357d9910f5849752c4
c3a15bd68cce6c560431dff61e7061f48c316dbd
refs/heads/master
2021-04-30T11:52:55.525000
2018-02-12T15:22:58
2018-02-12T15:22:58
121,263,052
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sidd.redis.pubsub; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPubSub; import java.io.IOException; /** * Created by Siddharth on 2/12/18. */ public class RedisPubSubTester extends JedisPubSub { public static void main(String[] args) throws Exception { final String channelName = "mychannel"; //Initialize a pool of jedis instances final JedisPoolConfig poolConfig = new JedisPoolConfig(); final JedisPool jedisPool = new JedisPool(poolConfig, "127.0.0.1", 6379, 0); final Jedis subscriberJedis = jedisPool.getResource(); final Jedis publisherJedis = jedisPool.getResource(); //Subscribe to the channel Thread subscriber = new Thread(new Subscriber(subscriberJedis, channelName)); subscriber.start(); Thread.sleep(1000); for(int c = 0; c < 5; c++) { publisherJedis.publish(channelName, "Hello"+c); } } } class Subscriber extends JedisPubSub implements Runnable { Jedis jedis; String channelName; public Subscriber(Jedis jedis, String channelName) { this.jedis = jedis; this.channelName = channelName; } public void run() { jedis.subscribe(this, channelName); System.out.println("Subscription done..."); } @Override public void onMessage(String channel, String message) { super.onMessage(channel, message); System.out.println("Received: " + message); } @Override public void onSubscribe(String channel, int subscribedChannels) { super.onSubscribe(channel, subscribedChannels); System.out.println("Subscribed to channel : " + channel); } @Override public void onUnsubscribe(String channel, int subscribedChannels) { super.onUnsubscribe(channel, subscribedChannels); } }
UTF-8
Java
1,965
java
RedisPubSubTester.java
Java
[ { "context": "b;\n\nimport java.io.IOException;\n\n/**\n * Created by Siddharth on 2/12/18.\n */\npublic class RedisPubSubTester ex", "end": 245, "score": 0.944969654083252, "start": 236, "tag": "NAME", "value": "Siddharth" }, { "context": " JedisPool jedisPool = new JedisPool(poolConfig, \"127.0.0.1\", 6379, 0);\n final Jedis subscriberJedis =", "end": 615, "score": 0.9997087121009827, "start": 606, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
null
[]
package com.sidd.redis.pubsub; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPubSub; import java.io.IOException; /** * Created by Siddharth on 2/12/18. */ public class RedisPubSubTester extends JedisPubSub { public static void main(String[] args) throws Exception { final String channelName = "mychannel"; //Initialize a pool of jedis instances final JedisPoolConfig poolConfig = new JedisPoolConfig(); final JedisPool jedisPool = new JedisPool(poolConfig, "127.0.0.1", 6379, 0); final Jedis subscriberJedis = jedisPool.getResource(); final Jedis publisherJedis = jedisPool.getResource(); //Subscribe to the channel Thread subscriber = new Thread(new Subscriber(subscriberJedis, channelName)); subscriber.start(); Thread.sleep(1000); for(int c = 0; c < 5; c++) { publisherJedis.publish(channelName, "Hello"+c); } } } class Subscriber extends JedisPubSub implements Runnable { Jedis jedis; String channelName; public Subscriber(Jedis jedis, String channelName) { this.jedis = jedis; this.channelName = channelName; } public void run() { jedis.subscribe(this, channelName); System.out.println("Subscription done..."); } @Override public void onMessage(String channel, String message) { super.onMessage(channel, message); System.out.println("Received: " + message); } @Override public void onSubscribe(String channel, int subscribedChannels) { super.onSubscribe(channel, subscribedChannels); System.out.println("Subscribed to channel : " + channel); } @Override public void onUnsubscribe(String channel, int subscribedChannels) { super.onUnsubscribe(channel, subscribedChannels); } }
1,965
0.66972
0.658524
69
27.492754
25.115168
85
false
false
0
0
0
0
0
0
0.594203
false
false
2
6908b6b73ed6ee8535ce8c9ccfa8e9468c9be186
16,149,077,039,550
fb7ec28cfce6729fa20ab12da0bc102c3d13b070
/src/main/java/com/bit2017/springcontainer/TestBeanFactory.java
1435b8c6a7b2bbfbb2658d603145412a835947d7
[]
no_license
hyeyoungGo/springcontainer
https://github.com/hyeyoungGo/springcontainer
ed4b7fb03c12a4412705eafff1b95114b4285ed0
19110e8f3e55b78b64b9d7844e3dc524d0d14c6b
refs/heads/master
2021-06-11T06:59:29.086000
2017-02-28T05:03:14
2017-02-28T05:03:14
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bit2017.springcontainer; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; public class TestBeanFactory { public static void main( String[] args ){ testBeanFactory(); testBeanFactory2(); } public static void testBeanFactory() { BeanFactory bf = new XmlBeanFactory( new ClassPathResource( "config/applicationContext.xml" ) ); User user1 = (User)bf.getBean( "user1" ); User user2 = bf.getBean( User.class ); System.out.println( user1.getName() ); System.out.println( user2.getName() ); System.out.println( user1 == user2 ); // singleton 이다. } public static void testBeanFactory2() { BeanFactory bf = new XmlBeanFactory( new ClassPathResource( "config/applicationContext2.xml" ) ); User user1 = (User)bf.getBean( "user" ); // scanning 생성시 id는 클래스이름 앞에 문자를 소문자로 바꾼 이름이다. User user2 = bf.getBean( User.class ); System.out.println( user1.getName() ); System.out.println( user2.getName() ); System.out.println( user1 == user2 ); // singleton 이다. } }
UTF-8
Java
1,330
java
TestBeanFactory.java
Java
[]
null
[]
package com.bit2017.springcontainer; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; public class TestBeanFactory { public static void main( String[] args ){ testBeanFactory(); testBeanFactory2(); } public static void testBeanFactory() { BeanFactory bf = new XmlBeanFactory( new ClassPathResource( "config/applicationContext.xml" ) ); User user1 = (User)bf.getBean( "user1" ); User user2 = bf.getBean( User.class ); System.out.println( user1.getName() ); System.out.println( user2.getName() ); System.out.println( user1 == user2 ); // singleton 이다. } public static void testBeanFactory2() { BeanFactory bf = new XmlBeanFactory( new ClassPathResource( "config/applicationContext2.xml" ) ); User user1 = (User)bf.getBean( "user" ); // scanning 생성시 id는 클래스이름 앞에 문자를 소문자로 바꾼 이름이다. User user2 = bf.getBean( User.class ); System.out.println( user1.getName() ); System.out.println( user2.getName() ); System.out.println( user1 == user2 ); // singleton 이다. } }
1,330
0.636578
0.620879
38
31.526316
23.189989
92
false
false
0
0
0
0
0
0
1.157895
false
false
2
3dfc057a90aeb0657e935406bc2321347b334323
17,111,149,713,102
5263138ba666e975469520e080542aab3be7bdea
/src/Views/agence/controller/ListerAgenceFXMLController.java
85f1550aed94dede655e636b3aa7e52a247afe1a
[]
no_license
Hamrouniasma13/Russie2018
https://github.com/Hamrouniasma13/Russie2018
77ecbbca66e14a1d2b70c5a16784117392af099c
3df7b894f81a6b9773f85397b3a25dc68861678b
refs/heads/master
2020-03-09T07:57:09.035000
2018-04-09T17:33:03
2018-04-09T17:33:03
128,676,852
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 Views.agence.controller; import Services.AgenceService; import entities.Agence; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.nio.channels.FileChannel; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TableColumn; import javafx.scene.control.TableRow; import javafx.scene.control.TableView; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.control.cell.PropertyValueFactory; import javafx.stage.FileChooser; import javafx.stage.Stage; /** * FXML Controller class * * @author asus */ public class ListerAgenceFXMLController implements Initializable { @FXML private TableView<Agence> TableAgence; @FXML private TableColumn<Agence, String> nomAgence; @FXML private TableColumn<Agence, String> adresseAgence; @FXML private TableColumn<Agence, Integer> ContactAgence; @FXML private TableColumn<Agence, String> chaine; @FXML private TableColumn<Agence,String> nom_image; @FXML private TextField filterField; @FXML private TextField nomAg; @FXML private TextField AdresseAgence; @FXML private TextArea descAgence; @FXML private TextField contactAgence; @FXML private Label imgtxt; @FXML private TextField nomAg11; @FXML private TextField AdresseAgence11; @FXML private TextArea descAgence11; @FXML private TextField contactAgence11; @FXML private Label imgtxt11; @FXML private Button addbtn; @FXML private Button uploadBtn; @FXML private Button uploadBtn11; @FXML private Button deletebtn; @FXML private Button updatebtn; AgenceService AS; ObservableList AgencesObservable; Agence selectedAgence; File newImageFile; File imageFile; /** * Initializes the controller class. * @param url * @param rb */ @Override public void initialize(URL url, ResourceBundle rb) { AS= new AgenceService(); initTable(); updatebtn.setDisable(true); deletebtn.setDisable(true); filterField.textProperty().addListener((observable, oldValue, newValue) -> { initTable(); FilteredList<Agence> filteredData = new FilteredList<>(AgencesObservable, p -> true); filteredData.setPredicate(agence -> { // If filter text is empty, display all persons. if (newValue == null || newValue.isEmpty()) { return true; } // Compare first name and last name of every person with filter text. String lowerCaseFilter = newValue.toLowerCase(); if (agence.getNomAgence().toLowerCase().contains(lowerCaseFilter)) { return true; // Filter matches first name. } else if (agence.getNomAgence().toLowerCase().contains(lowerCaseFilter)) { return true; // Filter matches last name. } return false; // Does not match. }); SortedList<Agence> sortedData = new SortedList<>(filteredData); sortedData.comparatorProperty().bind(TableAgence.comparatorProperty()); TableAgence.setItems(sortedData); }); TableAgence.setRowFactory( tv -> { TableRow<Agence> row = new TableRow<>(); row.setOnMouseClicked(event -> { if (event.getClickCount() == 2 && (! row.isEmpty()) ) { selectedAgence = row.getItem(); setData(selectedAgence); updatebtn.setDisable(false); deletebtn.setDisable(false); } }); return row ; }); updatebtn.setOnMouseClicked(e->updateAgence()); deletebtn.setOnMouseClicked(e->deleteAgence()); addbtn.setOnMouseClicked(e->addAgence()); uploadBtn11.setOnMouseClicked(e->SelectImage(true)); uploadBtn.setOnMouseClicked(e->SelectImage(false)); } public void setData(Agence agence){ imageFile=null; nomAg.setText(agence.getNomAgence()); descAgence.setText(agence.getChaine()); AdresseAgence.setText(agence.getAdresseAgence()); contactAgence.setText(String.valueOf(agence.getContactAgence())); imgtxt.setText(agence.getNom_image()); } public void resetFormulaire(){ nomAg.setText(null); descAgence.setText(null); AdresseAgence.setText(null); contactAgence.setText(null); imgtxt.setText(null); nomAg11.setText(null); descAgence11.setText(null); AdresseAgence11.setText(null); contactAgence11.setText(null); imgtxt11.setText(null); selectedAgence = null; updatebtn.setDisable(true); deletebtn.setDisable(true); } private void updateAgence(){ selectedAgence.setNomAgence(nomAg.getText()); selectedAgence.setChaine(descAgence.getText()); selectedAgence.setContactAgence(Integer.parseInt(contactAgence.getText())); selectedAgence.setAdresseAgence(AdresseAgence.getText()); if(imageFile!=null){ selectedAgence.setNom_image(imageFile.getName()); } AS.update(selectedAgence); upload(false); initTable(); resetFormulaire(); } private void addAgence(){ Agence agence = new Agence(); upload(true); agence.setNomAgence(nomAg11.getText()); agence.setChaine(descAgence11.getText()); agence.setContactAgence(Integer.parseInt(contactAgence11.getText())); agence.setAdresseAgence(AdresseAgence11.getText()); if(newImageFile!=null){ agence.setNom_image(newImageFile.getName()); } AS.createAgence(agence); initTable(); resetFormulaire(); } private void deleteAgence(){ AS.delete(selectedAgence.getId()); initTable(); resetFormulaire(); } public void initTable(){ AgencesObservable = FXCollections.observableArrayList(AS.getAll("")); nomAgence.setCellValueFactory(new PropertyValueFactory<>("nomAgence")); adresseAgence.setCellValueFactory(new PropertyValueFactory<>("adresseAgence")); ContactAgence.setCellValueFactory(new PropertyValueFactory<>("ContactAgence")); chaine.setCellValueFactory(new PropertyValueFactory<>("chaine")); nom_image.setCellValueFactory(new PropertyValueFactory<>("nom_image")); TableAgence.setItems(AgencesObservable); } public void SelectImage(boolean newFile){ FileChooser fileChooser = new FileChooser(); fileChooser.getExtensionFilters().addAll( new FileChooser.ExtensionFilter("All Images", "*.*"), new FileChooser.ExtensionFilter("JPG", "*.jpg"), new FileChooser.ExtensionFilter("GIF", "*.gif"), new FileChooser.ExtensionFilter("BMP", "*.bmp"), new FileChooser.ExtensionFilter("PNG", "*.png") ); Stage stage =new Stage(); if(newFile){ newImageFile = fileChooser.showOpenDialog(stage); if(newImageFile!=null){ imgtxt11.setText(newImageFile.getName()); } }else{ imageFile = fileChooser.showOpenDialog(stage); if(imageFile!=null){ imgtxt.setText(imageFile.getName()); } } } public void upload(boolean newFile){ String AbsolutePath="C:\\Users\\Lenovo\\Documents\\NetBeansProjects\\Russie2018\\src\\Resources\\images\\agence_img\\"; try { File newfile; FileChannel src; if(newFile){ newfile = new File(AbsolutePath+newImageFile.getName()); src = new FileInputStream(newImageFile).getChannel(); }else{ newfile = new File(AbsolutePath+imageFile.getName()); src = new FileInputStream(imageFile).getChannel(); } FileChannel dest = new FileOutputStream(newfile).getChannel(); dest.transferFrom(src, 0, src.size()); dest.close(); imageFile=null; newImageFile=null; } catch (IOException e) { } } }
UTF-8
Java
9,213
java
ListerAgenceFXMLController.java
Java
[ { "context": "Stage;\n\n/**\n * FXML Controller class\n *\n * @author asus\n */\npublic class ListerAgenceFXMLController imp", "end": 1157, "score": 0.5678834915161133, "start": 1155, "tag": "NAME", "value": "as" }, { "context": "ge;\n\n/**\n * FXML Controller class\n *\n * @author asus\n */\npublic class ListerAgenceFXMLController imple", "end": 1159, "score": 0.7459204196929932, "start": 1157, "tag": "USERNAME", "value": "us" }, { "context": "ile){\n String AbsolutePath=\"C:\\\\Users\\\\Lenovo\\\\Documents\\\\NetBeansProjects\\\\Russie2018\\\\src\\\\Re", "end": 8339, "score": 0.8191847801208496, "start": 8333, "tag": "USERNAME", "value": "Lenovo" } ]
null
[]
/* * 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 Views.agence.controller; import Services.AgenceService; import entities.Agence; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.nio.channels.FileChannel; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TableColumn; import javafx.scene.control.TableRow; import javafx.scene.control.TableView; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.control.cell.PropertyValueFactory; import javafx.stage.FileChooser; import javafx.stage.Stage; /** * FXML Controller class * * @author asus */ public class ListerAgenceFXMLController implements Initializable { @FXML private TableView<Agence> TableAgence; @FXML private TableColumn<Agence, String> nomAgence; @FXML private TableColumn<Agence, String> adresseAgence; @FXML private TableColumn<Agence, Integer> ContactAgence; @FXML private TableColumn<Agence, String> chaine; @FXML private TableColumn<Agence,String> nom_image; @FXML private TextField filterField; @FXML private TextField nomAg; @FXML private TextField AdresseAgence; @FXML private TextArea descAgence; @FXML private TextField contactAgence; @FXML private Label imgtxt; @FXML private TextField nomAg11; @FXML private TextField AdresseAgence11; @FXML private TextArea descAgence11; @FXML private TextField contactAgence11; @FXML private Label imgtxt11; @FXML private Button addbtn; @FXML private Button uploadBtn; @FXML private Button uploadBtn11; @FXML private Button deletebtn; @FXML private Button updatebtn; AgenceService AS; ObservableList AgencesObservable; Agence selectedAgence; File newImageFile; File imageFile; /** * Initializes the controller class. * @param url * @param rb */ @Override public void initialize(URL url, ResourceBundle rb) { AS= new AgenceService(); initTable(); updatebtn.setDisable(true); deletebtn.setDisable(true); filterField.textProperty().addListener((observable, oldValue, newValue) -> { initTable(); FilteredList<Agence> filteredData = new FilteredList<>(AgencesObservable, p -> true); filteredData.setPredicate(agence -> { // If filter text is empty, display all persons. if (newValue == null || newValue.isEmpty()) { return true; } // Compare first name and last name of every person with filter text. String lowerCaseFilter = newValue.toLowerCase(); if (agence.getNomAgence().toLowerCase().contains(lowerCaseFilter)) { return true; // Filter matches first name. } else if (agence.getNomAgence().toLowerCase().contains(lowerCaseFilter)) { return true; // Filter matches last name. } return false; // Does not match. }); SortedList<Agence> sortedData = new SortedList<>(filteredData); sortedData.comparatorProperty().bind(TableAgence.comparatorProperty()); TableAgence.setItems(sortedData); }); TableAgence.setRowFactory( tv -> { TableRow<Agence> row = new TableRow<>(); row.setOnMouseClicked(event -> { if (event.getClickCount() == 2 && (! row.isEmpty()) ) { selectedAgence = row.getItem(); setData(selectedAgence); updatebtn.setDisable(false); deletebtn.setDisable(false); } }); return row ; }); updatebtn.setOnMouseClicked(e->updateAgence()); deletebtn.setOnMouseClicked(e->deleteAgence()); addbtn.setOnMouseClicked(e->addAgence()); uploadBtn11.setOnMouseClicked(e->SelectImage(true)); uploadBtn.setOnMouseClicked(e->SelectImage(false)); } public void setData(Agence agence){ imageFile=null; nomAg.setText(agence.getNomAgence()); descAgence.setText(agence.getChaine()); AdresseAgence.setText(agence.getAdresseAgence()); contactAgence.setText(String.valueOf(agence.getContactAgence())); imgtxt.setText(agence.getNom_image()); } public void resetFormulaire(){ nomAg.setText(null); descAgence.setText(null); AdresseAgence.setText(null); contactAgence.setText(null); imgtxt.setText(null); nomAg11.setText(null); descAgence11.setText(null); AdresseAgence11.setText(null); contactAgence11.setText(null); imgtxt11.setText(null); selectedAgence = null; updatebtn.setDisable(true); deletebtn.setDisable(true); } private void updateAgence(){ selectedAgence.setNomAgence(nomAg.getText()); selectedAgence.setChaine(descAgence.getText()); selectedAgence.setContactAgence(Integer.parseInt(contactAgence.getText())); selectedAgence.setAdresseAgence(AdresseAgence.getText()); if(imageFile!=null){ selectedAgence.setNom_image(imageFile.getName()); } AS.update(selectedAgence); upload(false); initTable(); resetFormulaire(); } private void addAgence(){ Agence agence = new Agence(); upload(true); agence.setNomAgence(nomAg11.getText()); agence.setChaine(descAgence11.getText()); agence.setContactAgence(Integer.parseInt(contactAgence11.getText())); agence.setAdresseAgence(AdresseAgence11.getText()); if(newImageFile!=null){ agence.setNom_image(newImageFile.getName()); } AS.createAgence(agence); initTable(); resetFormulaire(); } private void deleteAgence(){ AS.delete(selectedAgence.getId()); initTable(); resetFormulaire(); } public void initTable(){ AgencesObservable = FXCollections.observableArrayList(AS.getAll("")); nomAgence.setCellValueFactory(new PropertyValueFactory<>("nomAgence")); adresseAgence.setCellValueFactory(new PropertyValueFactory<>("adresseAgence")); ContactAgence.setCellValueFactory(new PropertyValueFactory<>("ContactAgence")); chaine.setCellValueFactory(new PropertyValueFactory<>("chaine")); nom_image.setCellValueFactory(new PropertyValueFactory<>("nom_image")); TableAgence.setItems(AgencesObservable); } public void SelectImage(boolean newFile){ FileChooser fileChooser = new FileChooser(); fileChooser.getExtensionFilters().addAll( new FileChooser.ExtensionFilter("All Images", "*.*"), new FileChooser.ExtensionFilter("JPG", "*.jpg"), new FileChooser.ExtensionFilter("GIF", "*.gif"), new FileChooser.ExtensionFilter("BMP", "*.bmp"), new FileChooser.ExtensionFilter("PNG", "*.png") ); Stage stage =new Stage(); if(newFile){ newImageFile = fileChooser.showOpenDialog(stage); if(newImageFile!=null){ imgtxt11.setText(newImageFile.getName()); } }else{ imageFile = fileChooser.showOpenDialog(stage); if(imageFile!=null){ imgtxt.setText(imageFile.getName()); } } } public void upload(boolean newFile){ String AbsolutePath="C:\\Users\\Lenovo\\Documents\\NetBeansProjects\\Russie2018\\src\\Resources\\images\\agence_img\\"; try { File newfile; FileChannel src; if(newFile){ newfile = new File(AbsolutePath+newImageFile.getName()); src = new FileInputStream(newImageFile).getChannel(); }else{ newfile = new File(AbsolutePath+imageFile.getName()); src = new FileInputStream(imageFile).getChannel(); } FileChannel dest = new FileOutputStream(newfile).getChannel(); dest.transferFrom(src, 0, src.size()); dest.close(); imageFile=null; newImageFile=null; } catch (IOException e) { } } }
9,213
0.618908
0.614566
288
30.989584
24.04921
131
false
false
0
0
0
0
0
0
0.607639
false
false
2
31969c0b2a742157112455e179552337c3aa4091
29,635,274,347,938
d0b800ebf3d7f8db5ecbe28fcb184d4ed69e35a0
/src/test/java/com/github/dockerjava/netty/exec/UpdateSwarmCmdExecTest.java
85e0f21a9976d5cffb3af9f44bff555f6e946434
[ "Apache-2.0" ]
permissive
gesellix/docker-java
https://github.com/gesellix/docker-java
1e3ba1f59f99014bd7a525cdc0ce749c86a3f594
62c701a50390e5b57892544700baf9a980c2957a
refs/heads/master
2020-12-28T23:15:26.652000
2017-07-21T09:49:54
2017-08-11T09:33:43
29,610,325
0
1
null
true
2015-01-21T20:25:13
2015-01-21T20:25:12
2015-01-21T20:25:12
2015-01-21T20:21:25
2,622
0
0
0
Java
null
null
package com.github.dockerjava.netty.exec; import com.github.dockerjava.api.exception.DockerException; import com.github.dockerjava.api.exception.NotAcceptableException; import com.github.dockerjava.api.model.Swarm; import com.github.dockerjava.api.model.SwarmCAConfig; import com.github.dockerjava.api.model.SwarmDispatcherConfig; import com.github.dockerjava.api.model.SwarmOrchestration; import com.github.dockerjava.api.model.SwarmRaftConfig; import com.github.dockerjava.api.model.SwarmSpec; import com.github.dockerjava.api.model.TaskDefaults; import com.github.dockerjava.netty.AbstractNettySwarmDockerClientTest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestResult; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import java.lang.reflect.Method; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; @Test(groups = "swarm-integration") public class UpdateSwarmCmdExecTest extends AbstractNettySwarmDockerClientTest { public static final Logger LOG = LoggerFactory.getLogger(UpdateSwarmCmdExecTest.class); @BeforeTest public void beforeTest() throws Exception { super.beforeTest(); } @AfterTest public void afterTest() { super.afterTest(); } @BeforeMethod public void beforeMethod(Method method) { super.beforeMethod(method); } @AfterMethod public void afterMethod(ITestResult result) { super.afterMethod(result); } public void updateSwarm() throws DockerException { SwarmSpec firstSpec = new SwarmSpec().withName("firstSpec"); SwarmSpec secondSpec = new SwarmSpec() .withName("secondSpec") .withDispatcher(new SwarmDispatcherConfig() .withHeartbeatPeriod(10000000L) ).withOrchestration(new SwarmOrchestration() .withTaskHistoryRententionLimit(100) ).withCaConfig(new SwarmCAConfig() .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) .withRaft(new SwarmRaftConfig() .withElectionTick(8) .withSnapshotInterval(20000) .withHeartbeatTick(5) .withLogEntriesForSlowFollowers(200) ).withTaskDefaults(new TaskDefaults()); dockerClient.initializeSwarmCmd(firstSpec) .withListenAddr("127.0.0.1") .withAdvertiseAddr("127.0.0.1") .exec(); LOG.info("Initialized swarm: {}", firstSpec.toString()); Swarm swarm = dockerClient.inspectSwarmCmd().exec(); LOG.info("Inspected swarm: {}", swarm.toString()); assertThat(swarm.getSpec(), is(not(equalTo(secondSpec)))); dockerClient.updateSwarmCmd(secondSpec) .withVersion(swarm.getVersion().getIndex()) .exec(); LOG.info("Updated swarm: {}", secondSpec.toString()); swarm = dockerClient.inspectSwarmCmd().exec(); LOG.info("Inspected swarm: {}", swarm.toString()); assertThat(swarm.getSpec(), is(equalTo(secondSpec))); } @Test(expectedExceptions = NotAcceptableException.class) public void updatingSwarmThrowsWhenNotInSwarm() throws DockerException { SwarmSpec swarmSpec = new SwarmSpec() .withName("swarm"); dockerClient.updateSwarmCmd(swarmSpec) .withVersion(1l) .exec(); } }
UTF-8
Java
3,759
java
UpdateSwarmCmdExecTest.java
Java
[ { "context": "rmCmd(firstSpec)\n .withListenAddr(\"127.0.0.1\")\n .withAdvertiseAddr(\"127.0.0.1\")", "end": 2715, "score": 0.9997363686561584, "start": 2706, "tag": "IP_ADDRESS", "value": "127.0.0.1" }, { "context": "(\"127.0.0.1\")\n .withAdvertiseAddr(\"127.0.0.1\")\n .exec();\n LOG.info(\"Init", "end": 2763, "score": 0.9997333884239197, "start": 2754, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
null
[]
package com.github.dockerjava.netty.exec; import com.github.dockerjava.api.exception.DockerException; import com.github.dockerjava.api.exception.NotAcceptableException; import com.github.dockerjava.api.model.Swarm; import com.github.dockerjava.api.model.SwarmCAConfig; import com.github.dockerjava.api.model.SwarmDispatcherConfig; import com.github.dockerjava.api.model.SwarmOrchestration; import com.github.dockerjava.api.model.SwarmRaftConfig; import com.github.dockerjava.api.model.SwarmSpec; import com.github.dockerjava.api.model.TaskDefaults; import com.github.dockerjava.netty.AbstractNettySwarmDockerClientTest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestResult; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import java.lang.reflect.Method; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; @Test(groups = "swarm-integration") public class UpdateSwarmCmdExecTest extends AbstractNettySwarmDockerClientTest { public static final Logger LOG = LoggerFactory.getLogger(UpdateSwarmCmdExecTest.class); @BeforeTest public void beforeTest() throws Exception { super.beforeTest(); } @AfterTest public void afterTest() { super.afterTest(); } @BeforeMethod public void beforeMethod(Method method) { super.beforeMethod(method); } @AfterMethod public void afterMethod(ITestResult result) { super.afterMethod(result); } public void updateSwarm() throws DockerException { SwarmSpec firstSpec = new SwarmSpec().withName("firstSpec"); SwarmSpec secondSpec = new SwarmSpec() .withName("secondSpec") .withDispatcher(new SwarmDispatcherConfig() .withHeartbeatPeriod(10000000L) ).withOrchestration(new SwarmOrchestration() .withTaskHistoryRententionLimit(100) ).withCaConfig(new SwarmCAConfig() .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) .withRaft(new SwarmRaftConfig() .withElectionTick(8) .withSnapshotInterval(20000) .withHeartbeatTick(5) .withLogEntriesForSlowFollowers(200) ).withTaskDefaults(new TaskDefaults()); dockerClient.initializeSwarmCmd(firstSpec) .withListenAddr("127.0.0.1") .withAdvertiseAddr("127.0.0.1") .exec(); LOG.info("Initialized swarm: {}", firstSpec.toString()); Swarm swarm = dockerClient.inspectSwarmCmd().exec(); LOG.info("Inspected swarm: {}", swarm.toString()); assertThat(swarm.getSpec(), is(not(equalTo(secondSpec)))); dockerClient.updateSwarmCmd(secondSpec) .withVersion(swarm.getVersion().getIndex()) .exec(); LOG.info("Updated swarm: {}", secondSpec.toString()); swarm = dockerClient.inspectSwarmCmd().exec(); LOG.info("Inspected swarm: {}", swarm.toString()); assertThat(swarm.getSpec(), is(equalTo(secondSpec))); } @Test(expectedExceptions = NotAcceptableException.class) public void updatingSwarmThrowsWhenNotInSwarm() throws DockerException { SwarmSpec swarmSpec = new SwarmSpec() .withName("swarm"); dockerClient.updateSwarmCmd(swarmSpec) .withVersion(1l) .exec(); } }
3,759
0.675978
0.662676
102
35.85294
23.93881
91
false
false
0
0
0
0
0
0
0.480392
false
false
2
44d5b66d562956467afb6def654540c3ff5ea322
128,849,029,669
9d1fca31518d4685c349e044d0f8b149ac901ee6
/src/designPattern/state1/SpiteVoteState.java
168a034a58c20c6ec7795b899a7805f6ad53bfe2
[ "Apache-2.0" ]
permissive
yekevin/JavaPractise
https://github.com/yekevin/JavaPractise
5bd45ca4264d93a4f36975a167e926745e7e16f8
036aeecb4f1aacffd9bec836b6cdf2aebca69234
refs/heads/master
2021-01-21T07:10:37.813000
2020-10-22T07:18:54
2020-10-22T07:18:54
82,881,428
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package designPattern.state1; /** * @author Kevin * @description * @date 2017/2/16 */ public class SpiteVoteState implements VoteState { @Override public void vote(String voteUser, String voteItem, VoteManager voteManager) { //恶意投票 //取消用户的投票资格,并取消投票记录 String s = voteManager.getMapVote().get(voteUser); if (s != null) { voteManager.getMapVote().remove(voteUser); } System.out.println("你有恶意刷票行为,取消投票资格"); } }
UTF-8
Java
557
java
SpiteVoteState.java
Java
[ { "context": "package designPattern.state1;\n\n/**\n * @author Kevin\n * @description\n * @date 2017/2/16\n */\npublic cla", "end": 51, "score": 0.9995099306106567, "start": 46, "tag": "NAME", "value": "Kevin" } ]
null
[]
package designPattern.state1; /** * @author Kevin * @description * @date 2017/2/16 */ public class SpiteVoteState implements VoteState { @Override public void vote(String voteUser, String voteItem, VoteManager voteManager) { //恶意投票 //取消用户的投票资格,并取消投票记录 String s = voteManager.getMapVote().get(voteUser); if (s != null) { voteManager.getMapVote().remove(voteUser); } System.out.println("你有恶意刷票行为,取消投票资格"); } }
557
0.630928
0.614433
19
24.526316
22.323856
81
false
false
0
0
0
0
0
0
0.315789
false
false
2
6fdd12802f278899281202d3af08bc780bee198d
128,849,030,459
7170cf1dbecad9f87b78c7ec7a22a470fe925ff7
/src/java/Methods/API/Partner/PartnerCompleteOrder.java
519a3009446089c76be82619bd7676192cfc10cd
[]
no_license
soheilrahsaz/MacaronBaWebSite
https://github.com/soheilrahsaz/MacaronBaWebSite
1e652c3171466c2e70a151a5319095be932cefc5
c47a5a7f0781d347f8f28c03cd887a8214315af3
refs/heads/master
2022-01-08T08:06:44.718000
2019-05-15T05:13:06
2019-05-15T05:13:06
186,752,486
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 Methods.API.Partner; import Objects.Partner.Partner; import Objects.Partner.PartnerPart; import Objects.Partner.PartnerReceipt; import Objects.Payment.Payment; import Objects.Ship.Ship; import SQL.Commands.OrderHistorySQLCommands; import SQL.Commands.OrderSQLCommands; import SQL.Commands.PartnerSQLCommands; import java.sql.Connection; import java.sql.SQLException; /** * * @author Moses */ public class PartnerCompleteOrder { private PartnerSQLCommands partnerSQL; private OrderHistorySQLCommands orderHisSQL; private OrderSQLCommands orderSQL; private Partner partner; public PartnerCompleteOrder(Connection connection,Partner partner) { this.partner=partner; this.partnerSQL=new PartnerSQLCommands(connection); this.orderHisSQL=new OrderHistorySQLCommands(connection); this.orderSQL=new OrderSQLCommands(connection); } public void completeOrder(PartnerReceipt receipt,Ship ship,Payment payment) throws SQLException { int price=setPrices(receipt); int shipId=orderSQL.addShip(ship.getShipType().getShipTypeId(), ship.getAddress().getAddressId()); int payStatus=0; if(payment.getPaymentType().getPaymentTypeId()==2) { payStatus=0; }else if(payment.getPaymentType().getPaymentTypeId()==3) { payStatus=1; } int paymentId=orderSQL.addPayment(price, payment.getPaymentType().getPaymentTypeId(), "", payStatus); this.partnerSQL.completeOrder(receipt.getOrderId(), shipId, paymentId); decreaseCounts(receipt); this.partnerSQL.runOut(); } private void decreaseCounts(PartnerReceipt receipt) throws SQLException { for(PartnerPart part:receipt.getParts()) { this.partnerSQL.reduceCount(part.getProduct().getProductId(), part.getCount()); } } private int setPrices(PartnerReceipt receipt) throws SQLException { int wholePrice=0; for(PartnerPart part:receipt.getParts()) { int price=part.getProduct().getPrice()*part.getCount(); price*=this.partner.getSeries().getEffect()/100; this.partnerSQL.setPartFinalPrice(part.getPartId(), price); wholePrice+=price; } return wholePrice; } }
UTF-8
Java
2,620
java
PartnerCompleteOrder.java
Java
[ { "context": "port java.sql.SQLException;\r\n\r\n/**\r\n *\r\n * @author Moses\r\n */\r\npublic class PartnerCompleteOrder {\r\n priv", "end": 605, "score": 0.8850595355033875, "start": 600, "tag": "NAME", "value": "Moses" } ]
null
[]
/* * 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 Methods.API.Partner; import Objects.Partner.Partner; import Objects.Partner.PartnerPart; import Objects.Partner.PartnerReceipt; import Objects.Payment.Payment; import Objects.Ship.Ship; import SQL.Commands.OrderHistorySQLCommands; import SQL.Commands.OrderSQLCommands; import SQL.Commands.PartnerSQLCommands; import java.sql.Connection; import java.sql.SQLException; /** * * @author Moses */ public class PartnerCompleteOrder { private PartnerSQLCommands partnerSQL; private OrderHistorySQLCommands orderHisSQL; private OrderSQLCommands orderSQL; private Partner partner; public PartnerCompleteOrder(Connection connection,Partner partner) { this.partner=partner; this.partnerSQL=new PartnerSQLCommands(connection); this.orderHisSQL=new OrderHistorySQLCommands(connection); this.orderSQL=new OrderSQLCommands(connection); } public void completeOrder(PartnerReceipt receipt,Ship ship,Payment payment) throws SQLException { int price=setPrices(receipt); int shipId=orderSQL.addShip(ship.getShipType().getShipTypeId(), ship.getAddress().getAddressId()); int payStatus=0; if(payment.getPaymentType().getPaymentTypeId()==2) { payStatus=0; }else if(payment.getPaymentType().getPaymentTypeId()==3) { payStatus=1; } int paymentId=orderSQL.addPayment(price, payment.getPaymentType().getPaymentTypeId(), "", payStatus); this.partnerSQL.completeOrder(receipt.getOrderId(), shipId, paymentId); decreaseCounts(receipt); this.partnerSQL.runOut(); } private void decreaseCounts(PartnerReceipt receipt) throws SQLException { for(PartnerPart part:receipt.getParts()) { this.partnerSQL.reduceCount(part.getProduct().getProductId(), part.getCount()); } } private int setPrices(PartnerReceipt receipt) throws SQLException { int wholePrice=0; for(PartnerPart part:receipt.getParts()) { int price=part.getProduct().getPrice()*part.getCount(); price*=this.partner.getSeries().getEffect()/100; this.partnerSQL.setPartFinalPrice(part.getPartId(), price); wholePrice+=price; } return wholePrice; } }
2,620
0.667939
0.664504
76
32.473682
27.844717
109
false
false
0
0
0
0
0
0
0.644737
false
false
2
f30c06bdf6f7524ed6448db90d2d0bb06bb6a058
18,330,920,433,224
c89333d091f152c8c36623065cf6974997530876
/modulesnov3/sa.elm.ob.utility/src/sa/elm/ob/utility/properties/Resource.java
09d5d7d5d99e9316dff65e48dae9d2eab08f6bd1
[]
no_license
Orkhan42/openbravotest
https://github.com/Orkhan42/openbravotest
24cb0f35986732c41a21963d7aa7a0910e7b4afd
82c7bfb60dda7a30be276a2b07e5ca2b4a92c585
refs/heads/master
2023-03-01T00:35:37.463000
2021-02-04T12:55:45
2021-02-04T12:55:45
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package sa.elm.ob.utility.properties; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Properties; import org.apache.log4j.Logger; import sa.elm.ob.utility.util.Utility; public class Resource { private static Resource resource = null; private static HashMap<String, Properties> hm = new HashMap<String, Properties>(); private static Properties defaultProp = null; public static final String AP_INVOICE_RULE = "EUT_101"; public static final String BUDGET_PREPARATION_RULE = "EUT_102"; public static final String BUDGET_ENTRY_RULE = "EUT_103"; public static final String BUDGET_REVISION_RULE = "EUT_104"; public static final String MANUAL_ENCUMBRANCE_RULE = "EUT_105"; public static final String GLJOURNAL_RULE = "EUT_106"; public static final String PAYMENT_OUT_RULE = "EUT_107"; public static final String PURCHASE_ORDER_RULE = "EUT_108"; public static final String AP_Prepayment_App_RULE = "EUT_109"; public static final String AP_Prepayment_Inv_RULE = "EUT_110"; public static final String PURCHASE_REQUISITION = "EUT_111"; public static final String MATERIAL_ISSUE_REQUEST = "EUT_112"; public static final String Return_Transaction = "EUT_113"; public static final String CUSTODY_TRANSFER = "EUT_114"; public static final String MATERIAL_ISSUE_REQUEST_IT = "EUT_115"; public static final String Bid_Management = "EUT_116"; public static final String PROPOSAL_MANAGEMENT = "EUT_117"; public static final String PURCHASE_REQUISITION_LIMITED = "EUT_118"; public static final String BUDGET_ADJUSTMENT_RULE = "EUT_119"; public static final String BCU_BUDGET_DISTRIBUTION = "EUT_120"; public static final String ORG_BUDGET_DISTRIBUTION = "EUT_121"; public static final String PROPOSAL_MANAGEMENT_DIRECT = "EUT_122"; public static final String TECHNICAL_EVALUATION_EVENT = "EUT_123"; public static final String RDV_Transaction = "EUT_124"; public static final String PURCHASE_AGREEMENT_RULE = "EUT_125"; public static final String RDV_BudgHoldDtl = "EUT_126"; public static final String RDV_LAST_VERSION = "EUT_127"; public static final String PROPERTY_COMPENSATION = "EUT_131"; private static Logger log4j = Logger.getLogger(Resource.class); public static String getProperty(String propKey, String lang) { return getValue(propKey, lang, false); } public static String getProperty(String propKey, String lang, boolean escape) { return getValue(propKey, lang, escape); } public static String getDynamicProperty(String propKey, String lang, String args[]) { String value = getProperty(propKey, lang); if (args != null) for (int i = 0; i < args.length; i++) { value = value.replace("${" + i + "}", args[i]); } return value; } private static String getValue(String propKey, String lang, boolean escape) { String val = null; if (resource == null) { resource = new Resource(); try { log4j.debug("inside:" + lang.toLowerCase()); defaultProp = new Properties(); InputStream input = Thread.currentThread().getContextClassLoader() .getResourceAsStream("sa/elm/ob/utility/properties/applicationresources.properties"); defaultProp.load(new InputStreamReader(input, "UTF-8")); hm.put("en_us", defaultProp); } catch (Exception e) { log4j.error("Exception in Resource", e); } } log4j.debug("language:" + lang.toLowerCase()); Properties prop = hm.get(lang.toLowerCase()); if (prop != null) { val = prop.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } else { try { Properties props = new Properties(); InputStream input = Thread.currentThread().getContextClassLoader() .getResourceAsStream("sa/elm/ob/utility/properties/applicationresources_" + lang.toLowerCase() + ".properties"); props.load(new InputStreamReader(input, "UTF-8")); log4j.debug("language else:" + lang.toLowerCase()); hm.put(lang.toLowerCase(), props); val = props.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } catch (Exception e) { log4j.error("Exception in Resource", e); val = defaultProp.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } } } }
UTF-8
Java
4,465
java
Resource.java
Java
[]
null
[]
package sa.elm.ob.utility.properties; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Properties; import org.apache.log4j.Logger; import sa.elm.ob.utility.util.Utility; public class Resource { private static Resource resource = null; private static HashMap<String, Properties> hm = new HashMap<String, Properties>(); private static Properties defaultProp = null; public static final String AP_INVOICE_RULE = "EUT_101"; public static final String BUDGET_PREPARATION_RULE = "EUT_102"; public static final String BUDGET_ENTRY_RULE = "EUT_103"; public static final String BUDGET_REVISION_RULE = "EUT_104"; public static final String MANUAL_ENCUMBRANCE_RULE = "EUT_105"; public static final String GLJOURNAL_RULE = "EUT_106"; public static final String PAYMENT_OUT_RULE = "EUT_107"; public static final String PURCHASE_ORDER_RULE = "EUT_108"; public static final String AP_Prepayment_App_RULE = "EUT_109"; public static final String AP_Prepayment_Inv_RULE = "EUT_110"; public static final String PURCHASE_REQUISITION = "EUT_111"; public static final String MATERIAL_ISSUE_REQUEST = "EUT_112"; public static final String Return_Transaction = "EUT_113"; public static final String CUSTODY_TRANSFER = "EUT_114"; public static final String MATERIAL_ISSUE_REQUEST_IT = "EUT_115"; public static final String Bid_Management = "EUT_116"; public static final String PROPOSAL_MANAGEMENT = "EUT_117"; public static final String PURCHASE_REQUISITION_LIMITED = "EUT_118"; public static final String BUDGET_ADJUSTMENT_RULE = "EUT_119"; public static final String BCU_BUDGET_DISTRIBUTION = "EUT_120"; public static final String ORG_BUDGET_DISTRIBUTION = "EUT_121"; public static final String PROPOSAL_MANAGEMENT_DIRECT = "EUT_122"; public static final String TECHNICAL_EVALUATION_EVENT = "EUT_123"; public static final String RDV_Transaction = "EUT_124"; public static final String PURCHASE_AGREEMENT_RULE = "EUT_125"; public static final String RDV_BudgHoldDtl = "EUT_126"; public static final String RDV_LAST_VERSION = "EUT_127"; public static final String PROPERTY_COMPENSATION = "EUT_131"; private static Logger log4j = Logger.getLogger(Resource.class); public static String getProperty(String propKey, String lang) { return getValue(propKey, lang, false); } public static String getProperty(String propKey, String lang, boolean escape) { return getValue(propKey, lang, escape); } public static String getDynamicProperty(String propKey, String lang, String args[]) { String value = getProperty(propKey, lang); if (args != null) for (int i = 0; i < args.length; i++) { value = value.replace("${" + i + "}", args[i]); } return value; } private static String getValue(String propKey, String lang, boolean escape) { String val = null; if (resource == null) { resource = new Resource(); try { log4j.debug("inside:" + lang.toLowerCase()); defaultProp = new Properties(); InputStream input = Thread.currentThread().getContextClassLoader() .getResourceAsStream("sa/elm/ob/utility/properties/applicationresources.properties"); defaultProp.load(new InputStreamReader(input, "UTF-8")); hm.put("en_us", defaultProp); } catch (Exception e) { log4j.error("Exception in Resource", e); } } log4j.debug("language:" + lang.toLowerCase()); Properties prop = hm.get(lang.toLowerCase()); if (prop != null) { val = prop.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } else { try { Properties props = new Properties(); InputStream input = Thread.currentThread().getContextClassLoader() .getResourceAsStream("sa/elm/ob/utility/properties/applicationresources_" + lang.toLowerCase() + ".properties"); props.load(new InputStreamReader(input, "UTF-8")); log4j.debug("language else:" + lang.toLowerCase()); hm.put(lang.toLowerCase(), props); val = props.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } catch (Exception e) { log4j.error("Exception in Resource", e); val = defaultProp.getProperty(propKey); return val == null ? "" : (escape ? Utility.escapeHTML(val) : val); } } } }
4,465
0.68869
0.667637
103
42.359222
26.020849
97
false
false
0
0
0
0
0
0
0.864078
false
false
2
6ceb2a1b9958c76a15d574b06e3db119de715c8f
14,723,147,902,206
d48f8e1c899a4b6452defc82c1b739ea64fb447c
/app/src/main/java/com/houkcorp/margatsniym/events/ExpiredOAuthEvent.java
4e98ec457a138dd9156d770cff8e139cd7a9f63a
[]
no_license
DanHouk/margatsniym
https://github.com/DanHouk/margatsniym
7de02ac22b00ebb8aca2ebfc85f93865ecf3e766
1a52dae6a2b225ed1f25ac1cb060ad61cbc4d8b7
refs/heads/master
2020-12-30T23:47:50.945000
2017-05-02T18:28:03
2017-05-02T18:28:03
80,575,427
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.houkcorp.margatsniym.events; /** * An event for notifying when OAuth fails. */ public class ExpiredOAuthEvent { private boolean expired; public ExpiredOAuthEvent(boolean expired) { this.expired = expired; } public boolean isExpired() { return expired; } }
UTF-8
Java
308
java
ExpiredOAuthEvent.java
Java
[]
null
[]
package com.houkcorp.margatsniym.events; /** * An event for notifying when OAuth fails. */ public class ExpiredOAuthEvent { private boolean expired; public ExpiredOAuthEvent(boolean expired) { this.expired = expired; } public boolean isExpired() { return expired; } }
308
0.672078
0.672078
16
18.3125
17.108912
47
false
false
0
0
0
0
0
0
0.25
false
false
2
54e374498d51bab14f246de30ee80d86f8fca4c5
10,720,238,382,015
f53419b9a0e31085fe4f73ae6530df77cf42ddbd
/src/algorithm_HashTable/LeetCode447_easy_NumOfBoomerangs.java
7ec9f749e7a497943985998eb9b215634d64b960
[]
no_license
aureole-420/coding-practice
https://github.com/aureole-420/coding-practice
ca227a42e1bc2556eafce8415b7657a53a2bad44
d571de8f196d4e8bfe24a9007a9dc3f1a9030b49
refs/heads/master
2021-06-12T23:55:58.171000
2019-09-21T18:18:29
2019-09-21T18:18:29
114,938,927
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package algorithm_HashTable; import java.util.*; // 做前:每个点搜索,把所有的等距离的点放在一起 // ? 如果多点重复应该怎么做? // 做中: 看了答案,仔细看题目,发现想多了,明白的说了pairwaise distinct public class LeetCode447_easy_NumOfBoomerangs { public int numberOfBoomerangs(int[][] points) { HashMap<Integer, Integer> map = new HashMap<>(); int result = 0; for (int i = 0; i < points.length; i++) { for (int j = 0; j < points.length; j++) { if (i == j) continue; int distance = getDistance(points[i], points[j]); map.put(distance, map.getOrDefault(distance, 0) + 1); } for (int dist : map.keySet()) { int count = map.get(dist); result += count * (count-1); } map.clear(); // map要清空!!! } return result; } private int getDistance(int[] p1, int[] p2) { int dx = p1[0] - p2[0]; int dy = p1[1] - p2[1]; return dx * dx + dy * dy; } }
UTF-8
Java
1,075
java
LeetCode447_easy_NumOfBoomerangs.java
Java
[]
null
[]
package algorithm_HashTable; import java.util.*; // 做前:每个点搜索,把所有的等距离的点放在一起 // ? 如果多点重复应该怎么做? // 做中: 看了答案,仔细看题目,发现想多了,明白的说了pairwaise distinct public class LeetCode447_easy_NumOfBoomerangs { public int numberOfBoomerangs(int[][] points) { HashMap<Integer, Integer> map = new HashMap<>(); int result = 0; for (int i = 0; i < points.length; i++) { for (int j = 0; j < points.length; j++) { if (i == j) continue; int distance = getDistance(points[i], points[j]); map.put(distance, map.getOrDefault(distance, 0) + 1); } for (int dist : map.keySet()) { int count = map.get(dist); result += count * (count-1); } map.clear(); // map要清空!!! } return result; } private int getDistance(int[] p1, int[] p2) { int dx = p1[0] - p2[0]; int dy = p1[1] - p2[1]; return dx * dx + dy * dy; } }
1,075
0.537646
0.517497
39
23.179487
18.570547
60
false
false
0
0
0
0
0
0
1.717949
false
false
2
1d5ad173da9f1e05c2b8712b0e6b003820cc9972
31,430,570,682,129
3c4738e5ea8795cf2a9fbaad90b7886033ea51bb
/E-Government/E-Government-ejb/src/main/java/edu/esprit/services/gestion/eDinarCard/GestionEDinarCardLocal.java
2f359158e065af5c89e7aa8851e2a5f99ebe281b
[]
no_license
chaimabrini/E-GovernmentWS
https://github.com/chaimabrini/E-GovernmentWS
e9a7725bb2136484e011f246d62a6233b039edd4
b3b4e85c58b11149856d156022d814e447f1faf0
refs/heads/master
2020-12-31T02:01:49.608000
2016-03-15T16:54:23
2016-03-15T16:54:23
53,509,552
0
0
null
true
2016-03-09T16:26:11
2016-03-09T15:39:14
2016-03-09T15:39:15
2016-03-09T16:26:11
38
0
0
0
Java
null
null
package edu.esprit.services.gestion.eDinarCard; import java.util.List; import javax.ejb.Local; import edu.esprit.domain.EDinarCard; @Local public interface GestionEDinarCardLocal { EDinarCard findEDinarCardByNumeroCard(String numeroCard); List<EDinarCard> findAllEDinarCard(); }
UTF-8
Java
300
java
GestionEDinarCardLocal.java
Java
[]
null
[]
package edu.esprit.services.gestion.eDinarCard; import java.util.List; import javax.ejb.Local; import edu.esprit.domain.EDinarCard; @Local public interface GestionEDinarCardLocal { EDinarCard findEDinarCardByNumeroCard(String numeroCard); List<EDinarCard> findAllEDinarCard(); }
300
0.78
0.78
14
19.428572
20.282696
58
false
false
0
0
0
0
0
0
0.571429
false
false
2
f10a8f3bc6d3d661d014d1cee3a6ef2ac88d0f49
30,485,677,880,878
67f6c4921fc911ecdbd4ad452d14eb29eb95672f
/src/main/java/mrhart1ey/gomoku/player/gui/TicTacToeComponent.java
3121f78111a1e9d46c2507d9b934fcdae868d543
[]
no_license
mrhart1ey/Gomoku
https://github.com/mrhart1ey/Gomoku
7b6d36d6dd125c9d01140a05e2acec8f8e2ba461
294180c40173ce282e36849cc0183037b69202c6
refs/heads/master
2022-12-27T09:41:32.991000
2020-08-06T23:28:39
2020-08-06T23:28:39
274,977,311
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package mrhart1ey.gomoku.player.gui; import mrhart1ey.gomoku.player.gui.drawjob.DrawJob; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Stroke; import java.util.ArrayList; import java.util.List; import javax.swing.JComponent; public class TicTacToeComponent extends JComponent { private DrawJob masterDrawer; public TicTacToeComponent() { masterDrawer = ((g) -> { }); } @Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; masterDrawer.draw(g2); } /** * Call this before paintComponent to draw the new jobs * * @param board The board to draw * @param widgets The extras to draw */ public void update(DrawJob board, List<DrawJob> widgets) { masterDrawer = new DrawingJobMaster(board, widgets); } private static class DrawingJobMaster implements DrawJob { private final List<DrawJob> drawingJobs; public DrawingJobMaster(DrawJob board, List<DrawJob> widgets) { drawingJobs = new ArrayList<>(); drawingJobs.add(board); drawingJobs.addAll(widgets); } @Override public void draw(Graphics2D g2) { for (DrawJob drawingJob : drawingJobs) { Font oldFont = g2.getFont(); Color oldColor = g2.getColor(); Stroke oldStroke = g2.getStroke(); RenderingHints rh = new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.setRenderingHints(rh); drawingJob.draw(g2); g2.setFont(oldFont); g2.setColor(oldColor); g2.setStroke(oldStroke); } } } }
UTF-8
Java
1,931
java
TicTacToeComponent.java
Java
[ { "context": "package mrhart1ey.gomoku.player.gui;\n\nimport mrhart1ey.gomoku.playe", "end": 17, "score": 0.7428737282752991, "start": 10, "tag": "USERNAME", "value": "hart1ey" }, { "context": "package mrhart1ey.gomoku.player.gui;\n\nimport mrhart1ey.gomoku.player.gui.drawjob.DrawJob;\nimport java.aw", "end": 54, "score": 0.9926882982254028, "start": 45, "tag": "USERNAME", "value": "mrhart1ey" } ]
null
[]
package mrhart1ey.gomoku.player.gui; import mrhart1ey.gomoku.player.gui.drawjob.DrawJob; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Stroke; import java.util.ArrayList; import java.util.List; import javax.swing.JComponent; public class TicTacToeComponent extends JComponent { private DrawJob masterDrawer; public TicTacToeComponent() { masterDrawer = ((g) -> { }); } @Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; masterDrawer.draw(g2); } /** * Call this before paintComponent to draw the new jobs * * @param board The board to draw * @param widgets The extras to draw */ public void update(DrawJob board, List<DrawJob> widgets) { masterDrawer = new DrawingJobMaster(board, widgets); } private static class DrawingJobMaster implements DrawJob { private final List<DrawJob> drawingJobs; public DrawingJobMaster(DrawJob board, List<DrawJob> widgets) { drawingJobs = new ArrayList<>(); drawingJobs.add(board); drawingJobs.addAll(widgets); } @Override public void draw(Graphics2D g2) { for (DrawJob drawingJob : drawingJobs) { Font oldFont = g2.getFont(); Color oldColor = g2.getColor(); Stroke oldStroke = g2.getStroke(); RenderingHints rh = new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.setRenderingHints(rh); drawingJob.draw(g2); g2.setFont(oldFont); g2.setColor(oldColor); g2.setStroke(oldStroke); } } } }
1,931
0.605904
0.5971
72
25.819445
21.164255
71
false
false
0
0
0
0
0
0
0.458333
false
false
2
ead872d279efbe4d6dcf7539c9c14aa1a9fa84db
18,528,488,933,480
714a1d9531d330fc4be1854a6fe94d80364c9c55
/PackageJars/src/com/zhou/plugin/packagejars/message/Messages.java
e7ef4c4e10c358cb58da1cd8d0b2f3c9af83563b
[]
no_license
zhouziyang931224/IdeaPlugin
https://github.com/zhouziyang931224/IdeaPlugin
c254da87797c66cd253ca0c665fd6a0e7934767a
59f3ba838afce21297cb36f7c20536b56ef825bb
refs/heads/master
2021-01-19T03:43:50.321000
2016-07-24T16:37:33
2016-07-24T16:37:33
62,869,150
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zhou.plugin.packagejars.message; import com.intellij.compiler.impl.ProblemsViewPanel; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.ui.content.Content; import com.intellij.ui.content.MessageView; /** * Created by Administrator on 2016/7/8. */ public class Messages { private static final String ID = "packing"; public Messages() { } private static ProblemsViewPanel getInstance(Project project) { MessageView messageView = MessageView.SERVICE.getInstance(project); ProblemsViewPanel packMessages = null; Content[] content = messageView.getContentManager().getContents(); int len$ = content.length; for (int i$ = 0; i$ < len$; ++i$) { Content content1 = content[i$]; if ("packing".equals(content1.getTabName())) { packMessages = (ProblemsViewPanel) content1.getComponent(); break; } } if (packMessages != null) { return packMessages; } else { packMessages = new ProblemsViewPanel(project); Content var7 = com.intellij.ui.content.ContentFactory.SERVICE.getInstance().createContent(packMessages, "packing", true); messageView.getContentManager().addContent(var7); messageView.getContentManager().setSelectedContent(var7); return packMessages; } } public static void clear(Project project) { MessageView messageView = MessageView.SERVICE.getInstance(project); Content[] arr$ = messageView.getContentManager().getContents(); int len$ = arr$.length; for (int i$ = 0; i$ < len$; ++i$) { Content content = arr$[i$]; if ("packing".equals(content.getTabName())) { ProblemsViewPanel viewPanel = (ProblemsViewPanel) content.getComponent(); viewPanel.close(); break; } } } public static void info(Project project, String string) { ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW); if (toolWindow != null) { toolWindow.activate((Runnable) null, false); } getInstance(project).addMessage(3, new String[]{string}, (VirtualFile) null, -1, -1, (Object) null); } }
UTF-8
Java
2,548
java
Messages.java
Java
[ { "context": "ntellij.ui.content.MessageView;\n\n/**\n * Created by Administrator on 2016/7/8.\n */\n\npublic class Messages {\n pri", "end": 443, "score": 0.7801542282104492, "start": 430, "tag": "USERNAME", "value": "Administrator" } ]
null
[]
package com.zhou.plugin.packagejars.message; import com.intellij.compiler.impl.ProblemsViewPanel; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.ui.content.Content; import com.intellij.ui.content.MessageView; /** * Created by Administrator on 2016/7/8. */ public class Messages { private static final String ID = "packing"; public Messages() { } private static ProblemsViewPanel getInstance(Project project) { MessageView messageView = MessageView.SERVICE.getInstance(project); ProblemsViewPanel packMessages = null; Content[] content = messageView.getContentManager().getContents(); int len$ = content.length; for (int i$ = 0; i$ < len$; ++i$) { Content content1 = content[i$]; if ("packing".equals(content1.getTabName())) { packMessages = (ProblemsViewPanel) content1.getComponent(); break; } } if (packMessages != null) { return packMessages; } else { packMessages = new ProblemsViewPanel(project); Content var7 = com.intellij.ui.content.ContentFactory.SERVICE.getInstance().createContent(packMessages, "packing", true); messageView.getContentManager().addContent(var7); messageView.getContentManager().setSelectedContent(var7); return packMessages; } } public static void clear(Project project) { MessageView messageView = MessageView.SERVICE.getInstance(project); Content[] arr$ = messageView.getContentManager().getContents(); int len$ = arr$.length; for (int i$ = 0; i$ < len$; ++i$) { Content content = arr$[i$]; if ("packing".equals(content.getTabName())) { ProblemsViewPanel viewPanel = (ProblemsViewPanel) content.getComponent(); viewPanel.close(); break; } } } public static void info(Project project, String string) { ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW); if (toolWindow != null) { toolWindow.activate((Runnable) null, false); } getInstance(project).addMessage(3, new String[]{string}, (VirtualFile) null, -1, -1, (Object) null); } }
2,548
0.64168
0.635008
71
34.887325
30.295052
133
false
false
0
0
0
0
0
0
0.647887
false
false
2
c4637fe3449419faa35cb765cf953bfb8a5896bb
27,195,732,964,792
5f69591cb15cd83a43ebe9e9a0f9abdb981a14e8
/src/main/java/br/com/code/sinqia/dto/ClienteDTO.java
6b57eed03f9170ad79e8e7fede29e96787e7e013
[]
no_license
EdwardHill/sinqia-api
https://github.com/EdwardHill/sinqia-api
0f7f830591941189dd5ab46a15092a0b5a06aab2
1b414a2104fdd7c27fe2e1df3c0bf56a36ca63ac
refs/heads/main
2023-03-06T09:50:09.585000
2021-02-24T18:07:19
2021-02-24T18:07:19
333,189,702
0
0
null
false
2021-02-24T17:15:46
2021-01-26T19:13:05
2021-02-03T18:15:30
2021-02-24T17:15:45
15,061
0
0
0
JavaScript
false
false
package br.com.code.sinqia.dto; import java.io.Serializable; import java.util.Date; import br.com.code.sinqia.domain.Cliente; import br.com.code.sinqia.domain.Endereco; import br.com.code.sinqia.domain.Telefone; public class ClienteDTO implements Serializable { private static final long serialVersionUID = 1L; private Integer id; private String nome; private String cpf; private String email; private Date nascimento; private Telefone telefone; private Endereco endereco; private String profile; public ClienteDTO() { } public ClienteDTO(Cliente obj) { super(); id = obj.getId(); nome = obj.getNome(); cpf = obj.getCpf(); email = obj.getEmail(); nascimento = obj.getNascimento(); telefone = obj.getTelefone(); endereco = obj.getEndereco(); profile = obj.getProfile(); } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getCpf() { return cpf; } public void setCpf(String cpf) { this.cpf = cpf; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Date getNascimento() { return nascimento; } public void setNascimento(Date nascimento) { this.nascimento = nascimento; } public Telefone getTelefone() { return telefone; } public void setTelefone(Telefone telefone) { this.telefone = telefone; } public String getProfile() { return profile; } public void setProfile(String profile) { this.profile = profile; } public Endereco getEndereco() { return endereco; } public void setEndereco(Endereco endereco) { this.endereco = endereco; } }
UTF-8
Java
1,761
java
ClienteDTO.java
Java
[]
null
[]
package br.com.code.sinqia.dto; import java.io.Serializable; import java.util.Date; import br.com.code.sinqia.domain.Cliente; import br.com.code.sinqia.domain.Endereco; import br.com.code.sinqia.domain.Telefone; public class ClienteDTO implements Serializable { private static final long serialVersionUID = 1L; private Integer id; private String nome; private String cpf; private String email; private Date nascimento; private Telefone telefone; private Endereco endereco; private String profile; public ClienteDTO() { } public ClienteDTO(Cliente obj) { super(); id = obj.getId(); nome = obj.getNome(); cpf = obj.getCpf(); email = obj.getEmail(); nascimento = obj.getNascimento(); telefone = obj.getTelefone(); endereco = obj.getEndereco(); profile = obj.getProfile(); } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getCpf() { return cpf; } public void setCpf(String cpf) { this.cpf = cpf; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Date getNascimento() { return nascimento; } public void setNascimento(Date nascimento) { this.nascimento = nascimento; } public Telefone getTelefone() { return telefone; } public void setTelefone(Telefone telefone) { this.telefone = telefone; } public String getProfile() { return profile; } public void setProfile(String profile) { this.profile = profile; } public Endereco getEndereco() { return endereco; } public void setEndereco(Endereco endereco) { this.endereco = endereco; } }
1,761
0.702442
0.701874
101
16.435644
14.900605
49
false
false
0
0
0
0
0
0
1.386139
false
false
2
c057332f98f42b5e3618bc646209b03f1585fab0
3,874,060,509,385
fc65213ab98b34f71b5e9894cdb6333323109ce9
/src/br/ucb/saam/beans/MensagemBean.java
2af44768ba6270e51c79b8e2d666daaf2612a636
[]
no_license
nelsongustavo/SAAM
https://github.com/nelsongustavo/SAAM
67ed2dbb39cffaa1047ff75b19fe39dc48d50240
baa7d9e01ce5240e6cf5007918882c5955049b1f
refs/heads/master
2020-12-25T04:53:18.005000
2013-06-18T19:40:29
2013-06-18T19:40:29
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.ucb.saam.beans; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** Classe para objetos do tipo Mensagem, onde ser�o contidos, valores e m�todos para o mesmo. * Representa as mensagens enviadas por usu�rios. * * @author William Barreto * @version 1.0 * @since 2013 * */ @Entity @Table(name="mensagens") public class MensagemBean implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue @Column(name="COD_MENSAGEM") private int id; @Column(name="DATA") private Date data; @Column(name="TEXTO") private String texto; @ManyToOne() @JoinColumn(name="COD_USUARIO") private UsuarioBean usuario; //Constructor public MensagemBean(){ this.usuario = new UsuarioBean(); } //Methods //Getters and Setters public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getData() { return data; } public void setData(Date data) { this.data = data; } public String getTexto() { return texto; } public void setTexto(String texto) { this.texto = texto; } public UsuarioBean getUsuario() { return usuario; } public void setUsuario(UsuarioBean usuario) { this.usuario = usuario; } }
UTF-8
Java
1,482
java
MensagemBean.java
Java
[ { "context": "s mensagens enviadas por usu�rios.\n * \n * @author William Barreto\n * @version 1.0\n * @since 2013\n *\n */\n\n@Entity\n@T", "end": 500, "score": 0.9998968243598938, "start": 485, "tag": "NAME", "value": "William Barreto" } ]
null
[]
package br.ucb.saam.beans; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** Classe para objetos do tipo Mensagem, onde ser�o contidos, valores e m�todos para o mesmo. * Representa as mensagens enviadas por usu�rios. * * @author <NAME> * @version 1.0 * @since 2013 * */ @Entity @Table(name="mensagens") public class MensagemBean implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue @Column(name="COD_MENSAGEM") private int id; @Column(name="DATA") private Date data; @Column(name="TEXTO") private String texto; @ManyToOne() @JoinColumn(name="COD_USUARIO") private UsuarioBean usuario; //Constructor public MensagemBean(){ this.usuario = new UsuarioBean(); } //Methods //Getters and Setters public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getData() { return data; } public void setData(Date data) { this.data = data; } public String getTexto() { return texto; } public void setTexto(String texto) { this.texto = texto; } public UsuarioBean getUsuario() { return usuario; } public void setUsuario(UsuarioBean usuario) { this.usuario = usuario; } }
1,473
0.716125
0.711382
82
17
16.65284
94
false
false
0
0
0
0
0
0
1.073171
false
false
2
c4a66432f535fe66297af2d26ba793b585c43b8b
2,087,354,120,842
b0546b01ebe1d6527d8d58ffac5bfd27f1919603
/plugins/SpriteEditor/src/com/soyostar/pluginimpl/sprite/widge/TileSetViewPane.java
b9c70b9c56bf92a6d8fc4ac783f46fd6bcb61ef4
[]
no_license
heroyuy/systar
https://github.com/heroyuy/systar
b71da2e44a7a3733c53a45bd5d9dd84e4a13f039
ebce6ef8b95ee969244dcce76ebd79d7f0353aca
refs/heads/master
2021-01-10T10:42:59.250000
2012-10-15T14:46:36
2012-10-15T14:46:36
47,677,163
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.soyostar.pluginimpl.sprite.widge; import com.soyostar.pluginimpl.sprite.model.Animation; import com.soyostar.pluginimpl.sprite.model.TileSet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.util.ArrayList; import javax.swing.JPanel; /** * * @author Administrator */ public class TileSetViewPane extends JPanel { private int selectedIndex = -1; private Dimension viewSize = new Dimension(128, 128); private int titleSize = 16; public TileSetViewPane() { } /** * * @return */ public int getSelectedIndex() { return this.selectedIndex; } /** * * @param index */ public void setSelectedIndex(int index) { this.selectedIndex = index; this.updateUI(); } public TileSet getSelectedTileSet() { return this.selectedIndex < 0 ? null : Animation.getInstance().getTileSet(this.selectedIndex); } /** * * @param x * @param y */ public void setSelectedTileSet(int x, int y) { int len = Animation.getInstance().getTileSetsCount(); if (y > 0 && y <= this.viewSize.height + this.titleSize) { if (x > 0 && x <= len * this.viewSize.width) { this.setSelectedIndex(x / this.viewSize.width); return; } } this.setSelectedIndex(-1); } @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); int len = Animation.getInstance().getTileSetsCount(); return new Dimension(Math.max(size.width, len * (this.viewSize.width + 1)), Math.max(size.height, this.viewSize.height + this.titleSize)); } @Override public void paintComponent(Graphics g) { g.clearRect(0, 0, this.getWidth(), this.getHeight()); int cc = 150 / this.titleSize; for (int i = 0; i < Animation.getInstance().getTileSetsCount(); i++) { g.setColor(Color.WHITE); g.fillRect(i * viewSize.width, titleSize, viewSize.width - 1, viewSize.height - 1); g.setColor(Color.LIGHT_GRAY); for (int y = titleSize / 8; y < (titleSize + viewSize.height) / 8; y++) { for (int x = i * viewSize.width / 8; x < (i + 1) * viewSize.width / 8; x++) { if ((y + x) % 2 == 1) { g.fillRect(x * 8, y * 8, 8, 8); } } } Animation.getInstance().getTileSet(i).paintPreview(g, i * this.viewSize.width + 2, this.titleSize + 2, this.viewSize.width - 4); Color labelColor = Color.BLACK; if (this.selectedIndex == i) { labelColor = Color.BLUE; } for (int j = 0; j < this.titleSize; j++) { g.setColor(new Color(labelColor.getRed(), labelColor.getGreen(), labelColor.getBlue(), 105 + j * cc)); g.drawLine(i * this.viewSize.width, j + 1, i * this.viewSize.width + this.viewSize.width - this.titleSize + j, j + 1); } if (this.selectedIndex == i) { g.setColor(Color.BLUE); } else { g.setColor(Color.BLACK); } g.draw3DRect(i * (this.viewSize.width), this.titleSize, this.viewSize.width - 1, this.viewSize.height - 1, true); g.setColor(Color.WHITE); g.drawString(Animation.getInstance().getTileSet(i).getName(), i * (this.viewSize.width) + 2, this.titleSize - 2); } } }
UTF-8
Java
3,652
java
TileSetViewPane.java
Java
[ { "context": "ist;\nimport javax.swing.JPanel;\n\n/**\n *\n * @author Administrator\n */\npublic class TileSetViewPane extends JPanel {", "end": 418, "score": 0.4980611503124237, "start": 405, "tag": "NAME", "value": "Administrator" } ]
null
[]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.soyostar.pluginimpl.sprite.widge; import com.soyostar.pluginimpl.sprite.model.Animation; import com.soyostar.pluginimpl.sprite.model.TileSet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.util.ArrayList; import javax.swing.JPanel; /** * * @author Administrator */ public class TileSetViewPane extends JPanel { private int selectedIndex = -1; private Dimension viewSize = new Dimension(128, 128); private int titleSize = 16; public TileSetViewPane() { } /** * * @return */ public int getSelectedIndex() { return this.selectedIndex; } /** * * @param index */ public void setSelectedIndex(int index) { this.selectedIndex = index; this.updateUI(); } public TileSet getSelectedTileSet() { return this.selectedIndex < 0 ? null : Animation.getInstance().getTileSet(this.selectedIndex); } /** * * @param x * @param y */ public void setSelectedTileSet(int x, int y) { int len = Animation.getInstance().getTileSetsCount(); if (y > 0 && y <= this.viewSize.height + this.titleSize) { if (x > 0 && x <= len * this.viewSize.width) { this.setSelectedIndex(x / this.viewSize.width); return; } } this.setSelectedIndex(-1); } @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); int len = Animation.getInstance().getTileSetsCount(); return new Dimension(Math.max(size.width, len * (this.viewSize.width + 1)), Math.max(size.height, this.viewSize.height + this.titleSize)); } @Override public void paintComponent(Graphics g) { g.clearRect(0, 0, this.getWidth(), this.getHeight()); int cc = 150 / this.titleSize; for (int i = 0; i < Animation.getInstance().getTileSetsCount(); i++) { g.setColor(Color.WHITE); g.fillRect(i * viewSize.width, titleSize, viewSize.width - 1, viewSize.height - 1); g.setColor(Color.LIGHT_GRAY); for (int y = titleSize / 8; y < (titleSize + viewSize.height) / 8; y++) { for (int x = i * viewSize.width / 8; x < (i + 1) * viewSize.width / 8; x++) { if ((y + x) % 2 == 1) { g.fillRect(x * 8, y * 8, 8, 8); } } } Animation.getInstance().getTileSet(i).paintPreview(g, i * this.viewSize.width + 2, this.titleSize + 2, this.viewSize.width - 4); Color labelColor = Color.BLACK; if (this.selectedIndex == i) { labelColor = Color.BLUE; } for (int j = 0; j < this.titleSize; j++) { g.setColor(new Color(labelColor.getRed(), labelColor.getGreen(), labelColor.getBlue(), 105 + j * cc)); g.drawLine(i * this.viewSize.width, j + 1, i * this.viewSize.width + this.viewSize.width - this.titleSize + j, j + 1); } if (this.selectedIndex == i) { g.setColor(Color.BLUE); } else { g.setColor(Color.BLACK); } g.draw3DRect(i * (this.viewSize.width), this.titleSize, this.viewSize.width - 1, this.viewSize.height - 1, true); g.setColor(Color.WHITE); g.drawString(Animation.getInstance().getTileSet(i).getName(), i * (this.viewSize.width) + 2, this.titleSize - 2); } } }
3,652
0.568729
0.55586
107
33.13084
33.589352
146
false
false
0
0
0
0
0
0
0.719626
false
false
2
3732cc9679e4ce09ab6708f86dff9ea91162d8e1
12,773,232,790,424
41b8bcf79c99e7484d928c80976262d2ffd8e3ae
/src/main/java/listasEncadeadas/ListaEncadeada.java
3de2a2b84e3b52710788bcc6cffc60b09f674c23
[]
no_license
ynsprojetos/Treinamento-Estrutura-Dados
https://github.com/ynsprojetos/Treinamento-Estrutura-Dados
9417516caf814d05f8883b588abf2575e8f99a3b
6ad6799f2ce485d1627dfd0b297094d7d8485f21
refs/heads/master
2023-08-24T16:31:15.831000
2021-10-18T20:55:04
2021-10-18T20:55:04
408,989,937
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package listasEncadeadas; public class ListaEncadeada<T> { No<T> referenciaEntrada; public ListaEncadeada(){ this.referenciaEntrada = null; } public void add(T conteudo){ No<T> novoNo = new No<>(conteudo); if(this.isEmpty()){ referenciaEntrada = novoNo; return; } No<T> noAuxiliar = referenciaEntrada; for (int i = 0; i < this.size()-1; i++){ noAuxiliar = noAuxiliar.getProximoNo(); } noAuxiliar.setProximoNo(novoNo); } private No<T> getNo(int index){ validaIndice(index); No<T> noAuxiliar = referenciaEntrada; No<T> noRetorno = null; for (int i = 0; i< this.size()-1; i++){ noAuxiliar = noAuxiliar.getProximoNo(); } return noRetorno; } public int size(){ int tamanhoLista = 0; No<T> referenciaAux = referenciaEntrada; while(true){ if (referenciaAux != null){ tamanhoLista++; if (referenciaAux.getProximoNo() != null){ referenciaAux = referenciaAux.getProximoNo(); }else{ break; } }else{ break; } } return tamanhoLista; } public boolean isEmpty(){ return referenciaEntrada == null ? true : false; } public void validaIndice(int index){ if (index >= size()){ throw new IndexOutOfBoundsException("não existe conteudo no indice nformado."); } } }
UTF-8
Java
1,678
java
ListaEncadeada.java
Java
[]
null
[]
package listasEncadeadas; public class ListaEncadeada<T> { No<T> referenciaEntrada; public ListaEncadeada(){ this.referenciaEntrada = null; } public void add(T conteudo){ No<T> novoNo = new No<>(conteudo); if(this.isEmpty()){ referenciaEntrada = novoNo; return; } No<T> noAuxiliar = referenciaEntrada; for (int i = 0; i < this.size()-1; i++){ noAuxiliar = noAuxiliar.getProximoNo(); } noAuxiliar.setProximoNo(novoNo); } private No<T> getNo(int index){ validaIndice(index); No<T> noAuxiliar = referenciaEntrada; No<T> noRetorno = null; for (int i = 0; i< this.size()-1; i++){ noAuxiliar = noAuxiliar.getProximoNo(); } return noRetorno; } public int size(){ int tamanhoLista = 0; No<T> referenciaAux = referenciaEntrada; while(true){ if (referenciaAux != null){ tamanhoLista++; if (referenciaAux.getProximoNo() != null){ referenciaAux = referenciaAux.getProximoNo(); }else{ break; } }else{ break; } } return tamanhoLista; } public boolean isEmpty(){ return referenciaEntrada == null ? true : false; } public void validaIndice(int index){ if (index >= size()){ throw new IndexOutOfBoundsException("não existe conteudo no indice nformado."); } } }
1,678
0.495528
0.492546
70
22.957144
20.653908
91
false
false
0
0
0
0
0
0
0.385714
false
false
2
980aef35a7910daddb174bb23fd74cabd26aab13
18,322,330,522,134
d92d68b20dfa0295293969b767211afd04f1c4c7
/app/src/main/java/me/chenjr/uiinteraction/LinerLayout_activity.java
9cf90c2f0682b1bc8a778b5601ab492d12e18e8f
[]
no_license
android-course-code/UI_Interaction
https://github.com/android-course-code/UI_Interaction
ce37d17a8ec215e2facf6e1ee489f9e66519e05e
f4640ae089439acaff16987171d209f6c38e5384
refs/heads/master
2020-03-12T01:33:22.781000
2018-05-06T10:57:28
2018-05-06T10:57:28
130,379,111
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.chenjr.uiinteraction; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; public class LinerLayout_activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_liner_layout); // TODO: final LinearLayout layout = this.findViewById(R.id.Linear_layout_uc1); Button bt_hor = findViewById(R.id.btn_ll_hor); Button bt_ver = findViewById(R.id.btn_ll_ver); Button bt_left_center = findViewById(R.id.btn_ll_left_center); Button bt_center = findViewById(R.id.btn_ll_center); Button bt_return = findViewById(R.id.btn_ll_return); bt_hor.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setOrientation(LinearLayout.HORIZONTAL); } }); bt_ver.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setOrientation(LinearLayout.VERTICAL); } }); bt_left_center.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setHorizontalGravity(Gravity.LEFT); } }); bt_center.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setHorizontalGravity(Gravity.CENTER); } }); bt_return.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } }
UTF-8
Java
1,951
java
LinerLayout_activity.java
Java
[]
null
[]
package me.chenjr.uiinteraction; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; public class LinerLayout_activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_liner_layout); // TODO: final LinearLayout layout = this.findViewById(R.id.Linear_layout_uc1); Button bt_hor = findViewById(R.id.btn_ll_hor); Button bt_ver = findViewById(R.id.btn_ll_ver); Button bt_left_center = findViewById(R.id.btn_ll_left_center); Button bt_center = findViewById(R.id.btn_ll_center); Button bt_return = findViewById(R.id.btn_ll_return); bt_hor.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setOrientation(LinearLayout.HORIZONTAL); } }); bt_ver.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setOrientation(LinearLayout.VERTICAL); } }); bt_left_center.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setHorizontalGravity(Gravity.LEFT); } }); bt_center.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { layout.setHorizontalGravity(Gravity.CENTER); } }); bt_return.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } }
1,951
0.611994
0.610969
61
30.983606
24.159641
80
false
false
0
0
0
0
0
0
0.409836
false
false
2
a32a3a37a1694b8a4b7a2c4f5b4af11d31fcc739
23,364,622,113,277
0e501521e09164fece0a2fcb961dc81e19481a2b
/CSE12_P8/P8_Fred_QTester/quantitytester.java
ea80470ef73c73c1e8b3ab96e782c3e7f989955f
[]
no_license
KwatErnar/UCSD-CSE-12
https://github.com/KwatErnar/UCSD-CSE-12
90712b9ee9c83d02bc7a67b7432624c96d809d58
0ef55ca55c33273135b9358501ec9fdaf654035b
refs/heads/master
2015-07-14T22:44:10
2015-04-16T07:26:35
2015-04-16T07:26:35
34,040,683
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * CSE 12 Homework 8 * NAME: Luyao Zhou * ID: A97028480 * LOGIN: CS12EJD * Section [A00] * Date: 05-27-2014 */ import java.util.*; import junit.framework.TestCase; public class QuantityTester extends TestCase { private Quantity one; private Quantity two; private Quantity three; private Quantity four; private Quantity five; private List<String> emp; private Map<String,Quantity> db; /** Standard Test Fixture * with five fixed quantity */ public void setUp(){ db = QuantityDB.getDB(); emp = new ArrayList<String>(); // one = 1.0 // two = 10.0 m sec^-1 // three = 10.0 m sec^-1 // four = 20.0 sec m^-1 // five = 20.0 m sec^-1 one = new Quantity(); three = new Quantity(10,Arrays.asList("m","s"), Arrays.asList("s","sec")); two = new Quantity(three); four = new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")); five = new Quantity(20,Arrays.asList("m"),Arrays.asList("sec")); } /** test for no-arugment constructor */ public void testCtorOne(){ assertEquals("no argument constrctor",new Quantity(1,emp,emp),one); //System.out.println(four.toString()); //System.out.println(one.toString()); //System.out.println(one.mul(three)); } /** test for copy constructor */ public void testCtorTwo(){ assertTrue("test copy constructor",two != three); assertTrue("test copy constructor",two.equals(three)); assertEquals("test copy constructor",two.toString(),three.toString()); try{ Quantity temp = new Quantity(null); fail("IllegalArgumentException Excepted!"); } catch(IllegalArgumentException e){ } } /** test for 3-argument constructor */ public void testCtorThree(){ try{ new Quantity(1.0, null,Arrays.asList("s")); fail("Exceptiuon expected"); } catch(IllegalArgumentException e){ } try{ new Quantity(1.0,Arrays.asList("s"),null); fail("Expception expected"); } catch(IllegalArgumentException e){ } assertEquals("test third constructor", new Quantity(10, Arrays.asList("m"), Arrays.asList("sec")), three); } /** test for method Mul */ public void testMul(){ assertEquals("one times one",one,one.mul(one)); assertEquals("three times one",new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), one.mul(three)); assertEquals("three times for", new Quantity(200,emp,emp),three.mul(four)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); try{ one.mul(null); fail("Exception excepted, cannot mul by null"); } catch (IllegalArgumentException e){ } } /** test for method Div */ public void testDiv() { try{ one.div(null); fail("Exception excepted"); } catch (IllegalArgumentException e){ } try{ one.div(new Quantity(0,Arrays.asList("m"),Arrays.asList("s"))); fail("Exception excepted"); } catch (IllegalArgumentException e){ } assertEquals("test div 1",one,one.div(one)); assertEquals("test div 2",new Quantity(0.1, Arrays.asList("sec"),Arrays.asList("m")), one.div(three)); assertEquals("test div 3",new Quantity(0.5,emp,emp),three.div(five)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("m"),Arrays.asList("sec")), five); } /** test for method Pow */ public void testPow(){ assertEquals("test pow 1", one, one.pow(100)); assertEquals("test pow 2", new Quantity(100, Arrays.asList("m","m"), Arrays.asList("sec","sec")), three.pow(2)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("test pow 3", new Quantity(), two.pow(0)); assertEquals("test pow 4", new Quantity(0.001, Arrays.asList("sec","sec","sec"),Arrays.asList("m","m","m")), two.pow(-3)); } /** test for method Add */ public void testAdd(){ try{ one.add(three); fail("Exception expected, unit doesn't match"); } catch (IllegalArgumentException e){ } try{ one.add(null); fail("Exception Excepted, cannot add null"); } catch (Exception e){ } assertEquals("test add 1", new Quantity(40,Arrays.asList("sec"),Arrays.asList("m")), four.add(four)); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); } /** test for method Sub */ public void testSub(){ try{ one.sub(three); fail("Exception expected, unit doesn't match"); } catch (IllegalArgumentException e){ } try{ one.sub(null); fail("Exception expected, cannot sub null"); } catch (Exception e){ } assertEquals("test add 1", new Quantity(0,Arrays.asList("sec"),Arrays.asList("m")), four.sub(four)); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); } /** test for method Negate */ public void testNegate(){ assertEquals("test negate 1", new Quantity(-20,Arrays.asList("sec"),Arrays.asList("m")), four.negate() ); } /** test for method toString */ public void testToString(){ assertEquals("test toString 1", "1.0", one.toString()); assertEquals("test toString 2", "10.0 m sec^-1", three.toString()); } /** test for method Equals */ public void testEquals(){ assertTrue("test equals ",!one.equals(null)); assertTrue("test equals 1", new Integer(1).equals(new Integer(1))); assertTrue("test equals 2", two.equals(three)); assertTrue("test equals 3", new Quantity(0.111112, Arrays.asList("m"), Arrays.asList("s")).equals(new Quantity(0.111113, Arrays.asList("m"), Arrays.asList("s")))); assertTrue("test equals 4", !new Quantity(0.111112, Arrays.asList("m"), Arrays.asList("s")).equals(new Quantity(0.111118, Arrays.asList("m"), Arrays.asList("s")))); assertTrue("test equals 5", new Integer(1).equals(1)); assertTrue("test equals 6", !one.equals(new Integer(1))); assertTrue("test equals 7", !one.equals(1)); assertTrue("test equals 8", !three.equals(10.0)); } /** test for method hashCode */ public void testHashCode(){ assertEquals("test hashcode 1", new Integer(1).hashCode(), new Integer(1).hashCode()); assertEquals("test hashcode 2", one.hashCode(), new Quantity().hashCode()); assertEquals("test hashcode 3", new Quantity(20,Arrays.asList("sec"), Arrays.asList("m")).hashCode(), four.hashCode()); } /** test for method NormalizeUnit */ public void testNormalizedUnit() { assertEquals("test normalizedUnit 0", new Quantity(1000,Arrays.asList("meter"),emp), Quantity.normalizedUnit("km",db)); assertEquals("test normalizedUnit 1", new Quantity(1.0, Arrays.asList("kg","meter","meter"), Arrays.asList("ampere","ampere","second","second","second")), Quantity.normalizedUnit("ohm", db)); assertEquals("test normalizedUnit 2", new Quantity(31557600.0, Arrays.asList("second"), emp), Quantity.normalizedUnit("year", db)); assertEquals("test normalizedUnit 3", new Quantity(1, Arrays.asList("smoot"), emp), Quantity.normalizedUnit("smoot", db)); } /** test for method Normalize */ public void testNormalize() { Quantity year = new Quantity(50, Arrays.asList("year"),emp ); assertEquals("test normalize 1 ", new Quantity(1577880000.0, Arrays.asList("second"), emp), year.normalize(db)); Quantity none = new Quantity(100, Arrays.asList("smoot"), Arrays.asList("good")); assertEquals("test normalize 2 ", new Quantity(100, Arrays.asList("smoot"), Arrays.asList("good")), none.normalize(db)); } }
UTF-8
Java
9,597
java
quantitytester.java
Java
[ { "context": "/*\n * CSE 12 Homework 8\n * NAME: Luyao Zhou\n * ID: A97028480\n * LOGIN: CS12EJD\n * Section [A0", "end": 43, "score": 0.9998348355293274, "start": 33, "tag": "NAME", "value": "Luyao Zhou" }, { "context": "k 8\n * NAME: Luyao Zhou\n * ID: A97028480\n * LOGIN: CS12EJD\n * Section [A00]\n * Date: 05-27-2014\n */\nimport j", "end": 78, "score": 0.9781532287597656, "start": 71, "tag": "USERNAME", "value": "CS12EJD" } ]
null
[]
/* * CSE 12 Homework 8 * NAME: <NAME> * ID: A97028480 * LOGIN: CS12EJD * Section [A00] * Date: 05-27-2014 */ import java.util.*; import junit.framework.TestCase; public class QuantityTester extends TestCase { private Quantity one; private Quantity two; private Quantity three; private Quantity four; private Quantity five; private List<String> emp; private Map<String,Quantity> db; /** Standard Test Fixture * with five fixed quantity */ public void setUp(){ db = QuantityDB.getDB(); emp = new ArrayList<String>(); // one = 1.0 // two = 10.0 m sec^-1 // three = 10.0 m sec^-1 // four = 20.0 sec m^-1 // five = 20.0 m sec^-1 one = new Quantity(); three = new Quantity(10,Arrays.asList("m","s"), Arrays.asList("s","sec")); two = new Quantity(three); four = new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")); five = new Quantity(20,Arrays.asList("m"),Arrays.asList("sec")); } /** test for no-arugment constructor */ public void testCtorOne(){ assertEquals("no argument constrctor",new Quantity(1,emp,emp),one); //System.out.println(four.toString()); //System.out.println(one.toString()); //System.out.println(one.mul(three)); } /** test for copy constructor */ public void testCtorTwo(){ assertTrue("test copy constructor",two != three); assertTrue("test copy constructor",two.equals(three)); assertEquals("test copy constructor",two.toString(),three.toString()); try{ Quantity temp = new Quantity(null); fail("IllegalArgumentException Excepted!"); } catch(IllegalArgumentException e){ } } /** test for 3-argument constructor */ public void testCtorThree(){ try{ new Quantity(1.0, null,Arrays.asList("s")); fail("Exceptiuon expected"); } catch(IllegalArgumentException e){ } try{ new Quantity(1.0,Arrays.asList("s"),null); fail("Expception expected"); } catch(IllegalArgumentException e){ } assertEquals("test third constructor", new Quantity(10, Arrays.asList("m"), Arrays.asList("sec")), three); } /** test for method Mul */ public void testMul(){ assertEquals("one times one",one,one.mul(one)); assertEquals("three times one",new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), one.mul(three)); assertEquals("three times for", new Quantity(200,emp,emp),three.mul(four)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); try{ one.mul(null); fail("Exception excepted, cannot mul by null"); } catch (IllegalArgumentException e){ } } /** test for method Div */ public void testDiv() { try{ one.div(null); fail("Exception excepted"); } catch (IllegalArgumentException e){ } try{ one.div(new Quantity(0,Arrays.asList("m"),Arrays.asList("s"))); fail("Exception excepted"); } catch (IllegalArgumentException e){ } assertEquals("test div 1",one,one.div(one)); assertEquals("test div 2",new Quantity(0.1, Arrays.asList("sec"),Arrays.asList("m")), one.div(three)); assertEquals("test div 3",new Quantity(0.5,emp,emp),three.div(five)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("m"),Arrays.asList("sec")), five); } /** test for method Pow */ public void testPow(){ assertEquals("test pow 1", one, one.pow(100)); assertEquals("test pow 2", new Quantity(100, Arrays.asList("m","m"), Arrays.asList("sec","sec")), three.pow(2)); assertEquals("original quantity shouldn't change", new Quantity(10, Arrays.asList("m"),Arrays.asList("sec")), three); assertEquals("test pow 3", new Quantity(), two.pow(0)); assertEquals("test pow 4", new Quantity(0.001, Arrays.asList("sec","sec","sec"),Arrays.asList("m","m","m")), two.pow(-3)); } /** test for method Add */ public void testAdd(){ try{ one.add(three); fail("Exception expected, unit doesn't match"); } catch (IllegalArgumentException e){ } try{ one.add(null); fail("Exception Excepted, cannot add null"); } catch (Exception e){ } assertEquals("test add 1", new Quantity(40,Arrays.asList("sec"),Arrays.asList("m")), four.add(four)); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); } /** test for method Sub */ public void testSub(){ try{ one.sub(three); fail("Exception expected, unit doesn't match"); } catch (IllegalArgumentException e){ } try{ one.sub(null); fail("Exception expected, cannot sub null"); } catch (Exception e){ } assertEquals("test add 1", new Quantity(0,Arrays.asList("sec"),Arrays.asList("m")), four.sub(four)); assertEquals("original quanitiy shouldn't change", new Quantity(20,Arrays.asList("sec"),Arrays.asList("m")), four); } /** test for method Negate */ public void testNegate(){ assertEquals("test negate 1", new Quantity(-20,Arrays.asList("sec"),Arrays.asList("m")), four.negate() ); } /** test for method toString */ public void testToString(){ assertEquals("test toString 1", "1.0", one.toString()); assertEquals("test toString 2", "10.0 m sec^-1", three.toString()); } /** test for method Equals */ public void testEquals(){ assertTrue("test equals ",!one.equals(null)); assertTrue("test equals 1", new Integer(1).equals(new Integer(1))); assertTrue("test equals 2", two.equals(three)); assertTrue("test equals 3", new Quantity(0.111112, Arrays.asList("m"), Arrays.asList("s")).equals(new Quantity(0.111113, Arrays.asList("m"), Arrays.asList("s")))); assertTrue("test equals 4", !new Quantity(0.111112, Arrays.asList("m"), Arrays.asList("s")).equals(new Quantity(0.111118, Arrays.asList("m"), Arrays.asList("s")))); assertTrue("test equals 5", new Integer(1).equals(1)); assertTrue("test equals 6", !one.equals(new Integer(1))); assertTrue("test equals 7", !one.equals(1)); assertTrue("test equals 8", !three.equals(10.0)); } /** test for method hashCode */ public void testHashCode(){ assertEquals("test hashcode 1", new Integer(1).hashCode(), new Integer(1).hashCode()); assertEquals("test hashcode 2", one.hashCode(), new Quantity().hashCode()); assertEquals("test hashcode 3", new Quantity(20,Arrays.asList("sec"), Arrays.asList("m")).hashCode(), four.hashCode()); } /** test for method NormalizeUnit */ public void testNormalizedUnit() { assertEquals("test normalizedUnit 0", new Quantity(1000,Arrays.asList("meter"),emp), Quantity.normalizedUnit("km",db)); assertEquals("test normalizedUnit 1", new Quantity(1.0, Arrays.asList("kg","meter","meter"), Arrays.asList("ampere","ampere","second","second","second")), Quantity.normalizedUnit("ohm", db)); assertEquals("test normalizedUnit 2", new Quantity(31557600.0, Arrays.asList("second"), emp), Quantity.normalizedUnit("year", db)); assertEquals("test normalizedUnit 3", new Quantity(1, Arrays.asList("smoot"), emp), Quantity.normalizedUnit("smoot", db)); } /** test for method Normalize */ public void testNormalize() { Quantity year = new Quantity(50, Arrays.asList("year"),emp ); assertEquals("test normalize 1 ", new Quantity(1577880000.0, Arrays.asList("second"), emp), year.normalize(db)); Quantity none = new Quantity(100, Arrays.asList("smoot"), Arrays.asList("good")); assertEquals("test normalize 2 ", new Quantity(100, Arrays.asList("smoot"), Arrays.asList("good")), none.normalize(db)); } }
9,593
0.548088
0.526206
294
31.639456
23.958282
80
false
false
0
0
0
0
0
0
0.911565
false
false
2
47f4ff58bf9715cc1274116c0c1cb064a090cb25
27,865,747,859,585
44e082b233a2e44212422514fa9225cf1b6358d2
/FHProgrammieren_BERNALDiana-Grace/src/glprogSS2020/BernalHausuebung2/bIFUnterprogramm/a_Notenberechnung.java
a9c7d221187699ab28d563890b960ba35e0f7ce6
[]
no_license
fhbgraceb/VerbundA-SS20
https://github.com/fhbgraceb/VerbundA-SS20
b3af20000e1a4b6efe768156ad415dbf67e16be0
7e672445bb785386af2ff65d3526f89c67882a71
refs/heads/master
2022-12-28T05:56:20.158000
2020-10-10T23:20:18
2020-10-10T23:20:18
238,525,365
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package BernalHausuebung2.bIFUnterprogramm; import java.util.Scanner; public class a_Notenberechnung { /* Aufgabe: 1.Notenberechngung:Prüfungspunkte und Mitarbeitspunkte werden gemeinsam in einer Methode übergeben, z.B.: noteermitteln(40,23); die Prüfung muss jedoch positiv sein d.h. größer 35 Punkte, 51 Punkte im Summe genügen nicht z.B.: Prüfung 30, Mitarbeitspunkte 30 ergeben aufgrund des K.O. -Kriteriums dennoch ein nicht genügend. Zurück gegeben wir die Note. Geben Sie zumindest 3 Testfälle aus, d.h. 3 Methodenaufrufe mit unterschiedlichen Anwendungs-/Verzweigungsfall. Notenschlüssel der FH entsprechend. FH notenschluessel: sehrgut:100-89 gut:88-76 befriedigend:75-63 genügend:62-51 nicht genügend:50-0 */ public static void main(String[] args) { Scanner s= new Scanner(System.in); System.out.println("Prüfungspunkte bitte eingeben: "); int pruefungsp=s.nextInt(); System.out.println("Mitarbeitspunkte bitte eingeben: "); int mitarbeitsp=s.nextInt(); int note=0; if (pruefungsp > 35) { note=noteErmittlung(pruefungsp, mitarbeitsp); switch (note) { case 1: System.out.println("Sehr Gut"); break; case 2: System.out.println("Gut"); break; case 3: System.out.println("Befriedigend"); break; case 4: System.out.println("Genügend"); break; case 5: System.out.println("Nicht Genügend"); break; default: System.out.println("nicht Beurteilt"); break; } }else{ System.out.println("Nicht Genügend - Prüfung war negativ!"); } s.close(); } public static int noteErmittlung(int c,int v) { int gesamtsumme = c + v; int mark=0; if (gesamtsumme > 88) { mark=1; } else if (gesamtsumme > 75) { mark=2; } else if (gesamtsumme > 62) { mark=3; } else if (gesamtsumme > 50) { mark=4; } else { mark=5; } return mark; } }
ISO-8859-1
Java
1,878
java
a_Notenberechnung.java
Java
[]
null
[]
package BernalHausuebung2.bIFUnterprogramm; import java.util.Scanner; public class a_Notenberechnung { /* Aufgabe: 1.Notenberechngung:Prüfungspunkte und Mitarbeitspunkte werden gemeinsam in einer Methode übergeben, z.B.: noteermitteln(40,23); die Prüfung muss jedoch positiv sein d.h. größer 35 Punkte, 51 Punkte im Summe genügen nicht z.B.: Prüfung 30, Mitarbeitspunkte 30 ergeben aufgrund des K.O. -Kriteriums dennoch ein nicht genügend. Zurück gegeben wir die Note. Geben Sie zumindest 3 Testfälle aus, d.h. 3 Methodenaufrufe mit unterschiedlichen Anwendungs-/Verzweigungsfall. Notenschlüssel der FH entsprechend. FH notenschluessel: sehrgut:100-89 gut:88-76 befriedigend:75-63 genügend:62-51 nicht genügend:50-0 */ public static void main(String[] args) { Scanner s= new Scanner(System.in); System.out.println("Prüfungspunkte bitte eingeben: "); int pruefungsp=s.nextInt(); System.out.println("Mitarbeitspunkte bitte eingeben: "); int mitarbeitsp=s.nextInt(); int note=0; if (pruefungsp > 35) { note=noteErmittlung(pruefungsp, mitarbeitsp); switch (note) { case 1: System.out.println("Sehr Gut"); break; case 2: System.out.println("Gut"); break; case 3: System.out.println("Befriedigend"); break; case 4: System.out.println("Genügend"); break; case 5: System.out.println("Nicht Genügend"); break; default: System.out.println("nicht Beurteilt"); break; } }else{ System.out.println("Nicht Genügend - Prüfung war negativ!"); } s.close(); } public static int noteErmittlung(int c,int v) { int gesamtsumme = c + v; int mark=0; if (gesamtsumme > 88) { mark=1; } else if (gesamtsumme > 75) { mark=2; } else if (gesamtsumme > 62) { mark=3; } else if (gesamtsumme > 50) { mark=4; } else { mark=5; } return mark; } }
1,878
0.691935
0.660753
69
25.956522
26.580713
112
false
false
0
0
0
0
0
0
2.26087
false
false
2
3f350912b324b5ab5c7894190af0abe294b360c4
12,163,347,411,745
4f1270800ec8855381fb0ab6bfa6d9df95eee35f
/src/main/java/com/jusfoun/parsexml/model/inputs/params/LabelName.java
ceea3db682db57ac56af76a5894f1bf56c428474
[]
no_license
Timehsw/ParseXml
https://github.com/Timehsw/ParseXml
8283e89dde03ea6e7f696189174ad033a6d9c19a
fa8a96b843add7ba8c2932858f55dff390b420f1
refs/heads/master
2016-09-11T21:59:03.409000
2016-08-11T08:14:39
2016-08-11T08:14:39
65,451,427
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jusfoun.parsexml.model.inputs.params; import com.jusfoun.parsexml.model.base.BaseConfig; public class LabelName extends BaseConfig { }
UTF-8
Java
151
java
LabelName.java
Java
[]
null
[]
package com.jusfoun.parsexml.model.inputs.params; import com.jusfoun.parsexml.model.base.BaseConfig; public class LabelName extends BaseConfig { }
151
0.807947
0.807947
8
17.875
22.898895
50
false
false
0
0
0
0
0
0
0.25
false
false
2
26312f4082c328b479e06b1d07073c367c10b3b9
5,523,327,976,532
ebea32d4f448d212ea14a0ca1575cc4b1300a185
/src/com/org/action/user/UserChangePasswordAction.java
d3d6be16e417f218811ac0dde7a41864ec620027
[]
no_license
khale0106/webapp-construction-data
https://github.com/khale0106/webapp-construction-data
50fa4e2f0cded5f73816e893fca0116f6a774e03
aa8c14602e63c1eba2ebec3f6a3b3bb14d495dd5
refs/heads/master
2020-06-10T02:20:46.111000
2019-09-07T05:47:42
2019-09-07T05:47:42
193,553,987
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.org.action.user; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import javax.naming.NamingException; import org.apache.log4j.Logger; import com.opensymphony.xwork2.ActionSupport; import com.org.core.models.Users; import com.org.services.UserServices; import com.org.services.impl.UserServicesImpl; import com.org.utils.EncryptUtils; import lombok.Getter; import lombok.Setter; public class UserChangePasswordAction extends ActionSupport { private static final Logger logger = Logger.getLogger(UserChangePasswordAction.class); @Getter @Setter private String userId; @Getter @Setter private String oldPassword; @Getter @Setter private String confirmNewPassword; @Getter @Setter private String newPassword; @Getter @Setter private String msgChangePassword; @Getter @Setter private String msgCheckOldPassword; public String execute() { // get user by user's id try { UserServices userServices = new UserServicesImpl(); Users user = userServices.getUserById(userId); String oldHash = EncryptUtils.getEncryptStr(oldPassword); boolean isCorrectOldPassword = user.getPassword().equals(oldHash); if(isCorrectOldPassword) { // update new password into model String password = EncryptUtils.getEncryptStr(newPassword); user.setPassword(password); // update to db boolean result = userServices.updateUserById(user); if(result) msgChangePassword = "SUCCESS"; else msgChangePassword = "FAIL"; } else { msgCheckOldPassword = "INCORRECT"; } } catch (SQLException e) { logger.error("[UserChangePasswordAction][SQL] - " + e.getMessage()); } catch (NamingException e) { logger.error("[UserChangePasswordAction][Naming] - " + e.getMessage()); } catch (NoSuchAlgorithmException e) { logger.error("[UserChangePasswordAction][NoSuchAlgorithm] - " + e.getMessage()); } return SUCCESS; } }
UTF-8
Java
1,919
java
UserChangePasswordAction.java
Java
[]
null
[]
package com.org.action.user; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import javax.naming.NamingException; import org.apache.log4j.Logger; import com.opensymphony.xwork2.ActionSupport; import com.org.core.models.Users; import com.org.services.UserServices; import com.org.services.impl.UserServicesImpl; import com.org.utils.EncryptUtils; import lombok.Getter; import lombok.Setter; public class UserChangePasswordAction extends ActionSupport { private static final Logger logger = Logger.getLogger(UserChangePasswordAction.class); @Getter @Setter private String userId; @Getter @Setter private String oldPassword; @Getter @Setter private String confirmNewPassword; @Getter @Setter private String newPassword; @Getter @Setter private String msgChangePassword; @Getter @Setter private String msgCheckOldPassword; public String execute() { // get user by user's id try { UserServices userServices = new UserServicesImpl(); Users user = userServices.getUserById(userId); String oldHash = EncryptUtils.getEncryptStr(oldPassword); boolean isCorrectOldPassword = user.getPassword().equals(oldHash); if(isCorrectOldPassword) { // update new password into model String password = EncryptUtils.getEncryptStr(newPassword); user.setPassword(password); // update to db boolean result = userServices.updateUserById(user); if(result) msgChangePassword = "SUCCESS"; else msgChangePassword = "FAIL"; } else { msgCheckOldPassword = "INCORRECT"; } } catch (SQLException e) { logger.error("[UserChangePasswordAction][SQL] - " + e.getMessage()); } catch (NamingException e) { logger.error("[UserChangePasswordAction][Naming] - " + e.getMessage()); } catch (NoSuchAlgorithmException e) { logger.error("[UserChangePasswordAction][NoSuchAlgorithm] - " + e.getMessage()); } return SUCCESS; } }
1,919
0.751954
0.750912
62
29.951612
23.7985
87
false
false
0
0
0
0
0
0
2.112903
false
false
2
d2eded57242d76aafa402f075f8ffba1130d1513
28,973,849,411,339
f101c69b5f92310d15ce2b883728dc98b135f891
/multiline-string/src/main/java/org/adrianwalker/multilinestring/StringProcessor.java
a30605d4e508715ea5b17d81ff24f301cad0ad10
[]
no_license
benelog/multiline
https://github.com/benelog/multiline
80cd63fb70d1bd5a2c75c2a3bc6902c04be603f0
cad354180bcce22a2c0c91ac2e2c09c15e300bf8
refs/heads/master
2020-12-22T13:36:40.322000
2017-03-13T21:37:36
2017-03-13T21:37:36
7,741,715
87
24
null
false
2017-03-13T21:37:37
2013-01-21T22:30:51
2017-03-06T14:55:48
2017-03-13T21:37:37
182
64
11
7
Java
null
null
package org.adrianwalker.multilinestring; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; public class StringProcessor { public static String toString(String value,Multiline annotation) { if(!annotation.mergeLines() && !annotation.trimWhiteSpace()) { return value; } String crnl = System.getProperty("line.separator"); try { BufferedReader reader = new BufferedReader(new StringReader(value)); StringBuilder buf = new StringBuilder(); String line = reader.readLine(); while(line != null) { if(annotation.trimWhiteSpace()) { line = line.trim(); } if(annotation.mergeLines() && buf.length()>0) { if(annotation.mergeChar() != '\0') { buf.append(annotation.mergeChar()); } } buf.append(line); if(!annotation.mergeLines()) { buf.append(crnl); } line = reader.readLine(); } return buf.toString(); } catch(IOException ex) { // should never happen. Just return the value return value; } } }
UTF-8
Java
1,068
java
StringProcessor.java
Java
[]
null
[]
package org.adrianwalker.multilinestring; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; public class StringProcessor { public static String toString(String value,Multiline annotation) { if(!annotation.mergeLines() && !annotation.trimWhiteSpace()) { return value; } String crnl = System.getProperty("line.separator"); try { BufferedReader reader = new BufferedReader(new StringReader(value)); StringBuilder buf = new StringBuilder(); String line = reader.readLine(); while(line != null) { if(annotation.trimWhiteSpace()) { line = line.trim(); } if(annotation.mergeLines() && buf.length()>0) { if(annotation.mergeChar() != '\0') { buf.append(annotation.mergeChar()); } } buf.append(line); if(!annotation.mergeLines()) { buf.append(crnl); } line = reader.readLine(); } return buf.toString(); } catch(IOException ex) { // should never happen. Just return the value return value; } } }
1,068
0.641386
0.639513
52
19.538462
19.254831
71
false
false
0
0
0
0
0
0
3
false
false
2
54d2a03fcabfb6ef05a9e957cb7bac5c2e5372c5
17,987,323,065,483
ade50bf810449f258f56248640e178961f56cf1d
/app/src/main/java/workshop/g_s/myfitnessnutritiondairy/utils/Constants.java
943be8faca4e31e4e670f3c6230f28451c487079
[]
no_license
shimrongal/MyFitnessNutritionDairy
https://github.com/shimrongal/MyFitnessNutritionDairy
a8b28fb34ebd8d0ff227aea0c7f8d34318e98a33
9bfe9a8b8132940c66aa3a45170b232a8fed907a
refs/heads/master
2020-04-24T00:00:21.731000
2019-02-19T21:11:44
2019-02-19T21:11:44
171,552,183
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package workshop.g_s.myfitnessnutritiondairy.utils; public class Constants { public static final int FIREBASE_SIGN_IN = 123; public final static String BASE_URL = "https://shimrongal.000webhostapp.com/"; public static final String IS_USER_LOGED = "is user loged"; static final String GO_TO_WORKOUT_FRAGMENT = "goToWorkoutFrag"; public static final String WORKOUT_ID = "workId"; public static final String FOOD_ID = "foodId"; public static final String FOOD_LIST_OBJECT = "foodListObject"; static final int TIME_INTERVAL_FOR_DOUBLE_CLICK_TO_EXIT = 2000; public static final int CAMERA_REQUEST_CODE = 5; //Fragment Section static final String FOODS_FRAGMENT = "FoodsFragment"; static final String FOOD_DETAILS_FRAGMENT = "FoodDetailsFragment"; static final String BARCODE_SCANNER_FRAGMENT = "BARCODE_SCANNER_FRAGMENT"; static final String WORKOUT_FRAGMENT = "WorkoutFragment"; static final String EXERCISE_FRAGMENT = "ExerciseFragment"; //Intent Action Section public static final String ACTION_GO_TO_FOODS_FRAGMENT = "goToFoods"; static final String ACTION_GO_TO_SCANNER_FRAGMENT = "GoToScanner"; }
UTF-8
Java
1,177
java
Constants.java
Java
[]
null
[]
package workshop.g_s.myfitnessnutritiondairy.utils; public class Constants { public static final int FIREBASE_SIGN_IN = 123; public final static String BASE_URL = "https://shimrongal.000webhostapp.com/"; public static final String IS_USER_LOGED = "is user loged"; static final String GO_TO_WORKOUT_FRAGMENT = "goToWorkoutFrag"; public static final String WORKOUT_ID = "workId"; public static final String FOOD_ID = "foodId"; public static final String FOOD_LIST_OBJECT = "foodListObject"; static final int TIME_INTERVAL_FOR_DOUBLE_CLICK_TO_EXIT = 2000; public static final int CAMERA_REQUEST_CODE = 5; //Fragment Section static final String FOODS_FRAGMENT = "FoodsFragment"; static final String FOOD_DETAILS_FRAGMENT = "FoodDetailsFragment"; static final String BARCODE_SCANNER_FRAGMENT = "BARCODE_SCANNER_FRAGMENT"; static final String WORKOUT_FRAGMENT = "WorkoutFragment"; static final String EXERCISE_FRAGMENT = "ExerciseFragment"; //Intent Action Section public static final String ACTION_GO_TO_FOODS_FRAGMENT = "goToFoods"; static final String ACTION_GO_TO_SCANNER_FRAGMENT = "GoToScanner"; }
1,177
0.737468
0.728122
28
41.035713
29.378664
82
false
false
0
0
0
0
0
0
0.607143
false
false
2
775e87c637902e0521a7b69bcd686d954fab4d5c
7,361,573,980,397
85cf9c1cfd030f45faf88efc34649a391b5fd11e
/src/pers/carlS/headFirstDesginPatterns/theCommandPattern/RemoteLoader.java
6e07c5c975fe7bf718b22f551601f8c8e33cc78a
[]
no_license
SunWeiJunnnnn/designPatterns
https://github.com/SunWeiJunnnnn/designPatterns
97120715ce8e875ae94ec134de5e36da0ed360b8
19904d75a8b968fb9ea21eadd6595c08269e1a6e
refs/heads/master
2020-06-18T08:31:21.117000
2019-09-04T08:42:16
2019-09-04T08:42:16
196,233,724
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pers.carlS.headFirstDesginPatterns.theCommandPattern; import pers.carlS.headFirstDesginPatterns.theCommandPattern.command.*; public class RemoteLoader { public static void main(String[] args) { // create all the devices in their proper locations RemoteController remoteController = new RemoteController(); Light livingRoomLight = new Light("Living Room"); Light kitchenLight = new Light("Kitchen"); CeilingFan ceilingFan = new CeilingFan("Living Room"); GarageDoor door = new GarageDoor(""); Stereo stereo = new Stereo("Living room"); // create all the Light Command objects LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight); LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight); LightOnCommand kitchenLightOn = new LightOnCommand(kitchenLight); LightOffCommand kitchenLightOff = new LightOffCommand(kitchenLight); // create all the on and off for the ceiling fan CeilingFanOnCommand ceilingFanOn = new CeilingFanOnCommand(ceilingFan); CeilingFanOffCommand ceilingFanOff = new CeilingFanOffCommand(ceilingFan); // create all the stereo GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(door); GarageDoorCloesCommand garageDoorClose = new GarageDoorCloesCommand(door); StereoOnWithCdCommand stereoOn = new StereoOnWithCdCommand(stereo); remoteController.setOnCommands(0, livingRoomLightOn, livingRoomLightOff); remoteController.setOnCommands(1, kitchenLightOn, kitchenLightOff); remoteController.setOnCommands(2, ceilingFanOn, ceilingFanOff); remoteController.setOnCommands(3, garageDoorOpen,garageDoorClose ); System.out.println(remoteController); remoteController.onButtonWasPressed(0); remoteController.offButtonWasPressed(0); remoteController.onButtonWasPressed(1); remoteController.offButtonWasPressed(1); remoteController.onButtonWasPressed(2); remoteController.offButtonWasPressed(2); remoteController.onButtonWasPressed(3); remoteController.offButtonWasPressed(3); } }
UTF-8
Java
2,214
java
RemoteLoader.java
Java
[]
null
[]
package pers.carlS.headFirstDesginPatterns.theCommandPattern; import pers.carlS.headFirstDesginPatterns.theCommandPattern.command.*; public class RemoteLoader { public static void main(String[] args) { // create all the devices in their proper locations RemoteController remoteController = new RemoteController(); Light livingRoomLight = new Light("Living Room"); Light kitchenLight = new Light("Kitchen"); CeilingFan ceilingFan = new CeilingFan("Living Room"); GarageDoor door = new GarageDoor(""); Stereo stereo = new Stereo("Living room"); // create all the Light Command objects LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight); LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight); LightOnCommand kitchenLightOn = new LightOnCommand(kitchenLight); LightOffCommand kitchenLightOff = new LightOffCommand(kitchenLight); // create all the on and off for the ceiling fan CeilingFanOnCommand ceilingFanOn = new CeilingFanOnCommand(ceilingFan); CeilingFanOffCommand ceilingFanOff = new CeilingFanOffCommand(ceilingFan); // create all the stereo GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(door); GarageDoorCloesCommand garageDoorClose = new GarageDoorCloesCommand(door); StereoOnWithCdCommand stereoOn = new StereoOnWithCdCommand(stereo); remoteController.setOnCommands(0, livingRoomLightOn, livingRoomLightOff); remoteController.setOnCommands(1, kitchenLightOn, kitchenLightOff); remoteController.setOnCommands(2, ceilingFanOn, ceilingFanOff); remoteController.setOnCommands(3, garageDoorOpen,garageDoorClose ); System.out.println(remoteController); remoteController.onButtonWasPressed(0); remoteController.offButtonWasPressed(0); remoteController.onButtonWasPressed(1); remoteController.offButtonWasPressed(1); remoteController.onButtonWasPressed(2); remoteController.offButtonWasPressed(2); remoteController.onButtonWasPressed(3); remoteController.offButtonWasPressed(3); } }
2,214
0.738934
0.733514
47
46.106384
28.587481
82
false
false
0
0
0
0
0
0
0.808511
false
false
2
7d145d04775f669ad465a0f47488a085e3fd850f
31,834,297,623,901
69d547c0745d65712e7539d0a7e8f7e75aee13d6
/src/main/java/com/sfa/qb/model/price/Quantity.java
34967c30c20dbc7f0764db2990aa0ade8c725381
[]
no_license
jherson/sfa-qb
https://github.com/jherson/sfa-qb
2e2073045aea14eaa1db8fa8d849f678b27a9a1f
f844558201564c665dd1842f0bef271dea1c4caf
refs/heads/master
2015-08-06T03:19:14.076000
2013-05-21T21:23:25
2013-05-21T21:23:25
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sfa.qb.model.price; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Quantity { @XmlAttribute(name="uom") private String uom; @XmlElement(name="Quantity") private String quantity; public String getUom() { return uom; } public void setUom(String uom) { this.uom = uom; } public String getQuantity() { return quantity; } public void setQuantity(String quantity) { this.quantity = quantity; } }
UTF-8
Java
693
java
Quantity.java
Java
[]
null
[]
package com.sfa.qb.model.price; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Quantity { @XmlAttribute(name="uom") private String uom; @XmlElement(name="Quantity") private String quantity; public String getUom() { return uom; } public void setUom(String uom) { this.uom = uom; } public String getQuantity() { return quantity; } public void setQuantity(String quantity) { this.quantity = quantity; } }
693
0.760462
0.760462
35
18.828571
17.100519
49
false
false
0
0
0
0
0
0
1.028571
false
false
2
4d2807886201c7508c5f494aafe6c7a70920a401
14,465,449,892,048
912fb5b241619aace18432c4a9c1a3509b299e44
/cgps-reservation/src/main/java/com/sk/demo/cpgs/reservation/domain/model/Reservation.java
3e7feb4ef7ea3a02d1292a22f7ecf19d25c73f74
[]
no_license
swj9189/cgpsnew
https://github.com/swj9189/cgpsnew
07ca3e77707ab4908746f3872d5a986991417f3f
2630d46f3248abdf688abdacace03adc29cbad4c
refs/heads/master
2022-01-15T18:23:50.349000
2019-07-25T03:28:06
2019-07-25T03:28:06
198,376,308
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sk.demo.cpgs.reservation.domain.model; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Table; import com.sk.demo.cgps.reservation.shared.Address; import com.sk.demo.cpgs.reservation.domain.base.AbstractEntity; import com.sk.demo.cpgs.reservation.domain.base.AggregateRoot; import lombok.Data; @Data @Entity @Table(name = "reservation") public class Reservation extends AbstractEntity implements AggregateRoot { private Long userId; private Long menuId; private String menuName; private Long restaurantId; private String restaurantName; private Address restaurntAddress; private Boolean completed = false; private Boolean reservated = false; private Date regDate; public Reservation(Long userId, Long menuId, String menuName, Long restaurantId, String restaurantName, Boolean completed , Date regDate) { this.userId = userId; this.menuId = menuId; this.menuName = menuName; this.restaurantId = restaurantId; this.restaurantName = restaurantName; this.completed = completed; this.regDate = regDate; } }
UTF-8
Java
1,118
java
Reservation.java
Java
[]
null
[]
package com.sk.demo.cpgs.reservation.domain.model; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Table; import com.sk.demo.cgps.reservation.shared.Address; import com.sk.demo.cpgs.reservation.domain.base.AbstractEntity; import com.sk.demo.cpgs.reservation.domain.base.AggregateRoot; import lombok.Data; @Data @Entity @Table(name = "reservation") public class Reservation extends AbstractEntity implements AggregateRoot { private Long userId; private Long menuId; private String menuName; private Long restaurantId; private String restaurantName; private Address restaurntAddress; private Boolean completed = false; private Boolean reservated = false; private Date regDate; public Reservation(Long userId, Long menuId, String menuName, Long restaurantId, String restaurantName, Boolean completed , Date regDate) { this.userId = userId; this.menuId = menuId; this.menuName = menuName; this.restaurantId = restaurantId; this.restaurantName = restaurantName; this.completed = completed; this.regDate = regDate; } }
1,118
0.76297
0.76297
38
27.421053
26.392414
140
false
false
0
0
0
0
0
0
1.5
false
false
2
edcbb92df23b7a53114aed256d2587d70341e44e
25,314,537,275,453
8225a2c3eccf916360b502f5ab4ff12ee892bdde
/willow-utils/src/test/java/com/nitorcreations/willow/utils/TestObfuscatorTool.java
922cbb1e97be17eece1d5f339b9c5ab4d920bae9
[ "Apache-2.0" ]
permissive
NitorCreations/willow
https://github.com/NitorCreations/willow
f778f3a3eb67fab7fbbc10e2e19de1c7343f0f65
f51e4134f856276554740a43812e750c40655c87
refs/heads/master
2022-12-22T16:24:27.817000
2022-01-13T16:19:42
2022-01-13T16:19:42
23,064,947
14
2
Apache-2.0
false
2022-12-14T20:25:38
2014-08-18T09:03:44
2022-01-13T16:19:16
2022-12-14T20:25:35
5,718
12
2
40
JavaScript
false
false
package com.nitorcreations.willow.utils; import static org.junit.Assert.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; import java.nio.charset.StandardCharsets; import org.junit.Test; public class TestObfuscatorTool { @Test public void testTool() throws Exception { ObfuscatorTool.main(new String[] {"target/test-classes/root.properties"}); File enc = new File("target/test-classes/root.properties.encrypted"); File key = new File("target/test-classes/root.properties.key"); assertTrue(enc.exists()); assertTrue(key.exists()); System.setProperty("decrypt", ""); ByteArrayOutputStream output = new ByteArrayOutputStream(); PrintStream oldOut = System.out; System.setOut(new PrintStream(output, true, "UTF-8")); ObfuscatorTool.main(new String[] {"target/test-classes/root.properties.encrypted", "target/test-classes/root.properties.key" }); System.setOut(oldOut); byte[] outputData = output.toByteArray(); ByteArrayInputStream in = new ByteArrayInputStream(outputData); MergeableProperties props = new MergeableProperties(); props.load(in); assertEquals("foo/bar", props.getProperty("included.file[1].extraprops")); } }
UTF-8
Java
1,272
java
TestObfuscatorTool.java
Java
[]
null
[]
package com.nitorcreations.willow.utils; import static org.junit.Assert.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; import java.nio.charset.StandardCharsets; import org.junit.Test; public class TestObfuscatorTool { @Test public void testTool() throws Exception { ObfuscatorTool.main(new String[] {"target/test-classes/root.properties"}); File enc = new File("target/test-classes/root.properties.encrypted"); File key = new File("target/test-classes/root.properties.key"); assertTrue(enc.exists()); assertTrue(key.exists()); System.setProperty("decrypt", ""); ByteArrayOutputStream output = new ByteArrayOutputStream(); PrintStream oldOut = System.out; System.setOut(new PrintStream(output, true, "UTF-8")); ObfuscatorTool.main(new String[] {"target/test-classes/root.properties.encrypted", "target/test-classes/root.properties.key" }); System.setOut(oldOut); byte[] outputData = output.toByteArray(); ByteArrayInputStream in = new ByteArrayInputStream(outputData); MergeableProperties props = new MergeableProperties(); props.load(in); assertEquals("foo/bar", props.getProperty("included.file[1].extraprops")); } }
1,272
0.741352
0.73978
33
37.545456
28.712885
132
false
false
0
0
0
0
0
0
0.878788
false
false
2
d6184a3916a453900864823920614457eb8b33f4
12,532,714,573,716
f2071bae6110ca408190e93b32aa9783193f57d7
/StuScoreAnalyticalSystem/src/com/liuxu/ssas/model/Student.java
cdfd6282ff466b12d9f1aea92647b90c88f67c01
[]
no_license
RomanceLiuXu/myworkspace
https://github.com/RomanceLiuXu/myworkspace
ae24ab49ad555f29f1f77bae0bf3c538f8f9e5e8
96de2243d8212c241020f525913f83618a6a2876
refs/heads/master
2020-04-23T08:04:06.618000
2019-02-16T16:39:44
2019-02-16T16:39:44
171,025,129
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.liuxu.ssas.model; public class Student { private String name;// 姓名 private Integer sid;// 学号 public Student() { super(); // TODO Auto-generated constructor stub } public Student(String name, Integer sid) { super(); this.name = name; this.sid = sid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getSid() { return sid; } public void setSid(Integer sid) { this.sid = sid; } }
UTF-8
Java
502
java
Student.java
Java
[]
null
[]
package com.liuxu.ssas.model; public class Student { private String name;// 姓名 private Integer sid;// 学号 public Student() { super(); // TODO Auto-generated constructor stub } public Student(String name, Integer sid) { super(); this.name = name; this.sid = sid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getSid() { return sid; } public void setSid(Integer sid) { this.sid = sid; } }
502
0.651822
0.651822
35
13.114285
13.278923
43
false
false
0
0
0
0
0
0
1.257143
false
false
2
b9e29a4390520bab824adee9d130a134fc7c6460
6,957,847,028,108
6984f27320a10846e312c026e6d978408ac59857
/src/test/java/com/thepapyrusprint/backend/web/rest/NotationResourceIT.java
5e91157a7d332e862372c5aa2f2a2075a0d127e0
[]
no_license
Nkonshu/ThePapyrusPrint
https://github.com/Nkonshu/ThePapyrusPrint
4cbd40b23d0f16e2b639245b7a70c043fdf48fe4
0e8ed3a95cb412e45f507ccc49908a25b24f320d
refs/heads/master
2023-06-01T04:40:36.896000
2020-04-03T23:49:14
2020-04-03T23:49:14
252,567,418
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.thepapyrusprint.backend.web.rest; import com.thepapyrusprint.backend.ThePapyrusPrintApp; import com.thepapyrusprint.backend.domain.Notation; import com.thepapyrusprint.backend.repository.NotationRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Integration tests for the {@link NotationResource} REST controller. */ @SpringBootTest(classes = ThePapyrusPrintApp.class) @AutoConfigureMockMvc @WithMockUser public class NotationResourceIT { private static final Float DEFAULT_NOTE = 1F; private static final Float UPDATED_NOTE = 2F; private static final String DEFAULT_OBSERVATION = "AAAAAAAAAA"; private static final String UPDATED_OBSERVATION = "BBBBBBBBBB"; @Autowired private NotationRepository notationRepository; @Autowired private EntityManager em; @Autowired private MockMvc restNotationMockMvc; private Notation notation; /** * Create an entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Notation createEntity(EntityManager em) { Notation notation = new Notation() .note(DEFAULT_NOTE) .observation(DEFAULT_OBSERVATION); return notation; } /** * Create an updated entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Notation createUpdatedEntity(EntityManager em) { Notation notation = new Notation() .note(UPDATED_NOTE) .observation(UPDATED_OBSERVATION); return notation; } @BeforeEach public void initTest() { notation = createEntity(em); } @Test @Transactional public void createNotation() throws Exception { int databaseSizeBeforeCreate = notationRepository.findAll().size(); // Create the Notation restNotationMockMvc.perform(post("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isCreated()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeCreate + 1); Notation testNotation = notationList.get(notationList.size() - 1); assertThat(testNotation.getNote()).isEqualTo(DEFAULT_NOTE); assertThat(testNotation.getObservation()).isEqualTo(DEFAULT_OBSERVATION); } @Test @Transactional public void createNotationWithExistingId() throws Exception { int databaseSizeBeforeCreate = notationRepository.findAll().size(); // Create the Notation with an existing ID notation.setId(1L); // An entity with an existing ID cannot be created, so this API call must fail restNotationMockMvc.perform(post("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isBadRequest()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void getAllNotations() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); // Get all the notationList restNotationMockMvc.perform(get("/api/notations?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(notation.getId().intValue()))) .andExpect(jsonPath("$.[*].note").value(hasItem(DEFAULT_NOTE.doubleValue()))) .andExpect(jsonPath("$.[*].observation").value(hasItem(DEFAULT_OBSERVATION))); } @Test @Transactional public void getNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); // Get the notation restNotationMockMvc.perform(get("/api/notations/{id}", notation.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.id").value(notation.getId().intValue())) .andExpect(jsonPath("$.note").value(DEFAULT_NOTE.doubleValue())) .andExpect(jsonPath("$.observation").value(DEFAULT_OBSERVATION)); } @Test @Transactional public void getNonExistingNotation() throws Exception { // Get the notation restNotationMockMvc.perform(get("/api/notations/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); int databaseSizeBeforeUpdate = notationRepository.findAll().size(); // Update the notation Notation updatedNotation = notationRepository.findById(notation.getId()).get(); // Disconnect from session so that the updates on updatedNotation are not directly saved in db em.detach(updatedNotation); updatedNotation .note(UPDATED_NOTE) .observation(UPDATED_OBSERVATION); restNotationMockMvc.perform(put("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(updatedNotation))) .andExpect(status().isOk()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeUpdate); Notation testNotation = notationList.get(notationList.size() - 1); assertThat(testNotation.getNote()).isEqualTo(UPDATED_NOTE); assertThat(testNotation.getObservation()).isEqualTo(UPDATED_OBSERVATION); } @Test @Transactional public void updateNonExistingNotation() throws Exception { int databaseSizeBeforeUpdate = notationRepository.findAll().size(); // Create the Notation // If the entity doesn't have an ID, it will throw BadRequestAlertException restNotationMockMvc.perform(put("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isBadRequest()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeUpdate); } @Test @Transactional public void deleteNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); int databaseSizeBeforeDelete = notationRepository.findAll().size(); // Delete the notation restNotationMockMvc.perform(delete("/api/notations/{id}", notation.getId()) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()); // Validate the database contains one less item List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeDelete - 1); } }
UTF-8
Java
8,439
java
NotationResourceIT.java
Java
[]
null
[]
package com.thepapyrusprint.backend.web.rest; import com.thepapyrusprint.backend.ThePapyrusPrintApp; import com.thepapyrusprint.backend.domain.Notation; import com.thepapyrusprint.backend.repository.NotationRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Integration tests for the {@link NotationResource} REST controller. */ @SpringBootTest(classes = ThePapyrusPrintApp.class) @AutoConfigureMockMvc @WithMockUser public class NotationResourceIT { private static final Float DEFAULT_NOTE = 1F; private static final Float UPDATED_NOTE = 2F; private static final String DEFAULT_OBSERVATION = "AAAAAAAAAA"; private static final String UPDATED_OBSERVATION = "BBBBBBBBBB"; @Autowired private NotationRepository notationRepository; @Autowired private EntityManager em; @Autowired private MockMvc restNotationMockMvc; private Notation notation; /** * Create an entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Notation createEntity(EntityManager em) { Notation notation = new Notation() .note(DEFAULT_NOTE) .observation(DEFAULT_OBSERVATION); return notation; } /** * Create an updated entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Notation createUpdatedEntity(EntityManager em) { Notation notation = new Notation() .note(UPDATED_NOTE) .observation(UPDATED_OBSERVATION); return notation; } @BeforeEach public void initTest() { notation = createEntity(em); } @Test @Transactional public void createNotation() throws Exception { int databaseSizeBeforeCreate = notationRepository.findAll().size(); // Create the Notation restNotationMockMvc.perform(post("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isCreated()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeCreate + 1); Notation testNotation = notationList.get(notationList.size() - 1); assertThat(testNotation.getNote()).isEqualTo(DEFAULT_NOTE); assertThat(testNotation.getObservation()).isEqualTo(DEFAULT_OBSERVATION); } @Test @Transactional public void createNotationWithExistingId() throws Exception { int databaseSizeBeforeCreate = notationRepository.findAll().size(); // Create the Notation with an existing ID notation.setId(1L); // An entity with an existing ID cannot be created, so this API call must fail restNotationMockMvc.perform(post("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isBadRequest()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void getAllNotations() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); // Get all the notationList restNotationMockMvc.perform(get("/api/notations?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(notation.getId().intValue()))) .andExpect(jsonPath("$.[*].note").value(hasItem(DEFAULT_NOTE.doubleValue()))) .andExpect(jsonPath("$.[*].observation").value(hasItem(DEFAULT_OBSERVATION))); } @Test @Transactional public void getNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); // Get the notation restNotationMockMvc.perform(get("/api/notations/{id}", notation.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.id").value(notation.getId().intValue())) .andExpect(jsonPath("$.note").value(DEFAULT_NOTE.doubleValue())) .andExpect(jsonPath("$.observation").value(DEFAULT_OBSERVATION)); } @Test @Transactional public void getNonExistingNotation() throws Exception { // Get the notation restNotationMockMvc.perform(get("/api/notations/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); int databaseSizeBeforeUpdate = notationRepository.findAll().size(); // Update the notation Notation updatedNotation = notationRepository.findById(notation.getId()).get(); // Disconnect from session so that the updates on updatedNotation are not directly saved in db em.detach(updatedNotation); updatedNotation .note(UPDATED_NOTE) .observation(UPDATED_OBSERVATION); restNotationMockMvc.perform(put("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(updatedNotation))) .andExpect(status().isOk()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeUpdate); Notation testNotation = notationList.get(notationList.size() - 1); assertThat(testNotation.getNote()).isEqualTo(UPDATED_NOTE); assertThat(testNotation.getObservation()).isEqualTo(UPDATED_OBSERVATION); } @Test @Transactional public void updateNonExistingNotation() throws Exception { int databaseSizeBeforeUpdate = notationRepository.findAll().size(); // Create the Notation // If the entity doesn't have an ID, it will throw BadRequestAlertException restNotationMockMvc.perform(put("/api/notations") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(notation))) .andExpect(status().isBadRequest()); // Validate the Notation in the database List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeUpdate); } @Test @Transactional public void deleteNotation() throws Exception { // Initialize the database notationRepository.saveAndFlush(notation); int databaseSizeBeforeDelete = notationRepository.findAll().size(); // Delete the notation restNotationMockMvc.perform(delete("/api/notations/{id}", notation.getId()) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()); // Validate the database contains one less item List<Notation> notationList = notationRepository.findAll(); assertThat(notationList).hasSize(databaseSizeBeforeDelete - 1); } }
8,439
0.694751
0.693921
221
37.18552
28.535395
102
false
false
0
0
0
0
0
0
0.357466
false
false
2
efa284dae26e71c83873ca548e27dff206e7c2bc
24,137,716,215,477
7afd71899884c2caf7ade8c8d842adbe95909cbf
/CursoDeJava/src/PesoIdeal.java
5c5e5d08b54d154c69f7f76e329fb3df501d6722
[]
no_license
Rodrigosaforcada/CursoDeJava
https://github.com/Rodrigosaforcada/CursoDeJava
4d6ea18f40fbc986084dd63fe18bb8a52a600d53
91cb4b53301a72bf97fb356a2dde3c57ad56487d
refs/heads/main
2023-08-27T16:11:22.590000
2021-10-21T02:09:29
2021-10-21T02:09:29
396,153,318
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Scanner; public class PesoIdeal { public static void main(String[] args) { System.out.println("Introduce la altura en centímetros de una persona: "); Scanner reader = new Scanner(System.in); int peso = reader.nextInt(); System.out.println("Introduce el género de la misma persona, 1 si es\n" + "mujer, 2 si es hombre: "); Scanner reader2 = new Scanner(System.in); int genero = reader2.nextInt(); if (genero == 1) { System.out.println("Su peso ideal es " + (peso - 120) + " kilogramos."); } else { System.out.println("Su peso ideal es " + (peso - 110) + " kilogramos."); } } }
UTF-8
Java
719
java
PesoIdeal.java
Java
[]
null
[]
import java.util.Scanner; public class PesoIdeal { public static void main(String[] args) { System.out.println("Introduce la altura en centímetros de una persona: "); Scanner reader = new Scanner(System.in); int peso = reader.nextInt(); System.out.println("Introduce el género de la misma persona, 1 si es\n" + "mujer, 2 si es hombre: "); Scanner reader2 = new Scanner(System.in); int genero = reader2.nextInt(); if (genero == 1) { System.out.println("Su peso ideal es " + (peso - 120) + " kilogramos."); } else { System.out.println("Su peso ideal es " + (peso - 110) + " kilogramos."); } } }
719
0.573222
0.55788
21
33.142857
29.176451
84
false
false
0
0
0
0
0
0
0.52381
false
false
2
3787483d1c53cd13edc9ff00be9d996352783b49
15,350,213,149,065
4fd3fd183e7d00a27dc8ea8a5470ec7a5f317f46
/fight/src/main/java/com/hellouxing/fight/activity/FightActivity.java
45a6e138d9603a5e2d55a7b22631d826a6c8cf63
[]
no_license
GPC-debug/andclient
https://github.com/GPC-debug/andclient
4c7699f767075474308489c70b735c0075307d81
655865cf90463cde50da08ccbf35d3ed613f8273
refs/heads/master
2020-08-07T19:33:05.724000
2019-10-08T06:09:39
2019-10-08T06:09:40
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hellouxing.fight.activity; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.Gravity; import android.view.View; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.easymi.component.base.RxBaseActivity; import com.easymi.component.utils.Log; import com.easymi.component.utils.ToastUtil; import com.easymi.component.widget.CusToolbar; import com.hellouxing.fight.R; import com.hellouxing.fight.entity.FightInfoEntity; import com.hellouxing.fight.widget.FightInfoPopupWindow; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import cn.addapp.pickers.picker.DatePicker; public class FightActivity extends RxBaseActivity { private TextView tvSelectTime; private TextView etFightNumber; private ImageView ivClean; private LinearLayout viewMain; private CusToolbar cusToolbar; private Context context; private FightInfoEntity event; @Override public boolean isEnableSwipe() { return false; } @Override public int getLayoutId() { return R.layout.activity_fight_number; } @Override public void initViews(Bundle savedInstanceState) { context = this; event = new FightInfoEntity(); tvSelectTime = findViewById(R.id.tv_act_fight_number_time); etFightNumber = findViewById(R.id.et_act_fight_number); ivClean = findViewById(R.id.iv_act_fight_number_clean); cusToolbar = findViewById(R.id.cus_toolbar); viewMain = findViewById(R.id.linearlayout); cusToolbar.setLeftBack(new View.OnClickListener() { @Override public void onClick(View view) { //创建Intent对象 Intent intent = new Intent(); //将求和的结果放进intent中 intent.putExtra("number", event.getNumber()); //返回结果 setResult(TransferMainActivity.REQUEST_FIGHT, intent); finish(); } }); cusToolbar.setTitle("航班"); onClick(); } @Override protected void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override protected void onStop() { super.onStop(); EventBus.getDefault().unregister(this); } @Override protected void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(FightInfoEntity event) { /* Do something */ this.event = event; } private void onClick() { etFightNumber.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if (!charSequence.equals("")) { ivClean.setVisibility(View.VISIBLE); } else { ivClean.setVisibility(View.INVISIBLE); } } @Override public void afterTextChanged(Editable editable) { } }); ivClean.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { etFightNumber.setText(""); ivClean.setVisibility(View.INVISIBLE); } }); tvSelectTime.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { showTime(viewMain); } }); } public void showTime(View view) { final DatePicker picker = new DatePicker(this); picker.setCanLoop(true); picker.setWheelModeEnable(true); picker.setTopPadding(15); picker.setRangeStart(2019, 8, 29); picker.setRangeEnd(2111, 1, 11); picker.setSelectedItem(2019, 10, 7); picker.setWeightEnable(true); picker.setLineColor(Color.BLACK); picker.setOnDatePickListener(new DatePicker.OnYearMonthDayPickListener() { @Override public void onDatePicked(String year, String month, String day) { ToastUtil.showMessage(context, year + "-" + month + "-" + day); tvSelectTime.setText(year + "-" + month + "-" + day); tvSelectTime.setTextColor(getResources().getColor(R.color.color_33)); showWindow(viewMain); } }); picker.setOnWheelListener(new DatePicker.OnWheelListener() { @Override public void onYearWheeled(int index, String year) { picker.setTitleText(year + "-" + picker.getSelectedMonth() + "-" + picker.getSelectedDay()); } @Override public void onMonthWheeled(int index, String month) { picker.setTitleText(picker.getSelectedYear() + "-" + month + "-" + picker.getSelectedDay()); } @Override public void onDayWheeled(int index, String day) { picker.setTitleText(picker.getSelectedYear() + "-" + picker.getSelectedMonth() + "-" + day); } }); picker.show(); } public void showWindow(View parentView) { FightInfoPopupWindow popupWindow = new FightInfoPopupWindow(context); setBackgroundAlpha(0.5f);//设置屏幕透明度 popupWindow.setFocusable(false);// 点击空白处时,隐藏掉pop窗口 popupWindow.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, 0, 0); } /** * 设置添加屏幕的背景透明度 * * @param bgAlpha 屏幕透明度0.0-1.0 1表示完全不透明 */ public void setBackgroundAlpha(float bgAlpha) { WindowManager.LayoutParams lp = getWindow() .getAttributes(); lp.alpha = bgAlpha; getWindow().setAttributes(lp); } }
UTF-8
Java
6,412
java
FightActivity.java
Java
[]
null
[]
package com.hellouxing.fight.activity; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.Gravity; import android.view.View; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.easymi.component.base.RxBaseActivity; import com.easymi.component.utils.Log; import com.easymi.component.utils.ToastUtil; import com.easymi.component.widget.CusToolbar; import com.hellouxing.fight.R; import com.hellouxing.fight.entity.FightInfoEntity; import com.hellouxing.fight.widget.FightInfoPopupWindow; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import cn.addapp.pickers.picker.DatePicker; public class FightActivity extends RxBaseActivity { private TextView tvSelectTime; private TextView etFightNumber; private ImageView ivClean; private LinearLayout viewMain; private CusToolbar cusToolbar; private Context context; private FightInfoEntity event; @Override public boolean isEnableSwipe() { return false; } @Override public int getLayoutId() { return R.layout.activity_fight_number; } @Override public void initViews(Bundle savedInstanceState) { context = this; event = new FightInfoEntity(); tvSelectTime = findViewById(R.id.tv_act_fight_number_time); etFightNumber = findViewById(R.id.et_act_fight_number); ivClean = findViewById(R.id.iv_act_fight_number_clean); cusToolbar = findViewById(R.id.cus_toolbar); viewMain = findViewById(R.id.linearlayout); cusToolbar.setLeftBack(new View.OnClickListener() { @Override public void onClick(View view) { //创建Intent对象 Intent intent = new Intent(); //将求和的结果放进intent中 intent.putExtra("number", event.getNumber()); //返回结果 setResult(TransferMainActivity.REQUEST_FIGHT, intent); finish(); } }); cusToolbar.setTitle("航班"); onClick(); } @Override protected void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override protected void onStop() { super.onStop(); EventBus.getDefault().unregister(this); } @Override protected void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(FightInfoEntity event) { /* Do something */ this.event = event; } private void onClick() { etFightNumber.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if (!charSequence.equals("")) { ivClean.setVisibility(View.VISIBLE); } else { ivClean.setVisibility(View.INVISIBLE); } } @Override public void afterTextChanged(Editable editable) { } }); ivClean.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { etFightNumber.setText(""); ivClean.setVisibility(View.INVISIBLE); } }); tvSelectTime.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { showTime(viewMain); } }); } public void showTime(View view) { final DatePicker picker = new DatePicker(this); picker.setCanLoop(true); picker.setWheelModeEnable(true); picker.setTopPadding(15); picker.setRangeStart(2019, 8, 29); picker.setRangeEnd(2111, 1, 11); picker.setSelectedItem(2019, 10, 7); picker.setWeightEnable(true); picker.setLineColor(Color.BLACK); picker.setOnDatePickListener(new DatePicker.OnYearMonthDayPickListener() { @Override public void onDatePicked(String year, String month, String day) { ToastUtil.showMessage(context, year + "-" + month + "-" + day); tvSelectTime.setText(year + "-" + month + "-" + day); tvSelectTime.setTextColor(getResources().getColor(R.color.color_33)); showWindow(viewMain); } }); picker.setOnWheelListener(new DatePicker.OnWheelListener() { @Override public void onYearWheeled(int index, String year) { picker.setTitleText(year + "-" + picker.getSelectedMonth() + "-" + picker.getSelectedDay()); } @Override public void onMonthWheeled(int index, String month) { picker.setTitleText(picker.getSelectedYear() + "-" + month + "-" + picker.getSelectedDay()); } @Override public void onDayWheeled(int index, String day) { picker.setTitleText(picker.getSelectedYear() + "-" + picker.getSelectedMonth() + "-" + day); } }); picker.show(); } public void showWindow(View parentView) { FightInfoPopupWindow popupWindow = new FightInfoPopupWindow(context); setBackgroundAlpha(0.5f);//设置屏幕透明度 popupWindow.setFocusable(false);// 点击空白处时,隐藏掉pop窗口 popupWindow.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, 0, 0); } /** * 设置添加屏幕的背景透明度 * * @param bgAlpha 屏幕透明度0.0-1.0 1表示完全不透明 */ public void setBackgroundAlpha(float bgAlpha) { WindowManager.LayoutParams lp = getWindow() .getAttributes(); lp.alpha = bgAlpha; getWindow().setAttributes(lp); } }
6,412
0.616412
0.610369
214
28.383177
24.707691
108
false
false
0
0
0
0
0
0
0.523364
false
false
2
acb20a2ac173d3a750e46ba189db9066c79cc525
23,184,233,505,288
31f194c8c897e025e01701ce35dc77dc5bfd275c
/L1J/src/com/lineage/server/model/item/etcitem/other/Kerosene.java
9d49df54a54bd948084086b8617503d6bb6d6212
[]
no_license
danceking/l1jcn-zwb
https://github.com/danceking/l1jcn-zwb
6404547566b63e0c0d6e510d45202bba78e010b6
d146a1807fc5b62632f35b87eaf500ecc6c902e9
refs/heads/master
2020-06-26T02:04:35.671000
2012-09-18T08:32:11
2012-09-18T08:32:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lineage.server.model.item.etcitem.other; import com.lineage.server.model.Instance.L1ItemInstance; import com.lineage.server.model.Instance.L1PcInstance; import com.lineage.server.model.item.ItemExecutor; import com.lineage.server.serverpackets.S_ItemName; import com.lineage.server.serverpackets.S_ServerMessage; /** * 灯油 - 40003 * * @author jrwz */ public class Kerosene implements ItemExecutor { public static ItemExecutor get() { return new Kerosene(); } private Kerosene() { } /** * 道具执行 * * @param data * 参数 * @param pc * 对象 * @param item * 道具 */ @Override public void execute(final int[] data, final L1PcInstance pc, final L1ItemInstance item) { for (final L1ItemInstance lightItem : pc.getInventory().getItems()) { if (lightItem.getItem().getItemId() == 40002) { // 灯笼 lightItem.setRemainingTime(item.getItem().getLightFuel()); pc.sendPackets(new S_ItemName(lightItem)); pc.sendPackets(new S_ServerMessage(230)); // 你在灯笼里加满了新的灯油。 break; } } pc.getInventory().removeItem(item, 1); } }
UTF-8
Java
1,358
java
Kerosene.java
Java
[ { "context": "verMessage;\r\n\r\n/**\r\n * 灯油 - 40003\r\n * \r\n * @author jrwz\r\n */\r\npublic class Kerosene implements ItemExecut", "end": 375, "score": 0.9996633529663086, "start": 371, "tag": "USERNAME", "value": "jrwz" } ]
null
[]
package com.lineage.server.model.item.etcitem.other; import com.lineage.server.model.Instance.L1ItemInstance; import com.lineage.server.model.Instance.L1PcInstance; import com.lineage.server.model.item.ItemExecutor; import com.lineage.server.serverpackets.S_ItemName; import com.lineage.server.serverpackets.S_ServerMessage; /** * 灯油 - 40003 * * @author jrwz */ public class Kerosene implements ItemExecutor { public static ItemExecutor get() { return new Kerosene(); } private Kerosene() { } /** * 道具执行 * * @param data * 参数 * @param pc * 对象 * @param item * 道具 */ @Override public void execute(final int[] data, final L1PcInstance pc, final L1ItemInstance item) { for (final L1ItemInstance lightItem : pc.getInventory().getItems()) { if (lightItem.getItem().getItemId() == 40002) { // 灯笼 lightItem.setRemainingTime(item.getItem().getLightFuel()); pc.sendPackets(new S_ItemName(lightItem)); pc.sendPackets(new S_ServerMessage(230)); // 你在灯笼里加满了新的灯油。 break; } } pc.getInventory().removeItem(item, 1); } }
1,358
0.578988
0.564417
47
25.74468
23.97913
77
false
false
0
0
0
0
0
0
0.319149
false
false
2
e60fd5caffc9419915adcfcc1a281a00e061e020
1,065,151,915,385
1ef497fef3ca2bd5981ff2a6d3b5df32a845ce85
/jadx-decompile/com/baidu/tts/client/model/RecordData.java
9473dd5e07bbbfe4d9dde1b0484baeea6faecb88
[]
no_license
gmtandi/droneapp
https://github.com/gmtandi/droneapp
624eeb8a77bbb6cbe3160d79d0c9b46e827e8f4f
bfacef0ef2cc43aded3e03c012debcee868706c5
refs/heads/master
2019-07-22T10:11:35.423000
2017-06-01T00:38:41
2017-06-01T00:38:41
92,822,587
5
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.baidu.tts.client.model; import com.baidu.tts.chainofresponsibility.logger.LoggerProxy; import com.baidu.tts.l.a; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.json.JSONException; import org.json.JSONObject; public class RecordData { ExecutorService a = Executors.newSingleThreadExecutor(); private a b; public class InsertData implements Callable<Integer> { final /* synthetic */ RecordData a; private JSONObject b; private String c; private String d; public InsertData(RecordData recordData, JSONObject jSONObject, String str, String str2) { this.a = recordData; this.b = jSONObject; this.c = str; this.d = str2; } public Integer call() { if (this.b == null && this.d == null) { this.a.b.c(this.c); } else { this.a.b.a(this.c, this.d, this.b.toString()); } return Integer.valueOf(0); } } public RecordData(a aVar) { this.b = aVar; } public void setEndInfo(String str, String str2, int i, String str3) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("modeId", str2); jSONObject.put("result", i); jSONObject.put("endTime", str3); LoggerProxy.d("RecordData", "EndInfo json= " + jSONObject.toString()); this.a.submit(new InsertData(this, jSONObject, str, "endInfo")); } catch (JSONException e) { e.printStackTrace(); } } public void setStartInfo(String str, String str2, String str3) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("startTime", str3); jSONObject.put("modeId", str2); LoggerProxy.d("RecordData", " StartInfo json= " + jSONObject.toString()); this.a.submit(new InsertData(this, null, str, null)); this.a.submit(new InsertData(this, jSONObject, str, "startInfo")); } catch (JSONException e) { e.printStackTrace(); } } }
UTF-8
Java
2,228
java
RecordData.java
Java
[]
null
[]
package com.baidu.tts.client.model; import com.baidu.tts.chainofresponsibility.logger.LoggerProxy; import com.baidu.tts.l.a; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.json.JSONException; import org.json.JSONObject; public class RecordData { ExecutorService a = Executors.newSingleThreadExecutor(); private a b; public class InsertData implements Callable<Integer> { final /* synthetic */ RecordData a; private JSONObject b; private String c; private String d; public InsertData(RecordData recordData, JSONObject jSONObject, String str, String str2) { this.a = recordData; this.b = jSONObject; this.c = str; this.d = str2; } public Integer call() { if (this.b == null && this.d == null) { this.a.b.c(this.c); } else { this.a.b.a(this.c, this.d, this.b.toString()); } return Integer.valueOf(0); } } public RecordData(a aVar) { this.b = aVar; } public void setEndInfo(String str, String str2, int i, String str3) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("modeId", str2); jSONObject.put("result", i); jSONObject.put("endTime", str3); LoggerProxy.d("RecordData", "EndInfo json= " + jSONObject.toString()); this.a.submit(new InsertData(this, jSONObject, str, "endInfo")); } catch (JSONException e) { e.printStackTrace(); } } public void setStartInfo(String str, String str2, String str3) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("startTime", str3); jSONObject.put("modeId", str2); LoggerProxy.d("RecordData", " StartInfo json= " + jSONObject.toString()); this.a.submit(new InsertData(this, null, str, null)); this.a.submit(new InsertData(this, jSONObject, str, "startInfo")); } catch (JSONException e) { e.printStackTrace(); } } }
2,228
0.587971
0.583034
67
32.253731
24.254461
98
false
false
0
0
0
0
0
0
0.925373
false
false
2
d46c2925f785b31cb4b7327a47c81acf60c1d91b
2,808,908,665,672
af31903a6cddb50b8ca8b2dffd7a37a4b1841b76
/Lab_5/src/main/java/ru/xorsiphus/dao/repositories/IBookDAO.java
aa87435ac118e0e09dad293cbc263c6603ee7e7b
[ "Apache-2.0" ]
permissive
Xorsiphus/JavaLabs
https://github.com/Xorsiphus/JavaLabs
3f260e2f69ee4e2e9f0ddb912d41bd61eb5c9d22
d2250f284f79eb56acca9f5b151fd76b68979e4d
refs/heads/master
2023-02-05T10:48:41.046000
2020-12-24T13:04:59
2020-12-24T13:04:59
294,879,268
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.xorsiphus.dao.repositories; import org.springframework.data.repository.NoRepositoryBean; import ru.xorsiphus.entity.IEntity; import java.util.List; import java.util.Optional; @NoRepositoryBean public interface IBookDAO <T extends IEntity> { List<T> findAll(); List<T> findByAuthor(String author); Optional<T> findById(int id); void updateById(int id, T books); void insert(T books); void removeById(int id); }
UTF-8
Java
448
java
IBookDAO.java
Java
[]
null
[]
package ru.xorsiphus.dao.repositories; import org.springframework.data.repository.NoRepositoryBean; import ru.xorsiphus.entity.IEntity; import java.util.List; import java.util.Optional; @NoRepositoryBean public interface IBookDAO <T extends IEntity> { List<T> findAll(); List<T> findByAuthor(String author); Optional<T> findById(int id); void updateById(int id, T books); void insert(T books); void removeById(int id); }
448
0.745536
0.745536
18
23.888889
17.358601
60
false
false
0
0
0
0
0
0
0.666667
false
false
2
313d030119a3c685c070a6657cfca00ccdfd6598
2,233,383,047,354
1a9757df82c1be01b38762e6fe5f7df53f0f6c4e
/app/src/main/java/com/example/i2iCell/WebService.java
f2f91d435282eff6a1bd80fc7d1757c5253fea90
[]
no_license
i2icell/Android_AysegulKarahancer
https://github.com/i2icell/Android_AysegulKarahancer
de79e95051d1bfe5595d59ea0abde1332d119164
30155bf78a24711ecef27048bf92527c31dbf2d9
refs/heads/master
2020-06-16T23:50:17.492000
2019-07-12T11:10:34
2019-07-12T11:10:34
195,735,429
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.i2iCell; import com.example.i2iCell.ui.login.User; import org.w3c.dom.Document; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class WebService { public class WebServiceClient { private final String LOGIN_SUCCESSFUL = "1"; private final String RETURN_PATTERN = "<ns:return>([^>]*)(?=.*</ns:return>)"; private final String RETURN_TAG_BEGIN = "<ns:return>"; private final String RETURN_TAG_END = "</ns:return"; public String requestFromUrl(String serviceUrlString) { StringBuilder responseStringBuilder = new StringBuilder(); URL serviceUrl; try { serviceUrl = new URL(serviceUrlString); URLConnection serviceConnection = serviceUrl.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(serviceConnection.getInputStream())); String lineOfResponse; while ((lineOfResponse = bufferedReader.readLine()) != null) { responseStringBuilder.append(lineOfResponse + "\n"); } bufferedReader.close(); } catch (Exception e) { //log.error("ERROR AT WEB SERVICE CLIENT - login method : " + e); } return responseStringBuilder.toString(); } private boolean getBooleanResultFromResponse(String response) { int beginIndex = response.indexOf(RETURN_TAG_BEGIN) + RETURN_TAG_BEGIN.length(); int endIndex = response.indexOf(RETURN_TAG_END); String result = response.substring(beginIndex, endIndex); if (result.equals(LOGIN_SUCCESSFUL)) return true; return false; } public String[] getStringResultFromResponse(String response) { int endIndex,beginIndex; Pattern pattern = Pattern.compile(RETURN_PATTERN); Matcher matcher = pattern.matcher(response); String resultWord = ""; String rawResult; while (matcher.find()) { rawResult = matcher.group(); beginIndex = rawResult.indexOf(RETURN_TAG_BEGIN ) + RETURN_TAG_BEGIN.length() ; if(rawResult.contains(RETURN_TAG_END)) { endIndex = rawResult.indexOf(RETURN_TAG_END); } else { endIndex = rawResult.length() ; } resultWord += rawResult.substring(beginIndex,endIndex) + ","; } String[] resultArray = resultWord.split(","); return resultArray; } public boolean login(String userName, String password) { String serviceUrlString = readServiceUrlFromFile("login"); serviceUrlString = serviceUrlString.replace("USERNAME", userName); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", password); if(getStringResultFromResponse(requestFromUrl(serviceUrlString))[0].equals(LOGIN_SUCCESSFUL) ) return true; return false; //return getSingleResultFromResponse(requestFromUrl(serviceUrlString)); } public String[] getBalances(String phoneNumber) { String serviceUrlString = readServiceUrlFromFile("getBalances"); serviceUrlString = serviceUrlString.replace("INPUTNUMBER", phoneNumber); String response = requestFromUrl(serviceUrlString); String[] balances = getStringResultFromResponse(response); return balances; } public boolean createUser(User user) { String serviceUrlString = readServiceUrlFromFile("createUser"); serviceUrlString = insertUserInputsToString(user, serviceUrlString); return getBooleanResultFromResponse(requestFromUrl(serviceUrlString)); } public boolean changePassword(User user) { String serviceUrlString = readServiceUrlFromFile("changePassword"); serviceUrlString = serviceUrlString.replace("TCNUMBERINPUT", user.getTcNumber()); serviceUrlString = serviceUrlString.replace("USERNAME", user.getPhoneNumber()); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", user.getPassword()); String response = requestFromUrl(serviceUrlString); return getBooleanResultFromResponse(response); } private String readServiceUrlFromFile(String webServiceName) { File file = new File("src/i2iCell//ServiceLinks.xml"); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder; try { documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(file); String urlString = document.getElementsByTagName(webServiceName).item(0).getTextContent(); return urlString; } catch (Exception e) { //log.error("Error while XML file reading: " + e); return null; } } private String insertUserInputsToString(User user, String serviceUrlString) { serviceUrlString = serviceUrlString.replace("FIRSTNAMEINPUT", user.getFirstName()); serviceUrlString = serviceUrlString.replace("LASTNAMEINPUT", user.getLastName()); serviceUrlString = serviceUrlString.replace("PHONENUMBERINPUT", user.getPhoneNumber()); serviceUrlString = serviceUrlString.replace("EMAILINPUT", user.getMail()); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", user.getPassword()); serviceUrlString = serviceUrlString.replace("BIRTHDAYINPUT", user.getBirthDate()); serviceUrlString = serviceUrlString.replace("TCNUMBERINPUT", user.getTcNumber()); return serviceUrlString; } } }
UTF-8
Java
6,333
java
WebService.java
Java
[ { "context": ";\n\n }\n\n\n public boolean login(String userName, String password) {\n\n\n String serviceU", "end": 2989, "score": 0.9957102537155151, "start": 2981, "tag": "USERNAME", "value": "userName" }, { "context": " serviceUrlString = serviceUrlString.replace(\"USERNAME\", userName);\n serviceUrlString = servi", "end": 3148, "score": 0.9916098713874817, "start": 3140, "tag": "USERNAME", "value": "USERNAME" }, { "context": "ceUrlString = serviceUrlString.replace(\"USERNAME\", userName);\n serviceUrlString = serviceUrlString", "end": 3159, "score": 0.9984242916107178, "start": 3151, "tag": "USERNAME", "value": "userName" }, { "context": " serviceUrlString = serviceUrlString.replace(\"USERNAME\", user.getPhoneNumber());\n serviceUrlS", "end": 4503, "score": 0.9608689546585083, "start": 4495, "tag": "USERNAME", "value": "USERNAME" } ]
null
[]
package com.example.i2iCell; import com.example.i2iCell.ui.login.User; import org.w3c.dom.Document; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class WebService { public class WebServiceClient { private final String LOGIN_SUCCESSFUL = "1"; private final String RETURN_PATTERN = "<ns:return>([^>]*)(?=.*</ns:return>)"; private final String RETURN_TAG_BEGIN = "<ns:return>"; private final String RETURN_TAG_END = "</ns:return"; public String requestFromUrl(String serviceUrlString) { StringBuilder responseStringBuilder = new StringBuilder(); URL serviceUrl; try { serviceUrl = new URL(serviceUrlString); URLConnection serviceConnection = serviceUrl.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(serviceConnection.getInputStream())); String lineOfResponse; while ((lineOfResponse = bufferedReader.readLine()) != null) { responseStringBuilder.append(lineOfResponse + "\n"); } bufferedReader.close(); } catch (Exception e) { //log.error("ERROR AT WEB SERVICE CLIENT - login method : " + e); } return responseStringBuilder.toString(); } private boolean getBooleanResultFromResponse(String response) { int beginIndex = response.indexOf(RETURN_TAG_BEGIN) + RETURN_TAG_BEGIN.length(); int endIndex = response.indexOf(RETURN_TAG_END); String result = response.substring(beginIndex, endIndex); if (result.equals(LOGIN_SUCCESSFUL)) return true; return false; } public String[] getStringResultFromResponse(String response) { int endIndex,beginIndex; Pattern pattern = Pattern.compile(RETURN_PATTERN); Matcher matcher = pattern.matcher(response); String resultWord = ""; String rawResult; while (matcher.find()) { rawResult = matcher.group(); beginIndex = rawResult.indexOf(RETURN_TAG_BEGIN ) + RETURN_TAG_BEGIN.length() ; if(rawResult.contains(RETURN_TAG_END)) { endIndex = rawResult.indexOf(RETURN_TAG_END); } else { endIndex = rawResult.length() ; } resultWord += rawResult.substring(beginIndex,endIndex) + ","; } String[] resultArray = resultWord.split(","); return resultArray; } public boolean login(String userName, String password) { String serviceUrlString = readServiceUrlFromFile("login"); serviceUrlString = serviceUrlString.replace("USERNAME", userName); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", password); if(getStringResultFromResponse(requestFromUrl(serviceUrlString))[0].equals(LOGIN_SUCCESSFUL) ) return true; return false; //return getSingleResultFromResponse(requestFromUrl(serviceUrlString)); } public String[] getBalances(String phoneNumber) { String serviceUrlString = readServiceUrlFromFile("getBalances"); serviceUrlString = serviceUrlString.replace("INPUTNUMBER", phoneNumber); String response = requestFromUrl(serviceUrlString); String[] balances = getStringResultFromResponse(response); return balances; } public boolean createUser(User user) { String serviceUrlString = readServiceUrlFromFile("createUser"); serviceUrlString = insertUserInputsToString(user, serviceUrlString); return getBooleanResultFromResponse(requestFromUrl(serviceUrlString)); } public boolean changePassword(User user) { String serviceUrlString = readServiceUrlFromFile("changePassword"); serviceUrlString = serviceUrlString.replace("TCNUMBERINPUT", user.getTcNumber()); serviceUrlString = serviceUrlString.replace("USERNAME", user.getPhoneNumber()); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", user.getPassword()); String response = requestFromUrl(serviceUrlString); return getBooleanResultFromResponse(response); } private String readServiceUrlFromFile(String webServiceName) { File file = new File("src/i2iCell//ServiceLinks.xml"); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder; try { documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(file); String urlString = document.getElementsByTagName(webServiceName).item(0).getTextContent(); return urlString; } catch (Exception e) { //log.error("Error while XML file reading: " + e); return null; } } private String insertUserInputsToString(User user, String serviceUrlString) { serviceUrlString = serviceUrlString.replace("FIRSTNAMEINPUT", user.getFirstName()); serviceUrlString = serviceUrlString.replace("LASTNAMEINPUT", user.getLastName()); serviceUrlString = serviceUrlString.replace("PHONENUMBERINPUT", user.getPhoneNumber()); serviceUrlString = serviceUrlString.replace("EMAILINPUT", user.getMail()); serviceUrlString = serviceUrlString.replace("PASSWORDINPUT", user.getPassword()); serviceUrlString = serviceUrlString.replace("BIRTHDAYINPUT", user.getBirthDate()); serviceUrlString = serviceUrlString.replace("TCNUMBERINPUT", user.getTcNumber()); return serviceUrlString; } } }
6,333
0.631928
0.630823
197
31.147207
33.953892
126
false
false
0
0
0
0
0
0
0.527919
false
false
2
b9dd59a7f02e08b25cd1c3aedf97a43b2e025ac3
21,844,203,732,521
b9f6ac2b41c2c09bc36fa7f0a5af9547718fda63
/src/main/java/blusunrize/immersiveengineering/common/util/compat/computercraft/PeripheralExcavator.java
bbee30414f84180fe79c2c6c9776a2ea18654ea6
[]
no_license
AmusedWraith/SteamvaniaImmersiveEngineering
https://github.com/AmusedWraith/SteamvaniaImmersiveEngineering
23e52dd31e1d6ef8819efc4c2878ade7e81ed7bf
322557823e33c517e9210d149f0138b7088a0218
refs/heads/master
2021-01-16T19:07:15.331000
2017-08-18T18:38:49
2017-08-18T18:38:49
100,139,446
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package blusunrize.immersiveengineering.common.util.compat.computercraft; import blusunrize.immersiveengineering.common.blocks.metal.TileEntityExcavator; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.world.World; public class PeripheralExcavator extends IEPeripheral { public static final String[] cmds = {"isActive", "setEnabled", "getEnergyStored", "getMaxEnergyStored"}; public PeripheralExcavator(World w, int _x, int _y, int _z) { super(w, _x, _y, _z); } @Override public String getType() { return "IE:excavator"; } @Override public String[] getMethodNames() { return cmds; } @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException { TileEntityExcavator te = (TileEntityExcavator) getTileEntity(TileEntityExcavator.class); if (te==null) throw new LuaException("The excavator was removed"); switch (method) { case 0://isActive return new Object[]{te.active}; case 1://setEnabled if (arguments.length!=1||!(arguments[0] instanceof Boolean)) throw new LuaException("Wrong amount of arguments, needs one boolean"); boolean on = (boolean)arguments[0]; te.computerOn = on; return null; case 2: //stored energy return new Object[]{te.energyStorage.getEnergyStored()}; case 3: //max energy return new Object[]{te.energyStorage.getMaxEnergyStored()}; } return null; } @Override public void attach(IComputerAccess computer) { TileEntityExcavator te = (TileEntityExcavator) w.getTileEntity(x, y, z); if (te==null) return; te.computerControlled = true; te.computerOn = true; } @Override public void detach(IComputerAccess computer) { TileEntityExcavator te = (TileEntityExcavator) w.getTileEntity(x, y, z); if (te==null) return; te.computerControlled = false; } @Override public boolean equals(IPeripheral other) { if (!(other instanceof PeripheralExcavator)) return false; PeripheralExcavator otherPer = (PeripheralExcavator) other; return w==otherPer.w&&x==otherPer.x&&y==otherPer.y&&z==otherPer.z; } }
UTF-8
Java
2,311
java
PeripheralExcavator.java
Java
[]
null
[]
package blusunrize.immersiveengineering.common.util.compat.computercraft; import blusunrize.immersiveengineering.common.blocks.metal.TileEntityExcavator; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.world.World; public class PeripheralExcavator extends IEPeripheral { public static final String[] cmds = {"isActive", "setEnabled", "getEnergyStored", "getMaxEnergyStored"}; public PeripheralExcavator(World w, int _x, int _y, int _z) { super(w, _x, _y, _z); } @Override public String getType() { return "IE:excavator"; } @Override public String[] getMethodNames() { return cmds; } @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException { TileEntityExcavator te = (TileEntityExcavator) getTileEntity(TileEntityExcavator.class); if (te==null) throw new LuaException("The excavator was removed"); switch (method) { case 0://isActive return new Object[]{te.active}; case 1://setEnabled if (arguments.length!=1||!(arguments[0] instanceof Boolean)) throw new LuaException("Wrong amount of arguments, needs one boolean"); boolean on = (boolean)arguments[0]; te.computerOn = on; return null; case 2: //stored energy return new Object[]{te.energyStorage.getEnergyStored()}; case 3: //max energy return new Object[]{te.energyStorage.getMaxEnergyStored()}; } return null; } @Override public void attach(IComputerAccess computer) { TileEntityExcavator te = (TileEntityExcavator) w.getTileEntity(x, y, z); if (te==null) return; te.computerControlled = true; te.computerOn = true; } @Override public void detach(IComputerAccess computer) { TileEntityExcavator te = (TileEntityExcavator) w.getTileEntity(x, y, z); if (te==null) return; te.computerControlled = false; } @Override public boolean equals(IPeripheral other) { if (!(other instanceof PeripheralExcavator)) return false; PeripheralExcavator otherPer = (PeripheralExcavator) other; return w==otherPer.w&&x==otherPer.x&&y==otherPer.y&&z==otherPer.z; } }
2,311
0.742968
0.734747
82
27.182926
27.465334
106
false
false
0
0
0
0
0
0
2
false
false
2
6c05fe96f49609c74c000478988176eb01da25b0
31,198,642,466,338
fe90aada0c6b1fa6d2f3a715d8a9fabe990bb690
/TentamenDranken20200316/src/model/Voorraad.java
7c89343aafa127858754b8e742f69c926a0d5c5f
[]
no_license
mPeltzerNovi/OefentenamenSlijterijOOP
https://github.com/mPeltzerNovi/OefentenamenSlijterijOOP
cd0ddc81ba973f8728fee3ee5421b36a9014fd95
53555f50a77c036b4a39eabe9f33a3914d41a229
refs/heads/main
2023-04-28T09:53:57.809000
2021-05-16T12:44:54
2021-05-16T12:44:54
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package model; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.time.LocalDate; import java.util.ArrayList; import java.util.Collections; public class Voorraad { private ArrayList<Drank> dranken; //default constructor voor Voorraad public Voorraad() { dranken = new ArrayList<>(); } //Methode om dranken toe te voegen --> steeds in de array stoppen. public void voegDrankToe(Drank drank) { dranken.add(drank); } //Later maken: //Methode voor printBewaarWijnen() //Stap 6: Implementeer de methode printBewaarwijnen public void printBewaarWijnen() { for (Drank drank : dranken) { if (drank instanceof Wijn) { Wijn wijn = (Wijn)drank; if (wijn.isBewaarWijn()) { System.out.println(wijn.toString()); System.out.println(); } } } } //Stap 7Methode voor printBedorvenDranken() met File maken in "resources" //met een try catch blok public void printBedorvenDranken() { try { File drankbestand = new File("resources/bedorvendrank.txt"); PrintWriter printWriter = new PrintWriter(drankbestand); for (Drank drank : dranken) { if (drank.bepaalHoudbaarTot().isBefore(LocalDate.now())) { printWriter.println(drank); printWriter.println(); } } printWriter.close(); } catch (IOException schrijffout) { //hier word "new Printwriter" ok System.out.println("Schrijven niet gelukt"); } } //toString voor een uitdraai van de voorraad; alfabetisch gesorteerd. //Stap 5 c. toString die de dranken output op alfabetische volgorde public String toString() { Collections.sort(dranken); StringBuilder builder = new StringBuilder(); for (Drank drank : dranken) { builder.append(drank.toString()); //(hier gaat die info uit de Drank-Constructor erin builder.append("\n\n"); } return builder.toString(); } }
UTF-8
Java
2,189
java
Voorraad.java
Java
[]
null
[]
package model; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.time.LocalDate; import java.util.ArrayList; import java.util.Collections; public class Voorraad { private ArrayList<Drank> dranken; //default constructor voor Voorraad public Voorraad() { dranken = new ArrayList<>(); } //Methode om dranken toe te voegen --> steeds in de array stoppen. public void voegDrankToe(Drank drank) { dranken.add(drank); } //Later maken: //Methode voor printBewaarWijnen() //Stap 6: Implementeer de methode printBewaarwijnen public void printBewaarWijnen() { for (Drank drank : dranken) { if (drank instanceof Wijn) { Wijn wijn = (Wijn)drank; if (wijn.isBewaarWijn()) { System.out.println(wijn.toString()); System.out.println(); } } } } //Stap 7Methode voor printBedorvenDranken() met File maken in "resources" //met een try catch blok public void printBedorvenDranken() { try { File drankbestand = new File("resources/bedorvendrank.txt"); PrintWriter printWriter = new PrintWriter(drankbestand); for (Drank drank : dranken) { if (drank.bepaalHoudbaarTot().isBefore(LocalDate.now())) { printWriter.println(drank); printWriter.println(); } } printWriter.close(); } catch (IOException schrijffout) { //hier word "new Printwriter" ok System.out.println("Schrijven niet gelukt"); } } //toString voor een uitdraai van de voorraad; alfabetisch gesorteerd. //Stap 5 c. toString die de dranken output op alfabetische volgorde public String toString() { Collections.sort(dranken); StringBuilder builder = new StringBuilder(); for (Drank drank : dranken) { builder.append(drank.toString()); //(hier gaat die info uit de Drank-Constructor erin builder.append("\n\n"); } return builder.toString(); } }
2,189
0.595249
0.593879
73
28.986301
24.036783
98
false
false
0
0
0
0
0
0
0.342466
false
false
2
8986eed5cdc3863e5c88e813b34e0228f2b914b6
31,980,326,556,083
a8c1dc2428da43c8ff52a0fab5cbbaa9e556909f
/src/main/java/org/kris/oilsimulation/model/Vector.java
4ce7b2da74a8ee78dd75903731d7b1123fadcd2a
[]
no_license
wojciechkumon/oil-simulation
https://github.com/wojciechkumon/oil-simulation
1d1739c6dd2891fac079e05ec0347616c90a93f3
ddc8262322188bf7f3cde2b23dd1d4fb39c6ebbe
refs/heads/master
2022-10-14T02:06:54.320000
2017-01-24T20:18:01
2019-08-20T18:14:42
203,428,258
0
0
null
false
2022-10-05T19:32:26
2019-08-20T18:02:29
2019-08-20T18:15:19
2022-10-05T19:32:23
6,717
0
0
4
Java
false
false
package org.kris.oilsimulation.model; public class Vector { private static final Vector ZERO_VECTOR = new Vector(0, 0); private final double x; private final double y; public Vector(double x, double y) { this.x = x; this.y = y; } public Vector add(Vector other) { return new Vector(x + other.x, y + other.y); } public Vector scalarMul(double scalar) { return new Vector(scalar * x, scalar * y); } public double getX() { return x; } public double getY() { return y; } public static Vector zeroVector() { return ZERO_VECTOR; } }
UTF-8
Java
592
java
Vector.java
Java
[]
null
[]
package org.kris.oilsimulation.model; public class Vector { private static final Vector ZERO_VECTOR = new Vector(0, 0); private final double x; private final double y; public Vector(double x, double y) { this.x = x; this.y = y; } public Vector add(Vector other) { return new Vector(x + other.x, y + other.y); } public Vector scalarMul(double scalar) { return new Vector(scalar * x, scalar * y); } public double getX() { return x; } public double getY() { return y; } public static Vector zeroVector() { return ZERO_VECTOR; } }
592
0.636824
0.633446
32
17.5
17.367355
61
false
false
0
0
0
0
0
0
0.46875
false
false
2
064ec9e1217e8a6d2f4dbebff4469feb510c6e22
19,782,619,367,516
d15f0d388d41e00f146e6c0d5c55e2282ada2af4
/LIgnorance/src/main/java/com/livelearn/ignorance/test/pulltorefreshwithloadmore/viewholder/TabIndicatorViewHolder.java
2ba265264836b8ad1e6a0cb743bc94c09f5efd16
[]
no_license
FPhoenixCorneaE/Ignorance
https://github.com/FPhoenixCorneaE/Ignorance
0ed600d128918c01590c4e236939e185a9d05bce
8737327768d1ab9e5010f6ecca0f3347bae7cbdd
refs/heads/master
2021-08-07T22:35:50.683000
2021-06-16T03:45:01
2021-06-16T03:45:01
95,649,709
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.livelearn.ignorance.test.pulltorefreshwithloadmore.viewholder; import android.view.LayoutInflater; import android.view.View; import android.widget.AbsListView; import android.widget.TextView; import com.livelearn.ignorance.R; import com.livelearn.ignorance.test.pulltorefreshwithloadmore.viewpager.TabPageIndicator; import com.livelearn.ignorance.utils.DisplayUtils; /** * Created on 2017/3/21. */ public class TabIndicatorViewHolder extends TabPageIndicator.ViewHolderBase { private TextView mNameView; private View mTagView; @Override public View createView(LayoutInflater layoutInflater, int position) { View view = layoutInflater.inflate(R.layout.item_tab_page_indicator, null); view.setLayoutParams(new AbsListView.LayoutParams(DisplayUtils.dp2px(40), -1)); mNameView = (TextView) view.findViewById(R.id.tv_tab_name); mTagView = view.findViewById(R.id.tv_current_tab); return view; } @Override public void updateView(int position, boolean isCurrent) { mNameView.setText(String.valueOf(position)); if (isCurrent) { mTagView.setVisibility(View.VISIBLE); } else { mTagView.setVisibility(View.INVISIBLE); } } }
UTF-8
Java
1,261
java
TabIndicatorViewHolder.java
Java
[]
null
[]
package com.livelearn.ignorance.test.pulltorefreshwithloadmore.viewholder; import android.view.LayoutInflater; import android.view.View; import android.widget.AbsListView; import android.widget.TextView; import com.livelearn.ignorance.R; import com.livelearn.ignorance.test.pulltorefreshwithloadmore.viewpager.TabPageIndicator; import com.livelearn.ignorance.utils.DisplayUtils; /** * Created on 2017/3/21. */ public class TabIndicatorViewHolder extends TabPageIndicator.ViewHolderBase { private TextView mNameView; private View mTagView; @Override public View createView(LayoutInflater layoutInflater, int position) { View view = layoutInflater.inflate(R.layout.item_tab_page_indicator, null); view.setLayoutParams(new AbsListView.LayoutParams(DisplayUtils.dp2px(40), -1)); mNameView = (TextView) view.findViewById(R.id.tv_tab_name); mTagView = view.findViewById(R.id.tv_current_tab); return view; } @Override public void updateView(int position, boolean isCurrent) { mNameView.setText(String.valueOf(position)); if (isCurrent) { mTagView.setVisibility(View.VISIBLE); } else { mTagView.setVisibility(View.INVISIBLE); } } }
1,261
0.727201
0.718477
39
31.333334
28.4617
89
false
false
0
0
0
0
0
0
0.564103
false
false
2
7200ca2a801e3b5eb0075f0b61b4da8832285e64
30,210,799,983,146
5c5b5f51110041f41757f2ce62c2b7e04de4644d
/src/Utils/Math/utilClass.java
1406ff33844ce98b9bada0aa8156eac42ddaa4be
[ "Apache-2.0" ]
permissive
kppomzh/ArrayList_Simulate_DB
https://github.com/kppomzh/ArrayList_Simulate_DB
203b6c90ad05f891d39074e8cba5a894b9395068
2924c729395e572df16e53052c721c32e34987d5
refs/heads/master
2021-10-02T19:23:59.091000
2018-11-30T09:54:26
2018-11-30T09:54:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Utils.Math; public class utilClass { public static Double Sqrt(Double x) { Double xhalf = 0.5f*x; Integer i = x.intValue(); // get bits for floating VALUE i = 0x5f375a86- (i>>1); // gives initial guess y0 x = i.doubleValue(); // convert bits BACK to float x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy //x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy return 1/x; } }
UTF-8
Java
567
java
utilClass.java
Java
[]
null
[]
package Utils.Math; public class utilClass { public static Double Sqrt(Double x) { Double xhalf = 0.5f*x; Integer i = x.intValue(); // get bits for floating VALUE i = 0x5f375a86- (i>>1); // gives initial guess y0 x = i.doubleValue(); // convert bits BACK to float x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy //x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy return 1/x; } }
567
0.597884
0.566138
16
34.4375
28.657393
78
false
false
0
0
0
0
0
0
0.75
false
false
2
778e56e52058699ea8e3e4d14f71db666cb2c053
30,210,799,983,253
3a40c38767c14b2033b4226a99701d0ac18a852c
/MiPractica/Esqueleto Traductor/src/parser/GrammarParser.java
b5a238a03c5f806e8e112a20bf55c8a3672e4875
[]
no_license
alexl0/DLP
https://github.com/alexl0/DLP
e721e3261f4da950daef517cb3643c04889be460
6181bf7cd9b7e2fd3ffcd25eaf29235afca64632
refs/heads/master
2023-08-31T18:20:54.623000
2021-10-14T09:40:43
2021-10-14T09:40:43
335,927,066
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// Generated from src\parser\Grammar.g4 by ANTLR 4.7.2 package parser; import ast.*; import ast.VarDefinition.VarScope; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; import java.util.Iterator; import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class GrammarParser extends Parser { static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, DATA=28, CODE=29, PRINT=30, INT=31, FLOAT=32, LITENT=33, LITREAL=34, LITCHAR=35, IDENT=36, PLUS=37, MULT=38, SUB=39, DIV=40, SEMICOLON=41, ASSIGN=42, OPEN_PAREN=43, CLOSE_PAREN=44, LINE_COMMENT=45, MULTILINE_COMMENT=46, WHITESPACE=47; public static final int RULE_start = 0, RULE_definitions = 1, RULE_definition = 2, RULE_sentencias = 3, RULE_sentencia = 4, RULE_exprs = 5, RULE_expr = 6, RULE_defVars = 7, RULE_defVar = 8, RULE_defStruct = 9, RULE_defFunc = 10, RULE_defWhile = 11, RULE_defIf = 12, RULE_type = 13, RULE_params = 14, RULE_param = 15, RULE_fields = 16; private static String[] makeRuleNames() { return new String[] { "start", "definitions", "definition", "sentencias", "sentencia", "exprs", "expr", "defVars", "defVar", "defStruct", "defFunc", "defWhile", "defIf", "type", "params", "param", "fields" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, "'read'", "'printsp'", "'println'", "'return'", "','", "'.'", "'['", "']'", "'<'", "'>'", "'!='", "'=='", "'>='", "'<='", "'&&'", "'||'", "'!'", "'''", "'var'", "':'", "'struct'", "'{'", "'}'", "'while'", "'if'", "'else'", "'char'", "'DATA'", "'CODE'", "'print'", "'int'", "'float'", null, null, null, null, "'+'", "'*'", "'-'", "'/'", "';'", "'='", "'('", "')'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "DATA", "CODE", "PRINT", "INT", "FLOAT", "LITENT", "LITREAL", "LITCHAR", "IDENT", "PLUS", "MULT", "SUB", "DIV", "SEMICOLON", "ASSIGN", "OPEN_PAREN", "CLOSE_PAREN", "LINE_COMMENT", "MULTILINE_COMMENT", "WHITESPACE" }; } 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; } @Override public String getGrammarFileName() { return "Grammar.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public ATN getATN() { return _ATN; } public GrammarParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } public static class StartContext extends ParserRuleContext { public Program ast; public DefinitionsContext definitions; public DefinitionsContext definitions() { return getRuleContext(DefinitionsContext.class,0); } public TerminalNode EOF() { return getToken(GrammarParser.EOF, 0); } public StartContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_start; } } public final StartContext start() throws RecognitionException { StartContext _localctx = new StartContext(_ctx, getState()); enterRule(_localctx, 0, RULE_start); try { enterOuterAlt(_localctx, 1); { setState(34); ((StartContext)_localctx).definitions = definitions(); ((StartContext)_localctx).ast = new Program(((StartContext)_localctx).definitions.list); setState(36); match(EOF); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefinitionsContext extends ParserRuleContext { public List<Definition> list = new ArrayList<Definition>();; public DefinitionContext definition; public List<DefinitionContext> definition() { return getRuleContexts(DefinitionContext.class); } public DefinitionContext definition(int i) { return getRuleContext(DefinitionContext.class,i); } public DefinitionsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_definitions; } } public final DefinitionsContext definitions() throws RecognitionException { DefinitionsContext _localctx = new DefinitionsContext(_ctx, getState()); enterRule(_localctx, 2, RULE_definitions); int _la; try { enterOuterAlt(_localctx, 1); { setState(41); _errHandler.sync(this); _la = _input.LA(1); do { { { setState(38); ((DefinitionsContext)_localctx).definition = definition(); _localctx.list.add(((DefinitionsContext)_localctx).definition.ast); } } setState(43); _errHandler.sync(this); _la = _input.LA(1); } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__18) | (1L << T__20) | (1L << IDENT))) != 0) ); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefinitionContext extends ParserRuleContext { public Definition ast; public DefVarContext defVar; public DefStructContext defStruct; public DefFuncContext defFunc; public DefVarContext defVar() { return getRuleContext(DefVarContext.class,0); } public DefStructContext defStruct() { return getRuleContext(DefStructContext.class,0); } public DefFuncContext defFunc() { return getRuleContext(DefFuncContext.class,0); } public DefinitionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_definition; } } public final DefinitionContext definition() throws RecognitionException { DefinitionContext _localctx = new DefinitionContext(_ctx, getState()); enterRule(_localctx, 4, RULE_definition); try { setState(54); _errHandler.sync(this); switch (_input.LA(1)) { case T__18: enterOuterAlt(_localctx, 1); { setState(45); ((DefinitionContext)_localctx).defVar = defVar(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defVar.ast; } break; case T__20: enterOuterAlt(_localctx, 2); { setState(48); ((DefinitionContext)_localctx).defStruct = defStruct(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defStruct.ast; } break; case IDENT: enterOuterAlt(_localctx, 3); { setState(51); ((DefinitionContext)_localctx).defFunc = defFunc(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defFunc.ast; } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class SentenciasContext extends ParserRuleContext { public List<Sentence> list = new ArrayList<>();; public SentenciaContext sentencia; public List<SentenciaContext> sentencia() { return getRuleContexts(SentenciaContext.class); } public SentenciaContext sentencia(int i) { return getRuleContext(SentenciaContext.class,i); } public SentenciasContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_sentencias; } } public final SentenciasContext sentencias() throws RecognitionException { SentenciasContext _localctx = new SentenciasContext(_ctx, getState()); enterRule(_localctx, 6, RULE_sentencias); int _la; try { enterOuterAlt(_localctx, 1); { setState(61); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__1) | (1L << T__2) | (1L << T__3) | (1L << T__8) | (1L << T__16) | (1L << T__17) | (1L << T__23) | (1L << T__24) | (1L << PRINT) | (1L << LITENT) | (1L << LITREAL) | (1L << LITCHAR) | (1L << IDENT) | (1L << OPEN_PAREN))) != 0)) { { { setState(56); ((SentenciasContext)_localctx).sentencia = sentencia(); _localctx.list.add(((SentenciasContext)_localctx).sentencia.ast); } } setState(63); _errHandler.sync(this); _la = _input.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class SentenciaContext extends ParserRuleContext { public Sentence ast; public ExprContext expr; public DefWhileContext defWhile; public DefIfContext defIf; public ExprContext l; public ExprContext r; public Token IDENT; public ExprsContext exprs; public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public TerminalNode PRINT() { return getToken(GrammarParser.PRINT, 0); } public DefWhileContext defWhile() { return getRuleContext(DefWhileContext.class,0); } public DefIfContext defIf() { return getRuleContext(DefIfContext.class,0); } public TerminalNode ASSIGN() { return getToken(GrammarParser.ASSIGN, 0); } public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprsContext exprs() { return getRuleContext(ExprsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public SentenciaContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_sentencia; } } public final SentenciaContext sentencia() throws RecognitionException { SentenciaContext _localctx = new SentenciaContext(_ctx, getState()); enterRule(_localctx, 8, RULE_sentencia); try { setState(114); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(64); match(T__0); setState(65); ((SentenciaContext)_localctx).expr = expr(0); setState(66); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Read(((SentenciaContext)_localctx).expr.ast); } break; case 2: enterOuterAlt(_localctx, 2); { setState(69); match(PRINT); setState(70); ((SentenciaContext)_localctx).expr = expr(0); setState(71); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Print(((SentenciaContext)_localctx).expr.ast); } break; case 3: enterOuterAlt(_localctx, 3); { setState(74); match(T__1); setState(75); ((SentenciaContext)_localctx).expr = expr(0); setState(76); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Printsp(((SentenciaContext)_localctx).expr.ast); } break; case 4: enterOuterAlt(_localctx, 4); { setState(79); match(T__2); setState(80); ((SentenciaContext)_localctx).expr = expr(0); setState(81); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Println(((SentenciaContext)_localctx).expr.ast); } break; case 5: enterOuterAlt(_localctx, 5); { setState(84); match(T__2); setState(85); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Println(new VoidConstant()); } break; case 6: enterOuterAlt(_localctx, 6); { setState(87); ((SentenciaContext)_localctx).defWhile = defWhile(); ((SentenciaContext)_localctx).ast = ((SentenciaContext)_localctx).defWhile.ast; } break; case 7: enterOuterAlt(_localctx, 7); { setState(90); ((SentenciaContext)_localctx).defIf = defIf(); ((SentenciaContext)_localctx).ast = ((SentenciaContext)_localctx).defIf.ast; } break; case 8: enterOuterAlt(_localctx, 8); { setState(93); ((SentenciaContext)_localctx).l = expr(0); setState(94); match(ASSIGN); setState(95); ((SentenciaContext)_localctx).r = expr(0); setState(96); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Assignment(((SentenciaContext)_localctx).l.ast, ((SentenciaContext)_localctx).r.ast); } break; case 9: enterOuterAlt(_localctx, 9); { setState(99); match(T__3); setState(100); ((SentenciaContext)_localctx).expr = expr(0); setState(101); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Return(((SentenciaContext)_localctx).expr.ast); } break; case 10: enterOuterAlt(_localctx, 10); { setState(104); match(T__3); setState(105); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Return(new VoidConstant()); } break; case 11: enterOuterAlt(_localctx, 11); { setState(107); ((SentenciaContext)_localctx).IDENT = match(IDENT); setState(108); match(OPEN_PAREN); setState(109); ((SentenciaContext)_localctx).exprs = exprs(); setState(110); match(CLOSE_PAREN); setState(111); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new FuncInvocation(((SentenciaContext)_localctx).IDENT, ((SentenciaContext)_localctx).exprs.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ExprsContext extends ParserRuleContext { public List<Expression> list = new ArrayList<Expression>(); public ExprContext expr; public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public ExprsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_exprs; } } public final ExprsContext exprs() throws RecognitionException { ExprsContext _localctx = new ExprsContext(_ctx, getState()); enterRule(_localctx, 10, RULE_exprs); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(128); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__8) | (1L << T__16) | (1L << T__17) | (1L << LITENT) | (1L << LITREAL) | (1L << LITCHAR) | (1L << IDENT) | (1L << OPEN_PAREN))) != 0)) { { setState(122); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(116); ((ExprsContext)_localctx).expr = expr(0); _localctx.list.add(((ExprsContext)_localctx).expr.ast); setState(118); match(T__4); } } } setState(124); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); } setState(125); ((ExprsContext)_localctx).expr = expr(0); _localctx.list.add(((ExprsContext)_localctx).expr.ast); } } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ExprContext extends ParserRuleContext { public Expression ast; public ExprContext e; public ExprContext e1; public ExprContext l; public Token IDENT; public Token LITENT; public Token LITREAL; public Token LITCHAR; public ExprsContext exprs; public ExprContext expr; public TypeContext type; public Token op; public ExprContext r; public ExprContext e2; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode LITENT() { return getToken(GrammarParser.LITENT, 0); } public TerminalNode LITREAL() { return getToken(GrammarParser.LITREAL, 0); } public TerminalNode LITCHAR() { return getToken(GrammarParser.LITCHAR, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprsContext exprs() { return getRuleContext(ExprsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode MULT() { return getToken(GrammarParser.MULT, 0); } public TerminalNode DIV() { return getToken(GrammarParser.DIV, 0); } public TerminalNode PLUS() { return getToken(GrammarParser.PLUS, 0); } public TerminalNode SUB() { return getToken(GrammarParser.SUB, 0); } public ExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_expr; } } public final ExprContext expr() throws RecognitionException { return expr(0); } private ExprContext expr(int _p) throws RecognitionException { ParserRuleContext _parentctx = _ctx; int _parentState = getState(); ExprContext _localctx = new ExprContext(_ctx, _parentState); ExprContext _prevctx = _localctx; int _startState = 12; enterRecursionRule(_localctx, 12, RULE_expr, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(165); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: { setState(131); ((ExprContext)_localctx).IDENT = match(IDENT); ((ExprContext)_localctx).ast = new Variable(((ExprContext)_localctx).IDENT); } break; case 2: { setState(133); ((ExprContext)_localctx).LITENT = match(LITENT); ((ExprContext)_localctx).ast = new IntConstant(((ExprContext)_localctx).LITENT); } break; case 3: { setState(135); ((ExprContext)_localctx).LITREAL = match(LITREAL); ((ExprContext)_localctx).ast = new RealConstant(((ExprContext)_localctx).LITREAL); } break; case 4: { setState(137); ((ExprContext)_localctx).LITCHAR = match(LITCHAR); ((ExprContext)_localctx).ast = new CharConstant(((ExprContext)_localctx).LITCHAR); } break; case 5: { setState(139); ((ExprContext)_localctx).IDENT = match(IDENT); setState(140); match(OPEN_PAREN); setState(141); ((ExprContext)_localctx).exprs = exprs(); setState(142); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = new FuncInvocationExpression(((ExprContext)_localctx).IDENT,((ExprContext)_localctx).exprs.list); } break; case 6: { setState(145); match(OPEN_PAREN); setState(146); ((ExprContext)_localctx).expr = expr(0); setState(147); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = ((ExprContext)_localctx).expr.ast; } break; case 7: { setState(150); match(T__8); setState(151); ((ExprContext)_localctx).type = type(); setState(152); match(T__9); setState(153); match(OPEN_PAREN); setState(154); ((ExprContext)_localctx).expr = expr(0); setState(155); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = new CastExpression(((ExprContext)_localctx).type.ast,((ExprContext)_localctx).expr.ast); } break; case 8: { setState(158); ((ExprContext)_localctx).op = match(T__16); setState(159); ((ExprContext)_localctx).expr = expr(2); ((ExprContext)_localctx).ast = new UnaryExpression(((ExprContext)_localctx).op,((ExprContext)_localctx).expr.ast); } break; case 9: { setState(162); match(T__17); setState(163); ((ExprContext)_localctx).IDENT = match(IDENT); setState(164); match(T__17); } break; } _ctx.stop = _input.LT(-1); setState(199); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,8,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { setState(197); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { case 1: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(167); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); setState(168); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==MULT || _la==DIV) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(169); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(9); ((ExprContext)_localctx).ast = new ArithmeticExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 2: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(172); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); setState(173); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==SUB) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(174); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(8); ((ExprContext)_localctx).ast = new ArithmeticExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 3: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(177); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); setState(178); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13))) != 0)) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(179); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(5); ((ExprContext)_localctx).ast = new ComparableExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 4: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(182); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); setState(183); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__14 || _la==T__15) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(184); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(4); ((ExprContext)_localctx).ast = new LogicalExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 5: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.e = _prevctx; _localctx.e = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(187); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); setState(188); match(T__5); setState(189); ((ExprContext)_localctx).IDENT = match(IDENT); ((ExprContext)_localctx).ast = new FieldAccessExpression(((ExprContext)_localctx).e.ast,((ExprContext)_localctx).IDENT); } break; case 6: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.e1 = _prevctx; _localctx.e1 = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(191); if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); setState(192); match(T__6); setState(193); ((ExprContext)_localctx).e2 = ((ExprContext)_localctx).expr = expr(0); setState(194); match(T__7); ((ExprContext)_localctx).ast = new IndexExpression(((ExprContext)_localctx).e1.ast,((ExprContext)_localctx).e2.ast); } break; } } } setState(201); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,8,_ctx); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { unrollRecursionContexts(_parentctx); } return _localctx; } public static class DefVarsContext extends ParserRuleContext { public List<Definition> list = new ArrayList<Definition>();; public Token IDENT; public TypeContext type; public List<TerminalNode> IDENT() { return getTokens(GrammarParser.IDENT); } public TerminalNode IDENT(int i) { return getToken(GrammarParser.IDENT, i); } public List<TypeContext> type() { return getRuleContexts(TypeContext.class); } public TypeContext type(int i) { return getRuleContext(TypeContext.class,i); } public List<TerminalNode> SEMICOLON() { return getTokens(GrammarParser.SEMICOLON); } public TerminalNode SEMICOLON(int i) { return getToken(GrammarParser.SEMICOLON, i); } public DefVarsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defVars; } } public final DefVarsContext defVars() throws RecognitionException { DefVarsContext _localctx = new DefVarsContext(_ctx, getState()); enterRule(_localctx, 14, RULE_defVars); int _la; try { enterOuterAlt(_localctx, 1); { setState(211); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__18) { { { setState(202); match(T__18); setState(203); ((DefVarsContext)_localctx).IDENT = match(IDENT); setState(204); match(T__19); setState(205); ((DefVarsContext)_localctx).type = type(); setState(206); match(SEMICOLON); _localctx.list.add(new VarDefinition(((DefVarsContext)_localctx).IDENT,((DefVarsContext)_localctx).type.ast,VarScope.LOCAL)); } } setState(213); _errHandler.sync(this); _la = _input.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefVarContext extends ParserRuleContext { public Definition ast; public Token IDENT; public TypeContext type; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public DefVarContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defVar; } } public final DefVarContext defVar() throws RecognitionException { DefVarContext _localctx = new DefVarContext(_ctx, getState()); enterRule(_localctx, 16, RULE_defVar); try { enterOuterAlt(_localctx, 1); { setState(214); match(T__18); setState(215); ((DefVarContext)_localctx).IDENT = match(IDENT); setState(216); match(T__19); setState(217); ((DefVarContext)_localctx).type = type(); setState(218); match(SEMICOLON); ((DefVarContext)_localctx).ast = new VarDefinition(((DefVarContext)_localctx).IDENT, ((DefVarContext)_localctx).type.ast, VarScope.GLOBAL); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefStructContext extends ParserRuleContext { public StructDefinition ast; public Token IDENT; public FieldsContext fields; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public FieldsContext fields() { return getRuleContext(FieldsContext.class,0); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public DefStructContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defStruct; } } public final DefStructContext defStruct() throws RecognitionException { DefStructContext _localctx = new DefStructContext(_ctx, getState()); enterRule(_localctx, 18, RULE_defStruct); try { enterOuterAlt(_localctx, 1); { setState(221); match(T__20); setState(222); ((DefStructContext)_localctx).IDENT = match(IDENT); setState(223); match(T__21); setState(224); ((DefStructContext)_localctx).fields = fields(); setState(225); match(T__22); setState(226); match(SEMICOLON); ((DefStructContext)_localctx).ast = new StructDefinition(new VarType(((DefStructContext)_localctx).IDENT),((DefStructContext)_localctx).fields.list); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefFuncContext extends ParserRuleContext { public FunDefinition ast; public Token IDENT; public ParamsContext params; public TypeContext type; public DefVarsContext defVars; public SentenciasContext sentencias; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ParamsContext params() { return getRuleContext(ParamsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public DefVarsContext defVars() { return getRuleContext(DefVarsContext.class,0); } public SentenciasContext sentencias() { return getRuleContext(SentenciasContext.class,0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public DefFuncContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defFunc; } } public final DefFuncContext defFunc() throws RecognitionException { DefFuncContext _localctx = new DefFuncContext(_ctx, getState()); enterRule(_localctx, 20, RULE_defFunc); try { setState(252); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(229); ((DefFuncContext)_localctx).IDENT = match(IDENT); setState(230); match(OPEN_PAREN); setState(231); ((DefFuncContext)_localctx).params = params(); setState(232); match(CLOSE_PAREN); { setState(233); match(T__19); setState(234); ((DefFuncContext)_localctx).type = type(); } setState(236); match(T__21); setState(237); ((DefFuncContext)_localctx).defVars = defVars(); setState(238); ((DefFuncContext)_localctx).sentencias = sentencias(); setState(239); match(T__22); ((DefFuncContext)_localctx).ast = new FunDefinition(((DefFuncContext)_localctx).IDENT, ((DefFuncContext)_localctx).params.list, ((DefFuncContext)_localctx).type.ast, ((DefFuncContext)_localctx).defVars.list, ((DefFuncContext)_localctx).sentencias.list); } break; case 2: enterOuterAlt(_localctx, 2); { setState(242); ((DefFuncContext)_localctx).IDENT = match(IDENT); setState(243); match(OPEN_PAREN); setState(244); ((DefFuncContext)_localctx).params = params(); setState(245); match(CLOSE_PAREN); setState(246); match(T__21); setState(247); ((DefFuncContext)_localctx).defVars = defVars(); setState(248); ((DefFuncContext)_localctx).sentencias = sentencias(); setState(249); match(T__22); ((DefFuncContext)_localctx).ast = new FunDefinition(((DefFuncContext)_localctx).IDENT, ((DefFuncContext)_localctx).params.list, new VoidType(), ((DefFuncContext)_localctx).defVars.list, ((DefFuncContext)_localctx).sentencias.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefWhileContext extends ParserRuleContext { public While ast; public ExprContext expr; public SentenciasContext sentencias; public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public SentenciasContext sentencias() { return getRuleContext(SentenciasContext.class,0); } public DefWhileContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defWhile; } } public final DefWhileContext defWhile() throws RecognitionException { DefWhileContext _localctx = new DefWhileContext(_ctx, getState()); enterRule(_localctx, 22, RULE_defWhile); try { enterOuterAlt(_localctx, 1); { setState(254); match(T__23); setState(255); match(OPEN_PAREN); setState(256); ((DefWhileContext)_localctx).expr = expr(0); setState(257); match(CLOSE_PAREN); setState(258); match(T__21); setState(259); ((DefWhileContext)_localctx).sentencias = sentencias(); setState(260); match(T__22); ((DefWhileContext)_localctx).ast = new While(((DefWhileContext)_localctx).expr.ast, ((DefWhileContext)_localctx).sentencias.list); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefIfContext extends ParserRuleContext { public IfElse ast; public ExprContext expr; public SentenciasContext sentencias; public SentenciasContext ifSentences; public SentenciasContext elseSentences; public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public List<SentenciasContext> sentencias() { return getRuleContexts(SentenciasContext.class); } public SentenciasContext sentencias(int i) { return getRuleContext(SentenciasContext.class,i); } public DefIfContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defIf; } } public final DefIfContext defIf() throws RecognitionException { DefIfContext _localctx = new DefIfContext(_ctx, getState()); enterRule(_localctx, 24, RULE_defIf); try { setState(285); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(263); match(T__24); setState(264); match(OPEN_PAREN); setState(265); ((DefIfContext)_localctx).expr = expr(0); setState(266); match(CLOSE_PAREN); setState(267); match(T__21); setState(268); ((DefIfContext)_localctx).sentencias = sentencias(); setState(269); match(T__22); ((DefIfContext)_localctx).ast = new IfElse(((DefIfContext)_localctx).expr.ast, ((DefIfContext)_localctx).sentencias.list, null); } break; case 2: enterOuterAlt(_localctx, 2); { setState(272); match(T__24); setState(273); match(OPEN_PAREN); setState(274); ((DefIfContext)_localctx).expr = expr(0); setState(275); match(CLOSE_PAREN); setState(276); match(T__21); setState(277); ((DefIfContext)_localctx).ifSentences = sentencias(); setState(278); match(T__22); setState(279); match(T__25); setState(280); match(T__21); setState(281); ((DefIfContext)_localctx).elseSentences = sentencias(); setState(282); match(T__22); ((DefIfContext)_localctx).ast = new IfElse(((DefIfContext)_localctx).expr.ast, ((DefIfContext)_localctx).ifSentences.list, ((DefIfContext)_localctx).elseSentences.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class TypeContext extends ParserRuleContext { public Type ast; public Token i; public Token f; public Token c; public Token LITENT; public TypeContext type; public Token IDENT; public TerminalNode INT() { return getToken(GrammarParser.INT, 0); } public TerminalNode FLOAT() { return getToken(GrammarParser.FLOAT, 0); } public TerminalNode LITENT() { return getToken(GrammarParser.LITENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_type; } } public final TypeContext type() throws RecognitionException { TypeContext _localctx = new TypeContext(_ctx, getState()); enterRule(_localctx, 26, RULE_type); try { setState(301); _errHandler.sync(this); switch (_input.LA(1)) { case INT: enterOuterAlt(_localctx, 1); { setState(287); ((TypeContext)_localctx).i = match(INT); ((TypeContext)_localctx).ast = new IntType(); _localctx.ast.setPositions(((TypeContext)_localctx).i); } break; case FLOAT: enterOuterAlt(_localctx, 2); { setState(289); ((TypeContext)_localctx).f = match(FLOAT); ((TypeContext)_localctx).ast = new RealType(); _localctx.ast.setPositions(((TypeContext)_localctx).f); } break; case T__26: enterOuterAlt(_localctx, 3); { setState(291); ((TypeContext)_localctx).c = match(T__26); ((TypeContext)_localctx).ast = new CharType(); _localctx.ast.setPositions(((TypeContext)_localctx).c); } break; case T__6: enterOuterAlt(_localctx, 4); { setState(293); match(T__6); setState(294); ((TypeContext)_localctx).LITENT = match(LITENT); setState(295); match(T__7); setState(296); ((TypeContext)_localctx).type = type(); ((TypeContext)_localctx).ast = new ArrayType(new IntConstant(((TypeContext)_localctx).LITENT), ((TypeContext)_localctx).type.ast); } break; case IDENT: enterOuterAlt(_localctx, 5); { setState(299); ((TypeContext)_localctx).IDENT = match(IDENT); ((TypeContext)_localctx).ast = new VarType(((TypeContext)_localctx).IDENT); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ParamsContext extends ParserRuleContext { public List<VarDefinition> list = new ArrayList<VarDefinition>(); public ParamContext param; public List<ParamContext> param() { return getRuleContexts(ParamContext.class); } public ParamContext param(int i) { return getRuleContext(ParamContext.class,i); } public ParamsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_params; } } public final ParamsContext params() throws RecognitionException { ParamsContext _localctx = new ParamsContext(_ctx, getState()); enterRule(_localctx, 28, RULE_params); try { int _alt; setState(316); _errHandler.sync(this); switch (_input.LA(1)) { case IDENT: enterOuterAlt(_localctx, 1); { setState(309); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(303); ((ParamsContext)_localctx).param = param(); _localctx.list.add(((ParamsContext)_localctx).param.ast); setState(305); match(T__4); } } } setState(311); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } setState(312); ((ParamsContext)_localctx).param = param(); _localctx.list.add(((ParamsContext)_localctx).param.ast); } break; case CLOSE_PAREN: enterOuterAlt(_localctx, 2); { } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ParamContext extends ParserRuleContext { public VarDefinition ast; public Token IDENT; public TypeContext type; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public ParamContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_param; } } public final ParamContext param() throws RecognitionException { ParamContext _localctx = new ParamContext(_ctx, getState()); enterRule(_localctx, 30, RULE_param); try { enterOuterAlt(_localctx, 1); { setState(318); ((ParamContext)_localctx).IDENT = match(IDENT); setState(319); match(T__19); setState(320); ((ParamContext)_localctx).type = type(); ((ParamContext)_localctx).ast = new VarDefinition(((ParamContext)_localctx).IDENT,((ParamContext)_localctx).type.ast,VarScope.PARAM); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class FieldsContext extends ParserRuleContext { public List<StructField> list = new ArrayList<StructField>();; public Token IDENT; public TypeContext type; public List<TerminalNode> IDENT() { return getTokens(GrammarParser.IDENT); } public TerminalNode IDENT(int i) { return getToken(GrammarParser.IDENT, i); } public List<TypeContext> type() { return getRuleContexts(TypeContext.class); } public TypeContext type(int i) { return getRuleContext(TypeContext.class,i); } public List<TerminalNode> SEMICOLON() { return getTokens(GrammarParser.SEMICOLON); } public TerminalNode SEMICOLON(int i) { return getToken(GrammarParser.SEMICOLON, i); } public FieldsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_fields; } } public final FieldsContext fields() throws RecognitionException { FieldsContext _localctx = new FieldsContext(_ctx, getState()); enterRule(_localctx, 32, RULE_fields); int _la; try { enterOuterAlt(_localctx, 1); { setState(329); _errHandler.sync(this); _la = _input.LA(1); do { { { setState(323); ((FieldsContext)_localctx).IDENT = match(IDENT); setState(324); match(T__19); setState(325); ((FieldsContext)_localctx).type = type(); setState(326); match(SEMICOLON); _localctx.list.add(new StructField(((FieldsContext)_localctx).IDENT,((FieldsContext)_localctx).type.ast)); } } setState(331); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==IDENT ); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { case 6: return expr_sempred((ExprContext)_localctx, predIndex); } return true; } private boolean expr_sempred(ExprContext _localctx, int predIndex) { switch (predIndex) { case 0: return precpred(_ctx, 8); case 1: return precpred(_ctx, 7); case 2: return precpred(_ctx, 4); case 3: return precpred(_ctx, 3); case 4: return precpred(_ctx, 10); case 5: return precpred(_ctx, 9); } return true; } public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\61\u0150\4\2\t\2"+ "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\3\2\3\2\3\2\3\2\3\3\3\3\3\3\6\3,\n\3\r\3\16\3-\3\4\3\4\3\4\3\4\3\4\3"+ "\4\3\4\3\4\3\4\5\49\n\4\3\5\3\5\3\5\7\5>\n\5\f\5\16\5A\13\5\3\6\3\6\3"+ "\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6"+ "\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3"+ "\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6u\n\6\3\7\3\7\3"+ "\7\3\7\7\7{\n\7\f\7\16\7~\13\7\3\7\3\7\3\7\5\7\u0083\n\7\3\b\3\b\3\b\3"+ "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b"+ "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u00a8\n\b"+ "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3"+ "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\7\b\u00c8\n\b\f\b\16"+ "\b\u00cb\13\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\7\t\u00d4\n\t\f\t\16\t\u00d7"+ "\13\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3"+ "\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3"+ "\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00ff\n\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3"+ "\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+ "\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0120\n\16\3\17\3\17"+ "\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\5\17\u0130"+ "\n\17\3\20\3\20\3\20\3\20\7\20\u0136\n\20\f\20\16\20\u0139\13\20\3\20"+ "\3\20\3\20\3\20\5\20\u013f\n\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22"+ "\3\22\3\22\3\22\6\22\u014c\n\22\r\22\16\22\u014d\3\22\2\3\16\23\2\4\6"+ "\b\n\f\16\20\22\24\26\30\32\34\36 \"\2\6\4\2((**\4\2\'\'))\3\2\13\20\3"+ "\2\21\22\2\u0166\2$\3\2\2\2\4+\3\2\2\2\68\3\2\2\2\b?\3\2\2\2\nt\3\2\2"+ "\2\f\u0082\3\2\2\2\16\u00a7\3\2\2\2\20\u00d5\3\2\2\2\22\u00d8\3\2\2\2"+ "\24\u00df\3\2\2\2\26\u00fe\3\2\2\2\30\u0100\3\2\2\2\32\u011f\3\2\2\2\34"+ "\u012f\3\2\2\2\36\u013e\3\2\2\2 \u0140\3\2\2\2\"\u014b\3\2\2\2$%\5\4\3"+ "\2%&\b\2\1\2&\'\7\2\2\3\'\3\3\2\2\2()\5\6\4\2)*\b\3\1\2*,\3\2\2\2+(\3"+ "\2\2\2,-\3\2\2\2-+\3\2\2\2-.\3\2\2\2.\5\3\2\2\2/\60\5\22\n\2\60\61\b\4"+ "\1\2\619\3\2\2\2\62\63\5\24\13\2\63\64\b\4\1\2\649\3\2\2\2\65\66\5\26"+ "\f\2\66\67\b\4\1\2\679\3\2\2\28/\3\2\2\28\62\3\2\2\28\65\3\2\2\29\7\3"+ "\2\2\2:;\5\n\6\2;<\b\5\1\2<>\3\2\2\2=:\3\2\2\2>A\3\2\2\2?=\3\2\2\2?@\3"+ "\2\2\2@\t\3\2\2\2A?\3\2\2\2BC\7\3\2\2CD\5\16\b\2DE\7+\2\2EF\b\6\1\2Fu"+ "\3\2\2\2GH\7 \2\2HI\5\16\b\2IJ\7+\2\2JK\b\6\1\2Ku\3\2\2\2LM\7\4\2\2MN"+ "\5\16\b\2NO\7+\2\2OP\b\6\1\2Pu\3\2\2\2QR\7\5\2\2RS\5\16\b\2ST\7+\2\2T"+ "U\b\6\1\2Uu\3\2\2\2VW\7\5\2\2WX\7+\2\2Xu\b\6\1\2YZ\5\30\r\2Z[\b\6\1\2"+ "[u\3\2\2\2\\]\5\32\16\2]^\b\6\1\2^u\3\2\2\2_`\5\16\b\2`a\7,\2\2ab\5\16"+ "\b\2bc\7+\2\2cd\b\6\1\2du\3\2\2\2ef\7\6\2\2fg\5\16\b\2gh\7+\2\2hi\b\6"+ "\1\2iu\3\2\2\2jk\7\6\2\2kl\7+\2\2lu\b\6\1\2mn\7&\2\2no\7-\2\2op\5\f\7"+ "\2pq\7.\2\2qr\7+\2\2rs\b\6\1\2su\3\2\2\2tB\3\2\2\2tG\3\2\2\2tL\3\2\2\2"+ "tQ\3\2\2\2tV\3\2\2\2tY\3\2\2\2t\\\3\2\2\2t_\3\2\2\2te\3\2\2\2tj\3\2\2"+ "\2tm\3\2\2\2u\13\3\2\2\2vw\5\16\b\2wx\b\7\1\2xy\7\7\2\2y{\3\2\2\2zv\3"+ "\2\2\2{~\3\2\2\2|z\3\2\2\2|}\3\2\2\2}\177\3\2\2\2~|\3\2\2\2\177\u0080"+ "\5\16\b\2\u0080\u0081\b\7\1\2\u0081\u0083\3\2\2\2\u0082|\3\2\2\2\u0082"+ "\u0083\3\2\2\2\u0083\r\3\2\2\2\u0084\u0085\b\b\1\2\u0085\u0086\7&\2\2"+ "\u0086\u00a8\b\b\1\2\u0087\u0088\7#\2\2\u0088\u00a8\b\b\1\2\u0089\u008a"+ "\7$\2\2\u008a\u00a8\b\b\1\2\u008b\u008c\7%\2\2\u008c\u00a8\b\b\1\2\u008d"+ "\u008e\7&\2\2\u008e\u008f\7-\2\2\u008f\u0090\5\f\7\2\u0090\u0091\7.\2"+ "\2\u0091\u0092\b\b\1\2\u0092\u00a8\3\2\2\2\u0093\u0094\7-\2\2\u0094\u0095"+ "\5\16\b\2\u0095\u0096\7.\2\2\u0096\u0097\b\b\1\2\u0097\u00a8\3\2\2\2\u0098"+ "\u0099\7\13\2\2\u0099\u009a\5\34\17\2\u009a\u009b\7\f\2\2\u009b\u009c"+ "\7-\2\2\u009c\u009d\5\16\b\2\u009d\u009e\7.\2\2\u009e\u009f\b\b\1\2\u009f"+ "\u00a8\3\2\2\2\u00a0\u00a1\7\23\2\2\u00a1\u00a2\5\16\b\4\u00a2\u00a3\b"+ "\b\1\2\u00a3\u00a8\3\2\2\2\u00a4\u00a5\7\24\2\2\u00a5\u00a6\7&\2\2\u00a6"+ "\u00a8\7\24\2\2\u00a7\u0084\3\2\2\2\u00a7\u0087\3\2\2\2\u00a7\u0089\3"+ "\2\2\2\u00a7\u008b\3\2\2\2\u00a7\u008d\3\2\2\2\u00a7\u0093\3\2\2\2\u00a7"+ "\u0098\3\2\2\2\u00a7\u00a0\3\2\2\2\u00a7\u00a4\3\2\2\2\u00a8\u00c9\3\2"+ "\2\2\u00a9\u00aa\f\n\2\2\u00aa\u00ab\t\2\2\2\u00ab\u00ac\5\16\b\13\u00ac"+ "\u00ad\b\b\1\2\u00ad\u00c8\3\2\2\2\u00ae\u00af\f\t\2\2\u00af\u00b0\t\3"+ "\2\2\u00b0\u00b1\5\16\b\n\u00b1\u00b2\b\b\1\2\u00b2\u00c8\3\2\2\2\u00b3"+ "\u00b4\f\6\2\2\u00b4\u00b5\t\4\2\2\u00b5\u00b6\5\16\b\7\u00b6\u00b7\b"+ "\b\1\2\u00b7\u00c8\3\2\2\2\u00b8\u00b9\f\5\2\2\u00b9\u00ba\t\5\2\2\u00ba"+ "\u00bb\5\16\b\6\u00bb\u00bc\b\b\1\2\u00bc\u00c8\3\2\2\2\u00bd\u00be\f"+ "\f\2\2\u00be\u00bf\7\b\2\2\u00bf\u00c0\7&\2\2\u00c0\u00c8\b\b\1\2\u00c1"+ "\u00c2\f\13\2\2\u00c2\u00c3\7\t\2\2\u00c3\u00c4\5\16\b\2\u00c4\u00c5\7"+ "\n\2\2\u00c5\u00c6\b\b\1\2\u00c6\u00c8\3\2\2\2\u00c7\u00a9\3\2\2\2\u00c7"+ "\u00ae\3\2\2\2\u00c7\u00b3\3\2\2\2\u00c7\u00b8\3\2\2\2\u00c7\u00bd\3\2"+ "\2\2\u00c7\u00c1\3\2\2\2\u00c8\u00cb\3\2\2\2\u00c9\u00c7\3\2\2\2\u00c9"+ "\u00ca\3\2\2\2\u00ca\17\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cc\u00cd\7\25\2"+ "\2\u00cd\u00ce\7&\2\2\u00ce\u00cf\7\26\2\2\u00cf\u00d0\5\34\17\2\u00d0"+ "\u00d1\7+\2\2\u00d1\u00d2\b\t\1\2\u00d2\u00d4\3\2\2\2\u00d3\u00cc\3\2"+ "\2\2\u00d4\u00d7\3\2\2\2\u00d5\u00d3\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6"+ "\21\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d8\u00d9\7\25\2\2\u00d9\u00da\7&\2"+ "\2\u00da\u00db\7\26\2\2\u00db\u00dc\5\34\17\2\u00dc\u00dd\7+\2\2\u00dd"+ "\u00de\b\n\1\2\u00de\23\3\2\2\2\u00df\u00e0\7\27\2\2\u00e0\u00e1\7&\2"+ "\2\u00e1\u00e2\7\30\2\2\u00e2\u00e3\5\"\22\2\u00e3\u00e4\7\31\2\2\u00e4"+ "\u00e5\7+\2\2\u00e5\u00e6\b\13\1\2\u00e6\25\3\2\2\2\u00e7\u00e8\7&\2\2"+ "\u00e8\u00e9\7-\2\2\u00e9\u00ea\5\36\20\2\u00ea\u00eb\7.\2\2\u00eb\u00ec"+ "\7\26\2\2\u00ec\u00ed\5\34\17\2\u00ed\u00ee\3\2\2\2\u00ee\u00ef\7\30\2"+ "\2\u00ef\u00f0\5\20\t\2\u00f0\u00f1\5\b\5\2\u00f1\u00f2\7\31\2\2\u00f2"+ "\u00f3\b\f\1\2\u00f3\u00ff\3\2\2\2\u00f4\u00f5\7&\2\2\u00f5\u00f6\7-\2"+ "\2\u00f6\u00f7\5\36\20\2\u00f7\u00f8\7.\2\2\u00f8\u00f9\7\30\2\2\u00f9"+ "\u00fa\5\20\t\2\u00fa\u00fb\5\b\5\2\u00fb\u00fc\7\31\2\2\u00fc\u00fd\b"+ "\f\1\2\u00fd\u00ff\3\2\2\2\u00fe\u00e7\3\2\2\2\u00fe\u00f4\3\2\2\2\u00ff"+ "\27\3\2\2\2\u0100\u0101\7\32\2\2\u0101\u0102\7-\2\2\u0102\u0103\5\16\b"+ "\2\u0103\u0104\7.\2\2\u0104\u0105\7\30\2\2\u0105\u0106\5\b\5\2\u0106\u0107"+ "\7\31\2\2\u0107\u0108\b\r\1\2\u0108\31\3\2\2\2\u0109\u010a\7\33\2\2\u010a"+ "\u010b\7-\2\2\u010b\u010c\5\16\b\2\u010c\u010d\7.\2\2\u010d\u010e\7\30"+ "\2\2\u010e\u010f\5\b\5\2\u010f\u0110\7\31\2\2\u0110\u0111\b\16\1\2\u0111"+ "\u0120\3\2\2\2\u0112\u0113\7\33\2\2\u0113\u0114\7-\2\2\u0114\u0115\5\16"+ "\b\2\u0115\u0116\7.\2\2\u0116\u0117\7\30\2\2\u0117\u0118\5\b\5\2\u0118"+ "\u0119\7\31\2\2\u0119\u011a\7\34\2\2\u011a\u011b\7\30\2\2\u011b\u011c"+ "\5\b\5\2\u011c\u011d\7\31\2\2\u011d\u011e\b\16\1\2\u011e\u0120\3\2\2\2"+ "\u011f\u0109\3\2\2\2\u011f\u0112\3\2\2\2\u0120\33\3\2\2\2\u0121\u0122"+ "\7!\2\2\u0122\u0130\b\17\1\2\u0123\u0124\7\"\2\2\u0124\u0130\b\17\1\2"+ "\u0125\u0126\7\35\2\2\u0126\u0130\b\17\1\2\u0127\u0128\7\t\2\2\u0128\u0129"+ "\7#\2\2\u0129\u012a\7\n\2\2\u012a\u012b\5\34\17\2\u012b\u012c\b\17\1\2"+ "\u012c\u0130\3\2\2\2\u012d\u012e\7&\2\2\u012e\u0130\b\17\1\2\u012f\u0121"+ "\3\2\2\2\u012f\u0123\3\2\2\2\u012f\u0125\3\2\2\2\u012f\u0127\3\2\2\2\u012f"+ "\u012d\3\2\2\2\u0130\35\3\2\2\2\u0131\u0132\5 \21\2\u0132\u0133\b\20\1"+ "\2\u0133\u0134\7\7\2\2\u0134\u0136\3\2\2\2\u0135\u0131\3\2\2\2\u0136\u0139"+ "\3\2\2\2\u0137\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u013a\3\2\2\2\u0139"+ "\u0137\3\2\2\2\u013a\u013b\5 \21\2\u013b\u013c\b\20\1\2\u013c\u013f\3"+ "\2\2\2\u013d\u013f\3\2\2\2\u013e\u0137\3\2\2\2\u013e\u013d\3\2\2\2\u013f"+ "\37\3\2\2\2\u0140\u0141\7&\2\2\u0141\u0142\7\26\2\2\u0142\u0143\5\34\17"+ "\2\u0143\u0144\b\21\1\2\u0144!\3\2\2\2\u0145\u0146\7&\2\2\u0146\u0147"+ "\7\26\2\2\u0147\u0148\5\34\17\2\u0148\u0149\7+\2\2\u0149\u014a\b\22\1"+ "\2\u014a\u014c\3\2\2\2\u014b\u0145\3\2\2\2\u014c\u014d\3\2\2\2\u014d\u014b"+ "\3\2\2\2\u014d\u014e\3\2\2\2\u014e#\3\2\2\2\22-8?t|\u0082\u00a7\u00c7"+ "\u00c9\u00d5\u00fe\u011f\u012f\u0137\u013e\u014d"; 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); } } }
UTF-8
Java
56,712
java
GrammarParser.java
Java
[]
null
[]
// Generated from src\parser\Grammar.g4 by ANTLR 4.7.2 package parser; import ast.*; import ast.VarDefinition.VarScope; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; import java.util.Iterator; import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class GrammarParser extends Parser { static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, DATA=28, CODE=29, PRINT=30, INT=31, FLOAT=32, LITENT=33, LITREAL=34, LITCHAR=35, IDENT=36, PLUS=37, MULT=38, SUB=39, DIV=40, SEMICOLON=41, ASSIGN=42, OPEN_PAREN=43, CLOSE_PAREN=44, LINE_COMMENT=45, MULTILINE_COMMENT=46, WHITESPACE=47; public static final int RULE_start = 0, RULE_definitions = 1, RULE_definition = 2, RULE_sentencias = 3, RULE_sentencia = 4, RULE_exprs = 5, RULE_expr = 6, RULE_defVars = 7, RULE_defVar = 8, RULE_defStruct = 9, RULE_defFunc = 10, RULE_defWhile = 11, RULE_defIf = 12, RULE_type = 13, RULE_params = 14, RULE_param = 15, RULE_fields = 16; private static String[] makeRuleNames() { return new String[] { "start", "definitions", "definition", "sentencias", "sentencia", "exprs", "expr", "defVars", "defVar", "defStruct", "defFunc", "defWhile", "defIf", "type", "params", "param", "fields" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, "'read'", "'printsp'", "'println'", "'return'", "','", "'.'", "'['", "']'", "'<'", "'>'", "'!='", "'=='", "'>='", "'<='", "'&&'", "'||'", "'!'", "'''", "'var'", "':'", "'struct'", "'{'", "'}'", "'while'", "'if'", "'else'", "'char'", "'DATA'", "'CODE'", "'print'", "'int'", "'float'", null, null, null, null, "'+'", "'*'", "'-'", "'/'", "';'", "'='", "'('", "')'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "DATA", "CODE", "PRINT", "INT", "FLOAT", "LITENT", "LITREAL", "LITCHAR", "IDENT", "PLUS", "MULT", "SUB", "DIV", "SEMICOLON", "ASSIGN", "OPEN_PAREN", "CLOSE_PAREN", "LINE_COMMENT", "MULTILINE_COMMENT", "WHITESPACE" }; } 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; } @Override public String getGrammarFileName() { return "Grammar.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public ATN getATN() { return _ATN; } public GrammarParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } public static class StartContext extends ParserRuleContext { public Program ast; public DefinitionsContext definitions; public DefinitionsContext definitions() { return getRuleContext(DefinitionsContext.class,0); } public TerminalNode EOF() { return getToken(GrammarParser.EOF, 0); } public StartContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_start; } } public final StartContext start() throws RecognitionException { StartContext _localctx = new StartContext(_ctx, getState()); enterRule(_localctx, 0, RULE_start); try { enterOuterAlt(_localctx, 1); { setState(34); ((StartContext)_localctx).definitions = definitions(); ((StartContext)_localctx).ast = new Program(((StartContext)_localctx).definitions.list); setState(36); match(EOF); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefinitionsContext extends ParserRuleContext { public List<Definition> list = new ArrayList<Definition>();; public DefinitionContext definition; public List<DefinitionContext> definition() { return getRuleContexts(DefinitionContext.class); } public DefinitionContext definition(int i) { return getRuleContext(DefinitionContext.class,i); } public DefinitionsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_definitions; } } public final DefinitionsContext definitions() throws RecognitionException { DefinitionsContext _localctx = new DefinitionsContext(_ctx, getState()); enterRule(_localctx, 2, RULE_definitions); int _la; try { enterOuterAlt(_localctx, 1); { setState(41); _errHandler.sync(this); _la = _input.LA(1); do { { { setState(38); ((DefinitionsContext)_localctx).definition = definition(); _localctx.list.add(((DefinitionsContext)_localctx).definition.ast); } } setState(43); _errHandler.sync(this); _la = _input.LA(1); } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__18) | (1L << T__20) | (1L << IDENT))) != 0) ); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefinitionContext extends ParserRuleContext { public Definition ast; public DefVarContext defVar; public DefStructContext defStruct; public DefFuncContext defFunc; public DefVarContext defVar() { return getRuleContext(DefVarContext.class,0); } public DefStructContext defStruct() { return getRuleContext(DefStructContext.class,0); } public DefFuncContext defFunc() { return getRuleContext(DefFuncContext.class,0); } public DefinitionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_definition; } } public final DefinitionContext definition() throws RecognitionException { DefinitionContext _localctx = new DefinitionContext(_ctx, getState()); enterRule(_localctx, 4, RULE_definition); try { setState(54); _errHandler.sync(this); switch (_input.LA(1)) { case T__18: enterOuterAlt(_localctx, 1); { setState(45); ((DefinitionContext)_localctx).defVar = defVar(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defVar.ast; } break; case T__20: enterOuterAlt(_localctx, 2); { setState(48); ((DefinitionContext)_localctx).defStruct = defStruct(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defStruct.ast; } break; case IDENT: enterOuterAlt(_localctx, 3); { setState(51); ((DefinitionContext)_localctx).defFunc = defFunc(); ((DefinitionContext)_localctx).ast = ((DefinitionContext)_localctx).defFunc.ast; } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class SentenciasContext extends ParserRuleContext { public List<Sentence> list = new ArrayList<>();; public SentenciaContext sentencia; public List<SentenciaContext> sentencia() { return getRuleContexts(SentenciaContext.class); } public SentenciaContext sentencia(int i) { return getRuleContext(SentenciaContext.class,i); } public SentenciasContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_sentencias; } } public final SentenciasContext sentencias() throws RecognitionException { SentenciasContext _localctx = new SentenciasContext(_ctx, getState()); enterRule(_localctx, 6, RULE_sentencias); int _la; try { enterOuterAlt(_localctx, 1); { setState(61); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__1) | (1L << T__2) | (1L << T__3) | (1L << T__8) | (1L << T__16) | (1L << T__17) | (1L << T__23) | (1L << T__24) | (1L << PRINT) | (1L << LITENT) | (1L << LITREAL) | (1L << LITCHAR) | (1L << IDENT) | (1L << OPEN_PAREN))) != 0)) { { { setState(56); ((SentenciasContext)_localctx).sentencia = sentencia(); _localctx.list.add(((SentenciasContext)_localctx).sentencia.ast); } } setState(63); _errHandler.sync(this); _la = _input.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class SentenciaContext extends ParserRuleContext { public Sentence ast; public ExprContext expr; public DefWhileContext defWhile; public DefIfContext defIf; public ExprContext l; public ExprContext r; public Token IDENT; public ExprsContext exprs; public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public TerminalNode PRINT() { return getToken(GrammarParser.PRINT, 0); } public DefWhileContext defWhile() { return getRuleContext(DefWhileContext.class,0); } public DefIfContext defIf() { return getRuleContext(DefIfContext.class,0); } public TerminalNode ASSIGN() { return getToken(GrammarParser.ASSIGN, 0); } public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprsContext exprs() { return getRuleContext(ExprsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public SentenciaContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_sentencia; } } public final SentenciaContext sentencia() throws RecognitionException { SentenciaContext _localctx = new SentenciaContext(_ctx, getState()); enterRule(_localctx, 8, RULE_sentencia); try { setState(114); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(64); match(T__0); setState(65); ((SentenciaContext)_localctx).expr = expr(0); setState(66); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Read(((SentenciaContext)_localctx).expr.ast); } break; case 2: enterOuterAlt(_localctx, 2); { setState(69); match(PRINT); setState(70); ((SentenciaContext)_localctx).expr = expr(0); setState(71); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Print(((SentenciaContext)_localctx).expr.ast); } break; case 3: enterOuterAlt(_localctx, 3); { setState(74); match(T__1); setState(75); ((SentenciaContext)_localctx).expr = expr(0); setState(76); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Printsp(((SentenciaContext)_localctx).expr.ast); } break; case 4: enterOuterAlt(_localctx, 4); { setState(79); match(T__2); setState(80); ((SentenciaContext)_localctx).expr = expr(0); setState(81); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Println(((SentenciaContext)_localctx).expr.ast); } break; case 5: enterOuterAlt(_localctx, 5); { setState(84); match(T__2); setState(85); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Println(new VoidConstant()); } break; case 6: enterOuterAlt(_localctx, 6); { setState(87); ((SentenciaContext)_localctx).defWhile = defWhile(); ((SentenciaContext)_localctx).ast = ((SentenciaContext)_localctx).defWhile.ast; } break; case 7: enterOuterAlt(_localctx, 7); { setState(90); ((SentenciaContext)_localctx).defIf = defIf(); ((SentenciaContext)_localctx).ast = ((SentenciaContext)_localctx).defIf.ast; } break; case 8: enterOuterAlt(_localctx, 8); { setState(93); ((SentenciaContext)_localctx).l = expr(0); setState(94); match(ASSIGN); setState(95); ((SentenciaContext)_localctx).r = expr(0); setState(96); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Assignment(((SentenciaContext)_localctx).l.ast, ((SentenciaContext)_localctx).r.ast); } break; case 9: enterOuterAlt(_localctx, 9); { setState(99); match(T__3); setState(100); ((SentenciaContext)_localctx).expr = expr(0); setState(101); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Return(((SentenciaContext)_localctx).expr.ast); } break; case 10: enterOuterAlt(_localctx, 10); { setState(104); match(T__3); setState(105); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new Return(new VoidConstant()); } break; case 11: enterOuterAlt(_localctx, 11); { setState(107); ((SentenciaContext)_localctx).IDENT = match(IDENT); setState(108); match(OPEN_PAREN); setState(109); ((SentenciaContext)_localctx).exprs = exprs(); setState(110); match(CLOSE_PAREN); setState(111); match(SEMICOLON); ((SentenciaContext)_localctx).ast = new FuncInvocation(((SentenciaContext)_localctx).IDENT, ((SentenciaContext)_localctx).exprs.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ExprsContext extends ParserRuleContext { public List<Expression> list = new ArrayList<Expression>(); public ExprContext expr; public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public ExprsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_exprs; } } public final ExprsContext exprs() throws RecognitionException { ExprsContext _localctx = new ExprsContext(_ctx, getState()); enterRule(_localctx, 10, RULE_exprs); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(128); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__8) | (1L << T__16) | (1L << T__17) | (1L << LITENT) | (1L << LITREAL) | (1L << LITCHAR) | (1L << IDENT) | (1L << OPEN_PAREN))) != 0)) { { setState(122); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(116); ((ExprsContext)_localctx).expr = expr(0); _localctx.list.add(((ExprsContext)_localctx).expr.ast); setState(118); match(T__4); } } } setState(124); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); } setState(125); ((ExprsContext)_localctx).expr = expr(0); _localctx.list.add(((ExprsContext)_localctx).expr.ast); } } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ExprContext extends ParserRuleContext { public Expression ast; public ExprContext e; public ExprContext e1; public ExprContext l; public Token IDENT; public Token LITENT; public Token LITREAL; public Token LITCHAR; public ExprsContext exprs; public ExprContext expr; public TypeContext type; public Token op; public ExprContext r; public ExprContext e2; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode LITENT() { return getToken(GrammarParser.LITENT, 0); } public TerminalNode LITREAL() { return getToken(GrammarParser.LITREAL, 0); } public TerminalNode LITCHAR() { return getToken(GrammarParser.LITCHAR, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprsContext exprs() { return getRuleContext(ExprsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public List<ExprContext> expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode MULT() { return getToken(GrammarParser.MULT, 0); } public TerminalNode DIV() { return getToken(GrammarParser.DIV, 0); } public TerminalNode PLUS() { return getToken(GrammarParser.PLUS, 0); } public TerminalNode SUB() { return getToken(GrammarParser.SUB, 0); } public ExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_expr; } } public final ExprContext expr() throws RecognitionException { return expr(0); } private ExprContext expr(int _p) throws RecognitionException { ParserRuleContext _parentctx = _ctx; int _parentState = getState(); ExprContext _localctx = new ExprContext(_ctx, _parentState); ExprContext _prevctx = _localctx; int _startState = 12; enterRecursionRule(_localctx, 12, RULE_expr, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(165); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: { setState(131); ((ExprContext)_localctx).IDENT = match(IDENT); ((ExprContext)_localctx).ast = new Variable(((ExprContext)_localctx).IDENT); } break; case 2: { setState(133); ((ExprContext)_localctx).LITENT = match(LITENT); ((ExprContext)_localctx).ast = new IntConstant(((ExprContext)_localctx).LITENT); } break; case 3: { setState(135); ((ExprContext)_localctx).LITREAL = match(LITREAL); ((ExprContext)_localctx).ast = new RealConstant(((ExprContext)_localctx).LITREAL); } break; case 4: { setState(137); ((ExprContext)_localctx).LITCHAR = match(LITCHAR); ((ExprContext)_localctx).ast = new CharConstant(((ExprContext)_localctx).LITCHAR); } break; case 5: { setState(139); ((ExprContext)_localctx).IDENT = match(IDENT); setState(140); match(OPEN_PAREN); setState(141); ((ExprContext)_localctx).exprs = exprs(); setState(142); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = new FuncInvocationExpression(((ExprContext)_localctx).IDENT,((ExprContext)_localctx).exprs.list); } break; case 6: { setState(145); match(OPEN_PAREN); setState(146); ((ExprContext)_localctx).expr = expr(0); setState(147); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = ((ExprContext)_localctx).expr.ast; } break; case 7: { setState(150); match(T__8); setState(151); ((ExprContext)_localctx).type = type(); setState(152); match(T__9); setState(153); match(OPEN_PAREN); setState(154); ((ExprContext)_localctx).expr = expr(0); setState(155); match(CLOSE_PAREN); ((ExprContext)_localctx).ast = new CastExpression(((ExprContext)_localctx).type.ast,((ExprContext)_localctx).expr.ast); } break; case 8: { setState(158); ((ExprContext)_localctx).op = match(T__16); setState(159); ((ExprContext)_localctx).expr = expr(2); ((ExprContext)_localctx).ast = new UnaryExpression(((ExprContext)_localctx).op,((ExprContext)_localctx).expr.ast); } break; case 9: { setState(162); match(T__17); setState(163); ((ExprContext)_localctx).IDENT = match(IDENT); setState(164); match(T__17); } break; } _ctx.stop = _input.LT(-1); setState(199); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,8,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { setState(197); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { case 1: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(167); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); setState(168); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==MULT || _la==DIV) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(169); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(9); ((ExprContext)_localctx).ast = new ArithmeticExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 2: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(172); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); setState(173); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==SUB) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(174); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(8); ((ExprContext)_localctx).ast = new ArithmeticExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 3: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(177); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); setState(178); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13))) != 0)) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(179); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(5); ((ExprContext)_localctx).ast = new ComparableExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 4: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.l = _prevctx; _localctx.l = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(182); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); setState(183); ((ExprContext)_localctx).op = _input.LT(1); _la = _input.LA(1); if ( !(_la==T__14 || _la==T__15) ) { ((ExprContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(184); ((ExprContext)_localctx).r = ((ExprContext)_localctx).expr = expr(4); ((ExprContext)_localctx).ast = new LogicalExpression(((ExprContext)_localctx).l.ast,((ExprContext)_localctx).op,((ExprContext)_localctx).r.ast); } break; case 5: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.e = _prevctx; _localctx.e = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(187); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); setState(188); match(T__5); setState(189); ((ExprContext)_localctx).IDENT = match(IDENT); ((ExprContext)_localctx).ast = new FieldAccessExpression(((ExprContext)_localctx).e.ast,((ExprContext)_localctx).IDENT); } break; case 6: { _localctx = new ExprContext(_parentctx, _parentState); _localctx.e1 = _prevctx; _localctx.e1 = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_expr); setState(191); if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); setState(192); match(T__6); setState(193); ((ExprContext)_localctx).e2 = ((ExprContext)_localctx).expr = expr(0); setState(194); match(T__7); ((ExprContext)_localctx).ast = new IndexExpression(((ExprContext)_localctx).e1.ast,((ExprContext)_localctx).e2.ast); } break; } } } setState(201); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,8,_ctx); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { unrollRecursionContexts(_parentctx); } return _localctx; } public static class DefVarsContext extends ParserRuleContext { public List<Definition> list = new ArrayList<Definition>();; public Token IDENT; public TypeContext type; public List<TerminalNode> IDENT() { return getTokens(GrammarParser.IDENT); } public TerminalNode IDENT(int i) { return getToken(GrammarParser.IDENT, i); } public List<TypeContext> type() { return getRuleContexts(TypeContext.class); } public TypeContext type(int i) { return getRuleContext(TypeContext.class,i); } public List<TerminalNode> SEMICOLON() { return getTokens(GrammarParser.SEMICOLON); } public TerminalNode SEMICOLON(int i) { return getToken(GrammarParser.SEMICOLON, i); } public DefVarsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defVars; } } public final DefVarsContext defVars() throws RecognitionException { DefVarsContext _localctx = new DefVarsContext(_ctx, getState()); enterRule(_localctx, 14, RULE_defVars); int _la; try { enterOuterAlt(_localctx, 1); { setState(211); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__18) { { { setState(202); match(T__18); setState(203); ((DefVarsContext)_localctx).IDENT = match(IDENT); setState(204); match(T__19); setState(205); ((DefVarsContext)_localctx).type = type(); setState(206); match(SEMICOLON); _localctx.list.add(new VarDefinition(((DefVarsContext)_localctx).IDENT,((DefVarsContext)_localctx).type.ast,VarScope.LOCAL)); } } setState(213); _errHandler.sync(this); _la = _input.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefVarContext extends ParserRuleContext { public Definition ast; public Token IDENT; public TypeContext type; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public DefVarContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defVar; } } public final DefVarContext defVar() throws RecognitionException { DefVarContext _localctx = new DefVarContext(_ctx, getState()); enterRule(_localctx, 16, RULE_defVar); try { enterOuterAlt(_localctx, 1); { setState(214); match(T__18); setState(215); ((DefVarContext)_localctx).IDENT = match(IDENT); setState(216); match(T__19); setState(217); ((DefVarContext)_localctx).type = type(); setState(218); match(SEMICOLON); ((DefVarContext)_localctx).ast = new VarDefinition(((DefVarContext)_localctx).IDENT, ((DefVarContext)_localctx).type.ast, VarScope.GLOBAL); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefStructContext extends ParserRuleContext { public StructDefinition ast; public Token IDENT; public FieldsContext fields; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public FieldsContext fields() { return getRuleContext(FieldsContext.class,0); } public TerminalNode SEMICOLON() { return getToken(GrammarParser.SEMICOLON, 0); } public DefStructContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defStruct; } } public final DefStructContext defStruct() throws RecognitionException { DefStructContext _localctx = new DefStructContext(_ctx, getState()); enterRule(_localctx, 18, RULE_defStruct); try { enterOuterAlt(_localctx, 1); { setState(221); match(T__20); setState(222); ((DefStructContext)_localctx).IDENT = match(IDENT); setState(223); match(T__21); setState(224); ((DefStructContext)_localctx).fields = fields(); setState(225); match(T__22); setState(226); match(SEMICOLON); ((DefStructContext)_localctx).ast = new StructDefinition(new VarType(((DefStructContext)_localctx).IDENT),((DefStructContext)_localctx).fields.list); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefFuncContext extends ParserRuleContext { public FunDefinition ast; public Token IDENT; public ParamsContext params; public TypeContext type; public DefVarsContext defVars; public SentenciasContext sentencias; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ParamsContext params() { return getRuleContext(ParamsContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public DefVarsContext defVars() { return getRuleContext(DefVarsContext.class,0); } public SentenciasContext sentencias() { return getRuleContext(SentenciasContext.class,0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public DefFuncContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defFunc; } } public final DefFuncContext defFunc() throws RecognitionException { DefFuncContext _localctx = new DefFuncContext(_ctx, getState()); enterRule(_localctx, 20, RULE_defFunc); try { setState(252); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(229); ((DefFuncContext)_localctx).IDENT = match(IDENT); setState(230); match(OPEN_PAREN); setState(231); ((DefFuncContext)_localctx).params = params(); setState(232); match(CLOSE_PAREN); { setState(233); match(T__19); setState(234); ((DefFuncContext)_localctx).type = type(); } setState(236); match(T__21); setState(237); ((DefFuncContext)_localctx).defVars = defVars(); setState(238); ((DefFuncContext)_localctx).sentencias = sentencias(); setState(239); match(T__22); ((DefFuncContext)_localctx).ast = new FunDefinition(((DefFuncContext)_localctx).IDENT, ((DefFuncContext)_localctx).params.list, ((DefFuncContext)_localctx).type.ast, ((DefFuncContext)_localctx).defVars.list, ((DefFuncContext)_localctx).sentencias.list); } break; case 2: enterOuterAlt(_localctx, 2); { setState(242); ((DefFuncContext)_localctx).IDENT = match(IDENT); setState(243); match(OPEN_PAREN); setState(244); ((DefFuncContext)_localctx).params = params(); setState(245); match(CLOSE_PAREN); setState(246); match(T__21); setState(247); ((DefFuncContext)_localctx).defVars = defVars(); setState(248); ((DefFuncContext)_localctx).sentencias = sentencias(); setState(249); match(T__22); ((DefFuncContext)_localctx).ast = new FunDefinition(((DefFuncContext)_localctx).IDENT, ((DefFuncContext)_localctx).params.list, new VoidType(), ((DefFuncContext)_localctx).defVars.list, ((DefFuncContext)_localctx).sentencias.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefWhileContext extends ParserRuleContext { public While ast; public ExprContext expr; public SentenciasContext sentencias; public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public SentenciasContext sentencias() { return getRuleContext(SentenciasContext.class,0); } public DefWhileContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defWhile; } } public final DefWhileContext defWhile() throws RecognitionException { DefWhileContext _localctx = new DefWhileContext(_ctx, getState()); enterRule(_localctx, 22, RULE_defWhile); try { enterOuterAlt(_localctx, 1); { setState(254); match(T__23); setState(255); match(OPEN_PAREN); setState(256); ((DefWhileContext)_localctx).expr = expr(0); setState(257); match(CLOSE_PAREN); setState(258); match(T__21); setState(259); ((DefWhileContext)_localctx).sentencias = sentencias(); setState(260); match(T__22); ((DefWhileContext)_localctx).ast = new While(((DefWhileContext)_localctx).expr.ast, ((DefWhileContext)_localctx).sentencias.list); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DefIfContext extends ParserRuleContext { public IfElse ast; public ExprContext expr; public SentenciasContext sentencias; public SentenciasContext ifSentences; public SentenciasContext elseSentences; public TerminalNode OPEN_PAREN() { return getToken(GrammarParser.OPEN_PAREN, 0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } public TerminalNode CLOSE_PAREN() { return getToken(GrammarParser.CLOSE_PAREN, 0); } public List<SentenciasContext> sentencias() { return getRuleContexts(SentenciasContext.class); } public SentenciasContext sentencias(int i) { return getRuleContext(SentenciasContext.class,i); } public DefIfContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_defIf; } } public final DefIfContext defIf() throws RecognitionException { DefIfContext _localctx = new DefIfContext(_ctx, getState()); enterRule(_localctx, 24, RULE_defIf); try { setState(285); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { setState(263); match(T__24); setState(264); match(OPEN_PAREN); setState(265); ((DefIfContext)_localctx).expr = expr(0); setState(266); match(CLOSE_PAREN); setState(267); match(T__21); setState(268); ((DefIfContext)_localctx).sentencias = sentencias(); setState(269); match(T__22); ((DefIfContext)_localctx).ast = new IfElse(((DefIfContext)_localctx).expr.ast, ((DefIfContext)_localctx).sentencias.list, null); } break; case 2: enterOuterAlt(_localctx, 2); { setState(272); match(T__24); setState(273); match(OPEN_PAREN); setState(274); ((DefIfContext)_localctx).expr = expr(0); setState(275); match(CLOSE_PAREN); setState(276); match(T__21); setState(277); ((DefIfContext)_localctx).ifSentences = sentencias(); setState(278); match(T__22); setState(279); match(T__25); setState(280); match(T__21); setState(281); ((DefIfContext)_localctx).elseSentences = sentencias(); setState(282); match(T__22); ((DefIfContext)_localctx).ast = new IfElse(((DefIfContext)_localctx).expr.ast, ((DefIfContext)_localctx).ifSentences.list, ((DefIfContext)_localctx).elseSentences.list); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class TypeContext extends ParserRuleContext { public Type ast; public Token i; public Token f; public Token c; public Token LITENT; public TypeContext type; public Token IDENT; public TerminalNode INT() { return getToken(GrammarParser.INT, 0); } public TerminalNode FLOAT() { return getToken(GrammarParser.FLOAT, 0); } public TerminalNode LITENT() { return getToken(GrammarParser.LITENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_type; } } public final TypeContext type() throws RecognitionException { TypeContext _localctx = new TypeContext(_ctx, getState()); enterRule(_localctx, 26, RULE_type); try { setState(301); _errHandler.sync(this); switch (_input.LA(1)) { case INT: enterOuterAlt(_localctx, 1); { setState(287); ((TypeContext)_localctx).i = match(INT); ((TypeContext)_localctx).ast = new IntType(); _localctx.ast.setPositions(((TypeContext)_localctx).i); } break; case FLOAT: enterOuterAlt(_localctx, 2); { setState(289); ((TypeContext)_localctx).f = match(FLOAT); ((TypeContext)_localctx).ast = new RealType(); _localctx.ast.setPositions(((TypeContext)_localctx).f); } break; case T__26: enterOuterAlt(_localctx, 3); { setState(291); ((TypeContext)_localctx).c = match(T__26); ((TypeContext)_localctx).ast = new CharType(); _localctx.ast.setPositions(((TypeContext)_localctx).c); } break; case T__6: enterOuterAlt(_localctx, 4); { setState(293); match(T__6); setState(294); ((TypeContext)_localctx).LITENT = match(LITENT); setState(295); match(T__7); setState(296); ((TypeContext)_localctx).type = type(); ((TypeContext)_localctx).ast = new ArrayType(new IntConstant(((TypeContext)_localctx).LITENT), ((TypeContext)_localctx).type.ast); } break; case IDENT: enterOuterAlt(_localctx, 5); { setState(299); ((TypeContext)_localctx).IDENT = match(IDENT); ((TypeContext)_localctx).ast = new VarType(((TypeContext)_localctx).IDENT); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ParamsContext extends ParserRuleContext { public List<VarDefinition> list = new ArrayList<VarDefinition>(); public ParamContext param; public List<ParamContext> param() { return getRuleContexts(ParamContext.class); } public ParamContext param(int i) { return getRuleContext(ParamContext.class,i); } public ParamsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_params; } } public final ParamsContext params() throws RecognitionException { ParamsContext _localctx = new ParamsContext(_ctx, getState()); enterRule(_localctx, 28, RULE_params); try { int _alt; setState(316); _errHandler.sync(this); switch (_input.LA(1)) { case IDENT: enterOuterAlt(_localctx, 1); { setState(309); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(303); ((ParamsContext)_localctx).param = param(); _localctx.list.add(((ParamsContext)_localctx).param.ast); setState(305); match(T__4); } } } setState(311); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } setState(312); ((ParamsContext)_localctx).param = param(); _localctx.list.add(((ParamsContext)_localctx).param.ast); } break; case CLOSE_PAREN: enterOuterAlt(_localctx, 2); { } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ParamContext extends ParserRuleContext { public VarDefinition ast; public Token IDENT; public TypeContext type; public TerminalNode IDENT() { return getToken(GrammarParser.IDENT, 0); } public TypeContext type() { return getRuleContext(TypeContext.class,0); } public ParamContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_param; } } public final ParamContext param() throws RecognitionException { ParamContext _localctx = new ParamContext(_ctx, getState()); enterRule(_localctx, 30, RULE_param); try { enterOuterAlt(_localctx, 1); { setState(318); ((ParamContext)_localctx).IDENT = match(IDENT); setState(319); match(T__19); setState(320); ((ParamContext)_localctx).type = type(); ((ParamContext)_localctx).ast = new VarDefinition(((ParamContext)_localctx).IDENT,((ParamContext)_localctx).type.ast,VarScope.PARAM); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class FieldsContext extends ParserRuleContext { public List<StructField> list = new ArrayList<StructField>();; public Token IDENT; public TypeContext type; public List<TerminalNode> IDENT() { return getTokens(GrammarParser.IDENT); } public TerminalNode IDENT(int i) { return getToken(GrammarParser.IDENT, i); } public List<TypeContext> type() { return getRuleContexts(TypeContext.class); } public TypeContext type(int i) { return getRuleContext(TypeContext.class,i); } public List<TerminalNode> SEMICOLON() { return getTokens(GrammarParser.SEMICOLON); } public TerminalNode SEMICOLON(int i) { return getToken(GrammarParser.SEMICOLON, i); } public FieldsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_fields; } } public final FieldsContext fields() throws RecognitionException { FieldsContext _localctx = new FieldsContext(_ctx, getState()); enterRule(_localctx, 32, RULE_fields); int _la; try { enterOuterAlt(_localctx, 1); { setState(329); _errHandler.sync(this); _la = _input.LA(1); do { { { setState(323); ((FieldsContext)_localctx).IDENT = match(IDENT); setState(324); match(T__19); setState(325); ((FieldsContext)_localctx).type = type(); setState(326); match(SEMICOLON); _localctx.list.add(new StructField(((FieldsContext)_localctx).IDENT,((FieldsContext)_localctx).type.ast)); } } setState(331); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==IDENT ); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { case 6: return expr_sempred((ExprContext)_localctx, predIndex); } return true; } private boolean expr_sempred(ExprContext _localctx, int predIndex) { switch (predIndex) { case 0: return precpred(_ctx, 8); case 1: return precpred(_ctx, 7); case 2: return precpred(_ctx, 4); case 3: return precpred(_ctx, 3); case 4: return precpred(_ctx, 10); case 5: return precpred(_ctx, 9); } return true; } public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\61\u0150\4\2\t\2"+ "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\3\2\3\2\3\2\3\2\3\3\3\3\3\3\6\3,\n\3\r\3\16\3-\3\4\3\4\3\4\3\4\3\4\3"+ "\4\3\4\3\4\3\4\5\49\n\4\3\5\3\5\3\5\7\5>\n\5\f\5\16\5A\13\5\3\6\3\6\3"+ "\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6"+ "\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3"+ "\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6u\n\6\3\7\3\7\3"+ "\7\3\7\7\7{\n\7\f\7\16\7~\13\7\3\7\3\7\3\7\5\7\u0083\n\7\3\b\3\b\3\b\3"+ "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b"+ "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u00a8\n\b"+ "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3"+ "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\7\b\u00c8\n\b\f\b\16"+ "\b\u00cb\13\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\7\t\u00d4\n\t\f\t\16\t\u00d7"+ "\13\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3"+ "\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3"+ "\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00ff\n\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3"+ "\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+ "\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0120\n\16\3\17\3\17"+ "\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\5\17\u0130"+ "\n\17\3\20\3\20\3\20\3\20\7\20\u0136\n\20\f\20\16\20\u0139\13\20\3\20"+ "\3\20\3\20\3\20\5\20\u013f\n\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22"+ "\3\22\3\22\3\22\6\22\u014c\n\22\r\22\16\22\u014d\3\22\2\3\16\23\2\4\6"+ "\b\n\f\16\20\22\24\26\30\32\34\36 \"\2\6\4\2((**\4\2\'\'))\3\2\13\20\3"+ "\2\21\22\2\u0166\2$\3\2\2\2\4+\3\2\2\2\68\3\2\2\2\b?\3\2\2\2\nt\3\2\2"+ "\2\f\u0082\3\2\2\2\16\u00a7\3\2\2\2\20\u00d5\3\2\2\2\22\u00d8\3\2\2\2"+ "\24\u00df\3\2\2\2\26\u00fe\3\2\2\2\30\u0100\3\2\2\2\32\u011f\3\2\2\2\34"+ "\u012f\3\2\2\2\36\u013e\3\2\2\2 \u0140\3\2\2\2\"\u014b\3\2\2\2$%\5\4\3"+ "\2%&\b\2\1\2&\'\7\2\2\3\'\3\3\2\2\2()\5\6\4\2)*\b\3\1\2*,\3\2\2\2+(\3"+ "\2\2\2,-\3\2\2\2-+\3\2\2\2-.\3\2\2\2.\5\3\2\2\2/\60\5\22\n\2\60\61\b\4"+ "\1\2\619\3\2\2\2\62\63\5\24\13\2\63\64\b\4\1\2\649\3\2\2\2\65\66\5\26"+ "\f\2\66\67\b\4\1\2\679\3\2\2\28/\3\2\2\28\62\3\2\2\28\65\3\2\2\29\7\3"+ "\2\2\2:;\5\n\6\2;<\b\5\1\2<>\3\2\2\2=:\3\2\2\2>A\3\2\2\2?=\3\2\2\2?@\3"+ "\2\2\2@\t\3\2\2\2A?\3\2\2\2BC\7\3\2\2CD\5\16\b\2DE\7+\2\2EF\b\6\1\2Fu"+ "\3\2\2\2GH\7 \2\2HI\5\16\b\2IJ\7+\2\2JK\b\6\1\2Ku\3\2\2\2LM\7\4\2\2MN"+ "\5\16\b\2NO\7+\2\2OP\b\6\1\2Pu\3\2\2\2QR\7\5\2\2RS\5\16\b\2ST\7+\2\2T"+ "U\b\6\1\2Uu\3\2\2\2VW\7\5\2\2WX\7+\2\2Xu\b\6\1\2YZ\5\30\r\2Z[\b\6\1\2"+ "[u\3\2\2\2\\]\5\32\16\2]^\b\6\1\2^u\3\2\2\2_`\5\16\b\2`a\7,\2\2ab\5\16"+ "\b\2bc\7+\2\2cd\b\6\1\2du\3\2\2\2ef\7\6\2\2fg\5\16\b\2gh\7+\2\2hi\b\6"+ "\1\2iu\3\2\2\2jk\7\6\2\2kl\7+\2\2lu\b\6\1\2mn\7&\2\2no\7-\2\2op\5\f\7"+ "\2pq\7.\2\2qr\7+\2\2rs\b\6\1\2su\3\2\2\2tB\3\2\2\2tG\3\2\2\2tL\3\2\2\2"+ "tQ\3\2\2\2tV\3\2\2\2tY\3\2\2\2t\\\3\2\2\2t_\3\2\2\2te\3\2\2\2tj\3\2\2"+ "\2tm\3\2\2\2u\13\3\2\2\2vw\5\16\b\2wx\b\7\1\2xy\7\7\2\2y{\3\2\2\2zv\3"+ "\2\2\2{~\3\2\2\2|z\3\2\2\2|}\3\2\2\2}\177\3\2\2\2~|\3\2\2\2\177\u0080"+ "\5\16\b\2\u0080\u0081\b\7\1\2\u0081\u0083\3\2\2\2\u0082|\3\2\2\2\u0082"+ "\u0083\3\2\2\2\u0083\r\3\2\2\2\u0084\u0085\b\b\1\2\u0085\u0086\7&\2\2"+ "\u0086\u00a8\b\b\1\2\u0087\u0088\7#\2\2\u0088\u00a8\b\b\1\2\u0089\u008a"+ "\7$\2\2\u008a\u00a8\b\b\1\2\u008b\u008c\7%\2\2\u008c\u00a8\b\b\1\2\u008d"+ "\u008e\7&\2\2\u008e\u008f\7-\2\2\u008f\u0090\5\f\7\2\u0090\u0091\7.\2"+ "\2\u0091\u0092\b\b\1\2\u0092\u00a8\3\2\2\2\u0093\u0094\7-\2\2\u0094\u0095"+ "\5\16\b\2\u0095\u0096\7.\2\2\u0096\u0097\b\b\1\2\u0097\u00a8\3\2\2\2\u0098"+ "\u0099\7\13\2\2\u0099\u009a\5\34\17\2\u009a\u009b\7\f\2\2\u009b\u009c"+ "\7-\2\2\u009c\u009d\5\16\b\2\u009d\u009e\7.\2\2\u009e\u009f\b\b\1\2\u009f"+ "\u00a8\3\2\2\2\u00a0\u00a1\7\23\2\2\u00a1\u00a2\5\16\b\4\u00a2\u00a3\b"+ "\b\1\2\u00a3\u00a8\3\2\2\2\u00a4\u00a5\7\24\2\2\u00a5\u00a6\7&\2\2\u00a6"+ "\u00a8\7\24\2\2\u00a7\u0084\3\2\2\2\u00a7\u0087\3\2\2\2\u00a7\u0089\3"+ "\2\2\2\u00a7\u008b\3\2\2\2\u00a7\u008d\3\2\2\2\u00a7\u0093\3\2\2\2\u00a7"+ "\u0098\3\2\2\2\u00a7\u00a0\3\2\2\2\u00a7\u00a4\3\2\2\2\u00a8\u00c9\3\2"+ "\2\2\u00a9\u00aa\f\n\2\2\u00aa\u00ab\t\2\2\2\u00ab\u00ac\5\16\b\13\u00ac"+ "\u00ad\b\b\1\2\u00ad\u00c8\3\2\2\2\u00ae\u00af\f\t\2\2\u00af\u00b0\t\3"+ "\2\2\u00b0\u00b1\5\16\b\n\u00b1\u00b2\b\b\1\2\u00b2\u00c8\3\2\2\2\u00b3"+ "\u00b4\f\6\2\2\u00b4\u00b5\t\4\2\2\u00b5\u00b6\5\16\b\7\u00b6\u00b7\b"+ "\b\1\2\u00b7\u00c8\3\2\2\2\u00b8\u00b9\f\5\2\2\u00b9\u00ba\t\5\2\2\u00ba"+ "\u00bb\5\16\b\6\u00bb\u00bc\b\b\1\2\u00bc\u00c8\3\2\2\2\u00bd\u00be\f"+ "\f\2\2\u00be\u00bf\7\b\2\2\u00bf\u00c0\7&\2\2\u00c0\u00c8\b\b\1\2\u00c1"+ "\u00c2\f\13\2\2\u00c2\u00c3\7\t\2\2\u00c3\u00c4\5\16\b\2\u00c4\u00c5\7"+ "\n\2\2\u00c5\u00c6\b\b\1\2\u00c6\u00c8\3\2\2\2\u00c7\u00a9\3\2\2\2\u00c7"+ "\u00ae\3\2\2\2\u00c7\u00b3\3\2\2\2\u00c7\u00b8\3\2\2\2\u00c7\u00bd\3\2"+ "\2\2\u00c7\u00c1\3\2\2\2\u00c8\u00cb\3\2\2\2\u00c9\u00c7\3\2\2\2\u00c9"+ "\u00ca\3\2\2\2\u00ca\17\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cc\u00cd\7\25\2"+ "\2\u00cd\u00ce\7&\2\2\u00ce\u00cf\7\26\2\2\u00cf\u00d0\5\34\17\2\u00d0"+ "\u00d1\7+\2\2\u00d1\u00d2\b\t\1\2\u00d2\u00d4\3\2\2\2\u00d3\u00cc\3\2"+ "\2\2\u00d4\u00d7\3\2\2\2\u00d5\u00d3\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6"+ "\21\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d8\u00d9\7\25\2\2\u00d9\u00da\7&\2"+ "\2\u00da\u00db\7\26\2\2\u00db\u00dc\5\34\17\2\u00dc\u00dd\7+\2\2\u00dd"+ "\u00de\b\n\1\2\u00de\23\3\2\2\2\u00df\u00e0\7\27\2\2\u00e0\u00e1\7&\2"+ "\2\u00e1\u00e2\7\30\2\2\u00e2\u00e3\5\"\22\2\u00e3\u00e4\7\31\2\2\u00e4"+ "\u00e5\7+\2\2\u00e5\u00e6\b\13\1\2\u00e6\25\3\2\2\2\u00e7\u00e8\7&\2\2"+ "\u00e8\u00e9\7-\2\2\u00e9\u00ea\5\36\20\2\u00ea\u00eb\7.\2\2\u00eb\u00ec"+ "\7\26\2\2\u00ec\u00ed\5\34\17\2\u00ed\u00ee\3\2\2\2\u00ee\u00ef\7\30\2"+ "\2\u00ef\u00f0\5\20\t\2\u00f0\u00f1\5\b\5\2\u00f1\u00f2\7\31\2\2\u00f2"+ "\u00f3\b\f\1\2\u00f3\u00ff\3\2\2\2\u00f4\u00f5\7&\2\2\u00f5\u00f6\7-\2"+ "\2\u00f6\u00f7\5\36\20\2\u00f7\u00f8\7.\2\2\u00f8\u00f9\7\30\2\2\u00f9"+ "\u00fa\5\20\t\2\u00fa\u00fb\5\b\5\2\u00fb\u00fc\7\31\2\2\u00fc\u00fd\b"+ "\f\1\2\u00fd\u00ff\3\2\2\2\u00fe\u00e7\3\2\2\2\u00fe\u00f4\3\2\2\2\u00ff"+ "\27\3\2\2\2\u0100\u0101\7\32\2\2\u0101\u0102\7-\2\2\u0102\u0103\5\16\b"+ "\2\u0103\u0104\7.\2\2\u0104\u0105\7\30\2\2\u0105\u0106\5\b\5\2\u0106\u0107"+ "\7\31\2\2\u0107\u0108\b\r\1\2\u0108\31\3\2\2\2\u0109\u010a\7\33\2\2\u010a"+ "\u010b\7-\2\2\u010b\u010c\5\16\b\2\u010c\u010d\7.\2\2\u010d\u010e\7\30"+ "\2\2\u010e\u010f\5\b\5\2\u010f\u0110\7\31\2\2\u0110\u0111\b\16\1\2\u0111"+ "\u0120\3\2\2\2\u0112\u0113\7\33\2\2\u0113\u0114\7-\2\2\u0114\u0115\5\16"+ "\b\2\u0115\u0116\7.\2\2\u0116\u0117\7\30\2\2\u0117\u0118\5\b\5\2\u0118"+ "\u0119\7\31\2\2\u0119\u011a\7\34\2\2\u011a\u011b\7\30\2\2\u011b\u011c"+ "\5\b\5\2\u011c\u011d\7\31\2\2\u011d\u011e\b\16\1\2\u011e\u0120\3\2\2\2"+ "\u011f\u0109\3\2\2\2\u011f\u0112\3\2\2\2\u0120\33\3\2\2\2\u0121\u0122"+ "\7!\2\2\u0122\u0130\b\17\1\2\u0123\u0124\7\"\2\2\u0124\u0130\b\17\1\2"+ "\u0125\u0126\7\35\2\2\u0126\u0130\b\17\1\2\u0127\u0128\7\t\2\2\u0128\u0129"+ "\7#\2\2\u0129\u012a\7\n\2\2\u012a\u012b\5\34\17\2\u012b\u012c\b\17\1\2"+ "\u012c\u0130\3\2\2\2\u012d\u012e\7&\2\2\u012e\u0130\b\17\1\2\u012f\u0121"+ "\3\2\2\2\u012f\u0123\3\2\2\2\u012f\u0125\3\2\2\2\u012f\u0127\3\2\2\2\u012f"+ "\u012d\3\2\2\2\u0130\35\3\2\2\2\u0131\u0132\5 \21\2\u0132\u0133\b\20\1"+ "\2\u0133\u0134\7\7\2\2\u0134\u0136\3\2\2\2\u0135\u0131\3\2\2\2\u0136\u0139"+ "\3\2\2\2\u0137\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138\u013a\3\2\2\2\u0139"+ "\u0137\3\2\2\2\u013a\u013b\5 \21\2\u013b\u013c\b\20\1\2\u013c\u013f\3"+ "\2\2\2\u013d\u013f\3\2\2\2\u013e\u0137\3\2\2\2\u013e\u013d\3\2\2\2\u013f"+ "\37\3\2\2\2\u0140\u0141\7&\2\2\u0141\u0142\7\26\2\2\u0142\u0143\5\34\17"+ "\2\u0143\u0144\b\21\1\2\u0144!\3\2\2\2\u0145\u0146\7&\2\2\u0146\u0147"+ "\7\26\2\2\u0147\u0148\5\34\17\2\u0148\u0149\7+\2\2\u0149\u014a\b\22\1"+ "\2\u014a\u014c\3\2\2\2\u014b\u0145\3\2\2\2\u014c\u014d\3\2\2\2\u014d\u014b"+ "\3\2\2\2\u014d\u014e\3\2\2\2\u014e#\3\2\2\2\22-8?t|\u0082\u00a7\u00c7"+ "\u00c9\u00d5\u00fe\u011f\u012f\u0137\u013e\u014d"; 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); } } }
56,712
0.64794
0.563902
1,688
32.597748
30.347414
304
false
false
0
0
48
0.001693
0
0
3.841232
false
false
2
82e89fc6043637c383697d41e0023fd3a44726f2
31,018,253,832,340
bcc879cfe7beb771bc3e8301c0383b89e9f19199
/app/src/main/java/com/dreamgyf/launcher/config/LayoutConfig.java
ffe19662fa62c2e7e4b4605c4f37a2de06f8644d
[]
no_license
dreamgyf/DreamLauncher
https://github.com/dreamgyf/DreamLauncher
52077d97cb438e13635b24c9aacf50921b75d868
550c72e76ebf6213fd12a2fc053797fe6bc5d583
refs/heads/master
2023-04-25T08:15:03.124000
2021-05-08T05:41:46
2021-05-08T05:41:46
362,767,430
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.dreamgyf.launcher.config; public class LayoutConfig { /** * @return 应用图标一屏最大行数 */ public static int getRows() { return 6; } /** * @return 应用图标一屏最大列数 */ public static int getCols() { return 4; } }
UTF-8
Java
270
java
LayoutConfig.java
Java
[]
null
[]
package com.dreamgyf.launcher.config; public class LayoutConfig { /** * @return 应用图标一屏最大行数 */ public static int getRows() { return 6; } /** * @return 应用图标一屏最大列数 */ public static int getCols() { return 4; } }
270
0.630435
0.621739
19
11.105263
12.221184
37
false
false
0
0
0
0
0
0
0.894737
false
false
2
86710cf9cda144ad56eff5d9efc5560932133e48
7,249,904,848,726
a1854d4d08d7bcc3487b0cd68f29a18be1ca8a65
/src/com/houlong/pattern/simpleFactory/Client.java
4c1bf3c2c527c612b3c0279ba2ee13224018cf48
[]
no_license
houlong123/javaKnowledge
https://github.com/houlong123/javaKnowledge
284261e5d531671d1ef07bf55cb9f9a54b8535de
b292d1685aa3ff1cfa61df2229a73c25d68386d3
refs/heads/master
2020-03-17T17:29:01.692000
2018-05-17T09:44:34
2018-05-17T09:44:34
133,789,933
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.houlong.pattern.simpleFactory; /** * 简单工厂模式 */ public class Client { public static void main(String[] args) { Chat chat = ChatFactory.createChat("histogram"); chat.display(); System.out.println("---------------------"); //简化的简单工厂模式 Chat chat2 = Chat.createChat("pie"); chat2.display(); } }
UTF-8
Java
393
java
Client.java
Java
[]
null
[]
package com.houlong.pattern.simpleFactory; /** * 简单工厂模式 */ public class Client { public static void main(String[] args) { Chat chat = ChatFactory.createChat("histogram"); chat.display(); System.out.println("---------------------"); //简化的简单工厂模式 Chat chat2 = Chat.createChat("pie"); chat2.display(); } }
393
0.556474
0.550964
17
20.352942
19.502462
56
false
false
0
0
0
0
0
0
0.352941
false
false
2
bcdb2965b55d6124d2d90ff6841f847036651dc2
25,331,717,120,540
074efd4d142e5f91710ae2ea6d6e43f7c226d774
/core/src/com/jatek/items/SwordYellow.java
26a7e530adae8a9f12e1023ecd833cae6cb0fa7e
[]
no_license
ricsi98/csakegyjatek
https://github.com/ricsi98/csakegyjatek
9fc13d9c62b6016637f48ad93011de93e753f478
304317e48a5b57efd068c35bbaa84171c246cc9a
refs/heads/master
2018-02-09T05:01:02.682000
2017-03-01T20:23:15
2017-03-01T20:23:15
80,460,478
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jatek.items; import com.badlogic.gdx.math.Vector2; public class SwordYellow extends Item{ public SwordYellow(Vector2 pos) { super(0, 15, 0, ItemSprites.SwordYellowSpr, ItemSprites.SwordYellowInfo, pos); } }
UTF-8
Java
226
java
SwordYellow.java
Java
[]
null
[]
package com.jatek.items; import com.badlogic.gdx.math.Vector2; public class SwordYellow extends Item{ public SwordYellow(Vector2 pos) { super(0, 15, 0, ItemSprites.SwordYellowSpr, ItemSprites.SwordYellowInfo, pos); } }
226
0.769912
0.743363
10
21.6
25.068707
80
false
false
0
0
0
0
0
0
1.2
false
false
2
64af1b5ee09528975d50326e412849f46bdc71f4
25,331,717,118,950
2355521debc967f044d992ae4efa7b056a978aef
/app/src/main/java/com/teletalk/salestrackerdata/salestrackerdata/Alarm_Receiver.java
5a304993619815caafe587eec41f3a5b27d11a1c
[]
no_license
shwetastha/sales_tracker
https://github.com/shwetastha/sales_tracker
3b50634e5f6f52cba204162aba85604d78c63f80
5ebc3bfe8589d0b8c00241e8647f9bbd50574049
refs/heads/master
2020-04-21T10:48:35.891000
2019-02-11T21:20:24
2019-02-11T21:20:24
169,497,903
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.teletalk.salestrackerdata.salestrackerdata; /** * Created by ShwePC on 5/20/2015. */ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Build; import android.util.Log; import android.widget.Toast; //import android.widget.Toast; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Alarm_Receiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { BootCompletedJobService.enqueueWork(context, new Intent()); // Toast.makeText(context, "Started after some time", Toast.LENGTH_LONG).show(); Log.w("SalesTrackerData:", "AlarmReciever"); String timerComplete = AndroidUtils.getfileContent(context, AndroidUtils.TIMER_STATUS_FILE, AndroidUtils.MSG_STATUS_N); AndroidUtils.getCurrentLocation(context); // if (timerComplete.equalsIgnoreCase("n")) { // Toast.makeText(context, "Timer Finished", Toast.LENGTH_LONG).show(); Intent service = new Intent(context, Network.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(service); } else { context.startService(service); } // } } }
UTF-8
Java
1,336
java
Alarm_Receiver.java
Java
[ { "context": "estrackerdata.salestrackerdata;\n\n/**\n * Created by ShwePC on 5/20/2015.\n */\n\nimport android.content.Broadca", "end": 81, "score": 0.9996631145477295, "start": 75, "tag": "USERNAME", "value": "ShwePC" } ]
null
[]
package com.teletalk.salestrackerdata.salestrackerdata; /** * Created by ShwePC on 5/20/2015. */ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Build; import android.util.Log; import android.widget.Toast; //import android.widget.Toast; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Alarm_Receiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { BootCompletedJobService.enqueueWork(context, new Intent()); // Toast.makeText(context, "Started after some time", Toast.LENGTH_LONG).show(); Log.w("SalesTrackerData:", "AlarmReciever"); String timerComplete = AndroidUtils.getfileContent(context, AndroidUtils.TIMER_STATUS_FILE, AndroidUtils.MSG_STATUS_N); AndroidUtils.getCurrentLocation(context); // if (timerComplete.equalsIgnoreCase("n")) { // Toast.makeText(context, "Timer Finished", Toast.LENGTH_LONG).show(); Intent service = new Intent(context, Network.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(service); } else { context.startService(service); } // } } }
1,336
0.708084
0.702844
43
30.069767
28.724348
127
false
false
0
0
0
0
0
0
0.697674
false
false
2
c478ad72741077d077c99101c7fd9d3a9d4bc80f
27,264,452,425,814
14f167054857cdd3f19dd49db92f80f2ea10419e
/springboot-web/src/main/java/com/ymdx/mapper/OrderMapper.java
51f72944eecafadf0800f158fb48b81c4bba67ef
[]
no_license
ymdx0610/ymdx-security
https://github.com/ymdx0610/ymdx-security
55c9acb89b9bb67e897a8a196f783610ee3fed4c
35d3b672dc8ff4d1aef9d5b5c43501a6957be146
refs/heads/master
2022-07-03T01:30:35.052000
2020-03-18T07:44:23
2020-03-18T07:44:23
248,167,697
0
0
null
false
2022-06-17T03:02:04
2020-03-18T07:40:52
2020-03-18T07:44:37
2022-06-17T03:02:04
686
0
0
11
Java
false
false
package com.ymdx.mapper; import com.ymdx.entity.OrderEntity; import org.apache.ibatis.annotations.Insert; /** * @ClassName: OrderMapper * @Description: TODO * @Author: ymdx * @Email: y_m_d_x@163.com * @Date: 2020-03-15 16:56 * @Version: 1.0 **/ public interface OrderMapper { @Insert("insert into order_info(order_code,order_desc) values (#{orderCode},#{orderDesc})") int addOrder(OrderEntity orderEntity); }
UTF-8
Java
428
java
OrderMapper.java
Java
[ { "context": "ame: OrderMapper\n * @Description: TODO\n * @Author: ymdx\n * @Email: y_m_d_x@163.com\n * @Date: 2020-03-15 1", "end": 177, "score": 0.9997276663780212, "start": 173, "tag": "USERNAME", "value": "ymdx" }, { "context": "\n * @Description: TODO\n * @Author: ymdx\n * @Email: y_m_d_x@163.com\n * @Date: 2020-03-15 16:56\n * @Version: 1.0\n **/\n", "end": 204, "score": 0.9999163746833801, "start": 189, "tag": "EMAIL", "value": "y_m_d_x@163.com" } ]
null
[]
package com.ymdx.mapper; import com.ymdx.entity.OrderEntity; import org.apache.ibatis.annotations.Insert; /** * @ClassName: OrderMapper * @Description: TODO * @Author: ymdx * @Email: <EMAIL> * @Date: 2020-03-15 16:56 * @Version: 1.0 **/ public interface OrderMapper { @Insert("insert into order_info(order_code,order_desc) values (#{orderCode},#{orderDesc})") int addOrder(OrderEntity orderEntity); }
420
0.698598
0.658879
19
21.526316
22.511677
95
false
false
0
0
0
0
0
0
0.315789
false
false
2
127450cf2e38a86dd3866cc10cc691bb13c73b87
1,142,461,315,503
c2aea7f85b6502c80adc61af528e56c3d1388ef1
/voluntariado-spring/src/main/java/cl/tbd/ejemplo1/repositories/RankingRepository.java
411cd56f92b104fe151d3eb1f214d9d33a982448
[]
no_license
Rodolfato/TBD
https://github.com/Rodolfato/TBD
6d6447849ff864ad498b52b18f6e5910a2564b2b
c0572c1f08e3c2b548275865b330af09bcf3e35a
refs/heads/master
2023-02-21T10:14:02.951000
2021-01-27T08:29:36
2021-01-27T08:29:36
305,592,351
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cl.tbd.ejemplo1.repositories; import java.util.List; import cl.tbd.ejemplo1.models.Ranking; import org.json.JSONArray; public interface RankingRepository { public List<Ranking> getAllRankings(); public Ranking createRanking(Ranking ranking); public JSONArray getRankByTask(long id_tarea, int quantity); public Ranking updateRanking(Ranking ranking, long id); public List<Ranking> deleteRanking(long id); public int calculateRanking(long id_tarea, long id_vol); }
UTF-8
Java
499
java
RankingRepository.java
Java
[]
null
[]
package cl.tbd.ejemplo1.repositories; import java.util.List; import cl.tbd.ejemplo1.models.Ranking; import org.json.JSONArray; public interface RankingRepository { public List<Ranking> getAllRankings(); public Ranking createRanking(Ranking ranking); public JSONArray getRankByTask(long id_tarea, int quantity); public Ranking updateRanking(Ranking ranking, long id); public List<Ranking> deleteRanking(long id); public int calculateRanking(long id_tarea, long id_vol); }
499
0.769539
0.765531
16
30.1875
22.959799
64
false
false
0
0
0
0
0
0
0.8125
false
false
2
e0840943bd4baf8ebc37c576f62b3bc373a20d45
30,004,641,586,656
1f2b3b2ae931c866be894583437a9aff7c517539
/com/maya/puc/common/Connection.java
4d35554379f3c5bd46448a99b476822f669797ab
[ "MIT" ]
permissive
jwnichls/puc
https://github.com/jwnichls/puc
becb9bbbac6605859887de0442d2a031d612c0e5
b833093b00bffdeaa87ec01444b556fccdb76b26
refs/heads/master
2021-01-06T06:07:04.163000
2020-02-17T23:55:34
2020-02-17T23:55:34
241,230,271
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.maya.puc.common; /* $Id: Connection.java,v 1.13 2003/10/23 07:52:54 jeffreyn Exp $ */ import org.jdom.Document; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.StringReader; import java.net.InetAddress; import java.net.Socket; import java.net.SocketException; import java.net.UnknownHostException; import java.util.Vector; public class Connection { private static int next_id = 0; private int conn_id = -1; private Vector listeners = new Vector(); private boolean connected = false; private ReceivingThread in = null; private MonitorThread monitor = null; private Socket sock = null; private OutputStream out = null; private boolean reconnect = false; private int connPort = -1; private InetAddress connIP = null; /** * Creates a new connection to the PUC device server at the specified * IP address and port. After the connection, use the connect() * and disconnect() functions to make or break the actual connection, * and use isConnected() to determine whether the connection is actually * connected. To send a message over the connection, use send(), and * to receive messages, register one or more classes that implement * ConnectionListener using addConnectionListener(). * * @param _connIP the IP address of the PUC device server to connect to. * @param _connPort the port of the PUC device server. */ public Connection(InetAddress _connIP, int _connPort) { connIP = _connIP; connPort = _connPort; conn_id = next_id++; try { monitor = new MonitorThread(this); monitor.start(); } catch (IOException e) { System.out.println("IOException when starting MonitorThread: " + e); } } public void requestReconnect() { reconnect = true; } public boolean reconnectRequested() { return reconnect; } /** * Data access function. * * @return The IP address to which the connection attempt will be made. */ public InetAddress getConnIP() { return connIP; } /** * Data access function. * * @return The port number to which the connection attempt is made. */ public int getConnPort() { return connPort; } /** * Determines whether a connection has been established. * * @return true if a connection is active, false otherwise */ public boolean isConnected() { return connected; } /** * Attempts to establish a connection. isConnected() should * be called immediately afterward to verify success. */ public void connect() { byte[] data = null; // sanity check if (connected) return; try { sock = new Socket(connIP, connPort); out = sock.getOutputStream(); in = new ReceivingThread(sock, this); in.start(); connected = true; } catch (UnknownHostException e) { } catch (SocketException e) { } catch (IOException e) { } } public Socket getNewSocket() { try { sock = new Socket(connIP, connPort); return sock; } catch (IOException ex) { return null; } } /** * Closes a connection. */ public void disconnect() { if (!connected) return; try { synchronized (in) { in.stop(); } sock.close(); } catch (IOException e) { System.err.println("IOException in Connection.disconnect(): " + e); } connected = false; } /** * Stop all threads */ public void stop() { if (connected) disconnect(); try { synchronized (monitor) { monitor.stop(); } } catch(Exception e) { System.err.println("Exception in Connection.stop(): " + e); } } public static int lsbByteArrayToInt(byte[] array) { int output = -1; if (array == null) return output; if (array.length > 0) output = 0; output |= (array[0]) & (long) 0xFF; if (array.length > 1) output |= (array[1] << 8) & (long) 0xFF00; if (array.length > 2) { output |= (array[2] << 16) & (long) 0xFF0000; output |= (array[3] << 24) & (long) 0xFF000000; } return output; } public static byte[] intToLsbByteArray(int num, int len) { byte[] array = null; if ((len == 4) || (len == 2) || (len == 1)) { array = new byte[len]; int idx = 0; array[0] = (byte) (num & (long) 0xFF); if (len == 1) return array; array[1] = (byte) ((num & (long) 0xFF00) >> 8); if (len == 2) return array; array[2] = (byte) ((num & (long) 0xFF0000) >> 16); array[3] = (byte) ((num & (long) 0xFF000000) >> 24); return array; } else { return array; } } /** * Returns the ID number of the connection. * * @ returns the ID number of the connection. */ public int getConnectionID() { return conn_id; } /** * Sends a message to the stereo. * * @param _msg The message to send to the stereo. */ public void send(Message _msg) throws IOException { synchronized (this) { try { int len, xmllen; XMLOutputter xmlgen = new XMLOutputter(); byte[] msgbytes = xmlgen.outputString(_msg.getDocument()).getBytes(); xmllen = len = msgbytes.length; // add binary data, if appropriate if ( _msg.hasBinaryData() ) { len += _msg.getBinaryDataLength(); byte[] buf = new byte[ len ]; System.arraycopy( msgbytes, 0, buf, 0, xmllen ); int bytesRead = 0; while( true ) { bytesRead += _msg.getBinaryData().read( buf, xmllen + bytesRead, _msg.getBinaryDataLength()-bytesRead ); if ( bytesRead == _msg.getBinaryDataLength() ) break; } msgbytes = buf; } out.write(intToLsbByteArray(len, 4)); out.write(intToLsbByteArray(xmllen, 4)); out.write(msgbytes); } catch (IOException e) { System.out.println(e); e.printStackTrace(); } // out.write(_msg.serialization()); } } /** * Registers a ConnectionListener to receive notifications whenever * the connection gets a new message. * * @param l - The listener to be registered. */ public void addConnectionListener(ConnectionListener l) { listeners.addElement(l); } /** * Removes a ConnectionListener from the list of listeners to be * notified of connection events. * * @param l - The listener to be removed. */ public void removeConnectionListener(ConnectionListener l) { listeners.removeElement(l); } /** * Sends a ConnectionEvent to all registered listeners. * * @param e - The ConnectionEvent to send out. */ public void dispatchConnectionEvent(ConnectionEvent e) { ConnectionListener l; for (int i = 0; i < listeners.size(); i++) { l = (ConnectionListener) listeners.elementAt(i); if (e instanceof ConnectionEvent.MessageReceived) l.messageReceived((ConnectionEvent.MessageReceived) e); else if (e instanceof ConnectionEvent.ConnectionLost) l.connectionLost((ConnectionEvent.ConnectionLost) e); else if (e instanceof ConnectionEvent.ConnectionRegained) l.connectionRegained((ConnectionEvent.ConnectionRegained) e); } } class MonitorThread extends Thread { private Connection conn = null; /** * Creates a MonitorThread. */ public MonitorThread(Connection _conn) throws IOException { conn = _conn; } public void run() { while (true) { if (conn.reconnectRequested()) { System.out.print("Attempting to reconnect..."); conn.disconnect(); conn.connect(); if (conn.isConnected()) { System.out.print("reconnected."); conn.reconnect = false; conn.dispatchConnectionEvent(new ConnectionEvent.ConnectionRegained(conn)); } System.out.println(); } try { sleep(1000); } catch (InterruptedException e) { } } } } /** * Receives, decodes, and enqueues incoming ARQ messages. */ class ReceivingThread extends Thread { private InputStream in = null; // private byte[] data = new byte[65535]; protected Vector messages = new Vector(); private Connection conn = null; SAXBuilder saxbuild = null; /** * Creates a ReceivingThread from a TCP socket. * * @param _sock The TCP socket from which to read the messages. */ public ReceivingThread(Socket _sock, Connection _conn) throws IOException { in = _sock.getInputStream(); conn = _conn; try { saxbuild = new SAXBuilder(); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } public void run() { Document doc = null; com.maya.puc.common.Message msg = null; byte[] buf = new byte[65535]; byte[] num = new byte[4]; int bytesRead = 0; int len = 0; int xmllen = 0; while (true) { if (conn.reconnectRequested()) { try { sleep(1000); } catch (InterruptedException e) { } } else { try { int ret = 0; // STEP #1: Read length value len = 0; while( true ) { len += ret = in.read( num, len, 4-len ); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if ( len == 4 ) { len = lsbByteArrayToInt(num); break; } } // STEP #2: Read XML length value xmllen = 0; while( true ) { xmllen += ret = in.read( num, xmllen, 4-xmllen ); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if ( xmllen == 4 ) { xmllen = lsbByteArrayToInt(num); if ( xmllen > len ) throw new IOException( "XML length cannot exceed message length." ); break; } } // STEP #3: Read Message Data doc = null; bytesRead = 0; while( true ) { bytesRead += ret = in.read(buf, bytesRead, len - bytesRead); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if (bytesRead == len) { // get xml data into usable form String result = new String(buf, 0, xmllen); try { doc = saxbuild.build(new StringReader(result)); } catch (Exception e) { System.out.println(e); } // get binary data into usable form ByteArrayInputStream binData = null; if ( len > xmllen ) binData = new ByteArrayInputStream( buf, xmllen, len-xmllen ); msg = com.maya.puc.common.Message.decode(doc,binData,(binData == null?-1:len-xmllen)); if (msg.isValid()) conn.dispatchConnectionEvent(new ConnectionEvent.MessageReceived(conn, msg)); break; } } } catch (Exception e) { System.out.println("This connection has experienced an error."); e.printStackTrace(); conn.requestReconnect(); conn.dispatchConnectionEvent(new ConnectionEvent.ConnectionLost(conn)); } } } } } }
UTF-8
Java
12,726
java
Connection.java
Java
[]
null
[]
package com.maya.puc.common; /* $Id: Connection.java,v 1.13 2003/10/23 07:52:54 jeffreyn Exp $ */ import org.jdom.Document; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.StringReader; import java.net.InetAddress; import java.net.Socket; import java.net.SocketException; import java.net.UnknownHostException; import java.util.Vector; public class Connection { private static int next_id = 0; private int conn_id = -1; private Vector listeners = new Vector(); private boolean connected = false; private ReceivingThread in = null; private MonitorThread monitor = null; private Socket sock = null; private OutputStream out = null; private boolean reconnect = false; private int connPort = -1; private InetAddress connIP = null; /** * Creates a new connection to the PUC device server at the specified * IP address and port. After the connection, use the connect() * and disconnect() functions to make or break the actual connection, * and use isConnected() to determine whether the connection is actually * connected. To send a message over the connection, use send(), and * to receive messages, register one or more classes that implement * ConnectionListener using addConnectionListener(). * * @param _connIP the IP address of the PUC device server to connect to. * @param _connPort the port of the PUC device server. */ public Connection(InetAddress _connIP, int _connPort) { connIP = _connIP; connPort = _connPort; conn_id = next_id++; try { monitor = new MonitorThread(this); monitor.start(); } catch (IOException e) { System.out.println("IOException when starting MonitorThread: " + e); } } public void requestReconnect() { reconnect = true; } public boolean reconnectRequested() { return reconnect; } /** * Data access function. * * @return The IP address to which the connection attempt will be made. */ public InetAddress getConnIP() { return connIP; } /** * Data access function. * * @return The port number to which the connection attempt is made. */ public int getConnPort() { return connPort; } /** * Determines whether a connection has been established. * * @return true if a connection is active, false otherwise */ public boolean isConnected() { return connected; } /** * Attempts to establish a connection. isConnected() should * be called immediately afterward to verify success. */ public void connect() { byte[] data = null; // sanity check if (connected) return; try { sock = new Socket(connIP, connPort); out = sock.getOutputStream(); in = new ReceivingThread(sock, this); in.start(); connected = true; } catch (UnknownHostException e) { } catch (SocketException e) { } catch (IOException e) { } } public Socket getNewSocket() { try { sock = new Socket(connIP, connPort); return sock; } catch (IOException ex) { return null; } } /** * Closes a connection. */ public void disconnect() { if (!connected) return; try { synchronized (in) { in.stop(); } sock.close(); } catch (IOException e) { System.err.println("IOException in Connection.disconnect(): " + e); } connected = false; } /** * Stop all threads */ public void stop() { if (connected) disconnect(); try { synchronized (monitor) { monitor.stop(); } } catch(Exception e) { System.err.println("Exception in Connection.stop(): " + e); } } public static int lsbByteArrayToInt(byte[] array) { int output = -1; if (array == null) return output; if (array.length > 0) output = 0; output |= (array[0]) & (long) 0xFF; if (array.length > 1) output |= (array[1] << 8) & (long) 0xFF00; if (array.length > 2) { output |= (array[2] << 16) & (long) 0xFF0000; output |= (array[3] << 24) & (long) 0xFF000000; } return output; } public static byte[] intToLsbByteArray(int num, int len) { byte[] array = null; if ((len == 4) || (len == 2) || (len == 1)) { array = new byte[len]; int idx = 0; array[0] = (byte) (num & (long) 0xFF); if (len == 1) return array; array[1] = (byte) ((num & (long) 0xFF00) >> 8); if (len == 2) return array; array[2] = (byte) ((num & (long) 0xFF0000) >> 16); array[3] = (byte) ((num & (long) 0xFF000000) >> 24); return array; } else { return array; } } /** * Returns the ID number of the connection. * * @ returns the ID number of the connection. */ public int getConnectionID() { return conn_id; } /** * Sends a message to the stereo. * * @param _msg The message to send to the stereo. */ public void send(Message _msg) throws IOException { synchronized (this) { try { int len, xmllen; XMLOutputter xmlgen = new XMLOutputter(); byte[] msgbytes = xmlgen.outputString(_msg.getDocument()).getBytes(); xmllen = len = msgbytes.length; // add binary data, if appropriate if ( _msg.hasBinaryData() ) { len += _msg.getBinaryDataLength(); byte[] buf = new byte[ len ]; System.arraycopy( msgbytes, 0, buf, 0, xmllen ); int bytesRead = 0; while( true ) { bytesRead += _msg.getBinaryData().read( buf, xmllen + bytesRead, _msg.getBinaryDataLength()-bytesRead ); if ( bytesRead == _msg.getBinaryDataLength() ) break; } msgbytes = buf; } out.write(intToLsbByteArray(len, 4)); out.write(intToLsbByteArray(xmllen, 4)); out.write(msgbytes); } catch (IOException e) { System.out.println(e); e.printStackTrace(); } // out.write(_msg.serialization()); } } /** * Registers a ConnectionListener to receive notifications whenever * the connection gets a new message. * * @param l - The listener to be registered. */ public void addConnectionListener(ConnectionListener l) { listeners.addElement(l); } /** * Removes a ConnectionListener from the list of listeners to be * notified of connection events. * * @param l - The listener to be removed. */ public void removeConnectionListener(ConnectionListener l) { listeners.removeElement(l); } /** * Sends a ConnectionEvent to all registered listeners. * * @param e - The ConnectionEvent to send out. */ public void dispatchConnectionEvent(ConnectionEvent e) { ConnectionListener l; for (int i = 0; i < listeners.size(); i++) { l = (ConnectionListener) listeners.elementAt(i); if (e instanceof ConnectionEvent.MessageReceived) l.messageReceived((ConnectionEvent.MessageReceived) e); else if (e instanceof ConnectionEvent.ConnectionLost) l.connectionLost((ConnectionEvent.ConnectionLost) e); else if (e instanceof ConnectionEvent.ConnectionRegained) l.connectionRegained((ConnectionEvent.ConnectionRegained) e); } } class MonitorThread extends Thread { private Connection conn = null; /** * Creates a MonitorThread. */ public MonitorThread(Connection _conn) throws IOException { conn = _conn; } public void run() { while (true) { if (conn.reconnectRequested()) { System.out.print("Attempting to reconnect..."); conn.disconnect(); conn.connect(); if (conn.isConnected()) { System.out.print("reconnected."); conn.reconnect = false; conn.dispatchConnectionEvent(new ConnectionEvent.ConnectionRegained(conn)); } System.out.println(); } try { sleep(1000); } catch (InterruptedException e) { } } } } /** * Receives, decodes, and enqueues incoming ARQ messages. */ class ReceivingThread extends Thread { private InputStream in = null; // private byte[] data = new byte[65535]; protected Vector messages = new Vector(); private Connection conn = null; SAXBuilder saxbuild = null; /** * Creates a ReceivingThread from a TCP socket. * * @param _sock The TCP socket from which to read the messages. */ public ReceivingThread(Socket _sock, Connection _conn) throws IOException { in = _sock.getInputStream(); conn = _conn; try { saxbuild = new SAXBuilder(); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } public void run() { Document doc = null; com.maya.puc.common.Message msg = null; byte[] buf = new byte[65535]; byte[] num = new byte[4]; int bytesRead = 0; int len = 0; int xmllen = 0; while (true) { if (conn.reconnectRequested()) { try { sleep(1000); } catch (InterruptedException e) { } } else { try { int ret = 0; // STEP #1: Read length value len = 0; while( true ) { len += ret = in.read( num, len, 4-len ); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if ( len == 4 ) { len = lsbByteArrayToInt(num); break; } } // STEP #2: Read XML length value xmllen = 0; while( true ) { xmllen += ret = in.read( num, xmllen, 4-xmllen ); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if ( xmllen == 4 ) { xmllen = lsbByteArrayToInt(num); if ( xmllen > len ) throw new IOException( "XML length cannot exceed message length." ); break; } } // STEP #3: Read Message Data doc = null; bytesRead = 0; while( true ) { bytesRead += ret = in.read(buf, bytesRead, len - bytesRead); if ( ret < 0 ) throw new IOException( "Socket is dead." ); if (bytesRead == len) { // get xml data into usable form String result = new String(buf, 0, xmllen); try { doc = saxbuild.build(new StringReader(result)); } catch (Exception e) { System.out.println(e); } // get binary data into usable form ByteArrayInputStream binData = null; if ( len > xmllen ) binData = new ByteArrayInputStream( buf, xmllen, len-xmllen ); msg = com.maya.puc.common.Message.decode(doc,binData,(binData == null?-1:len-xmllen)); if (msg.isValid()) conn.dispatchConnectionEvent(new ConnectionEvent.MessageReceived(conn, msg)); break; } } } catch (Exception e) { System.out.println("This connection has experienced an error."); e.printStackTrace(); conn.requestReconnect(); conn.dispatchConnectionEvent(new ConnectionEvent.ConnectionLost(conn)); } } } } } }
12,726
0.527503
0.51768
460
25.665216
22.417114
107
false
false
0
0
0
0
0
0
0.997826
false
false
2
cdc53b896910f332340e49fa2dd837c2e46451e4
4,750,233,900,549
aeb594638893e9941972b1fd8c3d0eed392e9b12
/app/src/main/java/project/harsh/com/yoblunttask/CardScrollerFragment.java
c18ee8c0ace004c372bd1d44d4c639dcb71a1f5b
[]
no_license
harsh4056/YoBluntTask
https://github.com/harsh4056/YoBluntTask
11cbda2f02efc9135c7d74c37ceac22b22020957
1695d96ec1beeabe75928801d9927081de3e77f3
refs/heads/master
2021-01-01T18:45:20.839000
2017-07-26T16:59:07
2017-07-26T16:59:07
98,427,263
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package project.harsh.com.yoblunttask; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import java.util.List; public class CardScrollerFragment extends Fragment { LinearLayoutManager layoutManager; RecyclerView cardDataRecycler; private final float zoomLevel=10f;// zoom level public Marker marker; public List<CardData> cardDataList; // Context context; @Override public void onAttach(Activity activity){ super.onAttach(activity); try { cardDataList = ((MainActivity) activity).cardDataList;//initialize card data } catch (ClassCastException e){ Log.e("CLassCast","Sorry"); } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment cardDataRecycler = (RecyclerView) inflater.inflate(R.layout.fragment_card_scroller,container,false); layoutManager = new LinearLayoutManager(inflater.getContext(), LinearLayoutManager.HORIZONTAL, false); CaptionedImagesAdapter adapter= new CaptionedImagesAdapter(cardDataList); cardDataRecycler.setAdapter(adapter); cardDataRecycler.setLayoutManager(layoutManager); return cardDataRecycler; } public void setFocusListener(final GoogleMap googleMap){ /*----------Default value first element*/ marker = googleMap.addMarker(new MarkerOptions().position(cardDataList.get(0).latLng).title(cardDataList.get(0).description)); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cardDataList.get(0).latLng,zoomLevel)); cardDataRecycler.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { switch(motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: // PRESSED return true; case MotionEvent.ACTION_UP:// On touch up event the current first item visilble is considered and the location is changed according to that int firstVisibleItem = layoutManager.findFirstVisibleItemPosition(); marker.setPosition(cardDataList.get(firstVisibleItem).latLng); marker.setTitle(cardDataList.get(firstVisibleItem).description); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cardDataList.get(firstVisibleItem).latLng,zoomLevel)); return true; } return false; } }); } }
UTF-8
Java
3,432
java
CardScrollerFragment.java
Java
[]
null
[]
package project.harsh.com.yoblunttask; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import java.util.List; public class CardScrollerFragment extends Fragment { LinearLayoutManager layoutManager; RecyclerView cardDataRecycler; private final float zoomLevel=10f;// zoom level public Marker marker; public List<CardData> cardDataList; // Context context; @Override public void onAttach(Activity activity){ super.onAttach(activity); try { cardDataList = ((MainActivity) activity).cardDataList;//initialize card data } catch (ClassCastException e){ Log.e("CLassCast","Sorry"); } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment cardDataRecycler = (RecyclerView) inflater.inflate(R.layout.fragment_card_scroller,container,false); layoutManager = new LinearLayoutManager(inflater.getContext(), LinearLayoutManager.HORIZONTAL, false); CaptionedImagesAdapter adapter= new CaptionedImagesAdapter(cardDataList); cardDataRecycler.setAdapter(adapter); cardDataRecycler.setLayoutManager(layoutManager); return cardDataRecycler; } public void setFocusListener(final GoogleMap googleMap){ /*----------Default value first element*/ marker = googleMap.addMarker(new MarkerOptions().position(cardDataList.get(0).latLng).title(cardDataList.get(0).description)); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cardDataList.get(0).latLng,zoomLevel)); cardDataRecycler.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { switch(motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: // PRESSED return true; case MotionEvent.ACTION_UP:// On touch up event the current first item visilble is considered and the location is changed according to that int firstVisibleItem = layoutManager.findFirstVisibleItemPosition(); marker.setPosition(cardDataList.get(firstVisibleItem).latLng); marker.setTitle(cardDataList.get(firstVisibleItem).description); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cardDataList.get(firstVisibleItem).latLng,zoomLevel)); return true; } return false; } }); } }
3,432
0.682401
0.680361
100
33.32
34.435413
159
false
false
0
0
0
0
0
0
0.54
false
false
2
af233fea4a408fe591a5b9ebf5961531f44b0256
4,750,233,900,001
8bf04d2b35c82ad3296ddbebe118feecd7912ca4
/src/Capa2_Aplicacion/GestionarPagoServicio.java
750debbd15dd5af8d4dc503b6d8403cb41f9467b
[]
no_license
JuliusSauco/IntroBank_Soft
https://github.com/JuliusSauco/IntroBank_Soft
35e88df5004ec61851e6035a9e4a7865d6bec848
b4d96018c7e94719607120cc6a970e9b917f8d7e
refs/heads/master
2021-07-12T15:07:12.813000
2020-08-02T20:26:55
2020-08-02T20:26:55
181,379,535
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Capa2_Aplicacion; public class GestionarPagoServicio { }
UTF-8
Java
72
java
GestionarPagoServicio.java
Java
[]
null
[]
package Capa2_Aplicacion; public class GestionarPagoServicio { }
72
0.75
0.736111
5
13.2
14.606848
36
false
false
0
0
0
0
0
0
0.2
false
false
2
4d5fd3cbfc6e2370f20a9c9a7e211d0c33457424
21,182,778,737,771
cc58c3db309a14b9540c73b117079124e7e903d5
/gamecard3/src/com/macower/businessdata/dao/ShippingOptionDaoImpl.java
3fb9e1b85758550182afa7879dd1fcae64e4fd03
[]
no_license
tonsqxv/gamecard
https://github.com/tonsqxv/gamecard
6d871960e5d4d6b45b62e458a3d4927ca55f542a
58f58235d4655fa0a1405bf779d76d2e68488b86
refs/heads/master
2023-05-29T00:38:40.103000
2021-06-14T10:56:39
2021-06-14T10:56:39
363,405,827
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.macower.businessdata.dao; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.MatchMode; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import com.macower.businessdata.entity.ShippingOption; import com.macower.core.dao.BaseEntityDao; import com.macower.core.entity.Page; import com.macower.core.util.StringUtils; @Repository public class ShippingOptionDaoImpl extends BaseEntityDao<ShippingOption>{ public Page<ShippingOption> findPageBy(ShippingOption obj, Integer pageNo, Integer pageSize) { DetachedCriteria dc = DetachedCriteria.forClass(ShippingOption.class); if(StringUtils.isNotEmpty(obj.getShippingOptionName())){ dc.add(Restrictions.like("shippingOptionName", obj.getShippingOptionName(),MatchMode.ANYWHERE)) ; } return this.findPageBy(dc,pageNo,pageSize) ; } }
UTF-8
Java
881
java
ShippingOptionDaoImpl.java
Java
[]
null
[]
package com.macower.businessdata.dao; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.MatchMode; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import com.macower.businessdata.entity.ShippingOption; import com.macower.core.dao.BaseEntityDao; import com.macower.core.entity.Page; import com.macower.core.util.StringUtils; @Repository public class ShippingOptionDaoImpl extends BaseEntityDao<ShippingOption>{ public Page<ShippingOption> findPageBy(ShippingOption obj, Integer pageNo, Integer pageSize) { DetachedCriteria dc = DetachedCriteria.forClass(ShippingOption.class); if(StringUtils.isNotEmpty(obj.getShippingOptionName())){ dc.add(Restrictions.like("shippingOptionName", obj.getShippingOptionName(),MatchMode.ANYWHERE)) ; } return this.findPageBy(dc,pageNo,pageSize) ; } }
881
0.819523
0.819523
27
31.629629
30.725967
100
false
false
0
0
0
0
0
0
1.185185
false
false
2
1379ecb205e19f3cf7e90ac32efcff4e8086b7ad
2,190,433,331,294
a297f02c265e8cf8fb46613b9c9449482d41580e
/src/main/java/com/devcom/controllers/UserController.java
19c7aa26c0fba5418c4ba46549d43c6338836249
[]
no_license
cherradii/Ques-Answr
https://github.com/cherradii/Ques-Answr
4c2643c2498f334b0be84541bb4da17fa6970836
8c83e3c2a8c56857cf8bea31fb4e679a85b0bf14
refs/heads/master
2020-07-24T07:39:14.340000
2019-09-08T21:52:24
2019-09-08T21:52:24
207,850,013
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.devcom.controllers; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @CrossOrigin @RequestMapping(value = "/userController") public class UserController { @RequestMapping(value = "/test", method = RequestMethod.GET) public String test(){ return "runnig..."; } }
UTF-8
Java
497
java
UserController.java
Java
[]
null
[]
package com.devcom.controllers; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @CrossOrigin @RequestMapping(value = "/userController") public class UserController { @RequestMapping(value = "/test", method = RequestMethod.GET) public String test(){ return "runnig..."; } }
497
0.802817
0.802817
17
28.235294
24.160078
62
false
false
0
0
0
0
0
0
0.705882
false
false
2
dadd9b2dded18b3bdfee89914572ab2b384b8a96
25,443,386,329,753
2fd9d77d529e9b90fd077d0aa5ed2889525129e3
/DecompiledViberSrc/app/src/main/java/com/google/android/gms/internal/ads/zzchb.java
1d2176a6eb2c6f7494b8b6118d95fd49685ca406
[]
no_license
cga2351/code
https://github.com/cga2351/code
703f5d49dc3be45eafc4521e931f8d9d270e8a92
4e35fb567d359c252c2feca1e21b3a2a386f2bdb
refs/heads/master
2021-07-08T15:11:06.299000
2021-05-06T13:22:21
2021-05-06T13:22:21
60,314,071
1
3
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.google.android.gms.internal.ads; import android.content.Context; public final class zzchb implements zzdth<zzbbi<String>> { private final zzdtt<Context> zzeol; private final zzdtt<zzczs> zzfhu; private zzchb(zzdtt<zzczs> paramzzdtt, zzdtt<Context> paramzzdtt1) { this.zzfhu = paramzzdtt; this.zzeol = paramzzdtt1; } public static zzchb zzab(zzdtt<zzczs> paramzzdtt, zzdtt<Context> paramzzdtt1) { return new zzchb(paramzzdtt, paramzzdtt1); } } /* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_2_dex2jar.jar * Qualified Name: com.google.android.gms.internal.ads.zzchb * JD-Core Version: 0.6.2 */
UTF-8
Java
706
java
zzchb.java
Java
[]
null
[]
package com.google.android.gms.internal.ads; import android.content.Context; public final class zzchb implements zzdth<zzbbi<String>> { private final zzdtt<Context> zzeol; private final zzdtt<zzczs> zzfhu; private zzchb(zzdtt<zzczs> paramzzdtt, zzdtt<Context> paramzzdtt1) { this.zzfhu = paramzzdtt; this.zzeol = paramzzdtt1; } public static zzchb zzab(zzdtt<zzczs> paramzzdtt, zzdtt<Context> paramzzdtt1) { return new zzchb(paramzzdtt, paramzzdtt1); } } /* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_2_dex2jar.jar * Qualified Name: com.google.android.gms.internal.ads.zzchb * JD-Core Version: 0.6.2 */
706
0.689802
0.665722
26
25.23077
26.880516
93
false
false
0
0
0
0
0
0
0.384615
false
false
2
3f99b8a42f46ca6ca74d6808eea55bddfcb0a842
6,416,681,205,973
ec951f0d5be1b5a27d0b55c60eb3741dc98e21de
/src/main/java/TwitterStreamReader.java
cd353923aacc1757543a6e5ecf8899d19b8536b4
[]
no_license
sachinkundu/kinesis_twitter_rt_analyzer
https://github.com/sachinkundu/kinesis_twitter_rt_analyzer
fcb0ca6f062e8573f46bc930d5c799b9d9eeb750
59651e6c30be3d5d5a9411ccd2e3a6fbc6e05c72
refs/heads/master
2020-09-22T03:31:51.769000
2015-04-22T08:33:56
2015-04-22T08:33:56
32,920,042
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import org.json.*; import com.google.common.collect.Lists; import com.twitter.hbc.ClientBuilder; import com.twitter.hbc.core.Client; import com.twitter.hbc.core.Constants; import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint; import com.twitter.hbc.core.processor.StringDelimitedProcessor; import com.twitter.hbc.httpclient.auth.Authentication; import com.twitter.hbc.httpclient.auth.OAuth1; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class TwitterStreamReader { public static void run(String consumerKey, String consumerSecret, String token, String secret, KinesisProducer producer) throws InterruptedException { BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000); StatusesFilterEndpoint endpoint = new StatusesFilterEndpoint(); endpoint.trackTerms(Lists.newArrayList("#EarthDay2015")); Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret); Client client = new ClientBuilder() .hosts(Constants.STREAM_HOST) .endpoint(endpoint) .authentication(auth) .processor(new StringDelimitedProcessor(queue)) .build(); client.connect(); while (true) { String msg = queue.take(); JSONObject obj = new JSONObject(msg); producer.sendTweet(msg, obj.getString("id_str")); if (client.isDone()) { System.out.println("Client connection closed unexpectedly: "); break; } } client.stop(); // Print some stats System.out.printf("The client read %d messages!\n", client.getStatsTracker().getNumMessages()); } }
UTF-8
Java
1,793
java
TwitterStreamReader.java
Java
[]
null
[]
import org.json.*; import com.google.common.collect.Lists; import com.twitter.hbc.ClientBuilder; import com.twitter.hbc.core.Client; import com.twitter.hbc.core.Constants; import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint; import com.twitter.hbc.core.processor.StringDelimitedProcessor; import com.twitter.hbc.httpclient.auth.Authentication; import com.twitter.hbc.httpclient.auth.OAuth1; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class TwitterStreamReader { public static void run(String consumerKey, String consumerSecret, String token, String secret, KinesisProducer producer) throws InterruptedException { BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000); StatusesFilterEndpoint endpoint = new StatusesFilterEndpoint(); endpoint.trackTerms(Lists.newArrayList("#EarthDay2015")); Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret); Client client = new ClientBuilder() .hosts(Constants.STREAM_HOST) .endpoint(endpoint) .authentication(auth) .processor(new StringDelimitedProcessor(queue)) .build(); client.connect(); while (true) { String msg = queue.take(); JSONObject obj = new JSONObject(msg); producer.sendTweet(msg, obj.getString("id_str")); if (client.isDone()) { System.out.println("Client connection closed unexpectedly: "); break; } } client.stop(); // Print some stats System.out.printf("The client read %d messages!\n", client.getStatsTracker().getNumMessages()); } }
1,793
0.668154
0.662019
45
38.866665
27.490282
103
false
false
0
0
0
0
0
0
0.733333
false
false
2
8e93968bb4cdb26179881c2b1c00b5fc24cee836
11,209,864,700,276
e240d1b66d16eeb129cc0dd0559aa8a490ad359f
/BackEnd/src/radin/backend/microcompilers/CompoundStatementCompiler.java
5096f7dc5c5571081cc1fd98a7269023a3900e48
[]
no_license
mstr87811499/Jodin-Java
https://github.com/mstr87811499/Jodin-Java
a62a055fb210f2f8dadbb0bd55d71ea6428d6803
4448cb02ac0bfb0cdeadb4088e62d703e553c38a
refs/heads/master
2023-04-15T22:37:42.926000
2021-03-14T21:57:46
2021-03-14T21:57:46
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package radin.backend.microcompilers; import radin.backend.compilation.AbstractIndentedOutputCompiler; import radin.midanalysis.TypeAugmentedSemanticNode; import java.io.PrintWriter; public class CompoundStatementCompiler extends AbstractIndentedOutputCompiler { public CompoundStatementCompiler(PrintWriter printWriter, int indent) { super(printWriter, indent); } @Override public boolean compile(TypeAugmentedSemanticNode node) { StatementCompiler statementCompiler = new StatementCompiler(getPrintWriter()); //print(getIndentString()); Integer currentLine = null; for (TypeAugmentedSemanticNode child : node.getChildren()) { /*Token firstToken = child.findFirstToken(); if(firstToken != null && firstToken.getLineNumber() >= 0 && (currentLine == null || firstToken.getLineNumber() >= currentLine)) { if (currentLine == null) { currentLine = firstToken.getLineNumber(); } else { while (++currentLine != firstToken.getLineNumber()) { println(); } } } else { currentLine = null; } */ if(!statementCompiler.compile(child)) return false; println(); } return true; } }
UTF-8
Java
1,428
java
CompoundStatementCompiler.java
Java
[]
null
[]
package radin.backend.microcompilers; import radin.backend.compilation.AbstractIndentedOutputCompiler; import radin.midanalysis.TypeAugmentedSemanticNode; import java.io.PrintWriter; public class CompoundStatementCompiler extends AbstractIndentedOutputCompiler { public CompoundStatementCompiler(PrintWriter printWriter, int indent) { super(printWriter, indent); } @Override public boolean compile(TypeAugmentedSemanticNode node) { StatementCompiler statementCompiler = new StatementCompiler(getPrintWriter()); //print(getIndentString()); Integer currentLine = null; for (TypeAugmentedSemanticNode child : node.getChildren()) { /*Token firstToken = child.findFirstToken(); if(firstToken != null && firstToken.getLineNumber() >= 0 && (currentLine == null || firstToken.getLineNumber() >= currentLine)) { if (currentLine == null) { currentLine = firstToken.getLineNumber(); } else { while (++currentLine != firstToken.getLineNumber()) { println(); } } } else { currentLine = null; } */ if(!statementCompiler.compile(child)) return false; println(); } return true; } }
1,428
0.585434
0.584734
42
33
30.112488
141
false
false
0
0
0
0
0
0
0.452381
false
false
2
433e1c6788494b92c75aa60fb9ab90cc4a5637b5
28,174,985,490,076
268fce3684f168d992be69b3dd11df5a55820e68
/lims-rijnstate/src/main/java/nl/runnable/lims/rijnstate/Bootstrap.java
d2aa28bd2fd93e08e5b4ac83ecfcb7154c4b9745
[]
no_license
grebbel/anaconda-java
https://github.com/grebbel/anaconda-java
d051c36ef3558eec5c30c9ea7970b2cf985973cc
2d272118e0e7341d8c195b097fd2507756ec7f5b
refs/heads/master
2021-01-19T06:26:20.061000
2012-07-30T09:22:25
2012-07-30T09:22:25
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package nl.runnable.lims.rijnstate; import javax.annotation.ManagedBean; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.activiti.engine.RepositoryService; /** * Performs bootstrap operations. * * @author Laurens Fridael * */ @ManagedBean public class Bootstrap { @Inject private UserIdentityHelper userIdentityHelper; @Inject private RepositoryService repositoryService; @Inject private GroupHelper groupHelper; @PostConstruct public void performBootstrap() { repositoryService.createDeployment().addClasspathResource("processes/request.bpmn20.xml").deploy(); groupHelper.createDefaultGroups(); userIdentityHelper.createGroups(); userIdentityHelper.createUsers(); userIdentityHelper.createMemberships(); } }
UTF-8
Java
772
java
Bootstrap.java
Java
[ { "context": "*\n * Performs bootstrap operations.\n * \n * @author Laurens Fridael\n * \n */\n@ManagedBean\npublic class Bootstrap {\n\n\t@", "end": 257, "score": 0.9998820424079895, "start": 242, "tag": "NAME", "value": "Laurens Fridael" } ]
null
[]
package nl.runnable.lims.rijnstate; import javax.annotation.ManagedBean; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.activiti.engine.RepositoryService; /** * Performs bootstrap operations. * * @author <NAME> * */ @ManagedBean public class Bootstrap { @Inject private UserIdentityHelper userIdentityHelper; @Inject private RepositoryService repositoryService; @Inject private GroupHelper groupHelper; @PostConstruct public void performBootstrap() { repositoryService.createDeployment().addClasspathResource("processes/request.bpmn20.xml").deploy(); groupHelper.createDefaultGroups(); userIdentityHelper.createGroups(); userIdentityHelper.createUsers(); userIdentityHelper.createMemberships(); } }
763
0.796632
0.794041
35
21.057142
21.549866
101
false
false
0
0
0
0
0
0
0.914286
false
false
2
b98d8d92210a0f7cecf1bc9adfbb17263e179a23
5,686,536,704,338
5fedb08590b97e71f65b6854cac40f4679e4ae93
/woooqi-bpm-logic/src/main/java/com/woooqi/bpm/service/bpm/DeployService.java
cec5b25723c2f94b0edfceb2e641327f3109d3ae
[]
no_license
xeon-ye/woooqi-bpm
https://github.com/xeon-ye/woooqi-bpm
c234156eb75420f4835800e3b25aa2b0f3df6fff
64dc99312eb91de4bb2008d60e0cd963a2d1c683
refs/heads/master
2021-09-05T12:20:37.785000
2018-01-27T13:57:11
2018-01-27T13:57:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.woooqi.bpm.service.bpm; import java.io.IOException; import java.io.InputStream; import java.util.List; import com.titan.entity.bpm.bpm.Deployment; public interface DeployService { public List<Deployment> getAllDeploy(String name); public InputStream getImageByte(String deployId) throws IOException; public InputStream getXmlByte(String deployId) throws IOException; public int setDeployGategory(String deployId,String categoryId); }
UTF-8
Java
466
java
DeployService.java
Java
[]
null
[]
package com.woooqi.bpm.service.bpm; import java.io.IOException; import java.io.InputStream; import java.util.List; import com.titan.entity.bpm.bpm.Deployment; public interface DeployService { public List<Deployment> getAllDeploy(String name); public InputStream getImageByte(String deployId) throws IOException; public InputStream getXmlByte(String deployId) throws IOException; public int setDeployGategory(String deployId,String categoryId); }
466
0.800429
0.800429
21
21.190475
24.58536
69
false
false
0
0
0
0
0
0
0.952381
false
false
2
36afc4d694c3d1a4e7a881758d25391b524adb9f
34,041,910,792,431
a5d1e976fe51d2ce8f2add3a94b35b1b2be3c54e
/src/main/java/gov/noaa/ncdc/wct/ui/event/MouseMotionPopupListener.java
8383b1451dbb250320056ad4a23eab141639b75b
[]
no_license
gss2002/wct
https://github.com/gss2002/wct
cc4ee9aa684db0941eaefe2fbd04642967f6d3f6
f242d36d074ff024eb55e8f6cbd626ac7072ad74
refs/heads/master
2020-12-24T07:19:45.685000
2016-12-26T20:48:28
2016-12-26T20:48:28
59,535,643
4
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package gov.noaa.ncdc.wct.ui.event; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import javax.swing.JPopupMenu; public class MouseMotionPopupListener extends MouseMotionAdapter { private Component invoker; private JPopupMenu menu; public MouseMotionPopupListener(Component invoker, JPopupMenu menu) { this.invoker = invoker; this.menu = menu; } public void mouseMoved(MouseEvent e) { checkPopup(e); } // public void mousePressed(MouseEvent e) { //// System.out.println("PRESSED"); // checkPopup(e); // } // // public void mouseClicked(MouseEvent e) { //// System.out.println("CLICKED"); // checkPopup(e); // } // // public void mouseReleased(MouseEvent e) { //// System.out.println("RELEASED"); // checkPopup(e); // } private void checkPopup(MouseEvent e) { // if (e.isPopupTrigger()) { // menu.show(invoker, e.getX(), e.getY()); // } if (! menu.isShowing()) { menu.show(invoker, invoker.getWidth(), 0); } // else { // System.out.println("SETTING setVisible to FALSE"); // menu.setVisible(false); // } } }
UTF-8
Java
1,318
java
MouseMotionPopupListener.java
Java
[]
null
[]
package gov.noaa.ncdc.wct.ui.event; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import javax.swing.JPopupMenu; public class MouseMotionPopupListener extends MouseMotionAdapter { private Component invoker; private JPopupMenu menu; public MouseMotionPopupListener(Component invoker, JPopupMenu menu) { this.invoker = invoker; this.menu = menu; } public void mouseMoved(MouseEvent e) { checkPopup(e); } // public void mousePressed(MouseEvent e) { //// System.out.println("PRESSED"); // checkPopup(e); // } // // public void mouseClicked(MouseEvent e) { //// System.out.println("CLICKED"); // checkPopup(e); // } // // public void mouseReleased(MouseEvent e) { //// System.out.println("RELEASED"); // checkPopup(e); // } private void checkPopup(MouseEvent e) { // if (e.isPopupTrigger()) { // menu.show(invoker, e.getX(), e.getY()); // } if (! menu.isShowing()) { menu.show(invoker, invoker.getWidth(), 0); } // else { // System.out.println("SETTING setVisible to FALSE"); // menu.setVisible(false); // } } }
1,318
0.578149
0.57739
53
22.830189
20.213703
73
false
false
0
0
0
0
0
0
0.490566
false
false
2
77990249ea4e9588e60ebb6ac558fe780791671a
25,022,479,478,639
6a2c5fb0bb2c6addf3a24e7ecd0862e0d4744fb9
/shap-project/src/main/java/com/ying/shap_project/Circle.java
618775edc54527b34f73ca2d365f1440d9e9d60c
[]
no_license
yingsunnn/shape-project
https://github.com/yingsunnn/shape-project
e29213f265fdd19e4bfa612afc25d812d0c4fbad
e0daad1aef04b707ed460490e6d104215b807fe1
refs/heads/master
2021-06-07T04:25:48.903000
2016-08-24T22:35:30
2016-08-24T22:35:30
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ying.shap_project; import java.util.List; import com.ying.shap_project.exception.IllegalShapeArgumentException; import com.ying.shap_project.utils.ObjectUtils; import com.ying.shap_project.utils.math.MathUtils; import com.ying.shap_project.utils.math.Point; public class Circle extends Shape { private double radius; public Circle() { } public Circle(Point point, double raidus) { setLocatedPoint(point); this.radius = raidus; } public Circle(List<String> args) { initializedShape(args); } @Override public double getArea() { return Math.PI * getRadius() * getRadius(); } @Override public boolean isInclude(Point point) { double distance = MathUtils.distance(getLocatedPoint(), point); if (radius >= distance) return true; return false; } @Override public boolean validateArgs(List<String> args) { if (args.size() != 4) { throw new IllegalShapeArgumentException("Wrong number of circle arguments. Needs 4 but " + args.size() + " " + args); } for (int i = 1; i < args.size(); i++) { if (!ObjectUtils.isNumber(args.get(i))) { throw new IllegalShapeArgumentException(args.get(i) + " is not a number. " + args); } } if (Double.valueOf(args.get(3)) <= 0) throw new IllegalShapeArgumentException("Radius(" + args.get(3) + ") can not be negative or 0. " + args); return true; } @Override public void convertArgs(List<String> args) { setLocatedPoint(new Point(Double.valueOf(args.get(1)), Double.valueOf(args.get(2)))); setRadius(Double.valueOf(args.get(3))); } public double getRadius() { return radius; } public void setRadius(double radius) { this.radius = radius; } @Override public String printShape() { return getName() + ": circle with centre at(" + getLocatedPoint().getX() + ", " + getLocatedPoint().getY() + ") and radius " + getRadius(); } }
UTF-8
Java
1,936
java
Circle.java
Java
[]
null
[]
package com.ying.shap_project; import java.util.List; import com.ying.shap_project.exception.IllegalShapeArgumentException; import com.ying.shap_project.utils.ObjectUtils; import com.ying.shap_project.utils.math.MathUtils; import com.ying.shap_project.utils.math.Point; public class Circle extends Shape { private double radius; public Circle() { } public Circle(Point point, double raidus) { setLocatedPoint(point); this.radius = raidus; } public Circle(List<String> args) { initializedShape(args); } @Override public double getArea() { return Math.PI * getRadius() * getRadius(); } @Override public boolean isInclude(Point point) { double distance = MathUtils.distance(getLocatedPoint(), point); if (radius >= distance) return true; return false; } @Override public boolean validateArgs(List<String> args) { if (args.size() != 4) { throw new IllegalShapeArgumentException("Wrong number of circle arguments. Needs 4 but " + args.size() + " " + args); } for (int i = 1; i < args.size(); i++) { if (!ObjectUtils.isNumber(args.get(i))) { throw new IllegalShapeArgumentException(args.get(i) + " is not a number. " + args); } } if (Double.valueOf(args.get(3)) <= 0) throw new IllegalShapeArgumentException("Radius(" + args.get(3) + ") can not be negative or 0. " + args); return true; } @Override public void convertArgs(List<String> args) { setLocatedPoint(new Point(Double.valueOf(args.get(1)), Double.valueOf(args.get(2)))); setRadius(Double.valueOf(args.get(3))); } public double getRadius() { return radius; } public void setRadius(double radius) { this.radius = radius; } @Override public String printShape() { return getName() + ": circle with centre at(" + getLocatedPoint().getX() + ", " + getLocatedPoint().getY() + ") and radius " + getRadius(); } }
1,936
0.661674
0.656508
77
23.142857
29.278206
141
false
false
0
0
0
0
0
0
1.454545
false
false
2
8c682f23090a024d11a6a2a93f410145f7117d48
22,677,427,364,004
41b5626593f86fe60035fdaae236edf2c9352926
/roncoo-education-user/roncoo-education-user-service/src/main/java/com/roncoo/education/user/service/feign/FeignLecturerController.java
818144353023a0389a9c40f73f06a6d6a14bfba3
[ "MIT" ]
permissive
chenhaoaixuexi/cloudCourse
https://github.com/chenhaoaixuexi/cloudCourse
5b662a822108efa70606c06e590870a9aa6dbbe7
eafac97da0a08d7a3245aef2a248778d963c1997
refs/heads/master
2023-04-06T11:30:58.368000
2020-04-08T05:10:53
2020-04-08T05:10:53
253,463,242
0
0
MIT
false
2023-03-27T22:19:49
2020-04-06T10:22:05
2020-04-08T05:12:22
2023-03-27T22:19:48
2,022
0
0
3
Java
false
false
package com.roncoo.education.user.service.feign; import java.util.List; import com.roncoo.education.user.feign.interfaces.IFeignLecturer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.roncoo.education.user.feign.qo.LecturerQO; import com.roncoo.education.user.feign.vo.LecturerVO; import com.roncoo.education.user.service.feign.biz.FeignLecturerBiz; import com.roncoo.education.util.base.BaseController; import com.roncoo.education.util.base.Page; /** * 讲师信息 * * @author wujing */ @RestController public class FeignLecturerController extends BaseController implements IFeignLecturer { @Autowired private FeignLecturerBiz biz; @Override public Page<LecturerVO> listForPage(@RequestBody LecturerQO qo) { return biz.listForPage(qo); } @Override public int save(@RequestBody LecturerQO qo) { return biz.save(qo); } @Override public int deleteById(@PathVariable(value = "id") Long id) { return biz.deleteById(id); } @Override public int updateById(@RequestBody LecturerQO qo) { return biz.updateById(qo); } @Override public LecturerVO getById(@PathVariable(value = "id") Long id) { return biz.getById(id); } /** * 列出所有讲师信息 */ @Override public List<LecturerVO> listAllForLecturer() { return biz.listAllForLecturer(); } /*** * 根据讲师用户编号查找讲师信息 */ @Override public LecturerVO getByLecturerUserNo(@PathVariable(value = "lecturerUserNo") Long lecturerUserNo) { return biz.getByLecturerUserNo(lecturerUserNo); } }
UTF-8
Java
1,796
java
FeignLecturerController.java
Java
[ { "context": "on.util.base.Page;\r\n\r\n/**\r\n * 讲师信息\r\n *\r\n * @author wujing\r\n */\r\n@RestController\r\npublic class FeignLecturer", "end": 715, "score": 0.9992372393608093, "start": 709, "tag": "USERNAME", "value": "wujing" } ]
null
[]
package com.roncoo.education.user.service.feign; import java.util.List; import com.roncoo.education.user.feign.interfaces.IFeignLecturer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.roncoo.education.user.feign.qo.LecturerQO; import com.roncoo.education.user.feign.vo.LecturerVO; import com.roncoo.education.user.service.feign.biz.FeignLecturerBiz; import com.roncoo.education.util.base.BaseController; import com.roncoo.education.util.base.Page; /** * 讲师信息 * * @author wujing */ @RestController public class FeignLecturerController extends BaseController implements IFeignLecturer { @Autowired private FeignLecturerBiz biz; @Override public Page<LecturerVO> listForPage(@RequestBody LecturerQO qo) { return biz.listForPage(qo); } @Override public int save(@RequestBody LecturerQO qo) { return biz.save(qo); } @Override public int deleteById(@PathVariable(value = "id") Long id) { return biz.deleteById(id); } @Override public int updateById(@RequestBody LecturerQO qo) { return biz.updateById(qo); } @Override public LecturerVO getById(@PathVariable(value = "id") Long id) { return biz.getById(id); } /** * 列出所有讲师信息 */ @Override public List<LecturerVO> listAllForLecturer() { return biz.listAllForLecturer(); } /*** * 根据讲师用户编号查找讲师信息 */ @Override public LecturerVO getByLecturerUserNo(@PathVariable(value = "lecturerUserNo") Long lecturerUserNo) { return biz.getByLecturerUserNo(lecturerUserNo); } }
1,796
0.743119
0.743119
68
23.647058
25.9268
101
false
false
0
0
0
0
0
0
0.926471
false
false
2
fcb6d2ab279c796fd13a74bfc9acd54ca3b739ec
18,047,452,596,109
0722b0b6d1c1d89be3ae5ab65ea184fb56946ff5
/BloomFilter/src/MyHash.java
68a82f782f1f95a6068e60e1fd16bcbf7a297e39
[]
no_license
zh2333/Trics
https://github.com/zh2333/Trics
9f543fc5723b3ea1e4e2898a2dc050491f20cf9d
9a04a1940607929bc01a622290a5f8e780802585
refs/heads/main
2022-12-31T20:14:48.769000
2020-10-25T09:47:08
2020-10-25T09:47:08
304,793,084
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public interface MyHash { /** * 三个hash算法 * @return */ int hashOne(String key); int hashTwo(String key); int hashThree(String key); }
UTF-8
Java
174
java
MyHash.java
Java
[]
null
[]
public interface MyHash { /** * 三个hash算法 * @return */ int hashOne(String key); int hashTwo(String key); int hashThree(String key); }
174
0.566265
0.566265
11
14.090909
11.397405
30
false
false
0
0
0
0
0
0
0.272727
false
false
2
435f886449a07a975ae6e5f23c86dae354c418cb
1,425,929,168,571
2ada2e94dd7404e888ad54e0989c2ffb830f8967
/IdeaProjects/HelloPlugin/src/main/java/commands/kill.java
77feec1f9c2793b06594f4b5d6036aa0e659662a
[]
no_license
KortaPo/plugins
https://github.com/KortaPo/plugins
02e309deced1d5c80e18c833dbf625d6b75b6cc1
7ac36d13c582d60fe6bed9e1400a0146b144a09a
refs/heads/main
2023-07-11T07:11:00.405000
2021-08-15T21:35:20
2021-08-15T21:35:20
410,804,299
1
0
null
true
2021-09-27T08:33:31
2021-09-27T08:33:30
2021-09-27T08:32:45
2021-08-26T15:20:44
69
0
0
0
null
false
false
package commands; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class kill implements CommandExecutor { @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { if (!(commandSender instanceof Player)) {return true;} Player player = (Player) commandSender; if (strings.length > 0) { Player playerToBeKilled = Bukkit.getPlayer(strings[0]); playerToBeKilled.setHealth(0); player.sendMessage(ChatColor.GOLD + "§lDamn! " + ChatColor.YELLOW + "You killed " + playerToBeKilled.getDisplayName() + "."); } else if (strings.length == 0) { player.setHealth(0); player.sendMessage(ChatColor.GOLD + "§lDamn! " + ChatColor.YELLOW + "You killed " + player.getDisplayName() + "."); } return true; } }
UTF-8
Java
1,062
java
kill.java
Java
[]
null
[]
package commands; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class kill implements CommandExecutor { @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { if (!(commandSender instanceof Player)) {return true;} Player player = (Player) commandSender; if (strings.length > 0) { Player playerToBeKilled = Bukkit.getPlayer(strings[0]); playerToBeKilled.setHealth(0); player.sendMessage(ChatColor.GOLD + "§lDamn! " + ChatColor.YELLOW + "You killed " + playerToBeKilled.getDisplayName() + "."); } else if (strings.length == 0) { player.setHealth(0); player.sendMessage(ChatColor.GOLD + "§lDamn! " + ChatColor.YELLOW + "You killed " + player.getDisplayName() + "."); } return true; } }
1,062
0.651887
0.64717
28
35.857143
35.780796
137
false
false
0
0
0
0
0
0
0.642857
false
false
2
d7ba2209069ef98eb907164612bef600639402bf
14,121,852,494,934
43aa135f1d0983b5a8a8455857931c720d8787df
/oms/web3-NewDc/application/front/test/web3-inform/test/java/webbroker3/inform/message/WEB3InformAccSwElecDeliApplyInpRequestTest.java
c334684eb2e88fa291e7930f0385d25366af306b
[ "Apache-2.0", "W3C-19980720", "Apache-1.1", "BSD-2-Clause" ]
permissive
leegine/COMS
https://github.com/leegine/COMS
d8637ee07d0d0cc83187cf216c5b423d19ce9c43
f8d9027ca0b6f3656843d908b0c6b95600266193
refs/heads/master
2020-04-18T05:37:41.079000
2019-01-29T08:31:38
2019-01-29T08:31:38
167,285,652
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2011.04.07.01.31.18; author zhang-tengyu; state Exp; branches; next ; deltatype text; kopt kv; permissions 666; commitid 5444d9d078c63f4; filename WEB3InformAccSwElecDeliApplyInpRequestTest.java; desc @@ 1.1 log @*** empty log message *** @ text @/** Copyright : (株)大和総研 証券ソリューションシステム第二部 File Name : 口座切替・電子交付申込入力リクエスト(WEB3InformAccSwElecDeliApplyInpRequestTest.java) Author Name : Daiwa Institute of Research Revision History : 2007/09/21 孫洪江 (中訊) 仕様変更モデル110 */ package webbroker3.inform.message; import webbroker3.common.WEB3BaseException; import webbroker3.common.WEB3ErrorCatalog; import webbroker3.mock.TestBaseForMock; import webbroker3.util.WEB3LogUtility; public class WEB3InformAccSwElecDeliApplyInpRequestTest extends TestBaseForMock { /** * ログユーティリティ<BR> */ private static WEB3LogUtility log = WEB3LogUtility .getInstance(WEB3InformAccSwElecDeliApplyInpRequestTest.class); public WEB3InformAccSwElecDeliApplyInpRequestTest(String arg0) { super(arg0); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } // 1) @連絡種別のチェック //  @1−1) @未入力の場合、例外をスローする。 public void testValidate_0001() { String STR_METHOD_NAME = ".testValidate_0001()"; log.entering(TEST_START + STR_METHOD_NAME); WEB3InformAccSwElecDeliApplyInpRequest l_request = new WEB3InformAccSwElecDeliApplyInpRequest(); l_request.informType = null; try { l_request.validate(); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } catch (WEB3BaseException l_ex) { log.debug(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); assertEquals(WEB3ErrorCatalog.BUSINESS_ERROR_01817, l_ex.getErrorInfo()); } catch (Exception l_ex) { log.error(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } } //正常 public void testValidate_0002() { String STR_METHOD_NAME = ".testValidate_0002()"; log.entering(TEST_START + STR_METHOD_NAME); WEB3InformAccSwElecDeliApplyInpRequest l_request = new WEB3InformAccSwElecDeliApplyInpRequest(); l_request.informType = "1"; try { l_request.validate(); log.exiting(TEST_END + STR_METHOD_NAME); } catch (WEB3BaseException l_ex) { log.debug(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } catch (Exception l_ex) { log.error(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } } } @
SHIFT_JIS
Java
3,206
java
WEB3InformAccSwElecDeliApplyInpRequestTest.java
Java
[ { "context": "ment\t@// @;\n\n\n1.1\ndate\t2011.04.07.01.31.18;\tauthor zhang-tengyu;\tstate Exp;\nbranches;\nnext\t;\ndeltatype\ttext;\nkopt", "end": 108, "score": 0.9956886768341064, "start": 96, "tag": "USERNAME", "value": "zhang-tengyu" } ]
null
[]
head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2011.04.07.01.31.18; author zhang-tengyu; state Exp; branches; next ; deltatype text; kopt kv; permissions 666; commitid 5444d9d078c63f4; filename WEB3InformAccSwElecDeliApplyInpRequestTest.java; desc @@ 1.1 log @*** empty log message *** @ text @/** Copyright : (株)大和総研 証券ソリューションシステム第二部 File Name : 口座切替・電子交付申込入力リクエスト(WEB3InformAccSwElecDeliApplyInpRequestTest.java) Author Name : Daiwa Institute of Research Revision History : 2007/09/21 孫洪江 (中訊) 仕様変更モデル110 */ package webbroker3.inform.message; import webbroker3.common.WEB3BaseException; import webbroker3.common.WEB3ErrorCatalog; import webbroker3.mock.TestBaseForMock; import webbroker3.util.WEB3LogUtility; public class WEB3InformAccSwElecDeliApplyInpRequestTest extends TestBaseForMock { /** * ログユーティリティ<BR> */ private static WEB3LogUtility log = WEB3LogUtility .getInstance(WEB3InformAccSwElecDeliApplyInpRequestTest.class); public WEB3InformAccSwElecDeliApplyInpRequestTest(String arg0) { super(arg0); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } // 1) @連絡種別のチェック //  @1−1) @未入力の場合、例外をスローする。 public void testValidate_0001() { String STR_METHOD_NAME = ".testValidate_0001()"; log.entering(TEST_START + STR_METHOD_NAME); WEB3InformAccSwElecDeliApplyInpRequest l_request = new WEB3InformAccSwElecDeliApplyInpRequest(); l_request.informType = null; try { l_request.validate(); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } catch (WEB3BaseException l_ex) { log.debug(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); assertEquals(WEB3ErrorCatalog.BUSINESS_ERROR_01817, l_ex.getErrorInfo()); } catch (Exception l_ex) { log.error(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } } //正常 public void testValidate_0002() { String STR_METHOD_NAME = ".testValidate_0002()"; log.entering(TEST_START + STR_METHOD_NAME); WEB3InformAccSwElecDeliApplyInpRequest l_request = new WEB3InformAccSwElecDeliApplyInpRequest(); l_request.informType = "1"; try { l_request.validate(); log.exiting(TEST_END + STR_METHOD_NAME); } catch (WEB3BaseException l_ex) { log.debug(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } catch (Exception l_ex) { log.error(TEST_END + STR_METHOD_NAME, l_ex); log.exiting(TEST_END + STR_METHOD_NAME); fail(); } } } @
3,206
0.617784
0.586596
132
21.833334
24.237202
104
false
false
0
0
0
0
0
0
0.5
false
false
2
1aa56903a20c9062419861eec5456596fca6b90a
5,385,889,005,082
de5a08a9ef167860f893695e8ffd93dc114d91d9
/src/main/java/com/github/cobrijani/security/TokenProvider.java
51e43109de893e16cd8cc588dbd9cfbe071bf7ec
[ "MIT" ]
permissive
Cobrijani/jwt-security-autoconfigure
https://github.com/Cobrijani/jwt-security-autoconfigure
f22a8a9c1da3f253f245da38800db598f0f3c4b1
f1b92a86b2209455eee7911681806685048cf02b
refs/heads/master
2021-01-19T13:18:44.037000
2019-06-11T10:25:03
2019-06-11T10:25:03
82,382,138
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.github.cobrijani.security; import org.springframework.security.core.Authentication; /** * Service that manipulates with Json Web Tokens * Created by SBratic on 10/31/2016. */ public interface TokenProvider { /** * Creates token based on authentication details * * @param authentication authenticatioon details * @param rememberMe is user remember me * @return json web token */ String createToken(Authentication authentication, Boolean rememberMe); /** * Checks whether token is valid * * @param token token to be checked * @return is valid or not */ boolean validateToken(String token); /** * Extract authentication from token * * @param token token to be extracted from * @return authentication details */ Authentication getAuthentication(String token); }
UTF-8
Java
843
java
TokenProvider.java
Java
[ { "context": "package com.github.cobrijani.security;\n\nimport org.springframework.security.co", "end": 28, "score": 0.7968127131462097, "start": 19, "tag": "USERNAME", "value": "cobrijani" }, { "context": "hat manipulates with Json Web Tokens\n * Created by SBratic on 10/31/2016.\n */\npublic interface TokenProvider", "end": 172, "score": 0.9995852112770081, "start": 165, "tag": "USERNAME", "value": "SBratic" } ]
null
[]
package com.github.cobrijani.security; import org.springframework.security.core.Authentication; /** * Service that manipulates with Json Web Tokens * Created by SBratic on 10/31/2016. */ public interface TokenProvider { /** * Creates token based on authentication details * * @param authentication authenticatioon details * @param rememberMe is user remember me * @return json web token */ String createToken(Authentication authentication, Boolean rememberMe); /** * Checks whether token is valid * * @param token token to be checked * @return is valid or not */ boolean validateToken(String token); /** * Extract authentication from token * * @param token token to be extracted from * @return authentication details */ Authentication getAuthentication(String token); }
843
0.710558
0.701068
36
22.416666
21.159941
72
false
false
0
0
0
0
0
0
0.166667
false
false
2
2e3a2e151004e000cd546f3b62b399eb7ef86cc9
20,280,835,603,629
6ab9e3d3816cea01ac7896fe43acb1828c034fdd
/src/main/java/lightriders/evaluation/IRoundsEstimator.java
a843fa567003e3432ff09db6d854c90051412236
[]
no_license
brandondong/Lightriders-AI
https://github.com/brandondong/Lightriders-AI
a93db4a6039079fd13a4622c692ae2f3950cee88
6c857fa6ded172f26a5d2a9c1c6f3fee15ef6298
refs/heads/master
2020-03-21T02:20:04.382000
2018-09-08T08:29:57
2018-09-08T08:29:57
137,993,826
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package lightriders.evaluation; import lightriders.ai.Player; import lightriders.game.Board; public interface IRoundsEstimator { /** * Estimates the rounds left on a board for a specified player. * * @param board * The board to estimate for * @param player * The player to estimate for * @return The number of estimated rounds left */ int roundsLeft(Board board, Player player); }
UTF-8
Java
445
java
IRoundsEstimator.java
Java
[]
null
[]
package lightriders.evaluation; import lightriders.ai.Player; import lightriders.game.Board; public interface IRoundsEstimator { /** * Estimates the rounds left on a board for a specified player. * * @param board * The board to estimate for * @param player * The player to estimate for * @return The number of estimated rounds left */ int roundsLeft(Board board, Player player); }
445
0.660674
0.660674
19
21.421053
19.634331
64
false
false
0
0
0
0
0
0
0.789474
false
false
2
3ce3697910ba1c32ae1fb8abaa8221750a70abcc
19,791,209,349,657
9a4c60b3b8345b81cec6e8c3fd4781698c6a7010
/src/main/java/org/fundacionjala/coding/Fernando/movies/Movie.java
b35edae707ad6aa1f200f79826f68828500b83e9
[]
no_license
NandoOU/coding
https://github.com/NandoOU/coding
704b518098a2a7604d555409145ed9ba0ea655a6
23ffe782adf2812c7390c758417a02267ff70048
refs/heads/develop
2020-04-05T22:41:27.234000
2017-03-25T23:07:59
2017-03-25T23:07:59
83,051,159
0
0
null
true
2017-02-24T14:47:03
2017-02-24T14:47:02
2017-02-21T18:01:54
2017-02-21T18:01:53
5
0
0
0
null
null
null
package org.fundacionjala.coding.Fernando.movies; /** * Created by Administrator on 3/21/2017. */ public abstract class Movie { private String title; /** * @param title param. */ public Movie(final String title) { this.title = title; } /** * @param daysRented param. * @return double value. */ public abstract double calculateAmount(final int daysRented); /** * @param daysRented param. * @return int value. */ public abstract int calculateFrequentRenterPoints(final int daysRented); /** * @return String value. */ public String getTitle() { return title; } }
UTF-8
Java
677
java
Movie.java
Java
[]
null
[]
package org.fundacionjala.coding.Fernando.movies; /** * Created by Administrator on 3/21/2017. */ public abstract class Movie { private String title; /** * @param title param. */ public Movie(final String title) { this.title = title; } /** * @param daysRented param. * @return double value. */ public abstract double calculateAmount(final int daysRented); /** * @param daysRented param. * @return int value. */ public abstract int calculateFrequentRenterPoints(final int daysRented); /** * @return String value. */ public String getTitle() { return title; } }
677
0.602659
0.592319
34
18.911764
18.907465
76
false
false
0
0
0
0
0
0
0.176471
false
false
2
467f5670fdc5338a34d988ad219f8f7d7bb74387
5,720,896,487,853
4f577c88b7e24618cc4cf4b2db626eabdd5074ae
/longjian-houseqm-app/src/main/java/com/longfor/longjian/houseqm/app/controller/oapiv3houseqm/HouseqmStatController.java
64c91be409ac3a6ce64dacdd7b8dbefb224b0e67
[]
no_license
zhourihu5/longjian-houseqm-server
https://github.com/zhourihu5/longjian-houseqm-server
4744172b1978337498d96f7099c4ae455ca47b92
24322ac37cde3b5b637554ffb1cfc1d181ad1e32
refs/heads/master
2023-08-04T18:10:36.302000
2019-03-29T08:52:05
2019-03-29T08:52:05
409,153,730
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.longfor.longjian.houseqm.app.controller.oapiv3houseqm; import com.google.common.collect.Lists; import com.longfor.longjian.common.base.LjBaseResponse; import com.longfor.longjian.common.util.CtrlTool; import com.longfor.longjian.common.util.SessionInfo; import com.longfor.longjian.common.util.StringUtil; import com.longfor.longjian.houseqm.app.req.StatAreaSituationReq; import com.longfor.longjian.houseqm.app.req.StatTaskSituationMembersCheckerReq; import com.longfor.longjian.houseqm.app.req.StatTaskSituationMembersRepairerReq; import com.longfor.longjian.houseqm.app.req.houseqmstat.*; import com.longfor.longjian.houseqm.app.service.IHouseqmStatService; import com.longfor.longjian.houseqm.app.service.IHouseqmStatisticService; import com.longfor.longjian.houseqm.app.utils.CtrlToolUtils; import com.longfor.longjian.houseqm.app.vo.*; import com.longfor.longjian.houseqm.app.vo.houseqmstat.*; import com.longfor.longjian.houseqm.consts.RepossessionStatusEnum; import com.longfor.longjian.houseqm.util.DateUtil; import com.longfor.longjian.houseqm.util.MathUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; /** * http://192.168.37.159:3000/project/8/interface/api/298 项目/任务检查人员统计 * <p> * http://192.168.37.159:3000/project/8/interface/api/304 项目任务进度统计信息 * http://192.168.37.159:3000/project/8/interface/api/306 项目任务信息汇总 * http://192.168.37.159:3000/project/8/interface/api/310 获取区域列表 * http://192.168.37.159:3000/project/8/interface/api/314 获取任务详情-总体情况 * http://192.168.37.159:3000/project/8/interface/api/318 获取整改追踪信息 * http://192.168.37.159:3000/project/8/interface/api/322 获取区域下任务信息 * * @author lipeishuai * @date 2018/11/17 15:07 */ @RestController @RequestMapping("oapi/v3/houseqm/") @Slf4j public class HouseqmStatController { private static final String SEE = "项目.移动验房.统计.查看"; private static final String GCJCSEE = "项目.工程检查.统计.查看"; private static final String YMDHMS = "yyyy-MM-dd hh:mm:ss"; private static final String YMD = "yyyy-MM-dd"; @Resource private IHouseqmStatService houseqmStatService; @Resource private IHouseqmStatisticService houseqmStatisticService; @Resource private CtrlTool ctrlTool; @Resource private SessionInfo sessionInfo; @RequestMapping(value = "stat/category_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatCategoryStatRspVo> categoryStat(HttpServletRequest request, @Validated StatCategoryStatReq req) { LjBaseResponse<StatCategoryStatRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } if (req.getArea_id() == null) req.setArea_id(0); Date beginOn = DateUtil.timeStampToDate(0, YMD); Date endOn = DateUtil.timeStampToDate(0, YMD); if (req.getBegin_on() != null && !"".equals(req.getBegin_on())) { beginOn = DateUtil.strToDate(req.getBegin_on(), YMD); } if (req.getEnd_on() != null && !"".equals(req.getEnd_on())) { Date t = DateUtil.strToDate(req.getEnd_on(), YMD); endOn = DateUtil.dateAddDay(t, 1); } StatCategoryStatRspVo result = houseqmStatService.searchHouseQmIssueCategoryStatByProjTaskIdAreaIdBeginOnEndOn(req.getProject_id(), req.getTask_id(), req.getArea_id(), beginOn, endOn); response.setData(result); return response; } @RequestMapping(value = "stat/inspection_situation_search", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatInspectionSituationSearchRspVo> inspectionSituationSearch(HttpServletRequest request, @Validated StatInspectionSituationSearchReq req) { LjBaseResponse<StatInspectionSituationSearchRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } if (req.getArea_id() == null) req.setArea_id(0); if (req.getIssue_status() == null) req.setIssue_status(2); if (req.getStatus() == null) req.setStatus(0); if (!req.getStatus().equals(RepossessionStatusEnum.Accept.getId())) { req.setStart_time(""); req.setEnd_time(""); } // 时间设置问题 可能造成数据结果不一致,修改 Date startTime = DateUtil.timeStampToDate(0, YMD); Date endTime = DateUtil.timeStampToDate(0, YMD); if (req.getStart_time().length() > 0) { startTime = DateUtil.strToDate(req.getStart_time() + " 00:00:00", YMDHMS); endTime = DateUtil.strToDate(req.getEnd_time() + " 23:59:59", YMDHMS); } List<Integer> areaIds = houseqmStatService.searchRepossessInspectionAreaIdsByConditions(req.getProject_id(), req.getTask_id(), req.getArea_id(), req.getStatus(), req.getIssue_status(), startTime, endTime); StatInspectionSituationSearchRspVo data = new StatInspectionSituationSearchRspVo(); data.setTotal(areaIds.size()); List<Integer> ids = splitSliceByPaged(areaIds, req.getPage(), req.getPage_size()); List<InspectionHouseStatusInfoVo> details = houseqmStatService.formatFenhuHouseInspectionStatusInfoByAreaIds(req.getIssue_status(),req.getTask_id(), ids); List<HouseQmStatInspectionSituationRspVo> items = new ArrayList<>(); for (InspectionHouseStatusInfoVo detail : details) { HouseQmStatInspectionSituationRspVo item = new HouseQmStatInspectionSituationRspVo(); item.setArea_id(detail.getAreaId()); item.setArea_name(detail.getAreaName()); item.setArea_path(detail.getAreaPathName()); item.setIssue_approveded_count(detail.getIssueApprovededCount()); item.setIssue_count(detail.getIssueCount()); item.setIssue_repaired_count(detail.getIssueRepairedCount()); item.setStatus(detail.getStatus()); item.setStatus_name(detail.getStatusName()); item.setTask_id(detail.getTaskId()); items.add(item); } if (!items.isEmpty()) data.setItems(items);// go 源码 返回为null 所以需要进行判断 response.setData(data); return response; } private List<Integer> splitSliceByPaged(List<Integer> areaIds, int page, int pageSize) { int start; if (page <= 0) { page = 1; } start = (page - 1) * pageSize; if (start >= areaIds.size()) return areaIds; int end = start + pageSize; if (end > areaIds.size()) { end = areaIds.size(); } List<Integer> ids = Lists.newArrayList(); for (int i = start; i < end; i++) { ids.add(areaIds.get(i)); } return ids; } @RequestMapping(value = "stat_houseqm/checker_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<CheckerStatListVo> checkerStat(HttpServletRequest request, @Valid StatHouseqmCheckerStatReq req) { LjBaseResponse<CheckerStatListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); CheckerStatListVo checkerStatListVo = houseqmStatService.searchCheckerIssueStatisticByProjIdAndTaskId(req.getProject_id(), taskIdList); response.setData(checkerStatListVo); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_daily", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<ProjectDailyListVo> taskSituationDaily(HttpServletRequest request, @Valid StatTaskSituationDailyReq req) { LjBaseResponse<ProjectDailyListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); ProjectDailyListVo pdv = houseqmStatService.searchTaskSituationDailyByProjTaskIdInOnPage(req.getProject_id(), taskIdList, req.getPage(), req.getPage_size()); response.setData(pdv); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_overall", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<ProjectOveralListVo> taskSituationOverall(HttpServletRequest request, @Valid StatTaskSituationOverallReq req) { LjBaseResponse<ProjectOveralListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); ProjectOveralListVo projectOveralListVo = new ProjectOveralListVo(); ProjectOveralListVo.ProjectOveralVo totalStat = projectOveralListVo.new ProjectOveralVo(); ArrayList<ProjectOveralListVo.ProjectOveralVo> items = Lists.newArrayList(); totalStat.setTask_name("合计"); totalStat.setIssue_count(0); totalStat.setRecords_count(0); totalStat.setChecked_count(0); for (Integer taskId : taskIdList) { try { ProjectOveralListVo.ProjectOveralVo item = houseqmStatService.getInspectTaskStatByProjTaskId(req.getProject_id(), taskId); if (item == null) { continue; } totalStat.setChecked_count(totalStat.getChecked_count() + item.getChecked_count()); totalStat.setIssue_count(totalStat.getIssue_count() + item.getIssue_count()); totalStat.setRecords_count(totalStat.getRecords_count() + item.getRecords_count()); items.add(item); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } } items.add(totalStat); projectOveralListVo.setItems(items); response.setData(projectOveralListVo); return response; } @RequestMapping(value = "stat/task_area_list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<TaskAreaListVo> taskAreaList(HttpServletRequest request, @Valid StatTaskAreaListReq req) { LjBaseResponse<TaskAreaListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { if (req.getTyp() == null) req.setTyp(0); TaskAreaListVo talv = houseqmStatService.searchAreasByProjTaskIdTyp(req.getProject_id(), req.getTask_id(), req.getTyp()); response.setData(talv); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/area_situation_task_list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<AreaTaskListVo> areaSituationTaskList(HttpServletRequest request, @Valid StatAreaSituationTaskListReq req) { LjBaseResponse<AreaTaskListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { AreaTaskListVo areaTaskListVo = houseqmStatService.searchHouseQmCheckTaskByProjIdAreaIdCategoryClsIn(req.getProject_id(), req.getArea_id(), Arrays.asList(req.getCategory_cls())); response.setData(areaTaskListVo); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_detail", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<TaskStatVo> taskDetail(HttpServletRequest request, @Valid StatTaskDetailReq req) { LjBaseResponse<TaskStatVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { if (req.getArea_id() == null) req.setArea_id(0); TaskStatVo.IssueStatVo issue = houseqmStatisticService.getCheckTaskIssueTypeStatByTaskIdAreaId(req.getTask_id(), req.getArea_id()); TaskStatVo.HouseStatVo house = houseqmStatisticService.getHouseQmCheckTaskHouseStatByTaskId(req.getProject_id(), req.getTask_id(), req.getArea_id()); house.setHouse_checked_percent(MathUtil.getPercentage(house.getChecked_count(), house.getHouse_count())); house.setHouse_repaired_percent(MathUtil.getPercentage(house.getRepaired_count(), house.getHas_issue_count())); house.setHouse_approveded_percent(MathUtil.getPercentage(house.getApproved_count(), house.getRepaired_count())); TaskStatVo taskStatVo = new TaskStatVo(); taskStatVo.setIssue(issue); taskStatVo.setHouse(house); response.setData(taskStatVo); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_repair_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationRepairStatRsp> taskSituationRepairStat(HttpServletRequest request, @Valid StatTaskSituationRepairStatReq req) { LjBaseResponse<StatTaskSituationRepairStatRsp> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } Date t = null; try { t = new SimpleDateFormat(YMDHMS).parse("0001-01-01 00:00:00"); } catch (ParseException e) { log.error(e.getMessage()); } try { TaskRepairStatVo taskRepairStatVo = houseqmStatisticService.searchIssueRepairStatisticByProjTaskIdAreaIdBeginOnEndOn(req.getProject_id(), req.getTask_id(), 0, t, t); TaskRepairStatVo.TaskRepairVo item = taskRepairStatVo.getItem(); StatTaskSituationRepairStatRsp res = new StatTaskSituationRepairStatRsp(); StatTaskSituationRepairStatRsp.HouseQmStatTaskDetailRepairerStatRsp result = res.new HouseQmStatTaskDetailRepairerStatRsp(); result.setInitime_finish(item.getInitime_finish()); result.setInitime_finish_count(item.getInitime_finish_count()); result.setInitime_unfinish(item.getInitime_unfinish()); result.setInitime_unfinish_count(item.getInitime_unfinish_count()); result.setNo_plan_end_on(item.getNo_plan_end_on()); result.setNo_plan_end_on_count(item.getNo_plan_end_on_count()); result.setOvertime_finish(item.getOvertime_finish()); result.setOvertime_finish_count(item.getOvertime_finish_count()); result.setOvertime_unfinish(item.getOvertime_unfinish()); result.setOvertime_unfinish_count(item.getOvertime_unfinish_count()); res.setItem(result); response.setData(res); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_members_checker", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationMembersCheckerRspVo> taskSituationMembersChecker(HttpServletRequest request, @Valid StatTaskSituationMembersCheckerReq req) { LjBaseResponse<StatTaskSituationMembersCheckerRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); if ("".equals(req.getBegin_on())) { req.setBegin_on("1970-01-01"); } Date start = DateUtil.strToDate(req.getBegin_on(), YMD); Date end = null; if ("".equals(req.getEnd_on())) { end = new Date(); } else { end = DateUtil.strToDate(req.getEnd_on(), YMD); } List<HouseQmStatTaskDetailMemberCheckerRspVo> result = houseqmStatService.searchCheckerIssueStatusStatByProjTaskIdBetweenTime(req.getProject_id(), req.getTask_id(), start, DateUtil.dateAddDay(end, 1)); StatTaskSituationMembersCheckerRspVo data = new StatTaskSituationMembersCheckerRspVo(); data.setItems(result); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } return response; } @RequestMapping(value = "stat/task_situation_members_repairer", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationMembersRepairerRspVo> taskSituationMembersRepairer(HttpServletRequest request, @Valid StatTaskSituationMembersRepairerReq req) { LjBaseResponse<StatTaskSituationMembersRepairerRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); if ("".equals(req.getBegin_on())) { req.setBegin_on("1970-01-01"); } Date start = DateUtil.strToDate(req.getBegin_on(), YMD); Date end = null; if ("".equals(req.getEnd_on())) { end = new Date(); } else { end = DateUtil.strToDate(req.getEnd_on(), YMD); } List<HouseQmStatTaskDetailMemberRepairerRspVo> res = houseqmStatService.searchRepaireIssueStatusStatByProjTaskIdBetweenTime(req.getProject_id(), req.getTask_id(), start, DateUtil.dateAddDay(end, 1)); StatTaskSituationMembersRepairerRspVo data = new StatTaskSituationMembersRepairerRspVo(); data.setItems(res); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } return response; } @RequestMapping(value = "stat/area_situation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatAreaSituationRspVo> areaSituation(HttpServletRequest request, @Valid StatAreaSituationReq req) { LjBaseResponse<StatAreaSituationRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { HouseQmStatAreaSituationIssueRspVo result = houseqmStatService.getAreaIssueTypeStatByProjectIdAreaIdCategoryCls(req.getProject_id(), req.getArea_id(), req.getCategory_cls()); StatAreaSituationRspVo data = new StatAreaSituationRspVo(); data.setIssue(result); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); return response; } return response; } }
UTF-8
Java
21,522
java
HouseqmStatController.java
Java
[ { "context": ".util.Date;\nimport java.util.List;\n\n/**\n * http://192.168.37.159:3000/project/8/interface/api/298 项目/任务检查人员统计\n * ", "end": 1653, "score": 0.8923929929733276, "start": 1639, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "8/interface/api/298 项目/任务检查人员统计\n * <p>\n * http://192.168.37.159:3000/project/8/interface/api/304 项目任务进度统计信息\n * ht", "end": 1731, "score": 0.999555230140686, "start": 1717, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "/project/8/interface/api/304 项目任务进度统计信息\n * http://192.168.37.159:3000/project/8/interface/api/306 项目任务信", "end": 1789, "score": 0.9963663220405579, "start": 1786, "tag": "IP_ADDRESS", "value": "192" }, { "context": "ject/8/interface/api/304 项目任务进度统计信息\n * http://192.168.37.159:3000/project/8/interface/api/306 项目任务信息汇总\n * htt", "end": 1800, "score": 0.9848871231079102, "start": 1790, "tag": "IP_ADDRESS", "value": "168.37.159" }, { "context": "0/project/8/interface/api/306 项目任务信息汇总\n * http://192.168.37.159:3000/project/8/interface/api/310 获取区域列表\n * http:", "end": 1868, "score": 0.9997045397758484, "start": 1854, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "000/project/8/interface/api/310 获取区域列表\n * http://192.168.37.159:3000/project/8/interface/api/314 获取任务详情-总体情况\n * ", "end": 1934, "score": 0.9930596947669983, "start": 1920, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "roject/8/interface/api/314 获取任务详情-总体情况\n * http://192.168.37.159:3000/project/8/interface/api/318 获取整改追踪信息\n * htt", "end": 2005, "score": 0.9990713000297546, "start": 1991, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "0/project/8/interface/api/318 获取整改追踪信息\n * http://192.168.37.159:3000/project/8/interface/api/322 获取区域下任务信息\n *\n *", "end": 2073, "score": 0.9649545550346375, "start": 2059, "tag": "IP_ADDRESS", "value": "192.168.37.159" }, { "context": "oject/8/interface/api/322 获取区域下任务信息\n *\n * @author lipeishuai\n * @date 2018/11/17 15:07\n */\n@RestController\n@Re", "end": 2142, "score": 0.9990285634994507, "start": 2132, "tag": "USERNAME", "value": "lipeishuai" } ]
null
[]
package com.longfor.longjian.houseqm.app.controller.oapiv3houseqm; import com.google.common.collect.Lists; import com.longfor.longjian.common.base.LjBaseResponse; import com.longfor.longjian.common.util.CtrlTool; import com.longfor.longjian.common.util.SessionInfo; import com.longfor.longjian.common.util.StringUtil; import com.longfor.longjian.houseqm.app.req.StatAreaSituationReq; import com.longfor.longjian.houseqm.app.req.StatTaskSituationMembersCheckerReq; import com.longfor.longjian.houseqm.app.req.StatTaskSituationMembersRepairerReq; import com.longfor.longjian.houseqm.app.req.houseqmstat.*; import com.longfor.longjian.houseqm.app.service.IHouseqmStatService; import com.longfor.longjian.houseqm.app.service.IHouseqmStatisticService; import com.longfor.longjian.houseqm.app.utils.CtrlToolUtils; import com.longfor.longjian.houseqm.app.vo.*; import com.longfor.longjian.houseqm.app.vo.houseqmstat.*; import com.longfor.longjian.houseqm.consts.RepossessionStatusEnum; import com.longfor.longjian.houseqm.util.DateUtil; import com.longfor.longjian.houseqm.util.MathUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; /** * http://192.168.37.159:3000/project/8/interface/api/298 项目/任务检查人员统计 * <p> * http://192.168.37.159:3000/project/8/interface/api/304 项目任务进度统计信息 * http://192.168.37.159:3000/project/8/interface/api/306 项目任务信息汇总 * http://192.168.37.159:3000/project/8/interface/api/310 获取区域列表 * http://192.168.37.159:3000/project/8/interface/api/314 获取任务详情-总体情况 * http://192.168.37.159:3000/project/8/interface/api/318 获取整改追踪信息 * http://192.168.37.159:3000/project/8/interface/api/322 获取区域下任务信息 * * @author lipeishuai * @date 2018/11/17 15:07 */ @RestController @RequestMapping("oapi/v3/houseqm/") @Slf4j public class HouseqmStatController { private static final String SEE = "项目.移动验房.统计.查看"; private static final String GCJCSEE = "项目.工程检查.统计.查看"; private static final String YMDHMS = "yyyy-MM-dd hh:mm:ss"; private static final String YMD = "yyyy-MM-dd"; @Resource private IHouseqmStatService houseqmStatService; @Resource private IHouseqmStatisticService houseqmStatisticService; @Resource private CtrlTool ctrlTool; @Resource private SessionInfo sessionInfo; @RequestMapping(value = "stat/category_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatCategoryStatRspVo> categoryStat(HttpServletRequest request, @Validated StatCategoryStatReq req) { LjBaseResponse<StatCategoryStatRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } if (req.getArea_id() == null) req.setArea_id(0); Date beginOn = DateUtil.timeStampToDate(0, YMD); Date endOn = DateUtil.timeStampToDate(0, YMD); if (req.getBegin_on() != null && !"".equals(req.getBegin_on())) { beginOn = DateUtil.strToDate(req.getBegin_on(), YMD); } if (req.getEnd_on() != null && !"".equals(req.getEnd_on())) { Date t = DateUtil.strToDate(req.getEnd_on(), YMD); endOn = DateUtil.dateAddDay(t, 1); } StatCategoryStatRspVo result = houseqmStatService.searchHouseQmIssueCategoryStatByProjTaskIdAreaIdBeginOnEndOn(req.getProject_id(), req.getTask_id(), req.getArea_id(), beginOn, endOn); response.setData(result); return response; } @RequestMapping(value = "stat/inspection_situation_search", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatInspectionSituationSearchRspVo> inspectionSituationSearch(HttpServletRequest request, @Validated StatInspectionSituationSearchReq req) { LjBaseResponse<StatInspectionSituationSearchRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } if (req.getArea_id() == null) req.setArea_id(0); if (req.getIssue_status() == null) req.setIssue_status(2); if (req.getStatus() == null) req.setStatus(0); if (!req.getStatus().equals(RepossessionStatusEnum.Accept.getId())) { req.setStart_time(""); req.setEnd_time(""); } // 时间设置问题 可能造成数据结果不一致,修改 Date startTime = DateUtil.timeStampToDate(0, YMD); Date endTime = DateUtil.timeStampToDate(0, YMD); if (req.getStart_time().length() > 0) { startTime = DateUtil.strToDate(req.getStart_time() + " 00:00:00", YMDHMS); endTime = DateUtil.strToDate(req.getEnd_time() + " 23:59:59", YMDHMS); } List<Integer> areaIds = houseqmStatService.searchRepossessInspectionAreaIdsByConditions(req.getProject_id(), req.getTask_id(), req.getArea_id(), req.getStatus(), req.getIssue_status(), startTime, endTime); StatInspectionSituationSearchRspVo data = new StatInspectionSituationSearchRspVo(); data.setTotal(areaIds.size()); List<Integer> ids = splitSliceByPaged(areaIds, req.getPage(), req.getPage_size()); List<InspectionHouseStatusInfoVo> details = houseqmStatService.formatFenhuHouseInspectionStatusInfoByAreaIds(req.getIssue_status(),req.getTask_id(), ids); List<HouseQmStatInspectionSituationRspVo> items = new ArrayList<>(); for (InspectionHouseStatusInfoVo detail : details) { HouseQmStatInspectionSituationRspVo item = new HouseQmStatInspectionSituationRspVo(); item.setArea_id(detail.getAreaId()); item.setArea_name(detail.getAreaName()); item.setArea_path(detail.getAreaPathName()); item.setIssue_approveded_count(detail.getIssueApprovededCount()); item.setIssue_count(detail.getIssueCount()); item.setIssue_repaired_count(detail.getIssueRepairedCount()); item.setStatus(detail.getStatus()); item.setStatus_name(detail.getStatusName()); item.setTask_id(detail.getTaskId()); items.add(item); } if (!items.isEmpty()) data.setItems(items);// go 源码 返回为null 所以需要进行判断 response.setData(data); return response; } private List<Integer> splitSliceByPaged(List<Integer> areaIds, int page, int pageSize) { int start; if (page <= 0) { page = 1; } start = (page - 1) * pageSize; if (start >= areaIds.size()) return areaIds; int end = start + pageSize; if (end > areaIds.size()) { end = areaIds.size(); } List<Integer> ids = Lists.newArrayList(); for (int i = start; i < end; i++) { ids.add(areaIds.get(i)); } return ids; } @RequestMapping(value = "stat_houseqm/checker_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<CheckerStatListVo> checkerStat(HttpServletRequest request, @Valid StatHouseqmCheckerStatReq req) { LjBaseResponse<CheckerStatListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); CheckerStatListVo checkerStatListVo = houseqmStatService.searchCheckerIssueStatisticByProjIdAndTaskId(req.getProject_id(), taskIdList); response.setData(checkerStatListVo); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_daily", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<ProjectDailyListVo> taskSituationDaily(HttpServletRequest request, @Valid StatTaskSituationDailyReq req) { LjBaseResponse<ProjectDailyListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); ProjectDailyListVo pdv = houseqmStatService.searchTaskSituationDailyByProjTaskIdInOnPage(req.getProject_id(), taskIdList, req.getPage(), req.getPage_size()); response.setData(pdv); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_overall", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<ProjectOveralListVo> taskSituationOverall(HttpServletRequest request, @Valid StatTaskSituationOverallReq req) { LjBaseResponse<ProjectOveralListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } List<Integer> taskIdList = StringUtil.strToInts(req.getTask_ids(), ","); ProjectOveralListVo projectOveralListVo = new ProjectOveralListVo(); ProjectOveralListVo.ProjectOveralVo totalStat = projectOveralListVo.new ProjectOveralVo(); ArrayList<ProjectOveralListVo.ProjectOveralVo> items = Lists.newArrayList(); totalStat.setTask_name("合计"); totalStat.setIssue_count(0); totalStat.setRecords_count(0); totalStat.setChecked_count(0); for (Integer taskId : taskIdList) { try { ProjectOveralListVo.ProjectOveralVo item = houseqmStatService.getInspectTaskStatByProjTaskId(req.getProject_id(), taskId); if (item == null) { continue; } totalStat.setChecked_count(totalStat.getChecked_count() + item.getChecked_count()); totalStat.setIssue_count(totalStat.getIssue_count() + item.getIssue_count()); totalStat.setRecords_count(totalStat.getRecords_count() + item.getRecords_count()); items.add(item); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } } items.add(totalStat); projectOveralListVo.setItems(items); response.setData(projectOveralListVo); return response; } @RequestMapping(value = "stat/task_area_list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<TaskAreaListVo> taskAreaList(HttpServletRequest request, @Valid StatTaskAreaListReq req) { LjBaseResponse<TaskAreaListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { if (req.getTyp() == null) req.setTyp(0); TaskAreaListVo talv = houseqmStatService.searchAreasByProjTaskIdTyp(req.getProject_id(), req.getTask_id(), req.getTyp()); response.setData(talv); } catch (Exception e) { log.warn(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/area_situation_task_list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<AreaTaskListVo> areaSituationTaskList(HttpServletRequest request, @Valid StatAreaSituationTaskListReq req) { LjBaseResponse<AreaTaskListVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { AreaTaskListVo areaTaskListVo = houseqmStatService.searchHouseQmCheckTaskByProjIdAreaIdCategoryClsIn(req.getProject_id(), req.getArea_id(), Arrays.asList(req.getCategory_cls())); response.setData(areaTaskListVo); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_detail", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<TaskStatVo> taskDetail(HttpServletRequest request, @Valid StatTaskDetailReq req) { LjBaseResponse<TaskStatVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { if (req.getArea_id() == null) req.setArea_id(0); TaskStatVo.IssueStatVo issue = houseqmStatisticService.getCheckTaskIssueTypeStatByTaskIdAreaId(req.getTask_id(), req.getArea_id()); TaskStatVo.HouseStatVo house = houseqmStatisticService.getHouseQmCheckTaskHouseStatByTaskId(req.getProject_id(), req.getTask_id(), req.getArea_id()); house.setHouse_checked_percent(MathUtil.getPercentage(house.getChecked_count(), house.getHouse_count())); house.setHouse_repaired_percent(MathUtil.getPercentage(house.getRepaired_count(), house.getHas_issue_count())); house.setHouse_approveded_percent(MathUtil.getPercentage(house.getApproved_count(), house.getRepaired_count())); TaskStatVo taskStatVo = new TaskStatVo(); taskStatVo.setIssue(issue); taskStatVo.setHouse(house); response.setData(taskStatVo); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_repair_stat", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationRepairStatRsp> taskSituationRepairStat(HttpServletRequest request, @Valid StatTaskSituationRepairStatReq req) { LjBaseResponse<StatTaskSituationRepairStatRsp> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } Date t = null; try { t = new SimpleDateFormat(YMDHMS).parse("0001-01-01 00:00:00"); } catch (ParseException e) { log.error(e.getMessage()); } try { TaskRepairStatVo taskRepairStatVo = houseqmStatisticService.searchIssueRepairStatisticByProjTaskIdAreaIdBeginOnEndOn(req.getProject_id(), req.getTask_id(), 0, t, t); TaskRepairStatVo.TaskRepairVo item = taskRepairStatVo.getItem(); StatTaskSituationRepairStatRsp res = new StatTaskSituationRepairStatRsp(); StatTaskSituationRepairStatRsp.HouseQmStatTaskDetailRepairerStatRsp result = res.new HouseQmStatTaskDetailRepairerStatRsp(); result.setInitime_finish(item.getInitime_finish()); result.setInitime_finish_count(item.getInitime_finish_count()); result.setInitime_unfinish(item.getInitime_unfinish()); result.setInitime_unfinish_count(item.getInitime_unfinish_count()); result.setNo_plan_end_on(item.getNo_plan_end_on()); result.setNo_plan_end_on_count(item.getNo_plan_end_on_count()); result.setOvertime_finish(item.getOvertime_finish()); result.setOvertime_finish_count(item.getOvertime_finish_count()); result.setOvertime_unfinish(item.getOvertime_unfinish()); result.setOvertime_unfinish_count(item.getOvertime_unfinish_count()); res.setItem(result); response.setData(res); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); } return response; } @RequestMapping(value = "stat/task_situation_members_checker", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationMembersCheckerRspVo> taskSituationMembersChecker(HttpServletRequest request, @Valid StatTaskSituationMembersCheckerReq req) { LjBaseResponse<StatTaskSituationMembersCheckerRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); if ("".equals(req.getBegin_on())) { req.setBegin_on("1970-01-01"); } Date start = DateUtil.strToDate(req.getBegin_on(), YMD); Date end = null; if ("".equals(req.getEnd_on())) { end = new Date(); } else { end = DateUtil.strToDate(req.getEnd_on(), YMD); } List<HouseQmStatTaskDetailMemberCheckerRspVo> result = houseqmStatService.searchCheckerIssueStatusStatByProjTaskIdBetweenTime(req.getProject_id(), req.getTask_id(), start, DateUtil.dateAddDay(end, 1)); StatTaskSituationMembersCheckerRspVo data = new StatTaskSituationMembersCheckerRspVo(); data.setItems(result); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } return response; } @RequestMapping(value = "stat/task_situation_members_repairer", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatTaskSituationMembersRepairerRspVo> taskSituationMembersRepairer(HttpServletRequest request, @Valid StatTaskSituationMembersRepairerReq req) { LjBaseResponse<StatTaskSituationMembersRepairerRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); if ("".equals(req.getBegin_on())) { req.setBegin_on("1970-01-01"); } Date start = DateUtil.strToDate(req.getBegin_on(), YMD); Date end = null; if ("".equals(req.getEnd_on())) { end = new Date(); } else { end = DateUtil.strToDate(req.getEnd_on(), YMD); } List<HouseQmStatTaskDetailMemberRepairerRspVo> res = houseqmStatService.searchRepaireIssueStatusStatByProjTaskIdBetweenTime(req.getProject_id(), req.getTask_id(), start, DateUtil.dateAddDay(end, 1)); StatTaskSituationMembersRepairerRspVo data = new StatTaskSituationMembersRepairerRspVo(); data.setItems(res); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } return response; } @RequestMapping(value = "stat/area_situation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public LjBaseResponse<StatAreaSituationRspVo> areaSituation(HttpServletRequest request, @Valid StatAreaSituationReq req) { LjBaseResponse<StatAreaSituationRspVo> response = new LjBaseResponse<>(); try { ctrlTool.projPermMulti(request, new String[]{SEE, GCJCSEE}); } catch (Exception e) { log.error(e.getMessage()); return CtrlToolUtils.errorReturn(response,e); } try { HouseQmStatAreaSituationIssueRspVo result = houseqmStatService.getAreaIssueTypeStatByProjectIdAreaIdCategoryCls(req.getProject_id(), req.getArea_id(), req.getCategory_cls()); StatAreaSituationRspVo data = new StatAreaSituationRspVo(); data.setIssue(result); response.setData(data); } catch (Exception e) { log.error(e.getMessage()); response.setMessage(e.getMessage()); response.setResult(1); return response; } return response; } }
21,522
0.665101
0.654157
431
48.396751
40.288437
213
false
false
0
0
0
0
0
0
0.87007
false
false
2
ec7783a884382895946f0708bf9cc1b2f6114c6b
18,227,841,272,460
5eb7be08998b3cf4af5591eb5c81ebbd10292086
/src/main/java/tasks/easy/Task107.java
d01b234c2424e114d35d13dd20854090da4bf62f
[]
no_license
Karinkaaa/LeetCode
https://github.com/Karinkaaa/LeetCode
8e42d033f6aca516f55540db57a1b4a29fc44f17
105d9d545589b77bf9539df55d29c5ab5538a5e1
refs/heads/master
2021-07-07T20:32:16.246000
2020-01-18T00:56:10
2020-01-18T00:56:10
198,888,386
0
0
null
false
2020-10-13T18:55:27
2019-07-25T19:15:04
2020-01-18T00:56:20
2020-10-13T18:55:26
87
0
0
1
Java
false
false
package tasks.easy; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Task107 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public static List<List<Integer>> levelOrderBottom(TreeNode root) { List<List<Integer>> resultList = new ArrayList<>(); fillingList(root, resultList, 0); Collections.reverse(resultList); return resultList; } public static void fillingList(TreeNode node, List<List<Integer>> resultList, int depth) { if (node == null) return; boolean isCreated = resultList.size() < depth + 1; List<Integer> list = isCreated ? new ArrayList<>() : resultList.get(depth); if (isCreated) resultList.add(list); fillingList(node.left, resultList, depth + 1); fillingList(node.right, resultList, depth + 1); list.add(node.val); } }
UTF-8
Java
1,014
java
Task107.java
Java
[]
null
[]
package tasks.easy; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Task107 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public static List<List<Integer>> levelOrderBottom(TreeNode root) { List<List<Integer>> resultList = new ArrayList<>(); fillingList(root, resultList, 0); Collections.reverse(resultList); return resultList; } public static void fillingList(TreeNode node, List<List<Integer>> resultList, int depth) { if (node == null) return; boolean isCreated = resultList.size() < depth + 1; List<Integer> list = isCreated ? new ArrayList<>() : resultList.get(depth); if (isCreated) resultList.add(list); fillingList(node.left, resultList, depth + 1); fillingList(node.right, resultList, depth + 1); list.add(node.val); } }
1,014
0.616371
0.609467
45
21.533333
24.450949
94
false
false
0
0
0
0
0
0
0.6
false
false
2
e74b54c4e4900943c171fc15a2518b68203b2793
29,875,792,546,762
4860c5b2023a4a42abbbbd41e5e9ed6c54e9efdf
/inheritance_composition_demo/src/example_inheritance_composition/Organization.java
06575a7458f72de0225c1e43b09b65a95dfcda07
[]
no_license
soadedeji/Revature-Training
https://github.com/soadedeji/Revature-Training
84c847201f4ec4d6e8deac4998ed26ec0ac83769
098e3ae5abfa8be1451dc75da0f51a9ebb790551
refs/heads/master
2020-07-07T04:35:16.504000
2019-08-19T21:28:37
2019-08-19T21:28:37
203,250,140
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package example_inheritance_composition; public class Organization { private int id; private String oName; private String location; public Organization() { // TODO Auto-generated constructor stub } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getoName() { return oName; } public void setoName(String oName) { this.oName = oName; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public Organization(int id, String oName, String location) { super(); this.id = id; this.oName = oName; this.location = location; } public void printOrganization() { System.out.println("Organization details are: "); System.out.println("Id: "+id); System.out.println("Organization name: "+oName); System.out.println("Organization location: "+location); } }
UTF-8
Java
920
java
Organization.java
Java
[ { "context": "ation) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.oName = oName;\n\t\tthis.location = location;\n\t}\n\t\n\tpublic void pr", "end": 650, "score": 0.8957399129867554, "start": 645, "tag": "NAME", "value": "oName" } ]
null
[]
package example_inheritance_composition; public class Organization { private int id; private String oName; private String location; public Organization() { // TODO Auto-generated constructor stub } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getoName() { return oName; } public void setoName(String oName) { this.oName = oName; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public Organization(int id, String oName, String location) { super(); this.id = id; this.oName = oName; this.location = location; } public void printOrganization() { System.out.println("Organization details are: "); System.out.println("Id: "+id); System.out.println("Organization name: "+oName); System.out.println("Organization location: "+location); } }
920
0.692391
0.692391
51
17.039215
17.201187
61
false
false
0
0
0
0
0
0
1.45098
false
false
2
ab0dbafbfd13b5868852515b221cbfa555933872
36,867,999,271,667
ccacdb8a2c7cef25184328c379343542b26859bb
/src/main/java/edu/wpi/cs/melpomene/feedbackapp/http/CreateSnippetResponse.java
bd0cfbc206d279c1cac79989b99da6e5e79e8aaf
[]
no_license
cs509-melpomene/feedbackapp
https://github.com/cs509-melpomene/feedbackapp
217f3ebb380cb1b70cbe09b8336497cbf4ddb1b2
3574d59842fab24ccfa82d9588f10ae4771cc876
refs/heads/main
2023-01-25T04:53:50
2020-12-10T23:44:27
2020-12-10T23:44:27
304,136,742
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.wpi.cs.melpomene.feedbackapp.http; /** * In most cases the response is the name of the constant that was being created. * * if an error of some sort, then the response describes that error. * */ public class CreateSnippetResponse { public final String snippetID; public final String viewerPassword; public final String error; public final int httpCode; /** * Create success response. * @param snippetID * @param creatorPassword * @param viewerPassword */ public CreateSnippetResponse (String snippetID, String viewerPassword) { this.snippetID = snippetID; this.viewerPassword = viewerPassword; this.error = ""; this.httpCode = 200; } /** * Create failure response. * @param error */ public CreateSnippetResponse (String error) { this.snippetID = ""; this.viewerPassword = ""; this.error = error; this.httpCode = 500; } public String getSnippetID() { return snippetID; } public String getViewerPassword() { return viewerPassword; } public String toString() { return "Response(" + snippetID + ")"; } }
UTF-8
Java
1,087
java
CreateSnippetResponse.java
Java
[ { "context": "his.snippetID = snippetID;\n\t\tthis.viewerPassword = viewerPassword;\n\t\tthis.error = \"\";\n\t\tthis.httpCode = 200;\n\t}\n\t\n\t", "end": 637, "score": 0.9261276721954346, "start": 623, "tag": "PASSWORD", "value": "viewerPassword" } ]
null
[]
package edu.wpi.cs.melpomene.feedbackapp.http; /** * In most cases the response is the name of the constant that was being created. * * if an error of some sort, then the response describes that error. * */ public class CreateSnippetResponse { public final String snippetID; public final String viewerPassword; public final String error; public final int httpCode; /** * Create success response. * @param snippetID * @param creatorPassword * @param viewerPassword */ public CreateSnippetResponse (String snippetID, String viewerPassword) { this.snippetID = snippetID; this.viewerPassword = <PASSWORD>; this.error = ""; this.httpCode = 200; } /** * Create failure response. * @param error */ public CreateSnippetResponse (String error) { this.snippetID = ""; this.viewerPassword = ""; this.error = error; this.httpCode = 500; } public String getSnippetID() { return snippetID; } public String getViewerPassword() { return viewerPassword; } public String toString() { return "Response(" + snippetID + ")"; } }
1,083
0.700092
0.694572
51
20.313726
19.363894
81
false
false
0
0
0
0
0
0
1.372549
false
false
2
e5e928eb4a17af98f5598bfa8f2bb53efdd8a14e
11,038,065,988,768
5c6cbeab644aa38eb12c2dfb990fa3829abc7cd0
/src/Dozent.java
8cee1be68530914bdb2313ba4e7742b5fae2a45b
[]
no_license
trecker95/Kursverwaltung
https://github.com/trecker95/Kursverwaltung
ffa52a555e99b52938ce3e61c59263a8073e6517
11ac03961789a0e49247c850d6568e9b8bdd6ec3
refs/heads/master
2020-12-24T09:31:42.067000
2013-05-07T14:09:36
2013-05-07T14:09:36
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Dozent { private String name; public Dozent(String name) { super(); this.name = name; } @Override public String toString() { return "Dozent [name=" + name + "]"; } }
UTF-8
Java
196
java
Dozent.java
Java
[]
null
[]
public class Dozent { private String name; public Dozent(String name) { super(); this.name = name; } @Override public String toString() { return "Dozent [name=" + name + "]"; } }
196
0.617347
0.617347
14
12.928572
12.325724
38
false
false
0
0
0
0
0
0
1.214286
false
false
2
be23e4a0762144e948bf8b3a8a1636139566b3a6
36,361,193,145,472
080a0d54dc462c3cf95ab9142cbcc4304f46c164
/Chapter2/Sort2_5Quick.java
d838b5dbe1ce45c1d60a572caa9fbcfc9416a0d7
[]
no_license
tangbin90/AlgorithmInJAVA
https://github.com/tangbin90/AlgorithmInJAVA
603ad22ab5d19d6905fefb15a06a1ee8549a3388
521134080fbae705d2b3f06018c64c97311fbfbc
refs/heads/master
2021-01-19T10:45:11.091000
2017-04-27T07:01:49
2017-04-27T07:01:49
87,897,405
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import edu.princeton.cs.algs4.In; import edu.princeton.cs.algs4.StdOut; import edu.princeton.cs.algs4.StdRandom; import java.util.Comparator; /** * @author TangBin * @version V1.0 * @date 11/04/2017 4:19 PM */ public class Sort2_5Quick { public static void QuickSort(Comparable[] a){ StdRandom.shuffle(a); sort(a,0,a.length-1); } public static void sort(Comparable[] a, int lo, int hi){ if(lo>=hi) return; int mid=partitionDoubleDirection(a,lo,hi); sort(a,lo,mid-1); sort(a,mid+1,hi); } public static int partitionOneDirection(Comparable[] a, int lo, int hi){ int i=lo-1; Comparable v = a[hi]; for(int j=lo;j<hi;j++){ if(less(a[j],v)){ i++; exch(a,j,i); } } exch(a,hi, ++i); return i; } public static int partitionDoubleDirection(Comparable[] a, int lo, int hi){ int j=hi; int i=lo+1; Comparable key = a[lo]; while(i<=j){ while(less(a[i],key)) { i++; if(i>=hi) break; } while(less(key,a[j])) { j--; if(j<=lo) break; } if(i<j) exch(a,i++,j--); else break; } System.out.println(i+" "+j); exch(a,lo,i-1); return j; } private void sortUseThreePartition(Comparable[] a, int lo, int hi){ if(hi<=lo) return; int lt = lo; int gt = hi; int eq = lo+1; Comparable key =a[lo]; while(eq<gt){ int com = a[eq].compareTo(key); if(com<0) exch(a,lt++,eq++); else if(com==0) eq++; else exch(a,lt,gt--); } sortUseThreePartition(a,lo,lt-1); sortUseThreePartition(a,gt+1,hi); } private static boolean less(Comparable v, Comparable w){ return v.compareTo(w)<0; } private static void exch(Comparable[] a, int i, int j){ if(i==j) return; Comparable t = a[i]; a[i] = a[j]; a[j] = t; } private static void show(Comparable[] a){ for(int i = 0; i<a.length;i++){ StdOut.print(a[i]+" "); } StdOut.println(); } public static boolean isSorted(Comparable[] a){ for(int i = 1;i<a.length;i++) if(less(a[i],a[i-1])) return false; return true; } public static void main(String... args){ Integer[] a={0,4,3,1,5}; //partition2(a,0,a.length-1); sort(a,0,a.length-1); show(a); } }
UTF-8
Java
2,729
java
Sort2_5Quick.java
Java
[ { "context": "dom;\n\nimport java.util.Comparator;\n\n/**\n * @author TangBin\n * @version V1.0\n * @date 11/04/2017 4:19 PM\n */\n", "end": 166, "score": 0.9992479681968689, "start": 159, "tag": "NAME", "value": "TangBin" } ]
null
[]
import edu.princeton.cs.algs4.In; import edu.princeton.cs.algs4.StdOut; import edu.princeton.cs.algs4.StdRandom; import java.util.Comparator; /** * @author TangBin * @version V1.0 * @date 11/04/2017 4:19 PM */ public class Sort2_5Quick { public static void QuickSort(Comparable[] a){ StdRandom.shuffle(a); sort(a,0,a.length-1); } public static void sort(Comparable[] a, int lo, int hi){ if(lo>=hi) return; int mid=partitionDoubleDirection(a,lo,hi); sort(a,lo,mid-1); sort(a,mid+1,hi); } public static int partitionOneDirection(Comparable[] a, int lo, int hi){ int i=lo-1; Comparable v = a[hi]; for(int j=lo;j<hi;j++){ if(less(a[j],v)){ i++; exch(a,j,i); } } exch(a,hi, ++i); return i; } public static int partitionDoubleDirection(Comparable[] a, int lo, int hi){ int j=hi; int i=lo+1; Comparable key = a[lo]; while(i<=j){ while(less(a[i],key)) { i++; if(i>=hi) break; } while(less(key,a[j])) { j--; if(j<=lo) break; } if(i<j) exch(a,i++,j--); else break; } System.out.println(i+" "+j); exch(a,lo,i-1); return j; } private void sortUseThreePartition(Comparable[] a, int lo, int hi){ if(hi<=lo) return; int lt = lo; int gt = hi; int eq = lo+1; Comparable key =a[lo]; while(eq<gt){ int com = a[eq].compareTo(key); if(com<0) exch(a,lt++,eq++); else if(com==0) eq++; else exch(a,lt,gt--); } sortUseThreePartition(a,lo,lt-1); sortUseThreePartition(a,gt+1,hi); } private static boolean less(Comparable v, Comparable w){ return v.compareTo(w)<0; } private static void exch(Comparable[] a, int i, int j){ if(i==j) return; Comparable t = a[i]; a[i] = a[j]; a[j] = t; } private static void show(Comparable[] a){ for(int i = 0; i<a.length;i++){ StdOut.print(a[i]+" "); } StdOut.println(); } public static boolean isSorted(Comparable[] a){ for(int i = 1;i<a.length;i++) if(less(a[i],a[i-1])) return false; return true; } public static void main(String... args){ Integer[] a={0,4,3,1,5}; //partition2(a,0,a.length-1); sort(a,0,a.length-1); show(a); } }
2,729
0.470136
0.454012
113
23.150442
17.250483
79
false
false
0
0
0
0
0
0
0.929204
false
false
2
47e68f5ec5bd0ff0ba226a4c02879d1d14bb9140
35,450,660,108,451
ddc7e27beaa94ac5e6247558394db3827cccbd7b
/src/GUI/Components/CardComponent.java
0ec5b483ecdcc3fd6613cdc90fef61c880774c2f
[]
no_license
Fleskvegg/Poker2
https://github.com/Fleskvegg/Poker2
b7fb450f6a2c92c69faa2bac13ae3e48f1ba77d0
785cbef3816f2c7fe0fe11271197355db252ed75
refs/heads/master
2016-08-03T23:12:33.345000
2015-04-10T18:23:01
2015-04-10T18:23:01
33,690,380
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package GUI.Components; import CardGameExceptions.NoSuchCardException; import Cards.Card; import java.awt.*; /** * Graphical component corresponding to one card in either deck or hand */ public class CardComponent extends AbstractClickableComponent { private static final int CARD_SIZE_X = 50; private static final int CARD_SIZE_Y = 75; private Card card; @Override public boolean isClicked() { return card.isClicked(); } @Override public void setClicked(final boolean b) { card.setClicked(b); } @Override public void clickAction() { card.clickAction(); } public CardComponent(final int x, final int y, final Card card, PersonComponent personComponent) { this.setBounds(x, y, CARD_SIZE_X, CARD_SIZE_Y); this.card = card; personComponent.addToPokerComponent(this); } public void drawCard(Graphics2D g, boolean visable) { if (card.isClicked()) { g.setColor(Color.BLUE); g.fillRect(getX(), getY(), CARD_SIZE_X + 5, CARD_SIZE_Y + 5); } if (visable) { g.setColor(Color.WHITE); g.fillRect(getX(), getY(), CARD_SIZE_X, CARD_SIZE_Y); Font font = new Font("Serif", Font.BOLD, 15); g.setFont(font); g.setColor(card.getColorByCardType()); try { g.drawString(String.valueOf(card.getCardIntValue()), getX() + 7, getY() + 15); g.drawString(String.valueOf(card.getCardIntValue()), getX() + CARD_SIZE_X - 18, getY() + CARD_SIZE_Y - 7); } catch (NoSuchCardException e) { } } else { g.setColor(Color.BLUE); g.fillRect(getX(), getY(), CARD_SIZE_X, CARD_SIZE_Y); } } }
UTF-8
Java
1,593
java
CardComponent.java
Java
[]
null
[]
package GUI.Components; import CardGameExceptions.NoSuchCardException; import Cards.Card; import java.awt.*; /** * Graphical component corresponding to one card in either deck or hand */ public class CardComponent extends AbstractClickableComponent { private static final int CARD_SIZE_X = 50; private static final int CARD_SIZE_Y = 75; private Card card; @Override public boolean isClicked() { return card.isClicked(); } @Override public void setClicked(final boolean b) { card.setClicked(b); } @Override public void clickAction() { card.clickAction(); } public CardComponent(final int x, final int y, final Card card, PersonComponent personComponent) { this.setBounds(x, y, CARD_SIZE_X, CARD_SIZE_Y); this.card = card; personComponent.addToPokerComponent(this); } public void drawCard(Graphics2D g, boolean visable) { if (card.isClicked()) { g.setColor(Color.BLUE); g.fillRect(getX(), getY(), CARD_SIZE_X + 5, CARD_SIZE_Y + 5); } if (visable) { g.setColor(Color.WHITE); g.fillRect(getX(), getY(), CARD_SIZE_X, CARD_SIZE_Y); Font font = new Font("Serif", Font.BOLD, 15); g.setFont(font); g.setColor(card.getColorByCardType()); try { g.drawString(String.valueOf(card.getCardIntValue()), getX() + 7, getY() + 15); g.drawString(String.valueOf(card.getCardIntValue()), getX() + CARD_SIZE_X - 18, getY() + CARD_SIZE_Y - 7); } catch (NoSuchCardException e) { } } else { g.setColor(Color.BLUE); g.fillRect(getX(), getY(), CARD_SIZE_X, CARD_SIZE_Y); } } }
1,593
0.663528
0.654112
61
25.114754
26.701813
108
false
false
0
0
0
0
0
0
1.180328
false
false
2
a16cdadc938aeaf2cfc05682399ecc009a955be4
39,591,008,544,847
ece8198428da8f81e0b314b034b95f4adbb9f59e
/SquidDemoTemplate/src/com/example/squiddemo/entity/Player.java
ab47ca3fbb354a19c6e21861515eec85a3abf525
[]
no_license
MCU-Sule/uts-oopl2-programmingBae
https://github.com/MCU-Sule/uts-oopl2-programmingBae
aa9bbdafc0f0dfbcff562a5f167e6b040f6f2bdb
f753fe58b205177d55a4e44e2012acecee0039b3
refs/heads/main
2023-09-04T21:12:16.254000
2021-11-04T04:57:28
2021-11-04T04:57:28
424,455,024
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.squiddemo.entity; /** * Abednego Steven 1972009 */ public class Player { private int id; private String nama; private int umur; private String keahlian; public Player() { } public Player(int id, String nama, int umur, String keahlian) { this.id = id; this.nama = nama; this.umur = umur; this.keahlian = keahlian; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNama() { return nama; } public void setNama(String nama) { this.nama = nama; } public int getUmur() { return umur; } public void setUmur(int umur) { this.umur = umur; } public String getKeahlian() { return keahlian; } public void setKeahlian(String keahlian) { this.keahlian = keahlian; } @Override public String toString() { return nama ; } }
UTF-8
Java
1,056
java
Player.java
Java
[ { "context": "package com.example.squiddemo.entity;\r\n/**\r\n * Abednego Steven 1972009\r\n */\r\npublic class Player {\r\n private ", "end": 62, "score": 0.9988532066345215, "start": 47, "tag": "NAME", "value": "Abednego Steven" } ]
null
[]
package com.example.squiddemo.entity; /** * <NAME> 1972009 */ public class Player { private int id; private String nama; private int umur; private String keahlian; public Player() { } public Player(int id, String nama, int umur, String keahlian) { this.id = id; this.nama = nama; this.umur = umur; this.keahlian = keahlian; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNama() { return nama; } public void setNama(String nama) { this.nama = nama; } public int getUmur() { return umur; } public void setUmur(int umur) { this.umur = umur; } public String getKeahlian() { return keahlian; } public void setKeahlian(String keahlian) { this.keahlian = keahlian; } @Override public String toString() { return nama ; } }
1,047
0.526515
0.519886
57
16.526316
14.510861
67
false
false
0
0
0
0
0
0
0.368421
false
false
2
005ac64f7e6f485e2bf5356a270850bc5f4c0f80
34,789,235,147,509
d5e408ccd10f42687726fa7ac243bed978c0f539
/src/Zadaci_18_02_2016/z_5Test.java
43b907ed74f7ff72b33c88e7c6adbf40d37cbd4e
[]
no_license
adorw9/BILD-IT-Zadaci
https://github.com/adorw9/BILD-IT-Zadaci
0117a3934514229589bb26782bad438feedaea3e
306c88884efdeb7cfcb578a2b1cb416048765f48
refs/heads/master
2021-01-10T18:32:02.735000
2016-02-24T20:29:14
2016-02-24T20:29:14
49,736,725
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Zadaci_18_02_2016; /** * @author Adnan Bričić * */ public class z_5Test { public static void main(String[] args) { // pravimo objekat z_5MyStack stack1 = new z_5MyStack(); stack1.push(3); stack1.push(8); // objekat koji kloniramo z_5MyStack stack2 = new z_5MyStack(); stack2 = stack1.clone(); // ispis rezultata System.out.println("Stack: " + stack1); System.out.println("Clone Stack: " + stack2); } }
WINDOWS-1250
Java
468
java
z_5Test.java
Java
[ { "context": "package Zadaci_18_02_2016;\r\n\r\n/**\r\n * @author Adnan Bričić\r\n *\r\n */\r\npublic class z_5Test {\r\n\r\n\tpublic stati", "end": 58, "score": 0.999870240688324, "start": 46, "tag": "NAME", "value": "Adnan Bričić" } ]
null
[]
package Zadaci_18_02_2016; /** * @author <NAME> * */ public class z_5Test { public static void main(String[] args) { // pravimo objekat z_5MyStack stack1 = new z_5MyStack(); stack1.push(3); stack1.push(8); // objekat koji kloniramo z_5MyStack stack2 = new z_5MyStack(); stack2 = stack1.clone(); // ispis rezultata System.out.println("Stack: " + stack1); System.out.println("Clone Stack: " + stack2); } }
460
0.611588
0.562232
25
16.639999
15.735005
47
false
false
0
0
0
0
0
0
1.2
false
false
2
a674a0842bbe29f6c5fd6347d3b5f45d4282ca7b
39,384,850,141,738
142883ffb9386de8bc80ef474cf70210d5335347
/src/com/timvisee/DungeonMaze/populator/TallGrassPopulator.java
1b17229f11d6d7f70eded7cfaaa54fbfa0d21ce2
[]
no_license
SpoonsJTD/DungeonMaze
https://github.com/SpoonsJTD/DungeonMaze
01fb979a3f4190401b5b792e31e45dc0a78b1168
cc938ed322b5265d888461684aa3804ce6ec9448
refs/heads/master
2021-01-25T02:38:01.729000
2013-07-01T16:21:17
2013-07-01T16:21:17
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.timvisee.DungeonMaze.populator; import java.util.Random; import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; import com.timvisee.DungeonMaze.DungeonMaze; public class TallGrassPopulator extends BlockPopulator { public static final int CHANCE_OF_GRASS = 35; public static final int ITERATIONS = 100; public static DungeonMaze plugin; @Override public void populate(World world, Random random, Chunk source) { if(!DungeonMaze.isConstantChunk(world.getName(), source)) { for(int i = 0; i < ITERATIONS; i++) { if (random.nextInt(100) < CHANCE_OF_GRASS) { int grassX = random.nextInt(16); int grassZ = random.nextInt(16); int yground; for(yground = 100; source.getBlock(grassX, yground, grassZ).getType() == Material.AIR; yground--); if(source.getBlock(grassX, yground, grassZ).getTypeId() == 2) { int grassY = yground + 1; source.getBlock(grassX, grassY, grassZ).setTypeId(31); source.getBlock(grassX, grassY, grassZ).setData((byte) 1); } } } } } }
UTF-8
Java
1,135
java
TallGrassPopulator.java
Java
[]
null
[]
package com.timvisee.DungeonMaze.populator; import java.util.Random; import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; import com.timvisee.DungeonMaze.DungeonMaze; public class TallGrassPopulator extends BlockPopulator { public static final int CHANCE_OF_GRASS = 35; public static final int ITERATIONS = 100; public static DungeonMaze plugin; @Override public void populate(World world, Random random, Chunk source) { if(!DungeonMaze.isConstantChunk(world.getName(), source)) { for(int i = 0; i < ITERATIONS; i++) { if (random.nextInt(100) < CHANCE_OF_GRASS) { int grassX = random.nextInt(16); int grassZ = random.nextInt(16); int yground; for(yground = 100; source.getBlock(grassX, yground, grassZ).getType() == Material.AIR; yground--); if(source.getBlock(grassX, yground, grassZ).getTypeId() == 2) { int grassY = yground + 1; source.getBlock(grassX, grassY, grassZ).setTypeId(31); source.getBlock(grassX, grassY, grassZ).setData((byte) 1); } } } } } }
1,135
0.686344
0.667841
41
26.707317
25.230879
103
false
false
0
0
0
0
0
0
3.170732
false
false
2
759c60946b80caf95a7f0246ceaa2452e129fc19
39,384,850,140,777
c50a709fa63d35b02ce1fbc3ce3bcd87325d1cb5
/Prime.java
cde3a3135d32b7885b9814f3e411bf069cda1cf8
[]
no_license
marcoswca/algorithms
https://github.com/marcoswca/algorithms
43fdf435abae01df2d3f2e1225a63902691b344e
4d9994e95d294594444a914bf1e0ac74e134925c
refs/heads/master
2020-12-04T14:57:27.721000
2020-10-23T02:30:59
2020-10-23T02:30:59
231,808,236
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package algorithms; /* * The prime factors of 13195 are 5, 7, 13 and 29. * What is the largest prime factor of the number 600851475143 ? */ public class Prime { public static void main(String[] args) { System.out.println(solution()); } private static long solution() { long num = 600851475143L; for (long i = 1; i < num; i++) { if (num % i == 0) { long factor = num / i; if (isPrime(factor)) { return factor; } } } return 0; } private static boolean isPrime(long num) { long half = num / 2; for (int i = 2; i <= half; i++) { if (num % i == 0) { return false; } } return true; } }
UTF-8
Java
643
java
Prime.java
Java
[]
null
[]
package algorithms; /* * The prime factors of 13195 are 5, 7, 13 and 29. * What is the largest prime factor of the number 600851475143 ? */ public class Prime { public static void main(String[] args) { System.out.println(solution()); } private static long solution() { long num = 600851475143L; for (long i = 1; i < num; i++) { if (num % i == 0) { long factor = num / i; if (isPrime(factor)) { return factor; } } } return 0; } private static boolean isPrime(long num) { long half = num / 2; for (int i = 2; i <= half; i++) { if (num % i == 0) { return false; } } return true; } }
643
0.580093
0.51633
34
17.911764
16.394705
64
false
false
0
0
0
0
0
0
2.117647
false
false
2
3d6311442da54054d86fbad4f8d83ba127a321c3
29,188,597,808,054
7344866370bd60505061fcc7e8c487339a508bb9
/OpenConcerto/src/org/openconcerto/utils/cc/TransformerFuture.java
b6719b9f721ce4f87335db858cb1369a0ab00eb4
[]
no_license
sanogotech/openconcerto_ERP_JAVA
https://github.com/sanogotech/openconcerto_ERP_JAVA
ed3276858f945528e96a5ccfdf01a55b58f92c8d
4d224695be0a7a4527851a06d8b8feddfbdd3d0e
refs/heads/master
2023-04-11T09:51:29.952000
2021-04-21T14:39:18
2021-04-21T14:39:18
360,197,474
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved. * * The contents of this file are subject to the terms of the GNU General Public License Version 3 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each file. */ package org.openconcerto.utils.cc; import org.openconcerto.utils.Value; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; public class TransformerFuture<E, T, X extends Exception> implements ITransformerFuture<E, T, X> { private final AtomicReference<Value<E>> input; private final FutureTask<T> f; public TransformerFuture(final ITransformerExn<? super E, ? extends T, ? extends X> cl) { super(); this.f = new FutureTask<T>(new Callable<T>() { @Override public T call() throws X { return cl.transformChecked(TransformerFuture.this.input.get().getValue()); } }); this.input = new AtomicReference<Value<E>>(Value.<E> getNone()); } @Override public final boolean cancel(boolean mayInterruptIfRunning) { return this.f.cancel(mayInterruptIfRunning); } @Override public final boolean isCancelled() { return this.f.isCancelled(); } @Override public final boolean isDone() { return this.f.isDone(); } @Override public final T get() throws InterruptedException, ExecutionException { return this.f.get(); } @Override public final T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.f.get(timeout, unit); } @Override public final T transformChecked(E input) throws X { if (!this.input.compareAndSet(Value.<E> getNone(), Value.getSome(input))) throw new IllegalStateException("Already run"); this.f.run(); assert this.f.isDone(); try { return this.f.get(); } catch (InterruptedException e) { // shouldn't happen since f is done throw new IllegalStateException(e); } catch (ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof Error) { throw (Error) cause; } else if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { // our Callable throws X @SuppressWarnings("unchecked") final X casted = (X) cause; throw casted; } } } }
UTF-8
Java
3,134
java
TransformerFuture.java
Java
[]
null
[]
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved. * * The contents of this file are subject to the terms of the GNU General Public License Version 3 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each file. */ package org.openconcerto.utils.cc; import org.openconcerto.utils.Value; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; public class TransformerFuture<E, T, X extends Exception> implements ITransformerFuture<E, T, X> { private final AtomicReference<Value<E>> input; private final FutureTask<T> f; public TransformerFuture(final ITransformerExn<? super E, ? extends T, ? extends X> cl) { super(); this.f = new FutureTask<T>(new Callable<T>() { @Override public T call() throws X { return cl.transformChecked(TransformerFuture.this.input.get().getValue()); } }); this.input = new AtomicReference<Value<E>>(Value.<E> getNone()); } @Override public final boolean cancel(boolean mayInterruptIfRunning) { return this.f.cancel(mayInterruptIfRunning); } @Override public final boolean isCancelled() { return this.f.isCancelled(); } @Override public final boolean isDone() { return this.f.isDone(); } @Override public final T get() throws InterruptedException, ExecutionException { return this.f.get(); } @Override public final T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.f.get(timeout, unit); } @Override public final T transformChecked(E input) throws X { if (!this.input.compareAndSet(Value.<E> getNone(), Value.getSome(input))) throw new IllegalStateException("Already run"); this.f.run(); assert this.f.isDone(); try { return this.f.get(); } catch (InterruptedException e) { // shouldn't happen since f is done throw new IllegalStateException(e); } catch (ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof Error) { throw (Error) cause; } else if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { // our Callable throws X @SuppressWarnings("unchecked") final X casted = (X) cause; throw casted; } } } }
3,134
0.646458
0.644225
91
33.43956
29.3367
119
false
false
0
0
0
0
0
0
0.472527
false
false
2
1e3b9a7a88452cf39e84d63aa59ebe62b4ea6911
37,203,006,748,681
1170a07d4e1693795ac61c208a61a62319539501
/app/src/main/java/se/tmeit/app/ui/members/MembersSimpleListFragment.java
73b8587473c84c96f12e461015363cb8863a761a
[ "Apache-2.0" ]
permissive
wsv-accidis/tmeit-android
https://github.com/wsv-accidis/tmeit-android
5fcb584fbcfd11eebcb013710f4d58658d11971f
02c65ada43c694ad785ea9dd7e09f50e177b4681
refs/heads/master
2022-11-02T18:29:34.727000
2022-10-25T15:32:48
2022-10-25T15:32:48
31,129,788
3
7
Apache-2.0
false
2018-11-20T08:41:00
2015-02-21T15:32:03
2018-11-19T15:22:16
2018-11-20T08:40:59
3,669
2
2
8
Java
false
null
package se.tmeit.app.ui.members; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import java.util.List; import se.tmeit.app.R; import se.tmeit.app.model.Member; import se.tmeit.app.services.Repository; import se.tmeit.app.services.RepositoryResultHandler; import se.tmeit.app.ui.ListFragmentBase; /** * Simple list fragment for cases where we just need a selectable list of members. */ public final class MembersSimpleListFragment extends ListFragmentBase { private static final String STATE_LIST_VIEW = "membersSimpleListState"; private static final String TAG = MembersSimpleListFragment.class.getSimpleName(); private final MembersListResultHandler mRepositoryResultHandler = new MembersListResultHandler(); private OnMemberSelectedListener mListener; private Member.RepositoryData mMembers; @Override public void onListItemClick(ListView l, View v, int position, long id) { if (v.getTag() instanceof Member) { getListView().setItemChecked(position, true); Member member = (Member) v.getTag(); if (null != mListener) { mListener.onMemberSelected(member); } } else { Log.w(TAG, "Got a click on a list item without an associated member."); } } public void setOnMemberSelectedListener(OnMemberSelectedListener listener) { mListener = listener; } @Override protected void getDataFromRepository(Repository repository) { repository.getMembers(mRepositoryResultHandler, false); } @Override protected String getStateKey() { return STATE_LIST_VIEW; } @Override protected void initializeList() { finishInitializeList(new MembersSimpleListAdapter(getActivity(), mMembers)); getListView().setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); } public interface OnMemberSelectedListener { void onMemberSelected(Member member); } private final class MembersListResultHandler implements RepositoryResultHandler<Member.RepositoryData> { @Override public void onError(int errorMessage) { mMembers = Member.RepositoryData.empty(); onRepositoryError(errorMessage); } @Override public void onSuccess(Member.RepositoryData result) { mMembers = result; onRepositorySuccess(); } } private final class MembersSimpleListAdapter extends BaseAdapter { private final LayoutInflater mInflater; private final List<Member> mMembers; private MembersSimpleListAdapter(Context context, Member.RepositoryData members) { mMembers = members.getMembers(); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { return mMembers.size(); } @Override public Object getItem(int position) { return mMembers.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (null == view) { view = mInflater.inflate(R.layout.list_item_simple_member, parent, false); } Member item = mMembers.get(position); TextView text1 = view.findViewById(android.R.id.text1); text1.setText(item.realName()); view.setTag(item); return view; } } }
UTF-8
Java
3,400
java
MembersSimpleListFragment.java
Java
[]
null
[]
package se.tmeit.app.ui.members; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import java.util.List; import se.tmeit.app.R; import se.tmeit.app.model.Member; import se.tmeit.app.services.Repository; import se.tmeit.app.services.RepositoryResultHandler; import se.tmeit.app.ui.ListFragmentBase; /** * Simple list fragment for cases where we just need a selectable list of members. */ public final class MembersSimpleListFragment extends ListFragmentBase { private static final String STATE_LIST_VIEW = "membersSimpleListState"; private static final String TAG = MembersSimpleListFragment.class.getSimpleName(); private final MembersListResultHandler mRepositoryResultHandler = new MembersListResultHandler(); private OnMemberSelectedListener mListener; private Member.RepositoryData mMembers; @Override public void onListItemClick(ListView l, View v, int position, long id) { if (v.getTag() instanceof Member) { getListView().setItemChecked(position, true); Member member = (Member) v.getTag(); if (null != mListener) { mListener.onMemberSelected(member); } } else { Log.w(TAG, "Got a click on a list item without an associated member."); } } public void setOnMemberSelectedListener(OnMemberSelectedListener listener) { mListener = listener; } @Override protected void getDataFromRepository(Repository repository) { repository.getMembers(mRepositoryResultHandler, false); } @Override protected String getStateKey() { return STATE_LIST_VIEW; } @Override protected void initializeList() { finishInitializeList(new MembersSimpleListAdapter(getActivity(), mMembers)); getListView().setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); } public interface OnMemberSelectedListener { void onMemberSelected(Member member); } private final class MembersListResultHandler implements RepositoryResultHandler<Member.RepositoryData> { @Override public void onError(int errorMessage) { mMembers = Member.RepositoryData.empty(); onRepositoryError(errorMessage); } @Override public void onSuccess(Member.RepositoryData result) { mMembers = result; onRepositorySuccess(); } } private final class MembersSimpleListAdapter extends BaseAdapter { private final LayoutInflater mInflater; private final List<Member> mMembers; private MembersSimpleListAdapter(Context context, Member.RepositoryData members) { mMembers = members.getMembers(); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { return mMembers.size(); } @Override public Object getItem(int position) { return mMembers.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (null == view) { view = mInflater.inflate(R.layout.list_item_simple_member, parent, false); } Member item = mMembers.get(position); TextView text1 = view.findViewById(android.R.id.text1); text1.setText(item.realName()); view.setTag(item); return view; } } }
3,400
0.763824
0.762941
121
27.099174
26.398849
105
false
false
0
0
0
0
0
0
1.834711
false
false
2
1c81fe1028f560c43830f9090664f7caa490b131
36,627,481,140,019
534c5206c95238cdbe238e35ad742b38127b1557
/Data-Mining/src/benutzerSchnittstelle/KnotenAuswahlDialog.java
4d1d683b19f725f9b4e2fc1737bd04cf0152a130
[]
no_license
phausmann/Data-Mining
https://github.com/phausmann/Data-Mining
0e0f8bbef5248db66f7ead4a6e7b947ef7b49806
4ef4bbdd48c7602f6dd7ea9b806210556e32b56c
refs/heads/master
2021-01-21T13:08:04.114000
2013-06-06T07:11:31
2013-06-06T07:11:31
7,842,500
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package benutzerSchnittstelle; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import logikschicht.InteraktivKomponenten; import logikschicht.Zeichenkomponenten; public class KnotenAuswahlDialog extends JDialog { private boolean buttonauswahl; private int selectedcolumn; public KnotenAuswahlDialog(Gui oberflaeche, final InteraktivKomponenten knoten) { super(oberflaeche.getFrame(), "Tabelle zu " + knoten.getZeichenattribut().toString(), true); setLocationRelativeTo(oberflaeche.getFrame()); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); JPanel aufnahme = new JPanel(); JPanel buttons = new JPanel(); JPanel inhalt = new JPanel(); aufnahme.setLayout(new BorderLayout()); buttons.setLayout(new FlowLayout()); // Instanziieren eines neuen Datenmodells anhand der Knotendaten // Einbetten der Tabelle in eine JScrollpane TeilTabellenModell datenmodell = new TeilTabellenModell(knoten.getDaten(), knoten.getKopfzeile()); final JTable datentabelle = new JTable(datenmodell); inhalt.add(new JScrollPane(datentabelle), BorderLayout.CENTER); JButton bestaetigen = new JButton("OK"); bestaetigen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.out.println(datentabelle.getSelectedColumn()); buttonauswahl = true; selectedcolumn = datentabelle.getSelectedColumn(); dispose(); } }); buttons.add(bestaetigen); JButton abbrechen = new JButton("Abbrechen"); abbrechen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonauswahl = false; // Wenn Abbrechen, dann Schließen des Dialogs dispose(); } }); buttons.add(abbrechen); aufnahme.add(inhalt, BorderLayout.CENTER); aufnahme.add(buttons, BorderLayout.SOUTH); add(aufnahme); setSize(500, 400); setResizable(false); setVisible(true); } public boolean isButtonauswahl() { return buttonauswahl; } public int getSelectedcolumn() { return selectedcolumn; } }
UTF-8
Java
2,316
java
KnotenAuswahlDialog.java
Java
[]
null
[]
package benutzerSchnittstelle; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import logikschicht.InteraktivKomponenten; import logikschicht.Zeichenkomponenten; public class KnotenAuswahlDialog extends JDialog { private boolean buttonauswahl; private int selectedcolumn; public KnotenAuswahlDialog(Gui oberflaeche, final InteraktivKomponenten knoten) { super(oberflaeche.getFrame(), "Tabelle zu " + knoten.getZeichenattribut().toString(), true); setLocationRelativeTo(oberflaeche.getFrame()); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); JPanel aufnahme = new JPanel(); JPanel buttons = new JPanel(); JPanel inhalt = new JPanel(); aufnahme.setLayout(new BorderLayout()); buttons.setLayout(new FlowLayout()); // Instanziieren eines neuen Datenmodells anhand der Knotendaten // Einbetten der Tabelle in eine JScrollpane TeilTabellenModell datenmodell = new TeilTabellenModell(knoten.getDaten(), knoten.getKopfzeile()); final JTable datentabelle = new JTable(datenmodell); inhalt.add(new JScrollPane(datentabelle), BorderLayout.CENTER); JButton bestaetigen = new JButton("OK"); bestaetigen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.out.println(datentabelle.getSelectedColumn()); buttonauswahl = true; selectedcolumn = datentabelle.getSelectedColumn(); dispose(); } }); buttons.add(bestaetigen); JButton abbrechen = new JButton("Abbrechen"); abbrechen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonauswahl = false; // Wenn Abbrechen, dann Schließen des Dialogs dispose(); } }); buttons.add(abbrechen); aufnahme.add(inhalt, BorderLayout.CENTER); aufnahme.add(buttons, BorderLayout.SOUTH); add(aufnahme); setSize(500, 400); setResizable(false); setVisible(true); } public boolean isButtonauswahl() { return buttonauswahl; } public int getSelectedcolumn() { return selectedcolumn; } }
2,316
0.753348
0.750756
85
26.235294
22.770283
100
false
false
0
0
0
0
0
0
2.247059
false
false
2
81186706479ce3e9fc697a1ca1551bd238f9834e
36,627,481,141,965
d07bbf11ed09f215c4126e0c278b6019a9ff2b90
/src/main/java/org/powertac/common/interfaces/ServerConfiguration.java
30d119a340abfef9379bab405ec3280bde38435a
[]
no_license
srehker/server-interface
https://github.com/srehker/server-interface
9a532e62f20cec8f2832b3e329000cc47fc5d94a
b67826949bb23b8b60b62d0f9b81e7f08c7f5400
refs/heads/master
2021-01-18T17:02:33.538000
2015-08-31T11:28:27
2015-08-31T11:28:27
33,368,632
0
0
null
true
2015-04-03T15:12:32
2015-04-03T15:12:32
2015-04-02T19:48:27
2015-04-02T19:48:27
723
0
0
0
null
null
null
/* * Copyright (c) 2012 by the original author * * 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.powertac.common.interfaces; import java.util.Collection; import java.util.List; /** * Support for annotation-driven configuration. Configurable services, including * services that create configurable instances (such as gencos or customer models), * configure themselves by calling configure(). The result is that properties * annotated as @ConfigurableValue will be matched with configuration * data, and classes annotated as @ConfigurableInstance will have instances * created and configured as specified in the server configuration. * @author John Collins */ public interface ServerConfiguration { /** * Configures a target object by matching configuration clauses with * @ConfigurableValue annotations on the target object. This is typically * called in the initialize() method. */ public void configureMe (Object target); /** * Creates and configures potentially multiple instances of a target class * annotated as @ConfigurableInstance. Returns the created instances in * a list in no particular order. */ public Collection<?> configureInstances (Class<?> target); /** * Configures a set of named instances that have already been created. * This is useful for restoring instances from a bootstrap record when * those instances have already been created by, for example, a dynamically * configured customer model. */ public Collection<?> configureNamedInstances (List<?> instances); /** * Gathers public configuration data for publication to brokers. Data is gathered * from @ConfigurableValue properties with publish=true. Note that such properties * must either be fields, or have a "standard" getter, or must specify a getter * that produces the value as a String. This is typically called at the end of * the initialize() method. */ public void publishConfiguration (Object target); /** * Gathers state information at the end of a boot session to be restored * in a subsequent sim session. Data is gathered from @ConfigurableValue * properties with bootstrapState=true. Such properties can be fields, or * may have "standard" getters and setters. This method is called at the * end of a bootstrap session by a component that wishes to have its state * saved in the boot record. */ public void saveBootstrapState (Object thing); }
UTF-8
Java
2,970
java
ServerConfiguration.java
Java
[ { "context": " specified in the server configuration.\n * @author John Collins\n */\npublic interface ServerConfiguration\n{\n /**\n", "end": 1184, "score": 0.9996225237846375, "start": 1172, "tag": "NAME", "value": "John Collins" } ]
null
[]
/* * Copyright (c) 2012 by the original author * * 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.powertac.common.interfaces; import java.util.Collection; import java.util.List; /** * Support for annotation-driven configuration. Configurable services, including * services that create configurable instances (such as gencos or customer models), * configure themselves by calling configure(). The result is that properties * annotated as @ConfigurableValue will be matched with configuration * data, and classes annotated as @ConfigurableInstance will have instances * created and configured as specified in the server configuration. * @author <NAME> */ public interface ServerConfiguration { /** * Configures a target object by matching configuration clauses with * @ConfigurableValue annotations on the target object. This is typically * called in the initialize() method. */ public void configureMe (Object target); /** * Creates and configures potentially multiple instances of a target class * annotated as @ConfigurableInstance. Returns the created instances in * a list in no particular order. */ public Collection<?> configureInstances (Class<?> target); /** * Configures a set of named instances that have already been created. * This is useful for restoring instances from a bootstrap record when * those instances have already been created by, for example, a dynamically * configured customer model. */ public Collection<?> configureNamedInstances (List<?> instances); /** * Gathers public configuration data for publication to brokers. Data is gathered * from @ConfigurableValue properties with publish=true. Note that such properties * must either be fields, or have a "standard" getter, or must specify a getter * that produces the value as a String. This is typically called at the end of * the initialize() method. */ public void publishConfiguration (Object target); /** * Gathers state information at the end of a boot session to be restored * in a subsequent sim session. Data is gathered from @ConfigurableValue * properties with bootstrapState=true. Such properties can be fields, or * may have "standard" getters and setters. This method is called at the * end of a bootstrap session by a component that wishes to have its state * saved in the boot record. */ public void saveBootstrapState (Object thing); }
2,964
0.748822
0.746128
72
40.25
31.451351
84
false
false
0
0
0
0
0
0
0.291667
false
false
2
33e1bc09c76b8374c39ed4818f10bbb32c6769d7
35,940,286,378,979
26bacc8bb95762c702548703bb786ae9785d7358
/src/fr/sorbonne_u/datacenter/hardware/computers/ports/ComputerServicesInboundPort.java
b82cd42ee53421f0a67e17b6eec79377016777e8
[ "MIT" ]
permissive
lexctk/SylAlexCenter
https://github.com/lexctk/SylAlexCenter
3e2b18ad94dc0a1744943d68c41151fae375eff8
ba4f13f01e5cbdd32e02828e17a462189314dc79
refs/heads/master
2020-03-31T14:54:38.674000
2019-02-03T21:35:47
2019-02-03T21:35:47
151,435,903
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package fr.sorbonne_u.datacenter.hardware.computers.ports; import fr.sorbonne_u.components.AbstractComponent; import fr.sorbonne_u.components.ComponentI; import fr.sorbonne_u.components.ports.AbstractInboundPort; import fr.sorbonne_u.datacenter.hardware.computers.Computer; import fr.sorbonne_u.datacenter.hardware.computers.Computer.AllocatedCore; import fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI; /** * The class <code>ComputerServicesInboundPort</code> implements an inbound port * offering the <code>ComputerServicesI</code> interface. * * <p> * <strong>Description</strong> * </p> * * <p> * <strong>Invariant</strong> * </p> * * <pre> * invariant true * </pre> * * <p> * Created on : April 9, 2015 * </p> * * @author <a href="mailto:Jacques.Malenfant@lip6.fr">Jacques Malenfant</a> */ public class ComputerServicesInboundPort extends AbstractInboundPort implements ComputerServicesI { private static final long serialVersionUID = 1L; // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ public ComputerServicesInboundPort(ComponentI owner) throws Exception { super(ComputerServicesI.class, owner); assert owner instanceof Computer; } public ComputerServicesInboundPort(String uri, ComponentI owner) throws Exception { super(uri, ComputerServicesI.class, owner); assert owner instanceof Computer; } // ------------------------------------------------------------------------ // Methods // ------------------------------------------------------------------------ /** * @see fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI#allocateCore() */ @Override public AllocatedCore allocateCore() throws Exception { return this.getOwner().handleRequestSync(new AbstractComponent.AbstractService<>() { @Override public AllocatedCore call() throws Exception { return ((Computer) this.getOwner()).allocateCore(); } }); } /** * @see fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI#allocateCores(int) */ @Override public AllocatedCore[] allocateCores(final int numberRequested) throws Exception { return this.getOwner().handleRequestSync(new AbstractComponent.AbstractService<>() { @Override public AllocatedCore[] call() throws Exception { return ((Computer) this.getOwner()).allocateCores(numberRequested); } }); } @Override public boolean increaseFrequency(int coreNo, int processorNo) throws Exception { final Computer computer = (Computer) this.getOwner(); return this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Boolean>() { @Override public Boolean call() throws Exception { return computer.increaseFrequency(coreNo, processorNo); } }); } @Override public boolean decreaseFrequency(int coreNo, int processorNo) throws Exception { final Computer computer = (Computer) this.getOwner(); return this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Boolean>() { @Override public Boolean call() throws Exception { return computer.decreaseFrequency(coreNo, processorNo); } }); } @Override public void releaseCores(AllocatedCore[] allocateCores) throws Exception { final Computer computer = (Computer) this.getOwner(); this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Void>() { @Override public Void call() throws Exception { computer.releaseCores(allocateCores); return null; } }); } }
UTF-8
Java
3,656
java
ComputerServicesInboundPort.java
Java
[ { "context": "il 9, 2015\n * </p>\n * \n * @author <a href=\"mailto:Jacques.Malenfant@lip6.fr\">Jacques Malenfant</a>\n */\npublic class ComputerS", "end": 820, "score": 0.9986892342567444, "start": 795, "tag": "EMAIL", "value": "Jacques.Malenfant@lip6.fr" }, { "context": "author <a href=\"mailto:Jacques.Malenfant@lip6.fr\">Jacques Malenfant</a>\n */\npublic class ComputerServicesInboundPort ", "end": 839, "score": 0.9998789429664612, "start": 822, "tag": "NAME", "value": "Jacques Malenfant" } ]
null
[]
package fr.sorbonne_u.datacenter.hardware.computers.ports; import fr.sorbonne_u.components.AbstractComponent; import fr.sorbonne_u.components.ComponentI; import fr.sorbonne_u.components.ports.AbstractInboundPort; import fr.sorbonne_u.datacenter.hardware.computers.Computer; import fr.sorbonne_u.datacenter.hardware.computers.Computer.AllocatedCore; import fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI; /** * The class <code>ComputerServicesInboundPort</code> implements an inbound port * offering the <code>ComputerServicesI</code> interface. * * <p> * <strong>Description</strong> * </p> * * <p> * <strong>Invariant</strong> * </p> * * <pre> * invariant true * </pre> * * <p> * Created on : April 9, 2015 * </p> * * @author <a href="mailto:<EMAIL>"><NAME></a> */ public class ComputerServicesInboundPort extends AbstractInboundPort implements ComputerServicesI { private static final long serialVersionUID = 1L; // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ public ComputerServicesInboundPort(ComponentI owner) throws Exception { super(ComputerServicesI.class, owner); assert owner instanceof Computer; } public ComputerServicesInboundPort(String uri, ComponentI owner) throws Exception { super(uri, ComputerServicesI.class, owner); assert owner instanceof Computer; } // ------------------------------------------------------------------------ // Methods // ------------------------------------------------------------------------ /** * @see fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI#allocateCore() */ @Override public AllocatedCore allocateCore() throws Exception { return this.getOwner().handleRequestSync(new AbstractComponent.AbstractService<>() { @Override public AllocatedCore call() throws Exception { return ((Computer) this.getOwner()).allocateCore(); } }); } /** * @see fr.sorbonne_u.datacenter.hardware.computers.interfaces.ComputerServicesI#allocateCores(int) */ @Override public AllocatedCore[] allocateCores(final int numberRequested) throws Exception { return this.getOwner().handleRequestSync(new AbstractComponent.AbstractService<>() { @Override public AllocatedCore[] call() throws Exception { return ((Computer) this.getOwner()).allocateCores(numberRequested); } }); } @Override public boolean increaseFrequency(int coreNo, int processorNo) throws Exception { final Computer computer = (Computer) this.getOwner(); return this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Boolean>() { @Override public Boolean call() throws Exception { return computer.increaseFrequency(coreNo, processorNo); } }); } @Override public boolean decreaseFrequency(int coreNo, int processorNo) throws Exception { final Computer computer = (Computer) this.getOwner(); return this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Boolean>() { @Override public Boolean call() throws Exception { return computer.decreaseFrequency(coreNo, processorNo); } }); } @Override public void releaseCores(AllocatedCore[] allocateCores) throws Exception { final Computer computer = (Computer) this.getOwner(); this.getOwner().handleRequestSync( new AbstractComponent.AbstractService<Void>() { @Override public Void call() throws Exception { computer.releaseCores(allocateCores); return null; } }); } }
3,627
0.678063
0.676149
121
29.214876
30.294207
100
false
false
0
0
0
0
0
0
1.719008
false
false
2
4da97cd33a70ddb382ee985f1789194de7b73442
36,584,531,469,540
75bf3b9b13407ca4cd956835f19efdb5e8e479f5
/src/main/java/com/example/demo/exception/PasswordInvalidException.java
5ae0e584e6b7e5022020c09de0830c485d2ed1a3
[]
no_license
artyom-yurin/LibrarySystem
https://github.com/artyom-yurin/LibrarySystem
809e8711a98089c7c7cd157b7f1cddebbeea285f
f158a41b275ae35b27ce592ce6e406932e7eb99f
refs/heads/master
2021-01-24T00:43:06.415000
2019-02-16T09:17:45
2019-02-16T09:17:45
122,775,518
0
0
null
false
2019-02-16T09:17:46
2018-02-24T20:07:42
2019-02-05T11:31:15
2019-02-16T09:17:46
372
0
0
0
Java
false
null
package com.example.demo.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value = HttpStatus.FORBIDDEN, reason = "Invalid password") public class PasswordInvalidException extends RuntimeException { }
UTF-8
Java
287
java
PasswordInvalidException.java
Java
[]
null
[]
package com.example.demo.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value = HttpStatus.FORBIDDEN, reason = "Invalid password") public class PasswordInvalidException extends RuntimeException { }
287
0.836237
0.836237
8
34.875
29.070765
74
false
false
0
0
0
0
0
0
0.5
false
false
2
793ba97967c4f30e48d411d02a913bd3d0201af7
38,886,633,920,402
7ca5b46769738d68b8b6c6c8497abffb1fb4516d
/app/src/main/java/com/cyw/zsj/module/homePage/adapter/MaterielDescHolder.java
51fdd22f34b2d23533c182da3de091e28a2a4937
[]
no_license
kissmiao/Zsj
https://github.com/kissmiao/Zsj
f63247d8cc709377248302945948ee23987c70c0
17da3ddf747c468d5d9ac2c915d4ee06a89bbd7f
refs/heads/master
2019-01-28T17:06:58.982000
2017-11-19T10:29:00
2017-11-19T10:29:00
98,107,359
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cyw.zsj.module.homePage.adapter; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; import com.cyw.zsj.R; /** * Created by lyd10892 on 2016/8/23. */ public class MaterielDescHolder extends RecyclerView.ViewHolder { public TextView tv_brand; public TextView tv_brand_name; public TextView specifications_one; public TextView specifications_tow; public TextView tv_market_price; public TextView tv_shop_price; public TextView tv_num; public ImageView iv_materiel_item_image; public ImageView mCheckBox; public View mItemView; public MaterielDescHolder(View itemView) { super(itemView); initView(); mItemView = itemView; } private void initView() { tv_brand = (TextView) itemView.findViewById(R.id.tv_materiel_item_brand); tv_brand_name = (TextView) itemView.findViewById(R.id.tv_materiel_brand_name); specifications_one = (TextView) itemView.findViewById(R.id.tv_materiel_specifications_one); specifications_tow = (TextView) itemView.findViewById(R.id.tv_materiel_specifications_tow); tv_market_price = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_price); tv_shop_price = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_cost_price); tv_num = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_number); iv_materiel_item_image = (ImageView) itemView.findViewById(R.id.iv_materiel_item_image); mCheckBox = (ImageView) itemView.findViewById(R.id.cb_materiel); } }
UTF-8
Java
1,700
java
MaterielDescHolder.java
Java
[ { "context": "xtView;\n\nimport com.cyw.zsj.R;\n\n\n/**\n * Created by lyd10892 on 2016/8/23.\n */\n\npublic class MaterielDescHolde", "end": 267, "score": 0.9994019865989685, "start": 259, "tag": "USERNAME", "value": "lyd10892" } ]
null
[]
package com.cyw.zsj.module.homePage.adapter; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; import com.cyw.zsj.R; /** * Created by lyd10892 on 2016/8/23. */ public class MaterielDescHolder extends RecyclerView.ViewHolder { public TextView tv_brand; public TextView tv_brand_name; public TextView specifications_one; public TextView specifications_tow; public TextView tv_market_price; public TextView tv_shop_price; public TextView tv_num; public ImageView iv_materiel_item_image; public ImageView mCheckBox; public View mItemView; public MaterielDescHolder(View itemView) { super(itemView); initView(); mItemView = itemView; } private void initView() { tv_brand = (TextView) itemView.findViewById(R.id.tv_materiel_item_brand); tv_brand_name = (TextView) itemView.findViewById(R.id.tv_materiel_brand_name); specifications_one = (TextView) itemView.findViewById(R.id.tv_materiel_specifications_one); specifications_tow = (TextView) itemView.findViewById(R.id.tv_materiel_specifications_tow); tv_market_price = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_price); tv_shop_price = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_cost_price); tv_num = (TextView) itemView.findViewById(R.id.tv_materiel_item_project_number); iv_materiel_item_image = (ImageView) itemView.findViewById(R.id.iv_materiel_item_image); mCheckBox = (ImageView) itemView.findViewById(R.id.cb_materiel); } }
1,700
0.719412
0.711765
50
33
31.76539
99
false
false
0
0
0
0
0
0
0.58
false
false
2
dfa126b89517e06b789a7020d4ff013963a309e3
16,698,832,896,818
0a0752dd39277c619e8c89823632b0757d5051f3
/findbugs/over_run/src/mid/classes/org/apache/batik/svggen/font/table/SingleSubstFormat2.java
604b0b095096cfa69a32368e206cc85f6c5a7d39
[]
no_license
anthonycanino1/entbench
https://github.com/anthonycanino1/entbench
fc5386f6806124a13059a1d7f21ba1128af7bb19
3c664cc693d4415fd8367c8307212d5aa2f3ae68
refs/heads/master
2021-01-10T13:49:12.811000
2016-11-14T21:57:38
2016-11-14T21:57:38
52,231,403
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.apache.batik.svggen.font.table; public class SingleSubstFormat2 extends org.apache.batik.svggen.font.table.SingleSubst { private int coverageOffset; private int glyphCount; private int[] substitutes; private org.apache.batik.svggen.font.table.Coverage coverage; protected SingleSubstFormat2(java.io.RandomAccessFile raf, int offset) throws java.io.IOException { super(); coverageOffset = raf.readUnsignedShort( ); glyphCount = raf.readUnsignedShort( ); substitutes = (new int[glyphCount]); for (int i = 0; i < glyphCount; i++) { substitutes[i] = raf. readUnsignedShort( ); } raf.seek(offset + coverageOffset); coverage = org.apache.batik.svggen.font.table.Coverage. read( raf); } public int getFormat() { return 2; } public int substitute(int glyphId) { int i = coverage.findGlyph( glyphId); if (i > -1) { return substitutes[i]; } return glyphId; } public static final java.lang.String jlc$CompilerVersion$jl7 = "2.7.0"; public static final long jlc$SourceLastModified$jl7 = 1445630120000L; public static final java.lang.String jlc$ClassType$jl7 = ("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"); public static final java.lang.String jlc$CompilerVersion$jl5 = "2.7.0"; public static final long jlc$SourceLastModified$jl5 = 1445630120000L; public static final java.lang.String jlc$ClassType$jl5 = ("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" + "M4/91Lf/yCt/VB7F/l+jFmQ65ykAAA=="); }
UTF-8
Java
19,984
java
SingleSubstFormat2.java
Java
[ { "context": " \"h1TlUJe52d7dkdmZYab3bg+CiFURylSMUTSYyP2RYKIUiJVoJcaS", "end": 2113, "score": 0.6327534914016724, "start": 2111, "tag": "KEY", "value": "h1" }, { "context": " \"h1TlUJe52d7dkdmZYab3bg+CiFURylSMUTSYyP2RYKIUiJVoJcaSYBIjFBE", "end": 2120, "score": 0.5838658809661865, "start": 2115, "tag": "KEY", "value": "UJe52" }, { "context": " \"h1TlUJe52d7dkdmZYab3bg+CiFURylSMUTSYyP2RYKIUiJVoJcaSYBIjFBEL\" +\n ", "end": 2157, "score": 0.5859795212745667, "start": 2128, "tag": "KEY", "value": "ab3bg+CiFURylSMUTSYyP2RYKIUiJ" }, { "context": " \"h1TlUJe52d7dkdmZYab3bg+CiFURylSMUTSYyP2RYKIUiJVoJcaSYBIjFBEL\" +\n ", "end": 2171, "score": 0.5897232294082642, "start": 2159, "tag": "KEY", "value": "JcaSYBIjFBEL" }, { "context": " \"YiUqiUatlBq0Sv6ImJjEvNc9s/OxH4RUKtmqme3tfu/1e/1e/97r3oMfkSrL\" +\n ", "end": 2280, "score": 0.7228026986122131, "start": 2238, "tag": "KEY", "value": "YiUqiUatlBq0Sv6ImJjEvNc9s/OxH4RUKtmqme3tfu" }, { "context": " \"YiUqiUatlBq0Sv6ImJjEvNc9s/OxH4RUKtmqme3tfu/1e/1e/97r3oMfkSrL\" +\n ", "end": 2283, "score": 0.6315575242042542, "start": 2281, "tag": "KEY", "value": "1e" }, { "context": " \"YiUqiUatlBq0Sv6ImJjEvNc9s/OxH4RUKtmqme3tfu/1e/1e/97r3oMfkSrL\" +\n ", "end": 2286, "score": 0.5685451030731201, "start": 2284, "tag": "KEY", "value": "1e" }, { "context": "\"YiUqiUatlBq0Sv6ImJjEvNc9s/OxH4RUKtmqme3tfu/1e/1e/97r3oMfkSrL\" +\n ", "end": 2298, "score": 0.6975009441375732, "start": 2287, "tag": "KEY", "value": "97r3oMfkSrL" }, { "context": " \"JB2GpCWkCBs3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+", "end": 2375, "score": 0.6133425235748291, "start": 2365, "tag": "KEY", "value": "JB2GpCWkCB" }, { "context": " \"JB2GpCWkCBs3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+\" +\n ", "end": 2382, "score": 0.5927011966705322, "start": 2376, "tag": "KEY", "value": "3qBUZx" }, { "context": " \"JB2GpCWkCBs3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+\" +\n ", "end": 2388, "score": 0.5074023008346558, "start": 2387, "tag": "KEY", "value": "o" }, { "context": " \"JB2GpCWkCBs3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+\" +\n ", "end": 2390, "score": 0.5307320952415466, "start": 2389, "tag": "KEY", "value": "0" }, { "context": " \"JB2GpCWkCBs3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+\" +\n ", "end": 2403, "score": 0.5964794754981995, "start": 2399, "tag": "KEY", "value": "PyvW" }, { "context": " \"0ONE0mUXFuD2X7KS3HXi9vPtXExIxgTsLptLJlB9iiu52zSlcdQ", "end": 5668, "score": 0.6843903660774231, "start": 5667, "tag": "KEY", "value": "0" }, { "context": " \"kvZBfgBMtpStlMNsmC9DmFs+A7IF51T0yDrYd3qmWwbssnoBsC2MfM/exrKR\" +\n ", "end": 5820, "score": 0.5920543074607849, "start": 5819, "tag": "KEY", "value": "7" }, { "context": " \"kvZBfgBMtpStlMNsmC9DmFs+A7IF51T0yDrYd3qmWwbssnoBsC2MfM/exrKR\" +\n ", "end": 5824, "score": 0.5538755655288696, "start": 5822, "tag": "KEY", "value": "51" }, { "context": " \"kvZBfgBMtpStlMNsmC9DmFs+A7IF51T0yDrYd3qmWwbssnoBsC2MfM/exrKR\" +\n ", "end": 5832, "score": 0.5307105183601379, "start": 5831, "tag": "KEY", "value": "3" }, { "context": " \"kvZBfgBMtpStlMNsmC9DmFs+A7IF51T0yDrYd3qmWwbssnoBsC2MfM/exrKR\" +\n ", "end": 5835, "score": 0.5539244413375854, "start": 5834, "tag": "KEY", "value": "W" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5936, "score": 0.6809442043304443, "start": 5921, "tag": "KEY", "value": "Y8WgqWTAWaN2Ujv" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5940, "score": 0.530706524848938, "start": 5939, "tag": "KEY", "value": "7" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5946, "score": 0.5805985927581787, "start": 5944, "tag": "KEY", "value": "23" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5951, "score": 0.5995628833770752, "start": 5950, "tag": "KEY", "value": "G" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5956, "score": 0.5920469164848328, "start": 5955, "tag": "KEY", "value": "J" }, { "context": " \"Y8WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5967, "score": 0.5507018566131592, "start": 5965, "tag": "KEY", "value": "L8" }, { "context": "WgqWTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5975, "score": 0.614479124546051, "start": 5973, "tag": "KEY", "value": "AP" }, { "context": "WTAWaN2Ujvcdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP\" +\n ", "end": 5978, "score": 0.561478853225708, "start": 5976, "tag": "KEY", "value": "Rj" }, { "context": " \"7u42U55IbBYe+hw+IXj+iQ96BjtEemjtsXPUvHySMowcaL+4TFXpNyG6vfWt\" +\n ", "end": 6108, "score": 0.8190118074417114, "start": 6048, "tag": "KEY", "value": "7u42U55IbBYe+hw+IXj+iQ96BjtEemjtsXPUvHySMowcaL+4TFXpNyG6vfWt" }, { "context": " \"zY++f0iYEEziAWK6e8+9n0fu2yPcKyqdBQXFhpdHVDvCHHxdg9rNLz", "end": 6179, "score": 0.6669209003448486, "start": 6175, "tag": "KEY", "value": "zY++" }, { "context": " \"7/D25x7fvkto1erP26ugLD3023/8OrL3j8eLwH+FYleryzHk82D", "end": 6303, "score": 0.7646409273147583, "start": 6302, "tag": "KEY", "value": "7" }, { "context": " \"7/D25x7fvkto1erP26ugLD3023/8OrL3j8eLwH+FYleryzHk82DdFv", "end": 6306, "score": 0.5306031703948975, "start": 6305, "tag": "KEY", "value": "2" }, { "context": " \"7/D25x7fvkto1erP26ugLD3023/8OrL3j8eLwH+FYleryzHk82DdFvSOMKl6\" +\n ", "end": 6340, "score": 0.5073485374450684, "start": 6340, "tag": "KEY", "value": "" }, { "context": " \"FYkWqGMH4BQnAPsGVuVkamBQc74+fHVaXgD2O9JTqcfl+1/9uHHD", "end": 6558, "score": 0.6427828669548035, "start": 6556, "tag": "KEY", "value": "FY" }, { "context": " \"G/cfKUT93JVP07ODm9czbTCBendEJfNFv5szsYYlc+3HaftyZoj", "end": 7319, "score": 0.5142457485198975, "start": 7318, "tag": "KEY", "value": "G" }, { "context": " \"904e/TzVFUF0mlPqapCX7fvv3jORGHhsmQPk3XDgZLpxuUpHqeo", "end": 8843, "score": 0.7168387770652771, "start": 8842, "tag": "KEY", "value": "9" } ]
null
[]
package org.apache.batik.svggen.font.table; public class SingleSubstFormat2 extends org.apache.batik.svggen.font.table.SingleSubst { private int coverageOffset; private int glyphCount; private int[] substitutes; private org.apache.batik.svggen.font.table.Coverage coverage; protected SingleSubstFormat2(java.io.RandomAccessFile raf, int offset) throws java.io.IOException { super(); coverageOffset = raf.readUnsignedShort( ); glyphCount = raf.readUnsignedShort( ); substitutes = (new int[glyphCount]); for (int i = 0; i < glyphCount; i++) { substitutes[i] = raf. readUnsignedShort( ); } raf.seek(offset + coverageOffset); coverage = org.apache.batik.svggen.font.table.Coverage. read( raf); } public int getFormat() { return 2; } public int substitute(int glyphId) { int i = coverage.findGlyph( glyphId); if (i > -1) { return substitutes[i]; } return glyphId; } public static final java.lang.String jlc$CompilerVersion$jl7 = "2.7.0"; public static final long jlc$SourceLastModified$jl7 = 1445630120000L; public static final java.lang.String jlc$ClassType$jl7 = ("H4sIAAAAAAAAAMVZfZAUxRXv3fs+7rgP4EA+DjgOqkDdBcEYPaMeJyeHe9wV" + "h1TlUJe52d7dkdmZY<KEY>Vo<KEY>" + "<KEY>/1e/1e/<KEY>" + "<KEY>s3qBUZxPagZFo00aNKlrUeeuPyvW8/uOP8b+p2hkn1MJmclqx+" + "WbJor0LVhDVM5iiaxSRNptZaShPIMWhSi5qjElN0bZhMU6y+jKEqssL69QRF" + "gg2SGSMtEmOmMpJltM8WwMjcGNcmyrWJdgcJumKkQdaNcZdhpo+hxzOGtBl3" + "PouR5tgd0qgUzTJFjcYUi3XlTHKpoavjKVVnEZpjkTvUK+2FWBO7smAZOp5q" + "+uSz+9PNfBmmSJqmM26itY5aujpKEzHS5PauUmnG2kLuJBUxMslDzEhnzJk0" + "CpNGYVLHXpcKtG+kWjbTo3NzmCOp2pBRIUbm+4UYkillbDGDXGeQUMts2zkz" + "WDsvb63j7oCJD10a3fOt25t/WEGahkmTog2hOjIowWCSYVhQmhmhptWdSNDE" + "MGnRwOFD1FQkVdlqe7vVUlKaxLIQAs6yYGfWoCaf010r8CTYZmZlppt585I8" + "qOxfVUlVSoGtba6twsJe7AcD6xVQzExKEHs2S+VmRUvwOPJz5G3svBkIgLUm" + "Q1laz09VqUnQQVpFiKiSlooOQfBpKSCt0iEETR5rJYTiWhuSvFlK0TgjM4J0" + "g2IIqOr4QiALI9OCZFwSeGlmwEse/3y09tr7tmmrtTAJgc4JKquo/yRgag8w" + "raNJalLYB4KxYUnsYant+d1hQoB4WoBY0Pz4K+duuKz96DFBM6sIzcDIHVRm" + "cXn/yORTs3sWX12BatQauqWg832W8102aI905QxAmra8RByMOINH1/3qy3cd" + "oGfDpL6PVMu6ms1AHLXIesZQVGreRDVqSowm+kgd1RI9fLyP1EA7pmhU9A4k" + "kxZlfaRS5V3VOv8NS5QEEbhE9dBWtKTutA2JpXk7ZxBCauAhDfDMIeLDvxkZ" + "jab1DI1KsqQpmh4dNHW0Hx3KMYda0E7AqKFHRyD+N1++LHJV1NKzJgRkVDdT" + "UQmiIk3FYNQaTaWoFk3CSkWZNKLS6BAEmEqHsiMW69XNjMSuiGD8Gf+3mXO4" + "JlPGQiFw1+wgWKiwz1braoKacXlPduWqc0/GT4hAxM1jryYjV8L0ETF9hE8f" + "EdNHcPoInz5SOD0JhfisU1ENESDg3s0AFIDUDYuHbluzaXdHBUSmMVYJvkHS" + "RQWZq8dFFCcNxOWDp9adf+Xl+gNhEgbQGYHM5aaPTl/6ENnP1GWaAPwqlUgc" + "MI2WTh1F9SBH947t3LBjKdfDmxFQYBWAGbIPIo7np+gMIkExuU273v/k8MPb" + "dRcTfCnGyYwFnAg1HUEfB42Py0vmSc/En9/eGSaVgF+A2UyCPQZw2B6cwwc5" + "XQ58oy21YHAS/azikIO59Sxt6mNuDw++Ft6eCi6ejHtwHjwL7U3Jv3G0zcD3" + "dBGsGDMBK3h6+NKQse+1kx8s58vtZJImTwkwRFmXB71QWCvHqRY3BNeblALd" + "H/YOPvjQR7s28vgDigXFJuzEdw+gFrgQlvmrx7a8/tab+18NuzHLSJ1h6gw2" + "Mk3k8nbiEGksYyeGuqsSAKAKEjBwOm/RIDCVpIJ7CvfJ35sWLnvmw/uaRSio" + "0ONE0mUXFuD2X7KS3HXi9vPtXExIxgTsLptLJlB9iiu52zSlcdQjt/P0nEde" + "kvZBfgBMtpStlMNsmC9DmFs+A7IF51T0yDrYd3qmWwbssnoBsC2MfM/exrKR" + "<KEY>cdn7LL2u23ugkrGIsgvJmq/+Vn65+L86DoRYxAPtRj0bP" + "<KEY>" + "zY++f0iYEEziAWK6e8+9n0fu2yPcKyqdBQXFhpdHVDvCHHxdg9rNLzcL5+h9" + "7/D25x7fvkto1erP26ugLD3023/8OrL3j8eLwH+FYleryzHk82DdFvSOMKl6" + "2b6/7rjntQFAlz5Sm9WULVnal/DKhFLNyo543OXWULzDaxy6hpHQEvAC717B" + "FYkWqGMH4BQnAPsGVuVkamBQc74+fHVaXgD2O9JTqcfl+1/9uHHDx0fO8cXw" + "l/pevOmXDOGJFnwtRE9MDya71ZKVBroVR9fe2qwe/QwkDoNEvjEGTEi8OR86" + "2dRVNW+88Iu2TacqSLiX1Ku6lOiVONCTOkBYaqUhZ+eM628Q6DJWC69mbOVI" + "fmEIXxgBbnOLQ8WqjMH45t76k+lPX/uDiTc5sAkYm8XZKy08YQRzMj8muunk" + "wzPfefdn579XI0KrzEYJ8M3424A6cvc7nxYsMs+eRfZOgH84evDRmT3XneX8" + "bhpD7gW5wmIHEr3Le8WBzF/CHdUvhknNMGmW7SPZBknNYnIYhmOI5ZzT4Njm" + "G/cfKUT93JVP07ODm9czbTCBendEJfNFv5szsYYlc+3HaftyZojwxq2cZRF/" + "L8bXZU6KqjFMBY7uNJCgJpURyshkWR8FAExRUYhj79UiO+M7hq/bhMCBknG4" + "wW/FLDv7O1VAMStE4bAIX/FCdUtxM1KfUseNdI+e1YqqmrxIVdvhmW9PNr+E" + "qmpZVUtxMzLJwiymMDiCWsH9lU9yPPEKQH12ygc/Or6p5nWxv4qn0cDZ8J1t" + "J76r//5sGFlw1i/6S7AWeOyFEN+MKP/V0wneX0hjLJqiegZEsHSMaimWdo5C" + "/7vJEJIXlkYkzypPfH/ByR0TC97mAF2rWLBvoXgocnb38Hx88K2zpxvnPMkL" + "6UqsQeyE5r/0KLzT8F1VcA814Yvx5tVFk9sGQWDH3rbimz3MSLWRHVEVqPCq" + "koomqVziNdCt8kXBX9fja9zG+eWFRZzIoYhukR5V1yhWks7YVCe/5u+IYDBX" + "oDBWJMGs0c9NdiH4qtPnK848MKOh8BCH0tpLHNGWlHZmcIKX7v7zzPXXpTdd" + "xOlsbsDXQZFP9B88ftMi+YEwv2ASiF9wMeVn6vLjfL1JWdbU/LVOh+v88RIo" + "js07hTMDFZCT6PH3N8qMfRNfX4O4kNGpIgbKkO/hcbbeU1GEXE16cwF8zfwH" + "+NphI1BHCXzdWxZfS3EzUutkLidoL/03ri96bJ6AXY+UsSvn6vf1vH78U00C" + "904e/TzVFUF0mlPqapCX7fvv3jORGHhsmQPk3XDgZLpxuUpHqeoRJTbvrrwa" + "TSh+BjxLbTWWBhfZNTRgAdesvgxrmaA5VGbsML4eB/1T1L4hcsGOr/UTF4oh" + "X1nLo7OY1ZfAs8JWfcXFW12Ktfi5g5vApT5bxvTn8PU0FClu5g/Y/szF256D" + "QrTw0g3L/RkF/wmIe2z5yYmm2ukTt/xO5CvnrrkBzs/JrKp6q1FPu9owaVLh" + "djSI2tTgXz9npOPCGwvwhuUTyAuC80Uok8txMlKJX16WY4xML8ECuU00vPQn" + "GGkO0oMq/NtLdxKc4tKBKNHwkpyCAzCQYPO04UBK5OJuRHMh/7bP+33ahfzu" + "QYoFvtTH/x5y0lRW/EEUlw9PrFm77dwXHhNXZLIqbd2KUiZBySFu6/Kpbn5J" + "aY6s6tWLP5v8VN1CB3tahMLuFprlCfH1sBkMDL6ZgcsjqzN/h/T6/muPvLy7" + "+jSUWBtJSIJKY2PhSSpnZCEPb4wVu1yAQoDfa3XVv7vplU/fCLXyAysRFUd7" + "OY64/OCRM4NJw/h2mNT1kSqAVprjx7wbx7V1VB41fXcV1SNwkMjXb5Nxp0j4" + "1xFfGXtBG/O9eMUKm6Hw2qbw2hnO8mPUXInSUUxjoDjIGoZ3lK/sKp70c7jS" + "EInxWL9h2PdVtdP5yhsGB4Q/8cT8LwHsubsDHgAA"); public static final java.lang.String jlc$CompilerVersion$jl5 = "2.7.0"; public static final long jlc$SourceLastModified$jl5 = 1445630120000L; public static final java.lang.String jlc$ClassType$jl5 = ("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" + "M4/91Lf/yCt/VB7F/l+jFmQ65ykAAA=="); }
19,840
0.619195
0.521918
236
83.677963
28.151793
126
false
false
0
0
0
0
0
0
0.105932
false
false
2