blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
b99e0273807f4f766711ad06b3be89a4af2aa0ab
e9b882673a68c24b96b7832162a367c2e68f478a
/src/Ant.java
3e9a71dc1e624f10cdb50afbb533d8d1bd54549b
[]
no_license
AleksanderSas/PO_Ants
246176dbdb4c9862e45aabff4e196173472418d3
46b0378c9fdb6f8465751544f104eedfb4bfeb74
refs/heads/master
2021-01-13T00:48:32.686679
2016-01-16T11:39:17
2016-01-16T11:39:17
48,754,649
0
0
null
null
null
null
UTF-8
Java
false
false
2,909
java
import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.List; import javafx.util.Pair; public class Ant implements Comparable<Ant>{ private List<Path> road = new ArrayList<Path>(); private List<GraphNode> visitedNodes = new ArrayList<>(); private List<Float> ppb = new ArrayList<>(); private GraphNode currentNode = null; private GraphNode startNode; public boolean complete = false; private int totalDistance; public Ant(GraphNode startNode) { this.startNode = startNode; reset(); } /* * PARAMETERS: * nodeNumber: number of node to walk through * pathSelector: method to select path, for example best or tossed * RETURN * true if found road successfully, otherwise false * for example there is no next path from the node */ public boolean walk(int nodeNumber,int epoche, IPathSelector pathSelector) throws InternalException { //start node is already added totalDistance = 0; while(nodeNumber > 1) { List<Path> paths = currentNode.getNodes(nodeNumber, visitedNodes); if(paths.size() == 0) return false; //Pair<Path, Float> pair = Path.randPath(paths,epoche); Pair<Path, Float> pair = pathSelector.selectPath(paths, epoche); Path nextPath = pair.getKey(); road.add(nextPath); visitedNodes.add(nextPath.getNodeFrom(currentNode)); currentNode = nextPath.getNodeFrom(currentNode); ppb.add(pair.getValue()); nodeNumber--; totalDistance += nextPath.getDistance(); } Path lastPath = currentNode.getPath2Node(startNode); if(lastPath == null) return false; totalDistance += lastPath.getDistance(); road.add(lastPath); ppb.add((float) -1.0); complete = true; return true; } public void spreadPheromone(float pheromoneSpreadFactor, int mean) { if(! complete) return; float pheromone = (float) Math.pow(pheromoneSpreadFactor / totalDistance, FactorCentre.pheromoneExpFactor); for(Path p : road) p.addPheromone(pheromone); } public void reset() { currentNode = startNode; visitedNodes.clear(); road.clear(); ppb.clear(); visitedNodes.add(startNode); complete = false; totalDistance = Integer.MAX_VALUE; } public int getDistance() { return totalDistance; } public String toString() { StringBuilder sb = new StringBuilder(); if(!complete) { return "ant terminated"; } int i = 0; for(GraphNode n : visitedNodes) { sb.append(n.getName()).append(" \tpher.: ").append(road.get(i).getPheromon()). append("\tacc.:").append(ppb.get(i)).append(" -> \n"); i++; } sb.append("total distance: ").append(totalDistance); return sb.toString(); } @Override public int compareTo(Ant a) { if(complete && !a.complete) return -1; if(!complete && a.complete) return 1; if(totalDistance < a.getDistance()) return -1; return (totalDistance == a.getDistance())? 0 : 1; } }
[ "aleksander.sas93@gmail.com" ]
aleksander.sas93@gmail.com
a5e0fdbf4c837ed3f91ab137859535fbc14dc556
1234762179f1e94196313b2985079aa7999757ae
/src/com/gotraveling/insthub/BeeFramework/activity/MainActivity.java
d688bcfe586bcf41c274974f622296e6025f1531
[]
no_license
chaoming0625/TraveFriend
8381950f7d1fb4cdc89d1e786b752a736a7ea6ea
10ef747fb2fa4b4c62363b64d719a1678b87ce09
refs/heads/master
2021-01-10T13:31:38.113388
2016-03-29T01:14:54
2016-03-29T01:14:54
52,664,772
5
7
null
null
null
null
UTF-8
Java
false
false
7,425
java
package com.gotraveling.insthub.BeeFramework.activity; /* * ______ ______ ______ * /\ __ \ /\ ___\ /\ ___\ * \ \ __< \ \ __\_ \ \ __\_ * \ \_____\ \ \_____\ \ \_____\ * \/_____/ \/_____/ \/_____/ * * * Copyright (c) 2013-2014, {Bee} open source community * http://www.bee-framework.com * * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.view.KeyEvent; import android.widget.Toast; import com.gotraveling.insthub.BeeFramework.BeeFrameworkApp; import com.gotraveling.insthub.BeeFramework.BeeFrameworkConst; import com.gotraveling.insthub.BeeFramework.Utils.CustomExceptionHandler; import com.gotraveling.insthub.BeeFramework.model.BeeQuery; import com.baidu.android.pushservice.PushConstants; import com.baidu.android.pushservice.PushManager; import com.insthub.ecmobile.R; import org.json.JSONException; import org.json.JSONObject; import java.io.File; public class MainActivity extends BaseActivity{ public static final String RESPONSE_METHOD = "method"; public static final String RESPONSE_CONTENT = "content"; public static final String RESPONSE_ERRCODE = "errcode"; protected static final String ACTION_LOGIN = "com.baidu.pushdemo.action.LOGIN"; public static final String ACTION_MESSAGE = "com.baiud.pushdemo.action.MESSAGE"; public static final String ACTION_RESPONSE = "bccsclient.action.RESPONSE"; public static final String ACTION_PUSHCLICK = "bccsclient.action.PUSHCLICK"; public static final String ACTION_SHOW_MESSAGE = "bccsclient.action.SHOW_MESSAGE"; protected static final String EXTRA_ACCESS_TOKEN = "access_token"; public static final String EXTRA_MESSAGE = "message"; public static final String CUSTOM_CONTENT ="CustomContent"; // 在百度开发者中心查询应用的API Key public static final String API_KEY = "qGCsDwjNoNRNkg1iuvKZiAkz"; private SharedPreferences shared; private SharedPreferences.Editor editor; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); shared = this.getSharedPreferences("userInfo", 0); editor = shared.edit(); String path = Environment.getExternalStorageDirectory().getAbsolutePath() + BeeFrameworkConst.LOG_DIR_PATH; File storePath = new File(path); storePath.mkdirs(); Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler( path, null)); } @Override protected void onStart() { super.onStart(); PushManager.startWork(getApplicationContext(), PushConstants.LOGIN_TYPE_API_KEY, API_KEY); } private boolean isExit = false; //退出操作 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK){ if(isExit==false){ isExit=true; Resources resource = (Resources) getBaseContext().getResources(); String exi=resource.getString(R.string.exit); Toast.makeText(getApplicationContext(), exi, Toast.LENGTH_SHORT).show(); handler.sendEmptyMessageDelayed(0, 3000); if(BeeQuery.environment() == BeeQuery.ENVIROMENT_DEVELOPMENT) { BeeFrameworkApp.getInstance().showBug(this); } return true; } else { finish(); return false; } } return true; } Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); isExit=false; } }; @Override protected void onNewIntent(Intent intent) { // 如果要统计Push引起的用户使用应用情况,请实现本方法,且加上这一个语句 setIntent(intent); handleIntent(intent); } /** * 处理Intent * * @param intent * intent */ private void handleIntent(Intent intent) { String action = intent.getAction(); if (ACTION_RESPONSE.equals(action)) { String method = intent.getStringExtra(RESPONSE_METHOD); if (PushConstants.METHOD_BIND.equals(method)) { int errorCode = intent.getIntExtra(RESPONSE_ERRCODE, 0); if (errorCode == 0) { String content = intent.getStringExtra(RESPONSE_CONTENT); String appid = ""; String channelid = ""; String userid = ""; try { JSONObject jsonContent = new JSONObject(content); JSONObject params = jsonContent .getJSONObject("response_params"); appid = params.getString("appid"); channelid = params.getString("channel_id"); userid = params.getString("user_id"); editor.putString("UUID",userid); editor.commit(); } catch (JSONException e) { } } else { } } } else if (ACTION_LOGIN.equals(action)) { String accessToken = intent.getStringExtra(EXTRA_ACCESS_TOKEN); PushManager.startWork(getApplicationContext(), PushConstants.LOGIN_TYPE_ACCESS_TOKEN, accessToken); } else if (ACTION_MESSAGE.equals(action)) { String message = intent.getStringExtra(EXTRA_MESSAGE); String summary = "Receive message from server:\n\t"; JSONObject contentJson = null; String contentStr = message; try { contentJson = new JSONObject(message); contentStr = contentJson.toString(4); } catch (JSONException e) { } summary += contentStr; } else if (ACTION_PUSHCLICK.equals(action)) { String message = intent.getStringExtra(CUSTOM_CONTENT); } } }
[ "chaoming1995@foxmail.com" ]
chaoming1995@foxmail.com
d06b8622d04ace0e5291733a5a4c431fe31815e3
c4d977f0a3f921c2a099f77161524cd60d76ff93
/src/test/java/endtoend/functions/jquery/traversing/FindFunctionTest.java
522fe59060b56cb60274af98c4f8b2227effa89e
[ "Apache-2.0" ]
permissive
jbravo/seleniumQuery
d2b49de6349309c52afe63274189d8886d346726
fc13646f50e4081bf70fb9706185264f27c15c69
refs/heads/master
2020-12-14T08:53:19.522660
2016-03-16T18:49:45
2016-03-16T18:49:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,742
java
/* Copyright (c) 2015 seleniumQuery 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 endtoend.functions.jquery.traversing; import org.junit.Rule; import org.junit.Test; import testinfrastructure.junitrule.SetUpAndTearDownDriver; import static io.github.seleniumquery.SeleniumQuery.$; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class FindFunctionTest { private static final int COMBO_OPTIONS_COUNT = 4; private static final int OTHER_OPTIONS_COUNT = 2; @Rule public SetUpAndTearDownDriver setUpAndTearDownDriverRule = new SetUpAndTearDownDriver(getClass()); @Test public void find_function() { assertThat($("option").size(), is(COMBO_OPTIONS_COUNT + OTHER_OPTIONS_COUNT)); assertThat($("#combo").find("option").size(), is(COMBO_OPTIONS_COUNT)); } @Test public void find_function__with_pseudoClasses() { assertThat($("#combo").find("option:contains(Howdy)").size(), is(1)); assertThat($("#combo").find("option:contains(Howdy)").get(0).getAttribute("id"), is("howdy-option")); } @Test public void find_function__with_empty_result() { assertThat($("#combo").find(".non-existant-class").size(), is(0)); } }
[ "acdcjunior@gmail.com" ]
acdcjunior@gmail.com
6b3cfca025d5341a878cdf9b83a690c1700d089f
08658c85d245baf43cf5834d56e4c8a71981f34d
/src/main/java/com/fileshare/file/io/Pipe.java
ba8c8fb6dcd6a0b0953c15724193a7c1eba79814
[]
no_license
daimos/RMI-fileShare
ca69a03f839ed6aaa9001dcbea920c1fe851bf59
db6cbf03375f425fdcb8b9efff808c73a6e6bdb6
refs/heads/master
2021-01-16T18:44:52.039559
2013-06-26T14:28:44
2013-06-26T14:28:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,032
java
package com.fileshare.file.io; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.Hashtable; /** * @author Jan Paw * Date: 6/10/13 */ public class Pipe implements Serializable { private final static int BUF_SIZE = 1024 * 64; private static int keySeed = 0; private static final Hashtable<Integer, java.io.OutputStream> registry = new Hashtable<>(); private final transient int key; private transient java.io.InputStream in; private final transient boolean isOutputRegistration; public Pipe(int key, java.io.InputStream in) { this.key = key; this.in = in; isOutputRegistration = false; } public Pipe(java.io.OutputStream out) { isOutputRegistration = true; synchronized (registry) { key = keySeed++; registry.put(key, out); } } public int getKey() { if (!isOutputRegistration) throw new IllegalArgumentException( "Not an OutputStream registration"); return key; } protected void finalize() { if (isOutputRegistration) registry.remove(key); } private void writeObject(ObjectOutputStream out) throws IOException { out.writeInt(key); byte[] b = new byte[BUF_SIZE]; int len; do { len = in.read(b); out.writeInt(len); if (len >= 0) out.write(b, 0, len); } while (len >= 0); } private void readObject(ObjectInputStream in) throws IOException { int key = in.readInt(); java.io.OutputStream out = registry.remove(key); byte[] b = new byte[BUF_SIZE]; int len; do { len = in.readInt(); if (len >= 0) { in.readFully(b, 0, len); out.write(b, 0, len); } } while (len >= 0); } }
[ "explicite@windowslive.com" ]
explicite@windowslive.com
e093b707e848ea2d6ed5460f7351463cb5da7bb9
b30973ecdc299e9346aacb191c5e18cacb4043fb
/src/fileProcessor/LoadingFileProfile.java
00e6742675225904b4a2e60a6c707a40c3ed515d
[]
no_license
BroEmilio/FileProcessor
0dba91089f494b1c139b53e37c084a654a90bf85
0016ee27104be690cf8065ce1c41b3bfa215f2bb
refs/heads/master
2020-12-20T18:28:09.822874
2020-01-28T19:35:41
2020-01-28T19:35:41
236,170,850
0
0
null
null
null
null
UTF-8
Java
false
false
1,030
java
package fileProcessor; import java.nio.file.Path; import javax.swing.JFileChooser; import javax.swing.filechooser.FileNameExtensionFilter; public class LoadingFileProfile { public LoadingFileProfile() { loadChooser = configureLoadChooser(loadFilter); } Path loadedFile; JFileChooser loadChooser; //set filter for files FileNameExtensionFilter loadFilter = new FileNameExtensionFilter("Pliki tekstowe", "txt"); JFileChooser configureLoadChooser(FileNameExtensionFilter filter) { String userDir = System.getProperty("user.home"); JFileChooser chooser= new JFileChooser(userDir +"/Desktop"); chooser.setFileFilter(filter); chooser.setDialogTitle("Wybierz plik do przetworzenia"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setAcceptAllFileFilterUsed(false); chooser.showOpenDialog(null); loadedFile = chooser.getSelectedFile().toPath(); return chooser; } public Path getPath() { return loadedFile; } }
[ "Emilio@Emilio-Laptop.home" ]
Emilio@Emilio-Laptop.home
453916fff09cd622c2bc9ed23492cdd1052bda8e
f163ea0084da06625504129929303fabdc950d25
/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/Tuple7Property.java
4bf80cc0fc16c680bc6995bac525766005930793
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
sureshpendap/Achilles
492f1c6520a8d3f13e7dc4d7cff09310880b69e9
90a164abd82d8244cd026cf67081af6443ea3f88
refs/heads/master
2021-05-02T17:06:15.988699
2016-10-30T16:12:27
2016-10-30T16:12:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,396
java
/* * Copyright (C) 2012-2016 DuyHai DOAN * * 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 info.archinnov.achilles.internals.metamodel; import static info.archinnov.achilles.internals.cql.TupleExtractor.extractType; import static java.lang.String.format; import java.util.Arrays; import java.util.List; import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.datastax.driver.core.DataType; import com.datastax.driver.core.GettableData; import com.datastax.driver.core.TupleType; import com.datastax.driver.core.TupleValue; import com.google.common.reflect.TypeToken; import info.archinnov.achilles.internals.metamodel.columns.FieldInfo; import info.archinnov.achilles.internals.options.Options; import info.archinnov.achilles.type.tuples.Tuple7; import info.archinnov.achilles.validation.Validator; public class Tuple7Property<ENTITY, A, B, C, D, E, F, G> extends AbstractTupleProperty<ENTITY, Tuple7<A, B, C, D, E, F, G>> { private static final Logger LOGGER = LoggerFactory.getLogger(Tuple7.class); private final AbstractProperty<ENTITY, A, ?> aProperty; private final AbstractProperty<ENTITY, B, ?> bProperty; private final AbstractProperty<ENTITY, C, ?> cProperty; private final AbstractProperty<ENTITY, D, ?> dProperty; private final AbstractProperty<ENTITY, E, ?> eProperty; private final AbstractProperty<ENTITY, F, ?> fProperty; private final AbstractProperty<ENTITY, G, ?> gProperty; public Tuple7Property(FieldInfo<ENTITY, Tuple7<A, B, C, D, E, F, G>> fieldInfo, AbstractProperty<ENTITY, A, ?> aProperty, AbstractProperty<ENTITY, B, ?> bProperty, AbstractProperty<ENTITY, C, ?> cProperty, AbstractProperty<ENTITY, D, ?> dProperty, AbstractProperty<ENTITY, E, ?> eProperty, AbstractProperty<ENTITY, F, ?> fProperty, AbstractProperty<ENTITY, G, ?> gProperty) { super(new TypeToken<Tuple7<A, B, C, D, E, F, G>>() { }, fieldInfo); this.aProperty = aProperty; this.bProperty = bProperty; this.cProperty = cProperty; this.dProperty = dProperty; this.eProperty = eProperty; this.fProperty = fProperty; this.gProperty = gProperty; } @Override TupleValue encodeFromJavaInternal(Tuple7<A, B, C, D, E, F, G> tuple7, Optional<Options> cassandraOptions) { if (LOGGER.isTraceEnabled()) { LOGGER.trace(format("Encode from Java '%s' tuple7 %s to CQL type", fieldName, tuple7)); } return tupleType.newValue( aProperty.encodeFromRaw(tuple7._1(), cassandraOptions), bProperty.encodeFromRaw(tuple7._2(), cassandraOptions), cProperty.encodeFromRaw(tuple7._3(), cassandraOptions), dProperty.encodeFromRaw(tuple7._4(), cassandraOptions), eProperty.encodeFromRaw(tuple7._5(), cassandraOptions), fProperty.encodeFromRaw(tuple7._6(), cassandraOptions), gProperty.encodeFromRaw(tuple7._7(), cassandraOptions)); } @Override TupleValue encodeFromRawInternal(Object o, Optional<Options> cassandraOptions) { if (LOGGER.isTraceEnabled()) { LOGGER.trace(format("Encode raw '%s' tuple7 object %s", fieldName, o)); } Validator.validateTrue(Tuple7.class.isAssignableFrom(o.getClass()), "The class of object %s to encode should be Tuple7", o); return encodeFromJava((Tuple7<A, B, C, D, E, F, G>) o, cassandraOptions); } @Override Tuple7<A, B, C, D, E, F, G> decodeFromGettableInternal(GettableData gettableData) { if (LOGGER.isTraceEnabled()) { LOGGER.trace(format("Decode '%s' tuple7 from gettable object %s", fieldName, gettableData)); } return decodeFromRaw(gettableData.getTupleValue(fieldInfo.quotedCqlColumn)); } @Override Tuple7<A, B, C, D, E, F, G> decodeFromRawInternal(Object o) { if (LOGGER.isTraceEnabled()) { LOGGER.trace(format("Decode '%s' tuple7 raw object %s", fieldName, o)); } Validator.validateTrue(TupleValue.class.isAssignableFrom(o.getClass()), "The class of object %s to decode should be %s", o, TupleValue.class.getCanonicalName()); final List<DataType> types = tupleType.getComponentTypes(); return new Tuple7<>( aProperty.decodeFromRaw(extractType((TupleValue) o, types.get(0), aProperty, 0)), bProperty.decodeFromRaw(extractType((TupleValue) o, types.get(1), bProperty, 1)), cProperty.decodeFromRaw(extractType((TupleValue) o, types.get(2), cProperty, 2)), dProperty.decodeFromRaw(extractType((TupleValue) o, types.get(3), dProperty, 3)), eProperty.decodeFromRaw(extractType((TupleValue) o, types.get(4), eProperty, 4)), fProperty.decodeFromRaw(extractType((TupleValue) o, types.get(5), fProperty, 5)), gProperty.decodeFromRaw(extractType((TupleValue) o, types.get(6), gProperty, 6))); } @Override public TupleType buildType(Optional<Options> cassandraOptions) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(format("Build current '%s' tuple7 data type", fieldName)); } return tupleTypeFactory.typeFor( aProperty.buildType(cassandraOptions), bProperty.buildType(cassandraOptions), cProperty.buildType(cassandraOptions), dProperty.buildType(cassandraOptions), eProperty.buildType(cassandraOptions), fProperty.buildType(cassandraOptions), gProperty.buildType(cassandraOptions)); } @Override protected List<AbstractProperty<ENTITY, ?, ?>> componentsProperty() { return Arrays.asList(aProperty, bProperty, cProperty, dProperty, eProperty, fProperty, gProperty); } }
[ "doanduyhai@gmail.com" ]
doanduyhai@gmail.com
e327dc4b0f27dfa0660b505ac003661dc9aa7b37
c14c442da44013107a26252aea7a043af52fcbad
/Assignment8/src/DrawApp.java
6232bf3c707465eca56f9eba01958baf1ab47bb0
[]
no_license
Jess-Nguy/Drawing-App
8183d1215d299245c14b9830570d170d27456ff0
4be30ec47fa89390b893dabb1b81b9510f772294
refs/heads/master
2020-04-27T15:51:05.490987
2019-03-08T03:30:04
2019-03-08T03:30:04
174,462,717
0
0
null
null
null
null
UTF-8
Java
false
false
11,448
java
import java.util.InputMismatchException; import javafx.application.Application; import static javafx.application.Application.launch; import javafx.event.ActionEvent; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.StrokeLineCap; import javafx.stage.Stage; /** *This class is a GUI drawing application. * * * @author Jess Nguyen, 000747411 */ public class DrawApp extends Application { /**Graphics Context called drawGC **/ GraphicsContext drawGC; /**all of the labels **/ private Label labelLocation, labelRadius, labelColour, labelMessage, labelErrors; /**all of the text fields**/ private TextField textX, textY, textRadius, textRed, textGreen, textBlue; /**radius of the circle draw tool**/ private int radius = 20; /**number for rgb red, green and blue colour**/ private int red; private int green; private int blue; /**Past x and y location to draw a line for smooth brush work**/ private double previousX; private double previousY; /**User input of x and y**/ private int x; private int y; // TODO: Instance Variables for View Components and Model // TODO: Private Event Handlers and Helper Methods /** * Draws a circle from user input on canvas. * @param e The ActionEvent of draw **/ private void drawing(ActionEvent e) { try { radius = Integer.parseInt(textRadius.getText()); if (radius <= 0) { labelErrors.setText("Radius has to be greater than 0."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Radius."); return; } try { red = Integer.parseInt(textRed.getText()); if (red < 0 || red > 255) { labelErrors.setText("Red must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Red."); return; } try { green = Integer.parseInt(textGreen.getText()); if (green < 0 || green >255) { labelErrors.setText("Green must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Green."); return; } try { blue = Integer.parseInt(textBlue.getText()); if (blue < 0 || blue > 255) { labelErrors.setText("Blue must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Blue. "); return; } try { x = Integer.parseInt(textX.getText()); if (x < 0 || x > 800) { labelErrors.setText("X must be in range 0 to 800."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for X. "); return; } try { y = Integer.parseInt(textY.getText()); if (y < 0 || y > 420) { labelErrors.setText("Y must be in range 0 to 420."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Y. "); return; } drawGC.setFill(Color.rgb(red, green, blue)); drawGC.fillOval(x, y, radius, radius); labelErrors.setText("No Errors"); } /** * Draws a line when mouse is dragged. * @param me MouseEvent of draggedHandler **/ private void draggedHandler(MouseEvent me) { try { radius = Integer.parseInt(textRadius.getText()); if (radius <= 0) { labelErrors.setText("Radius has to be greater than 0."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Radius."); return; } try { red = Integer.parseInt(textRed.getText()); if (red < 0 || red > 255) { labelErrors.setText("Red must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Red."); return; } try { green = Integer.parseInt(textGreen.getText()); if (green < 0 || green >255) { labelErrors.setText("Green must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Green."); return; } try { blue = Integer.parseInt(textBlue.getText()); if (blue < 0 || blue > 255) { labelErrors.setText("Blue must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Blue. "); return; } drawGC.setStroke(Color.rgb(red, green, blue)); drawGC.setLineWidth(radius); drawGC.setLineCap(StrokeLineCap.ROUND); drawGC.strokeLine(previousX, previousY, me.getX(), me.getY()); previousX = me.getX(); previousY = me.getY(); } /** * Draws a circle when mouse pressed. * @param me MouseEvent of pressedHandler **/ private void pressedHandler(MouseEvent me) { try { radius = Integer.parseInt(textRadius.getText()); if (radius <= 0) { labelErrors.setText("Radius has to be greater than 0."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Radius."); return; } try { red = Integer.parseInt(textRed.getText()); if (red < 0 || red > 255) { labelErrors.setText("Red must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Red."); return; } try { green = Integer.parseInt(textGreen.getText()); if (green < 0 || green >255) { labelErrors.setText("Green must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Green."); return; } try { blue = Integer.parseInt(textBlue.getText()); if (blue < 0 || blue > 255) { labelErrors.setText("Blue must be in range 0 to 255."); return; } } catch (NumberFormatException g) { labelErrors.setText("Bad input for Blue. "); return; } drawGC.setFill(Color.rgb(red, green, blue)); drawGC.fillOval(me.getX() - 5, me.getY() - 5, radius, radius); previousX = me.getX(); previousY = me.getY(); } /** * This is where you create your components and the model and add event * handlers. * * @param stage The main stage * @throws Exception */ @Override public void start(Stage stage) throws Exception { Pane root = new Pane(); Scene scene = new Scene(root, 800, 500); // set the size here stage.setTitle("Mouse Events"); // set the window title here stage.setScene(scene); // TODO: Add your GUI-building code here /**GUI building for labels**/ labelLocation = new Label("Location:"); labelRadius = new Label("Radius:"); labelColour = new Label("Colour:"); labelMessage = new Label("Press the Button or Click on the canvas"); labelErrors = new Label("No Errors"); /**GUI building for textfields**/ textX = new TextField("0"); textY = new TextField("0"); textRadius = new TextField("20"); textRed = new TextField("255"); textGreen = new TextField("140"); textBlue = new TextField("0"); /**GUI building for button**/ Button drawIt = new Button("Draw It!"); // 1. Create the model // 2. Create the GUI components Canvas drawCanvas = new Canvas(800, 420); // 3. Add components to the root root.getChildren().addAll(labelLocation, labelRadius, labelColour, labelMessage, labelErrors, textX, textY, textRadius, textRed, textGreen, textBlue, drawIt, drawCanvas); // 4. Configure the components (colors, fonts, size, location) drawGC = drawCanvas.getGraphicsContext2D(); /**Label placements on window**/ labelLocation.setLayoutY(420); labelRadius.setLayoutY(420); labelColour.setLayoutY(420); labelMessage.setLayoutY(480); labelErrors.setLayoutY(450); labelRadius.setLayoutX(210); labelColour.setLayoutX(330); /**Label size**/ labelErrors.setPrefWidth(800); labelMessage.setPrefWidth(800); /**Text field placements on window**/ textX.setLayoutY(420); textY.setLayoutY(420); textX.setLayoutX(65); textY.setLayoutX(135); textRadius.setLayoutY(420); textRed.setLayoutY(420); textGreen.setLayoutY(420); textBlue.setLayoutY(420); textRadius.setLayoutX(260); textRed.setLayoutX(380); textGreen.setLayoutX(450); textBlue.setLayoutX(520); /**Text field size**/ textX.setPrefWidth(70); textY.setPrefWidth(70); textRadius.setPrefWidth(70); textRed.setPrefWidth(70); textGreen.setPrefWidth(70); textBlue.setPrefWidth(70); drawIt.setLayoutY(420); drawIt.setLayoutX(590); labelErrors.setStyle("-fx-background-color:lightgray;-fx-alignment:center;-fx-text-fill:green;"); labelMessage.setStyle("-fx-alignment:center;-fx-background-color:lightblue;"); // 5. Add Event Handlers and do final setup drawCanvas.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::draggedHandler); drawCanvas.addEventHandler(MouseEvent.MOUSE_PRESSED, this::pressedHandler); drawIt.setOnAction(this::drawing); // 6. Show the stage stage.show(); } /** * Make no changes here. * * @param args unused */ public static void main(String[] args) { launch(args); } }
[ "noreply@github.com" ]
Jess-Nguy.noreply@github.com
db25e2200c6006870cc10596b59f491ae5d1584b
cd303d35fa037e8eecd4aa03381765342b2cff6a
/src/test/java/org/springframework/data/orientdb3/test/sample/repository/CountryRepository.java
5f2c850e5b913d0659cac1cec753e649f5c660da
[]
no_license
xxcxy/spring-data-orientdb
965cb6d607048a214a6f8a79d07b683f88e495b7
fe70fc9faf1b971d850657c29101784fbc86ade4
refs/heads/master
2023-06-07T20:01:29.187918
2019-11-13T12:38:11
2019-11-13T12:38:11
214,389,590
2
1
null
2023-05-26T22:14:52
2019-10-11T08:54:39
Java
UTF-8
Java
false
false
288
java
package org.springframework.data.orientdb3.test.sample.repository; import org.springframework.data.orientdb3.repository.OrientdbRepository; import org.springframework.data.orientdb3.test.sample.Country; public interface CountryRepository extends OrientdbRepository<Country, String> { }
[ "bert7914@gmail.com" ]
bert7914@gmail.com
146abdb240bdc3c40b4e86bd94f2c707a7615e39
0c42d28d09272c7cb10d0081f286978fec3598c3
/DemoProjects/BluetoothDemo/app/src/androidTest/java/com/example/harsh/bluetoothdemo/ExampleInstrumentedTest.java
68cb62db2b08ecfb937563694bc85b8f79066108
[]
no_license
manishsundriyal/Android-Samples
34e422a754ea6206304752155a4ba2eafc2d0a56
4e6d90d4c9e4745badf49b2a13554dff0251ec88
refs/heads/master
2021-07-18T10:54:35.649535
2017-10-26T12:20:24
2017-10-26T12:20:24
110,438,925
1
0
null
2017-11-12T14:25:00
2017-11-12T14:25:00
null
UTF-8
Java
false
false
766
java
package com.example.harsh.bluetoothdemo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.harsh.bluetoothdemo", appContext.getPackageName()); } }
[ "harshbhardwaj2357@gmail.com" ]
harshbhardwaj2357@gmail.com
dcbd551ca85ed713154a6e7ce4822fa6e56e9aef
d4ccf9206b9bd265469897f2a80cd2326126e9ce
/searcher/CleverSearcher.java
0c18a832cd801bfb8b599e5c8d96fab2c8d48c0f
[]
no_license
MatthewTAustwick/Year2UniversityJavaWorkWeek1-2_Extra
559cae797e5f1fbe7438a4a2ac0cc4be9f1885d2
48a5f328b74c9fb15d76ee9dcae9312694bd3260
refs/heads/master
2020-11-25T12:20:49.656319
2019-12-17T16:35:38
2019-12-17T16:35:38
228,656,792
0
0
null
null
null
null
UTF-8
Java
false
false
2,443
java
package searcher; import java.util.Arrays; public class CleverSearcher<T extends Comparable<? super T>> extends Searcher<T>{ CleverSearcher(T[] array, int k) { super(array, k); } @Override public T findElement() throws IndexingError { //Creates the findElement() method defined in "Searcher" T[] array = getArray(); //This makes sure that "array" contains the actual array designated in the constructor. int k = getIndex(); //This creates "k" which is a denotation of the current index of any of the integers in the array. if (k <= 0 || k > array.length) { //This checks to make sure that the given index is within the boundaries of the array and does not exceed it or go below it. throw new IndexingError(); //Outputs an error which is defined by its own class - this only occurs if the given index is NOT in the array. } //Creates a new array called "helperArray" which currently contains the memory needed to store k numbers but is designed to take integers. T helperArray[] = (T[]) new Object[k]; int index = 0; //This line just helps efficiency as "index" is always set to 0 so it can be used in multiple for each loops (see below). for (; index < k; index++){ //For as long as index is less than k, run the code inside. helperArray[index] = array[index]; //This copies the current number in the indexth position from the big array into the smaller array. } Arrays.sort(helperArray); //Sorts the small array from smallest to largest. for (; index < array.length; index++){ //For as long as index is less than the length of the big array, run the code inside. if (array[index].compareTo(helperArray[0]) > 0){ //If the current number in the big array is bigger than the SMALLEST number in the small array... helperArray[0] = array[index]; //Replace the SMALLEST number in the small array with the current number from the big array Arrays.sort(helperArray); //Resort the small array so you have the numbers in order, once again. } } //By the end of this iterative process, you will have the top k largest numbers inside of the small array as they will all be bigger than the large array return helperArray[0]; //Ergo, the smallest out of the small array WILL BE the kth largest number } }
[ "noreply@github.com" ]
MatthewTAustwick.noreply@github.com
3b6b10ff6d377655b3f1dd3b807c2f4179c147a4
51fa3cc281eee60058563920c3c9059e8a142e66
/Java/src/testcases/CWE400_Resource_Exhaustion/s01/CWE400_Resource_Exhaustion__getQueryString_Servlet_write_04.java
893dad83db1ffaec2c6295f01a47a89fca0879c1
[]
no_license
CU-0xff/CWE-Juliet-TestSuite-Java
0b4846d6b283d91214fed2ab96dd78e0b68c945c
f616822e8cb65e4e5a321529aa28b79451702d30
refs/heads/master
2020-09-14T10:41:33.545462
2019-11-21T07:34:54
2019-11-21T07:34:54
223,105,798
1
4
null
null
null
null
UTF-8
Java
false
false
18,506
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE400_Resource_Exhaustion__getQueryString_Servlet_write_04.java Label Definition File: CWE400_Resource_Exhaustion.label.xml Template File: sources-sinks-04.tmpl.java */ /* * @description * CWE: 400 Resource Exhaustion * BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter()) * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: write * GoodSink: Write to a file count number of times, but first validate count * BadSink : Write to a file count number of times * Flow Variant: 04 Control flow: if(PRIVATE_STATIC_FINAL_TRUE) and if(PRIVATE_STATIC_FINAL_FALSE) * * */ package testcases.CWE400_Resource_Exhaustion.s01; import testcasesupport.*; import javax.servlet.http.*; import java.util.StringTokenizer; import java.util.logging.Level; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.io.IOException; public class CWE400_Resource_Exhaustion__getQueryString_Servlet_write_04 extends AbstractTestCaseServlet { /* The two variables below are declared "final", so a tool should * be able to identify that reads of these will always return their * initialized values. */ private static final boolean PRIVATE_STATIC_FINAL_TRUE = true; private static final boolean PRIVATE_STATIC_FINAL_FALSE = false; public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { int count; if (PRIVATE_STATIC_FINAL_TRUE) { count = Integer.MIN_VALUE; /* initialize count in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */ { StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); /* a token will be like "id=33" */ if(token.startsWith("id=")) /* check if we have the "id" parameter" */ { try { count = Integer.parseInt(token.substring(3)); /* set count to the int 33 */ } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat); } break; /* exit while loop */ } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure count is inititialized before the Sink to avoid compiler errors */ count = 0; } if (PRIVATE_STATIC_FINAL_TRUE) { File file = new File("badSink.txt"); FileOutputStream streamFileOutput = new FileOutputStream(file); OutputStreamWriter writerOutputStream = new OutputStreamWriter(streamFileOutput, "UTF-8"); BufferedWriter writerBuffered = new BufferedWriter(writerOutputStream); int i; /* POTENTIAL FLAW: Do not validate count before using it as the for loop variant to write to a file */ for (i = 0; i < count; i++) { try { writerBuffered.write("Hello"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream writing", exceptIO); } } /* Close stream reading objects */ try { if (writerBuffered != null) { writerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedWriter", exceptIO); } try { if (writerOutputStream != null) { writerOutputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing OutputStreamWriter", exceptIO); } try { if (streamFileOutput != null) { streamFileOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileOutputStream", exceptIO); } } } /* goodG2B1() - use goodsource and badsink by changing first PRIVATE_STATIC_FINAL_TRUE to PRIVATE_STATIC_FINAL_FALSE */ private void goodG2B1(HttpServletRequest request, HttpServletResponse response) throws Throwable { int count; if (PRIVATE_STATIC_FINAL_FALSE) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure count is inititialized before the Sink to avoid compiler errors */ count = 0; } else { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ count = 2; } if (PRIVATE_STATIC_FINAL_TRUE) { File file = new File("badSink.txt"); FileOutputStream streamFileOutput = new FileOutputStream(file); OutputStreamWriter writerOutputStream = new OutputStreamWriter(streamFileOutput, "UTF-8"); BufferedWriter writerBuffered = new BufferedWriter(writerOutputStream); int i; /* POTENTIAL FLAW: Do not validate count before using it as the for loop variant to write to a file */ for (i = 0; i < count; i++) { try { writerBuffered.write("Hello"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream writing", exceptIO); } } /* Close stream reading objects */ try { if (writerBuffered != null) { writerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedWriter", exceptIO); } try { if (writerOutputStream != null) { writerOutputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing OutputStreamWriter", exceptIO); } try { if (streamFileOutput != null) { streamFileOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileOutputStream", exceptIO); } } } /* goodG2B2() - use goodsource and badsink by reversing statements in first if */ private void goodG2B2(HttpServletRequest request, HttpServletResponse response) throws Throwable { int count; if (PRIVATE_STATIC_FINAL_TRUE) { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ count = 2; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure count is inititialized before the Sink to avoid compiler errors */ count = 0; } if (PRIVATE_STATIC_FINAL_TRUE) { File file = new File("badSink.txt"); FileOutputStream streamFileOutput = new FileOutputStream(file); OutputStreamWriter writerOutputStream = new OutputStreamWriter(streamFileOutput, "UTF-8"); BufferedWriter writerBuffered = new BufferedWriter(writerOutputStream); int i; /* POTENTIAL FLAW: Do not validate count before using it as the for loop variant to write to a file */ for (i = 0; i < count; i++) { try { writerBuffered.write("Hello"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream writing", exceptIO); } } /* Close stream reading objects */ try { if (writerBuffered != null) { writerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedWriter", exceptIO); } try { if (writerOutputStream != null) { writerOutputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing OutputStreamWriter", exceptIO); } try { if (streamFileOutput != null) { streamFileOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileOutputStream", exceptIO); } } } /* goodB2G1() - use badsource and goodsink by changing second PRIVATE_STATIC_FINAL_TRUE to PRIVATE_STATIC_FINAL_FALSE */ private void goodB2G1(HttpServletRequest request, HttpServletResponse response) throws Throwable { int count; if (PRIVATE_STATIC_FINAL_TRUE) { count = Integer.MIN_VALUE; /* initialize count in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */ { StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); /* a token will be like "id=33" */ if(token.startsWith("id=")) /* check if we have the "id" parameter" */ { try { count = Integer.parseInt(token.substring(3)); /* set count to the int 33 */ } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat); } break; /* exit while loop */ } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure count is inititialized before the Sink to avoid compiler errors */ count = 0; } if (PRIVATE_STATIC_FINAL_FALSE) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ IO.writeLine("Benign, fixed string"); } else { /* FIX: Validate count before using it as the for loop variant to write to a file */ if (count > 0 && count <= 20) { File file = new File("goodSink.txt"); FileOutputStream streamFileOutput = new FileOutputStream(file); OutputStreamWriter writerOutputStream = new OutputStreamWriter(streamFileOutput, "UTF-8"); BufferedWriter writerBuffered = new BufferedWriter(writerOutputStream); int i; for (i = 0; i < count; i++) { try { writerBuffered.write("Hello"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream writing", exceptIO); } } /* Close stream reading objects */ try { if (writerBuffered != null) { writerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedWriter", exceptIO); } try { if (writerOutputStream != null) { writerOutputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing OutputStreamWriter", exceptIO); } try { if (streamFileOutput != null) { streamFileOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileOutputStream", exceptIO); } } } } /* goodB2G2() - use badsource and goodsink by reversing statements in second if */ private void goodB2G2(HttpServletRequest request, HttpServletResponse response) throws Throwable { int count; if (PRIVATE_STATIC_FINAL_TRUE) { count = Integer.MIN_VALUE; /* initialize count in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */ { StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); /* a token will be like "id=33" */ if(token.startsWith("id=")) /* check if we have the "id" parameter" */ { try { count = Integer.parseInt(token.substring(3)); /* set count to the int 33 */ } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat); } break; /* exit while loop */ } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure count is inititialized before the Sink to avoid compiler errors */ count = 0; } if (PRIVATE_STATIC_FINAL_TRUE) { /* FIX: Validate count before using it as the for loop variant to write to a file */ if (count > 0 && count <= 20) { File file = new File("goodSink.txt"); FileOutputStream streamFileOutput = new FileOutputStream(file); OutputStreamWriter writerOutputStream = new OutputStreamWriter(streamFileOutput, "UTF-8"); BufferedWriter writerBuffered = new BufferedWriter(writerOutputStream); int i; for (i = 0; i < count; i++) { try { writerBuffered.write("Hello"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream writing", exceptIO); } } /* Close stream reading objects */ try { if (writerBuffered != null) { writerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedWriter", exceptIO); } try { if (writerOutputStream != null) { writerOutputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing OutputStreamWriter", exceptIO); } try { if (streamFileOutput != null) { streamFileOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileOutputStream", exceptIO); } } } } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B1(request, response); goodG2B2(request, response); goodB2G1(request, response); goodB2G2(request, response); } /* 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); } }
[ "frank@fischer.com.mt" ]
frank@fischer.com.mt
bf7c97f5bad4a5182f114d0dc3042c7f6bfa3f90
b653ef9e353de3a8023658faa898d38e4e8cb46d
/src/main/java/com/crud/tasks/TasksApplication.java
0eba472144b495ec79294aa3ba67a428f523c4ff
[]
no_license
ganzes/tasksRESTAPI
8172a94ce7430fb9b6f832640a19b0e5044c4f17
4ff33e92c4c0d46d0ebd425e3c9bd71d8466bdbb
refs/heads/master
2022-02-27T21:58:46.179191
2019-11-17T22:36:26
2019-11-17T22:36:26
198,316,308
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
package com.crud.tasks; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication //public class TasksApplication extends SpringBootServletInitializer { public class TasksApplication { public static void main(String[] args) { SpringApplication.run(TasksApplication.class, args); } /* @Override protected SpringApplicationBuilder configure (SpringApplicationBuilder application){ return application.sources(TasksApplication.class); }*/ }
[ "charczuk.arkadiusz@gmail.com" ]
charczuk.arkadiusz@gmail.com
8e3b968df4a9e9e35d8cfe96d00dae688f35fc04
e0abb0e3548922165428e90523ccd86c64fab542
/taxiandr/src/main/java/com/taxiandroid/ru/taxiandr/CustomTwoAdapter.java
920117e50fc1ef88aa565c494714ebd1b9e79c04
[]
no_license
kimdaehoi/TaxiAndroid
3db03cb66325e238594cf50a38a68dea4b9343f6
c60462807ff50869f384dba8c8c9208a28fc408f
refs/heads/master
2020-02-26T13:22:32.109845
2015-11-08T10:06:30
2015-11-08T10:06:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,417
java
package com.taxiandroid.ru.taxiandr; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; /** * Created by saperov on 01.11.15. */ public class CustomTwoAdapter extends ArrayAdapter<Two> { public CustomTwoAdapter (Context context,ArrayList<Two> two_items){ super(context,0,two_items); } public View getView(int position, View convertView, ViewGroup parent) { // Get the data item for this position Two two = getItem(position); if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_two, parent, false); } // Lookup view for data population TextView text1 = (TextView) convertView.findViewById(R.id.tvTwo); text1.setText(two.two_item); ImageView imageView = (ImageView) convertView.findViewById(R.id.ivTwo); if (position == 0) { imageView.setImageResource(R.drawable.ic_action_mail); } if (position == 1) { imageView.setImageResource(R.drawable.ic_action_phone_outgoing); } if (position == 3) { imageView.setImageResource(R.drawable.ic_action_undo); } return convertView; } }
[ "developerc@yandex.ru" ]
developerc@yandex.ru
b7d1156ca70a835210a52ceffbf304d580dfac73
4d6ced63edcf7939c816bad08d05059d83a3a344
/BookStoreWebsite/src/com/bookstore/controller/admin/book/ListBookServlet.java
d0d9ce6c88ee6574147fb0ccdd78441ecec5d3e5
[]
no_license
logi92/BookStoreWebSite
08f377a7931247b3bc34d58f4ea10dd008f3a778
bea218863d51bbb514eecafc10977c2b4b5497b6
refs/heads/master
2023-08-08T20:51:00.545604
2019-06-06T09:21:34
2019-06-06T09:21:34
188,024,166
0
0
null
2023-07-22T06:24:39
2019-05-22T11:22:59
Java
UTF-8
Java
false
false
725
java
package com.bookstore.controller.admin.book; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.bookstore.service.BookServices; @WebServlet("/admin/list_books") public class ListBookServlet extends HttpServlet { private static final long serialVersionUID = 1L; public ListBookServlet() { } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { BookServices bookServices = new BookServices(request, response); bookServices.listBooks(); } }
[ "r_nazar92@mail.ru" ]
r_nazar92@mail.ru
fb9b809676f1f9bcaa700113bb45a306f51550f7
bbc3c6473b3928b0e8ba0776211d07c07a322523
/app/src/main/java/com/ahlemmohamed/customlistviewfragmentnd/ui/home/HomeViewModel.java
a27fb17bcbb013136612478d151877939b5ecd23
[]
no_license
TajouriMohamed/CustomListViewFragmentND
88e471dbd9c2f7d1bf9d8080ee10d08ea93479fe
2d973df8ba6f0c2b426cc83c9f370a4cae63041c
refs/heads/master
2020-09-09T12:31:45.681015
2019-11-13T11:50:05
2019-11-13T11:50:05
221,447,242
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package com.ahlemmohamed.customlistviewfragmentnd.ui.home; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class HomeViewModel extends ViewModel { private MutableLiveData<String> mText; public HomeViewModel() { mText = new MutableLiveData<>(); //mText.setValue("This is home fragment"); } public LiveData<String> getText() { return mText; } }
[ "jessymina.jc@gmail.com" ]
jessymina.jc@gmail.com
503c47470efd81608ff9c63876f7e20959bd9e09
1feb48fe4e6556a21e25b0d020c1963a8af2db03
/WEB-INF/src/com/bilelaris/Person.java
6e914215970ce024dccdde241cca16362af3c26a
[]
no_license
bilelaris/tp_rest
b29d1577ab03301921308abdec6d364d9ab55596
d4ff2d3fdb7266743b3abbc80eb1f2fcbcf4ae31
refs/heads/master
2021-05-14T11:52:28.275397
2018-01-05T23:37:19
2018-01-05T23:37:19
116,396,122
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package com.bilelaris; public class Person { private Integer id; private String lastname; private String firstname; public Person() { } public Person(Integer id, String lastname, String firstname) { this.id = id; this.lastname = lastname; this.firstname = firstname; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } @Override public String toString() { return "Person{" + "id=" + id + ", lastname='" + lastname + '\'' + ", firstname='" + firstname + '\'' + '}'; } }
[ "bilel94@gmail.com" ]
bilel94@gmail.com
17ae656a5c73878c7d70fca3cc72e420d936698f
b38b26157d3eee8a9d825e58349e3190ddc191dc
/webapp/src/main/java/cn/momia/common/service/CachedService.java
ef3d8e674d2d1eae5b070841ea431f5a0a07eebc
[ "Apache-2.0" ]
permissive
lovemomia/common
dc944487903c53f51cc7c197da70639d45665c54
63f6d64667d099272c7d7fd319e6bf4586b772bb
refs/heads/master
2021-01-17T08:11:50.900184
2016-05-19T08:06:55
2016-05-19T08:06:55
36,642,935
0
1
null
null
null
null
UTF-8
Java
false
false
713
java
package cn.momia.common.service; import java.util.ArrayList; import java.util.List; public class CachedService extends AbstractService { private List<?> cachedList = new ArrayList<Object>(); private Class<?> type; private String sql; public Class<?> getType() { return type; } public void setType(Class<?> type) { this.type = type; } public String getSql() { return sql; } public void setSql(String sql) { this.sql = sql; } @Override protected void doReload() { cachedList = queryObjectList(sql, type); } public List<?> listAll() { if (isOutOfDate()) reload(); return cachedList; } }
[ "arthas.wuqf@gmail.com" ]
arthas.wuqf@gmail.com
12998bf75f191796573f8e9d2c7d122175672c36
f1c9e890767fa745fc1a3555f02deb2a06ce50aa
/deprecated/eglibrary-android-api8/src/com/eaglesakura/lib/io/DataOutputStream.java
207424e76c12d0b62ffb1c2d60924224e8aed6da
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
eaglesakura/eglibrary
29555b3e1914f5bb1ebd43eba703e6cf0f247138
7aabf46ad7c54ad8be943f79d00aecb3da137c13
refs/heads/master
2021-01-23T14:41:34.147230
2015-12-03T13:17:41
2015-12-03T13:17:41
3,609,071
4
0
null
null
null
null
UTF-8
Java
false
false
9,313
java
package com.eaglesakura.lib.io; import java.io.IOException; import java.io.OutputStream; import com.eaglesakura.lib.android.game.resource.DisposableResource; import com.eaglesakura.lib.android.game.util.LogUtil; /** * ライブラリ規定の形式でデータを出力するインターフェース。<BR> * このクラスを通して出力したファイルは対になる {@link DataInputStream}で開くことが可能。 * * * */ public final class DataOutputStream extends DisposableResource { /** * 入出力。 */ private OutputStream writer = null; public DataOutputStream(OutputStream os) { writer = os; } /** * リソースの開放を行う。 * * * */ @Override public void dispose() { if (writer != null) { try { writer.close(); } catch (Exception e) { LogUtil.log(e); } writer = null; } } /** * 実際のバッファへ書き込みを行う。 * * * @param buf * @param position * @param length * */ public void writeBuffer(byte[] buf, int position, int length) throws IOException { writer.write(buf, position, length); } /** * 1バイト整数を保存する。 * * * @param n * */ public void writeS8(byte n) throws IOException { byte[] buf = { n, }; writeBuffer(buf, 0, buf.length); } /** * * * @param b * @throws IOException * */ public void writeBoolean(boolean b) throws IOException { writeS8(b ? (byte) 1 : (byte) 0); } /** * 2バイト整数を保存する。 * * * @param n * */ public void writeS16(short n) throws IOException { byte[] buf = { (byte) ((((int) n) >> 8) & 0xff), (byte) ((((int) n) >> 0) & 0xff), }; writeBuffer(buf, 0, buf.length); } /** * 4バイト整数を保存する。 * * * @param n * */ public void writeS32(int n) throws IOException { byte[] buf = { (byte) ((((int) n) >> 24) & 0xff), (byte) ((((int) n) >> 16) & 0xff), (byte) ((((int) n) >> 8) & 0xff), (byte) ((((int) n) >> 0) & 0xff), }; writeBuffer(buf, 0, buf.length); } /** * 8バイト整数を保存する。 * * * @param n * */ public void writeS64(long n) throws IOException { byte[] buf = { (byte) ((n >> 56) & 0xff), //! (byte) ((n >> 48) & 0xff), //! (byte) ((n >> 40) & 0xff), //! (byte) ((n >> 32) & 0xff), //! (byte) ((n >> 24) & 0xff), //! (byte) ((n >> 16) & 0xff), //! (byte) ((n >> 8) & 0xff), //! (byte) ((n >> 0) & 0xff), //! }; writeBuffer(buf, 0, buf.length); } /** * 4バイト整数の配列を保存する。 * * * @param buffer * @param position * @param length * */ public final void writeS32Array(final int[] buffer) throws IOException { byte[] temp = new byte[buffer.length * 4]; int ptr = 0; for (int n : buffer) { temp[ptr] = (byte) ((n >> 24) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 16) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 8) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 0) & 0xff); ptr++; } writeBuffer(temp, 0, temp.length); } /** * 4バイト整数の配列を保存する。 * * * @param buffer * @param position * @param length * */ public final void writeS32ArrayWithLength(final int[] buffer) throws IOException { writeS32(buffer.length); byte[] temp = new byte[buffer.length * 4]; int ptr = 0; for (int n : buffer) { temp[ptr] = (byte) ((n >> 24) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 16) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 8) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 0) & 0xff); ptr++; } writeBuffer(temp, 0, temp.length); } /** * 8バイト整数の配列を保存する。 * * * @param buffer * @param position * @param length * */ public final void writeS64Array(final long[] buffer) throws IOException { final byte[] temp = new byte[buffer.length * 8]; int ptr = 0; for (long n : buffer) { temp[ptr] = (byte) ((n >> 56) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 48) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 40) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 32) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 24) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 16) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 8) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 0) & 0xff); ptr++; } writeBuffer(temp, 0, temp.length); } /** * 8バイト整数の配列を保存する。 * * * @param buffer * @param position * @param length * */ public final void writeS64ArrayWithLength(final long[] buffer) throws IOException { writeS32(buffer.length); final byte[] temp = new byte[buffer.length * 8]; int ptr = 0; for (long n : buffer) { temp[ptr] = (byte) ((n >> 56) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 48) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 40) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 32) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 24) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 16) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 8) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 0) & 0xff); ptr++; } writeBuffer(temp, 0, temp.length); } /** * 浮動小数点配列を保存する。 * * * @param buffer * */ public void writeFloatArray(float[] buffer) throws IOException { byte[] temp = new byte[buffer.length * 4]; int ptr = 0; for (float f : buffer) { int n = Float.floatToIntBits(f); temp[ptr] = (byte) ((n >> 24) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 16) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 8) & 0xff); ptr++; temp[ptr] = (byte) ((n >> 0) & 0xff); ptr++; } writeBuffer(temp, 0, temp.length); } /** * 浮動小数値をGL形式の固定小数として保存する。 * * * @param n * */ public void writeGLFloat(float f) throws IOException { int n = (int) (f * (float) 0x10000); byte[] buf = { (byte) ((((int) n) >> 24) & 0xff), (byte) ((((int) n) >> 16) & 0xff), (byte) ((((int) n) >> 8) & 0xff), (byte) ((((int) n) >> 0) & 0xff), }; writeBuffer(buf, 0, buf.length); } /** * 浮動小数値を書き込む。 * * * @param f * */ public void writeFloat(float f) throws IOException { writeS32(Float.floatToIntBits(f)); } /** * 文字列を書き込む。<BR> * エンコードはShiftJISとして保存する。 * * * @param str * */ public void writeString(String str) throws IOException { byte[] buf = str.getBytes("Shift_JIS"); //! 文字列の長さを保存。 writeS16((short) buf.length); //! 文字列本体を保存。 writeBuffer(buf, 0, buf.length); } /** * 書き込みを行った場合の保存バイト数を計算する。 * * * @param str * @return * */ public static int getWriteSize(String str) { byte[] buf = str.getBytes(); return buf.length + 2; } /** * 配列の大きさと本体を保存する。<BR> * bufferがnullである場合、0バイトのファイルとして保存する。 * * * @param buffer * */ public void writeFile(byte[] buffer) throws IOException { if (buffer == null) { writeS32(0); return; } //! 配列の長さ writeS32(buffer.length); //! 配列本体 writeBuffer(buffer, 0, buffer.length); } }
[ "eagle.sakura@gmail.com" ]
eagle.sakura@gmail.com
9910318eae5a0cf13c6e98ba9f454d9f23ce3215
fbb146bf1b0a9fa8f9765d8d3c1583f826711009
/app/src/main/java/com/tekinarslan/material/sample/ui/adapter/CetPagerAdapter.java
e9ec9425b721731572e7f64ca355d1ff8738509b
[]
no_license
Morcal/English
2394ba2fe280f52f6aa3b88f6ef708a6d6b744da
1e4159de3188cd3bd1e10c7ac156905176699266
refs/heads/master
2020-04-14T01:10:34.599383
2016-06-12T12:59:22
2016-06-12T12:59:22
52,508,229
3
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package com.tekinarslan.material.sample.ui.adapter; import android.content.Context; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.tekinarslan.material.sample.ui.module.study.CommentFragment; import com.tekinarslan.material.sample.ui.module.study.CourseListFragment; import com.tekinarslan.material.sample.ui.module.study.IntroduceFragment; import com.tekinarslan.material.sample.ui.module.study.TabFragment; /** * Created by lyqdhgo on 2016/4/30. */ public class CetPagerAdapter extends FragmentPagerAdapter { final int PAGE_COUNT = 3; private String tabTitles[] = new String[]{"章节", "评论", "详情"}; private Context context; public CetPagerAdapter(FragmentManager fm, Context context) { super(fm); this.context = context; } @Override public Fragment getItem(int position) { switch (position) { case 0: // 章节 return CourseListFragment.newInstance(position + 1); case 1: // 评论 return CommentFragment.newInstance(); case 2: // 详情 return IntroduceFragment.newInstance(); default: return TabFragment.newInstance(position + 1); } } @Override public int getCount() { return PAGE_COUNT; } @Override public CharSequence getPageTitle(int position) { return tabTitles[position]; } }
[ "lyqdhgo@163.com" ]
lyqdhgo@163.com
c75e89c3c8e18d9d65dafa438dc642ed4478cd6d
1eb7464b2e4bd594e44f1dba5420bdb6c9d2e3e8
/src/main/java/com/study/spring/aop/aop3/SleepHelper.java
76a546d3a29015508b7a608d9db2caa4255574a3
[]
no_license
CoolSt1578/springstudy
8f99ae579f1b95797d13efd6c389372756cdabd4
f65b627e3bbe87c81164428f9c2683cfcb1eea28
refs/heads/master
2021-05-08T21:05:35.788731
2019-01-29T16:21:13
2019-01-29T16:21:13
119,628,507
0
0
null
null
null
null
UTF-8
Java
false
false
1,117
java
package com.study.spring.aop.aop3; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; /** * Created by guodd on 2018/1/29. */ @Aspect public class SleepHelper { public SleepHelper(){} @Pointcut("execution(* *.sleep())") public void sleeppoint(){ System.out.println("切入点"); } @Before(value = "sleeppoint()") public void beforeSleep() { System.out.println("睡觉前要脱衣服"); } @After(value = "sleeppoint()") public void afterSleep(){ System.out.println("起床前要穿衣服"); } @AfterThrowing(value = "sleeppoint()", throwing = "ex") public void doThrowing(JoinPoint joinPoint, Throwable ex){ System.out.println("doThrowing::method " + joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + " throw exception"); System.out.println(ex.getMessage()); } }
[ "guodongdong@aicaigroup.com" ]
guodongdong@aicaigroup.com
4b8e71408782b80b1a4906c843066ae17b17c2db
e0681fe37a24703ba5fe18de5ff68b8d3bebd9ab
/spring/src/main/java/fi/tuplabasari/blog/creation/BlogPost.java
4a744aa03aaacba39a3e01f51d9057df1715b03a
[]
no_license
c6julkar/tuplabasari-blog
7e5945fb8b29f3ced75254af728e91ecf92b3291
94fc3b1a83d788ef7945fce318bb0c0bb90d0bef
refs/heads/development
2021-04-15T04:04:05.615085
2018-04-26T05:50:06
2018-04-26T05:50:06
126,144,178
0
0
null
2018-04-26T06:02:41
2018-03-21T08:06:56
JavaScript
UTF-8
Java
false
false
702
java
package fi.tuplabasari.blog.creation; public class BlogPost { private int id; private static int ENTIRES; private String header; private String content; public BlogPost() { } public BlogPost(String header, String content) { ENTIRES++; this.header = header; this.content = content; this.id = ENTIRES; } public BlogPost(int id, String header, String content) { this.header = header; this.content = content; this.id = id; } public int getId() { return id; } public String getHeader() { return header; } public String getContent() { return content; } }
[ "joni.ryynanen@cs.tamk.fi" ]
joni.ryynanen@cs.tamk.fi
ace987ba29acb3e2a2f91793b9c2ec3fffaf11e5
bc8e97282c5833174236fa7f3062139087a6a592
/Lesson10/lesson10-homework/app/src/main/java/com/example/lesson6_homework/CardData.java
289859462aeb9b9fe81281b010c041147071d978
[]
no_license
GeorgeUG02/Android_Introduction
2aca92a13e6729ed9a51b2a8538d4ff5e4632c90
ffb9c72766757bd2d22b3e5248de9cb5191cc8c2
refs/heads/main
2023-03-31T07:36:06.070182
2021-04-07T08:54:57
2021-04-07T08:54:57
343,113,650
0
0
null
2021-04-07T08:59:58
2021-02-28T13:35:26
Java
UTF-8
Java
false
false
711
java
package com.example.lesson6_homework; public class CardData { private String id; private String title; private String description; private String dateOfCreation; public CardData(String title, String description, String dateoOfCreation) { this.title = title; this.description = description; this.dateOfCreation = dateoOfCreation; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public String getDescription() { return description; } public String getDateOfCreation() { return dateOfCreation; } }
[ "georgukladnik@gmail.com" ]
georgukladnik@gmail.com
b7c17518b3ec76e251073689d61ccc83a11da4c8
45fef5fbf8d45003bbb1668b5cfab4504b5c27e9
/src/main/java/com/pmfis/cinemaapp/model/rest/ReservationRequest.java
73b0dde001a5d4303fa9b827912291c58a7e2954
[]
no_license
nemanjagajic/CinemaAppBackend
0a185460ede3323e2030685d3f89171ef8c0f008
b8c4523e4cb41e5fe56f15e79362e1968165ffc6
refs/heads/master
2021-05-05T14:53:28.318848
2018-01-22T21:17:29
2018-01-22T21:17:29
118,516,023
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package com.pmfis.cinemaapp.model.rest; public class ReservationRequest { private int idMovie; private int idPerson; public ReservationRequest() { } public ReservationRequest(int idMovie, int idPerson) { this.idMovie = idMovie; this.idPerson = idPerson; } public int getIdMovie() { return idMovie; } public void setIdMovie(int idMovie) { this.idMovie = idMovie; } public int getIdPerson() { return idPerson; } public void setIdPerson(int idPerson) { this.idPerson = idPerson; } }
[ "Nemanja.gajicru96@gmail.com" ]
Nemanja.gajicru96@gmail.com
873fd2232fe3933eea31c45a0f142635cc076b82
63a7bd3becf06451bb61f99d0e1cb644bdb054c0
/src/com/java/stock/model/dao/WarehouseDao.java
da7d014c89cf957f07a54a314f48026fa6bed015
[]
no_license
SE3NIDA/NIDAProject
69b676c4b9ae49b066cf8002297c26599952a6db
729106488c179ba1f81c8f389fa583d40d453215
refs/heads/master
2016-09-05T16:47:34.437776
2013-06-21T11:23:19
2013-06-21T11:23:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package com.java.stock.model.dao; import java.sql.SQLException; import java.util.List; import org.springframework.dao.DataAccessException; import com.java.stock.model.entity.Warehouse; public interface WarehouseDao { public void addnewWharehouse(Warehouse employee) throws DataAccessException,SQLException; public long maxWharehouseId() throws DataAccessException,SQLException; public List<Warehouse> searchWherehouse() throws DataAccessException,SQLException; public List<Warehouse> searchWherehouse(long id, String name) throws DataAccessException,SQLException; }
[ "TOM@TOM-PC" ]
TOM@TOM-PC
13dbf6bc9c139dd2890e4654edb56a7296ba5557
ffebadf174b7bf72c8d0641292f39c10d492cb5a
/spring-boot-mybatis-mulidatasource/src/main/java/com/yunfei/datasource/DataSource1Config.java
d54d815acf5b52d4429302a03a815f1563a21269
[]
no_license
Max-jinxin/springboot-learning-start
6a9d1de26c7fa5de04eede74d828850b7b269436
33337931e6adcd788e487a285e7e6008a8ceb23f
refs/heads/master
2021-05-06T03:47:48.150334
2017-04-19T08:58:30
2017-04-19T08:58:30
114,886,550
0
0
null
null
null
null
UTF-8
Java
false
false
2,285
java
package com.yunfei.datasource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import javax.sql.DataSource; /** * 数据源1 */ @Configuration @MapperScan(basePackages = "com.yunfei.mapper.test1", sqlSessionTemplateRef = "test1SqlSessionTemplate") public class DataSource1Config { /** * 获取数据源1的配置文件信息 * @return */ @Bean(name = "test1DataSource") @ConfigurationProperties(prefix = "spring.datasource.test1") @Primary public DataSource testDataSource() { return DataSourceBuilder.create().build(); } /** * 数据源的xml文件路径 * @return */ @Bean(name = "test1SqlSessionFactory") @Primary public SqlSessionFactory testSqlSessionFactory(@Qualifier("test1DataSource") DataSource dataSource) throws Exception { SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); bean.setDataSource(dataSource); bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/test1/*.xml")); return bean.getObject(); } @Bean(name = "test1TransactionManager") @Primary public DataSourceTransactionManager testTransactionManager(@Qualifier("test1DataSource") DataSource dataSource) { return new DataSourceTransactionManager(dataSource); } @Bean(name = "test1SqlSessionTemplate") @Primary public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("test1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { return new SqlSessionTemplate(sqlSessionFactory); } }
[ "zhengyf@ctyun.cn" ]
zhengyf@ctyun.cn
82a6b8cc0d0e3c6133f8cf785c86c218941ce7bf
78f284cd59ae5795f0717173f50e0ebe96228e96
/factura-negocio/src/cl/stotomas/factura/negocio/ia_6/copy/copy3/TestingHab.java
60b9429e60a0a73b601a6cc8cf36307bda4893b9
[]
no_license
Pattricio/Factura
ebb394e525dfebc97ee2225ffc5fca10962ff477
eae66593ac653f85d05071b6ccb97fb1e058502d
refs/heads/master
2020-03-16T03:08:45.822070
2018-05-07T15:29:25
2018-05-07T15:29:25
132,481,305
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,149
java
package cl.stotomas.factura.negocio.ia_6.copy.copy3; import java.util.*; public class TestingHab { private int id; private String nombre; private String apellido; private int edad; /** * Constructor vacío */ public TestingHab() { id = 1; nombre = "Edward"; apellido = "Dammus"; edad = 22; } /** * Constructor con parametros */ public TestingHab(int id, String nombre, String apellido, int edad) { this.id = id; this.nombre = nombre; this.apellido = apellido; setEdad(edad); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public int getEdad() { return edad; } public void setEdad(int edad) { this.edad = edad; } /** * Método que acepte que la edad debe ser mayor a 15 */ public void edadMayor(int edad) { if(edad > 15) { System.out.println("Admitido"); } else { System.out.println("Edad debe ser mayor a 15"); } } /** * Método que me valide el segundo nombre */ public void validarNombre(String nombre) { StringTokenizer token = new StringTokenizer(nombre); if(token.countTokens() == 2) { System.out.println("Ingresaste 2 nombres"); }else { System.out.println("Error"); } } /** * Método que me pregunte por la edad y por el nombre */ public void NombreEdad(String nombre, int edad) { System.out.println("Cual es tu nombre y tu edad"); if(nombre.equals(nombre)) { System.out.println("Su nombre es: " +getNombre()); }else if(edad == 13) { this.edad = 100; // cambia la edad a 100 System.out.println("Su edad es:" +getEdad()); } } /** * Instanciar una persona */ public void Persona(Object o) { if(o.getClass() == TestingHab.class) { System.out.println(o); } } }
[ "Adriana Molano@DESKTOP-GQ96FK8" ]
Adriana Molano@DESKTOP-GQ96FK8
f7adba30a597edf124d40fa2105ce96a0e84e9c7
ef12c20f75a5dffec3696c548b580f20589306e8
/Calculator/src/calculator/FXMLDocumentController.java
8b54bde2e4ff8da25d89730f77b53e9bb870d8c7
[]
no_license
kashaf874/JavaFx_2019
c15c4def280e69d688e4e0ca40fbb9c149b5e7cd
dd31c39cfc1ad1a11ed39e56354790aca97b9c59
refs/heads/main
2023-09-04T18:53:26.370769
2021-10-01T12:26:34
2021-10-01T12:26:34
412,396,091
0
0
null
null
null
null
UTF-8
Java
false
false
1,232
java
package calculator; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.text.Text; public class FXMLDocumentController implements Initializable { @FXML private TextField username; @FXML private PasswordField password; @FXML private Button login; @FXML private Text message; @Override public void initialize(URL url, ResourceBundle rb) { } @FXML private void Login(ActionEvent event) { /* if(username.getText().equals(password.getText())){ message.setText("Welcome to Technercia"); }else{ message.setText("Wrong Credentials! Try Again..."); } */ String UN, PS; UN=username.getText(); PS=password.getText(); if(UN.equals(PS)){ message.setText("Welcome to Technercia"); }else{ message.setText("Wrong Credentials! Try Again..."); } } }
[ "kashafnaz510@gmail.com" ]
kashafnaz510@gmail.com
9ff38fa0f93c32aaffd04e8bbf8cddfcd5602f2f
ebd558f1fc813dfc0864de3d892a6d08cc09ef3e
/StringCount.java
6fa8e13746175dce25d45109131e4bb2c3a62633
[]
no_license
kishoruprade/JavaLearning
0e8e7761841aeb35f52c7a0066ac4cbe04b7c700
71e4bedd58f2e13d836dac4ad8e076100f403c04
refs/heads/master
2023-05-11T08:16:31.943024
2019-06-18T06:13:39
2019-06-18T06:13:39
181,825,230
0
0
null
2023-05-09T18:43:44
2019-04-17T05:48:47
Java
UTF-8
Java
false
false
744
java
package stringExamples; public class StringCount { public static void main(String[] args) { String str = "Welcome to Java"; char []ch = str.toCharArray(); int count = 0; // Program for Reverse the String and count the characters in the string for (int i = str.length()-1 ;i>=0;i--){ count =count+1; System.out.print(ch[i]); } System.out.println(count); System.out.println("..........Reverse the String with it's precision position....."); String []arr = str.split(" "); for (int i=0;i<arr.length;i++){ for (int j=arr[i].length()-1;j>=0;j--){ System.out.print(arr[i].charAt(j)); } System.out.print(" "); } } }
[ "noreply@github.com" ]
kishoruprade.noreply@github.com
489a76c52daa72456cc82d306df3f0f126b04d9d
dd6db37aaddc1f6a2548000310b333050b2a56f8
/core/src/com/cod3rboy/pewdew/managers/GameStateManager.java
1f707a7f2547a8b701d711db33fbf5def684ce01
[]
no_license
cod3rboy/PewDew
ab2cb09eb679b0d36baa1ee9390550a532b3e220
f4bd3a0e9b0a6d5493a34fa549595695bbaa5f44
refs/heads/master
2022-07-23T00:51:13.370072
2019-05-19T14:57:51
2019-05-19T14:57:51
200,008,406
0
0
null
null
null
null
UTF-8
Java
false
false
2,659
java
package com.cod3rboy.pewdew.managers; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; import com.cod3rboy.pewdew.gamestates.GameOverState; import com.cod3rboy.pewdew.gamestates.GameState; import com.cod3rboy.pewdew.gamestates.HighScoreState; import com.cod3rboy.pewdew.gamestates.MenuState; import com.cod3rboy.pewdew.gamestates.PlayState; public class GameStateManager { // Current game state; private GameState gameState; public static final int MENU = 0; public static final int PLAY = 53253; public static final int HIGHSCORE = 353; public static final int GAMEOVER = 25352; private static boolean musicSetting; // True = Music ON and False = Music OFF private static final String PREFERENCES = "settings"; private static final String KEY_MUSIC = "music_status"; private static final String KEY_CANNON = "cannon_fixed"; static { loadMusicSetting(); } public GameStateManager(){ setState(MENU); } public void setState(int state){ if(gameState != null) gameState.dispose(); if(state == MENU){ // Switch to menu state gameState = new MenuState(this); } if(state == PLAY){ // Switch to play state gameState = new PlayState(this); } if(state == HIGHSCORE){ gameState = new HighScoreState(this); } if(state == GAMEOVER) { gameState = new GameOverState(this); } } public void update(float dt){ gameState.update(dt); } public void draw() { gameState.draw(); } public static boolean getMusicSetting() { return musicSetting; } public static void setMusicSetting(boolean setting){ musicSetting = setting; saveMusicSetting(); } private static void saveMusicSetting(){ // Save Music Setting to Preferences Preferences prefs = Gdx.app.getPreferences(PREFERENCES); prefs.putBoolean(KEY_MUSIC, musicSetting); prefs.flush(); } private static void loadMusicSetting(){ // Load Music Setting from Preferences musicSetting = Gdx.app.getPreferences(PREFERENCES).getBoolean(KEY_MUSIC, true); } public static void saveCannonFixed(boolean bool){ // Save the cannon mode of user whether it is fixed at tip or set at controller Right Stick Preferences prefs = Gdx.app.getPreferences(PREFERENCES); prefs.putBoolean(KEY_CANNON, bool); prefs.flush(); } public static boolean getCannonFixed(){ return Gdx.app.getPreferences(PREFERENCES).getBoolean(KEY_CANNON, false); } }
[ "cod3rboy@hotmail.com" ]
cod3rboy@hotmail.com
4c7e22901e98d43b34b48c3438575a0d7be80da0
d93e3ae631d39d16e82949efdc576016a99536a4
/src/main/java/com/rbc/b2e/embark/admin/model/service/AdminServiceException.java
3f2c65bc4eb4c7014d27ae6417d855a441da59ca
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bjacome/EmbarkAdminApp
ae29bd53126f3e3b4a723dd4b2d6e7f7dc972168
3780f33b218522be5002127b685ff3de612a734b
refs/heads/master
2021-01-20T14:34:38.287763
2017-02-22T04:32:22
2017-02-22T04:32:22
82,759,576
0
0
null
null
null
null
UTF-8
Java
false
false
487
java
package com.rbc.b2e.embark.admin.model.service; public class AdminServiceException extends RuntimeException { private static final long serialVersionUID = 1L; public AdminServiceException() { super(); } public AdminServiceException(String aMessage, Exception aCause) { super(aMessage, aCause); } public AdminServiceException(String aMessage) { super(aMessage); } public AdminServiceException(Exception aCause) { super(aCause.getMessage()); } }
[ "bjacome@sympatico.ca" ]
bjacome@sympatico.ca
17039bc9c24ba0f1d1b050719f742ca0378616d6
04415f666f5e9ccc0ca724becf2e0557e7ad4792
/Kaggle_Project/Plankton/src/com/plankton/RGBFrame.java
0345b5f1645d01eebf551db51fc27bf178e81937
[]
no_license
vigneshwarrvenkat/Big-data-Project1
036991bcc12b730c1a9d0f3054e9863a96f01daa
23d18d4fe23746b1fb4270f192de081374a83f6c
refs/heads/master
2021-01-15T23:51:26.126510
2016-06-13T20:47:17
2016-06-13T20:47:17
42,652,324
0
0
null
null
null
null
UTF-8
Java
false
false
2,181
java
package com.plankton; //Blob Finder Demo //A.Greensted //http://www.labbookpages.co.uk //Please use however you like. I'd be happy to hear any feedback or comments. import java.awt.*; import javax.swing.*; import java.awt.image.*; import java.awt.color.*; public class RGBFrame extends JComponent { private int width; private int height; private Dimension size; private byte[] data; private PixelInterleavedSampleModel sampleModel; private DataBufferByte dataBuffer; private WritableRaster raster; private ColorModel colourModel; private BufferedImage image; private Graphics2D graphics; private int[] colOrder = null; private String title; public RGBFrame(int width, int height, byte[] data) { this(width, height, data, null, new int[] {2,1,0}); } public RGBFrame(int width, int height, byte[] data, String title) { this(width, height, data, title, new int[] {2,1,0}); } public RGBFrame(int width, int height, byte[] data, int[] colOrder) { this(width, height, data, null, colOrder); } public RGBFrame(int width, int height, byte[] data, String title, int[] colOrder) { this.width = width; this.height = height; this.data = data; this.title = title; this.colOrder = colOrder; size = new Dimension(width, height); dataBuffer = new DataBufferByte(data, data.length); sampleModel = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, width, height, 3, 3*width, colOrder); ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); colourModel = new ComponentColorModel(cs, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); raster = Raster.createWritableRaster(sampleModel, dataBuffer, new Point(0,0)); image = new BufferedImage(colourModel, raster, false, null); } public Graphics2D getBufferImageGraphics() { if (graphics == null) graphics = image.createGraphics(); return graphics; } public Dimension getSize() { return size; } public Dimension getPreferredSize() { return size; } public void paintComponent(Graphics g) { if (image != null) g.drawImage(image, 0, 0, this); if (title != null) { g.setColor(Color.RED); g.drawString(title, 5, height - 5); } } }
[ "vigneshwarrv88@gmail.com" ]
vigneshwarrv88@gmail.com
da8676646dd43db9c89631fe4654193554289117
052c33482f6576d9574939e977cd029109b6782f
/week3/Point.java
ddfb2e5b88923edfbeaba9163a3dc7d49d8e59d4
[]
no_license
drykiss0/algo1
5899432c915e21e6482e691da249a8fca1275e3e
a2c98c6ec2ad233e0dddd0961c12b6a16c938285
refs/heads/master
2020-04-29T13:49:09.414243
2019-04-22T23:19:50
2019-04-22T23:19:50
176,179,326
1
0
null
null
null
null
UTF-8
Java
false
false
4,337
java
/****************************************************************************** * Compilation: javac Point.java * Execution: java Point * Dependencies: none * * An immutable data type for points in the plane. * For use on Coursera, Algorithms Part I programming assignment. * ******************************************************************************/ import java.util.Comparator; import edu.princeton.cs.algs4.StdDraw; import edu.princeton.cs.algs4.StdOut; public class Point implements Comparable<Point> { private final int x; // x-coordinate of this point private final int y; // y-coordinate of this point public int getX() { return x; } public int getY() { return y; } /** * Initializes a new point. * * @param x the <em>x</em>-coordinate of the point * @param y the <em>y</em>-coordinate of the point */ public Point(int x, int y) { /* DO NOT MODIFY */ this.x = x; this.y = y; } /** * Draws this point to standard draw. */ public void draw() { /* DO NOT MODIFY */ StdDraw.point(x, y); } /** * Draws the line segment between this point and the specified point * to standard draw. * * @param that the other point */ public void drawTo(Point that) { /* DO NOT MODIFY */ StdDraw.line(this.x, this.y, that.x, that.y); } /** * Returns the slope between this point and the specified point. * Formally, if the two points are (x0, y0) and (x1, y1), then the slope * is (y1 - y0) / (x1 - x0). For completeness, the slope is defined to be * +0.0 if the line segment connecting the two points is horizontal; * Double.POSITIVE_INFINITY if the line segment is vertical; * and Double.NEGATIVE_INFINITY if (x0, y0) and (x1, y1) are equal. * * @param that the other point * @return the slope between this point and the specified point */ public double slopeTo(Point that) { int dy = that.y - this.y; int dx = that.x - this.x; if (compareTo(that) == 0) { return Double.NEGATIVE_INFINITY; } if (dy == 0) { return 0; } if (dx == 0) { return Double.POSITIVE_INFINITY; } return (double)dy / dx; } /** * Compares two points by y-coordinate, breaking ties by x-coordinate. * Formally, the invoking point (x0, y0) is less than the argument point * (x1, y1) if and only if either y0 < y1 or if y0 = y1 and x0 < x1. * * @param that the other point * @return the value <tt>0</tt> if this point is equal to the argument * point (x0 = x1 and y0 = y1); * a negative integer if this point is less than the argument * point; and a positive integer if this point is greater than the * argument point */ public int compareTo(Point that) { int sign = (int) Math.signum(this.y - that.y); if (sign == 0) { sign = (int) Math.signum(this.x - that.x); } return sign; } /** * Compares two points by the slope they make with this point. * The slope is defined as in the slopeTo() method. * * @return the Comparator that defines this ordering on points */ public Comparator<Point> slopeOrder() { return (p1, p2) -> (int) Math.signum(slopeTo(p1) - slopeTo(p2)); } /** * Returns a string representation of this point. * This method is provide for debugging; * your program should not rely on the format of the string representation. * * @return a string representation of this point */ public String toString() { /* DO NOT MODIFY */ return "(" + x + ", " + y + ")"; } /** * Unit tests the Point data type. */ public static void main(String[] args) { Point p0 = new Point(0, 0); Point p1 = new Point(0, 1); Point p2 = new Point(0, 2); StdOut.println(p1 + ", " + p2); StdOut.println("Slope p0->p1 = " + p0.slopeTo(p1)); StdOut.println("Slope p0->p2 = " + p0.slopeTo(p2)); StdOut.println("Comparator: " + p0.slopeOrder().compare(p0, p1)); } }
[ "noreply@github.com" ]
drykiss0.noreply@github.com
8f8f0e7e5b85ec77d04f6eb82317fe6e96346ace
b34e4fca48c4821af8dd04196176572ee8cda29d
/util/src/main/java/com/zaze/utils/task/executor/MyThreadPoolExecutor.java
2253885f0aaaa822eb290fb1eae2f346e11438a5
[]
no_license
zaze359/test
01be8c8c2d441d55696fe7246ef45060336c2bca
1d297939734b26a8ab7df9a2edc9c7a1b0f51699
refs/heads/master
2023-08-31T06:32:20.574460
2023-08-28T16:24:14
2023-08-28T16:24:14
56,709,795
4
0
null
null
null
null
UTF-8
Java
false
false
2,207
java
package com.zaze.utils.task.executor; import java.util.concurrent.BlockingQueue; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Description : * * @author : ZAZE * @version : 2018-02-01 - 09:17 */ public class MyThreadPoolExecutor extends ThreadPoolExecutor { private int executeNum = 0; public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue); } public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory); } public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler); } public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler); } @Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); executeNum--; } @Override protected void beforeExecute(Thread t, Runnable r) { super.beforeExecute(t, r); executeNum++; } @Override public void setMaximumPoolSize(int maximumPoolSize) { super.setMaximumPoolSize(maximumPoolSize); } @Override public void setCorePoolSize(int corePoolSize) { super.setCorePoolSize(corePoolSize); } public int getExecuteNum() { return executeNum; } public void setExecuteNum(int executeNum) { this.executeNum = executeNum; } }
[ "359635919@qq.com" ]
359635919@qq.com
0527b2d3394a7d2001bb148f135687b23a18dddd
f45dec3f6a6fc5d7fbae9618861653bcd7e6b742
/src/main/java/us/ihmc/mecano/spatial/interfaces/SpatialAccelerationReadOnly.java
726689a2f3b8af8ad9fdf01d654e7c84c17062b2
[ "Apache-2.0" ]
permissive
madhephaestus/mecano
f0c854d712db73092be784b69207de8764d4fc12
9397481bdc5e8c529369420915594e2b666dc754
refs/heads/master
2020-12-03T18:16:47.071092
2020-01-02T17:15:15
2020-01-02T17:15:15
231,426,446
0
0
Apache-2.0
2020-01-02T17:14:23
2020-01-02T17:14:22
null
UTF-8
Java
false
false
10,111
java
package us.ihmc.mecano.spatial.interfaces; import us.ihmc.euclid.referenceFrame.exceptions.ReferenceFrameMismatchException; import us.ihmc.euclid.referenceFrame.interfaces.FramePoint3DReadOnly; import us.ihmc.euclid.referenceFrame.interfaces.FrameVector3DBasics; import us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly; import us.ihmc.mecano.tools.MecanoTools; /** * Read-only interface for a spatial acceleration. * <p> * A spatial acceleration is a vector composed of 6 components with an angular part and a linear * part. It represents the time derivative of a twist. The angular part represents a 3D angular * acceleration and the linear part a 3D linear acceleration. * </p> * <p> * A spatial acceleration always describes the relative velocity of a body with respect to a base. * These two entities are referred to here by using two reference frames: a {@code bodyFrame} that * is considered to be rigidly attached to the body, and a {@code baseFrame} that is considered to * be rigidly attached to the base. * </p> * <p> * When using a {@code SpatialAccelerationVectorReadOnly}, it is important to note that the * reference frame in which it is expressed does not only refer to the coordinate system in which * the angular and linear 3D vectors are expressed. The origin of the reference frame is also used * as the point where the acceleration is measured. While the angular part remains the same as the * point of measurement changes, the linear part does depend on its location. * </p> * <p> * This framework for representing in an accurate and safe manner spatial accelerations is based on * the Ph.D. thesis of Vincent Duindam entitled <i>"Port-Based Modeling and Control for Efficient * Bipedal Walking Robots"</i>. Duindam's publications can be found * <a href="http://sites.google.com/site/vincentduindam/publications">here</a>. Several references * to this work are spread throughout the code. * </p> * <p> * The convention when using a spatial vector in matrix operations is that the angular part occupies * the 3 first rows and the linear part the 3 last as follows:<br> * * <pre> * / angularX \ * | angularY | * | angularZ | * V = | linearX | * | linearY | * \ linearX / * </pre> * </p> * * @author Twan Koolen * @author Sylvain Bertrand */ public interface SpatialAccelerationReadOnly extends SpatialMotionReadOnly { /** * Calculates the linear acceleration of a body-fixed point {@code bodyFixedPoint} perceived from * the base frame. * <p> * The "perceived from the base frame" means that the body-fixed point is observed from the base, * such that Coriolis acceleration resulting from the body velocity with respect to the base is * considered. * </p> * <p> * Effectively, the resulting linear acceleration &alpha;<sub>result</sub> is calculated as follows: * * <pre> * &alpha;<sub>result</sub> = &alpha;<sub>this</sub> + &omega;'<sub>this</sub> &times; P + &omega;<sub>twist</sub> &times; ((&omega;<sub>twist</sub> &times; P) + &nu;<sub>twist</sub>) * </pre> * * where &alpha;<sub>this</sub> and &omega;'<sub>this</sub> represent the angular and linear parts * of this spatial acceleration, &omega;<sub>twist</sub> and &nu;<sub>twist</sub> represent the * angular and linear parts of the body twist, and {@code P} is the {@code bodyFixedPoint}. * </p> * * @param bodyTwist the twist of {@code this.bodyFrame} with respect to * {@code this.baseFrame} and expressed in * {@code this.expressedInFrame}. Not modified. * @param bodyFixedPoint the position on the body where the linear acceleration is to be * estimated. Not modified. * @param linearAccelerationToPack the vector used to store the result. Modified. * @throws ReferenceFrameMismatchException if the {@code bodyTwist} does not have the same reference * frames as {@code this}, if the {@code bodyFixedPoint} is * not expressed in the same reference frame as * {@code this}, or if this spatial acceleration is not * expressed in either the body frame of the base frame. */ default void getLinearAccelerationAt(TwistReadOnly bodyTwist, FramePoint3DReadOnly bodyFixedPoint, FrameVector3DBasics linearAccelerationToPack) { /* * Without this check, the "expressed-in-frame" could possibly be moving with respect to both the * base and the body. In such context, this acceleration would consider additional acceleration * induced by the motion of the "expressed-in-frame" itself which is undesirable here. */ if (getReferenceFrame() != getBodyFrame() && getReferenceFrame() != getBaseFrame()) throw new ReferenceFrameMismatchException("This spatial acceleration has to either be expressed in base frame or body frame to use this feature: body frame = " + getBodyFrame() + ", base frame = " + getBaseFrame() + ", expressed in frame = " + getReferenceFrame()); /* * A spatial acceleration can be changed from being expressed in the base frame to being expressed * in the body frame and vice versa without considering the twist between the two. Indeed when * looking at the equations provided in SpatialAccelerationVectorBasics.changeFrame(ReferenceFrame, * Twist, Twist), the bias acceleration generated by the velocity becomes zero in such condition. * Knowing that, there is no need to enforce a particular frame between the base frame and the body * frame, the resulting acceleration will be correct, just with components expressed in a different * coordinate system. */ checkExpressedInFrameMatch(bodyFixedPoint.getReferenceFrame()); checkReferenceFrameMatch(bodyTwist); linearAccelerationToPack.setIncludingFrame(bodyTwist.getLinearPart()); // v MecanoTools.addCrossToVector(bodyTwist.getAngularPart(), bodyFixedPoint, linearAccelerationToPack); // (w x p) + v linearAccelerationToPack.cross(bodyTwist.getAngularPart(), linearAccelerationToPack); // w x ((w x p) + v) MecanoTools.addCrossToVector(getAngularPart(), bodyFixedPoint, linearAccelerationToPack); // (wDot x p) + w x ((w x p) + v) linearAccelerationToPack.add(getLinearPart()); // vDot + (wDot x p) + w x ((w x p) + v) } /** * Calculates the linear acceleration of the body frame's origin perceived from the base frame. * <p> * This method is equivalent to calling * {@link #getLinearAccelerationAt(TwistReadOnly, FramePoint3DReadOnly, FrameVector3DBasics)} with * the {@code bodyfixedPoint} being zero. So effectively, the linear acceleration * &alpha;<sub>result</sub> is calculated as follows: * * <pre> * &alpha;<sub>result</sub> = &alpha;<sub>this</sub> + &omega;<sub>twist</sub> &times; &nu;<sub>twist</sub> * </pre> * * where &alpha;<sub>this</sub> represents the linear part of this spatial acceleration, * &omega;<sub>twist</sub> and &nu;<sub>twist</sub> represent the angular and linear parts of the * body twist. * </p> * * @param bodyTwist the twist of {@code this.bodyFrame} with respect to * {@code this.baseFrame} and expressed in * {@code this.expressedInFrame}. Not modified. * @param linearAccelerationToPack the vector used to store the result. Modified. * @throws ReferenceFrameMismatchException if the {@code bodyTwist} does not have the same reference * frames as {@code this}, or if this spatial acceleration * is not expressed in the body frame. */ default void getLinearAccelerationAtBodyOrigin(TwistReadOnly bodyTwist, FrameVector3DBasics linearAccelerationToPack) { getBodyFrame().checkReferenceFrameMatch(getReferenceFrame()); checkReferenceFrameMatch(bodyTwist); linearAccelerationToPack.setIncludingFrame(getLinearPart()); MecanoTools.addCrossToVector(bodyTwist.getAngularPart(), bodyTwist.getLinearPart(), linearAccelerationToPack); } /** * Tests if {@code this} and {@code other} represent the same spatial acceleration to an * {@code epsilon}. * <p> * It is likely that the implementation of this method will change in the future as the definition * of "geometrically-equal" for spatial accelerations might evolve. In the meantime, the current * assumption is that two spatial accelerations are geometrically equal if both their 3D angular and * 3D linear accelerations are independently geometrically equal, see * {@link Vector3DReadOnly#geometricallyEquals(Vector3DReadOnly, double)}. * </p> * <p> * Note that {@code this.geometricallyEquals(other, epsilon) == true} does not necessarily imply * {@code this.epsilonEquals(other, epsilon)} and vice versa. * </p> * * @param other the other spatial acceleration to compare against this. Not modified. * @param epsilon the tolerance to use for the comparison. * @return {@code true} if the two spatial accelerations represent the same physical quantity, * {@code false} otherwise. * @throws ReferenceFrameMismatchException if the reference frames of {@code other} do not * respectively match the reference frames of {@code this}. */ default boolean geometricallyEquals(SpatialAccelerationReadOnly other, double epsilon) { checkReferenceFrameMatch(other); if (!getAngularPart().geometricallyEquals(other.getAngularPart(), epsilon)) return false; if (!getLinearPart().geometricallyEquals(other.getLinearPart(), epsilon)) return false; return true; } }
[ "sbertrand@ihmc.us" ]
sbertrand@ihmc.us
ad502a1c74d8f94dcd4aa93aab338a94ff790d70
4211df9765e835faa88bda360531ea4f60a7efce
/src/main/java/com/supermy/curator/CuratorUtil.java
10ecabd94bb4d05d2687b0b28e45155acc474259
[]
no_license
supermy/spring_engines_template
9d67e307d8d3061eaa9cbc8fefc525810e257209
94a34c72996929e43bb491d517a6b7f46992939c
refs/heads/master
2021-01-22T08:48:56.338213
2015-05-25T11:28:25
2015-05-25T11:28:25
28,484,517
0
0
null
null
null
null
UTF-8
Java
false
false
10,944
java
package com.supermy.curator; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.common.base.Objects; import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.io.Charsets; import org.apache.curator.RetryPolicy; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.api.CuratorWatcher; import org.apache.curator.framework.api.GetChildrenBuilder; import org.apache.curator.framework.api.GetDataBuilder; import org.apache.curator.framework.recipes.cache.TreeCache; import org.apache.curator.framework.recipes.cache.TreeCacheEvent; import org.apache.curator.framework.recipes.cache.TreeCacheListener; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.utils.CloseableUtils; import org.apache.curator.utils.ZKPaths; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.data.Stat; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Created by moyong on 15/5/16. */ public class CuratorUtil { private CuratorFramework client; public CuratorUtil(String zkAddress) { client = CuratorFrameworkFactory.newClient(zkAddress, new ExponentialBackoffRetry(1000, 3)); client.getCuratorListenable().addListener(new NodeEventListener()); client.start(); } public CuratorUtil(CuratorFramework client ) { this.client =client; } public CuratorFramework createSimple(String connectionString) { // these are reasonable arguments for the ExponentialBackoffRetry. // The first retry will wait 1 second - the second will wait up to 2 seconds - the // third will wait up to 4 seconds. ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3); // The simplest way to get a CuratorFramework instance. This will use default values. // The only required arguments are the connection string and the retry policy return CuratorFrameworkFactory.newClient(connectionString, retryPolicy); } public CuratorFramework createWithOptions(String connectionString, RetryPolicy retryPolicy, int connectionTimeoutMs, int sessionTimeoutMs) { // using the CuratorFrameworkFactory.builder() gives fine grained control // over creation options. See the CuratorFrameworkFactory.Builder javadoc details return CuratorFrameworkFactory.builder().connectString(connectionString) .retryPolicy(retryPolicy) .connectionTimeoutMs(connectionTimeoutMs) .sessionTimeoutMs(sessionTimeoutMs) // etc. etc. .build(); } /** * 遍历JsonTree * * @param json */ public void decodeJSONObject(JSONObject json, String path) throws Exception { Iterator<String> keys = json.keySet().iterator(); JSONObject jo = null; Object o; String key; while (keys.hasNext()) { key = keys.next(); o = json.get(key); // System.out.println(o.getClass()); if (o instanceof JSONObject) { jo = (JSONObject) o; if (jo.keySet().size() > 0) { decodeJSONObject(jo, path + key); } else { System.out.println("key:" + key); } } else { if (o instanceof JSONArray) { JSONArray jsa = (JSONArray) o; for (int i = 0; i < jsa.size(); i++) { JSONObject jo2 = jsa.getJSONObject(i); decodeJSONObject( jo2, path + key); } } else if (path.endsWith("/")) { client.create().creatingParentsIfNeeded().forPath(path + key, o.toString().getBytes()); System.out.println(" path:" + path + key + " value:" + o); } else { client.create().creatingParentsIfNeeded().forPath(path + "/" + key, o.toString().getBytes()); System.out.println(" path:" + path + "/" + key + " value:" + o); } } } } /** * 创建node * * @param nodeName * @param value * @return */ public boolean createNode(String nodeName, String value) { boolean suc = false; try { Stat stat = getClient().checkExists().forPath(nodeName); if (stat == null) { String opResult = null; if (Strings.isNullOrEmpty(value)) { opResult = getClient().create().creatingParentsIfNeeded().forPath(nodeName); // client.create()//创建一个路径 // .creatingParentsIfNeeded()//如果指定的节点的父节点不存在,递归创建父节点 // .withMode(CreateMode.PERSISTENT)//存储类型(临时的还是持久的) // .withACL(ZooDefs.Ids.OPEN_ACL_UNSAFE)//访问权限 // .forPath("/zk/test", "123".getBytes());//创建的路径 } else { opResult = getClient().create().creatingParentsIfNeeded() .forPath(nodeName, value.getBytes(Charsets.UTF_8)); } suc = Objects.equal(nodeName, opResult); } } catch (Exception e) { e.printStackTrace(); } return suc; } /** * 更新节点 * * @param nodeName * @param value * @return */ public boolean updateNode(String nodeName, String value) { boolean suc = false; try { Stat stat = getClient().checkExists().forPath(nodeName); if (stat != null) { Stat opResult = getClient().setData().forPath(nodeName, value.getBytes(Charsets.UTF_8)); suc = opResult != null; } } catch (Exception e) { e.printStackTrace(); } return suc; } /** * 删除节点 * * @param nodeName */ public void deleteNode(String nodeName) { try { getClient().delete().deletingChildrenIfNeeded().forPath(nodeName); } catch (Exception e) { e.printStackTrace(); } } /** * 找到指定节点下所有子节点的名称与值 * * @param node * @return */ public Map<String, String> listChildrenDetail(String node) { Map<String, String> map = Maps.newHashMap(); try { GetChildrenBuilder childrenBuilder = getClient().getChildren(); List<String> children = childrenBuilder.forPath(node); GetDataBuilder dataBuilder = getClient().getData(); if (children != null) { for (String child : children) { String propPath = ZKPaths.makePath(node, child); map.put(child, new String(dataBuilder.forPath(propPath), Charsets.UTF_8)); } } } catch (Exception e) { e.printStackTrace(); } return map; } /** * 列出子节点的名称 * * @param node * @return */ public List<String> listChildren(String node) { List<String> children = Lists.newArrayList(); try { GetChildrenBuilder childrenBuilder = getClient().getChildren(); children = childrenBuilder.forPath(node); } catch (Exception e) { e.printStackTrace(); } return children; } /** * 增加监听 * * @param node * @param isSelf * true 为node本身增加监听 false 为node的子节点增加监听 * @throws Exception */ public void addWatch(String node, boolean isSelf) throws Exception { if (isSelf) { getClient().getData().watched().forPath(node); } else { getClient().getChildren().watched().forPath(node); } } /** * * 监控节点下面的所有树叶节点 * * @param node * @throws Exception */ public void addWatchTree(String node) throws Exception { final TreeCache treeCache = new TreeCache(client, node); treeCache.getListenable().addListener(new TreeCacheListener() { @Override public void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception { System.out.println("================== catch tree change =================="); if(event.getData() == null){ System.out.println("===init," + event.getType()); return; } if(event.getData().getData() == null){ System.out.println("===delete," + event.getType() + "," + event.getData().getPath()); }else{ System.out.println("===update or add," + event.getType() + "," + event.getData().getPath() + "," + new String(event.getData().getData())); } } }); treeCache.start(); } /** * 增加监听 * * @param node * @param isSelf * true 为node本身增加监听 false 为node的子节点增加监听 * @param watcher * @throws Exception */ public void addWatch(String node, boolean isSelf, Watcher watcher) throws Exception { if (isSelf) { getClient().getData().usingWatcher(watcher).forPath(node); } else { getClient().getChildren().usingWatcher(watcher).forPath(node); } } /** * 增加监听 * * @param node * @param isSelf * true 为node本身增加监听 false 为node的子节点增加监听 * @param watcher * @throws Exception */ public void addWatch(String node, boolean isSelf, CuratorWatcher watcher) throws Exception { if (isSelf) { getClient().getData().usingWatcher(watcher).forPath(node); } else { getClient().getChildren().usingWatcher(watcher).forPath(node); } } /** * 销毁资源 */ public void destory() { if (client != null) { //client.close(); CloseableUtils.closeQuietly(client); } } /** * 获取client * * * @return */ public CuratorFramework getClient() { return client; } }
[ "springclick@gmail.com" ]
springclick@gmail.com
b9fbfe14c3325dfbcedddba3f68825784568a58a
f13fe5d482e0970ec51eb12c1db6270291365fac
/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigTests.java
13f277ade9957f2caecabad7429b388389e517c6
[ "Apache-2.0", "LicenseRef-scancode-elastic-license-2018", "LicenseRef-scancode-other-permissive" ]
permissive
seanmcrw/elasticsearch
e8633f8d72c1895ce0349cc73eb7f0cb29932ec9
9621c1a796c2f7747479eb912f1435d84686ffd9
refs/heads/master
2020-07-30T19:28:17.456445
2019-09-24T09:27:58
2019-09-24T09:27:58
191,790,339
0
0
Apache-2.0
2019-06-13T15:38:46
2019-06-13T15:38:46
null
UTF-8
Java
false
false
4,034
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Predicate; import static org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsSourceTests.randomSourceConfig; import static org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsDestTests.randomDestConfig; import static org.elasticsearch.client.ml.dataframe.OutlierDetectionTests.randomOutlierDetection; public class DataFrameAnalyticsConfigTests extends AbstractXContentTestCase<DataFrameAnalyticsConfig> { public static DataFrameAnalyticsConfig randomDataFrameAnalyticsConfig() { DataFrameAnalyticsConfig.Builder builder = DataFrameAnalyticsConfig.builder() .setId(randomAlphaOfLengthBetween(1, 10)) .setSource(randomSourceConfig()) .setDest(randomDestConfig()) .setAnalysis(randomOutlierDetection()); if (randomBoolean()) { builder.setDescription(randomAlphaOfLength(20)); } if (randomBoolean()) { builder.setAnalyzedFields(new FetchSourceContext(true, generateRandomStringArray(10, 10, false, false), generateRandomStringArray(10, 10, false, false))); } if (randomBoolean()) { builder.setModelMemoryLimit(new ByteSizeValue(randomIntBetween(1, 16), randomFrom(ByteSizeUnit.MB, ByteSizeUnit.GB))); } if (randomBoolean()) { builder.setCreateTime(Instant.now()); } if (randomBoolean()) { builder.setVersion(Version.CURRENT); } return builder.build(); } @Override protected DataFrameAnalyticsConfig createTestInstance() { return randomDataFrameAnalyticsConfig(); } @Override protected DataFrameAnalyticsConfig doParseInstance(XContentParser parser) throws IOException { return DataFrameAnalyticsConfig.fromXContent(parser); } @Override protected boolean supportsUnknownFields() { return true; } @Override protected Predicate<String> getRandomFieldsExcludeFilter() { // allow unknown fields in the root of the object only return field -> !field.isEmpty(); } @Override protected NamedXContentRegistry xContentRegistry() { List<NamedXContentRegistry.Entry> namedXContent = new ArrayList<>(); namedXContent.addAll(new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents()); namedXContent.addAll(new MlDataFrameAnalysisNamedXContentProvider().getNamedXContentParsers()); return new NamedXContentRegistry(namedXContent); } }
[ "noreply@github.com" ]
seanmcrw.noreply@github.com
7e15462de6730e5da3621546b9d4e69a8928338e
d67d0ce5a5aca7593b81d9b614f456b002c0183b
/src/main/java/org/apache/commons/configuration2/io/ConfigurationLogger.java
ea5c9f3660f2315eb1955aa267e4df531f810a00
[]
no_license
royyoung388/apach-commons-test
1927dc866d84969105974e89d01e26d703387dbe
c515edaa95db682e5a872d1c29c7837698dbf6eb
refs/heads/master
2020-05-17T18:38:04.109414
2019-04-28T11:15:33
2019-04-28T11:15:33
183,889,578
0
0
null
null
null
null
UTF-8
Java
false
false
7,459
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 org.apache.commons.configuration2.io; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.NoOpLog; /** * <p> * A class providing basic logging capabilities. * </p> * <p> * When reading configuration files in complex scenarios having log output is * useful for diagnostic purposes. Therefore, <em>Commons Configuration</em> * produces some logging output. As concrete projects have different * requirements on the amount and detail of logging, there is a way of * configuring logging: All classes derived from * {@link org.apache.commons.configuration2.AbstractConfiguration} * can be assigned a logger which is then used for all log statements generated. * </p> * <p> * Allowing a logger object to be passed to a configuration creates a direct * dependency to a concrete logging framework in the configuration API. This * would make it impossible to switch to an alternative logging framework * without breaking backwards compatibility. To avoid this, the * {@code ConfigurationLogger} class is introduced. It is a minimum abstraction * over a logging framework offering only very basic logging capabilities. The * methods defined in this class are used by configuration implementations to * produce their logging statements. Client applications can create specialized * instances and pass them to configuration objects without having to deal with * a concrete logging framework. It is even possible to create a subclass that * uses a completely different logging framework. * </p> * * @version $Id: ConfigurationLogger.java 1842194 2018-09-27 22:24:23Z ggregory $ * @since 2.0 */ public class ConfigurationLogger { /** The internal logger. */ private final Log log; /** * Creates a new instance of {@code ConfigurationLogger} that uses the * specified logger name. * * @param loggerName the logger name (must not be <b>null</b>) * @throws IllegalArgumentException if the logger name is <b>null</b> */ public ConfigurationLogger(final String loggerName) { this(createLoggerForName(loggerName)); } /** * Creates a new instance of {@code ConfigurationLogger} that uses a logger * whose name is derived from the provided class. * * @param logCls the class whose name is to be used for logging (must not be * <b>null</b>) * @throws IllegalArgumentException if the logger class is <b>null</b> */ public ConfigurationLogger(final Class<?> logCls) { this(createLoggerForClass(logCls)); } /** * Creates a new, uninitialized instance of {@code ConfigurationLogger}. * This constructor can be used by derived classes that implement their own * specific logging mechanism. Such classes must override all methods * because the default implementations do not work in this uninitialized * state. */ protected ConfigurationLogger() { this((Log) null); } /** * Creates a new instance of {@code ConfigurationLogger} which wraps the * specified logger. * * @param wrapped the logger to be wrapped */ ConfigurationLogger(final Log wrapped) { log = wrapped; } /** * Creates a new dummy logger which produces no output. If such a logger is * passed to a configuration object, logging is effectively disabled. * * @return the new dummy logger */ public static ConfigurationLogger newDummyLogger() { return new ConfigurationLogger(new NoOpLog()); } /** * Returns a flag whether logging on debug level is enabled. * * @return <b>true</b> if debug logging is enabled, <b>false</b> otherwise */ public boolean isDebugEnabled() { return getLog().isDebugEnabled(); } /** * Logs the specified message on debug level. * * @param msg the message to be logged */ public void debug(final String msg) { getLog().debug(msg); } /** * Returns a flag whether logging on info level is enabled. * * @return <b>true</b> if debug logging is enabled, <b>false</b> otherwise */ public boolean isInfoEnabled() { return getLog().isInfoEnabled(); } /** * Logs the specified message on info level. * * @param msg the message to be logged */ public void info(final String msg) { getLog().info(msg); } /** * Logs the specified message on warn level. * * @param msg the message to be logged */ public void warn(final String msg) { getLog().warn(msg); } /** * Logs the specified exception on warn level. * * @param msg the message to be logged * @param ex the exception to be logged */ public void warn(final String msg, final Throwable ex) { getLog().warn(msg, ex); } /** * Logs the specified message on error level. * * @param msg the message to be logged */ public void error(final String msg) { getLog().error(msg); } /** * Logs the specified exception on error level. * * @param msg the message to be logged * @param ex the exception to be logged */ public void error(final String msg, final Throwable ex) { getLog().error(msg, ex); } /** * Returns the internal logger. * * @return the internal logger */ Log getLog() { return log; } /** * Creates an internal logger for the given name. Throws an exception if the * name is undefined. * * @param name the name of the logger * @return the logger object * @throws IllegalArgumentException if the logger name is undefined */ private static Log createLoggerForName(final String name) { if (name == null) { throw new IllegalArgumentException("Logger name must not be null!"); } return LogFactory.getLog(name); } /** * Creates an internal logger for the given class. Throws an exception if * the class is undefined. * * @param cls the logger class * @return the logger object * @throws IllegalArgumentException if the logger class is undefined */ private static Log createLoggerForClass(final Class<?> cls) { if (cls == null) { throw new IllegalArgumentException( "Logger class must not be null!"); } return LogFactory.getLog(cls); } }
[ "976611019@qq.com" ]
976611019@qq.com
9a613b5e842ef34f9982524d637f7b9da492d4ea
8f27ccfcce993a229cfeda4a224121478cd4569c
/designMode/src/cn/designMode/demo/controller/UserState.java
27b8238e14623c8ae06d3388f5248329a923a6a1
[]
no_license
caozhiyang123/JavaStudy
033b23d3a30d44056d8abfba8814b87f7a8cd191
d66604e639658b38b133dc1f687e317699817896
refs/heads/master
2020-05-13T19:36:48.391848
2019-04-17T09:52:23
2019-04-17T09:52:23
181,654,038
0
0
null
null
null
null
UTF-8
Java
false
false
74
java
package cn.designMode.demo.controller; public class UserState { }
[ "1250233433@qq.com" ]
1250233433@qq.com
804433fa4f503c641057c06e7bfaa96ab1bd8995
b64e05efdb0cbe1f998466c4a63926e4fb951df2
/src/main/java/tommy/spring/exam02/HelloSpring.java
ce81b756b54be685b3c43c24a9198db05472775a
[]
no_license
asd4919/four
e676dd8f9d252c849ceea120ac370b5726904cc7
3b2c165a466531f77f0f00c1a482080d8e16624b
refs/heads/main
2023-08-22T16:11:27.390967
2021-10-10T06:33:25
2021-10-10T06:33:25
415,489,135
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package tommy.spring.exam02; public class HelloSpring { public static void main(String[] args) { MyBean bean = new MyBeanOne(); bean.sayHello("Spring"); } }
[ "asd4919@hanmail.net" ]
asd4919@hanmail.net
023dea792b594974b16a8b50cda63dfd2d3fbeee
fa90d92dabae851b49f5e22746de144171719755
/cogTraining/src/com/lumosity/model/Order.java
5e0080683481dbea5dc576d048cda1ed6daccb42
[]
no_license
tobyqqc/Cog_Project
fed48656b8b6e788b1c4fb514ccd90b03e93ba69
a834ce9efd5abc92724d285b5e0f44387602b12b
refs/heads/master
2020-04-18T05:39:34.313402
2019-01-24T02:14:02
2019-01-24T02:14:02
167,286,854
0
0
null
null
null
null
UTF-8
Java
false
false
7,314
java
package com.lumosity.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import org.apache.commons.lang3.StringUtils; import com.jfinal.plugin.activerecord.ActiveRecordException; import com.jfinal.plugin.activerecord.Db; import com.jfinal.plugin.activerecord.Page; import com.jfinal.plugin.activerecord.Record; import com.lumosity.model.base.BaseOrder; import com.lumosity.utils.DateTimeKit; /** * Generated by JFinal. */ @SuppressWarnings("serial") public class Order extends BaseOrder<Order> { public static final Order dao = new Order(); public void saveOrder(String orderNo, Long userId, BigDecimal price, String payType, String gameClassIds, Integer gameDate, String trainClassOrderNo) { if (StringUtils.isNotBlank(gameClassIds)) { String[] gameClassIdss = gameClassIds.split(","); for (String gameClassId : gameClassIdss) { saveOrder(orderNo, userId, price, payType, Integer.parseInt(gameClassId), gameDate, trainClassOrderNo); } } } public void saveOrder(String orderNo, Long userId, BigDecimal price, String payType, Integer gameClassId, Integer gameDate, String trainClassOrderNo) { Order order = new Order(); order.setOrderNo(orderNo); order.setUserId(userId); order.setPayTime(new Date()); order.setPayPrice(price); order.setPayType(payType); order.setGameClassId(gameClassId); order.setTrainClassOrderNo(trainClassOrderNo); // Record gameDateDate = GameClass.dao.findDictDateById(gameDate); // String valueStr = gameDateDate.getStr("value"); long expireTime = findExpireTimeByUserIdAndGameClassId(userId, gameClassId); expireTime = DateTimeKit.addDay(new Date(expireTime), (gameDate)).getTime(); order.setExpireTime(expireTime); order.save(); } /** * 支付成功修改订单状态 * * @param orderNo */ public void successOrder(String orderNo) { List<Order> orders = find("select * from `order` where trainClassOrderNo = ?", orderNo); for (Order order : orders) { if (order.getStatus() == 0) { order.setStatus(1); order.update(); } } } /** * 根据用户ID和小类ID查询该小类的截止时间 * * @param userId * @param gameClassId * @return */ public long findExpireTimeByUserIdAndGameClassId(long userId, int gameClassId) { String sql = " SELECT MAX(o.`expireTime`) expireTime FROM " + " `order` o WHERE o.`userId` = ? AND o.`gameClassId` = ? AND o.`status` = 1 "; Order order = findFirst(sql, userId, gameClassId); Long exprieTime = order == null ? null : order.getExpireTime(); return exprieTime == null || exprieTime < System.currentTimeMillis() ? System.currentTimeMillis() : exprieTime; } /** * 根据用户ID和trainClassId查询该小类的截止时间 * * @param userId * @param gameClassId * @return */ public long findExpireTimeByUserIdAndTrainClassId(long userId, int trainClassId) { String sql = "SELECT MAX(o.`expireTime`) expireTime FROM `order` o WHERE o.`userId` = ? AND o.`status` = 1"; Order order = findFirst(sql, userId); Long exprieTime = (order == null? null : order.getExpireTime()); return exprieTime == null ? System.currentTimeMillis() : exprieTime; } /** * 查询用户每个游戏小类的充值截止时间 * * @param userId * @return */ public List<Record> findTopupGameClassByUserId(Long userId) { String sql = " SELECT MAX(o.`expireTime`) expireTime,gc.`gameClassId`,gc.`gameClassName` FROM `order` o " + " LEFT JOIN game_class gc ON o.`gameClassId` = gc.`gameClassId` " + " WHERE o.`userId` = ? and o.`status` = 1 " + " GROUP BY o.`gameClassId`"; return Db.find(sql, userId); } /** * 查询用户每个游戏小类的充值截止时间 * * @param userId * @return */ public Record findTopupTrainClassByUserId(Long userId) { String sql = "SELECT MAX(o.`expireTime`) expireTime FROM `order` o WHERE o.`userId` = ? AND o.status = 1"; return Db.findFirst(sql, userId); } public Page<Record> page(long userId, int pageNumber, int pageSize) { String sql = " SELECT o.`orderId`,o.`orderNo`,o.`payTime`,o.`payType`,o.`status`, o.`payPrice`, '认知训练' as gameClassName" + " FROM `order` o " + " WHERE o.`userId` = " + userId + " GROUP BY o.`trainClassOrderNo` " + " ORDER BY o.`payTime` DESC "; return page(sql, pageNumber, pageSize); } public Page<Record> page(String sql, int pageNumber, int pageSize) { List<Object> outConditionValues = new ArrayList<Object>(); if (pageNumber < 1 || pageSize < 1) { throw new ActiveRecordException("pageNumber and pageSize must more than 0"); } String totalRowSql = sql; List result = Db.query(totalRowSql); int size = result.size(); Boolean isGroupBySql = null; if (isGroupBySql == null) { isGroupBySql = size > 1; } long totalRow; // if (isGroupBySql) { // totalRow = size; // } else { // totalRow = (size > 0) ? ((Number) result.get(0)).longValue() : 0; // } totalRow = size; if (totalRow == 0) { return new Page<Record>(new ArrayList<Record>(0), pageNumber, pageSize, 0, 0); } int totalPage = (int) (totalRow / pageSize); if (totalRow % pageSize != 0) { totalPage++; } if (pageNumber > totalPage) { return new Page<Record>(new ArrayList<Record>(0), pageNumber, pageSize, totalPage, (int) totalRow); } // -------- sql = forPaginate(pageNumber, pageSize, sql); System.out.println("sql:" + sql); List<Record> list = Db.find(sql, outConditionValues.toArray()); return new Page<Record>(list, pageNumber, pageSize, totalPage, (int) totalRow); } public String forPaginate(int pageNumber, int pageSize, String select) { int offset = pageSize * (pageNumber - 1); StringBuilder ret = new StringBuilder(); ret.append(select); ret.append(" limit ").append(offset).append(", ").append(pageSize); // limit can use one or two '?' to pass paras return ret.toString(); } public boolean checkStatus(String orderNo) { String sql = "select * from `order` where trainClassOrderNo = ? order by expireTime desc"; Order order = findFirst(sql, orderNo); if (order == null || order.getStatus() == 0) { System.out.println("order is null"); return false; } else { System.out.println("order statis is :" + order.getStatus()); return true; } } /** * 分配试用订单 * @param orderNo * @param userId * @param gameClassId * @param gameDate * @param trainClassOrderNo * @return */ public boolean saveAllotOrder(String orderNo, Long userId, Integer gameClassId, Integer gameDate, String trainClassOrderNo){ //分配 支付金额为0 BigDecimal price=new BigDecimal(0); Order order = new Order(); order.setOrderNo(orderNo); order.setUserId(userId); order.setPayTime(new Date()); order.setPayPrice(price); order.setPayType("分配试用"); order.setGameClassId(gameClassId); order.setTrainClassOrderNo(trainClassOrderNo); //支付状态设为成功 order.setStatus(1); long expireTime = findExpireTimeByUserIdAndGameClassId(userId, gameClassId); expireTime = DateTimeKit.addDay(new Date(expireTime), (gameDate)).getTime(); order.setExpireTime(expireTime); //out_expireTime=new Date(expireTime); return order.save(); } }
[ "" ]
81baa727c997d4f0a07b6a5f8a7d9b5951780289
20d14f6ca9c6237be4a72eafefff31a641037e9d
/src/main/java/jan/jakubowski/noteme/database/repositories/RoleRepository.java
f64845fffceb5341ec4364aad51b62fbd427c26e
[]
no_license
g3t0r/note.me-back-end
27befcde615fe9a5e5bc15f93fb9baaefe4e0548
7275c0ceb5923432f24b73c11aaf5238b8576b0c
refs/heads/master
2020-05-09T00:03:29.447562
2020-01-06T00:48:42
2020-01-06T00:48:42
180,973,813
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package jan.jakubowski.noteme.database.repositories; import jan.jakubowski.noteme.database.entities.Role; import org.springframework.data.repository.CrudRepository; import java.util.Optional; public interface RoleRepository extends CrudRepository<Role, Long> { Optional<Role> getOneById(Long id); Optional<Role> getOneByName(String name); }
[ "jan.jakubowski.ti@gmail.com" ]
jan.jakubowski.ti@gmail.com
e61c51c64e4d6cc24d0d3182a10b23ba02b92c6a
274b7d5833e4da6205084f9d5b9b7a23aed9a687
/Application/src/main/java/application/stub/Package.java
8f530d45e965915ae5043d847f9a884df2ede0bd
[]
no_license
nimigeanmihnea/soap-application
807adc7402e83ed293162141a4a6373a73d55aa8
6a5a0ff436e8a4597023cc8c9003ff26fea098dd
refs/heads/master
2021-08-23T22:32:31.299105
2017-12-06T22:07:46
2017-12-06T22:07:46
113,372,167
0
0
null
null
null
null
UTF-8
Java
false
false
6,204
java
package application.stub; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for package complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="package"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="destination" type="{http://service/}user" minOccurs="0"/> * &lt;element name="destinationCity" type="{http://service/}city" minOccurs="0"/> * &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/> * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="route" type="{http://service/}city" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="sender" type="{http://service/}user" minOccurs="0"/> * &lt;element name="senderCity" type="{http://service/}city" minOccurs="0"/> * &lt;element name="tracking" type="{http://www.w3.org/2001/XMLSchema}boolean"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "package", propOrder = { "description", "destination", "destinationCity", "id", "name", "route", "sender", "senderCity", "tracking" }) public class Package { protected String description; protected User destination; protected City destinationCity; protected long id; protected String name; @XmlElement(nillable = true) protected List<City> route; protected User sender; protected City senderCity; protected boolean tracking; /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the destination property. * * @return * possible object is * {@link User } * */ public User getDestination() { return destination; } /** * Sets the value of the destination property. * * @param value * allowed object is * {@link User } * */ public void setDestination(User value) { this.destination = value; } /** * Gets the value of the destinationCity property. * * @return * possible object is * {@link City } * */ public City getDestinationCity() { return destinationCity; } /** * Sets the value of the destinationCity property. * * @param value * allowed object is * {@link City } * */ public void setDestinationCity(City value) { this.destinationCity = value; } /** * Gets the value of the id property. * */ public long getId() { return id; } /** * Sets the value of the id property. * */ public void setId(long value) { this.id = value; } /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the route 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 route property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRoute().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link City } * * */ public List<City> getRoute() { if (route == null) { route = new ArrayList<City>(); } return this.route; } /** * Gets the value of the sender property. * * @return * possible object is * {@link User } * */ public User getSender() { return sender; } /** * Sets the value of the sender property. * * @param value * allowed object is * {@link User } * */ public void setSender(User value) { this.sender = value; } /** * Gets the value of the senderCity property. * * @return * possible object is * {@link City } * */ public City getSenderCity() { return senderCity; } /** * Sets the value of the senderCity property. * * @param value * allowed object is * {@link City } * */ public void setSenderCity(City value) { this.senderCity = value; } /** * Gets the value of the tracking property. * */ public boolean isTracking() { return tracking; } /** * Sets the value of the tracking property. * */ public void setTracking(boolean value) { this.tracking = value; } }
[ "nimigean.mihnea@gmail.com" ]
nimigean.mihnea@gmail.com
cda53b60c892f77359fcb8b82e52ad24de0f0aef
8aab03f9484b5fe4e1ba8f20e993e27ccce7dfb5
/BoardGameGeek/src/com/boardgamegeek/provider/SearchSuggestTextProvider.java
1734924f1c49ce0c1decfa83b2a3b2e4caa4a8bf
[]
no_license
OrangesCyf/boardgamegeek
d7e45da0fb9c1699c91535d889937f86e5f29f68
45384874afdc1243651fbd8c01818b78ce452d9f
refs/heads/master
2021-01-10T15:55:29.215761
2015-01-20T14:12:13
2015-01-20T14:12:13
36,479,501
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.boardgamegeek.provider; import android.app.SearchManager; public class SearchSuggestTextProvider extends SearchSuggestProvider { @Override protected String getPath() { return SearchManager.SUGGEST_URI_PATH_QUERY + "/*"; } }
[ "chris.comeaux@gmail.com" ]
chris.comeaux@gmail.com
0be7dfddbf36b4b5fc71eddb94922fdcccf83954
29ab223dfa71ae0be43922e91478ea8745784b19
/src/reductions/SatTo3Sat.java
af3fca0d5663fa646ab44d4bbc916fa751e6d5bc
[]
no_license
AdrienVaret/ReductionsPolynomiales
c85336759cb4300edfe303028b71c8d4de1ebaf3
ba31453d0eb6624f0ce304fabb5331e48e6fb25d
refs/heads/master
2018-09-03T18:55:20.934187
2018-05-23T11:38:16
2018-05-23T11:38:16
121,569,998
1
1
null
null
null
null
UTF-8
Java
false
false
3,602
java
package reductions; import java.io.File; import java.util.ArrayList; import structures.SatFNC; public class SatTo3Sat { public static SatFNC convert(SatFNC sat) { int nbLitterals = sat.getNbLitterals(); ArrayList<String> clauses = new ArrayList<String>(); for (String clause : sat.getClauses()) { String [] splittedClause = clause.split(" "); int nbLitteralsClause = splittedClause.length - 1; //THE END 0 // a b c => a b c if (nbLitteralsClause == 3) { clauses.add(clause); } // a b => a b a else if (nbLitteralsClause < 3 && nbLitteralsClause > 0) { String newClause = new String(); for (int i = 0 ; i < 3 ; i++) { if (i < nbLitteralsClause) { newClause += splittedClause[i] + " "; } else { newClause += splittedClause[0] + " "; } } newClause += /*" 0"*/"0"; clauses.add(newClause); } /* * a b c d e f => a b g * !g c f * !f d h * !h e f */ else { int i = 0; //int newLitteral = sat.getNbLitterals() + 1; int newLitteral = nbLitterals+1; while (i < nbLitteralsClause) { //generate first clause if (i == 0) { String newClause = new String(splittedClause[0] + " " + splittedClause[1] + " " + newLitteral + " 0"); //newClause += newLitteral + " 0"; clauses.add(newClause); nbLitterals += 1; i += 2; } //generate last clause if (i == (nbLitteralsClause-2)) { String newClause = "-"+ newLitteral + " " + splittedClause[i] + " " + splittedClause[i+1] + " 0"; clauses.add(newClause); i += 2; } //general case else { String newClause = "-" + newLitteral + " " + splittedClause[i] /*+ " "*/; newLitteral += 1; newClause += " " + newLitteral + " 0"; clauses.add(newClause); nbLitterals += 1; i += 1; } } } } return new SatFNC(nbLitterals, clauses.size(), clauses); } public static SatFNC convertBis(SatFNC sat) { int nbLitterals = sat.getNbLitterals(); ArrayList<String> clauses = new ArrayList<String>(); for (String clause : sat.getClauses()) { String [] splittedClause = clause.split(" "); int nbLitteralsClause = splittedClause.length - 1; //THE END 0 // a b c => a b c if (nbLitteralsClause == 3) { clauses.add(clause); } // a b => a b a else if (nbLitteralsClause < 3 && nbLitteralsClause > 0) { clauses.add(clause); } /* * a b c d e f => a b g * !g c f * !f d h * !h e f */ else { int i = 0; //int newLitteral = sat.getNbLitterals() + 1; int newLitteral = nbLitterals+1; while (i < nbLitteralsClause) { //generate first clause if (i == 0) { String newClause = new String(splittedClause[0] + " " + splittedClause[1] + " " + newLitteral + " 0"); //newClause += newLitteral + " 0"; clauses.add(newClause); nbLitterals += 1; i += 2; } //generate last clause if (i == (nbLitteralsClause-2)) { String newClause = "-"+ newLitteral + " " + splittedClause[i] + " " + splittedClause[i+1] + " 0"; clauses.add(newClause); i += 2; } //general case else { String newClause = "-" + newLitteral + " " + splittedClause[i] /*+ " "*/; newLitteral += 1; newClause += " " + newLitteral + " 0"; clauses.add(newClause); nbLitterals += 1; i += 1; } } } } return new SatFNC(nbLitterals, clauses.size(), clauses); } }
[ "adrien.varet@etu.univ-amu.fr" ]
adrien.varet@etu.univ-amu.fr
b88fd45a01da14d18d0f7bed4260031f7ed4ed7d
c6768a54f64fece211e24c6a104b42104a8dd435
/src/main/java/hello/core/order/OrderServiceImpl.java
5b3ad9d08620062fc3ffed99a1fd5a145c6345c6
[]
no_license
yoonseokch/spring_example
fe79da92cab95a3f205062f29ed71d1621161735
8b62397f5565627b542b979286f959d29123c095
refs/heads/master
2023-02-05T09:00:53.844871
2020-12-28T11:06:35
2020-12-28T11:06:35
316,935,163
0
0
null
null
null
null
UTF-8
Java
false
false
1,198
java
package hello.core.order; import hello.core.annotation.MainDiscountPolicy; import hello.core.discount.DiscountPolicy; import hello.core.member.Member; import hello.core.member.MemberRepository; import hello.core.member.MemoryMemberRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component public class OrderServiceImpl implements OrderService { private final MemberRepository memberRepository; private final DiscountPolicy discountPolicy; @Autowired public OrderServiceImpl(MemberRepository memberRepository, @MainDiscountPolicy DiscountPolicy discountPolicy) { this.memberRepository = memberRepository; this.discountPolicy = discountPolicy; } @Override public Order createOrder(Long memberID, String itemName, int itemPrice) { Member member= memberRepository.findById(memberID); int dis=discountPolicy.discount(member,itemPrice); return new Order(memberID,itemName,itemPrice,dis); } public MemberRepository getMemberRepository() { return memberRepository; } }
[ "yoonsukch@gmail.com" ]
yoonsukch@gmail.com
002dd95d37e46ebf7a8cc50c7e6f707f350d350f
12144de5347beeef935a1e842c6083ba322cf336
/src/main/java/com/lppz/etl/common/pipe/impl/http/LimitedInputStream.java
92fc1009787a54af0ed1a8a4671db07d9a1907ac
[]
no_license
leego86/simple-setl
b424c1eda9f86b5efde3fbc150e4fff92b6871cb
79bb6f3e35dea3b31f8951e1586d9da7e56e37e2
refs/heads/master
2021-07-05T01:17:46.011546
2017-09-26T10:11:56
2017-09-26T10:11:56
104,853,120
0
1
null
null
null
null
UTF-8
Java
false
false
1,442
java
package com.lppz.etl.common.pipe.impl.http; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; /** * copy from google protobuf,支持带limit限制读取数量的功能,将stream可用于流式读取 * * @author jianghang 2013-8-29 下午3:34:32 * @since 4.2.1 */ public class LimitedInputStream extends FilterInputStream { private int limit; public LimitedInputStream(InputStream in, int limit){ super(in); this.limit = limit; } @Override public int available() throws IOException { return Math.min(super.available(), limit); } @Override public int read() throws IOException { if (limit <= 0) { return -1; } final int result = super.read(); if (result >= 0) { --limit; } return result; } @Override public int read(final byte[] b, final int off, int len) throws IOException { if (limit <= 0) { return -1; } len = Math.min(len, limit); final int result = super.read(b, off, len); if (result >= 0) { limit -= result; } return result; } @Override public long skip(final long n) throws IOException { final long result = super.skip(Math.min(n, limit)); if (result >= 0) { limit -= result; } return result; } }
[ "leego8697@gmail.com" ]
leego8697@gmail.com
f75b51a6b3974324f3a7bf25fe6933a06343f76a
212731602425a8e0d6f2ddbdb46d22f5274505cc
/core/src/main/java/io/firstwave/gdxkit/behavior/Blackboard.java
9c25878aa024b9502aa89ad5de4e68cc422b3ba7
[]
no_license
firstwave/gdxkit-0
4fa0f98a109fe324c48df920839bb094df00531a
562704d457dff0d8aa2649edf6d20f3af80a0e9d
refs/heads/master
2020-03-30T05:19:54.210826
2014-06-06T18:21:22
2014-06-07T04:24:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,811
java
package io.firstwave.gdxkit.behavior; import io.firstwave.gdxkit.util.Log; import java.util.HashMap; import java.util.Map; /** * A Blackboard represents the state of an Agents behavior. Since behavior trees are stateless and potentially shared between agents, * using a Blackboard allows you to persist state on a per-agent basis. * Provides a mapping from String to various serializable types * First version created on 4/13/14. */ public class Blackboard implements IBlackboard { private static final String TAG = Blackboard.class.getSimpleName(); private final Map<String, Object> mMap; public Blackboard() { mMap = new HashMap<String, Object>(); } public Blackboard(Blackboard toCopy) { mMap = toCopy.mMap; } @Override protected Object clone() throws CloneNotSupportedException { return new Blackboard(this); } private void typeWarning(String key, String type) { Log.d(TAG, "Couldn't cast mapped value for '" + key + "' to " + type); } @Override public boolean containsKey(String key) { return mMap.containsKey(key); } @Override public Object get(String key) { return mMap.get(key); } @Override public Object remove(String key) { return mMap.remove(key); } @Override public void putBoolean(String key, boolean value) { mMap.put(key, value); } @Override public boolean getBoolean(String key) { return getBoolean(key, false); } @Override public boolean getBoolean(String key, boolean defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Boolean) rv; } catch(ClassCastException e) { typeWarning(key, "Boolean"); return defaultValue; } } @Override public void putBooleanArray(String key, boolean[] value) { mMap.put(key, value); } @Override public boolean[] getBooleanArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (boolean[]) rv; } catch(ClassCastException e) { typeWarning(key, "boolean[]"); return null; } } @Override public void putBlackboard(String key, IBlackboard value) { mMap.put(key, value); } @Override public IBlackboard getBlackboard(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (IBlackboard) rv; } catch(ClassCastException e) { typeWarning(key, "Blackboard"); return null; } } @Override public void putByte(String key, byte value) { mMap.put(key, value); } @Override public byte getByte(String key) { return getByte(key, (byte) 0); } @Override public byte getByte(String key, byte defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Byte) rv; } catch(ClassCastException e) { typeWarning(key, "Byte"); return defaultValue; } } @Override public void putByteArray(String key, byte[] value) { mMap.put(key, value); } @Override public byte[] getByteArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (byte[]) rv; } catch(ClassCastException e) { typeWarning(key, "byte[]"); return null; } } @Override public void putChar(String key, char value) { mMap.put(key, value); } @Override public char getChar(String key) { return getChar(key, (char) 0); } @Override public char getChar(String key, char defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Character) rv; } catch(ClassCastException e) { typeWarning(key, "Character"); return defaultValue; } } @Override public void putCharArray(String key, char[] value) { mMap.put(key, value); } @Override public char[] getCharArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (char[]) rv; } catch(ClassCastException e) { typeWarning(key, "char[]"); return null; } } @Override public void putCharSequence(String key, CharSequence value) { mMap.put(key, value); } @Override public CharSequence getCharSequence(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (CharSequence) rv; } catch(ClassCastException e) { typeWarning(key, "CharSequence"); return null; } } @Override public void putDouble(String key, double value) { mMap.put(key, value); } @Override public double getDouble(String key) { return getDouble(key, 0.0); } @Override public double getDouble(String key, double defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Double) rv; } catch(ClassCastException e) { typeWarning(key, "Double"); return defaultValue; } } @Override public void putDoubleArray(String key, double[] value) { mMap.put(key, value); } @Override public double[] getDoubleArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (double[]) rv; } catch(ClassCastException e) { typeWarning(key, "double[]"); return null; } } @Override public void putFloat(String key, float value) { mMap.put(key, value); } @Override public float getFloat(String key) { return getFloat(key, 0.0f); } @Override public float getFloat(String key, float defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Float) rv; } catch(ClassCastException e) { typeWarning(key, "Float"); return defaultValue; } } @Override public void putFloatArray(String key, float[] value) { mMap.put(key, value); } @Override public float[] getFloatArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (float[]) rv; } catch(ClassCastException e) { typeWarning(key, "float[]"); return null; } } @Override public void putInt(String key, int value) { mMap.put(key, value); } @Override public int getInt(String key) { return getInt(key, 0); } @Override public int getInt(String key, int defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Integer) rv; } catch(ClassCastException e) { typeWarning(key, "Integer"); return defaultValue; } } @Override public void putIntArray(String key, int[] value) { mMap.put(key, value); } @Override public int[] getIntArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (int[]) rv; } catch(ClassCastException e) { typeWarning(key, "int[]"); return null; } } @Override public void putLong(String key, long value) { mMap.put(key, value); } @Override public long getLong(String key) { return getLong(key, 0); } @Override public long getLong(String key, long defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Long) rv; } catch(ClassCastException e) { typeWarning(key, "Long"); return defaultValue; } } @Override public void putLongArray(String key, long[] value) { mMap.put(key, value); } @Override public long[] getLongArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (long[]) rv; } catch(ClassCastException e) { typeWarning(key, "long[]"); return null; } } @Override public void putShort(String key, short value) { mMap.put(key, value); } @Override public short getShort(String key) { return getShort(key, (short) 0); } @Override public short getShort(String key, short defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (Short) rv; } catch(ClassCastException e) { typeWarning(key, "Short"); return defaultValue; } } @Override public void putShortArray(String key, short[] value) { mMap.put(key, value); } @Override public short[] getShortArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (short[]) rv; } catch(ClassCastException e) { typeWarning(key, "short[]"); return null; } } @Override public void putString(String key, String value) { mMap.put(key, value); } @Override public String getString(String key) { return getString(key, null); } @Override public String getString(String key, String defaultValue) { Object rv = mMap.get(key); if (rv == null) return defaultValue; try { return (String) rv; } catch(ClassCastException e) { typeWarning(key, "String"); return defaultValue; } } @Override public void putStringArray(String key, String[] value) { mMap.put(key, value); } @Override public String[] getStringArray(String key) { Object rv = mMap.get(key); if (rv == null) return null; try { return (String[]) rv; } catch(ClassCastException e) { typeWarning(key, "String[]"); return null; } } }
[ "olbartley@gmail.com" ]
olbartley@gmail.com
618eb6ee22ed3abdee028298e7b15bfa30dc6b23
37e43f3786c0aa47b1ba802b8e6770b1e21160bc
/app/src/androidTest/java/com/example/tenakatauniversity/ExampleInstrumentedTest.java
8d4642bb517be183f5b2a171508579a9e7829f70
[]
no_license
Fransunisoft/TenakataUniversity
eeadfb5710fabe9c2272774b54279d32c45ffe90
5a3c84cea53405f4faa9c617e94f1cd84785fdc2
refs/heads/master
2022-11-22T05:00:54.168589
2020-07-20T00:33:15
2020-07-20T00:33:15
280,976,136
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.example.tenakatauniversity; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.tenakatauniversity", appContext.getPackageName()); } }
[ "oluwaseyi.ayodele@arca.network" ]
oluwaseyi.ayodele@arca.network
394246c54551c7961becc59552a01851ff7528a1
b6eb0ecadbb70ed005d687268a0d40e89d4df73e
/feilong-formatter/src/main/java/com/feilong/formatter/entity/BeanFormatterConfig.java
108d8dc2d1b1897038468ec42d98a08a8212eec3
[ "Apache-2.0" ]
permissive
ifeilong/feilong
b175d02849585c7b12ed0e9864f307ed1a26e89f
a0d4efeabc29503b97caf0c300afe956a5caeb9f
refs/heads/master
2023-08-18T13:08:46.724616
2023-08-14T04:30:34
2023-08-14T04:30:34
252,767,655
97
28
Apache-2.0
2023-04-17T17:47:44
2020-04-03T15:14:35
Java
UTF-8
Java
false
false
4,077
java
/* * Copyright (C) 2008 feilong * * 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.feilong.formatter.entity; import java.util.Map; import org.apache.commons.collections4.Transformer; /** * 提供格式化的时候,相关参数控制. * * @author <a href="https://github.com/ifeilong/feilong">feilong</a> * @since 1.8.5 */ public class BeanFormatterConfig{ //*************************通常二者选其一设置********************** /** 排除的属性名字, 会提取所有的属性, 然后剔除 exclude部分. */ private String[] excludePropertyNames; /** 包含的属性名字,会提取所有的属性,然后仅取 include部分. */ private String[] includePropertyNames; //--------------------------------------------------------------- /** 显示属性(列 )的顺序. */ private String[] sorts; //--------------------------------------------------------------- /** * 指定属性类型转换. * * @since 1.10.7 */ private Map<String, Transformer<Object, String>> propertyNameAndTransformerMap; //--------------------------------------------------------------- /** * 获得 排除的属性名字, 会提取所有的属性, 然后剔除 exclude部分. * * @return the excludePropertyNames */ public String[] getExcludePropertyNames(){ return excludePropertyNames; } /** * 设置 排除的属性名字, 会提取所有的属性, 然后剔除 exclude部分. * * @param excludePropertyNames * the excludePropertyNames to set */ public void setExcludePropertyNames(String...excludePropertyNames){ this.excludePropertyNames = excludePropertyNames; } /** * 获得 包含的属性名字,会提取所有的属性,然后仅取 include部分. * * @return the includePropertyNames */ public String[] getIncludePropertyNames(){ return includePropertyNames; } /** * 设置 包含的属性名字,会提取所有的属性,然后仅取 include部分. * * @param includePropertyNames * the includePropertyNames to set */ public void setIncludePropertyNames(String...includePropertyNames){ this.includePropertyNames = includePropertyNames; } /** * 获得 显示属性(列 )的顺序. * * @return the sorts */ public String[] getSorts(){ return sorts; } /** * 设置 显示属性(列 )的顺序. * * @param sorts * the sorts to set */ public void setSorts(String...sorts){ this.sorts = sorts; } /** * 获得 指定属性类型转换. * * @return the propertyNameAndTransformerMap * @since 1.10.7 */ public Map<String, Transformer<Object, String>> getPropertyNameAndTransformerMap(){ return propertyNameAndTransformerMap; } /** * 设置 指定属性类型转换. * * @param propertyNameAndTransformerMap * the propertyNameAndTransformerMap to set * @since 1.10.7 */ public void setPropertyNameAndTransformerMap(Map<String, Transformer<Object, String>> propertyNameAndTransformerMap){ this.propertyNameAndTransformerMap = propertyNameAndTransformerMap; } }
[ "venusdrogon@163.com" ]
venusdrogon@163.com
5692f0a3a000e3f33f5a13ce98ce0f7d36deda26
d089026d84cbfb791f6205f79f5234b507000862
/app/src/main/java/com/example/mike/sunshine/MainActivity.java
98be0817b1d6cc6143c71bd185a8c90c0078e91d
[]
no_license
mbremner/Sunshine
b6b52bee35ad49f56acf4c583b4967c3fd69f711
c7a94d940afb7416432d2663d79b15801ab72e1d
refs/heads/master
2021-01-02T04:53:22.834329
2014-09-16T23:28:38
2014-09-16T23:28:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,038
java
package com.example.mike.sunshine; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new ForecastFragment()) .commit(); } Log.v("tag" , "create"); } @Override protected void onStart() { super.onStart(); Log.v("tag" , "start"); } @Override protected void onResume() { super.onResume(); Log.v("tag" , "resume"); } @Override protected void onPause() { super.onPause(); Log.v("tag" , "pause"); } @Override protected void onStop() { super.onStop(); Log.v("tag" , "stop"); } @Override protected void onDestroy() { super.onDestroy(); Log.v("tag" , "destroy"); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { Intent openSettings = new Intent(this , SettingsActivity.class ); startActivity(openSettings); return true; } return super.onOptionsItemSelected(item); } }
[ "m_b2@hotmail.ca" ]
m_b2@hotmail.ca
a3261e01b654714158a09c84ac05e95399db1700
ba54082b2fe42c5af1824dce60a57cd0402615a6
/Serializable/src/test/java/com/example/myintentadvanceusages/ExampleUnitTest.java
3bc8e525be236a6aa8de77b402ee87cb286e7d1b
[]
no_license
PhoeBe-NanMu/MyIntentAdvanceUsages
a4050f4e4014576a1f193fce414af4207ac73fdd
f64705f589408acd7c4fb1d99dd4ea5e159c3744
refs/heads/master
2020-12-04T16:20:59.756357
2016-08-27T17:11:59
2016-08-27T17:11:59
66,724,515
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.example.myintentadvanceusages; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "2443638666@qq.com" ]
2443638666@qq.com
098093dadc47f40b2318605509ad789ecbbca0bd
eb7093a412fe1914be15bf301e2c143cdf02fc87
/waremanager/src/main/java/cn/longkai/struts/entity/PageBean.java
00f876bd5ad89855af57ab31a964dc3552348337
[]
no_license
jack10008101/warehouse
c2e323c2ece53988373987477985f3393fbc9e42
733d1a8b6c44e45c896be318b0e534edce1cbbfd
refs/heads/master
2016-09-05T23:38:54.568576
2015-07-26T02:32:09
2015-07-26T02:32:09
39,385,061
0
0
null
null
null
null
UTF-8
Java
false
false
3,180
java
package cn.longkai.struts.entity; import java.util.List; import com.sun.org.apache.xml.internal.security.Init; /** * * @author jack 2015年7月24日 * */ public class PageBean<T> { private List<T> list;// 要返回的某一项列表 private int allRow;/* 总记录数 */ private int totalPage;/* 总页数 */ private int currentPage;// 当前页 private int pageSize;// 每一页的记录数 private boolean isFirstPage;// 是否为当前第一页 private boolean isLastPage;// 是否为最后一页 private boolean hasPreviousPage;// 是否有前一页 private boolean hasNextPage;// 是否有下一页 public List<T> getList() { return list; } public void setList(List<T> list) { this.list = list; } public int getAllRow() { return allRow; } public void setAllRow(int allRow) { this.allRow = allRow; } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public int getCurrentPage() { return currentPage; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public boolean isFirstPage() { return isFirstPage; } public void setFirstPage(boolean isFirstPage) { this.isFirstPage = isFirstPage; } public boolean isLastPage() { return isLastPage; } public void setLastPage(boolean isLastPage) { this.isLastPage = isLastPage; } public boolean isHasPreviousPage() { return hasPreviousPage; } public void setHasPreviousPage(boolean hasPreviousPage) { this.hasPreviousPage = hasPreviousPage; } public boolean isHasNextPage() { return hasNextPage; } public void setHasNextPage(boolean hasNextPage) { this.hasNextPage = hasNextPage; } /** * 初始化页面信息 */ public void init() { this.isFirstPage = isFirstPage; this.isLastPage = isLastPage; this.hasPreviousPage = hasNextPage; this.hasNextPage = hasNextPage; } /** * 根据总记录数和每页的记录数计算总页数 * * @param pageSize * 每页的记录数 * @param allRow * 总记录数 * @return 总页数 */ public static int countTotalPage(final int pageSize, final int allRow) { int totalPage = allRow % pageSize == 0 ? allRow / pageSize : allRow / pageSize + 1; return totalPage; } /** * 计算当前也开始的记录数 * @param pageSize 每页的记录数 * @param currentPage 当前的页数 * @return 当前也开始的记录号 */ public static int countOffset(final int pageSize, final int currentPage) { int offset=pageSize*(currentPage-1); return offset; } /** * 计算当前的页数,若为0 或者请求URL中没有“?page=”则用1代替 * @param page 传入的参数,可能为0 或者为空返回1 * @return */ public static int countCurrentPage(int page) { final int curPage = (page==0?1:page); return curPage; } }
[ "1538490988@qq.com" ]
1538490988@qq.com
d8ad72c79ed515cef190276ecdce659dcbe14240
c0c6c5e519486bb69d519edcded097ad3de7cac8
/src/controller/EditMealServlet.java
35c1857509fb22cbc44551a38a8cd568bdb5ec42
[]
no_license
hillarymurphy/WebMealPlanning
93fec8fffc099cae20e8e2c930fe84412c9d2a68
20989afe504c94d3ed4c7ad44d6ceaafb6d91950
refs/heads/master
2022-12-26T20:08:34.281139
2020-10-07T02:07:52
2020-10-07T02:07:52
298,933,535
0
0
null
null
null
null
UTF-8
Java
false
false
1,794
java
package controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import model.ListMeal; /** * Servlet implementation class EditMealServlet */ @WebServlet("/editMealServlet") public class EditMealServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public EditMealServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.getWriter().append("Served at: ").append(request.getContextPath()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub ListMealHelper dao = new ListMealHelper(); String main = request.getParameter("main"); String vegetable = request.getParameter("vegetable"); String fruit = request.getParameter("fruit"); Integer tempId = Integer.parseInt(request.getParameter("id")); ListMeal mealToUpdate = dao.searchForMealById(tempId); mealToUpdate.setFruit(fruit); mealToUpdate.setVegetable(vegetable); mealToUpdate.setMain(main); dao.updateMeal(mealToUpdate); getServletContext().getRequestDispatcher("/viewAllMealsServlet").forward(request, response); } }
[ "hillary.j.murphy@gmail.com" ]
hillary.j.murphy@gmail.com
4f6c5799e577bc813763fd1a236cfcbeac9f58d6
eda67295bbd2bd1b307bf94cf537a54079d00c81
/src/main/java/com/payments/security/jwt/ApiSecurityContext.java
dc24343b4b64286563b6a4eda8524d5f6a8b9b1e
[]
no_license
traycho-zz/payments-sample
c2339f09866bedb1e30d1af02ba050d5d94ea494
131ea89ca0a2f28602247486625b71b7ab44b6b9
refs/heads/master
2020-03-18T08:04:40.333812
2018-06-20T23:17:01
2018-06-20T23:17:01
134,488,297
0
2
null
null
null
null
UTF-8
Java
false
false
1,002
java
package com.payments.security.jwt; import java.security.Principal; import java.util.Set; import javax.ws.rs.core.SecurityContext; public class ApiSecurityContext implements SecurityContext{ private final String AUTH_SCHEMA = "TOKEN_AUTH"; private final String username; private final Set<String> roles; public ApiSecurityContext(final String username, final Set<String> roles){ this.username = username; this.roles = roles; } @Override public Principal getUserPrincipal() { return new Principal() { @Override public String getName() { return username; } }; } @Override public boolean isUserInRole(final String role) { return this.roles.contains(role); } @Override public boolean isSecure() { return false; } @Override public String getAuthenticationScheme() { return AUTH_SCHEMA; } }
[ "traycho@gmail.com" ]
traycho@gmail.com
ef524da507768b113a71be34d8ba97ee7723ca10
d81e4ea7d5f53a8cc23cca235dc0e27d800c64d4
/SampleUsername/src/Updateflight.java
c6883967e462a5df116fd26acc69754cde8478a8
[]
no_license
ashiqsabith123/Airline_reservation_system
8ed15973b2e6eb50da9ea06a4fe3bc8eeae40e13
d58d4020e052a6660fa80fe31044fc889545ff67
refs/heads/main
2023-07-28T22:29:02.709202
2021-09-18T17:27:16
2021-09-18T17:27:16
407,924,093
3
0
null
null
null
null
UTF-8
Java
false
false
9,540
java
import java.awt.Color; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.Vector; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.table.DefaultTableModel; public class Updateflight implements ActionListener,MouseListener { DefaultTableModel model = new DefaultTableModel(); JFrame frame1; JTextField field,flightname,flightd,flighta,flightp,flightdp,flightap,flightdd; JLabel update,flightnumber; JButton button,updatee,back; JTable table; JScrollPane pane; String no; public Updateflight() { frame1 = new JFrame(); frame1.setSize(1155,800); frame1.setLayout(null); frame1.getContentPane().setBackground(Color.white); frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); update = new JLabel(); update.setText("Update Flight"); update.setBounds(30, 10, 259, 80); update.setFont(new Font("Candara",Font.TRUETYPE_FONT,40)); update.setForeground(new Color(128,0,128)); flightnumber = new JLabel(); flightnumber.setText("Enter Flight Number:"); flightnumber.setBounds(30, 70, 259, 80); flightnumber.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,25)); flightnumber.setForeground( Color.black); field = new JTextField(); field.setBounds(280, 95, 250, 40); field.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); button = new JButton("Submit"); button.setBounds(570, 95, 150, 40); button.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,25)); button.setForeground(new Color(128,0,128)); button.setFocusable(false); button.addActionListener(this); table = new JTable(); Object [] coloumns = {"FLIGHT NAME","DEPARTURE TIME","ARRAIVAL TIME","PRICE","DEPARTURE","ARRAIVAL","DEPART DATE"}; model.setColumnIdentifiers(coloumns); table.setModel(model); table.setForeground(Color.black); table.setBackground(Color.white); table.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,14)); table.setRowHeight(30); table.setAutoCreateRowSorter(true); table.addMouseListener(this); pane = new JScrollPane(table); pane.setBounds(10,180,1100,50); frame1.add(pane); Object[] row =new Object[50]; flightname = new JTextField(); flightname.setBounds(10, 250, 150, 30); flightname.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flightd = new JTextField(); flightd.setBounds(170, 250, 150, 30); flightd.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flighta = new JTextField(); flighta.setBounds(330, 250, 150, 30); flighta.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flightp = new JTextField(); flightp.setBounds(490, 250, 150, 30); flightp.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flightdp = new JTextField(); flightdp.setBounds(650, 250, 150, 30); flightdp.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flightap = new JTextField(); flightap.setBounds(810, 250, 150, 30); flightap.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); flightdd = new JTextField(); flightdd.setBounds(970, 250, 150, 30); flightdd.setFont(new Font("Rockwell",Font.TRUETYPE_FONT,20)); updatee = new JButton("Update"); updatee.setFont(new Font("RockWell",Font.TRUETYPE_FONT,20)); updatee.setBounds(420, 350,200, 35); updatee.setBackground(Color.DARK_GRAY); updatee.setForeground(Color.white); updatee.setFocusable(false); updatee.addActionListener(this); back = new JButton("Back"); back.setFocusable(false); back.setBounds(150, 700, 200, 35); back.setFont(new Font("RockWell",Font.TRUETYPE_FONT,15)); back.setBackground(Color.DARK_GRAY); back.setForeground(Color.white); back.addActionListener(this); frame1.add(field); frame1.add(update); frame1.add(flightnumber); frame1.add(button); frame1.add(flightname); frame1.add(flightd); frame1.add(flighta); frame1.add(flightp); frame1.add(flightdp); frame1.add(flightap); frame1.add(flightdd); frame1.add(updatee); frame1.add(back); frame1.setVisible(true); } @Override public void mouseClicked(MouseEvent e) { if(e.getSource() == table) { int selctedRowIndex = table.getSelectedRow(); flightname.setText(model.getValueAt(selctedRowIndex,0).toString()); flightd.setText(model.getValueAt(selctedRowIndex,1).toString()); flighta.setText(model.getValueAt(selctedRowIndex,2).toString()); flightp.setText(model.getValueAt(selctedRowIndex,3).toString()); flightdp.setText(model.getValueAt(selctedRowIndex,4).toString()); flightap.setText(model.getValueAt(selctedRowIndex,5).toString()); flightdd.setText(model.getValueAt(selctedRowIndex,6).toString()); } } @Override public void actionPerformed(ActionEvent e) { if(e.getSource()== button) { no = field.getText(); Boolean flag = null; try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/signup","root",""); String sql="select * from flightdetails WHERE flightno='"+no+"'"; Statement stmt=con.createStatement(); ResultSet rs = stmt.executeQuery(sql); DefaultTableModel dl=(DefaultTableModel)table.getModel(); dl.setRowCount(0); while(rs.next()) { Vector v2=new Vector(); v2.add(rs.getString("flightname")); v2.add(rs.getString("departtime")); v2.add(rs.getString("arraivaltime")); v2.add(rs.getString("price")); v2.add(rs.getString("depart")); v2.add(rs.getString("arraival")); v2.add(rs.getString("departdate")); dl.addRow(v2); no = rs.getString("flightno"); if(no.equals(no) ){ flag = true; } } if(flag == true) { } else { JOptionPane.showMessageDialog(null, "Invalid Flight Number"); } } catch( Exception ex){ System.out.println(ex); JOptionPane.showMessageDialog(null, "Invalid Flight Number"); } } if(e.getSource()== updatee) { String a,b,c,d,h,f,g; a = flightname.getText(); b = flightd.getText(); c = flighta.getText(); d = flightp.getText(); h = flightdp.getText(); f = flightap.getText(); g = flightdd.getText(); Boolean flag; try { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/signup","root",""); String sql="update flightdetails set flightname='"+a+"', departtime='"+b+"', arraivaltime='"+c+"', price='"+d+"', depart= '"+h+"', arraival='"+f+"', departdate='"+g+"' where flightno='"+no+"'"; Statement stmt=con.createStatement(); stmt.executeUpdate(sql); flag = true; if(flag== true){ JOptionPane.showMessageDialog(null, "Updated Successfully"); } } catch(Exception e1) { System.out.println("Error" + e1); } } if(e.getSource()== back) { new AdminPage(); } } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } }
[ "noreply@github.com" ]
ashiqsabith123.noreply@github.com
c60642401ec12b22525c18f4de5cf53999a87bbb
f35f53494db3606f050331c29408922aef7123ad
/src/main/java/stack/ReversePolishNotation.java
0c34180476efe79f777876c66d87c8ade9e41dbe
[]
no_license
BisariaLove/leetcode-problems
a7177bfbc94c90a9cab47dd3a924ab3ca8ff9803
d931039b1ae6aef6bb56c2f28ba9367532ef7b80
refs/heads/master
2021-06-30T03:05:46.739833
2020-08-10T06:27:45
2020-08-10T06:27:45
169,809,860
0
0
null
2020-10-13T11:56:15
2019-02-08T22:56:12
Java
UTF-8
Java
false
false
977
java
package stack; /* * @author love.bisaria on 27/02/19 * * Problem Description - https://leetcode.com/problems/evaluate-reverse-polish-notation/ * */ import java.util.*; public class ReversePolishNotation { static Set<String> operators = new HashSet<String>(Arrays.asList("+", "-", "*", "/")); public int evalRPN(String[] tokens) { Stack<Integer> stack = new Stack(); for(String token : tokens){ if(operators.contains(token)){ int a = stack.pop(); int b = stack.pop(); switch(token.charAt(0)){ case '+' : stack.push(a+b); break; case '-' : stack.push(b-a); break; case '*' : stack.push(a*b); break; case '/' : stack.push((a==0||b==0)?0:(b/a)); break; } } else{ stack.push(Integer.parseInt(token)); } } return stack.pop(); } }
[ "bisarialove@gmail.com" ]
bisarialove@gmail.com
a899779e431d0e90ef6d4392ef56006a727e9dd2
1c5296d7bc6d272ff1e8026482bc91e66db68b26
/app/src/main/java/hbie/vip/parking/fragment/InformationFragment.java
fd7bdba76e087744fd327b6b19bf80d69d471704
[]
no_license
onloo521/Parking
ed2693034f20ddce92774a6399dea0efdfb1ee9b
b941322cf1f8d4d0683a0739bd77859a63a1e445
refs/heads/master
2020-02-26T14:36:46.531459
2016-06-02T13:40:14
2016-06-02T13:40:14
60,265,999
0
0
null
null
null
null
UTF-8
Java
false
false
9,317
java
package hbie.vip.parking.fragment; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import hbie.vip.parking.R; import hbie.vip.parking.adapter.OrderListAdapter; import hbie.vip.parking.bean.UserInfo; import hbie.vip.parking.bean.order.order; import hbie.vip.parking.dao.CommunalInterfaces; import hbie.vip.parking.net.UserRequest; import hbie.vip.parking.ui.list.PullToRefreshListView; import hbie.vip.parking.utils.LogUtils; import hbie.vip.parking.utils.NetBaseUtils; import hbie.vip.parking.utils.ToastUtils; /** * Created by mac on 16/5/9. */ public class InformationFragment extends Fragment { private Activity activity; private PullToRefreshListView lv_comprehensive; private Context mContext; private UserInfo user; private SharedPreferences sp; private TextView tv_car_current_number, tv_car_park,tv_car_time,tv_car_timelong,tv_car_money; private ImageView bt_car_Logo; private ListView lv_order; private OrderListAdapter orderListAdapter; private TextView detail_loading; private ArrayList<order.OrderData> orderList; private final static int GET_CAR_LOCATION=1; private final static int GET_ORDER_LIST=2; @SuppressWarnings("static-access") @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); mContext = getActivity(); sp = mContext.getSharedPreferences("list", mContext.MODE_PRIVATE); user = new UserInfo(mContext); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragement_main, container, false); detail_loading = (TextView) view.findViewById(R.id.detail_loading); lv_comprehensive = (PullToRefreshListView) view .findViewById(R.id.lv_comprehensive); lv_comprehensive.setPullLoadEnabled(true); lv_comprehensive.setScrollLoadEnabled(false); lv_order = lv_comprehensive.getRefreshableView(); orderList = new ArrayList<order.OrderData>(); return view; } @Override public void onAttach(Activity activity) { this.activity = activity; super.onAttach(activity); } // @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); initView(); } private void initView() { bt_car_Logo=(ImageView)getView().findViewById(R.id.iv_car_logo); tv_car_current_number =(TextView) getView().findViewById(R.id.tv_car_current_info); tv_car_money=(TextView)getView().findViewById(R.id.tv_car_money); tv_car_park = (TextView)getView().findViewById(R.id.tv_car_park); tv_car_time=(TextView)getView().findViewById(R.id.tv_car_time); tv_car_timelong = (TextView)getView().findViewById(R.id.tv_car_timelong); tv_car_park.setText("暂无"); tv_car_time.setText("暂无"); tv_car_time.setText("暂无"); tv_car_money.setText("暂无"); } @Override public void onResume() { super.onResume(); // 获取数据,网络获取数据并保存 LogUtils.i("UserData", "------->onResume"); getData(); } /** * 获取数据,网络获取数据并保存 */ private void getData() { user.readData(mContext); LogUtils.i("UserData", "------->onResume-->"+user.getUserId() +user.getCurrentcar()); new UserRequest(mContext, handler).getMemberCurrentCar(user.getUserId(), GET_ORDER_LIST); if(user.getCurrentcar()!=null && !user.getCurrentcar().equals("null")){ bt_car_Logo.setSelected(true); tv_car_current_number.setText(user.getUserCurrentCarBrand()+" "+user.getUserCurrentCarType()+" "+user.getCurrentcar()); if (NetBaseUtils.isConnnected(mContext)) { new UserRequest(mContext, handler).getCarLocation(user.getUserId(), user.getCurrentcar(), GET_CAR_LOCATION); } }else{ bt_car_Logo.setSelected(false); tv_car_current_number.setText("暂无"); } if (NetBaseUtils.isConnnected(mContext)) { new UserRequest(mContext, handler).getUnpayOrderListByOwner(user.getUserId(), GET_ORDER_LIST); }else{ ToastUtils.ToastShort(mContext, "网络问题,请稍后重试!"); } } private Handler handler = new Handler(Looper.myLooper()) { public void handleMessage(android.os.Message msg) { switch (msg.what) { case GET_CAR_LOCATION: if (msg.obj != null) { String result = (String) msg.obj; JSONObject json; try{ json = new JSONObject(result); String state = json.getString("status"); String data = json.getString("data"); if (state.equals(CommunalInterfaces._STATE)) { JSONObject item = new JSONObject(data); tv_car_park.setText(item.getString("park")+" "+item.getString("position")); tv_car_time.setText(item.getString("start_time")); tv_car_timelong.setText("2小时"); tv_car_money.setText("10元"); }else{ tv_car_park.setText("暂无"); tv_car_time.setText("暂无"); tv_car_time.setText("暂无"); tv_car_money.setText("暂无"); } }catch (JSONException e1){ e1.printStackTrace(); ToastUtils.ToastShort(mContext, "没有数据!"); } } break; case GET_ORDER_LIST: if (msg.obj != null) { String result = (String) msg.obj; JSONObject obj; orderList.clear(); try { obj = new JSONObject(result); if (obj.optString("status").equals(CommunalInterfaces._STATE)) { user.readData(mContext); if(obj.getString("data")!=null && obj.getString("data")!=""){ JSONArray hwArray = obj.getJSONArray("data"); if(hwArray != null && hwArray.length()>0) { JSONObject itemObject=new JSONObject(obj.optString("data")); for (int i = 0; i < hwArray.length(); i++) { itemObject = hwArray.optJSONObject(i); if(itemObject.getString("is_current_car").equals("0")) { order.OrderData orderData = new order.OrderData(); // orderData.setId(itemObject.getString("id")); orderData.setCarnumber(user.getCurrentcar()); orderData.setDate(itemObject.getString("date")); orderData.setTime(itemObject.getString("time")); orderData.setPrice(itemObject.getString("price")); orderData.setMoney(itemObject.getString("money")); orderData.setStatus(itemObject.getString("pay_status")); orderList.add(orderData); } } orderListAdapter = new OrderListAdapter(activity, orderList); lv_order.setAdapter(orderListAdapter); }else{ ToastUtils.ToastShort(mContext, "没有数据!"); } } } } catch (JSONException e1) { e1.printStackTrace(); ToastUtils.ToastShort(mContext, "没有数据!"); } }else{ ToastUtils.ToastShort(mContext, "没有数据!"); } break; } }; }; }
[ "zhu83@vip.qq.com" ]
zhu83@vip.qq.com
df69cfd0f5a3495a4295f62e49ab3a0e1535e5fe
e25422148dde6b1c9d8c7e391712882fc50ec70b
/backend/src/main/java/com/project/bku/model/Sekolah.java
d93672370242593b17d47743ed5454a874a14c21
[]
no_license
puspaningtyas/BKU_BOS
a2e3ade92201654cc9ee5683b2fb99891499fac2
7de22e809326d80a1a51cdb1544505b278329d5d
refs/heads/master
2020-04-02T17:19:23.364325
2018-12-06T09:55:45
2018-12-06T09:55:45
154,652,834
0
1
null
null
null
null
UTF-8
Java
false
false
3,232
java
package com.project.bku.model; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; import com.project.bku.model.audit.UserDateAudit; @Entity @Table(name="sekolah") public class Sekolah extends UserDateAudit{ private static final long serialVersionUID = -6666342282800547074L; @Id @Column(name = "npsn") private Long npsn; private String namaSekolah; private String nss; private String alamat; private String rt; private String rw; private String dusun; private String desaKelurahan; private String kecamatan; private String kabupatenKota; private String provinsi; private String kodePos; private String noRekening; private String namaBank; private String npwp; private String email; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "management_sekolah_id") private ManajemenSekolah managementSekolah; public ManajemenSekolah getManagementSekolah() { return managementSekolah; } public void setManagementSekolah(ManajemenSekolah managementSekolah) { this.managementSekolah = managementSekolah; } public String getNamaSekolah() { return namaSekolah; } public void setNamaSekolah(String namaSekolah) { this.namaSekolah = namaSekolah; } public Long getNpsn() { return npsn; } public void setNpsn(Long npsn) { this.npsn = npsn; } public String getNss() { return nss; } public void setNss(String nss) { this.nss = nss; } public String getAlamat() { return alamat; } public void setAlamat(String alamat) { this.alamat = alamat; } public String getRt() { return rt; } public void setRt(String rt) { this.rt = rt; } public String getRw() { return rw; } public void setRw(String rw) { this.rw = rw; } public String getDusun() { return dusun; } public void setDusun(String dusun) { this.dusun = dusun; } public String getDesaKelurahan() { return desaKelurahan; } public void setDesaKelurahan(String desaKelurahan) { this.desaKelurahan = desaKelurahan; } public String getKecamatan() { return kecamatan; } public void setKecamatan(String kecamatan) { this.kecamatan = kecamatan; } public String getKabupatenKota() { return kabupatenKota; } public void setKabupatenKota(String kabupatenKota) { this.kabupatenKota = kabupatenKota; } public String getProvinsi() { return provinsi; } public void setProvinsi(String provinsi) { this.provinsi = provinsi; } public String getKodePos() { return kodePos; } public void setKodePos(String kodePos) { this.kodePos = kodePos; } public String getNoRekening() { return noRekening; } public void setNoRekening(String noRekening) { this.noRekening = noRekening; } public String getNamaBank() { return namaBank; } public void setNamaBank(String namaBank) { this.namaBank = namaBank; } public String getNpwp() { return npwp; } public void setNpwp(String npwp) { this.npwp = npwp; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
[ "willychristt@gmail.com" ]
willychristt@gmail.com
9a4405a07ce655a11ab0bfda22afe21264c5d588
3c9eeb6437b551bd1fd2ac69d7d18b3a5e865d2d
/src/main/java/com/cred/rules/StatelessRule.java
5fb299528c635f325c40a3cd4971a367fd6f0bde
[]
no_license
anmolkapoor/insta-sms-kafka-redis-with-rules
1ea99a5f8a9c0c8f05ca0e6ee7b053cae7169394
5d6b14abb79a207a39a7f10a773556d4f2fff5d7
refs/heads/master
2020-11-24T23:26:25.312487
2019-12-16T13:19:41
2019-12-16T13:19:41
228,385,905
0
1
null
2023-09-05T22:01:50
2019-12-16T12:47:22
Java
UTF-8
Java
false
false
276
java
package com.cred.rules; import com.cred.models.EventDto; import javafx.util.Pair; import java.util.Optional; public interface StatelessRule { public String getRuleName(); public Pair<Boolean, Optional<String>> applyRuleAndReturnReasonIfTrue(EventDto eventDto); }
[ "anmol.kapoor@flipkart.com" ]
anmol.kapoor@flipkart.com
33ed2c44f8b604611a6b3f1f9bd239213f01880b
abc7e2b2a4f4f835b5bc695dd8087e1c8c1199df
/satish/src/com/transset/TrlFlags.java
ce0aaa84056dea2a1c3554f04df1a7a200d32174
[]
no_license
katpb/spark-mongo-test
db54e83f94fc8f4d7638ea0838742331711025ed
4489ae3315dafc828ec5fbeefd3257bc2252be8c
refs/heads/master
2023-04-28T15:34:31.788929
2020-07-19T17:49:46
2020-07-19T17:49:46
268,293,363
0
2
null
2023-04-21T20:44:21
2020-05-31T14:09:23
Java
UTF-8
Java
false
false
43,867
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2020.06.07 at 01:19:54 PM IST // package com.transset; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; 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="trlNegative" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="cause"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="refund"/> * &lt;enumeration value="void"/> * &lt;enumeration value="negDept"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlDeli" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlBay" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlFstmp" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlSpDisc" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPrepdCard" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="func"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="activation"/> * &lt;enumeration value="revaluation"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlBdayVerif" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPLUNotFnd" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPLUNotScan" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPLU" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlMoneyOrder" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlUpdPluCust" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlUpdDepCust" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlNetVoid" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlCatCust" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlFuelOnly" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlFuelSale" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPriceOvrd" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlFirstCAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlMatch" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlPopMemDCR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlCWDoPromo" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlCWPromoDn" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlCouponRedeemed" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="trlLoyLnDisc" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element ref="{}taxableRebate" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "trlNegative", "trlDeli", "trlBay", "trlFstmp", "trlSpDisc", "trlPrepdCard", "trlBdayVerif", "trlPLUNotFnd", "trlPLUNotScan", "trlPLU", "trlMoneyOrder", "trlUpdPluCust", "trlUpdDepCust", "trlNetVoid", "trlCatCust", "trlFuelOnly", "trlFuelSale", "trlPriceOvrd", "trlFirstCAB", "trlMatch", "trlPopMemDCR", "trlCWDoPromo", "trlCWPromoDn", "trlCouponRedeemed", "trlLoyLnDisc", "taxableRebate" }) @XmlRootElement(name = "trlFlags") public class TrlFlags { protected TrlFlags.TrlNegative trlNegative; protected TrlFlags.TrlDeli trlDeli; protected TrlFlags.TrlBay trlBay; protected TrlFlags.TrlFstmp trlFstmp; protected TrlFlags.TrlSpDisc trlSpDisc; protected TrlFlags.TrlPrepdCard trlPrepdCard; protected TrlFlags.TrlBdayVerif trlBdayVerif; protected TrlFlags.TrlPLUNotFnd trlPLUNotFnd; protected TrlFlags.TrlPLUNotScan trlPLUNotScan; protected TrlFlags.TrlPLU trlPLU; protected TrlFlags.TrlMoneyOrder trlMoneyOrder; protected TrlFlags.TrlUpdPluCust trlUpdPluCust; protected TrlFlags.TrlUpdDepCust trlUpdDepCust; protected TrlFlags.TrlNetVoid trlNetVoid; protected TrlFlags.TrlCatCust trlCatCust; protected TrlFlags.TrlFuelOnly trlFuelOnly; protected TrlFlags.TrlFuelSale trlFuelSale; protected TrlFlags.TrlPriceOvrd trlPriceOvrd; protected TrlFlags.TrlFirstCAB trlFirstCAB; protected TrlFlags.TrlMatch trlMatch; protected TrlFlags.TrlPopMemDCR trlPopMemDCR; protected TrlFlags.TrlCWDoPromo trlCWDoPromo; protected TrlFlags.TrlCWPromoDn trlCWPromoDn; protected TrlFlags.TrlCouponRedeemed trlCouponRedeemed; protected TrlFlags.TrlLoyLnDisc trlLoyLnDisc; protected List<TaxableRebate> taxableRebate; /** * Gets the value of the trlNegative property. * * @return * possible object is * {@link TrlFlags.TrlNegative } * */ public TrlFlags.TrlNegative getTrlNegative() { return trlNegative; } /** * Sets the value of the trlNegative property. * * @param value * allowed object is * {@link TrlFlags.TrlNegative } * */ public void setTrlNegative(TrlFlags.TrlNegative value) { this.trlNegative = value; } /** * Gets the value of the trlDeli property. * * @return * possible object is * {@link TrlFlags.TrlDeli } * */ public TrlFlags.TrlDeli getTrlDeli() { return trlDeli; } /** * Sets the value of the trlDeli property. * * @param value * allowed object is * {@link TrlFlags.TrlDeli } * */ public void setTrlDeli(TrlFlags.TrlDeli value) { this.trlDeli = value; } /** * Gets the value of the trlBay property. * * @return * possible object is * {@link TrlFlags.TrlBay } * */ public TrlFlags.TrlBay getTrlBay() { return trlBay; } /** * Sets the value of the trlBay property. * * @param value * allowed object is * {@link TrlFlags.TrlBay } * */ public void setTrlBay(TrlFlags.TrlBay value) { this.trlBay = value; } /** * Gets the value of the trlFstmp property. * * @return * possible object is * {@link TrlFlags.TrlFstmp } * */ public TrlFlags.TrlFstmp getTrlFstmp() { return trlFstmp; } /** * Sets the value of the trlFstmp property. * * @param value * allowed object is * {@link TrlFlags.TrlFstmp } * */ public void setTrlFstmp(TrlFlags.TrlFstmp value) { this.trlFstmp = value; } /** * Gets the value of the trlSpDisc property. * * @return * possible object is * {@link TrlFlags.TrlSpDisc } * */ public TrlFlags.TrlSpDisc getTrlSpDisc() { return trlSpDisc; } /** * Sets the value of the trlSpDisc property. * * @param value * allowed object is * {@link TrlFlags.TrlSpDisc } * */ public void setTrlSpDisc(TrlFlags.TrlSpDisc value) { this.trlSpDisc = value; } /** * Gets the value of the trlPrepdCard property. * * @return * possible object is * {@link TrlFlags.TrlPrepdCard } * */ public TrlFlags.TrlPrepdCard getTrlPrepdCard() { return trlPrepdCard; } /** * Sets the value of the trlPrepdCard property. * * @param value * allowed object is * {@link TrlFlags.TrlPrepdCard } * */ public void setTrlPrepdCard(TrlFlags.TrlPrepdCard value) { this.trlPrepdCard = value; } /** * Gets the value of the trlBdayVerif property. * * @return * possible object is * {@link TrlFlags.TrlBdayVerif } * */ public TrlFlags.TrlBdayVerif getTrlBdayVerif() { return trlBdayVerif; } /** * Sets the value of the trlBdayVerif property. * * @param value * allowed object is * {@link TrlFlags.TrlBdayVerif } * */ public void setTrlBdayVerif(TrlFlags.TrlBdayVerif value) { this.trlBdayVerif = value; } /** * Gets the value of the trlPLUNotFnd property. * * @return * possible object is * {@link TrlFlags.TrlPLUNotFnd } * */ public TrlFlags.TrlPLUNotFnd getTrlPLUNotFnd() { return trlPLUNotFnd; } /** * Sets the value of the trlPLUNotFnd property. * * @param value * allowed object is * {@link TrlFlags.TrlPLUNotFnd } * */ public void setTrlPLUNotFnd(TrlFlags.TrlPLUNotFnd value) { this.trlPLUNotFnd = value; } /** * Gets the value of the trlPLUNotScan property. * * @return * possible object is * {@link TrlFlags.TrlPLUNotScan } * */ public TrlFlags.TrlPLUNotScan getTrlPLUNotScan() { return trlPLUNotScan; } /** * Sets the value of the trlPLUNotScan property. * * @param value * allowed object is * {@link TrlFlags.TrlPLUNotScan } * */ public void setTrlPLUNotScan(TrlFlags.TrlPLUNotScan value) { this.trlPLUNotScan = value; } /** * Gets the value of the trlPLU property. * * @return * possible object is * {@link TrlFlags.TrlPLU } * */ public TrlFlags.TrlPLU getTrlPLU() { return trlPLU; } /** * Sets the value of the trlPLU property. * * @param value * allowed object is * {@link TrlFlags.TrlPLU } * */ public void setTrlPLU(TrlFlags.TrlPLU value) { this.trlPLU = value; } /** * Gets the value of the trlMoneyOrder property. * * @return * possible object is * {@link TrlFlags.TrlMoneyOrder } * */ public TrlFlags.TrlMoneyOrder getTrlMoneyOrder() { return trlMoneyOrder; } /** * Sets the value of the trlMoneyOrder property. * * @param value * allowed object is * {@link TrlFlags.TrlMoneyOrder } * */ public void setTrlMoneyOrder(TrlFlags.TrlMoneyOrder value) { this.trlMoneyOrder = value; } /** * Gets the value of the trlUpdPluCust property. * * @return * possible object is * {@link TrlFlags.TrlUpdPluCust } * */ public TrlFlags.TrlUpdPluCust getTrlUpdPluCust() { return trlUpdPluCust; } /** * Sets the value of the trlUpdPluCust property. * * @param value * allowed object is * {@link TrlFlags.TrlUpdPluCust } * */ public void setTrlUpdPluCust(TrlFlags.TrlUpdPluCust value) { this.trlUpdPluCust = value; } /** * Gets the value of the trlUpdDepCust property. * * @return * possible object is * {@link TrlFlags.TrlUpdDepCust } * */ public TrlFlags.TrlUpdDepCust getTrlUpdDepCust() { return trlUpdDepCust; } /** * Sets the value of the trlUpdDepCust property. * * @param value * allowed object is * {@link TrlFlags.TrlUpdDepCust } * */ public void setTrlUpdDepCust(TrlFlags.TrlUpdDepCust value) { this.trlUpdDepCust = value; } /** * Gets the value of the trlNetVoid property. * * @return * possible object is * {@link TrlFlags.TrlNetVoid } * */ public TrlFlags.TrlNetVoid getTrlNetVoid() { return trlNetVoid; } /** * Sets the value of the trlNetVoid property. * * @param value * allowed object is * {@link TrlFlags.TrlNetVoid } * */ public void setTrlNetVoid(TrlFlags.TrlNetVoid value) { this.trlNetVoid = value; } /** * Gets the value of the trlCatCust property. * * @return * possible object is * {@link TrlFlags.TrlCatCust } * */ public TrlFlags.TrlCatCust getTrlCatCust() { return trlCatCust; } /** * Sets the value of the trlCatCust property. * * @param value * allowed object is * {@link TrlFlags.TrlCatCust } * */ public void setTrlCatCust(TrlFlags.TrlCatCust value) { this.trlCatCust = value; } /** * Gets the value of the trlFuelOnly property. * * @return * possible object is * {@link TrlFlags.TrlFuelOnly } * */ public TrlFlags.TrlFuelOnly getTrlFuelOnly() { return trlFuelOnly; } /** * Sets the value of the trlFuelOnly property. * * @param value * allowed object is * {@link TrlFlags.TrlFuelOnly } * */ public void setTrlFuelOnly(TrlFlags.TrlFuelOnly value) { this.trlFuelOnly = value; } /** * Gets the value of the trlFuelSale property. * * @return * possible object is * {@link TrlFlags.TrlFuelSale } * */ public TrlFlags.TrlFuelSale getTrlFuelSale() { return trlFuelSale; } /** * Sets the value of the trlFuelSale property. * * @param value * allowed object is * {@link TrlFlags.TrlFuelSale } * */ public void setTrlFuelSale(TrlFlags.TrlFuelSale value) { this.trlFuelSale = value; } /** * Gets the value of the trlPriceOvrd property. * * @return * possible object is * {@link TrlFlags.TrlPriceOvrd } * */ public TrlFlags.TrlPriceOvrd getTrlPriceOvrd() { return trlPriceOvrd; } /** * Sets the value of the trlPriceOvrd property. * * @param value * allowed object is * {@link TrlFlags.TrlPriceOvrd } * */ public void setTrlPriceOvrd(TrlFlags.TrlPriceOvrd value) { this.trlPriceOvrd = value; } /** * Gets the value of the trlFirstCAB property. * * @return * possible object is * {@link TrlFlags.TrlFirstCAB } * */ public TrlFlags.TrlFirstCAB getTrlFirstCAB() { return trlFirstCAB; } /** * Sets the value of the trlFirstCAB property. * * @param value * allowed object is * {@link TrlFlags.TrlFirstCAB } * */ public void setTrlFirstCAB(TrlFlags.TrlFirstCAB value) { this.trlFirstCAB = value; } /** * Gets the value of the trlMatch property. * * @return * possible object is * {@link TrlFlags.TrlMatch } * */ public TrlFlags.TrlMatch getTrlMatch() { return trlMatch; } /** * Sets the value of the trlMatch property. * * @param value * allowed object is * {@link TrlFlags.TrlMatch } * */ public void setTrlMatch(TrlFlags.TrlMatch value) { this.trlMatch = value; } /** * Gets the value of the trlPopMemDCR property. * * @return * possible object is * {@link TrlFlags.TrlPopMemDCR } * */ public TrlFlags.TrlPopMemDCR getTrlPopMemDCR() { return trlPopMemDCR; } /** * Sets the value of the trlPopMemDCR property. * * @param value * allowed object is * {@link TrlFlags.TrlPopMemDCR } * */ public void setTrlPopMemDCR(TrlFlags.TrlPopMemDCR value) { this.trlPopMemDCR = value; } /** * Gets the value of the trlCWDoPromo property. * * @return * possible object is * {@link TrlFlags.TrlCWDoPromo } * */ public TrlFlags.TrlCWDoPromo getTrlCWDoPromo() { return trlCWDoPromo; } /** * Sets the value of the trlCWDoPromo property. * * @param value * allowed object is * {@link TrlFlags.TrlCWDoPromo } * */ public void setTrlCWDoPromo(TrlFlags.TrlCWDoPromo value) { this.trlCWDoPromo = value; } /** * Gets the value of the trlCWPromoDn property. * * @return * possible object is * {@link TrlFlags.TrlCWPromoDn } * */ public TrlFlags.TrlCWPromoDn getTrlCWPromoDn() { return trlCWPromoDn; } /** * Sets the value of the trlCWPromoDn property. * * @param value * allowed object is * {@link TrlFlags.TrlCWPromoDn } * */ public void setTrlCWPromoDn(TrlFlags.TrlCWPromoDn value) { this.trlCWPromoDn = value; } /** * Gets the value of the trlCouponRedeemed property. * * @return * possible object is * {@link TrlFlags.TrlCouponRedeemed } * */ public TrlFlags.TrlCouponRedeemed getTrlCouponRedeemed() { return trlCouponRedeemed; } /** * Sets the value of the trlCouponRedeemed property. * * @param value * allowed object is * {@link TrlFlags.TrlCouponRedeemed } * */ public void setTrlCouponRedeemed(TrlFlags.TrlCouponRedeemed value) { this.trlCouponRedeemed = value; } /** * Gets the value of the trlLoyLnDisc property. * * @return * possible object is * {@link TrlFlags.TrlLoyLnDisc } * */ public TrlFlags.TrlLoyLnDisc getTrlLoyLnDisc() { return trlLoyLnDisc; } /** * Sets the value of the trlLoyLnDisc property. * * @param value * allowed object is * {@link TrlFlags.TrlLoyLnDisc } * */ public void setTrlLoyLnDisc(TrlFlags.TrlLoyLnDisc value) { this.trlLoyLnDisc = value; } /** * Gets the value of the taxableRebate 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 taxableRebate property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTaxableRebate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TaxableRebate } * * */ public List<TaxableRebate> getTaxableRebate() { if (taxableRebate == null) { taxableRebate = new ArrayList<TaxableRebate>(); } return this.taxableRebate; } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlBay { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlBdayVerif { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlCWDoPromo { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlCWPromoDn { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlCatCust { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlCouponRedeemed { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlDeli { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlFirstCAB { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlFstmp { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlFuelOnly { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlFuelSale { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlLoyLnDisc { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlMatch { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlMoneyOrder { } /** * <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;attribute name="cause"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="refund"/> * &lt;enumeration value="void"/> * &lt;enumeration value="negDept"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlNegative { @XmlAttribute(name = "cause") protected String cause; /** * Gets the value of the cause property. * * @return * possible object is * {@link String } * */ public String getCause() { return cause; } /** * Sets the value of the cause property. * * @param value * allowed object is * {@link String } * */ public void setCause(String value) { this.cause = value; } } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlNetVoid { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPLU { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPLUNotFnd { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPLUNotScan { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPopMemDCR { } /** * <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;attribute name="func"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="activation"/> * &lt;enumeration value="revaluation"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPrepdCard { @XmlAttribute(name = "func") protected String func; /** * Gets the value of the func property. * * @return * possible object is * {@link String } * */ public String getFunc() { return func; } /** * Sets the value of the func property. * * @param value * allowed object is * {@link String } * */ public void setFunc(String value) { this.func = value; } } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlPriceOvrd { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlSpDisc { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlUpdDepCust { } /** * <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;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class TrlUpdPluCust { } }
[ "satish_r1@verifone.com" ]
satish_r1@verifone.com
1c6712d954b580af49307dd3472db48d507dee23
ecbc629de652175006766173b66aa2d7b300d041
/src/main/java/org/red5/server/api/plugin/IRed5PluginHandler.java
aabee6202fc66906fb30a25b5ae7f6ecb32cd791
[ "Apache-2.0" ]
permissive
nelshukri/TheummahLive
4565012aa02c6ca7f6c1ea7f0ae89e8abc298528
372322a48de4c3c8d900349979c052a79646161b
refs/heads/master
2022-10-05T23:21:10.325252
2020-03-30T20:33:20
2020-03-30T20:33:20
251,526,160
0
0
Apache-2.0
2022-10-04T23:56:48
2020-03-31T07:06:19
Java
UTF-8
Java
false
false
1,450
java
/* * RED5 Open Source Media Server - https://github.com/Red5/ * * Copyright 2006-2016 by respective authors (see below). All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.red5.server.api.plugin; import java.util.Map; import org.red5.server.adapter.MultiThreadedApplicationAdapter; /** * Base interface for handlers originating from plug-ins. * * @author Paul Gregoire */ public interface IRed5PluginHandler { /** * Initialize the plug-in handler. */ void init(); /** * Set the application making use of this plug-in handler. * * @param application * application adapter */ void setApplication(MultiThreadedApplicationAdapter application); /** * Set properties to be used by this handler. * * @param props * plugin properties map */ void setProperties(Map<String, Object> props); }
[ "mondain@gmail.com" ]
mondain@gmail.com
2320f9a10aec41076fee06a9aefcfe0182341e1e
1baaf313bfa6fbae6652bc8ac42309aaee8be11f
/chronix-core/src/main/java/org/oxymores/chronix/engine/ChronixEngineSim.java
dbbab91958817d1b487feeab637d285e8615601a
[ "Apache-2.0", "BSD-3-Clause", "MIT" ]
permissive
marcanpilami/jChronix
270e6824cfdb17ab92b87f91c552a4e2bb5390f9
ed1c1f099b440027c431beee2f76665bf59b578d
refs/heads/osgi
2023-01-28T19:26:36.790377
2021-05-23T12:58:33
2021-05-23T12:58:33
4,024,149
1
1
Apache-2.0
2023-01-07T07:43:52
2012-04-14T10:53:58
Java
UTF-8
Java
false
false
3,946
java
package org.oxymores.chronix.engine; /* public class ChronixEngineSim extends ChronixEngine { private static final Logger log = LoggerFactory.getLogger(ChronixEngineSim.class); private final UUID appToSimulateId; private final DateTime start, end; public static List<RunLog> simulate(String configurationDirectoryPath, UUID appID, DateTime start, DateTime end) { ChronixEngineSim es = new ChronixEngineSim(configurationDirectoryPath, appID, start, end); es.startEngine(false); return es.waitForSimEnd(); } public ChronixEngineSim(String configurationDirectoryPath, UUID appID, DateTime start, DateTime end) { super(configurationDirectoryPath, "raccoon:9999", false, 0); this.appToSimulateId = appID; this.start = start; this.end = end; } // params are ignored! @Override protected void startEngine(boolean blocking) { MDC.put("node", "simu"); log.info(String.format("(%s) simulation engine starting between %s and %s", this.dbPath, this.start, this.end)); try { // Context this.ctxMeta = new ChronixContext("simu", this.dbPath, true, null, null); // This is a simulation: we are only interested in a single application for (Application ap : this.ctxMeta.getApplications()) { if (!ap.getId().equals(appToSimulateId)) { this.ctxMeta.removeApplicationFromCache(ap.getId()); } } // This is a simulation: there is no network, only one simulation node. ExecutionNode simulationNode = new ExecutionNode(); ExecutionNodeConnectionAmq conn = new ExecutionNodeConnectionAmq(); conn.setDns("raccoon"); conn.setqPort(9999); simulationNode.addConnectionMethod(conn); simulationNode.setName("simu"); this.ctxMeta.getEnvironment().addNode(simulationNode); this.ctxMeta.getEnvironment().setConsole(simulationNode); ctxMeta.setLocalNodeName(simulationNode.getName()); for (Place p : this.ctxMeta.getEnvironment().getPlaces().values()) { p.setNode(simulationNode); } // Broker with some of the consumer threads. Not started: meta, runner agent, order. In memory broker, no networking, with EM. this.broker = new Broker(this.ctxMeta, false, true, false); this.broker.setNbRunners(this.nbRunner); this.broker.registerListeners(this, false, false, true, true, true, true, true, false, true); // Active sources agent this.stAgent = new SelfTriggerAgentSim(); ((SelfTriggerAgentSim) this.stAgent).setBeginTime(start); ((SelfTriggerAgentSim) this.stAgent).setEndTime(end); this.stAgent.startAgent(ctxMeta, broker.getConnection(), this.start); // Done this.engineStarts.release(); log.info("Simulator for context " + this.ctxMeta.getContextRoot() + " has finished its boot sequence"); } catch (ChronixInitializationException | JMSException | IOException e) { log.error("The simulation engine has failed to start", e); this.run = false; } } public List<RunLog> waitForSimEnd() { this.waitForInitEnd(); log.info("Simulation has started. Waiting for simulation end"); try { this.stAgent.join(); } catch (InterruptedException e) { } log.info("Simulation has ended. Returning results"); MDC.remove("node"); try (Connection conn = this.ctxMeta.getHistoryDataSource().open()) { return conn.createQuery("SELECT * from RunLog h").executeAndFetch(RunLog.class); } } } */
[ "marsu_pilami@msn.com" ]
marsu_pilami@msn.com
b438a72b11124abcb39f7cd73dfa8803c97851df
a6b8e063d7e0422ee1a79100ae947a522334ced7
/LivelyWorld/Plugin/src/main/java/com/kylantraynor/livelyworld/waterV2/WaterListener.java
641caed8a4cf1f80bb334c9d19a06f8086f2310c
[]
no_license
KylanTraynor/LivelyWorld
cb5062e1a503230addf52dc2c49287723924ff48
5c3d26ff58a3d63d53067eb6194e8126aab480e4
refs/heads/master
2021-01-12T06:37:47.513505
2020-03-22T17:57:14
2020-03-22T17:57:14
77,397,820
1
0
null
null
null
null
UTF-8
Java
false
false
3,645
java
package com.kylantraynor.livelyworld.waterV2; import com.kylantraynor.livelyworld.LivelyWorld; import com.kylantraynor.livelyworld.Utils; import org.bukkit.Chunk; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.FluidLevelChangeEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.inventory.ItemStack; public class WaterListener implements Listener { private WaterModule module; public WaterListener(WaterModule module){ this.module = module; } @EventHandler(ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event){ if(!event.getBlock().getWorld().getName().equals("world")) return; if(!LivelyWorld.getInstance().getWaterModule().isRealisticSimulation()) return; WaterWorld w = module.getWorld(event.getBlock().getWorld()); if (w == null) return; WaterChunk wc = w.getChunk(event.getBlock().getChunk().getX(), event.getBlock().getChunk().getZ()); if(wc == null) return; int x = Utils.floorMod2(event.getBlock().getX(), 4); int z = Utils.floorMod2(event.getBlock().getZ(), 4); wc.onBlockChange(x,event.getBlock().getY(), z, null, new boolean[8], true); } @EventHandler(ignoreCancelled = true) public void onBlockPlace(BlockPlaceEvent event){ if(!event.getBlock().getWorld().getName().equals("world")) return; if(!LivelyWorld.getInstance().getWaterModule().isRealisticSimulation()) return; WaterWorld w = module.getWorld(event.getBlock().getWorld()); if (w == null) return; WaterChunk wc = w.getChunk(event.getBlock().getChunk().getX(), event.getBlock().getChunk().getZ()); if(wc == null) return; int x = Utils.floorMod2(event.getBlock().getX(), 4); int z = Utils.floorMod2(event.getBlock().getZ(), 4); BlockData bd = event.getBlockPlaced().getBlockData(); Permeability perm = WaterUtils.materialToPermeability(bd.getMaterial()); boolean[] obstacles = new boolean[8]; if(perm != null){ obstacles = WaterUtils.dataToObstacles(bd); } wc.onBlockChange(x,event.getBlock().getY(), z, perm, obstacles, true); } @EventHandler public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){ if(!LivelyWorld.getInstance().getWaterModule().isEnabled()) return; Block b = event.getBlockClicked().getRelative(event.getBlockFace()); Chunk c = b.getChunk(); ItemStack is = event.getPlayer().getInventory().getItemInMainHand(); String info = Utils.getLoreInfo(is, "Level"); final int cX = Utils.floorMod2(b.getX(), 4); final int cZ = Utils.floorMod2(b.getZ(), 4); final int level = (info != null ? Utils.keepBetween(0, Integer.parseInt(info),32) : 32); WaterWorld w = module.getWorld(b.getWorld()); if(w == null) return; WaterChunk wc = w.getChunk(c.getX(), c.getZ()); if(wc == null) return; wc.addWaterIn(new BlockLocation(cX, b.getY(), cZ), level); } @EventHandler public void onFluidLevelChange(FluidLevelChangeEvent event){ if(!Utils.isWater(event.getBlock())) return; if(!event.getBlock().getWorld().getName().equals("world")) return; if(!LivelyWorld.getInstance().getWaterModule().isRealisticSimulation()) return; event.setCancelled(true); } }
[ "baptiste.jacquet28@gmail.com" ]
baptiste.jacquet28@gmail.com
e648c20d828776192c7a9e84ce520324e4166a41
c257d8afd0785bddaff12819ca3fea58efef375c
/juju-user/src/main/java/com/juju/sport/user/mapper/DeviceUsersMapper.java
b1a30364f54adb840a4a7aaa33ce14ae4b30bba2
[]
no_license
wwbg1988/juju_sport
37c2177a185a6485cd75ef0d72d084476dc51b8b
39a2d91ef815c85de60649adc50372f7ee3e3343
refs/heads/master
2020-06-21T03:47:28.924899
2016-11-26T06:08:46
2016-11-26T06:08:46
74,807,863
0
1
null
null
null
null
UTF-8
Java
false
false
3,108
java
package com.juju.sport.user.mapper; import com.juju.sport.user.pojo.DeviceUsers; import com.juju.sport.user.pojo.DeviceUsersExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface DeviceUsersMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int countByExample(DeviceUsersExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int deleteByExample(DeviceUsersExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int deleteByPrimaryKey(String id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int insert(DeviceUsers record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int insertSelective(DeviceUsers record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ List<DeviceUsers> selectByExample(DeviceUsersExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ DeviceUsers selectByPrimaryKey(String id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int updateByExampleSelective(@Param("record") DeviceUsers record, @Param("example") DeviceUsersExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int updateByExample(@Param("record") DeviceUsers record, @Param("example") DeviceUsersExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int updateByPrimaryKeySelective(DeviceUsers record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table juju_device_users * * @mbggenerated Tue May 26 10:15:32 CST 2015 */ int updateByPrimaryKey(DeviceUsers record); }
[ "wuweitree@163.com" ]
wuweitree@163.com
63315ee80e921c99e30f45baea6cc0cd070bb476
4f4ae458c3256f3041993ef19c7cb5de4c55c178
/src/main/java/service/VideoService.java
1c6d73e57c5ec39ade47e0c9827b847075336fa5
[]
no_license
songrunyu/GPdemo2
a9053422f2c49e0b0c1d4b09d6ad13efc8736867
c3fc58192abd9f7b432fe8439998d75992342e41
refs/heads/master
2020-12-03T10:36:54.719349
2016-05-19T09:50:07
2016-05-19T09:50:07
58,120,758
0
0
null
2016-05-05T09:42:01
2016-05-05T09:42:00
null
UTF-8
Java
false
false
540
java
package service; import domain.VideoDO; import domain.VideoQuery; import domain.VideoUpdate; import java.util.List; /** * Created by tqy on 16-5-11. */ public interface VideoService { String SPRING_NAME = "videoService"; List<VideoDO> select(VideoQuery videoQuery); List<VideoDO> selctHotVideo(Integer limit); Boolean updatePlayOrLike(VideoUpdate videoUpdate); List<VideoDO> selectNewVideo(); List<VideoDO> selectVideos(List<Integer> videoList); List<VideoDO> selectLikeVideos(List<Integer> interestId); }
[ "tangqyuan@gmail.com" ]
tangqyuan@gmail.com
96eb9a1e6e09a6745a3ee44f68b77d10d3dd9001
aa5b91a9198d44033de27357e4765faa49b6af73
/test/com/twu/biblioteca/ExampleTest.java
a01fb14c3ac4de8cf0a9dcd9cff68e6e28f78875
[ "Apache-2.0" ]
permissive
AndreiRupertti/twu-biblioteca-andrei
5d8d4c671acd53d75ac3efbcbc916c156b6405e5
e7f55f26828bc806b8693f6dc8ccbb8df894ea16
refs/heads/master
2020-07-01T23:31:50.502260
2019-08-14T21:31:19
2019-08-14T21:32:15
201,343,069
1
0
Apache-2.0
2020-05-19T15:47:08
2019-08-08T21:54:36
Java
UTF-8
Java
false
false
198
java
package com.twu.biblioteca; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ExampleTest { @Test public void test() { assertEquals(1, 1); } }
[ "arupertti@gmail.com" ]
arupertti@gmail.com
b2ab06dff02077bb6d002e23bf7820547110d05e
995f73d30450a6dce6bc7145d89344b4ad6e0622
/P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/com/huawei/internal/telephony/vsim/annotation/MtkSupport.java
637fb644535bce6cb787499a76f81b857747a13c
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
502
java
package com.huawei.internal.telephony.vsim.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.PARAMETER, ElementType.TYPE}) @Documented @Retention(RetentionPolicy.SOURCE) public @interface MtkSupport { }
[ "dstmath@163.com" ]
dstmath@163.com
7a8774e08c9fa7e3ecb8ff55bd60496aa4a18509
a6c79e8b62dd4ccb5de16494a3b53b1194014896
/week4/alex/concurrency/C10.java
a16b908ccbd14aed18b86adaa7630c097a279eda
[]
no_license
591958857/JavaWork
25b461ea211bddedc8001902bd7fb3787e5ab31e
3c1e71803698df988b956c09a44189ca90e84c65
refs/heads/master
2023-07-09T19:03:11.167409
2021-08-08T12:31:25
2021-08-08T12:31:25
380,425,273
1
0
null
null
null
null
GB18030
Java
false
false
1,147
java
package com.alex.concurrency; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; /* * 1,callable * 2,线程池callable * 3,join * 4,wait notify * 5,锁 * 6,自旋等待 Sleep * 7,信号量 * 8,Countdownlatch * 9,Cyclicbarrier * 10,CompletableFuture * */ //CompletableFuture public class C10 { public static void main(String[] args) { long start=System.currentTimeMillis(); CompletableFuture<Integer> cf = CompletableFuture.supplyAsync(()->{ return sum(); }); Integer result = 0; try { result = cf.get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } System.out.println("异步计算结果为:"+result); System.out.println("使用时间:"+ (System.currentTimeMillis()-start) + " ms"); } private static int sum() { return fibo(36); } private static int fibo(int a) { if ( a < 2) return 1; return fibo(a-1) + fibo(a-2); } }
[ "591958857@qq.com" ]
591958857@qq.com
da48aa96585990a4432235645319882bb68e1a3d
e1d39986f49b2d94f1560e95b7adff8901f42975
/Spring/jdbcTemp/src/main/java/service/BookService.java
dc767897eb57e71c0164a941ca1f9b89d53b020d
[]
no_license
CorvusR/MyProjects
9902e33bbd2b7c1ec576920b185d0b8b18278d1b
0d3e536893a920a3bec53063e3124029682fa547
refs/heads/master
2023-05-25T06:40:03.279045
2021-06-12T05:22:46
2021-06-12T05:22:46
376,208,931
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package service; import beans.Book; import dao.BookDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class BookService { @Autowired private BookDao bookDao; public void addBook(Book book) { bookDao.add(book); } public void deleteBook(int id) { bookDao.delete(id); } public void rewrite(Book book){ bookDao.rewrite(book); } public void rewritePlus(String name_before , String name_after){ bookDao.rewritePlus(name_before,name_after); } public void query(int id){ System.out.println(bookDao.query(1)); } public void batchAdd(List<Object[]> books){ bookDao.batchAdd(books); } }
[ "1@corvus.com" ]
1@corvus.com
b09d5b81afcf851a7f006a901808809ad2c626ee
58564326b9c7330db27f617506161b9b03147efd
/app/src/main/java/com/iniongun/dashboards/database/UrlEntity.java
16a084f5fa6bbcea4186bad8285275ee99f2d4f6
[]
no_license
IniongunIsaac/Dashboards
284fc5cc0f374fbf947ada6b4c6549dd6b2c62e2
298b2384b6d7f50adb4fbd154332df40c4c10d50
refs/heads/master
2020-04-05T21:23:40.708366
2018-11-26T08:36:29
2018-11-26T08:36:29
157,218,488
0
1
null
null
null
null
UTF-8
Java
false
false
447
java
package com.iniongun.dashboards.database; import android.arch.persistence.room.Entity; import android.arch.persistence.room.PrimaryKey; @Entity public class UrlEntity { @PrimaryKey(autoGenerate = true) public int urlId; public String url; public UrlEntity(String url) { this.url = url; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
[ "iniongunisaac@gmail.com" ]
iniongunisaac@gmail.com
afa5af08bb255cfedd78b9433be077b6e405715a
7801ec27c49880dd302b97e58e3eb3e648735a3e
/src/main/java/streaming/operations/CollectToList.java
fbd5faebde88e8c2ab9f53bf8f3b10847cb123ae
[]
no_license
Sergei1234567/stream
59f79158c8a1a700bdbc7f55d9d392438b552aa8
258ad6d0b317c89721c3ba2a59ec8e35aced2032
refs/heads/master
2020-06-12T09:58:02.569223
2019-06-28T11:53:42
2019-06-28T11:53:42
194,265,118
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package streaming.operations; // collect(toList()) – энергичная операция, порождающая список из значений //в объекте Stream import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class CollectToList { public static void main(String[] args) { List<String> collected = Stream.of("a", "b", "c").collect(Collectors.toList()); System.out.println(collected); } }
[ "berezhnoi.serg@gmail.com" ]
berezhnoi.serg@gmail.com
6deed75f258c55b408e98a355b137042d61db733
cd443150eac6f72b471e86e5b5b949fd2a061f39
/src/main/java/com/isador/trade/jbtce/privateapi/deserializer/OrderStatusDeserializer.java
27124af60947605aef28c17d872e166ac7b5ad8f
[ "Apache-2.0" ]
permissive
iisador/jBTCE
0d9f5a830e3076205665da1ee46f5d118b54622d
4394e4ef59f4d836360b24002d08e738311e300d
refs/heads/master
2021-01-19T18:11:16.675884
2017-06-23T11:44:29
2017-06-23T11:44:29
15,549,326
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.isador.trade.jbtce.privateapi.deserializer; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; import com.isador.trade.jbtce.privateapi.OrderStatus; import java.lang.reflect.Type; /** * Order status deserializer. Using Enum ordered conversion * * @author isador * @see OrderStatus * @see JsonDeserializer * @since 2.0.1 */ public class OrderStatusDeserializer implements JsonDeserializer<OrderStatus> { @Override public OrderStatus deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return OrderStatus.values()[json.getAsInt()]; } }
[ "i.isador.max89@gmail.com" ]
i.isador.max89@gmail.com
2fd764926203d81db6d7ae83c7204da8c2bef5d9
2100cabf6514e17703b7e72cdeaddb14fd34f99f
/src/main/java/Zjazd6/Ex06_01/Movable.java
b5d6bdd5bbd17db446c5b999a957e25dadd71971
[]
no_license
s20495-pj/POJ_MichalWadas
17355823edadcebd7138e553761ace36182e17ec
4dcadefc1bbfade014364e04063e5f96be944e9c
refs/heads/master
2021-02-03T20:12:01.007326
2020-06-14T11:50:35
2020-06-14T11:50:35
243,531,774
0
0
null
2020-10-13T20:43:39
2020-02-27T13:55:24
Java
UTF-8
Java
false
false
230
java
package Zjazd6.Ex06_01; /** * summary: Implement UML chart, exercise 06_01: Movable * author: Michal Wadas **/ public interface Movable { void moveUp(); void moveDown(); void moveLeft(); void moveRight(); }
[ "michal.wadas@hycom.pl" ]
michal.wadas@hycom.pl
78b01d94e5ae46da354227c5f74f1c84a0ee5615
0ca6cb919d10b8a760a8cf5c9bb52fbf32836de2
/UCSAndroid/ucsandroid/src/main/java/org/wso2/balana/ObligationResult.java
e7db39796b6062764cd006b83ba4c1c27dedf286
[]
no_license
tezcan10/ucsandroid
74527a590832cce3d7834bb3898ec7b8827a3349
01432da631dd09860e515ade6578290b9c3f5a87
refs/heads/master
2020-06-22T02:49:05.076738
2019-07-18T15:41:10
2019-07-18T15:41:10
197,614,591
0
0
null
2019-07-18T15:38:03
2019-07-18T15:38:02
null
UTF-8
Java
false
false
390
java
package org.wso2.balana; import java.io.OutputStream; public abstract interface ObligationResult { public abstract void encode(OutputStream paramOutputStream); public abstract void encode(OutputStream paramOutputStream, Indenter paramIndenter); } /* Location: * Qualified Name: org.wso2.balana.ObligationResult * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */
[ "antoniolm23@gmail.com" ]
antoniolm23@gmail.com
478388ebd082b983128340ad560e24caee10aca0
4496b9ef951104a8346f7adc119b70a607d9a1e3
/app/src/main/java/com/example/oscarvazquez/firebasetest/MainActivity.java
52375b55b3b3bd6b76aeaa46419daafc7634fa82
[]
no_license
oxcarod/FirebaseTest
3bc0837c1ea57a375958aa692679d1e4f3f519c9
8feee2882cc82fcf5baf6b3347f9fc0ed1ff8e15
refs/heads/master
2021-05-07T03:22:16.879700
2017-11-15T16:32:06
2017-11-15T16:32:06
110,858,286
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
package com.example.oscarvazquez.firebasetest; import android.content.Context; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Context context = getApplicationContext(); } }
[ "oxcarod@hotmail.com" ]
oxcarod@hotmail.com
a307a327cdf7a96d28990150d9bf20c6f30d1206
f79ca72f2a81c01e11e4f0666e1ae8432c4c976e
/app/src/main/java/headline/news/newsheadline/model/NewsModel.java
383e933ab9338e8c85e4b43e4587b70a4c1d43cf
[]
no_license
prakashbalab24/News-Headlines
f058ea3f930b5d978da0973fdcae5d576d523947
8ad5d4cec93aba0c788d59bb5dee7e6b9a706405
refs/heads/master
2021-01-12T03:23:21.802655
2017-01-19T08:47:49
2017-01-19T08:47:49
78,205,479
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package headline.news.newsheadline.model; /** * Created by prakash-bala on 14/12/16. */ public class NewsModel { private String title; private String thumbnail; private String sourceUrl; private int localThumbnail; public NewsModel() { } public NewsModel(String title, String thumbnail,String sourceUrl) { this.title = title; this.thumbnail = thumbnail; this.sourceUrl = sourceUrl; } public NewsModel(String title, int localThumbnail) { this.title = title; this.localThumbnail = localThumbnail; } public String getTitle() { return title; } public void setTitle(String name) { this.title = name; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } public String getSourceUrl() { return sourceUrl; } public void setSourceUrl(String sourceUrl) { this.sourceUrl = sourceUrl; } public int getLocalThumbnail() { return localThumbnail; } public void setLocalThumbnail(int localThumbnail) { this.localThumbnail = localThumbnail; } }
[ "prakashbala.b24@gmail.com" ]
prakashbala.b24@gmail.com
c87c931c51ddb3bea2df3c41de4544f7641f3f6d
0465d3fa759ac7b66fa31f45236966caf533ee89
/ijaaaaava/src/cn/eas/base/BaseMessagedb.java
795f3b896dcbd24f4a45cb7dd89791c87a952d99
[]
no_license
ipiszy/javahomework
d8cba902fb669a57780aa774daf9eceaedcdc564
bf9fe15cf77193a0f4ad583d93c28d09c09a0bac
refs/heads/master
2021-01-10T10:21:10.121649
2008-07-31T10:35:49
2008-07-31T10:35:49
49,164,545
0
0
null
null
null
null
UTF-8
Java
false
false
3,666
java
package cn.eas.base; import java.io.Serializable; /** * This is an object that contains data related to the messagedb table. * Do not modify this class because it will be overwritten if the configuration file * related to this class is modified. * * @hibernate.class * table="messagedb" */ public abstract class BaseMessagedb implements Serializable { public static String REF = "Messagedb"; public static String PROP_DATE = "Date"; public static String PROP_MESSAGE = "Message"; public static String PROP_USERNAME = "Username"; public static String PROP_ID = "Id"; public static String PROP_MESSAGELEAVER = "Messageleaver"; // constructors public BaseMessagedb () { initialize(); } /** * Constructor for primary key */ public BaseMessagedb (long id) { this.setId(id); initialize(); } /** * Constructor for required fields */ public BaseMessagedb ( long id, java.lang.String username, java.lang.String messageleaver, java.lang.String message) { this.setId(id); this.setUsername(username); this.setMessageleaver(messageleaver); this.setMessage(message); initialize(); } protected void initialize () {} private int hashCode = Integer.MIN_VALUE; // primary key private long id; // fields private java.lang.String username; private java.lang.String messageleaver; private java.lang.String message; private java.lang.String date; /** * Return the unique identifier of this class * @hibernate.id * generator-class="identity" * column="id" */ public long getId () { return id; } /** * Set the unique identifier of this class * @param id the new ID */ public void setId (long id) { this.id = id; this.hashCode = Integer.MIN_VALUE; } /** * Return the value associated with the column: username */ public java.lang.String getUsername () { return username; } /** * Set the value related to the column: username * @param username the username value */ public void setUsername (java.lang.String username) { this.username = username; } /** * Return the value associated with the column: messageleaver */ public java.lang.String getMessageleaver () { return messageleaver; } /** * Set the value related to the column: messageleaver * @param messageleaver the messageleaver value */ public void setMessageleaver (java.lang.String messageleaver) { this.messageleaver = messageleaver; } /** * Return the value associated with the column: message */ public java.lang.String getMessage () { return message; } /** * Set the value related to the column: message * @param message the message value */ public void setMessage (java.lang.String message) { this.message = message; } /** * Return the value associated with the column: date */ public java.lang.String getDate () { return date; } /** * Set the value related to the column: date * @param date the date value */ public void setDate (java.lang.String date) { this.date = date; } public boolean equals (Object obj) { if (null == obj) return false; if (!(obj instanceof cn.eas.Messagedb)) return false; else { cn.eas.Messagedb messagedb = (cn.eas.Messagedb) obj; return (this.getId() == messagedb.getId()); } } public int hashCode () { if (Integer.MIN_VALUE == this.hashCode) { return (int) this.getId(); } return this.hashCode; } public String toString () { return super.toString(); } }
[ "ipiszy@1ed89adf-6c51-0410-a788-b37564eced82" ]
ipiszy@1ed89adf-6c51-0410-a788-b37564eced82
8885cf54597d7229a775a22b60237c2ad367194c
c7a49054341dba454a31aa3c5d6348f078ec8d4c
/src/main/java/com/weibo/remind/Remind.java
7e8d67bad2b8874ec1142a1b4cdb3b67d01eb138
[]
no_license
clarkjia/vipblog
ad42d454cac71c923960a44d80e1c5dff4ee5017
5568a614a021e92f7f833da9d522239bc1e6072f
refs/heads/master
2021-05-10T16:51:27.435016
2018-02-11T06:45:07
2018-02-11T06:45:07
118,589,603
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.weibo.remind; import com.weibo.weibo4j.Reminds; import com.weibo.weibo4j.model.WeiboException; import com.weibo.weibo4j.org.json.JSONObject; public class Remind { public static void main(String[] args) { String access_token = args[0]; Reminds rm = new Reminds(access_token); try { JSONObject jo = rm.getUnreadCountOfRemind(); System.out.println(jo.toString()); } catch (WeiboException e) { e.printStackTrace(); } } }
[ "jiaaiqiang@jd.com" ]
jiaaiqiang@jd.com
6a5d2d96efe1f9fead146c3d63a6d1419cc22efb
5fddb9a3f85f50cdefe3bf29ca06b33ad44bcd62
/src/main/java/com/syncleus/aethermud/game/Commands/AutoAssist.java
582f24578bb332c743ed4b367a64b432f07ec027
[ "Apache-2.0" ]
permissive
freemo/AetherMUD-coffee
da315ae8046d06069a058fb38723750a02f72853
dbc091b3e1108aa6aff3640da4707ace4c6771e5
refs/heads/master
2021-01-19T22:34:29.830622
2017-08-26T14:01:24
2017-08-26T14:06:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,023
java
/** * Copyright 2017 Syncleus, Inc. * with portions copyright 2004-2017 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. */ package com.syncleus.aethermud.game.Commands; import com.syncleus.aethermud.game.MOBS.interfaces.MOB; import com.syncleus.aethermud.game.core.CMParms; import java.util.List; public class AutoAssist extends StdCommand { private final String[] access = I(new String[]{"AUTOASSIST"}); public AutoAssist() { } @Override public String[] getAccessWords() { return access; } @Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands, 1) : ""; if ((mob.isAttributeSet(MOB.Attrib.AUTOASSIST) && (parm.length() == 0)) || (parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB.Attrib.AUTOASSIST, false); mob.tell(L("Autoassist has been turned on.")); } else if ((!mob.isAttributeSet(MOB.Attrib.AUTOASSIST) && (parm.length() == 0)) || (parm.equalsIgnoreCase("OFF"))) { mob.setAttribute(MOB.Attrib.AUTOASSIST, true); mob.tell(L("Autoassist has been turned off.")); } else if (parm.length() > 0) { mob.tell(L("Illegal @x1 argument: '@x2'. Try ON or OFF, or nothing to toggle.", getAccessWords()[0], parm)); } return false; } @Override public boolean canBeOrdered() { return true; } }
[ "jeffrey.freeman@syncleus.com" ]
jeffrey.freeman@syncleus.com
9e0010c577652ee79bef700e07fd98869162bca6
5b8a1b21ed3398b3d9499de4625b600248abed05
/Psquiza/src/projetoLP2/enums/Status.java
89494f232199e8184fd2b7035dc34f8554bb72f4
[]
no_license
charles-bezerra/Projeto-LabP2
f195c4f507559f9c412c0af5d74542e8c7e50860
9de36b8bb51d6ae7624c5abe3c83432ee1f99bc4
refs/heads/master
2020-08-27T09:16:04.802469
2019-11-21T13:50:39
2019-11-21T13:50:39
217,312,833
0
1
null
null
null
null
UTF-8
Java
false
false
372
java
package projetoLP2.enums; /** * Enumera o status de um item de uma atividade metodologica * @author Charles Bezerra de Oliveira Junior */ public enum Status { PENDENTE("PENDENTE"), REALIZADO("REALIZADO"); private String valor; Status(String valor) { this.valor = valor; } public String getValor() { return this.valor; } }
[ "charlesbezerra5@gmail.com" ]
charlesbezerra5@gmail.com
9720f2edff632a40a31e0aef794c0210ac181e1e
028251327078c74eb17c5c01e206ac27953d6872
/lubigAPI/src/main/java/com/enp/lubig/dao/SystemLogDAO.java
f99188bc200b554d8d9152299a61a12173fa9bf0
[]
no_license
pcr3831/springboot
46ac46ba725fa9816744d06cc1e8e379522deeb7
7bc9533fa0a5041f57e7a1c38324d900e3366c62
refs/heads/master
2021-04-27T18:12:46.316184
2019-01-09T01:20:35
2019-01-09T01:20:35
122,335,431
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.enp.lubig.dao; import java.util.List; import org.springframework.stereotype.Repository; import com.enp.lubig.vo.SystemLogVO; @Repository("_systemLogDAO") public interface SystemLogDAO { public int insertSystemLog() throws Exception; public List<SystemLogVO> selectSystemLog(SystemLogVO systemLogVO) throws Exception; /* public int updateSystemLog() throws Exception; public int deleteSystemLog() throws Exception; */ }
[ "crPark@MAUI-WORKER" ]
crPark@MAUI-WORKER
d84d37843b24823785bdf836274ab70034d56858
272ecbf30d2f7561c7924fff4f852d004f96270e
/chzy-uaa/src/main/java/com/central/oauth/openid/OpenIdAuthenticationProvider.java
8632822f5322f511b96539e1844c97554fec5f26
[ "Apache-2.0" ]
permissive
liguangyue/chzy
10be54bde6a2ca7c6d7ace185a4e850625b36e28
4a8523ea989da49eb3a46f97d248c5662186c4ed
refs/heads/master
2022-06-26T13:36:55.576677
2019-11-06T08:47:24
2019-11-06T08:47:24
219,940,889
3
1
null
null
null
null
UTF-8
Java
false
false
1,709
java
package com.central.oauth.openid; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.InternalAuthenticationServiceException; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.social.security.SocialUserDetailsService; /** * @author ligy7 */ public class OpenIdAuthenticationProvider implements AuthenticationProvider { private SocialUserDetailsService userDetailsService; @Override public Authentication authenticate(Authentication authentication) { OpenIdAuthenticationToken authenticationToken = (OpenIdAuthenticationToken) authentication; String openId = (String) authenticationToken.getPrincipal(); UserDetails user = userDetailsService.loadUserByUserId(openId); if (user == null) { throw new InternalAuthenticationServiceException("openId错误"); } OpenIdAuthenticationToken authenticationResult = new OpenIdAuthenticationToken(user, user.getAuthorities()); authenticationResult.setDetails(authenticationToken.getDetails()); return authenticationResult; } @Override public boolean supports(Class<?> authentication) { return OpenIdAuthenticationToken.class.isAssignableFrom(authentication); } public SocialUserDetailsService getUserDetailsService() { return userDetailsService; } public void setUserDetailsService(SocialUserDetailsService userDetailsService) { this.userDetailsService = userDetailsService; } }
[ "liy7@asiainfo.com" ]
liy7@asiainfo.com
60a23717b8ac02e156b6fe8c47e8669896bb5a74
b1b5586f4de1a39a33a1434892117d50c28d0f4f
/src/test/java/interviewprograms/PyramidStars7.java
ef9041b4161101c7035e086b15715f68334f2dcc
[]
no_license
rohankumargattu/sunmicrosystems
31a7c2f31d4c81ba28603a3b8db5322a1d2b689c
6d5167bc25fd40b7983874151b23db5060bcc76f
refs/heads/master
2023-03-15T01:50:43.324602
2021-03-29T21:02:21
2021-03-29T21:02:21
342,023,905
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package interviewprograms; public class PyramidStars7 { public static void main(String[] args) throws Exception { for(int i=1;i<=5;i++) { for(int j=5;j>i;j--) { System.out.print(" "); } for(int k=1;k<=i;k++) { System.out.print("* "); } for(int r=2;r<=i;r++) { System.out.print("* "); } System.out.println(); } } }
[ "gattu@DESKTOP-D8HNM4S" ]
gattu@DESKTOP-D8HNM4S
3270c49a6f3675d9fe92d2ce89d826d7fc2805fc
1a8ceb6299a7b559128d40009966f9c03e40d9a2
/src/core/abstracts/VerificationService.java
261487d59794b41125e9d5707a482a48c7c1deb0
[]
no_license
tuncerrstm/UserValidationOPP
0ce1c6aa796cdbe120a9afa4ad42466a73fc4403
da54f3d78db923d90bd2d16f13fb1bd303b839a0
refs/heads/main
2023-04-25T06:41:19.930068
2021-05-21T21:15:52
2021-05-21T21:15:52
369,654,888
1
0
null
null
null
null
UTF-8
Java
false
false
135
java
package core.abstracts; import entities.concretes.User; public interface VerificationService { boolean verificate(User user); }
[ "tuncerrstm@gmail.com" ]
tuncerrstm@gmail.com
fc26787e2dc6a641dffffe7c33b5583654c59ad6
bec1b1bb06d3aead3f266ff75083cf48c0d04354
/src/main/java/ActorsReader.java
9bfb58c6231f7f9fb3d9028dd1ed2b853c2a673c
[]
no_license
MKrezheska/NBPXML
fefe0fba7d7e92adb3ff3301104ff6caf9ffab1f
588f4ba4016c8ffa810db7da51cbcbdac2195601
refs/heads/master
2023-02-24T04:55:06.411804
2021-01-31T12:43:34
2021-01-31T12:43:34
334,144,358
0
0
null
null
null
null
UTF-8
Java
false
false
2,944
java
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.util.Bytes; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; public class ActorsReader { public static void main(String[] args) throws IOException { int CHARACTER = 0; int GENDER = 1; int NAME_ACTOR = 3; int ID_MOVIE = 4; int TITLE = 5; int RATING = 6; int ID_ACTOR = 7; //HBase configuration Configuration config = HBaseConfiguration.create(); //Get connection instance from configuration Connection connection = ConnectionFactory.createConnection(config); //Get movie table instance Table ratingsTable = connection.getTable(TableName.valueOf("actors_table")); //Read data from file int i = 0; File file = new File("C:\\Users\\Magdalena\\OneDrive\\Desktop\\archive\\last_kveri.csv"); try (BufferedReader br = new BufferedReader(new FileReader(file))) { String line; while ((line = br.readLine()) != null) { String row_key = ""; String[] data = line.split("\\|"); String actorId = data[ID_ACTOR].replaceAll("[^0-9]", ""); System.out.println(actorId); row_key+= actorId + "+" + data[RATING] + "+" + data[ID_MOVIE]; Put p = new Put(Bytes.toBytes(row_key)); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("character"), Bytes.toBytes(data[CHARACTER])); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("gender"), Bytes.toBytes(data[GENDER])); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("id_actor"), Bytes.toBytes(actorId)); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("name_actor"), Bytes.toBytes(data[NAME_ACTOR])); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("id_movie"), Bytes.toBytes(data[ID_MOVIE])); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("title"), Bytes.toBytes(data[TITLE])); p.addColumn(Bytes.toBytes("actors"), Bytes.toBytes("rating"), Bytes.toBytes(data[RATING])); ratingsTable.put(p); } } } }
[ "magdalena_krezeska@hotmail.com" ]
magdalena_krezeska@hotmail.com
e5e648a048cd191aa61dea9d6488110141c10cf0
4acd854c17c1cc730fd6b000994ba61342f26869
/src/DesignPatten/ComponentMethod/Company.java
6094231e985bdea20bd219d158f383bde010d027
[]
no_license
Morty123456/LeetCode
836b2e9e72e94db5ce0244bc11e3bd4ce56dcf01
c2de2f6e4ea0978bea8727d43375ec72cc8f4062
refs/heads/master
2020-11-26T20:12:06.048471
2020-11-23T02:10:09
2020-11-23T02:10:09
229,196,094
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package DesignPatten.ComponentMethod; abstract class Company { protected String name; public Company(String name){ this.name = name; } // public Company(){}; // public Company(){} public abstract void Add(Company c); public abstract void Remove(Company c); public abstract void Display(int depth); public abstract void LineOfDuty(); }
[ "13021151355@163.com" ]
13021151355@163.com
dd11c89273eefea544e39c2c68be2082521c2e14
c76f129c8b51f45300fb1bb63663c5362e7d6448
/src/main/java/com/zd/carbarn/dao/SysMenuRepo.java
a4b84d8b7fcd83b4eb3112742cea03b86805cd8f
[]
no_license
dengpau/carbarn
dc19197ea1224ae4620512f4b0b8aba6f9d62166
3cc4d7e30e24debc25b4ebaca010548fcd4e0b52
refs/heads/master
2021-01-22T13:23:07.686602
2017-09-15T06:49:13
2017-09-15T06:49:13
100,666,223
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package com.zd.carbarn.dao; import com.zd.carbarn.entity.SystemMenu; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * @Author: DJQ * @Date: 2017/9/7 下午2:06 */ @Repository public interface SysMenuRepo extends JpaRepository<SystemMenu,Integer> { }
[ "31118466+dengpau@users.noreply.github.com" ]
31118466+dengpau@users.noreply.github.com
e220a5b4e231d3ba02ac7619964515bc35c895dc
500a81516b777e0275a379bf3b8cdaa3227c521a
/src/ValidationOfThings/ITTeacher.java
a1e65c4860451f8950bacb8108c5427894ec8fc8
[]
no_license
SochiCheat/Interface_abstract_hw
b709f8fe52e77539d96b3a5161df65a299dbadbd
e9e0cab796e6634d215932cdbea9cdc314405d1d
refs/heads/master
2022-04-02T22:18:04.390041
2020-01-29T13:50:20
2020-01-29T13:50:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package ValidationOfThings; public class ITTeacher extends Thing { private int yearsOfExperience; private boolean teaching; public ITTeacher(String name, int yearsOfExperience, boolean teaching ) { super(name); this.yearsOfExperience = yearsOfExperience; this.teaching= teaching; } @Override public boolean isValid() { // TODO Auto-generated method stub if(yearsOfExperience > 2) { return true; }else { return false; } } @Override public String toString() { String result; if(isValid()) { result = " valid"; }else { result = " Not valid"; } return super.toString() + result; } }
[ "sochicheat@gmail.com" ]
sochicheat@gmail.com
14b024b1a5d6fd273daaadb2b0f5c62b9a622856
d18110961e4708ace94ffecd2c488fe84c9d5cd2
/src/main/java/com/kobi/example/demo/dto/ReportDto.java
18fbd7e295301cb58bdb7ca800924867c19c4af0
[]
no_license
kobi-lemberg/springboot-executor
0cce4399dd1f7b5f3b8eeb28413363ca04448b74
0a525ec48ddce7ecedb8c81c025c742647c7b4cb
refs/heads/master
2022-04-22T16:55:42.824433
2020-04-20T06:00:55
2020-04-20T06:00:55
257,185,863
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package com.kobi.example.demo.dto; import lombok.Value; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import java.time.LocalTime; @Value public class ReportDto { @Length(max = 50, min = 1, message = "Length of report name should be between 1 to 50") private final String name; @Min(0) @Max(24) private int hourToRun; @Min(0) @Max(60) private int minutesToRun; }
[ "kobi.lemberg@pipl.com" ]
kobi.lemberg@pipl.com
05fb348aa7633770099f0b13be6dded9a037f56c
774a935fd2ea995044214b2246b1c1f1b6e46854
/bullpen-web/src/main/java/net/acesinc/ats/web/repository/PasswordResetRequestRepository.java
ca648c3cc4c23844b00c7c197c4a5ea2f754a4ab
[]
no_license
JLLeitschuh/bullpen
f18a4ec0169ce14f6360db73ad267975d42d1a39
3d45d56f5f62404f65f886a7e2c7fb476c295eab
refs/heads/master
2021-01-02T15:24:15.195482
2017-04-26T00:02:40
2017-04-26T00:02:40
239,680,785
0
0
null
2020-11-17T17:27:40
2020-02-11T05:05:40
null
UTF-8
Java
false
false
638
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package net.acesinc.ats.web.repository; import net.acesinc.ats.web.data.PasswordResetRequest; import org.springframework.data.repository.PagingAndSortingRepository; /** * * @author andrewserff */ public interface PasswordResetRequestRepository extends PagingAndSortingRepository<PasswordResetRequest, String> { public PasswordResetRequest findByEmail(String email); public PasswordResetRequest findByIdAndEmail(String id, String email); }
[ "dylankolson@gmail.com" ]
dylankolson@gmail.com
c90df853169c90f33ce330342f9b616e6293a04e
0c52e6cd9861addedd64f7788c7ccd2c8095a9a0
/app/src/main/java/com/ali/demo/api/AlipayUploadRequest.java
0f48256953ba4529f74c47ad35009202d3f91267
[]
no_license
RayJack1011/TianHePay
d4c1a6e6efb85e1e4b3ba3425326e1825bcfebaa
af6f203ac79047b07080ade5d8529a718804735e
refs/heads/master
2020-03-29T08:09:48.174303
2018-09-21T02:11:32
2018-09-21T02:11:32
149,696,827
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.ali.demo.api; import java.util.Map; public interface AlipayUploadRequest<T extends AlipayResponse> extends AlipayRequest<T> { /** * 获取所有的Key-Value形式的文件请求参数集合。其中: * <ul> * <li>Key: 请求参数名</li> * <li>Value: 请求参数文件元数据</li> * </ul> * * @return 文件请求参数集合 */ public Map<String, FileItem> getFileParams(); }
[ "rayjack1011@163.com" ]
rayjack1011@163.com
7084b3850ede88c5532aeb1aebd69d8faa4955a5
8762293e9c50723dad93e3464e2fa16f76aa7d91
/app/src/main/java/com/bonson/qqtapk/model/db/UserDao.java
2f522d77744f6675126c973e9bd8cbff982a20d4
[]
no_license
bonsonjjc/qqtapk
e4921c29335590e069dee47e1234c8c65748f7bc
f41f8dad10a7537c72f9a09447a62f7ebb4c59a7
refs/heads/master
2018-11-02T02:59:13.352258
2018-08-24T06:35:46
2018-08-24T06:35:46
116,576,391
0
1
null
null
null
null
UTF-8
Java
false
false
1,227
java
package com.bonson.qqtapk.model.db; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Delete; import android.arch.persistence.room.Insert; import android.arch.persistence.room.OnConflictStrategy; import android.arch.persistence.room.Query; import android.arch.persistence.room.Update; import com.bonson.qqtapk.model.bean.Baby; import com.bonson.qqtapk.model.bean.User; import java.util.List; import io.reactivex.Flowable; /** * Created by zjw on 2018/1/2. */ @Dao public interface UserDao { @Insert(onConflict = OnConflictStrategy.REPLACE) long insertUer(User user); @Query("select * from users") User user(); @Update void update(User user); @Delete int deleteUser(User user); @Insert(onConflict = OnConflictStrategy.REPLACE) Long[] insertBaby(Baby... baby); @Insert(onConflict = OnConflictStrategy.REPLACE) List<Long> insertBaby(List<Baby> baby); @Delete int deleteBaby(Baby baby); @Query("select * from babys where fid = :id") Baby baby(String id); @Query("select * from babys order by fid asc") Flowable<List<Baby>> babyList(); @Query("select * from babys order by fid asc") List<Baby> babies(); }
[ "iagghdfdn@qq.com" ]
iagghdfdn@qq.com
26fb7ba4a0aea40bbdefa3532923f899441f609c
aabeefe120bcb9680d0c074224c6c9771e61033c
/src/test/java/com/gos/dao/CartDAOTest.java
e8bb9a5b3b36048924f058923f64aedf972d98d1
[]
no_license
geekymv/ssmm
edcdcd214daf2c814dfdaba0c437a855aab60648
60791ceef5b14ffe9ff06fc0972e74a20937ac93
refs/heads/master
2021-01-23T03:04:12.052065
2014-12-15T06:57:11
2014-12-15T06:57:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
814
java
package com.gos.dao; import java.util.List; import javax.annotation.Resource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.gos.model.Cart; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/beans.xml") public class CartDAOTest { private CartDAO cartDAO; @Resource public void setCartDAO(CartDAO cartDAO) { this.cartDAO = cartDAO; } @Test public void test() { Cart cart = cartDAO.query(1, 1); System.out.println(cart); } @Test public void testQueryMyCart() { List<Cart> carts = cartDAO.queryMyCart(1); for (Cart cart : carts) { System.out.println(cart); } } }
[ "ym2011678@foxmail.com" ]
ym2011678@foxmail.com
c4d783b6c247a1be74a47f37df70fabec0946de1
252e3d90f333abd22b692ffa5800d9e2abd024a3
/src/main/java/pl/msmet/voucherstore/sales/payment/PayUPaymentGateway.java
926ee045aaecc49c22389dd3bc2ee1842eca8081
[]
no_license
Lavyel/voucherstore
55dd96d6c6656d3f3efc71f533788ada62313d92
6df17a75b9cd0bdd1bbf321883098b9a2ba1a5ab
refs/heads/main
2023-03-18T09:47:24.251016
2021-03-06T20:42:58
2021-03-06T20:42:58
345,180,983
0
0
null
null
null
null
UTF-8
Java
false
false
2,266
java
package pl.msmet.voucherstore.sales.payment; import pl.msmet.payu.PayU; import pl.msmet.payu.exceptions.PayUException; import pl.msmet.payu.model.Buyer; import pl.msmet.payu.model.OrderCreateRequest; import pl.msmet.payu.model.Product; import pl.msmet.voucherstore.sales.ordering.Reservation; import java.util.stream.Collectors; public class PayUPaymentGateway implements PaymentGateway { private final PayU payU; public PayUPaymentGateway(PayU payU) { this.payU = payU; } @Override public PaymentDetails register(Reservation reservation) { var orderCreateRequest = formReservation(reservation); try { var response = payU.handle(orderCreateRequest); return PaymentDetails.builder() .paymentId(response.getOrderId()) .paymentUrl(response.getRedirectUri()) .reservationId(reservation.getId()) .build(); } catch (PayUException e) { throw new PaymentException(e); } } private OrderCreateRequest formReservation(Reservation reservation) { return OrderCreateRequest.builder() .customerIp("127.0.0.1") .description(String.format("Payment for reservations with id %s", reservation.getId())) .currencyCode("PLN") .totalAmount(reservation.getTotal()) .extOrderId(reservation.getId()) .buyer(Buyer.builder() .email(reservation.getCustomerEmail()) .firstName(reservation.getCustomerFirstname()) .lastName(reservation.getCustomerLastname()) .language("pl") .build()) .products( reservation.getItems().stream() .map(ri -> new Product(ri.getName(), ri.getUnitPrice(), ri.getQuantity())) .collect(Collectors.toList())) .build(); } @Override public boolean isTrusted(PaymentUpdateStatusRequest paymentUpdateStatusRequest) { return payU.isTrusted(paymentUpdateStatusRequest.getBody(), paymentUpdateStatusRequest.getSignature()); } }
[ "noreply@github.com" ]
Lavyel.noreply@github.com
a33cf49614c0de014c1afd7dca56c1f3ad438972
62efa3f5038377c804d60445d154eb1a9ac1f315
/java/src/main/java/com/hansheng/Thread/TextThreadMethod.java
7f57e13664a3c2968213653f61cdb6435fe229c5
[ "Apache-2.0" ]
permissive
MrWu94/AndroidNoteX
5a3122704e3968c6e47c9ac7f3c68da3a3dd32ff
b8d837582d23356a81aaa53e95adfcb4b2a6f715
refs/heads/master
2021-07-16T01:53:56.612465
2017-10-23T13:12:18
2017-10-23T13:12:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,378
java
package com.hansheng.Thread; /** * Created by hansheng on 2016/10/3. * 调用yield(),不同优先级的线程永远不会得到执行机会。 * sleep()使当前线程进入停滞状态,所以执行sleep()的线程在指定的时间内肯定不会执行; * yield()只是使当前线程重新回到可执行状态,所以执行yield()的线程有可能在进入到可执行状态后马上又被执行。 * yield():暂停当前正在执行的线程对象,并执行其他线程。 */ class TestThreadMethod extends Thread{ public static int shareVar = 0; public TestThreadMethod(String name){ super(name); } public void run(){ for(int i=0; i<4; i++){ System.out.print(Thread.currentThread().getName()); System.out.println(" : " + i); Thread.yield(); // /* (2) */ // try{ // Thread.sleep(3000); // } // catch(InterruptedException e){ // System.out.println("Interrupted"); // }} }} } class TestThread{ public static void main(String[] args){ TestThreadMethod t1 = new TestThreadMethod("t1"); TestThreadMethod t2 = new TestThreadMethod("t2"); t1.setPriority(Thread.MAX_PRIORITY); t2.setPriority(Thread.MIN_PRIORITY); t1.start(); t2.start(); } }
[ "shenghanming@gmai.com" ]
shenghanming@gmai.com
feaedde818797f9ff7fbeafca3169744003012ab
8a06957394b9173cac67868a2fda27ac2c3a3729
/spring-mybatis-sharding-jdbc/src/main/java/com/company/sharding/precise/DatabaseInlineAlgorithm.java
c6a0b98ec36fb6364b39a6a6cd2227076beadb13
[]
no_license
BinLee218/spring-cloud-my
f5fcfbb158e1f0968cf19f4eeb7cabf02b1c94f2
61c6ab46ed7f6724e10253691bdd12117ae4c0c5
refs/heads/master
2023-04-19T17:23:00.935203
2021-05-18T09:44:31
2021-05-18T09:44:31
289,687,884
3
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package com.company.sharding.precise; import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm; import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue; import java.util.Collection; import java.util.LinkedHashSet; import java.util.LinkedList; /** * @author bin.li * @date 2020/9/24 * 分库的自定义逻辑 * */ public class DatabaseInlineAlgorithm implements PreciseShardingAlgorithm { @Override public String doSharding(Collection availableTargetNames, PreciseShardingValue shardingValue) { if (shardingValue.getLogicTableName().equals("book_info")) { if(shardingValue.getColumnName().equals("book_type")){ Integer value = Integer.parseInt(shardingValue.getValue().toString()); LinkedHashSet<String> linkedHashSet = (LinkedHashSet<String>) availableTargetNames; String[] objects = linkedHashSet.toArray(new String[]{}); String object = objects[value]; return object; } } return null; } }
[ "bin.li@pintec.com" ]
bin.li@pintec.com
22d0984c543405b7e4bb730d3b2841619d62ec34
eca7ed2dde0e3dc3aa0452d26ea931cc025bb60b
/caliper/src/main/java/com/google/caliper/Benchmark.java
06bda82416f2086f3a4b571472277682943018fc
[ "Apache-2.0" ]
permissive
peterlynch/caliper
3304e4e413ac0bfe1c2f18275b6f32cf654616ec
e9ab49811aba6e15cd1bff953db7238d7fd40fa4
refs/heads/master
2020-03-29T23:58:38.468809
2011-11-09T16:12:16
2011-11-09T16:12:16
2,742,704
3
1
null
null
null
null
UTF-8
Java
false
false
1,746
java
/* * Copyright (C) 2009 Google 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.google.caliper; import java.util.Map; import java.util.Set; /** * A collection of benchmarks that share a set of configuration parameters. */ public interface Benchmark { Set<String> parameterNames(); Set<String> parameterValues(String parameterName); ConfiguredBenchmark createBenchmark(Map<String, String> parameterValues); /** * A mapping of units to their values. Their values must be integers, but all values are relative, * so if one unit is 1.5 times the size of another, then these units can be expressed as * {"unit1"=10,"unit2"=15}. The smallest unit given by the function will be used to display * immediate results when running at the command line. * * e.g. 0% Scenario{...} 16.08<SMALLEST-UNIT>; σ=1.72<SMALLEST-UNIT> @ 3 trials */ Map<String, Integer> getTimeUnitNames(); Map<String, Integer> getInstanceUnitNames(); Map<String, Integer> getMemoryUnitNames(); /** * Converts nanoseconds to the smallest unit defined in {@link #getTimeUnitNames()}. */ double nanosToUnits(double nanos); double instancesToUnits(long instances); double bytesToUnits(long bytes); }
[ "peter@peterlynch.ca" ]
peter@peterlynch.ca
85bc834347d300a0cccc8dcb107075769fdd31ff
ab918939f5de4246046ef24bc313e9e602d24792
/trunk/oncotcap/src/main/java/oncotcap/display/editor/persistibleeditorpanel/FilterEditorPanel.java
a2027c6eb48d3e46dcb19906635af52004547bb5
[]
no_license
professorbeautiful/oncotcap
3c3006ff9d9da5283ba8e77378dcaf74b7fb9e3f
5025b8b921f26cd74076eb26241c7041a7bc8d34
refs/heads/master
2021-01-21T18:10:37.083536
2014-02-19T15:59:26
2014-02-19T15:59:26
15,146,293
0
0
null
null
null
null
UTF-8
Java
false
false
13,814
java
package oncotcap.display.editor.persistibleeditorpanel; import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import java.awt.datatransfer.*; import javax.swing.border.*; import java.util.*; import java.io.*; import java.lang.reflect.Array; import oncotcap.util.*; import oncotcap.datalayer.Persistible; import oncotcap.display.browser.OncBrowser; import oncotcap.display.browser.GenericTreeNode; import oncotcap.display.browser.GenericTreeNodeRenderer; import oncotcap.display.browser.DoubleClickListener; import oncotcap.display.browser.DoubleClickEvent; import oncotcap.display.common.DragDropLabel; import oncotcap.display.common.Droppable; import oncotcap.display.common.OncTreeNode; import oncotcap.display.editor.EditorFrame; import oncotcap.datalayer.persistible.*; import oncotcap.datalayer.persistible.parameter.*; import javax.swing.tree.*; public class FilterEditorPanel extends EditorPanel implements TreeModelListener, DoubleClickListener, NodeDeleteListener { public BooleanTree booleanTree; protected OperatorPane operators; protected JPanel stageAndClassPanel; private JPanel classPanel; private JPanel stagePanel; private OncFilter filter; protected OncTreeNode rootNode; protected DefaultTreeModel model; private Droppable droppedItem = null; private boolean keywordsOnly = false; public FilterEditorPanel() { // setBorder(BorderFactory.createLineBorder(Color.blue, 3)); // rootNode = new OncTreeNode(OncFilter.rootFilterObj); // model = new DefaultTreeModel(rootNode); init(); } public FilterEditorPanel(Droppable dropped) { this(dropped, false); } public FilterEditorPanel(Droppable dropped, boolean keywordsOnly) { droppedItem = dropped; this.keywordsOnly = keywordsOnly; } public FilterEditorPanel(OncFilter filter) { init(); edit(filter); } public static void main(String [] args) { EditorFrame.showEditor(new OncFilter()); // JFrame jf = new JFrame(); // FilterEditorPanel fp = new FilterEditorPanel(); // fp.edit(new OncFilter()); // jf.getContentPane().add(fp); // jf.setSize(500,500); // jf.setVisible(true); } private void init() { // setBorder(BorderFactory.createLineBorder(Color.blue, 3)); rootNode = new OncTreeNode(OncFilter.rootFilterObj, Persistible.DO_NOT_SAVE); model = new DefaultTreeModel(rootNode); // Update only one tree instance booleanTree = new BooleanTree(model); booleanTree.getModel().addTreeModelListener(this); //booleanTree.addNodeDeleteListener(this); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView(booleanTree); operators = new OperatorPane(); //operators.setPreferredSize(new Dimension(150, Short.MAX_VALUE)); setLayout(new BorderLayout()); add(scrollPane, BorderLayout.CENTER); addOperators(BorderLayout.NORTH, SwingConstants.HORIZONTAL); setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, OncBrowser.getDefaultInputMap()); setInputMap(JComponent.WHEN_FOCUSED, OncBrowser.getDefaultInputMap()); setActionMap(OncBrowser.getDefaultActionMap()); } private JPanel getClassPanel() { classPanel = new JPanel(); //classPanel.add(new HorizontalLine()); classPanel.setLayout(new BoxLayout(classPanel, BoxLayout.Y_AXIS)); Iterator it = SubsetClass.getAllClasses().iterator(); while(it.hasNext()) classPanel.add(new DragDropLabel((SubsetClass)it.next())); return classPanel; } private JPanel getStagePanel() { stagePanel = new JPanel(); stagePanel.setLayout(new BoxLayout(stagePanel, BoxLayout.Y_AXIS)); return stagePanel; } public void edit(Object obj) { if(obj instanceof OncFilter) edit((OncFilter) obj); } public void edit(OncFilter filter) { this.filter = filter; rootNode = filter.getRootNode(); keywordsOnly = filter.getKeywordsOnly(); ((DefaultTreeModel)booleanTree.getModel()).setRoot(rootNode); ((DefaultTreeModel)booleanTree.getModel()).reload(); //sideeffect collapses booleanTree.expandAll(); addListenersToExistingNodes(rootNode); booleanTree.revalidate(); Iterator stagedObjs = filter.getStagedObjects().iterator(); while(stagedObjs.hasNext()) { Object obj = stagedObjs.next(); if(obj instanceof Droppable) addToStage((Droppable) obj); } operators.revalidate(); repaint(); } private void addListenersToExistingNodes(DefaultMutableTreeNode rootNode){ // All the nodes that were read in from the KB need to be heard too for (Enumeration e=rootNode.breadthFirstEnumeration(); e.hasMoreElements(); ) { OncTreeNode n = (OncTreeNode)e.nextElement(); if ( n.getUserObject() instanceof Persistible) ((Persistible)n.getUserObject()).addSaveListener(booleanTree); } } public void addOperators(String borderLayoutLocation, int orientation) { add(operators, borderLayoutLocation); } public void addTextLabel() { operators.add(new SearchTextLabel()); } public Object getValue() { return(filter); } public void setFilter(OncFilter f) { filter = f; if ( filter != null ) edit(filter); } public OncFilter getFilter() { return filter; } public void save() { if(filter == null) filter = new OncFilter(); filter.setRootNode(rootNode); filter.setKeywordsOnly(keywordsOnly); } public boolean getKeywordsOnly() { return(keywordsOnly); } public void setKeywordsOnly(boolean keywordsOnly) { this.keywordsOnly = keywordsOnly; } public void removeOperator(TcapLogicalOperator op) { operators.removeOperator(op); } public void addNodeDeleteListener(NodeDeleteListener listener) { booleanTree.addNodeDeleteListener(listener); } public void removeNodeDeleteListener(NodeDeleteListener listener) { booleanTree.removeNodeDeleteListener(listener); } /////////// public void setClassPanelVisible(boolean vis) { if(classPanel != null) { classPanel.setVisible(vis); revalidate(); repaint(); } } public void addToStage(Droppable d) { stagePanel.add(new DragDropLabel(d)); // System.out.println("added " + d ); revalidate(); repaint(); } public void setClassesVisible(boolean vis) { classPanel.setVisible(vis); } public JTree getTree() { return booleanTree; } public void treeNodesChanged(TreeModelEvent e) { //System.out.println("Tree has changed 1"); } public void treeNodesInserted(TreeModelEvent e) { //System.out.println("Tree has inserted 1"); } public void treeNodesRemoved(TreeModelEvent e) { //System.out.println("Tree has removed nodes 1"); } public void treeStructureChanged(TreeModelEvent e) { //System.out.println("Tree has structure change 1"); } public void addDoubleClickListener (DoubleClickListener listener) { booleanTree.getSelectionListener().addDoubleClickListener(listener); } public void doubleClicked(DoubleClickEvent evt){ // int x = 0; // int y = 0; // if ( evt.getMouseEvent() != null ) { // x = evt.getMouseEvent().getX(); // y = evt.getMouseEvent().getY(); // } // if ( evt.getSource() instanceof BooleanTree ) { // Object obj = tree.getLastSelectedPathComponent(); // Object userObject = null; // if ( obj instanceof DefaultMutableTreeNode ) // userObject = ((DefaultMutableTreeNode)obj).getUserObject(); // else // return; // if ( userObject instanceof Editable) { // EditorPanel editorPanel = // EditorFrame.showEditor((Editable)userObject, // null, // x, y, // (GenericTree)evt.getSource()); // if ( userObject instanceof Persistible ) { // ((Persistible)userObject).addSaveListener(editorPanel); // } // } // else { // JOptionPane.showMessageDialog // (null, // "There is no editor for the selected object."); // } // } } public String toString() { return "Filter==> " + filter; } //NodeDeleteListener public void nodeDeleted(OncTreeNode deletedNode){ System.out.println("Node deleted"); } /////////////////////// public class SearchTextLabel extends JLabel implements oncotcap.display.common.Droppable { private DataFlavor nodeFlavors [] = { Droppable.searchText }; public SearchTextLabel() { super(""); setBackground(new Color(235,232,227)); setBorder(new EmptyBorder(new Insets(0,0,0,0))); ImageIcon textIcon = oncotcap.util.OncoTcapIcons.getImageIcon ("text.jpg"); setIcon(textIcon); // Enable drag on this label LabelTransferHandler th = new LabelTransferHandler("text"); setTransferHandler(th); MouseInputListener ml = new MyMouseListener(); addMouseListener(ml); addMouseMotionListener(ml); } public boolean dropOn(Object dropOnObject){ System.out.println("Drop on"); return false; } public DataFlavor [] getTransferDataFlavors() { //System.out.println("getTransferDataFlavors - oo " + nodeFlavors); return(nodeFlavors); } public boolean isDataFlavorSupported( DataFlavor flavor) { if ( flavor.equals(Droppable.searchText ) ) return true; return false; } public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { //System.out.println("flavor getTransferData "+ flavor); if (isDataFlavorSupported(flavor)) return(new oncotcap.datalayer.SearchText("cancer")); else throw(new UnsupportedFlavorException(flavor)); } class MyMouseListener implements MouseInputListener { public void mouseEntered(MouseEvent e) { setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } public void mouseDragged(MouseEvent e) { JComponent c = (JComponent)e.getSource(); TransferHandler handler = c.getTransferHandler(); handler.exportAsDrag(c, e, TransferHandler.COPY); } public void mouseMoved(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } } } class LabelTransferHandler extends TransferHandler { public LabelTransferHandler() { super("Text"); } public LabelTransferHandler(String s) { super(s); } public void exportAsDrag(JComponent comp, InputEvent e, int action) { super.exportAsDrag(comp, e, action); } public void exportToClipboard(JComponent comp, Clipboard clip, int action) { super.exportToClipboard(comp, clip, action); } public Transferable createTransferable(JComponent c) { //System.out.println("createtransferable"); return (Transferable)c; } protected void exportDone(JComponent c, Transferable t, int action) { } public boolean canImport(JComponent c, DataFlavor[] flavors) { return false; } } } class OperatorPane extends JPanel { Hashtable operatorBoxes = new Hashtable(); OperatorPane() { init(); } private void init() { setMaximumSize(new Dimension(150, 300)); // setBorder(BorderFactory.createLineBorder(Color.blue, 3)); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); Vector ops = TcapLogicalOperator.getDefinedOperators(); Iterator it = ops.iterator(); while(it.hasNext()) { TcapLogicalOperator op = (TcapLogicalOperator) it.next(); Box opBox = Box.createHorizontalBox(); //opBox.setMaximumSize(new Dimension(Short.MAX_VALUE, 15)); opBox.add(Box.createHorizontalStrut(3)); // if the operator has an icon use it ImageIcon opIcon = oncotcap.util.OncoTcapIcons.getImageIcon(op.getName() + ".jpg"); if (opIcon != null) opBox.add(new DragDropLabel(op, opIcon)); else opBox.add(new DragDropLabel(op)); //opBox.add(Box.createHorizontalGlue()); operatorBoxes.put(op, opBox); add(opBox); } //add in some Keyword or StatementTemplate instances for testing purposes... /* add(new HorizontalLine(4)); // Vector allTemplates = StatementTemplate.getAllStatementTemplates(); Class sbClass = ReflectionHelper.classForName("oncotcap.datalayer.persistible.Keyword"); Collection allTemplates = oncotcap.Oncotcap.getDataSource().find(sbClass); it = allTemplates.iterator(); while(it.hasNext()) { Object obj = it.next(); if(obj instanceof Keyword) add(new DragDropLabel((Keyword) obj)); } */ } public void removeOperator(TcapLogicalOperator op) { Box rBox = (Box) operatorBoxes.get(op); if(rBox != null) { remove(rBox); operatorBoxes.remove(op); repaint(); } } public class DragAdapter extends MouseAdapter { public void mousePressed(MouseEvent e) { JComponent c = (JComponent) e.getSource(); c.setBackground(TcapColor.lightBlue); c.setOpaque(true); repaint(); TransferHandler handler = c.getTransferHandler(); handler.exportAsDrag(c, e, TransferHandler.COPY); } } //} }
[ "shirey@07fea3a5-968d-7a4d-9f3c-285a10aae1c6" ]
shirey@07fea3a5-968d-7a4d-9f3c-285a10aae1c6
6cca0a7ba09d42ecfa91e18ffade7fb2e4f9da1c
20705754a56f025c9635ff5e5e087eff235b1b00
/src/main/java/moe/meis/invitation/service/InvitationService.java
bace494f00e5ab9cf3e070528c2e4765c9e74855
[]
no_license
AniMeis/news
2e95a6d01c7dae4d24235aea345d151990dddd2a
aae403ff94746c98551244ed915286ff6dc76de7
refs/heads/master
2020-04-11T07:22:53.766209
2018-12-13T08:33:08
2018-12-13T08:33:08
161,608,339
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package moe.meis.invitation.service; import java.util.List; import moe.meis.invitation.pojo.Invitation; public interface InvitationService { public List<Invitation> list(); public List<Invitation> getByTitle(String title); public Invitation getByByKey(int id); public boolean removeByKey(int id); }
[ "1293679498@qq.com" ]
1293679498@qq.com
ba3d091f303e754a280ee3422b199d7e16a4d368
af14c0d136b69874df20bf65f039d0958ab6c6bc
/ejbModule/session/FacadeEvaluation.java
a376b70bbd383ee98b1c93b1a3a70dbf299a01be
[]
no_license
Tharass/megamovie_EAR_EJB
de91c668375b71bea738b39af7aab9299295380e
d6721a885b32a3d8773f29ba0606b26aa5e1d68b
refs/heads/master
2020-03-19T01:33:11.774646
2018-06-01T09:39:05
2018-06-01T09:39:05
135,553,628
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
package session; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import model.entities.Evaluation; import model.entities.Film; import model.entities.Genre; import model.entities.Realisateur; @Stateless public class FacadeEvaluation { @PersistenceContext private EntityManager em; public List<Evaluation> listerLesEvaluations(){ TypedQuery<Evaluation> q = em.createQuery("select e From Evaluation e",Evaluation.class); return q.getResultList(); } public void ajouterEvaluation(Evaluation evaluation){ em.persist(evaluation); } }
[ "SCH CHARO Jonathan@vmprog" ]
SCH CHARO Jonathan@vmprog