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
c36549a08feb7512f6314440772ee21a75f73c6e
23,536,420,847,171
bc75ec3d5fbb59975830ed1f71bf8e28baa61582
/src/patchfilter/model/util/PatchInfo.java
d256fe39f4ccfb76e90586ab46181895c2b2094d
[]
no_license
Emilyaxe/InPaFer-ICSME
https://github.com/Emilyaxe/InPaFer-ICSME
105bd7ada05dbce80205fc2cba854462517e8416
494257f6771bd0b54da3af0feaaa00c3a6097e75
refs/heads/master
2023-05-03T19:34:49.737000
2021-02-01T02:16:02
2021-02-01T02:16:02
363,866,851
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package patchfilter.model.util; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lombok.extern.slf4j.Slf4j; import patchfilter.model.config.Constant; import patchfilter.model.entity.Pair; import patchfilter.model.entity.PatchFile; import patchfilter.model.instrument.visitor.MethodInstrumentVisitor; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.CompilationUnit; import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; @Slf4j public class PatchInfo { public static void obainAllMethod(List<PatchFile> patchFileList){ for(PatchFile patchFile: patchFileList) { getModifyMethod(patchFile); } } // Set patchFile 修改的函数名称 public static void getModifyMethod(PatchFile patchFile){ log.info("Init Method Range Info for: " + patchFile.getPatchName()); int modifyLine = patchFile.getModifyLine(); String fixedFile = patchFile.getFixedFile(); String MethodRangeFile = fixedFile.split("/")[fixedFile.split("/").length-1]; // 存储 fixed file下所有method的range的文件 String tmpMethodRecord = Constant.CACHE + patchFile.getSubject().getName() + "/" + patchFile.getSubject().getId() + "/" + MethodRangeFile; // 存储每个补丁,修改函数的文件 String patchMethodFile = Constant.CACHE + patchFile.getSubject().getName() + "/" + patchFile.getSubject().getId() + "/" + patchFile.getPatchName(); Map<String, Pair<Integer, Integer>> methodRangeList = new HashMap<String, Pair<Integer,Integer>>(); if(new File(patchMethodFile).exists()){ String methodName = FileIO.readFileToString(patchMethodFile); patchFile.setModifiedMethod(methodName); // return methodName; } else if(new File(tmpMethodRecord).exists()){ methodRangeList = str2Map(FileIO.readFileToString(tmpMethodRecord)); }else{ FileIO.backUpFile(fixedFile, fixedFile + ".bak"); MethodInstrumentVisitor methodVisitor = new MethodInstrumentVisitor(); CompilationUnit compilationUnit = FileIO.genASTFromSource(FileIO.readFileToString(fixedFile), ASTParser.K_COMPILATION_UNIT); compilationUnit.accept(methodVisitor); methodRangeList = methodVisitor.getMethodRange(); String methodRange = JSONObject.toJSONString(methodRangeList); FileIO.writeStringToFile(tmpMethodRecord, methodRange); } for(Map.Entry<String, Pair<Integer, Integer>> entry: methodRangeList.entrySet()){ int starLine = entry.getValue().getKey(); int endLine = entry.getValue().getValue(); if(modifyLine >= starLine && modifyLine <= endLine){ FileIO.writeStringToFile(patchMethodFile, entry.getKey()); patchFile.setModifiedMethod(entry.getKey()); break; } } if(patchFile.getModifiedMethod().equals("")){ log.error("Patch " + patchFile.getPatchName() + " Cannot get modified Method!"); } // return null; } //private void public static Map<String, Pair<Integer, Integer>> str2Map(String str){ //Map<String, Pair<Integer, Integer>> map = // (Map<String, Pair<Integer, Integer>>) JSON.parseObject(str, new TypeReference<Map<String, Pair<Integer, Integer>>>() {}); Map<String,Pair<Integer, Integer>> map = new Gson().fromJson(str, new TypeToken<HashMap<String,Pair<Integer, Integer>>>(){}.getType()); return map; } }
UTF-8
Java
3,741
java
PatchInfo.java
Java
[]
null
[]
package patchfilter.model.util; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lombok.extern.slf4j.Slf4j; import patchfilter.model.config.Constant; import patchfilter.model.entity.Pair; import patchfilter.model.entity.PatchFile; import patchfilter.model.instrument.visitor.MethodInstrumentVisitor; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.CompilationUnit; import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; @Slf4j public class PatchInfo { public static void obainAllMethod(List<PatchFile> patchFileList){ for(PatchFile patchFile: patchFileList) { getModifyMethod(patchFile); } } // Set patchFile 修改的函数名称 public static void getModifyMethod(PatchFile patchFile){ log.info("Init Method Range Info for: " + patchFile.getPatchName()); int modifyLine = patchFile.getModifyLine(); String fixedFile = patchFile.getFixedFile(); String MethodRangeFile = fixedFile.split("/")[fixedFile.split("/").length-1]; // 存储 fixed file下所有method的range的文件 String tmpMethodRecord = Constant.CACHE + patchFile.getSubject().getName() + "/" + patchFile.getSubject().getId() + "/" + MethodRangeFile; // 存储每个补丁,修改函数的文件 String patchMethodFile = Constant.CACHE + patchFile.getSubject().getName() + "/" + patchFile.getSubject().getId() + "/" + patchFile.getPatchName(); Map<String, Pair<Integer, Integer>> methodRangeList = new HashMap<String, Pair<Integer,Integer>>(); if(new File(patchMethodFile).exists()){ String methodName = FileIO.readFileToString(patchMethodFile); patchFile.setModifiedMethod(methodName); // return methodName; } else if(new File(tmpMethodRecord).exists()){ methodRangeList = str2Map(FileIO.readFileToString(tmpMethodRecord)); }else{ FileIO.backUpFile(fixedFile, fixedFile + ".bak"); MethodInstrumentVisitor methodVisitor = new MethodInstrumentVisitor(); CompilationUnit compilationUnit = FileIO.genASTFromSource(FileIO.readFileToString(fixedFile), ASTParser.K_COMPILATION_UNIT); compilationUnit.accept(methodVisitor); methodRangeList = methodVisitor.getMethodRange(); String methodRange = JSONObject.toJSONString(methodRangeList); FileIO.writeStringToFile(tmpMethodRecord, methodRange); } for(Map.Entry<String, Pair<Integer, Integer>> entry: methodRangeList.entrySet()){ int starLine = entry.getValue().getKey(); int endLine = entry.getValue().getValue(); if(modifyLine >= starLine && modifyLine <= endLine){ FileIO.writeStringToFile(patchMethodFile, entry.getKey()); patchFile.setModifiedMethod(entry.getKey()); break; } } if(patchFile.getModifiedMethod().equals("")){ log.error("Patch " + patchFile.getPatchName() + " Cannot get modified Method!"); } // return null; } //private void public static Map<String, Pair<Integer, Integer>> str2Map(String str){ //Map<String, Pair<Integer, Integer>> map = // (Map<String, Pair<Integer, Integer>>) JSON.parseObject(str, new TypeReference<Map<String, Pair<Integer, Integer>>>() {}); Map<String,Pair<Integer, Integer>> map = new Gson().fromJson(str, new TypeToken<HashMap<String,Pair<Integer, Integer>>>(){}.getType()); return map; } }
3,741
0.660147
0.658517
94
38.159573
33.782566
143
false
false
0
0
0
0
0
0
0.744681
false
false
2
7a40dcbd7d6ba109a6ae2024d136c1dc8cc9f4b7
3,831,110,882,303
0c727870731a350d7e530374e1947a5704fcc1dc
/xchange-bitcointoyou/src/main/java/com/xeiam/xchange/bitcointoyou/service/polling/BitcoinToYouAccountServiceRaw.java
488aca305dadbd158a7ddae00e76b5b19ca87f6b
[ "MIT" ]
permissive
egregor-dev/XChange
https://github.com/egregor-dev/XChange
08c3335563e36408d6605916e4052795d91e8bf0
e2654a9e1537ae0f9f9141df7961712a9ed23630
refs/heads/develop
2020-12-29T19:04:18.379000
2015-06-27T07:13:39
2015-06-27T07:13:39
38,203,309
1
0
null
true
2015-06-28T15:14:18
2015-06-28T15:14:17
2015-06-24T15:10:22
2015-06-27T14:34:44
33,002
0
0
0
null
null
null
package com.xeiam.xchange.bitcointoyou.service.polling; import java.io.IOException; import com.xeiam.xchange.Exchange; import com.xeiam.xchange.bitcointoyou.dto.BitcoinToYouBaseTradeApiResult; import com.xeiam.xchange.bitcointoyou.dto.account.BitcoinToYouBalance; import com.xeiam.xchange.bitcointoyou.service.BitcoinToYouDigest; import com.xeiam.xchange.exceptions.ExchangeException; /** * @author gnandiga * @author Felipe Micaroni Lalli */ public class BitcoinToYouAccountServiceRaw extends BitcoinToYouBasePollingService { /** * @param exchange */ protected BitcoinToYouAccountServiceRaw(Exchange exchange) { super(exchange); } public BitcoinToYouBaseTradeApiResult<BitcoinToYouBalance[]> getBitcoinToYouBalance() throws IOException { Long nonce = exchange.getNonceFactory().createValue(); BitcoinToYouDigest signatureCreator = BitcoinToYouDigest.createInstance(exchange.getExchangeSpecification().getApiKey(), exchange .getExchangeSpecification().getSecretKey(), nonce); BitcoinToYouBaseTradeApiResult<BitcoinToYouBalance[]> accountInfo = bitcoinToYouAuthenticated.getBalance(exchange.getExchangeSpecification() .getApiKey(), nonce, signatureCreator, nonce); if (accountInfo.getSuccess() == 0) { throw new ExchangeException("Error getting account info: " + accountInfo.getError()); } return accountInfo; } }
UTF-8
Java
1,394
java
BitcoinToYouAccountServiceRaw.java
Java
[ { "context": "ange.exceptions.ExchangeException;\n\n/**\n * @author gnandiga\n * @author Felipe Micaroni Lalli\n */\npublic class", "end": 411, "score": 0.9943058490753174, "start": 403, "tag": "USERNAME", "value": "gnandiga" }, { "context": "angeException;\n\n/**\n * @author gnandig...
null
[]
package com.xeiam.xchange.bitcointoyou.service.polling; import java.io.IOException; import com.xeiam.xchange.Exchange; import com.xeiam.xchange.bitcointoyou.dto.BitcoinToYouBaseTradeApiResult; import com.xeiam.xchange.bitcointoyou.dto.account.BitcoinToYouBalance; import com.xeiam.xchange.bitcointoyou.service.BitcoinToYouDigest; import com.xeiam.xchange.exceptions.ExchangeException; /** * @author gnandiga * @author <NAME> */ public class BitcoinToYouAccountServiceRaw extends BitcoinToYouBasePollingService { /** * @param exchange */ protected BitcoinToYouAccountServiceRaw(Exchange exchange) { super(exchange); } public BitcoinToYouBaseTradeApiResult<BitcoinToYouBalance[]> getBitcoinToYouBalance() throws IOException { Long nonce = exchange.getNonceFactory().createValue(); BitcoinToYouDigest signatureCreator = BitcoinToYouDigest.createInstance(exchange.getExchangeSpecification().getApiKey(), exchange .getExchangeSpecification().getSecretKey(), nonce); BitcoinToYouBaseTradeApiResult<BitcoinToYouBalance[]> accountInfo = bitcoinToYouAuthenticated.getBalance(exchange.getExchangeSpecification() .getApiKey(), nonce, signatureCreator, nonce); if (accountInfo.getSuccess() == 0) { throw new ExchangeException("Error getting account info: " + accountInfo.getError()); } return accountInfo; } }
1,379
0.784075
0.783357
42
32.190475
38.436241
144
false
false
0
0
0
0
0
0
0.428571
false
false
2
09b1e07d1754d00a726cc33c19550958ce5970e0
28,286,654,673,303
0f2ee5cab08234c0c26690feb0e5572a34b1b8a6
/ThinkingInJava/src/com/cn/session_1between3/application_5/Value.java
743300ee23465bb0e5af573e978c7594e995f28d
[]
no_license
StephenImp/JavaBasisAndPromote
https://github.com/StephenImp/JavaBasisAndPromote
dc16504c5ec54ff6826b2d1583fe52b65966a391
bd4991965b3add27fc22b4daf8d68c0d8da9dc03
refs/heads/master
2022-12-26T15:47:27.762000
2021-03-04T14:11:54
2021-03-04T14:11:54
150,877,893
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cn.session_1between3.application_5; public class Value { int i; @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + i; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Value other = (Value) obj; if (i != other.i) return false; return true; } }
UTF-8
Java
587
java
Value.java
Java
[]
null
[]
package com.cn.session_1between3.application_5; public class Value { int i; @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + i; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Value other = (Value) obj; if (i != other.i) return false; return true; } }
587
0.502555
0.492334
30
18.566668
13.688641
47
false
false
0
0
0
0
0
0
0.4
false
false
2
2ba93e0b0460344ecf6e4b48a1ff11428270e4c2
21,199,958,630,709
517e8a971b817351217d7a83d2d828a6fa7f5ca2
/src/edu/METutor/TheoryOfMachines/Cams/InputHandler.java
2136472bf8319dfddbc9b53e9b6af7a39c342566
[]
no_license
Argonizer/MechanicalCamFollowerDesignSoftware
https://github.com/Argonizer/MechanicalCamFollowerDesignSoftware
ae56b95e0b036d44323292d669a9aa1a208bad85
bd7a1bd6b26c87db4aaf1a4ae5eb52d89f5315f8
refs/heads/master
2021-09-21T21:08:47.232000
2018-08-31T14:20:52
2018-08-31T14:20:52
146,898,793
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.METutor.TheoryOfMachines.Cams; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class InputHandler implements MouseListener, MouseMotionListener { DispAngleDiagram disp; public int MouseX, MouseY; private boolean[] buttons = new boolean[4]; public InputHandler(DispAngleDiagram disp) { this.disp = disp; for (int i = 0; i < 4; i++) { buttons[i] = false; } } public void mouseClicked(MouseEvent e) { } public void mousePressed(MouseEvent e) { MouseX = e.getX(); MouseY = e.getY(); Rectangle MouseR = new Rectangle(MouseX - 1, MouseY - 1, 2, 2); if (disp.AngleMark1ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark1 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark1 = clamp((int)DispAngleDiagram.AngleMark1, 3, (int)DispAngleDiagram.AngleMark2 - 5); buttons[0] = true; } if (disp.AngleMark2ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark2 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark2 = clamp((int)DispAngleDiagram.AngleMark2, (int)DispAngleDiagram.AngleMark1 + 6, (int)DispAngleDiagram.AngleMark3 - 5); buttons[1] = true; } if (disp.AngleMark3ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark3 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark3 = clamp((int)DispAngleDiagram.AngleMark3, (int)DispAngleDiagram.AngleMark2 + 6, 357); buttons[2] = true; } if (disp.getFollowerBounds().intersects(MouseR)) { ControlPanel.OffsetData = (MouseY - RenderCamProfile.centreY); ControlPanel.OffsetData = clamp((int)ControlPanel.OffsetData, -1 * (int)ControlPanel.BaseRadData, (int)ControlPanel.BaseRadData); buttons[3] = true; } } public void mouseReleased(MouseEvent e) { for (int i = 0; i < 4; i++) { buttons[i] = false; } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mouseDragged(MouseEvent e) { MouseX = e.getX(); MouseY = e.getY(); if (buttons[0]) { DispAngleDiagram.AngleMark1 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark1 = clamp((int)DispAngleDiagram.AngleMark1, 3, (int)DispAngleDiagram.AngleMark2 - 5); } else if (buttons[1]) { DispAngleDiagram.AngleMark2 = (MouseX - 50 ) / 2; DispAngleDiagram.AngleMark2 = clamp((int)DispAngleDiagram.AngleMark2, (int)DispAngleDiagram.AngleMark1 + 6, (int)DispAngleDiagram.AngleMark3 - 5); } else if (buttons[2]) { DispAngleDiagram.AngleMark3 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark3 = clamp((int)DispAngleDiagram.AngleMark3, (int)DispAngleDiagram.AngleMark2 + 6, 357); } else if (buttons[3]){ ControlPanel.OffsetData = (MouseY - RenderCamProfile.centreY); ControlPanel.OffsetData = clamp((int)ControlPanel.OffsetData, -1 * (int)ControlPanel.BaseRadData, (int)ControlPanel.BaseRadData); } } public void mouseMoved(MouseEvent e) { } public int clamp(int Angle, int MinAngle, int MaxAngle) { if(Angle < MinAngle) return MinAngle; else if(Angle > MaxAngle) return MaxAngle; else return Angle; } }
UTF-8
Java
3,224
java
InputHandler.java
Java
[]
null
[]
package edu.METutor.TheoryOfMachines.Cams; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class InputHandler implements MouseListener, MouseMotionListener { DispAngleDiagram disp; public int MouseX, MouseY; private boolean[] buttons = new boolean[4]; public InputHandler(DispAngleDiagram disp) { this.disp = disp; for (int i = 0; i < 4; i++) { buttons[i] = false; } } public void mouseClicked(MouseEvent e) { } public void mousePressed(MouseEvent e) { MouseX = e.getX(); MouseY = e.getY(); Rectangle MouseR = new Rectangle(MouseX - 1, MouseY - 1, 2, 2); if (disp.AngleMark1ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark1 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark1 = clamp((int)DispAngleDiagram.AngleMark1, 3, (int)DispAngleDiagram.AngleMark2 - 5); buttons[0] = true; } if (disp.AngleMark2ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark2 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark2 = clamp((int)DispAngleDiagram.AngleMark2, (int)DispAngleDiagram.AngleMark1 + 6, (int)DispAngleDiagram.AngleMark3 - 5); buttons[1] = true; } if (disp.AngleMark3ButtonBounds().intersects(MouseR)) { DispAngleDiagram.AngleMark3 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark3 = clamp((int)DispAngleDiagram.AngleMark3, (int)DispAngleDiagram.AngleMark2 + 6, 357); buttons[2] = true; } if (disp.getFollowerBounds().intersects(MouseR)) { ControlPanel.OffsetData = (MouseY - RenderCamProfile.centreY); ControlPanel.OffsetData = clamp((int)ControlPanel.OffsetData, -1 * (int)ControlPanel.BaseRadData, (int)ControlPanel.BaseRadData); buttons[3] = true; } } public void mouseReleased(MouseEvent e) { for (int i = 0; i < 4; i++) { buttons[i] = false; } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mouseDragged(MouseEvent e) { MouseX = e.getX(); MouseY = e.getY(); if (buttons[0]) { DispAngleDiagram.AngleMark1 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark1 = clamp((int)DispAngleDiagram.AngleMark1, 3, (int)DispAngleDiagram.AngleMark2 - 5); } else if (buttons[1]) { DispAngleDiagram.AngleMark2 = (MouseX - 50 ) / 2; DispAngleDiagram.AngleMark2 = clamp((int)DispAngleDiagram.AngleMark2, (int)DispAngleDiagram.AngleMark1 + 6, (int)DispAngleDiagram.AngleMark3 - 5); } else if (buttons[2]) { DispAngleDiagram.AngleMark3 = (MouseX - 50) / 2; DispAngleDiagram.AngleMark3 = clamp((int)DispAngleDiagram.AngleMark3, (int)DispAngleDiagram.AngleMark2 + 6, 357); } else if (buttons[3]){ ControlPanel.OffsetData = (MouseY - RenderCamProfile.centreY); ControlPanel.OffsetData = clamp((int)ControlPanel.OffsetData, -1 * (int)ControlPanel.BaseRadData, (int)ControlPanel.BaseRadData); } } public void mouseMoved(MouseEvent e) { } public int clamp(int Angle, int MinAngle, int MaxAngle) { if(Angle < MinAngle) return MinAngle; else if(Angle > MaxAngle) return MaxAngle; else return Angle; } }
3,224
0.691377
0.665943
104
29
35.363224
149
false
false
0
0
0
0
0
0
2.067308
false
false
2
941111a314cdd4728465c38cf74f3cb83b8270ce
16,990,890,635,886
3adbbe2f1612420e1be6720964c3a04b99f1078a
/app/src/main/java/com/sem/staticfragment/Staticfragment.java
52267b8530176b691516e307a94c7df780f844f5
[]
no_license
thaouet/StaticFragment
https://github.com/thaouet/StaticFragment
91a8ff716643e79090006bd8a1ffb7a493638527
03394857c81b7db0898358728c62e5d873bf880a
refs/heads/master
2020-08-31T14:20:52.089000
2019-10-31T07:35:37
2019-10-31T07:35:37
218,709,741
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sem.staticfragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; public class Staticfragment extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.staticfragment, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { // handle your fragment events here final TextView txtView = (TextView) view.findViewById(R.id.tv); Button btn = (Button) view.findViewById(R.id.btn); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { txtView.setText("Hello My Fragment"); } }); } }
UTF-8
Java
1,192
java
Staticfragment.java
Java
[]
null
[]
package com.sem.staticfragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; public class Staticfragment extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.staticfragment, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { // handle your fragment events here final TextView txtView = (TextView) view.findViewById(R.id.tv); Button btn = (Button) view.findViewById(R.id.btn); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { txtView.setText("Hello My Fragment"); } }); } }
1,192
0.708054
0.708054
41
28.073172
28.45912
132
false
false
0
0
0
0
0
0
0.512195
false
false
2
090a8989d0f83fe00d8e905b0fe652b6cac41762
15,659,450,783,712
d6b6abe73a0c82656b04875135b4888c644d2557
/sources/com/puzzlersworld/android/gcm/AndroAppGcmListenerService.java
5ac7744b827ecfaf368664e6f0053d2059b0f03d
[]
no_license
chanyaz/and_unimed
https://github.com/chanyaz/and_unimed
4344d1a8ce8cb13b6880ca86199de674d770304b
fb74c460f8c536c16cca4900da561c78c7035972
refs/heads/master
2020-03-29T09:07:09.224000
2018-08-30T06:29:32
2018-08-30T06:29:32
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.puzzlersworld.android.gcm; import android.app.NotificationManager; import android.os.Build.VERSION; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.gson.Gson; import com.puzzlersworld.android.util.g; import com.puzzlersworld.wp.controller.RestServiceManager; import com.puzzlersworld.wp.controller.a; import com.puzzlersworld.wp.dto.Config; import com.puzzlersworld.wp.dto.X; import javax.inject.Inject; import mobi.androapp.ac.c8700.R; public class AndroAppGcmListenerService extends FirebaseMessagingService { @Inject a b; @Inject g c; @Inject RestServiceManager d; private NotificationManager e; private Gson f; private X g; private Config h; /* JADX WARNING: Removed duplicated region for block: B:26:0x014e */ /* JADX WARNING: Removed duplicated region for block: B:36:0x01ae */ /* JADX WARNING: Removed duplicated region for block: B:74:0x03d1 */ /* JADX WARNING: Removed duplicated region for block: B:39:0x01b8 */ /* JADX WARNING: Removed duplicated region for block: B:60:0x02f0 */ /* JADX WARNING: Removed duplicated region for block: B:41:0x01be */ /* JADX WARNING: Removed duplicated region for block: B:26:0x014e */ /* JADX WARNING: Removed duplicated region for block: B:29:0x0188 */ /* JADX WARNING: Removed duplicated region for block: B:36:0x01ae */ /* JADX WARNING: Removed duplicated region for block: B:39:0x01b8 */ /* JADX WARNING: Removed duplicated region for block: B:74:0x03d1 */ /* JADX WARNING: Removed duplicated region for block: B:41:0x01be */ /* JADX WARNING: Removed duplicated region for block: B:60:0x02f0 */ /* JADX WARNING: Removed duplicated region for block: B:80:? A:{SYNTHETIC, RETURN} */ /* JADX WARNING: Removed duplicated region for block: B:44:0x022b */ private void a(java.util.Map r15) { /* r14 = this; r13 = 2131230781; // 0x7f08003d float:1.8077624E38 double:1.0529679123E-314; r12 = 2130837654; // 0x7f020096 float:1.7280268E38 double:1.0527736817E-314; r3 = 0; r6 = 0; r4 = 1; r0 = "AndroApp:"; r1 = "Generating notification"; android.util.Log.d(r0, r1); r0 = "notification"; r0 = r14.getSystemService(r0); r0 = (android.app.NotificationManager) r0; r14.e = r0; r7 = new android.content.Intent; r0 = com.puzzlersworld.android.FullscreenActivity.class; r7.<init>(r14, r0); r8 = java.lang.System.currentTimeMillis(); r0 = r14.getApplication(); com.puzzlersworld.android.gcm.b.a(r0); r0 = "AndroAppListenerService"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "Message : "; r1 = r1.append(r2); r1 = r1.append(r15); r1 = r1.toString(); android.util.Log.i(r0, r1); r5 = new com.puzzlersworld.wp.dto.Post; r5.<init>(); r0 = "post_id"; r0 = r15.containsKey(r0); if (r0 == 0) goto L_0x0061; L_0x0051: r1 = new java.lang.Long; r0 = "post_id"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r1.<init>(r0); r5.setID(r1); L_0x0061: r0 = "title"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setTitle(r0); r0 = "link"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setLink(r0); r0 = "excerpt"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setExcerpt(r0); r0 = "postImage"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setPostImage(r0); r0 = "cache"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r1 = "postType"; r1 = r15.get(r1); r1 = (java.lang.String) r1; if (r1 != 0) goto L_0x03db; L_0x009f: r1 = "post"; r2 = r1; L_0x00a2: r5.setPostType(r2); r1 = "AndroAppListenerService"; r10 = new java.lang.StringBuilder; r10.<init>(); r11 = "Post "; r10 = r10.append(r11); r11 = r5.getID(); r10 = r10.append(r11); r11 = " link= "; r10 = r10.append(r11); r11 = r5.getLink(); r10 = r10.append(r11); r11 = " contentType "; r10 = r10.append(r11); r11 = r5.getPostContentType(); r10 = r10.append(r11); r10 = r10.toString(); android.util.Log.d(r1, r10); r1 = r5.getID(); if (r1 != 0) goto L_0x00eb; L_0x00e3: r0 = "AndroApp:"; r1 = "Returning as post id is null"; android.util.Log.d(r0, r1); L_0x00ea: return; L_0x00eb: r1 = com.puzzlersworld.android.gcm.a.c; r10 = r5.getTitle(); r1.add(r10); r1 = com.puzzlersworld.android.gcm.a.c; r1 = r1.size(); r10 = r14.b(); if (r1 > r10) goto L_0x0303; L_0x0100: if (r0 == 0) goto L_0x010a; L_0x0102: r1 = "yes"; r0 = r0.equals(r1); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x03d7; L_0x010a: r0 = "AndroApp:"; r1 = "Caching the post"; android.util.Log.d(r0, r1); Catch:{ Exception -> 0x03ce } r0 = "page"; r0 = r2.equals(r0); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x029e; L_0x0119: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchPage(r1); Catch:{ Exception -> 0x03ce } L_0x0130: r0 = r0.execute(); Catch:{ Exception -> 0x03ce } r0 = r0.b(); Catch:{ Exception -> 0x03ce } r0 = (com.puzzlersworld.wp.dto.Post) r0; Catch:{ Exception -> 0x03ce } if (r0 != 0) goto L_0x02d8; L_0x013c: r1 = "AndroApp:"; r3 = "Returning as post is null"; android.util.Log.d(r1, r3); Catch:{ Exception -> 0x0144 } goto L_0x00ea; L_0x0144: r1 = move-exception; r3 = r4; r5 = r0; r0 = r1; L_0x0148: r0.printStackTrace(); r0 = r3; L_0x014c: if (r0 != 0) goto L_0x0182; L_0x014e: r0 = "AndroApp"; r1 = new java.lang.StringBuilder; r1.<init>(); r3 = "Notificatio post id "; r1 = r1.append(r3); r3 = r5.getID(); r1 = r1.append(r3); r3 = " post type "; r1 = r1.append(r3); r1 = r1.append(r2); r1 = r1.toString(); android.util.Log.d(r0, r1); r0 = "notificationPostId"; r1 = r5.getID(); r7.putExtra(r0, r1); r0 = "postType"; r7.putExtra(r0, r2); L_0x0182: r0 = r5.getFeaturedImageObject(); if (r0 == 0) goto L_0x03d4; L_0x0188: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); if (r0 == 0) goto L_0x03d4; L_0x0192: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); r0 = r0.isEmpty(); if (r0 != 0) goto L_0x03d4; L_0x01a0: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); L_0x01a8: r1 = com.puzzlersworld.android.util.w.f(r0); if (r1 == 0) goto L_0x01b2; L_0x01ae: r0 = r5.getPostImage(); L_0x01b2: r1 = com.puzzlersworld.android.util.w.f(r0); if (r1 != 0) goto L_0x03d1; L_0x01b8: r0 = com.puzzlersworld.android.util.w.a(r0); L_0x01bc: if (r0 == 0) goto L_0x02f0; L_0x01be: r1 = new android.support.v4.app.am; r1.<init>(); r0 = r1.a(r0); r1 = r5.getTitle(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.b(r1); r1 = r5.getTitle(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.a(r1); r0 = r0.b(r6); L_0x01e3: r1 = new android.support.v4.app.ao; r2 = "androapp_posts"; r1.<init>(r14, r2); r2 = r14.c(); r1 = r1.a(r2); r2 = r14.getDrawable(r12); r2 = com.puzzlersworld.android.util.w.a(r2); r1 = r1.a(r2); r2 = r5.getTitle(); r2 = com.puzzlersworld.android.util.w.b(r2); r1 = r1.a(r2); r0 = r1.a(r0); r0 = r0.a(r4); r0 = r0.a(r8); r1 = "Posts"; r0 = r0.a(r1); r1 = r5.getExcerpt(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.b(r1); r1 = r0; L_0x0229: if (r5 == 0) goto L_0x00ea; L_0x022b: r0 = r5.getID(); r0 = r0.intValue(); if (r4 != 0) goto L_0x023c; L_0x0235: r0 = 12426; // 0x308a float:1.7413E-41 double:6.1393E-320; r2 = "requestCode"; r7.putExtra(r2, r0); L_0x023c: r2 = 134217728; // 0x8000000 float:3.85186E-34 double:6.63123685E-316; r2 = android.app.PendingIntent.getActivity(r14, r0, r7, r2); r1.a(r2); r2 = new java.lang.StringBuilder; r2.<init>(); r3 = r14.getString(r13); r2 = r2.append(r3); r3 = " - "; r2 = r2.append(r3); r3 = com.puzzlersworld.wp.dto.StringConstants.NEW_POST; r3 = r3.getMessage(); r2 = r2.append(r3); r3 = " - "; r2 = r2.append(r3); r3 = r5.getTitle(); r2 = r2.append(r3); r2 = r2.toString(); r1.c(r2); r1 = r1.a(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r3 = 2; if (r2 > r3) goto L_0x03bd; L_0x0284: r2 = r1.defaults; r2 = r2 | 1; r1.defaults = r2; L_0x028a: r2 = r1.defaults; r2 = r2 | 8; r1.defaults = r2; r2 = r14.e; r2.notify(r0, r1); r0 = "AndroApp:"; r1 = "After notify"; android.util.Log.d(r0, r1); goto L_0x00ea; L_0x029e: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = com.puzzlersworld.android.util.w.a(r0); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x02bf; L_0x02a6: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchCustomPostV2(r2, r1); Catch:{ Exception -> 0x03ce } goto L_0x0130; L_0x02bf: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchPost(r1); Catch:{ Exception -> 0x03ce } goto L_0x0130; L_0x02d8: r1 = r14.getApplication(); Catch:{ Exception -> 0x0144 } r1 = (com.puzzlersworld.android.FriopinApplication) r1; Catch:{ Exception -> 0x0144 } r1 = r1.f(); Catch:{ Exception -> 0x0144 } r1 = r1.toJson(r0); Catch:{ Exception -> 0x0144 } r3 = "entity"; r7.putExtra(r3, r1); Catch:{ Exception -> 0x0144 } r1 = r0; r0 = r4; L_0x02ed: r5 = r1; goto L_0x014c; L_0x02f0: r0 = new android.support.v4.app.an; r0.<init>(); r1 = r5.getExcerpt(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.a(r1); goto L_0x01e3; L_0x0303: r0 = new com.puzzlersworld.wp.dto.Menu; Catch:{ Exception -> 0x0332 } r0.<init>(); Catch:{ Exception -> 0x0332 } r1 = com.puzzlersworld.wp.dto.MenuItemType.home; Catch:{ Exception -> 0x0332 } r0.setMenuItemType(r1); Catch:{ Exception -> 0x0332 } r1 = r14.b; Catch:{ Exception -> 0x0332 } r2 = 1; r1.a(r0, r2); Catch:{ Exception -> 0x0332 } L_0x0313: r1 = new android.support.v4.app.ap; r1.<init>(); r0 = com.puzzlersworld.android.gcm.a.c; r2 = r0.iterator(); L_0x031e: r0 = r2.hasNext(); if (r0 == 0) goto L_0x0337; L_0x0324: r0 = r2.next(); r0 = (java.lang.String) r0; r0 = com.puzzlersworld.android.util.w.b(r0); r1.b(r0); goto L_0x031e; L_0x0332: r0 = move-exception; r0.printStackTrace(); goto L_0x0313; L_0x0337: r0 = new java.lang.StringBuilder; r0.<init>(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r0 = r0.append(r2); r2 = " "; r0 = r0.append(r2); r2 = com.puzzlersworld.wp.dto.StringConstants.NEW_POSTS; r2 = r2.getMessage(); r0 = r0.append(r2); r0 = r0.toString(); r1.a(r0); r0 = new android.support.v4.app.ao; r2 = "androapp_posts"; r0.<init>(r14, r2); r2 = r14.getString(r13); r0 = r0.a(r2); r2 = r14.c(); r0 = r0.a(r2); r2 = r14.getDrawable(r12); r2 = com.puzzlersworld.android.util.w.a(r2); r0 = r0.a(r2); r0 = r0.a(r1); r1 = "Posts"; r0 = r0.a(r1); r0 = r0.c(r4); r0 = r0.a(r4); r1 = new java.lang.StringBuilder; r1.<init>(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r1 = r1.append(r2); r2 = " "; r1 = r1.append(r2); r2 = com.puzzlersworld.wp.dto.StringConstants.NEW_POSTS; r2 = r2.getMessage(); r1 = r1.append(r2); r1 = r1.toString(); r0 = r0.b(r1); r4 = r3; r1 = r0; goto L_0x0229; L_0x03bd: r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r3 = 5; if (r2 > r3) goto L_0x028a; L_0x03c6: r2 = r1.defaults; r2 = r2 | 2; r1.defaults = r2; goto L_0x028a; L_0x03ce: r0 = move-exception; goto L_0x0148; L_0x03d1: r0 = r6; goto L_0x01bc; L_0x03d4: r0 = r6; goto L_0x01a8; L_0x03d7: r0 = r3; r1 = r5; goto L_0x02ed; L_0x03db: r2 = r1; goto L_0x00a2; */ throw new UnsupportedOperationException("Method not decompiled: com.puzzlersworld.android.gcm.AndroAppGcmListenerService.a(java.util.Map):void"); } private int b() { return (this.h == null || this.h.getPushStackThershold() == null) ? 3 : this.h.getPushStackThershold().intValue(); } private int c() { return (VERSION.SDK_INT >= 21 ? 1 : null) != null ? R.drawable.notification_icon : R.drawable.ic_launcher; } /* JADX WARNING: Removed duplicated region for block: B:29:0x00d6 A:{ExcHandler: java.lang.NoSuchMethodError (r0_31 'e' java.lang.Error), Splitter: B:0:0x0000} */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing block: B:20:0x00bb, code: r0 = move-exception; */ /* JADX WARNING: Missing block: B:21:0x00bc, code: r0.printStackTrace(); */ /* JADX WARNING: Missing block: B:29:0x00d6, code: r0 = move-exception; */ /* JADX WARNING: Missing block: B:30:0x00d7, code: com.puzzlersworld.android.FriopinApplication.a().a(r0); */ /* JADX WARNING: Missing block: B:32:?, code: return; */ public void a(com.google.firebase.messaging.RemoteMessage r7) { /* r6 = this; super.a(r7); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r1 = r7.a(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r2 = r7.b(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } com.puzzlersworld.android.util.InjectibleApplication.a(r6); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = new com.google.gson.Gson; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r6.f = r0; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = "message"; r0 = r2.get(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = (java.lang.String) r0; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r3 = "AndroAppListenerService"; r4 = new java.lang.StringBuilder; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r5 = "From: "; r4 = r4.append(r5); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4 = r4.append(r1); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4 = r4.toString(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } android.util.Log.d(r3, r4); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r3 = "AndroAppListenerService"; r4 = new java.lang.StringBuilder; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r5 = "Message: "; r4 = r4.append(r5); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r4.append(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.toString(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } android.util.Log.d(r3, r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = "/topics/"; r0 = r1.startsWith(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0055; L_0x0055: r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0.a(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r0.e(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0085; L_0x0062: r0 = r6.f; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.e(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r3 = com.puzzlersworld.wp.dto.Config.class; r0 = r0.fromJson(r1, r3); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = (com.puzzlersworld.wp.dto.Config) r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r6.h = r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r6.h; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0085; L_0x0078: r0 = com.puzzlersworld.android.FriopinApplication.h(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.h; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.getStringMap(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0.setStringMap(r1); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } L_0x0085: r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r0.f(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x009f; L_0x008d: r0 = r6.f; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.f(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r3 = com.puzzlersworld.wp.dto.X.class; r0 = r0.fromJson(r1, r3); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = (com.puzzlersworld.wp.dto.X) r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r6.g = r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } L_0x009f: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00b7; L_0x00a3: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.getP(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00b7; L_0x00ab: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.getP(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.booleanValue(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00ce; L_0x00b7: r6.a(r2); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } L_0x00ba: return; L_0x00bb: r0 = move-exception; r0.printStackTrace(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } goto L_0x009f; L_0x00c0: r0 = move-exception; r0.printStackTrace(); r1 = com.puzzlersworld.android.FriopinApplication.a(); Catch:{ Exception -> 0x00cc } r1.a(r0); Catch:{ Exception -> 0x00cc } goto L_0x00ba; L_0x00cc: r0 = move-exception; goto L_0x00ba; L_0x00ce: r0 = "AndroAppListenerService"; r1 = "Not showing push notification as it is not enabled"; android.util.Log.d(r0, r1); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } goto L_0x00ba; L_0x00d6: r0 = move-exception; r1 = com.puzzlersworld.android.FriopinApplication.a(); r1.a(r0); goto L_0x00ba; */ throw new UnsupportedOperationException("Method not decompiled: com.puzzlersworld.android.gcm.AndroAppGcmListenerService.a(com.google.firebase.messaging.RemoteMessage):void"); } }
UTF-8
Java
22,209
java
AndroAppGcmListenerService.java
Java
[ { "context": " 0) goto L_0x00eb;\n L_0x00e3:\n r0 = \"AndroApp:\";\n r1 = \"Returning as post id is null\";\n ", "end": 4637, "score": 0.7894165515899658, "start": 4632, "tag": "NAME", "value": "roApp" }, { "context": " 0) goto L_0x03d7;\n L_0x010a:\n r0 = ...
null
[]
package com.puzzlersworld.android.gcm; import android.app.NotificationManager; import android.os.Build.VERSION; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.gson.Gson; import com.puzzlersworld.android.util.g; import com.puzzlersworld.wp.controller.RestServiceManager; import com.puzzlersworld.wp.controller.a; import com.puzzlersworld.wp.dto.Config; import com.puzzlersworld.wp.dto.X; import javax.inject.Inject; import mobi.androapp.ac.c8700.R; public class AndroAppGcmListenerService extends FirebaseMessagingService { @Inject a b; @Inject g c; @Inject RestServiceManager d; private NotificationManager e; private Gson f; private X g; private Config h; /* JADX WARNING: Removed duplicated region for block: B:26:0x014e */ /* JADX WARNING: Removed duplicated region for block: B:36:0x01ae */ /* JADX WARNING: Removed duplicated region for block: B:74:0x03d1 */ /* JADX WARNING: Removed duplicated region for block: B:39:0x01b8 */ /* JADX WARNING: Removed duplicated region for block: B:60:0x02f0 */ /* JADX WARNING: Removed duplicated region for block: B:41:0x01be */ /* JADX WARNING: Removed duplicated region for block: B:26:0x014e */ /* JADX WARNING: Removed duplicated region for block: B:29:0x0188 */ /* JADX WARNING: Removed duplicated region for block: B:36:0x01ae */ /* JADX WARNING: Removed duplicated region for block: B:39:0x01b8 */ /* JADX WARNING: Removed duplicated region for block: B:74:0x03d1 */ /* JADX WARNING: Removed duplicated region for block: B:41:0x01be */ /* JADX WARNING: Removed duplicated region for block: B:60:0x02f0 */ /* JADX WARNING: Removed duplicated region for block: B:80:? A:{SYNTHETIC, RETURN} */ /* JADX WARNING: Removed duplicated region for block: B:44:0x022b */ private void a(java.util.Map r15) { /* r14 = this; r13 = 2131230781; // 0x7f08003d float:1.8077624E38 double:1.0529679123E-314; r12 = 2130837654; // 0x7f020096 float:1.7280268E38 double:1.0527736817E-314; r3 = 0; r6 = 0; r4 = 1; r0 = "AndroApp:"; r1 = "Generating notification"; android.util.Log.d(r0, r1); r0 = "notification"; r0 = r14.getSystemService(r0); r0 = (android.app.NotificationManager) r0; r14.e = r0; r7 = new android.content.Intent; r0 = com.puzzlersworld.android.FullscreenActivity.class; r7.<init>(r14, r0); r8 = java.lang.System.currentTimeMillis(); r0 = r14.getApplication(); com.puzzlersworld.android.gcm.b.a(r0); r0 = "AndroAppListenerService"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "Message : "; r1 = r1.append(r2); r1 = r1.append(r15); r1 = r1.toString(); android.util.Log.i(r0, r1); r5 = new com.puzzlersworld.wp.dto.Post; r5.<init>(); r0 = "post_id"; r0 = r15.containsKey(r0); if (r0 == 0) goto L_0x0061; L_0x0051: r1 = new java.lang.Long; r0 = "post_id"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r1.<init>(r0); r5.setID(r1); L_0x0061: r0 = "title"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setTitle(r0); r0 = "link"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setLink(r0); r0 = "excerpt"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setExcerpt(r0); r0 = "postImage"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r5.setPostImage(r0); r0 = "cache"; r0 = r15.get(r0); r0 = (java.lang.String) r0; r1 = "postType"; r1 = r15.get(r1); r1 = (java.lang.String) r1; if (r1 != 0) goto L_0x03db; L_0x009f: r1 = "post"; r2 = r1; L_0x00a2: r5.setPostType(r2); r1 = "AndroAppListenerService"; r10 = new java.lang.StringBuilder; r10.<init>(); r11 = "Post "; r10 = r10.append(r11); r11 = r5.getID(); r10 = r10.append(r11); r11 = " link= "; r10 = r10.append(r11); r11 = r5.getLink(); r10 = r10.append(r11); r11 = " contentType "; r10 = r10.append(r11); r11 = r5.getPostContentType(); r10 = r10.append(r11); r10 = r10.toString(); android.util.Log.d(r1, r10); r1 = r5.getID(); if (r1 != 0) goto L_0x00eb; L_0x00e3: r0 = "AndroApp:"; r1 = "Returning as post id is null"; android.util.Log.d(r0, r1); L_0x00ea: return; L_0x00eb: r1 = com.puzzlersworld.android.gcm.a.c; r10 = r5.getTitle(); r1.add(r10); r1 = com.puzzlersworld.android.gcm.a.c; r1 = r1.size(); r10 = r14.b(); if (r1 > r10) goto L_0x0303; L_0x0100: if (r0 == 0) goto L_0x010a; L_0x0102: r1 = "yes"; r0 = r0.equals(r1); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x03d7; L_0x010a: r0 = "AndroApp:"; r1 = "Caching the post"; android.util.Log.d(r0, r1); Catch:{ Exception -> 0x03ce } r0 = "page"; r0 = r2.equals(r0); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x029e; L_0x0119: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchPage(r1); Catch:{ Exception -> 0x03ce } L_0x0130: r0 = r0.execute(); Catch:{ Exception -> 0x03ce } r0 = r0.b(); Catch:{ Exception -> 0x03ce } r0 = (com.puzzlersworld.wp.dto.Post) r0; Catch:{ Exception -> 0x03ce } if (r0 != 0) goto L_0x02d8; L_0x013c: r1 = "AndroApp:"; r3 = "Returning as post is null"; android.util.Log.d(r1, r3); Catch:{ Exception -> 0x0144 } goto L_0x00ea; L_0x0144: r1 = move-exception; r3 = r4; r5 = r0; r0 = r1; L_0x0148: r0.printStackTrace(); r0 = r3; L_0x014c: if (r0 != 0) goto L_0x0182; L_0x014e: r0 = "AndroApp"; r1 = new java.lang.StringBuilder; r1.<init>(); r3 = "Notificatio post id "; r1 = r1.append(r3); r3 = r5.getID(); r1 = r1.append(r3); r3 = " post type "; r1 = r1.append(r3); r1 = r1.append(r2); r1 = r1.toString(); android.util.Log.d(r0, r1); r0 = "notificationPostId"; r1 = r5.getID(); r7.putExtra(r0, r1); r0 = "postType"; r7.putExtra(r0, r2); L_0x0182: r0 = r5.getFeaturedImageObject(); if (r0 == 0) goto L_0x03d4; L_0x0188: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); if (r0 == 0) goto L_0x03d4; L_0x0192: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); r0 = r0.isEmpty(); if (r0 != 0) goto L_0x03d4; L_0x01a0: r0 = r5.getFeaturedImageObject(); r0 = r0.getSource(); L_0x01a8: r1 = com.puzzlersworld.android.util.w.f(r0); if (r1 == 0) goto L_0x01b2; L_0x01ae: r0 = r5.getPostImage(); L_0x01b2: r1 = com.puzzlersworld.android.util.w.f(r0); if (r1 != 0) goto L_0x03d1; L_0x01b8: r0 = com.puzzlersworld.android.util.w.a(r0); L_0x01bc: if (r0 == 0) goto L_0x02f0; L_0x01be: r1 = new android.support.v4.app.am; r1.<init>(); r0 = r1.a(r0); r1 = r5.getTitle(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.b(r1); r1 = r5.getTitle(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.a(r1); r0 = r0.b(r6); L_0x01e3: r1 = new android.support.v4.app.ao; r2 = "androapp_posts"; r1.<init>(r14, r2); r2 = r14.c(); r1 = r1.a(r2); r2 = r14.getDrawable(r12); r2 = com.puzzlersworld.android.util.w.a(r2); r1 = r1.a(r2); r2 = r5.getTitle(); r2 = com.puzzlersworld.android.util.w.b(r2); r1 = r1.a(r2); r0 = r1.a(r0); r0 = r0.a(r4); r0 = r0.a(r8); r1 = "Posts"; r0 = r0.a(r1); r1 = r5.getExcerpt(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.b(r1); r1 = r0; L_0x0229: if (r5 == 0) goto L_0x00ea; L_0x022b: r0 = r5.getID(); r0 = r0.intValue(); if (r4 != 0) goto L_0x023c; L_0x0235: r0 = 12426; // 0x308a float:1.7413E-41 double:6.1393E-320; r2 = "requestCode"; r7.putExtra(r2, r0); L_0x023c: r2 = 134217728; // 0x8000000 float:3.85186E-34 double:6.63123685E-316; r2 = android.app.PendingIntent.getActivity(r14, r0, r7, r2); r1.a(r2); r2 = new java.lang.StringBuilder; r2.<init>(); r3 = r14.getString(r13); r2 = r2.append(r3); r3 = " - "; r2 = r2.append(r3); r3 = com.puzzlersworld.wp.dto.StringConstants.NEW_POST; r3 = r3.getMessage(); r2 = r2.append(r3); r3 = " - "; r2 = r2.append(r3); r3 = r5.getTitle(); r2 = r2.append(r3); r2 = r2.toString(); r1.c(r2); r1 = r1.a(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r3 = 2; if (r2 > r3) goto L_0x03bd; L_0x0284: r2 = r1.defaults; r2 = r2 | 1; r1.defaults = r2; L_0x028a: r2 = r1.defaults; r2 = r2 | 8; r1.defaults = r2; r2 = r14.e; r2.notify(r0, r1); r0 = "AndroApp:"; r1 = "After notify"; android.util.Log.d(r0, r1); goto L_0x00ea; L_0x029e: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = com.puzzlersworld.android.util.w.a(r0); Catch:{ Exception -> 0x03ce } if (r0 == 0) goto L_0x02bf; L_0x02a6: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchCustomPostV2(r2, r1); Catch:{ Exception -> 0x03ce } goto L_0x0130; L_0x02bf: r0 = r14.d; Catch:{ Exception -> 0x03ce } r0 = r0.getWpCoreService(); Catch:{ Exception -> 0x03ce } r1 = new java.lang.Long; Catch:{ Exception -> 0x03ce } r10 = r5.getID(); Catch:{ Exception -> 0x03ce } r10 = r10.longValue(); Catch:{ Exception -> 0x03ce } r1.<init>(r10); Catch:{ Exception -> 0x03ce } r0 = r0.fetchPost(r1); Catch:{ Exception -> 0x03ce } goto L_0x0130; L_0x02d8: r1 = r14.getApplication(); Catch:{ Exception -> 0x0144 } r1 = (com.puzzlersworld.android.FriopinApplication) r1; Catch:{ Exception -> 0x0144 } r1 = r1.f(); Catch:{ Exception -> 0x0144 } r1 = r1.toJson(r0); Catch:{ Exception -> 0x0144 } r3 = "entity"; r7.putExtra(r3, r1); Catch:{ Exception -> 0x0144 } r1 = r0; r0 = r4; L_0x02ed: r5 = r1; goto L_0x014c; L_0x02f0: r0 = new android.support.v4.app.an; r0.<init>(); r1 = r5.getExcerpt(); r1 = com.puzzlersworld.android.util.w.b(r1); r0 = r0.a(r1); goto L_0x01e3; L_0x0303: r0 = new com.puzzlersworld.wp.dto.Menu; Catch:{ Exception -> 0x0332 } r0.<init>(); Catch:{ Exception -> 0x0332 } r1 = com.puzzlersworld.wp.dto.MenuItemType.home; Catch:{ Exception -> 0x0332 } r0.setMenuItemType(r1); Catch:{ Exception -> 0x0332 } r1 = r14.b; Catch:{ Exception -> 0x0332 } r2 = 1; r1.a(r0, r2); Catch:{ Exception -> 0x0332 } L_0x0313: r1 = new android.support.v4.app.ap; r1.<init>(); r0 = com.puzzlersworld.android.gcm.a.c; r2 = r0.iterator(); L_0x031e: r0 = r2.hasNext(); if (r0 == 0) goto L_0x0337; L_0x0324: r0 = r2.next(); r0 = (java.lang.String) r0; r0 = com.puzzlersworld.android.util.w.b(r0); r1.b(r0); goto L_0x031e; L_0x0332: r0 = move-exception; r0.printStackTrace(); goto L_0x0313; L_0x0337: r0 = new java.lang.StringBuilder; r0.<init>(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r0 = r0.append(r2); r2 = " "; r0 = r0.append(r2); r2 = com.puzzlersworld.wp.dto.StringConstants.NEW_POSTS; r2 = r2.getMessage(); r0 = r0.append(r2); r0 = r0.toString(); r1.a(r0); r0 = new android.support.v4.app.ao; r2 = "androapp_posts"; r0.<init>(r14, r2); r2 = r14.getString(r13); r0 = r0.a(r2); r2 = r14.c(); r0 = r0.a(r2); r2 = r14.getDrawable(r12); r2 = com.puzzlersworld.android.util.w.a(r2); r0 = r0.a(r2); r0 = r0.a(r1); r1 = "Posts"; r0 = r0.a(r1); r0 = r0.c(r4); r0 = r0.a(r4); r1 = new java.lang.StringBuilder; r1.<init>(); r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r1 = r1.append(r2); r2 = " "; r1 = r1.append(r2); r2 = com.puzzlersworld.wp.dto.StringConstants.NEW_POSTS; r2 = r2.getMessage(); r1 = r1.append(r2); r1 = r1.toString(); r0 = r0.b(r1); r4 = r3; r1 = r0; goto L_0x0229; L_0x03bd: r2 = com.puzzlersworld.android.gcm.a.c; r2 = r2.size(); r3 = 5; if (r2 > r3) goto L_0x028a; L_0x03c6: r2 = r1.defaults; r2 = r2 | 2; r1.defaults = r2; goto L_0x028a; L_0x03ce: r0 = move-exception; goto L_0x0148; L_0x03d1: r0 = r6; goto L_0x01bc; L_0x03d4: r0 = r6; goto L_0x01a8; L_0x03d7: r0 = r3; r1 = r5; goto L_0x02ed; L_0x03db: r2 = r1; goto L_0x00a2; */ throw new UnsupportedOperationException("Method not decompiled: com.puzzlersworld.android.gcm.AndroAppGcmListenerService.a(java.util.Map):void"); } private int b() { return (this.h == null || this.h.getPushStackThershold() == null) ? 3 : this.h.getPushStackThershold().intValue(); } private int c() { return (VERSION.SDK_INT >= 21 ? 1 : null) != null ? R.drawable.notification_icon : R.drawable.ic_launcher; } /* JADX WARNING: Removed duplicated region for block: B:29:0x00d6 A:{ExcHandler: java.lang.NoSuchMethodError (r0_31 'e' java.lang.Error), Splitter: B:0:0x0000} */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing block: B:20:0x00bb, code: r0 = move-exception; */ /* JADX WARNING: Missing block: B:21:0x00bc, code: r0.printStackTrace(); */ /* JADX WARNING: Missing block: B:29:0x00d6, code: r0 = move-exception; */ /* JADX WARNING: Missing block: B:30:0x00d7, code: com.puzzlersworld.android.FriopinApplication.a().a(r0); */ /* JADX WARNING: Missing block: B:32:?, code: return; */ public void a(com.google.firebase.messaging.RemoteMessage r7) { /* r6 = this; super.a(r7); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r1 = r7.a(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r2 = r7.b(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } com.puzzlersworld.android.util.InjectibleApplication.a(r6); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = new com.google.gson.Gson; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r6.f = r0; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = "message"; r0 = r2.get(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = (java.lang.String) r0; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r3 = "AndroAppListenerService"; r4 = new java.lang.StringBuilder; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r5 = "From: "; r4 = r4.append(r5); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4 = r4.append(r1); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4 = r4.toString(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } android.util.Log.d(r3, r4); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r3 = "AndroAppListenerService"; r4 = new java.lang.StringBuilder; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r4.<init>(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r5 = "Message: "; r4 = r4.append(r5); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r4.append(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.toString(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } android.util.Log.d(r3, r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = "/topics/"; r0 = r1.startsWith(r0); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0055; L_0x0055: r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0.a(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r0.e(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0085; L_0x0062: r0 = r6.f; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.e(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r3 = com.puzzlersworld.wp.dto.Config.class; r0 = r0.fromJson(r1, r3); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = (com.puzzlersworld.wp.dto.Config) r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r6.h = r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r6.h; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x0085; L_0x0078: r0 = com.puzzlersworld.android.FriopinApplication.h(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.h; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.getStringMap(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0.setStringMap(r1); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } L_0x0085: r0 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = r0.f(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x009f; L_0x008d: r0 = r6.f; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r6.c; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r1 = r1.f(); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r3 = com.puzzlersworld.wp.dto.X.class; r0 = r0.fromJson(r1, r3); Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r0 = (com.puzzlersworld.wp.dto.X) r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } r6.g = r0; Catch:{ Exception -> 0x00bb, NoSuchMethodError -> 0x00d6 } L_0x009f: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00b7; L_0x00a3: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.getP(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00b7; L_0x00ab: r0 = r6.g; Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.getP(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } r0 = r0.booleanValue(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } if (r0 == 0) goto L_0x00ce; L_0x00b7: r6.a(r2); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } L_0x00ba: return; L_0x00bb: r0 = move-exception; r0.printStackTrace(); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } goto L_0x009f; L_0x00c0: r0 = move-exception; r0.printStackTrace(); r1 = com.puzzlersworld.android.FriopinApplication.a(); Catch:{ Exception -> 0x00cc } r1.a(r0); Catch:{ Exception -> 0x00cc } goto L_0x00ba; L_0x00cc: r0 = move-exception; goto L_0x00ba; L_0x00ce: r0 = "AndroAppListenerService"; r1 = "Not showing push notification as it is not enabled"; android.util.Log.d(r0, r1); Catch:{ Exception -> 0x00c0, NoSuchMethodError -> 0x00d6 } goto L_0x00ba; L_0x00d6: r0 = move-exception; r1 = com.puzzlersworld.android.FriopinApplication.a(); r1.a(r0); goto L_0x00ba; */ throw new UnsupportedOperationException("Method not decompiled: com.puzzlersworld.android.gcm.AndroAppGcmListenerService.a(com.google.firebase.messaging.RemoteMessage):void"); } }
22,209
0.552839
0.454005
583
37.094341
25.953377
183
false
false
0
0
0
0
0
0
1.128645
false
false
2
48a05512c64e59ff1e2b75b15e65665023de88d3
21,878,563,443,750
7f31b80102f657646980dee5cc01eeb897710943
/wy-es-api/wy-es-service/src/main/java/com/aomygod/es/service/impl/BaseServiceImple.java
539f9d0b191788f3e690bad4de4ee75f39320edd
[]
no_license
wangchao550586585/wy
https://github.com/wangchao550586585/wy
905d5a2a281f7695ccc86399601c74802265e229
0df5c05ebc80038b7bae8ed3afe96bc0ed64e512
refs/heads/master
2020-02-22T00:21:46.228000
2017-08-10T00:02:25
2017-08-10T00:02:25
99,862,576
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.aomygod.es.service.impl; import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Order; import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; import org.springframework.data.elasticsearch.core.query.Criteria; import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import com.aomygod.es.repository.BaseRepository; import com.aomygod.es.service.BaseService; import com.aomygod.mp.service.GoodsMpService; import com.aomygod.mp.service.ShopMpService; @SuppressWarnings({ "rawtypes", "unchecked" }) public abstract class BaseServiceImple<T, ID extends Serializable> implements BaseService<T, ID> { @Resource protected GoodsMpService goodsMpService; @Resource protected ShopMpService shopMpService; protected BaseRepository repository; @Resource protected ElasticsearchTemplate elasticsearchTemplate; protected Class<T> clazz; @PostConstruct public void initBaseClazz() throws Exception { ParameterizedType type = (ParameterizedType) this.getClass() .getGenericSuperclass(); clazz = (Class) type.getActualTypeArguments()[0]; } public void setRepository(BaseRepository repository) { this.repository = repository; } public void indexMapperEntity(Class<T> clazz) { elasticsearchTemplate.putMapping(clazz); } public void refreshIndex(Class<T> clazz) { elasticsearchTemplate.refresh(clazz); } public void createIndex(Class<T> clazz) { elasticsearchTemplate.createIndex(clazz); } public void deleteIndex(Class<T> clazz) { elasticsearchTemplate.deleteIndex(clazz); } public boolean insert(T Object) { return repository.save(Object) != null; } public boolean batchInsert(Iterable<T> iterator) { return repository.save(iterator) != null; } public void delete(T Object) { repository.delete(Object); } public void deleteById(Serializable id) { repository.delete(id); } public void batchDelete(Iterable<T> iterator) { repository.delete(iterator); } public void deleteAll() { repository.deleteAll(); } public boolean existById(Serializable id) { return repository.exists(id); } public Long count() { return repository.count(); } public Iterator<T> findAll() { return repository.findAll().iterator(); } public Iterator<T> findAll(Pageable pageable) { return repository.findAll(pageable).iterator(); } public Iterator<T> findAll(Sort sort) { return repository.findAll(sort).iterator(); } public Iterator<T> findByIds(Iterable<String> ids) { return repository.findAll(ids).iterator(); } public T findById(Serializable id) { return (T) repository.findOne(id); } public Iterator<T> queryByName(String name, Pageable pageable) { return repository.findByName(name, pageable).iterator(); } public Iterator<T> queryBykeyWord(String keyword, Pageable pageable) { return repository.findBykeyWord(keyword, pageable).iterator(); } public List<T> findESPage(Map<String, Object> params, Integer pageNo, Integer pageSize) { return findESPage(params, pageNo, pageSize, null); } public List<T> findESPage(Map<String, Object> params, Integer pageNo, Integer pageSize, Map<String, Direction> order) { // 匹配查询 Criteria criteria = new Criteria(); for (String key : params.keySet()) { criteria.and(new Criteria(key).is(params.get(key))); } // 添加分页和排序规则 Sort sort = null; if (order != null) { List<Order> orderList = new ArrayList<Sort.Order>(); for (String key : order.keySet()) { orderList.add(new Order(order.get(key), key)); } sort = new Sort((Order[]) orderList.toArray()); } Pageable page = new PageRequest(pageNo, pageSize, sort == null ? null : sort); CriteriaQuery query = new CriteriaQuery(criteria, page); return elasticsearchTemplate.queryForList(query, clazz); } @Override public void syncInit() { // 清空映射 deleteIndex(clazz); syncObjectList(); } public abstract void syncObjectList(); }
UTF-8
Java
4,379
java
BaseServiceImple.java
Java
[]
null
[]
package com.aomygod.es.service.impl; import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Order; import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; import org.springframework.data.elasticsearch.core.query.Criteria; import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import com.aomygod.es.repository.BaseRepository; import com.aomygod.es.service.BaseService; import com.aomygod.mp.service.GoodsMpService; import com.aomygod.mp.service.ShopMpService; @SuppressWarnings({ "rawtypes", "unchecked" }) public abstract class BaseServiceImple<T, ID extends Serializable> implements BaseService<T, ID> { @Resource protected GoodsMpService goodsMpService; @Resource protected ShopMpService shopMpService; protected BaseRepository repository; @Resource protected ElasticsearchTemplate elasticsearchTemplate; protected Class<T> clazz; @PostConstruct public void initBaseClazz() throws Exception { ParameterizedType type = (ParameterizedType) this.getClass() .getGenericSuperclass(); clazz = (Class) type.getActualTypeArguments()[0]; } public void setRepository(BaseRepository repository) { this.repository = repository; } public void indexMapperEntity(Class<T> clazz) { elasticsearchTemplate.putMapping(clazz); } public void refreshIndex(Class<T> clazz) { elasticsearchTemplate.refresh(clazz); } public void createIndex(Class<T> clazz) { elasticsearchTemplate.createIndex(clazz); } public void deleteIndex(Class<T> clazz) { elasticsearchTemplate.deleteIndex(clazz); } public boolean insert(T Object) { return repository.save(Object) != null; } public boolean batchInsert(Iterable<T> iterator) { return repository.save(iterator) != null; } public void delete(T Object) { repository.delete(Object); } public void deleteById(Serializable id) { repository.delete(id); } public void batchDelete(Iterable<T> iterator) { repository.delete(iterator); } public void deleteAll() { repository.deleteAll(); } public boolean existById(Serializable id) { return repository.exists(id); } public Long count() { return repository.count(); } public Iterator<T> findAll() { return repository.findAll().iterator(); } public Iterator<T> findAll(Pageable pageable) { return repository.findAll(pageable).iterator(); } public Iterator<T> findAll(Sort sort) { return repository.findAll(sort).iterator(); } public Iterator<T> findByIds(Iterable<String> ids) { return repository.findAll(ids).iterator(); } public T findById(Serializable id) { return (T) repository.findOne(id); } public Iterator<T> queryByName(String name, Pageable pageable) { return repository.findByName(name, pageable).iterator(); } public Iterator<T> queryBykeyWord(String keyword, Pageable pageable) { return repository.findBykeyWord(keyword, pageable).iterator(); } public List<T> findESPage(Map<String, Object> params, Integer pageNo, Integer pageSize) { return findESPage(params, pageNo, pageSize, null); } public List<T> findESPage(Map<String, Object> params, Integer pageNo, Integer pageSize, Map<String, Direction> order) { // 匹配查询 Criteria criteria = new Criteria(); for (String key : params.keySet()) { criteria.and(new Criteria(key).is(params.get(key))); } // 添加分页和排序规则 Sort sort = null; if (order != null) { List<Order> orderList = new ArrayList<Sort.Order>(); for (String key : order.keySet()) { orderList.add(new Order(order.get(key), key)); } sort = new Sort((Order[]) orderList.toArray()); } Pageable page = new PageRequest(pageNo, pageSize, sort == null ? null : sort); CriteriaQuery query = new CriteriaQuery(criteria, page); return elasticsearchTemplate.queryForList(query, clazz); } @Override public void syncInit() { // 清空映射 deleteIndex(clazz); syncObjectList(); } public abstract void syncObjectList(); }
4,379
0.752129
0.751899
167
25.017963
22.842463
77
false
false
0
0
0
0
0
0
1.508982
false
false
2
7f571b0d16a96f84d33cd9e8bb8c73dac2907916
26,130,581,051,936
c92ef970dae02da6e357102a92d891ea50e0e800
/src/main/java/com/lhpc/service/IPayNotifyService.java
42b1fad78be4444761efb29788cf6aeebde94cf6
[]
no_license
tbs005/LaiHuiWX
https://github.com/tbs005/LaiHuiWX
e2db51d398e8672c208a705ab336d958856ef2b5
ed5ae07a614ddf0ccb978f5a658482d18d303f94
refs/heads/master
2021-06-21T19:07:40.175000
2017-07-13T03:33:57
2017-07-13T03:33:57
100,596,056
0
1
null
true
2017-08-17T11:25:39
2017-08-17T11:25:38
2017-07-13T03:42:12
2017-07-13T03:33:57
0
0
0
0
null
null
null
package com.lhpc.service; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.http.ResponseEntity; public interface IPayNotifyService { ResponseEntity<String> notify(HttpServletRequest request, HttpServletResponse response); }
UTF-8
Java
304
java
IPayNotifyService.java
Java
[]
null
[]
package com.lhpc.service; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.http.ResponseEntity; public interface IPayNotifyService { ResponseEntity<String> notify(HttpServletRequest request, HttpServletResponse response); }
304
0.835526
0.835526
13
22.384615
21.858068
58
false
false
0
0
0
0
0
0
0.769231
false
false
2
1fcfa5d1cddb3b2e31dcabe312d59504d0b70d10
26,130,581,050,160
5e6ab97b92c9236e9ccb84d9fc5acd3685f5696d
/src/main/java/statistics/RelationalUniplexNetworkStatistic.java
bf79fb653248f9718ba905a37a14970ba9f3a017
[]
no_license
duyvu/GitHubNetworkModel
https://github.com/duyvu/GitHubNetworkModel
5688da4b0b84b570218b7a9702f1796038546e5a
de04c09adde72f389cca7377eac6a8b0f3da5b7a
refs/heads/master
2020-07-09T23:57:08.681000
2019-08-24T06:29:54
2019-08-24T06:29:54
204,112,866
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package statistics; /** * @author duyvu * */ public abstract class RelationalUniplexNetworkStatistic extends UniplexNetworkStatistic { protected String senderNodeProperty; protected String receiverNodeProperty; /** * */ public RelationalUniplexNetworkStatistic() { } public String getSenderNodeProperty() { return senderNodeProperty; } public void setSenderNodeProperty(String senderNodeProperty) { this.senderNodeProperty = senderNodeProperty; } public String getReceiverNodeProperty() { return receiverNodeProperty; } public void setReceiverNodeProperty(String receiverNodeProperty) { this.receiverNodeProperty = receiverNodeProperty; } }
UTF-8
Java
693
java
RelationalUniplexNetworkStatistic.java
Java
[ { "context": "/**\n * \n */\npackage statistics;\n\n/**\n * @author duyvu\n * \n */\npublic abstract class RelationalUniplexNe", "end": 53, "score": 0.999530553817749, "start": 48, "tag": "USERNAME", "value": "duyvu" } ]
null
[]
/** * */ package statistics; /** * @author duyvu * */ public abstract class RelationalUniplexNetworkStatistic extends UniplexNetworkStatistic { protected String senderNodeProperty; protected String receiverNodeProperty; /** * */ public RelationalUniplexNetworkStatistic() { } public String getSenderNodeProperty() { return senderNodeProperty; } public void setSenderNodeProperty(String senderNodeProperty) { this.senderNodeProperty = senderNodeProperty; } public String getReceiverNodeProperty() { return receiverNodeProperty; } public void setReceiverNodeProperty(String receiverNodeProperty) { this.receiverNodeProperty = receiverNodeProperty; } }
693
0.76912
0.76912
38
17.236841
21.385477
67
false
false
0
0
0
0
0
0
0.842105
false
false
2
c2e699181f8942157dec7da62c48a33884343d15
23,648,090,002,338
c0a717b3cae89fd5f7afd5270644774fde8b6ec1
/hctest/hc-dtf/src/java/v1_1/com/sun/dtf/actions/honeycomb/GetDate.java
b329345516503d2f93ca6b3232e5057fd986fe16
[]
no_license
elambert/honeycomb
https://github.com/elambert/honeycomb
c11f60ace76ca0ab664e61b4d2ff7ead4653e0de
abd6ce4381b5db36a6c6b23e84c1fb8e8412d7b5
refs/heads/master
2020-03-27T22:39:34.505000
2012-08-29T20:09:16
2012-08-29T20:09:16
472,780
3
1
null
false
2012-08-29T19:52:10
2010-01-14T23:39:04
2012-08-22T05:08:38
2010-01-14T23:44:12
57,344
null
2
1
Java
null
null
package com.sun.dtf.actions.honeycomb; import java.io.IOException; import java.util.Date; import com.sun.dtf.exception.DTFException; import com.sun.honeycomb.client.NameValueObjectArchive; import com.sun.honeycomb.common.ArchiveException; public abstract class GetDate { public static Date getDate(NameValueObjectArchive archive) throws DTFException { try { return archive.getDate(); } catch (ArchiveException e) { throw new DTFException("Error getting date from cluster.",e); } catch (IOException e) { throw new DTFException("Error getting date from cluster.",e); } } }
UTF-8
Java
665
java
GetDate.java
Java
[]
null
[]
package com.sun.dtf.actions.honeycomb; import java.io.IOException; import java.util.Date; import com.sun.dtf.exception.DTFException; import com.sun.honeycomb.client.NameValueObjectArchive; import com.sun.honeycomb.common.ArchiveException; public abstract class GetDate { public static Date getDate(NameValueObjectArchive archive) throws DTFException { try { return archive.getDate(); } catch (ArchiveException e) { throw new DTFException("Error getting date from cluster.",e); } catch (IOException e) { throw new DTFException("Error getting date from cluster.",e); } } }
665
0.684211
0.684211
22
29.227272
23.284664
73
false
false
0
0
0
0
0
0
0.5
false
false
2
ec3a0af8e7f67fd68e445cf6b687e44d9ca26c75
29,540,785,066,193
a78fe6dc30d70bafa4d5ac0ac4d539c6bc51af8c
/sources/org/mockito/junit/MockitoJUnit.java
0c00a58697fe2df8168a4e89e0a5d63c7cb5dfa8
[]
no_license
bellmit/Medscape-decompile
https://github.com/bellmit/Medscape-decompile
d78dd1e0764274e8b73be59a668da8bcfa11ec95
26bbd3e603de315b31afcc64fe3f2503dc3de854
refs/heads/master
2023-03-06T04:12:59.075000
2021-02-15T08:46:11
2021-02-15T08:46:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.mockito.junit; import org.mockito.Incubating; import org.mockito.internal.configuration.plugins.Plugins; import org.mockito.internal.junit.JUnitRule; import org.mockito.internal.junit.VerificationCollectorImpl; import org.mockito.quality.Strictness; public class MockitoJUnit { public static MockitoRule rule() { return new JUnitRule(Plugins.getMockitoLogger(), Strictness.WARN); } @Incubating public static VerificationCollector collector() { return new VerificationCollectorImpl(); } }
UTF-8
Java
539
java
MockitoJUnit.java
Java
[]
null
[]
package org.mockito.junit; import org.mockito.Incubating; import org.mockito.internal.configuration.plugins.Plugins; import org.mockito.internal.junit.JUnitRule; import org.mockito.internal.junit.VerificationCollectorImpl; import org.mockito.quality.Strictness; public class MockitoJUnit { public static MockitoRule rule() { return new JUnitRule(Plugins.getMockitoLogger(), Strictness.WARN); } @Incubating public static VerificationCollector collector() { return new VerificationCollectorImpl(); } }
539
0.769944
0.769944
18
28.944445
23.313021
74
false
false
0
0
0
0
0
0
0.5
false
false
2
8ff9c469877c2bc54e2bd55156c788c90a124c2a
6,021,544,154,595
143bee61d431df7ff48c8642a8b6d4876fa850a9
/src/main/java/com/rahul/hibernate/serviceImpl/EmployeeServiceImpl.java
7625246d562c72b0964b29400bd9908021d24854
[]
no_license
choudharyrahul11/HibernateCRUD
https://github.com/choudharyrahul11/HibernateCRUD
8e956f1a8a3cc9b37d1a53ecd7e996887361e1c6
ac4f3773731c7cad41e6c6768fa15d68f34b667f
refs/heads/master
2020-04-09T14:07:26.332000
2018-12-04T16:46:23
2018-12-04T16:46:23
160,387,858
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.rahul.hibernate.serviceImpl; import com.rahul.hibernate.DAO.EmployeeDAO; import com.rahul.hibernate.DAOImpl.EmployeeDAOImpl; import com.rahul.hibernate.model.Employee; import com.rahul.hibernate.service.EmployeeService; public class EmployeeServiceImpl implements EmployeeService { EmployeeDAO employeeDAO = new EmployeeDAOImpl(); public void createEmployee(Employee employee) { employeeDAO.createEmployee(employee); } public void deleteEmployee(int empID) { // EmployeeDAO employeeDAO = new EmployeeDAOImpl(); employeeDAO.deleteEmployee(empID); } public void updateEmployee(int empID, String updatedContactNumber) { employeeDAO.updateEmployee(empID, updatedContactNumber); } public Employee fetchEmployeeDetails(int inputValue) { return employeeDAO.fetchEmployeeDetails(inputValue); } }
UTF-8
Java
830
java
EmployeeServiceImpl.java
Java
[]
null
[]
package com.rahul.hibernate.serviceImpl; import com.rahul.hibernate.DAO.EmployeeDAO; import com.rahul.hibernate.DAOImpl.EmployeeDAOImpl; import com.rahul.hibernate.model.Employee; import com.rahul.hibernate.service.EmployeeService; public class EmployeeServiceImpl implements EmployeeService { EmployeeDAO employeeDAO = new EmployeeDAOImpl(); public void createEmployee(Employee employee) { employeeDAO.createEmployee(employee); } public void deleteEmployee(int empID) { // EmployeeDAO employeeDAO = new EmployeeDAOImpl(); employeeDAO.deleteEmployee(empID); } public void updateEmployee(int empID, String updatedContactNumber) { employeeDAO.updateEmployee(empID, updatedContactNumber); } public Employee fetchEmployeeDetails(int inputValue) { return employeeDAO.fetchEmployeeDetails(inputValue); } }
830
0.807229
0.807229
31
25.774193
25.05183
69
false
false
0
0
0
0
0
0
1.096774
false
false
2
0f6953a52f31e6307efda8b1e7ecd97cbc9a49bb
31,799,937,859,848
1c6676dd9268d1492c3e467d55cdeebcf0fc986c
/app/src/main/java/car/gov/co/carserviciociudadano/bicicar/activities/BeneficiariosActivity.java
579c2cf9f7e51d48d291bc8fe312f4534cc1b5ff
[]
no_license
mecorredors/AplicarAndroid
https://github.com/mecorredors/AplicarAndroid
da77d71b5a5cad55738e7e5b14c1ce57e434643b
8f3c3ca2f662a2a60ec997ee36757f5755bbbb01
refs/heads/master
2023-04-14T08:51:09.168000
2020-03-11T14:37:05
2020-03-11T14:37:05
361,540,875
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package car.gov.co.carserviciociudadano.bicicar.activities; import android.content.Context; import android.content.DialogInterface; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; import android.widget.Spinner; import android.widget.TextView; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import car.gov.co.carserviciociudadano.AppCar; import car.gov.co.carserviciociudadano.R; import car.gov.co.carserviciociudadano.Utils.Enumerator; import car.gov.co.carserviciociudadano.bicicar.adapter.BeneficiariosAdapter; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Asistentes; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Beneficiarios; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Colegios; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Eventos; import car.gov.co.carserviciociudadano.bicicar.model.Asistente; import car.gov.co.carserviciociudadano.bicicar.model.Beneficiario; import car.gov.co.carserviciociudadano.bicicar.model.Colegio; import car.gov.co.carserviciociudadano.bicicar.model.Evento; import car.gov.co.carserviciociudadano.bicicar.presenter.AsistentesPresenter; import car.gov.co.carserviciociudadano.bicicar.presenter.BeneficiarioPresenter; import car.gov.co.carserviciociudadano.bicicar.presenter.IViewAsistente; import car.gov.co.carserviciociudadano.bicicar.presenter.IViewBeneficiario; import car.gov.co.carserviciociudadano.common.BaseActivity; import car.gov.co.carserviciociudadano.parques.model.ErrorApi; public class BeneficiariosActivity extends BaseActivity implements IViewBeneficiario, BeneficiariosAdapter.BeneficiarioListener { @BindView(R.id.recycler_view) RecyclerView recyclerView; @BindView(R.id.btnGuardarAsistencia) Button btnGuardarAsistencia; @BindView(R.id.txtBuscar) EditText txtBuscar; @BindView(R.id.btnBuscar) ImageButton btnBuscar; @BindView(R.id.spiColegio) Spinner spiColegio; @BindView(R.id.lySpiColegios) View lySpiColegios; Beneficiario mBeneficiarioLogin; BeneficiariosAdapter mAdaptador; List<Beneficiario> mLstBeneficiarios = new ArrayList<>(); List<Beneficiario> mLstCopyBeneficiarios = new ArrayList<>(); List<Colegio> mLstColegios = new ArrayList<>(); ArrayAdapter<Colegio> adapterColegios; BeneficiarioPresenter beneficiarioPresenter; private Evento mEvento; private AsistentesPresenter asistentesPresenter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_beneficiarios); ButterKnife.bind(this); ActionBar bar = getSupportActionBar(); bar.setDisplayHomeAsUpEnabled(true); mBeneficiarioLogin = Beneficiarios.readBeneficio(); if (mBeneficiarioLogin != null) bar.setTitle( mBeneficiarioLogin.Nombres + " " + mBeneficiarioLogin.Apellidos); Bundle b = getIntent().getExtras(); if (b != null){ int idEvento = b.getInt(Evento.ID_EVENTO,0); mEvento = new Eventos().read(idEvento); } recyclerView.setHasFixedSize(true); mAdaptador = new BeneficiariosAdapter(mLstBeneficiarios); mAdaptador.setBeneficiarioListener(this); recyclerView.setAdapter(mAdaptador); recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); recyclerView.setItemAnimator(new DefaultItemAnimator()); beneficiarioPresenter = new BeneficiarioPresenter(this); asistentesPresenter = new AsistentesPresenter(iViewAsistente); List<Beneficiario> lstBeneficiarios; lySpiColegios.setVisibility(View.GONE); if (mEvento != null) { if (mEvento.getTipoEvento().Publico){ lySpiColegios.setVisibility(View.VISIBLE); mLstColegios.addAll(new Colegios().conEstudiates()); adapterColegios = new ArrayAdapter<>(getApplicationContext(), R.layout.spinner_item, mLstColegios); adapterColegios.setDropDownViewResource( R.layout.simple_spinner_dropdown_item); spiColegio.setAdapter(adapterColegios); lstBeneficiarios = mLstColegios.size() > 0 ? beneficiarioPresenter.listLocal(mLstColegios.get(0).IDColegio) : beneficiarioPresenter.listAllLocal(); onItemSelecteColegio(); if (mLstColegios.size() == 0){ mostrarMensajeDialog("Debe descargar instituciones y estudiantes para registrar asistencia de otras instituciones"); } }else { lstBeneficiarios = beneficiarioPresenter.listLocal(mEvento.IDColegio); } beneficiarioPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); asistentesPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); }else{ //cuando registra asistencia el lider grupo lstBeneficiarios = beneficiarioPresenter.listLocal(mBeneficiarioLogin.Curso, mBeneficiarioLogin.IDColegio); beneficiarioPresenter.desabilitarYaRegistrados(lstBeneficiarios, 0); } if (lstBeneficiarios.size() > 0){ onSuccess(lstBeneficiarios); }else{ obtenerBeneficiarios(); } activarBoton(); txtBuscar.setImeActionLabel("Buscar", KeyEvent.KEYCODE_SEARCH); txtBuscar.setImeOptions(EditorInfo.IME_ACTION_SEARCH); txtBuscar.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { boolean handled = false; if (actionId == EditorInfo.IME_ACTION_SEARCH) { filter(txtBuscar.getText().toString().trim()); handled = true; } return handled; } }); } private void onItemSelecteColegio(){ spiColegio.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { txtBuscar.setText(""); Colegio colegio = mLstColegios.get(i); if (colegio != null ){ List<Beneficiario> lstBeneficiarios = beneficiarioPresenter.listLocal(colegio.IDColegio); asistentesPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); onSuccess(lstBeneficiarios); } } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); } @Override public void onPause() { AppCar.VolleyQueue().cancelAll(Beneficiarios.TAG); super.onPause(); } @Override public void onBackPressed(){ setResult(RESULT_OK); super.onBackPressed(); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if(id== android.R.id.home){ if (getSupportFragmentManager().getBackStackEntryCount() > 0) getSupportFragmentManager().popBackStack(); else this.onBackPressed(); } return super.onOptionsItemSelected(item); } private void filter(String text){ if (btnGuardarAsistencia.getVisibility() == View.VISIBLE){ mostrarMensajeDialog("Debe guardar los seleccionados antes de hacer otra búsqueda "); return; } mLstBeneficiarios.clear(); if (text != null && text.trim().length() > 0) { String filter = text.trim().toLowerCase(); for (Beneficiario item : mLstCopyBeneficiarios) { if (item.Nombres.toLowerCase().contains(filter) || item.Apellidos.toLowerCase().contains(filter)) { mLstBeneficiarios.add(item); } } // if (mLstColegios.size() > 0) { // PreferencesApp.getDefault(PreferencesApp.WRITE).putString(ULTIMA_BUSQUEDA, filter).commit(); // } }else{ mLstBeneficiarios.addAll(mLstCopyBeneficiarios); } mAdaptador.notifyDataSetChanged(); txtBuscar.clearFocus(); InputMethodManager in = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(txtBuscar.getWindowToken(), 0); } private void obtenerBeneficiarios(){ mostrarProgressDialog("Descargando estudiantes"); if (mEvento != null) { beneficiarioPresenter.list(mEvento.IDColegio); }else{ beneficiarioPresenter.list(mBeneficiarioLogin.Curso, mBeneficiarioLogin.IDColegio); } } @OnClick(R.id.btnBuscar) void onBuscar(){ filter(txtBuscar.getText().toString()); } @OnClick(R.id.btnGuardarAsistencia) void onGuardarAsistencia(){ guardarAsistencia(); } private void guardarAsistencia(){ boolean actualizarEstadoEvento = false; for (Beneficiario b : mLstBeneficiarios){ Asistentes asistentes = new Asistentes(); if (b.Selected && b.Enabled) { if (mEvento != null && mEvento.getTipoEvento() != null){ if (!mEvento.getTipoEvento().Recorrido || mEvento.getTipoEvento().Publico){ asistentes.insert(new Asistente(mEvento.IDEvento, b.IDBeneficiario, Enumerator.Estado.PENDIENTE_PUBLICAR)); }else{ beneficiarioPresenter.GuardarLogTrayecto(b, mBeneficiarioLogin, mEvento); } actualizarEstadoEvento = true; }else { beneficiarioPresenter.GuardarLogTrayecto(b, mBeneficiarioLogin); } b.Enabled = false; } } if (actualizarEstadoEvento){ mEvento.Estado = Enumerator.Estado.PENDIENTE_PUBLICAR; new Eventos().update(mEvento); } if (mEvento != null && mEvento.getTipoEvento() != null){ beneficiarioPresenter.desabilitarYaRegistrados(mLstCopyBeneficiarios, mEvento.IDEvento); asistentesPresenter.desabilitarYaRegistrados(mLstCopyBeneficiarios, mEvento.IDEvento); mAdaptador.notifyDataSetChanged(); mostrarMensaje("Asistencia guardada"); }else { setResult(RESULT_OK); finish(); } } private void activarBoton(){ int count = 0; for (Beneficiario b : mLstBeneficiarios) { if (b.Selected && b.Enabled) count ++; } btnGuardarAsistencia.setVisibility(count > 0 ? View.VISIBLE : View.GONE); } @Override public void onSuccess(Beneficiario beneficiario) { } @Override public void onSuccess(List<Beneficiario> lstBeneficiarios) { ocultarProgressDialog(); mLstBeneficiarios.clear(); mLstBeneficiarios.addAll(lstBeneficiarios); mLstCopyBeneficiarios = new ArrayList<>(mLstBeneficiarios); mAdaptador.notifyDataSetChanged(); } @Override public void onError(ErrorApi errorApi) { } @Override public void onErrorListarItems(ErrorApi errorApi) { ocultarProgressDialog(); if (errorApi.getStatusCode() == 404) mostrarMensajeDialog(errorApi.getMessage()); else{ AlertDialog.Builder builder = new AlertDialog.Builder(BeneficiariosActivity.this); builder.setMessage(errorApi.getMessage()); builder.setPositiveButton("Reintentar", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); obtenerBeneficiarios(); } }); builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.show(); } } @Override public void onSuccessRecordarClave(String mensaje) { } @Override public void onErrorRecordarClave(ErrorApi error) { } @Override public void onCheckedAsistenacia(int position, CompoundButton compoundButton, boolean b) { Beneficiario beneficiario = mLstBeneficiarios.get(position); if (beneficiario != null){ beneficiario.Selected = b; } activarBoton(); } IViewAsistente iViewAsistente = new IViewAsistente() { @Override public void onSuccess(int idEvento) { } @Override public void onErrorAsistente(ErrorApi error) { } @Override public void onError(ErrorApi error) { } }; }
UTF-8
Java
13,811
java
BeneficiariosActivity.java
Java
[]
null
[]
package car.gov.co.carserviciociudadano.bicicar.activities; import android.content.Context; import android.content.DialogInterface; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; import android.widget.Spinner; import android.widget.TextView; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import car.gov.co.carserviciociudadano.AppCar; import car.gov.co.carserviciociudadano.R; import car.gov.co.carserviciociudadano.Utils.Enumerator; import car.gov.co.carserviciociudadano.bicicar.adapter.BeneficiariosAdapter; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Asistentes; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Beneficiarios; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Colegios; import car.gov.co.carserviciociudadano.bicicar.dataaccess.Eventos; import car.gov.co.carserviciociudadano.bicicar.model.Asistente; import car.gov.co.carserviciociudadano.bicicar.model.Beneficiario; import car.gov.co.carserviciociudadano.bicicar.model.Colegio; import car.gov.co.carserviciociudadano.bicicar.model.Evento; import car.gov.co.carserviciociudadano.bicicar.presenter.AsistentesPresenter; import car.gov.co.carserviciociudadano.bicicar.presenter.BeneficiarioPresenter; import car.gov.co.carserviciociudadano.bicicar.presenter.IViewAsistente; import car.gov.co.carserviciociudadano.bicicar.presenter.IViewBeneficiario; import car.gov.co.carserviciociudadano.common.BaseActivity; import car.gov.co.carserviciociudadano.parques.model.ErrorApi; public class BeneficiariosActivity extends BaseActivity implements IViewBeneficiario, BeneficiariosAdapter.BeneficiarioListener { @BindView(R.id.recycler_view) RecyclerView recyclerView; @BindView(R.id.btnGuardarAsistencia) Button btnGuardarAsistencia; @BindView(R.id.txtBuscar) EditText txtBuscar; @BindView(R.id.btnBuscar) ImageButton btnBuscar; @BindView(R.id.spiColegio) Spinner spiColegio; @BindView(R.id.lySpiColegios) View lySpiColegios; Beneficiario mBeneficiarioLogin; BeneficiariosAdapter mAdaptador; List<Beneficiario> mLstBeneficiarios = new ArrayList<>(); List<Beneficiario> mLstCopyBeneficiarios = new ArrayList<>(); List<Colegio> mLstColegios = new ArrayList<>(); ArrayAdapter<Colegio> adapterColegios; BeneficiarioPresenter beneficiarioPresenter; private Evento mEvento; private AsistentesPresenter asistentesPresenter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_beneficiarios); ButterKnife.bind(this); ActionBar bar = getSupportActionBar(); bar.setDisplayHomeAsUpEnabled(true); mBeneficiarioLogin = Beneficiarios.readBeneficio(); if (mBeneficiarioLogin != null) bar.setTitle( mBeneficiarioLogin.Nombres + " " + mBeneficiarioLogin.Apellidos); Bundle b = getIntent().getExtras(); if (b != null){ int idEvento = b.getInt(Evento.ID_EVENTO,0); mEvento = new Eventos().read(idEvento); } recyclerView.setHasFixedSize(true); mAdaptador = new BeneficiariosAdapter(mLstBeneficiarios); mAdaptador.setBeneficiarioListener(this); recyclerView.setAdapter(mAdaptador); recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); recyclerView.setItemAnimator(new DefaultItemAnimator()); beneficiarioPresenter = new BeneficiarioPresenter(this); asistentesPresenter = new AsistentesPresenter(iViewAsistente); List<Beneficiario> lstBeneficiarios; lySpiColegios.setVisibility(View.GONE); if (mEvento != null) { if (mEvento.getTipoEvento().Publico){ lySpiColegios.setVisibility(View.VISIBLE); mLstColegios.addAll(new Colegios().conEstudiates()); adapterColegios = new ArrayAdapter<>(getApplicationContext(), R.layout.spinner_item, mLstColegios); adapterColegios.setDropDownViewResource( R.layout.simple_spinner_dropdown_item); spiColegio.setAdapter(adapterColegios); lstBeneficiarios = mLstColegios.size() > 0 ? beneficiarioPresenter.listLocal(mLstColegios.get(0).IDColegio) : beneficiarioPresenter.listAllLocal(); onItemSelecteColegio(); if (mLstColegios.size() == 0){ mostrarMensajeDialog("Debe descargar instituciones y estudiantes para registrar asistencia de otras instituciones"); } }else { lstBeneficiarios = beneficiarioPresenter.listLocal(mEvento.IDColegio); } beneficiarioPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); asistentesPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); }else{ //cuando registra asistencia el lider grupo lstBeneficiarios = beneficiarioPresenter.listLocal(mBeneficiarioLogin.Curso, mBeneficiarioLogin.IDColegio); beneficiarioPresenter.desabilitarYaRegistrados(lstBeneficiarios, 0); } if (lstBeneficiarios.size() > 0){ onSuccess(lstBeneficiarios); }else{ obtenerBeneficiarios(); } activarBoton(); txtBuscar.setImeActionLabel("Buscar", KeyEvent.KEYCODE_SEARCH); txtBuscar.setImeOptions(EditorInfo.IME_ACTION_SEARCH); txtBuscar.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { boolean handled = false; if (actionId == EditorInfo.IME_ACTION_SEARCH) { filter(txtBuscar.getText().toString().trim()); handled = true; } return handled; } }); } private void onItemSelecteColegio(){ spiColegio.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { txtBuscar.setText(""); Colegio colegio = mLstColegios.get(i); if (colegio != null ){ List<Beneficiario> lstBeneficiarios = beneficiarioPresenter.listLocal(colegio.IDColegio); asistentesPresenter.desabilitarYaRegistrados(lstBeneficiarios, mEvento.IDEvento); onSuccess(lstBeneficiarios); } } @Override public void onNothingSelected(AdapterView<?> adapterView) { } }); } @Override public void onPause() { AppCar.VolleyQueue().cancelAll(Beneficiarios.TAG); super.onPause(); } @Override public void onBackPressed(){ setResult(RESULT_OK); super.onBackPressed(); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if(id== android.R.id.home){ if (getSupportFragmentManager().getBackStackEntryCount() > 0) getSupportFragmentManager().popBackStack(); else this.onBackPressed(); } return super.onOptionsItemSelected(item); } private void filter(String text){ if (btnGuardarAsistencia.getVisibility() == View.VISIBLE){ mostrarMensajeDialog("Debe guardar los seleccionados antes de hacer otra búsqueda "); return; } mLstBeneficiarios.clear(); if (text != null && text.trim().length() > 0) { String filter = text.trim().toLowerCase(); for (Beneficiario item : mLstCopyBeneficiarios) { if (item.Nombres.toLowerCase().contains(filter) || item.Apellidos.toLowerCase().contains(filter)) { mLstBeneficiarios.add(item); } } // if (mLstColegios.size() > 0) { // PreferencesApp.getDefault(PreferencesApp.WRITE).putString(ULTIMA_BUSQUEDA, filter).commit(); // } }else{ mLstBeneficiarios.addAll(mLstCopyBeneficiarios); } mAdaptador.notifyDataSetChanged(); txtBuscar.clearFocus(); InputMethodManager in = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(txtBuscar.getWindowToken(), 0); } private void obtenerBeneficiarios(){ mostrarProgressDialog("Descargando estudiantes"); if (mEvento != null) { beneficiarioPresenter.list(mEvento.IDColegio); }else{ beneficiarioPresenter.list(mBeneficiarioLogin.Curso, mBeneficiarioLogin.IDColegio); } } @OnClick(R.id.btnBuscar) void onBuscar(){ filter(txtBuscar.getText().toString()); } @OnClick(R.id.btnGuardarAsistencia) void onGuardarAsistencia(){ guardarAsistencia(); } private void guardarAsistencia(){ boolean actualizarEstadoEvento = false; for (Beneficiario b : mLstBeneficiarios){ Asistentes asistentes = new Asistentes(); if (b.Selected && b.Enabled) { if (mEvento != null && mEvento.getTipoEvento() != null){ if (!mEvento.getTipoEvento().Recorrido || mEvento.getTipoEvento().Publico){ asistentes.insert(new Asistente(mEvento.IDEvento, b.IDBeneficiario, Enumerator.Estado.PENDIENTE_PUBLICAR)); }else{ beneficiarioPresenter.GuardarLogTrayecto(b, mBeneficiarioLogin, mEvento); } actualizarEstadoEvento = true; }else { beneficiarioPresenter.GuardarLogTrayecto(b, mBeneficiarioLogin); } b.Enabled = false; } } if (actualizarEstadoEvento){ mEvento.Estado = Enumerator.Estado.PENDIENTE_PUBLICAR; new Eventos().update(mEvento); } if (mEvento != null && mEvento.getTipoEvento() != null){ beneficiarioPresenter.desabilitarYaRegistrados(mLstCopyBeneficiarios, mEvento.IDEvento); asistentesPresenter.desabilitarYaRegistrados(mLstCopyBeneficiarios, mEvento.IDEvento); mAdaptador.notifyDataSetChanged(); mostrarMensaje("Asistencia guardada"); }else { setResult(RESULT_OK); finish(); } } private void activarBoton(){ int count = 0; for (Beneficiario b : mLstBeneficiarios) { if (b.Selected && b.Enabled) count ++; } btnGuardarAsistencia.setVisibility(count > 0 ? View.VISIBLE : View.GONE); } @Override public void onSuccess(Beneficiario beneficiario) { } @Override public void onSuccess(List<Beneficiario> lstBeneficiarios) { ocultarProgressDialog(); mLstBeneficiarios.clear(); mLstBeneficiarios.addAll(lstBeneficiarios); mLstCopyBeneficiarios = new ArrayList<>(mLstBeneficiarios); mAdaptador.notifyDataSetChanged(); } @Override public void onError(ErrorApi errorApi) { } @Override public void onErrorListarItems(ErrorApi errorApi) { ocultarProgressDialog(); if (errorApi.getStatusCode() == 404) mostrarMensajeDialog(errorApi.getMessage()); else{ AlertDialog.Builder builder = new AlertDialog.Builder(BeneficiariosActivity.this); builder.setMessage(errorApi.getMessage()); builder.setPositiveButton("Reintentar", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); obtenerBeneficiarios(); } }); builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.show(); } } @Override public void onSuccessRecordarClave(String mensaje) { } @Override public void onErrorRecordarClave(ErrorApi error) { } @Override public void onCheckedAsistenacia(int position, CompoundButton compoundButton, boolean b) { Beneficiario beneficiario = mLstBeneficiarios.get(position); if (beneficiario != null){ beneficiario.Selected = b; } activarBoton(); } IViewAsistente iViewAsistente = new IViewAsistente() { @Override public void onSuccess(int idEvento) { } @Override public void onErrorAsistente(ErrorApi error) { } @Override public void onError(ErrorApi error) { } }; }
13,811
0.663215
0.662129
364
36.93956
30.573038
163
false
false
0
0
0
0
0
0
0.571429
false
false
2
7679ca6697a715bc00c9e9922790fac9a4b11743
3,607,772,543,602
3a2a9cf812e8a7eac4917f9312cd062cc1fce5e6
/week 3/solution/week 3 Standalone Observer Solution/src/app/Application.java
c48389781e6e7c0a87204ac7d6988ef539e510c4
[ "Apache-2.0" ]
permissive
tcorbat/B2B-tec
https://github.com/tcorbat/B2B-tec
7ac8ca2945ddf6a48a36e69208b677c0ca8cd623
c57ea28ee58a7d24704b102a64bc847acebf30ef
refs/heads/master
2023-08-05T08:48:12.819000
2021-01-14T17:18:19
2021-01-14T17:18:19
162,693,833
0
0
null
false
2023-07-20T15:05:59
2018-12-21T09:23:25
2023-03-02T16:20:24
2023-07-20T15:05:56
4,309
1
0
5
Java
false
false
package app; import bl.DomainModel; import ui.UserInterface; public class Application { public static void main(String[] args) { var model = new DomainModel(); var ui = new UserInterface(model); model.setData("data"); } }
UTF-8
Java
244
java
Application.java
Java
[]
null
[]
package app; import bl.DomainModel; import ui.UserInterface; public class Application { public static void main(String[] args) { var model = new DomainModel(); var ui = new UserInterface(model); model.setData("data"); } }
244
0.680328
0.680328
12
18.333334
14.226345
41
false
false
0
0
0
0
0
0
1.166667
false
false
2
0b67300b06fd0075888325785ae2dba471601e9a
20,023,137,567,951
be68bcbe1055784dfd723aa47ccca52f310fda5f
/sources/p021wl/smartled/activity/PinSequenceActivity.java
c295682feba442214d6a8b79adba0430ec392fdb
[]
no_license
nicholaschum/DecompiledEvoziSmartLED
https://github.com/nicholaschum/DecompiledEvoziSmartLED
02710bc9b7ddb5db2f7fbbcebfe21605f8e889f8
42d3df21feac3d039219c3384e12e56e5f587028
refs/heads/master
2023-08-18T01:57:52.644000
2021-09-17T20:48:43
2021-09-17T20:48:43
407,675,617
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package p021wl.smartled.activity; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.support.p010v7.app.AppCompatActivity; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; import com.qihoo360.replugin.library.C0462R; import java.lang.reflect.Array; import p021wl.smartled.p024c.C0528a; import p021wl.smartled.p027f.C0538a; /* renamed from: wl.smartled.activity.PinSequenceActivity */ public class PinSequenceActivity extends AppCompatActivity implements View.OnClickListener, View.OnTouchListener { /* renamed from: a */ private static final int[][] f2138a = {new int[]{C0462R.C0464id.id_iv_pin_r00, C0462R.C0464id.id_iv_pin_r01, C0462R.C0464id.id_iv_pin_r02}, new int[]{C0462R.C0464id.id_iv_pin_r10, C0462R.C0464id.id_iv_pin_r11, C0462R.C0464id.id_iv_pin_r12}, new int[]{C0462R.C0464id.id_iv_pin_r20, C0462R.C0464id.id_iv_pin_r21, C0462R.C0464id.id_iv_pin_r22}}; /* renamed from: b */ private static final int[][] f2139b = {new int[]{C0462R.C0463drawable.ic_pin_r_down, C0462R.C0463drawable.ic_pin_r_up, C0462R.C0463drawable.ic_pin_r_invalid}, new int[]{C0462R.C0463drawable.ic_pin_g_down, C0462R.C0463drawable.ic_pin_g_up, C0462R.C0463drawable.ic_pin_g_invalid}, new int[]{C0462R.C0463drawable.ic_pin_b_down, C0462R.C0463drawable.ic_pin_b_up, C0462R.C0463drawable.ic_pin_b_invalid}}; /* renamed from: c */ private static final int[] f2140c = {C0462R.C0463drawable.ic_pin_sequence_pr, C0462R.C0463drawable.ic_pin_sequence_pg, C0462R.C0463drawable.ic_pin_sequence_pb, C0462R.C0463drawable.ic_pin_sequence_pn}; /* renamed from: d */ private static final int[] f2141d = {-1, -1, -1}; /* renamed from: e */ private static final int[][] f2142e = {new int[]{1, 2, 2}, new int[]{1, 2, 2}, new int[]{1, 2, 2}}; /* renamed from: f */ private final ImageView[][] f2143f = ((ImageView[][]) Array.newInstance(ImageView.class, new int[]{3, 3})); /* renamed from: g */ private final ImageView[] f2144g = new ImageView[3]; /* renamed from: h */ private ImageView f2145h; /* renamed from: i */ private ImageView f2146i; /* renamed from: j */ private Handler f2147j = new C0498u(this); /* renamed from: a */ private void m1649a() { for (int i = 0; i < f2138a.length; i++) { for (int i2 = 0; i2 < f2138a[i].length; i2++) { this.f2143f[i][i2].setImageResource(f2139b[i][f2142e[i][i2]]); } } } /* renamed from: b */ private void m1650b() { ImageView imageView; int i; for (int i2 = 0; i2 < f2141d.length; i2++) { if (f2141d[i2] == -1) { imageView = this.f2144g[i2]; i = f2140c[3]; } else { imageView = this.f2144g[i2]; i = f2140c[f2141d[i2]]; } imageView.setImageResource(i); } } /* renamed from: c */ private void m1651c() { ImageView imageView; int i; if (m1652d()) { imageView = this.f2146i; i = C0462R.C0463drawable.ic_pin_sequence_send_up; } else { imageView = this.f2146i; i = C0462R.C0463drawable.ic_pin_sequence_send_invalid; } imageView.setImageResource(i); } /* renamed from: d */ private static boolean m1652d() { for (int i : f2141d) { if (i == -1) { return false; } } return true; } /* JADX WARNING: Removed duplicated region for block: B:27:0x0069 */ /* JADX WARNING: Removed duplicated region for block: B:71:? A[RETURN, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. */ public void onClick(android.view.View r8) { /* r7 = this; int r8 = r8.getId() r0 = 2131230823(0x7f080067, float:1.807771E38) if (r8 != r0) goto L_0x0014 android.os.Handler r8 = r7.f2147j r0 = 100 r8.removeMessages(r0) r7.finish() return L_0x0014: r0 = 0 r1 = 0 L_0x0016: int[][] r2 = f2138a int r2 = r2.length if (r1 >= r2) goto L_0x00c8 r2 = 0 L_0x001c: int[][] r3 = f2138a r3 = r3[r1] int r3 = r3.length if (r2 >= r3) goto L_0x00c4 int[][] r3 = f2138a r3 = r3[r1] r3 = r3[r2] if (r3 != r8) goto L_0x00c0 int[][] r8 = f2142e r8 = r8[r1] r8 = r8[r2] r3 = -1 r4 = 1 if (r8 != 0) goto L_0x0041 int[] r8 = f2141d r8[r2] = r3 int[][] r8 = f2142e r8 = r8[r1] r8[r2] = r4 L_0x003f: r8 = 1 goto L_0x0067 L_0x0041: if (r8 != r4) goto L_0x0066 int[] r8 = f2141d r8[r2] = r1 int[][] r8 = f2142e r8 = r8[r1] r8[r2] = r0 r8 = 0 L_0x004e: int[][] r5 = f2138a int r5 = r5.length if (r8 >= r5) goto L_0x003f if (r8 == r1) goto L_0x0063 int[][] r5 = f2142e r5 = r5[r8] r5 = r5[r2] if (r5 != 0) goto L_0x0063 int[][] r5 = f2142e r5 = r5[r8] r5[r2] = r4 L_0x0063: int r8 = r8 + 1 goto L_0x004e L_0x0066: r8 = 0 L_0x0067: if (r8 == 0) goto L_0x00bf int r2 = r2 + r4 r8 = r2 L_0x006b: int[] r1 = f2141d int r1 = r1.length if (r8 >= r1) goto L_0x0077 int[] r1 = f2141d r1[r8] = r3 int r8 = r8 + 1 goto L_0x006b L_0x0077: r8 = 0 L_0x0078: int[][] r1 = f2138a int r1 = r1.length if (r8 >= r1) goto L_0x00b6 r1 = r2 L_0x007e: int[][] r5 = f2138a r5 = r5[r8] int r5 = r5.length if (r1 >= r5) goto L_0x00b3 int[] r5 = f2141d int r6 = r1 + -1 r5 = r5[r6] if (r5 == r3) goto L_0x00a9 r5 = 0 L_0x008e: int[] r6 = f2141d int r6 = r6.length if (r5 >= r6) goto L_0x009e int[] r6 = f2141d r6 = r6[r5] if (r6 != r8) goto L_0x009b r5 = 1 goto L_0x009f L_0x009b: int r5 = r5 + 1 goto L_0x008e L_0x009e: r5 = 0 L_0x009f: if (r5 == 0) goto L_0x00a2 goto L_0x00a9 L_0x00a2: int[][] r5 = f2142e r5 = r5[r8] r5[r1] = r4 goto L_0x00b0 L_0x00a9: int[][] r5 = f2142e r5 = r5[r8] r6 = 2 r5[r1] = r6 L_0x00b0: int r1 = r1 + 1 goto L_0x007e L_0x00b3: int r8 = r8 + 1 goto L_0x0078 L_0x00b6: r7.m1649a() r7.m1651c() r7.m1650b() L_0x00bf: return L_0x00c0: int r2 = r2 + 1 goto L_0x001c L_0x00c4: int r1 = r1 + 1 goto L_0x0016 L_0x00c8: return */ throw new UnsupportedOperationException("Method not decompiled: p021wl.smartled.activity.PinSequenceActivity.onClick(android.view.View):void"); } /* access modifiers changed from: protected */ public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView((int) C0462R.layout.activity_pin_sequence); this.f2145h = (ImageView) findViewById(C0462R.C0464id.id_iv_back); this.f2145h.setOnClickListener(this); this.f2146i = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_send); this.f2146i.setOnTouchListener(this); this.f2144g[0] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_r); this.f2144g[1] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_g); this.f2144g[2] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_b); for (int i = 0; i < f2138a.length; i++) { for (int i2 = 0; i2 < f2138a[i].length; i2++) { ImageView imageView = (ImageView) findViewById(f2138a[i][i2]); this.f2143f[i][i2] = imageView; imageView.setOnClickListener(this); } } m1649a(); m1651c(); m1650b(); } /* access modifiers changed from: protected */ public void onDestroy() { super.onDestroy(); this.f2147j.removeMessages(100); } /* access modifiers changed from: protected */ public void onStop() { super.onStop(); } public boolean onTouch(View view, MotionEvent motionEvent) { if (view.getId() != C0462R.C0464id.id_iv_pin_sequence_send) { return false; } if (m1652d()) { int action = motionEvent.getAction(); if (action == 0) { this.f2146i.setImageResource(C0462R.C0463drawable.ic_pin_sequence_send_down); C0538a.m1861a().mo4986a((Context) this, C0528a.m1795a().mo4941e(), f2141d[0] + 1, f2141d[1] + 1, f2141d[2] + 1); } else if (action == 1 || action == 3) { m1651c(); if (!this.f2147j.hasMessages(100)) { this.f2147j.sendEmptyMessageDelayed(100, 600); } } } return true; } }
UTF-8
Java
9,918
java
PinSequenceActivity.java
Java
[]
null
[]
package p021wl.smartled.activity; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.support.p010v7.app.AppCompatActivity; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; import com.qihoo360.replugin.library.C0462R; import java.lang.reflect.Array; import p021wl.smartled.p024c.C0528a; import p021wl.smartled.p027f.C0538a; /* renamed from: wl.smartled.activity.PinSequenceActivity */ public class PinSequenceActivity extends AppCompatActivity implements View.OnClickListener, View.OnTouchListener { /* renamed from: a */ private static final int[][] f2138a = {new int[]{C0462R.C0464id.id_iv_pin_r00, C0462R.C0464id.id_iv_pin_r01, C0462R.C0464id.id_iv_pin_r02}, new int[]{C0462R.C0464id.id_iv_pin_r10, C0462R.C0464id.id_iv_pin_r11, C0462R.C0464id.id_iv_pin_r12}, new int[]{C0462R.C0464id.id_iv_pin_r20, C0462R.C0464id.id_iv_pin_r21, C0462R.C0464id.id_iv_pin_r22}}; /* renamed from: b */ private static final int[][] f2139b = {new int[]{C0462R.C0463drawable.ic_pin_r_down, C0462R.C0463drawable.ic_pin_r_up, C0462R.C0463drawable.ic_pin_r_invalid}, new int[]{C0462R.C0463drawable.ic_pin_g_down, C0462R.C0463drawable.ic_pin_g_up, C0462R.C0463drawable.ic_pin_g_invalid}, new int[]{C0462R.C0463drawable.ic_pin_b_down, C0462R.C0463drawable.ic_pin_b_up, C0462R.C0463drawable.ic_pin_b_invalid}}; /* renamed from: c */ private static final int[] f2140c = {C0462R.C0463drawable.ic_pin_sequence_pr, C0462R.C0463drawable.ic_pin_sequence_pg, C0462R.C0463drawable.ic_pin_sequence_pb, C0462R.C0463drawable.ic_pin_sequence_pn}; /* renamed from: d */ private static final int[] f2141d = {-1, -1, -1}; /* renamed from: e */ private static final int[][] f2142e = {new int[]{1, 2, 2}, new int[]{1, 2, 2}, new int[]{1, 2, 2}}; /* renamed from: f */ private final ImageView[][] f2143f = ((ImageView[][]) Array.newInstance(ImageView.class, new int[]{3, 3})); /* renamed from: g */ private final ImageView[] f2144g = new ImageView[3]; /* renamed from: h */ private ImageView f2145h; /* renamed from: i */ private ImageView f2146i; /* renamed from: j */ private Handler f2147j = new C0498u(this); /* renamed from: a */ private void m1649a() { for (int i = 0; i < f2138a.length; i++) { for (int i2 = 0; i2 < f2138a[i].length; i2++) { this.f2143f[i][i2].setImageResource(f2139b[i][f2142e[i][i2]]); } } } /* renamed from: b */ private void m1650b() { ImageView imageView; int i; for (int i2 = 0; i2 < f2141d.length; i2++) { if (f2141d[i2] == -1) { imageView = this.f2144g[i2]; i = f2140c[3]; } else { imageView = this.f2144g[i2]; i = f2140c[f2141d[i2]]; } imageView.setImageResource(i); } } /* renamed from: c */ private void m1651c() { ImageView imageView; int i; if (m1652d()) { imageView = this.f2146i; i = C0462R.C0463drawable.ic_pin_sequence_send_up; } else { imageView = this.f2146i; i = C0462R.C0463drawable.ic_pin_sequence_send_invalid; } imageView.setImageResource(i); } /* renamed from: d */ private static boolean m1652d() { for (int i : f2141d) { if (i == -1) { return false; } } return true; } /* JADX WARNING: Removed duplicated region for block: B:27:0x0069 */ /* JADX WARNING: Removed duplicated region for block: B:71:? A[RETURN, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. */ public void onClick(android.view.View r8) { /* r7 = this; int r8 = r8.getId() r0 = 2131230823(0x7f080067, float:1.807771E38) if (r8 != r0) goto L_0x0014 android.os.Handler r8 = r7.f2147j r0 = 100 r8.removeMessages(r0) r7.finish() return L_0x0014: r0 = 0 r1 = 0 L_0x0016: int[][] r2 = f2138a int r2 = r2.length if (r1 >= r2) goto L_0x00c8 r2 = 0 L_0x001c: int[][] r3 = f2138a r3 = r3[r1] int r3 = r3.length if (r2 >= r3) goto L_0x00c4 int[][] r3 = f2138a r3 = r3[r1] r3 = r3[r2] if (r3 != r8) goto L_0x00c0 int[][] r8 = f2142e r8 = r8[r1] r8 = r8[r2] r3 = -1 r4 = 1 if (r8 != 0) goto L_0x0041 int[] r8 = f2141d r8[r2] = r3 int[][] r8 = f2142e r8 = r8[r1] r8[r2] = r4 L_0x003f: r8 = 1 goto L_0x0067 L_0x0041: if (r8 != r4) goto L_0x0066 int[] r8 = f2141d r8[r2] = r1 int[][] r8 = f2142e r8 = r8[r1] r8[r2] = r0 r8 = 0 L_0x004e: int[][] r5 = f2138a int r5 = r5.length if (r8 >= r5) goto L_0x003f if (r8 == r1) goto L_0x0063 int[][] r5 = f2142e r5 = r5[r8] r5 = r5[r2] if (r5 != 0) goto L_0x0063 int[][] r5 = f2142e r5 = r5[r8] r5[r2] = r4 L_0x0063: int r8 = r8 + 1 goto L_0x004e L_0x0066: r8 = 0 L_0x0067: if (r8 == 0) goto L_0x00bf int r2 = r2 + r4 r8 = r2 L_0x006b: int[] r1 = f2141d int r1 = r1.length if (r8 >= r1) goto L_0x0077 int[] r1 = f2141d r1[r8] = r3 int r8 = r8 + 1 goto L_0x006b L_0x0077: r8 = 0 L_0x0078: int[][] r1 = f2138a int r1 = r1.length if (r8 >= r1) goto L_0x00b6 r1 = r2 L_0x007e: int[][] r5 = f2138a r5 = r5[r8] int r5 = r5.length if (r1 >= r5) goto L_0x00b3 int[] r5 = f2141d int r6 = r1 + -1 r5 = r5[r6] if (r5 == r3) goto L_0x00a9 r5 = 0 L_0x008e: int[] r6 = f2141d int r6 = r6.length if (r5 >= r6) goto L_0x009e int[] r6 = f2141d r6 = r6[r5] if (r6 != r8) goto L_0x009b r5 = 1 goto L_0x009f L_0x009b: int r5 = r5 + 1 goto L_0x008e L_0x009e: r5 = 0 L_0x009f: if (r5 == 0) goto L_0x00a2 goto L_0x00a9 L_0x00a2: int[][] r5 = f2142e r5 = r5[r8] r5[r1] = r4 goto L_0x00b0 L_0x00a9: int[][] r5 = f2142e r5 = r5[r8] r6 = 2 r5[r1] = r6 L_0x00b0: int r1 = r1 + 1 goto L_0x007e L_0x00b3: int r8 = r8 + 1 goto L_0x0078 L_0x00b6: r7.m1649a() r7.m1651c() r7.m1650b() L_0x00bf: return L_0x00c0: int r2 = r2 + 1 goto L_0x001c L_0x00c4: int r1 = r1 + 1 goto L_0x0016 L_0x00c8: return */ throw new UnsupportedOperationException("Method not decompiled: p021wl.smartled.activity.PinSequenceActivity.onClick(android.view.View):void"); } /* access modifiers changed from: protected */ public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView((int) C0462R.layout.activity_pin_sequence); this.f2145h = (ImageView) findViewById(C0462R.C0464id.id_iv_back); this.f2145h.setOnClickListener(this); this.f2146i = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_send); this.f2146i.setOnTouchListener(this); this.f2144g[0] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_r); this.f2144g[1] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_g); this.f2144g[2] = (ImageView) findViewById(C0462R.C0464id.id_iv_pin_sequence_display_b); for (int i = 0; i < f2138a.length; i++) { for (int i2 = 0; i2 < f2138a[i].length; i2++) { ImageView imageView = (ImageView) findViewById(f2138a[i][i2]); this.f2143f[i][i2] = imageView; imageView.setOnClickListener(this); } } m1649a(); m1651c(); m1650b(); } /* access modifiers changed from: protected */ public void onDestroy() { super.onDestroy(); this.f2147j.removeMessages(100); } /* access modifiers changed from: protected */ public void onStop() { super.onStop(); } public boolean onTouch(View view, MotionEvent motionEvent) { if (view.getId() != C0462R.C0464id.id_iv_pin_sequence_send) { return false; } if (m1652d()) { int action = motionEvent.getAction(); if (action == 0) { this.f2146i.setImageResource(C0462R.C0463drawable.ic_pin_sequence_send_down); C0538a.m1861a().mo4986a((Context) this, C0528a.m1795a().mo4941e(), f2141d[0] + 1, f2141d[1] + 1, f2141d[2] + 1); } else if (action == 1 || action == 3) { m1651c(); if (!this.f2147j.hasMessages(100)) { this.f2147j.sendEmptyMessageDelayed(100, 600); } } } return true; } }
9,918
0.511192
0.391712
299
32.17057
36.924595
403
false
false
0
0
0
0
0
0
0.397993
false
false
2
4dc0631f25b3d40ca1d2269b268f6ba83217d627
24,979,529,809,727
b25b91480ee7f4e5c3903c215825be1a4085c9e0
/src/Stack.java
c2ff6654e8cdbd97c77f98cbdfddc2b746db5823
[]
no_license
crackerzzz/algo-parts-1
https://github.com/crackerzzz/algo-parts-1
7a228c06584041887718b45147a16d6ddc231e29
d877e5abb476d2400392fad43282f55434ea350b
refs/heads/master
2020-04-08T05:44:08.184000
2019-05-21T23:45:19
2019-05-21T23:45:19
159,071,644
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Iterator; public class Stack<E> implements Iterable<E> { private Node first; private int N = 0; public void push(E item) { final Node oldfirst = first; first = new Node(item); first.next = oldfirst; N++; } public E pop() { final E item = first.item; first = first.next; N--; return item; } public boolean isEmpty() { return first == null; } public int size() { return N; } @Override public Iterator<E> iterator() { return new StackIterator(); } private class StackIterator implements Iterator<E> { private Node current = first; @Override public boolean hasNext() { return current != null; } @Override public E next() { final E item = current.item; current = current.next; return item; } } private class Node { E item; Node next; public Node(E item) { this.item = item; } } public static void main(String[] args) { Stack<String> stack = new Stack<>(); stack.push("1"); stack.push("2"); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); stack.push("3"); stack.push("4"); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); // System.out.println(" stack.pop();: " + stack.pop()); System.out.println("stack.isEmpty(): " + stack.isEmpty()); for (String item : stack) { System.out.println(item); } } }
UTF-8
Java
1,987
java
Stack.java
Java
[]
null
[]
import java.util.Iterator; public class Stack<E> implements Iterable<E> { private Node first; private int N = 0; public void push(E item) { final Node oldfirst = first; first = new Node(item); first.next = oldfirst; N++; } public E pop() { final E item = first.item; first = first.next; N--; return item; } public boolean isEmpty() { return first == null; } public int size() { return N; } @Override public Iterator<E> iterator() { return new StackIterator(); } private class StackIterator implements Iterator<E> { private Node current = first; @Override public boolean hasNext() { return current != null; } @Override public E next() { final E item = current.item; current = current.next; return item; } } private class Node { E item; Node next; public Node(E item) { this.item = item; } } public static void main(String[] args) { Stack<String> stack = new Stack<>(); stack.push("1"); stack.push("2"); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); stack.push("3"); stack.push("4"); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); System.out.println("stack.isEmpty(): " + stack.isEmpty()); // System.out.println(" stack.pop();: " + stack.pop()); // System.out.println(" stack.pop();: " + stack.pop()); System.out.println("stack.isEmpty(): " + stack.isEmpty()); for (String item : stack) { System.out.println(item); } } }
1,987
0.492703
0.490186
78
23.47436
19.422247
66
false
false
0
0
0
0
0
0
0.512821
false
false
2
7e87e7564d63f2cc34348c082d86e2d1a4b8b296
25,786,983,664,355
cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b
/AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/zeptolab/ctr/scorer/CtrGoogleLeaderboardsMap.java
e96ae2f451a8e8c674646fb6f49c4cc10033a34e
[]
no_license
linux86/AndoirdSecurity
https://github.com/linux86/AndoirdSecurity
3165de73b37f53070cd6b435e180a2cb58d6f672
1e72a3c1f7a72ea9cd12048d9874a8651e0aede7
refs/heads/master
2021-01-11T01:20:58.986000
2016-04-05T17:14:26
2016-04-05T17:14:26
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zeptolab.ctr.scorer; import com.zeptolab.zbuild.ZBuildConfig; import java.util.ArrayList; public class CtrGoogleLeaderboardsMap extends ArrayList { public CtrGoogleLeaderboardsMap() { if (!ZBuildConfig.profiles.contains("lite")) { add("CgkItOn28b0HEAIQMg"); add("CgkItOn28b0HEAIQMw"); add("CgkItOn28b0HEAIQNA"); add("CgkItOn28b0HEAIQOA"); add("CgkItOn28b0HEAIQNw"); add("CgkItOn28b0HEAIQOQ"); add("CgkItOn28b0HEAIQNQ"); add("CgkItOn28b0HEAIQNg"); add("CgkItOn28b0HEAIQOg"); add("CgkItOn28b0HEAIQOw"); add("CgkItOn28b0HEAIQPA"); add("CgkItOn28b0HEAIQPQ"); add("CgkItOn28b0HEAIQPg"); add("CgkItOn28b0HEAIQPw"); add("CgkItOn28b0HEAIQQA"); add("CgkItOn28b0HEAIQQw"); } } }
UTF-8
Java
898
java
CtrGoogleLeaderboardsMap.java
Java
[]
null
[]
package com.zeptolab.ctr.scorer; import com.zeptolab.zbuild.ZBuildConfig; import java.util.ArrayList; public class CtrGoogleLeaderboardsMap extends ArrayList { public CtrGoogleLeaderboardsMap() { if (!ZBuildConfig.profiles.contains("lite")) { add("CgkItOn28b0HEAIQMg"); add("CgkItOn28b0HEAIQMw"); add("CgkItOn28b0HEAIQNA"); add("CgkItOn28b0HEAIQOA"); add("CgkItOn28b0HEAIQNw"); add("CgkItOn28b0HEAIQOQ"); add("CgkItOn28b0HEAIQNQ"); add("CgkItOn28b0HEAIQNg"); add("CgkItOn28b0HEAIQOg"); add("CgkItOn28b0HEAIQOw"); add("CgkItOn28b0HEAIQPA"); add("CgkItOn28b0HEAIQPQ"); add("CgkItOn28b0HEAIQPg"); add("CgkItOn28b0HEAIQPw"); add("CgkItOn28b0HEAIQQA"); add("CgkItOn28b0HEAIQQw"); } } }
898
0.596882
0.54343
27
32.296295
15.015584
57
false
false
0
0
0
0
0
0
0.703704
false
false
2
b9ba6f87d074f8379f6a72dd33e27c600f1ece36
12,146,167,555,806
8875cfdc76dfd23754bb2650644b0fa3c63fb5c7
/MyCalculate/src/org/ant/MyCalculate/Test.java
040ff1c5e01709e02d4426eb5891c200c6a70736
[]
no_license
google-code/antsnow
https://github.com/google-code/antsnow
f7348842de14a4a05e82321246e44998423bda1d
844b7efe9fe0d5ae79360490ac9dc2005564b234
refs/heads/master
2016-08-04T23:13:08.798000
2015-03-15T12:06:51
2015-03-15T12:06:51
32,258,610
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.ant.MyCalculate; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test { /** * @param args */ public static void main(String[] args) { String str = "1+2"; String regEx = "+|-|*|//"; Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(str); boolean rs = m.find(); } }
UTF-8
Java
355
java
Test.java
Java
[]
null
[]
package org.ant.MyCalculate; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test { /** * @param args */ public static void main(String[] args) { String str = "1+2"; String regEx = "+|-|*|//"; Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(str); boolean rs = m.find(); } }
355
0.597183
0.591549
20
15.75
14.247368
41
false
false
0
0
0
0
0
0
1.3
false
false
2
a6987de83bd35d13fe1a61277a70d3c5a5310e2e
18,098,992,197,770
08be78ee28957fe393bea727228fbe13e5c00df1
/modules/erp/erp-web-core/src/main/java/com/erp/web/controller/BaseController.java
2f19f169441e9c0c38039507b1b8f4a9683f5c42
[]
no_license
javachengwc/java-apply
https://github.com/javachengwc/java-apply
432259eadfca88c6f3f2b80aae8e1e8a93df5159
98a45c716f18657f0e4181d0c125a73feb402b16
refs/heads/master
2023-08-22T12:30:05.708000
2023-08-15T08:21:15
2023-08-15T08:21:15
54,971,501
10
4
null
false
2022-12-16T11:03:56
2016-03-29T11:50:21
2022-10-10T06:55:54
2022-12-16T11:03:55
35,723
4
4
278
Java
false
false
package com.erp.web.controller; import lombok.Getter; import lombok.Setter; /** * 控制层基类 */ @Setter @Getter public abstract class BaseController { }
UTF-8
Java
163
java
BaseController.java
Java
[]
null
[]
package com.erp.web.controller; import lombok.Getter; import lombok.Setter; /** * 控制层基类 */ @Setter @Getter public abstract class BaseController { }
163
0.732026
0.732026
13
10.769231
12.279776
38
false
false
0
0
0
0
0
0
0.230769
false
false
2
06997d1b43f87e4a7befd312fa4d1b064a9ec974
15,728,170,266,747
43a9e04b63a8319ca3e8623cc621be6f42cf78f3
/common/src/main/java/uq/deco2800/singularity/common/representations/dangernoodle/GameState.java
670ee3bef0182f6a6e42622b2cad4db2fc27a554
[ "MIT" ]
permissive
UQdeco2800/singularity-server
https://github.com/UQdeco2800/singularity-server
586175bc6cc2661802a358b2ffc7ae15ce28e48c
e0a4b0660236b3620e20d912e9e6ac82baedda00
refs/heads/master
2020-06-09T15:12:22.901000
2016-12-09T12:17:31
2016-12-09T12:17:31
76,032,135
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package uq.deco2800.singularity.common.representations.dangernoodle; /** * Created by khoi_truong on 2016/10/18. * <p> * This enumeration is used to handle the switching between different game * state on this server. */ public enum GameState { START_LOBBY, JOINED_LOBBY, REQUEST_CLIENT_ID, LEAVE_LOBBY, REQUEST_CLIENTS_IN_LOBBY, LOBBY_FULL, START_GAME, PLAY_GAME, END_GAME, TURN_CHANGED, NOODLE_MOVED, NOODLE_FIRED }
UTF-8
Java
471
java
GameState.java
Java
[ { "context": "n.representations.dangernoodle;\n\n/**\n * Created by khoi_truong on 2016/10/18.\n * <p>\n * This enumeration is used", "end": 99, "score": 0.9996271729469299, "start": 88, "tag": "USERNAME", "value": "khoi_truong" } ]
null
[]
package uq.deco2800.singularity.common.representations.dangernoodle; /** * Created by khoi_truong on 2016/10/18. * <p> * This enumeration is used to handle the switching between different game * state on this server. */ public enum GameState { START_LOBBY, JOINED_LOBBY, REQUEST_CLIENT_ID, LEAVE_LOBBY, REQUEST_CLIENTS_IN_LOBBY, LOBBY_FULL, START_GAME, PLAY_GAME, END_GAME, TURN_CHANGED, NOODLE_MOVED, NOODLE_FIRED }
471
0.681529
0.656051
22
20.40909
18.428385
74
false
false
0
0
0
0
0
0
0.545455
false
false
2
715ffa0ada9e37d52165e8f95cfbfc0485263729
23,545,010,748,365
8817e851502752cb29af14f7ee84357d82ff2a34
/ScannerUserInput.java
2ede8b194297118b3d14d8a27855d11cd040c887
[]
no_license
Manvish2000/100_days-java
https://github.com/Manvish2000/100_days-java
d646fa443cd28c614c3d389618f3d1ce60deb5cd
e86642bd6ea8b22900a604179ee384d1020b9708
refs/heads/master
2023-01-22T04:44:14.779000
2020-12-03T08:20:29
2020-12-03T08:20:29
288,661,534
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package userInput; import java.util.Scanner; public class ScannerUserInput { public static void main(String[] args) { Scanner sc=new Scanner(System.in); float p=sc.nextFloat(); float t=sc.nextFloat(); float r=sc.nextFloat(); float s=(p*t*r)/100; System.out.println(s); } }
UTF-8
Java
303
java
ScannerUserInput.java
Java
[]
null
[]
package userInput; import java.util.Scanner; public class ScannerUserInput { public static void main(String[] args) { Scanner sc=new Scanner(System.in); float p=sc.nextFloat(); float t=sc.nextFloat(); float r=sc.nextFloat(); float s=(p*t*r)/100; System.out.println(s); } }
303
0.663366
0.653465
14
19.642857
13.161672
41
false
false
0
0
0
0
0
0
1.571429
false
false
2
47f9121c756e7c6c97fe259d3232784f874ec480
32,521,492,401,709
598cfb6dc795c010ec126f3e93e2f94aa3739703
/src/pkg311taskmanager/UserListModel.java
b88b84160ba6811018c33054e6ccb6b25c9a3530
[]
no_license
lap5508/EasyTask
https://github.com/lap5508/EasyTask
0ec2f1e1b35a4c1aee21a5b4b0af19a0f2e848bf
5569ad955012a267d351062062ee2f97bdacac63
refs/heads/master
2021-01-23T00:07:27.315000
2017-04-26T17:27:08
2017-04-26T17:27:08
85,702,231
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 pkg311taskmanager; import java.io.Serializable; import java.util.ArrayList; /** * * @author Luke */ public class UserListModel implements Serializable{ private ArrayList<UserModel> theListOfUsers; public UserListModel(){ if(theListOfUsers == null){ //buildTestUserList(); //SerializedDataCntl.getSerializedDataCntl().writeSerializedDataModel(); } } public void buildTestUserList(){ theListOfUsers = new ArrayList(); for (int i = 0; i < 100; i++){ String username = ("TestUser" + i); char[] password = {'t','e','s','t'}; UserModel newUser = new UserModel(username, password); getTheListOfUsers().add(newUser); } System.out.println("made new losers"); } public boolean authenticate(String usernameToCheck, char[] passwordToCheck){ boolean authenticated = false; boolean nameMatch = false; boolean passwordMatch = false; for (int i = 0; i < getTheListOfUsers().size(); i++){ nameMatch = usernameToCheck.equals(getTheListOfUsers().get(i).getUsername()); passwordMatch = String.valueOf(passwordToCheck).equals(String.valueOf(getTheListOfUsers().get(i).getPassword())); if(nameMatch && passwordMatch){ authenticated = true; break; } } return authenticated; } /** * @return the theListOfUsers */ public ArrayList<UserModel> getTheListOfUsers() { if(theListOfUsers == null){ theListOfUsers = new ArrayList<UserModel>(); } return theListOfUsers; } }
UTF-8
Java
1,973
java
UserListModel.java
Java
[ { "context": "import java.util.ArrayList;\r\n\r\n/**\r\n *\r\n * @author Luke\r\n */\r\npublic class UserListModel implements Seria", "end": 305, "score": 0.9997196793556213, "start": 301, "tag": "NAME", "value": "Luke" }, { "context": "; i < 100; i++){\r\n String username...
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 pkg311taskmanager; import java.io.Serializable; import java.util.ArrayList; /** * * @author Luke */ public class UserListModel implements Serializable{ private ArrayList<UserModel> theListOfUsers; public UserListModel(){ if(theListOfUsers == null){ //buildTestUserList(); //SerializedDataCntl.getSerializedDataCntl().writeSerializedDataModel(); } } public void buildTestUserList(){ theListOfUsers = new ArrayList(); for (int i = 0; i < 100; i++){ String username = ("TestUser" + i); char[] password = {'<PASSWORD>'}; UserModel newUser = new UserModel(username, password); getTheListOfUsers().add(newUser); } System.out.println("made new losers"); } public boolean authenticate(String usernameToCheck, char[] passwordToCheck){ boolean authenticated = false; boolean nameMatch = false; boolean passwordMatch = false; for (int i = 0; i < getTheListOfUsers().size(); i++){ nameMatch = usernameToCheck.equals(getTheListOfUsers().get(i).getUsername()); passwordMatch = String.valueOf(passwordToCheck).equals(String.valueOf(getTheListOfUsers().get(i).getPassword())); if(nameMatch && passwordMatch){ authenticated = true; break; } } return authenticated; } /** * @return the theListOfUsers */ public ArrayList<UserModel> getTheListOfUsers() { if(theListOfUsers == null){ theListOfUsers = new ArrayList<UserModel>(); } return theListOfUsers; } }
1,970
0.583882
0.579828
62
29.82258
26.393135
125
false
false
0
0
0
0
0
0
0.548387
false
false
2
fa8b19bc102ad6c70fdc964f00284430be6a8e9f
27,264,452,417,315
a7a435979c43e0ff01a937c164d30b9ec2f272f6
/src/com/example/tumb1r/QuotePost.java
77b93dbb434e56824dfd63c999f2d25f24c5d96d
[]
no_license
WSDarwinExperiment/DiegoSerrano
https://github.com/WSDarwinExperiment/DiegoSerrano
c14e100477c54508a6bdb768a5152c76d5fb1232
a5d959d6560d8d02c624e280f32619cc4d4b8440
refs/heads/master
2021-01-19T09:28:10.431000
2015-01-09T00:03:21
2015-01-09T00:03:21
28,987,692
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.tumb1r; public class QuotePost extends Post { private String text; private String source; public QuotePost(long id, String type, long timestamp, String state, String tags, String text, String source) { super(id, type, timestamp, state, tags); this.text = text; this.source = source; } public String getTitle() { return text; } public void setTitle(String title) { this.text = title; } public String getUrl() { return source; } public void setUrl(String url) { this.source = url; } @Override public String toString() { return text + "(" + this.getType() + ")"; } public String getHeader() { return this.shortenString(text); } }
UTF-8
Java
694
java
QuotePost.java
Java
[]
null
[]
package com.example.tumb1r; public class QuotePost extends Post { private String text; private String source; public QuotePost(long id, String type, long timestamp, String state, String tags, String text, String source) { super(id, type, timestamp, state, tags); this.text = text; this.source = source; } public String getTitle() { return text; } public void setTitle(String title) { this.text = title; } public String getUrl() { return source; } public void setUrl(String url) { this.source = url; } @Override public String toString() { return text + "(" + this.getType() + ")"; } public String getHeader() { return this.shortenString(text); } }
694
0.678674
0.677233
38
17.263159
20.935596
112
false
false
0
0
0
0
0
0
1.578947
false
false
2
c0f1ff37e25943e911721d44713e2e193ac365da
26,285,199,912,116
07a96c4d0dd20e9f2d59c4ef4f8e02a8326e05db
/KBS_4_Gewinnt/src/com/dhbw/vier_gewinnt/gui/StoneRed.java
e41a340737dd0ed3e4c9a2599758f859011096ab
[]
no_license
zobitobi89/KBS_4_Gewinnt
https://github.com/zobitobi89/KBS_4_Gewinnt
021afaee09e75216abb430b8793f249ab9fd778f
348b94135e569db75f612a9dd35c2bef8167e035
refs/heads/master
2021-01-10T18:38:52.559000
2012-10-05T10:48:09
2012-10-05T10:48:09
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.dhbw.vier_gewinnt.gui; import javax.swing.ImageIcon; import javax.swing.JLabel; public class StoneRed extends JLabel { /** * */ private static final long serialVersionUID = 1L; public StoneRed() { this.setIcon(new ImageIcon(StoneRed.class .getResource("/resources/Stein_rot(45).png"))); this.setBounds(30, 600, 45, 45); } }
UTF-8
Java
358
java
StoneRed.java
Java
[]
null
[]
package com.dhbw.vier_gewinnt.gui; import javax.swing.ImageIcon; import javax.swing.JLabel; public class StoneRed extends JLabel { /** * */ private static final long serialVersionUID = 1L; public StoneRed() { this.setIcon(new ImageIcon(StoneRed.class .getResource("/resources/Stein_rot(45).png"))); this.setBounds(30, 600, 45, 45); } }
358
0.703911
0.670391
19
17.842106
18.536631
51
false
false
0
0
0
0
0
0
1.210526
false
false
2
d2bb4f848ff8fa9a88044c79d7fb3c76d63cd576
27,255,862,530,014
66effc962a9527af541b244b6a1742db791bf7b0
/src/vacuumworld/cleaner/VacuumCleanerImpl.java
d30978da5c536569bcc2b52500862b569ecac391
[]
no_license
viktorkuznietsov1986/ai
https://github.com/viktorkuznietsov1986/ai
42b520c74a546eb6649b086e450d00a30cc3da50
885c81110b8396f5c65fbf77088e1e81573ea601
refs/heads/master
2021-01-23T16:14:48.587000
2018-08-15T19:52:49
2018-08-15T19:52:49
93,289,031
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package vacuumworld.cleaner; import vacuumworld.exceptions.CantGoException; import vacuumworld.misc.Direction; import vacuumworld.misc.Position; import vacuumworld.world.VacuumWorld; /** * Created by Viktor on 6/5/17. */ public class VacuumCleanerImpl extends VacuumCleaner { public VacuumCleanerImpl(VacuumWorld world, Position position) { super(world, position); } @Override public void suck() { System.out.println("action: suck."); world.cleanSector(position); } @Override public void go(Direction direction) throws CantGoException { super.go(direction); System.out.println("action: go " + direction); } @Override public void idle() { System.out.println("action: idle."); } }
UTF-8
Java
780
java
VacuumCleanerImpl.java
Java
[ { "context": " vacuumworld.world.VacuumWorld;\n\n/**\n * Created by Viktor on 6/5/17.\n */\npublic class VacuumCleanerImpl ext", "end": 209, "score": 0.9981271624565125, "start": 203, "tag": "NAME", "value": "Viktor" } ]
null
[]
package vacuumworld.cleaner; import vacuumworld.exceptions.CantGoException; import vacuumworld.misc.Direction; import vacuumworld.misc.Position; import vacuumworld.world.VacuumWorld; /** * Created by Viktor on 6/5/17. */ public class VacuumCleanerImpl extends VacuumCleaner { public VacuumCleanerImpl(VacuumWorld world, Position position) { super(world, position); } @Override public void suck() { System.out.println("action: suck."); world.cleanSector(position); } @Override public void go(Direction direction) throws CantGoException { super.go(direction); System.out.println("action: go " + direction); } @Override public void idle() { System.out.println("action: idle."); } }
780
0.678205
0.673077
34
21.941177
20.543985
68
false
false
0
0
0
0
0
0
0.382353
false
false
2
a4aa3f29970e4436e1f16a87534492c972530d91
23,570,780,590,004
6fb152580375fe87d40f90ce3d8130c50cd1a672
/hybridcache/src/main/java/tech/easily/hybridcache/lib/utils/PackageInfoHelper.java
d141d165437259fc7f776f7960d9f5655d498feb
[ "MIT" ]
permissive
libern/HybridCache
https://github.com/libern/HybridCache
0835ae2aa19dbf37f35d84599dcd4761688cc1a4
88cb94d25b970d6fce9abfb3f432f3fd19662cc3
refs/heads/master
2020-03-23T01:22:59.674000
2018-07-14T15:07:07
2018-07-14T15:07:07
140,914,125
0
0
MIT
true
2018-07-14T03:53:41
2018-07-14T03:53:41
2018-07-12T06:49:33
2018-04-05T04:37:09
401
0
0
0
null
false
null
package tech.easily.hybridcache.lib.utils; import android.content.Context; import android.content.pm.PackageInfo; import android.support.annotation.NonNull; /** * Created by lemon on 06/01/2018. */ public class PackageInfoHelper { public static int getAppVersionCode(@NonNull Context context) { String packageName = context.getPackageName(); try { PackageInfo packageInfo = context.getPackageManager().getPackageInfo(packageName, 0); return packageInfo.versionCode; } catch (Exception e) { return 0; } } }
UTF-8
Java
588
java
PackageInfoHelper.java
Java
[ { "context": "oid.support.annotation.NonNull;\n\n/**\n * Created by lemon on 06/01/2018.\n */\n\npublic class PackageInfoHelpe", "end": 182, "score": 0.9995176792144775, "start": 177, "tag": "USERNAME", "value": "lemon" } ]
null
[]
package tech.easily.hybridcache.lib.utils; import android.content.Context; import android.content.pm.PackageInfo; import android.support.annotation.NonNull; /** * Created by lemon on 06/01/2018. */ public class PackageInfoHelper { public static int getAppVersionCode(@NonNull Context context) { String packageName = context.getPackageName(); try { PackageInfo packageInfo = context.getPackageManager().getPackageInfo(packageName, 0); return packageInfo.versionCode; } catch (Exception e) { return 0; } } }
588
0.681973
0.664966
22
25.727272
25.145363
97
false
false
0
0
0
0
0
0
0.409091
false
false
2
00eaa0992ed96802b4ff243ff1feb511b84d9bee
33,578,054,345,190
b4493419485490a99785ffb5ded9e0806a533426
/archive/rhs/cap/src/com/arsdigita/persistence/DedicatedConnectionSource.java
7f395b8821aeffb3627e3352cb9fef55386e25f7
[]
no_license
BackupTheBerlios/myrian-svn
https://github.com/BackupTheBerlios/myrian-svn
11b6704a34689251c835cc1d6b21295c4312e2e5
65c1acb69e37f146bfece618b8812b0760bdcae5
refs/heads/master
2021-01-01T06:44:46.948000
2004-10-19T20:03:43
2004-10-19T20:03:43
40,823,082
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. * * The contents of this file are subject to the CCM Public * License (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.redhat.com/licenses/ccmpl.html. * * Software distributed under the License is distributed on an * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express * or implied. See the License for the specific language * governing rights and limitations under the License. * */ package com.arsdigita.persistence; import com.arsdigita.util.jdbc.*; import java.sql.*; /** * DedicatedConnectionSource * * @author Rafael H. Schloming &lt;rhs@mit.edu&gt; * @version $Revision: #1 $ $Date: 2004/05/03 $ **/ public class DedicatedConnectionSource implements ConnectionSource { public final static String versionId = "$Id: //users/rhs/persistence/cap/src/com/arsdigita/persistence/DedicatedConnectionSource.java#1 $ by $Author: rhs $, $DateTime: 2004/05/03 11:00:53 $"; private String m_url; private ThreadLocal m_connections = new ThreadLocal() { public Object initialValue() { return Connections.acquire(m_url); } }; public DedicatedConnectionSource(String url) { m_url = url; } public Connection acquire() { return (Connection) m_connections.get(); } public void release(Connection conn) { // do nothing } }
UTF-8
Java
1,487
java
DedicatedConnectionSource.java
Java
[ { "context": "*;\n\n/**\n * DedicatedConnectionSource\n *\n * @author Rafael H. Schloming &lt;rhs@mit.edu&gt;\n * @version $Revision: #1 $ $", "end": 712, "score": 0.9998776912689209, "start": 693, "tag": "NAME", "value": "Rafael H. Schloming" }, { "context": "ctionSource\n *\n * @au...
null
[]
/* * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. * * The contents of this file are subject to the CCM Public * License (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.redhat.com/licenses/ccmpl.html. * * Software distributed under the License is distributed on an * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express * or implied. See the License for the specific language * governing rights and limitations under the License. * */ package com.arsdigita.persistence; import com.arsdigita.util.jdbc.*; import java.sql.*; /** * DedicatedConnectionSource * * @author <NAME> &lt;<EMAIL>&gt; * @version $Revision: #1 $ $Date: 2004/05/03 $ **/ public class DedicatedConnectionSource implements ConnectionSource { public final static String versionId = "$Id: //users/rhs/persistence/cap/src/com/arsdigita/persistence/DedicatedConnectionSource.java#1 $ by $Author: rhs $, $DateTime: 2004/05/03 11:00:53 $"; private String m_url; private ThreadLocal m_connections = new ThreadLocal() { public Object initialValue() { return Connections.acquire(m_url); } }; public DedicatedConnectionSource(String url) { m_url = url; } public Connection acquire() { return (Connection) m_connections.get(); } public void release(Connection conn) { // do nothing } }
1,470
0.689307
0.667787
50
28.74
33.832417
195
false
false
0
0
0
0
83
0.055817
0.3
false
false
2
9fb6582fc85736307c8eaac6a0682c415cdb5b12
13,151,189,928,076
d7703769f52a27b13ff1dc83e673f0619f4afbb2
/show-restaurant/src/main/java/com/szhengzhu/controller/CategoryController.java
ecad385213b151d4429fe025a399d3e7b94732ac
[]
no_license
zengjianhong/show-root
https://github.com/zengjianhong/show-root
1ff346c936971b3bbfa20edec75c452b285d1903
5a9db5f90ff7a60cd59fed7e4fe40fa242c1e5e8
refs/heads/master
2022-02-14T17:57:45.806000
2022-01-16T11:54:50
2022-01-16T11:54:50
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.szhengzhu.controller; import cn.hutool.core.util.ObjectUtil; import com.szhengzhu.feign.ShowOrderingClient; import com.szhengzhu.bean.ordering.Category; import com.szhengzhu.bean.ordering.CategoryCommodity; import com.szhengzhu.bean.ordering.CategorySpecs; import com.szhengzhu.bean.ordering.vo.CategoryVo; import com.szhengzhu.bean.vo.Combobox; import com.szhengzhu.bean.xwechat.vo.CategoryModel; import com.szhengzhu.core.Contacts; import com.szhengzhu.core.PageGrid; import com.szhengzhu.core.PageParam; import com.szhengzhu.core.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import java.util.List; /** * @author Administrator */ @Validated @Api(tags = "分类:CategoryController") @RestController @RequestMapping("/v1/category") public class CategoryController { @Resource private ShowOrderingClient showOrderingClient; @ApiOperation(value = "获取分类分页列表") @PostMapping(value = "/page") public Result<PageGrid<CategoryVo>> page(HttpServletRequest req, @RequestBody PageParam<Category> pageParam) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); Category param = ObjectUtil.isNull(pageParam.getData()) ? new Category() : pageParam.getData(); param.setStoreId(storeId); pageParam.setData(param); return showOrderingClient.pageCate(pageParam); } @ApiOperation(value = "添加分类信息") @PostMapping(value = "") public Result add(HttpServletRequest req, @RequestBody @Validated Category category) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); category.setStoreId(storeId); return showOrderingClient.addCate(category); } @ApiOperation(value = "修改分类信息") @PatchMapping(value = "") public Result modify(@RequestBody @Validated Category category) { return showOrderingClient.modifyCate(category); } @ApiOperation(value = "批量修改分类状态") @PatchMapping(value = "/batch/status/{status}") public Result modifyStatus(@RequestBody @NotEmpty String[] cateIds, @PathVariable("status") @Min(-1) @Max(1) Integer status) { return showOrderingClient.modifyCateStatus(cateIds, status); } @ApiOperation(value = "批量删除分类信息") @DeleteMapping(value = "/batch") public Result deleteItem(@RequestBody @NotEmpty String[] cateIds) { return showOrderingClient.modifyCateStatus(cateIds, -1); } @ApiOperation(value = "点餐时获取分类及分类商品列表", notes = "点餐时获取商品分类及列表") @GetMapping(value = "/res/list") public Result<List<CategoryModel>> listResCate(HttpServletRequest req) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); return showOrderingClient.listResCate(storeId); } @ApiOperation(value = "获取分类键值对列表") @GetMapping(value = "/combobox") public Result<List<Combobox>> getCombobox(HttpServletRequest req) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); return showOrderingClient.getCateCombobox(storeId); } @ApiOperation(value = "批量添加或删除分类规格关联关系", notes = "specsIds为空时,即为删除") @PostMapping(value = "/specs/batch/opt/{cateId}") public Result optCateSpecs(@RequestBody String[] specsIds, @PathVariable("cateId") @NotBlank String cateId) { return showOrderingClient.optCateSpecs(specsIds, cateId); } @ApiOperation(value = "修改分类规格关联关系") @PatchMapping(value = "/specs") public Result modifyCateSpecs(@RequestBody @Validated CategorySpecs categorySpecs) { return showOrderingClient.modifyCateSpecs(categorySpecs); } @ApiOperation(value = "批量添加分类商品") @PostMapping(value = "/commodity/batch/opt/{cateId}") public Result optCateCommodity(@RequestBody String[] commodityIds, @PathVariable("cateId") @NotBlank String cateId) { return showOrderingClient.optCateCommodity(commodityIds, cateId); } @ApiOperation(value = "修改分类关联关系") @PatchMapping(value = "/commodity") public Result<Object> modifyCateCommodity(@RequestBody @Validated CategoryCommodity categoryCommodity) { return showOrderingClient.modifyCateCommodity(categoryCommodity); } }
UTF-8
Java
4,837
java
CategoryController.java
Java
[ { "context": "s.NotEmpty;\nimport java.util.List;\n\n/**\n * @author Administrator\n */\n@Validated\n@Api(tags = \"分类:CategoryController", "end": 1050, "score": 0.9563504457473755, "start": 1037, "tag": "NAME", "value": "Administrator" } ]
null
[]
package com.szhengzhu.controller; import cn.hutool.core.util.ObjectUtil; import com.szhengzhu.feign.ShowOrderingClient; import com.szhengzhu.bean.ordering.Category; import com.szhengzhu.bean.ordering.CategoryCommodity; import com.szhengzhu.bean.ordering.CategorySpecs; import com.szhengzhu.bean.ordering.vo.CategoryVo; import com.szhengzhu.bean.vo.Combobox; import com.szhengzhu.bean.xwechat.vo.CategoryModel; import com.szhengzhu.core.Contacts; import com.szhengzhu.core.PageGrid; import com.szhengzhu.core.PageParam; import com.szhengzhu.core.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import java.util.List; /** * @author Administrator */ @Validated @Api(tags = "分类:CategoryController") @RestController @RequestMapping("/v1/category") public class CategoryController { @Resource private ShowOrderingClient showOrderingClient; @ApiOperation(value = "获取分类分页列表") @PostMapping(value = "/page") public Result<PageGrid<CategoryVo>> page(HttpServletRequest req, @RequestBody PageParam<Category> pageParam) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); Category param = ObjectUtil.isNull(pageParam.getData()) ? new Category() : pageParam.getData(); param.setStoreId(storeId); pageParam.setData(param); return showOrderingClient.pageCate(pageParam); } @ApiOperation(value = "添加分类信息") @PostMapping(value = "") public Result add(HttpServletRequest req, @RequestBody @Validated Category category) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); category.setStoreId(storeId); return showOrderingClient.addCate(category); } @ApiOperation(value = "修改分类信息") @PatchMapping(value = "") public Result modify(@RequestBody @Validated Category category) { return showOrderingClient.modifyCate(category); } @ApiOperation(value = "批量修改分类状态") @PatchMapping(value = "/batch/status/{status}") public Result modifyStatus(@RequestBody @NotEmpty String[] cateIds, @PathVariable("status") @Min(-1) @Max(1) Integer status) { return showOrderingClient.modifyCateStatus(cateIds, status); } @ApiOperation(value = "批量删除分类信息") @DeleteMapping(value = "/batch") public Result deleteItem(@RequestBody @NotEmpty String[] cateIds) { return showOrderingClient.modifyCateStatus(cateIds, -1); } @ApiOperation(value = "点餐时获取分类及分类商品列表", notes = "点餐时获取商品分类及列表") @GetMapping(value = "/res/list") public Result<List<CategoryModel>> listResCate(HttpServletRequest req) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); return showOrderingClient.listResCate(storeId); } @ApiOperation(value = "获取分类键值对列表") @GetMapping(value = "/combobox") public Result<List<Combobox>> getCombobox(HttpServletRequest req) { String storeId = (String) req.getSession().getAttribute(Contacts.RESTAURANT_STORE); return showOrderingClient.getCateCombobox(storeId); } @ApiOperation(value = "批量添加或删除分类规格关联关系", notes = "specsIds为空时,即为删除") @PostMapping(value = "/specs/batch/opt/{cateId}") public Result optCateSpecs(@RequestBody String[] specsIds, @PathVariable("cateId") @NotBlank String cateId) { return showOrderingClient.optCateSpecs(specsIds, cateId); } @ApiOperation(value = "修改分类规格关联关系") @PatchMapping(value = "/specs") public Result modifyCateSpecs(@RequestBody @Validated CategorySpecs categorySpecs) { return showOrderingClient.modifyCateSpecs(categorySpecs); } @ApiOperation(value = "批量添加分类商品") @PostMapping(value = "/commodity/batch/opt/{cateId}") public Result optCateCommodity(@RequestBody String[] commodityIds, @PathVariable("cateId") @NotBlank String cateId) { return showOrderingClient.optCateCommodity(commodityIds, cateId); } @ApiOperation(value = "修改分类关联关系") @PatchMapping(value = "/commodity") public Result<Object> modifyCateCommodity(@RequestBody @Validated CategoryCommodity categoryCommodity) { return showOrderingClient.modifyCateCommodity(categoryCommodity); } }
4,837
0.742322
0.741451
113
39.628319
30.95306
130
false
false
0
0
0
0
0
0
0.486726
false
false
2
3d6942d2279a4ffc7a2005781555c6b4afacfe6d
38,783,554,691,488
9b02e1a977d4e2ae30c7b9de63aaf5536375c272
/src/Jugador.java
85c74ab4f3a840f4315f00a1a2480de30f6c62da
[ "Apache-2.0" ]
permissive
kiezmi/Juego_cartas
https://github.com/kiezmi/Juego_cartas
d977d6a6b6482c83fb961eeb29fa6160f6f94ba9
b5b6aee085eece1ac37252a911e27fc0ebe008e1
refs/heads/master
2021-01-10T08:23:21.442000
2016-03-03T11:35:22
2016-03-03T11:35:22
51,638,819
3
1
null
false
2016-03-03T11:23:30
2016-02-13T08:50:20
2016-02-21T00:09:08
2016-03-03T11:23:30
7
2
1
0
Java
null
null
public class Jugador { String nombre; int vidas; int mazo; public Jugador(String nombre, int vidas, int mazo) { this.nombre = nombre; this.vidas = vidas; this.mazo = mazo; } }
UTF-8
Java
208
java
Jugador.java
Java
[]
null
[]
public class Jugador { String nombre; int vidas; int mazo; public Jugador(String nombre, int vidas, int mazo) { this.nombre = nombre; this.vidas = vidas; this.mazo = mazo; } }
208
0.610577
0.610577
14
13.785714
14.006012
54
false
false
0
0
0
0
0
0
2.5
false
false
2
5b5d01cd90dcd64a51a6e7091a022b8c043bc12c
35,940,286,365,472
8d9e51ffc801ec034284ce24aee9eb8509d8e806
/java/com/fiskmods/heroes/common/item/ItemGameboii.java
16de1c0fa8cf4d910faecd280e924f282502b73f
[]
no_license
ImranDoet/FiskHeroes
https://github.com/ImranDoet/FiskHeroes
7c1777ee745e5e2f7d2441b6aa41f26e4b46b79b
00cbfad51c6fde0663cc8df3ea1754a7c9c411f7
refs/heads/main
2023-01-10T11:27:43.772000
2020-10-20T17:45:34
2020-10-20T17:45:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.fiskmods.heroes.common.item; import java.util.List; import com.fiskmods.heroes.FiskHeroes; import com.fiskmods.heroes.gameboii.GameboiiCartridge; import com.fiskmods.heroes.gameboii.GameboiiColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants.NBT; public class ItemGameboii extends ItemUntextured { private static final String TAG_CARTRIDGE = "Cartridge"; public ItemGameboii() { setMaxStackSize(1); setHasSubtypes(true); } @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advanced) { // list.add(StatCollector.translateToLocalFormatted("item.gameboii.desc1")); // list.add(StatCollector.translateToLocalFormatted("item.gameboii.desc2")); GameboiiCartridge cartridge = get(itemstack); if (cartridge != null) { list.add(StatCollector.translateToLocalFormatted("gameboii.cartridge." + cartridge.id)); } } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { GameboiiCartridge cartridge = get(itemstack); if (cartridge != null) { player.openGui(FiskHeroes.MODID, 5, world, cartridge.ordinal(), 0, 0); } else if (!world.isRemote) { player.addChatMessage(new ChatComponentTranslation("message.gameboii.noCartridge").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); } return itemstack; } @Override public void getSubItems(Item item, CreativeTabs tab, List list) { for (GameboiiColor color : GameboiiColor.values()) { list.add(new ItemStack(item, 1, color.ordinal())); } } @Override public ItemStack getContainerItem(ItemStack stack) { GameboiiCartridge cartridge = get(stack); if (cartridge != null) { return cartridge.create(); } return null; } @Override public boolean hasContainerItem(ItemStack stack) { return get(stack) != null; } public static GameboiiCartridge get(ItemStack stack) { return stack.hasTagCompound() && stack.getTagCompound().hasKey(TAG_CARTRIDGE, NBT.TAG_ANY_NUMERIC) ? GameboiiCartridge.get(stack.getTagCompound().getByte(TAG_CARTRIDGE)) : null; } public static ItemStack set(ItemStack stack, GameboiiCartridge cartridge) { if (!stack.hasTagCompound()) { if (cartridge == null) { return stack; } stack.setTagCompound(new NBTTagCompound()); } if (cartridge != null) { stack.getTagCompound().setByte(TAG_CARTRIDGE, (byte) cartridge.ordinal()); } else { stack.getTagCompound().removeTag(TAG_CARTRIDGE); } return stack; } }
UTF-8
Java
3,355
java
ItemGameboii.java
Java
[]
null
[]
package com.fiskmods.heroes.common.item; import java.util.List; import com.fiskmods.heroes.FiskHeroes; import com.fiskmods.heroes.gameboii.GameboiiCartridge; import com.fiskmods.heroes.gameboii.GameboiiColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants.NBT; public class ItemGameboii extends ItemUntextured { private static final String TAG_CARTRIDGE = "Cartridge"; public ItemGameboii() { setMaxStackSize(1); setHasSubtypes(true); } @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advanced) { // list.add(StatCollector.translateToLocalFormatted("item.gameboii.desc1")); // list.add(StatCollector.translateToLocalFormatted("item.gameboii.desc2")); GameboiiCartridge cartridge = get(itemstack); if (cartridge != null) { list.add(StatCollector.translateToLocalFormatted("gameboii.cartridge." + cartridge.id)); } } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { GameboiiCartridge cartridge = get(itemstack); if (cartridge != null) { player.openGui(FiskHeroes.MODID, 5, world, cartridge.ordinal(), 0, 0); } else if (!world.isRemote) { player.addChatMessage(new ChatComponentTranslation("message.gameboii.noCartridge").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); } return itemstack; } @Override public void getSubItems(Item item, CreativeTabs tab, List list) { for (GameboiiColor color : GameboiiColor.values()) { list.add(new ItemStack(item, 1, color.ordinal())); } } @Override public ItemStack getContainerItem(ItemStack stack) { GameboiiCartridge cartridge = get(stack); if (cartridge != null) { return cartridge.create(); } return null; } @Override public boolean hasContainerItem(ItemStack stack) { return get(stack) != null; } public static GameboiiCartridge get(ItemStack stack) { return stack.hasTagCompound() && stack.getTagCompound().hasKey(TAG_CARTRIDGE, NBT.TAG_ANY_NUMERIC) ? GameboiiCartridge.get(stack.getTagCompound().getByte(TAG_CARTRIDGE)) : null; } public static ItemStack set(ItemStack stack, GameboiiCartridge cartridge) { if (!stack.hasTagCompound()) { if (cartridge == null) { return stack; } stack.setTagCompound(new NBTTagCompound()); } if (cartridge != null) { stack.getTagCompound().setByte(TAG_CARTRIDGE, (byte) cartridge.ordinal()); } else { stack.getTagCompound().removeTag(TAG_CARTRIDGE); } return stack; } }
3,355
0.658122
0.656036
118
27.432203
31.890299
185
false
false
0
0
0
0
0
0
0.466102
false
false
2
4f307de580b04ffaecbab96539ff2d393b47aed0
38,465,727,113,082
761307af729340e0c4446d2efbb3a5101b68075e
/app/src/main/java/com/example/adivinha/Disciplina.java
279a9c0a244c435a290515bbd56af83a76037227
[]
no_license
andilegal/project-app-nota
https://github.com/andilegal/project-app-nota
55cd6fafcb628060616fba8521e8c54ef588efaf
c3638401c569f6e60622411c887f3f6fe7df1a4a
refs/heads/master
2022-06-11T12:21:10.150000
2020-05-08T22:42:24
2020-05-08T22:42:24
262,442,957
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.adivinha; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; public class Disciplina extends AppCompatActivity { private EditText disciplina; private ListView listaDisciplinas; private Button btnGravar; private Button btnVoltar; private Button btnAvancar; private ArrayList lista; private TextView preenchaCampos; ArrayAdapter<String> arrayAdapter; public Disciplina() { } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_disciplina); btnGravar = (Button) findViewById(R.id.idBtnGravar); btnVoltar = (Button) findViewById(R.id.idBtnVoltar); btnAvancar = (Button) findViewById(R.id.idBtnAvancar); disciplina = (EditText) findViewById(R.id.idDisciplina); listaDisciplinas = (ListView) findViewById(R.id.idListaDisciplinas); preenchaCampos = (TextView) findViewById(R.id.idPreenchaCampos); lista = new ArrayList<String>(); arrayAdapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, lista); btnGravar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String disciplinaValor = disciplina.getText().toString(); if(disciplinaValor != null && !disciplinaValor.equals("")){ lista.add(disciplinaValor); listaDisciplinas.setAdapter(arrayAdapter); arrayAdapter.notifyDataSetChanged(); } } }); btnVoltar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onVoltar(); } }); btnAvancar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!lista.isEmpty()) { onAvancar(); }else{ preenchaCampos.setText("*Coloque as disciplinas do seu curso"); } } }); } public void onAvancar(){ Intent intent = new Intent(this, Aprovado.class); startActivity(intent); } public void onVoltar(){ Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } }
UTF-8
Java
2,729
java
Disciplina.java
Java
[]
null
[]
package com.example.adivinha; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; public class Disciplina extends AppCompatActivity { private EditText disciplina; private ListView listaDisciplinas; private Button btnGravar; private Button btnVoltar; private Button btnAvancar; private ArrayList lista; private TextView preenchaCampos; ArrayAdapter<String> arrayAdapter; public Disciplina() { } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_disciplina); btnGravar = (Button) findViewById(R.id.idBtnGravar); btnVoltar = (Button) findViewById(R.id.idBtnVoltar); btnAvancar = (Button) findViewById(R.id.idBtnAvancar); disciplina = (EditText) findViewById(R.id.idDisciplina); listaDisciplinas = (ListView) findViewById(R.id.idListaDisciplinas); preenchaCampos = (TextView) findViewById(R.id.idPreenchaCampos); lista = new ArrayList<String>(); arrayAdapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, lista); btnGravar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String disciplinaValor = disciplina.getText().toString(); if(disciplinaValor != null && !disciplinaValor.equals("")){ lista.add(disciplinaValor); listaDisciplinas.setAdapter(arrayAdapter); arrayAdapter.notifyDataSetChanged(); } } }); btnVoltar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onVoltar(); } }); btnAvancar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!lista.isEmpty()) { onAvancar(); }else{ preenchaCampos.setText("*Coloque as disciplinas do seu curso"); } } }); } public void onAvancar(){ Intent intent = new Intent(this, Aprovado.class); startActivity(intent); } public void onVoltar(){ Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } }
2,729
0.638695
0.638329
85
31.105883
24.567326
118
false
false
0
0
0
0
0
0
0.552941
false
false
2
4fe2c74c04ec698920aac4c0d0343fbf93f0ee44
38,474,317,051,927
e3519bdfa65ddc0655d3eaf0e48aef41e8c9fd3c
/src/ForkJoinPool/ForkJoinPoolAction.java
55e544b517b3703feeb0215d211873adb43dd274
[]
no_license
wodongx123/ThreadPoolDemo
https://github.com/wodongx123/ThreadPoolDemo
a1fc347032674e8b094e2633b52fe8716780acee
6fe59d52099cd36c1ba014d9f06668dc6d36e618
refs/heads/master
2020-08-14T22:22:18.204000
2019-10-15T08:15:22
2019-10-15T08:15:22
215,240,457
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ForkJoinPool; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.RecursiveAction; @SuppressWarnings("serial") public class ForkJoinPoolAction extends RecursiveAction{ //最长的计算长度为10 private static final int MAX_LENGTH = 10; private int start; private int end; public ForkJoinPoolAction(int start, int end) { this.start = start; this.end = end; } @Override protected void compute() { System.out.println(Thread.currentThread().getName() + " start:" + start + " end:" + end); //当本线程的长度大于10的时候,再拆成两个子任务 if (end - start > MAX_LENGTH) { int mid = (end + start) / 2; ForkJoinPoolAction leftTask = new ForkJoinPoolAction(start, mid); ForkJoinPoolAction rightTask = new ForkJoinPoolAction(mid, end); //生成子任务 leftTask.fork(); rightTask.fork(); }else { for (int i = start; i < end; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } } public static void main(String[] args) throws Exception{ //创建一个通用池 ForkJoinPool pool = ForkJoinPool.commonPool(); pool.submit(new ForkJoinPoolAction(0, 100)); System.out.println(pool); //因为是后台线程,所以要卡住主线程。 System.in.read(); pool.shutdown(); } }
UTF-8
Java
1,336
java
ForkJoinPoolAction.java
Java
[]
null
[]
package ForkJoinPool; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.RecursiveAction; @SuppressWarnings("serial") public class ForkJoinPoolAction extends RecursiveAction{ //最长的计算长度为10 private static final int MAX_LENGTH = 10; private int start; private int end; public ForkJoinPoolAction(int start, int end) { this.start = start; this.end = end; } @Override protected void compute() { System.out.println(Thread.currentThread().getName() + " start:" + start + " end:" + end); //当本线程的长度大于10的时候,再拆成两个子任务 if (end - start > MAX_LENGTH) { int mid = (end + start) / 2; ForkJoinPoolAction leftTask = new ForkJoinPoolAction(start, mid); ForkJoinPoolAction rightTask = new ForkJoinPoolAction(mid, end); //生成子任务 leftTask.fork(); rightTask.fork(); }else { for (int i = start; i < end; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } } public static void main(String[] args) throws Exception{ //创建一个通用池 ForkJoinPool pool = ForkJoinPool.commonPool(); pool.submit(new ForkJoinPoolAction(0, 100)); System.out.println(pool); //因为是后台线程,所以要卡住主线程。 System.in.read(); pool.shutdown(); } }
1,336
0.678689
0.669672
55
21.181818
22.216366
94
false
false
0
0
0
0
0
0
2
false
false
2
4abc9aaf10112dd613ebfa577d28d7568ba5d99a
38,869,454,060,677
e41d380dcbd66ae386358a8bc873e0d523e0bd36
/src/main/java/com/iamgpj/begin/module/admin/auth/param/DeptParam.java
ab95e5a4d0940bb2cd2962b4434fe3e1f9c628c3
[]
no_license
heibais/begin
https://github.com/heibais/begin
b9930e236b7adfdfd6c7aac6017c2ff5b3cd83f6
0e04aeabc13c90168019cdf86fe4a81e22daa07b
refs/heads/master
2020-03-19T18:47:32.210000
2018-07-16T15:56:06
2018-07-16T15:56:06
119,272,368
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.iamgpj.begin.module.admin.auth.param; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; /** * @author: gpj * @Description: 部门参数 * @Date: Created in 17:51 2018/1/28 * @Modified By: */ @Data public class DeptParam { @ApiModelProperty(value = "部门id") private Integer id; @ApiModelProperty(value = "上级部门id", required = true) @NotNull(message = "部门上级栏目不能为空") private Integer pid; @ApiModelProperty(value = "部门名称", required = true) @NotEmpty(message = "部门名称不能为空") @Length(min = 2, max = 16, message = "部门名称应在2-16个字符直间") private String name; @ApiModelProperty(value = "排序", required = true) @NotNull(message = "排序不能为空") private Integer sort; @ApiModelProperty(value = "状态", required = true) @NotNull(message = "状态不能为空") private Integer status; }
UTF-8
Java
1,102
java
DeptParam.java
Java
[ { "context": "x.validation.constraints.NotNull;\n\n/**\n * @author: gpj\n * @Description: 部门参数\n * @Date: Created in 17:51 ", "end": 282, "score": 0.9996532201766968, "start": 279, "tag": "USERNAME", "value": "gpj" } ]
null
[]
package com.iamgpj.begin.module.admin.auth.param; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; /** * @author: gpj * @Description: 部门参数 * @Date: Created in 17:51 2018/1/28 * @Modified By: */ @Data public class DeptParam { @ApiModelProperty(value = "部门id") private Integer id; @ApiModelProperty(value = "上级部门id", required = true) @NotNull(message = "部门上级栏目不能为空") private Integer pid; @ApiModelProperty(value = "部门名称", required = true) @NotEmpty(message = "部门名称不能为空") @Length(min = 2, max = 16, message = "部门名称应在2-16个字符直间") private String name; @ApiModelProperty(value = "排序", required = true) @NotNull(message = "排序不能为空") private Integer sort; @ApiModelProperty(value = "状态", required = true) @NotNull(message = "状态不能为空") private Integer status; }
1,102
0.697154
0.679878
38
24.894737
19.623817
59
false
false
0
0
0
0
0
0
0.447368
false
false
2
bee28f47b98b6e691a5f4c8fbff29479208eb6fe
12,120,397,774,656
677285990f53b30061f84016c77a4d3008be9ae3
/InventaryDataManagement/src/com/bridgelabz/inventarymanagement/InventaryDataManagementService.java
81796838e680aa006d7fbe56f204f99dc20e851e
[]
no_license
SanketTambe39/InventaryDataManagement
https://github.com/SanketTambe39/InventaryDataManagement
39a613c4c40f9de9c874692e6f312e4eb84cb086
99d3089cd72252154dadcd659aa9489b47785ab0
refs/heads/master
2023-06-11T02:03:48.390000
2021-07-05T17:23:38
2021-07-05T17:23:38
383,204,005
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bridgelabz.inventarymanagement; public interface InventaryDataManagementService { public void addItem(ItemsDetails item); public void getDetails(); public void getDetailsByName(String itemName); public void calculateValueOfEachItem(); public void getTotalValue(); public void updateValue(ItemsDetails updateItem); public void deleteValue(String deleteItem); }
UTF-8
Java
391
java
InventaryDataManagementService.java
Java
[]
null
[]
package com.bridgelabz.inventarymanagement; public interface InventaryDataManagementService { public void addItem(ItemsDetails item); public void getDetails(); public void getDetailsByName(String itemName); public void calculateValueOfEachItem(); public void getTotalValue(); public void updateValue(ItemsDetails updateItem); public void deleteValue(String deleteItem); }
391
0.803069
0.803069
12
31.583334
19.098248
51
false
false
0
0
0
0
0
0
1.916667
false
false
2
8feb9cb00d48b2db4f5fed17ffc52ac73b139b32
35,596,688,982,729
90801a03b145b2c1bf1d1bf930b1769d9543151c
/src/main/java/com/sbmybatis/wbapps/entity/RecommendedBooklist.java
174545bfa78ddf394d00daa0eb6b41cd8c4b8edb
[]
no_license
tangmingze7280/LIBRARY-API
https://github.com/tangmingze7280/LIBRARY-API
b2728756d6533836dde7a35c728a06bbee89f996
9af73e9094af9cf217c32719e6893fe948e468ac
refs/heads/master
2022-06-24T03:36:04.068000
2019-05-29T02:46:53
2019-05-29T02:46:53
177,517,698
1
0
null
false
2022-06-21T01:00:40
2019-03-25T05:04:57
2020-12-09T02:01:54
2022-06-21T01:00:39
862
1
0
4
Java
false
false
package com.sbmybatis.wbapps.entity; import javax.persistence.*; import java.sql.Timestamp; import java.util.Objects; @Entity @Table(name = "recommended_booklist", schema = "baselibrary", catalog = "") public class RecommendedBooklist { private int id; private int wechatUserId; private int booklistId; private Timestamp createdAt; private Timestamp updatedAt; @Id @Column(name = "id") public int getId() { return id; } public void setId(int id) { this.id = id; } @Basic @Column(name = "wechat_user_id") public int getWechatUserId() { return wechatUserId; } public void setWechatUserId(int wechatUserId) { this.wechatUserId = wechatUserId; } @Basic @Column(name = "booklist_id") public int getBooklistId() { return booklistId; } public void setBooklistId(int booklistId) { this.booklistId = booklistId; } @Basic @Column(name = "created_at") public Timestamp getCreatedAt() { return createdAt; } public void setCreatedAt(Timestamp createdAt) { this.createdAt = createdAt; } @Basic @Column(name = "updated_at") public Timestamp getUpdatedAt() { return updatedAt; } public void setUpdatedAt(Timestamp updatedAt) { this.updatedAt = updatedAt; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RecommendedBooklist that = (RecommendedBooklist) o; return id == that.id && wechatUserId == that.wechatUserId && booklistId == that.booklistId && Objects.equals(createdAt, that.createdAt) && Objects.equals(updatedAt, that.updatedAt); } @Override public int hashCode() { return Objects.hash(id, wechatUserId, booklistId, createdAt, updatedAt); } }
UTF-8
Java
1,981
java
RecommendedBooklist.java
Java
[]
null
[]
package com.sbmybatis.wbapps.entity; import javax.persistence.*; import java.sql.Timestamp; import java.util.Objects; @Entity @Table(name = "recommended_booklist", schema = "baselibrary", catalog = "") public class RecommendedBooklist { private int id; private int wechatUserId; private int booklistId; private Timestamp createdAt; private Timestamp updatedAt; @Id @Column(name = "id") public int getId() { return id; } public void setId(int id) { this.id = id; } @Basic @Column(name = "wechat_user_id") public int getWechatUserId() { return wechatUserId; } public void setWechatUserId(int wechatUserId) { this.wechatUserId = wechatUserId; } @Basic @Column(name = "booklist_id") public int getBooklistId() { return booklistId; } public void setBooklistId(int booklistId) { this.booklistId = booklistId; } @Basic @Column(name = "created_at") public Timestamp getCreatedAt() { return createdAt; } public void setCreatedAt(Timestamp createdAt) { this.createdAt = createdAt; } @Basic @Column(name = "updated_at") public Timestamp getUpdatedAt() { return updatedAt; } public void setUpdatedAt(Timestamp updatedAt) { this.updatedAt = updatedAt; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RecommendedBooklist that = (RecommendedBooklist) o; return id == that.id && wechatUserId == that.wechatUserId && booklistId == that.booklistId && Objects.equals(createdAt, that.createdAt) && Objects.equals(updatedAt, that.updatedAt); } @Override public int hashCode() { return Objects.hash(id, wechatUserId, booklistId, createdAt, updatedAt); } }
1,981
0.614336
0.614336
82
23.158537
19.812824
80
false
false
0
0
0
0
0
0
0.414634
false
false
2
d54a9d196c095638184073a2e59395d71b5f714a
39,384,850,122,647
30597c3ec211b912d3c5a1fdd28cd6092d0dbe92
/simpleretailnew/src_server/com/ayuku/retail/persistence/model/Sequences.java
01e44549b1245a6bb7100fc91b9c0e23eaa7f743
[]
no_license
google-code/ayukusimpleretail
https://github.com/google-code/ayukusimpleretail
66f202821549758f49ae6e8f37fc7bdfb2b80374
80a062e30f3227a74e08e0bf5333db9fb8246f7a
refs/heads/master
2016-09-11T04:00:57.734000
2015-03-15T17:44:35
2015-03-15T17:44:35
32,274,678
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ayuku.retail.persistence.model; public class Sequences { /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceCatalog; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceSchema; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceName; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long currentValue; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long increment; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Boolean isGenerated; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String remarks; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long cache; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Integer id; /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_CATALOG * * @return the value of SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceCatalog() { return sequenceCatalog; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_CATALOG * * @param sequenceCatalog the value for SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceCatalog(String sequenceCatalog) { this.sequenceCatalog = sequenceCatalog == null ? null : sequenceCatalog.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_SCHEMA * * @return the value of SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceSchema() { return sequenceSchema; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_SCHEMA * * @param sequenceSchema the value for SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceSchema(String sequenceSchema) { this.sequenceSchema = sequenceSchema == null ? null : sequenceSchema.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_NAME * * @return the value of SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceName() { return sequenceName; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_NAME * * @param sequenceName the value for SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceName(String sequenceName) { this.sequenceName = sequenceName == null ? null : sequenceName.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.CURRENT_VALUE * * @return the value of SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getCurrentValue() { return currentValue; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.CURRENT_VALUE * * @param currentValue the value for SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setCurrentValue(Long currentValue) { this.currentValue = currentValue; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.INCREMENT * * @return the value of SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getIncrement() { return increment; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.INCREMENT * * @param increment the value for SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setIncrement(Long increment) { this.increment = increment; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.IS_GENERATED * * @return the value of SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Boolean getIsGenerated() { return isGenerated; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.IS_GENERATED * * @param isGenerated the value for SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setIsGenerated(Boolean isGenerated) { this.isGenerated = isGenerated; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.REMARKS * * @return the value of SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getRemarks() { return remarks; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.REMARKS * * @param remarks the value for SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setRemarks(String remarks) { this.remarks = remarks == null ? null : remarks.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.CACHE * * @return the value of SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getCache() { return cache; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.CACHE * * @param cache the value for SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setCache(Long cache) { this.cache = cache; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.ID * * @return the value of SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Integer getId() { return id; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.ID * * @param id the value for SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setId(Integer id) { this.id = id; } }
UTF-8
Java
9,077
java
Sequences.java
Java
[]
null
[]
package com.ayuku.retail.persistence.model; public class Sequences { /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceCatalog; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceSchema; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String sequenceName; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long currentValue; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long increment; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Boolean isGenerated; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private String remarks; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Long cache; /** * This field was generated by Apache iBATIS ibator. * This field corresponds to the database column SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ private Integer id; /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_CATALOG * * @return the value of SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceCatalog() { return sequenceCatalog; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_CATALOG * * @param sequenceCatalog the value for SEQUENCES.SEQUENCE_CATALOG * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceCatalog(String sequenceCatalog) { this.sequenceCatalog = sequenceCatalog == null ? null : sequenceCatalog.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_SCHEMA * * @return the value of SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceSchema() { return sequenceSchema; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_SCHEMA * * @param sequenceSchema the value for SEQUENCES.SEQUENCE_SCHEMA * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceSchema(String sequenceSchema) { this.sequenceSchema = sequenceSchema == null ? null : sequenceSchema.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.SEQUENCE_NAME * * @return the value of SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getSequenceName() { return sequenceName; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.SEQUENCE_NAME * * @param sequenceName the value for SEQUENCES.SEQUENCE_NAME * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setSequenceName(String sequenceName) { this.sequenceName = sequenceName == null ? null : sequenceName.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.CURRENT_VALUE * * @return the value of SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getCurrentValue() { return currentValue; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.CURRENT_VALUE * * @param currentValue the value for SEQUENCES.CURRENT_VALUE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setCurrentValue(Long currentValue) { this.currentValue = currentValue; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.INCREMENT * * @return the value of SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getIncrement() { return increment; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.INCREMENT * * @param increment the value for SEQUENCES.INCREMENT * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setIncrement(Long increment) { this.increment = increment; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.IS_GENERATED * * @return the value of SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Boolean getIsGenerated() { return isGenerated; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.IS_GENERATED * * @param isGenerated the value for SEQUENCES.IS_GENERATED * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setIsGenerated(Boolean isGenerated) { this.isGenerated = isGenerated; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.REMARKS * * @return the value of SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public String getRemarks() { return remarks; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.REMARKS * * @param remarks the value for SEQUENCES.REMARKS * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setRemarks(String remarks) { this.remarks = remarks == null ? null : remarks.trim(); } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.CACHE * * @return the value of SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Long getCache() { return cache; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.CACHE * * @param cache the value for SEQUENCES.CACHE * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setCache(Long cache) { this.cache = cache; } /** * This method was generated by Apache iBATIS ibator. * This method returns the value of the database column SEQUENCES.ID * * @return the value of SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public Integer getId() { return id; } /** * This method was generated by Apache iBATIS ibator. * This method sets the value of the database column SEQUENCES.ID * * @param id the value for SEQUENCES.ID * * @ibatorgenerated Sat Mar 03 16:31:32 ICT 2012 */ public void setId(Integer id) { this.id = id; } }
9,077
0.626969
0.591275
291
29.199312
26.807602
87
false
false
0
0
0
0
0
0
0.09622
false
false
2
1d6b690cf49cf77b1fc72e5ce7cce0f4413270eb
24,240,795,470,592
775ed9054f196aa860224c0a5f906ae11d48939d
/emulator-tapi-2.1/tapi2.1-javaServer/src/gen/java/io/swagger/model/TapiOduOduTerminationAndClientAdaptationPac.java
31589a4bde8d5543a21ecdd843d310c59f4131b7
[ "Apache-2.0" ]
permissive
iicc1/ODTN-emulator
https://github.com/iicc1/ODTN-emulator
6254e726ef318b58ac452b13e2a023c1aea8c8ee
f1e904823758fe15f4060c00119987df31d4c769
refs/heads/master
2020-11-26T02:34:04.842000
2020-09-22T18:24:12
2020-09-22T18:24:12
228,939,192
0
0
Apache-2.0
true
2019-12-18T23:37:43
2019-12-18T23:37:42
2019-12-18T14:50:35
2019-08-02T14:52:17
4,973
0
0
0
null
false
false
/* * tapi-common,tapi-dsr,tapi-path-computation,tapi-eth,tapi-virtual-network,tapi-topology,tapi-notification,tapi-oam,tapi-photonic-media,tapi-connectivity API * tapi-common,tapi-dsr,tapi-path-computation,tapi-eth,tapi-virtual-network,tapi-topology,tapi-notification,tapi-oam,tapi-photonic-media,tapi-connectivity API generated from yang definitions * * OpenAPI spec version: 1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.TapiOduMappingType; import io.swagger.model.TapiOduOduPayloadType; import io.swagger.model.TapiOduOduSlotSize; import javax.validation.constraints.*; /** * TapiOduOduTerminationAndClientAdaptationPac */ @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-14T14:58:12.974+01:00") public class TapiOduOduTerminationAndClientAdaptationPac { @JsonProperty("configured-mapping-type") private TapiOduMappingType configuredMappingType = null; @JsonProperty("auto-payload-type") private Boolean autoPayloadType = false; @JsonProperty("accepted-payload-type") private TapiOduOduPayloadType acceptedPayloadType = null; @JsonProperty("opu-tributary-slot-size") private TapiOduOduSlotSize opuTributarySlotSize = null; @JsonProperty("configured-client-type") private String configuredClientType = null; public TapiOduOduTerminationAndClientAdaptationPac configuredMappingType(TapiOduMappingType configuredMappingType) { this.configuredMappingType = configuredMappingType; return this; } /** * This attributes indicates the configured mapping type. * @return configuredMappingType **/ @JsonProperty("configured-mapping-type") @ApiModelProperty(value = "This attributes indicates the configured mapping type.") public TapiOduMappingType getConfiguredMappingType() { return configuredMappingType; } public void setConfiguredMappingType(TapiOduMappingType configuredMappingType) { this.configuredMappingType = configuredMappingType; } public TapiOduOduTerminationAndClientAdaptationPac autoPayloadType(Boolean autoPayloadType) { this.autoPayloadType = autoPayloadType; return this; } /** * This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Source at the client layer of the ODUP/ODUj-21 adaptation function. The value of true of this attribute configures that the adaptation source function shall fall back to the payload type PT&#x3D;20 if the conditions specified in 14.3.10.1/G.798 are satisfied. * @return autoPayloadType **/ @JsonProperty("auto-payload-type") @ApiModelProperty(value = "This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Source at the client layer of the ODUP/ODUj-21 adaptation function. The value of true of this attribute configures that the adaptation source function shall fall back to the payload type PT=20 if the conditions specified in 14.3.10.1/G.798 are satisfied. ") public Boolean isAutoPayloadType() { return autoPayloadType; } public void setAutoPayloadType(Boolean autoPayloadType) { this.autoPayloadType = autoPayloadType; } public TapiOduOduTerminationAndClientAdaptationPac acceptedPayloadType(TapiOduOduPayloadType acceptedPayloadType) { this.acceptedPayloadType = acceptedPayloadType; return this; } /** * This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Sink at the client layer of the ODUP/ODU[i]j or ODUP/ODUj-21 adaptation function. This attribute is a 2-digit Hex code that indicates the new accepted payload type. Valid values are defined in Table 15-8 of ITU-T Recommendation G.709 with one additional value UN_INTERPRETABLE. * @return acceptedPayloadType **/ @JsonProperty("accepted-payload-type") @ApiModelProperty(value = "This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Sink at the client layer of the ODUP/ODU[i]j or ODUP/ODUj-21 adaptation function. This attribute is a 2-digit Hex code that indicates the new accepted payload type. Valid values are defined in Table 15-8 of ITU-T Recommendation G.709 with one additional value UN_INTERPRETABLE.") public TapiOduOduPayloadType getAcceptedPayloadType() { return acceptedPayloadType; } public void setAcceptedPayloadType(TapiOduOduPayloadType acceptedPayloadType) { this.acceptedPayloadType = acceptedPayloadType; } public TapiOduOduTerminationAndClientAdaptationPac opuTributarySlotSize(TapiOduOduSlotSize opuTributarySlotSize) { this.opuTributarySlotSize = opuTributarySlotSize; return this; } /** * This attribute is applicable for ODU2 and ODU3 CTP only. It indicates the slot size of the ODU CTP. * @return opuTributarySlotSize **/ @JsonProperty("opu-tributary-slot-size") @ApiModelProperty(value = "This attribute is applicable for ODU2 and ODU3 CTP only. It indicates the slot size of the ODU CTP.") public TapiOduOduSlotSize getOpuTributarySlotSize() { return opuTributarySlotSize; } public void setOpuTributarySlotSize(TapiOduOduSlotSize opuTributarySlotSize) { this.opuTributarySlotSize = opuTributarySlotSize; } public TapiOduOduTerminationAndClientAdaptationPac configuredClientType(String configuredClientType) { this.configuredClientType = configuredClientType; return this; } /** * This attribute configures the type of the client CTP of the server ODU TTP. * @return configuredClientType **/ @JsonProperty("configured-client-type") @ApiModelProperty(value = "This attribute configures the type of the client CTP of the server ODU TTP.") public String getConfiguredClientType() { return configuredClientType; } public void setConfiguredClientType(String configuredClientType) { this.configuredClientType = configuredClientType; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TapiOduOduTerminationAndClientAdaptationPac tapiOduOduTerminationAndClientAdaptationPac = (TapiOduOduTerminationAndClientAdaptationPac) o; return Objects.equals(this.configuredMappingType, tapiOduOduTerminationAndClientAdaptationPac.configuredMappingType) && Objects.equals(this.autoPayloadType, tapiOduOduTerminationAndClientAdaptationPac.autoPayloadType) && Objects.equals(this.acceptedPayloadType, tapiOduOduTerminationAndClientAdaptationPac.acceptedPayloadType) && Objects.equals(this.opuTributarySlotSize, tapiOduOduTerminationAndClientAdaptationPac.opuTributarySlotSize) && Objects.equals(this.configuredClientType, tapiOduOduTerminationAndClientAdaptationPac.configuredClientType); } @Override public int hashCode() { return Objects.hash(configuredMappingType, autoPayloadType, acceptedPayloadType, opuTributarySlotSize, configuredClientType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TapiOduOduTerminationAndClientAdaptationPac {\n"); sb.append(" configuredMappingType: ").append(toIndentedString(configuredMappingType)).append("\n"); sb.append(" autoPayloadType: ").append(toIndentedString(autoPayloadType)).append("\n"); sb.append(" acceptedPayloadType: ").append(toIndentedString(acceptedPayloadType)).append("\n"); sb.append(" opuTributarySlotSize: ").append(toIndentedString(opuTributarySlotSize)).append("\n"); sb.append(" configuredClientType: ").append(toIndentedString(configuredClientType)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
UTF-8
Java
8,449
java
TapiOduOduTerminationAndClientAdaptationPac.java
Java
[ { "context": "ger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manu", "end": 502, "score": 0.9995405077934265, "start": 491, "tag": "USERNAME", "value": "swagger-api" }, { "context": "ad type PT&#x3D;20 if the conditions spe...
null
[]
/* * tapi-common,tapi-dsr,tapi-path-computation,tapi-eth,tapi-virtual-network,tapi-topology,tapi-notification,tapi-oam,tapi-photonic-media,tapi-connectivity API * tapi-common,tapi-dsr,tapi-path-computation,tapi-eth,tapi-virtual-network,tapi-topology,tapi-notification,tapi-oam,tapi-photonic-media,tapi-connectivity API generated from yang definitions * * OpenAPI spec version: 1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.TapiOduMappingType; import io.swagger.model.TapiOduOduPayloadType; import io.swagger.model.TapiOduOduSlotSize; import javax.validation.constraints.*; /** * TapiOduOduTerminationAndClientAdaptationPac */ @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-14T14:58:12.974+01:00") public class TapiOduOduTerminationAndClientAdaptationPac { @JsonProperty("configured-mapping-type") private TapiOduMappingType configuredMappingType = null; @JsonProperty("auto-payload-type") private Boolean autoPayloadType = false; @JsonProperty("accepted-payload-type") private TapiOduOduPayloadType acceptedPayloadType = null; @JsonProperty("opu-tributary-slot-size") private TapiOduOduSlotSize opuTributarySlotSize = null; @JsonProperty("configured-client-type") private String configuredClientType = null; public TapiOduOduTerminationAndClientAdaptationPac configuredMappingType(TapiOduMappingType configuredMappingType) { this.configuredMappingType = configuredMappingType; return this; } /** * This attributes indicates the configured mapping type. * @return configuredMappingType **/ @JsonProperty("configured-mapping-type") @ApiModelProperty(value = "This attributes indicates the configured mapping type.") public TapiOduMappingType getConfiguredMappingType() { return configuredMappingType; } public void setConfiguredMappingType(TapiOduMappingType configuredMappingType) { this.configuredMappingType = configuredMappingType; } public TapiOduOduTerminationAndClientAdaptationPac autoPayloadType(Boolean autoPayloadType) { this.autoPayloadType = autoPayloadType; return this; } /** * This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Source at the client layer of the ODUP/ODUj-21 adaptation function. The value of true of this attribute configures that the adaptation source function shall fall back to the payload type PT&#x3D;20 if the conditions specified in 172.16.31.10/G.798 are satisfied. * @return autoPayloadType **/ @JsonProperty("auto-payload-type") @ApiModelProperty(value = "This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Source at the client layer of the ODUP/ODUj-21 adaptation function. The value of true of this attribute configures that the adaptation source function shall fall back to the payload type PT=20 if the conditions specified in 172.16.31.10/G.798 are satisfied. ") public Boolean isAutoPayloadType() { return autoPayloadType; } public void setAutoPayloadType(Boolean autoPayloadType) { this.autoPayloadType = autoPayloadType; } public TapiOduOduTerminationAndClientAdaptationPac acceptedPayloadType(TapiOduOduPayloadType acceptedPayloadType) { this.acceptedPayloadType = acceptedPayloadType; return this; } /** * This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Sink at the client layer of the ODUP/ODU[i]j or ODUP/ODUj-21 adaptation function. This attribute is a 2-digit Hex code that indicates the new accepted payload type. Valid values are defined in Table 15-8 of ITU-T Recommendation G.709 with one additional value UN_INTERPRETABLE. * @return acceptedPayloadType **/ @JsonProperty("accepted-payload-type") @ApiModelProperty(value = "This attribute is applicable when the ODU CTP object instance represents a lower order ODU CTP Sink at the client layer of the ODUP/ODU[i]j or ODUP/ODUj-21 adaptation function. This attribute is a 2-digit Hex code that indicates the new accepted payload type. Valid values are defined in Table 15-8 of ITU-T Recommendation G.709 with one additional value UN_INTERPRETABLE.") public TapiOduOduPayloadType getAcceptedPayloadType() { return acceptedPayloadType; } public void setAcceptedPayloadType(TapiOduOduPayloadType acceptedPayloadType) { this.acceptedPayloadType = acceptedPayloadType; } public TapiOduOduTerminationAndClientAdaptationPac opuTributarySlotSize(TapiOduOduSlotSize opuTributarySlotSize) { this.opuTributarySlotSize = opuTributarySlotSize; return this; } /** * This attribute is applicable for ODU2 and ODU3 CTP only. It indicates the slot size of the ODU CTP. * @return opuTributarySlotSize **/ @JsonProperty("opu-tributary-slot-size") @ApiModelProperty(value = "This attribute is applicable for ODU2 and ODU3 CTP only. It indicates the slot size of the ODU CTP.") public TapiOduOduSlotSize getOpuTributarySlotSize() { return opuTributarySlotSize; } public void setOpuTributarySlotSize(TapiOduOduSlotSize opuTributarySlotSize) { this.opuTributarySlotSize = opuTributarySlotSize; } public TapiOduOduTerminationAndClientAdaptationPac configuredClientType(String configuredClientType) { this.configuredClientType = configuredClientType; return this; } /** * This attribute configures the type of the client CTP of the server ODU TTP. * @return configuredClientType **/ @JsonProperty("configured-client-type") @ApiModelProperty(value = "This attribute configures the type of the client CTP of the server ODU TTP.") public String getConfiguredClientType() { return configuredClientType; } public void setConfiguredClientType(String configuredClientType) { this.configuredClientType = configuredClientType; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TapiOduOduTerminationAndClientAdaptationPac tapiOduOduTerminationAndClientAdaptationPac = (TapiOduOduTerminationAndClientAdaptationPac) o; return Objects.equals(this.configuredMappingType, tapiOduOduTerminationAndClientAdaptationPac.configuredMappingType) && Objects.equals(this.autoPayloadType, tapiOduOduTerminationAndClientAdaptationPac.autoPayloadType) && Objects.equals(this.acceptedPayloadType, tapiOduOduTerminationAndClientAdaptationPac.acceptedPayloadType) && Objects.equals(this.opuTributarySlotSize, tapiOduOduTerminationAndClientAdaptationPac.opuTributarySlotSize) && Objects.equals(this.configuredClientType, tapiOduOduTerminationAndClientAdaptationPac.configuredClientType); } @Override public int hashCode() { return Objects.hash(configuredMappingType, autoPayloadType, acceptedPayloadType, opuTributarySlotSize, configuredClientType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TapiOduOduTerminationAndClientAdaptationPac {\n"); sb.append(" configuredMappingType: ").append(toIndentedString(configuredMappingType)).append("\n"); sb.append(" autoPayloadType: ").append(toIndentedString(autoPayloadType)).append("\n"); sb.append(" acceptedPayloadType: ").append(toIndentedString(acceptedPayloadType)).append("\n"); sb.append(" opuTributarySlotSize: ").append(toIndentedString(opuTributarySlotSize)).append("\n"); sb.append(" configuredClientType: ").append(toIndentedString(configuredClientType)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
8,455
0.7666
0.75796
188
43.936169
65.616196
446
false
false
0
0
0
0
0
0
0.441489
false
false
2
acf2c2c7c9b565e921136eae778882e80917a6cd
38,087,770,005,300
c4dfd738543d66758e933614b038a22ead6f24ef
/back/src/main/java/com/ethermorgan/onedaycp/service/MatchService.java
5fb0eedce2a3a40d0828b4464d508b76d17c671c
[]
no_license
klash-yang/OneDayCP21
https://github.com/klash-yang/OneDayCP21
fe988efe164fc2144e67b6bb40b2bdd1f5b7d63d
94040db02ae7bca6495117b4a8ef54b36e0da55f
refs/heads/master
2021-10-11T14:43:41.947000
2019-01-27T14:13:01
2019-01-27T14:13:01
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ethermorgan.onedaycp.service; public interface MatchService { }
UTF-8
Java
77
java
MatchService.java
Java
[]
null
[]
package com.ethermorgan.onedaycp.service; public interface MatchService { }
77
0.818182
0.818182
4
18.25
18.10214
41
false
false
0
0
0
0
0
0
0.25
false
false
2
87e319ce8854f0c6969a5ca8ff5d49570beb3657
5,342,939,369,575
a36fc76e6dc7670c72a48bd79e2b70ad4571debb
/src/main/java/com/carpoolingproject/carpoolingserver/controller/UserController.java
5eda6ec23faf3e3681919b9c8e6f184330fe97b5
[]
no_license
Thibaulttt/carpooling-project-server
https://github.com/Thibaulttt/carpooling-project-server
093716dff27ef4fc9d779302cf383dd8b0f76cd4
4d2d9ceea3f2be7ad722d3b72974c31b5f1722de
refs/heads/main
2022-12-27T19:51:23.549000
2020-10-16T14:18:21
2020-10-16T14:18:21
304,594,365
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.carpoolingproject.carpoolingserver.controller; import com.carpoolingproject.carpoolingserver.model.User; import com.carpoolingproject.carpoolingserver.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class UserController { @Autowired UserService userService; @RequestMapping(value = "/user", method = RequestMethod.GET) public List<User> getAll() { return userService.getAll(); } }
UTF-8
Java
754
java
UserController.java
Java
[]
null
[]
package com.carpoolingproject.carpoolingserver.controller; import com.carpoolingproject.carpoolingserver.model.User; import com.carpoolingproject.carpoolingserver.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController public class UserController { @Autowired UserService userService; @RequestMapping(value = "/user", method = RequestMethod.GET) public List<User> getAll() { return userService.getAll(); } }
754
0.809019
0.809019
22
33.272728
25.407911
66
false
false
0
0
0
0
0
0
0.545455
false
false
2
7b11125585e2fa60b96f18e6c5a34753a76c60aa
23,845,658,491,641
dcc4ee4515874f3d14a54e9d36b2c6b0ec09f7f0
/src/com/cognizant/truyum/dao/MenuItemDaoSqlImplTest.java
0ef79bdc4271e81c4162e0156baf7abd2aec4d07
[]
no_license
Priyadharsini29998/Priyadharsini29998.github.io
https://github.com/Priyadharsini29998/Priyadharsini29998.github.io
35261a95bc191af06bf08a608132bab225c80e80
bf0babacffb5a8d1661f86f05d49ad23848db3c0
refs/heads/master
2020-09-23T20:43:00.587000
2020-01-23T07:16:36
2020-01-23T07:16:36
225,582,734
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cognizant.truyum.dao; import java.sql.SQLException; import java.text.ParseException; import java.util.List; import com.cognizant.truyum.model.MenuItem; import com.cognizant.truyum.util.DateUtil; public class MenuItemDaoSqlImplTest { public static void main(String[] args) { try { System.out.println("Admin menu List"); testGetmenuItemAdmin(); System.out.println("Customer menu Item List"); testgetMenuItemListCustomer(); System.out.println("Modified menu Item List"); testModifyMenuItem(); testGetmenuItemAdmin(); } catch (Exception e) { e.printStackTrace(); } } private static void testModifyMenuItem() throws ParseException, SQLException { MenuItem m = new MenuItem(1, "ChocoPie", 10.00f, true, DateUtil.convertToDate("14/05/2018"), "Starter", true); MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); menuItemDao.modifyMenuItem(m); } public static void testGetmenuItemAdmin() throws ParseException, SQLException { MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); List<MenuItem> menuitemList = menuItemDao.getMenuItemListAdmin(); for (MenuItem x : menuitemList) { System.out.println(x); } } public static void testgetMenuItemListCustomer() throws ParseException, SQLException { MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); List<MenuItem> menuitemList = menuItemDao.getMenuItemListCustomer(); for (MenuItem x : menuitemList) { System.out.println(x); } } }
UTF-8
Java
1,461
java
MenuItemDaoSqlImplTest.java
Java
[]
null
[]
package com.cognizant.truyum.dao; import java.sql.SQLException; import java.text.ParseException; import java.util.List; import com.cognizant.truyum.model.MenuItem; import com.cognizant.truyum.util.DateUtil; public class MenuItemDaoSqlImplTest { public static void main(String[] args) { try { System.out.println("Admin menu List"); testGetmenuItemAdmin(); System.out.println("Customer menu Item List"); testgetMenuItemListCustomer(); System.out.println("Modified menu Item List"); testModifyMenuItem(); testGetmenuItemAdmin(); } catch (Exception e) { e.printStackTrace(); } } private static void testModifyMenuItem() throws ParseException, SQLException { MenuItem m = new MenuItem(1, "ChocoPie", 10.00f, true, DateUtil.convertToDate("14/05/2018"), "Starter", true); MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); menuItemDao.modifyMenuItem(m); } public static void testGetmenuItemAdmin() throws ParseException, SQLException { MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); List<MenuItem> menuitemList = menuItemDao.getMenuItemListAdmin(); for (MenuItem x : menuitemList) { System.out.println(x); } } public static void testgetMenuItemListCustomer() throws ParseException, SQLException { MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); List<MenuItem> menuitemList = menuItemDao.getMenuItemListCustomer(); for (MenuItem x : menuitemList) { System.out.println(x); } } }
1,461
0.748118
0.73922
52
27.096153
26.509983
105
false
false
0
0
0
0
0
0
1.961538
false
false
2
bb95700161a08c841b23cbc0eaeb688f8cf928b6
32,950,989,099,950
1a75ae7790da7ce9b03abedd9eaf89ab83c3f442
/tools/src/test/java/com/gsg/excel/CompanyInFoModel.java
a5f08e258b480fc40e20db62ae07949597cdcce4
[]
no_license
coatesmc/martinFowler
https://github.com/coatesmc/martinFowler
6096e318319a4591e38a72c131573d2269497c83
9162058dc92cba492cc60e16ecbfa97ea0fb1ee1
refs/heads/master
2022-10-14T11:48:05.360000
2020-03-30T08:52:34
2020-03-30T08:52:34
203,337,303
0
1
null
false
2022-10-05T18:20:32
2019-08-20T08:51:17
2020-03-30T08:52:58
2022-10-05T18:20:28
361
0
1
18
Java
false
false
package com.coates.excel; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.metadata.BaseRowModel; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** * @ClassName model * @Description TODO * @Author mc * @Date 2019/5/13 10:17 * @Version 1.0 **/ @Data @EqualsAndHashCode(callSuper = false) public class CompanyInFoModel extends BaseRowModel { @ExcelProperty(value ="单位名称", index=0) private String companyName; @ExcelProperty(value ="单位联系人",index=1) private String companyContact; @ExcelProperty(value ="联系电话",index=2) private String contactNumber; @ExcelProperty(value ="充值金额",index=3) private BigDecimal money; }
UTF-8
Java
752
java
CompanyInFoModel.java
Java
[ { "context": "* @ClassName model\n * @Description TODO\n * @Author mc\n * @Date 2019/5/13 10:17\n * @Version 1.0\n **/\n @D", "end": 268, "score": 0.9988411068916321, "start": 266, "tag": "USERNAME", "value": "mc" } ]
null
[]
package com.coates.excel; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.metadata.BaseRowModel; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** * @ClassName model * @Description TODO * @Author mc * @Date 2019/5/13 10:17 * @Version 1.0 **/ @Data @EqualsAndHashCode(callSuper = false) public class CompanyInFoModel extends BaseRowModel { @ExcelProperty(value ="单位名称", index=0) private String companyName; @ExcelProperty(value ="单位联系人",index=1) private String companyContact; @ExcelProperty(value ="联系电话",index=2) private String contactNumber; @ExcelProperty(value ="充值金额",index=3) private BigDecimal money; }
752
0.736769
0.713092
28
24.642857
16.301214
52
false
false
0
0
0
0
0
0
0.5
false
false
2
ca0d6c320ef40d1c9459633f400ed7deced7cb9d
12,171,937,377,540
405765e31c10346d1d160f4614f6d43b9ac606d8
/src/jp/ac/tokushima_u/is/ll/util/AudioUtil.java
1813b52e9faed5e4ef97bf4ba16067ccca545018
[]
no_license
scrollmember/androidscroll
https://github.com/scrollmember/androidscroll
5113aa85cbceeaa9b82ee042c68d02211bb286ee
f55c3f68048ce5f49dc7572ff653a57cef05a1fc
refs/heads/master
2021-01-23T03:53:10.460000
2015-05-11T04:51:39
2015-05-11T04:51:39
35,367,122
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package jp.ac.tokushima_u.is.ll.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLEncoder; import jp.ac.tokushima_u.is.ll.R; import android.content.Context; import android.util.Log; //import com.actionbarsherlock.R; public class AudioUtil { private static final String TAG = "AudioRetrieve"; public static File getPronounceAudio(Context context, String content, String code) { if(content==null||content.length()==0) return null; // 直接ファイルパスを指定する方法を行なってはならない // see: https://sites.google.com/a/techdoctranslator.com/jp/android/guide/data-storage // String filepath = context.getResources().getString(R.string.cache_audio_path); String filepath = context.getExternalCacheDir().toString() + context.getResources().getString(R.string.cache_audio_external_path); File dir = new File(filepath); if (!dir.exists()) dir.mkdirs(); File nomedia = new File(context.getExternalCacheDir().toString() + "/.nomedia"); if(!nomedia.exists()) { try { nomedia.createNewFile(); }catch(IOException e) { Log.e(TAG, "nomedia create error", e); } } filepath = filepath + content + "_" + code + ".mp3"; File file = new File(filepath); if (!file.exists()) { String purl = ApiConstants.Pronounce_URI + "?ie=UTF-8&lang=" + code + "&text="; FileOutputStream fout = null; InputStream in = null; try { purl = purl + URLEncoder.encode(content, "UTF-8"); URL url = new URL(purl);// 获得文件的路径 in = url.openStream();// 打开到此 URL 的连接并返回一个用于从该连接读入的 InputStream。 fout = new FileOutputStream(file);// 生成文件的位置 byte[] b = new byte[1024];// 缓冲区 int length = 0; int a; while ((a = in.read(b)) > 0) { length = a + length; fout.write(b); } fout.close(); in.close(); if(length==0) file.deleteOnExit(); } catch (Exception e) { } } return file; } }
UTF-8
Java
2,184
java
AudioUtil.java
Java
[]
null
[]
package jp.ac.tokushima_u.is.ll.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLEncoder; import jp.ac.tokushima_u.is.ll.R; import android.content.Context; import android.util.Log; //import com.actionbarsherlock.R; public class AudioUtil { private static final String TAG = "AudioRetrieve"; public static File getPronounceAudio(Context context, String content, String code) { if(content==null||content.length()==0) return null; // 直接ファイルパスを指定する方法を行なってはならない // see: https://sites.google.com/a/techdoctranslator.com/jp/android/guide/data-storage // String filepath = context.getResources().getString(R.string.cache_audio_path); String filepath = context.getExternalCacheDir().toString() + context.getResources().getString(R.string.cache_audio_external_path); File dir = new File(filepath); if (!dir.exists()) dir.mkdirs(); File nomedia = new File(context.getExternalCacheDir().toString() + "/.nomedia"); if(!nomedia.exists()) { try { nomedia.createNewFile(); }catch(IOException e) { Log.e(TAG, "nomedia create error", e); } } filepath = filepath + content + "_" + code + ".mp3"; File file = new File(filepath); if (!file.exists()) { String purl = ApiConstants.Pronounce_URI + "?ie=UTF-8&lang=" + code + "&text="; FileOutputStream fout = null; InputStream in = null; try { purl = purl + URLEncoder.encode(content, "UTF-8"); URL url = new URL(purl);// 获得文件的路径 in = url.openStream();// 打开到此 URL 的连接并返回一个用于从该连接读入的 InputStream。 fout = new FileOutputStream(file);// 生成文件的位置 byte[] b = new byte[1024];// 缓冲区 int length = 0; int a; while ((a = in.read(b)) > 0) { length = a + length; fout.write(b); } fout.close(); in.close(); if(length==0) file.deleteOnExit(); } catch (Exception e) { } } return file; } }
2,184
0.635214
0.629864
75
26.413334
24.840878
132
false
false
0
0
0
0
0
0
2.413333
false
false
2
ffe4f8cc06fed002bf30c0614b2053486edc8abe
24,498,493,465,829
ba4aa56ebc6e2ad2eff5582a8fcc21c5a9cf4611
/app/src/main/java/com/example/finalproject/view/MapDetailActivity.java
0ad47e984f246c2714a4d05d4b451b7bb92ddb53
[]
no_license
kangkyoungmin/AndroidProject
https://github.com/kangkyoungmin/AndroidProject
e7a7968f5e4c87c0053919f3f0778851f5f5005a
84e2ff38176498f1a371cfd194eec0b6235f47bf
refs/heads/main
2023-04-10T03:30:32.196000
2021-04-12T16:43:48
2021-04-12T16:43:48
357,268,121
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.finalproject.view; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.example.finalproject.R; import com.example.finalproject.adapter.ChatListViewAdapter; import com.example.finalproject.model.ChatRoom; import java.util.ArrayList; public class MapDetailActivity extends AppCompatActivity { ArrayList<ChatRoom> chatRoom; Context context; TextView tv_restName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mapdetail); context = this; tv_restName = findViewById(R.id.mapDetailTextView); tv_restName.setText("고수찜닭"); // todo. 식당 이름 출력하도록 변경 this.InitializeRoomList(); //현재 방의 정보를 받아오는 함수 ListView listView = (ListView) findViewById(R.id.mapDetailListView); final ChatListViewAdapter chatListViewAdapter = new ChatListViewAdapter(this, chatRoom); listView.setAdapter(chatListViewAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View v, int position, long id) { // 해당 부분은 RoomListActivity와 동일 Intent intentChat = new Intent(MapDetailActivity.this, RoomDetailActivity.class); intentChat.putExtra("chatTitle", chatRoom.get(position).getRoomTitle()); intentChat.putExtra("chatRest", chatRoom.get(position).getRestName()); intentChat.putExtra("chatTime", chatRoom.get(position).getRoomTime()); intentChat.putExtra("chatPerson", chatRoom.get(position).getRoomPersonnel()); intentChat.putExtra("chatGender", chatRoom.get(position).getRoomGender()); intentChat.putExtra("chatEct", chatRoom.get(position).getEct()); startActivity(intentChat); } }); } public void InitializeRoomList() { // RoomListActivity와 연동하여 생각 + 해당 식당만 출력 chatRoom = new ArrayList<ChatRoom>(); // 리스트 선언 // todo. 서버와 연동 // 리스트 추가 } }
UTF-8
Java
2,475
java
MapDetailActivity.java
Java
[ { "context": ".mapDetailTextView);\n tv_restName.setText(\"고수찜닭\"); // todo. 식당 이름 출력하도록 변경\n\n this.Initiali", "end": 905, "score": 0.9980776309967041, "start": 901, "tag": "NAME", "value": "고수찜닭" } ]
null
[]
package com.example.finalproject.view; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.example.finalproject.R; import com.example.finalproject.adapter.ChatListViewAdapter; import com.example.finalproject.model.ChatRoom; import java.util.ArrayList; public class MapDetailActivity extends AppCompatActivity { ArrayList<ChatRoom> chatRoom; Context context; TextView tv_restName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mapdetail); context = this; tv_restName = findViewById(R.id.mapDetailTextView); tv_restName.setText("고수찜닭"); // todo. 식당 이름 출력하도록 변경 this.InitializeRoomList(); //현재 방의 정보를 받아오는 함수 ListView listView = (ListView) findViewById(R.id.mapDetailListView); final ChatListViewAdapter chatListViewAdapter = new ChatListViewAdapter(this, chatRoom); listView.setAdapter(chatListViewAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View v, int position, long id) { // 해당 부분은 RoomListActivity와 동일 Intent intentChat = new Intent(MapDetailActivity.this, RoomDetailActivity.class); intentChat.putExtra("chatTitle", chatRoom.get(position).getRoomTitle()); intentChat.putExtra("chatRest", chatRoom.get(position).getRestName()); intentChat.putExtra("chatTime", chatRoom.get(position).getRoomTime()); intentChat.putExtra("chatPerson", chatRoom.get(position).getRoomPersonnel()); intentChat.putExtra("chatGender", chatRoom.get(position).getRoomGender()); intentChat.putExtra("chatEct", chatRoom.get(position).getEct()); startActivity(intentChat); } }); } public void InitializeRoomList() { // RoomListActivity와 연동하여 생각 + 해당 식당만 출력 chatRoom = new ArrayList<ChatRoom>(); // 리스트 선언 // todo. 서버와 연동 // 리스트 추가 } }
2,475
0.691684
0.691684
59
38.745762
30.384872
97
false
false
0
0
0
0
0
0
0.779661
false
false
2
c77c9255c5fb4df04ebdafe451dc72d17e21a534
24,498,493,464,751
e7b48d804629fa8381e682d4fd393f2aad5c95d9
/src/main/java/net/frozenorb/potpvp/kittype/command/KitLoadDefaultCommand.java
ee560be1e230eba5b2ec06e8c306bba7d259538a
[]
no_license
SkyHCF-Network/PotPvP
https://github.com/SkyHCF-Network/PotPvP
abf45c862c084d59aa1d1d0fcdbe7db18de4dd8d
5278672a4f95718fe3c700c6980bb21a26803000
refs/heads/main
2023-07-18T04:24:15.217000
2021-09-04T08:42:00
2021-09-04T08:42:00
395,804,104
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.frozenorb.potpvp.kittype.command; import net.frozenorb.potpvp.kittype.KitType; import net.frozenorb.qlib.command.Command; import net.frozenorb.qlib.command.Param; import org.bukkit.ChatColor; import org.bukkit.entity.Player; public final class KitLoadDefaultCommand { @Command(names = "kit loadDefault", permission = "op") public static void kitLoadDefault(Player sender, @Param(name="kit type") KitType kitType) { sender.getInventory().setArmorContents(kitType.getDefaultArmor()); sender.getInventory().setContents(kitType.getDefaultInventory()); sender.updateInventory(); sender.sendMessage(ChatColor.YELLOW + "Loaded default armor/inventory for " + kitType + "."); } }
UTF-8
Java
733
java
KitLoadDefaultCommand.java
Java
[]
null
[]
package net.frozenorb.potpvp.kittype.command; import net.frozenorb.potpvp.kittype.KitType; import net.frozenorb.qlib.command.Command; import net.frozenorb.qlib.command.Param; import org.bukkit.ChatColor; import org.bukkit.entity.Player; public final class KitLoadDefaultCommand { @Command(names = "kit loadDefault", permission = "op") public static void kitLoadDefault(Player sender, @Param(name="kit type") KitType kitType) { sender.getInventory().setArmorContents(kitType.getDefaultArmor()); sender.getInventory().setContents(kitType.getDefaultInventory()); sender.updateInventory(); sender.sendMessage(ChatColor.YELLOW + "Loaded default armor/inventory for " + kitType + "."); } }
733
0.744884
0.744884
21
33.952381
31.772219
101
false
false
0
0
0
0
0
0
0.571429
false
false
2
cde7dbfb7a2d5137d49049d322b124ae8a3caa75
33,200,097,263,149
4bc847e11bcfc76adb1117ab17bf51ec8b997080
/src/com/dsfy/service/ICommentService.java
69aa3548422aba4eb010f6855e85b9738190f47b
[]
no_license
toutoumu/CameraRental
https://github.com/toutoumu/CameraRental
f759b136ae598f317d21b2c4cc95bcef1765847b
c455aed62bc86e077922bf61f0cc660f3b748a2f
refs/heads/master
2021-06-03T19:18:52.538000
2019-04-25T06:28:20
2019-04-25T06:28:20
96,846,177
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.dsfy.service; import com.dsfy.dao.util.Pagination; import com.dsfy.entity.Comment; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; public interface ICommentService extends IBaseService { /** * 发表评论,并更新租赁信息评分 * * @param comment */ @Transactional(propagation = Propagation.REQUIRED) void comment(Comment comment,String orderNumber); /** * 获取用户发表过的所有评论 * * @param userId * @return */ Pagination<Comment> getByUser(int userId, int currentPage, int pageSize); /** * 获取租赁信息的所有评论 * * @param rentalId * @return */ Pagination<Comment> getByRental(int rentalId, int currentPage, int pageSize); /** * 根据租赁信息ID,或者用户ID查询评论 * * @param comment * @return */ Pagination<Comment> query(Comment comment, int currentPage, int pageSize); }
UTF-8
Java
1,049
java
ICommentService.java
Java
[]
null
[]
package com.dsfy.service; import com.dsfy.dao.util.Pagination; import com.dsfy.entity.Comment; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; public interface ICommentService extends IBaseService { /** * 发表评论,并更新租赁信息评分 * * @param comment */ @Transactional(propagation = Propagation.REQUIRED) void comment(Comment comment,String orderNumber); /** * 获取用户发表过的所有评论 * * @param userId * @return */ Pagination<Comment> getByUser(int userId, int currentPage, int pageSize); /** * 获取租赁信息的所有评论 * * @param rentalId * @return */ Pagination<Comment> getByRental(int rentalId, int currentPage, int pageSize); /** * 根据租赁信息ID,或者用户ID查询评论 * * @param comment * @return */ Pagination<Comment> query(Comment comment, int currentPage, int pageSize); }
1,049
0.663857
0.663857
42
21.595238
23.529171
81
false
false
0
0
0
0
0
0
0.428571
false
false
2
9cd8957bbddf1a64f03bcb401d1039745117b27b
28,458,453,367,985
72cb6db24a40c6b2ea285594bae21a355912cee6
/src/main/java/com/lenskart/wm/controller/ProductController.java
cf3952e422d14e693de975ef5a766226f991c7f7
[]
no_license
kssonu4u/wm
https://github.com/kssonu4u/wm
fe97195f4f2b908e49e2f82c973ece2e1d4398fc
1262e9a1a1f6145776380fafad8211ee552ea9f0
refs/heads/master
2016-09-23T07:37:30.608000
2016-03-01T10:54:28
2016-03-01T10:54:28
65,893,676
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lenskart.wm.controller; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.lenskart.wm.model.Product; import com.lenskart.wm.service.ProductService; @Controller @RequestMapping(value = "/product") public class ProductController { @RequestMapping(value = "/search/{product_id}", method = RequestMethod.GET) public @ResponseBody Product search(@PathVariable("product_id") String productId) { if(StringUtils.isNumeric(productId)) { return productService.getProductByProductId(Integer.parseInt(productId)); } return null; } @Autowired private ProductService productService; }
UTF-8
Java
969
java
ProductController.java
Java
[]
null
[]
package com.lenskart.wm.controller; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.lenskart.wm.model.Product; import com.lenskart.wm.service.ProductService; @Controller @RequestMapping(value = "/product") public class ProductController { @RequestMapping(value = "/search/{product_id}", method = RequestMethod.GET) public @ResponseBody Product search(@PathVariable("product_id") String productId) { if(StringUtils.isNumeric(productId)) { return productService.getProductByProductId(Integer.parseInt(productId)); } return null; } @Autowired private ProductService productService; }
969
0.814241
0.814241
29
32.413792
27.247927
84
false
false
0
0
0
0
0
0
1
false
false
2
96d6fef3a17c34344ad67da609c420ab71f170c1
2,594,160,315,779
09c01027d9da75a3037b904eaec790a569fd2ffa
/app/src/main/java/com/example/homestay/ui/profile/ProfilePresenter.java
e6fa7d9d9117fe071704674702dc53659faf37fe
[]
no_license
TranVanDinh235/HomeStay
https://github.com/TranVanDinh235/HomeStay
cb28ae94de16bf4fa1ea9ecd611ce09c75c49730
fe63f80e89f4b10e1ab3b96861a8de1822afe476
refs/heads/master
2021-04-23T21:19:54.908000
2020-08-13T16:51:28
2020-08-13T16:51:28
250,007,183
0
0
null
false
2020-08-13T16:51:29
2020-03-25T14:52:00
2020-06-09T16:26:45
2020-08-13T16:51:29
857
0
0
0
Java
false
false
package com.example.homestay.ui.profile; import com.example.homestay.di.PerActivity; import com.example.homestay.ui.base.MvpView; import com.example.homestay.ui.base.Presenter; @PerActivity public interface ProfilePresenter<V extends MvpView> extends Presenter<V> { void getUserData(); }
UTF-8
Java
294
java
ProfilePresenter.java
Java
[]
null
[]
package com.example.homestay.ui.profile; import com.example.homestay.di.PerActivity; import com.example.homestay.ui.base.MvpView; import com.example.homestay.ui.base.Presenter; @PerActivity public interface ProfilePresenter<V extends MvpView> extends Presenter<V> { void getUserData(); }
294
0.802721
0.802721
10
28.4
23.946608
75
false
false
0
0
0
0
0
0
0.5
false
false
2
faed482ee21fa7a9cf802e8800780a4603d5f656
2,602,750,181,563
08ceff0efa8ed3da7bbd58f4defc821fd75dc169
/src/main/java/lesson1/task3/Box.java
3d7ff5a6ebd7156139590f37cfc388cb09a5ed31
[]
no_license
Senpai07/GeekBrains_Java3
https://github.com/Senpai07/GeekBrains_Java3
595af0cfeeb51158e0443ec767b76045951cd7e6
af694c6ad3c3e772eb80f09e332f1dba19614aee
refs/heads/master
2021-05-17T23:24:34.306000
2020-04-20T19:01:00
2020-04-20T19:01:00
251,000,716
0
0
null
false
2020-10-13T21:06:34
2020-03-29T09:57:55
2020-04-20T19:01:04
2020-10-13T21:06:33
69
0
0
1
Java
false
false
package lesson1.task3; import java.util.ArrayList; public class Box<T extends Fruit> { private final ArrayList<T> box; public Box() { this.box = new ArrayList<>(); } public void addToBox(T fruit) { box.add(fruit); } public float getWeight() { float weightOfBox = 0; for (T t : this.box) { weightOfBox += t.getWeightOneFruit(); } return weightOfBox; } public boolean compare(Box<?> box2) { if (this == box2) { return true; } else return this.getWeight() == box2.getWeight(); } public void MoveTo(Box<T> box2) { for (T t : this.box) { box2.addToBox(t); } this.box.clear(); } }
UTF-8
Java
750
java
Box.java
Java
[]
null
[]
package lesson1.task3; import java.util.ArrayList; public class Box<T extends Fruit> { private final ArrayList<T> box; public Box() { this.box = new ArrayList<>(); } public void addToBox(T fruit) { box.add(fruit); } public float getWeight() { float weightOfBox = 0; for (T t : this.box) { weightOfBox += t.getWeightOneFruit(); } return weightOfBox; } public boolean compare(Box<?> box2) { if (this == box2) { return true; } else return this.getWeight() == box2.getWeight(); } public void MoveTo(Box<T> box2) { for (T t : this.box) { box2.addToBox(t); } this.box.clear(); } }
750
0.528
0.517333
36
19.833334
16.04594
59
false
false
0
0
0
0
0
0
0.333333
false
false
2
d761fdc86de76ebdaa6db4f429819a5a4d8a6291
4,071,629,066,418
97133d95edc289e789fcb03939c8fa5a6ce27496
/src/game/assets/Asset.java
3a4cd311fb52fd0f414cd55dda82b5757390d5eb
[]
no_license
somthingguy/AdventureEscape
https://github.com/somthingguy/AdventureEscape
c8f9939b9537cdd7e65107d0313fb994aa04fbcb
23a45c4c0deaf1bec2132845a8058f8aa5bd9193
refs/heads/master
2020-03-18T20:29:48.953000
2018-05-31T04:56:52
2018-05-31T04:56:52
127,796,942
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package game.assets; import java.awt.image.BufferedImage; public class Asset { private static final int width = 32, height = 32; private static final int pWidth = 64, pHeight = 64; public static BufferedImage brick, rock, cell, dirt, carpetLeft, carpetRight; public static BufferedImage[] prisoner; public static BufferedImage[] statue; public static BufferedImage[] player_still, player_up, player_down, player_left, player_right; public static BufferedImage[] enemy_still, enemy_up, enemy_down, enemy_left, enemy_right; public static void init(){ SpriteSheet sheet = new SpriteSheet(ImageLoader.loadImage("/tiles.png")); SpriteSheet psheet = new SpriteSheet(ImageLoader.loadImage("/player.png"));; SpriteSheet nsheet = new SpriteSheet(ImageLoader.loadImage("/npc.png")); SpriteSheet ssheet = new SpriteSheet(ImageLoader.loadImage("/statue.png")); SpriteSheet esheet = new SpriteSheet(ImageLoader.loadImage("/enemy.png")); //Player Animation player_still = new BufferedImage[4]; player_up = new BufferedImage[9]; player_left = new BufferedImage[9]; player_down = new BufferedImage[9]; player_right = new BufferedImage[9]; //Down0 player_still[0] = psheet.crop(0, pHeight * 2, pWidth, pHeight); //Left1 player_still[1] = psheet.crop(0, pHeight, pWidth, pHeight); //Right2 player_still[2] = psheet.crop(0, pHeight * 3, pWidth, pHeight); //Up3 player_still[3] = psheet.crop(0,0, pWidth, pHeight); player_up[0] = psheet.crop(0,0, pWidth, pHeight); player_up[1] = psheet.crop(pWidth,0, pWidth, pHeight); player_up[2] = psheet.crop(pWidth * 2,0, pWidth, pHeight); player_up[3] = psheet.crop(pWidth * 3,0, pWidth, pHeight); player_up[4] = psheet.crop(pWidth * 4,0, pWidth, pHeight); player_up[5] = psheet.crop(pWidth * 5,0, pWidth, pHeight); player_up[6] = psheet.crop(pWidth * 6,0, pWidth, pHeight); player_up[7] = psheet.crop(pWidth * 7,0, pWidth, pHeight); player_up[8] = psheet.crop(pWidth * 8,0, pWidth, pHeight); player_left[0] = psheet.crop(0, pHeight, pWidth, pHeight); player_left[1] = psheet.crop(pWidth, pHeight, pWidth, pHeight); player_left[2] = psheet.crop(pWidth * 2, pHeight, pWidth, pHeight); player_left[3] = psheet.crop(pWidth * 3, pHeight, pWidth, pHeight); player_left[4] = psheet.crop(pWidth * 4, pHeight, pWidth, pHeight); player_left[5] = psheet.crop(pWidth * 5, pHeight, pWidth, pHeight); player_left[6] = psheet.crop(pWidth * 6, pHeight, pWidth, pHeight); player_left[7] = psheet.crop(pWidth * 7, pHeight, pWidth, pHeight); player_left[8] = psheet.crop(pWidth * 8, pHeight, pWidth, pHeight); player_down[0] = psheet.crop(0, pHeight * 2, pWidth, pHeight); player_down[1] = psheet.crop(pWidth , pHeight * 2, pWidth, pHeight); player_down[2] = psheet.crop(pWidth * 2, pHeight * 2, pWidth, pHeight); player_down[3] = psheet.crop(pWidth * 3, pHeight * 2, pWidth, pHeight); player_down[4] = psheet.crop(pWidth * 4, pHeight * 2, pWidth, pHeight); player_down[5] = psheet.crop(pWidth * 5, pHeight * 2, pWidth, pHeight); player_down[6] = psheet.crop(pWidth * 6, pHeight * 2, pWidth, pHeight); player_down[7] = psheet.crop(pWidth * 7, pHeight * 2, pWidth, pHeight); player_down[8] = psheet.crop(pWidth * 8, pHeight * 2, pWidth, pHeight); player_right[0] = psheet.crop(0, pHeight * 3, pWidth, pHeight); player_right[1] = psheet.crop(pWidth , pHeight * 3, pWidth, pHeight); player_right[2] = psheet.crop(pWidth * 2, pHeight * 3, pWidth, pHeight); player_right[3] = psheet.crop(pWidth * 3, pHeight * 3, pWidth, pHeight); player_right[4] = psheet.crop(pWidth * 4, pHeight * 3, pWidth, pHeight); player_right[5] = psheet.crop(pWidth * 5, pHeight * 3, pWidth, pHeight); player_right[6] = psheet.crop(pWidth * 6, pHeight * 3, pWidth, pHeight); player_right[7] = psheet.crop(pWidth * 7, pHeight * 3, pWidth, pHeight); player_right[8] = psheet.crop(pWidth * 8, pHeight * 3, pWidth, pHeight); //Enemy Animation enemy_still = new BufferedImage[4]; enemy_up = new BufferedImage[9]; enemy_left = new BufferedImage[9]; enemy_down = new BufferedImage[9]; enemy_right = new BufferedImage[9]; enemy_still[0] = esheet.crop(0, pHeight * 2, pWidth, pHeight); enemy_still[1] = esheet.crop(0, pHeight, pWidth, pHeight); enemy_still[2] = esheet.crop(0, pHeight * 3, pWidth, pHeight); enemy_still[3] = esheet.crop(0,0, pWidth, pHeight); enemy_up[0] = esheet.crop(0,0, pWidth, pHeight); enemy_up[1] = esheet.crop(pWidth,0, pWidth, pHeight); enemy_up[2] = esheet.crop(pWidth * 2,0, pWidth, pHeight); enemy_up[3] = esheet.crop(pWidth * 3,0, pWidth, pHeight); enemy_up[4] = esheet.crop(pWidth * 4,0, pWidth, pHeight); enemy_up[5] = esheet.crop(pWidth * 5,0, pWidth, pHeight); enemy_up[6] = esheet.crop(pWidth * 6,0, pWidth, pHeight); enemy_up[7] = esheet.crop(pWidth * 7,0, pWidth, pHeight); enemy_up[8] = esheet.crop(pWidth * 8,0, pWidth, pHeight); enemy_left[0] = esheet.crop(0, pHeight, pWidth, pHeight); enemy_left[1] = esheet.crop(pWidth, pHeight, pWidth, pHeight); enemy_left[2] = esheet.crop(pWidth * 2, pHeight, pWidth, pHeight); enemy_left[3] = esheet.crop(pWidth * 3, pHeight, pWidth, pHeight); enemy_left[4] = esheet.crop(pWidth * 4, pHeight, pWidth, pHeight); enemy_left[5] = esheet.crop(pWidth * 5, pHeight, pWidth, pHeight); enemy_left[6] = esheet.crop(pWidth * 6, pHeight, pWidth, pHeight); enemy_left[7] = esheet.crop(pWidth * 7, pHeight, pWidth, pHeight); enemy_left[8] = esheet.crop(pWidth * 8, pHeight, pWidth, pHeight); enemy_down[0] = esheet.crop(0, pHeight * 2, pWidth, pHeight); enemy_down[1] = esheet.crop(pWidth , pHeight * 2, pWidth, pHeight); enemy_down[2] = esheet.crop(pWidth * 2, pHeight * 2, pWidth, pHeight); enemy_down[3] = esheet.crop(pWidth * 3, pHeight * 2, pWidth, pHeight); enemy_down[4] = esheet.crop(pWidth * 4, pHeight * 2, pWidth, pHeight); enemy_down[5] = esheet.crop(pWidth * 5, pHeight * 2, pWidth, pHeight); enemy_down[6] = esheet.crop(pWidth * 6, pHeight * 2, pWidth, pHeight); enemy_down[7] = esheet.crop(pWidth * 7, pHeight * 2, pWidth, pHeight); enemy_down[8] = esheet.crop(pWidth * 8, pHeight * 2, pWidth, pHeight); enemy_right[0] = esheet.crop(0, pHeight * 3, pWidth, pHeight); enemy_right[1] = esheet.crop(pWidth , pHeight * 3, pWidth, pHeight); enemy_right[2] = esheet.crop(pWidth * 2, pHeight * 3, pWidth, pHeight); enemy_right[3] = esheet.crop(pWidth * 3, pHeight * 3, pWidth, pHeight); enemy_right[4] = esheet.crop(pWidth * 4, pHeight * 3, pWidth, pHeight); enemy_right[5] = esheet.crop(pWidth * 5, pHeight * 3, pWidth, pHeight); enemy_right[6] = esheet.crop(pWidth * 6, pHeight * 3, pWidth, pHeight); enemy_right[7] = esheet.crop(pWidth * 7, pHeight * 3, pWidth, pHeight); enemy_right[8] = esheet.crop(pWidth * 8, pHeight * 3, pWidth, pHeight); //World Tiles brick = sheet.crop(0,0 , width, height); rock = sheet.crop(width, 0, width, height); cell = sheet.crop(width * 2, 0, width, height); dirt = sheet.crop(width * 3, 0, width, height); carpetLeft = sheet.crop(width * 4, 0, width, height); carpetRight = sheet.crop(width * 5, 0, width, height); statue = new BufferedImage[3]; statue[0] = ssheet.crop(0,0, width, height); statue[1] = ssheet.crop(width, 0, width, height); statue[2] = ssheet.crop(width * 2, 0, width, height); //NPC prisoner = new BufferedImage[5]; prisoner[0] = nsheet.crop(0, 0, pWidth, pHeight); prisoner[1] = nsheet.crop(pWidth, 0, pWidth, pHeight); prisoner[2] = nsheet.crop(pWidth * 2, 0, pWidth, pHeight); prisoner[3] = nsheet.crop(pWidth * 3, 0, pWidth, pHeight); prisoner[4] = nsheet.crop(0, pHeight, pWidth, pHeight); } }
UTF-8
Java
8,407
java
Asset.java
Java
[]
null
[]
package game.assets; import java.awt.image.BufferedImage; public class Asset { private static final int width = 32, height = 32; private static final int pWidth = 64, pHeight = 64; public static BufferedImage brick, rock, cell, dirt, carpetLeft, carpetRight; public static BufferedImage[] prisoner; public static BufferedImage[] statue; public static BufferedImage[] player_still, player_up, player_down, player_left, player_right; public static BufferedImage[] enemy_still, enemy_up, enemy_down, enemy_left, enemy_right; public static void init(){ SpriteSheet sheet = new SpriteSheet(ImageLoader.loadImage("/tiles.png")); SpriteSheet psheet = new SpriteSheet(ImageLoader.loadImage("/player.png"));; SpriteSheet nsheet = new SpriteSheet(ImageLoader.loadImage("/npc.png")); SpriteSheet ssheet = new SpriteSheet(ImageLoader.loadImage("/statue.png")); SpriteSheet esheet = new SpriteSheet(ImageLoader.loadImage("/enemy.png")); //Player Animation player_still = new BufferedImage[4]; player_up = new BufferedImage[9]; player_left = new BufferedImage[9]; player_down = new BufferedImage[9]; player_right = new BufferedImage[9]; //Down0 player_still[0] = psheet.crop(0, pHeight * 2, pWidth, pHeight); //Left1 player_still[1] = psheet.crop(0, pHeight, pWidth, pHeight); //Right2 player_still[2] = psheet.crop(0, pHeight * 3, pWidth, pHeight); //Up3 player_still[3] = psheet.crop(0,0, pWidth, pHeight); player_up[0] = psheet.crop(0,0, pWidth, pHeight); player_up[1] = psheet.crop(pWidth,0, pWidth, pHeight); player_up[2] = psheet.crop(pWidth * 2,0, pWidth, pHeight); player_up[3] = psheet.crop(pWidth * 3,0, pWidth, pHeight); player_up[4] = psheet.crop(pWidth * 4,0, pWidth, pHeight); player_up[5] = psheet.crop(pWidth * 5,0, pWidth, pHeight); player_up[6] = psheet.crop(pWidth * 6,0, pWidth, pHeight); player_up[7] = psheet.crop(pWidth * 7,0, pWidth, pHeight); player_up[8] = psheet.crop(pWidth * 8,0, pWidth, pHeight); player_left[0] = psheet.crop(0, pHeight, pWidth, pHeight); player_left[1] = psheet.crop(pWidth, pHeight, pWidth, pHeight); player_left[2] = psheet.crop(pWidth * 2, pHeight, pWidth, pHeight); player_left[3] = psheet.crop(pWidth * 3, pHeight, pWidth, pHeight); player_left[4] = psheet.crop(pWidth * 4, pHeight, pWidth, pHeight); player_left[5] = psheet.crop(pWidth * 5, pHeight, pWidth, pHeight); player_left[6] = psheet.crop(pWidth * 6, pHeight, pWidth, pHeight); player_left[7] = psheet.crop(pWidth * 7, pHeight, pWidth, pHeight); player_left[8] = psheet.crop(pWidth * 8, pHeight, pWidth, pHeight); player_down[0] = psheet.crop(0, pHeight * 2, pWidth, pHeight); player_down[1] = psheet.crop(pWidth , pHeight * 2, pWidth, pHeight); player_down[2] = psheet.crop(pWidth * 2, pHeight * 2, pWidth, pHeight); player_down[3] = psheet.crop(pWidth * 3, pHeight * 2, pWidth, pHeight); player_down[4] = psheet.crop(pWidth * 4, pHeight * 2, pWidth, pHeight); player_down[5] = psheet.crop(pWidth * 5, pHeight * 2, pWidth, pHeight); player_down[6] = psheet.crop(pWidth * 6, pHeight * 2, pWidth, pHeight); player_down[7] = psheet.crop(pWidth * 7, pHeight * 2, pWidth, pHeight); player_down[8] = psheet.crop(pWidth * 8, pHeight * 2, pWidth, pHeight); player_right[0] = psheet.crop(0, pHeight * 3, pWidth, pHeight); player_right[1] = psheet.crop(pWidth , pHeight * 3, pWidth, pHeight); player_right[2] = psheet.crop(pWidth * 2, pHeight * 3, pWidth, pHeight); player_right[3] = psheet.crop(pWidth * 3, pHeight * 3, pWidth, pHeight); player_right[4] = psheet.crop(pWidth * 4, pHeight * 3, pWidth, pHeight); player_right[5] = psheet.crop(pWidth * 5, pHeight * 3, pWidth, pHeight); player_right[6] = psheet.crop(pWidth * 6, pHeight * 3, pWidth, pHeight); player_right[7] = psheet.crop(pWidth * 7, pHeight * 3, pWidth, pHeight); player_right[8] = psheet.crop(pWidth * 8, pHeight * 3, pWidth, pHeight); //Enemy Animation enemy_still = new BufferedImage[4]; enemy_up = new BufferedImage[9]; enemy_left = new BufferedImage[9]; enemy_down = new BufferedImage[9]; enemy_right = new BufferedImage[9]; enemy_still[0] = esheet.crop(0, pHeight * 2, pWidth, pHeight); enemy_still[1] = esheet.crop(0, pHeight, pWidth, pHeight); enemy_still[2] = esheet.crop(0, pHeight * 3, pWidth, pHeight); enemy_still[3] = esheet.crop(0,0, pWidth, pHeight); enemy_up[0] = esheet.crop(0,0, pWidth, pHeight); enemy_up[1] = esheet.crop(pWidth,0, pWidth, pHeight); enemy_up[2] = esheet.crop(pWidth * 2,0, pWidth, pHeight); enemy_up[3] = esheet.crop(pWidth * 3,0, pWidth, pHeight); enemy_up[4] = esheet.crop(pWidth * 4,0, pWidth, pHeight); enemy_up[5] = esheet.crop(pWidth * 5,0, pWidth, pHeight); enemy_up[6] = esheet.crop(pWidth * 6,0, pWidth, pHeight); enemy_up[7] = esheet.crop(pWidth * 7,0, pWidth, pHeight); enemy_up[8] = esheet.crop(pWidth * 8,0, pWidth, pHeight); enemy_left[0] = esheet.crop(0, pHeight, pWidth, pHeight); enemy_left[1] = esheet.crop(pWidth, pHeight, pWidth, pHeight); enemy_left[2] = esheet.crop(pWidth * 2, pHeight, pWidth, pHeight); enemy_left[3] = esheet.crop(pWidth * 3, pHeight, pWidth, pHeight); enemy_left[4] = esheet.crop(pWidth * 4, pHeight, pWidth, pHeight); enemy_left[5] = esheet.crop(pWidth * 5, pHeight, pWidth, pHeight); enemy_left[6] = esheet.crop(pWidth * 6, pHeight, pWidth, pHeight); enemy_left[7] = esheet.crop(pWidth * 7, pHeight, pWidth, pHeight); enemy_left[8] = esheet.crop(pWidth * 8, pHeight, pWidth, pHeight); enemy_down[0] = esheet.crop(0, pHeight * 2, pWidth, pHeight); enemy_down[1] = esheet.crop(pWidth , pHeight * 2, pWidth, pHeight); enemy_down[2] = esheet.crop(pWidth * 2, pHeight * 2, pWidth, pHeight); enemy_down[3] = esheet.crop(pWidth * 3, pHeight * 2, pWidth, pHeight); enemy_down[4] = esheet.crop(pWidth * 4, pHeight * 2, pWidth, pHeight); enemy_down[5] = esheet.crop(pWidth * 5, pHeight * 2, pWidth, pHeight); enemy_down[6] = esheet.crop(pWidth * 6, pHeight * 2, pWidth, pHeight); enemy_down[7] = esheet.crop(pWidth * 7, pHeight * 2, pWidth, pHeight); enemy_down[8] = esheet.crop(pWidth * 8, pHeight * 2, pWidth, pHeight); enemy_right[0] = esheet.crop(0, pHeight * 3, pWidth, pHeight); enemy_right[1] = esheet.crop(pWidth , pHeight * 3, pWidth, pHeight); enemy_right[2] = esheet.crop(pWidth * 2, pHeight * 3, pWidth, pHeight); enemy_right[3] = esheet.crop(pWidth * 3, pHeight * 3, pWidth, pHeight); enemy_right[4] = esheet.crop(pWidth * 4, pHeight * 3, pWidth, pHeight); enemy_right[5] = esheet.crop(pWidth * 5, pHeight * 3, pWidth, pHeight); enemy_right[6] = esheet.crop(pWidth * 6, pHeight * 3, pWidth, pHeight); enemy_right[7] = esheet.crop(pWidth * 7, pHeight * 3, pWidth, pHeight); enemy_right[8] = esheet.crop(pWidth * 8, pHeight * 3, pWidth, pHeight); //World Tiles brick = sheet.crop(0,0 , width, height); rock = sheet.crop(width, 0, width, height); cell = sheet.crop(width * 2, 0, width, height); dirt = sheet.crop(width * 3, 0, width, height); carpetLeft = sheet.crop(width * 4, 0, width, height); carpetRight = sheet.crop(width * 5, 0, width, height); statue = new BufferedImage[3]; statue[0] = ssheet.crop(0,0, width, height); statue[1] = ssheet.crop(width, 0, width, height); statue[2] = ssheet.crop(width * 2, 0, width, height); //NPC prisoner = new BufferedImage[5]; prisoner[0] = nsheet.crop(0, 0, pWidth, pHeight); prisoner[1] = nsheet.crop(pWidth, 0, pWidth, pHeight); prisoner[2] = nsheet.crop(pWidth * 2, 0, pWidth, pHeight); prisoner[3] = nsheet.crop(pWidth * 3, 0, pWidth, pHeight); prisoner[4] = nsheet.crop(0, pHeight, pWidth, pHeight); } }
8,407
0.617343
0.585464
160
51.543751
29.701399
98
false
false
0
0
0
0
0
0
2.6125
false
false
2
d01f68d974f518a87840b63e732fe7cb6a5023b8
27,084,063,777,409
3afd49de8efbf82b573375785a82ee7f93e03e99
/app/src/main/java/com/swsdkj/wsl/config/MyConfig.java
4d0045a8c26b9ccdc95e871887d508bfded50c23
[]
no_license
yanggg1133/chengguan
https://github.com/yanggg1133/chengguan
e7bcb5c0822717633185e252ae908067ad01a9b2
eda2676b52f317b95f4409bf2e3d7dcfa1d6a894
refs/heads/master
2020-03-07T02:47:34.959000
2017-10-31T01:29:04
2017-10-31T01:29:30
127,217,567
1
0
null
true
2018-03-29T01:09:21
2018-03-29T01:09:21
2017-10-26T10:24:56
2017-10-31T01:34:32
87,270
0
0
0
null
false
null
package com.swsdkj.wsl.config; /** * Created by Administrator on 2017/4/25 0025. */ public class MyConfig { public static String myAddress=null; public static String myCity = null; public static Double Lat;//纬度 public static Double Lng;//经度 /** * 权限常量相关 */ public static final int WRITE_EXTERNAL_CODE = 0x01; public static final int CALL_PHONE_CODE = 0x02; public static final int CAMERA_CODE = 0x03; public static final int RADIO_CODE = 0x04; }
UTF-8
Java
517
java
MyConfig.java
Java
[ { "context": "package com.swsdkj.wsl.config;\n\n/**\n * Created by Administrator on 2017/4/25 0025.\n */\n\npublic class MyConfig {\n ", "end": 63, "score": 0.5283855199813843, "start": 50, "tag": "USERNAME", "value": "Administrator" } ]
null
[]
package com.swsdkj.wsl.config; /** * Created by Administrator on 2017/4/25 0025. */ public class MyConfig { public static String myAddress=null; public static String myCity = null; public static Double Lat;//纬度 public static Double Lng;//经度 /** * 权限常量相关 */ public static final int WRITE_EXTERNAL_CODE = 0x01; public static final int CALL_PHONE_CODE = 0x02; public static final int CAMERA_CODE = 0x03; public static final int RADIO_CODE = 0x04; }
517
0.674044
0.627767
19
25.157894
19.377857
55
false
false
0
0
0
0
0
0
0.473684
false
false
2
320681ef5d1ffd9d0a3121c6419f506f92958783
27,084,063,774,466
7a03f3a119ff175b052ebdc3962a8ada833a505e
/src/main/java/com/veqveq/onlinemarket/controllers/ProductController.java
09375fc7dd3b03a98ed5843b722d222f63a9f18e
[]
no_license
veqveq/GB.Java6.OnlineMarket
https://github.com/veqveq/GB.Java6.OnlineMarket
e4e0cdcaf2e49404248fe1ac4fa3bb3e749956de
8376d7e2e60c72545afd1f843219990b3dcf7a89
refs/heads/master
2023-04-13T18:31:19.908000
2021-04-27T09:16:10
2021-04-27T09:16:10
331,357,316
0
0
null
false
2021-04-27T09:16:18
2021-01-20T15:59:41
2021-04-20T11:19:06
2021-04-27T09:16:17
321
0
0
1
Java
false
false
package com.veqveq.onlinemarket.controllers; import com.veqveq.onlinemarket.dto.ProductDto; import com.veqveq.onlinemarket.exceptions.ResourceNotFoundException; import com.veqveq.onlinemarket.services.ProductService; import com.veqveq.onlinemarket.specifications.ProductSpecifications; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.http.HttpStatus; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("api/v1/products") @RequiredArgsConstructor public class ProductController { private final ProductService productService; @GetMapping("/{id}") private ProductDto findById(@PathVariable long id) { return productService.findDtoById(id).orElseThrow(() -> new ResourceNotFoundException(String.format("Resource by id: %d not found", id))); } @GetMapping private Page<ProductDto> findByCost(@RequestParam MultiValueMap<String, String> params, @RequestParam(name = "numb", defaultValue = "1") Integer number, @RequestParam(name = "size", defaultValue = "10") Integer size ) { if (number < 1) { number = 1; } return productService.findAll(ProductSpecifications.build(params), number, size); } @DeleteMapping("/{id}") private void delete(@PathVariable Long id) { productService.deleteById(id); } @ResponseStatus(HttpStatus.CREATED) @PostMapping private void save(@RequestBody ProductDto product) { productService.save(product); } @ResponseStatus(HttpStatus.OK) @PutMapping private void update(@RequestBody ProductDto product) { productService.update(product); } }
UTF-8
Java
1,829
java
ProductController.java
Java
[]
null
[]
package com.veqveq.onlinemarket.controllers; import com.veqveq.onlinemarket.dto.ProductDto; import com.veqveq.onlinemarket.exceptions.ResourceNotFoundException; import com.veqveq.onlinemarket.services.ProductService; import com.veqveq.onlinemarket.specifications.ProductSpecifications; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.http.HttpStatus; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("api/v1/products") @RequiredArgsConstructor public class ProductController { private final ProductService productService; @GetMapping("/{id}") private ProductDto findById(@PathVariable long id) { return productService.findDtoById(id).orElseThrow(() -> new ResourceNotFoundException(String.format("Resource by id: %d not found", id))); } @GetMapping private Page<ProductDto> findByCost(@RequestParam MultiValueMap<String, String> params, @RequestParam(name = "numb", defaultValue = "1") Integer number, @RequestParam(name = "size", defaultValue = "10") Integer size ) { if (number < 1) { number = 1; } return productService.findAll(ProductSpecifications.build(params), number, size); } @DeleteMapping("/{id}") private void delete(@PathVariable Long id) { productService.deleteById(id); } @ResponseStatus(HttpStatus.CREATED) @PostMapping private void save(@RequestBody ProductDto product) { productService.save(product); } @ResponseStatus(HttpStatus.OK) @PutMapping private void update(@RequestBody ProductDto product) { productService.update(product); } }
1,829
0.706944
0.703663
51
34.862743
31.461163
146
false
false
0
0
0
0
0
0
0.490196
false
false
2
f5415229fbc7941e7cf6b880c42c8a48a9ed6c6c
22,677,427,356,553
4a84baed65f3eede40973817bd606d813f83e740
/tests/org.jboss.tools.fuse.ui.bot.test/src/org/jboss/tools/fuse/ui/bot/test/suite/ServerTests.java
2aa2416ff18a470c36c82361def86b089b633850
[]
no_license
tsedmik/jbosstools-integration-stack-tests
https://github.com/tsedmik/jbosstools-integration-stack-tests
f4b14b29842efaa09be30448ae02bc42da3d91fd
26984cfc243ee91dba63807dd430b5e20ca4972f
refs/heads/master
2021-01-21T15:43:38.486000
2017-08-28T08:32:16
2017-08-28T10:10:59
13,615,821
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.jboss.tools.fuse.ui.bot.test.suite; import org.jboss.reddeer.junit.runner.RedDeerSuite; import org.jboss.tools.fuse.ui.bot.test.DataTransformationDeploymentTest; import org.jboss.tools.fuse.ui.bot.test.DeploymentTest; import org.jboss.tools.fuse.ui.bot.test.JMXNavigatorServerTest; import org.jboss.tools.fuse.ui.bot.test.QuickStartsTest; import org.jboss.tools.fuse.ui.bot.test.ServerJRETest; import org.jboss.tools.fuse.ui.bot.test.ServerTest; import org.junit.runner.RunWith; import org.junit.runners.Suite.SuiteClasses; import junit.framework.TestSuite; /** * Runs tests that need a Fuse server instance on Fuse Tooling * * @author tsedmik */ @SuiteClasses({ DataTransformationDeploymentTest.class, DeploymentTest.class, JMXNavigatorServerTest.class, QuickStartsTest.class, ServerTest.class, ServerJRETest.class }) @RunWith(RedDeerSuite.class) public class ServerTests extends TestSuite { }
UTF-8
Java
922
java
ServerTests.java
Java
[ { "context": "use server instance on Fuse Tooling\n * \n * @author tsedmik\n */\n@SuiteClasses({\n\tDataTransformationDeployment", "end": 662, "score": 0.9990725517272949, "start": 655, "tag": "USERNAME", "value": "tsedmik" } ]
null
[]
package org.jboss.tools.fuse.ui.bot.test.suite; import org.jboss.reddeer.junit.runner.RedDeerSuite; import org.jboss.tools.fuse.ui.bot.test.DataTransformationDeploymentTest; import org.jboss.tools.fuse.ui.bot.test.DeploymentTest; import org.jboss.tools.fuse.ui.bot.test.JMXNavigatorServerTest; import org.jboss.tools.fuse.ui.bot.test.QuickStartsTest; import org.jboss.tools.fuse.ui.bot.test.ServerJRETest; import org.jboss.tools.fuse.ui.bot.test.ServerTest; import org.junit.runner.RunWith; import org.junit.runners.Suite.SuiteClasses; import junit.framework.TestSuite; /** * Runs tests that need a Fuse server instance on Fuse Tooling * * @author tsedmik */ @SuiteClasses({ DataTransformationDeploymentTest.class, DeploymentTest.class, JMXNavigatorServerTest.class, QuickStartsTest.class, ServerTest.class, ServerJRETest.class }) @RunWith(RedDeerSuite.class) public class ServerTests extends TestSuite { }
922
0.809111
0.809111
30
29.733334
22.226011
73
false
false
0
0
0
0
0
0
0.733333
false
false
2
8a7f20f6a1682b478082f9c2a880c91ad1ddeef9
1,967,095,050,080
254ef555d1feab2a4c4cc3cc3acd7eb6952995be
/app/src/main/java/app/everydayempire/tv/fragments/ChallengeFragment.java
270c5d7b55ce450aebf58283b6d52bf5e4bacc55
[]
no_license
whitetiger1002/EverydayEmpire_android
https://github.com/whitetiger1002/EverydayEmpire_android
03179e5f26f5fc9174b57e7f53e19ba43ab0f699
de8ba9e98cb54290776916b596802d297eb7cac9
refs/heads/master
2023-04-04T03:13:23.110000
2021-04-20T20:08:50
2021-04-20T20:08:50
359,101,859
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package app.everydayempire.tv.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.facebook.drawee.view.SimpleDraweeView; import java.util.ArrayList; import app.everydayempire.tv.R; import app.everydayempire.tv.activities.MainActivity; import app.everydayempire.tv.data.ClipDataSource; import app.everydayempire.tv.data.models.Challenge; public class ChallengeFragment extends Fragment { public static String ARG_CHALLENGE = "challenge"; private Challenge mChallenge; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mChallenge = requireArguments().getParcelable(ARG_CHALLENGE); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_challenge, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); SimpleDraweeView image = view.findViewById(R.id.image); image.setImageURI(mChallenge.image); image.setOnClickListener(v -> { ArrayList<String> hashtags = new ArrayList<>(); hashtags.add(mChallenge.hashtag); Bundle params = new Bundle(); params.putStringArrayList(ClipDataSource.PARAM_HASHTAGS, hashtags); ((MainActivity) requireActivity()).showClips('#' + mChallenge.hashtag, params); }); } public static ChallengeFragment newInstance(Challenge challenge) { Bundle arguments = new Bundle(); arguments.putParcelable(ARG_CHALLENGE, challenge); ChallengeFragment fragment = new ChallengeFragment(); fragment.setArguments(arguments); return fragment; } }
UTF-8
Java
2,086
java
ChallengeFragment.java
Java
[]
null
[]
package app.everydayempire.tv.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.facebook.drawee.view.SimpleDraweeView; import java.util.ArrayList; import app.everydayempire.tv.R; import app.everydayempire.tv.activities.MainActivity; import app.everydayempire.tv.data.ClipDataSource; import app.everydayempire.tv.data.models.Challenge; public class ChallengeFragment extends Fragment { public static String ARG_CHALLENGE = "challenge"; private Challenge mChallenge; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mChallenge = requireArguments().getParcelable(ARG_CHALLENGE); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_challenge, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); SimpleDraweeView image = view.findViewById(R.id.image); image.setImageURI(mChallenge.image); image.setOnClickListener(v -> { ArrayList<String> hashtags = new ArrayList<>(); hashtags.add(mChallenge.hashtag); Bundle params = new Bundle(); params.putStringArrayList(ClipDataSource.PARAM_HASHTAGS, hashtags); ((MainActivity) requireActivity()).showClips('#' + mChallenge.hashtag, params); }); } public static ChallengeFragment newInstance(Challenge challenge) { Bundle arguments = new Bundle(); arguments.putParcelable(ARG_CHALLENGE, challenge); ChallengeFragment fragment = new ChallengeFragment(); fragment.setArguments(arguments); return fragment; } }
2,086
0.729147
0.729147
60
33.766666
28.725348
132
false
false
0
0
0
0
0
0
0.7
false
false
2
949bdb0f0a5981e866789689e28cc23f811a7e1d
30,013,231,467,114
deab6736ff760b0741ff55028b74b94d2e599d70
/src/main/java/com/github/loki/afro/metallum/core/parser/site/helper/disc/DiscSiteMemberParser.java
37d30e1092106588629aaa6645be38858363ab49
[ "Beerware" ]
permissive
Loki-Afro/metalarchives
https://github.com/Loki-Afro/metalarchives
37d0bac7491876f3cc3ddba8f285e09f0d2be9a3
0df998696dae84e2c6b5f3831ce1db8d97d2b7c6
refs/heads/master
2023-06-27T18:26:52.089000
2023-06-08T17:19:28
2023-06-08T17:19:28
35,333,468
43
21
NOASSERTION
false
2023-04-04T09:23:41
2015-05-09T15:23:02
2023-03-30T16:55:50
2023-04-04T09:23:40
9,876
35
10
0
Java
false
false
package com.github.loki.afro.metallum.core.parser.site.helper.disc; import com.github.loki.afro.metallum.core.util.MetallumUtil; import com.github.loki.afro.metallum.entity.Disc; import com.github.loki.afro.metallum.entity.Member; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class DiscSiteMemberParser { private final List<Disc.PartialMember> albumLineupList = new ArrayList<>(); private final List<Disc.PartialMember> guestLineupList = new ArrayList<>(); private final List<Disc.PartialMember> otherMemberList = new ArrayList<>(); private final Document doc; private static final Logger LOGGER = LoggerFactory.getLogger(DiscSiteMemberParser.class); private enum MemberCategory { ALBUM_LINEUP("Band members"), ALBUM_GUEST("Guest/session musicians", "Guest/Session"), ALBUM_OTHER("Other staff", "Misc. staff", "Miscellaneous staff"); private final String[] asString; MemberCategory(final String... asString) { this.asString = asString; } public static MemberCategory getMemberTypeForString(final String possibleMemberCategory) { for (final MemberCategory cat : values()) { if (MetallumUtil.isStringInArray(possibleMemberCategory, cat.asString)) { return cat; } } LOGGER.error("MemberCategory: " + possibleMemberCategory); return null; } } public DiscSiteMemberParser(final Document htmlDocument) { this.doc = htmlDocument; } public final void parse() { Element lineUpElementAll = this.doc.getElementById("album_all_members_lineup"); String category = null; // important when there are no categories or just one, happens often by Split DVDs and such things if (lineUpElementAll == null) { lineUpElementAll = this.doc.getElementById("album_members_lineup"); // not 100% sure when this occurs but sometimes there is just "Misc.staff" if (lineUpElementAll != null) { category = this.doc.getElementsByAttributeValue("href", "#album_members_lineup").first().text(); } else { lineUpElementAll = this.doc.getElementById("album_members_misc"); category = this.doc.getElementsByAttributeValue("href", "#album_members_misc").first().text(); } } Elements tableRows = lineUpElementAll.getElementsByTag("tr"); for (final Element row : tableRows) { if (row.hasClass("lineupHeaders")) { category = row.text(); } else if (row.hasClass("lineupRow")) { Disc.PartialMember member = parseMember(row); addToMemberList(member, category); } } } private Disc.PartialMember parseMember(final Element memberRow) { String memberIdStr = "0"; Element memberLink = memberRow.getElementsByAttribute("href").first(); if (memberLink != null) { memberIdStr = memberLink.attr("href"); memberIdStr = memberIdStr.substring(memberIdStr.lastIndexOf("/") + 1); } else { LOGGER.warn("Member without Link detected, please report that; Member = " + memberRow.text()); } String role = memberRow.getElementsByTag("td").last().text(); String memberName = memberLink != null ? memberLink.text() : memberRow.text(); return new Disc.PartialMember(Long.parseLong(memberIdStr), memberName, role); } private void addToMemberList(final Disc.PartialMember memberToAdd, final String category) { final MemberCategory cat = MemberCategory.getMemberTypeForString(category); switch (cat) { case ALBUM_LINEUP: this.albumLineupList.add(memberToAdd); break; case ALBUM_GUEST: this.guestLineupList.add(memberToAdd); break; case ALBUM_OTHER: this.otherMemberList.add(memberToAdd); break; default: break; } } public final List<Disc.PartialMember> getLineup() { return this.albumLineupList; } public final List<Disc.PartialMember> getOtherLineup() { return this.otherMemberList; } public final List<Disc.PartialMember> getGuestLineup() { return this.guestLineupList; } }
UTF-8
Java
4,643
java
DiscSiteMemberParser.java
Java
[]
null
[]
package com.github.loki.afro.metallum.core.parser.site.helper.disc; import com.github.loki.afro.metallum.core.util.MetallumUtil; import com.github.loki.afro.metallum.entity.Disc; import com.github.loki.afro.metallum.entity.Member; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class DiscSiteMemberParser { private final List<Disc.PartialMember> albumLineupList = new ArrayList<>(); private final List<Disc.PartialMember> guestLineupList = new ArrayList<>(); private final List<Disc.PartialMember> otherMemberList = new ArrayList<>(); private final Document doc; private static final Logger LOGGER = LoggerFactory.getLogger(DiscSiteMemberParser.class); private enum MemberCategory { ALBUM_LINEUP("Band members"), ALBUM_GUEST("Guest/session musicians", "Guest/Session"), ALBUM_OTHER("Other staff", "Misc. staff", "Miscellaneous staff"); private final String[] asString; MemberCategory(final String... asString) { this.asString = asString; } public static MemberCategory getMemberTypeForString(final String possibleMemberCategory) { for (final MemberCategory cat : values()) { if (MetallumUtil.isStringInArray(possibleMemberCategory, cat.asString)) { return cat; } } LOGGER.error("MemberCategory: " + possibleMemberCategory); return null; } } public DiscSiteMemberParser(final Document htmlDocument) { this.doc = htmlDocument; } public final void parse() { Element lineUpElementAll = this.doc.getElementById("album_all_members_lineup"); String category = null; // important when there are no categories or just one, happens often by Split DVDs and such things if (lineUpElementAll == null) { lineUpElementAll = this.doc.getElementById("album_members_lineup"); // not 100% sure when this occurs but sometimes there is just "Misc.staff" if (lineUpElementAll != null) { category = this.doc.getElementsByAttributeValue("href", "#album_members_lineup").first().text(); } else { lineUpElementAll = this.doc.getElementById("album_members_misc"); category = this.doc.getElementsByAttributeValue("href", "#album_members_misc").first().text(); } } Elements tableRows = lineUpElementAll.getElementsByTag("tr"); for (final Element row : tableRows) { if (row.hasClass("lineupHeaders")) { category = row.text(); } else if (row.hasClass("lineupRow")) { Disc.PartialMember member = parseMember(row); addToMemberList(member, category); } } } private Disc.PartialMember parseMember(final Element memberRow) { String memberIdStr = "0"; Element memberLink = memberRow.getElementsByAttribute("href").first(); if (memberLink != null) { memberIdStr = memberLink.attr("href"); memberIdStr = memberIdStr.substring(memberIdStr.lastIndexOf("/") + 1); } else { LOGGER.warn("Member without Link detected, please report that; Member = " + memberRow.text()); } String role = memberRow.getElementsByTag("td").last().text(); String memberName = memberLink != null ? memberLink.text() : memberRow.text(); return new Disc.PartialMember(Long.parseLong(memberIdStr), memberName, role); } private void addToMemberList(final Disc.PartialMember memberToAdd, final String category) { final MemberCategory cat = MemberCategory.getMemberTypeForString(category); switch (cat) { case ALBUM_LINEUP: this.albumLineupList.add(memberToAdd); break; case ALBUM_GUEST: this.guestLineupList.add(memberToAdd); break; case ALBUM_OTHER: this.otherMemberList.add(memberToAdd); break; default: break; } } public final List<Disc.PartialMember> getLineup() { return this.albumLineupList; } public final List<Disc.PartialMember> getOtherLineup() { return this.otherMemberList; } public final List<Disc.PartialMember> getGuestLineup() { return this.guestLineupList; } }
4,643
0.642473
0.640965
115
39.373913
32.455578
160
false
false
0
0
0
0
0
0
0.617391
false
false
2
17da8e2bb2c7695df6337ffb324b7914abf7ece1
13,219,909,352,416
265cbafb32e060a125e90143450038df20929eec
/src/main/java/com/fintech/demo/persistence/daoImpl/AccountsDaoImpl.java
a4c580c3f9db55e041bc35cb5e3de00e15573317
[]
no_license
unclejide1/ft-project
https://github.com/unclejide1/ft-project
7d7e21adc0d9d9105327502e3eb477261169ccc5
4edc8c1569bc6c73b2d0a184c29efc382d4e3e1a
refs/heads/main
2023-04-09T17:17:08.951000
2021-04-23T08:40:19
2021-04-23T08:40:19
360,696,250
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.fintech.demo.persistence.daoImpl; import com.fintech.demo.dao.AccountsDao; import com.fintech.demo.exceptions.BusinessLogicConflictException; import com.fintech.demo.exceptions.NotFoundException; import com.fintech.demo.model.Accounts; import com.fintech.demo.model.enums.RecordStatusConstant; import com.fintech.demo.persistence.repository.AccountsRepository; import javax.inject.Named; import java.util.List; import java.util.Optional; @Named public class AccountsDaoImpl extends CrudDaoImpl<Accounts, Long> implements AccountsDao { private final AccountsRepository repository; public AccountsDaoImpl(AccountsRepository repository) { super(repository); this.repository = repository; } @Override public List<Accounts> getAllAccounts() { return repository.getAllByRecordStatus(RecordStatusConstant.ACTIVE); } @Override public long countAccounts() { return repository.count(); } @Override public Accounts getCardByCardNumber(String accountNo) { return findCardByCardNumber(accountNo).orElseThrow(() -> new NotFoundException("Not Found. Details for card with No: " + accountNo)); } @Override public Optional<Accounts> findCardByCardNumber(String accountNo) { return repository.findFirstByAccountNoAndRecordStatus(accountNo, RecordStatusConstant.ACTIVE); } }
UTF-8
Java
1,386
java
AccountsDaoImpl.java
Java
[]
null
[]
package com.fintech.demo.persistence.daoImpl; import com.fintech.demo.dao.AccountsDao; import com.fintech.demo.exceptions.BusinessLogicConflictException; import com.fintech.demo.exceptions.NotFoundException; import com.fintech.demo.model.Accounts; import com.fintech.demo.model.enums.RecordStatusConstant; import com.fintech.demo.persistence.repository.AccountsRepository; import javax.inject.Named; import java.util.List; import java.util.Optional; @Named public class AccountsDaoImpl extends CrudDaoImpl<Accounts, Long> implements AccountsDao { private final AccountsRepository repository; public AccountsDaoImpl(AccountsRepository repository) { super(repository); this.repository = repository; } @Override public List<Accounts> getAllAccounts() { return repository.getAllByRecordStatus(RecordStatusConstant.ACTIVE); } @Override public long countAccounts() { return repository.count(); } @Override public Accounts getCardByCardNumber(String accountNo) { return findCardByCardNumber(accountNo).orElseThrow(() -> new NotFoundException("Not Found. Details for card with No: " + accountNo)); } @Override public Optional<Accounts> findCardByCardNumber(String accountNo) { return repository.findFirstByAccountNoAndRecordStatus(accountNo, RecordStatusConstant.ACTIVE); } }
1,386
0.763348
0.763348
43
31.232557
32.399281
141
false
false
0
0
0
0
0
0
0.44186
false
false
2
06f73c6143731d65448d91ee869bd7aab8c40eca
29,867,202,626,186
c4a7393466110cb5555fd314ff1161504e7d6ee2
/Beauty/Android/business/src/com/GlamourPromise/Beauty/bean/UnpaidCustomerInfo.java
a95353735db1c2d5b26a81b7a8a5ab6a84c77963
[]
no_license
mrs-zuo/Beauty
https://github.com/mrs-zuo/Beauty
174fcc9cc2fd6cf48e93600351d8e5a2e602a053
6266896a3e2e027501bb5eccfba8cd2f1cb928b2
refs/heads/master
2023-03-11T07:16:54.441000
2021-03-01T09:29:47
2021-03-01T09:29:47
322,498,347
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.GlamourPromise.Beauty.bean; import java.io.Serializable; public class UnpaidCustomerInfo implements Serializable{ private static final long serialVersionUID = 1L; private int customerID; private String customerName;//顾客姓名 private String lastOrderTime;//最后一笔未支付的订单的下单时间 private String customerLoginMobile;//顾客的登陆号码 private String customerLoginMobileShow;//顾客的登陆号码(只显示后四位) private int unPaidOrderCount;//未支付的订单数量 public String getCustomerLoginMobileShow() { return customerLoginMobileShow; } public void setCustomerLoginMobileShow(String customerLoginMobileShow) { this.customerLoginMobileShow = customerLoginMobileShow; } public int getCustomerID() { return customerID; } public void setCustomerID(int customerID) { this.customerID = customerID; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } public String getLastOrderTime() { return lastOrderTime; } public void setLastOrderTime(String lastOrderTime) { this.lastOrderTime = lastOrderTime; } public String getCustomerLoginMobile() { return customerLoginMobile; } public void setCustomerLoginMobile(String customerLoginMobile) { this.customerLoginMobile = customerLoginMobile; } public int getUnPaidOrderCount() { return unPaidOrderCount; } public void setUnPaidOrderCount(int unPaidOrderCount) { this.unPaidOrderCount = unPaidOrderCount; } }
UTF-8
Java
1,612
java
UnpaidCustomerInfo.java
Java
[ { "context": "nt customerID;\r\n\tprivate String customerName;//顾客姓名\r\n\tprivate String lastOrderTime;//最后一笔未支付的订单的下单时间\r", "end": 248, "score": 0.9659822583198547, "start": 244, "tag": "NAME", "value": "顾客姓名" } ]
null
[]
package com.GlamourPromise.Beauty.bean; import java.io.Serializable; public class UnpaidCustomerInfo implements Serializable{ private static final long serialVersionUID = 1L; private int customerID; private String customerName;//顾客姓名 private String lastOrderTime;//最后一笔未支付的订单的下单时间 private String customerLoginMobile;//顾客的登陆号码 private String customerLoginMobileShow;//顾客的登陆号码(只显示后四位) private int unPaidOrderCount;//未支付的订单数量 public String getCustomerLoginMobileShow() { return customerLoginMobileShow; } public void setCustomerLoginMobileShow(String customerLoginMobileShow) { this.customerLoginMobileShow = customerLoginMobileShow; } public int getCustomerID() { return customerID; } public void setCustomerID(int customerID) { this.customerID = customerID; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } public String getLastOrderTime() { return lastOrderTime; } public void setLastOrderTime(String lastOrderTime) { this.lastOrderTime = lastOrderTime; } public String getCustomerLoginMobile() { return customerLoginMobile; } public void setCustomerLoginMobile(String customerLoginMobile) { this.customerLoginMobile = customerLoginMobile; } public int getUnPaidOrderCount() { return unPaidOrderCount; } public void setUnPaidOrderCount(int unPaidOrderCount) { this.unPaidOrderCount = unPaidOrderCount; } }
1,612
0.77141
0.770751
50
28.360001
21.083416
73
false
false
0
0
0
0
0
0
1.54
false
false
2
4f7a02a0c95f94036872be4e757b57224dd18f0d
31,610,959,366,474
d5ef9e9f1ca61f596a41f5c7267d908494b50abc
/CPU's Gambit/src/ResEntry.java
22c23314d433e87fea0b1fdd4344b426a6980eea
[]
no_license
sarah-abdelfattah/Simulating-Tomasulo-Architecture
https://github.com/sarah-abdelfattah/Simulating-Tomasulo-Architecture
9c3fbd2c2182861ba54be1b3b32d534962cc3176
43bebc11afe972f331bb714af94ae753719439c3
refs/heads/main
2023-05-15T13:50:10.540000
2021-01-05T00:57:08
2021-01-05T00:57:08
325,114,579
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class ResEntry { //note: busy was deleted 3lshan f el reservationStation law null --> busy = false //vk should be the offset String op; double vj, vk; String qj, qk; // "0" when resolved int A; String address;//rep of address as a string -> 32+R2 //int cyclesLeft; //Qi int initialExecutionCycle; int jReady; int kReady; public ResEntry(String op, double vj, double vk, String qj, String qk, int A, int jReady, int kReady) { this.op = op; this.vj = vj; this.vk = vk; this.qj = qj; this.qk = qk; this.A = A; this.jReady = jReady; this.kReady = kReady; // if(op.equals("LD") || op.equals("SD")) // cyclesLeft = 2; // else if(op.equals("ADD") || op.equals("SUB")) // cyclesLeft = 3; // else if(op.equals("MUL")) // cyclesLeft = 5; // else // cyclesLeft = 7; } public String toString() { return "Res Entry:" + "\t" + op + "\t" + vj + "\t" + vk + "\tqj: " + qj + "\tqk: " + qk + "\tA: " + A + "\tjReady: " + jReady + "\tkReady: " + kReady + "\n"; } // void setV(String att, double value) { // if(att.equals("j")) // this.vj = value; // else // this.vk = value; // } }
UTF-8
Java
1,199
java
ResEntry.java
Java
[]
null
[]
public class ResEntry { //note: busy was deleted 3lshan f el reservationStation law null --> busy = false //vk should be the offset String op; double vj, vk; String qj, qk; // "0" when resolved int A; String address;//rep of address as a string -> 32+R2 //int cyclesLeft; //Qi int initialExecutionCycle; int jReady; int kReady; public ResEntry(String op, double vj, double vk, String qj, String qk, int A, int jReady, int kReady) { this.op = op; this.vj = vj; this.vk = vk; this.qj = qj; this.qk = qk; this.A = A; this.jReady = jReady; this.kReady = kReady; // if(op.equals("LD") || op.equals("SD")) // cyclesLeft = 2; // else if(op.equals("ADD") || op.equals("SUB")) // cyclesLeft = 3; // else if(op.equals("MUL")) // cyclesLeft = 5; // else // cyclesLeft = 7; } public String toString() { return "Res Entry:" + "\t" + op + "\t" + vj + "\t" + vk + "\tqj: " + qj + "\tqk: " + qk + "\tA: " + A + "\tjReady: " + jReady + "\tkReady: " + kReady + "\n"; } // void setV(String att, double value) { // if(att.equals("j")) // this.vj = value; // else // this.vk = value; // } }
1,199
0.547957
0.54045
57
20.035088
18.727936
104
false
false
0
0
0
0
0
0
2.894737
false
false
2
ddde823e374665716dae266c91c3630b3f8a8737
22,402,549,477,244
52d0fc439a2e92040e4b9a716387643b0670a229
/org/apache/velocity/tools/view/tools/ImportTool.java
d1432b11d6ae28a371137fdfe49ce58ea175a7ed
[]
no_license
zzyzzyzzy123/spring5-velocity
https://github.com/zzyzzyzzy123/spring5-velocity
b9e0a1e472d7a6c857c97940cc657d422aa6cac9
99cc57ca5da9258e1c18f2e75e5ffda4e5d2ce1e
refs/heads/master
2022-11-15T13:31:28.951000
2020-07-10T03:28:35
2020-07-10T03:28:35
278,529,398
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.apache.velocity.tools.view.tools; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.velocity.tools.view.ImportSupport; import org.apache.velocity.tools.view.context.ViewContext; /** * General-purpose text-importing view tool for templates. * <p>Usage:<br /> * Just call $import.read("http://www.foo.com/bleh.jsp?sneh=bar") to insert the contents of the named * resource into the template. * </p> * <p><pre> * Toolbox configuration: * &lt;tool&gt; * &lt;key&gt;import&lt;/key&gt; * &lt;scope&gt;request&lt;/scope&gt; * &lt;class&gt;org.apache.velocity.tools.view.tools.ImportTool&lt;/class&gt; * &lt;/tool&gt; * </pre></p> * * @author <a href="mailto:marinoj@centrum.is">Marino A. Jonsson</a> * @since VelocityTools 1.1 * @version $Revision$ $Date$ */ public class ImportTool extends ImportSupport { protected static final Log LOG = LogFactory.getLog(ImportTool.class); /** * Default constructor. Tool must be initialized before use. */ public ImportTool() {} /** * Initializes this tool. * * @param obj the current ViewContext * @throws IllegalArgumentException if the param is not a ViewContext */ public void init(Object obj) { if (! (obj instanceof ViewContext)) { throw new IllegalArgumentException("Tool can only be initialized with a ViewContext"); } ViewContext context = (ViewContext) obj; this.request = context.getRequest(); this.response = context.getResponse(); this.application = context.getServletContext(); } /** * Returns the supplied URL rendered as a String. * * @param url the URL to import * @return the URL as a string */ public String read(String url) { try { // check the URL if (url == null || url.equals("")) { LOG.warn("Import URL is null or empty"); return null; } return acquireString(url); } catch (Exception ex) { LOG.error("Exception while importing URL: " + ex.getMessage()); return null; } } }
UTF-8
Java
3,026
java
ImportTool.java
Java
[ { "context": "l&gt;\n * </pre></p>\n *\n * @author <a href=\"mailto:marinoj@centrum.is\">Marino A. Jonsson</a>\n * @since VelocityTools 1.", "end": 1565, "score": 0.9998176097869873, "start": 1547, "tag": "EMAIL", "value": "marinoj@centrum.is" }, { "context": " *\n * @author <a href=...
null
[]
package org.apache.velocity.tools.view.tools; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.velocity.tools.view.ImportSupport; import org.apache.velocity.tools.view.context.ViewContext; /** * General-purpose text-importing view tool for templates. * <p>Usage:<br /> * Just call $import.read("http://www.foo.com/bleh.jsp?sneh=bar") to insert the contents of the named * resource into the template. * </p> * <p><pre> * Toolbox configuration: * &lt;tool&gt; * &lt;key&gt;import&lt;/key&gt; * &lt;scope&gt;request&lt;/scope&gt; * &lt;class&gt;org.apache.velocity.tools.view.tools.ImportTool&lt;/class&gt; * &lt;/tool&gt; * </pre></p> * * @author <a href="mailto:<EMAIL>"><NAME></a> * @since VelocityTools 1.1 * @version $Revision$ $Date$ */ public class ImportTool extends ImportSupport { protected static final Log LOG = LogFactory.getLog(ImportTool.class); /** * Default constructor. Tool must be initialized before use. */ public ImportTool() {} /** * Initializes this tool. * * @param obj the current ViewContext * @throws IllegalArgumentException if the param is not a ViewContext */ public void init(Object obj) { if (! (obj instanceof ViewContext)) { throw new IllegalArgumentException("Tool can only be initialized with a ViewContext"); } ViewContext context = (ViewContext) obj; this.request = context.getRequest(); this.response = context.getResponse(); this.application = context.getServletContext(); } /** * Returns the supplied URL rendered as a String. * * @param url the URL to import * @return the URL as a string */ public String read(String url) { try { // check the URL if (url == null || url.equals("")) { LOG.warn("Import URL is null or empty"); return null; } return acquireString(url); } catch (Exception ex) { LOG.error("Exception while importing URL: " + ex.getMessage()); return null; } } }
3,004
0.656642
0.65466
95
30.852633
25.715843
101
false
false
0
0
0
0
0
0
0.410526
false
false
2
b71f87fcc606a4f744f613405c8478d41a3ae428
22,402,549,476,510
d9390bdd4525c2fb6bedf220b9a9f42e0b85d179
/Restored/Working_Lab2_SpringMVC/src/main/java/edu/sjsu/cmpe275/lab2/controller/PhoneController.java
183a2e97c8b9ec9eb2f24221d7e4c930fe0858f9
[]
no_license
SkandaB/CMPE275_Lab2_SpringMVC
https://github.com/SkandaB/CMPE275_Lab2_SpringMVC
867277770c09361b7839899facb9e7abb8d41bd8
0f2b6e76252bd25014627094b3bffcccfb4cb200
refs/heads/master
2020-12-24T10:41:00.285000
2016-11-22T02:52:02
2016-11-22T02:52:02
73,135,725
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.sjsu.cmpe275.lab2.controller; import java.util.List; import javax.persistence.Embeddable; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.json.MappingJackson2JsonView; import edu.sjsu.cmpe275.lab2.entity.AddressEntity; import edu.sjsu.cmpe275.lab2.entity.PhoneEntity; import edu.sjsu.cmpe275.lab2.entity.UserEntity; import edu.sjsu.cmpe275.lab2.service.PhoneService; import edu.sjsu.cmpe275.lab2.service.UserSerivce; import edu.sjsu.cmpe275.lab2.validator.PhoneFormValidator; /** * @author SkandaBhargav * Controller class to handle the various inbounds requests */ @Controller public class PhoneController { @Autowired private HttpServletResponse httpResponse; @Autowired private PhoneService pService; @Autowired private UserSerivce uService; @RequestMapping(value = "/phone", method = RequestMethod.GET) public ModelAndView showPhoneCreationForm(){ ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } @RequestMapping(value = "/phoneCreate", method = RequestMethod.GET) public ModelAndView showPhoneCreation(){ System.out.println("in showPhoneCreation"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } @RequestMapping(value="/phone", method=RequestMethod.POST) public Object phoneCreation( @RequestParam String number, @RequestParam String description, @RequestParam String city, @RequestParam String state, @RequestParam String street, @RequestParam String zip_code, ModelMap model, HttpServletRequest request, HttpServletResponse response) { ModelAndView mv = new ModelAndView("phones/addPhone"); if(number.isEmpty() || description.isEmpty() || city.isEmpty() || state.isEmpty() || street.isEmpty() || zip_code.isEmpty()){ mv.addObject("errorMessage", "* Please enter all the missing values"); return mv; } if(number.length()!=10 ){ mv.addObject("errorMessage", "* Phone Number invalid"); return mv; } if(zip_code.length()!=5){ mv.addObject("errorMessage", "* Zip Code invalid"); return mv; } PhoneEntity pEntity = pService.createUser(number,description,city,state,street,zip_code); String redirect = "http://104.198.234.6/lab2-1.0/phone/"+pEntity.getId().toString(); try{ response.sendRedirect(redirect); }catch (Exception e) { // TODO: handle exception } return null; } @RequestMapping(value = "/phone/{pid}", method = RequestMethod.GET) public Object showPhone(@PathVariable("pid") Integer id, @RequestParam(value="json",required = false, defaultValue="false") String json) { PhoneEntity pEntity = pService.findById(id); List<UserEntity> users = uService.findAll(); List<UserEntity> ret = pService.retrieveUsers(id); if(null!= pEntity) { if(json.equals("true")) { System.out.println("Data in JSON ****************"); ModelAndView mv = new ModelAndView(new MappingJackson2JsonView()); httpResponse.setStatus(HttpStatus.OK.value()); mv.addObject(pEntity); mv.addObject(users); mv.addObject(ret); return mv; } System.out.println(" **************** Returning the normal model view ****************"); ModelAndView mv = new ModelAndView("phones/phoneInfo"); httpResponse.setStatus(HttpStatus.OK.value()); mv.addObject("phone", pEntity); mv.addObject("users",users); mv.addObject("ret",ret); return mv; } else{ ModelAndView modelAndView = new ModelAndView("error"); String noUser = "Phone " +id + " Not found"; httpResponse.setStatus(HttpStatus.NOT_FOUND.value()); modelAndView.addObject("errorMessage", noUser); modelAndView.addObject("responseCode", HttpStatus.NOT_FOUND.value()); return modelAndView; } } @RequestMapping(value = "/phone/{pid}", method = RequestMethod.DELETE) public ModelAndView deleteUser(@PathVariable("pid") Integer id){ boolean status = pService.deleteById(id); System.out.println("Came back after deleting the phone"); if(status){ System.out.println("redirecting-------------"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; }else{ System.out.println("redirecting 233-------------"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } } @RequestMapping(value="/phone/{pid}", method = RequestMethod.POST) public String updatePhone(@PathVariable("pid") Integer id, @RequestParam String number, @RequestParam String description, @RequestParam String city, @RequestParam String state, @RequestParam String street, @RequestParam String zip_code, @RequestParam String uid, ModelMap model, HttpServletRequest request, HttpServletResponse response ) { System.out.println("Check the contents of returned user IDS "+uid); PhoneEntity pEntity = pService.updatePhone((Integer)id,number,description,city,state,street,zip_code,uid); List<UserEntity> checkd = pService.retrieveUsers(id); /*ModelAndView modelAndView = new ModelAndView("users/userInfo"); modelAndView.addObject("user", uEntity); return modelAndView;*/ return "http://104.198.234.6/lab2-1.0/phone/"+pEntity.getId().toString(); } } /*if (phoneService == null) { model.addAttribute("css", "danger"); model.addAttribute("msg", "Phone not found"); }*/
UTF-8
Java
6,217
java
PhoneController.java
Java
[ { "context": "ab2.validator.PhoneFormValidator;\n\n\n/**\n * @author SkandaBhargav\n * Controller class to handle the various inbound", "end": 1439, "score": 0.9997690320014954, "start": 1426, "tag": "NAME", "value": "SkandaBhargav" }, { "context": "ntity);\n\t\treturn modelAndView;*...
null
[]
package edu.sjsu.cmpe275.lab2.controller; import java.util.List; import javax.persistence.Embeddable; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.json.MappingJackson2JsonView; import edu.sjsu.cmpe275.lab2.entity.AddressEntity; import edu.sjsu.cmpe275.lab2.entity.PhoneEntity; import edu.sjsu.cmpe275.lab2.entity.UserEntity; import edu.sjsu.cmpe275.lab2.service.PhoneService; import edu.sjsu.cmpe275.lab2.service.UserSerivce; import edu.sjsu.cmpe275.lab2.validator.PhoneFormValidator; /** * @author SkandaBhargav * Controller class to handle the various inbounds requests */ @Controller public class PhoneController { @Autowired private HttpServletResponse httpResponse; @Autowired private PhoneService pService; @Autowired private UserSerivce uService; @RequestMapping(value = "/phone", method = RequestMethod.GET) public ModelAndView showPhoneCreationForm(){ ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } @RequestMapping(value = "/phoneCreate", method = RequestMethod.GET) public ModelAndView showPhoneCreation(){ System.out.println("in showPhoneCreation"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } @RequestMapping(value="/phone", method=RequestMethod.POST) public Object phoneCreation( @RequestParam String number, @RequestParam String description, @RequestParam String city, @RequestParam String state, @RequestParam String street, @RequestParam String zip_code, ModelMap model, HttpServletRequest request, HttpServletResponse response) { ModelAndView mv = new ModelAndView("phones/addPhone"); if(number.isEmpty() || description.isEmpty() || city.isEmpty() || state.isEmpty() || street.isEmpty() || zip_code.isEmpty()){ mv.addObject("errorMessage", "* Please enter all the missing values"); return mv; } if(number.length()!=10 ){ mv.addObject("errorMessage", "* Phone Number invalid"); return mv; } if(zip_code.length()!=5){ mv.addObject("errorMessage", "* Zip Code invalid"); return mv; } PhoneEntity pEntity = pService.createUser(number,description,city,state,street,zip_code); String redirect = "http://104.198.234.6/lab2-1.0/phone/"+pEntity.getId().toString(); try{ response.sendRedirect(redirect); }catch (Exception e) { // TODO: handle exception } return null; } @RequestMapping(value = "/phone/{pid}", method = RequestMethod.GET) public Object showPhone(@PathVariable("pid") Integer id, @RequestParam(value="json",required = false, defaultValue="false") String json) { PhoneEntity pEntity = pService.findById(id); List<UserEntity> users = uService.findAll(); List<UserEntity> ret = pService.retrieveUsers(id); if(null!= pEntity) { if(json.equals("true")) { System.out.println("Data in JSON ****************"); ModelAndView mv = new ModelAndView(new MappingJackson2JsonView()); httpResponse.setStatus(HttpStatus.OK.value()); mv.addObject(pEntity); mv.addObject(users); mv.addObject(ret); return mv; } System.out.println(" **************** Returning the normal model view ****************"); ModelAndView mv = new ModelAndView("phones/phoneInfo"); httpResponse.setStatus(HttpStatus.OK.value()); mv.addObject("phone", pEntity); mv.addObject("users",users); mv.addObject("ret",ret); return mv; } else{ ModelAndView modelAndView = new ModelAndView("error"); String noUser = "Phone " +id + " Not found"; httpResponse.setStatus(HttpStatus.NOT_FOUND.value()); modelAndView.addObject("errorMessage", noUser); modelAndView.addObject("responseCode", HttpStatus.NOT_FOUND.value()); return modelAndView; } } @RequestMapping(value = "/phone/{pid}", method = RequestMethod.DELETE) public ModelAndView deleteUser(@PathVariable("pid") Integer id){ boolean status = pService.deleteById(id); System.out.println("Came back after deleting the phone"); if(status){ System.out.println("redirecting-------------"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; }else{ System.out.println("redirecting 233-------------"); ModelAndView modelAndView = new ModelAndView("phones/addPhone"); return modelAndView; } } @RequestMapping(value="/phone/{pid}", method = RequestMethod.POST) public String updatePhone(@PathVariable("pid") Integer id, @RequestParam String number, @RequestParam String description, @RequestParam String city, @RequestParam String state, @RequestParam String street, @RequestParam String zip_code, @RequestParam String uid, ModelMap model, HttpServletRequest request, HttpServletResponse response ) { System.out.println("Check the contents of returned user IDS "+uid); PhoneEntity pEntity = pService.updatePhone((Integer)id,number,description,city,state,street,zip_code,uid); List<UserEntity> checkd = pService.retrieveUsers(id); /*ModelAndView modelAndView = new ModelAndView("users/userInfo"); modelAndView.addObject("user", uEntity); return modelAndView;*/ return "http://192.168.3.11/lab2-1.0/phone/"+pEntity.getId().toString(); } } /*if (phoneService == null) { model.addAttribute("css", "danger"); model.addAttribute("msg", "Phone not found"); }*/
6,216
0.742963
0.73299
178
33.932583
24.772356
108
false
false
0
0
0
0
0
0
2.421348
false
false
2
b0a27a115ec2e6d418182f0525f7acc85a625944
19,456,201,883,443
9593f22e1ef7635c92cdc3ae674a988ec90317c4
/src/main/java/com/sigurd4/bioshock/config/Config.java
b262c08d5073818a1e9d13e6b6a07683b7e584cc
[]
no_license
sigurd4/BioShockMod
https://github.com/sigurd4/BioShockMod
847ca445f1a6fe40487687469067b044c62e3a7a
2cbe39b673080997ce413d7812c52e5104265aa1
refs/heads/master
2020-05-17T23:08:39.269000
2015-06-30T22:52:04
2015-06-30T22:53:10
34,406,444
1
3
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sigurd4.bioshock.config; import java.util.ArrayList; import net.minecraftforge.common.config.Configuration; import com.google.common.collect.Lists; import com.sigurd4.bioshock.Stuff; public class Config { public static Configuration config = null; public static final ArrayList<ConfigEntry> entries = Lists.newArrayList(); public enum ConfigEntryCategory { GENERAL { @Override public String toString() { return Configuration.CATEGORY_GENERAL; } }; @Override public String toString() { return Stuff.Strings.UnderscoresToCamelSpaces(super.toString()); } } }
UTF-8
Java
615
java
Config.java
Java
[]
null
[]
package com.sigurd4.bioshock.config; import java.util.ArrayList; import net.minecraftforge.common.config.Configuration; import com.google.common.collect.Lists; import com.sigurd4.bioshock.Stuff; public class Config { public static Configuration config = null; public static final ArrayList<ConfigEntry> entries = Lists.newArrayList(); public enum ConfigEntryCategory { GENERAL { @Override public String toString() { return Configuration.CATEGORY_GENERAL; } }; @Override public String toString() { return Stuff.Strings.UnderscoresToCamelSpaces(super.toString()); } } }
615
0.744715
0.741463
32
18.21875
20.878719
75
false
false
0
0
0
0
0
0
1.59375
false
false
2
2235019ec784681bc10042cb513624a038ff25be
3,006,477,138,258
0cab77f527e586d3d84c2b69bd6076818677de2a
/ys-admin/src/main/java/com/ys/common/base/entiry/AbstractFeaturesEntity.java
d608bbbfb79f51372e30c24547c812e899cc0bf6
[]
no_license
zengyufei/taxi-ebean
https://github.com/zengyufei/taxi-ebean
a50c4f1a64c4d0f3bf6346e6c10619e886a3591a
2ec1e8b0f41f9477daf52f2abbd1819e879b4cd8
refs/heads/master
2021-01-23T20:05:22.235000
2017-10-31T07:17:31
2017-10-31T07:17:31
102,847,064
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ys.common.base.entiry; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.parser.Feature; import com.alibaba.fastjson.serializer.JSONSerializer; import com.alibaba.fastjson.serializer.SerializerFeature; import com.ys.common.base.ExtensionFeatures; import io.ebean.annotation.DbComment; import io.ebean.annotation.DbJson; import lombok.*; import lombok.experimental.Accessors; import lombok.experimental.FieldDefaults; import org.apache.commons.lang3.StringUtils; import javax.persistence.MappedSuperclass; @EqualsAndHashCode(callSuper = true) @Data @Accessors(chain=true) @FieldDefaults(level = AccessLevel.PROTECTED) @MappedSuperclass public abstract class AbstractFeaturesEntity<T> extends AbstractDateTimeEntity<T> implements ExtensionFeatures { /**特征对象JSON字段*/ @DbJson @DbComment("额外字段") @Setter(value = AccessLevel.NONE) @Getter(value = AccessLevel.NONE) JSONObject features = new JSONObject(); @Override public String getFeatures() { return features == null || features.size() == 0 ? null : JSON.toJSONString(features, SerializerFeature.UseISO8601DateFormat); } @Override public void setupFeature(String columnName, String value) { features.put(columnName, value); } @Override public void setupFeature(String columnName, Object value) { features.put(columnName, value); } @Override public void removeFeature(String columnName) { features.remove(columnName); } @Override public String getFeature(String columnName) { return features.getString(columnName); } @Override public <T> T getFeature(String columnName, Class<T> clz) { return features.getObject(columnName, clz); } @Override public void setFeatures(String features) { this.features = StringUtils.isBlank(features) ? new JSONObject() : JSONObject.parseObject(features, Feature.AllowISO8601DateFormat); } @Override public String toString() { JSONSerializer serializer = new JSONSerializer(); serializer.config(SerializerFeature.QuoteFieldNames, false); serializer.config(SerializerFeature.UseISO8601DateFormat, true); serializer.write(this); return serializer.getWriter().toString(); } }
UTF-8
Java
2,360
java
AbstractFeaturesEntity.java
Java
[]
null
[]
package com.ys.common.base.entiry; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.parser.Feature; import com.alibaba.fastjson.serializer.JSONSerializer; import com.alibaba.fastjson.serializer.SerializerFeature; import com.ys.common.base.ExtensionFeatures; import io.ebean.annotation.DbComment; import io.ebean.annotation.DbJson; import lombok.*; import lombok.experimental.Accessors; import lombok.experimental.FieldDefaults; import org.apache.commons.lang3.StringUtils; import javax.persistence.MappedSuperclass; @EqualsAndHashCode(callSuper = true) @Data @Accessors(chain=true) @FieldDefaults(level = AccessLevel.PROTECTED) @MappedSuperclass public abstract class AbstractFeaturesEntity<T> extends AbstractDateTimeEntity<T> implements ExtensionFeatures { /**特征对象JSON字段*/ @DbJson @DbComment("额外字段") @Setter(value = AccessLevel.NONE) @Getter(value = AccessLevel.NONE) JSONObject features = new JSONObject(); @Override public String getFeatures() { return features == null || features.size() == 0 ? null : JSON.toJSONString(features, SerializerFeature.UseISO8601DateFormat); } @Override public void setupFeature(String columnName, String value) { features.put(columnName, value); } @Override public void setupFeature(String columnName, Object value) { features.put(columnName, value); } @Override public void removeFeature(String columnName) { features.remove(columnName); } @Override public String getFeature(String columnName) { return features.getString(columnName); } @Override public <T> T getFeature(String columnName, Class<T> clz) { return features.getObject(columnName, clz); } @Override public void setFeatures(String features) { this.features = StringUtils.isBlank(features) ? new JSONObject() : JSONObject.parseObject(features, Feature.AllowISO8601DateFormat); } @Override public String toString() { JSONSerializer serializer = new JSONSerializer(); serializer.config(SerializerFeature.QuoteFieldNames, false); serializer.config(SerializerFeature.UseISO8601DateFormat, true); serializer.write(this); return serializer.getWriter().toString(); } }
2,360
0.732051
0.726068
76
29.802631
28.842138
140
false
false
0
0
0
0
0
0
0.513158
false
false
2
8f2e604abfcfc4de3081ded69c8a0a2d7f181555
3,006,477,140,217
953a33bee433d77b12ec23236cfe542178422485
/Lab4/src/main/java/EntityClasses/School.java
9ce98ef4f3df4a9a365fd5c0c571687d73b0af88
[]
no_license
NarcisSt/LaboratoarePA
https://github.com/NarcisSt/LaboratoarePA
62faa790eb3ebebb6a9381efb8916a1382aa3a55
c0bd76f40b0cbad9e6ca5f488de73490ef000e9e
refs/heads/main
2023-05-02T03:02:05.665000
2021-05-14T08:12:36
2021-05-14T08:12:36
340,395,637
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package EntityClasses; import java.util.Objects; import java.util.Set; import java.util.TreeSet; /** * The School class implements the Comparable interface and has the name of the school and a list of preferences regarding the students. * Also has the overridden compareTo and toString methods from the Object class. */ public class School implements Comparable<School> { private String name; private Set<Student> studentsPreferences = new TreeSet<>(); private int capacity; public School(String name) { this.name = name; } public School(String name, int capacity) { this.name = name; this.capacity = capacity; } public int getCapacity() { return capacity; } public void setCapacity(int capacity) { if (capacity >= 0) { this.capacity = capacity; } else { new Exception("Capacity must be at least 0"); } } @Override public int compareTo(School school) { if (this.name != null) { return this.name.compareTo(school.name); } else { new Exception("The name is null!"); return -1; } } @Override public String toString() { return "School{" + "name='" + name + '\'' + ", capacity=" + capacity + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; School school = (School) o; return Objects.equals(name, school.name); } @Override public int hashCode() { return Objects.hash(name); } }
UTF-8
Java
1,704
java
School.java
Java
[]
null
[]
package EntityClasses; import java.util.Objects; import java.util.Set; import java.util.TreeSet; /** * The School class implements the Comparable interface and has the name of the school and a list of preferences regarding the students. * Also has the overridden compareTo and toString methods from the Object class. */ public class School implements Comparable<School> { private String name; private Set<Student> studentsPreferences = new TreeSet<>(); private int capacity; public School(String name) { this.name = name; } public School(String name, int capacity) { this.name = name; this.capacity = capacity; } public int getCapacity() { return capacity; } public void setCapacity(int capacity) { if (capacity >= 0) { this.capacity = capacity; } else { new Exception("Capacity must be at least 0"); } } @Override public int compareTo(School school) { if (this.name != null) { return this.name.compareTo(school.name); } else { new Exception("The name is null!"); return -1; } } @Override public String toString() { return "School{" + "name='" + name + '\'' + ", capacity=" + capacity + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; School school = (School) o; return Objects.equals(name, school.name); } @Override public int hashCode() { return Objects.hash(name); } }
1,704
0.576291
0.574531
67
24.41791
23.363544
136
false
false
0
0
0
0
0
0
0.402985
false
false
2
2d0490af044eea94354f632b67e86f2ea5ceff94
16,277,926,073,374
be573ed5e6a54ad9d5cd1856b30fdda21df3ed29
/app/src/main/java/com/wutong/repair/data/bean/WorkbenchStatMaterialBean.java
331bfbe747d7cdeee7247458dd938a40200c4523
[]
no_license
unclebanana/RepairApp
https://github.com/unclebanana/RepairApp
e39c104a62a49cc3a95ff6a02245b222bc6df651
c6c8d74a79efc77cff31febb4ab2d9a6f9207c03
refs/heads/master
2022-04-15T20:43:15.733000
2017-02-14T10:03:49
2017-02-14T10:03:49
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.wutong.repair.data.bean; import java.util.List; import com.google.gson.annotations.SerializedName; /** * 用于维修材料的统计 * 当前材料中为asset(没有s) * @author Jolly * 创建时间:2013年12月23日下午1:14:17 * * 2014年01月11日 修改师大上全加s */ public class WorkbenchStatMaterialBean { @SerializedName(value="monthUsedCount") private Integer monthUsedNumber; @SerializedName(value="stockCount") private Integer storeNumber; @SerializedName(value="unit") private String unit; @SerializedName(value="assetsName") private String name; @SerializedName(value="brand") private String brand; @SerializedName(value="assetsId") private Integer id; private String specification; @SerializedName(value="deparmentUsedCount") private List<DivisionBean> divisionUseCountList; /*煤矿修改前的方案是,临时变量进行承接,get方法判断null时返回临时变量*/ @SerializedName(value="assestId") private Integer tempId; @SerializedName(value="assetName") private String tempName; public String getSpecification() { return specification; } public void setSpecification(String specification) { this.specification = specification; } public Integer getMonthUsedNumber() { return monthUsedNumber; } public void setMonthUsedNumber(Integer monthUsedNumber) { this.monthUsedNumber = monthUsedNumber; } public Integer getStoreNumber() { return storeNumber; } public void setStoreNumber(Integer storeNumber) { this.storeNumber = storeNumber; } public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } public String getName() { return name!=null?name:tempName; } public void setName(String name) { this.name = name; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public Integer getId() { return id!=null?id:tempId; } public void setId(Integer id) { this.id = id; } public List<DivisionBean> getDivisionUseCountList() { return divisionUseCountList; } public void setDivisionUseCountList(List<DivisionBean> divisionUseCountList) { this.divisionUseCountList = divisionUseCountList; } public Integer getTempId() { return tempId; } public void setTempId(Integer tempId) { this.tempId = tempId; } public String getTempName() { return tempName; } public void setTempName(String tempName) { this.tempName = tempName; } }
UTF-8
Java
2,501
java
WorkbenchStatMaterialBean.java
Java
[ { "context": "e;\n/**\n * 用于维修材料的统计\n * 当前材料中为asset(没有s)\n * @author Jolly\n * 创建时间:2013年12月23日下午1:14:17\n *\n * 2014年01月11日 修改", "end": 166, "score": 0.7028328776359558, "start": 161, "tag": "NAME", "value": "Jolly" } ]
null
[]
package com.wutong.repair.data.bean; import java.util.List; import com.google.gson.annotations.SerializedName; /** * 用于维修材料的统计 * 当前材料中为asset(没有s) * @author Jolly * 创建时间:2013年12月23日下午1:14:17 * * 2014年01月11日 修改师大上全加s */ public class WorkbenchStatMaterialBean { @SerializedName(value="monthUsedCount") private Integer monthUsedNumber; @SerializedName(value="stockCount") private Integer storeNumber; @SerializedName(value="unit") private String unit; @SerializedName(value="assetsName") private String name; @SerializedName(value="brand") private String brand; @SerializedName(value="assetsId") private Integer id; private String specification; @SerializedName(value="deparmentUsedCount") private List<DivisionBean> divisionUseCountList; /*煤矿修改前的方案是,临时变量进行承接,get方法判断null时返回临时变量*/ @SerializedName(value="assestId") private Integer tempId; @SerializedName(value="assetName") private String tempName; public String getSpecification() { return specification; } public void setSpecification(String specification) { this.specification = specification; } public Integer getMonthUsedNumber() { return monthUsedNumber; } public void setMonthUsedNumber(Integer monthUsedNumber) { this.monthUsedNumber = monthUsedNumber; } public Integer getStoreNumber() { return storeNumber; } public void setStoreNumber(Integer storeNumber) { this.storeNumber = storeNumber; } public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } public String getName() { return name!=null?name:tempName; } public void setName(String name) { this.name = name; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public Integer getId() { return id!=null?id:tempId; } public void setId(Integer id) { this.id = id; } public List<DivisionBean> getDivisionUseCountList() { return divisionUseCountList; } public void setDivisionUseCountList(List<DivisionBean> divisionUseCountList) { this.divisionUseCountList = divisionUseCountList; } public Integer getTempId() { return tempId; } public void setTempId(Integer tempId) { this.tempId = tempId; } public String getTempName() { return tempName; } public void setTempName(String tempName) { this.tempName = tempName; } }
2,501
0.741007
0.73212
126
17.753969
17.605774
79
false
false
0
0
0
0
0
0
1.134921
false
false
2
25477dc17ced14c5c9c1b8d9514a0a369c896b99
16,277,926,073,247
f0ddc43798851b92302b29bca1c4c6252c0d5b82
/src/main/java/com/herocheer/instructor/controller/ActivityRecruitInfoController.java
9d3c7cc175e0aecc98a24bdcee5f1af582e8888a
[]
no_license
cckmit/herocheer-instructor
https://github.com/cckmit/herocheer-instructor
1ecd3c0a596c88f42f7f7c24b6233303ddd78ce2
4d8c3ebc86b6f4fef7e06f5b875158f5f063b511
refs/heads/master
2023-08-14T12:00:39.113000
2021-09-03T09:07:03
2021-09-03T09:07:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.herocheer.instructor.controller; import com.herocheer.cache.bean.RedisClient; import com.herocheer.common.base.Page.Page; import com.herocheer.common.base.ResponseResult; import com.herocheer.instructor.domain.entity.ActivityRecruitApproval; import com.herocheer.instructor.domain.entity.ActivityRecruitInfo; import com.herocheer.instructor.domain.vo.ActivityRecruitDetailVo; import com.herocheer.instructor.domain.vo.ActivityRecruitInfoQueryVo; import com.herocheer.instructor.domain.vo.ActivityRecruitInfoVo; import com.herocheer.instructor.domain.vo.ApplicationListVo; import com.herocheer.instructor.enums.SysMessageEnums; import com.herocheer.instructor.service.ActivityRecruitInfoService; import com.herocheer.instructor.service.SysMessageService; import com.herocheer.web.annotation.AllowAnonymous; import com.herocheer.web.base.BaseController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.Arrays; import java.util.List; /** * @author linjf * @desc 招募信息主表(ActivityRecruitInfo)表控制层 * @date 2021-01-15 17:24:55 * @company 厦门熙重电子科技有限公司 */ @RestController @RequestMapping("/activity/recruit") @Api(tags = "招募信息管理") public class ActivityRecruitInfoController extends BaseController{ @Resource private ActivityRecruitInfoService activityRecruitInfoService; @Resource private RedisClient redisClient; @Autowired private SysMessageService sysMessageService; @PostMapping("/queryPage") @ApiOperation("招募信息查询") public ResponseResult<Page<ActivityRecruitInfo>> queryPageList(@RequestBody ActivityRecruitInfoQueryVo queryVo, HttpServletRequest request){ Page<ActivityRecruitInfo> page = activityRecruitInfoService.queryPage(queryVo,getCurUserId(request)); return ResponseResult.ok(page); } @GetMapping("/get") @ApiOperation("根据id查询招募信息详情") @AllowAnonymous public ResponseResult<ActivityRecruitInfoVo> get(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.getActivityRecruitInfo(id)); } @GetMapping("/withdraw") @ApiOperation("招募信息撤回") public ResponseResult withdraw(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.withdraw(id)); } @GetMapping("/revoke") @ApiOperation("招募信息取消") public ResponseResult revoke(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.revoke(id)); } @PostMapping("/add") @ApiOperation("新增招募信息") public ResponseResult add(@RequestBody ActivityRecruitInfoVo activityRecruitInfoVo, HttpServletRequest request){ reqLimitByUserId(request,"ActivityRecruitInfo_add",1); Integer count=activityRecruitInfoService.addActivityRecruitInfo(activityRecruitInfoVo); return ResponseResult.isSuccess(count); } @PostMapping("/update") @ApiOperation("更新招募信息") public ResponseResult update(@RequestBody ActivityRecruitInfoVo activityRecruitInfoVo){ Integer count=activityRecruitInfoService.updateActivityRecruitInfo(activityRecruitInfoVo); // 同步系统消息状态 sysMessageService.modifyMessage(Arrays.asList(SysMessageEnums.STATION_CHECK.getCode(),SysMessageEnums.MATCH_JI0N_CHECK.getCode()), activityRecruitInfoVo.getId(),false,false); return ResponseResult.isSuccess(count); } @DeleteMapping("/delete") @ApiOperation("删除招募信息") public ResponseResult delete(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.isSuccess(activityRecruitInfoService.deleteActivityRecruitInfo(id)); } @DeleteMapping("/detail/delete") @ApiOperation("删除招募信息详情-时段") public ResponseResult deleteDetail(@ApiParam("招募信息详情id") @RequestParam Long id){ return ResponseResult.isSuccess(activityRecruitInfoService.deleteDetail(id)); } @PostMapping("/approval") @ApiOperation("招募信息审批") public ResponseResult approval(HttpServletRequest request,@RequestBody ActivityRecruitApproval activityRecruitApproval){ reqLimitByUserId(request,"ActivityRecruitInfo_approval",1); Integer count=activityRecruitInfoService.approval(activityRecruitApproval,getUser(request)); // 同步系统消息状态 sysMessageService.modifyMessage(Arrays.asList(SysMessageEnums.STATION_CHECK.getCode(),SysMessageEnums.MATCH_JI0N_CHECK.getCode()), activityRecruitApproval.getRecruitId(),true,true); return ResponseResult.isSuccess(count); } @GetMapping("/approval/record") @ApiOperation("根据id查询审批记录") public ResponseResult<List<ActivityRecruitApproval>> approvalRecord(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.approvalRecord(id)); } @GetMapping("/hours") @ApiOperation("查询活动的招募时段") public ResponseResult<List<ActivityRecruitDetailVo>> recruitHours(@ApiParam("招募信息id") @RequestParam Long recruitId, @ApiParam("日期-时间戳")@RequestParam Long dateTime, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.getRecruitHours(recruitId,dateTime,getCurUserId(request))); } @GetMapping("/queryApplicationPage") @ApiOperation("公众号-查询信息审批列表") public ResponseResult<Page<ApplicationListVo>> queryApplicationPage(@ApiParam("类型(1.待审批2.已审批)") @RequestParam Integer type, @ApiParam("页码") @RequestParam Integer pageNo, @ApiParam("页数") @RequestParam Integer pageSize, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.queryApplicationPage(type,pageNo,pageSize,getCurUserId(request))); } @GetMapping("/getApplicationCount") @ApiOperation("公众号-查询信息审批统计数") public ResponseResult<Integer> getApplicationCount(@ApiParam("类型(1.待审批2.已审批)") @RequestParam Integer type, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.getApplicationCount(type,getCurUserId(request))); } }
UTF-8
Java
7,494
java
ActivityRecruitInfoController.java
Java
[ { "context": "til.Arrays;\nimport java.util.List;\n\n/**\n * @author linjf\n * @desc 招募信息主表(ActivityRecruitInfo)表控制层\n * @dat", "end": 1625, "score": 0.9996335506439209, "start": 1620, "tag": "USERNAME", "value": "linjf" }, { "context": "层\n * @date 2021-01-15 17:24:55\n * @company ...
null
[]
package com.herocheer.instructor.controller; import com.herocheer.cache.bean.RedisClient; import com.herocheer.common.base.Page.Page; import com.herocheer.common.base.ResponseResult; import com.herocheer.instructor.domain.entity.ActivityRecruitApproval; import com.herocheer.instructor.domain.entity.ActivityRecruitInfo; import com.herocheer.instructor.domain.vo.ActivityRecruitDetailVo; import com.herocheer.instructor.domain.vo.ActivityRecruitInfoQueryVo; import com.herocheer.instructor.domain.vo.ActivityRecruitInfoVo; import com.herocheer.instructor.domain.vo.ApplicationListVo; import com.herocheer.instructor.enums.SysMessageEnums; import com.herocheer.instructor.service.ActivityRecruitInfoService; import com.herocheer.instructor.service.SysMessageService; import com.herocheer.web.annotation.AllowAnonymous; import com.herocheer.web.base.BaseController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.Arrays; import java.util.List; /** * @author linjf * @desc 招募信息主表(ActivityRecruitInfo)表控制层 * @date 2021-01-15 17:24:55 * @company 厦门熙重电子科技有限公司 */ @RestController @RequestMapping("/activity/recruit") @Api(tags = "招募信息管理") public class ActivityRecruitInfoController extends BaseController{ @Resource private ActivityRecruitInfoService activityRecruitInfoService; @Resource private RedisClient redisClient; @Autowired private SysMessageService sysMessageService; @PostMapping("/queryPage") @ApiOperation("招募信息查询") public ResponseResult<Page<ActivityRecruitInfo>> queryPageList(@RequestBody ActivityRecruitInfoQueryVo queryVo, HttpServletRequest request){ Page<ActivityRecruitInfo> page = activityRecruitInfoService.queryPage(queryVo,getCurUserId(request)); return ResponseResult.ok(page); } @GetMapping("/get") @ApiOperation("根据id查询招募信息详情") @AllowAnonymous public ResponseResult<ActivityRecruitInfoVo> get(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.getActivityRecruitInfo(id)); } @GetMapping("/withdraw") @ApiOperation("招募信息撤回") public ResponseResult withdraw(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.withdraw(id)); } @GetMapping("/revoke") @ApiOperation("招募信息取消") public ResponseResult revoke(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.revoke(id)); } @PostMapping("/add") @ApiOperation("新增招募信息") public ResponseResult add(@RequestBody ActivityRecruitInfoVo activityRecruitInfoVo, HttpServletRequest request){ reqLimitByUserId(request,"ActivityRecruitInfo_add",1); Integer count=activityRecruitInfoService.addActivityRecruitInfo(activityRecruitInfoVo); return ResponseResult.isSuccess(count); } @PostMapping("/update") @ApiOperation("更新招募信息") public ResponseResult update(@RequestBody ActivityRecruitInfoVo activityRecruitInfoVo){ Integer count=activityRecruitInfoService.updateActivityRecruitInfo(activityRecruitInfoVo); // 同步系统消息状态 sysMessageService.modifyMessage(Arrays.asList(SysMessageEnums.STATION_CHECK.getCode(),SysMessageEnums.MATCH_JI0N_CHECK.getCode()), activityRecruitInfoVo.getId(),false,false); return ResponseResult.isSuccess(count); } @DeleteMapping("/delete") @ApiOperation("删除招募信息") public ResponseResult delete(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.isSuccess(activityRecruitInfoService.deleteActivityRecruitInfo(id)); } @DeleteMapping("/detail/delete") @ApiOperation("删除招募信息详情-时段") public ResponseResult deleteDetail(@ApiParam("招募信息详情id") @RequestParam Long id){ return ResponseResult.isSuccess(activityRecruitInfoService.deleteDetail(id)); } @PostMapping("/approval") @ApiOperation("招募信息审批") public ResponseResult approval(HttpServletRequest request,@RequestBody ActivityRecruitApproval activityRecruitApproval){ reqLimitByUserId(request,"ActivityRecruitInfo_approval",1); Integer count=activityRecruitInfoService.approval(activityRecruitApproval,getUser(request)); // 同步系统消息状态 sysMessageService.modifyMessage(Arrays.asList(SysMessageEnums.STATION_CHECK.getCode(),SysMessageEnums.MATCH_JI0N_CHECK.getCode()), activityRecruitApproval.getRecruitId(),true,true); return ResponseResult.isSuccess(count); } @GetMapping("/approval/record") @ApiOperation("根据id查询审批记录") public ResponseResult<List<ActivityRecruitApproval>> approvalRecord(@ApiParam("招募信息id") @RequestParam Long id){ return ResponseResult.ok(activityRecruitInfoService.approvalRecord(id)); } @GetMapping("/hours") @ApiOperation("查询活动的招募时段") public ResponseResult<List<ActivityRecruitDetailVo>> recruitHours(@ApiParam("招募信息id") @RequestParam Long recruitId, @ApiParam("日期-时间戳")@RequestParam Long dateTime, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.getRecruitHours(recruitId,dateTime,getCurUserId(request))); } @GetMapping("/queryApplicationPage") @ApiOperation("公众号-查询信息审批列表") public ResponseResult<Page<ApplicationListVo>> queryApplicationPage(@ApiParam("类型(1.待审批2.已审批)") @RequestParam Integer type, @ApiParam("页码") @RequestParam Integer pageNo, @ApiParam("页数") @RequestParam Integer pageSize, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.queryApplicationPage(type,pageNo,pageSize,getCurUserId(request))); } @GetMapping("/getApplicationCount") @ApiOperation("公众号-查询信息审批统计数") public ResponseResult<Integer> getApplicationCount(@ApiParam("类型(1.待审批2.已审批)") @RequestParam Integer type, HttpServletRequest request){ return ResponseResult.ok(activityRecruitInfoService.getApplicationCount(type,getCurUserId(request))); } }
7,494
0.725747
0.722645
153
45.359478
39.712959
189
false
false
0
0
0
0
0
0
0.542484
false
false
2
552bb789f65f72abfe54ea08e461fde5e63bb7e0
12,979,391,196,759
794c47de139a23ad4cd92563b5969b75007140d5
/app/src/main/java/com/fanfan/hotel/activity/PayActivity.java
7155ab6b703e5ed8bd4a5f9472ebfa0adcab543d
[]
no_license
seabreezerobot/FanFan_Hotel
https://github.com/seabreezerobot/FanFan_Hotel
a352538ad9e644cd9193b5bfca46c28700bf28d9
3e223f120bb0434e5ab020d2d3576a052fd65474
refs/heads/master
2020-03-27T01:22:21.857000
2018-02-09T09:22:26
2018-02-09T09:22:34
145,704,464
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.fanfan.hotel.activity; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.fanfan.hotel.R; import com.fanfan.hotel.common.InfoManage; import com.fanfan.hotel.common.activity.BarBaseActivity; import com.fanfan.hotel.model.PersonInfo; import com.fanfan.hotel.model.RoomInfo; import com.fanfan.hotel.utils.BitmapUtils; import com.fanfan.hotel.utils.PreferencesUtils; import com.fanfan.youtu.Youtucode; import com.fanfan.youtu.api.face.bean.Newperson; import com.fanfan.youtu.api.face.event.NewPersonEvent; import com.seabreeze.log.Print; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.io.File; public class PayActivity extends BarBaseActivity { public static final int PAY_TO_INFO_REQUESTCODE = 103; public static final int PAY_TO_INFO_RESULTCODE = 203; public static void newInstance(Activity context, int requestCode) { Intent intent = new Intent(context, PayActivity.class); context.startActivityForResult(intent, requestCode); } private Youtucode youtucode; private RoomInfo roomInfo; private PersonInfo personInfo; @Override protected int getLayoutId() { return R.layout.activity_pay; } @Override protected void initView() { super.initView(); setTitle("支付"); youtucode = Youtucode.getSingleInstance(); roomInfo = InfoManage.getInstance().getRoomInfo(); personInfo = InfoManage.getInstance().getPersonInfo(); } @Override protected void initData() { showToast("10s后跳转支付完成页面,模拟支付完成"); mHandler.postDelayed(new Runnable() { @Override public void run() { String personId = personInfo.getIDCard(); String headUrl = personInfo.getHeadUrl(); if ((new File(headUrl)).exists()) { Bitmap bitmap = BitmapFactory.decodeFile(headUrl); youtucode.newPerson(bitmap, personId, personInfo.getName()); } else { Print.e("文件缺失"); } } }, 10000); } @Override protected void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override protected void onStop() { super.onStop(); EventBus.getDefault().unregister(this); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PAY_TO_INFO_REQUESTCODE) { if (resultCode == PAY_TO_INFO_RESULTCODE) { setResult(ConfirmActivity.CONFIRM_TO_PAY_RESULTCODE); finish(); } } } @Subscribe(threadMode = ThreadMode.MAIN) public void onResultEvent(NewPersonEvent event) { if (event.isOk()) { Newperson newperson = event.getBean(); Print.e(newperson); if (newperson.getErrorcode() == 0) { String person_id = newperson.getPerson_id(); PreferencesUtils.putInt(this, person_id, roomInfo.getId()); InfoCompleteActivity.newInstance(PayActivity.this, PAY_TO_INFO_REQUESTCODE, InfoCompleteActivity.CHECK_IN); } else { Print.e("onError : " + newperson.getErrorcode() + " " + newperson.getErrormsg()); } } else { Print.e("onError : " + event.getCode() + " " + event.getCodeDescribe()); } } }
UTF-8
Java
3,834
java
PayActivity.java
Java
[]
null
[]
package com.fanfan.hotel.activity; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.fanfan.hotel.R; import com.fanfan.hotel.common.InfoManage; import com.fanfan.hotel.common.activity.BarBaseActivity; import com.fanfan.hotel.model.PersonInfo; import com.fanfan.hotel.model.RoomInfo; import com.fanfan.hotel.utils.BitmapUtils; import com.fanfan.hotel.utils.PreferencesUtils; import com.fanfan.youtu.Youtucode; import com.fanfan.youtu.api.face.bean.Newperson; import com.fanfan.youtu.api.face.event.NewPersonEvent; import com.seabreeze.log.Print; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.io.File; public class PayActivity extends BarBaseActivity { public static final int PAY_TO_INFO_REQUESTCODE = 103; public static final int PAY_TO_INFO_RESULTCODE = 203; public static void newInstance(Activity context, int requestCode) { Intent intent = new Intent(context, PayActivity.class); context.startActivityForResult(intent, requestCode); } private Youtucode youtucode; private RoomInfo roomInfo; private PersonInfo personInfo; @Override protected int getLayoutId() { return R.layout.activity_pay; } @Override protected void initView() { super.initView(); setTitle("支付"); youtucode = Youtucode.getSingleInstance(); roomInfo = InfoManage.getInstance().getRoomInfo(); personInfo = InfoManage.getInstance().getPersonInfo(); } @Override protected void initData() { showToast("10s后跳转支付完成页面,模拟支付完成"); mHandler.postDelayed(new Runnable() { @Override public void run() { String personId = personInfo.getIDCard(); String headUrl = personInfo.getHeadUrl(); if ((new File(headUrl)).exists()) { Bitmap bitmap = BitmapFactory.decodeFile(headUrl); youtucode.newPerson(bitmap, personId, personInfo.getName()); } else { Print.e("文件缺失"); } } }, 10000); } @Override protected void onStart() { super.onStart(); EventBus.getDefault().register(this); } @Override protected void onStop() { super.onStop(); EventBus.getDefault().unregister(this); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PAY_TO_INFO_REQUESTCODE) { if (resultCode == PAY_TO_INFO_RESULTCODE) { setResult(ConfirmActivity.CONFIRM_TO_PAY_RESULTCODE); finish(); } } } @Subscribe(threadMode = ThreadMode.MAIN) public void onResultEvent(NewPersonEvent event) { if (event.isOk()) { Newperson newperson = event.getBean(); Print.e(newperson); if (newperson.getErrorcode() == 0) { String person_id = newperson.getPerson_id(); PreferencesUtils.putInt(this, person_id, roomInfo.getId()); InfoCompleteActivity.newInstance(PayActivity.this, PAY_TO_INFO_REQUESTCODE, InfoCompleteActivity.CHECK_IN); } else { Print.e("onError : " + newperson.getErrorcode() + " " + newperson.getErrormsg()); } } else { Print.e("onError : " + event.getCode() + " " + event.getCodeDescribe()); } } }
3,834
0.643196
0.639241
120
30.6
24.889221
123
false
false
0
0
0
0
0
0
0.6
false
false
2
f137c6e6f80dc2f85584c4e81b4f2775e5b42909
28,097,676,054,798
cae9bf730c1feb6ee48ddda7fc90fb54c96db54b
/app/src/androidTest/java/ru/devsp/apps/market/db/SearchDaoTest.java
fab02fdac2536488741f8109d36504c121971b19
[]
no_license
genboo/market
https://github.com/genboo/market
ec50df392c03327e77dcf1ce839eaa8be3de6d00
427f519eae6ada460185b1428d5d0cc0b010c7db
refs/heads/master
2020-03-08T08:49:56.999000
2018-05-03T14:01:44
2018-05-03T14:01:44
117,683,220
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.devsp.apps.market.db; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import java.io.IOException; import java.util.List; import ru.devsp.apps.market.model.objects.SearchGood; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static ru.devsp.apps.market.tools.LiveDataTestUtil.getValue; /** * Тестирование базы: поиск * Created by gen on 15.12.2017. */ @RunWith(AndroidJUnit4.class) public class SearchDaoTest extends DbTest { private static final String CACHE_KEY = "search::light"; private static final String TITLE= "Духи"; private static final float PRICE = 159f; private static final String IMAGE= "http://test.org/image.png"; @Test public void insertAndReadList() throws IOException, InterruptedException { db.searchDao().insert(getSearchGood(1)); db.searchDao().insert(getSearchGood(2)); List<SearchGood> inserted = getValue(db.searchDao().getSearchGoods(CACHE_KEY)); assertThat(inserted, notNullValue()); assertThat(inserted.isEmpty(), is(false)); assertThat(inserted.size(), is(2)); assertThat(inserted.get(0).title, is(TITLE)); assertThat(inserted.get(0).image, is(IMAGE)); assertThat(inserted.get(0).price, is(PRICE)); assertThat(inserted.get(0).id, is(1L)); } @Test public void clearOld() throws IOException, InterruptedException { db.searchDao().insert(getSearchGood(1)); db.searchDao().clearOld(CACHE_KEY); List<SearchGood> inserted = getValue(db.searchDao().getSearchGoods(CACHE_KEY)); assertThat(inserted.isEmpty(), is(true)); } private SearchGood getSearchGood(long id){ SearchGood item = new SearchGood(); item.cacheKey = CACHE_KEY; item.image = IMAGE; item.id = id; item.price = PRICE; item.title = TITLE; return item; } }
UTF-8
Java
2,075
java
SearchDaoTest.java
Java
[ { "context": "ue;\n\n/**\n * Тестирование базы: поиск\n * Created by gen on 15.12.2017.\n */\n@RunWith(AndroidJUnit4.class)\n", "end": 519, "score": 0.989071249961853, "start": 516, "tag": "USERNAME", "value": "gen" } ]
null
[]
package ru.devsp.apps.market.db; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import java.io.IOException; import java.util.List; import ru.devsp.apps.market.model.objects.SearchGood; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static ru.devsp.apps.market.tools.LiveDataTestUtil.getValue; /** * Тестирование базы: поиск * Created by gen on 15.12.2017. */ @RunWith(AndroidJUnit4.class) public class SearchDaoTest extends DbTest { private static final String CACHE_KEY = "search::light"; private static final String TITLE= "Духи"; private static final float PRICE = 159f; private static final String IMAGE= "http://test.org/image.png"; @Test public void insertAndReadList() throws IOException, InterruptedException { db.searchDao().insert(getSearchGood(1)); db.searchDao().insert(getSearchGood(2)); List<SearchGood> inserted = getValue(db.searchDao().getSearchGoods(CACHE_KEY)); assertThat(inserted, notNullValue()); assertThat(inserted.isEmpty(), is(false)); assertThat(inserted.size(), is(2)); assertThat(inserted.get(0).title, is(TITLE)); assertThat(inserted.get(0).image, is(IMAGE)); assertThat(inserted.get(0).price, is(PRICE)); assertThat(inserted.get(0).id, is(1L)); } @Test public void clearOld() throws IOException, InterruptedException { db.searchDao().insert(getSearchGood(1)); db.searchDao().clearOld(CACHE_KEY); List<SearchGood> inserted = getValue(db.searchDao().getSearchGoods(CACHE_KEY)); assertThat(inserted.isEmpty(), is(true)); } private SearchGood getSearchGood(long id){ SearchGood item = new SearchGood(); item.cacheKey = CACHE_KEY; item.image = IMAGE; item.id = id; item.price = PRICE; item.title = TITLE; return item; } }
2,075
0.689268
0.678537
64
31.03125
24.469988
87
false
false
0
0
0
0
0
0
0.71875
false
false
2
66cc659f6c18d5186e9c743e6e0441d58571fb61
6,777,458,399,717
eca5f55f3ac8863ef70efe2edad8dfdfa1111b8a
/src/main/java/parking/mock/server/model/generic/Response.java
a50470d926a91154772a93449816fad61a4742d9
[]
no_license
WarnerHooh/parking-mock-server
https://github.com/WarnerHooh/parking-mock-server
9cf81a999aabfb642890218bc7ba56870808111a
68f2b17cb4c4498fc4a840fbbcce03a6d9dcbfea
refs/heads/master
2020-05-09T12:31:52.789000
2019-09-17T10:41:24
2019-09-17T10:41:24
181,114,569
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package parking.mock.server.model.generic; import ma.glasnost.orika.MapperFactory; import ma.glasnost.orika.impl.DefaultMapperFactory; public class Response<T> { public Response() { } public Response(T data) { this.data = data; } public T getData() { return data; } public Response<T> setData(T data) { this.data = data; return this; } private T data; }
UTF-8
Java
430
java
Response.java
Java
[]
null
[]
package parking.mock.server.model.generic; import ma.glasnost.orika.MapperFactory; import ma.glasnost.orika.impl.DefaultMapperFactory; public class Response<T> { public Response() { } public Response(T data) { this.data = data; } public T getData() { return data; } public Response<T> setData(T data) { this.data = data; return this; } private T data; }
430
0.616279
0.616279
26
15.538462
15.618606
51
false
false
0
0
0
0
0
0
0.307692
false
false
2
e6f988ff1a3ca618d07c926c8c167be35e8c4fd8
12,945,031,439,095
acc7de0194dd6dd70a4f0e37b0c76699e04442d5
/src/test/java/com/anand/trie/TrieDictionaryTest.java
4ad73376f23ac2f98679c2b8dc2f7a1cc38785cc
[]
no_license
anandbikas/parkinglot
https://github.com/anandbikas/parkinglot
1a2ee7159f9017f81ba820f8e78053e6dda15903
e9dc107091cb22c79185c299fb4a02b50175d4d7
refs/heads/master
2020-06-29T03:32:17.610000
2019-08-16T17:01:36
2019-08-16T17:01:36
200,427,741
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * @Author: Bikas Anand, * Sr. Software Engineer (SDE 3). * Git: https://github.com/anandbikas * LinkedIn: https://linkedin.com/in/anand-iitr-mca/ * Alma Mater: Indian Institute of Technology, Roorkee. */ package com.anand.trie; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @Test public class TrieDictionaryTest { private TrieDictionary<Integer> trieDictionary; @BeforeMethod private void setUp(){ trieDictionary = new TrieDictionary<>(new RegistrationNumberAlphabet()); } @Test private void testTrieDictionary(){ trieDictionary.insert("KA-01-HH-1234", 1); trieDictionary.insert("KA-01-HH-9999", 5); Assert.assertNotNull(trieDictionary.search("KA-01-HH-1234")); Assert.assertEquals(trieDictionary.search("KA-01-HH-9999"), (Integer) 5); trieDictionary.delete("KA-01-HH-9999"); Assert.assertNull(trieDictionary.search("KA-01-HH-9999")); } }
UTF-8
Java
1,057
java
TrieDictionaryTest.java
Java
[ { "context": "/**\n * @Author: Bikas Anand,\n * Sr. Software Engineer (SDE 3).\n ", "end": 31, "score": 0.9998831748962402, "start": 20, "tag": "NAME", "value": "Bikas Anand" }, { "context": " (SDE 3).\n * Git: https://github.com/anandbikas\n * ...
null
[]
/** * @Author: <NAME>, * Sr. Software Engineer (SDE 3). * Git: https://github.com/anandbikas * LinkedIn: https://linkedin.com/in/anand-iitr-mca/ * <NAME>: Indian Institute of Technology, Roorkee. */ package com.anand.trie; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @Test public class TrieDictionaryTest { private TrieDictionary<Integer> trieDictionary; @BeforeMethod private void setUp(){ trieDictionary = new TrieDictionary<>(new RegistrationNumberAlphabet()); } @Test private void testTrieDictionary(){ trieDictionary.insert("KA-01-HH-1234", 1); trieDictionary.insert("KA-01-HH-9999", 5); Assert.assertNotNull(trieDictionary.search("KA-01-HH-1234")); Assert.assertEquals(trieDictionary.search("KA-01-HH-9999"), (Integer) 5); trieDictionary.delete("KA-01-HH-9999"); Assert.assertNull(trieDictionary.search("KA-01-HH-9999")); } }
1,048
0.655629
0.617786
36
28.361111
26.368282
81
false
false
0
0
0
0
0
0
0.472222
false
false
2
f72270557dc6a6a8ac90627b651e94bece56e65c
15,023,795,610,606
4177802289807cc102bff3fd0624c39d5fe86713
/src/test/java/parasut/client/test/CreateContactTest.java
92aa7d340d5e02d32081d03553dc4f519c59dab2
[ "MIT" ]
permissive
easikoglu/parasut-java-client-api
https://github.com/easikoglu/parasut-java-client-api
c3d8669286a54f2f26e7a16761bdd2a2a28a1c5a
5b88c7040dc36ef1d2cca6cd9e87815e0fc5f089
refs/heads/master
2020-04-04T16:33:18.358000
2018-11-06T15:29:41
2018-11-06T15:29:41
156,082,642
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package parasut.client.test; import model.contact.ParasutContact; import model.contact.ParasutContactRequest; import model.contact.enums.ParasutContactAccountType; import model.request.ParasutSimpleRequest; import org.junit.Test; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertThat; public class CreateContactTest extends BaseTest { /** * create parasut contact */ @Test public void generateContact_withParasutContactRequestParam() { ParasutContact parasutContact = ParasutContact.create(httpOptions, ParasutContactRequest.builder() .accountType(ParasutContactAccountType.CUSTOMER.getValue()) .email("test@parasut.com") .name("test parasut") .build(), ParasutSimpleRequest.builder() .companyId(companyId) .token(parasutGetToken.getAccessToken()) .build() ); assertThat(parasutContact.getData().getAttributes().get("email"), equalTo("test@parasut.com")); } }
UTF-8
Java
1,138
java
CreateContactTest.java
Java
[ { "context": "TOMER.getValue())\n .email(\"test@parasut.com\")\n .name(\"test parasut\")\n ", "end": 740, "score": 0.9999287724494934, "start": 724, "tag": "EMAIL", "value": "test@parasut.com" }, { "context": "test@parasut.com\")\n ...
null
[]
package parasut.client.test; import model.contact.ParasutContact; import model.contact.ParasutContactRequest; import model.contact.enums.ParasutContactAccountType; import model.request.ParasutSimpleRequest; import org.junit.Test; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertThat; public class CreateContactTest extends BaseTest { /** * create parasut contact */ @Test public void generateContact_withParasutContactRequestParam() { ParasutContact parasutContact = ParasutContact.create(httpOptions, ParasutContactRequest.builder() .accountType(ParasutContactAccountType.CUSTOMER.getValue()) .email("<EMAIL>") .name("<NAME>") .build(), ParasutSimpleRequest.builder() .companyId(companyId) .token(parasutGetToken.getAccessToken()) .build() ); assertThat(parasutContact.getData().getAttributes().get("email"), equalTo("<EMAIL>")); } }
1,114
0.644112
0.644112
34
32.470589
29.063051
106
false
false
0
0
0
0
0
0
0.382353
false
false
2
c7553e7f14f6f4aa08cc550583517e824ba67d4b
22,514,218,574,007
8571a3e9ff3b2eee4681b73178b0f65102301c80
/src/main/java/net/parim/sns/modules/sys/service/PermissionService.java
2721bd9ba1e53ea700130dcbfb69629e4ec69629
[]
no_license
yong1236/cmcc-sns
https://github.com/yong1236/cmcc-sns
ba7dfde8ed860cc5aeaa80532d5d43eda8d582f1
ac7f3f98291fb7736cd05f7de502f4fcbfcb2df6
refs/heads/master
2021-01-10T01:10:15.324000
2016-01-02T23:18:24
2016-01-02T23:18:24
47,612,237
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.parim.sns.modules.sys.service; import net.parim.sns.modules.sys.repository.PrivilegeRepository; import net.parim.sns.modules.sys.repository.RoleRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class PermissionService { @Autowired PrivilegeRepository privilegeRepository; @Autowired RoleRepository roleRepository; }
UTF-8
Java
429
java
PermissionService.java
Java
[]
null
[]
package net.parim.sns.modules.sys.service; import net.parim.sns.modules.sys.repository.PrivilegeRepository; import net.parim.sns.modules.sys.repository.RoleRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class PermissionService { @Autowired PrivilegeRepository privilegeRepository; @Autowired RoleRepository roleRepository; }
429
0.832168
0.832168
18
22.833334
23.443193
64
false
false
0
0
0
0
0
0
0.777778
false
false
2
ddaa45ed75c943aed657ee957648151a0c252e57
30,966,714,208,306
ecba00e96cd2a6e3ab4ef4f1727727920a5508b8
/OS/Ov3/code/CPU.java
56acb86f6480e9a83ec99ab3c982534a6c78ecee
[]
no_license
OlavOlseng/Assig
https://github.com/OlavOlseng/Assig
88daac694075e731eb49942bdeda467d52d8f9d3
16c957eb299825dea86119da45621b936d882a9a
refs/heads/master
2020-04-10T14:56:18.987000
2019-04-11T10:16:01
2019-04-11T10:16:01
12,586,966
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class CPU { Statistics statistics; private Process currentProcess; long lastEventTime; Gui gui; public CPU(long clock, Statistics statistics, Gui gui){ this.statistics = statistics; this.lastEventTime = clock; this.gui = gui; } public void setProcess(Process p, long clock) { if(currentProcess == null) { statistics.cpuIdleTime += clock - lastEventTime; } lastEventTime = clock; this.currentProcess = p; gui.setCpuActive(p); } public Process removeProcess(long clock) { if(currentProcess == null) return null; Process p = currentProcess; p.leaveCPU(clock); currentProcess = null; statistics.cpuProcessTime += clock - lastEventTime; lastEventTime = clock; gui.setCpuActive(null); return p; } }
UTF-8
Java
756
java
CPU.java
Java
[]
null
[]
public class CPU { Statistics statistics; private Process currentProcess; long lastEventTime; Gui gui; public CPU(long clock, Statistics statistics, Gui gui){ this.statistics = statistics; this.lastEventTime = clock; this.gui = gui; } public void setProcess(Process p, long clock) { if(currentProcess == null) { statistics.cpuIdleTime += clock - lastEventTime; } lastEventTime = clock; this.currentProcess = p; gui.setCpuActive(p); } public Process removeProcess(long clock) { if(currentProcess == null) return null; Process p = currentProcess; p.leaveCPU(clock); currentProcess = null; statistics.cpuProcessTime += clock - lastEventTime; lastEventTime = clock; gui.setCpuActive(null); return p; } }
756
0.712963
0.712963
34
21.205883
16.577412
56
false
false
0
0
0
0
0
0
2.117647
false
false
2
cd9f13da9bb5adcab22be44d4a28d3e21e256e40
23,742,579,239,690
8b74313ffb2b8bb64c6a321e1a31417fd87c1691
/demo-all/src/test/java/BubleSort.java
8412400007bc6cb3dd59634a984d11f3a9890486
[]
no_license
Zongji/java-code-collections
https://github.com/Zongji/java-code-collections
4edb7004987b545e1d538942f70b6cff0ac26d1c
5b1416027ccd6d4e77052daeaf3a962126d6a91e
refs/heads/master
2019-01-24T03:22:41.439000
2019-01-08T17:07:01
2019-01-08T17:07:01
85,962,735
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package test; public class BubleSort { public static void main(String[] args) { // TODO Auto-generated method stub int a[] = {1,7,8,5,6,4}; sort(a); System.out.println("======="); for (int i : a) { System.out.print(i); } } public static void sort(int []arr){ for (int i = 0; i < arr.length; i++) { for (int j = i; j < arr.length-1; j++) { if (arr[j]>arr[j+1]) { int tmp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = tmp; } } } } }
UTF-8
Java
485
java
BubleSort.java
Java
[]
null
[]
package test; public class BubleSort { public static void main(String[] args) { // TODO Auto-generated method stub int a[] = {1,7,8,5,6,4}; sort(a); System.out.println("======="); for (int i : a) { System.out.print(i); } } public static void sort(int []arr){ for (int i = 0; i < arr.length; i++) { for (int j = i; j < arr.length-1; j++) { if (arr[j]>arr[j+1]) { int tmp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = tmp; } } } } }
485
0.505155
0.482474
28
16.321428
14.466843
43
false
false
0
0
0
0
0
0
2.571429
false
false
2
1d6709a0d71ac7746f4ecbd9cf95cb8f3ea6ca27
31,799,937,883,912
09fd8ba3bdc0450034d81abe64f9a7b5d0dd7415
/src/main/java/edu/cecar/controladores/ControladorPhoto.java
0613d5d52761478606905499ded404a089f89dd5
[]
no_license
angelone21/TestDesarrolladorC-S
https://github.com/angelone21/TestDesarrolladorC-S
580f71de6d387d193766e95c52fefad5655d722d
6319c000bce7210fdce3df3d399827f4c847cdb2
refs/heads/master
2022-07-09T17:04:19.742000
2019-09-30T04:38:49
2019-09-30T04:38:49
211,773,345
0
0
null
false
2022-06-21T01:58:01
2019-09-30T04:12:23
2019-09-30T04:38:51
2022-06-21T01:58:01
202
0
0
2
Java
false
false
package edu.cecar.controladores; import edu.cecar.componentes.singletons.SingletonConexionBD; import edu.cecar.modelos.Photo; import java.sql.PreparedStatement; import java.sql.SQLException; /** * Clase: ControladorPhoto * * @version: 0.1 * * @since: 16/09/2019 * * Fecha de Modificación: * * @author: Vincenzo Angelone * * Copyrigth: CECAR */ public final class ControladorPhoto { public void guardar(Photo photo) throws SQLException { PreparedStatement preparedStatement = SingletonConexionBD.getinstance().prepareStatement("insert into photo values(?,?,?,?,?,?,?)"); preparedStatement.setInt(1, photo.getId_photo()); preparedStatement.setInt(2, photo.getId_album()); preparedStatement.setString(3, photo.getTitle()); preparedStatement.setString(4, photo.getUrl()); preparedStatement.setString(5, photo.getThumbnail()); preparedStatement.setString(6, photo.getSelf()); preparedStatement.setString(7, photo.getEdit()); preparedStatement.execute(); } public void eliminarTodo() throws SQLException { PreparedStatement preparedStatement = SingletonConexionBD.getinstance().prepareStatement("delete from photo"); preparedStatement.execute(); } }
UTF-8
Java
1,267
java
ControladorPhoto.java
Java
[ { "context": "9/2019\n *\n * Fecha de Modificación:\n *\n * @author: Vincenzo Angelone\n *\n * Copyrigth: CECAR\n */\npublic final class Con", "end": 330, "score": 0.999880850315094, "start": 313, "tag": "NAME", "value": "Vincenzo Angelone" } ]
null
[]
package edu.cecar.controladores; import edu.cecar.componentes.singletons.SingletonConexionBD; import edu.cecar.modelos.Photo; import java.sql.PreparedStatement; import java.sql.SQLException; /** * Clase: ControladorPhoto * * @version: 0.1 * * @since: 16/09/2019 * * Fecha de Modificación: * * @author: <NAME> * * Copyrigth: CECAR */ public final class ControladorPhoto { public void guardar(Photo photo) throws SQLException { PreparedStatement preparedStatement = SingletonConexionBD.getinstance().prepareStatement("insert into photo values(?,?,?,?,?,?,?)"); preparedStatement.setInt(1, photo.getId_photo()); preparedStatement.setInt(2, photo.getId_album()); preparedStatement.setString(3, photo.getTitle()); preparedStatement.setString(4, photo.getUrl()); preparedStatement.setString(5, photo.getThumbnail()); preparedStatement.setString(6, photo.getSelf()); preparedStatement.setString(7, photo.getEdit()); preparedStatement.execute(); } public void eliminarTodo() throws SQLException { PreparedStatement preparedStatement = SingletonConexionBD.getinstance().prepareStatement("delete from photo"); preparedStatement.execute(); } }
1,256
0.7109
0.697472
41
29.878048
31.463642
140
false
false
0
0
0
0
0
0
0.707317
false
false
2
cfd47771e2fbc2c626af35e3ef20f00da6882819
2,963,527,466,298
e8ab0ccb257ce50fcbbaeb6bb25c788bb94152b8
/zap/src/main/java/org/zaproxy/zap/authentication/UsernamePasswordAuthenticationCredentials.java
9e5ae8397980723243fc68b1a2fd7b2eef845647
[ "Apache-2.0" ]
permissive
zaproxy/zaproxy
https://github.com/zaproxy/zaproxy
b8c982bcdf65dd9088893def83f561b838d8f28e
438f49c3db13eaff90c6c68a6e5c663a4dc4dc7c
refs/heads/main
2023-09-01T13:24:56.261000
2023-08-31T16:23:44
2023-08-31T16:23:44
36,817,565
11,996
2,629
Apache-2.0
false
2023-09-14T09:11:38
2015-06-03T16:55:01
2023-09-14T08:32:50
2023-09-14T09:11:37
195,912
11,225
2,117
728
Java
false
false
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2013 The ZAP Development Team * * 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.zaproxy.zap.authentication; import java.awt.GridBagLayout; import java.awt.Insets; import java.util.HashMap; import java.util.Map; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPasswordField; import net.sf.json.JSONObject; import org.apache.commons.codec.binary.Base64; import org.parosproxy.paros.Constant; import org.parosproxy.paros.control.Control; import org.zaproxy.zap.extension.api.ApiDynamicActionImplementor; import org.zaproxy.zap.extension.api.ApiException; import org.zaproxy.zap.extension.api.ApiResponse; import org.zaproxy.zap.extension.api.ApiResponseSet; import org.zaproxy.zap.extension.users.ExtensionUserManagement; import org.zaproxy.zap.extension.users.UsersAPI; import org.zaproxy.zap.model.Context; import org.zaproxy.zap.users.User; import org.zaproxy.zap.utils.ApiUtils; import org.zaproxy.zap.utils.ZapTextField; import org.zaproxy.zap.view.LayoutHelper; /** * The credentials implementation for use in systems that require a username and password * combination for authentication. */ public class UsernamePasswordAuthenticationCredentials implements AuthenticationCredentials { private static final String API_NAME = "UsernamePasswordAuthenticationCredentials"; /** * String used to represent encoded null credentials, that is, when {@code username} is {@code * null}. * * <p>It's a null character Base64 encoded, which will never be equal to encoding of defined * {@code username}/{@code password}. * * @see #encode(String) * @see #decode(String) */ private static final String NULL_CREDENTIALS = "AA=="; private static String FIELD_SEPARATOR = "~"; private String username; private String password; public UsernamePasswordAuthenticationCredentials() { super(); } public UsernamePasswordAuthenticationCredentials(String username, String password) { super(); this.username = username; this.password = password; } /** * Gets the username. * * @return the username */ public String getUsername() { return username; } /** * Gets the password. * * @return the password */ public String getPassword() { return password; } @Override public boolean isConfigured() { return username != null && password != null; } @Override public String encode(String parentStringSeparator) { if (FIELD_SEPARATOR.equals(parentStringSeparator)) { throw new IllegalArgumentException( "The string separator must not be the same as Field Separator (" + FIELD_SEPARATOR + ")."); } if (username == null) { return NULL_CREDENTIALS; } StringBuilder out = new StringBuilder(); out.append(Base64.encodeBase64String(username.getBytes())).append(FIELD_SEPARATOR); out.append(Base64.encodeBase64String(password.getBytes())).append(FIELD_SEPARATOR); return out.toString(); } @Override public void decode(String encodedCredentials) { if (NULL_CREDENTIALS.equals(encodedCredentials)) { username = null; password = null; return; } String[] pieces = encodedCredentials.split(FIELD_SEPARATOR); if (pieces.length == 0) { this.username = ""; this.password = ""; return; } this.username = new String(Base64.decodeBase64(pieces[0])); if (pieces.length > 1) this.password = new String(Base64.decodeBase64(pieces[1])); else this.password = ""; } /** * The Options Panel used for configuring a {@link UsernamePasswordAuthenticationCredentials}. */ public static class UsernamePasswordAuthenticationCredentialsOptionsPanel extends AbstractCredentialsOptionsPanel<UsernamePasswordAuthenticationCredentials> { private static final long serialVersionUID = 8881019014296985804L; private static final String USERNAME_LABEL = Constant.messages.getString( "authentication.method.fb.credentials.field.label.user"); private static final String PASSWORD_LABEL = Constant.messages.getString( "authentication.method.fb.credentials.field.label.pass"); private ZapTextField usernameTextField; private JPasswordField passwordTextField; public UsernamePasswordAuthenticationCredentialsOptionsPanel( UsernamePasswordAuthenticationCredentials credentials) { super(credentials); initialize(); } private void initialize() { this.setLayout(new GridBagLayout()); this.add(new JLabel(USERNAME_LABEL), LayoutHelper.getGBC(0, 0, 1, 0.0d)); this.usernameTextField = new ZapTextField(); if (this.getCredentials().username != null) this.usernameTextField.setText(this.getCredentials().username); this.add( this.usernameTextField, LayoutHelper.getGBC(1, 0, 1, 0.0d, new Insets(0, 4, 0, 0))); this.add(new JLabel(PASSWORD_LABEL), LayoutHelper.getGBC(0, 1, 1, 0.0d)); this.passwordTextField = new JPasswordField(); if (this.getCredentials().password != null) this.passwordTextField.setText(this.getCredentials().password); this.add( this.passwordTextField, LayoutHelper.getGBC(1, 1, 1, 1.0d, new Insets(0, 4, 0, 0))); } @Override public boolean validateFields() { if (usernameTextField.getText().isEmpty()) { JOptionPane.showMessageDialog( this, Constant.messages.getString( "authentication.method.fb.credentials.dialog.error.user.text"), Constant.messages.getString("authentication.method.fb.dialog.error.title"), JOptionPane.WARNING_MESSAGE); usernameTextField.requestFocusInWindow(); return false; } return true; } @Override public void saveCredentials() { getCredentials().username = usernameTextField.getText(); getCredentials().password = new String(passwordTextField.getPassword()); } } /* API related constants and methods. */ @Override public ApiResponse getApiResponseRepresentation() { Map<String, String> values = new HashMap<>(); values.put("type", API_NAME); values.put("username", username); values.put("password", password); return new ApiResponseSet<>("credentials", values); } private static final String ACTION_SET_CREDENTIALS = "formBasedAuthenticationCredentials"; private static final String PARAM_USERNAME = "username"; private static final String PARAM_PASSWORD = "password"; /** * Gets the api action for setting a {@link UsernamePasswordAuthenticationCredentials} for an * User. * * @param methodType the method type for which this is called * @return the sets the credentials for user api action */ public static ApiDynamicActionImplementor getSetCredentialsForUserApiAction( final AuthenticationMethodType methodType) { return new ApiDynamicActionImplementor( ACTION_SET_CREDENTIALS, new String[] {PARAM_USERNAME, PARAM_PASSWORD}, null) { @Override public void handleAction(JSONObject params) throws ApiException { Context context = ApiUtils.getContextByParamId(params, UsersAPI.PARAM_CONTEXT_ID); int userId = ApiUtils.getIntParam(params, UsersAPI.PARAM_USER_ID); // Make sure the type of authentication method is compatible if (!methodType.isTypeForMethod(context.getAuthenticationMethod())) throw new ApiException( ApiException.Type.ILLEGAL_PARAMETER, "User's credentials should match authentication method type of the context: " + context.getAuthenticationMethod().getType().getName()); // NOTE: no need to check if extension is loaded as this method is called only if // the Users // extension is loaded ExtensionUserManagement extensionUserManagement = Control.getSingleton() .getExtensionLoader() .getExtension(ExtensionUserManagement.class); User user = extensionUserManagement .getContextUserAuthManager(context.getId()) .getUserById(userId); if (user == null) throw new ApiException( ApiException.Type.USER_NOT_FOUND, UsersAPI.PARAM_USER_ID); // Build and set the credentials UsernamePasswordAuthenticationCredentials credentials = new UsernamePasswordAuthenticationCredentials(); credentials.username = ApiUtils.getNonEmptyStringParam(params, PARAM_USERNAME); credentials.password = params.optString(PARAM_PASSWORD, ""); user.setAuthenticationCredentials(credentials); } }; } }
UTF-8
Java
10,443
java
UsernamePasswordAuthenticationCredentials.java
Java
[ { "context": "ssword) {\n super();\n this.username = username;\n this.password = password;\n }\n\n /**", "end": 2711, "score": 0.9872720837593079, "start": 2703, "tag": "USERNAME", "value": "username" }, { "context": " this.username = username;\n thi...
null
[]
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2013 The ZAP Development Team * * 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.zaproxy.zap.authentication; import java.awt.GridBagLayout; import java.awt.Insets; import java.util.HashMap; import java.util.Map; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPasswordField; import net.sf.json.JSONObject; import org.apache.commons.codec.binary.Base64; import org.parosproxy.paros.Constant; import org.parosproxy.paros.control.Control; import org.zaproxy.zap.extension.api.ApiDynamicActionImplementor; import org.zaproxy.zap.extension.api.ApiException; import org.zaproxy.zap.extension.api.ApiResponse; import org.zaproxy.zap.extension.api.ApiResponseSet; import org.zaproxy.zap.extension.users.ExtensionUserManagement; import org.zaproxy.zap.extension.users.UsersAPI; import org.zaproxy.zap.model.Context; import org.zaproxy.zap.users.User; import org.zaproxy.zap.utils.ApiUtils; import org.zaproxy.zap.utils.ZapTextField; import org.zaproxy.zap.view.LayoutHelper; /** * The credentials implementation for use in systems that require a username and password * combination for authentication. */ public class UsernamePasswordAuthenticationCredentials implements AuthenticationCredentials { private static final String API_NAME = "UsernamePasswordAuthenticationCredentials"; /** * String used to represent encoded null credentials, that is, when {@code username} is {@code * null}. * * <p>It's a null character Base64 encoded, which will never be equal to encoding of defined * {@code username}/{@code password}. * * @see #encode(String) * @see #decode(String) */ private static final String NULL_CREDENTIALS = "AA=="; private static String FIELD_SEPARATOR = "~"; private String username; private String password; public UsernamePasswordAuthenticationCredentials() { super(); } public UsernamePasswordAuthenticationCredentials(String username, String password) { super(); this.username = username; this.password = <PASSWORD>; } /** * Gets the username. * * @return the username */ public String getUsername() { return username; } /** * Gets the password. * * @return the password */ public String getPassword() { return password; } @Override public boolean isConfigured() { return username != null && password != null; } @Override public String encode(String parentStringSeparator) { if (FIELD_SEPARATOR.equals(parentStringSeparator)) { throw new IllegalArgumentException( "The string separator must not be the same as Field Separator (" + FIELD_SEPARATOR + ")."); } if (username == null) { return NULL_CREDENTIALS; } StringBuilder out = new StringBuilder(); out.append(Base64.encodeBase64String(username.getBytes())).append(FIELD_SEPARATOR); out.append(Base64.encodeBase64String(password.getBytes())).append(FIELD_SEPARATOR); return out.toString(); } @Override public void decode(String encodedCredentials) { if (NULL_CREDENTIALS.equals(encodedCredentials)) { username = null; password = null; return; } String[] pieces = encodedCredentials.split(FIELD_SEPARATOR); if (pieces.length == 0) { this.username = ""; this.password = ""; return; } this.username = new String(Base64.decodeBase64(pieces[0])); if (pieces.length > 1) this.password = new String(Base64.decodeBase64(pieces[1])); else this.password = ""; } /** * The Options Panel used for configuring a {@link UsernamePasswordAuthenticationCredentials}. */ public static class UsernamePasswordAuthenticationCredentialsOptionsPanel extends AbstractCredentialsOptionsPanel<UsernamePasswordAuthenticationCredentials> { private static final long serialVersionUID = 8881019014296985804L; private static final String USERNAME_LABEL = Constant.messages.getString( "authentication.method.fb.credentials.field.label.user"); private static final String PASSWORD_LABEL = Constant.messages.getString( "authentication.method.fb.credentials.field.label.pass"); private ZapTextField usernameTextField; private JPasswordField passwordTextField; public UsernamePasswordAuthenticationCredentialsOptionsPanel( UsernamePasswordAuthenticationCredentials credentials) { super(credentials); initialize(); } private void initialize() { this.setLayout(new GridBagLayout()); this.add(new JLabel(USERNAME_LABEL), LayoutHelper.getGBC(0, 0, 1, 0.0d)); this.usernameTextField = new ZapTextField(); if (this.getCredentials().username != null) this.usernameTextField.setText(this.getCredentials().username); this.add( this.usernameTextField, LayoutHelper.getGBC(1, 0, 1, 0.0d, new Insets(0, 4, 0, 0))); this.add(new JLabel(PASSWORD_LABEL), LayoutHelper.getGBC(0, 1, 1, 0.0d)); this.passwordTextField = new JPasswordField(); if (this.getCredentials().password != null) this.passwordTextField.setText(this.getCredentials().password); this.add( this.passwordTextField, LayoutHelper.getGBC(1, 1, 1, 1.0d, new Insets(0, 4, 0, 0))); } @Override public boolean validateFields() { if (usernameTextField.getText().isEmpty()) { JOptionPane.showMessageDialog( this, Constant.messages.getString( "authentication.method.fb.credentials.dialog.error.user.text"), Constant.messages.getString("authentication.method.fb.dialog.error.title"), JOptionPane.WARNING_MESSAGE); usernameTextField.requestFocusInWindow(); return false; } return true; } @Override public void saveCredentials() { getCredentials().username = usernameTextField.getText(); getCredentials().password = new String(passwordTextField.getPassword()); } } /* API related constants and methods. */ @Override public ApiResponse getApiResponseRepresentation() { Map<String, String> values = new HashMap<>(); values.put("type", API_NAME); values.put("username", username); values.put("password", <PASSWORD>); return new ApiResponseSet<>("credentials", values); } private static final String ACTION_SET_CREDENTIALS = "formBasedAuthenticationCredentials"; private static final String PARAM_USERNAME = "username"; private static final String PARAM_PASSWORD = "<PASSWORD>"; /** * Gets the api action for setting a {@link UsernamePasswordAuthenticationCredentials} for an * User. * * @param methodType the method type for which this is called * @return the sets the credentials for user api action */ public static ApiDynamicActionImplementor getSetCredentialsForUserApiAction( final AuthenticationMethodType methodType) { return new ApiDynamicActionImplementor( ACTION_SET_CREDENTIALS, new String[] {PARAM_USERNAME, PARAM_PASSWORD}, null) { @Override public void handleAction(JSONObject params) throws ApiException { Context context = ApiUtils.getContextByParamId(params, UsersAPI.PARAM_CONTEXT_ID); int userId = ApiUtils.getIntParam(params, UsersAPI.PARAM_USER_ID); // Make sure the type of authentication method is compatible if (!methodType.isTypeForMethod(context.getAuthenticationMethod())) throw new ApiException( ApiException.Type.ILLEGAL_PARAMETER, "User's credentials should match authentication method type of the context: " + context.getAuthenticationMethod().getType().getName()); // NOTE: no need to check if extension is loaded as this method is called only if // the Users // extension is loaded ExtensionUserManagement extensionUserManagement = Control.getSingleton() .getExtensionLoader() .getExtension(ExtensionUserManagement.class); User user = extensionUserManagement .getContextUserAuthManager(context.getId()) .getUserById(userId); if (user == null) throw new ApiException( ApiException.Type.USER_NOT_FOUND, UsersAPI.PARAM_USER_ID); // Build and set the credentials UsernamePasswordAuthenticationCredentials credentials = new UsernamePasswordAuthenticationCredentials(); credentials.username = ApiUtils.getNonEmptyStringParam(params, PARAM_USERNAME); credentials.password = <PASSWORD>String(PARAM_PASSWORD, ""); user.setAuthenticationCredentials(credentials); } }; } }
10,449
0.632098
0.624533
267
38.112358
29.759375
105
false
false
0
0
0
0
0
0
0.531835
false
false
2
a5ac35761b97571a9d852167303b16e830837ea4
18,897,856,129,151
4142f6ba0121fe23c6f5e9a2ea2cd694c53d7976
/repository-crm/src/main/java/com/repository/crm/Po/CmsFooterChild.java
143f35f635f28c74db210949c51c124425027510
[]
no_license
bellmit/base-repository
https://github.com/bellmit/base-repository
49b02243ee29696277802c6b0200f76e12c25bc7
7aa410d2cb92530bf1227611d03c6974b40d9433
refs/heads/master
2023-03-18T00:10:33.600000
2018-09-13T06:27:25
2018-09-13T06:27:25
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.repository.crm.Po; import java.util.Date; /** * @author ywj * Created by ywj on 2018/05/22 */ public class CmsFooterChild { private Long id; private String uuid; /** * 名称 */ private String name; /** * 链接 */ private String link; /** * 所属栏目uuid */ private String columnUuid; /** * 状态0:被撤销1:未被撤销 */ private Boolean status; private Date createDate; private String createUserId; private Date updateDate; private String updateUserId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid == null ? null : uuid.trim(); } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getLink() { return link; } public void setLink(String link) { this.link = link == null ? null : link.trim(); } public String getColumnUuid() { return columnUuid; } public void setColumnUuid(String columnUuid) { this.columnUuid = columnUuid == null ? null : columnUuid.trim(); } public Boolean getStatus() { return status; } public void setStatus(Boolean status) { this.status = status; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getCreateUserId() { return createUserId; } public void setCreateUserId(String createUserId) { this.createUserId = createUserId == null ? null : createUserId.trim(); } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public String getUpdateUserId() { return updateUserId; } public void setUpdateUserId(String updateUserId) { this.updateUserId = updateUserId == null ? null : updateUserId.trim(); } }
UTF-8
Java
2,275
java
CmsFooterChild.java
Java
[ { "context": "ry.crm.Po;\n\nimport java.util.Date;\n\n/**\n * @author ywj\n * Created by ywj on 2018/05/22\n */\npublic class ", "end": 74, "score": 0.9996746778488159, "start": 71, "tag": "USERNAME", "value": "ywj" }, { "context": " java.util.Date;\n\n/**\n * @author ywj\n * Created...
null
[]
package com.repository.crm.Po; import java.util.Date; /** * @author ywj * Created by ywj on 2018/05/22 */ public class CmsFooterChild { private Long id; private String uuid; /** * 名称 */ private String name; /** * 链接 */ private String link; /** * 所属栏目uuid */ private String columnUuid; /** * 状态0:被撤销1:未被撤销 */ private Boolean status; private Date createDate; private String createUserId; private Date updateDate; private String updateUserId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid == null ? null : uuid.trim(); } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getLink() { return link; } public void setLink(String link) { this.link = link == null ? null : link.trim(); } public String getColumnUuid() { return columnUuid; } public void setColumnUuid(String columnUuid) { this.columnUuid = columnUuid == null ? null : columnUuid.trim(); } public Boolean getStatus() { return status; } public void setStatus(Boolean status) { this.status = status; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getCreateUserId() { return createUserId; } public void setCreateUserId(String createUserId) { this.createUserId = createUserId == null ? null : createUserId.trim(); } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public String getUpdateUserId() { return updateUserId; } public void setUpdateUserId(String updateUserId) { this.updateUserId = updateUserId == null ? null : updateUserId.trim(); } }
2,275
0.585899
0.581437
121
17.528925
18.509802
78
false
false
0
0
0
0
0
0
0.264463
false
false
2
89ee1c18713196f9627ad234de622bd62dd8ca99
2,276,332,693,191
a442a2a0bc8388314e5f500de754f23467593fa8
/Week01-03 Fundamentals/Day08/src/regex/MatchAlphaNumOnly.java
b42057e02d6d109bc40147adb6c30426dafe86e1
[]
no_license
solonburleson/CollaberaJava
https://github.com/solonburleson/CollaberaJava
7c9928015e43db9c785d8a021734ca973383d365
e2d934f4b61bbfe9235254bca52f0428de77514f
refs/heads/master
2022-07-09T19:44:08.762000
2020-01-06T14:15:46
2020-01-06T14:15:46
215,335,405
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package regex; import java.util.regex.Pattern; public class MatchAlphaNumOnly { public static void main(String[] args) { System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello4")); //true System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello")); //false, 5 characters long System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello[")); // false, [ not in regex System.out.println(Pattern.matches("[a-zA-Z0-9._]*@[a-zA-Z0-9]*.[a-z]{3}", "solon.burleson@gmail.com")); //true, simple email regex } }
UTF-8
Java
527
java
MatchAlphaNumOnly.java
Java
[ { "context": ".matches(\"[a-zA-Z0-9._]*@[a-zA-Z0-9]*.[a-z]{3}\", \"solon.burleson@gmail.com\")); //true, simple email regex\n\t}\n\n}\n", "end": 489, "score": 0.9999225735664368, "start": 465, "tag": "EMAIL", "value": "solon.burleson@gmail.com" } ]
null
[]
package regex; import java.util.regex.Pattern; public class MatchAlphaNumOnly { public static void main(String[] args) { System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello4")); //true System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello")); //false, 5 characters long System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "Hello[")); // false, [ not in regex System.out.println(Pattern.matches("[a-zA-Z0-9._]*@[a-zA-Z0-9]*.[a-z]{3}", "<EMAIL>")); //true, simple email regex } }
510
0.660342
0.629981
15
34.133335
41.759418
133
false
false
0
0
0
0
0
0
1.666667
false
false
2
eb6a54ca87ffcc9e8bc962a179ad46b59793a54a
18,777,597,050,746
4cebe0d2407e5737a99d67c99ab84ca093f11cff
/src/multithread/chapter2/demo02InstanceVariableIsNotThreadSafe/MyThread.java
e13901332aa3674f6081ccaf925bc6fa47132be1
[]
no_license
MoXiaogui0301/MultiThread-Program
https://github.com/MoXiaogui0301/MultiThread-Program
049be7ca7084955cb2a2372bf5acb3e9584f4086
1492e1add980342fbbcc2aed7866efca119998c9
refs/heads/master
2020-04-28T00:14:37.871000
2019-04-02T04:20:04
2019-04-02T04:20:04
174,808,187
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package multithread.chapter2.demo02InstanceVariableIsNotThreadSafe; public class MyThread extends Thread { private HasSelfPrivateNum numRef; private String username; public MyThread(HasSelfPrivateNum numRef,String username) { this.numRef = numRef; this.username = username; } @Override public void run() { super.run(); numRef.addI(username); } }
UTF-8
Java
411
java
MyThread.java
Java
[ { "context": " this.numRef = numRef;\n this.username = username;\n }\n\n @Override\n public void run() {\n ", "end": 304, "score": 0.9836648106575012, "start": 296, "tag": "USERNAME", "value": "username" } ]
null
[]
package multithread.chapter2.demo02InstanceVariableIsNotThreadSafe; public class MyThread extends Thread { private HasSelfPrivateNum numRef; private String username; public MyThread(HasSelfPrivateNum numRef,String username) { this.numRef = numRef; this.username = username; } @Override public void run() { super.run(); numRef.addI(username); } }
411
0.681265
0.673966
17
23.17647
20.520393
67
false
false
0
0
0
0
0
0
0.470588
false
false
2
28bee07637da6845387a8a6a275d31a96ee13548
13,804,024,913,658
ef0dcd04924e363b53b4a9e28bf2d21014c46e94
/src/cn/boqi/algorithms/search/InsertValueSearch.java
0048994aa7422c859223518dece6814e2ebd14c4
[]
no_license
boqigao/Algorithms
https://github.com/boqigao/Algorithms
e9985e8bb8a31d13ece5263daeee791b34fb76dc
89ca3d74a1abfb9ae77747e81a5aef6e38c97129
refs/heads/master
2022-04-17T03:29:01.765000
2020-03-21T10:18:54
2020-03-21T10:18:54
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.boqi.algorithms.search; /** * 差值查找 * * @author Boqi Gao */ public class InsertValueSearch { public static void main(String[] args) { int[] arr = new int[100]; for (int i = 0; i < 100; i++) { arr[i] = i + 1; } System.out.println(insertValueSearch(arr, 0, arr.length - 1, 3)); } /** * @param arr 原数组 * @param left 左指针 * @param right 右指针 * @param findVal 查找值 * @return 如果找到,就返回 对应的下标,如果没有找到,就返回-1 */ public static int insertValueSearch(int[] arr, int left, int right, int findVal) { //注意,后面两个条件必须需要,不然会数组越界 if (left > right || findVal < arr[0] || findVal > arr[arr.length - 1]) { return -1; } int mid = left + (right - left) * (findVal - arr[left]) / (arr[right] - arr[left]); int midVal = arr[mid]; if (findVal > midVal) {//向右边查找 insertValueSearch(arr, mid + 1, right, findVal); } else if (findVal < midVal) { insertValueSearch(arr, left, mid - 1, findVal); } else { return mid; } return -1; } }
UTF-8
Java
1,280
java
InsertValueSearch.java
Java
[ { "context": "boqi.algorithms.search;\n\n/**\n * 差值查找\n *\n * @author Boqi Gao\n */\npublic class InsertValueSearch {\n public s", "end": 70, "score": 0.9998428821563721, "start": 62, "tag": "NAME", "value": "Boqi Gao" } ]
null
[]
package cn.boqi.algorithms.search; /** * 差值查找 * * @author <NAME> */ public class InsertValueSearch { public static void main(String[] args) { int[] arr = new int[100]; for (int i = 0; i < 100; i++) { arr[i] = i + 1; } System.out.println(insertValueSearch(arr, 0, arr.length - 1, 3)); } /** * @param arr 原数组 * @param left 左指针 * @param right 右指针 * @param findVal 查找值 * @return 如果找到,就返回 对应的下标,如果没有找到,就返回-1 */ public static int insertValueSearch(int[] arr, int left, int right, int findVal) { //注意,后面两个条件必须需要,不然会数组越界 if (left > right || findVal < arr[0] || findVal > arr[arr.length - 1]) { return -1; } int mid = left + (right - left) * (findVal - arr[left]) / (arr[right] - arr[left]); int midVal = arr[mid]; if (findVal > midVal) {//向右边查找 insertValueSearch(arr, mid + 1, right, findVal); } else if (findVal < midVal) { insertValueSearch(arr, left, mid - 1, findVal); } else { return mid; } return -1; } }
1,278
0.513066
0.497387
46
23.956522
24.214581
91
false
false
0
0
0
0
0
0
0.630435
false
false
2
2eb1a7402c1525de5b4a3edeca603a5f9524a38d
19,971,597,955,563
9c172532ddf12724ab137c71f3b86f953f41283d
/mallplus-admin/src/main/java/com/zscat/mallplus/water/service/impl/WtWaterCardLimitServiceImpl.java
b4f31ba425b82852a9c13888dbe4833583903419
[ "Apache-2.0" ]
permissive
huangliliu0917/mallplus
https://github.com/huangliliu0917/mallplus
34885e0501871628c7a27ab1a490433bd1f6e1c8
337dcc0d823836d0a8e4e932d4460f0476f41006
refs/heads/master
2022-12-28T04:36:27.747000
2020-06-27T02:17:38
2020-06-27T02:17:38
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zscat.mallplus.water.service.impl; import com.zscat.mallplus.water.entity.WtWaterCardLimit; import com.zscat.mallplus.water.mapper.WtWaterCardLimitMapper; import com.zscat.mallplus.water.service.IWtWaterCardLimitService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import javax.annotation.Resource; /** * @author lyn * @date 2020-06-05 */ @Service public class WtWaterCardLimitServiceImpl extends ServiceImpl <WtWaterCardLimitMapper, WtWaterCardLimit> implements IWtWaterCardLimitService { @Resource private WtWaterCardLimitMapper wtWaterCardLimitMapper; }
UTF-8
Java
665
java
WtWaterCardLimitServiceImpl.java
Java
[ { "context": "\nimport javax.annotation.Resource;\n\n/**\n * @author lyn\n * @date 2020-06-05\n */\n@Service\npublic class WtW", "end": 403, "score": 0.9996160268783569, "start": 400, "tag": "USERNAME", "value": "lyn" } ]
null
[]
package com.zscat.mallplus.water.service.impl; import com.zscat.mallplus.water.entity.WtWaterCardLimit; import com.zscat.mallplus.water.mapper.WtWaterCardLimitMapper; import com.zscat.mallplus.water.service.IWtWaterCardLimitService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import javax.annotation.Resource; /** * @author lyn * @date 2020-06-05 */ @Service public class WtWaterCardLimitServiceImpl extends ServiceImpl <WtWaterCardLimitMapper, WtWaterCardLimit> implements IWtWaterCardLimitService { @Resource private WtWaterCardLimitMapper wtWaterCardLimitMapper; }
665
0.819549
0.807519
23
27.913044
28.446613
88
false
false
0
0
0
0
0
0
0.391304
false
false
2
82d1e56e6966c31650e1bba97b34de77df97a74a
18,872,086,324,914
aef7bc8da625717dab31630152080198864b95d7
/app/src/main/java/com/duma/ld/zhilianlift/model/ShoppingCartSelectModel.java
432fa8b661a35024e6458d4897013b57922aa38b
[]
no_license
799536960/zhilianlift
https://github.com/799536960/zhilianlift
b3cb51d4d6a062d9a487728b24996e0f2d089da2
4cc974cebe5f3edb9e7d2c800ec5a42242aae1fe
refs/heads/master
2020-03-25T19:51:26.633000
2018-08-06T12:25:36
2018-08-06T12:25:36
144,103,720
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.duma.ld.zhilianlift.model; /** * Created by liudong on 2017/12/29. */ public class ShoppingCartSelectModel { /** * id : 10 * goods_num : 8 * selected : 1 */ private int id; private int goods_num; private int selected; private int goodsPosition; public int getGoodsPosition() { return goodsPosition; } public void setGoodsPosition(int goodsPosition) { this.goodsPosition = goodsPosition; } public ShoppingCartSelectModel(ShoppingCartListModel shoppingCartListModel, boolean selected, int goodsPosition) { this.id = shoppingCartListModel.getShoppingCartStoreGoodsModel().getId(); this.goods_num = shoppingCartListModel.getShoppingCartStoreGoodsModel().getGoods_num(); this.goodsPosition = goodsPosition; if (selected) { this.selected = 1; } else { this.selected = 0; } } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getGoods_num() { return goods_num; } public void setGoods_num(int goods_num) { this.goods_num = goods_num; } public int getSelected() { return selected; } public void setSelected(int selected) { this.selected = selected; } }
UTF-8
Java
1,358
java
ShoppingCartSelectModel.java
Java
[ { "context": " com.duma.ld.zhilianlift.model;\n\n/**\n * Created by liudong on 2017/12/29.\n */\n\npublic class ShoppingCartSele", "end": 65, "score": 0.9993744492530823, "start": 58, "tag": "USERNAME", "value": "liudong" } ]
null
[]
package com.duma.ld.zhilianlift.model; /** * Created by liudong on 2017/12/29. */ public class ShoppingCartSelectModel { /** * id : 10 * goods_num : 8 * selected : 1 */ private int id; private int goods_num; private int selected; private int goodsPosition; public int getGoodsPosition() { return goodsPosition; } public void setGoodsPosition(int goodsPosition) { this.goodsPosition = goodsPosition; } public ShoppingCartSelectModel(ShoppingCartListModel shoppingCartListModel, boolean selected, int goodsPosition) { this.id = shoppingCartListModel.getShoppingCartStoreGoodsModel().getId(); this.goods_num = shoppingCartListModel.getShoppingCartStoreGoodsModel().getGoods_num(); this.goodsPosition = goodsPosition; if (selected) { this.selected = 1; } else { this.selected = 0; } } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getGoods_num() { return goods_num; } public void setGoods_num(int goods_num) { this.goods_num = goods_num; } public int getSelected() { return selected; } public void setSelected(int selected) { this.selected = selected; } }
1,358
0.611929
0.60162
62
20.903225
23.15983
118
false
false
0
0
0
0
0
0
0.322581
false
false
2
4a235cfb15bd935248c851754390a725a6fe0f7e
4,449,586,153,078
b32699c393b76a2b9eecd966cb65fdeb1c33acd1
/Picture2.java
8047e3459eb34dab9a58c5f03c104205b55f59bb
[]
no_license
dmellode/javaChess
https://github.com/dmellode/javaChess
9c3cfc9ad9fad76de001fd37c4572a118d8c32ed
00c0d767a0afd2a81a12a7d969772923781f3d56
refs/heads/main
2023-02-07T22:39:58.772000
2021-01-02T22:10:39
2021-01-02T22:10:39
326,278,607
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// The "Picture" class. import java.awt.*; import java.awt.image.*; import hsa.Console; public class Picture2 implements ImageObserver { Console c; // The output console public Image Pic; int x,y; public Picture2(String name, Console c, Image Pic, int x, int y) { this.c = c; Toolkit tk = Toolkit.getDefaultToolkit (); Pic = tk.getImage (name); this.Pic = Pic; this.x = x; this.y = y; tk.prepareImage (Pic, -1, -1, this); } public boolean imageUpdate (Image img, int infoflags, int x2, int y2, int width, int height) { c.drawImage (Pic, x, y, null); return true; } } // Picture class
UTF-8
Java
647
java
Picture2.java
Java
[]
null
[]
// The "Picture" class. import java.awt.*; import java.awt.image.*; import hsa.Console; public class Picture2 implements ImageObserver { Console c; // The output console public Image Pic; int x,y; public Picture2(String name, Console c, Image Pic, int x, int y) { this.c = c; Toolkit tk = Toolkit.getDefaultToolkit (); Pic = tk.getImage (name); this.Pic = Pic; this.x = x; this.y = y; tk.prepareImage (Pic, -1, -1, this); } public boolean imageUpdate (Image img, int infoflags, int x2, int y2, int width, int height) { c.drawImage (Pic, x, y, null); return true; } } // Picture class
647
0.630603
0.621329
33
18.60606
21.433392
96
false
false
0
0
0
0
0
0
1.212121
false
false
2
2704cca70af1678af63bbc052c52bb04e03bb9fd
16,879,221,503,033
49e2776bf9acd8f4b0d6ec3f582484d16a7e5ad2
/Cine/JavaSource/com/cine/dao/hibernate/ButacaHibernateDAO.java
bf2643b87b32be3de84d1dac4c2a061621b01e78
[]
no_license
Delawen/daaw
https://github.com/Delawen/daaw
7049ab8e6b691b6cbe7950407136a895a5ae5171
3a99b2ff03d0880c254db990b1dc47354923743b
refs/heads/master
2016-09-11T07:57:38.949000
2007-06-23T10:59:59
2007-06-23T10:59:59
32,205,821
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cine.dao.hibernate; import com.cine.dao.ButacaDAO; import com.cine.Butaca; public class ButacaHibernateDAO extends GenericHibernateDAO<Butaca, Long, ButacaDAO> implements ButacaDAO { }
UTF-8
Java
206
java
ButacaHibernateDAO.java
Java
[]
null
[]
package com.cine.dao.hibernate; import com.cine.dao.ButacaDAO; import com.cine.Butaca; public class ButacaHibernateDAO extends GenericHibernateDAO<Butaca, Long, ButacaDAO> implements ButacaDAO { }
206
0.791262
0.791262
10
19.700001
18.011385
56
false
false
0
0
0
0
0
0
0.5
false
false
2
6f6b73d0128e5821b2a1a89fb86a09bfe08a31c5
31,602,369,385,021
cec628def1aad94ccbefa814d2a0dbd51588e9bd
/deployment.deviceanywhere/libsrc/org/netbeans/modules/deployment/deviceanywhere/service/ApplicationAPIService.java
8f0814d6c798bc1a1996f4d86446fd68b1fa00a2
[]
no_license
emilianbold/netbeans-releases
https://github.com/emilianbold/netbeans-releases
ad6e6e52a896212cb628d4522a4f8ae685d84d90
2fd6dc84c187e3c79a959b3ddb4da1a9703659c7
refs/heads/master
2021-01-12T04:58:24.877000
2017-10-17T14:38:27
2017-10-17T14:38:27
78,269,363
30
15
null
false
2020-10-13T08:36:08
2017-01-07T09:07:28
2020-10-03T06:33:28
2020-10-13T08:36:06
965,667
16
11
5
null
false
false
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. 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 and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * Contributor(s): * * The Original Software is NetBeans. The Initial Developer of the Original * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ package org.netbeans.modules.deployment.deviceanywhere.service; import java.net.MalformedURLException; import java.net.URL; import java.util.ResourceBundle; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; import org.openide.util.Exceptions; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.1-04/12/2007 02:26 PM(vivekp)-RC1 * Generated source version: 2.1 * */ @WebServiceClient(name = "ApplicationAPIService", targetNamespace = "http://services.mc.com") public class ApplicationAPIService extends Service { private static URL url; static { try { String urlKey = "http://www.deviceanywhere.com/axis/services/ApplicationAPI"; try { ResourceBundle bundle = ResourceBundle.getBundle("org/netbeans/modules/deployment/deviceanywhere/service/Bundle"); //NOI18N urlKey = bundle.getString("service_url"); } catch (Exception exception) { //ignore } //lookup for replacement String newUrl = System.getProperty("deviceanywhere.service.url"); if (newUrl != null) { urlKey = newUrl; } url = new URL(urlKey + "?wsdl"); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } } // private static String[] SERVICES = new String[]{ // "http://www.deviceanywhere.com/axis/services/ApplicationAPI", //default // "http://www.deviceanywhere.com/vdl/sprint/axis/services/ApplicationAPI", //vdl // "http://mcdemo5.mobilecomplete.com/axis/services/ApplicationAPI" //test // }; public ApplicationAPIService() throws MalformedURLException { super(url, new QName("http://services.mc.com", "ApplicationAPIService")); //NOI18N } /** * * @return * returns ApplicationAPI */ @WebEndpoint(name = "ApplicationAPI") public ApplicationAPI getApplicationAPI() { return (ApplicationAPI)super.getPort(new QName("http://services.mc.com", "ApplicationAPI"), ApplicationAPI.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * @return * returns ApplicationAPI */ @WebEndpoint(name = "ApplicationAPI") public ApplicationAPI getApplicationAPI(WebServiceFeature... features) { return (ApplicationAPI)super.getPort(new QName("http://services.mc.com", "ApplicationAPI"), ApplicationAPI.class, features); } }
UTF-8
Java
5,037
java
ApplicationAPIService.java
Java
[ { "context": "atic {\n try {\n String urlKey = \"http://www.deviceanywhere.com/axis/services/ApplicationAPI\";\n try {\n ResourceBundl", "end": 3070, "score": 0.9447157382965088, "start": 3012, "tag": "KEY", "value": "http://www.deviceanywhere.com/...
null
[]
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. 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 and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * Contributor(s): * * The Original Software is NetBeans. The Initial Developer of the Original * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ package org.netbeans.modules.deployment.deviceanywhere.service; import java.net.MalformedURLException; import java.net.URL; import java.util.ResourceBundle; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; import org.openide.util.Exceptions; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.1-04/12/2007 02:26 PM(vivekp)-RC1 * Generated source version: 2.1 * */ @WebServiceClient(name = "ApplicationAPIService", targetNamespace = "http://services.mc.com") public class ApplicationAPIService extends Service { private static URL url; static { try { String urlKey = "http://www.deviceanywhere.com/axis/services/ApplicationAPI"; try { ResourceBundle bundle = ResourceBundle.getBundle("org/netbeans/modules/deployment/deviceanywhere/service/Bundle"); //NOI18N urlKey = bundle.getString("service_url"); } catch (Exception exception) { //ignore } //lookup for replacement String newUrl = System.getProperty("deviceanywhere.service.url"); if (newUrl != null) { urlKey = newUrl; } url = new URL(urlKey + "?wsdl"); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } } // private static String[] SERVICES = new String[]{ // "http://www.deviceanywhere.com/axis/services/ApplicationAPI", //default // "http://www.deviceanywhere.com/vdl/sprint/axis/services/ApplicationAPI", //vdl // "http://mcdemo5.mobilecomplete.com/axis/services/ApplicationAPI" //test // }; public ApplicationAPIService() throws MalformedURLException { super(url, new QName("http://services.mc.com", "ApplicationAPIService")); //NOI18N } /** * * @return * returns ApplicationAPI */ @WebEndpoint(name = "ApplicationAPI") public ApplicationAPI getApplicationAPI() { return (ApplicationAPI)super.getPort(new QName("http://services.mc.com", "ApplicationAPI"), ApplicationAPI.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * @return * returns ApplicationAPI */ @WebEndpoint(name = "ApplicationAPI") public ApplicationAPI getApplicationAPI(WebServiceFeature... features) { return (ApplicationAPI)super.getPort(new QName("http://services.mc.com", "ApplicationAPI"), ApplicationAPI.class, features); } }
5,037
0.700615
0.690887
123
39.951218
34.09071
181
false
false
0
0
0
0
0
0
0.357724
false
false
2
f8ca9605fb0656ac349653f17035906e274cb4f6
27,066,883,923,120
9f3169490ea9689ce33d9e29cc2883fbe3879a98
/src/main/java/com/GC/RolyPoly/AddUser.java
eb261b9a7f69637b5a41599451a88b7dcfeb3f7a
[]
no_license
tommyEtka/RolyPolyKids
https://github.com/tommyEtka/RolyPolyKids
cab93fa119386e6f1b46ebc2df916e1d973769a4
5f85e55a7bee1bc0f5735795abcac9ca11126918
refs/heads/master
2020-04-13T16:23:08.767000
2016-10-03T12:52:55
2016-10-03T12:52:55
68,112,954
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.GC.RolyPoly; import java.io.StringReader; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; @Controller public class AddUser { @RequestMapping(value = "signupsubmit", method = RequestMethod.POST) public String signup(HttpServletRequest request,Model model){ String selectCommand; String firstName,lastName,email,passwd; boolean isValid = true; firstName = request.getParameter("firstName"); lastName = request.getParameter("lastName"); email = request.getParameter("email"); passwd = request.getParameter("passwd"); try { //load driver for mysql Class.forName("com.mysql.jdbc.Driver"); //store the info to the DB orders- changed db psw Connection cnn = DriverManager.getConnection("jdbc:mysql://aa1s1uxliw4eyl2.c51rrraraa3j.us-west-2.rds.amazonaws.com:3306/rolypolykids","scuytuyriblet","12kjhkjh3usert"); //command isValid = validateFlds(model, firstName, lastName, email, passwd); if (!isValid){ //model.addAttribute("warning","All fields are mandatory. Please try again."); return "signup"; } else { selectCommand = "insert into users (firstName,lastName,email,password) values(?,?,?,?)"; //create statement PreparedStatement ps = cnn.prepareStatement(selectCommand); ps.setString(1, firstName); ps.setString(2, lastName); ps.setString(3, email); ps.setString(4, passwd); // use ps to execute the command ps.executeUpdate(); } return "login"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); model.addAttribute("Error","Error encountered restart app"); return "errorpage"; } } /** * @param firstName * @param lastName * @param email * @param passwd */ public boolean validateFlds(Model model, String firstName, String lastName, String email, String passwd) { boolean isValid = true; if (firstName.isEmpty()|| lastName.isEmpty()|| email.isEmpty() || passwd.isEmpty()){ isValid = false; }else if (firstName.equals("") && lastName.equals("") ){ isValid = false; } if (firstName.matches("[0-9]+")){ //model.addAttribute("warning","FirstName is not a numeric field. Please try again."); isValid = false; } if (lastName.matches("[0-9]+")){ //model.addAttribute("warning","LastName is not a numeric field. Please try again."); isValid = false; } if (email.matches("[0-9]+")){ //model.addAttribute("warning","email can not be all numeric characters.Please try again."); isValid = false; } if (passwd.matches("[0-9]+")){ //model.addAttribute("warning","The password should be a mix of Number and Alphabet characters.Please try again."); isValid = false; } return isValid; } @RequestMapping(value = "signup") public String signupdir(){ return "signup"; } //checkLogin @RequestMapping(value="loginPage", method = RequestMethod.POST) public String checkLogin(HttpServletRequest request,HttpSession session,Model model){ String selectCommand; String email; String passwd; String pwd = ""; ResultSet rs; email = request.getParameter("demail"); passwd= request.getParameter("password"); //System.out.println("You made it in the method :" +email); //System.out.println("You made it in the method :" +passwd); try { //load driver for mysql Class.forName("com.mysql.jdbc.Driver"); //store the info to the DB orders Connection cnn = DriverManager.getConnection("jdbc:mysql://aa1s1uxliw4eyl2.c51rrraraa3j.us-west-2.rds.amazonaws.com:3306/rolypolykids","syutuytcriblet","12hjguy3usert"); //command if (email == null||email.isEmpty()|| passwd == null || passwd.isEmpty()){ model.addAttribute("warning","All fields are mandatory. Please try again."); return "login"; } else { selectCommand = "select * from users where email = ? and password= ?"; //create statement PreparedStatement ps = cnn.prepareStatement(selectCommand); ps.setString(1,email); ps.setString(2,passwd); // use ps to execute the command rs = ps.executeQuery(); } if(!rs.first()){ model.addAttribute("warning","You have entered the wrong email address/password. Please try again."); return "login"; } //prepare data and send back to view boolean hasData = false; //System.out.println("Before session"); hasData= rs.first(); //System.out.println("has data " + hasData); if(hasData){ HttpSession session1 = request.getSession(); session1.setAttribute("email", email); session1.setAttribute("log", true); System.out.println("session set"); } return "home"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); model.addAttribute("Error","Error encountered restart app"); return "errorpage"; } } @RequestMapping(value = "login") public String logindir(){ return "login"; } @RequestMapping(value="logout") public String SubmitLogout(HttpSession session) { session.setAttribute("log", false); return "logout"; } }
UTF-8
Java
6,024
java
AddUser.java
Java
[ { "context": "\t\t\t{\n\t\t\t\t\n\t\t\t\tselectCommand = \"insert into users (firstName,lastName,email,password) values(?,?,?,?)\";\n\t\t\t\t//", "end": 1938, "score": 0.9765318632125854, "start": 1929, "tag": "NAME", "value": "firstName" }, { "context": "\t\t\t\tselectCommand = \"in...
null
[]
package com.GC.RolyPoly; import java.io.StringReader; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; @Controller public class AddUser { @RequestMapping(value = "signupsubmit", method = RequestMethod.POST) public String signup(HttpServletRequest request,Model model){ String selectCommand; String firstName,lastName,email,passwd; boolean isValid = true; firstName = request.getParameter("firstName"); lastName = request.getParameter("lastName"); email = request.getParameter("email"); passwd = request.getParameter("passwd"); try { //load driver for mysql Class.forName("com.mysql.jdbc.Driver"); //store the info to the DB orders- changed db psw Connection cnn = DriverManager.getConnection("jdbc:mysql://aa1s1uxliw4eyl2.c51rrraraa3j.us-west-2.rds.amazonaws.com:3306/rolypolykids","scuytuyriblet","12kjhkjh3usert"); //command isValid = validateFlds(model, firstName, lastName, email, passwd); if (!isValid){ //model.addAttribute("warning","All fields are mandatory. Please try again."); return "signup"; } else { selectCommand = "insert into users (firstName,lastName,email,password) values(?,?,?,?)"; //create statement PreparedStatement ps = cnn.prepareStatement(selectCommand); ps.setString(1, firstName); ps.setString(2, lastName); ps.setString(3, email); ps.setString(4, passwd); // use ps to execute the command ps.executeUpdate(); } return "login"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); model.addAttribute("Error","Error encountered restart app"); return "errorpage"; } } /** * @param firstName * @param lastName * @param email * @param passwd */ public boolean validateFlds(Model model, String firstName, String lastName, String email, String passwd) { boolean isValid = true; if (firstName.isEmpty()|| lastName.isEmpty()|| email.isEmpty() || passwd.isEmpty()){ isValid = false; }else if (firstName.equals("") && lastName.equals("") ){ isValid = false; } if (firstName.matches("[0-9]+")){ //model.addAttribute("warning","FirstName is not a numeric field. Please try again."); isValid = false; } if (lastName.matches("[0-9]+")){ //model.addAttribute("warning","LastName is not a numeric field. Please try again."); isValid = false; } if (email.matches("[0-9]+")){ //model.addAttribute("warning","email can not be all numeric characters.Please try again."); isValid = false; } if (passwd.matches("[0-9]+")){ //model.addAttribute("warning","The password should be a mix of Number and Alphabet characters.Please try again."); isValid = false; } return isValid; } @RequestMapping(value = "signup") public String signupdir(){ return "signup"; } //checkLogin @RequestMapping(value="loginPage", method = RequestMethod.POST) public String checkLogin(HttpServletRequest request,HttpSession session,Model model){ String selectCommand; String email; String passwd; String pwd = ""; ResultSet rs; email = request.getParameter("demail"); passwd= request.getParameter("password"); //System.out.println("You made it in the method :" +email); //System.out.println("You made it in the method :" +passwd); try { //load driver for mysql Class.forName("com.mysql.jdbc.Driver"); //store the info to the DB orders Connection cnn = DriverManager.getConnection("jdbc:mysql://aa1s1uxliw4eyl2.c51rrraraa3j.us-west-2.rds.amazonaws.com:3306/rolypolykids","syutuytcriblet","<PASSWORD>"); //command if (email == null||email.isEmpty()|| passwd == null || passwd.isEmpty()){ model.addAttribute("warning","All fields are mandatory. Please try again."); return "login"; } else { selectCommand = "select * from users where email = ? and password= ?"; //create statement PreparedStatement ps = cnn.prepareStatement(selectCommand); ps.setString(1,email); ps.setString(2,passwd); // use ps to execute the command rs = ps.executeQuery(); } if(!rs.first()){ model.addAttribute("warning","You have entered the wrong email address/password. Please try again."); return "login"; } //prepare data and send back to view boolean hasData = false; //System.out.println("Before session"); hasData= rs.first(); //System.out.println("has data " + hasData); if(hasData){ HttpSession session1 = request.getSession(); session1.setAttribute("email", email); session1.setAttribute("log", true); System.out.println("session set"); } return "home"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); model.addAttribute("Error","Error encountered restart app"); return "errorpage"; } } @RequestMapping(value = "login") public String logindir(){ return "login"; } @RequestMapping(value="logout") public String SubmitLogout(HttpSession session) { session.setAttribute("log", false); return "logout"; } }
6,021
0.683765
0.675631
208
27.961538
27.970596
173
false
false
0
0
0
0
0
0
2.788461
false
false
2
753585a2746ec475c7d12e968be6147566617fb5
15,934,328,701,932
3f7a4827c7c28ee7ae1edeb575670028de91f536
/src/me/br_/minecraft/bukkit/mario/MMain.java
4f74d5403cd65abaa91a8e83cd1822f102b60987
[]
no_license
BR-/Mario
https://github.com/BR-/Mario
e1cc815096f6d8397fe500e7a27ba33d9cb13bb1
85894a3e3dbac115283db3c1e094bbc454225a32
refs/heads/master
2021-01-23T11:48:30.741000
2011-06-20T03:14:08
2011-06-20T03:14:08
1,921,659
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.br_.minecraft.bukkit.mario; import org.bukkit.event.Event; import org.bukkit.plugin.java.JavaPlugin; public class MMain extends JavaPlugin { public void onDisable() { System.out.println("[Mario] Disabled."); } public void onEnable() { this.getServer() .getPluginManager() .registerEvent(Event.Type.PLAYER_INTERACT, new MListener(), Event.Priority.Low, this); System.out.println("[Mario] Enabled."); } }
UTF-8
Java
440
java
MMain.java
Java
[]
null
[]
package me.br_.minecraft.bukkit.mario; import org.bukkit.event.Event; import org.bukkit.plugin.java.JavaPlugin; public class MMain extends JavaPlugin { public void onDisable() { System.out.println("[Mario] Disabled."); } public void onEnable() { this.getServer() .getPluginManager() .registerEvent(Event.Type.PLAYER_INTERACT, new MListener(), Event.Priority.Low, this); System.out.println("[Mario] Enabled."); } }
440
0.715909
0.715909
18
23.5
18.568941
63
false
false
0
0
0
0
0
0
1.833333
false
false
2
9c13e6693838180792dcd65268f76414ab4a0b22
34,943,853,949,118
72a8199a72fd26a6fea95b98b30abcabfeefd62d
/src/main/java/com/comixtorm/collector/repository/ProfileRepository.java
7907a8e3b265bc1972bf079b96ddeac9bd75ec22
[]
no_license
droidark/comixtorm
https://github.com/droidark/comixtorm
ab2fab311d93756909e0068af9a471c019e8d625
1185de3ae0e0a523e451fc867f07278963ea7ffe
refs/heads/master
2020-03-19T05:48:18.243000
2018-10-24T21:02:23
2018-10-24T21:02:23
135,963,282
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.comixtorm.collector.repository; import com.comixtorm.collector.model.Profile; import org.springframework.data.repository.CrudRepository; public interface ProfileRepository extends CrudRepository<Profile, Long> { Profile findProfileById(Long id); }
UTF-8
Java
266
java
ProfileRepository.java
Java
[]
null
[]
package com.comixtorm.collector.repository; import com.comixtorm.collector.model.Profile; import org.springframework.data.repository.CrudRepository; public interface ProfileRepository extends CrudRepository<Profile, Long> { Profile findProfileById(Long id); }
266
0.830827
0.830827
8
32.25
26.840967
74
false
false
0
0
0
0
0
0
0.625
false
false
2
47d0dd4441975bf53680019feffde8b6c06bf008
7,352,984,078,317
99c4c084d71e0fa38009f67a6dea5e443dd4222f
/app/src/main/java/com/example/paoim/sharedpreferencedemo/MainActivity.java
eb24915e857fc17afc21bd8c9f51de4d2d7dcf84
[]
no_license
paoim/SharedPreferenceAndFileDemo
https://github.com/paoim/SharedPreferenceAndFileDemo
bef7966d28e40d73ac7d6a62ddbd5b7ed50288eb
bbb47d574193ff73ad1cd83843068eb867ae2bc3
refs/heads/master
2020-03-24T22:17:40.259000
2018-07-31T23:02:01
2018-07-31T23:02:01
143,077,496
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.paoim.sharedpreferencedemo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class MainActivity extends AppCompatActivity { private TextView tvWelcome, tvResult; private EditText etFirstName, etLastName, etMobilePhone, etEmail; private Button btnSave; private final static String FILE_NAME = "myContact.txt"; private boolean isValidateInput(String inputFirstName, String inputLastName, String inputMobilePhone, String inputEmail) { if (0 == inputFirstName.length()) { Toast.makeText(MainActivity.this, "Please input your first name!", Toast.LENGTH_LONG).show(); etFirstName.setFocusableInTouchMode(true); return false; } Log.d("inputFirstName", inputFirstName); if (0 == inputLastName.length()) { Toast.makeText(MainActivity.this, "Please input your last name!", Toast.LENGTH_LONG).show(); etLastName.setFocusableInTouchMode(true); return false; } Log.d("inputLastName", inputLastName); if (0 == inputMobilePhone.length() || 0 == inputEmail.length()) { if (0 == inputMobilePhone.length()) { Toast.makeText(MainActivity.this, "Please input your mobile phone!", Toast.LENGTH_LONG).show(); etMobilePhone.setFocusableInTouchMode(true); } if (0 == inputEmail.length()) { Toast.makeText(MainActivity.this, "Please input your email!", Toast.LENGTH_LONG).show(); etEmail.setFocusableInTouchMode(true); } return false; } Log.d("inputMobilePhone", inputMobilePhone); Log.d("inputEmail", inputEmail); return true; } private void onClick(View v) { String inputFirstName = etFirstName.getText().toString().trim(); String inputLastName = etLastName.getText().toString().trim(); String inputMobilePhone = etMobilePhone.getText().toString().trim(); String inputEmail = etEmail.getText().toString().trim(); if (isValidateInput(inputFirstName, inputLastName, inputMobilePhone, inputEmail)) { String result = inputFirstName + " " + inputLastName; if (0 < inputMobilePhone.length()) { result = result + ", " + inputMobilePhone; } if (0 < inputEmail.length()) { result = result + ", " + inputEmail; } if (0 < result.length()) { result = result.trim(); } Log.d("result", result); if (0 == result.length()) { Toast.makeText(MainActivity.this, "Please input!", Toast.LENGTH_LONG).show(); } else { saveDataToStoreInFile(result); tvResult.setText(result); finish();//close current Intent } } } private void loadDataFromFile() { File file = getApplicationContext().getFileStreamPath(FILE_NAME); if (file.exists()) { try { String line; String result = ""; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openFileInput(FILE_NAME))); while (null != (line = bufferedReader.readLine())) { result = result + line; } tvResult.setText(result); bufferedReader.close(); } catch (IOException e) { Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } } } private void saveDataToStoreInFile(String data) { try { FileOutputStream fileOutputStream = openFileOutput(FILE_NAME, MODE_PRIVATE); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream); outputStreamWriter.write(data + "\n"); outputStreamWriter.flush(); outputStreamWriter.close(); Toast.makeText(MainActivity.this, "Successfully saved!", Toast.LENGTH_LONG).show(); } catch (IOException e) { Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); tvWelcome = (TextView) findViewById(R.id.tvWelcome); tvResult = (TextView) findViewById(R.id.tvResult); etFirstName = (EditText) findViewById(R.id.etFirstName); etLastName = (EditText) findViewById(R.id.etLastName); etMobilePhone = (EditText) findViewById(R.id.etMobilePhone); etEmail = (EditText) findViewById(R.id.etEmail); btnSave = (Button) findViewById(R.id.btnSave); loadDataFromFile(); btnSave.setOnClickListener(this::onClick); } }
UTF-8
Java
5,379
java
MainActivity.java
Java
[]
null
[]
package com.example.paoim.sharedpreferencedemo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class MainActivity extends AppCompatActivity { private TextView tvWelcome, tvResult; private EditText etFirstName, etLastName, etMobilePhone, etEmail; private Button btnSave; private final static String FILE_NAME = "myContact.txt"; private boolean isValidateInput(String inputFirstName, String inputLastName, String inputMobilePhone, String inputEmail) { if (0 == inputFirstName.length()) { Toast.makeText(MainActivity.this, "Please input your first name!", Toast.LENGTH_LONG).show(); etFirstName.setFocusableInTouchMode(true); return false; } Log.d("inputFirstName", inputFirstName); if (0 == inputLastName.length()) { Toast.makeText(MainActivity.this, "Please input your last name!", Toast.LENGTH_LONG).show(); etLastName.setFocusableInTouchMode(true); return false; } Log.d("inputLastName", inputLastName); if (0 == inputMobilePhone.length() || 0 == inputEmail.length()) { if (0 == inputMobilePhone.length()) { Toast.makeText(MainActivity.this, "Please input your mobile phone!", Toast.LENGTH_LONG).show(); etMobilePhone.setFocusableInTouchMode(true); } if (0 == inputEmail.length()) { Toast.makeText(MainActivity.this, "Please input your email!", Toast.LENGTH_LONG).show(); etEmail.setFocusableInTouchMode(true); } return false; } Log.d("inputMobilePhone", inputMobilePhone); Log.d("inputEmail", inputEmail); return true; } private void onClick(View v) { String inputFirstName = etFirstName.getText().toString().trim(); String inputLastName = etLastName.getText().toString().trim(); String inputMobilePhone = etMobilePhone.getText().toString().trim(); String inputEmail = etEmail.getText().toString().trim(); if (isValidateInput(inputFirstName, inputLastName, inputMobilePhone, inputEmail)) { String result = inputFirstName + " " + inputLastName; if (0 < inputMobilePhone.length()) { result = result + ", " + inputMobilePhone; } if (0 < inputEmail.length()) { result = result + ", " + inputEmail; } if (0 < result.length()) { result = result.trim(); } Log.d("result", result); if (0 == result.length()) { Toast.makeText(MainActivity.this, "Please input!", Toast.LENGTH_LONG).show(); } else { saveDataToStoreInFile(result); tvResult.setText(result); finish();//close current Intent } } } private void loadDataFromFile() { File file = getApplicationContext().getFileStreamPath(FILE_NAME); if (file.exists()) { try { String line; String result = ""; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openFileInput(FILE_NAME))); while (null != (line = bufferedReader.readLine())) { result = result + line; } tvResult.setText(result); bufferedReader.close(); } catch (IOException e) { Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } } } private void saveDataToStoreInFile(String data) { try { FileOutputStream fileOutputStream = openFileOutput(FILE_NAME, MODE_PRIVATE); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream); outputStreamWriter.write(data + "\n"); outputStreamWriter.flush(); outputStreamWriter.close(); Toast.makeText(MainActivity.this, "Successfully saved!", Toast.LENGTH_LONG).show(); } catch (IOException e) { Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); tvWelcome = (TextView) findViewById(R.id.tvWelcome); tvResult = (TextView) findViewById(R.id.tvResult); etFirstName = (EditText) findViewById(R.id.etFirstName); etLastName = (EditText) findViewById(R.id.etLastName); etMobilePhone = (EditText) findViewById(R.id.etMobilePhone); etEmail = (EditText) findViewById(R.id.etEmail); btnSave = (Button) findViewById(R.id.btnSave); loadDataFromFile(); btnSave.setOnClickListener(this::onClick); } }
5,379
0.620004
0.617959
138
37.97826
29.161835
126
false
false
0
0
0
0
0
0
0.811594
false
false
2
089a93c0f9ece06ea87f18fa8f082e1c55ea7ea9
35,167,192,248,999
17759d27dc7b52ea16177dfb9247f78d9d572bfb
/aua-ems/src-ui/th/ac/aua/ems/client/AusEmsGridPanel.java
f06747f7f5143b187b2761e31a698c84e9e78898
[]
no_license
bunyawats/j2ee
https://github.com/bunyawats/j2ee
70a2eb3aeffef8ce7c234b1365e39eb1659578cb
38cf0aa12acf0ffe753e552592a3162a083f9f4f
refs/heads/master
2020-05-21T03:09:09.658000
2018-07-01T00:36:10
2018-07-01T00:36:10
37,700,445
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package th.ac.aua.ems.client; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HorizontalPanel; import com.gwtext.client.core.EventObject; import com.gwtext.client.data.ArrayReader; import com.gwtext.client.data.FieldDef; import com.gwtext.client.data.MemoryProxy; import com.gwtext.client.data.RecordDef; import com.gwtext.client.data.Store; import com.gwtext.client.data.event.StoreListener; import com.gwtext.client.widgets.Button; import com.gwtext.client.widgets.Panel; import com.gwtext.client.widgets.event.ButtonListenerAdapter; import com.gwtext.client.widgets.form.FieldSet; import com.gwtext.client.widgets.form.FormPanel; import com.gwtext.client.widgets.form.Hidden; import com.gwtext.client.widgets.grid.BaseColumnConfig; import com.gwtext.client.widgets.grid.ColumnModel; import com.gwtext.client.widgets.grid.EditorGridPanel; import com.gwtext.client.widgets.grid.RowSelectionModel; import com.gwtext.client.widgets.grid.event.GridCellListener; import com.gwtext.client.widgets.layout.FitLayout; import com.gwtext.client.widgets.layout.HorizontalLayout; import com.gwtext.client.widgets.layout.VerticalLayout; @SuppressWarnings("unchecked") public abstract class AusEmsGridPanel extends AuaEmsPanel { final protected FormPanel formPanel = new FormPanel(); protected Store store; protected BaseColumnConfig[] columns; protected FieldDef[] fieldDefs; final protected EditorGridPanel gridPanel = new EditorGridPanel(); final protected RowSelectionModel rowSelectionModel = new RowSelectionModel(); protected Button btnGridSave; protected Button btnGridCancel; private int maxWaitingState = 0; private int currentWaitingState = 0; protected Long selectedId; public void resetWaitingState() { maxWaitingState = 0; currentWaitingState = 0; } public void setMaxWaitingState(int maxState) { this.maxWaitingState = maxState; } public void increaseCurrentWaitingState() { this.currentWaitingState++; } protected void initClosable() { this.setClosable(false); } public Panel getViewPanel() { try { if (panel == null) { panel = new Panel(); panel.setLayout(new VerticalLayout(5)); renderTopPanel(); renderGridAreaPanel(); Panel toolBarGridPanel = genToolBarGridPanel(); if (toolBarGridPanel != null) { formPanel.add(toolBarGridPanel); formPanel.setBorder(false); } formPanel.add(new Hidden("x", "x")); panel.add(formPanel); this.resetPageStage(); } if ((this.getController().getSelectedId() != null) && (!this.getController().getSelectedId() .equals(this.selectedId))) { this.selectedId = this.getController().getSelectedId(); this.resetPageStage(); } System.out.println("this.isOnInitStage() " + this.isOnInitStage()); if (this.isOnInitStage()) { this.setOnInitStage(false); this.setActionStage(this.getController().getAction()); this.resetWaitingState(); loadLookUpRpcData(); Timer t = new Timer() { public void run() { if (maxWaitingState == currentWaitingState) { try { doFillGridData(); } catch (Exception e) { e.printStackTrace(); } this.cancel(); resetWaitingState(); } } }; t.scheduleRepeating(1000); } getController().setSelectedId(this.selectedId); } catch (Exception e) { e.printStackTrace(); } return panel; } protected void goBackToCallerPage() { resetPageStage(); getController().hideScreen(getPanelId()); String callerPageId = (String) getController().getSessionAttr( ControllerManager.CALLER_PAGE_NAME_ATTR); if (callerPageId != null) { getController().showScreen(callerPageId); } } class ConfirmButtonListener extends ButtonListenerAdapter { public void onClick(Button button, EventObject e) { try { loadForm(); if (formValidation()) { callRpcUpdate(); } } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } protected void renderGridAreaPanel() { FieldSet fieldSet = new FieldSet(getGridPanelTitle()); fieldSet.setLayout(new VerticalLayout(10)); fieldDefs = getFieldDefArray(); RecordDef recordDef = new RecordDef(fieldDefs); Object[][] dataArray = getEmtryInitArray(); MemoryProxy proxy = new MemoryProxy(dataArray); ArrayReader reader = new ArrayReader(recordDef); store = new Store(proxy, reader); StoreListener storeListener = getGridStoreListener(); if (storeListener != null) { store.addStoreListener(storeListener); } store.load(); gridPanel.setStore(store); columns = getColumnConfigArray(); ColumnModel columnModel = new ColumnModel(columns); gridPanel.setColumnModel(columnModel); gridPanel.setSelectionModel(rowSelectionModel); gridPanel.setEnableColumnResize(true); gridPanel.setEnableDragDrop(false); gridPanel.setEnableColumnHide(false); gridPanel.setEnableColumnMove(false); gridPanel.setIconCls("grid-icon"); gridPanel.setWidth(MAX_WIDTH); gridPanel.setHeight(400); GridCellListener cellListener = getGridCellListener(); if (cellListener != null) { gridPanel.addGridCellListener(cellListener); } fieldSet.add(gridPanel); panel.add(fieldSet); } public Panel genToolBarGridPanel() { btnGridSave = new Button("Save", new ConfirmButtonListener()); btnGridCancel = new Button("Cancel", new ButtonListenerAdapter() { public void onClick(Button button, EventObject e) { goBackToCallerPage(); } }); Panel topPanel = new Panel(); topPanel.setLayout(new FitLayout()); Panel toolbar = new Panel(); toolbar.setLayout(new HorizontalLayout(5)); toolbar.add(btnGridSave); toolbar.add(btnGridCancel); HorizontalPanel inner = new HorizontalPanel(); inner.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); inner.add(toolbar); topPanel.add(inner); topPanel.setBorder(false); return topPanel; } protected void updateGrid(Object[][] data) { System.out.println("before reconfigure"); if (store != null) { store.removeAll(); } RecordDef recordDef = new RecordDef(fieldDefs); ColumnModel columnModel = new ColumnModel(columns); MemoryProxy proxy = new MemoryProxy(data); ArrayReader reader = new ArrayReader(recordDef); store = new Store(proxy, reader); StoreListener storeListener = getGridStoreListener(); if (storeListener != null) { store.addStoreListener(storeListener); } store.load(); System.out.println("store load"); gridPanel.reconfigure(store, columnModel); System.out.println("after reconfigure"); } protected GridCellListener getGridCellListener() { return null; } protected StoreListener getGridStoreListener() { return null; } abstract protected BaseColumnConfig[] getColumnConfigArray(); abstract protected FieldDef[] getFieldDefArray(); abstract protected Object[][] getEmtryInitArray(); abstract protected String getGridPanelTitle(); abstract protected void doFillGridData(); abstract protected void loadForm(); abstract protected void callRpcUpdate(); abstract protected void renderTopPanel(); abstract protected void loadLookUpRpcData(); abstract protected boolean formValidation(); }
UTF-8
Java
7,484
java
AusEmsGridPanel.java
Java
[]
null
[]
package th.ac.aua.ems.client; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HorizontalPanel; import com.gwtext.client.core.EventObject; import com.gwtext.client.data.ArrayReader; import com.gwtext.client.data.FieldDef; import com.gwtext.client.data.MemoryProxy; import com.gwtext.client.data.RecordDef; import com.gwtext.client.data.Store; import com.gwtext.client.data.event.StoreListener; import com.gwtext.client.widgets.Button; import com.gwtext.client.widgets.Panel; import com.gwtext.client.widgets.event.ButtonListenerAdapter; import com.gwtext.client.widgets.form.FieldSet; import com.gwtext.client.widgets.form.FormPanel; import com.gwtext.client.widgets.form.Hidden; import com.gwtext.client.widgets.grid.BaseColumnConfig; import com.gwtext.client.widgets.grid.ColumnModel; import com.gwtext.client.widgets.grid.EditorGridPanel; import com.gwtext.client.widgets.grid.RowSelectionModel; import com.gwtext.client.widgets.grid.event.GridCellListener; import com.gwtext.client.widgets.layout.FitLayout; import com.gwtext.client.widgets.layout.HorizontalLayout; import com.gwtext.client.widgets.layout.VerticalLayout; @SuppressWarnings("unchecked") public abstract class AusEmsGridPanel extends AuaEmsPanel { final protected FormPanel formPanel = new FormPanel(); protected Store store; protected BaseColumnConfig[] columns; protected FieldDef[] fieldDefs; final protected EditorGridPanel gridPanel = new EditorGridPanel(); final protected RowSelectionModel rowSelectionModel = new RowSelectionModel(); protected Button btnGridSave; protected Button btnGridCancel; private int maxWaitingState = 0; private int currentWaitingState = 0; protected Long selectedId; public void resetWaitingState() { maxWaitingState = 0; currentWaitingState = 0; } public void setMaxWaitingState(int maxState) { this.maxWaitingState = maxState; } public void increaseCurrentWaitingState() { this.currentWaitingState++; } protected void initClosable() { this.setClosable(false); } public Panel getViewPanel() { try { if (panel == null) { panel = new Panel(); panel.setLayout(new VerticalLayout(5)); renderTopPanel(); renderGridAreaPanel(); Panel toolBarGridPanel = genToolBarGridPanel(); if (toolBarGridPanel != null) { formPanel.add(toolBarGridPanel); formPanel.setBorder(false); } formPanel.add(new Hidden("x", "x")); panel.add(formPanel); this.resetPageStage(); } if ((this.getController().getSelectedId() != null) && (!this.getController().getSelectedId() .equals(this.selectedId))) { this.selectedId = this.getController().getSelectedId(); this.resetPageStage(); } System.out.println("this.isOnInitStage() " + this.isOnInitStage()); if (this.isOnInitStage()) { this.setOnInitStage(false); this.setActionStage(this.getController().getAction()); this.resetWaitingState(); loadLookUpRpcData(); Timer t = new Timer() { public void run() { if (maxWaitingState == currentWaitingState) { try { doFillGridData(); } catch (Exception e) { e.printStackTrace(); } this.cancel(); resetWaitingState(); } } }; t.scheduleRepeating(1000); } getController().setSelectedId(this.selectedId); } catch (Exception e) { e.printStackTrace(); } return panel; } protected void goBackToCallerPage() { resetPageStage(); getController().hideScreen(getPanelId()); String callerPageId = (String) getController().getSessionAttr( ControllerManager.CALLER_PAGE_NAME_ATTR); if (callerPageId != null) { getController().showScreen(callerPageId); } } class ConfirmButtonListener extends ButtonListenerAdapter { public void onClick(Button button, EventObject e) { try { loadForm(); if (formValidation()) { callRpcUpdate(); } } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } protected void renderGridAreaPanel() { FieldSet fieldSet = new FieldSet(getGridPanelTitle()); fieldSet.setLayout(new VerticalLayout(10)); fieldDefs = getFieldDefArray(); RecordDef recordDef = new RecordDef(fieldDefs); Object[][] dataArray = getEmtryInitArray(); MemoryProxy proxy = new MemoryProxy(dataArray); ArrayReader reader = new ArrayReader(recordDef); store = new Store(proxy, reader); StoreListener storeListener = getGridStoreListener(); if (storeListener != null) { store.addStoreListener(storeListener); } store.load(); gridPanel.setStore(store); columns = getColumnConfigArray(); ColumnModel columnModel = new ColumnModel(columns); gridPanel.setColumnModel(columnModel); gridPanel.setSelectionModel(rowSelectionModel); gridPanel.setEnableColumnResize(true); gridPanel.setEnableDragDrop(false); gridPanel.setEnableColumnHide(false); gridPanel.setEnableColumnMove(false); gridPanel.setIconCls("grid-icon"); gridPanel.setWidth(MAX_WIDTH); gridPanel.setHeight(400); GridCellListener cellListener = getGridCellListener(); if (cellListener != null) { gridPanel.addGridCellListener(cellListener); } fieldSet.add(gridPanel); panel.add(fieldSet); } public Panel genToolBarGridPanel() { btnGridSave = new Button("Save", new ConfirmButtonListener()); btnGridCancel = new Button("Cancel", new ButtonListenerAdapter() { public void onClick(Button button, EventObject e) { goBackToCallerPage(); } }); Panel topPanel = new Panel(); topPanel.setLayout(new FitLayout()); Panel toolbar = new Panel(); toolbar.setLayout(new HorizontalLayout(5)); toolbar.add(btnGridSave); toolbar.add(btnGridCancel); HorizontalPanel inner = new HorizontalPanel(); inner.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); inner.add(toolbar); topPanel.add(inner); topPanel.setBorder(false); return topPanel; } protected void updateGrid(Object[][] data) { System.out.println("before reconfigure"); if (store != null) { store.removeAll(); } RecordDef recordDef = new RecordDef(fieldDefs); ColumnModel columnModel = new ColumnModel(columns); MemoryProxy proxy = new MemoryProxy(data); ArrayReader reader = new ArrayReader(recordDef); store = new Store(proxy, reader); StoreListener storeListener = getGridStoreListener(); if (storeListener != null) { store.addStoreListener(storeListener); } store.load(); System.out.println("store load"); gridPanel.reconfigure(store, columnModel); System.out.println("after reconfigure"); } protected GridCellListener getGridCellListener() { return null; } protected StoreListener getGridStoreListener() { return null; } abstract protected BaseColumnConfig[] getColumnConfigArray(); abstract protected FieldDef[] getFieldDefArray(); abstract protected Object[][] getEmtryInitArray(); abstract protected String getGridPanelTitle(); abstract protected void doFillGridData(); abstract protected void loadForm(); abstract protected void callRpcUpdate(); abstract protected void renderTopPanel(); abstract protected void loadLookUpRpcData(); abstract protected boolean formValidation(); }
7,484
0.709781
0.707509
274
25.313869
20.857441
79
false
false
0
0
0
0
0
0
2.218978
false
false
2
eb30e95b6505ff35dc00fbc85bbc8899c8e7536d
35,167,192,253,068
1a5f37c22fc768a8d9ddb523e2cc68c7a8cd637b
/GInfo.java
fb3832ac8b408df8eb28693912b9f0b931ded247
[ "MIT" ]
permissive
mastermarchewa3454/Graph-Modelling-and-Traversal
https://github.com/mastermarchewa3454/Graph-Modelling-and-Traversal
58629048086ade5d04ea619644617b72296c75fd
be85a96a0ce3159a09aa29256a213846051c408c
refs/heads/master
2022-02-18T06:12:07.516000
2019-05-22T06:42:12
2019-05-22T06:42:12
185,585,336
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class GInfo { private int widthArena = 1000; private int heightArena = 1000; private int textSize = 37; private int widthLine = 4; private String textColor = "#fffafa"; private int sizeBall = 35; private String ballColor = "#FF0000"; private int forDouble = 10; private String ball2Color = "#000000"; private int recWidth = 350; private int recHeight = 125; public int getWidthArena() { return widthArena; } public int getHeightArena() { return heightArena; } public int getTextSize() { return textSize; } public int getWidthLine() { return widthLine; } public String getTextColor() { return textColor; } public int getSizeBall() { return sizeBall; } public String getBallColor() { return ballColor; } public int getForDouble() { return forDouble; } public String getBall2Color() { return ball2Color; } public int getRecWidth() { return recWidth; } public int getRecHeight() { return recHeight; } }
UTF-8
Java
1,171
java
GInfo.java
Java
[]
null
[]
public class GInfo { private int widthArena = 1000; private int heightArena = 1000; private int textSize = 37; private int widthLine = 4; private String textColor = "#fffafa"; private int sizeBall = 35; private String ballColor = "#FF0000"; private int forDouble = 10; private String ball2Color = "#000000"; private int recWidth = 350; private int recHeight = 125; public int getWidthArena() { return widthArena; } public int getHeightArena() { return heightArena; } public int getTextSize() { return textSize; } public int getWidthLine() { return widthLine; } public String getTextColor() { return textColor; } public int getSizeBall() { return sizeBall; } public String getBallColor() { return ballColor; } public int getForDouble() { return forDouble; } public String getBall2Color() { return ball2Color; } public int getRecWidth() { return recWidth; } public int getRecHeight() { return recHeight; } }
1,171
0.581554
0.552519
60
18.533333
13.055608
42
false
false
0
0
0
0
0
0
0.366667
false
false
2
8e7d4c3bf8aefe047a5ff65b92f052a9f27e1241
29,978,871,783,432
01eab2e94160ccc523ffa17fc62789281a8973ac
/app/src/main/java/com/home/dbykovskyy/simpletodo/DialogFragment/MyAlertDialogFragment.java
9c72cdd21e1f1d99ff0709bb27064dbe8c2fa361
[]
no_license
dbykovsky/todo-android
https://github.com/dbykovsky/todo-android
76089ab6e7eb12abd0ce53dc0b14d86f6a9c60c7
1158b6d5be88f568ab38451f2b94b5dabce98332
refs/heads/master
2021-01-16T23:24:12.337000
2015-08-24T06:31:37
2015-08-24T06:31:37
41,166,852
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.home.dbykovskyy.simpletodo.DialogFragment; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import com.home.dbykovskyy.simpletodo.ItemPriority; /** * Created by dbykovskyy on 8/22/15. */ public class MyAlertDialogFragment extends DialogFragment { public MyAlertDialogFragment() { // Empty constructor required for DialogFragment } public DialogInterface.OnClickListener positiveClickListener; public DialogInterface.OnClickListener cancelClickListener; public DialogInterface.OnClickListener onChoiceClickListener; public void setPositiveListener(DialogInterface.OnClickListener positiveListener){ this.positiveClickListener=positiveListener; } public void setCancelClickListener(DialogInterface.OnClickListener cancelListener){ this.cancelClickListener = cancelListener; } public void setOnChoiceClickListener(DialogInterface.OnClickListener onChoiceListener){ this.onChoiceClickListener=onChoiceListener; } public static MyAlertDialogFragment newInstance(String title) { MyAlertDialogFragment frag = new MyAlertDialogFragment(); Bundle args = new Bundle(); args.putString("title", title); frag.setArguments(args); return frag; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString("title"); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); alertDialogBuilder.setTitle(title); alertDialogBuilder.setSingleChoiceItems(ItemPriority.priority, -1, onChoiceClickListener); alertDialogBuilder.setPositiveButton("OK", positiveClickListener); alertDialogBuilder.setNegativeButton("Cancel", cancelClickListener); return alertDialogBuilder.create(); } }
UTF-8
Java
1,983
java
MyAlertDialogFragment.java
Java
[ { "context": "ovskyy.simpletodo.ItemPriority;\n\n/**\n * Created by dbykovskyy on 8/22/15.\n */\npublic class MyAlertDialogFragmen", "end": 320, "score": 0.9995771646499634, "start": 310, "tag": "USERNAME", "value": "dbykovskyy" } ]
null
[]
package com.home.dbykovskyy.simpletodo.DialogFragment; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import com.home.dbykovskyy.simpletodo.ItemPriority; /** * Created by dbykovskyy on 8/22/15. */ public class MyAlertDialogFragment extends DialogFragment { public MyAlertDialogFragment() { // Empty constructor required for DialogFragment } public DialogInterface.OnClickListener positiveClickListener; public DialogInterface.OnClickListener cancelClickListener; public DialogInterface.OnClickListener onChoiceClickListener; public void setPositiveListener(DialogInterface.OnClickListener positiveListener){ this.positiveClickListener=positiveListener; } public void setCancelClickListener(DialogInterface.OnClickListener cancelListener){ this.cancelClickListener = cancelListener; } public void setOnChoiceClickListener(DialogInterface.OnClickListener onChoiceListener){ this.onChoiceClickListener=onChoiceListener; } public static MyAlertDialogFragment newInstance(String title) { MyAlertDialogFragment frag = new MyAlertDialogFragment(); Bundle args = new Bundle(); args.putString("title", title); frag.setArguments(args); return frag; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString("title"); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); alertDialogBuilder.setTitle(title); alertDialogBuilder.setSingleChoiceItems(ItemPriority.priority, -1, onChoiceClickListener); alertDialogBuilder.setPositiveButton("OK", positiveClickListener); alertDialogBuilder.setNegativeButton("Cancel", cancelClickListener); return alertDialogBuilder.create(); } }
1,983
0.761473
0.757438
55
35.054546
30.095253
98
false
false
0
0
0
0
0
0
0.545455
false
false
2
56a0e83130eff166dc7e43f2653e270b2a8b0013
10,900,627,028,797
224a25d9c3995816e3e0ef2b9a26702dc3d679e3
/web/src/main/java/com/taobao/zeus/web/platform/client/module/jobmanager/GroupInherit.java
eed2e8c645d20da727099f0d991d6dc75e0d822d
[]
no_license
wangcunxin/kn-zeus
https://github.com/wangcunxin/kn-zeus
8d20ccb4cfdcf58a624355eb033145a7e4e40f1b
73982ed81a6deab65cab02843ff1f9c836c303c1
refs/heads/master
2020-03-31T08:37:40.647000
2018-10-08T11:02:07
2018-10-08T11:02:07
152,065,282
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.taobao.zeus.web.platform.client.module.jobmanager; import java.io.Serializable; public class GroupInherit implements Serializable{ private static final long serialVersionUID = 1L; private GroupInherit parentGroup; private String groupId; public void setParentGroup(GroupInherit parentGroup) { this.parentGroup = parentGroup; } public void setGroupId(String groupId) { this.groupId = groupId; } public GroupInherit getParentGroup() { return parentGroup; } public String getGroupId() { return groupId; } }
UTF-8
Java
543
java
GroupInherit.java
Java
[]
null
[]
package com.taobao.zeus.web.platform.client.module.jobmanager; import java.io.Serializable; public class GroupInherit implements Serializable{ private static final long serialVersionUID = 1L; private GroupInherit parentGroup; private String groupId; public void setParentGroup(GroupInherit parentGroup) { this.parentGroup = parentGroup; } public void setGroupId(String groupId) { this.groupId = groupId; } public GroupInherit getParentGroup() { return parentGroup; } public String getGroupId() { return groupId; } }
543
0.773481
0.771639
26
19.884615
20.106117
62
false
false
0
0
0
0
0
0
1.115385
false
false
2
a6576748b8eda5575bb3e51afe4074f7be97bc28
31,920,196,976,636
c75ff446ba4d3604fdb34fda46d248d846e4c3ac
/app/src/main/java/au/edu/jcu/cp3406/numvert/SettingsActivity.java
2020296704aab5e2d9dd93e447bcc4e0992ef6d1
[]
no_license
Dallas-Marshall/Numvert
https://github.com/Dallas-Marshall/Numvert
f5578547a8bea7e55a9e5698280f4834f92feb12
37411590d6d55b0dfbe57beeab1b318126e36b28
refs/heads/master
2023-03-26T10:20:25.878000
2021-03-26T01:02:30
2021-03-26T01:02:30
348,159,190
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package au.edu.jcu.cp3406.numvert; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Spinner; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; public class SettingsActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener { private String fromUnits; private String toUnits; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); // Load currently selected units Intent intent = getIntent(); fromUnits = intent.getStringExtra("fromUnits"); toUnits = intent.getStringExtra("toUnits"); setupSpinners(); } private void setupSpinners() { // Setup spinners Spinner fromUnitsSpinner = findViewById(R.id.fromUnitsSpinner); Spinner toUnitsSpinner = findViewById(R.id.toUnitsSpinner); ArrayAdapter<CharSequence> adapterFromUnits = ArrayAdapter.createFromResource(this, R.array.measurements, android.R.layout.simple_spinner_item); adapterFromUnits.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); fromUnitsSpinner.setAdapter(adapterFromUnits); ArrayAdapter<CharSequence> adapterToUnits = ArrayAdapter.createFromResource(this, R.array.measurements, android.R.layout.simple_spinner_item); adapterToUnits.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); toUnitsSpinner.setAdapter(adapterToUnits); // Set Values int fromUnitsPosition = adapterFromUnits.getPosition(fromUnits); fromUnitsSpinner.setSelection(fromUnitsPosition); int toUnitsPosition = adapterToUnits.getPosition(toUnits); toUnitsSpinner.setSelection(toUnitsPosition); // Set listeners fromUnitsSpinner.setOnItemSelectedListener(this); toUnitsSpinner.setOnItemSelectedListener(this); } /** * Handles event when convertButton is pressed. * * @param buttonPressed The convertButton view element. */ public void convertCLicked(View buttonPressed) { Intent data = new Intent(); data.putExtra("fromUnits", fromUnits); data.putExtra("toUnits", toUnits); setResult(RESULT_OK, data); finish(); } /** * Handles when a spinner is changed. */ @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (parent.getId() == R.id.fromUnitsSpinner) { fromUnits = parent.getItemAtPosition(position).toString(); } else if (parent.getId() == R.id.toUnitsSpinner) { toUnits = parent.getItemAtPosition(position).toString(); } } @Override public void onNothingSelected(AdapterView<?> parent) { } }
UTF-8
Java
2,975
java
SettingsActivity.java
Java
[]
null
[]
package au.edu.jcu.cp3406.numvert; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Spinner; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; public class SettingsActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener { private String fromUnits; private String toUnits; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); // Load currently selected units Intent intent = getIntent(); fromUnits = intent.getStringExtra("fromUnits"); toUnits = intent.getStringExtra("toUnits"); setupSpinners(); } private void setupSpinners() { // Setup spinners Spinner fromUnitsSpinner = findViewById(R.id.fromUnitsSpinner); Spinner toUnitsSpinner = findViewById(R.id.toUnitsSpinner); ArrayAdapter<CharSequence> adapterFromUnits = ArrayAdapter.createFromResource(this, R.array.measurements, android.R.layout.simple_spinner_item); adapterFromUnits.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); fromUnitsSpinner.setAdapter(adapterFromUnits); ArrayAdapter<CharSequence> adapterToUnits = ArrayAdapter.createFromResource(this, R.array.measurements, android.R.layout.simple_spinner_item); adapterToUnits.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); toUnitsSpinner.setAdapter(adapterToUnits); // Set Values int fromUnitsPosition = adapterFromUnits.getPosition(fromUnits); fromUnitsSpinner.setSelection(fromUnitsPosition); int toUnitsPosition = adapterToUnits.getPosition(toUnits); toUnitsSpinner.setSelection(toUnitsPosition); // Set listeners fromUnitsSpinner.setOnItemSelectedListener(this); toUnitsSpinner.setOnItemSelectedListener(this); } /** * Handles event when convertButton is pressed. * * @param buttonPressed The convertButton view element. */ public void convertCLicked(View buttonPressed) { Intent data = new Intent(); data.putExtra("fromUnits", fromUnits); data.putExtra("toUnits", toUnits); setResult(RESULT_OK, data); finish(); } /** * Handles when a spinner is changed. */ @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (parent.getId() == R.id.fromUnitsSpinner) { fromUnits = parent.getItemAtPosition(position).toString(); } else if (parent.getId() == R.id.toUnitsSpinner) { toUnits = parent.getItemAtPosition(position).toString(); } } @Override public void onNothingSelected(AdapterView<?> parent) { } }
2,975
0.707899
0.706555
83
34.855423
32.311039
152
false
false
0
0
0
0
0
0
0.578313
false
false
2
1ef9530d9d0ef64c2efe52e629cf58478af96197
5,884,105,241,986
599887eb8b1da22dc7eb86fa075c934d853b7c53
/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/dto/account/OkCoinFunds.java
e4fe642255d71da1ef3a38dbb4a8b3c327574630
[ "MIT" ]
permissive
sinotopia/XChange
https://github.com/sinotopia/XChange
04fc87646639ab630cd6fbb2ecdf55f6552a6e83
709b6bbb01b88ee06d59b9c5f8ba1b1dab4fa31e
refs/heads/develop
2021-01-15T21:25:19.687000
2017-08-11T02:14:29
2017-08-11T02:14:29
99,866,259
0
0
null
true
2017-08-10T01:09:55
2017-08-10T01:09:55
2017-08-09T18:58:47
2017-08-09T19:39:18
23,865
0
0
0
null
null
null
package org.knowm.xchange.okcoin.dto.account; import java.math.BigDecimal; import java.util.Collections; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** * "funds": { * "asset": { * "net": "0", * "total": "0" * }, * "borrow": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "free": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "freezed": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "union_fund": { * "btc": "0", * "ltc": "0", * "eth": "0" * } * } */ public class OkCoinFunds { /** * 账户资产,包含净资产及总资产 */ private final Map<String, BigDecimal> asset; /** * 账户余额 */ private final Map<String, BigDecimal> free; /** * 账户冻结余额 */ private final Map<String, BigDecimal> freezed; /** * 账户借款信息(只有在账户有借款信息时才会返回) */ private final Map<String, BigDecimal> borrow; /** * 账户理财信息(只有在账户有理财信息时才返回) */ private final Map<String, BigDecimal> union_fund; public OkCoinFunds(@JsonProperty("asset") final Map<String, BigDecimal> asset, @JsonProperty("free") final Map<String, BigDecimal> free, @JsonProperty("freezed") final Map<String, BigDecimal> freezed, @JsonProperty(value = "borrow", required = false) final Map<String, BigDecimal> borrow, @JsonProperty(value = "union_fund", required = false) final Map<String, BigDecimal> union_fund) { this.asset = asset; this.free = free; this.freezed = freezed; this.borrow = borrow == null ? Collections.<String, BigDecimal>emptyMap() : borrow; this.union_fund = union_fund == null ? Collections.<String, BigDecimal>emptyMap() : union_fund; } public Map<String, BigDecimal> getFree() { return free; } public Map<String, BigDecimal> getFreezed() { return freezed; } public Map<String, BigDecimal> getBorrow() { return borrow; } public Map<String, BigDecimal> getAsset() { return asset; } public Map<String, BigDecimal> getUnion_fund() { return union_fund; } }
UTF-8
Java
2,348
java
OkCoinFunds.java
Java
[]
null
[]
package org.knowm.xchange.okcoin.dto.account; import java.math.BigDecimal; import java.util.Collections; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** * "funds": { * "asset": { * "net": "0", * "total": "0" * }, * "borrow": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "free": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "freezed": { * "btc": "0", * "usd": "0", * "ltc": "0", * "eth": "0" * }, * "union_fund": { * "btc": "0", * "ltc": "0", * "eth": "0" * } * } */ public class OkCoinFunds { /** * 账户资产,包含净资产及总资产 */ private final Map<String, BigDecimal> asset; /** * 账户余额 */ private final Map<String, BigDecimal> free; /** * 账户冻结余额 */ private final Map<String, BigDecimal> freezed; /** * 账户借款信息(只有在账户有借款信息时才会返回) */ private final Map<String, BigDecimal> borrow; /** * 账户理财信息(只有在账户有理财信息时才返回) */ private final Map<String, BigDecimal> union_fund; public OkCoinFunds(@JsonProperty("asset") final Map<String, BigDecimal> asset, @JsonProperty("free") final Map<String, BigDecimal> free, @JsonProperty("freezed") final Map<String, BigDecimal> freezed, @JsonProperty(value = "borrow", required = false) final Map<String, BigDecimal> borrow, @JsonProperty(value = "union_fund", required = false) final Map<String, BigDecimal> union_fund) { this.asset = asset; this.free = free; this.freezed = freezed; this.borrow = borrow == null ? Collections.<String, BigDecimal>emptyMap() : borrow; this.union_fund = union_fund == null ? Collections.<String, BigDecimal>emptyMap() : union_fund; } public Map<String, BigDecimal> getFree() { return free; } public Map<String, BigDecimal> getFreezed() { return freezed; } public Map<String, BigDecimal> getBorrow() { return borrow; } public Map<String, BigDecimal> getAsset() { return asset; } public Map<String, BigDecimal> getUnion_fund() { return union_fund; } }
2,348
0.555005
0.54734
101
20.960396
25.49662
120
false
false
0
0
0
0
0
0
0.584158
false
false
2
956ec11ad4e63b2c73ec37334c5ccf043aa056a4
4,904,852,706,422
90583edfb448b19c07a59115ee6eaffbf19a298d
/dollar-examples/src/test/java/me/neilellis/dollar/DollarTypeTest.java
6eafdf9421de9bd99434b0f924c42deb01850151
[ "Apache-2.0" ]
permissive
gitter-badger/dollar
https://github.com/gitter-badger/dollar
9b7bbece12bc8bd734ee90dd67c7e370454e7501
e071ce38a29b1f92500f784617db9690b2f70301
refs/heads/master
2021-01-15T15:52:46.226000
2014-12-02T16:00:33
2014-12-02T16:00:33
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright (c) 2014 Neil Ellis * * 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 me.neilellis.dollar; import org.junit.BeforeClass; import org.junit.Test; import static junit.framework.TestCase.assertFalse; import static me.neilellis.dollar.DollarStatic.$; import static org.junit.Assert.*; public class DollarTypeTest { @BeforeClass public static void setUp() { } @Test public void testIntegers() throws InterruptedException { //Number types assertEquals(1, (int) $(1).I()); assertEquals(1, (long) $(1).L()); assertEquals(1.0, $(1).D(), 0.000001); //identity assertEquals($(1), $(1).L()); assertEquals($(1), $(1)); assertNotEquals($(1).L(), $(1)); //Lambda assertEquals($((v) -> $(1)), $(1)); assertEquals($(1), $((v) -> $(1))); assertTrue($((v) -> $(1)).isLambda()); assertTrue($((v) -> $(1)).isInteger()); assertTrue($((v) -> $(1)).isNumber()); assertTrue($((v) -> $(1)).isSingleValue()); //isChecks assertTrue($(1).isInteger()); assertTrue($(1).isNumber()); assertTrue($(1).isSingleValue()); assertFalse($(1).isDecimal()); assertFalse($(1).isMap()); assertFalse($(1).isList()); assertFalse($(1).isLambda()); assertFalse($(1).isString()); assertFalse($(1).isVoid()); assertFalse($(1).$isEmpty().isTrue()); //numeric functions assertEquals(2, (long) $(1).$inc().L()); } @Test public void testDouble() throws InterruptedException { //Number types assertEquals(1L, (long) $(1.0).L()); //identity assertEquals($(1.0), $(1.0).D()); assertEquals($(1.0), $(1.0)); assertNotEquals($(1.0).D(), $(1.0)); //Lambda assertEquals($((v) -> $(1)), $(1)); assertEquals($(1), $((v) -> $(1))); assertTrue($((v) -> $(1.0)).isLambda()); assertTrue($((v) -> $(1.0)).isDecimal()); assertTrue($((v) -> $(1.0)).isNumber()); assertTrue($((v) -> $(1.0)).isSingleValue()); //isChecks assertTrue($(1.0).isDecimal()); assertTrue($(1.0).isNumber()); assertTrue($(1.0).isSingleValue()); assertFalse($(1.0).isInteger()); assertFalse($(1.0).isMap()); assertFalse($(1.0).isList()); assertFalse($(1.0).isLambda()); assertFalse($(1.0).isString()); assertFalse($(1.0).isVoid()); assertFalse($(1.0).$isEmpty().isTrue()); //numeric functions assertEquals(2.0, $(1.0).$inc().D(), 0.00001); } }
UTF-8
Java
3,177
java
DollarTypeTest.java
Java
[ { "context": "/*\n * Copyright (c) 2014 Neil Ellis\n *\n * Licensed under the Apache License, Version ", "end": 35, "score": 0.9998634457588196, "start": 25, "tag": "NAME", "value": "Neil Ellis" } ]
null
[]
/* * Copyright (c) 2014 <NAME> * * 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 me.neilellis.dollar; import org.junit.BeforeClass; import org.junit.Test; import static junit.framework.TestCase.assertFalse; import static me.neilellis.dollar.DollarStatic.$; import static org.junit.Assert.*; public class DollarTypeTest { @BeforeClass public static void setUp() { } @Test public void testIntegers() throws InterruptedException { //Number types assertEquals(1, (int) $(1).I()); assertEquals(1, (long) $(1).L()); assertEquals(1.0, $(1).D(), 0.000001); //identity assertEquals($(1), $(1).L()); assertEquals($(1), $(1)); assertNotEquals($(1).L(), $(1)); //Lambda assertEquals($((v) -> $(1)), $(1)); assertEquals($(1), $((v) -> $(1))); assertTrue($((v) -> $(1)).isLambda()); assertTrue($((v) -> $(1)).isInteger()); assertTrue($((v) -> $(1)).isNumber()); assertTrue($((v) -> $(1)).isSingleValue()); //isChecks assertTrue($(1).isInteger()); assertTrue($(1).isNumber()); assertTrue($(1).isSingleValue()); assertFalse($(1).isDecimal()); assertFalse($(1).isMap()); assertFalse($(1).isList()); assertFalse($(1).isLambda()); assertFalse($(1).isString()); assertFalse($(1).isVoid()); assertFalse($(1).$isEmpty().isTrue()); //numeric functions assertEquals(2, (long) $(1).$inc().L()); } @Test public void testDouble() throws InterruptedException { //Number types assertEquals(1L, (long) $(1.0).L()); //identity assertEquals($(1.0), $(1.0).D()); assertEquals($(1.0), $(1.0)); assertNotEquals($(1.0).D(), $(1.0)); //Lambda assertEquals($((v) -> $(1)), $(1)); assertEquals($(1), $((v) -> $(1))); assertTrue($((v) -> $(1.0)).isLambda()); assertTrue($((v) -> $(1.0)).isDecimal()); assertTrue($((v) -> $(1.0)).isNumber()); assertTrue($((v) -> $(1.0)).isSingleValue()); //isChecks assertTrue($(1.0).isDecimal()); assertTrue($(1.0).isNumber()); assertTrue($(1.0).isSingleValue()); assertFalse($(1.0).isInteger()); assertFalse($(1.0).isMap()); assertFalse($(1.0).isList()); assertFalse($(1.0).isLambda()); assertFalse($(1.0).isString()); assertFalse($(1.0).isVoid()); assertFalse($(1.0).$isEmpty().isTrue()); //numeric functions assertEquals(2.0, $(1.0).$inc().D(), 0.00001); } }
3,173
0.552093
0.519043
113
27.123894
21.434458
75
false
false
0
0
0
0
0
0
0.646018
false
false
2
57f8dd12d673577b79b50a648fa7383c9a7d54cf
10,067,403,375,914
eacfc7cf6b777649e8e017bf2805f6099cb9385d
/APK Source/src/com/chartboost/sdk/impl/db$c.java
5443b450ff71cdac047d999956c06b50b6377baa
[]
no_license
maartenpeels/WordonHD
https://github.com/maartenpeels/WordonHD
8b171cfd085e1f23150162ea26ed6967945005e2
4d316eb33bc1286c4b8813c4afd478820040bf05
refs/heads/master
2021-03-27T16:51:40.569000
2017-06-12T13:32:51
2017-06-12T13:32:51
44,254,944
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.chartboost.sdk.impl; import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.Set; // Referenced classes of package com.chartboost.sdk.impl: // db final class <init> extends <init> implements Serializable { final db a; public Set a() { return Collections.unmodifiableSet(db.a(a).keySet()); } public Set b() { return Collections.unmodifiableSet(db.a(a).entrySet()); } public Collection c() { return Collections.unmodifiableCollection(db.a(a).values()); } (db db1) { a = db1; super(); } }
UTF-8
Java
859
java
db$c.java
Java
[ { "context": "// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.\n// Jad home page: http://www.geocities.com/kpdus", "end": 61, "score": 0.9996771812438965, "start": 45, "tag": "NAME", "value": "Pavel Kouznetsov" } ]
null
[]
// Decompiled by Jad v1.5.8e. Copyright 2001 <NAME>. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.chartboost.sdk.impl; import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.Set; // Referenced classes of package com.chartboost.sdk.impl: // db final class <init> extends <init> implements Serializable { final db a; public Set a() { return Collections.unmodifiableSet(db.a(a).keySet()); } public Set b() { return Collections.unmodifiableSet(db.a(a).entrySet()); } public Collection c() { return Collections.unmodifiableCollection(db.a(a).values()); } (db db1) { a = db1; super(); } }
849
0.6461
0.635623
42
19.452381
20.823753
68
false
false
0
0
0
0
0
0
0.285714
false
false
2
5367c76cb1da9b81cabd1dc50aef17256b472db9
18,159,121,792,034
9a3f6d205ebd1c39d0b656493f8f38b7b5dc6d90
/com/test/Level2.java
0c2464fac9d3d595d8925cf9a8409cad112bbbc7
[]
no_license
fserj/algs
https://github.com/fserj/algs
72383bd2bef080c11105de3a0ff992a0153045be
21c4af98cc6a6a11d754ca712eb1a06457c336a1
refs/heads/master
2019-11-29T18:27:07.825000
2019-11-06T18:00:09
2019-11-06T18:00:09
100,710,963
0
0
null
false
2019-11-06T18:01:49
2017-08-18T12:43:09
2019-11-06T18:00:32
2019-11-06T18:01:48
2,701
0
0
2
Java
false
false
package com.test; /** * Created by sergiu.filip on 11/28/2015. */ public class Level2 { @RequiredField String value3; public String getValue3() { return value3; } public void setValue3(String value3) { this.value3 = value3; } public String getValue4() { return value4; } public void setValue4(String value4) { this.value4 = value4; } String value4; }
UTF-8
Java
438
java
Level2.java
Java
[ { "context": "package com.test;\n\n/**\n * Created by sergiu.filip on 11/28/2015.\n */\npublic class Level2 {\n\n @Re", "end": 49, "score": 0.9539504647254944, "start": 37, "tag": "NAME", "value": "sergiu.filip" } ]
null
[]
package com.test; /** * Created by sergiu.filip on 11/28/2015. */ public class Level2 { @RequiredField String value3; public String getValue3() { return value3; } public void setValue3(String value3) { this.value3 = value3; } public String getValue4() { return value4; } public void setValue4(String value4) { this.value4 = value4; } String value4; }
438
0.589041
0.53653
30
13.6
14.204694
42
false
false
0
0
0
0
0
0
0.233333
false
false
2
5597a45917b641f64499aba0b9aa6823096f1b77
5,514,738,041,778
e28da996a3c281450d160ddf275518e22b258282
/util7/src/test/java/link/webarata3/dro/common/util7/NumberUtilTest.java
d9e98e702a349a024addc5f0d91f4d5916c50a67
[ "MIT" ]
permissive
webarata3/AndroidUtil7
https://github.com/webarata3/AndroidUtil7
f7feabfd77bfcbea2c1bc3cd590d385dc17b3d29
34aac2e84122cb8f7f8a3e8d43b04efdd13ad4d3
refs/heads/master
2020-08-18T06:37:45.906000
2017-10-15T01:31:27
2017-10-15T01:31:27
73,525,861
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package link.webarata3.dro.common.util7; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; public class NumberUtilTest { @Test public void formatIntで123の場合() throws Exception { assertThat(NumberUtil.formatInt("123"), is(123)); } @Test public void formatIntでマイナス123の場合() throws Exception { assertThat(NumberUtil.formatInt("-123"), is(-123)); } @Test public void formatIntでnullの場合() throws Exception { assertThat(NumberUtil.formatInt(null), is(nullValue())); } @Test public void formatIntで1点0の場合() throws Exception { assertThat(NumberUtil.formatInt("1.0"), is(nullValue())); } }
UTF-8
Java
755
java
NumberUtilTest.java
Java
[]
null
[]
package link.webarata3.dro.common.util7; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; public class NumberUtilTest { @Test public void formatIntで123の場合() throws Exception { assertThat(NumberUtil.formatInt("123"), is(123)); } @Test public void formatIntでマイナス123の場合() throws Exception { assertThat(NumberUtil.formatInt("-123"), is(-123)); } @Test public void formatIntでnullの場合() throws Exception { assertThat(NumberUtil.formatInt(null), is(nullValue())); } @Test public void formatIntで1点0の場合() throws Exception { assertThat(NumberUtil.formatInt("1.0"), is(nullValue())); } }
755
0.677419
0.643759
28
24.464285
24.112062
65
false
false
0
0
0
0
0
0
0.428571
false
false
2
d54e8959e1bca904a5e347bebf1b3741b24d1206
30,279,519,506,631
1d3c64c5ce79669bcf5d0ea4f5a2305e8d02b013
/app/src/main/java/com/yohannes/app/dev/megabite/Detail.java
ab8626811e69c4634f7eda72ead5691b381d46ad
[]
no_license
YohannesTz/Megabite
https://github.com/YohannesTz/Megabite
545d1f17cf3dc66c6008ec99c0598cb67417cefa
a6fcaeea200b5cdd81af72c4b7aead5ff4a55833
refs/heads/master
2022-12-11T08:04:12.806000
2020-09-15T09:37:52
2020-09-15T09:37:52
295,682,302
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yohannes.app.dev.megabite; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; public class Detail extends AppCompatActivity { private Service service; private ListView serviceDetailList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); service = (Service) getIntent().getSerializableExtra("service"); serviceDetailList = (ListView) findViewById(R.id.service_detail_list); if(service.getService_detail() != null) { ListAdapter listAdapter = new ArrayAdapter<String>(this, R.layout.basic_row, service.getService_detail()); serviceDetailList.setAdapter(listAdapter); } //setting up back arrow to go back Toolbar toolbar = (Toolbar) findViewById(R.id.activityToolbar); toolbar.setTitle(service.getAmh_name()); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } /* @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); service = (Service) getIntent().getSerializableExtra("service"); RelativeLayout detailLayout = new RelativeLayout(this); //setting toolbar Toolbar toolbar = new Toolbar(this); toolbar.setTitle(service.getAmh_name()); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); //Setup ListView if service_detail is not null if(service.getService_detail() != null){ ListView serviceDetailList = new ListView(this); ListAdapter listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, service.getService_detail()); serviceDetailList.setAdapter(listAdapter); detailLayout.addView(toolbar); detailLayout.addView(serviceDetailList); }else{ TextView textView = new TextView(this); textView.setText("Hello world simple activity"); detailLayout.addView(toolbar); detailLayout.addView(textView); } setContentView(detailLayout); }*/ //return from the current activity @Override public boolean onSupportNavigateUp() { onBackPressed(); return true; } }
UTF-8
Java
2,695
java
Detail.java
Java
[]
null
[]
package com.yohannes.app.dev.megabite; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; public class Detail extends AppCompatActivity { private Service service; private ListView serviceDetailList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); service = (Service) getIntent().getSerializableExtra("service"); serviceDetailList = (ListView) findViewById(R.id.service_detail_list); if(service.getService_detail() != null) { ListAdapter listAdapter = new ArrayAdapter<String>(this, R.layout.basic_row, service.getService_detail()); serviceDetailList.setAdapter(listAdapter); } //setting up back arrow to go back Toolbar toolbar = (Toolbar) findViewById(R.id.activityToolbar); toolbar.setTitle(service.getAmh_name()); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } /* @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); service = (Service) getIntent().getSerializableExtra("service"); RelativeLayout detailLayout = new RelativeLayout(this); //setting toolbar Toolbar toolbar = new Toolbar(this); toolbar.setTitle(service.getAmh_name()); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); //Setup ListView if service_detail is not null if(service.getService_detail() != null){ ListView serviceDetailList = new ListView(this); ListAdapter listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, service.getService_detail()); serviceDetailList.setAdapter(listAdapter); detailLayout.addView(toolbar); detailLayout.addView(serviceDetailList); }else{ TextView textView = new TextView(this); textView.setText("Hello world simple activity"); detailLayout.addView(toolbar); detailLayout.addView(textView); } setContentView(detailLayout); }*/ //return from the current activity @Override public boolean onSupportNavigateUp() { onBackPressed(); return true; } }
2,695
0.689054
0.688683
73
35.917809
27.670147
135
false
false
0
0
0
0
0
0
0.60274
false
false
2
ba444d50b47c754916ebe57ded7e772051f0c5c7
11,811,160,119,606
4cc615a0f3627c6339f2c878dd88c7737188bb96
/api/src/test/java/data/TestDataFactory.java
e9a7795b1eba1dcc6564e323b55299fbeab69586
[]
no_license
ankowals/taf
https://github.com/ankowals/taf
bb2141636b0eb6c84746751fbf15722093a0eca9
b6e21f446da51484636b66a9356f629d5b572be8
refs/heads/master
2023-05-12T11:49:18.690000
2022-04-18T10:25:28
2022-04-18T10:25:28
200,910,176
2
0
null
false
2023-05-09T18:42:51
2019-08-06T19:14:13
2022-04-18T09:36:59
2023-05-09T18:42:47
74
2
0
3
Java
false
false
package data; import data.builders.CustomCategory; import data.builders.CustomPet; import data.builders.CustomTag; public class TestDataFactory { public static CustomCategory.CustomCategoryBuilder aDefaultCategory() { return CustomCategory.builder(); } public static CustomTag.CustomTagBuilder aDefaultTag() { return CustomTag.builder(); } public static CustomPet.CustomPetBuilder aDefaultPet() { return CustomPet.builder(); } }
UTF-8
Java
445
java
TestDataFactory.java
Java
[]
null
[]
package data; import data.builders.CustomCategory; import data.builders.CustomPet; import data.builders.CustomTag; public class TestDataFactory { public static CustomCategory.CustomCategoryBuilder aDefaultCategory() { return CustomCategory.builder(); } public static CustomTag.CustomTagBuilder aDefaultTag() { return CustomTag.builder(); } public static CustomPet.CustomPetBuilder aDefaultPet() { return CustomPet.builder(); } }
445
0.793258
0.793258
13
33.23077
37.449768
110
false
false
0
0
0
0
0
0
0.538462
false
false
2
b1dcef24e3dc348b614930be10eb77aa686a677f
16,544,214,031,508
8bd56d33a83a7c7a3a52ce2a623723133979ceea
/src/main/java/com/vlad/testjob/app/screens/MainActivity.java
c5e9a78dd8a3d8f8e1ed0a7d2299ce004e2ca0e8
[]
no_license
Vlad161/Products
https://github.com/Vlad161/Products
394527230b4160caa404e286a5884cadfa53cf80
f4932917b98ae5f1c870cca13f095b422e41bf77
refs/heads/master
2015-08-12T06:02:27.869000
2014-08-11T12:09:53
2014-08-11T12:09:53
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vlad.testjob.app.screens; import android.content.Intent; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import com.vlad.testjob.app.JSONReadFromAsset; import com.vlad.testjob.app.R; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; public class MainActivity extends ActionBarActivity { ListView listViewMain; ArrayList<String> nameList = new ArrayList<String>(); ArrayList<Integer> idList = new ArrayList<Integer>(); JSONArray jsonArray; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listViewMain = (ListView) findViewById(R.id.listViewMain); listViewMain.setOnItemClickListener(listViewMainListener); fillLists(); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_view_item, R.id.textViewListItem, nameList); listViewMain.setAdapter(adapter); } private void fillLists() { jsonArray = new JSONReadFromAsset().readJsonFromAsset(getApplicationContext()); for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = null; try { object = jsonArray.getJSONObject(i); } catch (JSONException e) { } idList.add(object.optInt("id")); //Заполняем ArrayList с id nameList.add(object.optString("name")); //Заполняем ArrayList с названием продуктов для вывода в ListView } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.itemShowCompany) { Intent intent = new Intent(this, AboutCompany.class); startActivity(intent); return true; } return super.onOptionsItemSelected(item); } AdapterView.OnItemClickListener listViewMainListener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { Intent intent = new Intent(getApplicationContext(), ProductsDescriptionActivity.class); JSONObject obj = null; int id = 0; String name = null; String description = null; String picture = null; try { obj = jsonArray.getJSONObject(position); id = obj.getInt("id"); name = obj.getString("name"); description = obj.getString("description"); picture = obj.getString("picture"); } catch (JSONException e) { } intent.putExtra("id", String.valueOf(id)); intent.putExtra("name", name); intent.putExtra("description", description); intent.putExtra("picture", picture); startActivity(intent); } }; }
UTF-8
Java
3,375
java
MainActivity.java
Java
[]
null
[]
package com.vlad.testjob.app.screens; import android.content.Intent; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import com.vlad.testjob.app.JSONReadFromAsset; import com.vlad.testjob.app.R; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; public class MainActivity extends ActionBarActivity { ListView listViewMain; ArrayList<String> nameList = new ArrayList<String>(); ArrayList<Integer> idList = new ArrayList<Integer>(); JSONArray jsonArray; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listViewMain = (ListView) findViewById(R.id.listViewMain); listViewMain.setOnItemClickListener(listViewMainListener); fillLists(); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_view_item, R.id.textViewListItem, nameList); listViewMain.setAdapter(adapter); } private void fillLists() { jsonArray = new JSONReadFromAsset().readJsonFromAsset(getApplicationContext()); for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = null; try { object = jsonArray.getJSONObject(i); } catch (JSONException e) { } idList.add(object.optInt("id")); //Заполняем ArrayList с id nameList.add(object.optString("name")); //Заполняем ArrayList с названием продуктов для вывода в ListView } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.itemShowCompany) { Intent intent = new Intent(this, AboutCompany.class); startActivity(intent); return true; } return super.onOptionsItemSelected(item); } AdapterView.OnItemClickListener listViewMainListener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { Intent intent = new Intent(getApplicationContext(), ProductsDescriptionActivity.class); JSONObject obj = null; int id = 0; String name = null; String description = null; String picture = null; try { obj = jsonArray.getJSONObject(position); id = obj.getInt("id"); name = obj.getString("name"); description = obj.getString("description"); picture = obj.getString("picture"); } catch (JSONException e) { } intent.putExtra("id", String.valueOf(id)); intent.putExtra("name", name); intent.putExtra("description", description); intent.putExtra("picture", picture); startActivity(intent); } }; }
3,375
0.645927
0.645026
100
32.27
27.360868
128
false
false
0
0
0
0
0
0
0.71
false
false
2