query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Nom de la colonne
public String getColumnName(int col) { return columns[col] ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int obtenirColonne() {\n return this.colonne;\n }", "int nbColonnes();", "@Override\n\tpublic String getColumnName(int col)\n\t{\n\t\treturn nomColonnes[col];\n\t}", "@Override\n\tpublic int getColumnCount()\n\t{\n\t\treturn nomColonnes.length;\n\t}", "private String name() {\r\n return...
[ "0.7031843", "0.6309519", "0.6271452", "0.6230726", "0.6223887", "0.61787397", "0.6132339", "0.60605264", "0.5964014", "0.5945078", "0.58593875", "0.5816322", "0.5807481", "0.5781714", "0.57809454", "0.5779889", "0.57705575", "0.57451814", "0.57075715", "0.5691437", "0.568596...
0.0
-1
Instantiates a new Employee.
public Employee(String n, double s) { name = n; salary = s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Employee() {}", "public Employee() {\n\t\tsuper();\n\t}", "public Employee() {\n\t\tSystem.out.println(\"Employee Contructor Called...\");\n\t}", "public Employee() {\n\n\t}", "public Employee() {\n\t\t\n\t}", "public Employee() {\n \n }", "Employee() {\n\t}", "public Employee() {\n }...
[ "0.78817695", "0.7866101", "0.7865031", "0.78367496", "0.78169423", "0.7816273", "0.7810965", "0.77583045", "0.77583045", "0.77583045", "0.7743915", "0.77382886", "0.7713318", "0.7713318", "0.76535535", "0.7355357", "0.73237157", "0.731892", "0.73182124", "0.73053324", "0.713...
0.6676051
58
TODO Autogenerated method stub
@Override public void onFailure(Call arg0, IOException arg1) { onError(callback, arg1.getMessage()); arg1.printStackTrace(); FLogger.e(arg1.getMessage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onResponse(Call arg0, Response response) throws IOException { try { String string = response.header("Set-Cookie"); s = string.substring(0, string.indexOf(";")); } catch (Exception e) { // TODO: handle exception } String result = response.body().string(); // String result=""; // 是否有响应 if (response.isSuccessful()) { FLogger.e(Global.INNER_TAG, "success"); onResult(callback, result.toString(),true); } else { FLogger.e(Global.INNER_TAG, "failed"); onResult(callback, result.toString(),false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onFailure(Call arg0, IOException arg1) { FLogger.e(arg1.getMessage()); arg1.printStackTrace(); onError(callback, arg1.getMessage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onResponse(Call arg0, Response response) throws IOException { String resultmsg = response.body().string(); String result=""; // try { // result = URLDecoder.decode(resultmsg, "UTF-8"); // } catch (UnsupportedEncodingException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // FLogger.e(Global.INNER_TAG, "解析数据出错"); // } // 是否有响应 if (response.isSuccessful()) { FLogger.e(Global.INNER_TAG, "success"); onResult(callback, result.toString(),true); } else { FLogger.e(Global.INNER_TAG, "failed"); onResult(callback, result.toString(),false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void onResponse(Call arg0, Response response) throws IOException { if (response.isSuccessful()) { onSuccess(callback, response.body().string()); } else { onError(callback, response.message()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Return the register template with an empty UserDTO
@GetMapping(value="/") public String showRegistrationForm(WebRequest request, Model model) { UserDTO userDTO = new UserDTO(); model.addAttribute("user", userDTO); return "security/register"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "UserDto create(UserRegistrationDto user);", "UserDTO registerUser(UserRegistrationDTO registrationDTO);", "@GetMapping(\"/register\")\n public String showRegister(Model model){\n model.addAttribute(\"user\", new User());\n return \"registerForm\";\n }", "@GetMapping(\"register\")\n pub...
[ "0.65818685", "0.62338805", "0.6182394", "0.6130215", "0.6102722", "0.6077673", "0.60340166", "0.60226685", "0.597601", "0.5969831", "0.5967139", "0.59524333", "0.5949601", "0.59311897", "0.58936554", "0.5892082", "0.5859008", "0.5856538", "0.5849058", "0.58485633", "0.582337...
0.62681276
1
profile bit 1 means to use vertical board at the position
boolean bitSet(int p, int b) // check if int p bit b is 1 { return ((p>>b) & 1)>0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkVertical() {\n\n for(int i = 0; i < 2; i++){ // winning column can be either 0-1-2-(3) or (0)-1-2-3\n for (int j = 0; j < stateArray[3].length; j++) {\n\n if (check3Vertical(i, j)) {\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskA...
[ "0.56879514", "0.5638899", "0.56151104", "0.55989873", "0.5555081", "0.5510212", "0.5506869", "0.5408581", "0.5364254", "0.53360075", "0.5328619", "0.5309462", "0.5303038", "0.52961904", "0.52949613", "0.5263815", "0.523975", "0.5231796", "0.52316767", "0.5197562", "0.5196398...
0.0
-1
Created with 66cfv2 User : Ting.Yao Date : 2015/3/2.
public interface SystemDefaultPropertyRepository extends DomainRepository<SystemDefaultProperty>{ SystemDefaultProperty findByActive(boolean active); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mo4359a() {\n }", "public void mo6081a() {\n }", "private static void cajas() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a(...
[ "0.5983929", "0.59540296", "0.5947119", "0.5903877", "0.5898031", "0.589373", "0.589373", "0.589373", "0.589373", "0.589373", "0.589373", "0.589373", "0.5880199", "0.57702744", "0.5725273", "0.5707204", "0.5703019", "0.5696539", "0.56740105", "0.5673375", "0.567314", "0.567...
0.0
-1
Map of planet (dark) images.
public static Map<Planet,ZImage> getDarkImages() throws IOException { Map<Planet,ZImage> plImgMap = new HashMap<>(); for( Planet planet: planetList ) { System.out.print("."); BufferedImage bImage = ImageIO.read(new File(planet.getFileDark())); // Store image with some metadata ZImage zimage = new ZImage( bImage, Constants.SCALEDP, Constants.SCALEDP, Color.BLACK ); plImgMap.put(planet, zimage); } return plImgMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Map<Planet,ZImage> getLightImages()\n throws IOException\n {\n Map<Planet,ZImage> plImgMap = new HashMap<>();\n \n for( Planet planet: planetList )\n {\n System.out.print(\".\");\n BufferedImage bImage = ImageIO.read(new File(planet.getF...
[ "0.7582287", "0.6576866", "0.6256235", "0.62015486", "0.6138476", "0.6056112", "0.59021246", "0.5829083", "0.5820949", "0.58013487", "0.5776634", "0.574486", "0.5710069", "0.5652389", "0.56278914", "0.56095576", "0.5598995", "0.55482787", "0.5538197", "0.55169725", "0.547134"...
0.81037
0
Map of planet (light) images.
public static Map<Planet,ZImage> getLightImages() throws IOException { Map<Planet,ZImage> plImgMap = new HashMap<>(); for( Planet planet: planetList ) { System.out.print("."); BufferedImage bImage = ImageIO.read(new File(planet.getFileLight())); // Store image with some metadata ZImage zimage = new ZImage( bImage, Constants.SCALEDP, Constants.SCALEDP, Color.LIGHT_GRAY ); plImgMap.put(planet, zimage); } return plImgMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Map<Planet,ZImage> getDarkImages()\n throws IOException\n {\n Map<Planet,ZImage> plImgMap = new HashMap<>();\n \n for( Planet planet: planetList )\n {\n System.out.print(\".\");\n BufferedImage bImage = ImageIO.read(new File(planet.getFi...
[ "0.7692597", "0.6589291", "0.64315075", "0.6309046", "0.6285713", "0.6077793", "0.6069116", "0.5921604", "0.5894711", "0.5879806", "0.58697855", "0.58591753", "0.57848006", "0.57276577", "0.56428504", "0.56417817", "0.5611384", "0.5558216", "0.55096334", "0.55006135", "0.5500...
0.81190556
0
Planet posn. (RA) and offset
public double getRADegrees() { return raDegrees; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Vector3f getPlanetPosition() {\r\n\t\tVector3f position = new Vector3f();\r\n\t\tdouble theta = Math.random() * 2 * Math.PI;\r\n\t\tdouble r = MathUtils.randRange(MIN_ORBITAL_RADIUS, MAX_ORBITAL_RADIUS);\r\n\t\tposition.x = (float) (r * Math.cos(theta));\r\n\t\tposition.z = (float) (r * Math.sin(theta));\r...
[ "0.6533833", "0.5896695", "0.58836955", "0.5804302", "0.5801189", "0.5784429", "0.5766391", "0.57476085", "0.5719608", "0.56631464", "0.56467414", "0.56391615", "0.5579488", "0.5550368", "0.55234605", "0.55101234", "0.5495934", "0.5447249", "0.54460347", "0.54249585", "0.5418...
0.0
-1
Set Right Ascension (degrees)
public void setRADegrees(double degrees) { this.raDegrees = degrees; this.ra = Math.toRadians(degrees); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "private void rotateRight() {\r\n\t switch(direction){\r\n\t case Constants.DIRECTION_NORTH:\r\n\t direction = Constants.DIRECTION_EAST;\r\n\t ...
[ "0.6820031", "0.6656377", "0.65502876", "0.65245163", "0.64460844", "0.64153546", "0.63588804", "0.625995", "0.6149831", "0.6129019", "0.6111203", "0.6089629", "0.6086164", "0.60826975", "0.6063804", "0.605092", "0.6043463", "0.6038355", "0.60057837", "0.60011214", "0.5977318...
0.0
-1
Set Right Ascension (rads)
public void setRA(double radians) { this.ra = radians; this.raDegrees = Math.toDegrees(radians); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "private void rotateRight() {\r\n\t switch(direction){\r\n\t case Constants.DIRECTION_NORTH:\r\n\t direction = Constants.DIRECTION_EAST;\r\n\t ...
[ "0.66044104", "0.6557008", "0.6497127", "0.64913785", "0.6436702", "0.63717145", "0.6328365", "0.631352", "0.62162095", "0.6203271", "0.6189533", "0.61402124", "0.6133792", "0.61070037", "0.60347456", "0.6031465", "0.6028417", "0.59745353", "0.5974486", "0.59431803", "0.59408...
0.0
-1
Return the Planet (by name) map.
public static Map<String,Planet> getPlanetsByName() { return planetsByName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, Planet> getPlanets(){\n\t\treturn galaxy;\n\t}", "public static Map<Integer,Planet> getPlanetsByOrder() { return planetsByOrder; }", "@Override\n\tString getName() {\n\t\treturn \"Planet\"+\": \"+name;\n\t}", "public Planet[] getPlanets() {\n return this.planets;\n }", "private...
[ "0.7395412", "0.6609919", "0.62092924", "0.6145058", "0.6106492", "0.6043343", "0.6028743", "0.600218", "0.5889792", "0.55765706", "0.54574674", "0.5414785", "0.5402339", "0.5387269", "0.53310025", "0.5312304", "0.5281421", "0.52375835", "0.51660836", "0.51335555", "0.512071"...
0.77732724
0
Return the Planet (by order, Sun=0) map.
public static Map<Integer,Planet> getPlanetsByOrder() { return planetsByOrder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, Planet> getPlanets(){\n\t\treturn galaxy;\n\t}", "public static Map<String,Planet> getPlanetsByName() { return planetsByName; }", "public Planet[] getPlanets() {\n return this.planets;\n }", "public List<Planet> getPlanets() {\n return planet;\n }", "public List<Plane...
[ "0.6596835", "0.64581156", "0.60708815", "0.6027259", "0.5994481", "0.58679974", "0.5620886", "0.5518349", "0.5431397", "0.5393265", "0.538897", "0.534997", "0.53117996", "0.5264545", "0.5243326", "0.52167034", "0.51890385", "0.5176214", "0.514661", "0.51170206", "0.5082644",...
0.7157904
0
Instantiates a new criterion entry.
public ExternalDocumentEntry() { super(CDAFactory.eINSTANCE.createExternalDocument()); this.getMdht().getTemplateIds() .add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.1.36")); this.getMdht().setClassCode(ActClassDocument.DOC); this.getMdht().setMoodCode(ActMood.EVN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static CreationEntry createSimpleEntry(int aPrimarySkill, int aObjectSource, int aObjectTarget, int aObjectCreated, boolean depleteSource, boolean depleteTarget, float aPercentageLost, boolean depleteEqually, boolean aCreateOnGround, int aCustomCreationCutOff, double aMinimumSkill, CreationCategories aCateg...
[ "0.5892874", "0.57654756", "0.56774586", "0.5634083", "0.5586621", "0.5579049", "0.5490071", "0.54777086", "0.54739803", "0.5466958", "0.5463326", "0.5462918", "0.5454926", "0.54171735", "0.5366101", "0.5363178", "0.5336755", "0.5330192", "0.5330192", "0.53301835", "0.5321808...
0.0
-1
Instantiates a new criterion entry.
public ExternalDocumentEntry( org.openhealthtools.mdht.uml.cda.ExternalDocument externalReference) { super(externalReference); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static CreationEntry createSimpleEntry(int aPrimarySkill, int aObjectSource, int aObjectTarget, int aObjectCreated, boolean depleteSource, boolean depleteTarget, float aPercentageLost, boolean depleteEqually, boolean aCreateOnGround, int aCustomCreationCutOff, double aMinimumSkill, CreationCategories aCateg...
[ "0.5892874", "0.57654756", "0.56774586", "0.5634083", "0.5586621", "0.5579049", "0.5490071", "0.54777086", "0.54739803", "0.5466958", "0.5463326", "0.5462918", "0.5454926", "0.54171735", "0.5366101", "0.5363178", "0.5336755", "0.5330192", "0.5330192", "0.53301835", "0.5321808...
0.0
-1
one id can be provided
public Identificator getId() { Identificator id = null; if ((getMdht().getIds() != null) && (getMdht().getIds().size() > 0)) { id = new Identificator(getMdht().getIds().get(0)); } return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "public void setId(int id){ this.id = id; }", "public void setID(String id){\n this.id = id;\n }", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }",...
[ "0.7414571", "0.7326482", "0.73204035", "0.728184", "0.72053176", "0.72053176", "0.7171675", "0.7084579", "0.7084579", "0.706377", "0.7054895", "0.70423466", "0.70423466", "0.7007279", "0.6991791", "0.698788", "0.698788", "0.698788", "0.698788", "0.698788", "0.698788", "0.6...
0.0
-1
Gets the narrative text for the reference.
public String getReferenceNarrativeText() { if ((this.getMdht().getText() != null) && (this.getMdht().getText().getText() != null)) { return this.getMdht().getText().getText(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TextWithReferences getTextWithReferences();", "@Override\n public String getText(Object object) {\n String label = ((Reference)object).getName();\n return label == null || label.length() == 0 ?\n getString(\"_UI_Reference_type\") :\n getString(\"_UI_Reference_type\") + \" \" + label;\n }", "p...
[ "0.658477", "0.64111733", "0.6394869", "0.6387471", "0.63291925", "0.6316659", "0.6316659", "0.63018584", "0.63018584", "0.62968117", "0.62671274", "0.62101775", "0.62049973", "0.6199648", "0.6197073", "0.61940175", "0.618964", "0.61592144", "0.6138579", "0.61350465", "0.6135...
0.8563752
0
Gets the url for the reference.
public String getReferenceUrl() { if ((this.getMdht().getText() != null) && (this.getMdht().getText().getReference() != null)) { return this.getMdht().getText().getReference().getValue(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "public String getURL() {\n\t\treturn prop.getProperty(\"URL\");\n\t}", "public final String getUrl() {\n return properties.get(URL_PROPERTY);\n }", "@Schema(description = \"Link to get this item\")\n public String getUrl() {...
[ "0.72877663", "0.7225614", "0.72042286", "0.7191793", "0.7185918", "0.7173457", "0.7173457", "0.71667874", "0.71549183", "0.7143246", "0.71006906", "0.71002847", "0.708858", "0.70617443", "0.7046611", "0.70133024", "0.70133024", "0.698944", "0.698944", "0.698944", "0.6981676"...
0.7731569
0
one id can be provided
public void setId(Identificator id) { this.getMdht().getIds().clear(); if (id != null) { this.getMdht().getIds().add(id.getIi()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "public void setId(int id){ this.id = id; }", "public void setID(String id){\n this.id = id;\n }", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }",...
[ "0.7414571", "0.7326482", "0.73204035", "0.728184", "0.72053176", "0.72053176", "0.7171675", "0.7084579", "0.7084579", "0.706377", "0.7054895", "0.70423466", "0.70423466", "0.7007279", "0.6991791", "0.698788", "0.698788", "0.698788", "0.698788", "0.698788", "0.698788", "0.6...
0.0
-1
Sets the text reference.
public void setReference(String value, String narrativeText) { this.getMdht().setText(Util.createReference(value, narrativeText)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void setReferenceText(String reference) {\n\t\tgetRoot().setText(CoreDataTypeHelpers.createEDWithReference(reference));\n\t}", "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "public void setText(String text)\n\t{\n\t\tthis.text = text;\n\t}", "public void setText(St...
[ "0.7904168", "0.737174", "0.70941573", "0.70941573", "0.70909655", "0.70764524", "0.70713896", "0.70713896", "0.70713896", "0.70691574", "0.705905", "0.7039602", "0.70278", "0.7005279", "0.7005279", "0.7005279", "0.7005279", "0.7005279", "0.7005279", "0.7005279", "0.6999899",...
0.7373215
1
1. make an array of 5 Strings
public static void main(String[] args) { String[] names = new String[5]; names[0]="Bob"; names[1]="Jeff"; names[2]="Sam"; names[3]="Mason"; names[4]="Jack"; //2. print the third element in the array System.out.println(names[2]); //3. set the third element to a different value names[2]="Rick"; //4. print the third element again System.out.println(names[2]); //5. use a for loop to print all the values in the array // BE SURE TO USE THE ARRAY'S length VARIABLE for (int i = 0; i < names.length; i++) { System.out.println(names[i]); } //6. make an array of 50 integers int[] counters = new int[50] ; Random r = new Random(); //7. use a for loop to make every value of the integer array a random number for (int i = 0; i < counters.length; i++) { counters[i]= r.nextInt(50); } //8. without printing the entire array, print only the smallest number in the array int smallest = counters[0]; for (int i = 0; i < counters.length; i++) { if(smallest>counters[i]) { smallest=counters[i]; } System.out.println(counters[i]); } System.out.println(smallest); //9 print the entire array to see if step 8 was correct //10. print the largest number in the array. int largest = counters[0]; for (int i = 0; i < counters.length; i++) { if(largest<counters[i]) { largest=counters[i]; } } System.out.println(largest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stringObject(){\n\n String s1[] = new String[5];\n\n s1[0] = \"A1\";\n s1[1] = \"A2\";\n s1[2] = \"A3\";\n s1[3] = \"A4\";\n s1[4] = \"A5\";\n\n for(int i=0; i < s1.length; i++){\n System.out.println(\"s1[\" + i + \"] = \" + s1[i]);\n\n ...
[ "0.67670757", "0.6662818", "0.66011935", "0.6350539", "0.6299632", "0.62401116", "0.6228285", "0.6216742", "0.6213391", "0.62108564", "0.6201113", "0.6131302", "0.6110208", "0.60881877", "0.6075369", "0.60366917", "0.6029954", "0.6020436", "0.5985632", "0.5972385", "0.586627"...
0.0
-1
Devuelve el tipo de IVA del producto
public IVA getIva() { return iva; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType xgetProductType();", "public String getType() {\r\n\t\treturn productType;\r\n\t}", "public IProduto getCodProd();", "String productKind();", "x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType.Enum getProductType();", "publ...
[ "0.63963705", "0.6282003", "0.61990845", "0.6165504", "0.60893756", "0.6031012", "0.6028247", "0.6016618", "0.5976386", "0.58996767", "0.5896415", "0.5871282", "0.58469456", "0.5829614", "0.58244216", "0.58125466", "0.58125466", "0.57420146", "0.57193524", "0.5706483", "0.568...
0.5345812
69
Establece el tipo de IVA
private void setIva(IVA iva) throws IvaInvalidoException { if (iva == null) { throw new IvaInvalidoException("El IVA debe ser válido."); } this.iva = iva; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTipoInmueble(Valor tipoInmueble) {\n this.tipoInmueble = tipoInmueble;\n }", "public IVA getIva() {\n return iva;\n }", "public String getViptype() {\n return viptype;\n }", "Object getTipo();", "private int getTipo(String _type) {\n\t\tif (_type.equals(TAG_CELL_TYPE_...
[ "0.6442789", "0.63390094", "0.6161444", "0.6157023", "0.60478884", "0.59316033", "0.5931533", "0.5923432", "0.59183687", "0.59140545", "0.59140545", "0.590438", "0.59026694", "0.5898252", "0.58767617", "0.58180124", "0.58015627", "0.5781874", "0.57589066", "0.5749205", "0.573...
0.58040386
16
Getter precio de compra
public double getPrecioCompra() { return precioCompra; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ComponenteCosto getComponenteCosto()\r\n/* 68: */ {\r\n/* 69: 91 */ return this.componenteCosto;\r\n/* 70: */ }", "private prestarComputador obtenerComputador() {\n String d = dFormat.format(TXTFechaDeEntrega.getDate());\n prestarComputador elcomputador = new prestarComputad...
[ "0.69318646", "0.68780154", "0.67832434", "0.676848", "0.66431373", "0.65888494", "0.649607", "0.6448788", "0.64306813", "0.641247", "0.6389084", "0.6381059", "0.6378677", "0.63602453", "0.63581103", "0.6352698", "0.6341879", "0.63338715", "0.63205063", "0.62993777", "0.62835...
0.72004986
0
Setter de precio de compra en el que se controla que el precio de compra no sea negativo
private void setPrecioCompra(double precioCompra) throws PrecioCompraNegativoException { if (precioCompra < 0) throw new PrecioCompraNegativoException("El precio de compra no puede ser negativo."); this.precioCompra = precioCompra; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPrecioVenta(double precioVenta) throws PrecioVentaNegativoException {\n if (precioVenta < 0)\n throw new PrecioVentaNegativoException(\"El precio de venta no puede ser negativo.\");\n this.precioVenta = precioVenta;\n }", "public void setPricePerSquareFoot(double newPricePerSquareFoot...
[ "0.6504442", "0.64030915", "0.6396143", "0.6387171", "0.637055", "0.6340185", "0.62777066", "0.6238101", "0.6236165", "0.6140335", "0.61284876", "0.6106877", "0.6084995", "0.6077252", "0.60622215", "0.6038498", "0.59814924", "0.59611315", "0.59512174", "0.59377635", "0.591564...
0.7443248
0
Getter precio de venta
public double getPrecioVenta() { return precioVenta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPrecio(){\n return precio;\n }", "public int getPesoV() \r\n\t\t{\r\n\t\t\treturn PesoV;\r\n\t\t}", "public double obtenerPrecio() {\n return precio;\n }", "public float getPrecio() {\r\n return precio;\r\n }", "String getPrecio();", "public double getPrecio() {\n ...
[ "0.82927346", "0.7791202", "0.77598745", "0.7741481", "0.7699125", "0.7676923", "0.7633457", "0.7584889", "0.7536277", "0.7511841", "0.74501204", "0.7443947", "0.7440363", "0.73855793", "0.73855793", "0.7351199", "0.73133975", "0.7110491", "0.70996696", "0.7091167", "0.707936...
0.8608808
0
Setter precio de venta en el que se controla que el precio de venta no sea negativo
private void setPrecioVenta(double precioVenta) throws PrecioVentaNegativoException { if (precioVenta < 0) throw new PrecioVentaNegativoException("El precio de venta no puede ser negativo."); this.precioVenta = precioVenta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPrecio(float precio) {\r\n this.precio = precio;\r\n }", "public void setPrecio(int precio) {\r\n\t\tthis.precio = precio;\r\n\t}", "private void setPrecioCompra(double precioCompra) throws PrecioCompraNegativoException {\n if (precioCompra < 0)\n throw new PrecioCompraNegativo...
[ "0.6815965", "0.6732846", "0.6708984", "0.661247", "0.6589082", "0.6550953", "0.6485617", "0.6352273", "0.6329473", "0.6311042", "0.6239513", "0.6227922", "0.6174822", "0.6145231", "0.612736", "0.6122811", "0.6113451", "0.61097246", "0.61044747", "0.610133", "0.60939026", "...
0.7751366
0
Setter de stock en el que se controla que el stock no sea negativo
private void setStock(int stock) throws StockNegativoException { if (stock < 0) throw new StockNegativoException("El stock no puede ser negativo."); this.stock = stock; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean updateStock(int quant) {\n\t\treturn false;\n\t}", "public void setStock(int stock) {\n this.stock = stock;\n }", "public void setStock(int stock) {\n this.stock = stock;\n }", "public void setStock(Integer stock) {\n this.stock = stock;\n }", "publ...
[ "0.69623405", "0.6776985", "0.6776985", "0.6738666", "0.67226285", "0.65668714", "0.654542", "0.6476988", "0.64654875", "0.63255686", "0.63213336", "0.6271611", "0.6271611", "0.62442464", "0.6218676", "0.61985606", "0.6116546", "0.60931313", "0.6043537", "0.6033654", "0.60012...
0.8043651
0
ApplicationContext context = new ClassPathXmlApplicationContext("configuration.xml");
@BeforeClass(alwaysRun = true) public void beforeClass() { baseConfig = PropertyLoader.newInstance().populate(BaseConfig.class); extendedWebDriver.manage().window().maximize(); extendedWebDriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); extendedWebDriver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args){\n ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n /*\n Check to see if the file exists\n File file = new File(\"src/main/java/applicationContext.xml\");\n System.out.println(file.exists(...
[ "0.68689525", "0.66262007", "0.6547543", "0.6497489", "0.6477103", "0.6469593", "0.64296323", "0.6278141", "0.627218", "0.62137365", "0.6174788", "0.61571324", "0.61546296", "0.6154513", "0.61464345", "0.6139055", "0.6116318", "0.61154985", "0.60851187", "0.60796493", "0.6026...
0.0
-1
This interface sets methods used by a UserContent Object
public interface UserContent { public String getURL(); public String getID(); public void setURL(String URL); public void setID(String ID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setContentObject(Object object);", "public abstract void setContent(Object o);", "private void setUserData(){\n }", "public synchronized void setContent(Object content) {\n // nothing\n }", "public interface UserProfileView {\r\n\r\n void setAboutMe(String aboutMe);\r\n...
[ "0.64012945", "0.62295127", "0.59505963", "0.5904618", "0.59030515", "0.5882063", "0.58803153", "0.58719486", "0.5861193", "0.5825143", "0.57922673", "0.57670736", "0.573969", "0.573196", "0.57313454", "0.5719534", "0.56751466", "0.56748104", "0.56401694", "0.5639096", "0.563...
0.7275029
0
hotel.getRooms().stream().filter(room > room.getBookings().stream() .anyMatch(booking > booking.getClientCode() == clientCode && booking.isActive())).findFirst();
public Optional<Booking> findClientActiveBooking(int clientCode) { for (Room room : hotel.getRooms()) { for (Booking booking : room.getBookings()) { if (booking.getClientCode() == clientCode && booking.isActive()) { return Optional.of(booking); } } } return Optional.empty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Appointment> getAppointmentByStatus(AppointmentStatus a){\n List<Appointment> appList = new ArrayList();\n try{\n appointments.stream().filter((app) -> (app.getStatus()==a)).forEachOrdered((app) -> {\n appList.add(app);\n });\n return appList;\n...
[ "0.5584621", "0.556784", "0.55280876", "0.5274865", "0.5260311", "0.521304", "0.51604164", "0.5067801", "0.49666843", "0.4958298", "0.4950058", "0.49487737", "0.493667", "0.4912274", "0.4901992", "0.48909512", "0.48386723", "0.48363087", "0.47994605", "0.47698626", "0.4759152...
0.69752574
0
Constructs a Scanner for input from the console.
public Ch12Ex1to9() { scan = new Scanner( System.in ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ConsoleScanner() {}", "public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}", "public Menu() {\n scanner = new Scanner(System.in);\n }", "public Ui() {\n this.scanner = new Scanner(System.in);\n }", "public Ui() {\n this.scanner = new Scanner(System.in)...
[ "0.7679628", "0.73641104", "0.7144629", "0.6991727", "0.6991727", "0.6892135", "0.6863805", "0.6863805", "0.6814603", "0.6776605", "0.6564853", "0.651814", "0.6506444", "0.6431977", "0.6383405", "0.6333323", "0.62605554", "0.62468827", "0.62176657", "0.62101084", "0.6177626",...
0.61801434
20
Constructs a Scanner to evaluate passed input (used for testing).
public Ch12Ex1to9( String str ) { scan = new Scanner( str ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Scanner(java.io.InputStream in) {\r\n this(new java.io.InputStreamReader(in));\r\n }", "public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}", "public Scanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public Scanner(java.io.InputStream in) {...
[ "0.67595524", "0.6731651", "0.67129594", "0.67129594", "0.6556401", "0.64397925", "0.63161576", "0.62522614", "0.6245106", "0.62130827", "0.62130827", "0.62130827", "0.62130827", "0.62130827", "0.62130827", "0.62130827", "0.62130827", "0.62028503", "0.6168102", "0.61573267", ...
0.0
-1
Calculate discounted price of item.
public void discountPrices() { System.out.print( "Enter amount of purchases: " ); int cost = scan.nextInt(); int discount = cost - cost / 10; if ( cost > 1000 ) { System.out.print( "Discounted price: " + discount ); } else { System.out.print( "Discounted price: " + cost ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getDiscountedPrice(double itemPrice);", "public double discountedPrice (){\n return basePrice - basePrice * discountRate;\n }", "public double applyDiscount(){\n SaleDTO saleDTO = sale.createSaleDTO();\n List<DiscountDTO> itemDiscounts=dc.findDiscounts(saleDTO,new ItemDiscount...
[ "0.84056485", "0.79828244", "0.7819291", "0.76256925", "0.7577455", "0.7551225", "0.75309193", "0.731896", "0.7276604", "0.72732335", "0.7267618", "0.7195236", "0.710067", "0.7068082", "0.70604146", "0.70490307", "0.70300424", "0.7022139", "0.6925713", "0.6901843", "0.6889502...
0.0
-1
Total cost of materials.
public void orderChecker() { System.out.print( "Number of bolts: " ); int bolts = scan.nextInt(); System.out.print( "Number of nuts: " ); int nuts = scan.nextInt(); System.out.print( "Number of washers: " ); int washers = scan.nextInt(); if ( nuts >= bolts ) { if ( washers >= 2 * bolts ) { System.out.println( "Check the Order: Order is OK." ); } else { System.out.println( "Check the Order: Too few washers." ); } } else { System.out.println( "Check the Order: Too few nuts." ); if ( ( washers < 2 * bolts ) ) { System.out.println( "Check the Order: Too few washers." ); } } final int boltPrice = 5; final int nutPrice = 3; final int washerPrice = 1; int cost = boltPrice * bolts + nutPrice * nuts + washerPrice * washers; System.out.println( "Total cost: " + cost ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getTotal() {\n return totalCost;\n }", "public double getTotalCost() {\r\n\t\treturn cost;\r\n\t}", "public double getTotalCost() {\n cost = spr.calculateCost();\n return cost;\n }", "public double getTotalCost() {\r\n return totalCost;\r\n }", "@Override\r\n\tp...
[ "0.75116134", "0.74123895", "0.7375955", "0.7352688", "0.7311897", "0.7236697", "0.722021", "0.7211604", "0.71976525", "0.71703213", "0.7106546", "0.7065222", "0.7009391", "0.6926238", "0.6925217", "0.6923177", "0.6911327", "0.6908921", "0.68897235", "0.68826145", "0.68814087...
0.0
-1
Program that helps decide if driver needs gas or not.
public void lastChanceGas() { System.out.print( "Tank capacity: " ); int capacity = scan.nextInt(); System.out.print( "Gage reading: " ); int gage = scan.nextInt(); System.out.print( "Miles per gallon: " ); int mpg = scan.nextInt(); double gasLeft = capacity * ( gage * 0.01 ); double milesDriveable = gasLeft * mpg; if ( milesDriveable >= 200 ) { System.out.println( "Safe to Proceed!" ); } else { System.out.println( "Get Gas!" ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:24:54.441 -0400\", hash_original_method = \"1010518D3DB50B5D3F092DFF8F5EA0A4\", hash_generated_method = \"654DD58672DC42C6BDE5C6ADE3A22CF1\")\n \n public static boolean startDriverCommand(){\n \tdouble taintD...
[ "0.5701274", "0.55835056", "0.5553162", "0.54939073", "0.5485782", "0.5421624", "0.54087186", "0.53981185", "0.53868794", "0.53514224", "0.5347286", "0.5328077", "0.5322269", "0.5275935", "0.5274336", "0.52586174", "0.52524984", "0.5246883", "0.5232393", "0.52286136", "0.5221...
0.59244883
0
Program that calculates the wind chill index (WCI).
public void windChillIndex() { System.out.print( "Enter the damn wind speed: " ); double v = scan.nextDouble(); System.out.print( "Enter the darn temperature: " ); double t = scan.nextDouble(); double wci; if ( 0 <= v && v <= 4 ) { wci = t; System.out.println( "The wind chill index is: " + wci ); } if ( v >= 45 ) { wci = 1.6 * t - 55; System.out.println( "The wind chill index is: " + wci ); } wci = 91.4 + ( 91.4 - t ) * ( 0.0203 * v - 0.304 * Math.sqrt( (double)v ) - 0.474 ); System.out.println( "The wind chill index is: " + wci ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getWindChill() {\n float tempC;\n float windSpeed;\n double windChill = 0;\n double windChillr = 0;\n\n\n if (readings.size() > 0) {\n tempC = readings.get(readings.size() - 1).temperature;\n windSpeed = readings.get(readings.size() - 1).windSp...
[ "0.6135505", "0.60259086", "0.5850188", "0.55997974", "0.5587272", "0.55252", "0.55150265", "0.55027723", "0.5499636", "0.5447766", "0.54455215", "0.5405443", "0.5386814", "0.5385485", "0.5383805", "0.53749114", "0.5363942", "0.5363245", "0.5329857", "0.5328931", "0.5298936",...
0.7273704
0
Program that calculates your age in seconds.
public void yourAgeInSeconds() { System.out.print( "Enter your goddamn age in years: " ); long years = scan.nextLong(); long yearDays = 365 * years; System.out.print( "Enter month number: " ); long months = scan.nextLong(); long monthDays = 0; if ( months > 0 ) // 1 month { monthDays = 31; { if ( months > 1 ) // 2 months { monthDays = monthDays + 28; if ( months > 2 ) // 3 months { monthDays = monthDays + 31; if ( months > 3 ) { monthDays = monthDays + 30; if ( months > 4 ) { monthDays = monthDays + 31; if ( months > 5 ) { monthDays = monthDays + 30; if ( months > 6 ) { monthDays = monthDays + 31; if ( months > 7 ) { monthDays = monthDays + 31; if ( months > 8 ) { monthDays = monthDays + 30; if ( months > 9 ) { monthDays = monthDays + 31; if ( months > 10 ) { monthDays = monthDays + 30; if ( months > 11 ) { monthDays = monthDays + 31; } } } } } } } } } } } } } System.out.print( "Enter the day number: " ); long days = scan.nextLong(); long totalDays = yearDays + monthDays + days; long seconds = totalDays * 24 * 60 * 60; System.out.println( "Your are " + seconds + " seconds old." ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void calculateTheAge (int birthYear){\n int age = 2021 - birthYear;\n System.out.println(\"The person is \" + age + \" years old\");\n }", "private int calculateAge() {\n\t\treturn LocalDate.now().getYear() - this.birthYear;\n\t}", "public int age(){\r\n\t\t//1000 ms = 1s, 60s = ...
[ "0.71573675", "0.70702815", "0.7062131", "0.70583045", "0.6870772", "0.6590686", "0.65828574", "0.65776986", "0.6567088", "0.6535885", "0.6517296", "0.6468443", "0.6368599", "0.6359714", "0.6359714", "0.6359714", "0.6352977", "0.63497436", "0.6293389", "0.6259122", "0.6231803...
0.78036034
0
Program that determines the price of a movie ticket
public void matineeMovieTickets() { System.out.print( "Enter your age: " ); double age = scan.nextDouble(); System.out.print( "Enter the 24-hour clock time: " ); double time = scan.nextDouble(); double price; if ( age <= 13 ) { price = 4.00; if ( time < 1700 ) { price = 2.00; } System.out.println( "The ticket price is $" + price ); } if ( age > 13 ) { price = 8.00; if ( time < 1700 ) { price = 5.00; } System.out.println( "The ticket price is $" + price ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getPrice(Movie movie, double time);", "public Double calcMovieRentalPrice(Integer unitPrice, Integer numOfDays, String videoReleaseYear);", "public static void main(String[] args) \n\t{\n\t\tString choiceTheKingsman2;\n\t\tString theKingsman2Info; \n\t\tDouble kingsman2Cost = 3.00;\n\t\tString ch...
[ "0.7598939", "0.72347784", "0.67460555", "0.66450036", "0.65566134", "0.6472819", "0.63864243", "0.6234903", "0.6168376", "0.6139632", "0.61069304", "0.6091108", "0.6084928", "0.60696703", "0.6067765", "0.60206467", "0.5979592", "0.5978621", "0.5971704", "0.5959092", "0.58822...
0.6576715
4
Testing method: instantiates a Lesson15Exercises object and then invokes each method.
public static void main( String[] args ) { Scanner kbd = new Scanner( System.in ); boolean done = false; Ch12Ex1to9 exercise = new Ch12Ex1to9(); do { System.out.println(); System.out.println(); System.out.println( "Make a selection" ); System.out.println(); System.out.println( " (1) Discount Prices" ); System.out.println( " (2) Order Checker" ); System.out.println( " (3) Last Chance Gas" ); System.out.println( " (4) Ground Beef Value Calculator" ); System.out.println( " (5) Y2K Problem Detector" ); System.out.println( " (6) Wind Chill Index" ); System.out.println( " (7) Your Age in Seconds" ); System.out.println( " (8) Matinee Movie Tickets" ); System.out.println( " (9) Midnight Madness" ); System.out.println( " (Q) Quit" ); System.out.println(); System.out.print( "Enter a choice: " ); String response = kbd.nextLine(); if ( response.length() > 0 ) { System.out.println(); switch ( response.charAt( 0 ) ) { case '1': exercise.discountPrices(); break; case '2': exercise.orderChecker(); break; case '3': exercise.lastChanceGas(); break; case '4': exercise.groundBeefValueCalc(); break; case '5': exercise.y2KProblemDetector(); break; case '6': exercise.windChillIndex(); break; case '7': exercise.yourAgeInSeconds(); break; case '8': exercise.matineeMovieTickets(); break; case '9': exercise.midnightMadness(); break; default: if ( response.toLowerCase().charAt( 0 ) == 'q' ) { done = true; } else { System.out.print( "Invalid Choice" ); } break; } } } while ( !done ); System.out.println( "Goodbye!" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runExercises() throws IOException {\n System.out.println(\"JDK 8 Lambdas and Streams MOOC Lesson 2\");\n System.out.println(\"Running exercise 1 solution...\");\n exercise1();\n System.out.println(\"Running exercise 2 solution...\");\n exercise2();\n System.out...
[ "0.69883573", "0.6810039", "0.67509425", "0.6627556", "0.66080964", "0.6493628", "0.6484517", "0.6478026", "0.6425052", "0.6383311", "0.6365542", "0.6343816", "0.6321825", "0.622515", "0.62187564", "0.6205069", "0.619419", "0.60774", "0.6060614", "0.60601765", "0.59847075", ...
0.0
-1
Note: this assumes all data is on Sheet zero
public String toJson() { StringBuilder sb = new StringBuilder(); //With resources try-catch should auto close //TODO: Might be fun to throw garbage at this just to confirm try (FileInputStream fis = new FileInputStream(excelFile)) { XSSFWorkbook workBook = new XSSFWorkbook(fis); XSSFSheet sheet = workBook.getSheetAt(0); Iterator<Row> rowIterator = sheet.iterator(); List<List<String>> sheetDataTable = loadSheetDataTable(sheet); sb.append(exportJSONStringFromSheetData(sheetDataTable)); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void importData() {\n Sheet sheet;\n Row row;\n int lastRowNum;\n // Discover how many sheets there are in the workbook....\n int numSheets = this.workbook.getNumberOfSheets();\n // and then iterate through them.\n for (int i = 0; i < numSheets; i++) {\n\n ...
[ "0.6184672", "0.61520064", "0.5995145", "0.5956301", "0.58001125", "0.57573664", "0.5742857", "0.5729039", "0.5711097", "0.56528217", "0.5649965", "0.5616082", "0.55942476", "0.5572859", "0.555776", "0.555755", "0.552094", "0.5519198", "0.54580826", "0.5444745", "0.5437646", ...
0.0
-1
/ Return sheet data in a two dimensional list. Each element in the outer list is represent a row, each element in the inner list represent a column. The first row is the column name row.
private static List<List<String>> loadSheetDataTable(XSSFSheet sheet) { List<List<String>> ret = new ArrayList<List<String>>(); // Get the first and last sheet row number. int firstRowNum = sheet.getFirstRowNum(); int lastRowNum = sheet.getLastRowNum(); if (lastRowNum > 0) { // Loop in sheet rows. for (int i = firstRowNum; i < lastRowNum + 1; i++) { // Get current row object. Row row = sheet.getRow(i); // Get first and last cell number. int firstCellNum = row.getFirstCellNum(); int lastCellNum = row.getLastCellNum(); // Create a String list to save column data in a row. List<String> rowDataList = new ArrayList<String>(); // Loop in the row cells. for (int j = firstCellNum; j < lastCellNum; j++) { // Get current cell. Cell cell = row.getCell(j); // Get cell type. CellType cellType = cell.getCellType(); if (cellType == CellType.NUMERIC) { double numberValue = cell.getNumericCellValue(); // BigDecimal is used to avoid double value is counted use Scientific counting method. // For example the original double variable value is 12345678, but jdk translated the value to 1.2345678E7. String stringCellValue = BigDecimal.valueOf(numberValue).toPlainString(); rowDataList.add(stringCellValue); } else if (cellType == CellType.STRING) { String cellValue = cell.getStringCellValue(); rowDataList.add(cellValue); } else if (cellType == CellType.BOOLEAN) { boolean numberValue = cell.getBooleanCellValue(); String stringCellValue = String.valueOf(numberValue); rowDataList.add(stringCellValue); } else if (cellType == CellType.BLANK) { rowDataList.add(""); } } // Add current row data list in the return list. ret.add(rowDataList); } } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<ArrayList<String>> readSheet(Sheet sheet)\n\t {\n\t\t if(sheet == null)\n\t\t\t return null;\n\t\t \n\t\t ArrayList<ArrayList<String>> rowValueList = new ArrayList<ArrayList<String>>();\t\n\t\t Iterator<Row> rowIterator = sheet.iterator();\t\t//Get the row iterator for the sheet\n\t\t int columnCo...
[ "0.74647546", "0.7164251", "0.6543909", "0.64829576", "0.6411747", "0.62937266", "0.6256172", "0.6192858", "0.61852986", "0.61836195", "0.6167401", "0.6127401", "0.6063377", "0.60577166", "0.60122913", "0.5979309", "0.5973548", "0.59646696", "0.59597415", "0.59572643", "0.594...
0.7564362
0
/ Return a JSON string from the string list.
private static String exportJSONStringFromSheetData(List<List<String>> dataTable) { String ret = ""; if(dataTable != null) { int rowCount = dataTable.size(); if(rowCount > 1) { // Create a JSONObject to store table data. JSONObject tableJsonObject = new JSONObject(); // The first row is the header row, store each column name. List<String> headerRow = dataTable.get(0); int columnCount = headerRow.size(); // Loop in the row data list. for(int i=1; i<rowCount; i++) { // Get current row data. List<String> dataRow = dataTable.get(i); // Create a JSONObject object to store row data. JSONObject rowJsonObject = new JSONObject(); for(int j=0;j<columnCount;j++) { String columnName = headerRow.get(j); String columnValue = dataRow.get(j); rowJsonObject.put(columnName, columnValue); } tableJsonObject.put("Row " + i, rowJsonObject); } // Return string format data of JSONObject object. ret = tableJsonObject.toString(); } } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getJSONfromList(List<?> list) {\n\t\tString json = null;\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\n\t\ttry {\n\t\t\tjson = mapper.writeValueAsString(list);\n\t\t} catch (JsonProcessingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tre...
[ "0.7421839", "0.7175394", "0.7136243", "0.7003975", "0.6748781", "0.6671043", "0.6602737", "0.64697933", "0.6462017", "0.63983196", "0.6374796", "0.633828", "0.6336301", "0.625969", "0.6241169", "0.6241169", "0.6241169", "0.6085714", "0.6054422", "0.60498023", "0.60298693", ...
0.0
-1
Created by Poltavets on 13.05.2016.
public interface UprazneniaAllListView { int getChoosenListPosition(); void setAdapter(Cursor cursor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpubl...
[ "0.60620165", "0.59320146", "0.57976496", "0.5714324", "0.5699367", "0.56983346", "0.5685863", "0.5685863", "0.55857986", "0.5584045", "0.55793995", "0.55632675", "0.5557114", "0.5533964", "0.55311555", "0.55238557", "0.5516587", "0.55091524", "0.5489404", "0.5484093", "0.548...
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_scrolling, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577...
0.0
-1
Creates a new basket
public Basket(String n, float ca, boolean a) { this.name = n; this.conversionAmount = ca; this.active = a; this.dateCreated = new Date(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testCreate() {\n TCreate_Return[] Baskets_create_out = basketService.create(new TCreate_Input[] { Basket_in });\n assertNoError(Baskets_create_out[0].getError());\n\n assertNull(\"No FormErrors\", Baskets_create_out[0].getFormErrors());\n assertEquals(\"created?\", true, Bas...
[ "0.74361396", "0.68775624", "0.6818581", "0.6734103", "0.6518597", "0.63371104", "0.61925656", "0.6187069", "0.6160961", "0.6160469", "0.6020492", "0.6019461", "0.60085016", "0.5917342", "0.59093255", "0.57660943", "0.5733264", "0.5681251", "0.56763834", "0.56261647", "0.5619...
0.5722003
17
Method called when plugin starts.
public void startPlugin() { // add a new ResourceChangeListener Cheops.getInstance().addResourceChangeListener(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void pluginInitialize() {}", "@Override\n protected void pluginInitialize() {\n // init();\n }", "public void onEnable()\n\t{\n\t\t//Tells the user that the plugin is starting up.\n\t\tlog.info(\"Started up.\");\n\t}", "public void onStart() {\n\t\t\n\t}", "@Override\n public void...
[ "0.78057086", "0.7693754", "0.7490136", "0.7357339", "0.73470795", "0.72514427", "0.7245425", "0.7201924", "0.7175036", "0.7118052", "0.70897824", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7087701", "0.7085926",...
0.7681256
2
Adds the ResourceChangeListener to capture changes for each new build
public void addResourceChangeListener() { if (elementChange == null) { elementChange = new JavaElementChange(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resourceChanged(IResourceChangeEvent event) {\n\n\t\tint eventType = event.getType();\n\t\tIResourceDelta delta = event.getDelta();\n\t\tswitch (eventType) {\n\t\tcase IResourceChangeEvent.POST_CHANGE:\n\t\t\tcheckProjectsAndDescriptorChanges(delta);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic v...
[ "0.6961628", "0.68122494", "0.654916", "0.6498046", "0.64934325", "0.64719796", "0.6460088", "0.6429672", "0.6383223", "0.62616867", "0.61398333", "0.61398333", "0.6121783", "0.61112314", "0.61078113", "0.6086283", "0.59864074", "0.59864074", "0.5978555", "0.5965746", "0.5892...
0.7405134
0
TODO: Implement CameraX operations Create configuration object for the viewfinder use case
private void startCamera() { PreviewConfig previewConfig = new PreviewConfig.Builder().setTargetResolution(new Size(640, 480)).build(); Preview preview = new Preview(previewConfig); preview.setOnPreviewOutputUpdateListener(output -> { ViewGroup parent = (ViewGroup) dataBinding.viewFinder.getParent(); parent.removeView(dataBinding.viewFinder); parent.addView(dataBinding.viewFinder, 0); dataBinding.viewFinder.setSurfaceTexture(output.getSurfaceTexture()); updateTransform(); }); // Create configuration object for the image capture use case // We don't set a resolution for image capture; instead, we // select a capture mode which will infer the appropriate // resolution based on aspect ration and requested mode ImageCaptureConfig imageCaptureConfig = new ImageCaptureConfig.Builder().setCaptureMode(ImageCapture.CaptureMode.MIN_LATENCY).build(); // Build the image capture use case and attach button click listener ImageCapture imageCapture = new ImageCapture(imageCaptureConfig); dataBinding.captureButton.setOnClickListener(v -> { File file = new File(getExternalMediaDirs()[0], System.currentTimeMillis() + ".jpg"); imageCapture.takePicture(file, executor, new ImageCapture.OnImageSavedListener() { @Override public void onImageSaved(@NonNull File file) { String msg = "Photo capture succeeded: " + file.getAbsolutePath(); Log.d("CameraXApp", msg); dataBinding.viewFinder.post( () -> Toast.makeText(CameraXDemo.this, msg, Toast.LENGTH_SHORT).show() ); } @Override public void onError(@NonNull ImageCapture.ImageCaptureError imageCaptureError, @NonNull String message, @Nullable Throwable cause) { String msg = "Photo capture failed: " + message; Log.e("CameraXApp", msg, cause); dataBinding.viewFinder.post( () -> Toast.makeText(CameraXDemo.this, msg, Toast.LENGTH_SHORT).show() ); } }); }); // Setup image analysis pipeline that computes average pixel luminance ImageAnalysisConfig analyzerConfig = new ImageAnalysisConfig.Builder().setImageReaderMode( ImageAnalysis.ImageReaderMode.ACQUIRE_LATEST_IMAGE).build(); // Build the image analysis use case and instantiate our analyzer ImageAnalysis analyzerUseCase = new ImageAnalysis(analyzerConfig); analyzerUseCase.setAnalyzer(executor, new LuminosityAnalyzer()); CameraX.bindToLifecycle(this, preview, imageCapture, analyzerUseCase); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n if(camera != null) {\n cameraView = new CameraView(this.getApplicationContext(), camera);\n FrameLayout camera_view = (FrameLayout)findViewById(R...
[ "0.66443", "0.6283906", "0.6099979", "0.598686", "0.59624153", "0.5930007", "0.58558327", "0.5790684", "0.57382786", "0.5709228", "0.56576014", "0.5635371", "0.5601029", "0.5591299", "0.5579194", "0.556878", "0.5553082", "0.5552504", "0.5552109", "0.5525337", "0.5512704", "...
0.53832453
26
TODO: Implement camera viewfinder transformations
private void updateTransform() { Matrix matrix = new Matrix(); float centerX = dataBinding.viewFinder.getWidth() / 2f; float centerY = dataBinding.viewFinder.getHeight() / 2f; int rotation = dataBinding.viewFinder.getDisplay().getRotation(); int rotationDegrees = 0; switch (rotation) { case Surface.ROTATION_0: rotationDegrees = 0; break; case Surface.ROTATION_90: rotationDegrees = 90; break; case Surface.ROTATION_180: rotationDegrees = 180; break; case Surface.ROTATION_270: rotationDegrees = 270; break; default: } matrix.postRotate(-rotationDegrees, centerX, centerY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Mat4x4 getMatView() {\n Mat4x4 matCameraRotX = MatrixMath.matrixMakeRotationX(cameraRot.getX());\n Mat4x4 matCameraRotY = MatrixMath.matrixMakeRotationY(cameraRot.getY());\n Mat4x4 matCameraRotZ = MatrixMath.matrixMakeRotationZ(cameraRot.getZ());\n Mat4x4 matCameraRotXY = MatrixM...
[ "0.6910589", "0.6719031", "0.6526996", "0.64978427", "0.64531475", "0.63670796", "0.62315804", "0.62314045", "0.62227136", "0.6181718", "0.6156203", "0.6096678", "0.6087292", "0.6086693", "0.6071094", "0.60559696", "0.6022353", "0.5994078", "0.5986943", "0.5974838", "0.596924...
0.7046188
0
If passed a baseUrl, context use that. If not, use the hardcoded one. This is to enable sending requests to localhost, in order to mock a stub http host that sends "fake" replies for testing.
public MovebankRequest(String baseUrl, Context context) { this.context = context; this.baseUrl = baseUrl; this.password = context.getResources().getString(R.string.movebank_password); this.username = context.getResources().getString(R.string.movebank_user); statusMap = new HashMap<Integer, Integer>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TestState baseUrl(String baseUrl) {\n this.baseUrl = baseUrl;\n return this;\n }", "public void setBaseUrl(String baseUrl) {\n this.baseUrl = baseUrl;\n }", "public void setBaseUrl(final String baseUrl) {\n this.baseUrl = baseUrl;\n }", "private String baseUrl() {\n ...
[ "0.6787251", "0.6738273", "0.6707891", "0.645689", "0.63640046", "0.62803966", "0.62342083", "0.62046915", "0.6201835", "0.61740345", "0.6163903", "0.6146672", "0.6146672", "0.6065373", "0.60028195", "0.6000466", "0.59982616", "0.59972537", "0.5985404", "0.59216624", "0.58669...
0.54715836
35
Sends a request to the Movebank API for the specified attributes
public void requestDataAsync( String attributes, RequestHandler requestHandler){ RequestQueue queue = Volley.newRequestQueue(context); String url = baseUrl+attributes; // Request a string response from the provided URL. Log.i("MovebankRequest", "sending string request to " + url); project.software.uni.positionprediction.datatypes.Request request = new project.software.uni.positionprediction.datatypes.Request(getNextRequestCode()); requestHandler.setRequest(request); StringRequest stringRequest = createStringRequest(request, url, requestHandler, requestHandler); // Add the request to the RequestQueue. queue.add(stringRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public project.software.uni.positionprediction.datatypes.Request requestDataSync(String attributes){\r\n\r\n RequestQueue queue = Volley.newRequestQueue(context);\r\n\r\n RequestFuture<String> requestFuture = RequestFuture.newFuture();\r\n\r\n String url = baseUrl+attributes;\r\n\r\n //...
[ "0.57246053", "0.5291319", "0.5285834", "0.5103011", "0.4942584", "0.48639303", "0.48052785", "0.47371045", "0.47244662", "0.47196054", "0.46977538", "0.46806034", "0.46140215", "0.46090582", "0.4595431", "0.45894545", "0.45819038", "0.45723704", "0.4552742", "0.45254815", "0...
0.48040417
7
Sends a request to the Movebank API and waits for the response This Method must never be called from the main thread.
public project.software.uni.positionprediction.datatypes.Request requestDataSync(String attributes){ RequestQueue queue = Volley.newRequestQueue(context); RequestFuture<String> requestFuture = RequestFuture.newFuture(); String url = baseUrl+attributes; // Request a string response from the provided URL. Log.i("MovebankRequest", "sending string request to " + url); project.software.uni.positionprediction.datatypes.Request request = new project.software.uni.positionprediction.datatypes.Request(getNextRequestCode()); StringRequest stringRequest = createStringRequest(request, url, requestFuture, requestFuture); // Add the request to the RequestQueue. requestFuture.setRequest(queue.add(stringRequest)); try{ String response = requestFuture.get(10, TimeUnit.SECONDS); request.setResponseStatus(statusMap.remove(new Integer(request.getId()))); request.setResponse(response); return request; } catch (InterruptedException | TimeoutException | ExecutionException e) { System.out.println(e.toString()); if(e.getCause() instanceof VolleyError) { VolleyError err = (VolleyError) e.getCause(); if(err.networkResponse != null) request.setResponseStatus(err.networkResponse.statusCode); else request.setResponseStatus(-1); } else { request.setResponseStatus(-1); } return request; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendRequest() throws IOException {\n\t\tHttpURLConnection urlConnection = getHttpURLConnection2(request.getServerUrl());\n\t\t\n\t\ttry {\n\t\t\tInputStream responseStream = null;\n\t final int serverResponseCode = urlConnection.getResponseCode();\n\t if (serverResponseCode / 100 == 2) {...
[ "0.5964188", "0.579815", "0.57201976", "0.56928253", "0.5675147", "0.56408125", "0.5609481", "0.5589509", "0.5578995", "0.5574842", "0.5405687", "0.5397854", "0.53545886", "0.53305167", "0.5328641", "0.53279805", "0.53221315", "0.5321741", "0.5309671", "0.5305198", "0.5300578...
0.0
-1
This Method return the status Code for the given Request
public static int getStatusForRequest(project.software.uni.positionprediction.datatypes.Request request){ return statusMap.remove(request.getId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getStatusCode();", "int getStatusCode();", "HttpStatusCode getStatusCode();", "int getStatusCode( );", "RequestStatus getStatus();", "public static Integer getStatusCode() {\n Response res = (Response) Serenity.getCurrentSession().get(\"apiResponse\");\n return res.then().extract().stat...
[ "0.75293905", "0.75293905", "0.74580276", "0.73976517", "0.73903954", "0.7187087", "0.71467674", "0.71031314", "0.7047012", "0.6978991", "0.68825495", "0.6850796", "0.6831498", "0.68126094", "0.67963785", "0.6737244", "0.6736035", "0.6735341", "0.67334014", "0.6728745", "0.66...
0.6711153
20
This Method returns ThreadSave a unique Code for the next Request
private synchronized int getNextRequestCode(){ return currentRequestCode++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getRequestCode() {\n return Thread.currentThread().hashCode();\n }", "private static long newId() {\n return REQUEST_ID.getAndIncrement();\n }", "public long threadId();", "private static synchronized String getNextRequestId()\n {\n if (++nextRequestId < 0)\n ...
[ "0.67684907", "0.58737516", "0.5769333", "0.5758146", "0.5706582", "0.5558166", "0.54345226", "0.5395166", "0.5390577", "0.53893965", "0.5361815", "0.53356063", "0.53335166", "0.52660525", "0.5162677", "0.51126343", "0.51044273", "0.5103375", "0.5103375", "0.5103375", "0.5079...
0.664567
1
This Method creates a StringRequest with the required headers
private StringRequest createStringRequest(final project.software.uni.positionprediction.datatypes.Request request, String url, Response.Listener<String> responseListener, Response.ErrorListener errorListener){ return new StringRequest(Request.Method.GET, url, responseListener, errorListener ) { @Override public Map <String, String> getHeaders() { HashMap< String, String > headers = new HashMap <> (); String creds = String.format("%s:%s",username,password); String encodedCredentials = Base64.encodeToString(creds.getBytes(), Base64.DEFAULT); headers.put("Authorization", "Basic " + encodedCredentials); return headers; } @Override protected Response<String> parseNetworkResponse(NetworkResponse response) { statusMap.put(new Integer(request.getId()), new Integer(response.statusCode)); return super.parseNetworkResponse(response); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RequestHeaders headers();", "protected HttpEntity createEntity(final String requestDocAsString) {\n return new StringEntity(requestDocAsString, ContentType.create(\"application/soap+xml\", \"UTF-8\"));\n }", "HttpClientRequest header(CharSequence name, CharSequence value);", "@Test\n public void...
[ "0.6079711", "0.5735902", "0.5723969", "0.56879723", "0.56703115", "0.56583333", "0.56504196", "0.56183153", "0.5595468", "0.55556947", "0.55098736", "0.5411957", "0.53864026", "0.5349512", "0.53193736", "0.52892745", "0.5278133", "0.5263384", "0.5232067", "0.5211936", "0.520...
0.6527094
0
return brain.getPlayer().isLeftSide() == brain.getFullstateInfo().LeftGotBall();
@Override public boolean CheckConditions() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isBallCollideLeftWall(GOval ball) {\n return ball.getX() <= 0;\n }", "private boolean leftCollision(InteractiveObject obj){\n\t\treturn leftUpCollision(obj) || leftDownCollision(obj);\n\t}", "public boolean isleft(){\n\t\tif (x>0 && x<Framework.width && y<Framework.height )//bullet c...
[ "0.6990788", "0.68046147", "0.6726903", "0.66499037", "0.6644608", "0.6637829", "0.6613889", "0.6550252", "0.65353715", "0.65167826", "0.6511688", "0.64760697", "0.64749116", "0.64411616", "0.6396573", "0.6374991", "0.63543785", "0.6339984", "0.63342994", "0.63254035", "0.631...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws IOException { String dir = "C:\\Projects\\packages\\jdk\\src\\"; String file = "java\\util\\ArrayList.java"; collector = new CommentCollector(new JavaFile(dir, file)); collector.parse(); for (Method method: collector.getCodeLists().methods) { if (method.getRetType() != "") { System.out.print(method.getRetType() + " "); } System.out.println(method.getId() + ":"); for (Parameter param: method.getParams()) { System.out.println( " PARAM: " + param.getType() + " " + param.getId()); } for (Variable var: method.getVariables()) { System.out.println( " VAR: " + var.getType() + " " + var.getId()); } for (Comment cmt: method.getAllComments()) { if (cmt.getTag() != null) { System.out.print(" (" + cmt.getTag() + ") "); } else { System.out.print(" "); } System.out.println(cmt.getOrigText()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Create an instance of ManagePreferences by database row id.
public ManagePreferences(Context context, long rowId) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JobPreference(Integer id) {\n super.id=id;\n }", "public ManagePreferences(Context context, String contactId, String contactLookupKey) {\n }", "@Override\n\tpublic UserPreferences newInstance() {\n\t\treturn new UserPreferences();\n\t}", "PrimaryKey createPrimaryKey();", "MrpConfigSetti...
[ "0.5306073", "0.52133363", "0.51780784", "0.5149235", "0.50414985", "0.5033291", "0.48966813", "0.4846379", "0.48332292", "0.47872585", "0.47614285", "0.4730369", "0.4688939", "0.46878654", "0.4686576", "0.46853164", "0.46717748", "0.46702763", "0.46702763", "0.46702763", "0....
0.7507119
0
Create an instance of ManagePreferences by contact lookup key.
public ManagePreferences(Context context, String contactId, String contactLookupKey) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ManagePreferences(Context context, long rowId) {\n }", "public static MethodHandles.Lookup createLookup(Class<?> clazz, int mode)\n {\n return constructor.invokeWith(clazz, mode);\n }", "public static EcidContact doLookup(Context ctx, String number, int numberType)\n {\n Log.d(...
[ "0.458045", "0.4567375", "0.4560135", "0.44616866", "0.44444847", "0.44138", "0.4385253", "0.43416542", "0.43148687", "0.43063527", "0.4298246", "0.42758608", "0.42534918", "0.42495355", "0.4199497", "0.4197741", "0.41877964", "0.41729096", "0.4168091", "0.41643208", "0.41581...
0.77653706
0
The entire line below reserved word and following expression is a statement:
public static void main(String[] args) { int myVariable = 50; // Basically, any complete "phrase" in Java -- ending with a semicolon -- is a statement. myVariable++; System.out.println("This is a statement too."); if(myVariable < 100) System.out.println("This entire two-line grouping is another statement."); // Multiple statements can be written on the same line, though it is not considered good form: int thisVar = 5; String thatVar = "Nasty hobbitses..."; System.out.println(thatVar); // Whitespace is (generally) ignored in Java. Whether you have 1 space or 5000 spaces, // Java doesn't care. What it does care about is separating things like keywords and // labels -- for the most part, there must be at least one space between alphanumeric // entities. int theOtherVar=99; // Legal int anotherVar = 100; // Legal intyetAnotherVar=101; // Not legal, space needed between 'int' & variable name // Again, generally speaking, spaces are optional between operands and operators. int firstNum=(234+567); // Legal int secondNum = ( 890 + 123 ); // Legal // Indentation is something that you use to make your code more readable, and assist others // in deciphering the flow of the program. Review your company's style guide or coding // standards and ensure that you are following procedures. // Most IDE's do the indentation for you, and there are "reformat" options in the IDE's // themselves to set things straight if you mess up. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mo44053a() {\n }", "public void mo9233aH() {\n }", "public void m23075a() {\n }", "public void mo23813b() {\n }", "private void m50366E() {\n }", "public void mo21792Q() {\n }", "public void mo2740a() {\n }", "public void mo12930a() {\n }", "public void mo381...
[ "0.5983025", "0.5968241", "0.5878941", "0.5876367", "0.5844575", "0.58296466", "0.5798523", "0.57895553", "0.57829154", "0.5769673", "0.5758229", "0.5728431", "0.5712035", "0.56954", "0.5658302", "0.56385183", "0.5637727", "0.56320214", "0.5624227", "0.5621769", "0.56178415",...
0.0
-1
This method creates and returns a connection to my cse database. The url, my username, and password are stored in another class.
public static Connection getConnection() { String DRIVER_CLASS = "com.mysql.cj.jdbc.Driver"; try { Class.forName(DRIVER_CLASS).getDeclaredConstructor().newInstance(); } catch(Exception e) { throw new RuntimeException(e); } java.sql.Connection conn = null; try { conn = DriverManager.getConnection(DatabaseInfo.url, DatabaseInfo.username, DatabaseInfo.password); } catch (SQLException e) { throw new RuntimeException(e); } return conn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Connection connection()\n {\n String host = main.getConfig().getString(\"db.host\");\n int port = main.getConfig().getInt(\"db.port\");\n String user = main.getConfig().getString(\"db.user\");\n String password = main.getConfig().getString(\"db.password\");\n String db ...
[ "0.77343297", "0.7669221", "0.76398647", "0.7532895", "0.7528243", "0.7525775", "0.7502176", "0.74922925", "0.7475282", "0.7468963", "0.7457923", "0.7453334", "0.740731", "0.7381222", "0.7357819", "0.73484474", "0.73427445", "0.7340212", "0.7335137", "0.7334938", "0.7330697",...
0.7162574
49
This method checks that the given Connection, PreparedStatement, and ResultSet are not null, and then closes them. It is intended for "get" methods that return something.
public static void close(Connection conn, PreparedStatement ps, ResultSet rs) { try { if(rs != null && !rs.isClosed()) { rs.close(); } if(ps != null && !ps.isClosed()) { ps.close(); } if(conn != null && !conn.isClosed()) { conn.close(); } } catch (SQLException e) { throw new RuntimeException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void closing(Connection connection, PreparedStatement preparedStatement, ResultSet rs) {\n try {\n if (rs != null) {\n rs.close();\n preparedStatement.close();\n connection.close();\n }\n } catch (SQLException sq...
[ "0.7171285", "0.70926255", "0.7031424", "0.7009813", "0.6947499", "0.69356465", "0.6921806", "0.6907407", "0.6905031", "0.68981546", "0.68581223", "0.68465096", "0.68252903", "0.68024933", "0.67948824", "0.67818475", "0.6770719", "0.6751524", "0.6724797", "0.6718739", "0.6689...
0.6792979
15
This method checks that the given Connection and PreparedStatement are not null, and then closes them. It is intended for "insert" methods that don't return anything, these are not yet implemented.
public static void close(Connection conn, PreparedStatement ps) { try { if(ps != null && !ps.isClosed()) { ps.close(); } if(conn != null && !conn.isClosed()) { conn.close(); } } catch (SQLException e) { throw new RuntimeException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void closing(Connection connection, PreparedStatement preparedStatement, ResultSet rs) {\n try {\n if (rs != null) {\n rs.close();\n preparedStatement.close();\n connection.close();\n }\n } catch (SQLException sq...
[ "0.68288916", "0.6803542", "0.66732", "0.6665013", "0.6626564", "0.6583309", "0.65444773", "0.6514784", "0.6500658", "0.64986455", "0.6387501", "0.63703823", "0.63549894", "0.63074625", "0.63027847", "0.6267378", "0.6264388", "0.6254397", "0.6237788", "0.622723", "0.62243986"...
0.68496406
0
Checks that the given PreparedStatement and ResultSet are not null, and then closes them. It is used in methods that are given a Connection and can use that same connection after the method is used.
public static void close(PreparedStatement ps, ResultSet rs) { try { if(rs != null && !rs.isClosed()) { rs.close(); } if(ps != null && !ps.isClosed()) { ps.close(); } } catch (SQLException e) { throw new RuntimeException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void closing(Connection connection, PreparedStatement preparedStatement, ResultSet rs) {\n try {\n if (rs != null) {\n rs.close();\n preparedStatement.close();\n connection.close();\n }\n } catch (SQLException sq...
[ "0.73576546", "0.7229617", "0.7187638", "0.71810406", "0.71036786", "0.70073307", "0.7003602", "0.6999012", "0.69672674", "0.69668484", "0.6935947", "0.69130206", "0.6912705", "0.69044095", "0.6891235", "0.6884654", "0.6868493", "0.68665665", "0.68460315", "0.6841227", "0.684...
0.72127527
2
Parses an XML document
public static String run( String dataFile, String schemeFile ) { String res = ""; try { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); docFactory.setValidating( false ); docFactory.setNamespaceAware( true ); SchemaFactory factory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI ); docFactory.setSchema( factory.newSchema( new Source[] { new StreamSource( schemeFile ) } ) ); DocumentBuilder builder = docFactory.newDocumentBuilder(); builder.setErrorHandler( new ErrorHandler() { @Override public void warning(SAXParseException exception) throws SAXException { throw exception; } @Override public void error(SAXParseException exception) throws SAXException { throw exception; } @Override public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document doc = builder.parse( new InputSource( dataFile ) ); return ""; } catch (SAXException | IOException | ParserConfigurationException ex) { return ex.getMessage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void parseXML(String XML);", "public abstract XMLDocument parse(URL url);", "public void parseXML(String xmlString) {\n DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); \n Document document = null; \n try { \n //...
[ "0.68500906", "0.6778623", "0.64440745", "0.64156216", "0.63998663", "0.63457435", "0.63075334", "0.62935424", "0.62734646", "0.62332565", "0.618391", "0.61230236", "0.6111972", "0.6097276", "0.60910165", "0.60405463", "0.6028189", "0.6009458", "0.6006771", "0.6005588", "0.59...
0.0
-1
TODO: merge to this project private SensorCommunication sensorCommunication; Empty constructor needed for serialization This constructor shall never be called otherwise
public Sensor() { if(this.rawData == null) this.rawData = new Vector<SensorData>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SensorData() {\n\n\t}", "public BasicSensor() {}", "public SensorReader() {\n\t\tinit();\n\t}", "private Sensor jsonToSensor(JsonElement rawSensor) throws IOException, InterruptedException {\n var sensorProperties = rawSensor.getAsJsonObject();\n var sensorLocation = sensorProperties.get...
[ "0.73992854", "0.70757174", "0.6787543", "0.6783614", "0.6781397", "0.67739505", "0.66766584", "0.66509414", "0.66340184", "0.6586872", "0.6574346", "0.64939415", "0.64922124", "0.635115", "0.6347336", "0.63358104", "0.62638587", "0.61782324", "0.6150746", "0.6130647", "0.612...
0.72629994
1
Creates a new Sensor, assigns the given values and adds the Sensor to the SensorManagers sensor list. The new Sensor will have the lowest external sensorID, which is not forgiven yet. Use only for external Sensors
public Sensor(IGarmentDriver sensorDriver, int sampleRate, int savePeriod, float smoothness, String displayedSensorName, SensorType sensorType, String bluetoothID, MeasurementSystems rawDataMeasurementSystem, MeasurementUnits rawDataMeasurementUnit, MeasurementSystems displayedMeasurementSystem, MeasurementUnits displayedMeasurementUnit) { isInternalSensor = false; // compute the lowest external sensorID which is not forgiven yet int id = 100; for (Sensor sensor : SensorManager.getAllSensors()) { if (id <= sensor.getSensorID()) { id = sensor.getSensorID() + 1; } } sensorID = id; this.sensorDriver = sensorDriver; this.sampleRate = sampleRate; this.savePeriod = savePeriod; this.smoothness = smoothness; this.displayedSensorName = displayedSensorName; this.sensorType = sensorType; this.bluetoothID = bluetoothID; this.rawDataMeasurementSystem = rawDataMeasurementSystem; this.rawDataMeasurementUnit = rawDataMeasurementUnit; this.displayedMeasurementSystem = displayedMeasurementSystem; this.displayedMeasurementUnit = displayedMeasurementUnit; this.graphType = GraphType.LINE; this.isEnabled = true; SensorManager.addNewSensor(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ExternalSensor createExternalSensor();", "void addSensor(Sensor sensor) {\n List<Sensor> listToAddTo;\n\n switch (sensor.getSensorType()) {\n case PM10:\n listToAddTo = this.pm10Sensors;\n break;\n case TEMP:\n listToAddTo = this.te...
[ "0.68262196", "0.65771836", "0.6456224", "0.62811774", "0.621502", "0.61227936", "0.6111058", "0.611", "0.6036705", "0.59223765", "0.5906559", "0.59012103", "0.5860498", "0.5849534", "0.58491886", "0.58319134", "0.5814497", "0.5805737", "0.5760379", "0.5727278", "0.5717411", ...
0.5521751
27
Creates a new Sensor, assigns the given values and adds the Sensor to the SensorManagers sensor list. The new Sensor will have the same sensorID as in Android. (see android.hardware.Sensor Use only for internal Sensors
protected Sensor(android.hardware.Sensor sensor, int sampleRate, int savePeriod, float smoothness, String displayedSensorName, SensorType sensorType, MeasurementSystems rawDataMeasurementSystem, MeasurementUnits rawDataMeasurementUnit) { this.isInternalSensor = true; this.sensorID = sensor.getType(); this.sampleRate = sampleRate; this.savePeriod = savePeriod; this.smoothness = smoothness; this.displayedSensorName = displayedSensorName; this.sensorType = sensorType; this.rawDataMeasurementSystem = rawDataMeasurementSystem; this.displayedMeasurementSystem = rawDataMeasurementSystem; this.rawDataMeasurementUnit = rawDataMeasurementUnit; this.displayedMeasurementUnit = rawDataMeasurementUnit; this.graphType = GraphType.LINE; SensorManager.addNewSensor(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DeviceSensor createDeviceSensor();", "private void registerSensors()\n {\n // Double check that the device has the required sensor capabilities\n\n if(!HasGotSensorCaps()){\n showToast(\"Required sensors not supported on this device!\");\n return;\n }\n\n // P...
[ "0.6797555", "0.64247566", "0.64128554", "0.6339899", "0.63079816", "0.6225251", "0.617305", "0.6138219", "0.6093071", "0.60386854", "0.601026", "0.5995042", "0.5967301", "0.5913234", "0.58909607", "0.5884586", "0.585892", "0.5839238", "0.5829147", "0.5827199", "0.5822041", ...
0.6040186
9
Creates a new GPS Sensor, assigns the given values and adds the Sensor to the SensorManagers sensor list. Use only for internal GPS Sensors
protected Sensor(int gpsSensorID, int sampleRate, int savePeriod, float smoothness, String displayedSensorName, SensorType sensorType, MeasurementSystems rawDataMeasurementSystem, MeasurementUnits rawDataMeasurementUnit) { this.isInternalSensor = true; this.sensorID = gpsSensorID; this.sampleRate = sampleRate; this.savePeriod = savePeriod; this.smoothness = smoothness; this. displayedSensorName = displayedSensorName; this.sensorType = sensorType; this.rawDataMeasurementSystem = rawDataMeasurementSystem; this.displayedMeasurementSystem = rawDataMeasurementSystem; this.rawDataMeasurementUnit = rawDataMeasurementUnit; this.displayedMeasurementUnit = rawDataMeasurementUnit; this.graphType = GraphType.LINE; SensorManager.addNewSensor(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void registerSensors()\n {\n // Double check that the device has the required sensor capabilities\n\n if(!HasGotSensorCaps()){\n showToast(\"Required sensors not supported on this device!\");\n return;\n }\n\n // Provide a little feedback via a toast\n\n...
[ "0.6386406", "0.61585265", "0.61217934", "0.6089884", "0.6076588", "0.6069285", "0.6024928", "0.5962822", "0.5925151", "0.58907735", "0.58553207", "0.5796379", "0.57573265", "0.57137996", "0.5707855", "0.5686643", "0.56676", "0.56460613", "0.5610229", "0.55773854", "0.5560422...
0.6004575
7
returns if the sensor is an internal Sensor.
public boolean isInternalSensor() { return isInternalSensor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isInternal();", "public boolean isInternal()\n {\n return m_fInternal;\n }", "public abstract boolean sensorFound();", "boolean hasSaveSensor();", "public boolean hasGetLatestSensorReadingForUser() {\n return getLatestSensorReadingForUser_ != null;\n }", "boolean hasG...
[ "0.6733534", "0.6572921", "0.61927825", "0.61068225", "0.6091463", "0.6052026", "0.5951177", "0.59365267", "0.59364516", "0.5934271", "0.59256035", "0.58985853", "0.5878154", "0.5829469", "0.5815663", "0.5778047", "0.5747934", "0.5747222", "0.5722536", "0.5696381", "0.5637139...
0.85729426
0
returns if the sensor is enabled.
public boolean isEnabled() { return isEnabled; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEnabled() {\r\n\t\treturn sensor.isEnabled();\r\n\t}", "public boolean isEnable() {\n return _enabled;\n }", "public boolean isEnabled()\n {\n return mSettings.getBoolean(ENABLED, true);\n }", "public boolean isEnable() {\n return enable;\n }", "public Boolean isEn...
[ "0.88131565", "0.75024396", "0.74884915", "0.7418108", "0.738713", "0.7384159", "0.73475146", "0.7257556", "0.72510046", "0.7198806", "0.7198806", "0.7198806", "0.7100127", "0.70806545", "0.7059046", "0.7041027", "0.7034546", "0.69965005", "0.6996422", "0.6987852", "0.6987852...
0.659572
79
sets the enabled status to the given value. => enables or disables the sensor
public void setEnabled(boolean newValue) { this.isEnabled = newValue; if (newValue) { if (isInternalSensor) { InternalSensors.getInstance().enableInternalSensor(this); } else { // TODO: enable external sensors } } else { saveSensor(); if (isInternalSensor) { InternalSensors.getInstance().disableInternalSensor(this); } else { // TODO: disable external sensors } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void enableSensor() {\n if (DEBUG) Log.d(TAG, \">>> Sensor \" + getEmulatorFriendlyName() + \" is enabled.\");\n mEnabledByEmulator = true;\n mValue = null;\n\n Message msg = Message.obtain();\n msg.what = SENSOR_STATE_CHANGED;\n msg.obj = M...
[ "0.7502934", "0.73789626", "0.72711444", "0.72121584", "0.71503776", "0.71324766", "0.7007123", "0.6983052", "0.6958566", "0.6931558", "0.69236296", "0.68367946", "0.6834298", "0.68095857", "0.68095857", "0.68095857", "0.68095857", "0.678912", "0.67839646", "0.6750968", "0.67...
0.73488986
2
adds tje given sensorData to rawData. If rawData > savePeriod the data will be saved to the Storage and rawData will be cleared.
public synchronized void addRawData (SensorData sensorData) { if (!isEnabled) { return; } rawData.add(sensorData); GarmentOSService.callback(CallbackFlags.VALUE_CHANGED, new ValueChangedCallback(sensorData.getLongUnixDate(), sensorData.getData())); if (rawData.size() > savePeriod) { saveSensor(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveSensor() {\n new SensorDataSerializer(sensorID, rawData);\n rawData.clear();\n }", "private void saveGyroData(float axis_x, float axis_y, float axis_z, long timestamp){\n //Log.v(TAG, \"saveGyroData:: axis_x: \"+axis_x+\" axis_y: \"+axis_y+\" axis_z: \"+axis_z);\n ...
[ "0.6958177", "0.569329", "0.5677685", "0.5606124", "0.5558784", "0.54911876", "0.54609007", "0.5371148", "0.53462577", "0.5310645", "0.52844507", "0.52786714", "0.5277859", "0.52684665", "0.5265532", "0.5249447", "0.5219877", "0.5196181", "0.5159902", "0.51550823", "0.5100398...
0.80892026
0
saves the sensorData to the Storage
private void saveSensor() { new SensorDataSerializer(sensorID, rawData); rawData.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveData() {\n\t\tdataSaver.save(data);\n\t}", "public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }", "private void saveData() {\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "public void saveSensorsDB() throws Exception {\n\n\t\t//Ge...
[ "0.7171921", "0.7154856", "0.68867606", "0.6862248", "0.65747577", "0.6556915", "0.6483792", "0.64761645", "0.6474207", "0.643909", "0.64291877", "0.6397387", "0.63803464", "0.6363199", "0.63628525", "0.6355687", "0.6343878", "0.63311017", "0.6287861", "0.6281791", "0.6246814...
0.84655255
0
returns the actual rawData of the Sensor, which is not saved to the storage yet.
public synchronized Vector<SensorData> getRawData() { return rawData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected int getSensorData() {\n\t\treturn sensor.getLightValue();\n\t}", "@Override\n public SignalSet getRawData() {\n return this.datRaw;\n }", "Object getRawData();", "public int[] getTempSensorData()\n {\n return tempSensorData;\n }", "public JSONObject getRawDa...
[ "0.7213266", "0.7046011", "0.68381804", "0.6789436", "0.6728527", "0.66144854", "0.6595221", "0.65799755", "0.6577123", "0.65511066", "0.6513496", "0.6511103", "0.64665246", "0.64656496", "0.6416579", "0.64111096", "0.6409069", "0.6404163", "0.64009476", "0.639297", "0.638102...
0.83104247
0
returns the rawData from the given timestamp to the millisecond exact. Or, if plusMinusOneSecond = true the rawData from the given timestamp plus minus 1 second.
public synchronized Vector<SensorData> getRawData(Date time, boolean plusMinusOneSecond) { if (!plusMinusOneSecond) { return getRawData(time, time); } else { return getRawData(new Date(time.getTime() - 1000), new Date(time.getTime() + 1000)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static byte[] getExactTime(long timestamp) {\n DATA1++;\n return new String(String.valueOf(DATA1) + \" zac[1]!!!\").getBytes();\n }", "public T get(long timestamp) {\n int index = fit(timestamp);\n return get(index);\n }", "public abstract long getTimestampMillis();", ...
[ "0.5954202", "0.57522726", "0.55203575", "0.5512498", "0.53498095", "0.5310734", "0.5310734", "0.5310734", "0.5295686", "0.52844733", "0.51787364", "0.5149699", "0.5149699", "0.5105067", "0.50967824", "0.50967824", "0.50967824", "0.50967824", "0.50967824", "0.50967824", "0.50...
0.6829254
0
returns the rawData between the two given timestamps including the given times themselves, either from the database or from the actual rawData or both. Depending of the given timestamps.
public synchronized Vector<SensorData> getRawData(Date begin, Date end) { Date firstLocallyHoldDate; Vector<SensorData> data = new Vector<SensorData>(); if (rawData.size() == 0) { firstLocallyHoldDate = new Date(); } else { firstLocallyHoldDate = rawData.get(0).getDate(); } if (begin.after(firstLocallyHoldDate) || begin.equals(firstLocallyHoldDate)) { getRawData(begin, end, data); } else { SensorDataDeSerializer deSerializer = new SensorDataDeSerializer(sensorID, data, Utils.dateToLongUnix(begin), Utils.dateToLongUnix(end), 0); deSerializer.work(); if (!end.before(firstLocallyHoldDate)) { getRawData(begin, end, data); } } return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<models.garaDB.tables.pojos.Ride> fetchByTimestamp(Timestamp... values) {\n return fetch(Ride.RIDE.TIMESTAMP, values);\n }", "public String assembleGetObservationsQuery(Set<DataStream> dataStreams, Date minTimestamp, Date maxTimestamp) {\n\t\tString sqlQuery = null;\r\n\t\t\r\n\t\tString que...
[ "0.554982", "0.5406476", "0.5172046", "0.5074408", "0.506985", "0.5040807", "0.5016186", "0.49896905", "0.4930881", "0.4870556", "0.4837814", "0.48137432", "0.47993487", "0.4783246", "0.47723803", "0.47567657", "0.47535095", "0.47230792", "0.4711921", "0.47103804", "0.4688580...
0.45594576
24
Get the sensor driver for the given sensor
public IGarmentDriver getSensorDriver() { return sensorDriver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Sensor getSensor();", "public Peripheral getHardwareDriverFromSoftwareDriver();", "DeviceSensor createDeviceSensor();", "public PeripheralHardwareDriverInterface getHardwareDriver();", "public String getSensor()\n {\n return sensor;\n }", "private MonitoredSensor getSensorByEFN(String name) ...
[ "0.72184175", "0.68307966", "0.6542731", "0.63443017", "0.6331817", "0.6319395", "0.62139785", "0.6106773", "0.60540783", "0.59944916", "0.59433985", "0.590944", "0.5908816", "0.5892391", "0.5856331", "0.5787004", "0.5761592", "0.57252115", "0.566729", "0.5629293", "0.5586682...
0.70962477
1
only an internal helper method to prevent multiple code.
private synchronized void getRawData (Date begin, Date end, Vector<SensorData> data) { for (SensorData sensorData : rawData) { if ((sensorData.getDate().before(end) || sensorData.getDate() .equals(end)) && (sensorData.getDate().after(begin) || sensorData .getDate().equals(begin))) { data.add(sensorData); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public void method_4270() {}", "@Override\n\tprotected void logic() {\n\n\t}", "protected boolean func_70041_e_() { ...
[ "0.6044926", "0.6044926", "0.6029732", "0.59592915", "0.5886533", "0.58680695", "0.58621943", "0.57458323", "0.5678456", "0.56745094", "0.56356066", "0.562792", "0.5627562", "0.5616221", "0.5595669", "0.55779845", "0.55642515", "0.55576944", "0.5543683", "0.5507566", "0.54873...
0.0
-1
Returns the given number of the newest SensorData of the Sensor.
public synchronized Vector<SensorData> getRawData(int numberOfValues, boolean loadFromStorage) { Vector<SensorData> returnData = new Vector<SensorData>(); if (loadFromStorage && rawData.size() < numberOfValues) { SensorDataDeSerializer deSerializer = new SensorDataDeSerializer(sensorID, returnData, numberOfValues - rawData.size()); long id = deSerializer.work(); while (!SensorDataDeSerializer.jobFinsihed(id)) {} returnData.addAll(rawData); } else { if (rawData.size() <= numberOfValues) { return rawData; } for (int i = rawData.size() - numberOfValues; i < rawData.size(); i++) { returnData.add(rawData.get(i)); } } return returnData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DataValue getLastDataByDeviceIdAndSensorTypeSortedByTimestamp(SensorValue sensorVal) throws Exception;", "public SensorData getLastSensorData() {\n if (mSensorData.size() > 0) {\n for (SensorData sensorData : mSensorData) {\n if (sensorData.isDatasetComplete()) {\n ...
[ "0.6601442", "0.6442331", "0.6336687", "0.59946495", "0.59490347", "0.59262556", "0.5866039", "0.5796465", "0.5756928", "0.57090163", "0.55371773", "0.5522297", "0.54840755", "0.5475003", "0.54613304", "0.54609424", "0.5433983", "0.5331124", "0.5322373", "0.53054804", "0.5281...
0.0
-1
sets the rawDataMeasurementSystem [e.g. METRICAL] and the rawDataMeasurementUnit [e.g. KILO] of the Sensor The rawDataMeasurementUnit has to fit to the rawDataMeasurementSystem! so KILO and METRICAL is legal! and KILO and ANGLOSAXON is illegal!
public void setRawDataMeasurementSystemAndUnit( MeasurementSystems rawDataMeasurementSystem, MeasurementUnits rawDataMeasurementUnit) { if (!rawDataMeasurementUnit .containsMeasurementSystem(rawDataMeasurementSystem)) { throw new IllegalArgumentException(); } this.rawDataMeasurementSystem = rawDataMeasurementSystem; this.rawDataMeasurementUnit = rawDataMeasurementUnit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDataUnit(String dataUnit) {\n this.dataUnit = dataUnit == null ? null : dataUnit.trim();\n }", "public void setLowUnit(TempUnit lowUnit) {\n this.lowUnit = lowUnit;\n }", "public void setUserUnits(String userUnitsString) throws DeviceException {\n\t\t// Make hardware unit com...
[ "0.58444643", "0.5538712", "0.5535677", "0.5480942", "0.54189616", "0.54183286", "0.5397402", "0.53839326", "0.53601396", "0.53576756", "0.53425974", "0.5311795", "0.53056675", "0.52989715", "0.5250954", "0.52494615", "0.5242322", "0.5227815", "0.5226954", "0.52055573", "0.51...
0.79558337
0
Create a parcelable Sensor object from the given Sensor for internal use
public PSensor toParcelable() { return new PSensor(this.sensorID, this.displayedSensorName, this.bluetoothID, this.sampleRate, this.savePeriod, this.smoothness, this.sensorType, this.graphType, this.rawDataMeasurementUnit, this.rawDataMeasurementSystem, this.displayedMeasurementUnit, this.displayedMeasurementSystem, this.isInternalSensor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Sensor jsonToSensor(JsonElement rawSensor) throws IOException, InterruptedException {\n var sensorProperties = rawSensor.getAsJsonObject();\n var sensorLocation = sensorProperties.get(\"location\").getAsString();\n var coordinate = this.getCoordinate(sensorLocation); // get location in...
[ "0.63142645", "0.6043109", "0.5990616", "0.5887039", "0.57617915", "0.5578664", "0.5538196", "0.55298036", "0.54736155", "0.53492576", "0.53168935", "0.5263512", "0.52488977", "0.5229638", "0.5189576", "0.5149184", "0.5136845", "0.51085997", "0.5081045", "0.50578564", "0.5027...
0.7178949
0
Create a parcelable Sensor object from the given Sensor
public de.unistuttgart.vis.wearable.os.api.PSensor toParcelableAPI() { return new de.unistuttgart.vis.wearable.os.api.PSensor(this.sensorID, this.displayedSensorName, this.bluetoothID, this.sampleRate, this.savePeriod, this.smoothness, this.sensorType, this.graphType, this.rawDataMeasurementUnit, this.rawDataMeasurementSystem, this.displayedMeasurementUnit, this.displayedMeasurementSystem, this.isInternalSensor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PSensor toParcelable() {\n return new PSensor(this.sensorID, this.displayedSensorName, this.bluetoothID, this.sampleRate,\n this.savePeriod, this.smoothness, this.sensorType, this.graphType,\n this.rawDataMeasurementUnit, this.rawDataMeasurementSystem,\n t...
[ "0.714916", "0.6217719", "0.59472454", "0.5925174", "0.5489485", "0.5472411", "0.5439583", "0.53962064", "0.5353913", "0.53427166", "0.53126657", "0.52453595", "0.52200305", "0.5204683", "0.51948285", "0.51678073", "0.5166897", "0.5073928", "0.50453514", "0.5034619", "0.50011...
0.5840249
4
/////////////////////////////////////////////////////// //////////////// GETTERS AND SETTERS ////////////////// ///////////////////////////////////////////////////////
public int getSensorID() { return sensorID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Override\n public void get() {}", "protected abstract Set method_1559();", "String setValue();", "public void setdat()\n {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private void assignment() {\n\n\t\t\t}", "public int\t\tge...
[ "0.6553492", "0.6423966", "0.6359154", "0.62207294", "0.6200378", "0.61341244", "0.6086578", "0.6046086", "0.603219", "0.59598625", "0.58804107", "0.58567077", "0.5813157", "0.58106345", "0.5798105", "0.57964057", "0.57964057", "0.5789135", "0.57880443", "0.5783892", "0.57721...
0.0
-1
File imgFile = new File("img/Checker.bmp"); return ImageIO.read(imgFile);
private BufferedImage initImg() throws IOException { int h = 256, w = 256; BufferedImage img = new BufferedImage(h, w, BufferedImage.TYPE_INT_ARGB); //int red = 0xff000000 + 0x00ff0000 + 0x00000000 + 0x00000000; short max = 0, min = 255, c = max; int color = SimpleImageViewer.getIntPixel(c, c, c); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { img.setRGB(x, y, color); } } return img; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BufferedImage readImage() throws IOException{\n\t\tFile read = new File(\"src/blue_plate.png\");\n\t\t//decodes a supplied File and returns a BufferedImage\n\t\tBufferedImage master = ImageIO.read(read);\n\t\treturn master;\n\t\t\n\t}", "private BufferedImage getImage(String f) {\n BufferedImag...
[ "0.71198857", "0.6865184", "0.6841495", "0.6652775", "0.66476834", "0.66429114", "0.6568374", "0.6568374", "0.6568374", "0.65114146", "0.64553976", "0.64227563", "0.6415649", "0.6399772", "0.6394905", "0.63753766", "0.63744247", "0.6370482", "0.6321469", "0.6312309", "0.63117...
0.5881098
71
Cannot understand this solution.
public boolean containsNearbyDuplicate2(int[] nums, int k) { if(nums == null || nums.length <=1) return false; Set<Integer> set = new HashSet<Integer> (); for(int i=0; i< nums.length; i++) { if(i>k) set.remove(nums[i-k-1]); if(!(set.add(nums[i]))) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "public int m()\r\n/* 485: */ {\r\n/* 486:497 */ int i = 0;\r\n/* 487:498 */ for (int j = 0; j < this.b.length; j++) {\r\n/* 488:499 */ if ((this.b[j] != null) && ((this.b[j].b() instanceof ajn)))\r\n/* 489: */ {\r\n/* 49...
[ "0.60890526", "0.55879104", "0.55342734", "0.54540825", "0.5382938", "0.537863", "0.53701353", "0.5348977", "0.5345412", "0.53374535", "0.5332246", "0.53136253", "0.53135055", "0.5311541", "0.53065693", "0.52906686", "0.5286893", "0.5272328", "0.52581936", "0.52369773", "0.52...
0.0
-1
Returns true if this is a simulation.
boolean isSimulation() { return simulation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSimMode() {\n return sim_mode;\n }", "public final boolean startSimulation() {\n\t\tboolean result = true;\n\t\tfor (String mdl : executors.keySet()) {\n\t\t\tSubstructureExecutorI exe = executors.get(mdl);\n\t\t\tresult = result && exe.startSimulation();\n\t\t}\n\t\tsetRunning(true);\...
[ "0.7226539", "0.7111183", "0.690993", "0.676323", "0.65426916", "0.64859194", "0.6274558", "0.62583226", "0.6201632", "0.6196116", "0.6187635", "0.61706364", "0.6160343", "0.6160343", "0.60526043", "0.60168374", "0.5926742", "0.59250253", "0.5906164", "0.5869859", "0.5863725"...
0.8291135
0
Clears all the values.
void clearValues() { percentMissing = "-1"; PICValue = "-1"; maf = "-1"; phenoDataSummary = "-1"; genoSummaryScript = sharedInformation.getWorkingDirectory() + scriptsRelativePath + dataSummaryScriptName; phenoSummaryScript = sharedInformation.getWorkingDirectory() + scriptsRelativePath + phenoSummaryScriptName; enginePath = sharedInformation.getWorkingDirectory() + rEngineRelativePath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n values.clear();\n }", "public void clear() {\n\t\tif(this.values!=null){\n\t\t\tthis.values.clear();\n\t\t}\n\t}", "public void clear() {\n synchronized (LOCK) {\n myValues.clear();\n }\n }", "public void clear()\r\n {\r\n for (int i = 0; i < values.len...
[ "0.8788741", "0.8329391", "0.8160038", "0.8029748", "0.7950717", "0.78669864", "0.7852638", "0.7843643", "0.7735642", "0.7735642", "0.7733899", "0.77278394", "0.77209175", "0.77209175", "0.77117217", "0.7703564", "0.77016765", "0.7693209", "0.7673", "0.76698726", "0.7648354",...
0.0
-1
Sets phenotype file, html file. Sets genotype file, html and csv file.
void setInputFile(String genoFile, String phenoFile) { this.genoFile = genoFile; this.phenoFile = phenoFile; this.genoHtmlName = Util.stripFileExtension(genoFile) + "_sum_" + new SimpleDateFormat("hhmmss").format(new Date()) + ".htm"; this.genoSummaryCsvName = PathConstants.summaryFilesMap.get(genoFile); this.phenoHtmlName = Util.stripFileExtension(phenoFile) + "_sum_" + new SimpleDateFormat("hhmmss").format(new Date()) + ".htm"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setFile() {\n\t}", "public void setFile(File file);", "public void setConfigFiles(String csv, String txt) {\n\t\tlayoutConfigFile = csv;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setting the layout file (.csv)\n\t\tsetupConfigFile = txt;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setting the setup file(.txt)\n\t}"...
[ "0.5732431", "0.571782", "0.54588383", "0.54231316", "0.54090095", "0.5392194", "0.53911144", "0.5387264", "0.53231", "0.5294035", "0.5269852", "0.52580667", "0.52143097", "0.5151939", "0.5146113", "0.51459575", "0.51020277", "0.507303", "0.50713915", "0.5068812", "0.5048957"...
0.6516527
0
constructor that is getting the fitting information
public ProductDbRepository(String dbUrl, String userName, String password) { this.dbUrl = dbUrl; this.userName = userName; this.password = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FitRealFunction() {\t\t\r\n\t}", "public ScaleInformation() {\n\t\tthis(0.0, 0.0, 800.0, 540.0, 800, 540);\n\t}", "protected void initSupportedIntensityMeasureParams() {\n\n\t\t// Create saParam:\n\t\tDoubleDiscreteConstraint periodConstraint = new DoubleDiscreteConstraint();\n\t\tTreeSet set = new Tree...
[ "0.64309746", "0.61774", "0.5917338", "0.5824113", "0.58142984", "0.58049965", "0.5774969", "0.5744063", "0.5735137", "0.5695525", "0.5694665", "0.569052", "0.56773907", "0.56108195", "0.55986387", "0.55507493", "0.5531314", "0.55230665", "0.54800516", "0.5463136", "0.5462217...
0.0
-1
loading the productdataset from the DB with the specified id
@Override public Product selectById(int id) throws ProductRepositoryException { try (Connection conn = DriverManager.getConnection(dbUrl, userName, password)) { // statement with the parameter PreparedStatement stmt = conn.prepareStatement(QUERY_SELECT_BY_ID_STATEMENT); // setting every value for the parameter (begins with 1) stmt.setInt(1, id); // executing ResultSet result = stmt.executeQuery(); // throwing exception, when there is no more data-sets if (!result.next()) { throw new ProductRepositoryException("Product with ID" + id + " doesn't exist"); } Product entity = readProduct(result); return entity; } catch (Exception e) { System.err.println("Error loading a Product-dataset\n"); e.printStackTrace(); throw new ProductRepositoryException("Error loading a product dataset", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Product loadById(int id) {\n\t\treturn null;\n\t}", "@Override\n\tpublic IDataResult<Product> getById(int id) {\n\t\tvar product = productDao.getById(id);\n\t\tif (product.id == 0) {\n\t\t\treturn new ErrorDataResult<Product>(\"Böyle bir ürün bulunmuyor.\");\n\t\t}\n\t\treturn new SuccessData...
[ "0.69698215", "0.6641738", "0.6530523", "0.65209115", "0.6465815", "0.6336231", "0.6316897", "0.6253307", "0.62455225", "0.61837244", "0.61828434", "0.6167618", "0.6126702", "0.6113478", "0.60810757", "0.606239", "0.6062314", "0.60394984", "0.60308903", "0.6023744", "0.598113...
0.6554255
2
insert into products (quantity, name, description, price, entryDate, category_id)
@Override public int insertProduct(Product product) throws ProductRepositoryException { try (Connection conn = DriverManager.getConnection(dbUrl, userName, password)) { // creating statement, returns result-set with the key-values PreparedStatement stmt = conn.prepareStatement(INSERT_PRODUCT_STATEMENT, Statement.RETURN_GENERATED_KEYS); setCommonParameters(product, stmt); // executing the command, result is the count of the affected data-sets int rowAffected = stmt.executeUpdate(); if (rowAffected != 1) { System.out.println("No dataset involved with the insert ????"); throw new ProductRepositoryException("No dataset is involved with the insert."); } // when everything went right, getting the key ResultSet keys = stmt.getGeneratedKeys(); if (keys.next()) { int id = keys.getInt(1); System.out.printf("Object inserted with the new ID=%d\n", id); return id; } else { // shouldn't happen System.err.printf("Object inserted, new ID unknown!"); throw new ProductRepositoryException("The dataset was inserted but the ID couldn't be identified"); } } catch (SQLException e) { System.err.println("Error when inserting product datatset"); e.printStackTrace(); throw new ProductRepositoryException("Error inserting the product-datasetz", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage(...
[ "0.71248055", "0.6793478", "0.6579579", "0.6523699", "0.6496463", "0.6493084", "0.6429776", "0.64149165", "0.6390943", "0.63887167", "0.63420486", "0.6331382", "0.6316138", "0.63052255", "0.62836605", "0.62826514", "0.6269748", "0.6258766", "0.6241371", "0.6232328", "0.620932...
0.0
-1
order of the parameters: quantity, name, description, price, entryDate, category_id
private void setCommonParameters(Product product, PreparedStatement stmt) throws SQLException { // setting the name, first parameter, second parameter and etc. stmt.setInt(1, product.getQuantity()); stmt.setString(2, product.getName()); stmt.setString(3, product.getDescription()); stmt.setDouble(4, product.getPrice()); stmt.setDate(5, Date.valueOf(product.getEntryDate())); stmt.setInt(6, product.getCategoryId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Item(int i, String n, String c, double p) {\n this.id = i;\n this.name = n;\n this.category = c;\n this.price = p;\n }", "void createItem (String name, String description, double price);", "void add(ProductCategory category);", "Order placeOrder(Set<Item> menu){\n\t\tHashMap<In...
[ "0.56970084", "0.5629307", "0.54393536", "0.5419488", "0.53789014", "0.5378132", "0.5370452", "0.53606033", "0.5359291", "0.5328486", "0.5311826", "0.5305654", "0.5281138", "0.5270961", "0.52497816", "0.5244984", "0.5234915", "0.5210214", "0.52085966", "0.51998514", "0.518648...
0.0
-1
The Voice Connector ID.
public void setVoiceConnectorId(String voiceConnectorId) { this.voiceConnectorId = voiceConnectorId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getVoiceConnectorId() {\n return this.voiceConnectorId;\n }", "UUID getConnectorId();", "public String getConnectId() {\n return connectId;\n }", "java.lang.String getChannelId();", "public String getCallId();", "public String getCHANNEL_ID() {\n return CHANNEL_ID...
[ "0.8322801", "0.72954416", "0.65863734", "0.65018165", "0.63737744", "0.6192946", "0.60818005", "0.5973976", "0.5952102", "0.59504384", "0.59411097", "0.5935334", "0.59034693", "0.59034693", "0.59034693", "0.589197", "0.5881535", "0.5881535", "0.5881535", "0.5875012", "0.5875...
0.63159895
5