blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
5663198026447b228b196e259fbe68df893df7bb
0ecc3f1b9199f398368b1126966c8f3a04351b0c
/clients-business-capability-services/src/main/java/com/lulobank/clients/services/features/clientverificationresult/mapper/RiskEngineMapper.java
1d40f59aa8e9f9b7a196522956feb877ff19fb74
[]
no_license
zhenyuncai/client
30c990af3fe97f8e63d7440f53a73819fcef572b
a352c3cc1d563e5ffa9886988bf831630a915d65
refs/heads/main
2023-06-04T12:59:02.973045
2021-06-29T23:16:07
2021-06-29T23:16:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
991
java
package com.lulobank.clients.services.features.clientverificationresult.mapper; import com.lulobank.clients.services.ports.out.dto.RiskOfferResponse; import com.lulobank.clients.services.utils.InterestUtil; import com.lulobank.clients.v3.adapters.port.out.dynamo.dto.RiskOfferV3; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.ReportingPolicy; import org.mapstruct.factory.Mappers; @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, imports = InterestUtil.class) public interface RiskEngineMapper { RiskEngineMapper INSTANCE = Mappers.getMapper(RiskEngineMapper.class); @Mapping(target = "idProductOffer", expression = "java(java.util.UUID.randomUUID().toString())") @Mapping(target = "state", constant = "ACTIVE") @Mapping(target = "type", constant = "REGISTRY_PREAPPROVED") @Mapping(target = "offerDate", expression = "java(java.time.LocalDateTime.now())") RiskOfferV3 toRiskOfferV3(RiskOfferResponse riskEngineResponse); }
[ "juan.toledo@globant.com" ]
juan.toledo@globant.com
06af3e0a29decb71e46fd6167bd01ca55476d9b2
a4b9bcf602647bf48a5412ad0f7d274b1bb147a9
/DesignPattern/factory/pizzaaf/PizzaIngredientFactory.java
2bed52834a27c9bea9fd52424b55a6c311222ab0
[]
no_license
huangketsudou/javalearning
5680884584771b6c9a9fb1ba5838824cd0ebb550
6a5b751e50007702641d14588cb90c0ea0ca0f4c
refs/heads/master
2022-11-10T14:50:08.716494
2020-06-25T09:12:02
2020-06-25T09:12:02
264,204,472
0
0
null
null
null
null
UTF-8
Java
false
false
252
java
package DesignPattern.factory.pizzaaf; public interface PizzaIngredientFactory { Dough createDough(); Sauce createSauce(); Cheese createCheese(); Veggies[] createVeggies(); Pepperoni createPepperoni(); Clams createClam(); }
[ "1941161938@qq.com" ]
1941161938@qq.com
1ab41a661a7a5f594d2e22184630931b0a9c52b4
3538406360a3ebe52f00e7b53cc06acb58b004a0
/deegree-core/trunk/src/main/java/org/deegree/feature/persistence/mapping/property/GeometryMapping.java
46d544750e0bc31d1c38af980a25709517e10888
[]
no_license
izaslavsky/incf-dai
d563e63aa7cf7147ceb5a60c2b7ade3754f502c8
4ba6954720974139388ac0f77040fabe28fb4752
refs/heads/master
2016-09-06T11:13:51.903896
2013-02-07T02:30:15
2013-02-07T02:30:15
32,130,589
0
1
null
null
null
null
UTF-8
Java
false
false
3,037
java
//$HeadURL: http://svn.wald.intevation.org/svn/deegree/deegree3/branches/3.0/deegree-core/src/main/java/org/deegree/feature/persistence/mapping/property/GeometryMapping.java $ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ Copyright (C) 2001-2009 by: - Department of Geography, University of Bonn - and - lat/lon GmbH - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact information: lat/lon GmbH Aennchenstr. 19, 53177 Bonn Germany http://lat-lon.de/ Department of Geography, University of Bonn Prof. Dr. Klaus Greve Postfach 1147, 53001 Bonn Germany http://www.geographie.uni-bonn.de/deegree/ e-mail: info@deegree.org ----------------------------------------------------------------------------*/ package org.deegree.feature.persistence.mapping.property; import org.deegree.cs.CRS; import org.deegree.feature.persistence.mapping.JoinChain; import org.deegree.feature.persistence.mapping.MappingExpression; import org.deegree.feature.types.property.GeometryPropertyType.CoordinateDimension; import org.deegree.feature.types.property.GeometryPropertyType.GeometryType; import org.deegree.filter.expression.PropertyName; /** * The <code></code> class TODO add class documentation here. * * @author <a href="mailto:schneider@lat-lon.de">Markus Schneider</a> * @author last edited by: $Author: mschneider $ * * @version $Revision: 27750 $, $Date: 2010-11-03 08:49:44 -0700 (Wed, 03 Nov 2010) $ */ public class GeometryMapping extends Mapping { private GeometryType type; private CoordinateDimension dim; private CRS crs; private String srid; public GeometryMapping( PropertyName path, MappingExpression mapping, GeometryType type, CoordinateDimension dim, CRS crs, String srid, JoinChain joinedTable ) { super( path, mapping, joinedTable ); this.type = type; this.dim = dim; this.crs = crs; this.srid = srid; } public GeometryType getType() { return type; } public CoordinateDimension getDim() { return dim; } public CRS getCRS() { return crs; } public String getSrid() { return srid; } @Override public String toString() { return super.toString() + ",{type=" + type + "}"; } }
[ "davlit0917@7cbae6f4-d32f-11de-a711-9fae7a67fc1c" ]
davlit0917@7cbae6f4-d32f-11de-a711-9fae7a67fc1c
2bd026a03eba9d3a56041c05422024de3b724bdc
ee2fece384c0b7b58cd40f10227960c9058d2ee6
/src/main/java/com/homeapp/app/domain/AbstractAuditingEntity.java
f729e1961d63622dd5911e573f699680de06c6dc
[]
no_license
FredPi17/HomeAutomationApp
302289b94b4f4a1109c2a81db6f25486c3f38867
1e9a98aa091982dd943a866b0ea919deeb9b49db
refs/heads/master
2022-12-22T15:00:58.568671
2020-03-09T18:50:24
2020-03-09T18:50:24
244,335,080
0
0
null
2022-12-16T05:13:17
2020-03-02T09:49:13
Java
UTF-8
Java
false
false
2,166
java
package com.homeapp.app.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.io.Serializable; import java.time.Instant; import javax.persistence.Column; import javax.persistence.EntityListeners; import javax.persistence.MappedSuperclass; /** * Base abstract class for entities which will hold definitions for created, last modified by and created, * last modified by date. */ @MappedSuperclass @EntityListeners(AuditingEntityListener.class) public abstract class AbstractAuditingEntity implements Serializable { private static final long serialVersionUID = 1L; @CreatedBy @Column(name = "created_by", nullable = false, length = 50, updatable = false) @JsonIgnore private String createdBy; @CreatedDate @Column(name = "created_date", updatable = false) @JsonIgnore private Instant createdDate = Instant.now(); @LastModifiedBy @Column(name = "last_modified_by", length = 50) @JsonIgnore private String lastModifiedBy; @LastModifiedDate @Column(name = "last_modified_date") @JsonIgnore private Instant lastModifiedDate = Instant.now(); public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Instant getCreatedDate() { return createdDate; } public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } }
[ "fpinaud17@gmail.com" ]
fpinaud17@gmail.com
232f6421b059dedba96f0f4dab6274f7ab8d50c2
07af209df92e6c247d12f76b91f2f2e2edfb46f0
/JavaBrains_Courses/JavaBrainsSpringDI/src/org/mzherdev/Triangle.java
7479aafacc63e062c901d7df44329030972c1bc7
[]
no_license
michaelzherdev/Java
7d19bf3358ce5d4cbb4774cdf86488aef9d26bb4
5b71e9b42814304d1128d696c91bb97f301a5d99
refs/heads/master
2021-01-10T06:31:36.341504
2015-10-15T19:31:46
2015-10-15T19:31:46
44,328,179
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package org.mzherdev; public class Triangle { private String type; public void draw() { System.out.println(getType() + " Triangle draw"); } public String getType() { return type; } public void setType(String type) { this.type = type; } }
[ "michaelzherdev@gmail.com" ]
michaelzherdev@gmail.com
4c4207137b9943fcffb5a580ab6b627510e89f6a
07d5605350374bc7a17ac1c75b3f40b059d07945
/cayenne-server/src/test/java/org/apache/cayenne/testdo/oneway/auto/_OnewayTable4.java
388cbdfc3589f8aa93f27571a2dfdfc09566473e
[ "Apache-2.0" ]
permissive
wx930910/cayenne_refactoring
839521ac1245fd91183312b94b6004b2b6bb115e
b5356d80b9d6a8bb0f763bf4e748c4669f4b1a87
refs/heads/master
2023-01-30T04:49:52.767938
2020-12-15T07:17:25
2020-12-15T07:17:25
314,658,092
0
0
null
null
null
null
UTF-8
Java
false
false
1,721
java
package org.apache.cayenne.testdo.oneway.auto; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.cayenne.BaseDataObject; /** * Class _OnewayTable4 was generated by Cayenne. * It is probably a good idea to avoid changing this class manually, * since it may be overwritten next time code is regenerated. * If you need to make any customizations, please use subclass. */ public abstract class _OnewayTable4 extends BaseDataObject { private static final long serialVersionUID = 1L; public static final String ID_PK_COLUMN = "ID"; @Override public Object readPropertyDirectly(String propName) { if(propName == null) { throw new IllegalArgumentException(); } switch(propName) { default: return super.readPropertyDirectly(propName); } } @Override public void writePropertyDirectly(String propName, Object val) { if(propName == null) { throw new IllegalArgumentException(); } switch (propName) { default: super.writePropertyDirectly(propName, val); } } private void writeObject(ObjectOutputStream out) throws IOException { writeSerialized(out); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { readSerialized(in); } @Override protected void writeState(ObjectOutputStream out) throws IOException { super.writeState(out); } @Override protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { super.readState(in); } }
[ "wx19930910@gmail.com" ]
wx19930910@gmail.com
b7f9073760680dc2c410135ab72611759138d79f
28a7ede896b98bf6e2630129d94e9e7afd29dc13
/src/main/java/com/nsb/practice/designpatterns/visitor/Monitor.java
38d3fd32fc5fd7903e334b6747219039725938b6
[ "Apache-2.0" ]
permissive
Dorae132/practice
8a7da9702074608c04d0b5e1a5358a9aad02eccb
d95221c3dea36720df3f0b0019d171a60c60e114
refs/heads/master
2022-11-28T10:43:35.461565
2020-09-27T00:51:20
2020-09-27T00:51:20
135,540,001
1
1
Apache-2.0
2022-10-18T23:20:51
2018-05-31T06:14:03
Java
UTF-8
Java
false
false
227
java
package com.nsb.practice.designpatterns.visitor; public class Monitor implements ComputerPart { @Override public void accept(ComputerPartVisitor computerPartVisitor) { computerPartVisitor.visit(this); } }
[ "nsb_2017@163.com" ]
nsb_2017@163.com
2bb9c560ff2f612034a3e34a6c4877e64fa5bd65
36d7ac13d205b9a5b8c3308a27c4605a1cd7ee56
/others/AndEngine-GLES2-AnchorCenter/src/org/andengine/audio/sound/SoundManager.java
a24468adf18047b6b34d4d9e97ca5ae94a9f8cdc
[ "Apache-2.0" ]
permissive
renanlr/billyadventures
92103d6208f2e80644fca38c2c8a4ad6f2b5a7ce
f35384d6355dbbdbc5708b370731d1be1e652f39
refs/heads/master
2021-01-20T03:39:09.059791
2014-12-09T05:03:33
2014-12-09T05:03:33
23,578,058
4
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
package org.andengine.audio.sound; import org.andengine.audio.BaseAudioManager; import org.andengine.audio.sound.exception.SoundException; import android.media.AudioManager; import android.media.SoundPool; import android.media.SoundPool.OnLoadCompleteListener; import android.util.SparseArray; /** * (c) 2010 Nicolas Gramlich * (c) 2011 Zynga Inc. * * @author Nicolas Gramlich * @since 13:22:59 - 11.03.2010 */ public class SoundManager extends BaseAudioManager<Sound> implements OnLoadCompleteListener { // =========================================================== // Constants // =========================================================== private static final int SOUND_STATUS_OK = 0; public static final int MAX_SIMULTANEOUS_STREAMS_DEFAULT = 5; // =========================================================== // Fields // =========================================================== private final SoundPool mSoundPool; private final SparseArray<Sound> mSoundMap = new SparseArray<Sound>(); // =========================================================== // Constructors // =========================================================== public SoundManager() { this(MAX_SIMULTANEOUS_STREAMS_DEFAULT); } public SoundManager(final int pMaxSimultaneousStreams) { this.mSoundPool = new SoundPool(pMaxSimultaneousStreams, AudioManager.STREAM_MUSIC, 0); this.mSoundPool.setOnLoadCompleteListener(this); } // =========================================================== // Getter & Setter // =========================================================== SoundPool getSoundPool() { return this.mSoundPool; } // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override public void add(final Sound pSound) { super.add(pSound); this.mSoundMap.put(pSound.getSoundID(), pSound); } @Override public boolean remove(final Sound pSound) { final boolean removed = super.remove(pSound); if (removed) { this.mSoundMap.remove(pSound.getSoundID()); } return removed; } @Override public void releaseAll() { super.releaseAll(); this.mSoundPool.release(); } @Override public synchronized void onLoadComplete(final SoundPool pSoundPool, final int pSoundID, final int pStatus) { if (pStatus == SoundManager.SOUND_STATUS_OK) { final Sound sound = this.mSoundMap.get(pSoundID); if (sound == null) { throw new SoundException("Unexpected soundID: '" + pSoundID + "'."); } else { sound.setLoaded(true); } } } // =========================================================== // Methods // =========================================================== public void onPause() { this.mSoundPool.autoPause(); } public void onResume() { this.mSoundPool.autoResume(); } // =========================================================== // Inner and Anonymous Classes // =========================================================== }
[ "renan.lobato.rheinboldt@gmail.com" ]
renan.lobato.rheinboldt@gmail.com
8cd05d37efd811b8cfb9b7a1136cefc73e74e32c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/26/26_940403c7c625d7e4a7073da45784d38e8361b617/InsertReviewFrame/26_940403c7c625d7e4a7073da45784d38e8361b617_InsertReviewFrame_s.java
e9a3b04019843ece8c62b8b1c8eec3af004326b3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,103
java
import java.awt.*; import java.awt.event.*; import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import javax.swing.*; /* * A review frame where a user can insert a review. */ public class InsertReviewFrame extends JFrame { private static Connection connection; private static PreparedStatement preparedStatement = null; JLabel label1, label2, label3, label4; JComboBox input1, input2, input3, input4; JButton saveButton, resetButton; String[] ratingChoices = {"1 - Dishaster!", "2 - Poor", "3 - Meh", "4 - Good", "5 - Great" }; String restid = ""; public InsertReviewFrame(Connection cn, final int userid) { connection = cn; setTitle("Dishaster! - New Review"); setLayout(new GridLayout(5,2)); setSize(new Dimension(400, 250)); label1 = new JLabel(" Restaurant:"); label2 = new JLabel(" Address:"); label3 = new JLabel(" Dish:"); label4 = new JLabel(" Rating:"); ArrayList<String> names = new ArrayList<String>(); try { names = GUIFrame.readDataBase("distinct name", 1, 1, ""); } catch (Exception e2) { e2.printStackTrace(); } input1 = new JComboBox(names.toArray()); input1.setSelectedItem(null); input2 = new JComboBox(); input3 = new JComboBox(); input4 = new JComboBox(); input1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { try { input2.removeAllItems(); input3.removeAllItems(); String name = (String)input1.getSelectedItem(); name = name.replace("'", "\\'"); String where = "name = '" + name + "'"; ArrayList<String> addresses = GUIFrame.readDataBase("address", 1, 1, where); for (String address : addresses) input2.addItem(address); input2.setSelectedItem(null); ArrayList<String> foods = GUIFrame.readDataBase("distinct food", 1, 3, where); for (String food : foods) input3.addItem(food); input3.setSelectedItem(null); } catch(Exception e) {} } }); input2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { try { String where = "address = '" + input2.getSelectedItem() + "'"; restid = GUIFrame.readDataBase("restaurant_id", 1, 1, where).get(0); } catch(Exception e) {} } }); input4 = new JComboBox(ratingChoices); input4.setSelectedItem(null); saveButton = new JButton("Add"); resetButton = new JButton("Reset"); add(label1); add(input1); add(label2); add(input2); add(label3); add(input3); add(label4); add(input4); add(saveButton); add(resetButton); // resets all the fields resetButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { input1.setSelectedItem(null); input2.setSelectedItem(null); input3.setSelectedItem(null); input4.setSelectedItem(null); } }); // insert new review saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { String value1 = (String) input1.getSelectedItem(); String value2 = (String) input2.getSelectedItem(); String value3 = (String) input3.getSelectedItem(); String value4 = Integer.toString(input4.getSelectedIndex() + 1); System.out.println(value1 + value2 + value3 + value4); try { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = Calendar.getInstance(); String statement = "insert into Review(reviewer_id, restaurant_id, food, rating, created) " + "values(" + userid + ", " + restid + ", '" + input3.getSelectedItem() + "', " + (input4.getSelectedIndex()+1) + ", '" + dateFormat.format(cal.getTime()) + "')"; System.out.println(statement); preparedStatement = connection.prepareStatement(statement); preparedStatement.executeUpdate(); JOptionPane.showMessageDialog(saveButton, "Successfully added."); // update the review frame table ReviewFrame.updateTable("SELECT name as restaurant, address, food, rating, created as date " + "FROM Review NATURAL JOIN Restaurant " + "WHERE reviewer_id = " + userid + " " + "ORDER BY created DESC;"); try { // update the review archive CallableStatement cStmt = connection.prepareCall("{call UpdateArchive()}"); //cStmt.setString(1, dateFormat.format(cal.getTime())); cStmt.execute(); } catch(Exception e) { JOptionPane.showMessageDialog(saveButton,"Error archiving."); } dispose(); } catch(Exception e) { JOptionPane.showMessageDialog(saveButton,"You have made this review already. If you wish to change the rating, select 'Update Review'."); } } }); setVisible(true); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8340c76029d70edb1f418106b3cc9ab6770486f5
f05d29ab5093f463a139c8e1db0da0cf754cfa86
/Android Projects/ThePeoplesKitchen/src/com/example/thepeopleskitchen/ParseFood.java
ff17554146b6dcfdd4ca5bcd3d11ca09af71eaf0
[]
no_license
skarpath/DevelopmentExamples
2e2cf8f88a9c7e54320fc4d35a389d7f6c4962f0
bf2bc615efcc1a7a7238150d84b52a2c4019e68a
refs/heads/master
2021-01-10T03:22:25.688571
2018-10-30T19:58:14
2018-10-30T19:58:14
42,538,603
0
0
null
null
null
null
UTF-8
Java
false
false
1,109
java
package com.example.thepeopleskitchen; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONObject; public class ParseFood { public ArrayList<Recipe> ParseJson(String toParse) { ArrayList<Recipe> recipes_list = new ArrayList<Recipe>(); try { JSONObject root = new JSONObject(toParse); JSONArray rarray = root.getJSONArray("recipes"); JSONObject obj; for (int i = 0; i < rarray.length(); i++) { { obj = rarray.getJSONObject(i); Recipe r = new Recipe(); r.setTitle(obj.getString("title")); r.setImage_url(obj.getString("image_url")); r.setRecipe_id(obj.getString("recipe_id")); r.setPublisher_url(obj.getString("publisher_url")); r.setPublisher(obj.getString("publisher")); r.setRecipe_url(obj.getString("f2f_url")); r.setSource_url(obj.getString("source_url")); r.setRank(obj.getString("social_rank")); recipes_list.add(r); } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } // Log.d("Parser",recipes_list.toString()); return recipes_list; } }
[ "=" ]
=
1202454e3a54da5d956b9a73c463aa1d648fb588
b3a79c99e20db39e7e0405c20bedad5a762b903e
/TaskFirebaseDatabase/app/src/main/java/com/example/appinventiv/taskfirebasedatabase/fragment/ChatFragment.java
2e0f23de6ad07eaa2223ee4bec35e1578fb4462c
[]
no_license
salonibisht/ChatApp
d108459be83beaf26f42a7335d50ac3d8f0215a5
c78e73c47a345c297e1ba40995304d49f21885f4
refs/heads/master
2020-03-07T22:42:50.958932
2018-04-02T14:25:41
2018-04-02T14:25:41
127,761,778
0
0
null
null
null
null
UTF-8
Java
false
false
5,147
java
package com.example.appinventiv.taskfirebasedatabase.fragment; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.example.appinventiv.taskfirebasedatabase.R; import com.example.appinventiv.taskfirebasedatabase.activity.ChatActivity; import com.example.appinventiv.taskfirebasedatabase.activity.LogInActivity; import com.example.appinventiv.taskfirebasedatabase.interfaces.UserInfoInterface; import com.example.appinventiv.taskfirebasedatabase.model.UserInfo; import com.example.appinventiv.taskfirebasedatabase.utility.AppConstants; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.firebase.ui.database.FirebaseRecyclerOptions; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.Unbinder; /** * A simple {@link Fragment} subclass. */ public class ChatFragment extends Fragment implements UserInfoInterface { @BindView(R.id.iv_back) ImageView ivBack; @BindView(R.id.toolbar_title) TextView toolbarTitle; Unbinder unbinder; @BindView(R.id.toolbar_profile) ImageView toolbarProfile; @BindView(R.id.rv_chat_contacts) RecyclerView rvChatContacts; private DatabaseReference mDatabasereference; private FirebaseUser firebaseUser; private Query query; private TextView tvName; private String name; private FirebaseRecyclerAdapter<UserInfo,UserViewHolder> firebaseRecyclerAdapter; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_chat, container, false); unbinder = ButterKnife.bind(this, view); toolbarTitle.setText(R.string.messages); toolbarProfile.setVisibility(View.VISIBLE); firebaseUser= FirebaseAuth.getInstance().getCurrentUser(); query = FirebaseDatabase.getInstance() .getReference() .child(AppConstants.KEY_USER); rvChatContacts.setLayoutManager(new LinearLayoutManager(getActivity())); return view; } @Override public void onDestroyView() { super.onDestroyView(); unbinder.unbind(); } @Override public void onStart() { super.onStart(); setChatAdapter(); } /** * set Adapter to show User name on inbox.... */ private void setChatAdapter() { FirebaseRecyclerOptions<UserInfo> options = new FirebaseRecyclerOptions.Builder<UserInfo>() .setQuery(query, UserInfo.class) .build(); firebaseRecyclerAdapter=new FirebaseRecyclerAdapter<UserInfo, UserViewHolder>(options) { @Override public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.view_status, parent, false); return new UserViewHolder(view); } @Override protected void onBindViewHolder(@NonNull UserViewHolder holder, int position, @NonNull UserInfo model) { holder.setName(model.getmFirstName(),model.getmSurname()); } }; firebaseRecyclerAdapter.startListening(); rvChatContacts.setAdapter(firebaseRecyclerAdapter); } @OnClick(R.id.iv_back) public void onViewClicked() { } @Override public void setOnItemClickListener(View view, int position) { Intent intent=new Intent(getActivity(),ChatActivity.class); intent.putExtra("selectedUserId",firebaseRecyclerAdapter.getRef(position).getKey()); intent.putExtra("name",name); intent.putExtra("type","inboxUser"); startActivity(intent); } public class UserViewHolder extends RecyclerView.ViewHolder { View mView; public UserViewHolder(View itemView) { super(itemView); tvName=itemView.findViewById(R.id.tv_user_name); mView=itemView; itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { setOnItemClickListener(view,getAdapterPosition()); } }); } /** * Set name present in the database to the text view in the inox.. * @param s * @param s1 */ public void setName(String s, String s1) { name=s+" "+s1; tvName.setText(s+" "+s1); } } }
[ "you@example.com" ]
you@example.com
4f8900782aedf172837d5e3f12bb360ce4913037
97b46ff38b675d934948ff3731cf1607a1cc0fc9
/DataPack/dist/game/data/scripts/transformations/AurabirdFalcon.java
7dc199c05842adc37ee4d53b28755270c287bd6f
[]
no_license
l2brutal/pk-elfo_H5
a6703d734111e687ad2f1b2ebae769e071a911a4
766fa2a92cb3dcde5da6e68a7f3d41603b9c037e
refs/heads/master
2020-12-28T13:33:46.142303
2016-01-20T09:53:10
2016-01-20T09:53:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,067
java
package transformations; import pk.elfo.gameserver.instancemanager.TransformationManager; import pk.elfo.gameserver.model.L2Transformation; import pk.elfo.gameserver.model.skills.L2Skill; public class AurabirdFalcon extends L2Transformation { private static final int[] SKILLS = new int[] { 884, 885, 886, 888, 890, 891, 894, 911, 932, 619 }; public AurabirdFalcon() { // id, colRadius, colHeight super(8, 38, 14.25); } @Override public void onTransform() { if ((getPlayer().getTransformationId() != 8) || getPlayer().isCursedWeaponEquipped()) { return; } getPlayer().setIsFlyingMounted(true); transformedSkills(); } @Override public void onUntransform() { getPlayer().setIsFlyingMounted(false); removeSkills(); } public void removeSkills() { // Air Blink getPlayer().removeSkill(L2Skill.valueOf(885, 1), false); // Exhilarate getPlayer().removeSkill(L2Skill.valueOf(894, 1), false); int lvl = getPlayer().getLevel() - 74; if (lvl > 0) { // Air Assault (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(884, lvl), false); // Air Shock Bomb (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(886, lvl), false); // Energy Storm (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(888, lvl), false); // Prodigious Flare (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(890, lvl), false); // Energy Shot (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(891, lvl), false); // Energy Burst (up to 11 levels) getPlayer().removeSkill(L2Skill.valueOf(911, lvl), false); } // Transform Dispel getPlayer().removeSkill(L2Skill.valueOf(619, 1), false); getPlayer().setTransformAllowedSkills(EMPTY_ARRAY); } public void transformedSkills() { // Air Blink if (getPlayer().getLevel() >= 75) { getPlayer().addSkill(L2Skill.valueOf(885, 1), false); } // Exhilarate if (getPlayer().getLevel() >= 83) { getPlayer().addSkill(L2Skill.valueOf(894, 1), false); } int lvl = getPlayer().getLevel() - 74; if (lvl > 0) { // Air Assault (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(884, lvl), false); // Air Shock Bomb (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(886, lvl), false); // Energy Storm (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(888, lvl), false); // Prodigious Flare (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(890, lvl), false); // Energy Shot (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(891, lvl), false); // Energy Burst (up to 11 levels) getPlayer().addSkill(L2Skill.valueOf(911, lvl), false); } // Transform Dispel getPlayer().addSkill(L2Skill.valueOf(619, 1), false); getPlayer().setTransformAllowedSkills(SKILLS); } public static void main(String[] args) { TransformationManager.getInstance().registerTransformation(new AurabirdFalcon()); } }
[ "PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba" ]
PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba
687684be9a30a812931fb31576b994ff68934dfe
47436699ac32b3b138c53f2c7931b4636ea79eb9
/server/dictionary-api/src/main/java/com/tsoft/dictionary/util/library/WordCounter.java
24d1a04904c05bd7da516d617d66e096b9b1bf8e
[]
no_license
knivit/dictionary
8108f67a9a2c066afa9d02cddec59d5f0d7668e0
d4285dec0352f124130a43e7a1acff6e053e196d
refs/heads/master
2021-01-13T02:11:44.807469
2015-03-15T13:15:31
2015-03-15T13:15:31
32,261,148
0
0
null
null
null
null
UTF-8
Java
false
false
193
java
package com.tsoft.library; public class WordCounter { private int count; public int getCount() { return count; } public void inc(int n) { count += n; } }
[ "knivit@gmail.com" ]
knivit@gmail.com
74bdd4948d927934038f714acb41c6f7c45c5aca
76875917925793ea446a1b1536606633a3272653
/evo-async-all/src/main/java/com/tazine/evo/async/spring/finish/FinishService.java
73462a2681e54fec91aca81e63fd59c7ea258854
[ "MIT" ]
permissive
BookFrank/EVO-World
01555355c434fac65406e158ffa5f7aebf3ff7dc
3d27ae414f0281668024838a4c64db4bdd4a6377
refs/heads/master
2022-06-22T05:56:43.648597
2020-05-05T15:44:32
2020-05-05T15:44:32
147,456,884
1
1
MIT
2022-06-21T02:58:35
2018-09-05T03:54:10
Java
UTF-8
Java
false
false
1,375
java
package com.tazine.evo.async.spring.finish; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.stereotype.Service; import org.springframework.util.concurrent.ListenableFuture; import java.util.Random; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** * FinishService * * @author frank * @date 2019/3/5 */ @Slf4j @Service public class FinishService { @Async public ListenableFuture<Integer> asyncProcess() { log.info("执行中"); int sec = new Random().nextInt(3); System.out.println(sec + " s"); try { TimeUnit.SECONDS.sleep(sec); } catch (InterruptedException e) { e.printStackTrace(); } return new AsyncResult<>(sec); } @Async public ListenableFuture<Integer> latchProcess(CountDownLatch latch) { log.info("执行中"); int sec = new Random().nextInt(5); System.out.println(sec + " s"); try { TimeUnit.SECONDS.sleep(sec); } catch (InterruptedException e) { e.printStackTrace(); } latch.countDown(); log.info("进行countDown,剩余 {} 个", latch.getCount()); return new AsyncResult<>(sec); } }
[ "bookfrank@foxmail.com" ]
bookfrank@foxmail.com
7c3bceafc6c60a3e94122d6262ce3c2fe8d6494f
91bac731a3ca26af7011e67602f73a3427195104
/L8.2.2/src/main/java/ru/otus/l822/NioMain.java
a8cabee246b8a5e9459605599d09c7f97f3ff173
[ "MIT" ]
permissive
kundzi/otus_java_2017_04
80ae01c6449e60fe31b1147b775794d0886747e7
417929594f9c6ffd401d088c74b1acded67e2ade
refs/heads/master
2020-12-03T00:32:54.085415
2017-08-16T20:32:36
2017-08-16T20:32:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
877
java
package ru.otus.l822; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class NioMain { public static void main(String[] args) throws Exception { try (RandomAccessFile aFile = new RandomAccessFile("data/data.txt", "rw")) { FileChannel inChannel = aFile.getChannel(); ByteBuffer buf = ByteBuffer.allocate(64); int bytesRead = inChannel.read(buf); while (bytesRead != -1) { System.out.println("Read " + bytesRead); buf.flip(); while (buf.hasRemaining()) { System.out.print((char) buf.get()); } System.out.print("\n"); buf.clear(); bytesRead = inChannel.read(buf); } } } }
[ "vitaly.chibrikov@gmail.com" ]
vitaly.chibrikov@gmail.com
8f319b84e4101a2739146ae7408e715832b93a9c
b733c258761e7d91a7ef0e15ca0e01427618dc33
/cards/src/main/java/org/rnd/jmagic/cards/LoneMissionary.java
d075bd955858c5f0967e684e9019c90ae88c78f1
[]
no_license
jmagicdev/jmagic
d43aa3d2288f46a5fa950152486235614c6783e6
40e573f8e6d1cf42603fd05928f42e7080ce0f0d
refs/heads/master
2021-01-20T06:57:51.007411
2014-10-22T03:03:34
2014-10-22T03:03:34
9,589,102
2
0
null
null
null
null
UTF-8
Java
false
false
878
java
package org.rnd.jmagic.cards; import static org.rnd.jmagic.Convenience.*; import org.rnd.jmagic.engine.*; import org.rnd.jmagic.engine.generators.*; @Name("Lone Missionary") @Types({Type.CREATURE}) @SubTypes({SubType.KOR, SubType.MONK}) @ManaCost("1W") @ColorIdentity({Color.WHITE}) public final class LoneMissionary extends Card { public static final class ETBGainLife extends EventTriggeredAbility { public ETBGainLife(GameState state) { super(state, "When Lone Missionary enters the battlefield, you gain 4 life."); this.addPattern(whenThisEntersTheBattlefield()); this.addEffect(gainLife(You.instance(), 4, "You gain 4 life.")); } } public LoneMissionary(GameState state) { super(state); this.setPower(2); this.setToughness(1); // When Lone Missionary enters the battlefield, you gain 4 life. this.addAbility(new ETBGainLife(state)); } }
[ "robyter@gmail" ]
robyter@gmail
3ba1944dede6f4f99d48c4e84791fd8e51e9cbbd
befcad493faf7d15614ff1b081e91c17496825c6
/jax-rs-linker-processor/src/test/resources/query_parameters_misdetection/PeopleResource.java
bd6b49bb95304c474ea84dbe11360e77e14a8277
[ "MIT" ]
permissive
vidal-community/jax-rs-linker
1dd465a46e7cae037bc7733299bb26ff18dac00a
1572ca9a139b6535b4328cc73952097273354bde
refs/heads/master
2023-04-12T09:56:36.878128
2022-07-25T12:39:53
2022-07-25T12:46:39
27,789,592
2
0
MIT
2023-02-27T11:57:46
2014-12-09T22:06:36
Java
UTF-8
Java
false
false
1,130
java
package query_parameters_misdetection; import fr.vidal.oss.jax_rs_linker.api.Self; import fr.vidal.oss.jax_rs_linker.api.SubResource; import javax.ws.rs.*; public class PeopleResource { @GET @Path("/{id}") @Self public Stuff searchById(@PathParam("id") Integer id) { return null; } @GET @Path("/{id}/friends") @SubResource(value = PeopleResource.class, qualifier = "friends") public Stuff findFriendsFilteredByCityOrCountry(@PathParam("id") Integer id, @BeanParam Localization localization) { return null; } private static class Stuff {} private static class Localization { private final String country; private final String city; public Localization(@QueryParam("pays") String country, @QueryParam("ville") String city) { this.country = country; this.city = city; } public String getCountry() { return country; } public String getCity() { return city; } } }
[ "florent.biville@gmail.com" ]
florent.biville@gmail.com
cecd28595edbccd605659d9c187d458c82c65d93
015fa633ea034d2be6aaa92aa3e1c663b38877e9
/src/main/java/array/others/poisk_v_otsortirovanom_masive/ArraySearching.java
5b739a1d2dee161934c822815bd93cd94d78addb
[]
no_license
programming-practices/java-core
b510a5104f417e670d74b94d62b6beff8d829b44
7680e92adc6bb9310ecc401b3768fc66b3ee66c2
refs/heads/main
2023-03-15T09:44:59.469839
2021-03-01T11:53:50
2021-03-01T11:53:50
303,077,639
1
0
null
null
null
null
UTF-8
Java
false
false
999
java
package array.others.poisk_v_otsortirovanom_masive; import array.others.heneratoru_dannux.RandomGenerator; import array.others.primenenie_heneratorov_dlya_sozdania_masivov.ConvertTo; import array.others.primenenie_heneratorov_dlya_sozdania_masivov.Generated; import others.entities.Generator; import java.util.Arrays; public class ArraySearching { public static void main(String[] args) { Generator<Integer> gen = new RandomGenerator.Integer(1000); int[] a = ConvertTo.primitive(Generated.array(new Integer[25], gen)); Arrays.sort(a); System.out.println("Sorted array: " + Arrays.toString(a)); while (true) { int r = gen.next(); int location = Arrays.binarySearch(a, r); if (location >= 0) { System.out.println("Location of " + r + " is " + location + ", a[" + location + "] = " + a[location]); break; // Out of while loop } } } }
[ "tsyupryk.roman@gmail.com" ]
tsyupryk.roman@gmail.com
080d7cba61e3edc5a96e27d9c6686d2dae40e405
4e828f3aec1018c7cdf9ccc9d9f5e6148502e10f
/chapter7-rpc/rpc-transporter/client-api/src/main/java/com/wuhulala/rpc/client/exception/TimeoutException.java
438dcb35af3f8192004b740065dbc1627a2e02a0
[]
no_license
Anthony-byte/netty-action
03b92f3eb3adc3dff868190235f601dd1c88d222
787421ca46655d2ee20bd5c206374b14d20d62e3
refs/heads/master
2023-03-10T07:44:22.990100
2021-02-18T06:24:45
2021-02-18T06:24:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.wuhulala.rpc.client.exception; import io.netty.channel.Channel; import java.net.InetSocketAddress; /** * TimeoutException. (API, Prototype, ThreadSafe) * * @export * @see org.apache.dubbo.remoting.exchange.support.DefaultFuture#get() */ public class TimeoutException extends RemotingException { public static final int CLIENT_SIDE = 0; public static final int SERVER_SIDE = 1; private static final long serialVersionUID = 3122966731958222692L; private final int phase; public TimeoutException(boolean serverSide, Channel channel, String message) { super(channel, message); this.phase = serverSide ? SERVER_SIDE : CLIENT_SIDE; } public TimeoutException(boolean serverSide, InetSocketAddress localAddress, InetSocketAddress remoteAddress, String message) { super(localAddress, remoteAddress, message); this.phase = serverSide ? SERVER_SIDE : CLIENT_SIDE; } public int getPhase() { return phase; } public boolean isServerSide() { return phase == 1; } public boolean isClientSide() { return phase == 0; } }
[ "370031044@qq.com" ]
370031044@qq.com
6ba3c24c3a0d6e484f388459687197511805ccc2
09d0ddd512472a10bab82c912b66cbb13113fcbf
/TestApplications/WhereYouGo-0.9.3-beta/DecompiledCode/Fernflower/src/main/java/menion/android/whereyougo/gui/extension/DataInfo.java
84e689d15ec9fe4c097c0129d49ff3ea0525918f
[]
no_license
sgros/activity_flow_plugin
bde2de3745d95e8097c053795c9e990c829a88f4
9e59f8b3adacf078946990db9c58f4965a5ccb48
refs/heads/master
2020-06-19T02:39:13.865609
2019-07-08T20:17:28
2019-07-08T20:17:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,235
java
package menion.android.whereyougo.gui.extension; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import menion.android.whereyougo.geo.location.Location; public class DataInfo implements Comparable { private static final String TAG = "DataInfo"; public Object addData01; public Object addData02; private double azimuth; private String description; private double distance; public boolean enabled; private int id; private int image; private Bitmap imageB; private Drawable imageD; private Bitmap imageRight; private String name; public double value01; public double value02; public DataInfo(int var1, String var2) { this(var1, var2, "", -1); } public DataInfo(int var1, String var2, Bitmap var3) { this(var1, var2, "", var3); } public DataInfo(int var1, String var2, String var3) { this(var1, var2, var3, -1); } public DataInfo(int var1, String var2, String var3, int var4) { this.enabled = true; this.distance = -1.0D; this.azimuth = -1.0D; this.setBasics(var1, var2, var3); this.image = var4; } public DataInfo(int var1, String var2, String var3, Bitmap var4) { this.enabled = true; this.distance = -1.0D; this.azimuth = -1.0D; this.setBasics(var1, var2, var3); this.imageB = var4; } public DataInfo(int var1, String var2, String var3, Drawable var4) { this.enabled = true; this.distance = -1.0D; this.azimuth = -1.0D; this.setBasics(var1, var2, var3); this.imageD = var4; } public DataInfo(String var1) { this(-1, var1, "", -1); } public DataInfo(String var1, String var2) { this(-1, var1, var2, -1); } public DataInfo(String var1, String var2, int var3) { this(-1, var1, var2, var3); } public DataInfo(String var1, String var2, Bitmap var3) { this(-1, var1, var2, (Bitmap)var3); } public DataInfo(String var1, String var2, Drawable var3) { this(-1, var1, var2, (Drawable)var3); } public DataInfo(String var1, String var2, Object var3) { this(-1, var1, var2, -1); this.addData01 = var3; } public DataInfo(DataInfo var1) { this.enabled = true; this.distance = -1.0D; this.azimuth = -1.0D; this.id = var1.id; this.name = var1.name; this.description = var1.description; this.image = var1.image; this.imageD = var1.imageD; this.imageB = var1.imageB; this.imageRight = var1.imageRight; this.value01 = var1.value01; this.value02 = var1.value02; this.distance = var1.distance; this.addData01 = var1.addData01; } private void setBasics(int var1, String var2, String var3) { this.id = var1; this.name = var2; this.description = var3; this.image = -1; this.imageD = null; this.imageB = null; this.imageRight = null; } public void addDescription(String var1) { if (this.description != null && this.description.length() != 0) { this.description = this.description + ", " + var1; } else { this.description = var1; } } public void clearDistAzi() { this.distance = -1.0D; } public int compareTo(DataInfo var1) { return this.name.compareTo(var1.getName()); } public String getDescription() { return this.description; } public int getId() { return this.id; } public int getImage() { return this.image; } public Bitmap getImageB() { return this.imageB; } public Drawable getImageD() { return this.imageD; } public Bitmap getImageRight() { return this.imageRight; } public Location getLocation() { Location var1 = new Location("DataInfo"); var1.setLatitude(this.value01); var1.setLongitude(this.value02); return var1; } public String getName() { return this.name; } public boolean isDistAziSet() { boolean var1; if (this.distance != -1.0D) { var1 = true; } else { var1 = false; } return var1; } public DataInfo setAddData01(Object var1) { this.addData01 = var1; return this; } public void setCoordinates(double var1, double var3) { this.value01 = var1; this.value02 = var3; } public void setDescription(String var1) { this.description = var1; } public void setDistAzi(float var1, float var2) { this.distance = (double)var1; this.azimuth = (double)var2; } public void setDistAzi(Location var1) { Location var2 = this.getLocation(); this.distance = (double)var1.distanceTo(var2); this.azimuth = (double)var1.bearingTo(var2); } public void setId(int var1) { this.id = var1; } public void setImage(int var1) { this.image = var1; } public void setImage(Bitmap var1) { this.imageB = var1; } public DataInfo setImageRight(Bitmap var1) { this.imageRight = var1; return this; } public void setName(String var1) { this.name = var1; } public String toString() { return this.getName(); } }
[ "crash@home.home.hr" ]
crash@home.home.hr
94d449ef0515096de35517414292f4a9b8d11c54
baba7ae4f32f0e680f084effcd658890183e7710
/MutationFramework/muJava/src/mujava/cmd/MutantsGenerator.java
bfa7dbd5c6822abbe76736f4b01e80d769b28183
[ "Apache-2.0" ]
permissive
TUBS-ISF/MutationAnalysisForDBC-FormaliSE21
75972c823c3c358494d2a2e9ec12e0a00e26d771
de825bc9e743db851f5ec1c5133dca3f04d20bad
refs/heads/main
2023-04-22T21:29:28.165271
2021-05-17T07:43:22
2021-05-17T07:43:22
368,096,901
0
0
null
null
null
null
UTF-8
Java
false
false
7,101
java
/** * Copyright (C) 2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package src.mujava.cmd; import java.io.*; import src.mujava.*; import src.mujava.util.Debug; /** * <p> * Description: * </p> * * @author Jeff Offutt and Yu-Seung Ma * @version 1.0 * */ public class MutantsGenerator { static public void generateMutants(String[] file_names){ generateMutants(file_names,MutationSystem.cm_operators, MutationSystem.tm_operators); } static public void generateClassMutants(String[] file_names){ generateMutants(file_names,MutationSystem.cm_operators, null); } static public void generateClassMutants(String[] file_names, String[] class_ops){ generateMutants(file_names,class_ops, null); } static public void generateTraditionalMutants(String[] file_names){ generateMutants(file_names, null, MutationSystem.tm_operators); } static public void generateTraditionalMutants(String[] file_names,String[] traditional_ops){ generateMutants(file_names, null,traditional_ops ); } static public void generateMutants(String[] file_names, String[] class_ops, String[] traditional_ops){ // file_names = Relative path from MutationSystem.SRC_PATH String file_name; for(int i=0;i<file_names.length;i++){ file_name = file_names[i]; System.out.println(file_name); try{ System.out.println(i+" : " +file_name); String temp = file_name.substring(0,file_name.length()-".java".length()); String class_name=""; for(int ii=0;ii<temp.length();ii++){ if( (temp.charAt(ii)=='\\') || (temp.charAt(ii)=='/') ){ class_name = class_name + "."; }else{ class_name = class_name + temp.charAt(ii); } } // Class c = Class.forName(class_name); int class_type = MutationSystem.getClassType(class_name); if(class_type==MutationSystem.NORMAL){ }else if(class_type==MutationSystem.MAIN){ System.out.println(" -- " + file_name+ " class contains 'static void main()' method."); System.out.println(" Pleas note that mutants are not generated for the 'static void main()' method"); }else{ switch(class_type){ case MutationSystem.MAIN : System.out.println(" -- Can't apply because " + file_name+ " contains only 'static void main()' method."); break; case MutationSystem.INTERFACE : System.out.println(" -- Can't apply because " + file_name+ " is 'interface' "); break; case MutationSystem.ABSTRACT : System.out.println(" -- Can't apply because " + file_name+ " is 'abstract' class "); break; case MutationSystem.APPLET : System.out.println(" -- Can't apply because " + file_name+ " is 'applet' class "); break; case MutationSystem.GUI : System.out.println(" -- Can't apply because " + file_name+ " is 'GUI' class "); break; } deleteDirectory(); continue; } // [2] Apply mutation testing setMutationSystemPathFor(file_name); //File[] original_files = new File[1]; //original_files[0] = new File(MutationSystem.SRC_PATH,file_name); File original_file = new File(MutationSystem.SRC_PATH,file_name); AllMutantsGenerator genEngine; Debug.setDebugLevel(3); genEngine = new AllMutantsGenerator(original_file,class_ops,traditional_ops); genEngine.makeMutants(); genEngine.compileMutants(); }catch(OpenJavaException oje){ System.out.println("[OJException] " + file_name + " " + oje.toString()); //System.out.println("Can't generate mutants for " +file_name + " because OpenJava " + oje.getMessage()); deleteDirectory(); }catch(Exception exp){ System.out.println("[Exception] " + file_name + " " + exp.toString()); exp.printStackTrace(); //System.out.println("Can't generate mutants for " +file_name + " due to exception" + exp.getClass().getName()); //exp.printStackTrace(); deleteDirectory(); }catch(Error er){ System.out.println("[Error] " + file_names + " " + er.toString()); //System.out.println("Can't generate mutants for " +file_name + " due to error" + er.getClass().getName()); deleteDirectory(); } } } static void setMutationSystemPathFor(String file_name){ try{ String temp; temp = file_name.substring(0,file_name.length()-".java".length()); temp = temp.replace('/','.'); temp = temp.replace('\\','.'); int separator_index = temp.lastIndexOf("."); if(separator_index>=0){ MutationSystem.CLASS_NAME=temp.substring(separator_index+1,temp.length()); }else{ MutationSystem.CLASS_NAME = temp; } String mutant_dir_path = MutationSystem.MUTANT_HOME+"/"+temp; File mutant_path = new File(mutant_dir_path); mutant_path.mkdir(); String class_mutant_dir_path = mutant_dir_path + "/" + MutationSystem.CM_DIR_NAME; File class_mutant_path = new File(class_mutant_dir_path); class_mutant_path.mkdir(); String traditional_mutant_dir_path = mutant_dir_path + "/" + MutationSystem.TM_DIR_NAME; File traditional_mutant_path = new File(traditional_mutant_dir_path); traditional_mutant_path.mkdir(); String original_dir_path = mutant_dir_path + "/" + MutationSystem.ORIGINAL_DIR_NAME; File original_path = new File(original_dir_path); original_path.mkdir(); MutationSystem.CLASS_MUTANT_PATH = class_mutant_dir_path; MutationSystem.TRADITIONAL_MUTANT_PATH = traditional_mutant_dir_path; MutationSystem.ORIGINAL_PATH = original_dir_path; MutationSystem.DIR_NAME = temp; }catch(Exception e){ System.err.println(e); } } static void deleteDirectory(){ File originalDir = new File(MutationSystem.MUTANT_HOME+"/"+MutationSystem.DIR_NAME + "/" + MutationSystem.ORIGINAL_DIR_NAME); while(originalDir.delete()){ } File cmDir = new File(MutationSystem.MUTANT_HOME+"/"+MutationSystem.DIR_NAME + "/" + MutationSystem.CM_DIR_NAME); while(cmDir.delete()){} File tmDir = new File(MutationSystem.MUTANT_HOME+"/"+MutationSystem.DIR_NAME + "/" + MutationSystem.TM_DIR_NAME); while(tmDir.delete()){} File myHomeDir = new File(MutationSystem.MUTANT_HOME+"/"+MutationSystem.DIR_NAME); while(myHomeDir.delete()){} } }
[ "a.knueppel@tu-bs.de" ]
a.knueppel@tu-bs.de
9f35b298740215f08648253291270cb27e1637da
68aa73a83994e7ab5f87a1362c1ad50a355d6d42
/io7m-blueberry-test-data/src/main/java/com/io7m/blueberry/test_data/TestAssumptionFailedWithOutput.java
4b0a4730984b90b06b887913fa7c9249ff8b9022
[]
no_license
io7m/blueberry
1c543e8407d904496bc4fbb8b9f2de99961bfd01
ac8ea47d306e8a5fcb88f21b12033b2806fc051d
refs/heads/develop
2021-01-18T23:26:35.614725
2018-06-04T14:31:40
2018-06-04T14:31:40
41,603,738
0
1
null
2017-01-05T21:45:59
2015-08-29T18:49:05
Java
UTF-8
Java
false
false
1,380
java
/* * Copyright © 2014 <code@io7m.com> http://io7m.com * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package com.io7m.blueberry.test_data; import org.junit.Assume; import org.junit.Test; /** * A class containing a method with a failed assumption that produces output * before the failure. * * This is test suite data and not intended for use by developers. */ @SuppressWarnings("static-method") public final class TestAssumptionFailedWithOutput { /** * Default constructor. */ public TestAssumptionFailedWithOutput() { } /** * A test. */ @Test public void testPassOne() { System.out.println("Some output"); Assume.assumeTrue(false); } }
[ "code@io7m.com" ]
code@io7m.com
9852e71f8433d65eb883ce5c5ef7aa184717f6de
e9cefd4737fd99c4eeb7f97b2ef3f8eced2163cb
/GoogleMapsApp/app/src/main/java/com/romellbolton/googlemapsapp/MapsActivity.java
b8a17ae1ab098cffb09dfd0a2503d3caadd7359d
[]
no_license
rrbolton423/ECEN-485-App-Development-for-Android-Devices
ad9e2f42475dc95133c7d4f7fe23931de151a1fe
4cd9a8897731ae0641705326cbc1cc4bd523512f
refs/heads/master
2021-05-12T10:08:52.823284
2018-05-02T19:30:56
2018-05-02T19:30:56
117,346,278
2
1
null
null
null
null
UTF-8
Java
false
false
2,360
java
package com.romellbolton.googlemapsapp; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; // Have MapActivity extend FragmentActivity and implement the OnMapReadyCallback interface public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { // Define an instance of GoogleMap private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); // Use the MapFragment's getMapAsync() method to get notified when the map fragment // is ready to be used. mapFragment.getMapAsync(this); } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Chicago, Illinois. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { // Instantiate a GoogleMap mMap = googleMap; // Create a LatLang object, specifying the coordinates of Chicago, IL LatLng chicago = new LatLng(41.850033, - 87.6500523); // Add a marker in Chicago using the LatLang object and // set the title of the marker to "Marker in Chicago" mMap.addMarker(new MarkerOptions().position(chicago).title("Marker in Chicago")); // Move the camera to the location of the LatLang object, i.e. Chicago mMap.moveCamera(CameraUpdateFactory.newLatLng(chicago)); } }
[ "user.email" ]
user.email
5867322c0ab3d52cb4939cba8aa407359ded911b
14c8213abe7223fe64ff89a47f70b0396e623933
/javassist/util/proxy/ProxyFactory$3.java
92cb63caa87996c65c1a950b8861c3b4bc516fc7
[ "MIT" ]
permissive
PolitePeoplePlan/backdoored
c804327a0c2ac5fe3fbfff272ca5afcb97c36e53
3928ac16a21662e4f044db9f054d509222a8400e
refs/heads/main
2023-05-31T04:19:55.497741
2021-06-23T15:20:03
2021-06-23T15:20:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
440
java
package javassist.util.proxy; import java.util.*; static final class ProxyFactory$3 implements Comparator { ProxyFactory$3() { super(); } @Override public int compare(final Object a1, final Object a2) { final Map.Entry v1 = (Map.Entry)a1; final Map.Entry v2 = (Map.Entry)a2; final String v3 = v1.getKey(); final String v4 = v2.getKey(); return v3.compareTo(v4); } }
[ "66845682+chrispycreme420@users.noreply.github.com" ]
66845682+chrispycreme420@users.noreply.github.com
0d4f4cc3c8abf71212c49922d9481dafc82831be
64d383a904007a939eb90e9e1b3b85d5b1c67794
/aliyun-java-sdk-vod/src/main/java/com/aliyuncs/vod/model/v20170321/SubmitAIVideoCensorJobRequest.java
2fd28d0aea5a8365983477a3c284afbcd0f7a7dd
[ "Apache-2.0" ]
permissive
15271091213/aliyun-openapi-java-sdk
ff76968c2f28a4e13b0002aea55af1de2c79fa4e
9dabde5f53ae890769feb5fff3a69dfc566a974d
refs/heads/master
2020-03-06T14:42:23.803542
2018-03-27T04:32:26
2018-03-27T04:32:26
126,940,526
1
0
null
2018-03-27T06:38:21
2018-03-27T06:38:21
null
UTF-8
Java
false
false
3,309
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.vod.model.v20170321; import com.aliyuncs.RpcAcsRequest; /** * @author auto create * @version */ public class SubmitAIVideoCensorJobRequest extends RpcAcsRequest<SubmitAIVideoCensorJobResponse> { public SubmitAIVideoCensorJobRequest() { super("vod", "2017-03-21", "SubmitAIVideoCensorJob", "vod"); } private String userData; private String resourceOwnerId; private String aIVideoCensorConfig; private String resourceOwnerAccount; private String ownerAccount; private String ownerId; private String mediaId; public String getUserData() { return this.userData; } public void setUserData(String userData) { this.userData = userData; if(userData != null){ putQueryParameter("UserData", userData); } } public String getResourceOwnerId() { return this.resourceOwnerId; } public void setResourceOwnerId(String resourceOwnerId) { this.resourceOwnerId = resourceOwnerId; if(resourceOwnerId != null){ putQueryParameter("ResourceOwnerId", resourceOwnerId); } } public String getAIVideoCensorConfig() { return this.aIVideoCensorConfig; } public void setAIVideoCensorConfig(String aIVideoCensorConfig) { this.aIVideoCensorConfig = aIVideoCensorConfig; if(aIVideoCensorConfig != null){ putQueryParameter("AIVideoCensorConfig", aIVideoCensorConfig); } } public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } public void setResourceOwnerAccount(String resourceOwnerAccount) { this.resourceOwnerAccount = resourceOwnerAccount; if(resourceOwnerAccount != null){ putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount); } } public String getOwnerAccount() { return this.ownerAccount; } public void setOwnerAccount(String ownerAccount) { this.ownerAccount = ownerAccount; if(ownerAccount != null){ putQueryParameter("OwnerAccount", ownerAccount); } } public String getOwnerId() { return this.ownerId; } public void setOwnerId(String ownerId) { this.ownerId = ownerId; if(ownerId != null){ putQueryParameter("OwnerId", ownerId); } } public String getMediaId() { return this.mediaId; } public void setMediaId(String mediaId) { this.mediaId = mediaId; if(mediaId != null){ putQueryParameter("MediaId", mediaId); } } @Override public Class<SubmitAIVideoCensorJobResponse> getResponseClass() { return SubmitAIVideoCensorJobResponse.class; } }
[ "haowei.yao@alibaba-inc.com" ]
haowei.yao@alibaba-inc.com
840c558955ab8dd82353998c255d307eed1dde61
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/14/14_c28ba180ec842856c39d1c778be7f8682097c05f/NewWorklogNotificationBuilder/14_c28ba180ec842856c39d1c778be7f8682097c05f_NewWorklogNotificationBuilder_t.java
f2994237f20636327487965bd0aebcf0aa5f00a1
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,737
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.tadamski.arij.worklog.notification; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.BitmapFactory; import android.support.v4.app.NotificationCompat; import com.tadamski.arij.R; import com.tadamski.arij.account.service.LoginInfo; import com.tadamski.arij.issue.dao.Issue; import com.tadamski.arij.worklog.activity.NewWorklogActivity_; import java.text.DateFormat; import java.util.Date; /** * @author tmszdmsk */ public class NewWorklogNotificationBuilder { private static final DateFormat TIME_FORMAT = DateFormat.getTimeInstance(DateFormat.SHORT); private static int NOTIFICATION_ID = 12366234; private static int PENDING_REQUETS_ID = 0; public static void createNotification(Context ctx, Issue issue, Date startDate, LoginInfo loginInfo) { NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE); Intent intent = NewWorklogActivity_.intent(ctx) .issue(issue) .loginInfo(loginInfo) .startDate(startDate) .flags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS).get(); Notification notification = new NotificationCompat.Builder(ctx). setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_stat_new_worklog)). setSmallIcon(R.drawable.ic_stat_new_worklog). setOngoing(true). setContentTitle(issue.getSummary().getKey() + ": " + issue.getSummary().getSummary()). setAutoCancel(false). setContentText("Started at: " + TIME_FORMAT.format(startDate)). setContentIntent(PendingIntent.getActivity(ctx, PENDING_REQUETS_ID++, intent, PendingIntent.FLAG_CANCEL_CURRENT)). setTicker("Work on " + issue.getSummary().getKey() + " started"). getNotification(); notificationManager.notify(issue.getSummary().getKey(), NOTIFICATION_ID, notification); } public static void cancelNotification(Context ctx, String issueKey) { NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancel(issueKey, NOTIFICATION_ID); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
490a40a1eedfb02df9e4e49d9d9f11fab48898a5
d4627ad44a9ac9dfb444bd5d9631b25abe49c37e
/net/divinerpg/item/overworld/ItemSlimeSword.java
4076ed6554247f94f8f1bc0b039f82229a66b769
[]
no_license
Scrik/Divine-RPG
0c357acf374f0ca7fab1f662b8f305ff0e587a2f
f546f1d60a2514947209b9eacdfda36a3990d994
refs/heads/master
2021-01-15T11:14:03.426172
2014-02-19T20:27:30
2014-02-19T20:27:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,114
java
package net.divinerpg.item.overworld; import net.divinerpg.helper.base.ItemDivineRPGSword; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemSlimeSword extends ItemDivineRPGSword { private int weaponDamage; private final EnumToolMaterial field_40439_b; public ItemSlimeSword(int var1, EnumToolMaterial var2) { super(var1, var2); this.field_40439_b = var2; this.maxStackSize = 1; this.setMaxDamage(1000); this.weaponDamage = 11; this.registerItemTexture("SlimeSword"); } /** * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if * sword */ @Override public float getStrVsBlock(ItemStack var1, Block var2) { return var2.blockID != Block.web.blockID ? 1.5F : 15.0F; } /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */ public boolean hitEntity(ItemStack var1, EntityLiving var2, EntityLiving var3) { var1.damageItem(1, var3); return true; } public boolean onBlockDestroyed(ItemStack var1, int var2, int var3, int var4, int var5, EntityLiving var6) { var1.damageItem(2, var6); return true; } /** * Returns the damage against a given entity. */ public int getDamageVsEntity(Entity var1) { return this.weaponDamage; } /** * Returns True is the item is renderer in full 3D when hold. */ @Override public boolean isFull3D() { return true; } /** * returns the action that specifies what animation to play when the items is being used */ @Override public EnumAction getItemUseAction(ItemStack var1) { return EnumAction.block; } /** * How long it takes to use or consume an item */ @Override public int getMaxItemUseDuration(ItemStack var1) { return 72000; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ @Override public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); return var1; } /** * Returns if the item (tool) can harvest results from the block type. */ @Override public boolean canHarvestBlock(Block var1) { return var1.blockID == Block.web.blockID; } /** * Return the enchantability factor of the item, most of the time is based on material. */ @Override public int getItemEnchantability() { return this.field_40439_b.getEnchantability(); } }
[ "brock.kerley@hotmail.com" ]
brock.kerley@hotmail.com
c1145ee934e3bf03153b8c1c590864b0b841d160
6f67d6b6e31e97d578c5cf8f3d29bfddde05d489
/core/src/main/java/com/novoda/imageloader/core/bitmap/BitmapUtil.java
92f3cff819a2892a7759e2e607ac4261da40542f
[ "Apache-2.0" ]
permissive
pratikvarma/ImageLoader
fd277bb10aa2ce6c46f0a554e5c682c18371d1f1
983389f5c6c97be2f09c46bda99c66b43cc84a06
refs/heads/master
2021-01-15T17:46:42.855250
2012-05-02T09:20:07
2012-05-02T09:20:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,114
java
/** * Copyright 2012 Novoda Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.novoda.imageloader.core.bitmap; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import com.novoda.imageloader.core.model.ImageWrapper; public class BitmapUtil { private static final int BUFFER_SIZE = 64 * 1024; public Bitmap decodeFileAndScale(File f, int width, int height) { updateLastModifiedForCache(f); int suggestedSize = height; if (width > height) { suggestedSize = height; } Bitmap unscaledBitmap = decodeFile(f, suggestedSize); if (unscaledBitmap == null) { return null; } return scaleBitmap(unscaledBitmap, width, height); } public Bitmap scaleResourceBitmap(Context c, int width, int height, int resourceId) { Bitmap b = null; try { b = BitmapFactory.decodeResource(c.getResources(), resourceId); return scaleBitmap(b, width, height); } catch (final Throwable e) { System.gc(); } return null; } public Bitmap scaleBitmap(Bitmap b, int width, int height) { int imageHeight = b.getHeight(); int imageWidth = b.getWidth(); if (imageHeight <= height && imageWidth <= width) { return b; } int finalWidth = width; int finalHeight = height; if (imageHeight > imageWidth) { float factor = ((float) height) / ((float) imageHeight); finalHeight = new Float(imageHeight * factor).intValue(); finalWidth = new Float(imageWidth * factor).intValue(); } else { float factor = ((float) width) / ((float) imageWidth); finalHeight = new Float(imageHeight * factor).intValue(); finalWidth = new Float(imageWidth * factor).intValue(); } Bitmap scaled = null; try { scaled = Bitmap.createScaledBitmap(b, finalWidth, finalHeight, true); } catch (final Throwable e) { System.gc(); } recycle(b); return scaled; } public Bitmap scaleResourceBitmap(ImageWrapper w, int resId) { return scaleResourceBitmap(w.getContext(), w.getWidth(), w.getHeight(), resId); } private void recycle(Bitmap scaled) { try { scaled.recycle(); } catch (Exception e) { // } } private void updateLastModifiedForCache(File f) { f.setLastModified(System.currentTimeMillis()); } private Bitmap decodeFile(File f, int suggestedSize) { Bitmap bitmap = null; FileInputStream fis = null; try { int scale = evaluateScale(f, suggestedSize); final BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = scale; options.inTempStorage = new byte[BUFFER_SIZE]; options.inPurgeable = true; fis = new FileInputStream(f); bitmap = BitmapFactory.decodeStream(fis, null, options); } catch (final Throwable e) { System.gc(); } finally { closeSilently(fis); } return bitmap; } private int evaluateScale(File f, int suggestedSize) { final BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; decodeFileToPopulateOptions(f, o); return calculateScale(suggestedSize, o.outWidth, o.outHeight); } private void decodeFileToPopulateOptions(File f, final BitmapFactory.Options o) { FileInputStream fis = null; try { fis = new FileInputStream(f); BitmapFactory.decodeStream(fis, null, o); closeSilently(fis); } catch (final Throwable e) { System.gc(); } finally { closeSilently(fis); } } private void closeSilently(Closeable c) { try { if (c != null) { c.close(); } } catch (Exception e) { } } private int calculateScale(final int requiredSize, int widthTmp, int heightTmp) { int scale = 1; while (true) { if ((widthTmp / 2) < requiredSize || (heightTmp / 2) < requiredSize) { break; } widthTmp /= 2; heightTmp /= 2; scale *= 2; } return scale; } }
[ "luigi.agosti@gmail.com" ]
luigi.agosti@gmail.com
36163a35d32f7132c5505bcd871a36ba8e404f04
8979fc82ea7b34410b935fbea0151977a0d46439
/src/company/ibm/oa/MinSwaps.java
511b32d69680653e9063abf22cd5c284960a7480
[ "MIT" ]
permissive
YC-S/LeetCode
6fa3f4e46c952b3c6bf5462a8ee0c1186ee792bd
452bb10e45de53217bca52f8c81b3034316ffc1b
refs/heads/master
2021-11-06T20:51:31.554936
2021-10-31T03:39:38
2021-10-31T03:39:38
235,529,949
1
0
null
null
null
null
UTF-8
Java
false
false
1,484
java
package company.ibm.oa; import java.util.Arrays; import java.util.List; public class MinSwaps { static int findMinSwaps(List<Integer> arr) { int n = arr.size(); // Array to store count of zeroes int[] noOfZeroes = new int[n]; int[] noOfOnes = new int[n]; int i, count1 = 0, count2 = 0; // Count number of zeroes // on right side of every one. noOfZeroes[n - 1] = 1 - arr.get(n - 1); for (i = n - 2; i >= 0; i--) { noOfZeroes[i] = noOfZeroes[i + 1]; if (arr.get(i) == 0) noOfZeroes[i]++; } // Count total number of swaps by adding number // of zeroes on right side of every one. for (i = 0; i < n; i++) { if (arr.get(i) == 1) count1 += noOfZeroes[i]; } noOfOnes[0] = 1 - arr.get(0); for (i = 1; i < n; ++i) { noOfOnes[i] = noOfOnes[i - 1]; if (arr.get(i) == 1) { noOfOnes[i]++; } } for (i = 0; i < n; ++i) { if (arr.get(i) == 0) { count2 += noOfOnes[i]; } } return Math.min(count1, count2); } // Driver Code public static void main(String[] args) { List<Integer> arr = Arrays.asList(0, 0, 1, 0, 1, 0, 1, 1); List<Integer> arr1 = Arrays.asList(1, 1, 1, 1, 0, 0, 0, 0); System.out.println(findMinSwaps(arr1)); } }
[ "yuanchenshi@gmail.com" ]
yuanchenshi@gmail.com
d4d997d726508c06487eb17af6d8bc451f010495
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/no_seeding/99_newzgrabber-Newzgrabber.NewsFile-1.0-3/Newzgrabber/NewsFile_ESTest_scaffolding.java
1e2cccc91de3e242e03580868f81b1a68eb6b946
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
526
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Oct 28 16:28:46 GMT 2019 */ package Newzgrabber; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class NewsFile_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
c9785a3aabf9d20273d47a8f75a191966d4eb954
a3c35547dc3a0b14e102943836e5aa1b80fda48c
/src/main/java/com/gaussic/repository/dcs_history/H089Rep.java
97dfae21fa6336e0ffd9c2c94b97ed8a1b796d5c
[ "MIT" ]
permissive
sumerJY100/SpringMVCDemo
679b91191bf2b9b4c48ba5ee6e6a83b5e254a71e
e120fb29e64ada03e69afe248a5675cbe5f3017c
refs/heads/master
2020-03-21T17:12:43.766644
2018-11-12T01:02:34
2018-11-12T01:02:34
138,820,041
0
0
null
2018-06-27T02:36:30
2018-06-27T02:36:30
null
UTF-8
Java
false
false
409
java
package com.gaussic.repository.dcs_history; import com.gaussic.model.dcs_history.H089Pojo; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.sql.Timestamp; import java.util.List; @Repository public interface H089Rep extends JpaRepository<H089Pojo,Long> { List<H089Pojo> findByVTimeBetween(Timestamp begin, Timestamp end); }
[ "15210365768@163.com" ]
15210365768@163.com
b7ada667a4eca634c770941d896beb4ce7f79608
dd52fad49c285bf6d759b35f24ad466a6aaa67a7
/PTN_Server(2015)/src/com/nms/drivechenxiao/service/bean/porteth/ac/AcObject.java
e99e15aa4b62e7a0c1d11c500b1f67b854934c91
[]
no_license
pengchong1989/sheb_serice
a5c46113f822342dfe98c5c232b5df21cb1ac6b6
3ce6550e8eb39f38871b4481af2987f238a368da
refs/heads/master
2021-08-30T05:52:24.235809
2017-12-16T08:47:06
2017-12-16T08:47:06
114,067,650
0
0
null
null
null
null
UTF-8
Java
false
false
7,019
java
package com.nms.drivechenxiao.service.bean.porteth.ac; import com.nms.drivechenxiao.service.bean.oam.OamObject; import com.nms.drivechenxiao.service.bean.pweth.service.ELanServiceObject; import com.nms.drivechenxiao.service.bean.pweth.service.ETreeServiceObject; import com.nms.drivechenxiao.service.bean.pweth.service.ElineServiceObject; public class AcObject { private ElineServiceObject eline = new ElineServiceObject(); private ELanServiceObject elan = new ELanServiceObject(); private ETreeServiceObject etree = new ETreeServiceObject(); private OamObject oam = new OamObject(); private String name = "";// 名称 ** private String ethacout = ""; private String ifname = "";// 接口名 ** private String ifindex = "";// 接口索引值 private String desc = "";// 接口描述 private String admin = "";// 接口管理状态 private String oper = "";// 接口工作状态 private String perprofile = "";// 性能profile名字 private String ref = "";// private String l3iifhwres = "";// private String mode = "";// ETHAC 模式 端口模式值'port' vlan模式值'port_plus_spvlan' private String spvlan = "";// 运营商VLANID ** private String cevlan = "";// 客户VLANID private String vthwres = "";// private String action = "";// 当报文从AC出去时VLAN动作 private String sdvlan = "";// 业务区分的VLANID private String sdvlanpri = "";// 业务区分的VLAN 优先级 private String sdvlancfi = "";// 业务区分的VLAN CFI private String ethifindex = "";// private String qoshwres = "";// private String qos = "";// pmap名 ** private String hwres = "";// private String hwresref = "";// private String dualid = "";// 双归保护组ID private boolean deleteQos; private boolean isCreateQos=false; //创建tunnel时,是否创建qos true创建 false不创建 /** * 修改业务 (eline,etree,elan) * identify 原来的名称-与name相对应 * 判断 ac是否修改 */ private String identify=""; public String getIdentify() { return identify; } public void setIdentify(String identify) { this.identify = identify; } public String toString(){ StringBuffer sb=new StringBuffer().append(" name=").append(name) .append(" ;ethacout=").append(ethacout).append(" ;ifname=").append(ifname) .append(" ;ifindex=").append(ifindex).append(" ;desc=").append(desc) .append(" ;admin=").append(admin).append(" ;oper=").append(oper) .append(" ;perprofile=").append(perprofile).append(" ;ref=").append(ref) .append(" :l3iifhwres=").append(l3iifhwres).append(" ;mode=").append(mode) .append(" ;spvlan=").append(spvlan).append(" ;cevlan=").append(cevlan) .append(" ;vthwres=").append(vthwres).append(" :action=").append(action) .append(" ;sdvlan=").append(sdvlan).append(" ;sdvlanpri=").append(sdvlanpri) .append(" ;sdvlancfi=").append(sdvlancfi).append(" ;ethifindex=").append(ethifindex) .append(" ;qoshwres=").append(qoshwres).append(" ;qos=").append(qos) .append(" ;hwres=").append(hwres).append(" ;hwresref=").append(hwresref) .append(" ;dualid=").append(dualid).append(" ;deleteQos=").append(deleteQos) .append(" ;eline={").append(eline.toString()).append("} ;elan={").append(elan.toString()) .append("} ;etree={").append(etree.toString()).append(" } ;oam={").append(oam.toString()).append("} "); return sb.toString(); } public boolean isDeleteQos() { return deleteQos; } public void setDeleteQos(boolean deleteQos) { this.deleteQos = deleteQos; } public String getEthacout() { return ethacout; } public void setEthacout(String ethacout) { this.ethacout = ethacout; } public String getName() { return name; } public void setName(String name) { this.name = name; } public ElineServiceObject getEline() { return eline; } public void setEline(ElineServiceObject eline) { this.eline = eline; } public ELanServiceObject getElan() { return elan; } public void setElan(ELanServiceObject elan) { this.elan = elan; } public ETreeServiceObject getEtree() { return etree; } public void setEtree(ETreeServiceObject etree) { this.etree = etree; } public OamObject getOam() { return oam; } public void setOam(OamObject oam) { this.oam = oam; } public String getIfname() { return ifname; } public void setIfname(String ifname) { this.ifname = ifname; } public String getIfindex() { return ifindex; } public void setIfindex(String ifindex) { this.ifindex = ifindex; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getAdmin() { return admin; } public void setAdmin(String admin) { this.admin = admin; } public String getOper() { return oper; } public void setOper(String oper) { this.oper = oper; } public String getPerprofile() { return perprofile; } public void setPerprofile(String perprofile) { this.perprofile = perprofile; } public String getRef() { return ref; } public void setRef(String ref) { this.ref = ref; } public String getL3iifhwres() { return l3iifhwres; } public void setL3iifhwres(String l3iifhwres) { this.l3iifhwres = l3iifhwres; } public String getMode() { return mode; } public void setMode(String mode) { this.mode = mode; } public String getSpvlan() { return spvlan; } public void setSpvlan(String spvlan) { this.spvlan = spvlan; } public String getCevlan() { return cevlan; } public void setCevlan(String cevlan) { this.cevlan = cevlan; } public String getVthwres() { return vthwres; } public void setVthwres(String vthwres) { this.vthwres = vthwres; } public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getSdvlan() { return sdvlan; } public void setSdvlan(String sdvlan) { this.sdvlan = sdvlan; } public String getSdvlanpri() { return sdvlanpri; } public void setSdvlanpri(String sdvlanpri) { this.sdvlanpri = sdvlanpri; } public String getSdvlancfi() { return sdvlancfi; } public void setSdvlancfi(String sdvlancfi) { this.sdvlancfi = sdvlancfi; } public String getEthifindex() { return ethifindex; } public void setEthifindex(String ethifindex) { this.ethifindex = ethifindex; } public String getQoshwres() { return qoshwres; } public void setQoshwres(String qoshwres) { this.qoshwres = qoshwres; } public String getQos() { return qos; } public void setQos(String qos) { this.qos = qos; } public String getHwres() { return hwres; } public void setHwres(String hwres) { this.hwres = hwres; } public String getHwresref() { return hwresref; } public void setHwresref(String hwresref) { this.hwresref = hwresref; } public String getDualid() { return dualid; } public void setDualid(String dualid) { this.dualid = dualid; } public boolean isCreateQos() { return isCreateQos; } public void setCreateQos(boolean isCreateQos) { this.isCreateQos = isCreateQos; } }
[ "pengchong@jiupaicn.com" ]
pengchong@jiupaicn.com
3534551c1c6d90ec44de4a3b8c118244ce287be9
480beb8e6931f9492969b6bd5dc25c4877dab576
/recursion/Boj1182.java
da5ace5b632f2171c7ac4b6397c904e18f406965
[]
no_license
wonseok5893/algorithm
a2905de9abf7b9dc538aaec334ac75996f45b6d3
8c00674321ffa1ee61a2552e425102cf0bcf714c
refs/heads/master
2023-05-28T03:24:25.264814
2021-05-28T07:48:51
2021-05-28T07:48:51
296,323,238
1
0
null
null
null
null
UTF-8
Java
false
false
1,286
java
package com.wonseok.recursion; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Boj1182 { static int[]isUsed; static int count = 0; static int s; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] info = br.readLine().split(" "); int n = Integer.parseInt(info[0]); s = Integer.parseInt(info[1]); int[] arr = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt) .toArray(); for (int i = 1; i <= n; i++) { isUsed = new int[n+1]; int sum = 0; int temp = 0; backtracking(arr,i,temp,sum); } System.out.println(count); } private static void backtracking(int[] arr, int i,int temp,int sum) { if(i==0){ if(sum==s) count++; return; } for (int j = temp; j < arr.length; j++) { if(isUsed[j]==1)continue; isUsed[j]=1; sum+=arr[j]; temp = j; backtracking(arr,i-1,temp+1,sum); sum-=arr[j]; isUsed[j]=0; } } }
[ "wonseok5893@naver.com" ]
wonseok5893@naver.com
115a876f5bb8c27a90925bd4259729a20d1b227f
d457364f912cbb7ca83a196c4581dcb0f2de2747
/app/src/main/java/com/diting/pingxingren/entity/Industry.java
f7bb62d108b400347f2dab5496fef996c968a2fb
[]
no_license
767954322/PXR
748ad1fb729f1a923e6cd55ff81a60b51a82f3be
e1da0bafda03d24e0625e85a2efb1a41714196f3
refs/heads/master
2020-03-12T22:54:25.328313
2018-04-24T13:06:48
2018-04-24T13:06:48
130,855,762
1
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.diting.pingxingren.entity; import com.chad.library.adapter.base.entity.MultiItemEntity; /** * Creator: Gu FanFan. * Date: 2017 - 11 - 16, 14:58. * Description: . */ public class Industry implements MultiItemEntity { public String industryItem; public Industry(String industryItem) { this.industryItem = industryItem; } @Override public int getItemType() { return 1; } }
[ "18911211362@163.com" ]
18911211362@163.com
0e1845fc57172b029599b8d178719334d3cabc08
6246ead40970de7586337989821a53ad21909a2f
/app/src/main/java/com/power/travel/xixuntravel/app/BaseActivity.java
3ce3e1149e5de2a671bad8ebc7fe9ce64892f4ee
[]
no_license
Power-Android/xixun
7f05f65e12dfd0d8bb9b4a61df4ca8d39c4f87c1
c0421e147222fecc630b34f3252d5cd28de8e84e
refs/heads/master
2021-05-08T07:40:57.952498
2018-03-19T08:48:36
2018-03-19T08:48:36
106,783,602
0
0
null
null
null
null
UTF-8
Java
false
false
3,232
java
package com.power.travel.xixuntravel.app; import android.app.Activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.view.WindowManager; import com.power.travel.xixuntravel.R; import com.power.travel.xixuntravel.utils.DialogUtils; public class BaseActivity extends FragmentActivity implements OnClickListener { @Override protected void onCreate(Bundle arg0) { setTranslucentStatus(); super.onCreate(arg0); } @Override public void onClick(View v) { } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); } protected void showEnsure(String message){ DialogUtils.showEnsure(this, message, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); } /** * isConnect 判断网络连接 * @return */ public boolean isConnect() { ConnectivityManager conManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = conManager.getActiveNetworkInfo(); if (networkInfo != null) { // 注意,这个判断一定要的哦,要不然会出错 return networkInfo.isAvailable(); } return false; } public void onPause() { super.onPause(); // MobclickAgent.onPause(this); } @Override protected void onResume() { super.onResume(); // MobclickAgent.onResume(this); if (isConnect() == false) {// 判断网络连接 if语句 DialogUtils.showEnsure(this, "网络连接失败, 请确认网络连接!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); } } /** * 设置状态栏背景状态 */ private void setTranslucentStatus() { setStatusBarTranslucent(true); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setStatusBarTintResource(R.color.title_layout_bg_color);// 状态栏的背景颜色(0表示无背景) } /** * 设置状态栏是否透明 * * @param isTransparent */ private void setStatusBarTranslucent(boolean isTransparent) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && isTransparent) { Window win = getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); // 导航栏透明 final int sBits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; winParams.flags |= sBits; win.setAttributes(winParams); } } public Resources getResources() { Resources res = super.getResources(); Configuration config=new Configuration(); config.setToDefaults(); res.updateConfiguration(config,res.getDisplayMetrics() ); return res; } }
[ "power_android@163.com" ]
power_android@163.com
0c6ba1ed0115fe7d546a4780ab0f9eec765bb9bf
2a99a287228e446eb30096abb0f920bb320262f5
/yikangYouthFountain/src/main/java/com/yikangyiliao/pension/dao/QuestionAnswerDao.java
9cd0e20d65ee53e44de7e184487aca2867800742
[]
no_license
yikangmc/youthFountain
fc76a8e2e696189758e4a20fcee0c9abd138f2ef
7f24f43beb42488d15bdd958e462403f9c564ee2
refs/heads/master
2021-01-19T02:35:22.358453
2016-11-08T08:22:23
2016-11-08T08:22:23
44,161,283
1
0
null
null
null
null
UTF-8
Java
false
false
1,445
java
package com.yikangyiliao.pension.dao; import java.util.List; import java.util.Map; import com.yikangyiliao.pension.entity.QuestionAnswer; public interface QuestionAnswerDao { int deleteByPrimaryKey(Long questionAnswerId); int insert(QuestionAnswer record); int insertSelective(QuestionAnswer record); QuestionAnswer selectByPrimaryKey(Long questionAnswerId); int updateByPrimaryKeySelective(QuestionAnswer record); int updateByPrimaryKey(QuestionAnswer record); /** * @author liushuaic * @date 2016-05-10 15:44 * @desc 添加问题支持 * */ int updateQuestionAnsweStartup(Long questionAnswerId); /** * @author liushuaic * @date 2016-05-10 15:47 * @desc 取消回答的支持 * */ int updateQuestionAnswerdown(Long questionAnswerId); /** * @author liushuaic * @date 2016-05-30 15:08 * @desc 获取问题的所有答案 * */ List<QuestionAnswer> selectQuestionAnswer(Map<String,Object> paramMap); /** * @author liushuaic * @date 2016-06-6 19:28 * @desc 获取精彩回答 * */ List<QuestionAnswer> getHotQuestionAnswer(Map<String,Object> paramMap); /** * @author liushuaic * @date 2016-06-13 15:48 * @desc 支持某一个问题回答 * */ int updateQuestionAnswerStarUpByQuestionAnswerId(Long questionAnswerId); }
[ "lavedream@hotmail.com" ]
lavedream@hotmail.com
3e6d2d6b1f24f2a3d450efe48dde96c398b0202f
e9adc2f72d647807eb6900b945b0ddeb5bdda2a7
/src/main/java/com/jsyn/unitgen/PitchToFrequency.java
9086749bb64ff75bdb7e95cf601e8d164f0dace8
[ "Apache-2.0" ]
permissive
philburk/jsyn
720ae13cf80afee666edc8d4e01679ee9f05f884
06f9a9a4d6aa4ddabde81f77878826a62e5d79ab
refs/heads/master
2023-08-31T05:11:59.337101
2023-08-28T20:26:04
2023-08-28T20:26:04
28,650,412
226
76
Apache-2.0
2023-08-28T20:26:06
2014-12-31T00:33:56
Java
UTF-8
Java
false
false
602
java
package com.jsyn.unitgen; import com.softsynth.math.AudioMath; public class PitchToFrequency extends PowerOfTwo { public PitchToFrequency() { input.setup(0.0, 60.0, 127.0); } /** * Convert from MIDI pitch to an octave offset from Concert A. */ @Override public double adjustInput(double in) { return (in - AudioMath.CONCERT_A_PITCH) * (1.0/12.0); } /** * Convert scaler to a frequency relative to Concert A. */ @Override public double adjustOutput(double out) { return out * AudioMath.getConcertAFrequency(); } }
[ "philburk@mobileer.com" ]
philburk@mobileer.com
415f89857b4e9c2ff2d8b7a3422d07bc4522ac46
f274b5f7a88fc18115c0d5b6e6dbca9590077c41
/app/src/main/java/com/ics/admin/BasicAdmin/StudentDetails/StudentAssinviewActivity.java
5dc7f1665851ced1c4befbd1ff3c08df20252364
[]
no_license
NothingbutPro/adminkota20dec2019
cff4ba12c02419c82a2a0ce770e2cac32f2ac881
d85018f968b332a1eb260442eaccc0b4b3fe811c
refs/heads/master
2020-11-27T02:18:56.854920
2020-02-01T07:50:05
2020-02-01T07:50:05
229,270,592
0
0
null
null
null
null
UTF-8
Java
false
false
6,419
java
package com.ics.admin.BasicAdmin.StudentDetails; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.app.Dialog; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import com.ics.admin.Adapter.AdminAdapters.StudentAdapter; import com.ics.admin.Model.Students; import com.ics.admin.R; import com.ics.admin.ShareRefrance.Shared_Preference; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Iterator; import javax.net.ssl.HttpsURLConnection; public class StudentAssinviewActivity extends AppCompatActivity { ArrayList<Students> studentsList = new ArrayList<>(); StudentAdapter studentAdapter; RecyclerView stuview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_student_assinview); //Recycler++++++++++++ stuview = findViewById(R.id.stuview); //++++++++++++ new GellAllStudebnts(new Shared_Preference().getId(this)).execute(); } private class GellAllStudebnts extends AsyncTask<String, Void, String> { String userid; // String Faculty_id; private Dialog dialog; String name; String email; String password; String mobile; String address; public GellAllStudebnts(String id) { this.userid = id; } @Override protected String doInBackground(String... arg0) { try { URL url = new URL("http://ihisaab.in/school_lms/api/get_assignstudents"); JSONObject postDataParams = new JSONObject(); // postDataParams.put("otp", Mobile_Number); // postDataParams.put("user_id", userid); Log.e("postDataParams", postDataParams.toString()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(15000 /*milliseconds*/); conn.setConnectTimeout(15000 /*milliseconds*/); conn.setRequestMethod("GET"); conn.setDoInput(true); conn.setDoOutput(true); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "UTF-8")); writer.write(getPostDataString(postDataParams)); writer.flush(); writer.close(); os.close(); int responseCode = conn.getResponseCode(); if (responseCode == HttpsURLConnection.HTTP_OK) { BufferedReader in = new BufferedReader(new InputStreamReader( conn.getInputStream())); StringBuffer sb = new StringBuffer(""); String line = ""; while ((line = in.readLine()) != null) { StringBuffer Ss = sb.append(line); Log.e("Ss", Ss.toString()); sb.append(line); break; } in.close(); return sb.toString(); } else { return new String("false : " + responseCode); } } catch (Exception e) { return new String("Exception: " + e.getMessage()); } } @Override protected void onPostExecute(String result) { if (result != null) { // dialog.dismiss(); JSONObject jsonObject1 = null; Log.e("PostRegistration", result.toString()); try { jsonObject1 = new JSONObject(result); if(jsonObject1.getBoolean("responce")){ JSONArray jsonArray = jsonObject1.getJSONArray("data"); for(int i=0;i<jsonArray.length();i++) { JSONObject jsonObject11 = jsonArray.getJSONObject(i); String id = jsonObject11.getString("id"); String name = jsonObject11.getString("name"); String mobile = jsonObject11.getString("mobile"); String email = jsonObject11.getString("email"); String address = jsonObject11.getString("address"); // String Batch = jsonObject11.getString("Batch"); studentsList.add(new Students(id, name, mobile, email, password,address,"","Not Assigned", "feedone")); } }else { } studentAdapter = new StudentAdapter(StudentAssinviewActivity.this,studentsList); LinearLayoutManager layoutManager = new LinearLayoutManager(StudentAssinviewActivity.this ); layoutManager.setOrientation(RecyclerView.VERTICAL); stuview.setLayoutManager(layoutManager); stuview.setAdapter(studentAdapter); } catch (JSONException e) { e.printStackTrace(); } } } public String getPostDataString(JSONObject params) throws Exception { StringBuilder result = new StringBuilder(); boolean first = true; Iterator<String> itr = params.keys(); while (itr.hasNext()) { String key = itr.next(); Object value = params.get(key); if (first) first = false; else result.append("&"); result.append(URLEncoder.encode(key, "UTF-8")); result.append("="); result.append(URLEncoder.encode(value.toString(), "UTF-8")); } return result.toString(); } } }
[ "paragsharma611@gmail.com" ]
paragsharma611@gmail.com
0f1306512909d1241dedaf3825ef073274c9947d
ea8013860ed0b905c64f449c8bce9e0c34a23f7b
/SystemUIGoogle/sources/androidx/core/app/NotificationCompatJellybean.java
42274a41bffb29ac5f64b494ff2ff0bc9f668a25
[]
no_license
TheScarastic/redfin_b5
5efe0dc0d40b09a1a102dfb98bcde09bac4956db
6d85efe92477576c4901cce62e1202e31c30cbd2
refs/heads/master
2023-08-13T22:05:30.321241
2021-09-28T12:33:20
2021-09-28T12:33:20
411,210,644
1
0
null
null
null
null
UTF-8
Java
false
false
4,991
java
package androidx.core.app; import android.app.Notification; import android.os.Bundle; import android.util.Log; import android.util.SparseArray; import androidx.core.app.NotificationCompat; import androidx.core.graphics.drawable.IconCompat; import java.lang.reflect.Field; import java.util.List; /* access modifiers changed from: package-private */ /* loaded from: classes.dex */ public class NotificationCompatJellybean { private static Field sExtrasField; private static boolean sExtrasFieldAccessFailed; private static final Object sExtrasLock = new Object(); private static final Object sActionsLock = new Object(); public static SparseArray<Bundle> buildActionExtrasMap(List<Bundle> list) { int size = list.size(); SparseArray<Bundle> sparseArray = null; for (int i = 0; i < size; i++) { Bundle bundle = list.get(i); if (bundle != null) { if (sparseArray == null) { sparseArray = new SparseArray<>(); } sparseArray.put(i, bundle); } } return sparseArray; } public static Bundle getExtras(Notification notification) { synchronized (sExtrasLock) { if (sExtrasFieldAccessFailed) { return null; } try { if (sExtrasField == null) { Field declaredField = Notification.class.getDeclaredField("extras"); if (!Bundle.class.isAssignableFrom(declaredField.getType())) { Log.e("NotificationCompat", "Notification.extras field is not of type Bundle"); sExtrasFieldAccessFailed = true; return null; } declaredField.setAccessible(true); sExtrasField = declaredField; } Bundle bundle = (Bundle) sExtrasField.get(notification); if (bundle == null) { bundle = new Bundle(); sExtrasField.set(notification, bundle); } return bundle; } catch (IllegalAccessException e) { Log.e("NotificationCompat", "Unable to access notification extras", e); sExtrasFieldAccessFailed = true; return null; } catch (NoSuchFieldException e2) { Log.e("NotificationCompat", "Unable to access notification extras", e2); sExtrasFieldAccessFailed = true; return null; } } } public static Bundle writeActionAndGetExtras(Notification.Builder builder, NotificationCompat.Action action) { IconCompat iconCompat = action.getIconCompat(); builder.addAction(iconCompat != null ? iconCompat.getResId() : 0, action.getTitle(), action.getActionIntent()); Bundle bundle = new Bundle(action.getExtras()); if (action.getRemoteInputs() != null) { bundle.putParcelableArray("android.support.remoteInputs", toBundleArray(action.getRemoteInputs())); } if (action.getDataOnlyRemoteInputs() != null) { bundle.putParcelableArray("android.support.dataRemoteInputs", toBundleArray(action.getDataOnlyRemoteInputs())); } bundle.putBoolean("android.support.allowGeneratedReplies", action.getAllowGeneratedReplies()); return bundle; } /* access modifiers changed from: package-private */ public static Bundle getBundleForAction(NotificationCompat.Action action) { Bundle bundle; Bundle bundle2 = new Bundle(); IconCompat iconCompat = action.getIconCompat(); bundle2.putInt("icon", iconCompat != null ? iconCompat.getResId() : 0); bundle2.putCharSequence("title", action.getTitle()); bundle2.putParcelable("actionIntent", action.getActionIntent()); if (action.getExtras() != null) { bundle = new Bundle(action.getExtras()); } else { bundle = new Bundle(); } bundle.putBoolean("android.support.allowGeneratedReplies", action.getAllowGeneratedReplies()); bundle2.putBundle("extras", bundle); bundle2.putParcelableArray("remoteInputs", toBundleArray(action.getRemoteInputs())); bundle2.putBoolean("showsUserInterface", action.getShowsUserInterface()); bundle2.putInt("semanticAction", action.getSemanticAction()); return bundle2; } private static Bundle toBundle(RemoteInput remoteInput) { new Bundle(); throw null; } private static Bundle[] toBundleArray(RemoteInput[] remoteInputArr) { if (remoteInputArr == null) { return null; } Bundle[] bundleArr = new Bundle[remoteInputArr.length]; for (int i = 0; i < remoteInputArr.length; i++) { bundleArr[i] = toBundle(remoteInputArr[i]); } return bundleArr; } }
[ "warabhishek@gmail.com" ]
warabhishek@gmail.com
91a350684711c27a64ff2a45f06b190e1f64d595
f6beea8ab88dad733809e354ef9a39291e9b7874
/com/planet_ink/coffee_mud/Items/Weapons/Arquebus.java
ea292e8d9d419a342c095da37ba0cbc344b4444f
[ "Apache-2.0" ]
permissive
bonnedav/CoffeeMud
c290f4d5a96f760af91f44502495a3dce3eea415
f629f3e2e10955e47db47e66d65ae2883e6f9072
refs/heads/master
2020-04-01T12:13:11.943769
2018-10-11T02:50:45
2018-10-11T02:50:45
153,196,768
0
0
Apache-2.0
2018-10-15T23:58:53
2018-10-15T23:58:53
null
UTF-8
Java
false
false
2,371
java
package com.planet_ink.coffee_mud.Items.Weapons; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; /* Copyright 2001-2018 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ public class Arquebus extends StdWeapon { @Override public String ID() { return "Arquebus"; } public Arquebus() { super(); setName("an arquebus"); setDisplayText("an arquebus is on the ground."); setDescription("It\\`s got a metal barrel and wooden stock."); basePhyStats().setAbility(0); basePhyStats().setLevel(0); basePhyStats.setWeight(15); basePhyStats().setAttackAdjustment(-1); basePhyStats().setDamage(10); setAmmunitionType("bullets"); setAmmoCapacity(1); setAmmoRemaining(1); minRange=0; maxRange=5; baseGoldValue=500; recoverPhyStats(); wornLogicalAnd=true; material=RawMaterial.RESOURCE_IRON; properWornBitmap=Wearable.WORN_HELD|Wearable.WORN_WIELD; weaponClassification=Weapon.CLASS_RANGED; weaponDamageType=Weapon.TYPE_PIERCING; } // protected boolean isBackfire() // { // // } }
[ "bo@zimmers.net" ]
bo@zimmers.net
fab2598216a56c3128aa0fa9931e99e1ad53b545
696aa05ec959063d58807051902d8e2c48a989b9
/ole-common/ole-utility/src/main/java/org/kuali/ole/docstore/model/xmlpojo/security/patron/oleml/AddressWithDates.java
59f43eca3df727575c54cd6603cf34f0c9f98b70
[]
no_license
sheiksalahudeen/ole-30-sprint-14-intermediate
3e8bcd647241eeb741d7a15ff9aef72f8ad34b33
2aef659b37628bd577e37077f42684e0977e1d43
refs/heads/master
2023-01-09T00:59:02.123787
2017-01-26T06:09:02
2017-01-26T06:09:02
80,089,548
0
0
null
2023-01-02T22:05:38
2017-01-26T05:47:58
PLSQL
UTF-8
Java
false
false
7,806
java
//// //// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 //// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> //// Any modifications to this file will be lost upon recompilation of the source schema. //// Generated on: 2012.03.15 at 02:03:46 PM IST //// // // //package org.kuali.ole.docstore.model.xmlpojo.security.patron.oleml; // //import com.thoughtworks.xstream.annotations.XStreamAlias; //import com.thoughtworks.xstream.annotations.XStreamImplicit; // //import javax.xml.bind.annotation.*; //import javax.xml.datatype.XMLGregorianCalendar; //import java.util.ArrayList; //import java.util.List; // // ///** // * This is an address with the other attributes that make it useful. // * Inactivated indicates that the library has forced the address to deactivate // * manually, rather than because the dates are invalid. Some other validation will be // * necessary for addresses. More than one address can be primary, as long as their date // * ranges do not intersect. // * // * <p>Java class for addressWithDates complex type. // * // * <p>The following schema fragment specifies the expected content contained within this class. // * // * <pre> // * &lt;complexType name="addressWithDates"> // * &lt;complexContent> // * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> // * &lt;sequence> // * &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/> // * &lt;choice maxOccurs="unbounded"> // * &lt;element name="postalAddress" type="{http://ole.kuali.org/standards/ole-patron}postalAddress"/> // * &lt;element name="emailAddress" type="{http://ole.kuali.org/standards/ole-patron}emailAddress"/> // * &lt;element name="telephoneNumber" type="{http://ole.kuali.org/standards/ole-patron}telephoneNumber"/> // * &lt;/choice> // * &lt;element name="activeDates" type="{http://ole.kuali.org/standards/ole-patron}beginEndDate" minOccurs="0"/> // * &lt;element name="inactivated" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/> // * &lt;element name="validated" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/> // * &lt;/sequence> // * &lt;attribute name="primary" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /> // * &lt;/restriction> // * &lt;/complexContent> // * &lt;/complexType> // * </pre> // * // * // * @author Rajesh Chowdary K // * @created Mar 15, 2012 // */ // //@XmlAccessorType(XmlAccessType.FIELD) //@XmlType(name = "addressWithDates", propOrder = { // "type", // "postalAddressOrEmailAddressOrTelephoneNumber", // "activeDates", // "inactivated", // "validated" //}) // //@XStreamAlias("addressWithDates") //public class AddressWithDates { // // @XmlElement(required = true) // protected String type; // // @XmlElements({ // @XmlElement(name = "telephoneNumber", type = TelephoneNumber.class), // @XmlElement(name = "emailAddress", type = EmailAddress.class), // @XmlElement(name = "postalAddress", type = PostalAddress.class) // }) // // @XStreamImplicit // protected List<Object> postalAddressOrEmailAddressOrTelephoneNumber = new ArrayList<Object>(); // // protected PostalAddress postalAddress; // // protected EmailAddress emailAddress; // // protected TelephoneNumber telephoneNumber; // // protected BeginEndDate activeDates; // // protected String inactivated; // // protected String validated; // @XmlAttribute(required = true) // protected boolean primary; // // // public PostalAddress getPostalAddress() { // return postalAddress; // } // // public void setPostalAddress(PostalAddress postalAddress) { // this.postalAddress = postalAddress; // } // // public EmailAddress getEmailAddress() { // return emailAddress; // } // // public void setEmailAddress(EmailAddress emailAddress) { // this.emailAddress = emailAddress; // } // // public TelephoneNumber getTelephoneNumber() { // return telephoneNumber; // } // // public void setTelephoneNumber(TelephoneNumber telephoneNumber) { // this.telephoneNumber = telephoneNumber; // } // // /** // * Gets the value of the type property. // * // * @return // * possible object is // * {@link String } // * // */ // public String getType() { // return type; // } // // /** // * Sets the value of the type property. // * // * @param value // * allowed object is // * {@link String } // * // */ // public void setType(String value) { // this.type = value; // } // // /** // * Gets the value of the postalAddressOrEmailAddressOrTelephoneNumber property. // * // * <p> // * This accessor method returns a reference to the live list, // * not a snapshot. Therefore any modification you make to the // * returned list will be present inside the JAXB object. // * This is why there is not a <CODE>set</CODE> method for the postalAddressOrEmailAddressOrTelephoneNumber property. // * // * <p> // * For example, to add a new item, do as follows: // * <pre> // * getPostalAddressOrEmailAddressOrTelephoneNumber().add(newItem); // * </pre> // * // * // * <p> // * Objects of the following type(s) are allowed in the list // * {@link TelephoneNumber } // * {@link EmailAddress } // * {@link PostalAddress } // * // * // */ // // public List<Object> getPostalAddressOrEmailAddressOrTelephoneNumber() { // return this.postalAddressOrEmailAddressOrTelephoneNumber; // } // // /** // * Gets the value of the activeDates property. // * // * @return // * possible object is // * {@link BeginEndDate } // * // */ // public BeginEndDate getActiveDates() { // return activeDates; // } // // /** // * Sets the value of the activeDates property. // * // * @param value // * allowed object is // * {@link BeginEndDate } // * // */ // public void setActiveDates(BeginEndDate value) { // this.activeDates = value; // } // // /** // * Gets the value of the inactivated property. // * // * @return // * possible object is // * {@link XMLGregorianCalendar } // * // */ // public String getInactivated() { // return inactivated; // } // // /** // * Sets the value of the inactivated property. // * // * @param value // * allowed object is // * {@link XMLGregorianCalendar } // * // */ // public void setInactivated(String value) { // this.inactivated = value; // } // // /** // * Gets the value of the validated property. // * // * @return // * possible object is // * {@link XMLGregorianCalendar } // * // */ // public String getValidated() { // return validated; // } // // /** // * Sets the value of the validated property. // * // * @param value // * allowed object is // * {@link XMLGregorianCalendar } // * // */ // public void setValidated(String value) { // this.validated = value; // } // // /** // * Gets the value of the primary property. // * // */ // public boolean isPrimary() { // return primary; // } // // /** // * Sets the value of the primary property. // * // */ // public void setPrimary(boolean value) { // this.primary = value; // } // //}
[ "sheiksalahudeen.m@kuali.org" ]
sheiksalahudeen.m@kuali.org
6ddab439944d345efa7a1dbc26109ee6227f2bb6
dd80a584130ef1a0333429ba76c1cee0eb40df73
/cts/tools/dasm/src/java_cup/production_part.java
cdb92f7bd78c02c7ef4b09bb36e7befbec3f15cb
[ "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
2,678
java
package java_cup; /** This class represents one part (either a symbol or an action) of a * production. In this base class it contains only an optional label * string that the user can use to refer to the part within actions.<p> * * This is an abstract class. * * @see java_cup.production * @version last updated: 11/25/95 * @author Scott Hudson */ public abstract class production_part { /*-----------------------------------------------------------*/ /*--- Constructor(s) ----------------------------------------*/ /*-----------------------------------------------------------*/ /** Simple constructor. */ public production_part(String lab) { _label = lab; } /*-----------------------------------------------------------*/ /*--- (Access to) Instance Variables ------------------------*/ /*-----------------------------------------------------------*/ /** Optional label for referring to the part within an action (null for * no label). */ protected String _label; /** Optional label for referring to the part within an action (null for * no label). */ public String label() {return _label;} /*-----------------------------------------------------------*/ /*--- General Methods ---------------------------------------*/ /*-----------------------------------------------------------*/ /** Indicate if this is an action (rather than a symbol). Here in the * base class, we don't this know yet, so its an abstract method. */ public abstract boolean is_action(); /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Equality comparison. */ public boolean equals(production_part other) { if (other == null) return false; /* compare the labels */ if (label() != null) return label().equals(other.label()); else return other.label() == null; } /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Generic equality comparison. */ public boolean equals(Object other) { if (!(other instanceof production_part)) return false; else return equals((production_part)other); } /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Produce a hash code. */ public int hashCode() { return label()==null ? 0 : label().hashCode(); } /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Convert to a string. */ public String toString() { if (label() != null) return label() + ":"; else return " "; } /*-----------------------------------------------------------*/ };
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
b22ce19951d3bba606659055c6d458c042232431
d104854fecbf15e522db98436de2ac42c832b92d
/src/test/java/what/the/spring/WhatTheSpring/service/MemberServiceIntegrationTest.java
506532c96e4da3889b6f01fce621490355f47ebe
[]
no_license
conquerex/WhatTheSpring
9feff5c781451c44508f5cc691f5cfd9e0739333
7ef069bd373096afb6002f58d82fd0889cd832e3
refs/heads/main
2023-04-17T05:02:52.414491
2021-05-06T01:43:54
2021-05-06T01:43:54
363,823,062
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package what.the.spring.WhatTheSpring.service; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.transaction.annotation.Transactional; import what.the.spring.WhatTheSpring.domain.Member; import what.the.spring.WhatTheSpring.repository.MemberRepository; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @SpringBootTest @Transactional class MemberServiceIntegrationTest { @Autowired MemberService service; @Autowired MemberRepository memberRepository; @Test void 회원가입() { // given Member member = new Member(); member.setName("spring22"); // when Long saveId = service.join(member); // then Member findMember = service.findOne(saveId).get(); assertThat(member.getName()).isEqualTo(findMember.getName()); } @Test void 중복_회원_예외() { // given Member member1 = new Member(); member1.setName("spring33"); Member member2 = new Member(); member2.setName("spring33"); // when service.join(member1); IllegalStateException e = assertThrows(IllegalStateException.class, () -> service.join(member2)); assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); } }
[ "conquerex@gmail.com" ]
conquerex@gmail.com
3669d9b66d3550794fd5c1c9f4a3a0cc4a7ad0c9
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_265/Testnull_26409.java
62a6d45a0c878e4e6985c3f910bde1c75dfdc629
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_265; import static org.junit.Assert.*; public class Testnull_26409 { private final Productionnull_26409 production = new Productionnull_26409("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
054df99f1231bf0651fc645f4e0bdfbc64b42a15
4ac51f07e5e4d5da395caa5cc8c3516923ef3012
/taverna-workflowmodel-api/src/main/java/net/sf/taverna/t2/workflowmodel/processor/activity/config/ActivityPortDefinitionBean.java
05d991f7c2285fea4d2f5cc8ef79081f3fd655c6
[]
no_license
taverna-incubator/incubator-taverna-engine
eb2b5d2c956982696e06b9404c6b94a2346417fe
1eca6315f88bfd19672114e3f3b574246a2994a5
refs/heads/master
2021-01-01T18:11:06.502122
2015-02-21T23:43:42
2015-02-21T23:43:42
28,545,860
0
1
null
2015-02-04T15:45:25
2014-12-27T20:40:19
Java
UTF-8
Java
false
false
3,021
java
/******************************************************************************* * Copyright (C) 2007 The University of Manchester * * Modifications to the initial code base are copyright of their * respective authors, or their employers as appropriate. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ******************************************************************************/ package net.sf.taverna.t2.workflowmodel.processor.activity.config; import java.net.URI; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean; import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty; /** * A generic bean that describes the shared properties of input and output * ports. * * @author Stuart Owen * */ @ConfigurationBean(uri = "http://ns.taverna.org.uk/2010/scufl2#PortDefinition") public abstract class ActivityPortDefinitionBean { private String name; private int depth; private List<String> mimeTypes; /** * @return the port name */ public String getName() { return name; } /** * @param name * the port name */ public void setName(String name) { this.name = name; } /** * @return the depth of the port */ public int getDepth() { return depth; } /** * @param depth * the depth of the port */ public void setDepth(int depth) { this.depth = depth; } /** * @return a list a MIME types that describe the port */ public List<String> getMimeTypes() { if (mimeTypes == null) return Collections.emptyList(); return mimeTypes; } /** * @param mimeTypes * the list of MIME-types that describe the port */ public void setMimeTypes(List<String> mimeTypes) { this.mimeTypes = mimeTypes; } /** * @param mimeTypes * the list of MIME-types that describe the port */ @ConfigurationProperty(name = "expectedMimeType", label = "Mime Types", description = "The MIME-types that describe the port", required = false) public void setMimeTypes(Set<URI> mimeTypes) { this.mimeTypes = new ArrayList<>(); for (URI uri : mimeTypes) this.mimeTypes.add("'" + URI.create("http://purl.org/NET/mediatypes/").relativize( uri) + "'"); } }
[ "stain@apache.org" ]
stain@apache.org
b3c26435007d987462cc49309c6d4801bcc91e70
44bdb9995b5c886788f9abbeb5b50c9029aba3a5
/oracle/apps/ap/oie/entry/header/lov/server/CuxOAAboardTravelEmpLovVORowImpl.java
8082c288dce8a7617f1ed90229da14e7e4f6cbee
[]
no_license
alosummer/enfi
ad8cd1e5beadce88257df1aeb6cac3218019500a
8221accfdd409bc6225d248a6b7fee5204211f73
refs/heads/master
2021-04-15T09:43:09.181927
2018-04-03T01:10:54
2018-04-03T01:10:54
126,925,232
0
0
null
null
null
null
UTF-8
Java
false
false
4,990
java
package cux.oracle.apps.ap.oie.entry.header.lov.server; import oracle.apps.fnd.framework.server.OAViewRowImpl; import oracle.jbo.domain.Number; import oracle.jbo.server.AttributeDefImpl; // --------------------------------------------------------------------- // --- File generated by Oracle ADF Business Components Design Time. // --- Custom code may be added to this class. // --- Warning: Do not modify method signatures of generated methods. // --------------------------------------------------------------------- public class CuxOAAboardTravelEmpLovVORowImpl extends OAViewRowImpl { public static final int EMPID = 0; public static final int EMPNAME = 1; public static final int EMPNUMBER = 2; public static final int EMPDEPT = 3; public static final int OAABROADTRAVELHEADERID = 4; public static final int OAABROADTRAVELLINEID = 5; /**This is the default constructor (do not remove) */ public CuxOAAboardTravelEmpLovVORowImpl() { } /**Gets the attribute value for the calculated attribute EmpId */ public Number getEmpId() { return (Number)getAttributeInternal(EMPID); } /**Sets <code>value</code> as the attribute value for the calculated attribute EmpId */ public void setEmpId(Number value) { setAttributeInternal(EMPID, value); } /**Gets the attribute value for the calculated attribute EmpName */ public String getEmpName() { return (String)getAttributeInternal(EMPNAME); } /**Sets <code>value</code> as the attribute value for the calculated attribute EmpName */ public void setEmpName(String value) { setAttributeInternal(EMPNAME, value); } /**Gets the attribute value for the calculated attribute EmpNumber */ public String getEmpNumber() { return (String)getAttributeInternal(EMPNUMBER); } /**Sets <code>value</code> as the attribute value for the calculated attribute EmpNumber */ public void setEmpNumber(String value) { setAttributeInternal(EMPNUMBER, value); } /**Gets the attribute value for the calculated attribute EmpDept */ public String getEmpDept() { return (String)getAttributeInternal(EMPDEPT); } /**Sets <code>value</code> as the attribute value for the calculated attribute EmpDept */ public void setEmpDept(String value) { setAttributeInternal(EMPDEPT, value); } /**Gets the attribute value for the calculated attribute OaAbroadTravelHeaderId */ public Number getOaAbroadTravelHeaderId() { return (Number)getAttributeInternal(OAABROADTRAVELHEADERID); } /**Sets <code>value</code> as the attribute value for the calculated attribute OaAbroadTravelHeaderId */ public void setOaAbroadTravelHeaderId(Number value) { setAttributeInternal(OAABROADTRAVELHEADERID, value); } /**Gets the attribute value for the calculated attribute OaAbroadTravelLineId */ public Number getOaAbroadTravelLineId() { return (Number)getAttributeInternal(OAABROADTRAVELLINEID); } /**Sets <code>value</code> as the attribute value for the calculated attribute OaAbroadTravelLineId */ public void setOaAbroadTravelLineId(Number value) { setAttributeInternal(OAABROADTRAVELLINEID, value); } /**getAttrInvokeAccessor: generated method. Do not modify. */ protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception { switch (index) { case EMPID: return getEmpId(); case EMPNAME: return getEmpName(); case EMPNUMBER: return getEmpNumber(); case EMPDEPT: return getEmpDept(); case OAABROADTRAVELHEADERID: return getOaAbroadTravelHeaderId(); case OAABROADTRAVELLINEID: return getOaAbroadTravelLineId(); default: return super.getAttrInvokeAccessor(index, attrDef); } } /**setAttrInvokeAccessor: generated method. Do not modify. */ protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception { switch (index) { case EMPID: setEmpId((Number)value); return; case EMPNAME: setEmpName((String)value); return; case EMPNUMBER: setEmpNumber((String)value); return; case EMPDEPT: setEmpDept((String)value); return; case OAABROADTRAVELHEADERID: setOaAbroadTravelHeaderId((Number)value); return; case OAABROADTRAVELLINEID: setOaAbroadTravelLineId((Number)value); return; default: super.setAttrInvokeAccessor(index, value, attrDef); return; } } }
[ "772856742@qq.com" ]
772856742@qq.com
902a6b9398629d3d24e9909c98693269e787d97d
69e80d61ba5bfea7715e8698b63ca3984d66e85b
/src/methodsandencapsulation/lambdas/Lambda3.java
6f07057ee831aaa93588edd2a5120cc3278495b4
[]
no_license
Arasefe/ZeroToHero
3b40195829f0f4179c73de31543fad0252ddaad4
bd8aaa2633d24a1a60384a511503d6afb9f635cc
refs/heads/master
2022-12-27T13:04:15.405591
2020-10-11T01:54:29
2020-10-11T01:54:29
284,329,327
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
package methodsandencapsulation.lambdas; public class Lambda3 { public static void main(String[] args) { String a="Lambda"; String b="Lambda1"; } }
[ "arasefe@users.noreply.github.com" ]
arasefe@users.noreply.github.com
a6c08f1ea23561d7193d82805c9d58c05399d2d1
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a021/A021555Test.java
5b2f88fad7ff5ae4595b69f2ce51e5296cabd926
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a021; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A021555Test extends AbstractSequenceTest { }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
c118d34d7a606f71123c8b7398ec1a7d9435b2c9
5e2d87829db1fd971fdaf96ef7f1ecb9999cb5d5
/biblioteca-quadrinho-java/src/model/Usuario.java
42289d889a7a0e698b9a757f6de015716b88e3d3
[]
no_license
emanuel71jo/projetos-curso-CC-UEPB
37c37616bfa3c9ae323e09cf5a9acfea6b218f89
08675b79eab2690ac18c66695ee1a6422c5fb114
refs/heads/master
2021-07-01T06:18:04.193009
2021-05-29T15:48:41
2021-05-29T15:48:41
236,749,930
1
0
null
2020-12-18T20:21:13
2020-01-28T14:09:42
Jupyter Notebook
UTF-8
Java
false
false
2,158
java
package model; import java.util.ArrayList; import java.util.List; public class Usuario extends Pessoa{ private String login; private String senha; private boolean permissao; private List<Leitura> leituras; public Usuario() { } public Usuario(String login, String senha) { super(); this.login = login; this.senha = senha; } public Usuario(String cpf) { super(cpf); } public Usuario(String cpf, String nome, boolean tipoPessoa, String login, String senha, boolean permissao) { super(cpf, nome, tipoPessoa); this.login = login; this.senha = senha; this.permissao = permissao; this.leituras = new ArrayList<Leitura>(); } public Usuario(String cpf, String nome, boolean tipoPessoa, String login, String senha, boolean permissao, List<Leitura> leitura) { super(cpf, nome, tipoPessoa); this.login = login; this.senha = senha; this.permissao = permissao; this.leituras = leitura; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getSenha() { return senha; } public void setSenha(String senha) { this.senha = senha; } public boolean isPermissao() { return permissao; } public void setPermissao(boolean permissao) { this.permissao = permissao; } public List<Leitura> getLeituras() { return leituras; } public void setLeituras(List<Leitura> leituras) { this.leituras = leituras; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((login == null) ? 0 : login.hashCode()); result = prime * result + ((senha == null) ? 0 : senha.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Usuario other = (Usuario) obj; if (login == null) { if (other.login != null) return false; } else if (!login.equals(other.login)) return false; if (senha == null) { if (other.senha != null) return false; } else if (!senha.equals(other.senha)) return false; return true; } }
[ "emanuel71jo@gmail.com" ]
emanuel71jo@gmail.com
fe91ef10c0dd2d276002fd8241e606e60d310804
882a1a28c4ec993c1752c5d3c36642fdda3d8fad
/proxies/com/microsoft/bingads/v12/campaignmanagement/GetNegativeSitesByAdGroupIdsRequest.java
7017f4f1e81275b6c4631d2b1fcecc3a69f32ace
[ "MIT" ]
permissive
BazaRoi/BingAds-Java-SDK
640545e3595ed4e80f5a1cd69bf23520754c4697
e30e5b73c01113d1c523304860180f24b37405c7
refs/heads/master
2020-07-26T08:11:14.446350
2019-09-10T03:25:30
2019-09-10T03:25:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,302
java
package com.microsoft.bingads.v12.campaignmanagement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CampaignId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/> * &lt;element name="AdGroupIds" type="{http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOflong" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "campaignId", "adGroupIds" }) @XmlRootElement(name = "GetNegativeSitesByAdGroupIdsRequest") public class GetNegativeSitesByAdGroupIdsRequest { @XmlElement(name = "CampaignId") protected Long campaignId; @XmlElement(name = "AdGroupIds", nillable = true) protected ArrayOflong adGroupIds; /** * Gets the value of the campaignId property. * * @return * possible object is * {@link Long } * */ public Long getCampaignId() { return campaignId; } /** * Sets the value of the campaignId property. * * @param value * allowed object is * {@link Long } * */ public void setCampaignId(Long value) { this.campaignId = value; } /** * Gets the value of the adGroupIds property. * * @return * possible object is * {@link ArrayOflong } * */ public ArrayOflong getAdGroupIds() { return adGroupIds; } /** * Sets the value of the adGroupIds property. * * @param value * allowed object is * {@link ArrayOflong } * */ public void setAdGroupIds(ArrayOflong value) { this.adGroupIds = value; } }
[ "qitia@microsoft.com" ]
qitia@microsoft.com
e991caaa4f3b16f65d327a2ad5d2b3fb9cc2afc0
0bffcdd8c5f803627956bd7cec7b28d1cea00dc3
/src/main/java/com/nativex/monetization/business/GetDeviceBalanceResponseData.java
362b68fd2ad0634a9e743f28edee4dae8c6353c2
[]
no_license
sinzua/baseApk
eb5d8c28cdb385ec49413217151ebba7c2fbb723
9011fb631ed84b1747561244cc08fff38205e97c
refs/heads/master
2021-01-21T17:39:20.367401
2017-05-21T18:06:26
2017-05-21T18:06:26
91,977,496
3
2
null
null
null
null
UTF-8
Java
false
false
700
java
package com.nativex.monetization.business; import com.google.gson.annotations.SerializedName; import com.nativex.common.LogItem; import com.nativex.common.Message; import com.nativex.common.Violation; import com.nativex.monetization.business.reward.Reward; import java.util.List; public class GetDeviceBalanceResponseData { @SerializedName("Balances") private List<Reward> balances = null; @SerializedName("Log") private List<LogItem> log = null; @SerializedName("Messages") private List<Message> messages = null; @SerializedName("Violations") private List<Violation> violations = null; public List<Reward> getBalances() { return this.balances; } }
[ "sinzua@gmail.com" ]
sinzua@gmail.com
8de3c77ed655bd17e6aa75a58a1a5eb64cc1e42b
0f90ce7bca8a10e8bb034fa7845c76edd282d07b
/header/src/main/java/org/zstack/header/volume/APIExpungeDataVolumeMsg.java
b64a290a590b30cf4211b4806a652a28267a8bca
[ "Apache-2.0" ]
permissive
cathywife/zstack
f8fac904c99af58fc742326193377657f969965b
3c282617f08c8535cf135fab31f2db7ac8bba121
refs/heads/master
2021-01-12T05:48:01.271101
2016-12-23T04:54:27
2016-12-23T04:55:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package org.zstack.header.volume; import org.zstack.header.identity.Action; import org.zstack.header.message.APIMessage; /** * Created by frank on 11/16/2015. */ @Action(category = VolumeConstant.ACTION_CATEGORY) public class APIExpungeDataVolumeMsg extends APIMessage implements VolumeMessage { private String uuid; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } @Override public String getVolumeUuid() { return uuid; } }
[ "xuexuemiao@yeah.net" ]
xuexuemiao@yeah.net
5421528cf28714073b7e381ce7550de4136053d3
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE197_Numeric_Truncation_Error/s02/CWE197_Numeric_Truncation_Error__short_random_10.java
0f321cfa49586ed9fe06ee26376e793aade88ed7
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
3,437
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE197_Numeric_Truncation_Error__short_random_10.java Label Definition File: CWE197_Numeric_Truncation_Error__short.label.xml Template File: sources-sink-10.tmpl.java */ /* * @description * CWE: 197 Numeric Truncation Error * BadSource: random Set data to a random value * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: to_byte Convert data to a byte * Flow Variant: 10 Control flow: if(IO.staticTrue) and if(IO.staticFalse) * * */ package testcases.CWE197_Numeric_Truncation_Error.s02; import testcasesupport.*; import java.security.SecureRandom; public class CWE197_Numeric_Truncation_Error__short_random_10 extends AbstractTestCase { /* uses badsource and badsink */ public void bad() throws Throwable { short data; if (IO.staticTrue) { /* FLAW: Set data to a random value */ data = (short)((new SecureRandom()).nextInt(Short.MAX_VALUE + 1)); } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B1() - use goodsource and badsink by changing IO.staticTrue to IO.staticFalse */ private void goodG2B1() throws Throwable { short data; if (IO.staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } else { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B2() - use goodsource and badsink by reversing statements in if */ private void goodG2B2() throws Throwable { short data; if (IO.staticTrue) { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } public void good() throws Throwable { goodG2B1(); goodG2B2(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
d1d3fd36da27a9fb61fb5b83ff4a938f17b4cd94
799cce351010ca320625a651fb2e5334611d2ebf
/Data Set/Synthetic/After/after_1611.java
4285d9964064645429f0327606ef6a97dbb2b505
[]
no_license
dareenkf/SQLIFIX
239be5e32983e5607787297d334e5a036620e8af
6e683aa68b5ec2cfe2a496aef7b467933c6de53e
refs/heads/main
2023-01-29T06:44:46.737157
2020-11-09T18:14:24
2020-11-09T18:14:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
public class Dummy { void sendRequest(Connection conn) throws SQLException { PreparedStatement stmt = conn.prepareStatement("SELECT EMPLOYEE_ID, LAST_NAME, EMAIL FROM EMPLOYEES WHERE LAST_NAME >? OR EMAIL >?"); stmt.setObject(1 , val2); stmt.setObject(2 , rand1); ResultSet rs = stmt.executeQuery(); } }
[ "jahin99@gmail.com" ]
jahin99@gmail.com
a98b6405ae5a377b76942804747645ec4ea2b627
b45a057b52344497f800d247c8aca9ec890c2714
/holly-chains-mobile/src/main/java/com/bt/chains/mapper/RewardMapper.java
d39f19960677427bdc18c62ecac10ffe530610e5
[]
no_license
scorpiopapa/game-hollychains
8f6269663dddf7749066c30583a6eab01e4c5b95
fc39e8b21d379dc8a89083913e2ef2a407de6368
refs/heads/master
2020-06-02T01:27:10.053166
2014-09-27T09:40:08
2014-09-27T09:40:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,864
java
package com.bt.chains.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import com.bt.chains.bean.domain.RewardConfig; import com.bt.chains.bean.domain.RewardMaster; import com.bt.chains.bean.domain.UserAchievementHistory; import com.bt.chains.bean.domain.UserReward; import com.bt.chains.bean.domain.UserRewardHis; import com.bt.chains.bean.domain.UserRewardStatus; import com.bt.chains.bean.domain.UserScore; import com.bt.chains.bean.view.UserAchivementView; @Repository public interface RewardMapper { /** * 获取用户奖励信息 * @param int * @return UserRewardView */ public List<UserAchivementView> getAchivementListDetail(@Param("userId")int userId); /** * 获取成就种类 * @param int * @return UserRewardView */ public List<RewardMaster> getRewardMaster(); /** * 获取成就详情 * @param int * @return UserRewardView */ public List<RewardConfig> getRewardConfig(); /** * 获取成就列表 * @param int * @return UserRewardView */ public List<UserAchievementHistory> userAchievementHistoryList(@Param("userId")int userId); /** * 查询当日成就 * @param UserMagic * @return */ public int selectCurrentAchievements(@Param("userId")int userId); /** * 查询其他成就 * @param UserMagic * @return */ public int selectOtherAchievements(@Param("userId")int userId); /** * 获取成就信息 * @param int * @return UserAchievementHistory */ public UserAchievementHistory selectUserAchievementHistory( UserAchievementHistory uarh); /** * 插入用户成就(有关money) * @param user * @return */ public void inserUserRewardHis(UserRewardHis rhis); /** * 查询用户成就状态 * @param user * @return */ public UserRewardStatus selectRewardStatus(int userId); /** * 插入用户成就状态 * @param user * @return */ public void insertRewardStatus(UserRewardStatus urs); /** * 更新用户成就状态 * @param user * @return */ public void updateRewardStatus(UserRewardStatus urs); /** * 获取用户可以获取的奖励 * @return */ public RewardConfig queryUserReward(@Param("category")int category, @Param("rewardType")int rewardType); /** * 根据类型获取奖励信息 * @param type * @return */ public RewardMaster getRewardMasterByType(@Param("type")int type); /** * 根据ID获取奖励配置信息 * @param id * @return */ public RewardConfig getRewardConfigById(@Param("id")int id); /** * 查询本月登陆天数 * @param userId * @param minMonthDate * @param nextMinMonthDate * @return int */ public int queryCurrMonthLoginSum(@Param("userId")int userId, @Param("type")int type, @Param("minMonthDate")String minMonthDate, @Param("nextMinMonthDate")String nextMinMonthDate); }
[ "liliang2005@gmail.com" ]
liliang2005@gmail.com
5ed940ae14d8f430ec0b9b3c0690c9b05d9de395
628de1aa2d2d5d960f949b6868b03a427721a482
/src/main/java/com/canzs/czs/pojo/vo/ApiResult.java
cbaf683af066ed87a6c977f8c1741f37b80da41e
[]
no_license
xiwc/czs
402197e4cda814b95176221319da88d044978341
288ee97253adf4ba22724d6df85887d8f2d913fa
refs/heads/master
2016-09-05T09:40:02.021254
2014-07-15T11:16:48
2014-07-15T11:16:48
19,299,966
0
0
null
null
null
null
UTF-8
Java
false
false
3,289
java
/** * ApiResult.java */ package com.canzs.czs.pojo.vo; import java.io.Serializable; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.canzs.czs.util.StringUtil; /** * 对调用zabbix api返回结果的封装. * * @creation 2013-10-15 上午11:44:31 * @modification 2013-10-15 上午11:44:31 * @company Canzs * @author xiweicheng * @version 1.0 * */ public class ApiResult implements Serializable { /** serialVersionUID [long] */ private static final long serialVersionUID = 8896678889526483526L; public static final String RESULT = "result"; public static final String ERROR = "error"; public static final String MESSAGE = "message"; public static final String DATA = "data"; public static final String EMPTY = ""; private String message; private JSONObject jsonObject; private boolean succeed; private Object extraData; public ApiResult() { } public ApiResult(JSONObject jsonObject) { this.jsonObject = jsonObject; this.succeed = this.jsonObject.containsKey(RESULT); if (!succeed) { setMessage(getErrorData()); } } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Object getExtraData() { return extraData; } public void setExtraData(Object extraData) { this.extraData = extraData; } public JSONObject getJsonObject() { return jsonObject; } public boolean succeed() { return succeed; } public boolean failed() { return !succeed; } public void setSucceed(boolean succeed) { this.succeed = succeed; } public JSONObject getJSONObjectResult() { return jsonObject.getJSONObject(RESULT); } public JSONArray getJSONArrayResult() { return jsonObject.getJSONArray(RESULT); } public boolean getBooleanResult() { return jsonObject.getBooleanValue(RESULT); } public String getStringResult() { return jsonObject.getString(RESULT); } public int getIntResult() { return jsonObject.getIntValue(RESULT); } public double getDoubleResult() { return jsonObject.getDoubleValue(RESULT); } public long getLongResult() { return jsonObject.getLongValue(RESULT); } public JSONObject getError() { JSONObject error = jsonObject.getJSONObject(ERROR); return error == null ? new JSONObject() : error; } public String getErrorMsg() { return succeed ? EMPTY : StringUtil.toString(getError().get(MESSAGE)); } public String getErrorData() { return succeed ? EMPTY : StringUtil.toString(getError().get(DATA)); } public String getIdResult(String idName) { String[] idArrResult = getIdArrResult(idName); if (idArrResult != null && idArrResult.length > 0) { return idArrResult[0]; } return null; } public String[] getIdArrResult(String idName) { if (succeed() && getJSONObjectResult() != null && getJSONObjectResult().getJSONArray(idName) != null) { JSONArray jsonArr = getJSONObjectResult().getJSONArray(idName); String[] arr = new String[jsonArr.size()]; for (int i = 0; i < jsonArr.size(); i++) { arr[i] = jsonArr.getString(i); } return arr; } return null; } @Override public String toString() { return "ApiResult [succeed=" + succeed + ", jsonObject=" + jsonObject + ", extraData=" + extraData + "]"; } }
[ "xiweicheng@yeah.net" ]
xiweicheng@yeah.net
dd8763ca2d6de375f7939d0a731db0d7ef66627c
0136bdbcba620caae2ede8668f05c038afd8807f
/basic/src/com/algorithm/a_sort/SelectSort.java
620a0a658529346bd277c0c9cfee4e680838eea5
[]
no_license
dh37789/basic
40c7ae83fdb20d2763b7ebf55f9f247e87fd448f
b9b84db0e832ae0dd4d0d9c1ed5bf2259dbefc38
refs/heads/master
2023-08-31T01:27:12.497153
2023-08-20T07:12:22
2023-08-20T07:12:22
199,305,523
2
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.algorithm.a_sort; public class SelectSort { public static void main(String[] args) { int[] arr = {9, 2, 10, 6, 3, 4, 1, 8, 7, 5}; System.out.println("Before : "); for (int i : arr) { System.out.print(i + " "); } System.out.println(); selectSort(arr); System.out.println("After : "); for (int i : arr) { System.out.print(i + " "); } } private static void selectSort(int[] arr) { for (int i = 0; i < arr.length; i++) { int tmp = i; int tmp2; for (int j = i; j < arr.length; j++) { if (arr[tmp] > arr[j]) { tmp = j; } } tmp2 = arr[i]; arr[i] = arr[tmp]; arr[tmp] = tmp2; } } }
[ "dhaudgkr@gmail.com" ]
dhaudgkr@gmail.com
0362e1eb8ea7abb860492fd28ecbd94296d6d602
550ca505ed8ef14d389cdabfe0b0ab564117f27e
/src/com/valens/base/doc/Doc.java
a5f35f01025e78d592fc6a4459cb97d9941a454b
[]
no_license
valens77/valens
ffdfaddaca00c2c8788cba69c04026c177677626
df7df278208e561c64b3227029f183d1a324fc78
refs/heads/master
2021-01-23T05:18:53.881610
2017-08-25T07:41:31
2017-08-25T07:41:31
86,295,652
0
0
null
null
null
null
UTF-8
Java
false
false
2,097
java
/** * */ package com.valens.base.doc; /** * @Description TODO * @author Huangxiaohua * @CreateDate 2017-3-27 * @updater * @updateDate * @remark * @version v1.0 */ public class Doc { /**myeclipse 设置注释 * Window --> Java --> Code Style --> CodeTemplates --> Comments --> (types类,method方法) --> Edit * */ //types /** * @Description ${todo} * @author Huangxiaohua * @CreateDate ${date} * @updater * @updateDate * @remark * ${tags} * @version v1.0 */ //method /** @Description ${todo} * ${tags} ${return_type} * @author Huangxiaohua * @CreateDate ${date} */ //类型(Types)注释标签(类的注释): /** * @ClassName: ${type_name} * @Description: ${todo}(这里用一句话描述这个类的作用) * @author A18ccms a18ccms_gmail_com * @date ${date} ${time} * ${tags} */ // or /** * ProjectName:${project_name} * ClassName:${type_name} * Description: * @Copyright: * @Company: * @author:${user} * @version * Create Date:${date} ${time} */ //字段(Fields)注释标签: /** * @Fields ${field} : ${todo}(用一句话描述这个变量表示什么) */ //构造函数标签: /** * <p>Title: </p> * <p>Description: </p> * ${tags} */ //方法(Constructor & Methods)标签: /** * @Title : ${enclosing_method} * @Description: ${todo} * ${tags} : ${return_type} * @author :xingchen * Create Date : ${date} ${time} * @throws */ //覆盖方法(OverridingMethods)标签: /* (非 Javadoc) * <p>Title:${enclosing_method}</p> * <p>Description: </p> * ${tags} * ${see_to_overridden} */ //代表方法(DelegateMethods)标签: /** * ${tags} * ${see_to_target} */ //getter方法标签: /** * @return ${bare_field_name} */ //setter方法标签: /** * @param ${param} 要设置的 ${bare_field_name} */ }
[ "yuanlian14@163.com" ]
yuanlian14@163.com
0d4534c92e8fd4f8e52621376849aaf49b5d6939
e32eb170db5419fd849058ba0a7fd63d3e35f16a
/utils/utils-api/src/main/java/com/redshape/utils/config/AbstractConfig.java
3a4d9e10a11730dea853a5eedf540f42a43ed2e8
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nikelin/Redshape-AS
9803f6825e310fdc0b0870513c977fea06d1c069
252d10988daadb9ca5972b61da2ef9d84eedafac
refs/heads/3.1.6
2022-09-02T23:48:47.958888
2012-11-13T10:02:03
2012-11-13T10:02:03
6,657,575
0
1
Apache-2.0
2022-09-01T22:51:08
2012-11-12T17:39:26
Java
UTF-8
Java
false
false
6,046
java
/* * Copyright 2012 Cyril A. Karpenko * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.redshape.utils.config; import com.redshape.utils.config.sources.IConfigSource; import java.util.*; /** * @author Cyril A. Karpenko <self@nikelin.ru> * @package com.redshape.utils.config * @date 10/20/11 1:13 PM */ public abstract class AbstractConfig implements IConfig { protected boolean nulled; protected String value; protected IConfig parent; protected String name; protected Map<String, String> attributes = new LinkedHashMap<String, String>(); protected List<IConfig> childs = new ArrayList<IConfig>(); protected IConfigSource source; protected boolean initialized; public AbstractConfig() { this(null, null, null); } protected AbstractConfig(IConfig parent, String name, String value) { this.parent = parent; this.name = name; this.value = value; } protected AbstractConfig(String name, String value) { this(null, name, value); } public AbstractConfig(IConfigSource source) throws ConfigException { this.source = source; this.init(); } abstract protected void actualInit() throws ConfigException ; protected void init() throws ConfigException { this.actualInit(); } protected void clear() { this.value = null; this.name = null; this.parent = null; this.attributes.clear(); this.childs.clear(); } @Override public boolean isNull() { return this.nulled; } @Override public String path() throws ConfigException { List<String> route = new ArrayList<String>(); IConfig parent = this; while ( null != parent ) { route.add( parent.name() ); parent = parent.parent(); } String[] routes = route.toArray( new String[route.size()] ); StringBuilder result = new StringBuilder(); for ( int i = routes.length; i > 0; i-- ) { result.append( routes[i] ); if ( i != routes.length - 1 ) { result.append("."); } } return result.toString(); } @Override public <T extends IConfig> List<T> childs() { return (List<T>) this.childs; } @Override public boolean hasChilds() { return !this.childs.isEmpty(); } @Override public IConfig get(String name) throws ConfigException { if (this.isNull()) { return this.createNull(); } IConfig result = this; String[] pathNodes = name.split("\\."); if ( pathNodes.length == 1 ) { return this._get(name); } for ( String pathNode : pathNodes ) { result = result.get(pathNode); if ( result.isNull() ) { break; } } return result; } private IConfig _get( String name ) { for ( IConfig config : this.childs() ) { if ( config.name().equals(name) ) { return config; } } return this.createNull(); } @Override public String[] list() { return this.list(null); } @Override public String[] list(String name) { List<String> list = new ArrayList<String>(); for ( IConfig node : this.childs() ) { if ( name == null || !node.name().equals(name) ) { continue; } list.add( node.value() ); } return list.toArray( new String[ list.size() ] ); } @Override public String name() { return this.name; } @Override public String[] names() { List<String> list = new ArrayList<String>(); for ( IConfig node : this.childs() ) { list.add( node.name() ); } return list.toArray( new String[ list.size() ] ); } @Override public String attribute(String name) { return this.attributes.get(name); } @Override public String[] attributeNames() { return this.attributes.keySet().toArray( new String[this.attributes.size()] ); } @Override public String value() { return this.value; } @Override public IConfig parent() throws ConfigException { return this.parent; } @Override public IConfig append(IConfig config) { config.parent(this); this.childs.add(config); return this; } @Override public IConfig parent(IConfig config) { this.parent = config; return this; } @Override public IConfig set(String value) throws ConfigException { this.value = value; return this; } @Override public IConfig attribute(String name, String value) { this.attributes.put(name, value); return this; } @Override public IConfig remove() throws ConfigException { this.parent.remove(this); this.nulled = true; return this; } @Override public IConfig remove(IConfig config) throws ConfigException { this.childs.remove(config); return this; } @Override public void save() throws ConfigException { if ( this.source == null ) { throw new IllegalStateException("Associated holder not exists"); } this.source.write( this.serialize() ); } abstract protected IConfig createNull(); }
[ "self@nikelin.ru" ]
self@nikelin.ru
c70d86e0878e63b21da7b9fa21a2d2b80b0b8593
b96817be9c54acaeed3503d6940500a133a8e7af
/java8/part1/src/lambda/types/ConsumerTest.java
6ac5b2c347299b63d2ab205164832879e7082bf0
[]
no_license
anbarasupr/java
3072fe76652205e163e7e1e3fe9848e80ecf11a6
e0cd42c6b9d1b675047ab178a9012509e37d6671
refs/heads/master
2023-07-11T11:49:56.153323
2023-06-22T15:09:47
2023-06-22T15:09:47
193,373,509
0
0
null
null
null
null
UTF-8
Java
false
false
1,433
java
package lambda.types; import java.util.*; import java.util.Iterator; import java.util.function.*; import common.Employee; import common.Student; public class ConsumerTest { public static void main(String[] args) { String s = "Hello my dear darling. How are you?"; Consumer<String> c = str -> System.out.println("consumer received:" + str); c.accept(s); // find students information including grade whose marks >=60 Function<Student, String> f = stud -> { int marks = stud.getMarks(); if (marks >= 80) { return "A[Distinction]"; } else if (marks >= 60) { return "B[First Class]"; } else if (marks >= 50) { return "B[Second Class]"; } else if (marks >= 40) { return "B[Third Class]"; } else { return "E[Failed]"; } }; Predicate<Student> p=stud->stud.getMarks()>=60; Consumer<Student> con=stud->System.out .println("name: " + stud.getName() + ", marks: " + stud.getMarks() + " , Grade: " + f.apply(stud)); System.out.println("PRINTING STUDENTS GRADE WHOSE MARKS >=60"); List<Student> list=getStudentList(); for (Student stud : list) { if(p.test(stud)) { con.accept(stud); } } } public static List<Student> getStudentList() { List<Student> list = new ArrayList<>(); list.add(new Student("anbu", 100)); list.add(new Student("priya", 99)); list.add(new Student("selvam", 60)); list.add(new Student("aruna", 30)); return list; } }
[ "anbarasu.2013@gmail.com" ]
anbarasu.2013@gmail.com
398aa3cdf8d7cf345f50abbf80bd71c3a2d27fc0
c2fb6846d5b932928854cfd194d95c79c723f04c
/arduino_backup/MySqljdbcdriver/mysql-connector-java-5.1.42/mysql-connector-java-5.1.42/src/com/mysql/jdbc/Statement.java
c3499bb0dda48831bcedc09b806653ff9134f52a
[ "GPL-2.0-only", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-only", "GPL-1.0-or-later", "LGPL-2.0-or-later", "LGPL-2.1-or-later", "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
Jimut123/code-backup
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
8d4c16b9e960d352a7775786ea60290b29b30143
refs/heads/master
2022-12-07T04:10:59.604922
2021-04-28T10:22:19
2021-04-28T10:22:19
156,666,404
9
5
MIT
2022-12-02T20:27:22
2018-11-08T07:22:48
Jupyter Notebook
UTF-8
Java
false
false
3,889
java
/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/J is licensed under the terms of the GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors. There are special exceptions to the terms and conditions of the GPLv2 as it is applied to this software, see the FOSS License Exception <http://www.mysql.com/about/legal/licensing/foss-exception.html>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package com.mysql.jdbc; import java.io.InputStream; import java.sql.SQLException; /** * This interface contains methods that are considered the "vendor extension" to the JDBC API for MySQL's implementation of java.sql.Statement. * * For those looking further into the driver implementation, it is not an API that is used for plugability of implementations inside our driver * (which is why there are still references to StatementImpl throughout the code). */ public interface Statement extends java.sql.Statement, Wrapper { /** * Workaround for containers that 'check' for sane values of * Statement.setFetchSize() so that applications can use * the Java variant of libmysql's mysql_use_result() behavior. * * @throws SQLException */ public abstract void enableStreamingResults() throws SQLException; /** * Resets this statements fetch size and result set type to the values * they had before enableStreamingResults() was called. * * @throws SQLException */ public abstract void disableStreamingResults() throws SQLException; /** * Sets an InputStream instance that will be used to send data * to the MySQL server for a "LOAD DATA LOCAL INFILE" statement * rather than a FileInputStream or URLInputStream that represents * the path given as an argument to the statement. * * This stream will be read to completion upon execution of a * "LOAD DATA LOCAL INFILE" statement, and will automatically * be closed by the driver, so it needs to be reset * before each call to execute*() that would cause the MySQL * server to request data to fulfill the request for * "LOAD DATA LOCAL INFILE". * * If this value is set to NULL, the driver will revert to using * a FileInputStream or URLInputStream as required. */ public abstract void setLocalInfileInputStream(InputStream stream); /** * Returns the InputStream instance that will be used to send * data in response to a "LOAD DATA LOCAL INFILE" statement. * * This method returns NULL if no such stream has been set * via setLocalInfileInputStream(). */ public abstract InputStream getLocalInfileInputStream(); public void setPingTarget(PingTarget pingTarget); public ExceptionInterceptor getExceptionInterceptor(); /** * Callback for result set instances to remove them from the Set that * tracks them per-statement */ public abstract void removeOpenResultSet(ResultSetInternalMethods rs); /** * Returns the number of open result sets for this statement. */ public abstract int getOpenResultSetCount(); public void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose); }
[ "jimutbahanpal@yahoo.com" ]
jimutbahanpal@yahoo.com
e64ad25687c71ff014c7e3b87e1398e2d3321fb6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_caaf0ccfc3d634f8ddf0f68db4d19ee1775a1f25/TCPio/30_caaf0ccfc3d634f8ddf0f68db4d19ee1775a1f25_TCPio_s.java
05261d863d269b33928183f171598bc1102b1b65
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,201
java
/** * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE * Version 2, December 2004 * * Copyright (C) sponge * Planet Earth * Everyone is permitted to copy and distribute verbatim or modified * copies of this license document, and changing it is allowed as long * as the name is changed. * * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION * * 0. You just DO WHAT THE FUCK YOU WANT TO. * * See... * * http://sam.zoy.org/wtfpl/ * and * http://en.wikipedia.org/wiki/WTFPL * * ...for any additional details and liscense questions. */ package net.i2p.BOB; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * Shove data from one stream to the other. * * @author sponge */ public class TCPio implements Runnable { private InputStream Ain; private OutputStream Aout; private nickname info; /** * Constructor * * @param Ain * @param Aout * @param db */ TCPio(InputStream Ain, OutputStream Aout, nickname db) { this.Ain = Ain; this.Aout = Aout; this.info = db; } /** * kill off the streams, to hopefully cause an IOException in the thread in order to kill it. */ /** * Copy from source to destination... * and yes, we are totally OK to block here on writes, * The OS has buffers, and I intend to use them. * */ public void run() { int b; byte a[] = new byte[1]; try { while(info.get("RUNNING").equals(true)) { b = Ain.read(a, 0, 1); // System.out.println(info.get("NICKNAME").toString() + " " + b); if(b > 0) { Aout.write(a,0,1); // Aout.flush(); too slow! } else if(b == 0) { try { // Thread.yield(); Thread.sleep(10); } catch(InterruptedException ex) { } } else { /* according to the specs: * * The total number of bytes read into the buffer, * or -1 is there is no more data because the end of * the stream has been reached. * */ return; } } } catch(IOException e) { } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
23112f8d630906232c6a32bbbf88cadc2df69465
926ebcb8c9b0734ea588777f1e7ffed7722e9e8c
/ASSA_source_code/app/src/main/java/com/example/user/gjsd/view/costlist/DistanceViewItem.java
7816125c6bb298831da4cb7ee8bcce961cafcbda
[]
no_license
MobileSeoul/2018seoul-92
a885051ede49492ebd5bf7f9f559b56c7bf0006f
5e998e404d66853bdf090b49bae10d6c35c3dda4
refs/heads/master
2020-04-11T21:37:13.338984
2018-12-17T10:13:25
2018-12-17T10:13:25
162,111,393
0
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package com.example.user.gjsd.view.costlist; import com.example.user.gjsd.model.Market; public class DistanceViewItem { // private String numberStr ; // private String titleStr ; // private String descStr ; // private String disStr ; // // public void setNumber(String number) { // numberStr = number; // } // public void setTitle(String title) { // titleStr = title ; // } // public void setDesc(String desc) { // descStr = desc ; // } // // public void setDisStr(String disStr) { // this.disStr = disStr; // } // // public String getNumber() { // return this.numberStr ; // } // public String getTitle() { // return this.titleStr ; // } // public String getDesc() { // return this.descStr ; // } // // public String getDisStr() { // return disStr; // } // // // private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public Market getMarket() { return market; } private Market market; public DistanceViewItem(String name, Market market){ this.name = name; this.market = market; } }
[ "ianyrchoi@gmail.com" ]
ianyrchoi@gmail.com
7ce686e7667b6a213f29f4a84bfb44ef213bc610
2f3c04382a66dbf222c8587edd67a5df4bc80422
/src/com/cedar/cp/ejb/api/budgetlocation/UserModelSecurityEditorSessionLocalHome.java
80394fe03982bad3f6a0aceb0b9d630ab1fbd387
[]
no_license
arnoldbendaa/cppro
d3ab6181cc51baad2b80876c65e11e92c569f0cc
f55958b85a74ad685f1360ae33c881b50d6e5814
refs/heads/master
2020-03-23T04:18:00.265742
2018-09-11T08:15:28
2018-09-11T08:15:28
141,074,966
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.cedar.cp.ejb.api.budgetlocation; import javax.ejb.CreateException; import javax.ejb.EJBLocalHome; public interface UserModelSecurityEditorSessionLocalHome extends EJBLocalHome { UserModelSecurityEditorSessionLocal create() throws CreateException; }
[ "arnoldbendaa@gmail.com" ]
arnoldbendaa@gmail.com
65eee1e35c275639ef92200dc417d782ec5804b3
3b5c8c5f62689fa2264581a5777ff7caf8c7608c
/25.visitor/src/main/java/visitors/acyclic/ExpressionPrinter.java
3f7c5c3ba7b71872b6a8e57d2e6eeef6b635361c
[]
no_license
slemjet/design-patterns
085adae813c1e257fcdf5009b20a64dc7f31c051
811b9b1ff9ca9654d3e20590986012f5b6862ac3
refs/heads/master
2021-06-15T16:22:17.668179
2019-09-08T08:50:10
2019-09-08T08:50:10
145,006,766
0
0
null
2021-03-31T21:32:02
2018-08-16T15:28:52
Java
UTF-8
Java
false
false
684
java
package visitors.acyclic; public class ExpressionPrinter implements DoubleExpressionVisitor, AdditionExpressionVisitor { private StringBuilder stringBuilder = new StringBuilder(); public void visit(DoubleExpression doubleExpression) { stringBuilder.append(doubleExpression.getValue()); } public void visit(AdditionExpression additionExpression) { stringBuilder.append("("); additionExpression.getLeft().accept(this); stringBuilder.append("+"); additionExpression.getRight().accept(this); stringBuilder.append(")"); } @Override public String toString() { return stringBuilder.toString(); } }
[ "slemjet@gmail.com" ]
slemjet@gmail.com
626d1ea9535793915977738390b22ed64be8bd85
5f2fb08c46b2acdfe52583cf95925325b36c6820
/skWeiChatBaidu/src/main/java/com/xfyyim/cn/ui/mucfile/ThreadPoolProxy.java
9cec04526be202219565c9f25a7578cf658c8eb8
[]
no_license
309925753/xinfuyouyue
7324fb7062c126156ee350a0e14b8b18bed7afe6
0bc8f8bb387d2203b74af05bfcc6733cde51cda2
refs/heads/master
2022-11-30T23:46:53.082249
2020-05-19T11:48:55
2020-05-19T11:48:55
287,436,362
3
6
null
null
null
null
UTF-8
Java
false
false
2,998
java
package com.xfyyim.cn.ui.mucfile; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @author liuxuan * @time 2017-7-7 14:39:11 * @des 创建线程池, 执行任务, 提交任务 */ public class ThreadPoolProxy { ThreadPoolExecutor mExecutor; int mCorePoolSize = 3; int mMaximumPoolSize = 3; long mKeepAliveTime = 1800; TimeUnit mUnit = TimeUnit.SECONDS; private ThreadPoolProxy(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) { super(); mCorePoolSize = corePoolSize; mMaximumPoolSize = maximumPoolSize; mKeepAliveTime = keepAliveTime; mUnit = unit; } private static volatile ThreadPoolProxy instance = null; public static ThreadPoolProxy getInstance() { synchronized (ThreadPoolProxy.class) { if (instance == null) { instance = new ThreadPoolProxy(3, 3, 3000, TimeUnit.MILLISECONDS); } } return instance; } private ThreadPoolExecutor initThreadPoolExecutor() { // 双重检查加锁 if (mExecutor == null) { synchronized (ThreadPoolProxy.class) { if (mExecutor == null) { BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>();// 无界队列 /* ThreadFactory threadFactory = Executors.defaultThreadFactory(); RejectedExecutionHandler handler = new ThreadPoolExecutor.AbortPolicy(); mExecutor = new ThreadPoolExecutor( mCorePoolSize, // 核心线程数 mMaximumPoolSize,// 最大的线程数 mKeepAliveTime, // 非核心线程超时时长(存活时长) mUnit, // 超时时间单位 workQueue, // 线程池中的任务队列 ); */ mExecutor = new ThreadPoolExecutor( mCorePoolSize, // 核心线程数 mMaximumPoolSize,// 最大的线程数 mKeepAliveTime, // 非核心线程超时时长(存活时长) mUnit, // 超时时间单位 workQueue // 线程池中的任务队列 ); // mExecutor.allowCoreThreadTimeOut(true);// 核心线程也存在超时策略 } } } return mExecutor; } /** * 执行任务 */ public void execute(Runnable task) { initThreadPoolExecutor(); mExecutor.execute(task); } /** * 移除任务 */ public void removeTask(Runnable task) { initThreadPoolExecutor(); mExecutor.remove(task); } }
[ "309925753@qq.com" ]
309925753@qq.com
3a479c86808e964286492fb62af1253267a18407
46167791cbfeebc8d3ddc97112764d7947fffa22
/quarkus/src/main/java/com/justexample/entity/Entity1443.java
d8504ff13af05ecd18255bc62633b56c8f5054bd
[]
no_license
kahlai/unrealistictest
4f668b4822a25b4c1f06c6b543a26506bb1f8870
fe30034b05f5aacd0ef69523479ae721e234995c
refs/heads/master
2023-08-25T09:32:16.059555
2021-11-09T08:17:22
2021-11-09T08:17:22
425,726,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
package com.example.entity; import java.sql.Timestamp; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Entity1443 { @Id private Long id; private String code; private String name; private String status; private int seq; private Timestamp createdDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public int getSeq() { return seq; } public void setSeq(int seq) { this.seq = seq; } public Timestamp getCreatedDate() { return createdDate; } public void setCreatedDate(Timestamp createdDate) { this.createdDate = createdDate; } }
[ "laikahhoe@gmail.com" ]
laikahhoe@gmail.com
d5239b5dd23855774aac0d98c7ce0cc248d6450c
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgGson/src/org/kyojo/schemaOrg/m3n3/gson/healthLifesci/clazz/SubstanceDeserializer.java
60ae0a15d611648e833d80fd09f8d2ad3e943d85
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
2,067
java
package org.kyojo.schemaorg.m3n3.gson.healthLifesci.clazz; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import org.kyojo.gson.JsonDeserializationContext; import org.kyojo.gson.JsonDeserializer; import org.kyojo.gson.JsonElement; import org.kyojo.gson.JsonObject; import org.kyojo.gson.JsonParseException; import org.kyojo.gson.reflect.TypeToken; import org.kyojo.schemaorg.m3n3.healthLifesci.impl.SUBSTANCE; import org.kyojo.schemaorg.m3n3.healthLifesci.Clazz.Substance; public class SubstanceDeserializer implements JsonDeserializer<Substance> { @Override public Substance deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { if(jsonElement.isJsonPrimitive()) { return new SUBSTANCE(jsonElement.getAsString()); } JsonObject jsonObject = jsonElement.getAsJsonObject(); Substance obj = new SUBSTANCE(); HashMap<String, Field> fldMap = new HashMap<>(); Field[] flds = SUBSTANCE.class.getFields(); for(Field fld : flds) { fldMap.put(fld.getName(), fld); } for(Entry<String, JsonElement> ent : jsonObject.entrySet()) { if(fldMap.containsKey(ent.getKey())) { Field fld = fldMap.get(ent.getKey()); JsonElement elm = ent.getValue(); try { if(fld.getType().equals(List.class)) { ParameterizedType gType = (ParameterizedType)fld.getGenericType(); Type[] aTypes = gType.getActualTypeArguments(); Type listType = TypeToken.getParameterized(ArrayList.class, (Class<?>)aTypes[0]).getType(); List<?> list = context.deserialize(elm, listType); fld.set(obj, list); } else { Object val = context.deserialize(elm, fld.getType()); fld.set(obj, val); } } catch(IllegalArgumentException iae) { throw new JsonParseException(iae); } catch(IllegalAccessException iae) { throw new JsonParseException(iae); } } } return obj; } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
d30b2b83abd16fe469b18ae58ee33b9ccdcbc7be
254292bbb95222cd6a97eae493e28b5a63c14a9d
/spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/service/HotelServiceImpl.java
7bb9d4902f4b92a6420bd1bf10b3f206a79958dc
[ "Apache-2.0", "Noweb" ]
permissive
pikefeier/springboot
0e881a59ceefd3ae1991e83a0ad4a4d787831097
2fb23ab250f095dec39bf5e4d114c26d51467142
refs/heads/master
2023-01-09T02:51:23.939848
2019-12-30T12:19:14
2019-12-30T12:19:14
230,909,567
0
0
Apache-2.0
2022-12-27T14:51:00
2019-12-30T12:10:46
Java
UTF-8
Java
false
false
3,136
java
/* * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sample.hibernate52.service; import java.util.HashMap; import java.util.List; import java.util.Map; import sample.hibernate52.domain.City; import sample.hibernate52.domain.Hotel; import sample.hibernate52.domain.Rating; import sample.hibernate52.domain.RatingCount; import sample.hibernate52.domain.Review; import sample.hibernate52.domain.ReviewDetails; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @Component("hotelService") @Transactional class HotelServiceImpl implements HotelService { private final HotelRepository hotelRepository; private final ReviewRepository reviewRepository; public HotelServiceImpl(HotelRepository hotelRepository, ReviewRepository reviewRepository) { this.hotelRepository = hotelRepository; this.reviewRepository = reviewRepository; } @Override public Hotel getHotel(City city, String name) { Assert.notNull(city, "City must not be null"); Assert.hasLength(name, "Name must not be empty"); return this.hotelRepository.findByCityAndName(city, name); } @Override public Page<Review> getReviews(Hotel hotel, Pageable pageable) { Assert.notNull(hotel, "Hotel must not be null"); return this.reviewRepository.findByHotel(hotel, pageable); } @Override public Review getReview(Hotel hotel, int reviewNumber) { Assert.notNull(hotel, "Hotel must not be null"); return this.reviewRepository.findByHotelAndIndex(hotel, reviewNumber); } @Override public Review addReview(Hotel hotel, ReviewDetails details) { Review review = new Review(hotel, 1, details); return this.reviewRepository.save(review); } @Override public ReviewsSummary getReviewSummary(Hotel hotel) { List<RatingCount> ratingCounts = this.hotelRepository.findRatingCounts(hotel); return new ReviewsSummaryImpl(ratingCounts); } private static class ReviewsSummaryImpl implements ReviewsSummary { private final Map<Rating, Long> ratingCount; public ReviewsSummaryImpl(List<RatingCount> ratingCounts) { this.ratingCount = new HashMap<Rating, Long>(); for (RatingCount ratingCount : ratingCounts) { this.ratingCount.put(ratingCount.getRating(), ratingCount.getCount()); } } @Override public long getNumberOfReviewsWithRating(Rating rating) { Long count = this.ratingCount.get(rating); return count == null ? 0 : count; } } }
[ "945302777@qq.com" ]
945302777@qq.com
99d3aefb812a6029d2e0dbe61adc0dafdf5cc6f3
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
/src/net/datenwerke/gxtdto/client/forms/simpleform/conditions/FieldChanged.java
af32bc98b0b0db8ca7e2fb59531b715cf6ab20cd
[]
no_license
bireports/ReportServer
da979eaf472b3e199e6fbd52b3031f0e819bff14
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
refs/heads/master
2020-04-18T10:18:56.181123
2019-01-25T00:45:14
2019-01-25T00:45:14
167,463,795
0
0
null
null
null
null
UTF-8
Java
false
false
1,318
java
/* * ReportServer * Copyright (c) 2018 InfoFabrik GmbH * http://reportserver.net/ * * * This file is part of ReportServer. * * ReportServer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.datenwerke.gxtdto.client.forms.simpleform.conditions; import net.datenwerke.gxtdto.client.forms.simpleform.SimpleForm; import net.datenwerke.gxtdto.client.forms.simpleform.hooks.FormFieldProviderHook; import com.google.gwt.user.client.ui.Widget; /** * * */ public class FieldChanged implements SimpleFormCondition { public boolean isMet(Widget formField, FormFieldProviderHook responsibleHook, SimpleForm form) { return true; } }
[ "srbala@gmail.com" ]
srbala@gmail.com
9117743b18b73c53dd8c6a807c5935a7f52ab44f
9abcf6981bd072be432af1c9920c7c982c36b84d
/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/InstallPlanJob.java
3c72c47c3f30ba4207d7219974b64b42273b984f
[]
no_license
Spencerx/xwiki-commons
026b6c0bfc31a3ba816a1b05e0c6f1c64824ec48
98ca9079598d7c90b8e2b7589c55d0f0e21eed7a
refs/heads/master
2021-01-16T17:52:07.194692
2014-06-27T08:51:59
2014-06-27T08:51:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,784
java
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.extension.job.internal; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; import javax.inject.Named; import org.xwiki.component.annotation.Component; import org.xwiki.extension.ExtensionId; import org.xwiki.extension.job.InstallRequest; import org.xwiki.job.Request; /** * Create an Extension installation plan. * * @version $Id$ * @since 4.0M1 */ @Component @Named(InstallPlanJob.JOBTYPE) public class InstallPlanJob extends AbstractInstallPlanJob<InstallRequest> { /** * The id of the job. */ public static final String JOBTYPE = "installplan"; @Override public String getType() { return JOBTYPE; } @Override protected InstallRequest castRequest(Request request) { InstallRequest installRequest; if (request instanceof InstallRequest) { installRequest = (InstallRequest) request; } else { installRequest = new InstallRequest(request); } return installRequest; } @Override protected void runInternal() throws Exception { Map<ExtensionId, Collection<String>> extensionsByNamespace = new LinkedHashMap<ExtensionId, Collection<String>>(); Collection<ExtensionId> extensions = getRequest().getExtensions(); for (ExtensionId extensionId : extensions) { if (getRequest().hasNamespaces()) { Collection<String> namespaces = getRequest().getNamespaces(); for (String namespace : namespaces) { addExtensionToProcess(extensionsByNamespace, extensionId, namespace); } } else { addExtensionToProcess(extensionsByNamespace, extensionId, null); } } // Start the actual plan creation start(extensionsByNamespace); } }
[ "thomas.mortagne@gmail.com" ]
thomas.mortagne@gmail.com
07b29450904f0f6592104056a316801364620259
577febbc697ea9cc2d645d79677b247d0c96af32
/src/test/java/com/alphadevs/tools/repository/timezone/DateTimeWrapperRepository.java
feda8536f33ea3ba4791a83ffc3fc1822ddc4c0d
[]
no_license
AlphaDevTeam/DBTool
e57c596f35eac0b336f116d970216805560e5c58
621055301908ba31e747eba3dd9d58e3a569db39
refs/heads/master
2020-12-21T03:09:33.332916
2020-01-26T08:46:38
2020-01-26T08:46:38
236,287,249
0
0
null
2020-01-26T08:51:30
2020-01-26T08:46:24
Java
UTF-8
Java
false
false
346
java
package com.alphadevs.tools.repository.timezone; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data JPA repository for the {@link DateTimeWrapper} entity. */ @Repository public interface DateTimeWrapperRepository extends JpaRepository<DateTimeWrapper, Long> { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
b23ec5e6700f59a65f76430d4f7b61086a8c1d61
893100224187a2aa8643d5067cbf634a0677fa37
/src/main/java/com/bytatech/ayoos/appointment/resource/assembler/NextTaskResource.java
58cef254eef00208e9d0b041d2fe994bf2f56c59
[]
no_license
BYTA-TECH/Appointment
7dd4bc10c09ef0c286dc21fe77667df9565e5dbe
7fbb1dedb0585cec2cbb3838a57a721d11435a3a
refs/heads/master
2022-12-22T22:45:25.459180
2020-03-16T11:24:34
2020-03-16T11:24:34
236,931,411
0
0
null
2022-12-16T04:43:44
2020-01-29T08:00:09
Java
UTF-8
Java
false
false
1,021
java
package com.bytatech.ayoos.appointment.resource.assembler; public class NextTaskResource { private String nextTaskId; private String nextTaskName; private String processId; /** * @return the nextTaskId */ public String getNextTaskId() { return nextTaskId; } /** * @return the selfId */ @Override public String toString() { return String.format( "CommandResource [nextTaskId=%s,\n nextTaskName=%s, \n processId=%s]", nextTaskId, nextTaskName, processId); } /** * @param nextTaskId the nextTaskId to set */ public void setNextTaskId(String nextTaskId) { this.nextTaskId = nextTaskId; } /** * @return the nextTaskName */ public String getNextTaskName() { return nextTaskName; } /** * @param nextTaskName the nextTaskName to set */ public void setNextTaskName(String nextTaskName) { this.nextTaskName = nextTaskName; } public String getProcessId() { return processId; } public void setProcessId(String processId) { this.processId = processId; } }
[ "ajay.e.s@lxisoft.com" ]
ajay.e.s@lxisoft.com
f7d11465fb3d6d10c7a7264a7db277ed36dd3dee
a25ffce70545f7a6afeb58e5c70eb24a17426318
/jbm-cluster/jbm-cluster-platform/jbm-cluster-platform-gateway/src/main/java/com/jbm/cluster/platform/gateway/handler/ValidateCodeHandler.java
23082b7a4bad392815cb0d38f62589a6d1dc60bc
[ "Apache-2.0" ]
permissive
numen06/JBM
4b3b2158f8199957c6e1500ab05ae5aca375a98f
827df87659e9392d73897753142271ab1e573974
refs/heads/7.1
2023-08-31T15:35:34.579275
2023-08-23T01:12:01
2023-08-23T01:12:01
160,906,536
10
9
Apache-2.0
2023-04-14T19:31:19
2018-12-08T05:16:32
Java
UTF-8
Java
false
false
1,408
java
package com.jbm.cluster.platform.gateway.handler; import com.alibaba.fastjson.JSON; import com.jbm.cluster.platform.gateway.service.ValidateCodeService; import com.jbm.framework.exceptions.CaptchaException; import com.jbm.framework.metadata.bean.ResultBody; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.server.HandlerFunction; import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; import reactor.core.publisher.Mono; import java.io.IOException; import java.util.Map; /** * 验证码获取 * * @author wesley.zhang */ @Component public class ValidateCodeHandler implements HandlerFunction<ServerResponse> { @Autowired private ValidateCodeService validateCodeService; @Override public Mono<ServerResponse> handle(ServerRequest serverRequest) { ResultBody<Map<String, Object>> ajax; try { ajax = validateCodeService.createCaptcha(); } catch (CaptchaException | IOException e) { return Mono.error(e); } return ServerResponse.status(HttpStatus.OK).body(BodyInserters.fromValue(JSON.toJSONString(ajax))); } }
[ "numen06@sina.com" ]
numen06@sina.com
2c559050c5d59c6e09ff8d924dc926c20f904e40
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/143/209/CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b.java
44356d86815cd9721841ea81db71ad3f9c29f88b
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
1,276
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b.java Label Definition File: CWE789_Uncontrolled_Mem_Alloc.int.label.xml Template File: sources-sink-51b.tmpl.java */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: console_readLine Read data from the console using readLine * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: HashSet Create a HashSet using data as the initial size * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ import java.util.HashSet; public class CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b { public void badSink(int data ) throws Throwable { /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(int data ) throws Throwable { /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
8e4c4ed817cfdf14704411ea64958df6fd2fd68b
43d68a329037c6490a4848d34781a8ed07db45a9
/src/com/facebook/buck/android/AndroidBinaryInstallGraphEnhancer.java
0db17789bedfbfa43f080ac51c641484cafa2ed2
[ "Apache-2.0" ]
permissive
thalescm/buck
415a1be0936ce4ec962fe255503f3c913cfe9f3a
8bf1ef65b9238854a7a622e5caaa7a292dc2ed9a
refs/heads/master
2022-01-05T23:47:17.703353
2019-03-01T15:21:17
2019-03-01T16:09:56
116,996,764
0
0
Apache-2.0
2019-05-15T08:56:13
2018-01-10T18:43:50
Java
UTF-8
Java
false
false
7,249
java
/* * Copyright 2017-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.android; import com.facebook.buck.android.exopackage.ExopackageInfo; import com.facebook.buck.android.exopackage.ExopackagePathAndHash; import com.facebook.buck.core.model.BuildTarget; import com.facebook.buck.core.model.Flavor; import com.facebook.buck.core.model.InternalFlavor; import com.facebook.buck.core.rules.ActionGraphBuilder; import com.facebook.buck.core.rules.BuildRule; import com.facebook.buck.core.rules.SourcePathRuleFinder; import com.facebook.buck.core.rules.impl.NoopBuildRule; import com.facebook.buck.core.sourcepath.SourcePath; import com.facebook.buck.io.filesystem.ProjectFilesystem; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.Multimap; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Optional; class AndroidBinaryInstallGraphEnhancer { static final Flavor INSTALL_FLAVOR = InternalFlavor.of("install"); private static final Flavor DIRECTORY_LISTING_FLAVOR = InternalFlavor.of("exo_directory_listing"); private static final Flavor EXO_FILE_INSTALL_FLAVOR = InternalFlavor.of("exo_file_installer"); private static final Flavor EXO_FILE_RESOURCE_INSTALL_FLAVOR = InternalFlavor.of("exo_resources_installer"); private ProjectFilesystem projectFilesystem; private BuildTarget buildTarget; private HasInstallableApk installableApk; private AndroidInstallConfig androidInstallConfig; AndroidBinaryInstallGraphEnhancer( AndroidInstallConfig androidInstallConfig, ProjectFilesystem projectFilesystem, BuildTarget buildTarget, HasInstallableApk installableApk) { this.projectFilesystem = projectFilesystem; this.buildTarget = buildTarget.withFlavors(INSTALL_FLAVOR); this.installableApk = installableApk; this.androidInstallConfig = androidInstallConfig; } public void enhance(ActionGraphBuilder graphBuilder) { if (androidInstallConfig.getConcurrentInstallEnabled(Optional.empty())) { if (exopackageEnabled()) { enhanceForConcurrentExopackageInstall(graphBuilder); } else { enhanceForConcurrentInstall(graphBuilder); } } else { enhanceForLegacyInstall(graphBuilder); } } private boolean exopackageEnabled() { return installableApk.getApkInfo().getExopackageInfo().isPresent(); } private void enhanceForConcurrentExopackageInstall(ActionGraphBuilder graphBuilder) { ApkInfo apkInfo = installableApk.getApkInfo(); Preconditions.checkState(apkInfo.getExopackageInfo().isPresent()); ExopackageDeviceDirectoryLister directoryLister = new ExopackageDeviceDirectoryLister( buildTarget.withFlavors(DIRECTORY_LISTING_FLAVOR), projectFilesystem); SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(graphBuilder); ExopackageInfo exopackageInfo = apkInfo.getExopackageInfo().get(); ImmutableList.Builder<BuildRule> finisherDeps = ImmutableList.builder(); if (exopackageInfo.getDexInfo().isPresent() || exopackageInfo.getNativeLibsInfo().isPresent() || exopackageInfo.getModuleInfo().isPresent()) { ExopackageInfo filteredExopackageInfo = ExopackageInfo.builder() .setDexInfo(exopackageInfo.getDexInfo()) .setNativeLibsInfo(exopackageInfo.getNativeLibsInfo()) .setModuleInfo(exopackageInfo.getModuleInfo()) .build(); ExopackageFilesInstaller fileInstaller = new ExopackageFilesInstaller( buildTarget.withFlavors(EXO_FILE_INSTALL_FLAVOR), projectFilesystem, ruleFinder, directoryLister.getSourcePathToOutput(), apkInfo.getManifestPath(), filteredExopackageInfo); graphBuilder.addToIndex(fileInstaller); finisherDeps.add(fileInstaller); } if (exopackageInfo.getResourcesInfo().isPresent()) { List<BuildRule> resourceInstallRules = createResourceInstallRules( exopackageInfo.getResourcesInfo().get(), ruleFinder, apkInfo.getManifestPath(), directoryLister.getSourcePathToOutput()); resourceInstallRules.forEach(graphBuilder::addToIndex); finisherDeps.addAll(resourceInstallRules); } BuildRule apkInstaller = new ExopackageInstallFinisher( buildTarget, projectFilesystem, ruleFinder, apkInfo, directoryLister, finisherDeps.build()); graphBuilder.addToIndex(directoryLister); graphBuilder.addToIndex(apkInstaller); } private List<BuildRule> createResourceInstallRules( ExopackageInfo.ResourcesInfo resourcesInfo, SourcePathRuleFinder ruleFinder, SourcePath manifestPath, SourcePath deviceExoContents) { // We construct a single ExopackageResourcesInstaller for each creator of exopackage resources. // This is done because the installers will synchronize on the underlying AndroidDevicesHelper // and so we don't want a single rule to generate a bunch of resource files and then take up a // bunch of build threads all waiting on each other. Multimap<BuildRule, ExopackagePathAndHash> creatorMappedPaths = resourcesInfo .getResourcesPaths() .stream() .collect( ImmutableListMultimap.toImmutableListMultimap( (ExopackagePathAndHash pathAndHash) -> ruleFinder.getRule(pathAndHash.getPath()).orElse(null), v -> v)); List<BuildRule> installers = new ArrayList<>(); int index = 0; for (Collection<ExopackagePathAndHash> paths : creatorMappedPaths.asMap().values()) { installers.add( new ExopackageResourcesInstaller( buildTarget.withAppendedFlavors( EXO_FILE_RESOURCE_INSTALL_FLAVOR, InternalFlavor.of(String.format("resources-%d", index))), projectFilesystem, ruleFinder, paths, manifestPath, deviceExoContents)); index++; } return installers; } private void enhanceForConcurrentInstall(ActionGraphBuilder graphBuilder) { graphBuilder.addToIndex( new AndroidBinaryNonExoInstaller(buildTarget, projectFilesystem, installableApk)); } private void enhanceForLegacyInstall(ActionGraphBuilder graphBuilder) { graphBuilder.addToIndex(new NoopBuildRule(buildTarget, projectFilesystem)); } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
cba039c870257f6215456b8153e69b1074566eb1
bccdc3e076a3473edfc2347cd70723d2af514b9b
/concurrency-basic/src/test/io/hedwig/concurrence/concurrentCF/map/SingletonTest.java
c8285f53a75f170cdfef575fb9e9958541eacdc8
[]
no_license
qdriven/meet-concurrence
6a5870a0e002ef2ef6dd0876a33c91e997dd79ad
f2afc8fd9803bbcbe6b5a4ef0116b959323399f6
refs/heads/master
2021-06-28T21:51:33.692154
2019-07-26T04:45:51
2019-07-26T04:45:51
179,921,196
0
0
null
2020-10-13T12:44:30
2019-04-07T05:15:19
Java
UTF-8
Java
false
false
773
java
package io.hedwig.concurrence.concurrentCF.map; import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class SingletonTest { private static Singleton singleton; @BeforeClass public static void setUpBeforeClass() throws Exception { singleton = Singleton.getInstance(); } @AfterClass public static void tearDownAfterClass() throws Exception { } @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void testLockResource() { int i1 = singleton.lockResource(); assertTrue(i1==0); } @Test public void testUnlockResource() { singleton.unlockResource(0); } }
[ "patrickwuke@163.com" ]
patrickwuke@163.com
3a4359fe00e22a8e0e7b8506225440604771ab2b
06eb59d91495a2b9568d21019e4dcb61ff236b7a
/izpack-src/tags/3.10.2/src/lib/com/izforge/izpack/util/os/WrappedNativeLibException.java
2de5f5fbfdac0edcc9b2b8ba9085e738ca57cbd4
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jponge/izpack-full-svn-history-copy
8fa773fb3f9f4004e762d29f708273533ba0ff1f
7a521ccd6ce0dd1a0664eaae12fd5bba5571d231
refs/heads/master
2016-09-01T18:24:14.656773
2010-03-01T07:38:22
2010-03-01T07:38:22
551,191
1
1
null
null
null
null
UTF-8
Java
false
false
5,004
java
/* * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved. * * http://izpack.org/ * http://developer.berlios.de/projects/izpack/ * * Copyright 2005 Klaus Bartz * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.izforge.izpack.util.os; import com.coi.tools.os.win.NativeLibException; import com.izforge.izpack.LocaleDatabase; /** * This class allows it to define error messages for <code>NativeLibException</code> s in the * IzPack locale files. The getMessage methode searches in the current langpack for entries which * are corresponding to that one which are received from native part. If the langpack do not contain * the entry, the resource boundle is used. * * @author Klaus Bartz * */ public class WrappedNativeLibException extends Exception { private static final long serialVersionUID = 3257562893309720112L; /** The packs locale database. */ protected static LocaleDatabase langpack = null; /** * Default constructor. */ public WrappedNativeLibException() { super(); } /** * @param message */ public WrappedNativeLibException(String message) { super(message); } /** * @param cause */ public WrappedNativeLibException(Throwable cause) { super(cause); } /** * @param message * @param cause */ public WrappedNativeLibException(String message, Throwable cause) { super(message, cause); } /* * (non-Javadoc) * * @see java.lang.Throwable#getMessage() */ public String getMessage() { StringBuffer retval = new StringBuffer(); boolean next = false; boolean ok = false; if (getCause() instanceof NativeLibException) { NativeLibException nle = (NativeLibException) getCause(); if (langpack != null) { while (true) { if (nle.getLibMessage() != null) { String val = (String) langpack.get("NativeLibException." + nle.getLibMessage()); if (val == null) break; retval.append(val); next = true; } else if (nle.getLibErr() != 0) { String val = (String) langpack.get("NativeLibException.libErrNumber." + Integer.toString(nle.getLibErr())); if (val == null) break; if (next) retval.append("\n"); next = true; retval.append(val); } if (nle.getOsErr() != 0) { String val = (String) langpack .get("NativeLibException.libInternal.OsErrNumPraefix") + Integer.toString(nle.getOsErr()); if (val == null) break; if (next) retval.append("\n"); next = true; retval.append(val); } if (nle.getOsMessage() != null) { String val = (String) langpack .get("NativeLibException.libInternal.OsErrStringPraefix") + nle.getOsMessage(); if (val == null) break; if (next) retval.append("\n"); next = true; retval.append(val); } ok = true; break; } } if (ok && retval.length() > 0) return (nle.reviseMsgWithArgs(retval.toString())); else return (nle.getMessage()); } else return (super.getMessage()); } /** * Returns the langpack. * * @return Returns the langpack. */ public static LocaleDatabase getLangpack() { return langpack; } /** * Sets the langpack to the given locale database. * * @param langpack the langpack to set. */ public static void setLangpack(LocaleDatabase langpack) { WrappedNativeLibException.langpack = langpack; } }
[ "jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761" ]
jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761
2871692944940d2bc5169b4cb547b46d7777d321
29b6a856a81a47ebab7bfdba7fe8a7b845123c9e
/dingtalk/java/src/main/java/com/aliyun/dingtalkworkflow_1_0/models/InstallAppResponseBody.java
b65cf090e4308e5c17370a3986187367cd4e4ada
[ "Apache-2.0" ]
permissive
aliyun/dingtalk-sdk
f2362b6963c4dbacd82a83eeebc223c21f143beb
586874df48466d968adf0441b3086a2841892935
refs/heads/master
2023-08-31T08:21:14.042410
2023-08-30T08:18:22
2023-08-30T08:18:22
290,671,707
22
9
null
2021-08-12T09:55:44
2020-08-27T04:05:39
PHP
UTF-8
Java
false
false
1,946
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.dingtalkworkflow_1_0.models; import com.aliyun.tea.*; public class InstallAppResponseBody extends TeaModel { @NameInMap("result") public java.util.List<InstallAppResponseBodyResult> result; public static InstallAppResponseBody build(java.util.Map<String, ?> map) throws Exception { InstallAppResponseBody self = new InstallAppResponseBody(); return TeaModel.build(map, self); } public InstallAppResponseBody setResult(java.util.List<InstallAppResponseBodyResult> result) { this.result = result; return this; } public java.util.List<InstallAppResponseBodyResult> getResult() { return this.result; } public static class InstallAppResponseBodyResult extends TeaModel { @NameInMap("bizType") public String bizType; @NameInMap("name") public String name; @NameInMap("processCode") public String processCode; public static InstallAppResponseBodyResult build(java.util.Map<String, ?> map) throws Exception { InstallAppResponseBodyResult self = new InstallAppResponseBodyResult(); return TeaModel.build(map, self); } public InstallAppResponseBodyResult setBizType(String bizType) { this.bizType = bizType; return this; } public String getBizType() { return this.bizType; } public InstallAppResponseBodyResult setName(String name) { this.name = name; return this; } public String getName() { return this.name; } public InstallAppResponseBodyResult setProcessCode(String processCode) { this.processCode = processCode; return this; } public String getProcessCode() { return this.processCode; } } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
d4c36599dc65c8c056aeab19874babdae144af6d
848271617c9f0b677e3e517a3642cf18b72e55ed
/app/src/main/java/com/cpigeon/cpigeonhelper/modular/usercenter/model/bean/UserLoginEntity.java
d7d52ace7c9364cb8107a55786c448f4cb7cc322
[]
no_license
xiaohl-902/CHelperAndroid
77e9c406e8b385bfadb1454395d215d5b7392e25
9a9c4262424d1b8bcb552720bbe8d48f1fa451df
refs/heads/master
2020-04-06T13:08:34.183892
2019-01-25T08:31:18
2019-01-25T08:31:18
157,485,914
1
1
null
null
null
null
UTF-8
Java
false
false
873
java
package com.cpigeon.cpigeonhelper.modular.usercenter.model.bean; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; /** * Created by Administrator on 2018/3/5. */ public class UserLoginEntity extends RealmObject { @PrimaryKey private int id; private String userName; //用户名 private String userPasword;//用户密码 public UserLoginEntity(){ } public UserLoginEntity(String userName, String userPasword) { this.userName = userName; this.userPasword = userPasword; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPasword() { return userPasword; } public void setUserPasword(String userPasword) { this.userPasword = userPasword; } }
[ "656452024@qq.com" ]
656452024@qq.com
f39325dcb81cd21ddf1c63bbe867785ac87e20fe
6f7ebc484c4c5c37c2e6072ffb12678bb060d6cf
/app/src/main/java/th/co/thiensurat/ecatalog/api/result/AllItemResult.java
8479151e3c2cb990159e55584fc72595ec542a3b
[]
no_license
tsrmobile/ECatalog
8e6a4173709ed3c924d630cbf73352b66d74f9ba
f2a17a2f86c8b57b36e5496aae1dae1bba11c477
refs/heads/master
2021-09-12T15:26:26.630477
2018-04-18T01:48:41
2018-04-18T01:48:45
111,789,373
0
0
null
null
null
null
UTF-8
Java
false
false
2,278
java
package th.co.thiensurat.ecatalog.api.result; import java.util.Date; /** * Created by teerayut.k on 11/8/2017. */ public class AllItemResult { private String orderid; private String productname; private String title; private String firstname; private String lastname; private String province; private String orderstatus; private String statusdetail; private String checkdate; private String canceldate; private String closedate; public AllItemResult() { } public String getOrderid() { return orderid; } public void setOrderid(String orderid) { this.orderid = orderid; } public String getProductname() { return productname; } public void setProductname(String productname) { this.productname = productname; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getOrderstatus() { return orderstatus; } public void setOrderstatus(String orderstatus) { this.orderstatus = orderstatus; } public String getStatusdetail() { return statusdetail; } public void setStatusdetail(String statusdetail) { this.statusdetail = statusdetail; } public String getCheckdate() { return checkdate; } public void setCheckdate(String checkdate) { this.checkdate = checkdate; } public String getCanceldate() { return canceldate; } public void setCanceldate(String canceldate) { this.canceldate = canceldate; } public String getClosedate() { return closedate; } public void setClosedate(String closedate) { this.closedate = closedate; } }
[ "teerayut.k@thiensurat.co.th" ]
teerayut.k@thiensurat.co.th
a34c1a0cbcee8ae68c3b8f4c32a1661eafec3768
2dce1d353d064b9f4c6765a4b6460c38b8d20264
/src/fractalzoomer/core/iteration_algorithm/FractalIterationAlgorithm.java
7556b5fa41a8d83c24a175bee5fe201d4deb7e51
[]
no_license
hrkalona/Fractal-Zoomer
1fa30c531c46e4b25f8bfb33f70888f3b366771c
bcc3e1298b13e84b0730c67ffd6332e4e6575353
refs/heads/master
2023-08-30T08:54:46.594168
2023-08-15T11:41:26
2023-08-15T11:41:26
2,676,588
17
3
null
2023-08-15T11:41:27
2011-10-30T19:18:07
Java
UTF-8
Java
false
false
1,809
java
/* * Fractal Zoomer, Copyright (C) 2020 hrkalona2 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package fractalzoomer.core.iteration_algorithm; import fractalzoomer.core.Complex; import fractalzoomer.core.GenericComplex; import fractalzoomer.functions.Fractal; /** * * @author hrkalona2 */ public class FractalIterationAlgorithm extends IterationAlgorithm { public FractalIterationAlgorithm(Fractal fractal) { super(fractal); } @Override public double calculate(GenericComplex number) { return fractal.calculateFractal(number); } @Override public Complex calculateDomain(GenericComplex number) { return fractal.calculateFractalDomain((Complex)number); } @Override public void calculateOrbit() { fractal.calculateFractalOrbit(); } @Override public double[] calculate3D(GenericComplex number) { double value = fractal.calculateFractal(number); return new double[] {fractal.getFractal3DHeight(value), value}; } @Override public boolean isJulia() { return false; } }
[ "hrkalona@gmail.com" ]
hrkalona@gmail.com
917e0735d360f3f037c115aea20321e8621519c5
f3aec68bc48dc52e76f276fd3b47c3260c01b2a4
/core/referencebook/src/main/java/ru/korus/tmis/pix/DataTypeUncertainNarrativeConceptDescriptor.java
06a9be9b78f43daf049a5d4fc0e84f45abb71c99
[]
no_license
MarsStirner/core
c9a383799a92e485e2395d81a0bc95d51ada5fa5
6fbf37af989aa48fabb9c4c2566195aafd2b16ab
refs/heads/master
2020-12-03T00:39:51.407573
2016-04-29T12:28:32
2016-04-29T12:28:32
96,041,573
0
1
null
null
null
null
UTF-8
Java
false
false
1,273
java
package ru.korus.tmis.pix; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DataTypeUncertainNarrativeConceptDescriptor. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="DataTypeUncertainNarrativeConceptDescriptor"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="UVN&lt;CD>"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "DataTypeUncertainNarrativeConceptDescriptor") @XmlEnum public enum DataTypeUncertainNarrativeConceptDescriptor { @XmlEnumValue("UVN<CD>") UVN_CD("UVN<CD>"); private final String value; DataTypeUncertainNarrativeConceptDescriptor(String v) { value = v; } public String value() { return value; } public static DataTypeUncertainNarrativeConceptDescriptor fromValue(String v) { for (DataTypeUncertainNarrativeConceptDescriptor c: DataTypeUncertainNarrativeConceptDescriptor.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "szgrebelny@korusconsulting.ru" ]
szgrebelny@korusconsulting.ru
6a726da4f9b63322cb1df8351dd65270d184732b
50e2ac120eaf4a75b586616ebc8314cdef34e663
/src/test/java/com/j256/testcheckpublisher/lambda/CommonsLogTest.java
5b27c0cc2b29b8e41e17d2f3caf8c511302042e5
[ "ISC" ]
permissive
j256/test-check-publisher-lambda
5835f0bec5e7538ecb330fc1b0eead13259b963f
92c540caaa5dad86759776dd00e2b769190e5878
refs/heads/master
2023-03-06T23:13:03.041149
2021-02-20T21:46:22
2021-02-20T21:46:22
330,529,866
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package com.j256.testcheckpublisher.lambda; import org.junit.Test; public class CommonsLogTest { @Test public void testStuff() { CommonsLog log = new CommonsLog("name"); log.setLevel(0); log.trace("trace"); log.trace("trace", new Exception()); log.debug("debug"); log.debug("debug", new Exception()); log.info("info"); log.info("info", new Exception()); log.warn("warn"); log.warn("warn", new Exception()); log.error("error"); log.error("error", new Exception()); log.fatal("fatal"); log.fatal("fatal", new Exception()); } }
[ "gray.github@mailnull.com" ]
gray.github@mailnull.com
fcdcaf852e7dd89dd5076489a8572e631d95591f
a2440dbe95b034784aa940ddc0ee0faae7869e76
/modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWCharModsCallback.java
423f7897e17fff9b11a83ec747a0b4bb8ea73d97
[ "LGPL-2.0-or-later", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "Zlib" ]
permissive
LWJGL/lwjgl3
8972338303520c5880d4a705ddeef60472a3d8e5
67b64ad33bdeece7c09b0f533effffb278c3ecf7
refs/heads/master
2023-08-26T16:21:38.090410
2023-08-26T16:05:52
2023-08-26T16:05:52
7,296,244
4,835
1,004
BSD-3-Clause
2023-09-10T12:03:24
2012-12-23T15:40:04
Java
UTF-8
Java
false
false
2,699
java
/* * Copyright LWJGL. All rights reserved. * License terms: https://www.lwjgl.org/license * MACHINE GENERATED FILE, DO NOT EDIT */ package org.lwjgl.glfw; import javax.annotation.*; import org.lwjgl.system.*; import static org.lwjgl.system.MemoryUtil.*; import static org.lwjgl.glfw.GLFW.*; /** * Instances of this class may be passed to the {@link GLFW#glfwSetCharModsCallback SetCharModsCallback} method. * * <p>Deprecared: scheduled for removal in version 4.0.</p> * * <h3>Type</h3> * * <pre><code> * void (*{@link #invoke}) ( * GLFWwindow *window, * unsigned int codepoint, * int mods * )</code></pre> * * @since version 3.1 */ public abstract class GLFWCharModsCallback extends Callback implements GLFWCharModsCallbackI { /** * Creates a {@code GLFWCharModsCallback} instance from the specified function pointer. * * @return the new {@code GLFWCharModsCallback} */ public static GLFWCharModsCallback create(long functionPointer) { GLFWCharModsCallbackI instance = Callback.get(functionPointer); return instance instanceof GLFWCharModsCallback ? (GLFWCharModsCallback)instance : new Container(functionPointer, instance); } /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ @Nullable public static GLFWCharModsCallback createSafe(long functionPointer) { return functionPointer == NULL ? null : create(functionPointer); } /** Creates a {@code GLFWCharModsCallback} instance that delegates to the specified {@code GLFWCharModsCallbackI} instance. */ public static GLFWCharModsCallback create(GLFWCharModsCallbackI instance) { return instance instanceof GLFWCharModsCallback ? (GLFWCharModsCallback)instance : new Container(instance.address(), instance); } protected GLFWCharModsCallback() { super(CIF); } GLFWCharModsCallback(long functionPointer) { super(functionPointer); } /** See {@link GLFW#glfwSetCharModsCallback SetCharModsCallback}. */ public GLFWCharModsCallback set(long window) { glfwSetCharModsCallback(window, this); return this; } private static final class Container extends GLFWCharModsCallback { private final GLFWCharModsCallbackI delegate; Container(long functionPointer, GLFWCharModsCallbackI delegate) { super(functionPointer); this.delegate = delegate; } @Override public void invoke(long window, int codepoint, int mods) { delegate.invoke(window, codepoint, mods); } } }
[ "iotsakp@gmail.com" ]
iotsakp@gmail.com
acfefcd2b2ed13c392dcbbbed846352b4fb32bd3
cded08c92cd17d66eaf5c412eaa4ce0f11f4c54a
/inference-framework/checker-framework/checkers/jdk/reimN/src/java/lang/Readable.java
77ffb6ffdd05de9970882e051d2eea4fc1599bfd
[ "Apache-2.0" ]
permissive
ANter-xidian/type-inference
77aa54f5fa93abc8dfcdbc93be4654cfebaa5ad9
90d002a1e2d0a3d160ab204084da9d5be5fdd971
refs/heads/master
2020-09-27T14:53:33.530140
2019-01-22T21:26:11
2019-01-22T21:26:11
226,540,844
1
0
NOASSERTION
2019-12-07T16:12:36
2019-12-07T16:12:35
null
UTF-8
Java
false
false
186
java
package java.lang; import checkers.inference2.reimN.quals.*; import java.io.IOException; public interface Readable { public int read(java.nio.CharBuffer cb) throws IOException; }
[ "dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37" ]
dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37
9f3b7cb86d6e180b6832ed68a0659a46b9158b50
eae6300133e52d3d2db4142427fb58cd1a9eb089
/jOOQ/src/main/java/org/jooq/MergeNotMatchedValuesStep4.java
e76d75fd0a0993d10bac0bca249ce76ab16c7893
[ "Apache-2.0" ]
permissive
arashi01/jOOQ
1a420fc2fa14fb40b03381ec4004a90b8d0522fb
e210b1a7ee2b5eadc240d9fdf64e6a7ff7b6b7aa
refs/heads/main
2023-02-01T11:56:00.983906
2020-12-15T14:33:10
2020-12-15T14:33:10
321,770,901
0
0
NOASSERTION
2020-12-15T19:38:36
2020-12-15T19:38:35
null
UTF-8
Java
false
false
2,820
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Other licenses: * ----------------------------------------------------------------------------- * Commercial licenses for this work are available. These replace the above * ASL 2.0 and offer limited warranties, support, maintenance, and commercial * database integrations. * * For more information, please visit: http://www.jooq.org/licenses * * * * * * * * * * * * * * * * */ package org.jooq; import static org.jooq.SQLDialect.CUBRID; // ... import static org.jooq.SQLDialect.DERBY; import static org.jooq.SQLDialect.FIREBIRD; import static org.jooq.SQLDialect.H2; // ... import static org.jooq.SQLDialect.HSQLDB; // ... // ... // ... // ... // ... // ... import java.util.Collection; import org.jetbrains.annotations.NotNull; /** * This type is used for the {@link Merge}'s DSL API. * <p> * Example: <code><pre> * DSLContext create = DSL.using(configuration); * * create.mergeInto(table) * .using(select) * .on(condition) * .whenMatchedThenUpdate() * .set(field1, value1) * .set(field2, value2) * .whenNotMatchedThenInsert(field1, field2) * .values(value1, value2) * .execute(); * </pre></code> * * @author Lukas Eder */ public interface MergeNotMatchedValuesStep4<R extends Record, T1, T2, T3, T4> { /** * Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code> * statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB }) MergeNotMatchedWhereStep<R> values(T1 value1, T2 value2, T3 value3, T4 value4); /** * Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code> * statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB }) MergeNotMatchedWhereStep<R> values(Field<T1> value1, Field<T2> value2, Field<T3> value3, Field<T4> value4); /** * Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code> * statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB }) MergeNotMatchedWhereStep<R> values(Collection<?> values); }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
289b4f8e5fb0847f9231505e31a1e18afd7045cc
1c5e8605c1a4821bc2a759da670add762d0a94a2
/src/dahua/fdc/aimcost/prjdynamiccostbill/ProjectDynamicCostEntryFactory.java
5dfd1189cf7a665c9f332bf41efc26a5541ef0dc
[]
no_license
shxr/NJG
8195cfebfbda1e000c30081399c5fbafc61bb7be
1b60a4a7458da48991de4c2d04407c26ccf2f277
refs/heads/master
2020-12-24T06:51:18.392426
2016-04-25T03:09:27
2016-04-25T03:09:27
19,804,797
0
3
null
null
null
null
UTF-8
Java
false
false
1,802
java
package com.kingdee.eas.fdc.aimcost.prjdynamiccostbill; import com.kingdee.bos.BOSException; import com.kingdee.bos.BOSObjectFactory; import com.kingdee.bos.util.BOSObjectType; import com.kingdee.bos.Context; public class ProjectDynamicCostEntryFactory { private ProjectDynamicCostEntryFactory() { } public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getRemoteInstance() throws BOSException { return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createRemoteBOSObject(new BOSObjectType("BF1D2179") ,com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry.class); } public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getRemoteInstanceWithObjectContext(Context objectCtx) throws BOSException { return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createRemoteBOSObjectWithObjectContext(new BOSObjectType("BF1D2179") ,com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry.class, objectCtx); } public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getLocalInstance(Context ctx) throws BOSException { return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createBOSObject(ctx, new BOSObjectType("BF1D2179")); } public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getLocalInstance(String sessionID) throws BOSException { return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createBOSObject(sessionID, new BOSObjectType("BF1D2179")); } }
[ "shxr_code@126.com" ]
shxr_code@126.com
1d8330282cc72e6e1e8cd0da9c4db0f951904591
a41544231c57edb8170956e75476ce198bef6dd3
/src/core/at/tuwien/ifs/somtoolbox/apps/viewer/controls/VisualizationControl.java
e54c445b52f1c56f271efda6fccb523dd54bf9a1
[]
no_license
TaylorPeer/somtooolbox-dendrograms
c7d915b2ec509c3c55e0704bd80671b4ba52e3eb
36094e8ab20e3bffe2df333d055f59f7384fed4b
refs/heads/master
2021-01-01T05:50:45.307287
2015-02-08T20:41:16
2015-02-08T20:41:16
30,176,715
0
1
null
null
null
null
UTF-8
Java
false
false
3,299
java
/* * Copyright 2004-2010 Information & Software Engineering Group (188/1) * Institute of Software Technology and Interactive Systems * Vienna University of Technology, Austria * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.ifs.tuwien.ac.at/dm/somtoolbox/license.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package at.tuwien.ifs.somtoolbox.apps.viewer.controls; import java.awt.Dimension; import java.awt.GridLayout; import javax.swing.JLabel; import at.tuwien.ifs.somtoolbox.apps.viewer.CommonSOMViewerStateData; import at.tuwien.ifs.somtoolbox.apps.viewer.SOMPane; import at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer.VisualizationControlPanel; import at.tuwien.ifs.somtoolbox.visualization.VisualizationUpdateListener; /** * @author Rudolf Mayer * @version $Id: VisualizationControl.java 3873 2010-10-28 09:29:58Z frank $ */ public class VisualizationControl extends AbstractViewerControl implements VisualizationUpdateListener { private static final long serialVersionUID = 1L; private SOMPane mapPane; private final String initialTitle; private final JLabel noVisLabel = new JLabel("No visualisation loaded"); public VisualizationControl(String title, CommonSOMViewerStateData state, SOMPane mapPane) { super(title, state, new GridLayout(1, 1)); initialTitle = title; this.mapPane = mapPane; // setContentBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5)); updateVisualisationControl(); setVisible(true); } @Override public void updateVisualization() { mapPane.updateVisualization(); mapPane.repaint(); if (getPanel() != null) { getPanel().revalidate(); getPanel().repaint(); } } @Override public Dimension getMinimumSize() { return getPreferredSize(); } public void updateVisualisationControl() { if (getContentPane().getComponentCount() > 0) { getContentPane().removeAll(); } VisualizationControlPanel panel = getPanel(); if (panel != null) { getContentPane().add(panel); mapPane.getCurrentVisualization().setVisualizationUpdateListener(this); panel.updateSwitchControls(); setTitle(panel.getName()); } else { getContentPane().add(noVisLabel); // setCollapsed(true); setTitle(initialTitle); } revalidate(); // getContentPane().repaint(); // updateVisualization(); } private VisualizationControlPanel getPanel() { if (mapPane != null && mapPane.getCurrentVisualization() != null) { return mapPane.getCurrentVisualization().getControlPanel(); } else { return null; } } }
[ "t.peer@cortical.io" ]
t.peer@cortical.io
1bc1c9ef16d113d413a766924654542c890b4b7d
f2d85e3f5d6dcac0a7b18cbfef6d6b7c62ab570a
/i2am-app/dynamic-tagcloud/dynamic-tagcloud-storm/src/main/java/i2am/team1/WordCountBinder.java
ea792aff960adf934da9629238734b64906290e5
[ "Apache-2.0" ]
permissive
dke-knu/i2am
82bb3cf07845819960f1537a18155541a1eb79eb
0548696b08ef0104b0c4e6dec79c25300639df04
refs/heads/master
2023-07-20T01:30:07.029252
2023-07-07T02:00:59
2023-07-07T02:00:59
71,136,202
8
14
Apache-2.0
2023-07-07T02:00:31
2016-10-17T12:29:48
Java
UTF-8
Java
false
false
656
java
package i2am.team1; import java.util.ArrayList; import java.util.List; import org.apache.storm.trident.operation.ReducerAggregator; import org.apache.storm.trident.tuple.TridentTuple; public class WordCountBinder implements ReducerAggregator<List<WordCountElement>>{ @Override public List<WordCountElement> init() { // TODO Auto-generated method stub return new ArrayList<WordCountElement>(); } @Override public List<WordCountElement> reduce(List<WordCountElement> curr, TridentTuple tuple) { // TODO Auto-generated method stub curr.add(new WordCountElement(tuple.getString(0), tuple.getLong(1), tuple.getString(2))); return curr; } }
[ "wnghd9999@naver.com" ]
wnghd9999@naver.com
2753f1772d13cbfcad68a9019fe50d4a3b35eb19
497e1b81a0b549c8102f28d44e6f5eeb2aefba2c
/operapi-spirng-boot-starter/src/main/java/com/application/boot/operapi/core/api/hive/HiveConfigProperties.java
ca876d1a22d1e2012624c71883c1a3033643378b
[]
no_license
luckysoftgo/base-spring-boot-starter
16c2476af824b662bd2ae204fcfd2af536385994
39f33f55c3355334feadae14d8e969d4b8103b32
refs/heads/master
2023-06-08T07:37:52.331939
2020-03-16T08:03:36
2020-03-16T08:03:36
225,787,849
0
0
null
2023-05-26T22:16:02
2019-12-04T05:37:59
Java
UTF-8
Java
false
false
1,364
java
package com.application.boot.operapi.core.api.hive; import com.application.boot.operapi.common.GenericPool; import org.springframework.boot.context.properties.ConfigurationProperties; /** * @author : 孤狼 * @NAME: HiveConfigProperties * @DESC: HbaseConfigProperties类设计 **/ @ConfigurationProperties(prefix = "hive") public class HiveConfigProperties { /** * 连接池对象 */ private GenericPool pool =new GenericPool(); /** * 请求的用户名. */ private String userName; /** * 请求的密码. */ private String userPass; /** * driver名称. */ private String hiveDriver="org.apache.hive.jdbc.HiveDriver"; /** * hive的连接地址. */ private String hiveUrl; public GenericPool getPool() { return pool; } public void setPool(GenericPool pool) { this.pool = pool; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPass() { return userPass; } public void setUserPass(String userPass) { this.userPass = userPass; } public String getHiveDriver() { return hiveDriver; } public void setHiveDriver(String hiveDriver) { this.hiveDriver = hiveDriver; } public String getHiveUrl() { return hiveUrl; } public void setHiveUrl(String hiveUrl) { this.hiveUrl = hiveUrl; } }
[ "supingemail@126.com" ]
supingemail@126.com
758a47654a4f3a0972488204064738c5525f7058
b312ba97eec1f108ef8584c5e88ee6bc4675d57f
/代码/ReviewUDP/src/Host2.java
fb6d38b5753ef9bb4f2fa0500e36ff262788aae9
[]
no_license
Beteasy/JAVA-GRADE2SEMESTER2-
5fb873ae311650840aba2e8ef67e8d373fba3697
38cdaf6a53c9b866dbc8bd04113fe5624b00bd20
refs/heads/master
2020-06-20T16:46:21.181792
2019-07-16T11:43:49
2019-07-16T11:43:49
197,182,089
0
0
null
null
null
null
UTF-8
Java
false
false
2,020
java
import java.io.*; import java.net.*; import java.util.*; public class Host2 { public static void main(String[] args) { // TODO Auto-generated method stub byte[] dataOut = null; DatagramPacket dataPackSend = null; DatagramSocket mailOut = null; Scanner scanner = new Scanner(System.in); String IP = new String("127.0.0.1"); int sendPort = 6666; Host2Class hostClass = new Host2Class(); Thread thread =new Thread(hostClass); thread.start(); System.out.println("*************running**********"); while(true) { dataOut = scanner.nextLine().getBytes(); try { dataPackSend = new DatagramPacket(dataOut,dataOut.length,InetAddress.getByName(IP),6666); mailOut = new DatagramSocket(); mailOut.send(dataPackSend); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } class Host2Class implements Runnable{ byte[] dataOut = null; byte[] dataIn = null; DatagramPacket dataPackSend = null; DatagramPacket dataPackReceive = null; DatagramSocket mailOut = null; DatagramSocket mailReceive = null; Scanner scanner = new Scanner(System.in); String IP = new String("127.0.0.1"); int receivePort = 2333; @Override public void run() { // TODO Auto-generated method stub dataIn = new byte[8192]; String str= ""; try { dataPackReceive = new DatagramPacket(dataIn,dataIn.length); mailReceive = new DatagramSocket(receivePort); } catch (SocketException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } while(true) { try { if(mailReceive == null) { System.out.println("mailReceive failed"); mailReceive = new DatagramSocket(2333); break; } else { mailReceive.receive(dataPackReceive); //how to get the data str = new String(dataPackReceive.getData(),0,dataPackReceive.getLength()); System.out.println(str); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
[ "1402308343@qq.com" ]
1402308343@qq.com
2e5db21421a485f65a93f680135fa6413ed1174c
49fe3d43ab90b4e241795f4c3f43bb53f4cb0e32
/src/com/company/Lesson40/Test02.java
27858a535e6e678ce26b2676de444692e7aec62f
[]
no_license
aierko/dev
a0e8a6b8ceaa61f6842cf02a4443fcc9ea6a3cf7
ea52685dd0a70e4bd578369cf417f6c6a2f7a5c9
refs/heads/master
2021-09-03T10:08:45.436562
2017-10-20T12:53:43
2017-10-20T12:53:43
106,323,994
0
0
null
null
null
null
UTF-8
Java
false
false
1,827
java
package com.company.Lesson40; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; /** * Created by user on 21.12.2016. *//* Новая задача: Программа вводит строки, пока пользователь не введёт пустую строку (нажав enter). Потом программа строит новый список. Если в строке чётное число букв, строка удваивается, если нечётное – утраивается. Программа выводит содержимое нового списка на экран. Пример ввода: Кот Коты Я Пример вывода: Кот Кот Кот Коты Коты Я Я Я */ public class Test02 { public static void main(String[] args) throws IOException { List<String> list = stroki(); System.out.println(fix(list)); } public static List<String> stroki() throws IOException { List<String> arr3 = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); while (true) { String a = reader.readLine(); if (a.isEmpty()) break; else arr3.add(a); } return arr3; } public static List<String> fix(List<String> list) { List<String> arr1 = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { if (list.get(i).length() % 2 == 0) { arr1.add(list.get(i)); arr1.add(list.get(i)); } else { arr1.add(list.get(i)); arr1.add(list.get(i)); arr1.add(list.get(i)); } } return arr1; } }
[ "vtldtl80" ]
vtldtl80
365696b25f83e9fd7f265cf7e11e5ca1f5ba008a
217d96db536ff284fc1b168bf640104f00ba1ad5
/rifidi/tags/org.rifidi.jmeswt/1.0.0/src/org/rifidi/utilities/swt/FileBrowser.java
e799d0737af6b9b1b07e164daad55b2181ee61f0
[]
no_license
TranscendsLLC/emulator
d5b94965b8ebd894707c093334c51aabf30d0075
a46c42cd2e86aafc213df7585dc923895a589446
refs/heads/master
2021-01-14T12:31:10.876450
2010-10-01T21:28:07
2010-10-01T21:28:07
43,608,652
1
1
null
null
null
null
UTF-8
Java
false
false
1,987
java
/** * */ package org.rifidi.utilities.swt; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; /** * @author dan */ public class FileBrowser { private int browserStyle; private Text fileEntry; public FileBrowser( String labeltext, String dialogText, Composite parent, int browserStyle ) { createWidget(labeltext,dialogText,parent); this.browserStyle = browserStyle; } private void createWidget( String labeltext, final String dialogText, Composite parent ) { Composite comp = new Composite(parent,SWT.NONE); GridLayout gl = new GridLayout(); gl.numColumns = 3; comp.setLayout( gl ); comp.setLayoutData( new GridData(SWT.FILL,SWT.CENTER,true,true)); // create label Label label = new Label(comp,SWT.NONE); label.setText(labeltext); // create text entry box fileEntry = new Text(comp,SWT.BORDER); fileEntry.setLayoutData( new GridData(SWT.FILL,SWT.CENTER,true,false) ); // create browse button Button browseButton = new Button(comp,SWT.NONE); browseButton.setText("Browse..."); browseButton.addSelectionListener( new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(SelectionEvent e) { FileDialog fd = new FileDialog(new Shell(),browserStyle); fd.setText(dialogText); String result = fd.open(); if ( result != null ) { fileEntry.setText(result); } } }); } public String getFile() { return fileEntry.getText(); } public Text getTextbox() { return fileEntry; } }
[ "jochen@70ba6d20-ffbb-44b8-b480-e27427137dba" ]
jochen@70ba6d20-ffbb-44b8-b480-e27427137dba
0d91e5bfccfe36a8b3843fb4f7364ee2a8058215
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes11.dex_source_from_JADX/com/facebook/composer/location/controller/ImplicitLocationPillControllerProvider.java
6f06d6c986ab8710767c97351f0afb21504542b7
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
258
java
package com.facebook.composer.location.controller; import com.facebook.inject.AbstractAssistedProvider; /* compiled from: from_step */ public class ImplicitLocationPillControllerProvider extends AbstractAssistedProvider<ImplicitLocationPillController> { }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
401e0d0a08416a7db59e6385667e5c287d3eaab0
f3fa656dec6b0eb19a284d7feb73afc9f3a38f28
/Chp. 02 - Linked Lists/_2_5_Sum_Lists/Pair.java
d9cb50c3037683d18bbf157c9131f428ddb82462
[]
no_license
venukolla/Cracking-the-Coding-Interview_solutions
c70dd69d5436bad6b4dddf6ef1839f893de55263
722e19cf0d857c3abe083cc1d7d5277d3ce73474
refs/heads/master
2020-06-01T20:41:43.304708
2019-06-04T05:45:59
2019-06-04T05:45:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package _2_5_Sum_Lists; import common.Node; class Pair { Node node; int carry; Pair(Node node, int carry) { this.node = node; this.carry = carry; } }
[ "9rodney@gmail.com" ]
9rodney@gmail.com
dbf92b05d22eb00e4f81ae107118dbbff377d2ef
58a961999c259d7fc9e0b8c17a0990f4247f29bf
/CDM/pract3/P1/sources/com/google/android/gms/internal/zzld.java
8fd436fef6e5aed5615d0159f48c6871064002da
[]
no_license
Lulocu/4B-ETSINF
c50b4ca70ad14b9ec9af6a199c82fad333f7bc8c
65d492d0fbeb630c7bbe25d92dfbfd9e5f41bcd8
refs/heads/master
2023-06-05T23:41:02.297413
2021-06-20T10:53:30
2021-06-20T10:53:30
339,157,412
0
1
null
null
null
null
UTF-8
Java
false
false
681
java
package com.google.android.gms.internal; import android.os.SystemClock; public final class zzld implements zzlb { private static zzld zzacK; public static synchronized zzlb zzoQ() { zzld zzld; synchronized (zzld.class) { if (zzacK == null) { zzacK = new zzld(); } zzld = zzacK; } return zzld; } @Override // com.google.android.gms.internal.zzlb public long currentTimeMillis() { return System.currentTimeMillis(); } @Override // com.google.android.gms.internal.zzlb public long elapsedRealtime() { return SystemClock.elapsedRealtime(); } }
[ "lulocu99@gmail.com" ]
lulocu99@gmail.com
c3e32d8ad39a2660c771fb0ef18a2292fa6506c7
e45bdfe09f5abddcccbcbf44ca532729c6480123
/新版本eclipse/day05_dataSource_jdbcTemplate/src/druid/DruidDemo2.java
a0fa7de60d56a9a619f127436d01feee14934de1
[]
no_license
18222137497/Learning-path
71417330650c326637290cbbb9c77375a284b94f
12a415ffce3ba8528666792ad99b8c9e6f9d107f
refs/heads/master
2023-03-12T06:37:09.380592
2021-02-23T10:18:32
2021-02-23T10:18:32
303,752,409
0
0
null
null
null
null
GB18030
Java
false
false
874
java
package druid; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * Druid工具类的测试类 * @author 123 * */ public class DruidDemo2 { public static void main(String[] args) { Connection c = null; PreparedStatement s =null; ResultSet r=null; try { //1.注册驱动 new DruidUtils(); //2.定义sql String sql = "select * from account where id=?"; //3.获取连接池对象 c = DruidUtils.getConnection(); //4.获取执行sql对象 s = c.prepareStatement(sql); s.setInt(1, 1); //5.执行sql r = s.executeQuery(); while (r.next()) { System.out.print("id="+r.getInt(1)+"|name="+r.getString(2)+"|balance="+r.getInt(3)); } } catch (SQLException e) { e.printStackTrace(); }finally { DruidUtils.closs(c, s, r); } } }
[ "67040612+18222137497@users.noreply.github.com" ]
67040612+18222137497@users.noreply.github.com
a1f69e88d3b4ecff77dd47f24ab825f0b21dc0f0
15f0514701a78e12750f68ba09d68095172493ee
/Java/114.java
264ed0c5cd26d81b52d80da80bbcfdf21b229856
[ "MIT" ]
permissive
strengthen/LeetCode
5e38c8c9d3e8f27109b9124ae17ef8a4139a1518
3ffa6dcbeb787a6128641402081a4ff70093bb61
refs/heads/master
2022-12-04T21:35:17.872212
2022-11-30T06:23:24
2022-11-30T06:23:24
155,958,163
936
365
MIT
2021-11-15T04:02:45
2018-11-03T06:47:38
null
UTF-8
Java
false
false
2,037
java
__________________________________________________________________________________________________ sample 0 ms submission /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { TreeNode prev; public void flatten(TreeNode root) { //base case if(root == null){ return; } prev = null; //run it in recursion pre-order flattenTree(root); } //Function to flatten tree with pre-order traversal public void flattenTree(TreeNode current){ if(current == null){ return; } //start addiing current to the right of the prev if(prev != null){ prev.right = current; prev.left = null; } prev = current; //get all nodes form left --> right and add to the prev TreeNode right = current.right; flattenTree(current.left); flattenTree(right); } } __________________________________________________________________________________________________ sample 34252 kb submission /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ // 04/03/2019 // Runtime: 0 ms, beat 100% class Solution { public void flatten(TreeNode root) { if (root == null) { return; } flattenHelper(root, new TreeNode[] {null}); } private void flattenHelper(TreeNode root, TreeNode[] prev) { if (root == null) { return; } flattenHelper(root.right, prev); flattenHelper(root.left, prev); root.right = prev[0]; root.left = null; prev[0] = root; } } __________________________________________________________________________________________________
[ "strengthen@users.noreply.github.com" ]
strengthen@users.noreply.github.com
cd751d1da889f9d9665668c4ac02a7eb6429c2f7
95a1d31c0eb7da21a9b3c9ef12619833d4ab2175
/wlhytestapp/src/main/java/com/quark/wanlihuanyunuser/AppYidaoActivity.java
42e9eae422c567b9f0922fe2d3ad84827a82eccc
[]
no_license
leonck/testtest
aba45553559716e8ad8342215a56783dcec334fa
c06885d28d60473c4c5dbee581de4252024cd305
refs/heads/master
2020-12-02T23:52:57.236224
2017-07-03T10:30:29
2017-07-03T10:30:29
95,955,840
0
0
null
null
null
null
UTF-8
Java
false
false
7,279
java
//package com.quark.kuaishi; // // //import android.app.Activity; //import android.content.Intent; //import android.content.SharedPreferences; //import android.content.SharedPreferences.Editor; //import android.os.Bundle; //import android.support.v4.view.PagerAdapter; //import android.support.v4.view.ViewPager; //import android.support.v4.view.ViewPager.OnPageChangeListener; //import android.util.Log; //import android.view.LayoutInflater; //import android.view.View; //import android.widget.ImageView; //import android.widget.TextView; // //import com.quark.kuaishi.ui.userinfo.LoginActivity; //import com.umeng.analytics.MobclickAgent; // //import java.util.ArrayList; // // //public class AppYidaoActivity extends Activity{ // private int pos = 0; // private int maxPos = 0; // private int currentPageScrollStatus; // // int height; // ////////// // private ArrayList<View> listViews = null; // private ViewPager pager; // private MyPageAdapter adapter; // ImageView rightrig; // TextView shop_text; // TextView order_text; // TextView terminal_number_text; // TextView id_text; // TextView goods_name; // TextView number; // int[] ids; // // TextView go; // @Override // public void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setContentView(R.layout.start_yindao); //// System.out.println(ApplicationControl.isFirstIn+"============s=========================="); // SharedPreferences sp1 = getSharedPreferences(AppParam.SHAREDPREFERENCESKEY, MODE_PRIVATE); // //判断是不是首次登录, // if(sp1.getBoolean("firststart", true)) { // Editor editjb = sp1.edit(); // //将登录标志位设置为false,下次登录时不在显示首次登录界面 // editjb.putBoolean("firststart", false); // editjb.commit(); // maxPos = 4; // ids = new int[4]; // ids[0] = R.drawable.yd_1; // ids[1] = R.drawable.yd_2; // ids[2] = R.drawable.yd_3; // ids[3] = R.drawable.yd_4; // init(); // go = (TextView)findViewById(R.id.go); // go.setOnClickListener(new View.OnClickListener() { // @Override // public void onClick(View v) { // Intent intent = new Intent(); // intent.setClass(AppYidaoActivity.this, LoginActivity.class); // startActivity(intent); // finish(); // } // }); // }else{ // Intent intent = new Intent(); // intent.setClass(AppYidaoActivity.this, AppStart.class); // startActivity(intent); // finish(); // } // } // // public void init(){ // pager = (ViewPager) findViewById(R.id.viewpager); // 找到ViewPager // pager.setOnPageChangeListener(pageChangeListener); // 设置页面滑动监听 // // initListViews();// // // adapter = new MyPageAdapter(listViews);// 构造adapter // pager.setAdapter(adapter);// 设置适配器 // adapter.notifyDataSetChanged();// 刷新 // } // // private void initListViews() { // if (listViews == null) // listViews = new ArrayList<View>(); // for (int i = 0; i < 4; i++) { // View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.yidao_item, null); // ImageView ig = (ImageView)view.findViewById(R.id.pic); // ig.setImageDrawable(getResources().getDrawable(ids[i])); //// view.setBackgroundDrawable(getResources().getDrawable(ids[i])); // listViews.add(view); // } // } // // /** // * 页面监听事件 // */ // private OnPageChangeListener pageChangeListener = new OnPageChangeListener() { // // @Override // public void onPageSelected(int position) { // // 切换page设置当前position值 // pos = position; // } // // @Override // public void onPageScrolled(int position, float positionOffset, // int positionOffsetPixels) { // // if (pos == 0) { // // 如果offsetPixels是0页面也被滑动了,代表在第一页还要往左划 // if (positionOffsetPixels == 0 && currentPageScrollStatus == 1) { // Log.e("e", "===============在第一页还要往左划========"); // } // } else if (pos == (maxPos - 1)) { // // 已经在最后一页还想往右划 // if (positionOffsetPixels == 0 && currentPageScrollStatus == 1) { // Log.e("e", "=================最后一页还想往右划============"); //// if(ApplicationControl.isFirstIn){ //// ApplicationControl.isFirstIn = false; //// Log.e("e", "=================最后一页还想往右划111111111111111111============"); //// Intent intent = new Intent(); //// intent.setClass(AppYidaoActivity.this, MainTabActivity.class); //// startActivity(intent); //// finish(); //// } // } // } // } // boolean hl = false; // public void onPageScrollStateChanged(int arg0) {// 滑动状态改变 // // 有三种状态(0,1,2)。arg0 // // ==1的时辰默示正在滑动,arg0==2的时辰默示滑动完毕了 // System.out.println("滑动状态改变"); // // 记录page滑动状态,如果滑动了state就是1 // currentPageScrollStatus = arg0; // // // 只有一张的时候 //// if (maxPos == 1) { //// Log.e("e", "=================只有一张============"); //// ApplicationControl.isFirstIn = false; //// Intent intent = new Intent(); //// intent.setClass(AppYidaoActivity.this, MainTabActivity.class); //// startActivity(intent); //// finish(); //// } // } // }; // // // /** // * ViewPager适配器 // * // * @author zhou // * // */ // class MyPageAdapter extends PagerAdapter { // // private ArrayList<View> listViews;// content // // private int size;// 页数 // // public MyPageAdapter(ArrayList<View> listViews) {// 构造函数 // // 初始化viewpager的时候给的一个页面 // this.listViews = listViews; // size = listViews == null ? 0 : listViews.size(); // // } // // public void setListViews(ArrayList<View> listViews) {// 自己写的一个方法用来添加数据 // this.listViews = listViews; // size = listViews == null ? 0 : listViews.size(); // } // // @Override // public int getCount() {// 返回数量 // return size; // } // // @Override // public void destroyItem(View arg0, int arg1, Object arg2) {// 销毁view对象 // ((ViewPager) arg0).removeView(listViews.get(arg1 % size)); // } // // @Override // public void finishUpdate(View arg0) { // } // // @Override // public Object instantiateItem(View arg0, int arg1) {// 返回view对象 // try { // ((ViewPager) arg0).addView(listViews.get(arg1 % size), 0); // } catch (Exception e) { // Log.e("zhou", "exception:" + e.getMessage()); // } // return listViews.get(arg1 % size); // } // // @Override // public boolean isViewFromObject(View arg0, Object arg1) { // return arg0 == arg1; // } // // @Override // public int getItemPosition(Object object) { // return POSITION_NONE; // } // } // @Override // protected void onPause() { // JPushInterface.onPause(this); // MobclickAgent.onPause(this); // // super.onPause(); // } // @Override // protected void onResume() { // super.onResume(); // JPushInterface.onResume(this); // MobclickAgent.onResume(this); // // } // } // // // // // // // // // //
[ "271381658@qq.com" ]
271381658@qq.com