blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 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 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47e6fc6fcacf35bcb301d8501f7d84b6c5b2da70 | 4b56bbafe75afcf71cc8fe5d7631c94e0e15c346 | /Android First Project/Japanese/src/com/example/japanese/QFive.java | fe334301105e45a0bf0e211a00a6ac6524aa2dc8 | [
"MIT"
] | permissive | rafaellepalmos/Android_Java | 4ece85a633a786457a12d4f637829629d388ec76 | c0367295fda0706630e7fe7599f447bf84fb2923 | refs/heads/master | 2021-01-11T15:04:32.882839 | 2017-01-28T16:09:36 | 2017-01-28T16:09:36 | 80,293,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package com.example.japanese;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class QFive extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qfive);
Button next = (Button) findViewById(R.id.next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("android.intent.action.QSIX"));
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_qfive, menu);
return true;
}
}
| [
"rafaelle.palmos@students.stamford.edu"
] | rafaelle.palmos@students.stamford.edu |
c1c9c8acb9ae54c6bf1cd66aaa35bff10d210352 | d687708e4dbd6ea6719ef9b56a0f4cad37fb45d4 | /MiBaseDatosP77B-master/app/src/main/java/com/osvaldovillalobosperez/mibasedatosp77b/MainActivity.java | e1c31988888580d62c7396d2dfdaf6848514a4e4 | [] | no_license | FR4N1995/MOVIL-II | 8cd44aa33d44ff74108103ffcbf7d8aae07045be | 448b0370dfd755ad1665a0abacf8b7f62580fd1d | refs/heads/master | 2020-12-28T00:31:08.272849 | 2020-03-09T22:52:14 | 2020-03-09T22:52:14 | 238,121,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,542 | java | package com.osvaldovillalobosperez.mibasedatosp77b;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FilterQueryProvider;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import java.util.List;
public class MainActivity extends AppCompatActivity {
ListView lv;
Button btnCrear, btnBuscar;
EditText txtFiltro;
SimpleCursorAdapter adp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final DAOContacto dao = new DAOContacto(this);
lv = findViewById(R.id.Lv);
btnCrear = findViewById(R.id.btnCrear);
btnBuscar = findViewById(R.id.btnBuscar);
txtFiltro = findViewById(R.id.txtBuscar);
/*dao.insert(
new Contacto(
0,
"paco",
"s15120062@alumnos.itsur.edu.mx",
"4451597776",
"10/12/1996"
)
);
dao.insert(
new Contacto(
0,
"francisco",
"s29823933@alumnos.itsur.edu.mx",
"4452880110",
"21/01/1997"
)
);*/
/*for (Contacto c : dao.getAll()) {
Toast.makeText(this, c.getUsuario(), Toast.LENGTH_SHORT).show();
}*/
final Cursor c = dao.getAllCursor();
refrescarLista(c);
// Listener de los clicks en el ListView.
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
List<Contacto> importar = dao.getAll();
Contacto contactoSeleccionado = importar.get(position);
Intent intent = new Intent(MainActivity.this, EditarContactoActivity.class);
intent.putExtra("_id", contactoSeleccionado.getId());
intent.putExtra("usuario", contactoSeleccionado.getUsuario());
intent.putExtra("email", contactoSeleccionado.getEmail());
intent.putExtra("tel", contactoSeleccionado.getTel());
intent.putExtra("fecha_nacimiento", contactoSeleccionado.getFecha_nacimiento());
startActivity(intent);
}
});
// Listener de los clicks largos en el ListView
//aqui es donde elimino
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
List<Contacto> importar = dao.getAll();
final Contacto contactoParaEliminar = importar.get(position);
AlertDialog dialog = new AlertDialog
.Builder(MainActivity.this)
.setPositiveButton("Sí, eliminar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dao.delete(contactoParaEliminar);
Intent reconstruir = getIntent();
finish();
startActivity(reconstruir);
}
})
.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setTitle("Confirmar")
.setMessage("¿Eliminar al contacto " + contactoParaEliminar.getUsuario() + "?")
.create();
dialog.show();
return true;
}
});
// Listener para el botón agregar.
btnCrear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, AgregarContactoActivity.class);
startActivity(intent);
}
});
btnBuscar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String obtenerTexto = txtFiltro.getText().toString();
Cursor filtrarBusqueda = dao.filter(obtenerTexto, "usuario");
refrescarLista(filtrarBusqueda);
}
});
/*txtFiltro.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
(MainActivity.this).adp.getFilter().filter(s);
}
@Override
public void afterTextChanged(Editable s) {
}
});*/
/*adp.setFilterQueryProvider(new FilterQueryProvider() {
@Override
public Cursor runQuery(CharSequence constraint) {
return dao.filter(constraint.toString(), "usuario");
}
});*/
}
public void refrescarLista(Cursor c) {
adp = new SimpleCursorAdapter(
this,
android.R.layout.simple_expandable_list_item_2,
c,
new String[]{"usuario", "email"},
new int[]{android.R.id.text1, android.R.id.text2},
SimpleCursorAdapter.IGNORE_ITEM_VIEW_TYPE
);
lv.setAdapter(adp);
}
@Override
protected void onResume() {
super.onResume();
final DAOContacto dao = new DAOContacto(this);
final Cursor c = dao.getAllCursor();
refrescarLista(c);
}
}
| [
"60637697+FR4N1995@users.noreply.github.com"
] | 60637697+FR4N1995@users.noreply.github.com |
96dcb6d1d7920060ad78d6c7ce78bb1b51465a97 | 40eeda945764a0f061188d90e3c84e82693b9e12 | /src/com/sunsheen/jfids/studio/wther/diagram/navigator/LogicNavigatorItem.java | 8bab4faddac49e1877a5490699d10913e26d6668 | [] | no_license | zhouf/wther.diagram | f004ca8ace45cceb65345d568b1b9711bc14c935 | 6508d0a63c79f48b1543f191fef5a48c8d4b28b7 | refs/heads/master | 2021-01-20T18:53:05.000033 | 2016-07-23T15:08:07 | 2016-07-23T15:08:07 | 63,996,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,968 | java | package com.sunsheen.jfids.studio.wther.diagram.navigator;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
public class LogicNavigatorItem extends LogicAbstractNavigatorItem {
/**
* @generated
*/
static {
final Class[] supportedTypes = new Class[] { View.class, EObject.class };
Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof com.sunsheen.jfids.studio.wther.diagram.navigator.LogicNavigatorItem
&& (adapterType == View.class || adapterType == EObject.class)) {
return ((com.sunsheen.jfids.studio.wther.diagram.navigator.LogicNavigatorItem) adaptableObject).getView();
}
return null;
}
public Class[] getAdapterList() {
return supportedTypes;
}
}, com.sunsheen.jfids.studio.wther.diagram.navigator.LogicNavigatorItem.class);
}
/**
* @generated
*/
private View myView;
/**
* @generated
*/
private boolean myLeaf = false;
/**
* @generated
*/
public LogicNavigatorItem(View view, Object parent, boolean isLeaf) {
super(parent);
myView = view;
myLeaf = isLeaf;
}
/**
* @generated
*/
public View getView() {
return myView;
}
/**
* @generated
*/
public boolean isLeaf() {
return myLeaf;
}
/**
* @generated
*/
public boolean equals(Object obj) {
if (obj instanceof com.sunsheen.jfids.studio.wther.diagram.navigator.LogicNavigatorItem) {
return EcoreUtil.getURI(getView()).equals(
EcoreUtil.getURI(((com.sunsheen.jfids.studio.wther.diagram.navigator.LogicNavigatorItem) obj)
.getView()));
}
return super.equals(obj);
}
/**
* @generated
*/
public int hashCode() {
return EcoreUtil.getURI(getView()).hashCode();
}
}
| [
"zhouf_t@sohu.com"
] | zhouf_t@sohu.com |
db4967bef85a243053bb97e35f50d283bd6a87d2 | a2df6764e9f4350e0d9184efadb6c92c40d40212 | /aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/QueryMSDdcsPushHistoryRequest.java | 28854419153458740ee45ba2fb8196918c33c727 | [
"Apache-2.0"
] | permissive | warriorsZXX/aliyun-openapi-java-sdk | 567840c4bdd438d43be6bd21edde86585cd6274a | f8fd2b81a5f2cd46b1e31974ff6a7afed111a245 | refs/heads/master | 2022-12-06T15:45:20.418475 | 2020-08-20T08:37:31 | 2020-08-26T06:17:49 | 290,450,773 | 1 | 0 | NOASSERTION | 2020-08-26T09:15:48 | 2020-08-26T09:15:47 | null | UTF-8 | Java | false | false | 2,826 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sofa.model.v20190815;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.sofa.Endpoint;
/**
* @author auto create
* @version
*/
public class QueryMSDdcsPushHistoryRequest extends RpcAcsRequest<QueryMSDdcsPushHistoryResponse> {
private Long endTime;
private Long startTime;
private String instanceId;
private String dataId;
private Long size;
private Long startId;
public QueryMSDdcsPushHistoryRequest() {
super("SOFA", "2019-08-15", "QueryMSDdcsPushHistory", "sofa");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
if(endTime != null){
putBodyParameter("EndTime", endTime.toString());
}
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
if(startTime != null){
putBodyParameter("StartTime", startTime.toString());
}
}
public String getInstanceId() {
return this.instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
if(instanceId != null){
putBodyParameter("InstanceId", instanceId);
}
}
public String getDataId() {
return this.dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
if(dataId != null){
putBodyParameter("DataId", dataId);
}
}
public Long getSize() {
return this.size;
}
public void setSize(Long size) {
this.size = size;
if(size != null){
putBodyParameter("Size", size.toString());
}
}
public Long getStartId() {
return this.startId;
}
public void setStartId(Long startId) {
this.startId = startId;
if(startId != null){
putBodyParameter("StartId", startId.toString());
}
}
@Override
public Class<QueryMSDdcsPushHistoryResponse> getResponseClass() {
return QueryMSDdcsPushHistoryResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
c42adc07098970c8b1525f7399add1c2ad49318c | a05988f6368de8e50f0142eb58ded977cfe067aa | /src/ItemGenerator.java | 4b65900ad237255cca8eec2188b146487b9740ac | [] | no_license | faithyap/CECS277-TextDungeonGame | 59ea59a92c84ccf0ea6ccd49a48c8dd9da2bf311 | e503e5a800fa78e7e5f16dd892698bc6af048374 | refs/heads/master | 2021-07-12T14:29:48.480939 | 2017-10-14T04:23:20 | 2017-10-14T04:23:20 | 106,897,541 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java |
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
/**
* This class generates an item, with information read from a text file.
*
* @author Faith Y.
* @version 1.0
* @since 2/17/2016
*/
public class ItemGenerator
{
// ArrayList that holds the possible items
private ArrayList<Item> itemList;
/**
* Constructor method for the ItemGenerator class
*/
public ItemGenerator()
{
itemList = new ArrayList<Item>();
try
{
Scanner read = new Scanner(new File("ItemList.txt"));
do
{
String readLine = read.nextLine();
String[] item = readLine.split(",");
itemList.add(new Item(item[0], Integer.parseInt(item[1])));
} while (read.hasNextLine());
read.close();
} catch(FileNotFoundException f)
{
System.out.println("File was not found.");
}
}
/**
* Generates a new object of the class Item
* @return new Item that has been constructed
*/
public Item generateItem()
{
Random generator = new Random();
int num = generator.nextInt(itemList.size());
Item i = new Item(itemList.get(num).getName(), itemList.get(num).getValue());
return i;
}
}
| [
"faithallysonyap@gmail.com"
] | faithallysonyap@gmail.com |
074e5b338836609da32dbe7d39805605c218ccd5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_1fa8d3bce5fcf2bb4a8870481085e20b690b2f62/EnsembleViewer/9_1fa8d3bce5fcf2bb4a8870481085e20b690b2f62_EnsembleViewer_t.java | c2d67da801d8ee52e55e268035a734f4516334a9 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,400 | java | /*
The contents of this file are subject to the Mozilla Public License Version 1.1
(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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is "EnsembleViewer.java". Description:
"Viewer for peeking into an Ensemble
@author Shu"
The Initial Developer of the Original Code is Bryan Tripp & Centre for Theoretical Neuroscience, University of Waterloo. Copyright (C) 2006-2008. All Rights Reserved.
Alternatively, the contents of this file may be used under the terms of the GNU
Public License license (the GPL License), in which case the provisions of GPL
License are applicable instead of those above. If you wish to allow use of your
version of this file only under the terms of the GPL License and not to allow
others to use your version of this file under the MPL, indicate your decision
by deleting the provisions above and replace them with the notice and other
provisions required by the GPL License. If you do not delete the provisions above,
a recipient may use your version of this file under either the MPL or the GPL License.
*/
package ca.nengo.ui.models.viewers;
import ca.nengo.model.Ensemble;
import ca.nengo.model.Node;
import ca.nengo.model.Network;
import ca.nengo.model.Probeable;
import ca.nengo.model.neuron.Neuron;
import ca.nengo.ui.lib.util.UserMessages;
import ca.nengo.ui.lib.util.Util;
import ca.nengo.ui.models.UINeoNode;
import ca.nengo.ui.models.nodes.UIEnsemble;
import ca.nengo.ui.models.nodes.UINeuron;
import ca.nengo.ui.models.nodes.UINetwork;
import ca.nengo.util.Probe;
/**
* Viewer for peeking into an Ensemble
*
* @author Shu
*/
public class EnsembleViewer extends NodeViewer {
private static final long serialVersionUID = 1L;
/**
* @param ensembleUI
* Parent Ensemble UI Wrapper
*/
public EnsembleViewer(UIEnsemble ensembleUI) {
super(ensembleUI);
}
@Override
public void applyDefaultLayout() {
if (getUINodes().size() == 0)
return;
applySortLayout(SortMode.BY_NAME);
}
@Override
public Ensemble getModel() {
return (Ensemble) super.getModel();
}
@Override
public UIEnsemble getViewerParent() {
return (UIEnsemble) super.getViewerParent();
}
@Override
public void updateViewFromModel(boolean isFirstUpdate) {
getGround().clearLayer();
Node[] nodes = getModel().getNodes();
/*
* Construct Neurons
*/
for (Node node : nodes) {
if (node instanceof Neuron) {
Neuron neuron = (Neuron) node;
UINeuron neuronUI = new UINeuron(neuron);
addUINode(neuronUI, false, false);
} else if (node instanceof Ensemble) {
Ensemble ensemble = (Ensemble)node;
UIEnsemble ensembleUI = new UIEnsemble(ensemble);
addUINode(ensembleUI,false,false);
} else if (node instanceof Network) {
Network network = (Network)node;
UINetwork networkUI = new UINetwork(network);
addUINode(networkUI, false, false);
} else {
UserMessages.showError("Unsupported node type " + node.getClass().getSimpleName()
+ " in EnsembleViewer");
}
}
if (getViewerParent().getNetworkParent() != null) {
/*
* Construct probes
*/
Probe[] probes = getViewerParent().getNetworkParent().getSimulator().getProbes();
for (Probe probe : probes) {
Probeable target = probe.getTarget();
if (!(target instanceof Node)) {
UserMessages.showError("Unsupported target type for probe");
} else {
if (probe.isInEnsemble() && probe.getEnsembleName() == getModel().getName()) {
Node node = (Node) target;
UINeoNode nodeUI = getUINode(node);
nodeUI.showProbe(probe);
}
}
}
}
}
@Override
protected void removeChildModel(Node node) {
Util.Assert(false, "Cannot remove model");
}
@Override
protected boolean canRemoveChildModel(Node node) {
return false;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ea7084824d0438b0c60cdf9a05e17b69ae564f38 | ae35e8f3d2b928605457c0d69077f9913bcd0500 | /src/programmersguide/asposecells/workingwithdata/addonfeatures/namedranges/copynamedranges/java/CopyNamedRanges.java | 29ded76029ad65a5f02291efc5a6f6359db9514e | [
"MIT"
] | permissive | asposemarketplace/Aspose-Cells-Java | 782bb48c226a2822a1c9b2c2fac201dbe4104774 | 287c566d3f5c07c50f0434f774fe41bea7e0dd1e | refs/heads/master | 2021-01-19T09:46:05.267016 | 2015-11-26T16:01:08 | 2015-11-26T16:01:08 | 46,932,416 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,630 | java | /*
* Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
*
* This file is part of Aspose.Cells. The source code in this file
* is only intended as a supplement to the documentation, and is provided
* "as is", without warranty of any kind, either expressed or implied.
*/
package programmersguide.asposecells.workingwithdata.addonfeatures.namedranges.copynamedranges.java;
import com.aspose.cells.*;
public class CopyNamedRanges
{
public static void main(String[] args) throws Exception
{
// The path to the documents directory.
String dataDir = "src/programmersguide/asposecells/workingwithdata/addonfeatures/namedranges/copynamedranges/data/";
//Instantiating a Workbook object
Workbook workbook = new Workbook();
WorksheetCollection worksheets = workbook.getWorksheets();
//Accessing the first worksheet in the Excel file
Worksheet sheet = worksheets.get(0);
Cells cells = sheet.getCells();
//Creating a named range
Range namedRange = cells.createRange("B4", "G14");
namedRange.setName("TestRange");
//Input some data with some formattings into
//a few cells in the range.
namedRange.get(0, 0).setValue("Test");
namedRange.get(0, 4).setValue("123");
//Creating a named range
Range namedRange2 = cells.createRange("H4", "M14");
namedRange2.setName("TestRange2");
namedRange2.copy(namedRange);
workbook.save(dataDir + "copyranges.xls");
// Print message
System.out.println("Process completed successfully");
}
}
| [
"shoaib.khan@aspose.com"
] | shoaib.khan@aspose.com |
9cb759744dbbe8892475b68d27c7bc05a292761f | a1fc9f75c7c1f2b5605c3790f07c50534fdd6163 | /src/main/java/com/gsm/controller/DemoController.java | 47e536104e6a84392d4baa1e0c82bf2bc5e3d2ac | [] | no_license | wenjiaqi123/StudySSM | 42a3a2f46b33193ba7e91101d5ee36eb9b5a3cab | 1ca2905e61438768df8490b4ef50a5257d944bf8 | refs/heads/master | 2022-12-22T15:20:06.215345 | 2019-09-25T15:16:52 | 2019-09-25T15:16:52 | 210,872,867 | 1 | 0 | null | 2022-12-16T04:24:47 | 2019-09-25T15:00:13 | Java | UTF-8 | Java | false | false | 610 | java | package com.gsm.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/demo")
public class DemoController {
@RequestMapping("/test")
public String test(){
System.out.println("LoginController.loginUser");
String str = "sss闻家奇";
return str;
}
@RequestMapping("/aaa")
public Map a(){
Map<String,Object> map = new HashMap<String,Object>();
map.put("msg","闻家奇");
return map;
}
} | [
"939949243@qq.com"
] | 939949243@qq.com |
624d880b162943153973c6f99ecd99a88d4bfb9f | 81248d3d9d19bc3939549cc72968d9e417f33907 | /warehouse/src/main/java/lv/javaguru/ee/warehouse/config/liquibase/LiquibaseSchemaUpdate.java | 8f26a06bb5077509735b121f66bf0de30d4c3d3f | [] | no_license | avigulis/EnterpriseApplicationDevelopment | 10a7ed35da52f08305cdd79812c49b0d1d556a35 | 9958f4bd8e0b48441407e1bbd4c913424cf92163 | refs/heads/master | 2021-01-24T02:11:42.084591 | 2014-10-28T21:05:25 | 2014-10-28T21:06:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package lv.javaguru.ee.warehouse.config.liquibase;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;
@Component
public class LiquibaseSchemaUpdate {
private static final Logger log = LoggerFactory.getLogger(LiquibaseSchemaUpdate.class);
@Autowired
private DatabaseMigrationService databaseMigrationService;
@Value("${liquibase.update:true}")
private boolean enabled;
@Value("${liquibase.context:main}")
private String context;
public void execute(DataSource dataSource) {
if (enabled) {
updateSchema(dataSource);
}
}
private void updateSchema(DataSource dataSource) {
StopWatch watch = watchTime();
databaseMigrationService.update(dataSource, context);
log.info("Database populated in {} ms", elapsedTimeInMillis(watch));
}
private StopWatch watchTime() {
StopWatch watch = new StopWatch();
watch.start();
return watch;
}
private long elapsedTimeInMillis(StopWatch watch) {
watch.stop();
return watch.getTotalTimeMillis();
}
}
| [
"myxamor@gmail.com"
] | myxamor@gmail.com |
c3326607c7426436263761ed9897f8f8e5925268 | d9fbe0b318adf04bd3804042e830e94f8f126480 | /src/main/java/toeic/Common/Model/ReadingModel.java | 4c2a1ff7dcdfa7a3dba7ed8a6f6760d434530481 | [] | no_license | ngocson18081195/Toeic | 31abf511d5a4df09c9dc1740b3c171b32c382590 | 11de55fff6db600e633469b3e7f048a3985d50b1 | refs/heads/master | 2021-08-30T10:02:51.710119 | 2017-12-17T11:29:20 | 2017-12-17T11:29:20 | 111,408,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 187 | java | package toeic.Common.Model;
import javax.persistence.MappedSuperclass;
/**
* Created by chien on 17/11/2017.
*/
@MappedSuperclass
public class ReadingModel extends QuestionModel {
}
| [
"qchien2400@gmail.com"
] | qchien2400@gmail.com |
07334d09d051968e253edf9d5818aadd6f8cbf71 | fd0f9437866e8ef151cfa5b777462c9fa47adec1 | /DesignPattern/src/ObserverDesignPattern/ObserverTest.java | a2bbd50aea9552d99baa8e0ab2a80a3a7b4ffadb | [] | no_license | vikass101786/Learning | 26241e9a74635d58e73437345f512b047fc747b8 | ca99d1b1c9d93f2bf5d7ad950a14fd1950008903 | refs/heads/master | 2023-04-12T08:19:46.530494 | 2021-05-01T07:36:30 | 2021-05-01T07:36:30 | 293,844,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | package ObserverDesignPattern;
public class ObserverTest {
public static void main(String[] args) {
Observer mobile = new MobileObserver();
Observer lcd = new LCDObserver();
Observer alert = new AlarmObserver();
Observable weatherSystem = new WeatherStation();
weatherSystem.add(mobile);
weatherSystem.add(lcd);
Message message = new Message(" <<< Its about to rain at 5:30 >>>");
weatherSystem.notify(message);
weatherSystem.remove(lcd);
weatherSystem.add(alert);
Message message2 = new Message(" <<< Its Tsunami time >>> ");
System.out.println(" =========================================================================== \n");
weatherSystem.notify(message2);
System.out.println(" =========================================================================== \n");
}
}
| [
"vikash.srivastava@amadeus.com"
] | vikash.srivastava@amadeus.com |
77adf665e79157dd470273370a659ab1edbd55b5 | 5479e441b1430b5301298119b3ad637b5e9a9a9a | /openapi-sdk-message/src/main/java/com/yiji/openapi/message/common/installment/InstallmentModifyScheduleResponse.java | 3f410322a58f9b2063a6071fd52f9316346c7e42 | [] | no_license | weichk/yiji-sdk | 4e3c0252a10eec91c6f14220994e9be903b68317 | 7715e3feabb3aef32ea8ee0103cafa774204d928 | refs/heads/master | 2022-12-22T12:47:16.898108 | 2019-06-20T07:56:23 | 2019-06-20T07:56:23 | 192,875,193 | 0 | 0 | null | 2022-12-15T23:31:31 | 2019-06-20T07:53:07 | Java | UTF-8 | Java | false | false | 566 | java | /*
* www.yiji.com Inc.
* Copyright (c) 2014 All Rights Reserved
*/
/*
* 修订记录:
* hgeshu@yiji.com 2015-05-19 10:53 创建
*
*/
package com.yiji.openapi.message.common.installment;
import com.yiji.openapi.sdk.common.annotation.OpenApiMessage;
import com.yiji.openapi.sdk.common.enums.ApiMessageType;
import com.yiji.openapi.sdk.common.message.ApiResponse;
/**
* @author hgeshu@yiji.com
*/
@OpenApiMessage(service = "installmentModifySchedule", type = ApiMessageType.Response)
public class InstallmentModifyScheduleResponse extends ApiResponse {
}
| [
"539603511@qq.com"
] | 539603511@qq.com |
51fa47a62cfc1b5db331d19d50872120234b1da3 | cac52d34455a08b3fb882d0a58e0b3b72206e935 | /common/protocols/android-java/src/main/java/ru/trendtech/common/mobileexchange/model/web/ArticleAdjustmentsRequest.java | b5d4b75b1d9be9dd4ac47d6e2e8b238cfb307b67 | [] | no_license | MrFractal/taxisto | 75f72238ab4ce3c14f6e559098653ae53756fbaa | 195863dc17f5c6147c578b5695c1bc34ef9702a5 | refs/heads/master | 2021-01-10T16:25:28.332080 | 2016-02-17T12:10:01 | 2016-02-17T12:10:01 | 51,916,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | package ru.trendtech.common.mobileexchange.model.web;
/**
* Created by petr on 12.02.2015.
*/
public class ArticleAdjustmentsRequest {
private String security_token;
private long articleAdjustmentsId;
public String getSecurity_token() {
return security_token;
}
public void setSecurity_token(String security_token) {
this.security_token = security_token;
}
public long getArticleAdjustmentsId() {
return articleAdjustmentsId;
}
public void setArticleAdjustmentsId(long articleAdjustmentsId) {
this.articleAdjustmentsId = articleAdjustmentsId;
}
}
| [
"fr@bekker.com.ua"
] | fr@bekker.com.ua |
02a62af733ace04cbac5054f17e2b4094936d988 | 6033c480307fc419522ca965d0fa3bad28ae35e7 | /sejda-console/src/main/java/org/sejda/cli/model/RotateTaskCliArguments.java | 6c699ee96d41d5070be849c3389d690a58446bf5 | [
"Apache-2.0"
] | permissive | bradparks/sejda__pdf_cli_command_line_merge_split | 96cac41f9a48c6cb00551b41d551d325ab6291c4 | 768e2df33ba0976041ad3d64e4eb374a9d8c0e12 | refs/heads/master | 2021-01-17T21:06:09.933222 | 2015-03-27T20:18:43 | 2015-03-27T20:18:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,977 | java | /*
* Created on Jul 10, 2011
* Copyright 2010 by Eduard Weissmann (edi.weissmann@gmail.com).
*
* 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.sejda.cli.model;
import org.sejda.conversion.PageRangeSetAdapter;
import org.sejda.conversion.RotationAdapter;
import org.sejda.conversion.PredefinedSetOfPagesAdapter;
import uk.co.flamingpenguin.jewel.cli.CommandLineInterface;
import uk.co.flamingpenguin.jewel.cli.Option;
/**
* Specifications for command line options of the Rotate task
*
* @author Eduard Weissmann
*
*/
@CommandLineInterface(application = TaskCliArguments.EXECUTABLE_NAME + " rotate")
public interface RotateTaskCliArguments extends CliArgumentsWithPdfAndDirectoryOutput, CliArgumentsWithPrefixableOutput {
@Option(shortName = "r", description = "rotation degrees: 90, 180 or 270. Pages will be rotated clockwise (required)")
RotationAdapter getRotation();
@Option(shortName = "m", description = "predefined pages: all, odd or even (optional)")
PredefinedSetOfPagesAdapter getPredefinedPages();
boolean isPredefinedPages();
@Option(shortName = "s", description = "page selection. You can set a subset of pages to rotate. Order of the pages is relevant. Accepted values: 'num1-num2' or"
+ " 'num-' or 'num1,num2-num3..' (EX. -s 4,12-14,8,20-) (optional)")
PageRangeSetAdapter getPageSelection();
boolean isPageSelection();
}
| [
"edi.weissmann@gmail.com"
] | edi.weissmann@gmail.com |
068e410d918edde328563eb3b52e2fc14396df9e | ed166738e5dec46078b90f7cca13a3c19a1fd04b | /minor/guice-OOM-error-reproduction/src/main/java/gen/H_Gen170.java | fd11b5a13b37e49562222ed202be92aeab715d80 | [] | no_license | michalradziwon/script | 39efc1db45237b95288fe580357e81d6f9f84107 | 1fd5f191621d9da3daccb147d247d1323fb92429 | refs/heads/master | 2021-01-21T21:47:16.432732 | 2016-03-23T02:41:50 | 2016-03-23T02:41:50 | 22,663,317 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java |
package gen;
public class H_Gen170 {
@com.google.inject.Inject
public H_Gen170(H_Gen171 h_gen171){
System.out.println(this.getClass().getCanonicalName() + " created. " + h_gen171 );
}
@com.google.inject.Inject public void injectInterfaceWithoutImpl(gen.InterfaceWithoutImpl i){} // should expolode :)
}
| [
"michal.radzi.won@gmail.com"
] | michal.radzi.won@gmail.com |
d1c8c328cc916ed834af074e3d62c2c1c46aed34 | 138c5dd54e57f498380c4c59e3ddabf939f1964a | /lcloud-library/lcloud-purchase-service/src/main/java/com/szcti/lcloud/purchase/service/impl/FileUploadUtil.java | c7d09bd5163b4d373719fd0a07de73a2529b192e | [] | no_license | JIANLAM/zt-project | 4d249f4b504789395a335df21fcf1cf009e07d78 | 50318c9296485d3a97050e307b3a8ab3e12510e7 | refs/heads/master | 2020-03-31T12:40:36.269261 | 2018-10-09T09:42:36 | 2018-10-09T09:42:36 | 152,225,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,048 | java | package com.szcti.lcloud.purchase.service.impl;
import com.szcti.lcloud.common.utils.IdGen;
import org.jboss.resteasy.plugins.providers.multipart.InputPart;
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
/**
* @Author liujunliang
* @Description
* @Date 2018/7/12
**/
public class FileUploadUtil {
//获取项目所在的路径
String filePath = System.getProperty("user.dir") + "/tmp/import/";
//String exportPath=System.getProperty("user.dir") + "\\export\\";
//String filePath="c:\\temp\\";//临时存放目录
public String uploadStoreFile(MultipartFormDataInput multipartFormDataInput,String fileName)
throws Exception {
//获取表单中的数据map
Map<String, List<InputPart>> dataMaps = multipartFormDataInput.getFormDataMap();
//根据表单元素名称获取表单元素(需要同前端沟通好表单元素的name)
List<InputPart> fileParts = dataMaps.get(fileName);//表单元素-文件
//解析获取表单文件的输入流
InputStream inputStream;
String rename;
try {
if (fileParts == null || fileParts.isEmpty())
throw new Exception("请求参数为空!");
InputPart filePart = fileParts.get(0);
String preindex=getFileNameByFileInputPart(filePart);
//preindex=preindex.split(".")[1];
rename=IdGen.getDateUUId()+preindex;
inputStream = filePart.getBody(InputStream.class, null);
} catch (Exception e) {
throw new Exception(e.getMessage());
}
//保存文件至本地
String filePathName =filePath+rename;
System.out.println("upload:"+filePathName);
//String filePathName = "C:\\temp\\newFile.xls";
File target = new File(filePathName);
FileOutputStream fos = null;
try {
if (!target.getParentFile().exists())
target.getParentFile().mkdirs();
fos = new FileOutputStream(target);
byte[] b = new byte[1024];
int readLength;
while ((readLength = inputStream.read(b)) != -1) {
fos.write(b, 0, readLength);
}
} catch (Exception e) {
//throw new AssistanceException(e.getMessage());
} finally {
if (inputStream != null)
inputStream.close();
if (fos != null)
fos.close();
}
return filePathName;
}
/**
* 从表单文件元素中提取文件名
*
* @param filePart
* @return
* @throws Exception
*/
public String getFileNameByFileInputPart(InputPart filePart) throws Exception {
String[] contentDispositionHeader = filePart.getHeaders().getFirst("Content-Disposition").split(";");
for (String fileName : contentDispositionHeader) {
if ((fileName.trim().startsWith("filename"))) {
String[] tmp = fileName.split("=");
String fileNameStr = tmp[1].trim().replaceAll("\"", "");
return fileNameStr;
}
}
return null;
}
/**
* 从表单元素中获取字串文本并以UTF-8编码
*
* @param inputPart
* @return
* @throws Exception
*/
public static String getInputPartAsString(InputPart inputPart) throws Exception {
if (inputPart == null)
return null;
String nameString = inputPart.getBodyAsString();
if (nameString == null || nameString.isEmpty())
return null;
return URLDecoder.decode(nameString, StandardCharsets.UTF_8.name());
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
} | [
"mrkinlam@163.com"
] | mrkinlam@163.com |
40919416c0727ce5891a885083c7d18f0262f326 | 01c2aa059ad6bb0e85a6e669723446084bf5b1c5 | /Botcoin-javafx/src/com/fxexperience/javafx/animation/FadeOutDownBigTransition.java | d7f32cb27b3abc7602f5c221d52ce1610d171dcc | [
"MIT"
] | permissive | adv0r/botcoin | 7baf02f59701ebe113b992680f360b74f5923116 | bab2914de3b87fb5563a8fdb9de2a47e0671a23a | refs/heads/master | 2020-03-30T05:49:53.696120 | 2014-04-29T07:45:58 | 2014-04-29T07:45:58 | 19,103,523 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,785 | java | package com.fxexperience.javafx.animation;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.TimelineBuilder;
import javafx.scene.Node;
import javafx.util.Duration;
/**
* Animate a fade out up big effect on a node
*
* Port of FadeOutDownBig from Animate.css http://daneden.me/animate by Dan Eden
*
* {@literal @}keyframes fadeOutDownBig {
* 0% {
* opacity: 1;
* transform: translateY(0);
* }
* 100% {
* opacity: 0;
* transform: translateY(2000px);
* }
* }
*
* @author Jasper Potts
*/
public class FadeOutDownBigTransition extends CachedTimelineTransition {
/**
* Create new FadeOutDownBigTransition
*
* @param node The node to affect
*/
public FadeOutDownBigTransition(final Node node) {
super(node, null);
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
@Override protected void starting() {
double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY();
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.translateYProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.translateYProperty(), endY, WEB_EASE)
)
)
.build();
super.starting();
}
@Override protected void stopping() {
super.stopping();
node.setTranslateY(0); // restore default
}
}
| [
"paternoster.nicolo@gmail.com"
] | paternoster.nicolo@gmail.com |
40439ee8ef395ecfca2060bd0cbea99568777498 | 01bd9890910d91152e7e67bc65b82a0646d5d736 | /src/test/java/com/dbunit/disable/log/controller/DbStatusControllerTest.java | ba46764c1526700f37e6a77de542f4e0ddc8c731 | [] | no_license | Kiririn00/dbunit-disabled-log | bc398d148096fda43b49d772b5f7c6cecdeed2ca | 9ee253420c5e68a4d0677347fab7b4c2b775677b | refs/heads/main | 2023-04-10T19:03:08.169739 | 2021-05-02T11:48:11 | 2021-05-02T11:48:11 | 363,573,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package com.dbunit.disable.log.controller;
import com.github.springtestdbunit.DbUnitTestExecutionListener;
import com.github.springtestdbunit.annotation.DatabaseSetup;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringRunner.class)
@SpringBootTest
@TestExecutionListeners({
DependencyInjectionTestExecutionListener.class,
TransactionalTestExecutionListener.class,
DbUnitTestExecutionListener.class
})
class DbStatusControllerTest {
@Test
@Transactional
@DisplayName("expected customer data should be same as actual data")
@DatabaseSetup("classpath:customerExpectedData.xml")
void selectTargetData(){
}
} | [
"as.varit_st@tni.ac.th"
] | as.varit_st@tni.ac.th |
5583381c72a7c266636393f2fda050247b1b2a8a | af606a04ed291e8c9b1e500739106a926e205ee2 | /aliyun-java-sdk-waf-openapi/src/main/java/com/aliyuncs/waf_openapi/transform/v20180117/CreateCertAndKeyResponseUnmarshaller.java | 44c19c68129ccba0343aa5906d1460a490f58d16 | [
"Apache-2.0"
] | permissive | xtlGitHub/aliyun-openapi-java-sdk | a733f0a16c8cc493cc28062751290f563ab73ace | f60c71de2c9277932b6549c79631b0f03b11cc36 | refs/heads/master | 2023-09-03T13:56:50.071024 | 2021-11-10T11:53:25 | 2021-11-10T11:53:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,402 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.waf_openapi.transform.v20180117;
import com.aliyuncs.waf_openapi.model.v20180117.CreateCertAndKeyResponse;
import com.aliyuncs.waf_openapi.model.v20180117.CreateCertAndKeyResponse.Result;
import com.aliyuncs.transform.UnmarshallerContext;
public class CreateCertAndKeyResponseUnmarshaller {
public static CreateCertAndKeyResponse unmarshall(CreateCertAndKeyResponse createCertAndKeyResponse, UnmarshallerContext _ctx) {
createCertAndKeyResponse.setRequestId(_ctx.stringValue("CreateCertAndKeyResponse.RequestId"));
Result result = new Result();
result.setWafTaskId(_ctx.stringValue("CreateCertAndKeyResponse.Result.WafTaskId"));
result.setStatus(_ctx.integerValue("CreateCertAndKeyResponse.Result.Status"));
createCertAndKeyResponse.setResult(result);
return createCertAndKeyResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
f7d1be06b4a199875682fa09dfeb87f87e8c14ec | 79f0296acf11c9852410a358130d477ebcdfad59 | /app/src/main/java/com/example/remembergroup/model/TextMessage.java | 9cb48eaac348706a28afb8e3fdf981071f9d9586 | [] | no_license | leekhai18/Project-Mobile | c41242a7250af78b5d567b3adbb4bf1ae59ac19f | 3c110cd95778a7b2a233865d1feba092900185e4 | refs/heads/master | 2021-09-02T08:06:56.454923 | 2017-12-31T19:43:37 | 2017-12-31T19:43:37 | 106,555,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package com.example.remembergroup.model;
public class TextMessage extends Message {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public TextMessage(String text, boolean isMine) {
super(Constant.TYPE_TEXT_MESSAGE, isMine);
this.text = text;
}
}
| [
"leekhai18@gmail.com"
] | leekhai18@gmail.com |
df653e81142e198378875642059bbbc47807a4bd | 96ca02a85d3702729076cb59ff15d069dfa8232b | /advert/src/com/dvnchina/advertDelivery/dao/impl/ProductDaoImpl.java | ef262e6b364910087691712b7f10d47c1c5258f6 | [] | no_license | Hurson/mysql | 4a1600d9f580ac086ff9472095ed6fa58fb11830 | 3db53442376485a310c76ad09d6cf71143f38274 | refs/heads/master | 2021-01-10T17:55:50.003989 | 2016-03-11T11:36:15 | 2016-03-11T11:36:15 | 54,877,514 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 12,494 | java | package com.dvnchina.advertDelivery.dao.impl;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import com.dvnchina.advertDelivery.constant.VodConstant;
import com.dvnchina.advertDelivery.dao.ProductDao;
import com.dvnchina.advertDelivery.model.AssetProduct;
import com.dvnchina.advertDelivery.model.ProductInfo;
public class ProductDaoImpl extends JdbcDaoSupport implements ProductDao {
@SuppressWarnings("unchecked")
@Override
public Map<Integer, Map<String, Object>> getProducts() {
String sql = "select id,product_id,modify_time from t_productinfo";
final Map<Integer, Map<String, Object>> productMap = new HashMap<Integer, Map<String, Object>>();
getJdbcTemplate().query(sql, new RowMapper() {
public Object mapRow(ResultSet rs, int num) throws SQLException {
ProductInfo product = new ProductInfo();
product.setProductId(rs.getString("product_id"));
product.setModifyTime(new Date(rs.getTimestamp("modify_time").getTime()));
final Map<String, Object> proMap = new HashMap<String, Object>();
Integer id = rs.getInt("id");
product.setId(id);
proMap.put(VodConstant.PRODUCT, product);
String queryAsset = "select t.id,t.product_id,t.asset_id,a.asset_id assetid,p.product_id productid "
+ "from t_asset_product t,t_assetinfo a,t_productinfo p "
+ "where a.id=t.asset_id and p.id=t.product_id and t.product_id="
+ id;
final Map<Integer, AssetProduct> assetMap = new HashMap<Integer, AssetProduct>();
/** 查询产品资源关系 */
getJdbcTemplate().query(queryAsset, new RowMapper() {
public Object mapRow(ResultSet rs, int num)
throws SQLException {
AssetProduct assetProduct = new AssetProduct();
assetProduct.setId(rs.getInt("id"));
assetProduct.setProduct_id(rs.getInt("product_id"));
assetProduct.setAsset_id(rs.getInt("asset_id"));
assetProduct.setProductId(rs.getString("productid"));
assetProduct.setAssetId(rs.getString("assetid"));
assetMap.put(assetProduct.hashCode(), assetProduct);
return null;
}
});
proMap.put(VodConstant.ASSETMAP, assetMap);
proMap.put(VodConstant.ASSETMAP, assetMap);
productMap.put(product.hashCode(), proMap);
return null;
}
});
return productMap;
}
private StringBuffer getSqlStr(List<String> productIds, int num) {
StringBuffer sql = new StringBuffer();
for (int i = num; i < productIds.size() && i - num < 1000; i++) {
if (i == 0 && num == 0) {
sql.append(" where product_id in(");
} else if (i == num) {
sql.append(" or product_id in(");
}
if (i != num) {
sql.append(",");
}
sql.append("'").append(productIds.get(i)).append("'");
}
sql.append(")");
return sql;
}
@SuppressWarnings("unchecked")
@Override
public Map<Integer, Map<String, Object>> getProductsByPId(
List<String> productIds) {
StringBuffer sql = new StringBuffer();
sql
.append("select id,product_id,modify_time from t_productinfo");
int size = productIds.size();
int num = 0;
while (size > 0) {
sql.append(this.getSqlStr(productIds, num));
num = num + 1000;
size = size - 1000;
}
final Map<Integer, Map<String, Object>> productMap = new HashMap<Integer, Map<String, Object>>();
getJdbcTemplate().query(sql.toString(), new RowMapper() {
public Object mapRow(ResultSet rs, int num) throws SQLException {
ProductInfo product = new ProductInfo();
product.setProductId(rs.getString("product_id"));
product.setModifyTime(new Date(rs.getTimestamp("modify_time").getTime()));
final Map<String, Object> proMap = new HashMap<String, Object>();
Integer id = rs.getInt("id");
product.setId(id);
proMap.put(VodConstant.PRODUCT, product);
String queryAsset = "select t.id,t.product_id,t.asset_id,a.asset_id assetid,p.product_id productid "
+ "from t_asset_product t,t_assetinfo a,t_productinfo p "
+ "where a.id=t.asset_id and p.id=t.product_id and t.product_id="
+ id;
final Map<Integer, AssetProduct> assetMap = new HashMap<Integer, AssetProduct>();
/** 查询产品资源关系 */
getJdbcTemplate().query(queryAsset, new RowMapper() {
public Object mapRow(ResultSet rs, int num)
throws SQLException {
AssetProduct assetProduct = new AssetProduct();
assetProduct.setId(rs.getInt("id"));
assetProduct.setProduct_id(rs.getInt("product_id"));
assetProduct.setAsset_id(rs.getInt("asset_id"));
assetProduct.setProductId(rs.getString("productid"));
assetProduct.setAssetId(rs.getString("assetid"));
assetMap.put(assetProduct.hashCode(), assetProduct);
return null;
}
});
proMap.put(VodConstant.ASSETMAP, assetMap);
productMap.put(product.hashCode(), proMap);
return null;
}
});
return productMap;
}
@Override
public void insertProduct(final List<ProductInfo> products) {
String sql = "insert into t_productinfo(id,product_id,product_name,price,product_desc,billing_model_name,billing_model_id,"
+ "billing_model_type,sp_id,is_package,poster_url,type,biz_id,biz_desc,create_time,modify_time,state) "
+ "values(T_PRODUCTINFO_SEQ.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement pstmt, int i)
throws SQLException {
pstmt.setString(1, products.get(i).getProductId());
pstmt.setString(2, products.get(i).getProductName());
pstmt.setString(3, products.get(i).getPrice());
pstmt.setString(4, products.get(i).getProductDesc());
pstmt.setString(5, products.get(i).getBillingModelName());
pstmt.setString(6, products.get(i).getBillingModelId());
pstmt.setString(7, products.get(i).getBillingModelType());
pstmt.setString(8, products.get(i).getSpId());
pstmt.setString(9, String.valueOf(products.get(i)
.getIsPackage()));
pstmt.setString(10, products.get(i).getPosterUrl());
pstmt.setString(11, products.get(i).getType());
pstmt.setString(12, products.get(i).getBizId());
pstmt.setString(13, products.get(i).getBizDesc());
pstmt.setTimestamp(14, new Timestamp(products.get(i).getCreateTime().getTime()));
pstmt.setTimestamp(15, new Timestamp(products.get(i).getModifyTime().getTime()));
pstmt.setString(16, String.valueOf(products.get(i).getState()));
}
public int getBatchSize() {
return products.size();
}
});
}
@Override
public void deleteProduct(final List<Integer> ids) {
String sql = "delete from t_productinfo where id=?";
getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement pstmt, int i)
throws SQLException {
pstmt.setInt(1, ids.get(i));
}
public int getBatchSize() {
return ids.size();
}
});
}
@Override
public void updateProduct(final List<ProductInfo> products) {
String sql = "update t_productinfo set product_id=?,product_name=?,price=?,product_desc=?,billing_model_name=?,billing_model_id=?,"
+ "billing_model_type=?,sp_id=?,is_package=?,poster_url=?,type=?,biz_id=?,biz_desc=?,create_time=?,"
+ "modify_time=?,state=? where id=?";
getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement pstmt, int i)
throws SQLException {
pstmt.setString(1, products.get(i).getProductId());
pstmt.setString(2, products.get(i).getProductName());
pstmt.setString(3, products.get(i).getPrice());
pstmt.setString(4, products.get(i).getProductDesc());
pstmt.setString(5, products.get(i).getBillingModelName());
pstmt.setString(6, products.get(i).getBillingModelId());
pstmt.setString(7, products.get(i).getBillingModelType());
pstmt.setString(8, products.get(i).getSpId());
pstmt.setString(9, String.valueOf(products.get(i)
.getIsPackage()));
pstmt.setString(10, products.get(i).getPosterUrl());
pstmt.setString(11, products.get(i).getType());
pstmt.setString(12, products.get(i).getBizId());
pstmt.setString(13, products.get(i).getBizDesc());
pstmt.setTimestamp(14, new Timestamp(products.get(i).getCreateTime().getTime()));
pstmt.setTimestamp(15, new Timestamp(products.get(i).getModifyTime().getTime()));
pstmt.setString(16, String.valueOf(products.get(i).getState()));
pstmt.setInt(17, products.get(i).getId());
}
public int getBatchSize() {
return products.size();
}
});
}
@Override
public void insertAssetProduct(final Object[] assetProducts) {
String sql = "insert into t_asset_product(id,product_id,asset_id) values(T_ASSET_PRODUCT_SEQ.nextval,"
+ "(select id from t_productinfo where product_id=?),(select id from t_assetinfo where asset_id=?))";
getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement pstmt, int i)
throws SQLException {
AssetProduct ap = (AssetProduct) assetProducts[i];
try {
pstmt.setString(1, ap.getProductId());
pstmt.setString(2, ap.getAssetId());
} catch (Exception e) {
logger.info("通过资源或产品id查询不到记录,添加资源包与资源关系失败!");
}
}
public int getBatchSize() {
return assetProducts.length;
}
});
}
@Override
public void deleteAssetProduct(final List<Integer> ids) {
String sql = "delete from t_asset_product where id=?";
getJdbcTemplate().batchUpdate(sql, new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement pstmt, int i)
throws SQLException {
pstmt.setInt(1, ids.get(i));
}
public int getBatchSize() {
return ids.size();
}
});
}
@Override
public List<ProductInfo> getProducts(int begin, int end, String id,
String name) {
StringBuffer sql = new StringBuffer();
sql.append("select id,product_id,product_name,price,is_package,type,biz_id,state from t_productinfo where 1=1 ");
if(StringUtils.isNotBlank(id)){
sql.append(" and upper(product_id) like '%");
sql.append(id.toUpperCase());
sql.append("%'");
}
if(StringUtils.isNotBlank(name)){
sql.append(" and product_name like '%");
sql.append(name);
sql.append("%'");
}
List<ProductInfo> ps = getJdbcTemplate().query(this.getPageSql(sql.toString(), begin, end),new RowMapper<ProductInfo>(){
@Override
public ProductInfo mapRow(ResultSet rs, int num)
throws SQLException {
ProductInfo p = new ProductInfo();
p.setId(rs.getInt("id"));
p.setProductId(rs.getString("product_id"));
p.setProductName(rs.getString("product_name"));
p.setPrice(rs.getString("price"));
String isPackage = rs.getString("is_package");
if(StringUtils.isNotBlank(isPackage)){
p.setIsPackage(isPackage.charAt(0));
}
p.setType(rs.getString("type"));
p.setBizId(rs.getString("biz_id"));
String state = rs.getString("state");
if(StringUtils.isNotBlank(state)){
p.setState(state.charAt(0));
}
return p;
}
});
return ps;
}
@Override
public int getProductCount(String id, String name) {
StringBuffer sql = new StringBuffer();
sql.append("select count(id) from t_productinfo where 1=1 ");
if(StringUtils.isNotBlank(id)){
sql.append(" and upper(product_id) like '%");
sql.append(id.toUpperCase());
sql.append("%'");
}
if(StringUtils.isNotBlank(name)){
sql.append(" and product_name like '%");
sql.append(name);
sql.append("%'");
}
return getJdbcTemplate().queryForInt(sql.toString());
}
private String getPageSql(String sql, int begin, int end) {
String pageSql = "select * from (select row_.*, rownum rownum_ from ("
+ sql + ") row_ where rownum <= " + end + ") where rownum_ >="
+ begin;
return pageSql;
}
}
| [
"zhengguojin@d881c268-5c81-4d69-b6ac-ed4e9099e0f2"
] | zhengguojin@d881c268-5c81-4d69-b6ac-ed4e9099e0f2 |
33f447918370b35dfefbfd5a8343793ae7b0ed60 | bc51a05094f0a4b90930dffc0891929abb03d197 | /src/main/java/me/gosimple/nbvcxz/matching/match/BruteForceMatch.java | 264c2099844ceeccc5e0bf94e66bf6e2fcdaf630 | [
"MIT"
] | permissive | vgorin/nbvcxz | b3aca274323054964d8e188e352a8d4ca377906e | 57be9926f223266d9659b397a3c4a4556da04886 | refs/heads/master | 2021-12-10T15:49:25.217520 | 2021-08-27T14:20:22 | 2021-08-27T14:20:22 | 229,557,702 | 0 | 0 | MIT | 2019-12-22T11:30:58 | 2019-12-22T11:30:58 | null | UTF-8 | Java | false | false | 949 | java | package me.gosimple.nbvcxz.matching.match;
import me.gosimple.nbvcxz.resources.BruteForceUtil;
import me.gosimple.nbvcxz.resources.Configuration;
/**
* @author Adam Brusselback
*/
public final class BruteForceMatch extends BaseMatch
{
/**
* Create a new {@code BruteForceMatch}
*
* @param match the {@code String} we are creating the {@code BruteForceMatch} from.
* @param configuration the {@link Configuration} object.
* @param index the index in the password for this match.
*/
public BruteForceMatch(char match, Configuration configuration, int index)
{
super(Character.toString(match), configuration, index, index);
super.setEntropy(getEntropy(match));
}
private double getEntropy(char character)
{
int cardinality = BruteForceUtil.getBrutForceCardinality(character);
return Math.max(0, log2(cardinality * getToken().length()));
}
}
| [
"adam.brusselback@gosimple.me"
] | adam.brusselback@gosimple.me |
d1fb9d59174b535f9bda5796f4df5e64c15c1909 | b737ee956d7bc27ed75836d5db556fa46372f57d | /src/cn/edu/syuct/note/controller/user/RegistController.java | ae752f086c07e0bfe6ba45e03d5fff9fef2d75bb | [] | no_license | LJYuan71/CloudNote | cbf1b497838cfc9ca4fe72a4bb1bd5499679ff4d | ce9d75e3299cdf8e9d3c32dc794b66ac4e6f022f | refs/heads/master | 2021-01-22T11:58:18.066591 | 2016-09-19T13:49:22 | 2016-09-19T13:49:22 | 68,610,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | package cn.edu.syuct.note.controller.user;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.edu.syuct.note.entity.NoteResult;
import cn.edu.syuct.note.service.UserService;
@Controller
@RequestMapping("/user")
public class RegistController {
@Resource
private UserService userService;
@RequestMapping("/regist.do")
@ResponseBody
public NoteResult execute(
String name,String password,
String nickname) throws Exception{
NoteResult result =
userService.regist(
name, password, nickname);
return result;
}
}
| [
"ljyuan71@163.com"
] | ljyuan71@163.com |
d1f4b009900bf7e6486f61000006c2939e2ac6b8 | ab1db2db5ec0e3652ff6324669a9902cd5afa549 | /libs/OpenCV/src/main/java/org/opencv/android/JavaCameraView.java | ac05edfab14a8aba7c60efc3d9ec4a1018484ac1 | [
"Apache-2.0"
] | permissive | youzhuangit/mirror | 4a1d5b10ce8eb11a5624c57895dbcb7cc82cc681 | 0525e13560956be375066a2b9562d04494596e65 | refs/heads/master | 2021-01-22T11:20:18.039952 | 2016-09-07T12:11:53 | 2016-09-07T12:11:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,356 | java | package org.opencv.android;
import android.content.Context;
import android.graphics.ImageFormat;
import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.ViewGroup.LayoutParams;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;
import java.util.List;
/**
* This class is an implementation of the Bridge View between OpenCV and Java Camera.
* This class relays on the functionality available in base class and only implements
* required functions:
* connectCamera - opens Java camera and sets the PreviewCallback to be delivered.
* disconnectCamera - closes the camera and stops preview.
* When frame is delivered via callback from Camera - it processed via OpenCV to be
* converted to RGBA32 and then passed to the external callback for modifications if required.
*/
public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallback {
private static final int MAGIC_TEXTURE_ID = 10;
private static final String TAG = "JavaCameraView";
private byte mBuffer[];
private Mat[] mFrameChain;
private int mChainIdx = 0;
private Thread mThread;
private boolean mStopThread;
protected Camera mCamera;
protected JavaCameraFrame[] mCameraFrame;
private SurfaceTexture mSurfaceTexture;
public static class JavaCameraSizeAccessor implements ListItemAccessor {
@Override
public int getWidth(Object obj) {
Camera.Size size = (Camera.Size) obj;
return size.width;
}
@Override
public int getHeight(Object obj) {
Camera.Size size = (Camera.Size) obj;
return size.height;
}
}
public JavaCameraView(Context context, int cameraId) {
super(context, cameraId);
}
public JavaCameraView(Context context, AttributeSet attrs) {
super(context, attrs);
}
protected boolean initializeCamera(int width, int height) {
Log.d(TAG, "Initialize java camera");
boolean result = true;
synchronized (this) {
mCamera = null;
if (mCameraIndex == CAMERA_ID_ANY) {
Log.d(TAG, "Trying to open camera with old open()");
try {
mCamera = Camera.open();
}
catch (Exception e){
Log.e(TAG, "Camera is not available (in use or does not exist): " + e.getLocalizedMessage());
}
if(mCamera == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
boolean connected = false;
for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(camIdx) + ")");
try {
mCamera = Camera.open(camIdx);
connected = true;
} catch (RuntimeException e) {
Log.e(TAG, "Camera #" + camIdx + "failed to open: " + e.getLocalizedMessage());
}
if (connected) break;
}
}
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
int localCameraIndex = mCameraIndex;
if (mCameraIndex == CAMERA_ID_BACK) {
Log.i(TAG, "Trying to open back camera");
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
Camera.getCameraInfo( camIdx, cameraInfo );
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
localCameraIndex = camIdx;
break;
}
}
} else if (mCameraIndex == CAMERA_ID_FRONT) {
Log.i(TAG, "Trying to open front camera");
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
Camera.getCameraInfo( camIdx, cameraInfo );
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
localCameraIndex = camIdx;
break;
}
}
}
if (localCameraIndex == CAMERA_ID_BACK) {
Log.e(TAG, "Back camera not found!");
} else if (localCameraIndex == CAMERA_ID_FRONT) {
Log.e(TAG, "Front camera not found!");
} else {
Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(localCameraIndex) + ")");
try {
mCamera = Camera.open(localCameraIndex);
} catch (RuntimeException e) {
Log.e(TAG, "Camera #" + localCameraIndex + "failed to open: " + e.getLocalizedMessage());
}
}
}
}
if (mCamera == null)
return false;
/* Now set camera parameters */
try {
Camera.Parameters params = mCamera.getParameters();
Log.d(TAG, "getSupportedPreviewSizes()");
List<android.hardware.Camera.Size> sizes = params.getSupportedPreviewSizes();
if (sizes != null) {
/* Select the size that fits surface considering maximum size allowed */
Size frameSize = calculateCameraFrameSize(sizes, new JavaCameraSizeAccessor(), width, height);
params.setPreviewFormat(ImageFormat.NV21);
Log.d(TAG, "Set preview size to " + Integer.valueOf((int)frameSize.width) + "x" + Integer.valueOf((int)frameSize.height));
params.setPreviewSize((int)frameSize.width, (int)frameSize.height);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && !android.os.Build.MODEL.equals("GT-I9100"))
params.setRecordingHint(true);
List<String> FocusModes = params.getSupportedFocusModes();
if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
{
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
}
mCamera.setParameters(params);
params = mCamera.getParameters();
mFrameWidth = params.getPreviewSize().width;
mFrameHeight = params.getPreviewSize().height;
if ((getLayoutParams().width == LayoutParams.MATCH_PARENT) && (getLayoutParams().height == LayoutParams.MATCH_PARENT))
mScale = Math.min(((float)height)/mFrameHeight, ((float)width)/mFrameWidth);
else
mScale = 0;
int size = mFrameWidth * mFrameHeight;
size = size * ImageFormat.getBitsPerPixel(params.getPreviewFormat()) / 8;
mBuffer = new byte[size];
mCamera.addCallbackBuffer(mBuffer);
mCamera.setPreviewCallbackWithBuffer(this);
mFrameChain = new Mat[2];
mFrameChain[0] = new Mat(mFrameHeight + (mFrameHeight/2), mFrameWidth, CvType.CV_8UC1);
mFrameChain[1] = new Mat(mFrameHeight + (mFrameHeight/2), mFrameWidth, CvType.CV_8UC1);
AllocateCache();
mCameraFrame = new JavaCameraFrame[2];
mCameraFrame[0] = new JavaCameraFrame(mFrameChain[0], mFrameWidth, mFrameHeight);
mCameraFrame[1] = new JavaCameraFrame(mFrameChain[1], mFrameWidth, mFrameHeight);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID);
mCamera.setPreviewTexture(mSurfaceTexture);
} else
mCamera.setPreviewDisplay(null);
/* Finally we are ready to start the preview */
Log.d(TAG, "startPreview");
mCamera.startPreview();
}
else
result = false;
} catch (Exception e) {
result = false;
e.printStackTrace();
}
}
return result;
}
protected void releaseCamera() {
synchronized (this) {
if (mCamera != null) {
mCamera.stopPreview();
mCamera.setPreviewCallback(null);
mCamera.release();
}
mCamera = null;
if (mFrameChain != null) {
mFrameChain[0].release();
mFrameChain[1].release();
}
if (mCameraFrame != null) {
mCameraFrame[0].release();
mCameraFrame[1].release();
}
}
}
private boolean mCameraFrameReady = false;
@Override
protected boolean connectCamera(int width, int height) {
/* 1. We need to instantiate camera
* 2. We need to start thread which will be getting frames
*/
/* First step - initialize camera connection */
Log.d(TAG, "Connecting to camera");
if (!initializeCamera(width, height))
return false;
mCameraFrameReady = false;
/* now we can start update thread */
Log.d(TAG, "Starting processing thread");
mStopThread = false;
mThread = new Thread(new CameraWorker());
mThread.start();
return true;
}
@Override
protected void disconnectCamera() {
/* 1. We need to stop thread which updating the frames
* 2. Stop camera and release it
*/
Log.d(TAG, "Disconnecting from camera");
try {
mStopThread = true;
Log.d(TAG, "Notify thread");
synchronized (this) {
this.notify();
}
Log.d(TAG, "Wating for thread");
if (mThread != null)
mThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
mThread = null;
}
/* Now release camera */
releaseCamera();
mCameraFrameReady = false;
}
@Override
public void onPreviewFrame(byte[] frame, Camera arg1) {
//Log.d(TAG, "Preview Frame received. Frame size: " + frame.length);
synchronized (this) {
mFrameChain[mChainIdx].put(0, 0, frame);
mCameraFrameReady = true;
this.notify();
}
if (mCamera != null)
mCamera.addCallbackBuffer(mBuffer);
}
private class JavaCameraFrame implements CvCameraViewFrame {
@Override
public Mat gray() {
return mYuvFrameData.submat(0, mHeight, 0, mWidth);
}
@Override
public Mat rgba() {
Imgproc.cvtColor(mYuvFrameData, mRgba, Imgproc.COLOR_YUV2RGBA_NV21, 4);
return mRgba;
}
public JavaCameraFrame(Mat Yuv420sp, int width, int height) {
super();
mWidth = width;
mHeight = height;
mYuvFrameData = Yuv420sp;
mRgba = new Mat();
}
public void release() {
mRgba.release();
}
private Mat mYuvFrameData;
private Mat mRgba;
private int mWidth;
private int mHeight;
};
private class CameraWorker implements Runnable {
@Override
public void run() {
do {
boolean hasFrame = false;
synchronized (JavaCameraView.this) {
try {
while (!mCameraFrameReady && !mStopThread) {
JavaCameraView.this.wait();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
if (mCameraFrameReady)
{
mChainIdx = 1 - mChainIdx;
mCameraFrameReady = false;
hasFrame = true;
}
}
if (!mStopThread && hasFrame) {
if (!mFrameChain[1 - mChainIdx].empty())
deliverAndDrawFrame(mCameraFrame[1 - mChainIdx]);
}
} while (!mStopThread);
Log.d(TAG, "Finish processing thread");
}
}
}
| [
"jreyes@vaporwarecorp.com"
] | jreyes@vaporwarecorp.com |
54e698a1e957790c204d6be3cad0eecd933b79bb | f4da8944e4f112a37f65548ced9cfa70211b541b | /src/main/java/org/icslab/sibadev/common/config/security/services/CustomOAuth2UserService.java | 92a8ef6d1ebba3d46e8180169d7cfdfef3f5ec8c | [] | no_license | TeamAltera/siba-BE-dev | f8259e48ae08a02a6d7b1db05e8606e800c56189 | c25077b0052896a5f57b57156f3c4dfbd2a1ace0 | refs/heads/master | 2022-02-24T23:21:22.133639 | 2019-09-04T10:02:36 | 2019-09-04T10:02:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,132 | java | package org.icslab.sibadev.common.config.security.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.icslab.sibadev.common.config.security.oauth2.UserPrincipal;
import org.icslab.sibadev.common.domain.kakao.KakaoDTO;
import org.icslab.sibadev.user.domain.UserDTO;
import org.icslab.sibadev.mappers.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequestEntityConverter;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.OAuth2AuthorizationException;
import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
import java.util.Optional;
@Service
public class CustomOAuth2UserService implements OAuth2UserService<OAuth2UserRequest, OAuth2User> {
private static final String MISSING_USER_INFO_URI_ERROR_CODE = "missing_user_info_uri";
private static final String MISSING_USER_NAME_ATTRIBUTE_ERROR_CODE = "missing_user_name_attribute";
private static final String INVALID_USER_INFO_RESPONSE_ERROR_CODE = "invalid_user_info_response";
private static final ParameterizedTypeReference<Map<String, Object>> PARAMETERIZED_RESPONSE_TYPE =
new ParameterizedTypeReference<Map<String, Object>>() {};
private RestOperations restOperations;
private Converter<OAuth2UserRequest, RequestEntity<?>> requestEntityConverter = new OAuth2UserRequestEntityConverter();
@Autowired
private UserMapper userMapper;
public CustomOAuth2UserService(){
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler());
this.restOperations = restTemplate;
}
@Override
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
//provider의 tokenUri 검사
if (!StringUtils.hasText(userRequest.getClientRegistration().getProviderDetails().getUserInfoEndpoint().getUri())) {
OAuth2Error oauth2Error = new OAuth2Error(
MISSING_USER_INFO_URI_ERROR_CODE,
"Missing required UserInfo Uri in UserInfoEndpoint for Client Registration: " +
userRequest.getClientRegistration().getRegistrationId(),
null
);
throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString());
}
//provider의 user-name-attribute 값 검사
String userNameAttributeName = userRequest.getClientRegistration().getProviderDetails()
.getUserInfoEndpoint().getUserNameAttributeName();
if (!StringUtils.hasText(userNameAttributeName)) {
OAuth2Error oauth2Error = new OAuth2Error(
MISSING_USER_NAME_ATTRIBUTE_ERROR_CODE,
"Missing required \"user name\" attribute name in UserInfoEndpoint for Client Registration: " +
userRequest.getClientRegistration().getRegistrationId(),
null
);
throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString());
}
RequestEntity<?> request = this.requestEntityConverter.convert(userRequest);
ResponseEntity<Map<String, Object>> response;
try {
//https://kapi.kakao.com/v2/user/me로 Authorization헤더 포함하여 사용자 정보 요청
response = this.restOperations.exchange(request, PARAMETERIZED_RESPONSE_TYPE);
} catch (OAuth2AuthorizationException ex) {
OAuth2Error oauth2Error = ex.getError();
StringBuilder errorDetails = new StringBuilder();
errorDetails.append("Error details: [");
errorDetails
.append("UserInfo Uri: ")
.append(userRequest.getClientRegistration().getProviderDetails().getUserInfoEndpoint().getUri());
errorDetails
.append(", Error Code: ")
.append(oauth2Error.getErrorCode());
if (oauth2Error.getDescription() != null) {
errorDetails
.append(", Error Description: ")
.append(oauth2Error.getDescription());
}
errorDetails.append("]");
oauth2Error = new OAuth2Error(INVALID_USER_INFO_RESPONSE_ERROR_CODE,
"An error occurred while attempting to retrieve the UserInfo Resource: " + errorDetails.toString(), null);
throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString(), ex);
} catch (RestClientException ex) {
OAuth2Error oauth2Error = new OAuth2Error(INVALID_USER_INFO_RESPONSE_ERROR_CODE,
"An error occurred while attempting to retrieve the UserInfo Resource: " + ex.getMessage(), null);
throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString(), ex);
}
Map<String, Object> userAttributes = response.getBody();//response body에 사용자 정보들 위치
//map을 KakaoUserInfoDto로 변환
final ObjectMapper mapper = new ObjectMapper(); // jackson's objectmapper
KakaoDTO kakaoUser = mapper.convertValue(userAttributes, KakaoDTO.class);
OAuth2User oauth2User = processOAuth2User(kakaoUser);
return oauth2User;
/*Set<GrantedAuthority> authorities = Collections.singleton(new OAuth2UserAuthority(userAttributes));
return new DefaultOAuth2User(authorities, userAttributes, userNameAttributeName);*/
}
private OAuth2User processOAuth2User(KakaoDTO kakaoUser) {
Optional<UserDTO> userOptional = userMapper.getUserByProviderId(kakaoUser.getId());
UserDTO user;
if(userOptional.isPresent()) { //사용자 정보 업데이트
user = userOptional.get();
user = updateExistingUser(user, kakaoUser);
} else { //등록이 안된 경우 새로 등록
user = registerNewUser(kakaoUser);
}
return UserPrincipal.create(user);
}
//새로운 사용자 등록
private UserDTO registerNewUser(KakaoDTO kakaoUser) {
UserDTO user = new UserDTO();
user.setProviderId(kakaoUser.getId());
//userInfoDto.setName(kakaoUserInfo.getProperties().getNickname());
user.setName("test"); //추후에 이름 변경해야
user.setEmail(kakaoUser.getKakaoAccount().getEmail());
user.setProfileImage(kakaoUser.getProperties().getProfileImage());
userMapper.save(user);
user = userMapper.getUserByProviderId(kakaoUser.getId()).get(); //추후에 최적화를 위한다면 provider_id가 PK가 되어야만 함
return user;
}
//기존 사용자 정보 업데이트
private UserDTO updateExistingUser(UserDTO existingUser, KakaoDTO kakaoUserInfo) {
//existingUserInfoDto.setName(kakaoUserInfo.getProperties().getNickname());
existingUser.setName("test"); //추후에 이름 변경해야
existingUser.setProfileImage(kakaoUserInfo.getProperties().getProfileImage());
existingUser.setEmail(kakaoUserInfo.getKakaoAccount().getEmail());
userMapper.update(existingUser);
return existingUser;
}
} | [
"sencom1028@gmail.com"
] | sencom1028@gmail.com |
144fd021768ab506b1aaacd64339c0bfd3d1e6b2 | 5113a3a8a110de49637aa7d1e9f75994cce8b9ef | /api_front_core/src/test/java/common/frame/data/CvsWriter.java | 86f0a2805f00d064332a6c365df572e85a9b31ef | [] | no_license | bluesky1986007/yd | c71d3fc847503b8001665c0b89f8f29fd17ae646 | aa0865c316ed5e8c4180b8716dfad95dcd1717bd | refs/heads/master | 2023-03-25T12:31:18.245079 | 2021-03-04T11:54:55 | 2021-03-04T11:54:55 | 302,634,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package common.frame.data;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class CvsWriter{
public CvsWriter(Object aa, String envTestID, HashMap<String,String> data)
{
String result="";
try
{
File writeFile = new File(new File("./").getCanonicalPath() + "//testDataWrite//"+ envTestID + "//"+ aa.getClass().getSimpleName() + ".csv");
BufferedWriter writeText = new BufferedWriter(new FileWriter(writeFile,true));
for (String value:data.values()){
if ("".equals(result)){
result = value;
}else {
result = result+","+value;
}
}
writeText.write(result);
writeText.newLine();
writeText.flush();
writeText.close();
} catch (FileNotFoundException e) {
System.out.println("没有找到指定文件");
} catch (IOException e) {
System.out.println("文件读写出错");
}
}
}
| [
"allen@AllendeMacBook-Pro.local"
] | allen@AllendeMacBook-Pro.local |
7bb1f1108ef189dcf33bca7031e0a80b27f8ab38 | 629c7d40989413b1b780bebf1e989b172dbea631 | /Design Patterns Java class/classes/aula08/ex01a_Proxy/BankAccount.java | a8ddcff074d62a2e747dd23aa028e26528672210 | [] | no_license | diogo-f/Computer_Engineering_classes_and_works | 1255faa70bc1ce710b518025803e25efd0b3d6e3 | 6a53a01fa1fc6f4694ea34780596bd712a058852 | refs/heads/master | 2020-03-21T01:17:49.268500 | 2018-06-19T19:17:45 | 2018-06-19T19:17:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | 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 aula08.ex01a_Proxy;
/**
*
* @author diogo
*/
public interface BankAccount {
void deposit(double amount);
boolean withdraw(double amount);
double balance();
}
| [
"diogo.reis@ua.pt"
] | diogo.reis@ua.pt |
ef9275a6c9f79e9106dfb1f8bdb5164a0e678ce5 | f009dc33f9624aac592cb66c71a461270f932ffa | /src/main/java/com/alipay/api/domain/PosDeviceInfoVO.java | e1c3d65e39cd52069cc5fd65420a86a7c3876c56 | [
"Apache-2.0"
] | permissive | 1093445609/alipay-sdk-java-all | d685f635af9ac587bb8288def54d94e399412542 | 6bb77665389ba27f47d71cb7fa747109fe713f04 | refs/heads/master | 2021-04-02T16:49:18.593902 | 2020-03-06T03:04:53 | 2020-03-06T03:04:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,796 | java | package com.alipay.api.domain;
import java.util.Date;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 设备商回流pos基础设备信息
*
* @author auto create
* @since 1.0, 2018-03-08 10:35:41
*/
public class PosDeviceInfoVO extends AlipayObject {
private static final long serialVersionUID = 4754144462785883866L;
/**
* 设备对应的软件方公司名称,比如:美味不用等;银盒子;二维火;云纵;雅座;辰森;
*/
@ApiField("decive_software_name")
private String deciveSoftwareName;
/**
* 设备安装的应用数
*/
@ApiField("device_app_cnt")
private String deviceAppCnt;
/**
* 设备安装的应用列表对应的流量,单位KB
*/
@ApiField("device_app_flow")
private String deviceAppFlow;
/**
* 设备安装的应用列表
*/
@ApiField("device_app_list")
private String deviceAppList;
/**
* 设备出厂公司;比如:商米;新大陆;荣焱;
*/
@ApiField("device_company_name")
private String deviceCompanyName;
/**
* 设备总使用流量,单位KB
*/
@ApiField("device_flow")
private String deviceFlow;
/**
* pos机设备ip值
*/
@ApiField("device_ip")
private String deviceIp;
/**
* pos机设备MAC地址
*/
@ApiField("device_mac")
private String deviceMac;
/**
* 设备运行的操作系统版本
*/
@ApiField("device_os_version")
private String deviceOsVersion;
/**
* pos机设备状态值,枚举值为:已出厂(1),已入仓(2),已出售(3),已报单(4),已发货(5),已收货(6),已激活(7)、已绑定(8)、运行中(9)、设备失联(10)、已解绑(11)
*/
@ApiField("device_status")
private String deviceStatus;
/**
* pos机设备类型,枚举值为: 旗舰(FLAG_SHIP),高端(HIGH_END),标准(STANDARD),手持(IN_HAND)
*/
@ApiField("device_type")
private String deviceType;
/**
* 设备型号,如荣焱P10CC、商米D1、荣焱P10S、商米P1、荣焱HD01、商米V1、商米M1、荣焱P8K、商米T1、商米T2lite、荣焱P8G、商米T1、商米T2Lite等
*/
@ApiField("device_version")
private String deviceVersion;
/**
* 设备激活时间
*/
@ApiField("gmt_activate")
private Date gmtActivate;
/**
* 最后登录时间:设备处于登陆状态的最后时间
*/
@ApiField("gmt_login")
private Date gmtLogin;
/**
* 设备解绑时间
*/
@ApiField("gmt_production")
private Date gmtProduction;
/**
* 最后发送信息时间:设备最后发送信息的时间,发给服务端的最后时间
*/
@ApiField("gmt_send")
private Date gmtSend;
/**
* 设备出厂时间
*/
@ApiField("gmt_unbundling")
private Date gmtUnbundling;
/**
* 最后更新时间:设备上软件的最后更新时间
*/
@ApiField("gmt_update")
private Date gmtUpdate;
/**
* 数据回流设备对应的ISV名称
*/
@ApiField("isv_name")
private String isvName;
/**
* 数据回流设备对应的ISV_PID
*/
@ApiField("isv_pid")
private String isvPid;
/**
* 口碑门店id,激活设备才有口碑门店id
*/
@ApiField("shop_id")
private String shopId;
/**
* 设备id,唯一标识设备的ID,SN号
*/
@ApiField("sn_no")
private String snNo;
public String getDeciveSoftwareName() {
return this.deciveSoftwareName;
}
public void setDeciveSoftwareName(String deciveSoftwareName) {
this.deciveSoftwareName = deciveSoftwareName;
}
public String getDeviceAppCnt() {
return this.deviceAppCnt;
}
public void setDeviceAppCnt(String deviceAppCnt) {
this.deviceAppCnt = deviceAppCnt;
}
public String getDeviceAppFlow() {
return this.deviceAppFlow;
}
public void setDeviceAppFlow(String deviceAppFlow) {
this.deviceAppFlow = deviceAppFlow;
}
public String getDeviceAppList() {
return this.deviceAppList;
}
public void setDeviceAppList(String deviceAppList) {
this.deviceAppList = deviceAppList;
}
public String getDeviceCompanyName() {
return this.deviceCompanyName;
}
public void setDeviceCompanyName(String deviceCompanyName) {
this.deviceCompanyName = deviceCompanyName;
}
public String getDeviceFlow() {
return this.deviceFlow;
}
public void setDeviceFlow(String deviceFlow) {
this.deviceFlow = deviceFlow;
}
public String getDeviceIp() {
return this.deviceIp;
}
public void setDeviceIp(String deviceIp) {
this.deviceIp = deviceIp;
}
public String getDeviceMac() {
return this.deviceMac;
}
public void setDeviceMac(String deviceMac) {
this.deviceMac = deviceMac;
}
public String getDeviceOsVersion() {
return this.deviceOsVersion;
}
public void setDeviceOsVersion(String deviceOsVersion) {
this.deviceOsVersion = deviceOsVersion;
}
public String getDeviceStatus() {
return this.deviceStatus;
}
public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
public String getDeviceType() {
return this.deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getDeviceVersion() {
return this.deviceVersion;
}
public void setDeviceVersion(String deviceVersion) {
this.deviceVersion = deviceVersion;
}
public Date getGmtActivate() {
return this.gmtActivate;
}
public void setGmtActivate(Date gmtActivate) {
this.gmtActivate = gmtActivate;
}
public Date getGmtLogin() {
return this.gmtLogin;
}
public void setGmtLogin(Date gmtLogin) {
this.gmtLogin = gmtLogin;
}
public Date getGmtProduction() {
return this.gmtProduction;
}
public void setGmtProduction(Date gmtProduction) {
this.gmtProduction = gmtProduction;
}
public Date getGmtSend() {
return this.gmtSend;
}
public void setGmtSend(Date gmtSend) {
this.gmtSend = gmtSend;
}
public Date getGmtUnbundling() {
return this.gmtUnbundling;
}
public void setGmtUnbundling(Date gmtUnbundling) {
this.gmtUnbundling = gmtUnbundling;
}
public Date getGmtUpdate() {
return this.gmtUpdate;
}
public void setGmtUpdate(Date gmtUpdate) {
this.gmtUpdate = gmtUpdate;
}
public String getIsvName() {
return this.isvName;
}
public void setIsvName(String isvName) {
this.isvName = isvName;
}
public String getIsvPid() {
return this.isvPid;
}
public void setIsvPid(String isvPid) {
this.isvPid = isvPid;
}
public String getShopId() {
return this.shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getSnNo() {
return this.snNo;
}
public void setSnNo(String snNo) {
this.snNo = snNo;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
5c44e150bbf1556bc0fb65d0c32b3b30b8aee020 | 16409065dcd09ded06962d1e8aba5fddf4aac7cf | /lib-v1/src/testing_lib/dataTypeIfazeMethodParamBoxing/DataTypeIfazeMethodParamBoxing.java | 581e612c6a449ae227526e187100317fa21fd980 | [] | no_license | mkaouer/api-evolution-data-corpus | ac6902e9fea97367d128a0641adff881ba7d42d0 | 407398eb0a512a94ab3637de04f5074333743ad5 | refs/heads/master | 2021-06-20T06:13:28.931167 | 2017-07-03T18:24:23 | 2017-07-03T18:24:23 | 280,723,347 | 1 | 0 | null | 2020-07-18T19:19:25 | 2020-07-18T19:19:24 | null | UTF-8 | Java | false | false | 143 | java | package testing_lib.dataTypeIfazeMethodParamBoxing;
public interface DataTypeIfazeMethodParamBoxing {
public void method1(int param1);
}
| [
"kamil.jezek@gmail.com"
] | kamil.jezek@gmail.com |
0ff9deb733366ad4dd5db2e18cfe3714f90a87a2 | e1ec1f28492746b3be253fbd3ed07c21e77253af | /src/main/java/org/energyos/espi/common/service/BatchListService.java | 3750736025c7dc40e5a940e73e967523402cddd7 | [] | no_license | AxKey/OpenESPI-Common-java | 337044c834538a27e2810d303692c6182255f0d2 | 3e94ec3bb533ff081783a126c22e64ee12f9c695 | refs/heads/master | 2021-01-21T06:10:25.253130 | 2014-02-04T05:50:35 | 2014-02-04T05:50:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package org.energyos.espi.common.service;
import org.energyos.espi.common.domain.BatchList;
import java.util.List;
public interface BatchListService {
void persist(BatchList batchList);
List<BatchList> findAll();
}
| [
"pair+izabel@pivotallabs.com"
] | pair+izabel@pivotallabs.com |
8ffbf565439ccff44370485471085defc12fd7d6 | 09e4f8ed0987774d120920a2b55e31c75cadc7ef | /tutoriais/saxsample/saxproj/src/main/java/br/com/fuctura/model/Municipio.java | 6a51e641e3951a4d29672f130de6d100f14a1b8b | [] | no_license | professordouglasfilho/aulasetutoriais | c2bd2be35af19668e4b53eb5600087863323c198 | fe0b2143c12b8d23a47b2a9f8e994ffe7b5599d4 | refs/heads/master | 2021-01-22T11:27:21.278407 | 2017-06-20T18:27:16 | 2017-06-20T18:27:16 | 92,693,083 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 667 | java | package br.com.fuctura.model;
/**
* Classe reflexo do elemento <municipio>
* @author douglas.f.filho
*
*/
public class Municipio {
private int id;
private String nome;
private long habitantes;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public long getHabitantes() {
return habitantes;
}
public void setHabitantes(long habitantes) {
this.habitantes = habitantes;
}
@Override
public String toString() {
return "Municipio [id=" + id + ", nome=" + nome + ", habitantes=" + habitantes + "]";
}
}
| [
"professordouglas.filho@gmail.com"
] | professordouglas.filho@gmail.com |
60edfaf63dd132a7eb896881cf36cee433dc3140 | 0c1d83b7cdf430709d7b7c47358163bfcf33b28a | /src/main/java/com/jemberdin/votingsystem/to/MenuTo.java | 69c9898bcf804b9789b4272abe8ac835cb08b184 | [] | no_license | jemberdin/voting-system | a5a6b6385b2e4def5e174f0ea95a166f97c9d861 | 829967b6f2c985a72695d25643b380f30022078c | refs/heads/master | 2022-11-21T02:52:42.901882 | 2020-02-19T11:00:12 | 2020-02-19T11:00:12 | 232,381,074 | 0 | 0 | null | 2022-11-15T23:54:29 | 2020-01-07T17:41:21 | Java | UTF-8 | Java | false | false | 1,619 | java | package com.jemberdin.votingsystem.to;
import java.beans.ConstructorProperties;
import java.time.LocalDate;
import java.util.List;
import java.util.Objects;
public class MenuTo extends BaseTo {
private final String restaurantName;
private final LocalDate date;
private final List<DishTo> dishes;
// Restaurant id
@ConstructorProperties({"id", "restaurantName", "date", "dishes"})
public MenuTo(Integer id, String restaurantName, LocalDate date, List<DishTo> dishes) {
super(id);
this.restaurantName = restaurantName;
this.date = date;
this.dishes = dishes;
}
public String getRestaurantName() {
return restaurantName;
}
public LocalDate getDate() {
return date;
}
public List<DishTo> getDishes() {
return dishes;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MenuTo that = (MenuTo) o;
return Objects.equals(id, that.id) &&
Objects.equals(restaurantName, that.restaurantName) &&
Objects.equals(date, that.date) &&
Objects.equals(dishes, that.dishes);
}
@Override
public int hashCode() {
return Objects.hash(id, restaurantName, date, dishes);
}
@Override
public String toString() {
return "MenuTo{" +
"id=" + id +
", name='" + restaurantName + '\'' +
", date=" + date +
", dishes=" + dishes +
'}';
}
}
| [
"myemberdin@yahoo.com"
] | myemberdin@yahoo.com |
5cec3387a0a30841f29c9560f9d922cf1b07ab65 | c53d114a03f22d9c59a6d6777889085300c873fb | /src/leetcode/IslandPerimeter.java | cbaf1e95a41cc1f90cdac47aa3d42d3d4dd3f0e8 | [] | no_license | sahilalipuria/Prep | cc5efe187cf00b32c0e2fdd2eddfbef4087a400e | 047e6c24af25edf4ed52147f456c3650691093f5 | refs/heads/master | 2023-08-04T14:22:42.877097 | 2020-10-05T11:36:39 | 2020-10-05T11:36:39 | 223,361,362 | 1 | 0 | null | 2023-09-05T21:58:49 | 2019-11-22T08:46:09 | Java | UTF-8 | Java | false | false | 1,634 | java | /**
*
*/
package leetcode;
/**
* @author salipuri
*
* 463. Island Perimeter
*
* You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.
Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).
The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
*
*/
public class IslandPerimeter {
/**
* @param args
*/
public static int islandPerimeter(int[][] grid) {
int perimeter = 0;
if(grid.length == 0 || grid[0].length==0)
return perimeter;
for(int i=0;i<grid.length;i++){
for(int j=0;j<grid[0].length;j++){
if(grid[i][j]==1){
perimeter += 4;
if(i!=0 && grid[i-1][j]==1){
perimeter-=2;
}
if(j!=0 && grid[i][j-1]==1){
perimeter-=2;
}
}
}
}
return perimeter;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(islandPerimeter(new int[][]{{0,1,0,0},
{1,1,1,0},
{0,1,0,0},
{1,1,0,0}}));
}
}
| [
"salipuri@cisco.com"
] | salipuri@cisco.com |
d72bdbff75dbd2c4f06e60553715fd9c16aac61a | 345831e08848609e7b3ab8f54775de630c13a5c1 | /src/sea/goethe/sportspas/model/ProgressModel.java | 12182e0c447a6cfdb0fba7c72782af801adfcc14 | [] | no_license | zeattacker/SportSpas | cc4c5ae97193631cc3ac7d28f9ae680c3e625235 | 0e9e26e2acbacbeabe4c7698326f0d0a9498ddb7 | refs/heads/master | 2015-08-18T03:11:59.774545 | 2014-12-26T18:08:27 | 2014-12-26T18:08:27 | 28,024,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | package sea.goethe.sportspas.model;
public class ProgressModel {
int id,speak,listen,read,write;
public ProgressModel(){
//blank constructor
}
public ProgressModel(int id,int read,int write,int listen,int speak){
this.id = id;
this.speak = speak;
this.listen = listen;
this.read = read;
this.write = write;
}
public ProgressModel(int read,int write,int listen,int speak){
this.speak = speak;
this.listen = listen;
this.read = read;
this.write = write;
}
public void setID(int id){
this.id = id;
}
public int getID(){
return this.id;
}
public void setSpeak(int speak){
this.speak = speak;
}
public int getSpeak(){
return this.speak;
}
public void setListen(int listen){
this.listen = listen;
}
public int getListen(){
return this.listen;
}
public void setRead(int read){
this.read = read;
}
public int getRead(){
return this.read;
}
public void setWrite(int write){
this.write = write;
}
public int getWrite(){
return this.write;
}
}
| [
"zeattacker@yahoo.com"
] | zeattacker@yahoo.com |
2502a2f8c0a0f5b17e35678138a61f3a4b5d0d2b | 1a67df6ac935df0ede86a64f96e1bed0260fe8fd | /app/src/main/java/com/example/muhammadbarrafirdaus/recyclerview/fragments/MemberFragment.java | 775a4e089791cb977088bc10e34b0e89720c4e6d | [] | no_license | muhF1508/RecyclerView | 6100a0d52755194cd41737d77f6b8e5538519720 | a7b0a93269b2344e3993ecdfdd6f39cc798648fb | refs/heads/master | 2021-06-20T05:04:06.907726 | 2021-02-09T05:29:33 | 2021-02-09T05:29:33 | 166,235,740 | 0 | 1 | null | 2019-10-27T04:00:35 | 2019-01-17T14:05:07 | Java | UTF-8 | Java | false | false | 2,902 | java | package com.example.muhammadbarrafirdaus.recyclerview.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.muhammadbarrafirdaus.recyclerview.R;
import com.example.muhammadbarrafirdaus.recyclerview.adapter.MemberListAdapter;
import com.example.muhammadbarrafirdaus.recyclerview.model.Member;
import java.util.ArrayList;
import java.util.List;
public class MemberFragment extends Fragment{
private RecyclerView listMember;
private LinearLayoutManager linearLayoutManager;
private MemberListAdapter memberListAdapter;
protected Context context;
public static MemberFragment newInstance(){
return new MemberFragment();
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.context = context;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_member, container, false);
listMember = (RecyclerView) rootView.findViewById(R.id.listmember);
return rootView;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
linearLayoutManager = new LinearLayoutManager(context);
memberListAdapter = new MemberListAdapter();
listMember.setLayoutManager(linearLayoutManager);
listMember.setAdapter(memberListAdapter);
loadData();
}
private void loadData(){
List<Member> memberList = new ArrayList<>();
Member member;
int thumb[] = {R.drawable.cow, R.drawable.elephant, R.drawable.monkey,
R.drawable.moose, R.drawable.ostrich, R.drawable.penguin,
R.drawable.bee, R.drawable.crab, R.drawable.crocodile,
R.drawable.frog, R.drawable.giraffe, R.drawable.dolphin,
};
String name[] = {"Sapi", "Gajah", "Monyet", "Rusa",
"Burung Onta", "Penguin", "lebah", "Kepiting",
"Buaya", "Katak", "Jerapah", "Lumba-lumba",
};
String team = "Macam-macam Hewan";
for(int i=0; i < thumb.length; i++){
member = new Member();
member.setId(i+1);
member.setName(name[i]);
member.setTeam(team);
member.setThumb(thumb[i]);
memberList.add(member);
}
memberListAdapter.addAll(memberList);
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
}
| [
"muhammadbarrafirdaus@Muhammads-MacBook-Pro.local"
] | muhammadbarrafirdaus@Muhammads-MacBook-Pro.local |
fd273b45dfbcce238dedf5585167865e8fa902b3 | 3171702d22be1ea7c5a84b09aa9e89a8b035ceae | /no.hal.learning/no.hal.learning.exercise/model.ui/src/no/hal/learning/exercise/provider/ExerciseProposalsItemProvider.java | 96a1ae9ddb2fa6dde1ce8e324aea1bfefad5c562 | [] | no_license | hallvard/jexercise | 345b728a84b89e43632eb95d825e9d86ea4cec58 | 0e6a911ea31d8f7f7dc0f288122214e239d9d5eb | refs/heads/master | 2021-05-25T09:19:30.421067 | 2020-12-14T15:57:44 | 2020-12-14T15:57:44 | 1,203,162 | 5 | 17 | null | 2020-10-13T10:16:03 | 2010-12-28T15:06:53 | Java | UTF-8 | Java | false | false | 6,594 | java | /**
*/
package no.hal.learning.exercise.provider;
import java.util.Collection;
import java.util.List;
import no.hal.learning.exercise.ExerciseFactory;
import no.hal.learning.exercise.ExercisePackage;
import no.hal.learning.exercise.ExerciseProposals;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link no.hal.learning.exercise.ExerciseProposals} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ExerciseProposalsItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExerciseProposalsItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addExercisePropertyDescriptor(object);
addAllProposalsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Exercise feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addExercisePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ExerciseProposals_exercise_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ExerciseProposals_exercise_feature", "_UI_ExerciseProposals_type"),
ExercisePackage.Literals.EXERCISE_PROPOSALS__EXERCISE,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the All Proposals feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAllProposalsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ExerciseProposals_allProposals_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ExerciseProposals_allProposals_feature", "_UI_ExerciseProposals_type"),
ExercisePackage.Literals.EXERCISE_PROPOSALS__ALL_PROPOSALS,
true,
false,
true,
null,
null,
null));
}
/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(ExercisePackage.Literals.EXERCISE_PROPOSALS__PROPOSALS);
}
return childrenFeatures;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.
return super.getChildFeature(object, child);
}
/**
* This returns ExerciseProposals.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/ExerciseProposals"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
return getString("_UI_ExerciseProposals_type");
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ExerciseProposals.class)) {
case ExercisePackage.EXERCISE_PROPOSALS__PROPOSALS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add
(createChildParameter
(ExercisePackage.Literals.EXERCISE_PROPOSALS__PROPOSALS,
ExerciseFactory.eINSTANCE.createExercisePartProposals()));
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return ((IChildCreationExtender)adapterFactory).getResourceLocator();
}
}
| [
"hal@idi.ntnu.no"
] | hal@idi.ntnu.no |
717e7a3f6d6dd974ed474326227b7206e361f56f | 9a604c2daa453ea3340ead41dd55240d4006b433 | /src/display/Display.java | 4e1ab3fae55d45ad18f60d2fd99163cd4f1ecd6c | [] | no_license | mada360/AIGame | 4e4331383e37ebe5ec79ae66dfcc6db9ff25cd2a | 3610edd0b38d947e280b6b646eb74b435a5863a6 | refs/heads/master | 2021-01-18T14:20:34.951435 | 2015-05-14T15:15:50 | 2015-05-14T15:15:50 | 34,678,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,126 | java | package display; /**
* Created by Adam on 13/04/2015.
*/
import javax.swing.JFrame;
import java.awt.*;
public class Display {
private JFrame frame;
private Canvas canvas;
private String title;
private int width, height;
public Display(String title, int width, int height){
this.title = title;
this.width = width;
this.height = height;
createDisplay();
}
private void createDisplay(){
frame = new JFrame(title);
frame.setSize(width,height);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
canvas = new Canvas();
canvas.setPreferredSize(new Dimension(width,height));
canvas.setMaximumSize(new Dimension(width, height));
canvas.setMinimumSize(new Dimension(width, height));
canvas.setFocusable(false);
frame.add(canvas);
frame.pack();
}
public Canvas getCanvas(){
return canvas;
}
public JFrame getFrame(){
return frame;
}
}
| [
"worley9@hotmail.co.uk"
] | worley9@hotmail.co.uk |
1cb94fce60241b41da443ec3ab08bf47e80bf7db | 41eeb46b2e6dba63e930a0da863c3238eaf2d13c | /src/main/java/com/goose/tools/mybatis/service/ConfigFile.java | 15526743cdab5a5b12b78c51d38bf3dd352414a5 | [] | no_license | WangJunGit/com-goose-mybatisGener | 28836f4fe4d1f911cf788be20fb019cc90165ef1 | 8f1927f2f127728e150a03dc8a13359928878251 | refs/heads/master | 2020-04-17T07:57:51.306669 | 2014-09-19T03:49:27 | 2014-09-19T03:49:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,002 | java | package com.goose.tools.mybatis.service;
import java.io.PrintWriter;
import java.util.List;
import com.goose.tools.mybatis.entity.FrameInfo;
import com.goose.tools.mybatis.entity.TableProperties;
import com.goose.tools.mybatis.utils.MyUtils;
public class ConfigFile
{
public static void createFile(String tableName, List<TableProperties> list, FrameInfo info) throws Exception
{
PrintWriter out = null;
try
{
String fullPackage = info.getPackage_entity() + "." + MyUtils.formatToClassName(tableName);
TableProperties first = list.get(0);
String className = MyUtils.formatToClassName(tableName);
String idName = list.get(0).getName();
String idJdbcType = MyUtils.formatJdbcType(list.get(0).getDateType());
String idFullType = MyUtils.formatFullType(list.get(0).getDateType());
out = new PrintWriter(info.getPath_config() + className + "-Mapper.xml", "UTF-8");
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
out.println("<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >");
out.println("<mapper namespace=\"" + info.getPackage_mapper() + "." + className + "Mapper\" >");
out.println(" <resultMap id=\"BaseResultMap\" type=\"" + fullPackage + "\" >");
boolean is_first = true;
for (TableProperties tableProperties : list)
{
if (is_first)
{
out.print(" <id");
}
else
{
out.print(" <result");
}
out.println(" column=\"" + tableProperties.getName() + "\" property=\"" + MyUtils.formatToVarName(tableProperties.getName()) + "\" jdbcType=\"" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "\" />");
is_first = false;
}
out.println(" </resultMap>");
out.println();
out.println(" <!-- 计数(对象) -->");
out.println(" <select id=\"count\" resultType=\"java.lang.Integer\" parameterType=\"" + fullPackage + "\">");
out.println(" select count(1) from " + tableName + "");
out.println(" <trim prefix=\"where\" prefixOverrides=\"and | or\">");
for (TableProperties tableProperties : list)
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + " != null\">");
out.println(" and " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
//新增按日期统计数量
String type = MyUtils.formatDataType(tableProperties.getDateType());
if ("Date".equals(type))
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_F != null\">");
out.println(" and " + tableProperties.getName() + " > #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_F,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_T != null\">");
out.println(" and " + tableProperties.getName() + " < #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_T,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
//新增大于等于和小于等于
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE != null\">");
out.println(" and " + tableProperties.getName() + " >= #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE != null\">");
out.println(" and " + tableProperties.getName() + " <![CDATA[<=]]> #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
}
}
out.println(" </trim>");
out.println(" </select>");
out.println(" <!-- 新增 -->");
out.println(" <insert id=\"add\" parameterType=\"" + fullPackage + "\" >");
boolean is_auto_increment = false;//是否自动增长
if (first.getColumn_type().equals("varchar(32)"))
{
out.println(" <selectKey keyProperty=\"" + MyUtils.formatToVarName(idName) + "\" resultType=\"java.lang.String\" order=\"BEFORE\">select replace(uuid(), '-', '')</selectKey>");
}
else if (first.getExtra().equals("auto_increment"))
{
is_auto_increment = true;
out.println(" <selectKey keyProperty=\"" + MyUtils.formatToVarName(idName) + "\" resultType=\"java.lang.Long\" order=\"AFTER\">SELECT LAST_INSERT_ID() as " + idName + "</selectKey>");
}
out.println(" insert into " + tableName + " (");
out.print(" ");
is_first = true;
int i = 0;
boolean is_hide_first = false;//是否隐藏过首字段
for (TableProperties tableProperties : list)
{
if (!is_hide_first && is_auto_increment)
{
is_hide_first = true;
continue;
}
if (!is_first)
{
out.print(", ");
i++;
if (i % 3 == 0)
{
out.println();
out.print(" ");
}
}
out.print(tableProperties.getName());
is_first = false;
}
out.println(")");
out.println(" values (");
out.print(" ");
is_first = true;
is_hide_first = false;
for (TableProperties tableProperties : list)
{
if (!is_hide_first && is_auto_increment)
{
is_hide_first = true;
continue;
}
if (!is_first)
{
out.println(", ");
out.print(" ");
}
out.print("#{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
is_first = false;
}
out.println(")");
out.println(" </insert>");
out.println();
out.println(" <!-- 删除(ID) -->");
out.println(" <delete id=\"deleteById\" parameterType=\"" + idFullType + "\" >");
out.println(" delete from " + tableName + " where " + idName + " = #{" + MyUtils.formatToVarName(idName) + ",jdbcType=" + idJdbcType + "}");
out.println(" </delete>");
out.println();
out.println(" <!-- 删除(对象) -->");
out.println(" <delete id=\"deleteByExample\" parameterType=\"" + fullPackage + "\">");
out.println(" delete from " + tableName + "");
out.println(" <trim prefix=\"where\" prefixOverrides=\"and | or\">");
for (TableProperties tableProperties : list)
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + " != null\">");
out.println(" and " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
String type = MyUtils.formatDataType(tableProperties.getDateType());
if ("Date".equals(type))
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_F != null\">");
out.println(" and " + tableProperties.getName() + " > #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_F,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_T != null\">");
out.println(" and " + tableProperties.getName() + " < #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_T,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
//新增大于等于和小于等于
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE != null\">");
out.println(" and " + tableProperties.getName() + " >= #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE != null\">");
out.println(" and " + tableProperties.getName() + " <![CDATA[<=]]> #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
}
}
out.println(" </trim>");
out.println(" </delete>");
out.println();
out.println(" <!-- 全部更新(timestamp字段除外) -->");
out.println(" <update id=\"updateAll\" parameterType=\"" + fullPackage + "\" >");
out.println(" update " + tableName + " set");
is_first = true;
for (TableProperties tableProperties : list)
{
if ("timestamp".equals(tableProperties))
{
continue;
}
if (!is_first)
{
out.println(",");
}
out.print(" " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
is_first = false;
}
out.println();
out.println(" where " + idName + " = #{" + MyUtils.formatToVarName(idName) + ",jdbcType=" + idJdbcType + "}");
out.println(" </update>");
out.println();
out.println(" <!-- 选择更新(timestamp字段除外) -->");
out.println(" <update id=\"updateSelected\" parameterType=\"" + fullPackage + "\" >");
out.println(" update " + tableName);
out.println(" <set>");
is_first = true;
for (TableProperties tableProperties : list)
{
if ("timestamp".equals(tableProperties))
{
continue;
}
if (!is_first)
{
out.println(",");
out.println(" </if>");
}
out.println(" <if test=\"" + MyUtils.formatToVarName(tableProperties.getName()) + " !=null\">");
out.print(" " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
is_first = false;
}
out.println();
out.println(" </if>");
out.println(" </set>");
out.println(" where " + idName + " = #{" + MyUtils.formatToVarName(idName) + ",jdbcType=" + idJdbcType + "}");
out.println(" </update>");
out.println();
out.println(" <!-- 查询(ID) -->");
out.println(" <select id=\"findById\" resultMap=\"BaseResultMap\" parameterType=\"" + idFullType + "\" >");
out.println(" select ");
out.print(" ");
is_first = true;
i = 0;
for (TableProperties tableProperties : list)
{
if (!is_first)
{
out.print(", ");
i++;
if (i % 3 == 0)
{
out.println();
out.print(" ");
}
}
out.print(tableProperties.getName());
is_first = false;
}
out.println();
out.println(" from " + tableName + " where " + idName + " = #{" + MyUtils.formatToVarName(idName) + ",jdbcType=" + idJdbcType + "}");
out.println(" </select>");
out.println();
out.println(" <!-- 查询(对象) -->");
out.println(" <select id=\"findByExample\" resultMap=\"BaseResultMap\" parameterType=\"" + fullPackage + "\">");
out.println(" select ");
out.print(" ");
is_first = true;
i = 0;
for (TableProperties tableProperties : list)
{
if (!is_first)
{
out.print(", ");
i++;
if (i % 3 == 0)
{
out.println();
out.print(" ");
}
}
out.print(tableProperties.getName());
is_first = false;
}
out.println();
out.println(" from " + tableName + "");
out.println(" <trim prefix=\"where\" prefixOverrides=\"and | or\">");
for (TableProperties tableProperties : list)
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + " != null\">");
out.println(" and " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
String type = MyUtils.formatDataType(tableProperties.getDateType());
if ("Date".equals(type))
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_F != null\">");
out.println(" and " + tableProperties.getName() + " > #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_F,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_T != null\">");
out.println(" and " + tableProperties.getName() + " < #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_T,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
//新增大于等于和小于等于
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE != null\">");
out.println(" and " + tableProperties.getName() + " >= #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_FE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE != null\">");
out.println(" and " + tableProperties.getName() + " <![CDATA[<=]]> #{" + MyUtils.formatToVarName(tableProperties.getName()) + "_TE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
}
}
out.println(" </trim>");
out.println(" order by " + idName + " desc");
out.println(" </select>");
out.println();
out.println(" <!-- 分页查询(附带排序) -->");
out.println(" <select id=\"pageByExample\" resultMap=\"BaseResultMap\">");
out.println(" select ");
out.print(" ");
is_first = true;
i = 0;
for (TableProperties tableProperties : list)
{
if (!is_first)
{
out.print(", ");
i++;
if (i % 3 == 0)
{
out.println();
out.print(" ");
}
}
out.print(tableProperties.getName());
is_first = false;
}
out.println();
out.println(" from " + tableName + "");
out.println(" <trim prefix=\"where\" prefixOverrides=\"and | or\">");
for (TableProperties tableProperties : list)
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + " != null\">");
out.println(" and " + tableProperties.getName() + " = #{" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + ",jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
String type = MyUtils.formatDataType(tableProperties.getDateType());
if ("Date".equals(type))
{
out.println(" <if test= \"" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_F != null\">");
out.println(" and " + tableProperties.getName() + " > #{" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_F,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_T != null\">");
out.println(" and " + tableProperties.getName() + " < #{" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_T,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
//新增大于等于和小于等于
out.println(" <if test= \"" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_FE != null\">");
out.println(" and " + tableProperties.getName() + " >= #{" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_FE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
out.println(" <if test= \"" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_TE != null\">");
out.println(" and " + tableProperties.getName() + " <![CDATA[<=]]> #{" + MyUtils.formatToVarName(tableName) + "." + MyUtils.formatToVarName(tableProperties.getName()) + "_TE,jdbcType=" + MyUtils.formatJdbcType(tableProperties.getDateType()) + "}");
out.println(" </if>");
}
}
out.println(" </trim>");
//排序
out.println(" <if test= \"orderBy != null\">");
out.println(" order by ${orderBy}");
out.println(" </if>");
//分页
out.println(" <if test=\"size !=null\" >");
out.println(" limit ");
out.println(" <if test=\"start !=null\" >");
out.println(" ${start},");
out.println(" </if>");
out.println(" ${size}");
out.println(" </if>");
out.println(" </select>");
out.println();
out.println("</mapper>");
}
catch (Exception e)
{
throw e;
}
finally
{
if (out != null)
{
out.close();
}
}
}
}
| [
"jun_page@163.com"
] | jun_page@163.com |
4447ec835db7ea7e0ef9c305815d03412b513a31 | 71649d0c6f283786204d9e8673d02c18bc96440d | /src/main/java/com/founder/model/BzdzAddJlxXzqhb.java | 290b0f57bbfc86d5093684fba008db8ac779a40b | [] | no_license | liangmeihuai/geode-example | 2b546be31a104707ea98cc95803b054f0a310118 | c9c961c981a0c9b34f7797caacf06d16d7ee455b | refs/heads/master | 2021-01-19T21:44:36.702759 | 2017-04-12T03:42:46 | 2017-04-12T03:42:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,492 | java | package com.founder.model;
import org.apache.geode.cache.Declarable;
import org.apache.geode.pdx.PdxReader;
import org.apache.geode.pdx.PdxSerializable;
import org.apache.geode.pdx.PdxWriter;
import java.util.Properties;
/**
* 街路巷区县管辖信息表
*
* @author congrihong
*
*/
public class BzdzAddJlxXzqhb implements PdxSerializable, Declarable {
//街路巷行政区划ID")
private String jlxxzqhid;
//街路巷代码")
private String jlxdm;
//行政区划代码")
private String xzqhdm;
private String xzqhmc;//行政区划名称 数据库没存这个字段
public String getXzqhmc() {
return xzqhmc;
}
public void setXzqhmc(String xzqhmc) {
this.xzqhmc = xzqhmc;
}
public String getJlxxzqhid() {
return jlxxzqhid;
}
public void setJlxxzqhid(String jlxxzqhid) {
this.jlxxzqhid = jlxxzqhid;
}
public String getJlxdm() {
return jlxdm;
}
public void setJlxdm(String jlxdm) {
this.jlxdm = jlxdm;
}
public String getXzqhdm() {
return xzqhdm;
}
public void setXzqhdm(String xzqhdm) {
this.xzqhdm = xzqhdm;
}
@Override
public void init(Properties props) {
}
@Override
public void toData(PdxWriter writer) {
writer.writeString("JLXDM",jlxdm);
writer.writeString("JLXXZQHID",jlxxzqhid);
writer.writeString("XZQHDM",xzqhdm);
}
@Override
public void fromData(PdxReader reader) {
jlxdm = reader.readString("JLXDM");
jlxxzqhid = reader.readString("JLXXZQHID");
xzqhdm = reader.readString("XZQHDM");
}
}
| [
"872749212@qq.com"
] | 872749212@qq.com |
6545817a136fd0e616ec65c575f91bba67c93738 | 5c7318d58196d948f30c4f336c19828064540dda | /src/java/com/aegis/entities/MPhc.java | e2f3e0481f89fa1025ec5a36f9ef2b661673cc73 | [] | no_license | Mounika45/RBSKTGJava | 730ea3f79eb96e800f24bb979158b615c5459a94 | d1008ffae0839925d4218f97529057f126ca98da | refs/heads/master | 2023-05-08T05:01:55.632369 | 2021-05-31T05:41:19 | 2021-05-31T05:41:19 | 372,394,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,672 | 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 com.aegis.entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author admin
*/
@Entity
@Table(name = "m_phc")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "MPhc.findAll", query = "SELECT m FROM MPhc m")
, @NamedQuery(name = "MPhc.findById", query = "SELECT m FROM MPhc m WHERE m.id = :id")
, @NamedQuery(name = "MPhc.findByCode", query = "SELECT m FROM MPhc m WHERE m.code = :code")
, @NamedQuery(name = "MPhc.findByName", query = "SELECT m FROM MPhc m WHERE m.name = :name")
, @NamedQuery(name = "MPhc.findByDistrictId", query = "SELECT m FROM MPhc m WHERE m.districtId = :districtId")
, @NamedQuery(name = "MPhc.findByMandalId", query = "SELECT m FROM MPhc m WHERE m.mandalId = :mandalId")
, @NamedQuery(name = "MPhc.findByVillageId", query = "SELECT m FROM MPhc m WHERE m.villageId = :villageId")
, @NamedQuery(name = "MPhc.findByCreatedUserId", query = "SELECT m FROM MPhc m WHERE m.createdUserId = :createdUserId")
, @NamedQuery(name = "MPhc.findByCreatedOn", query = "SELECT m FROM MPhc m WHERE m.createdOn = :createdOn")})
public class MPhc implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "Id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "Code")
private String code;
@Basic(optional = false)
@Column(name = "Name")
private String name;
@Basic(optional = false)
@Column(name = "DistrictId")
private int districtId;
@Basic(optional = false)
@Column(name = "MandalId")
private int mandalId;
@Column(name = "VillageId")
private Integer villageId;
@Column(name = "CreatedUserId")
private Integer createdUserId;
@Column(name = "CreatedOn")
@Temporal(TemporalType.TIMESTAMP)
private Date createdOn;
public MPhc() {
}
public MPhc(Integer id) {
this.id = id;
}
public MPhc(Integer id, String name, int districtId, int mandalId) {
this.id = id;
this.name = name;
this.districtId = districtId;
this.mandalId = mandalId;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getDistrictId() {
return districtId;
}
public void setDistrictId(int districtId) {
this.districtId = districtId;
}
public int getMandalId() {
return mandalId;
}
public void setMandalId(int mandalId) {
this.mandalId = mandalId;
}
public Integer getVillageId() {
return villageId;
}
public void setVillageId(Integer villageId) {
this.villageId = villageId;
}
public Integer getCreatedUserId() {
return createdUserId;
}
public void setCreatedUserId(Integer createdUserId) {
this.createdUserId = createdUserId;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof MPhc)) {
return false;
}
MPhc other = (MPhc) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.aegis.entities.MPhc[ id=" + id + " ]";
}
}
| [
"mounikavanamala57@gmail.com"
] | mounikavanamala57@gmail.com |
9ee9040cd96179cfca6038bba0e8473f36741a6e | 789fc45d8d3fd3a61650eda55b1a359ec44612d4 | /o2o-intf/src/main/java/com/ihomefnt/o2o/intf/manager/constant/right/RightLevelNewEnum.java | f3d2feeb6296337743293462e5313a6c50ed1e5f | [] | no_license | huayunlei/myboot-o2o | 99020673f5ce72d180088ef0d9171e7b267250da | 73fdca9e39929290f4fc28b9653460cb27f89c19 | refs/heads/master | 2023-01-01T08:57:05.021700 | 2020-10-21T14:58:44 | 2020-10-21T14:58:44 | 306,057,891 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 9,108 | java | package com.ihomefnt.o2o.intf.manager.constant.right;
import io.swagger.annotations.ApiModelProperty;
public enum RightLevelNewEnum {
LEVEL_ONE(0, "普通","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb09991f68e8b696bb12cab448f5033108eb.png!H-SMALL","https://img13.ihomefnt.com/05a105eb650338a2b142a2f1c4a04274551794c14014f1036ecf4946868be582.png!M-MIDDLE","", "https://static.ihomefnt.com/1/image/icon_normal-word.png","","https://static.ihomefnt.com/1/image/right_background.png","共6项",""),
LEVEL_TWO(1, "黄金","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb097fd011566433fab7ab3056836f88c4bc.png!H-SMALL","https://img13.ihomefnt.com/05a105eb650338a2b142a2f1c4a04274bd4454b82c222b6e44bdb2beeda86bc4.png!M-MIDDLE", "https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb0d3f1d4f31f3c926c7972f26188b6dd2.png!thum-100x100","https://static.ihomefnt.com/1/image/icon_golden-pic.png","https://static.ihomefnt.com/1/image/icon_golden-word.png","https://static.ihomefnt.com/1/image/right_background.png","共15项",""),
LEVEL_THREE(2, "铂金","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb09d2133d634e74b75e0309e757d74bbabf.png!H-SMALL","https://img13.ihomefnt.com/05a105eb650338a2b142a2f1c4a042749063e843edf2bb43e9c8d98bfa1b3a61.png!M-MIDDLE","https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb08d093366ff8c1686364e1a355aabe1b.png!thum-100x100", "https://static.ihomefnt.com/1/image/icon_platinum-pic.png","https://static.ihomefnt.com/1/image/icon_platinum-word.png","https://static.ihomefnt.com/1/image/right_background.png","共15项",""),
LEVEL_FOR(3, "钻石","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb095d7aa696e500cd8758dfb85ce2e144db.png!H-SMALL","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb09260c481e48790a1c5bc9630d8053dc7a.png!M-MIDDLE", "https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb0f37e5cdc6e90b3423676bf22ada06d2.png!thum-100x100","https://static.ihomefnt.com/1/image/icon_diamond-pic.png","https://static.ihomefnt.com/1/image/icon_diamond-word.png","https://static.ihomefnt.com/1/image/right_background.png","共15项",""),
LEVEL_FIV(4, "白银","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb090764bf0b89befe7f376218f0004c2da3.jpg!H-SMALL","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb09bc226ef24365f5fd7541a0366352c0fe.png!M-MIDDLE", "https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb17d5d9b51d910b17266865ed32451944.png!thum-100x100","https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb41c00785104db641e9ec704329d20e21.png!H-SMALL","https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb9a2a8e6f1ac2188f1bab31431a1a9b5d.png!H-SMALL","https://static.ihomefnt.com/1/image/right_background.png","共9项","仅现金客户可享受专属权益"),
LEVEL_SIX(5, "青铜","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb0993cceb5599a63518e38993cc974c0aed.png!H-SMALL","https://img13.ihomefnt.com/9940ec7f71a2fb1adf1e6636836bfb09778bedc8b76a67a05fe250f5f94d9eb2.png!M-MIDDLE", "https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cba9616f51b45d369410a8cb4369b6c9e3.png!thum-100x100","https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cb280fc0c539bc41a7914be118845cd5b7.png!H-SMALL","https://img13.ihomefnt.com/78b21b0ac49e74f7e95f807c3ed389cbb8fa2dd9204df3087c1b88e6942106be.png!H-SMALL","https://static.ihomefnt.com/1/image/right_background.png","共8项","仅限全品家软用户");
private int code;
private String name;//权益名称
@ApiModelProperty("权益等级图片")
private String gradeNameUrl;
@ApiModelProperty("权益等级背景图")
private String gradeBackGround;
private String gradeLevelIcoUrl;//权益等级小图标
private String gradeLevelPicUrl;//权益等级图片地址
private String gradelLevelUrl;//url图片
private String gradeLevelBackPicUrl;//底图
private String totalContent;//共享受特权
private String gradeClassifyDeac;//权益描述
RightLevelNewEnum(int code, String name,String gradeNameUrl,String gradeBackGround,String gradeLevelIcoUrl, String gradeLevelPicUrl, String gradelLevelUrl, String gradeLevelBackPicUrl, String totalContent, String gradeClassifyDeac) {
this.code = code;
this.name = name;
this.gradeNameUrl = gradeNameUrl;
this.gradeBackGround = gradeBackGround;
this.gradeLevelIcoUrl = gradeLevelIcoUrl;
this.gradeLevelPicUrl = gradeLevelPicUrl;
this.gradelLevelUrl = gradelLevelUrl;
this.gradeLevelBackPicUrl = gradeLevelBackPicUrl;
this.totalContent = totalContent;
this.gradeClassifyDeac = gradeClassifyDeac;
}
public static String getGradeNameUrl(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeNameUrl();
}
}
return null;
}
public static String getGradeBackGround(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeBackGround();
}
}
return null;
}
public static String getGradeLevelIcoUrl(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeLevelIcoUrl();
}
}
return null;
}
public static String getGradelLevelUrl(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradelLevelUrl();
}
}
return null;
}
public static String getTotalContent(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getTotalContent();
}
}
return null;
}
public static String getGradeClassifyDeac(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeClassifyDeac();
}
}
return null;
}
public static String getName(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getName();
}
}
return null;
}
public static String getGradeLevelPicUrl(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeLevelPicUrl();
}
}
return null;
}
public static String getGradeLevelBackPicUrl(int code) {
RightLevelNewEnum[] values = values();
for (RightLevelNewEnum v : values) {
if (v.getCode() == code) {
return v.getGradeLevelBackPicUrl();
}
}
return null;
}
public String getGradeNameUrl() {
return gradeNameUrl;
}
public void setGradeNameUrl(String gradeNameUrl) {
this.gradeNameUrl = gradeNameUrl;
}
public String getGradeBackGround() {
return gradeBackGround;
}
public void setGradeBackGround(String gradeBackGround) {
this.gradeBackGround = gradeBackGround;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGradeLevelIcoUrl() {
return gradeLevelIcoUrl;
}
public void setGradeLevelIcoUrl(String gradeLevelIcoUrl) {
this.gradeLevelIcoUrl = gradeLevelIcoUrl;
}
public String getGradeLevelPicUrl() {
return gradeLevelPicUrl;
}
public void setGradeLevelPicUrl(String gradeLevelPicUrl) {
this.gradeLevelPicUrl = gradeLevelPicUrl;
}
public String getGradelLevelUrl() {
return gradelLevelUrl;
}
public void setGradelLevelUrl(String gradelLevelUrl) {
this.gradelLevelUrl = gradelLevelUrl;
}
public String getGradeLevelBackPicUrl() {
return gradeLevelBackPicUrl;
}
public void setGradeLevelBackPicUrl(String gradeLevelBackPicUrl) {
this.gradeLevelBackPicUrl = gradeLevelBackPicUrl;
}
public String getTotalContent() {
return totalContent;
}
public void setTotalContent(String totalContent) {
this.totalContent = totalContent;
}
public String getGradeClassifyDeac() {
return gradeClassifyDeac;
}
public void setGradeClassifyDeac(String gradeClassifyDeac) {
this.gradeClassifyDeac = gradeClassifyDeac;
}
}
| [
"836774171@qq.com"
] | 836774171@qq.com |
cc185524ad46637603f5e24e32dfcaf82d7fd084 | f9a459e278cd451dab5de565b728cbc24f8678eb | /src/main/java/edu/osu/cse6341/lispInterpreter/exceptions/NotNumericException.java | 5bb1328eb5cae6fd116557a7254c822c1f0e6def | [] | no_license | smagill/LispInterpreter | eff133dd1ca8a0c2e8a67d79c1a84bd8f1f721de | 5e8901e8490b286d151034b273b89b15b0786a98 | refs/heads/master | 2022-12-22T14:18:37.514676 | 2020-09-25T23:02:57 | 2020-09-25T23:02:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package edu.osu.cse6341.lispInterpreter.exceptions;
public class NotNumericException extends Exception {
public NotNumericException(String message) {
super(message);
}
}
| [
"soppi.2@osu.edu"
] | soppi.2@osu.edu |
eaf7752c8afd3b75689d688deb3dc9aa7ef44c17 | 19e5a1dd860ac83bcee6b7151c79c2e2ccd8c0e6 | /src/Background/PanRoad.java | f81432316c13bbb3c8719165dbcb6b253c12d672 | [] | no_license | RileyTemp/Riley-Scratches | bb8bab7efd1c2e439c0b072c7b58fe6739d3fb2f | f0a4d7892511317746e6fa8c9e54a1ffd02d2e1e | refs/heads/master | 2021-01-17T16:39:38.032049 | 2016-06-21T14:05:41 | 2016-06-21T14:05:41 | 55,615,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package Background;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class PanRoad extends JPanel {
JButton btnSpace;
public PanRoad(ActionListener CardChanger) {
btnSpace = new JButton("Space");
btnSpace.addActionListener(CardChanger);
//java-demos.blogspot.ca/2012/09/setting-background-image-in-jframe.html
setLayout(new BorderLayout());
JLabel background = new JLabel(new ImageIcon("road.jpg"));
add(background);
background.setLayout(new FlowLayout());
background.add(btnSpace);
}
}
/*setLayout(new BorderLayout());
JLabel background = new JLabel(new ImageIcon("FHCI.jpg"));
add(background);
background.setLayout(new FlowLayout());*/
| [
"ander5266@FHC-IC0026893.wrdsb.ca"
] | ander5266@FHC-IC0026893.wrdsb.ca |
51e80f2ecad13c1f4c84d8b447e7c4d1a63d1e51 | 8710c2fc8658fa7e0e8a972ef47c1c3ff0b639fd | /app/src/main/java/com/kuldeep/zookaresult/AdmitCard.java | 9238fb0862349d7b36effd1f7d1b92cfe2537578 | [] | no_license | Kuldeepsiraswar-Lab/zookaresult | dcef34b889778805ce5c2d20eb0127daec8deae1 | 539f0a615bcb40f831c17c88b14ab3f6d0e630ed | refs/heads/master | 2023-02-02T05:30:03.587742 | 2020-12-16T05:39:21 | 2020-12-16T05:39:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,523 | java | package com.kuldeep.zookaresult;
import android.app.DownloadManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.URLUtil;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
public class AdmitCard extends Fragment implements SwipeRefreshLayout.OnRefreshListener {
public WebView mWebView;
private SwipeRefreshLayout swipeRefreshLayout;
public AdmitCard() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v= inflater.inflate(R.layout.webview, container, false);
mWebView = (WebView) v.findViewById(R.id.webView);
swipeRefreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_container);
swipeRefreshLayout.setOnRefreshListener(this);
mWebView.loadUrl("https://zookaresult.in/app/admit-card/");
WebSettings webSettings = mWebView.getSettings();
mWebView.getSettings().setSupportZoom(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setLoadWithOverviewMode(true);
mWebView.getSettings().setUseWideViewPort(true);
mWebView.getSettings().setDisplayZoomControls(false);
mWebView.getSettings().getCacheMode();
mWebView.clearCache(true);
mWebView.getSettings().setCacheMode(webSettings.LOAD_CACHE_ELSE_NETWORK);
// Enable Javascript
webSettings.setJavaScriptEnabled(true);
mWebView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
//This is the filter
if (event.getAction()!=KeyEvent.ACTION_DOWN)
return true;
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mWebView.canGoBack()) {
mWebView.goBack();
} else {
((MainActivity)getActivity()).onBackPressed();
}
return true;
}
return false;
}
});
mWebView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
DownloadManager.Request request=new DownloadManager.Request(Uri.parse(url));
request.setTitle(URLUtil.guessFileName(url,contentDisposition,mimetype));
request.setDescription("Downloading File");
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,URLUtil.guessFileName(url,contentDisposition,mimetype));
DownloadManager downloadManager = (DownloadManager)getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
Toast.makeText(getActivity().getApplicationContext(),"Downloading File",Toast.LENGTH_LONG).show();
}
});
// Force links and redirects to open in the WebView instead of in a browser
mWebView.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
swipeRefreshLayout.setRefreshing(true);
}
public void onPageFinished(WebView view, String url) {
swipeRefreshLayout.setRefreshing(false);
}
});
return v;
}
@Override
public void onRefresh() {
mWebView.reload();
}
} | [
"nawarkuldeep@gmail.com"
] | nawarkuldeep@gmail.com |
cbf2531b6c15930d69338a369719a3639262df86 | 662c15783269703dc5bd6120814f1ecfb746dbf7 | /bmvc01/src/main/java/controller/PrdJsn1Controller.java | 3cbbafc7f15d00185a6dd5515fc401674afbca31 | [] | no_license | panhua-hz/sprexp | 489037076d9cd2764c17a5d0aa146f368b4b3297 | d06582ed7ecf4faa1beb51258a551f45ecc30c21 | refs/heads/master | 2021-01-17T16:03:36.740333 | 2017-11-13T22:54:25 | 2017-11-13T22:54:25 | 95,459,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package controller;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import form.Product;
import services.ProductService;
@Controller
@RequestMapping("/prd")
public class PrdJsn1Controller {
@Autowired
ProductService productService;
@RequestMapping(method = GET)
public @ResponseBody List<Product> getProductJson(){
return this.productService.getAllProducts();
}
}
| [
"panhua_acct@126.com"
] | panhua_acct@126.com |
c2dab6d7946478995fef3fe8955106aeadf453db | 78a194ccc4fd7b286ebd74178af632365f4af223 | /Gym/src/Controladores/ControladorClientes.java | aba18f0eb24bd6e13dbf2523187179677313a692 | [] | no_license | alangonzalez93/GimBeta | 50a0fdfcdb94dcbaf2c7ef7380d7a0886d5ac15d | 3743fa577441ad3cfdf00cfe1dd4ab6cf025e21a | refs/heads/master | 2020-05-09T20:41:33.857658 | 2014-09-25T15:49:25 | 2014-09-25T15:49:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 37,629 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Controladores;
import ABMs.ABMSocios;
import Interfaces.AbmClienteGui;
import Interfaces.BusquedaGui;
import Interfaces.DesktopPaneImage;
import Interfaces.PagosGui;
import Interfaces.TodasAsisGui;
import Modelos.Arancel;
import Modelos.Asistencia;
import Modelos.Pago;
import Modelos.Socio;
import Modelos.Socioarancel;
import com.toedter.calendar.JDateChooser;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import org.javalite.activejdbc.LazyList;
/**
*
* @author nico
*/
public class ControladorClientes implements ActionListener {
private BusquedaGui clientesGui;
private JTable tablaClientes;
private JList actividades;
private AbmClienteGui altaClienteGui;
private ControladorAbmCliente controladorAbmCliente;
private PagosGui pagosGui;
private TodasAsisGui asisGui;
private ABMSocios abmSocios;
private DefaultTableModel tablaSocDefault;
private ActualizarDatos actualizarDAtos;
private JDateChooser calenDesde;
private JDateChooser calenHasta;
private String dateDesde;
private String dateHasta;
private JDateChooser calenDesdeA;
private JDateChooser calenHastaA;
private String dateDesdeA;
private String dateHastaA;
private boolean verTodos = false;
private boolean verTodas = false;
public ControladorClientes(BusquedaGui clientes, DesktopPaneImage desktop, ActualizarDatos actualizarDatos) {
this.clientesGui = clientes;
clientes.setActionListener(this);
altaClienteGui = new AbmClienteGui();
abmSocios = new ABMSocios();
this.actualizarDAtos = actualizarDatos;
controladorAbmCliente = new ControladorAbmCliente(altaClienteGui, actualizarDatos);
desktop.add(altaClienteGui);
pagosGui = new PagosGui();
// pagosGui.getCActiv().addItem("TODOS");
// pagosGui.getCActiv().addActionListener(new ActionListener() {
//public void actionPerformed(ActionEvent e){
// }});
asisGui = new TodasAsisGui();
asisGui.setActionListener(this);
desktop.add(asisGui);
desktop.add(pagosGui);
pagosGui.setActionListener(this);
tablaClientes = this.clientesGui.getTablaClientes();
tablaSocDefault = this.clientesGui.getTablaClientesDefault();
tablaClientes.addMouseListener(new java.awt.event.MouseAdapter() {
@Override
public void mouseClicked(java.awt.event.MouseEvent evt) {
tablaMouseClicked(evt);
}
});
clientesGui.getBusqueda().addKeyListener(new java.awt.event.KeyAdapter() {
@Override
public void keyReleased(java.awt.event.KeyEvent evt) {
busquedaKeyReleased(evt);
}
});
actividades = clientesGui.getActividades();
actividades.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent lse) {
if (lse.getValueIsAdjusting()) {
System.out.println("opcion siendo seleccionada,no hago nada");
} else {
System.out.println("opcion dejo de ser seleccionada ");
List actividadesSelecc = actividades.getSelectedValuesList();
System.out.println(actividadesSelecc.toString());
if (!actividadesSelecc.isEmpty()) {
boolean inactivo = false;
boolean morosos = false;
int i = 0;
while (i < actividadesSelecc.size()) {
if (actividadesSelecc.get(i) == "INACTIVOS") {
inactivo = true;
}
if (actividadesSelecc.get(i) == "MOROSOS") {
morosos = true;
}
i++;
}
cargarSociosActiv(actividadesSelecc, inactivo, morosos, false);
} else {
cargarSociosActiv(actividadesSelecc, false, false, true);
}
}
}
});
dateDesde = "0-0-0";
dateHasta = "9999-0-0";
calenDesde = pagosGui.getDesde();
calenHasta = pagosGui.getHasta();
///////////1
calenDesdeA = asisGui.getDesde();
calenHastaA = asisGui.getHasta();
//////////2
calenHasta.setCalendar(Calendar.getInstance());
calenDesde.setCalendar(Calendar.getInstance());
calenDesde.setDate(new Date(110, 1, 1));
/////////1
calenHastaA.setCalendar(Calendar.getInstance());
calenDesdeA.setCalendar(Calendar.getInstance());
calenDesdeA.setDate(new Date(110, 1, 1));
//////2
calenDesde.getJCalendar().addPropertyChangeListener("calendar", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
calenDesdePropertyChange(evt);
}
});
//////////////////1
calenDesdeA.getJCalendar().addPropertyChangeListener("calendar", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
calenDesdeAPropertyChange(evt);
}
});
/////////////////2
calenDesde.getDateEditor().setEnabled(false);
calenHasta.getDateEditor().setEnabled(false);
/////////////1
calenDesdeA.getDateEditor().setEnabled(false);
calenHastaA.getDateEditor().setEnabled(false);
/////////////2
calenHasta.getJCalendar().addPropertyChangeListener("calendar", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
calenHastaPropertyChange(e);
}
});
/////////1
calenHastaA.getJCalendar().addPropertyChangeListener("calendar", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
calenHastaAPropertyChange(e);
}
});
////////////2
}
public void calenDesdePropertyChange(PropertyChangeEvent e) {
dateHasta= dateToMySQLDate(pagosGui.getHasta().getCalendar().getTime(), false);
dateDesde = dateToMySQLDate(pagosGui.getDesde().getCalendar().getTime(), false);
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
String idCli = "nuul";
if (s != null) {
idCli = s.getString("ID_DATOS_PERS");
}
actualizarPagos(idCli, dateDesde, dateHasta, verTodos);
}
////////////1
public void calenDesdeAPropertyChange(PropertyChangeEvent e) {
dateHastaA= dateToMySQLDate(asisGui.getHasta().getCalendar().getTime(), false);
dateDesdeA = dateToMySQLDate(asisGui.getDesde().getCalendar().getTime(), false);
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
String idCli = "nuul";
if (s != null) {
idCli = s.getString("ID_DATOS_PERS");
}
actualizarAsis(idCli, dateDesdeA, dateHastaA, verTodas);
}
////////////////2
public void calenHastaPropertyChange(PropertyChangeEvent e) {
final Calendar c = (Calendar) e.getNewValue();
dateHasta= dateToMySQLDate(pagosGui.getHasta().getCalendar().getTime(), false);
dateDesde = dateToMySQLDate(pagosGui.getDesde().getCalendar().getTime(), false);
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
String idCli = "nuul";
if (s != null) {
idCli = s.getString("ID_DATOS_PERS");
}
actualizarPagos(idCli, dateDesde, dateHasta, verTodos);
}
///////////1
public void calenHastaAPropertyChange(PropertyChangeEvent e) {
final Calendar c = (Calendar) e.getNewValue();
dateHastaA= dateToMySQLDate(asisGui.getHasta().getCalendar().getTime(), false);
dateDesdeA = dateToMySQLDate(asisGui.getDesde().getCalendar().getTime(), false);
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
String idCli = "nuul";
if (s != null) {
idCli = s.getString("ID_DATOS_PERS");
}
actualizarAsis(idCli, dateDesdeA, dateHastaA, verTodas);
}
////////////2
public void cargarSociosActiv(List lista, boolean inactivo, boolean morosos, boolean soloNombre) {
tablaSocDefault.setRowCount(0);
if (soloNombre) {
LazyList<Socio> ListSocios = Socio.where("ACTIVO = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", 1, clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
clientesGui.getTablaClientesDefault().setRowCount(0);
Iterator<Socio> it = ListSocios.iterator();
while (it.hasNext()) {
Socio a = it.next();
Object row[] = new Object[5];
row[0] = a.getString("NOMBRE");
row[1] = a.getString("APELLIDO");
row[2] = a.getString("DNI");
row[3] = a.getString("TEL");
row[4] = a.getBoolean("ACTIVO");
clientesGui.getTablaClientesDefault().addRow(row);
}
clientesGui.getLabelResult3().setText(Integer.toString(ListSocios.size()));
/*LazyList lista3 = Arancel.where("ACTIVO = ?", 1);
Iterator<Arancel> iter = lista3.iterator();
String d[] = new String[100];
int i = 1;
while (iter.hasNext()) {
Arancel a = iter.next();
d[i] = a.getString("nombre");
i++;
}*/
//clientesGui.getActividades().setListData(d);
//ABMSocios abm = new ABMSocios();
} else {
if ((lista.size() == 2) && morosos && inactivo) {
LazyList lSocios = Socio.where("ACTIVO = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", 0, clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
Iterator<Socio> is = lSocios.iterator();
while (is.hasNext()) {
Socio s = is.next();
LazyList asistencias = Asistencia.where("ID_DATOS_PERS = ?", s.getInteger("ID_DATOS_PERS")).orderBy("ID_ASISTENCIA desc");
if (!asistencias.isEmpty()) {
System.out.println(s.get("NOMBRE") + " asist: " + asistencias.get(0).getDate("FECHA") + "prox pag " + s.getDate("FECHA_PROX_PAGO"));
if (s.getDate("FECHA_PROX_PAGO").before(asistencias.get(0).getDate("FECHA"))) {
Object row[] = new Object[5];
row[0] = s.getString("NOMBRE");
row[1] = s.getString("APELLIDO");
row[2] = s.getString("DNI");
row[3] = s.getString("TEL");
row[4] = s.getBoolean("ACTIVO");
tablaSocDefault.addRow(row);
}
}
}
}
if ((lista.size() == 1) && morosos) {
LazyList lSocios = Socio.where("ACTIVO = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", 1, clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
Iterator<Socio> is = lSocios.iterator();
while (is.hasNext()) {
Socio s = is.next();
LazyList asistencias = Asistencia.where("ID_DATOS_PERS = ?", s.getInteger("ID_DATOS_PERS")).orderBy("ID_ASISTENCIA desc");
if (!asistencias.isEmpty()) {
System.out.println(s.get("NOMBRE") + " asist: " + asistencias.get(0).getDate("FECHA") + "prox pag " + s.getDate("FECHA_PROX_PAGO"));
if (s.getDate("FECHA_PROX_PAGO").before(asistencias.get(0).getDate("FECHA"))) {
Object row[] = new Object[5];
row[0] = s.getString("NOMBRE");
row[1] = s.getString("APELLIDO");
row[2] = s.getString("DNI");
row[3] = s.getString("TEL");
row[4] = s.getBoolean("ACTIVO");
tablaSocDefault.addRow(row);
}
}
}
}
if ((lista.size() == 1) && inactivo) {
LazyList socioslist = Socio.where("ACTIVO = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", 0, clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
Iterator<Socio> itera = socioslist.iterator();
while (itera.hasNext()) {
Socio soc = itera.next();
Object row[] = new Object[5];
row[0] = soc.getString("NOMBRE");
row[1] = soc.getString("APELLIDO");
row[2] = soc.getString("DNI");
row[3] = soc.getString("TEL");
row[4] = soc.getBoolean("ACTIVO");
tablaSocDefault.addRow(row);
}
}
if ((!inactivo) && (!morosos)) {
int i = 0;
System.out.println("elementos en la lsita: " + lista.size());
LinkedList<String> h = new LinkedList();
while (i < lista.size()) {
Arancel a = Arancel.first("nombre = ?", lista.get(i));
int arancel_id = a.getInteger("id");
LazyList socioArancel = Socioarancel.where("id_arancel = ?", arancel_id);
clientesGui.getLabelResult3().setText(Integer.toString(socioArancel.size()));
Iterator<Socioarancel> it = socioArancel.iterator();
while (it.hasNext()) {
Socioarancel sa = it.next();
Socio so = Socio.first("ID_DATOS_PERS = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", sa.getInteger("id_socio"), clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
// codigo agregado el 09-4-2014
if (so != null) {
if (so.getInteger("ACTIVO") == 1) {
if (!h.contains(so.getString("ID_DATOS_PERS"))) {
h.add(so.getString("ID_DATOS_PERS"));
}
}
}
}
i++;
}
Iterator<String> aux = h.iterator();
String cli;
while (aux.hasNext()) {
cli = aux.next();
Socio so = Socio.first("ID_DATOS_PERS = ?", cli);
Object row[] = new Object[5];
row[0] = so.getString("NOMBRE");
row[1] = so.getString("APELLIDO");
row[2] = so.getString("DNI");
row[3] = so.getString("TEL");
row[4] = so.getBoolean("ACTIVO");
tablaSocDefault.addRow(row);
}
}
if ((inactivo) && (lista.size() > 1) && (!morosos)) {
int i = 0;
System.out.println("elementos en la lsita: " + lista.size());
LinkedList<String> h = new LinkedList();
while (i < lista.size()) {
if (lista.get(i) != "INACTIVOS") {
Arancel a = Arancel.first("nombre = ?", lista.get(i));
LazyList socioArancel = Socioarancel.where("id_arancel = ?", a.getInteger("id"));
clientesGui.getLabelResult3().setText(Integer.toString(socioArancel.size()));
Iterator<Socioarancel> it = socioArancel.iterator();
while (it.hasNext()) {
Socioarancel sa = it.next();
Socio so = Socio.first("ID_DATOS_PERS = ? and (NOMBRE like ? or APELLIDO like ? or DNI like ? )", sa.getInteger("id_socio"), clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%", clientesGui.getBusqueda().getText() + "%");
if (so != null) {
if (so.getInteger("ACTIVO") == 0) {
if (!h.contains(so.getString("ID_DATOS_PERS"))) {
h.add(so.getString("ID_DATOS_PERS"));
}
}
}
}
}
i++;
}
Iterator<String> aux = h.iterator();
String cli;
while (aux.hasNext()) {
cli = aux.next();
Socio so = Socio.first("ID_DATOS_PERS = ?", cli);
Object row[] = new Object[5];
row[0] = so.getString("NOMBRE");
row[1] = so.getString("APELLIDO");
row[2] = so.getString("DNI");
row[3] = so.getString("TEL");
row[4] = so.getBoolean("ACTIVO");
tablaSocDefault.addRow(row);
}
}
}
clientesGui.getLabelResult3().setText(Integer.toString(clientesGui.getTablaClientes().getRowCount()));
}
public void cargarSocios(String filtro) {
List actividadesSelecc = actividades.getSelectedValuesList();
System.out.println(actividadesSelecc.toString());
if (!actividadesSelecc.isEmpty()) {
boolean inactivo = false;
boolean morosos = false;
int i = 0;
while (i < actividadesSelecc.size()) {
if (actividadesSelecc.get(i) == "INACTIVOS") {
inactivo = true;
}
if (actividadesSelecc.get(i) == "MOROSOS") {
morosos = true;
}
i++;
}
cargarSociosActiv(actividadesSelecc, inactivo, morosos, false);
}
/*LazyList<Socio> ListSocios= Socio.where("NOMBRE like ? or APELLIDO like ? or DNI like ? ", filtro + "%",filtro + "%",filtro + "%");
tablaSocDefault.setRowCount(0);
Iterator<Socio> it = ListSocios.iterator();
while(it.hasNext()){
Socio a = it.next();
String row[] = new String[4];
row[0] = a.getString("NOMBRE");
row[1] = a.getString("APELLIDO");
row[2] = a.getString("DNI");
row[3] = a.getString("TEL");
tablaSocDefault.addRow(row);
}
clientesGui.getLabelResult3().setText(Integer.toString(ListSocios.size()));*/
}
public void busquedaKeyReleased(java.awt.event.KeyEvent evt) {
System.out.println("apreté el caracter" + evt.getKeyChar());
System.out.println("opcion dejo de ser seleccionada ");
List actividadesSelecc = actividades.getSelectedValuesList();
System.out.println(actividadesSelecc.toString());
if (!actividadesSelecc.isEmpty()) {
boolean inactivo = false;
boolean morosos = false;
int i = 0;
while (i < actividadesSelecc.size()) {
if (actividadesSelecc.get(i) == "INACTIVOS") {
inactivo = true;
}
if (actividadesSelecc.get(i) == "MOROSOS") {
morosos = true;
}
i++;
}
cargarSociosActiv(actividadesSelecc, inactivo, morosos, false);
} else {
cargarSociosActiv(actividadesSelecc, false, false, true);
}
clientesGui.getLabelResult3().setText(Integer.toString(clientesGui.getTablaClientes().getRowCount()));
}
public void tablaMouseClicked(java.awt.event.MouseEvent evt) {
clientesGui.getBotEliminarSocio().setEnabled(true);
clientesGui.getBotRegistrosPago().setEnabled(true);
if (evt.getClickCount() == 2) {
System.out.println("Hice doble click sobre un socio");
altaClienteGui.setBotonesNuevo(false);
altaClienteGui.bloquearCampos(true);
altaClienteGui.limpiarCampos();
int row = tablaClientes.getSelectedRow();
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(row, 2));
altaClienteGui.setTitle(s.getString("APELLIDO") + " " + s.getString("NOMBRE"));
altaClienteGui.setVisible(true);
altaClienteGui.toFront();
controladorAbmCliente.setSocio(s);
altaClienteGui.getNombre().setText(s.getString("NOMBRE"));
altaClienteGui.getApellido().setText(s.getString("APELLIDO"));
altaClienteGui.getTelefono().setText(s.getString("TEL"));
altaClienteGui.getDni().setText(s.getString("DNI"));
altaClienteGui.getDireccion().setText(s.getString("DIR"));
if (s.getString("SEXO").equals("M")) {
altaClienteGui.getSexo().setSelectedIndex(1);
} else {
altaClienteGui.getSexo().setSelectedIndex(0);
}
altaClienteGui.getFechaNacimJDate().setDate(s.getDate("FECHA_NAC"));;
altaClienteGui.getLabelFechaIngreso().setText(dateToMySQLDate(s.getDate("FECHA_ING"), true));
altaClienteGui.getLabelFechaVenci().setText(dateToMySQLDate(s.getDate("FECHA_PROX_PAGO"), true));
altaClienteGui.getTablaActivDefault().setRowCount(0);
LazyList<Socioarancel> ListSocAran = Socioarancel.where("id_socio = ?", s.get("ID_DATOS_PERS"));
Iterator<Socioarancel> ite = ListSocAran.iterator();
while (ite.hasNext()) {
Socioarancel sa = ite.next();
Arancel a = Arancel.first("id = ?", sa.get("id_arancel"));
Object row1[] = new Object[2];
row1[0] = a.getString("nombre");
row1[1] = true;
altaClienteGui.getTablaActivDefault().addRow(row1);
/*Se debe abrir la ventana de clientes para permitir el alta de giles*/
}
}
}
@Override
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == clientesGui.getBotAltaSocio()) {
System.out.println("Alta socio pulsado");
altaClienteGui.setBotonesNuevo(true);
altaClienteGui.bloquearCampos(false);
altaClienteGui.limpiarCampos();
controladorAbmCliente.setIsNuevo(true);
altaClienteGui.setTitle("Alta de socio");
altaClienteGui.setVisible(true);
altaClienteGui.toFront();
altaClienteGui.getTablaActivDefault().setRowCount(0);
LazyList<Arancel> ListAran = Arancel.findAll();
Iterator<Arancel> ite = ListAran.iterator();
while (ite.hasNext()) {
Arancel a = ite.next();
Object row[] = new Object[2];
row[0] = a.getString("nombre");
altaClienteGui.getTablaActivDefault().addRow(row);
/*Se debe abrir la ventana de clientes para permitir el alta de giles*/
}
}
if (ae.getSource() == clientesGui.getBotEliminarSocio()) {
System.out.println("eliminar socio");
if (tablaClientes.getSelectedRow() >= 0) {
/*elimino el socio SELECCIONADO, pregunto y fue*/
int ret = JOptionPane.showConfirmDialog(clientesGui, "¿Desea eliminar a " + tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 0) + " " + tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 1) + " ?", null, JOptionPane.YES_NO_OPTION);
if (ret == JOptionPane.YES_OPTION) {
System.out.println("elimino el de la fila " + tablaClientes.getSelectedRow());
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
if (abmSocios.baja(s)) {
JOptionPane.showMessageDialog(clientesGui, "Socio dado de baja exitosamente!");
LazyList<Socio> ListSocios = Socio.where("ACTIVO = ?", 1);
clientesGui.getTablaClientesDefault().setRowCount(0);
Iterator<Socio> it = ListSocios.iterator();
while (it.hasNext()) {
Socio a = it.next();
Object row[] = new Object[5];
row[0] = a.getString("NOMBRE");
row[1] = a.getString("APELLIDO");
row[2] = a.getString("DNI");
row[3] = a.getString("TEL");
row[4] = a.getBoolean("ACTIVO");
clientesGui.getTablaClientesDefault().addRow(row);
}
} else {
JOptionPane.showMessageDialog(clientesGui, "Ocurrio un error inesperado");
}
}
}
}
if (ae.getSource() == clientesGui.getBotRegistrosPago()) {
System.out.println("ver registros de pago pulsado");
verTodos = false;
if (tablaClientes.getSelectedRow() >= 0) {
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
LazyList ListPagos = Pago.where("ID_DATOS_PERS = ?", s.getString("ID_DATOS_PERS"));
pagosGui.getTablaPagosDefault().setRowCount(0);
Iterator<Pago> it = ListPagos.iterator();
while (it.hasNext()) {
Pago p = it.next();
Object row[] = new Object[6];
row[0] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 0);
row[1] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 1);
row[2] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2);
row[3] = dateToMySQLDate(p.getDate("FECHA"), true);
row[4] = p.getFloat("MONTO");
row[5] = p.getInteger("ID_PAGOS");
pagosGui.getTablaPagosDefault().addRow(row);
}
pagosGui.setVisible(true);
pagosGui.toFront();
System.out.println("pagos del gil de la fila" + tablaClientes.getSelectedRow());
}
}
if (ae.getSource() == clientesGui.getAsistencias()) {
System.out.println("ver registros de pago pulsado");
verTodas = false;
if (tablaClientes.getSelectedRow() >= 0) {
Socio s = Socio.first("DNI = ?", tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2));
LazyList ListAsis = Asistencia.where("ID_DATOS_PERS = ?", s.getString("ID_DATOS_PERS"));
ListAsis.orderBy("ID_ASISTENCIA");
asisGui.getTablaAsisDefault().setRowCount(0);
Iterator<Asistencia> it = ListAsis.iterator();
while (it.hasNext()) {
Asistencia p = it.next();
Object row[] = new Object[7];
row[0] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 0);
row[1] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 1);
row[2] = tablaClientes.getValueAt(tablaClientes.getSelectedRow(), 2);
row[3] = dateToMySQLDate(p.getDate("FECHA"), true);
//row[4] = p.getFloat("MONTO");
Arancel ar= Arancel.findFirst("id = ?", p.get("ID_ACTIV"));
String nombreActiv= ar.getString("nombre");
String nombreActivCombo="";
if(p.get("ID_ACTIV_COMBO")!=null){
ar= Arancel.findFirst("id = ?", p.get("ID_ACTIV_COMBO"));
nombreActivCombo=ar.getString("nombre");
}
row[4] = nombreActiv;
row[5] = nombreActivCombo;
row[6] = p.getInteger("ID_ASISTENCIA");
asisGui.getTablaAsisDefault().addRow(row);
}
asisGui.setVisible(true);
asisGui.toFront();
System.out.println("asis del gil de la fila" + tablaClientes.getSelectedRow());
}
}
if (ae.getSource() == asisGui.getBotBorrarAsis()) {
int ret = JOptionPane.showConfirmDialog(asisGui, "¿Desea eliminar la asistencia seleccionada?", null, JOptionPane.YES_NO_OPTION);
if (ret == JOptionPane.YES_OPTION) {
System.out.println("elimino el de la fila " + tablaClientes.getSelectedRow());
Asistencia.delete("ID_ASISTENCIA = ?", asisGui.getTablaAsis().getValueAt(asisGui.getTablaAsis().getSelectedRow(), 6));
dateHasta= dateToMySQLDate(asisGui.getHasta().getCalendar().getTime(), false);
dateDesde = dateToMySQLDate(asisGui.getDesde().getCalendar().getTime(), false);
actualizarAsis(dateDesde, dateDesde, dateHasta, verTodas);
}
}
if (ae.getSource() == asisGui.getBotVerTodos()) {
verTodas = true;
dateHastaA= dateToMySQLDate(asisGui.getHasta().getCalendar().getTime(), false);
dateDesdeA = dateToMySQLDate(asisGui.getDesde().getCalendar().getTime(), false);
actualizarAsis("no me importa", dateDesdeA, dateHastaA, verTodas);
}
if (ae.getSource() == pagosGui.getBotBorrarPago()) {
int ret = JOptionPane.showConfirmDialog(pagosGui, "¿Desea eliminar el pago seleccionado?", null, JOptionPane.YES_NO_OPTION);
if (ret == JOptionPane.YES_OPTION) {
System.out.println("elimino el de la fila " + tablaClientes.getSelectedRow());
Pago.delete("ID_PAGOS = ?", pagosGui.getTablaPagos().getValueAt(pagosGui.getTablaPagos().getSelectedRow(), 5));
dateHasta= dateToMySQLDate(pagosGui.getHasta().getCalendar().getTime(), false);
dateDesde = dateToMySQLDate(pagosGui.getDesde().getCalendar().getTime(), false);
actualizarPagos(dateDesde, dateDesde, dateHasta, verTodos);
}
}
if (ae.getSource() == pagosGui.getBotVerTodos()) {
verTodos = true;
dateHasta= dateToMySQLDate(pagosGui.getHasta().getCalendar().getTime(), false);
dateDesde = dateToMySQLDate(pagosGui.getDesde().getCalendar().getTime(), false);
actualizarPagos("no me importa", dateDesde, dateHasta, verTodos);
}
}
/*public void cargarSocios(){
LazyList<Socio> ListSocios= Socio.where("ACTIVO = ?", 1);
clientesGui.getTablaClientesDefault().setRowCount(0);
Iterator<Socio> it = ListSocios.iterator();
while(it.hasNext()){
Socio a = it.next();
String row[] = new String[4];
row[0] = a.getString("NOMBRE");
row[1] = a.getString("APELLIDO");
row[2] = a.getString("DNI");
row[3] = a.getString("TEL");
clientesGui.getTablaClientesDefault().addRow(row);
}
clientesGui.getLabelResult3().setText(Integer.toString(ListSocios.size()));
LazyList lista = Arancel.where("ACTIVO = ?", 1);
Iterator<Arancel> iter = lista.iterator();
String d[] = new String[100];
int i = 1;
while(iter.hasNext()){
Arancel a = iter.next();
d[i] = a.getString("nombre");
i++;
}
clientesGui.getActividades().setListData(d);
//ABMSocios abm = new ABMSocios();
}*/
/*va true si se quiere usar para mostrarla por pantalla es decir 12/12/2014 y false si va
para la base de datos, es decir 2014/12/12*/
public String dateToMySQLDate(Date fecha, boolean paraMostrar) {
if (fecha != null) {
if (paraMostrar) {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy");
return sdf.format(fecha);
} else {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
return sdf.format(fecha);
}
} else {
return "";
}
}
private void actualizarPagos(String idcliente, String desde, String hasta, boolean todos) {
LazyList<Pago> ListPagos;
if (!todos) {
ListPagos = Pago.where("ID_DATOS_PERS = ? and FECHA between ? and ?", idcliente, desde, hasta);
} else {
ListPagos = Pago.where("FECHA between ? and ?", desde, hasta);
}
pagosGui.getTablaPagosDefault().setRowCount(0);
if (ListPagos != null) {
Iterator<Pago> it = ListPagos.iterator();
Socio s;
while (it.hasNext()) {
Pago p = it.next();
s = Socio.findFirst("ID_DATOS_PERS =?", p.getString("ID_DATOS_PERS"));
Object row[] = new Object[6];
row[0] = s.getString("NOMBRE");
row[1] = s.getString("APELLIDO");
row[2] = s.getString("DNI");
row[3] = dateToMySQLDate(p.getDate("FECHA"), true);
row[4] = p.getFloat("MONTO");
row[5] = p.getInteger("ID_PAGOS");
pagosGui.getTablaPagosDefault().addRow(row);
}
}
}
private void actualizarAsis(String idcliente, String desde, String hasta, boolean todos) {
LazyList<Asistencia> ListAsis;
if (!todos) {
ListAsis = Asistencia.where("ID_DATOS_PERS = ? and FECHA between ? and ?", idcliente, desde, hasta);
} else {
ListAsis = Asistencia.where("FECHA between ? and ?", desde, hasta);
}
asisGui.getTablaAsisDefault().setRowCount(0);
if (ListAsis != null) {
Iterator<Asistencia> it = ListAsis.iterator();
Socio s;
while (it.hasNext()) {
Asistencia p = it.next();
s = Socio.findFirst("ID_DATOS_PERS =?", p.getString("ID_DATOS_PERS"));
Object row[] = new Object[7];
row[0] = s.getString("NOMBRE");
row[1] = s.getString("APELLIDO");
row[2] = s.getString("DNI");
row[3] = dateToMySQLDate(p.getDate("FECHA"), true);
// row[4] = p.getFloat("MONTO");
Arancel ar= Arancel.findFirst("id = ?", p.get("ID_ACTIV"));
if(ar != null){
String nombreActiv= ar.getString("nombre");
String nombreActivCombo="";
if(p.get("ID_ACTIV_COMBO")!=null){
ar= Arancel.findFirst("id = ?", p.get("ID_ACTIV_COMBO"));
nombreActivCombo=ar.getString("nombre");
}
row[4] = nombreActiv;
row[5] = nombreActivCombo;
}
row[6] = p.getInteger("ID_ASISTENCIA");
asisGui.getTablaAsisDefault().addRow(row);
}
}
}
}
| [
"alan@agonzalez.(none)"
] | alan@agonzalez.(none) |
a4fb77c91067acb72f7d9f1f89bafa0ccf84eb7b | 606cd7931bc5288ffe91cf58f45d3e4f64a9b3df | /pk/src/java/com/pelindo/ebtos/bean/security/LoginController.java | 4409cc5583f1c43057f5062dc23c9c656c0d622e | [] | no_license | surachman/iconos-tarakan | 5655284ac69059935922d92ee856b6926b656d1d | d7fa1c120d22d391983dab95c5654cb63b27e1f7 | refs/heads/master | 2021-01-20T20:21:40.937285 | 2016-06-27T14:51:22 | 2016-06-27T14:51:22 | 61,995,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,751 | java | package com.pelindo.ebtos.bean.security;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import com.qtasnim.jsf.FacesHelper;
import com.pelindo.ebtos.bean.application.Navigation;
import com.pelindo.ebtos.ejb.facade.remote.ActiveDirectoryFacadeRemote;
import com.pelindo.ebtos.ejb.facade.remote.MasterSettingAppFacadeRemote;
import com.pelindo.ebtos.model.ChangePassword;
import com.pelindo.ebtos.model.NamedObject;
import java.io.IOException;
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpSession;
import org.primefaces.context.RequestContext;
/**
*
* @author senoanggoro
*/
@ManagedBean(name="loginController")
@ViewScoped
public class LoginController implements Serializable{
private static final String AGENT_GROUP_NAME_PARAM = "ebtos.group.agent";
private MasterSettingAppFacadeRemote masterSettingAppFacade = lookupMasterSettingAppFacadeRemote();
private ActiveDirectoryFacadeRemote activeDirectoryFacade = lookupActiveDirectoryFacadeRemote();
private String username;
private String password;
private String module;
private ChangePassword changePassword;
public LoginController() {
module = FacesHelper.translateElExpression("#{module}", FacesContext.getCurrentInstance(), String.class);
changePassword = new ChangePassword();
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public ChangePassword getChangePassword() {
return changePassword;
}
public void setChangePassword(ChangePassword changePassword) {
this.changePassword = changePassword;
}
public void invalidate(){
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
HttpSession session = (HttpSession) ec.getSession(false);
session.invalidate();
}
public void doLogout(ActionEvent event) throws IOException {
FacesContext context = FacesContext.getCurrentInstance();
invalidate();
context.getExternalContext().redirect(Navigation.resolveHomeUrl(context));
}
public void changePassword(ActionEvent event){
FacesContext facesContext = FacesContext.getCurrentInstance();
RequestContext requestContext = RequestContext.getCurrentInstance();
if (getChangePassword() != null && getChangePassword().isValid()) {
if (getChangePassword().isNewPasswordValid()) {
LoginSessionBean sessionBean = LoginSessionBean.getCurrentInstance();
NamedObject user = activeDirectoryFacade.findUserByUid(sessionBean.getUsername());
if (user != null && activeDirectoryFacade.authenticate(user, changePassword.getCurrentPassword())) {
activeDirectoryFacade.changePassword(user, getChangePassword().getNewPassword());
requestContext.addCallbackParam("isPasswordChanged", true);
FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_INFO, "Info", "application.validation.password_changed");
return;
}
requestContext.addCallbackParam("isPasswordChanged", false);
FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_ERROR, "Error", "application.validation.password_wrong");
return;
}
requestContext.addCallbackParam("isPasswordChanged", false);
FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_ERROR, "Error", "application.validation.new_password_not_match");
return;
}
requestContext.addCallbackParam("isPasswordChanged", false);
}
public void doLogin(ActionEvent event) throws IOException, ServletException {
FacesContext context = FacesContext.getCurrentInstance();
NamedObject user = activeDirectoryFacade.findUserByUid(username);
if (activeDirectoryFacade.authenticate(user, password)){ //check credential
if (!user.getGroups().contains(masterSettingAppFacade.find(AGENT_GROUP_NAME_PARAM).getValueString())){
HttpSession session = (HttpSession) context.getExternalContext().getSession(true);
LoginSessionBean bean = LoginSessionBean.getCurrentInstance();
session.setAttribute("username", getUsername()); //untuk trigger
bean.setUsername(getUsername());
bean.setName(user.getCn());
bean.setGroups(user.getGroups());
context.getExternalContext().redirect(Navigation.resolveUrl(context, (module == null || module.equals("")) ? Navigation.DEFAULT_HOME_URL : module));
return;
}
FacesHelper.addErrorFacesMessage(context, "message.access.login_error_credential");
invalidate();
return;
}
if (activeDirectoryFacade.getMessage() != null)
FacesHelper.addErrorFacesMessage(context, activeDirectoryFacade.getMessage());
invalidate();
}
private ActiveDirectoryFacadeRemote lookupActiveDirectoryFacadeRemote() {
try {
Context c = new InitialContext();
return (ActiveDirectoryFacadeRemote) c.lookup("java:global/pkproject/pk-ejb/ActiveDirectoryFacade!com.pelindo.ebtos.ejb.facade.remote.ActiveDirectoryFacadeRemote");
} catch (NamingException ne) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
throw new RuntimeException(ne);
}
}
private MasterSettingAppFacadeRemote lookupMasterSettingAppFacadeRemote() {
try {
Context c = new InitialContext();
return (MasterSettingAppFacadeRemote) c.lookup("java:global/pkproject/pk-ejb/MasterSettingAppFacade!com.pelindo.ebtos.ejb.facade.remote.MasterSettingAppFacadeRemote");
} catch (NamingException ne) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
throw new RuntimeException(ne);
}
}
}
| [
"surachman026@gmail.com"
] | surachman026@gmail.com |
f86d55ffa7e88ee5faabe7e213ecc6b1eee3b6ac | f5298aaff65863bd241a689e5f93c17336520fe7 | /src/main/java/com/example/demo/controller/UserController.java | 84b6692d2955984ef426f0e2c09ae0c8f9c2c421 | [] | no_license | Haritha-Ti/Jwttoken | 6d913102b9c0f9bd6f67510b3fb54af4db4fa0e9 | 63112a2bcac4bc6a48a01ab9012077f7233ef852 | refs/heads/master | 2020-05-02T11:34:38.473173 | 2019-04-01T06:40:14 | 2019-04-01T06:40:14 | 177,932,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,723 | java | package com.example.demo.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.example.demo.config.JwtTokenUtil;
import com.example.demo.dto.UserDto;
import com.example.demo.model.LoginUser;
import com.example.demo.model.User;
import com.example.demo.service.UserService;
@RestController
public class UserController {
@Autowired
private UserService userService;
@Autowired
JwtTokenUtil jwtToken;
// private BCryptPasswordEncoder bCryptPasswordEncoder;
@RequestMapping(value = "/user", method = RequestMethod.GET)
public List listUser() {
return userService.findAll();
}
@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
public User getOne(@PathVariable(value = "id") Long id) {
return userService.findOne(id);
}
@RequestMapping(value = "/signup", method = RequestMethod.POST)
public User saveUser(@RequestBody UserDto user) {
System.out.println("user " + user.getUsername() + " pass " + user.getPassword() + " age " + user.getAge()
+ " salary " + user.getSalary());
return userService.save(user);
}
@PostMapping(value = "/getLoginCredentials")
@ResponseBody
public String adminLogin(@RequestBody LoginUser requestdata) {
// getting string value from json request
String username = requestdata.getUsername();
String password = requestdata.getPassword();
System.out.println("username " + username + "password " + password);
try {
if ((username != null) && (username.length() > 0) && (!username.equals(" ")) && (password != null)
&& (password.length() > 0)) {
// Invoking user authentication method
User usercheck = userService.login_authentication(username, password);
String token = null;
if (usercheck != null) {
UserDto userdata = new UserDto();
userdata.setUsername(usercheck.getUsername());
userdata.setPassword(usercheck.getUsername());
token = jwtToken.generateToken(userdata);
System.out.println("token : " + token);
}
return "token : "+token;
} else {
return null;
}
} catch (Exception e) {
System.out.println("Exception : " + e);
return null;
}
}
}
| [
"haritha@titech-OptiPlex-3010"
] | haritha@titech-OptiPlex-3010 |
6765a1382cc9fec71c33b196fa9ed4138bcf7e1e | e11d9d424631e20c920b6c61a442c1c805b6fd2c | /jtools.commons/src/main/java/jtools/commons/model/XBean.java | 949b98c9fb68576bef1b345af5a4dd7d2adb39f4 | [] | no_license | jribacruz/jtools | 6b72da2d6a0913be2fee2a40daed4b91210482fd | 4838357682ee91440374e23920949959295c752a | refs/heads/master | 2021-07-16T12:59:29.206128 | 2016-05-28T20:11:55 | 2016-05-28T20:11:55 | 49,345,266 | 0 | 1 | null | 2021-07-14T03:02:27 | 2016-01-09T23:07:49 | Java | UTF-8 | Java | false | false | 388 | java | package jtools.commons.model;
import jtools.commons.types.XCollection;
/**
* Classe que representa um bean CDI.
*
* @author jcruz
*
*/
public interface XBean extends XClass {
/**
*
* @return
*/
public XCollection<XClassAttribute> getInjectedAttributes();
/**
*
* @param attributeName
* @return
*/
public boolean isInjectedAttribute(String attributeName);
}
| [
"jribacruz@gmail.com"
] | jribacruz@gmail.com |
d70f1f93dbc5f19c988334061cf3f5528d6cc9c2 | bc15d60214b9defe1cc74a85cc64dd68ff4e49fd | /src/main/java/statemachine/seatheater/SeatHeaterState.java | e68eecdcd27a67a1a5de5d9cb699fdaa40884956 | [] | no_license | huxol/training-solutions | 2e99bc8f4ad9a316d84a4f6ab30e2cf45921f982 | fdec71f07dbc157a99aed4ae331730ebccfc598e | refs/heads/master | 2023-04-18T09:26:02.472018 | 2021-04-28T11:53:15 | 2021-04-28T11:53:15 | 308,872,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | package statemachine.seatheater;
public enum SeatHeaterState {
OFF {
SeatHeaterState next() {
return SeatHeaterState.THREE;
}
},
THREE {
SeatHeaterState next() {
return SeatHeaterState.TWO;
}
},
TWO {
SeatHeaterState next() {
return SeatHeaterState.ONE;
}
},
ONE {
SeatHeaterState next() {
return SeatHeaterState.OFF;
}
};
abstract SeatHeaterState next();
}
| [
"huxol@freemail.hu"
] | huxol@freemail.hu |
ca48582b50a5cd948aed006e103777fed30e491a | 09d0ddd512472a10bab82c912b66cbb13113fcbf | /TestApplications/privacy-friendly-netmonitor-2.0/DecompiledCode/Fernflower/src/main/java/android/support/v4/content/ContextCompat.java | 596b430b33908640fc8be2f155c5b0dad82539bf | [] | no_license | sgros/activity_flow_plugin | bde2de3745d95e8097c053795c9e990c829a88f4 | 9e59f8b3adacf078946990db9c58f4965a5ccb48 | refs/heads/master | 2020-06-19T02:39:13.865609 | 2019-07-08T20:17:28 | 2019-07-08T20:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,882 | java | package android.support.v4.content;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Process;
import android.os.Build.VERSION;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.util.TypedValue;
import java.io.File;
public class ContextCompat {
private static final String TAG = "ContextCompat";
private static final Object sLock = new Object();
private static TypedValue sTempValue;
protected ContextCompat() {
}
private static File buildPath(File var0, String... var1) {
int var2 = 0;
int var3 = var1.length;
File var4;
for(var4 = var0; var2 < var3; var4 = var0) {
String var5 = var1[var2];
if (var4 == null) {
var0 = new File(var5);
} else {
var0 = var4;
if (var5 != null) {
var0 = new File(var4, var5);
}
}
++var2;
}
return var4;
}
public static int checkSelfPermission(@NonNull Context var0, @NonNull String var1) {
if (var1 == null) {
throw new IllegalArgumentException("permission is null");
} else {
return var0.checkPermission(var1, Process.myPid(), Process.myUid());
}
}
public static Context createDeviceProtectedStorageContext(Context var0) {
return VERSION.SDK_INT >= 24 ? var0.createDeviceProtectedStorageContext() : null;
}
private static File createFilesDir(File var0) {
synchronized(ContextCompat.class){}
label103: {
Throwable var10000;
label107: {
boolean var1;
boolean var10001;
try {
if (var0.exists() || var0.mkdirs()) {
break label103;
}
var1 = var0.exists();
} catch (Throwable var8) {
var10000 = var8;
var10001 = false;
break label107;
}
if (var1) {
return var0;
}
try {
StringBuilder var2 = new StringBuilder();
var2.append("Unable to create files subdir ");
var2.append(var0.getPath());
Log.w("ContextCompat", var2.toString());
} catch (Throwable var7) {
var10000 = var7;
var10001 = false;
break label107;
}
return null;
}
Throwable var9 = var10000;
throw var9;
}
return var0;
}
public static File getCodeCacheDir(Context var0) {
return VERSION.SDK_INT >= 21 ? var0.getCodeCacheDir() : createFilesDir(new File(var0.getApplicationInfo().dataDir, "code_cache"));
}
@ColorInt
public static final int getColor(Context var0, @ColorRes int var1) {
return VERSION.SDK_INT >= 23 ? var0.getColor(var1) : var0.getResources().getColor(var1);
}
public static final ColorStateList getColorStateList(Context var0, @ColorRes int var1) {
return VERSION.SDK_INT >= 23 ? var0.getColorStateList(var1) : var0.getResources().getColorStateList(var1);
}
public static File getDataDir(Context var0) {
if (VERSION.SDK_INT >= 24) {
return var0.getDataDir();
} else {
String var1 = var0.getApplicationInfo().dataDir;
File var2;
if (var1 != null) {
var2 = new File(var1);
} else {
var2 = null;
}
return var2;
}
}
public static final Drawable getDrawable(Context var0, @DrawableRes int var1) {
if (VERSION.SDK_INT >= 21) {
return var0.getDrawable(var1);
} else if (VERSION.SDK_INT >= 16) {
return var0.getResources().getDrawable(var1);
} else {
Object var2 = sLock;
synchronized(var2){}
Throwable var10000;
boolean var10001;
label160: {
try {
if (sTempValue == null) {
TypedValue var3 = new TypedValue();
sTempValue = var3;
}
} catch (Throwable var15) {
var10000 = var15;
var10001 = false;
break label160;
}
label157:
try {
var0.getResources().getValue(var1, sTempValue, true);
var1 = sTempValue.resourceId;
return var0.getResources().getDrawable(var1);
} catch (Throwable var14) {
var10000 = var14;
var10001 = false;
break label157;
}
}
while(true) {
Throwable var16 = var10000;
try {
throw var16;
} catch (Throwable var13) {
var10000 = var13;
var10001 = false;
continue;
}
}
}
}
public static File[] getExternalCacheDirs(Context var0) {
return VERSION.SDK_INT >= 19 ? var0.getExternalCacheDirs() : new File[]{var0.getExternalCacheDir()};
}
public static File[] getExternalFilesDirs(Context var0, String var1) {
return VERSION.SDK_INT >= 19 ? var0.getExternalFilesDirs(var1) : new File[]{var0.getExternalFilesDir(var1)};
}
public static final File getNoBackupFilesDir(Context var0) {
return VERSION.SDK_INT >= 21 ? var0.getNoBackupFilesDir() : createFilesDir(new File(var0.getApplicationInfo().dataDir, "no_backup"));
}
public static File[] getObbDirs(Context var0) {
return VERSION.SDK_INT >= 19 ? var0.getObbDirs() : new File[]{var0.getObbDir()};
}
public static boolean isDeviceProtectedStorage(Context var0) {
return VERSION.SDK_INT >= 24 ? var0.isDeviceProtectedStorage() : false;
}
public static boolean startActivities(Context var0, Intent[] var1) {
return startActivities(var0, var1, (Bundle)null);
}
public static boolean startActivities(Context var0, Intent[] var1, Bundle var2) {
if (VERSION.SDK_INT >= 16) {
var0.startActivities(var1, var2);
} else {
var0.startActivities(var1);
}
return true;
}
public static void startActivity(Context var0, Intent var1, @Nullable Bundle var2) {
if (VERSION.SDK_INT >= 16) {
var0.startActivity(var1, var2);
} else {
var0.startActivity(var1);
}
}
public static void startForegroundService(Context var0, Intent var1) {
if (VERSION.SDK_INT >= 26) {
var0.startForegroundService(var1);
} else {
var0.startService(var1);
}
}
}
| [
"crash@home.home.hr"
] | crash@home.home.hr |
916559e8566b5c1c753c377a37cb40969f211d3d | 87c71767d3fa16bb352f29bd6bb74365637ecf16 | /springboot-mybatis-multi-ds/src/main/java/com/sgh/demo/domain/User.java | a0c613a33f9496f65ab1c2c313aa44690dc3b5a3 | [] | no_license | haleyshi/mybatis_study | 1b138b2d0c9c4e21d053332956d2cd8a0fbca1f8 | 31bcafe0a4a9803a0aecd49eb5a610030bb7efe3 | refs/heads/master | 2021-09-09T10:26:40.131355 | 2018-03-15T06:46:59 | 2018-03-15T06:48:34 | 113,397,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 840 | java | /**
*
*/
package com.sgh.demo.domain;
/**
* @author eguoshi
*
*/
public class User {
private Long id;
private String userName;
private String description;
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the userName
*/
public String getUserName() {
return userName;
}
/**
* @param userName the userName to set
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
}
| [
"haley.shi@ericsson.com"
] | haley.shi@ericsson.com |
5efafd9e2aeed60a5fbec92fbb68decd07327176 | 86deb8c126096f5ba5de0984cf76ab0750e8e1db | /src/handling/world/family/MapleFamilyBuff.java | 11a103f4623cad69fa07b0f278f7872fc01b668b | [] | no_license | 398074715/MapleStory | 2b3a5e3e4116bc5eb895f92a414540f9bc3c9c18 | 02a54eac29a764bb67256ec62ea8b03a209a4966 | refs/heads/master | 2023-08-22T22:57:52.716491 | 2021-08-15T14:27:13 | 2021-08-15T14:27:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,710 | java | package handling.world.family;
import client.MapleBuffStat;
import client.MapleCharacter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import server.MapleItemInformationProvider;
import server.MapleStatEffect;
import server.Timer;
import tools.MaplePacketCreator;
import tools.Pair;
public class MapleFamilyBuff
{
private static final int event = 2;
private static final int[] type;
private static final int[] duration;
private static final int[] effect;
private static final int[] rep;
private static final String[] name;
private static final String[] desc;
private static final List<MapleFamilyBuffEntry> buffEntries;
public static List<MapleFamilyBuffEntry> getBuffEntry() {
return MapleFamilyBuff.buffEntries;
}
public static MapleFamilyBuffEntry getBuffEntry(final int i) {
return MapleFamilyBuff.buffEntries.get(i);
}
static {
type = new int[] { 0, 1, 2, 3, 4, 2, 3, 2, 3, 2, 3 };
duration = new int[] { 0, 0, 15, 15, 30, 15, 15, 30, 30, 30, 30 };
effect = new int[] { 0, 0, 150, 150, 200, 200, 200, 200, 200, 200, 200 };
rep = new int[] { 3, 5, 7, 8, 10, 12, 15, 20, 25, 40, 50 };
name = new String[] { "直接移动到学院成员身边", "直接召唤学院成员", "我的爆率 1.5倍(15分钟)", "我的经验值 1.5倍(15分钟)", "学院成员的团结(30分钟)", "我的爆率 2倍(15分钟)", "我的经验值 2倍(15分钟)", "我的爆率 2倍(30分钟)", "我的经验值 2倍(30分钟)", "我的组队爆率 2倍(30分钟)", "我的组队经验值 2倍(30分钟)" };
desc = new String[] { "[对象] 我\n[效果] 直接可以移动到指定的学院成员身边。", "[对象] 学院成员 1名\n[效果] 直接可以召唤指定的学院成员到现在的地图。", "[对象] 我\n[持续效果] 15分钟\n[效果] 打怪爆率增加到 #c1.5倍# \n※ 与爆率活动重叠时失效。", "[对象] 我\n[持续效果] 15分钟\n[效果] 打怪经验值增加到 #c1.5倍# \n※ 与经验值活动重叠时失效。", "[启动条件] 校谱最低层学院成员6名以上在线时\n[持续效果] 30分钟\n[效果] 爆率和经验值增加到 #c2倍# ※ 与爆率、经验值活动重叠时失效。", "[对象] 我\n[持续效果] 15分钟\n[效果] 打怪爆率增加到 #c2倍# \n※ 与爆率活动重叠时失效。", "[对象] 我\n[持续效果] 15分钟\n[效果] 打怪经验值增加到 #c2倍# \n※ 与经验值活动重叠时失效。", "[对象] 我\n[持续效果] 30分钟\n[效果] 打怪爆率增加到 #c2倍# \n※ 与爆率活动重叠时失效。", "[对象] 我\n[持续效果] 30分钟\n[效果] 打怪经验值增加到 #c2倍# \n※ 与经验值活动重叠时失效。", "[对象] 我所属组队\n[持续效果] 30分钟\n[效果] 打怪爆率增加到 #c2倍# \n※ 与爆率活动重叠时失效。", "[对象] 我所属组队\n[持续效果] 30分钟\n[效果] 打怪经验值增加到 #c2倍# \n※ 与经验值活动重叠时失效。" };
buffEntries = new ArrayList<MapleFamilyBuffEntry>();
for (int i = 0; i < 2; ++i) {
MapleFamilyBuff.buffEntries.add(new MapleFamilyBuffEntry(i, MapleFamilyBuff.name[i], MapleFamilyBuff.desc[i], 1, MapleFamilyBuff.rep[i], MapleFamilyBuff.type[i], 190000 + i, MapleFamilyBuff.duration[i], MapleFamilyBuff.effect[i]));
}
}
public static class MapleFamilyBuffEntry
{
public String name;
public String desc;
public int count;
public int rep;
public int type;
public int index;
public int questID;
public int duration;
public int effect;
public List<Pair<MapleBuffStat, Integer>> effects;
public MapleFamilyBuffEntry(final int index, final String name, final String desc, final int count, final int rep, final int type, final int questID, final int duration, final int effect) {
this.name = name;
this.desc = desc;
this.count = count;
this.rep = rep;
this.type = type;
this.questID = questID;
this.index = index;
this.duration = duration;
this.effect = effect;
this.effects = this.getEffects();
}
public int getEffectId() {
switch (this.type) {
case 2: {
return 2022694;
}
case 3: {
return 2450018;
}
default: {
return 2022332;
}
}
}
public List<Pair<MapleBuffStat, Integer>> getEffects() {
final List<Pair<MapleBuffStat, Integer>> ret = new ArrayList<Pair<MapleBuffStat, Integer>>();
switch (this.type) {
case 2: {
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.掉落_率, this.effect));
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.金币_率, this.effect));
break;
}
case 3: {
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.经验_率, this.effect));
break;
}
case 4: {
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.经验_率, this.effect));
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.掉落_率, this.effect));
ret.add(new Pair<MapleBuffStat, Integer>(MapleBuffStat.金币_率, this.effect));
break;
}
}
return ret;
}
public void applyTo(final MapleCharacter chr) {
chr.getClient().getSession().write(MaplePacketCreator.giveBuff(-this.getEffectId(), this.duration * 60000, this.effects, null));
final MapleStatEffect eff = MapleItemInformationProvider.getInstance().getItemEffect(this.getEffectId());
chr.cancelEffect(eff, true, -1L, this.effects);
final long starttime = System.currentTimeMillis();
final MapleStatEffect.CancelEffectAction cancelAction = new MapleStatEffect.CancelEffectAction(chr, eff, starttime);
final ScheduledFuture<?> schedule = Timer.BuffTimer.getInstance().schedule(cancelAction, starttime + this.duration * 60000 - starttime);
chr.registerEffect(eff, starttime, schedule, this.effects);
}
}
}
| [
"i@aoaostar.com"
] | i@aoaostar.com |
30d50ca156d49bc89731310fa32c12211f56e65a | d57bbe48908b45cd0a5f9f9d9edc90e4ec37b93e | /com.cloudeggtech.granite.framework/com.cloudeggtech.granite.framework.plumbing/com.cloudeggtech.granite.framework.plumbing.spring/src/main/java/com/cloudeggtech/granite/framework/plumbing/spring/SpringComponentFactoryBean.java | fbda75385901e121ce9f0553822b338f5792ea4f | [
"Apache-2.0"
] | permissive | jaiiye/com.cloudeggtech.granite | 4893a109ae853a389899ad136969d550807e46f2 | 202d1907ec1de05458b6ace26bc1875455c6b9a2 | refs/heads/master | 2020-04-10T22:09:32.767634 | 2018-01-02T10:39:10 | 2018-01-02T10:39:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,523 | java | package com.cloudeggtech.granite.framework.plumbing.spring;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.gemini.blueprint.context.BundleContextAware;
import org.eclipse.gemini.blueprint.util.OsgiFilterUtils;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import com.cloudeggtech.granite.framework.core.repository.IComponentCollector;
import com.cloudeggtech.granite.framework.core.repository.IComponentInfo;
public class SpringComponentFactoryBean implements FactoryBean<IComponentInfo>, BeanFactoryAware,
InitializingBean, DisposableBean, BundleContextAware, ServiceListener {
private String componentId;
private String targetBeanName;
private BeanFactory beanFactory;
private BundleContext bundleContext;
private List<IComponentCollector> componentCollectors;
private SpringComponentInfo componentInfo;
public SpringComponentFactoryBean() {
componentCollectors = new ArrayList<>();
}
@Override
public IComponentInfo getObject() throws Exception {
return componentInfo;
}
@Override
public Class<IComponentInfo> getObjectType() {
return IComponentInfo.class;
}
@Override
public boolean isSingleton() {
return true;
}
public void setComponentId(String name) {
this.componentId = name;
}
public void setTargetBeanName(String targetBeanName) {
this.targetBeanName = targetBeanName;
}
@Override
public synchronized void afterPropertiesSet() throws Exception {
componentInfo = new SpringComponentInfo(componentId, targetBeanName, beanFactory, bundleContext);
Collection<ServiceReference<IComponentCollector>> srs = bundleContext.getServiceReferences(
IComponentCollector.class, null);
if (srs != null) {
for (ServiceReference<IComponentCollector> sr : srs) {
IComponentCollector componentCollector = bundleContext.getService(sr);
componentCollectors.add(componentCollector);
componentCollector.componentFound(componentInfo);
}
}
bundleContext.addServiceListener(this, OsgiFilterUtils.unifyFilter(IComponentCollector.class, null));
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
}
@Override
public synchronized void destroy() throws Exception {
if (!componentCollectors.isEmpty()) {
for (IComponentCollector componentCollector : componentCollectors) {
componentCollector.componentLost(componentId);
}
}
}
@Override
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
@Override
public synchronized void serviceChanged(ServiceEvent event) {
ServiceReference<?> sr = event.getServiceReference();
IComponentCollector componentCollector = (IComponentCollector)bundleContext.getService(sr);
if (event.getType() == ServiceEvent.REGISTERED) {
componentCollectors.add(componentCollector);
componentCollector.componentFound(componentInfo);
} else if (event.getType() == ServiceEvent.UNREGISTERING) {
componentCollectors.remove(componentCollector);
}
}
}
| [
"roger@cloudeggtech.com"
] | roger@cloudeggtech.com |
930b04fda26795a9717a68385a04bff01be96cda | fadfc07cbcca901f4892e02e627293b71ad7513c | /univoxer2016/trunk/Android/Univoxer/app/src/main/java/com/univoxer/android/login/fragments/SignUpFourthPageFragment.java | 85998c5d43ed8fd7186eab0aa9225ebce7b087c0 | [] | no_license | morettic2015/univoxer2017_bk | 057ec0a9531eede691ea09fa0aa08012a559b6ba | 3875d56055cd6c35c2216c984f5d5aa593d869cd | refs/heads/master | 2021-01-19T16:02:13.047941 | 2017-08-21T19:04:17 | 2017-08-21T19:04:17 | 100,983,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,532 | java | package com.univoxer.android.login.fragments;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.VolleyError;
import com.univoxer.android.MainActivity;
import com.univoxer.android.R;
import com.univoxer.android.utils.UnivoxerLog;
import com.univoxer.android.commons.BaseFragment;
import com.univoxer.android.login.adapter.LanguageAdapter;
import com.univoxer.android.user.User;
import com.univoxer.android.network.NetworkManager;
import com.univoxer.android.network.NetworkRequestCallback;
import com.univoxer.android.network.RequestManager;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Gustavo on 29/06/2016.
* SignUpFourthPageFragment
*/
public class SignUpFourthPageFragment extends BaseFragment {
private static final String TAG = SignUpFourthPageFragment.class.getSimpleName();
private ListView mListView;
private Button mButton;
private LanguageAdapter mAdapter;
private ImageView mFlagImage;
private TextView mLanguageText;
private LanguageAdapter.FlagItem mFlagItem;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.signup_second_page_fragment, container, false);
mFlagImage = (ImageView) view.findViewById(R.id.flag_selected);
mLanguageText = (TextView) view.findViewById(R.id.language_selected);
mAdapter = new LanguageAdapter(mContext, LanguageAdapter.PROFICIENCY, true);
mFlagImage.setImageResource(mAdapter.getItem(0).mIcon);
mLanguageText.setText(mAdapter.getItem(0).mTitle);
mListView = (ListView) view.findViewById(R.id.listview_language);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
LanguageAdapter.FlagItem flagItem = mAdapter.getItem(position);
mFlagImage.setImageResource(flagItem.mIcon);
mLanguageText.setText(flagItem.mTitle);
mFlagItem = mAdapter.getItem(position);
}
});
mButton = (Button) view.findViewById(R.id.btn_next);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addProficiency();
Intent intent = new Intent(mContext, MainActivity.class);
mContext.startActivity(intent);
}
});
return view;
}
@Override
public void onResume() {
super.onResume();
if (User.getInstance().getUserData(RequestManager.NATURE) != null) {
mFlagImage.setImageResource(mAdapter.getItemByToken(User.getInstance().getUserData(RequestManager.NATURE)).mIcon);
mLanguageText.setText(mAdapter.getItemByToken(User.getInstance().getUserData(RequestManager.NATURE)).mTitle);
}
}
private void addProficiency() {
Map<String, String> params = new HashMap<>();
params.put(RequestManager.ACTION, RequestManager.ACTIONS.PROFICIENCY.name());
params.put(RequestManager.ID_USER, User.getInstance().getUserData(RequestManager.ID_USER));
params.put(RequestManager.OPT, RequestManager.OPT_ENUM.ADD.name());
params.put(RequestManager.ID_LANG, String.valueOf(mFlagItem.mId));
NetworkManager.getInstance().doPostWithParams(RequestManager.URL, params, "addProficiency", new NetworkRequestCallback<JSONObject>() {
@Override
public void onRequestResponse(JSONObject response) {
HashMap<String, String> params = RequestManager.jsonToMap(response);
String message = params.get(RequestManager.MESSAGE);
UnivoxerLog.d(TAG, "addProficiency: " + message);
}
@Override
public void onRequestError(VolleyError error) {
Toast.makeText(mContext, error.toString(), Toast.LENGTH_SHORT).show();
}
});
}
} | [
"malacma@gmail.com"
] | malacma@gmail.com |
e57773b807191aff28dbee253d74f5f755e04444 | 28935683223311c6345a7c7a0ed2e5f19cfa94d8 | /app/src/main/java/com/google/android/apps/exposurenotification/nearby/PackageConfigurationHelper.java | 76f41b8988e17cc214361bb3c5a454de948ee276 | [
"Apache-2.0"
] | permissive | isabella232/exposure-notifications-android | 64ba16ea78d56d508874c5eaf2d7611b962cf48f | 0220325466214966368b1f1e5cc0eb8a6a380df7 | refs/heads/master | 2023-06-05T08:16:17.444741 | 2021-06-21T17:25:39 | 2021-06-21T17:28:13 | 380,784,965 | 0 | 0 | Apache-2.0 | 2021-06-27T16:15:55 | 2021-06-27T16:14:38 | null | UTF-8 | Java | false | false | 4,367 | java | /*
* Copyright 2020 Google LLC
*
* 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
*
* https://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.android.apps.exposurenotification.nearby;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.google.android.apps.exposurenotification.storage.ExposureNotificationSharedPreferences;
import com.google.android.gms.nearby.exposurenotification.PackageConfiguration;
import com.google.common.base.Optional;
import javax.inject.Inject;
/**
* Helper methods for {@link PackageConfiguration}.
*/
public class PackageConfigurationHelper {
public static final String APP_ANALYTICS_OPT_IN = "METRICS_OPT_IN";
public static final String PRIVATE_ANALYTICS_OPT_IN = "APPA_OPT_IN";
public static final String CHECK_BOX_API_KEY = "check_box_api";
private final ExposureNotificationSharedPreferences exposureNotificationSharedPreferences;
@Inject
public PackageConfigurationHelper(
ExposureNotificationSharedPreferences exposureNotificationSharedPreferences) {
this.exposureNotificationSharedPreferences = exposureNotificationSharedPreferences;
}
/**
* Updates the various analytics states with a given {@link PackageConfiguration}
*
* <p>If app analytics is not set and app analytics state from {@link PackageConfiguration} is
* true,
* update the app analytics state in {@link ExposureNotificationSharedPreferences}.
*
* <p>If private analytics is not set, and private analytics state exists in the {@link
* PackageConfiguration}, set the private analytics state in {@link
* ExposureNotificationSharedPreferences}.
*/
public void maybeUpdateAnalyticsState(@Nullable PackageConfiguration packageConfiguration) {
if (packageConfiguration == null) {
return;
}
if (getAppAnalyticsFromPackageConfiguration(packageConfiguration)) {
if (!exposureNotificationSharedPreferences.isAppAnalyticsSet()) {
exposureNotificationSharedPreferences.setAppAnalyticsState(true);
}
}
Optional<Boolean> privateAnalyticsFromConfiguration =
maybeGetPrivateAnalyticsFromPackageConfiguration(packageConfiguration);
if (privateAnalyticsFromConfiguration.isPresent()) {
if (!exposureNotificationSharedPreferences.isPrivateAnalyticsStateSet()) {
exposureNotificationSharedPreferences
.setPrivateAnalyticsState(privateAnalyticsFromConfiguration.get());
}
}
}
/**
* Fetches the app analytics state from a {@link PackageConfiguration} if it exists. Otherwise
* false.
*/
private static boolean getAppAnalyticsFromPackageConfiguration(
PackageConfiguration packageConfiguration) {
Bundle values = packageConfiguration.getValues();
if (values != null) {
return values.getBoolean(APP_ANALYTICS_OPT_IN, false);
}
return false;
}
/**
* Fetches the private analytics state from a {@link PackageConfiguration} if it exists. Otherwise
* absent.
*/
private static Optional<Boolean> maybeGetPrivateAnalyticsFromPackageConfiguration(
PackageConfiguration packageConfiguration) {
Bundle values = packageConfiguration.getValues();
if (values == null) {
return Optional.absent();
}
if (!values.containsKey(PRIVATE_ANALYTICS_OPT_IN)) {
return Optional.absent();
}
return Optional.of(values.getBoolean(PRIVATE_ANALYTICS_OPT_IN));
}
/**
* Fetches the checkbox consent from a {@link PackageConfiguration} if it exists. Otherwise
* returns false.
*/
public static boolean getCheckboxConsentFromPackageConfiguration(
@Nullable PackageConfiguration packageConfiguration) {
if (packageConfiguration == null) {
return false;
}
Bundle values = packageConfiguration.getValues();
if (values != null) {
return values.getBoolean(CHECK_BOX_API_KEY, false);
}
return false;
}
}
| [
"noreply@google.com"
] | noreply@google.com |
6d19c36d1728403a1c7424b0853a7e4c99ef9529 | 2fac25248a4dd0184b335b8a4cf52decf06f6262 | /src/main/java/methodchain/Robot.java | ecda7716fa16ac2e136c9cdeb62781e229dfaaec | [] | no_license | Rolderek/training-solutions | a1314a5c147b04531ed5d7909bb33fa85dd2605a | f87b5269e8499f54deb89bcebd4f3b5a765f67e3 | refs/heads/master | 2023-04-14T08:21:59.930872 | 2021-04-28T08:44:49 | 2021-04-28T08:44:49 | 308,072,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package methodchain;
public class Robot {
private int distance;
private int azimut;
public Robot(int distance, int azimut) {
this.distance = distance;
this.azimut = azimut;
}
public Robot go(int meter) {
this.distance = distance;
return this;
}
public Robot rotate(int angle) {
this.azimut = azimut;
return this;
}
public int getDistance() {
return distance;
}
public int getAzimut() {
return azimut;
}
}
| [
"restaslaci@gmail.com"
] | restaslaci@gmail.com |
4a015d581c820c5600c9fc81bbe6c2b98021c4dd | 8cfba22831d151185a41aed383df9989d440e475 | /FMPHuffman/src/huffman/ExternalNode.java | b0342e618ad3e4fc717ae205b6e3e385144d4942 | [] | no_license | filesqueezer/file-squeezer | c20d3a38a2f0debeacce98c3ff201a64dcbd7c6b | bc71a86d455898f52c1838833b0761498c967709 | refs/heads/master | 2021-01-17T05:29:59.497721 | 2015-06-24T08:30:06 | 2015-06-24T08:30:06 | 37,972,258 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,560 | java | package huffman;
import java.util.BitSet;
/**
* External Node class representing external nodes in a huffman tree.
*/
public class ExternalNode extends Node implements Comparable<Object>
{
/**
* Constructor sets the byte value of the node and initialises the Huffman bit pattern.
* @param b byte value.
* @param frequency usually 1, set to 0 in null byte scenario.
*/
public ExternalNode(final Byte b, final int frequency)
{
super(frequency);
this.character = b;
binaryCode = new BinaryCode(new BitSet(EIGHT), 0);
}
/**
* 8.
*/
private static final int EIGHT = 8;
/**
* Byte value.
*/
private Byte character;
/**
* Corresponding Huffman binaryCode.
*/
private BinaryCode binaryCode;
/**
* Getter for character.
* @return character.
*/
public final Byte getCharacter()
{
return character;
}
/**
* Getter for binaryCode.
* @return binaryCode.
*/
public final BinaryCode getBinaryCode()
{
return binaryCode;
}
/**
* Adds one bit to the binaryCode.
* @param bit to add can be 0 or 1.
*/
@Override
public final void addBit(final int bit)
{
for (int i = binaryCode.getLength(); i >= 0; i--)
{
binaryCode.getBitSet().set(i + 1, binaryCode.getBitSet().get(i));
}
if (bit == 1)
{
binaryCode.getBitSet().set(0, true);
}
else
{
binaryCode.getBitSet().set(0, false);
}
binaryCode.increaseLength();
}
}
| [
"filesqueezer@gmail.com"
] | filesqueezer@gmail.com |
fe3d4e5222ca78053ef91ffd55a6edc09378e3a8 | 54127295cf6d2f3fb00de7dc82b1f4868c25b80c | /src/main/java/com/springteam/carrental/model/dto/BranchDTO.java | 0e56e343ab0d0b987201d6882dfff3b0bc78d787 | [] | no_license | GoodValues/CarRental | cf06671399915545ed9215fb262f2450ae41dc81 | 0cf36a26fdf604568d9e3bc3172daec19f906ff3 | refs/heads/master | 2022-12-21T10:31:01.559454 | 2020-09-05T18:52:25 | 2020-09-05T18:52:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package com.springteam.carrental.model.dto;
import lombok.*;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode
public class BranchDTO {
private Long id;
private String address;
private List<EmployeeDTO> employees;
private List<CarDTO> cars;
}
| [
"a.niewiadomski@onet.pl"
] | a.niewiadomski@onet.pl |
85f703bfca92a280dced7c110ae980be39e35f55 | 75a359a289163857564e932e91bcfd03635553f3 | /MongoDemo/src/main/java/FrameWork/Bean/BaseEntity.java | de7f77277b7f8f6bd452ce7057cfb7374b90865c | [] | no_license | hkj141421/StudyDemo | 9f9ffc712836e09e24f044212b97d7ad06a7fbd6 | 0d5cc22562e19a7ea08864e9d1ff78a547e3d9f5 | refs/heads/master | 2022-12-20T12:22:20.814033 | 2020-01-11T04:48:10 | 2020-01-11T05:17:23 | 233,177,130 | 0 | 0 | null | 2022-12-16T05:00:02 | 2020-01-11T04:41:07 | Java | UTF-8 | Java | false | false | 533 | java | package FrameWork.Bean;
import org.springframework.data.annotation.Id;
import java.sql.Timestamp;
/**
* Created by forget on 2019/7/10.
*/
public class BaseEntity {
protected Timestamp createDate;
@Id
protected String id;
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"670378784@qq.com"
] | 670378784@qq.com |
56a639cbe3dbd997b672ec2ab972fdc3cb64a53c | a47c51426b9442290a7ec0e84a53e3061bfbde6c | /protocol/src/main/java/cn/com/ut/protocol/Channel.java | 427b48fd5cdb85f3e930087b0809026c0579d843 | [] | no_license | befiring/BluetoothTest | 1597f0daac8293ce0d0b20c6d5c9270bedd6b45e | c72e2c9494a78c52b0b4fc106202c8f50bbd626f | refs/heads/master | 2020-03-09T15:38:25.552549 | 2018-04-10T02:51:08 | 2018-04-10T02:51:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package cn.com.ut.protocol;
/**
* 通道
* Created by zhangyihuang on 2017/1/19.
*/
public class Channel extends IChannel {
@Override
public boolean open() {
this.getProtocol().setEnabled(true);
if (this.getPort().isConnected())
return true;
else
return this.getPort().open();
}
@Override
public void close() {
this.getPort().close();
this.getProtocol().setEnabled(false);
}
@Override
public boolean isOpen() {
return this.getProtocol().isEnabled() && this.getPort().isConnected();
}
} | [
"huangweiwen@ut.cn"
] | huangweiwen@ut.cn |
003ef8aba4867f6d0c38354afdcfbde5b7e4cce2 | 96010d11a15f21a8306ae4cdc0c7feed312d5311 | /src/main/java/com/lognsys/babycare/vo/StagesVO.java | 756dfdb6a5f2118435c6c094ecfe6eefa8120141 | [] | no_license | doshipriyank/ayurbaby | 061235b4e9d772710fb0e84cecc5e7528e89132c | 73a7cf1537cdcd5ad78055dd3aea7ce13139af96 | refs/heads/master | 2021-01-13T05:25:38.512235 | 2015-09-14T00:43:01 | 2015-09-14T00:43:01 | 81,445,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.lognsys.babycare.vo;
import java.util.Date;
public class StagesVO
{
private int id;
private String month;
private String week;
private Date last_edit;
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
public String getMonth()
{
return month;
}
public void setMonth(String month)
{
this.month = month;
}
public String getWeek()
{
return week;
}
public void setWeek(String week)
{
this.week = week;
}
public Date getLast_edit()
{
return last_edit;
}
public void setLast_edit(Date last_edit)
{
this.last_edit = last_edit;
}
}
| [
"doshi.priyank@gmail.com"
] | doshi.priyank@gmail.com |
bad87aaaae9078aef235ef9fb30cf2fb56e1d532 | a7a23391f897606c492d11af44e697b851a8364f | /goci-tools/goci-pubmedimport/src/main/java/uk/ac/ebi/spot/goci/PubmedImportDriver.java | 6e550ca1f0e97da0c80e79ae1a63a0416e229e28 | [] | no_license | joannellam/goci | 4914e5dd7310e1d394de91ce3f5ca0b056c43279 | 656acb4ff00f79eb88b00ed9d2e96a2cb9dc8f2f | refs/heads/2.x-dev | 2021-01-18T08:28:55.153338 | 2015-03-16T10:21:05 | 2015-03-16T10:21:05 | 32,320,560 | 0 | 0 | null | 2015-03-16T11:32:18 | 2015-03-16T11:32:18 | null | UTF-8 | Java | false | false | 1,959 | java | package uk.ac.ebi.spot.goci;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import uk.ac.ebi.spot.goci.exception.DispatcherException;
import uk.ac.ebi.spot.goci.lang.ImporterProperties;
import uk.ac.ebi.spot.goci.service.GwasPubmedImporter;
public class PubmedImportDriver {
private Logger log = LoggerFactory.getLogger(getClass());
protected Logger getLog() {
return log;
}
/*For Coldfusion integration, we don't need a main method*/
private GwasPubmedImporter importer;
public PubmedImportDriver(String PMID, String table){
getLog().debug("PubmedImportDriver initialised");
ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath*:pubmedimport.xml");
importer = ctx.getBean("searcher", GwasPubmedImporter.class);
getLog().info("The study " + PMID + " is to be added to table " + table);
ImporterProperties.setOutputTable(table);
// launchImporter(PMID);
}
// public void launchImporter(String PMID){
// try{
// getLog().debug("Dispatching the importer");
// importer.dispatchSearch(PMID);
// getLog().info("Import finished");
// }
//
// catch (DispatcherException e) {
// e.printStackTrace();
//
// }
// }
public String launchImporter(String PMID){
PMID = PMID.trim();
String output = null;
try{
getLog().debug("Dispatching the importer");
output = importer.dispatchSearch(PMID);
getLog().info("Import finished");
}
catch (DispatcherException e) {
e.printStackTrace();
}
if(output == null){
output = "Oh dear, something went wrong. Please contact your system admin.";
}
return output;
}
}
| [
"dwelter@ebi.ac.uk"
] | dwelter@ebi.ac.uk |
0f4d0937f135ae47d60f9d93ed1a55d9c5e3cf52 | 3e48cec4fcd759da71f615e69e8f8b08dd6c2e79 | /iot-admin3/src/main/java/net/work100/training/stage2/iot/admin/commons/utils/CookieUtils.java | c5709002fb9ea220621362fa17933d32cfff66e2 | [] | no_license | work100-net/training-stage2 | 615bb464b6d3993a3e0367fc34285f0983e9d62d | f130f9077f83d5a2829202549f7581d64412d8d8 | refs/heads/master | 2022-12-22T08:59:46.026883 | 2021-11-29T04:32:55 | 2021-11-29T04:32:55 | 238,898,365 | 3 | 6 | null | 2022-12-16T15:25:32 | 2020-02-07T10:37:15 | JavaScript | UTF-8 | Java | false | false | 9,796 | java | package net.work100.training.stage2.iot.admin.commons.utils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* <p>Title: CookieUtils</p>
* <p>Description: </p>
* <p>Url: http://www.work100.net/training/monolithic-frameworks-spring-mvc.html</p>
*
* @author liuxiaojun
* @date 2020-02-15 11:36
* ------------------- History -------------------
* <date> <author> <desc>
* 2020-02-15 liuxiaojun 初始创建
* -----------------------------------------------
*/
public final class CookieUtils {
/**
* 得到Cookie的值(不解码)
*
* @param request 请求
* @param cookieName Cookie名称
* @return
*/
public static String getCookieValue(HttpServletRequest request, String cookieName) {
return getCookieValue(request, cookieName, false);
}
/**
* 得到Cookie的值
*
* @param request 请求
* @param cookieName Cookie名称
* @param isDecoder 是否解码
* @return
*/
public static String getCookieValue(HttpServletRequest request, String cookieName, boolean isDecoder) {
Cookie[] cookieList = request.getCookies();
if (cookieList == null || cookieName == null) {
return null;
}
String retValue = null;
try {
for (int i = 0; i < cookieList.length; i++) {
if (cookieList[i].getName().equals(cookieName)) {
if (isDecoder) {
retValue = URLDecoder.decode(cookieList[i].getValue(), "UTF-8");
} else {
retValue = cookieList[i].getValue();
}
break;
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return retValue;
}
/**
* 得到Cookie的值
*
* @param request 请求
* @param cookieName Cookie名称
* @param encodeString 编码格式
* @return
*/
public static String getCookieValue(HttpServletRequest request, String cookieName, String encodeString) {
Cookie[] cookieList = request.getCookies();
if (cookieList == null || cookieName == null) {
return null;
}
String retValue = null;
try {
for (int i = 0; i < cookieList.length; i++) {
if (cookieList[i].getName().equals(cookieName)) {
retValue = URLDecoder.decode(cookieList[i].getValue(), encodeString);
break;
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return retValue;
}
/**
* 设置Cookie的值 不设置生效时间默认浏览器关闭即失效,也不编码
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
*/
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue) {
setCookie(request, response, cookieName, cookieValue, -1);
}
/**
* 设置Cookie的值 在指定时间内生效,但不编码
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param cookieMaxAge cookie生效的最大秒数
*/
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxAge) {
setCookie(request, response, cookieName, cookieValue, cookieMaxAge, false);
}
/**
* 设置Cookie的值 不设置生效时间
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param isEncode 是否编码
*/
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, boolean isEncode) {
setCookie(request, response, cookieName, cookieValue, -1, isEncode);
}
/**
* 设置Cookie的值 在指定时间内生效, 编码参数
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param cookieMaxAge cookie生效的最大秒数
* @param isEncode 是否编码
*/
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxAge, boolean isEncode) {
doSetCookie(request, response, cookieName, cookieValue, cookieMaxAge, isEncode);
}
/**
* 设置Cookie的值 在指定时间内生效, 编码参数(指定编码)
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param cookieMaxAge cookie生效的最大秒数
* @param encodeString 编码格式
*/
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxAge, String encodeString) {
doSetCookie(request, response, cookieName, cookieValue, cookieMaxAge, encodeString);
}
/**
* 删除Cookie带cookie域名
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
*/
public static void deleteCookie(HttpServletRequest request, HttpServletResponse response, String cookieName) {
doSetCookie(request, response, cookieName, "", -1, false);
}
/**
* 设置Cookie的值,并使其在指定时间内生效
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param cookieMaxAge cookie生效的最大秒数
* @param isEncode 是否编码
*/
private static final void doSetCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxAge, boolean isEncode) {
try {
if (cookieValue == null) {
cookieValue = "";
} else if (isEncode) {
cookieValue = URLEncoder.encode(cookieValue, "utf-8");
}
Cookie cookie = new Cookie(cookieName, cookieValue);
if (cookieMaxAge > 0) {
cookie.setMaxAge(cookieMaxAge);
}
if (null != request) {
// 设置域名的cookie
String domainName = getDomainName(request);
if (!"localhost".equals(domainName)) {
cookie.setDomain(domainName);
}
}
cookie.setPath("/");
response.addCookie(cookie);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 设置Cookie的值,并使其在指定时间内生效
*
* @param request 请求
* @param response 响应
* @param cookieName Cookie名称
* @param cookieValue Cookie值
* @param cookieMaxAge cookie生效的最大秒数
* @param encodeString 编码格式
*/
private static final void doSetCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxAge, String encodeString) {
try {
if (cookieValue == null) {
cookieValue = "";
} else {
cookieValue = URLEncoder.encode(cookieValue, encodeString);
}
Cookie cookie = new Cookie(cookieName, cookieValue);
if (cookieMaxAge > 0)
cookie.setMaxAge(cookieMaxAge);
if (null != request) {
// 设置域名的cookie
String domainName = getDomainName(request);
if (!"localhost".equals(domainName)) {
cookie.setDomain(domainName);
}
}
cookie.setPath("/");
response.addCookie(cookie);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 得到cookie的域名
*
* @param request 请求
* @return
*/
private static final String getDomainName(HttpServletRequest request) {
String domainName = null;
String serverName = request.getRequestURL().toString();
if (serverName == null || serverName.equals("")) {
domainName = "";
} else {
serverName = serverName.toLowerCase();
serverName = serverName.substring(7);
final int end = serverName.indexOf("/");
serverName = serverName.substring(0, end);
final String[] domains = serverName.split("\\.");
int len = domains.length;
if (len > 3) {
// www.xxx.com.cn
domainName = "." + domains[len - 3] + "." + domains[len - 2] + "." + domains[len - 1];
} else if (len <= 3 && len > 1) {
// xxx.com or xxx.cn
domainName = "." + domains[len - 2] + "." + domains[len - 1];
} else {
domainName = serverName;
}
}
if (domainName != null && domainName.indexOf(":") > 0) {
String[] ary = domainName.split("\\:");
domainName = ary[0];
}
return domainName;
}
}
| [
"xiaojun.liu@work100.net"
] | xiaojun.liu@work100.net |
d752ffcddd3719456731bb0b2d9c9d34c4400f90 | ce42941372f2af26b0d408e4d4fef468061fa1ca | /endpoint-libs/libtictactoe-v1/tictactoe/tictactoe-v1-generated-source/com/google/api/services/tictactoe/Tictactoe.java | 076a14601c481715e88de1e0c6ce13cbc9e8f6d8 | [] | no_license | palladius/tictactoe-codelab | b3ea7442619e2bee765a7a45d6a6eb0ad05d9f0b | dad77ba128225daf8421ded82ff78e0831e781c6 | refs/heads/master | 2021-01-19T07:46:10.497025 | 2013-10-15T07:45:34 | 2013-10-15T07:46:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,373 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This file was generated.
* with google-apis-code-generator 1.2.0 (build: 2012-11-27 16:02:30 UTC)
* on 2012-12-04 at 00:39:55 UTC
*/
package com.google.api.services.tictactoe;
import com.google.api.client.googleapis.GoogleUtils;
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest;
import com.google.api.client.googleapis.services.GoogleClientRequestInitializer;
import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.common.base.Preconditions;
/**
* Service definition for Tictactoe (v1).
*
* <p>
* This is an API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="" target="_blank">API Documentation</a>
* </p>
*
* <p>
* This service uses {@link TictactoeRequestInitializer} to initialize global parameters via its
* {@link Builder}.
* </p>
*
* <p>
* Upgrade warning: this class now extends {@link AbstractGoogleJsonClient}, whereas in prior
* version 1.8 it extended {@link com.google.api.client.googleapis.services.GoogleClient}.
* </p>
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class Tictactoe extends AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
Preconditions.checkState(GoogleUtils.VERSION.equals("1.12.0-beta"),
"You are currently running with version %s of google-api-client. " +
"You need version 1.12.0-beta of google-api-client to run version " +
"1.12.0-beta of the library.", GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://tictactoe-java.appspot.com/_ah/api/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "tictactoe/v1/";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
* @deprecated (scheduled to be removed in 1.13)
*/
@Deprecated
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
* <p>
* Use {@link Builder} if you need to specify any of the optional parameters.
* </p>
*
* @param transport HTTP transport
* @param jsonFactory JSON factory
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Tictactoe(HttpTransport transport, JsonFactory jsonFactory,
HttpRequestInitializer httpRequestInitializer) {
super(transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
}
/**
* @param transport HTTP transport
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @param rootUrl root URL of the service
* @param servicePath service path
* @param jsonObjectParser JSON object parser
* @param googleClientRequestInitializer Google request initializer or {@code null} for none
* @param applicationName application name to be sent in the User-Agent header of requests or
* {@code null} for none
* @param suppressPatternChecks whether discovery pattern checks should be suppressed on required
* parameters
*/
Tictactoe(HttpTransport transport,
HttpRequestInitializer httpRequestInitializer,
String rootUrl,
String servicePath,
JsonObjectParser jsonObjectParser,
GoogleClientRequestInitializer googleClientRequestInitializer,
String applicationName,
boolean suppressPatternChecks) {
super(transport,
httpRequestInitializer,
rootUrl,
servicePath,
jsonObjectParser,
googleClientRequestInitializer,
applicationName,
suppressPatternChecks);
}
@Override
protected void initialize(AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* An accessor for creating requests from the Board collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code Tictactoe tictactoe = new Tictactoe(...);}
* {@code Tictactoe.Board.List request = tictactoe.board().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Board board() {
return new Board();
}
/**
* The "board" collection of methods.
*/
public class Board {
/**
* Create a request for the method "board.getmove".
*
* This request holds the parameters needed by the the tictactoe server. After setting any optional
* parameters, call the {@link Getmove#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.tictactoe.model.Board}
* @return the request
*/
public Getmove getmove(com.google.api.services.tictactoe.model.Board content) throws java.io.IOException {
Getmove result = new Getmove(content);
initialize(result);
return result;
}
public class Getmove extends TictactoeRequest<com.google.api.services.tictactoe.model.Board> {
private static final String REST_PATH = "board";
Getmove(com.google.api.services.tictactoe.model.Board content) {
super(Tictactoe.this, "POST", REST_PATH, content, com.google.api.services.tictactoe.model.Board.class);
}
@Override
public Getmove setAlt(String alt) {
return (Getmove) super.setAlt(alt);
}
@Override
public Getmove setFields(String fields) {
return (Getmove) super.setFields(fields);
}
@Override
public Getmove setKey(String key) {
return (Getmove) super.setKey(key);
}
@Override
public Getmove setOauthToken(String oauthToken) {
return (Getmove) super.setOauthToken(oauthToken);
}
@Override
public Getmove setPrettyPrint(Boolean prettyPrint) {
return (Getmove) super.setPrettyPrint(prettyPrint);
}
@Override
public Getmove setQuotaUser(String quotaUser) {
return (Getmove) super.setQuotaUser(quotaUser);
}
@Override
public Getmove setUserIp(String userIp) {
return (Getmove) super.setUserIp(userIp);
}
}
}
/**
* An accessor for creating requests from the Scores collection.
*
* <p>The typical use is:</p>
* <pre>
* {@code Tictactoe tictactoe = new Tictactoe(...);}
* {@code Tictactoe.Scores.List request = tictactoe.scores().list(parameters ...)}
* </pre>
*
* @return the resource collection
*/
public Scores scores() {
return new Scores();
}
/**
* The "scores" collection of methods.
*/
public class Scores {
/**
* Create a request for the method "scores.get".
*
* This request holds the parameters needed by the the tictactoe server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param key
* @return the request
*/
public Get get(String key) throws java.io.IOException {
Get result = new Get(key);
initialize(result);
return result;
}
public class Get extends TictactoeRequest<com.google.api.services.tictactoe.model.Score> {
private static final String REST_PATH = "score/{key}";
Get(String key) {
super(Tictactoe.this, "GET", REST_PATH, null, com.google.api.services.tictactoe.model.Score.class);
this.key = Preconditions.checkNotNull(key, "Required parameter key must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get setAlt(String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setFields(String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUserIp(String userIp) {
return (Get) super.setUserIp(userIp);
}
@com.google.api.client.util.Key
private String key;
/**
*/
public String getKey() {
return key;
}
public Get setKey(String key) {
this.key = key;
return this;
}
}
/**
* Create a request for the method "scores.insert".
*
* This request holds the parameters needed by the the tictactoe server. After setting any optional
* parameters, call the {@link Insert#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.tictactoe.model.Score}
* @return the request
*/
public Insert insert(com.google.api.services.tictactoe.model.Score content) throws java.io.IOException {
Insert result = new Insert(content);
initialize(result);
return result;
}
public class Insert extends TictactoeRequest<com.google.api.services.tictactoe.model.Score> {
private static final String REST_PATH = "score";
Insert(com.google.api.services.tictactoe.model.Score content) {
super(Tictactoe.this, "POST", REST_PATH, content, com.google.api.services.tictactoe.model.Score.class);
}
@Override
public Insert setAlt(String alt) {
return (Insert) super.setAlt(alt);
}
@Override
public Insert setFields(String fields) {
return (Insert) super.setFields(fields);
}
@Override
public Insert setKey(String key) {
return (Insert) super.setKey(key);
}
@Override
public Insert setOauthToken(String oauthToken) {
return (Insert) super.setOauthToken(oauthToken);
}
@Override
public Insert setPrettyPrint(Boolean prettyPrint) {
return (Insert) super.setPrettyPrint(prettyPrint);
}
@Override
public Insert setQuotaUser(String quotaUser) {
return (Insert) super.setQuotaUser(quotaUser);
}
@Override
public Insert setUserIp(String userIp) {
return (Insert) super.setUserIp(userIp);
}
}
/**
* Create a request for the method "scores.list".
*
* This request holds the parameters needed by the the tictactoe server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @return the request
*/
public List list() throws java.io.IOException {
List result = new List();
initialize(result);
return result;
}
public class List extends TictactoeRequest<com.google.api.services.tictactoe.model.ScoreCollection> {
private static final String REST_PATH = "score";
List() {
super(Tictactoe.this, "GET", REST_PATH, null, com.google.api.services.tictactoe.model.ScoreCollection.class);
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List setAlt(String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setFields(String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUserIp(String userIp) {
return (List) super.setUserIp(userIp);
}
}
}
/**
* Builder for {@link Tictactoe}.
*
* <p>
* Implementation is not thread-safe.
* </p>
*
* @since 1.3.0
*/
public static final class Builder extends AbstractGoogleJsonClient.Builder {
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport
* @param jsonFactory JSON factory
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(HttpTransport transport, JsonFactory jsonFactory,
HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
}
/** Builds a new instance of {@link Tictactoe}. */
@Override
public Tictactoe build() {
return new Tictactoe(getTransport(),
getHttpRequestInitializer(),
getRootUrl(),
getServicePath(),
getObjectParser(),
getGoogleClientRequestInitializer(),
getApplicationName(),
getSuppressPatternChecks());
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
/**
* Set the {@link TictactoeRequestInitializer}.
*
* @since 1.12
*/
public Builder setTictactoeRequestInitializer(
TictactoeRequestInitializer tictactoeRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(tictactoeRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}
| [
"palladiusbonton+git@gmail.com"
] | palladiusbonton+git@gmail.com |
18e29dddcc08b207eeae78c1c10fedcc54fbbf42 | e2ea75cb268a3d212ad5e227fc4d5542cadf6af5 | /app/src/main/java/com/doglegs/baseproject/widget/dialog/ConfirmDialog.java | 2f868158ebe6d0356d8a7cd18ae085ea02b892ac | [] | no_license | WeAreDoglegs/BaseProject | 10bd3a00edd47f20d4c0b9cc0c4adc25fc5efa80 | 204706a747cf9d8646e8b23623165175bd126e73 | refs/heads/master | 2020-04-08T02:02:21.180445 | 2019-02-19T03:58:25 | 2019-02-19T03:58:25 | 158,920,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,556 | java | package com.doglegs.baseproject.widget.dialog;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.doglegs.baseproject.R;
import com.doglegs.core.utils.ScreenUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class ConfirmDialog extends Dialog {
@BindView(R.id.tv_dialog_title)
TextView tvDialogTitle;
@BindView(R.id.tv_cancel)
TextView tvCancel;
@BindView(R.id.tv_confirm)
TextView tvConfirm;
private OnDialogListener onDialogListener;
public ConfirmDialog(@NonNull Context context) {
this(context, R.style.BaseDialog);
}
public ConfirmDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
initDialog();
}
private void initDialog() {
View contentView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_confirm, null);
ButterKnife.bind(this, contentView);
setContentView(contentView);
ViewGroup.LayoutParams layoutParams = contentView.getLayoutParams();
layoutParams.width = (int) (ScreenUtils.getScreenWidth() * 0.8);
contentView.setLayoutParams(layoutParams);
getWindow().setGravity(Gravity.CENTER);
setCanceledOnTouchOutside(false);
}
@OnClick({R.id.tv_cancel, R.id.tv_confirm})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_cancel:
dismiss();
break;
case R.id.tv_confirm:
if (onDialogListener != null) {
onDialogListener.onConfirmClickListener();
}
break;
}
}
public void setTitle(String title) {
tvDialogTitle.setText(title);
}
public void setTitle(CharSequence title) {
tvDialogTitle.setText(title);
}
public void setConfirmText(String text) {
tvConfirm.setText(text);
}
public void setCancelText(String text) {
tvCancel.setText(text);
}
public void setTitleFontSize(int size) {
tvDialogTitle.setTextSize(size);
}
public interface OnDialogListener {
void onConfirmClickListener();
}
public void setOnDialogListener(OnDialogListener onDialogListener) {
this.onDialogListener = onDialogListener;
}
}
| [
"wujiaxin@51yryc.com"
] | wujiaxin@51yryc.com |
1bf561bd0a52dbe4d68583ee84dbd997293b67a0 | 57096aed07ad95b9c5d4c488d9aeeea4a41ec949 | /app/src/main/java/com/example/isaac/timeline/FriendsFragment.java | 87bdab65557368be3d22b4e4f9d9e307e60d3ba0 | [] | no_license | isilvious/TimelineApp | 75cc75e8cb8987e2dc91029fafe83c8cccda691d | 9a1bd771ea400f763b720da680c209e362f3fa9b | refs/heads/master | 2020-03-19T05:56:13.697591 | 2018-06-04T05:55:30 | 2018-06-04T05:55:30 | 135,976,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package com.example.isaac.timeline;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
*/
public class FriendsFragment extends Fragment {
public FriendsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_friends, container, false);
}
}
| [
"isilvious@eagles.bridgewater.edu"
] | isilvious@eagles.bridgewater.edu |
afadf0625cc57118539582d1c053ece8c12d4345 | 5e2a08926d704ac65426b804522477484d9df0fa | /src/main/java/ru/sgt/crm/security/SecurityUtils.java | 8a21e9a3d65fd012192a530629fb6daa221af8ee | [
"Unlicense"
] | permissive | Sgt1503/Kursach-final | 8011fac1fd7c7d71036d6a2df651c30d566e7ccb | 8e4c7e804b6da3a1dc8db15f41fab33dceb5e67c | refs/heads/master | 2023-03-30T19:43:02.074398 | 2021-03-31T21:56:41 | 2021-03-31T21:56:41 | 353,500,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,175 | java | package ru.sgt.crm.security;
import com.vaadin.flow.server.HandlerHelper.RequestType;
import com.vaadin.flow.shared.ApplicationConstants;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import javax.servlet.http.HttpServletRequest;
import java.util.stream.Stream;
public final class SecurityUtils {
private SecurityUtils() {
// Util methods only
}
static boolean isFrameworkInternalRequest(HttpServletRequest request) {
final String parameterValue = request.getParameter(ApplicationConstants.REQUEST_TYPE_PARAMETER);
return parameterValue != null
&& Stream.of(RequestType.values())
.anyMatch(r -> r.getIdentifier().equals(parameterValue));
}
static boolean isUserLoggedIn() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return authentication != null
&& !(authentication instanceof AnonymousAuthenticationToken)
&& authentication.isAuthenticated();
}
} | [
"sgt15032000@yandex.ru"
] | sgt15032000@yandex.ru |
69f09b5eb7e3099b3813d2554eac622abf24a91a | 6e1e4ee7eebc1b8dbd7ae43cf7b41c049b033946 | /src/main/java/com/nideas/api/userservice/data/dto/auth/JwtPayLoad.java | cd4789ba2d4238043abb42e40cb1f83a81806c16 | [] | no_license | n-ideas/nideas-api-user-service | 58eda1163a0334f36110a3d1f7f06871089d2ed2 | aa94e5663fd47b769fa1dc1332ec0dfe94175637 | refs/heads/master | 2020-04-19T08:58:44.978268 | 2019-01-30T06:17:46 | 2019-01-30T06:17:46 | 168,095,851 | 0 | 0 | null | 2019-01-30T06:17:50 | 2019-01-29T05:37:08 | Java | UTF-8 | Java | false | false | 382 | java | package com.nideas.api.userservice.data.dto.auth;
import com.nideas.api.userservice.enumeration.UserRole;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/** Created by Nanugonda on 9/5/2018. */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class JwtPayLoad {
private long id;
private String email;
private UserRole userRole;
}
| [
"bhanodhay.nanugonda@gmail.com"
] | bhanodhay.nanugonda@gmail.com |
4b5559e68d4fa94ebd561560f77b33be0d892770 | 41870f11643d170485c846ea12666aac88ba446c | /QuandlFetchService/src/main/java/app/util/TickerErrors.java | f32e78cdd21d40819bc971ce42a4c15695d72b88 | [] | no_license | shubham1chawla/TickerGenie | e7d870ae1a3ad071c51d81d6efc5684adf31f8dd | e6e928788bdbd9f60933f169e88dfcc8daf05b32 | refs/heads/master | 2020-05-02T15:25:09.422915 | 2019-04-02T18:18:38 | 2019-04-02T18:18:38 | 178,040,721 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | package app.util;
import com.fasterxml.jackson.annotation.JsonFormat;
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TickerErrors {
UNEXPECTED_EXCEPTION(1000, "Unknown error occured, Please contact Support."),
RESPONSE_EXCEPTION(1001, "Error occured while fetching information from Quandl Servers."),
DATE_PARSE_ERROR(1002, "Error parsing date while creating Ticker Info DTO."),
EMPTY_CODE_ERROR(1003, "Code not passed while fetching the data."),
QUANDL_SERVICE_UNAVAILABLE(1004, "Quandl Service is unavailable, Please contact Support.");
private Integer code;
private String message;
private TickerErrors(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| [
"shubham_chawla@live.com"
] | shubham_chawla@live.com |
7bd5f8232216b3d7cf00c1e1d099311028f0b8d1 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_c2eb8c1134d2d336eb7b57fcc58e23e3c7e693a8/MainActivity/12_c2eb8c1134d2d336eb7b57fcc58e23e3c7e693a8_MainActivity_t.java | 325f059d34085f6b72aed231d9d399506c37317f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 10,299 | java | package teaonly.droideye;
import teaonly.droideye.*;
import java.io.IOException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.lang.System;
import java.lang.Thread;
import java.util.*;
import java.net.*;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.res.Resources;
import android.content.res.AssetManager;
import android.content.res.AssetFileDescriptor;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.hardware.Camera.PictureCallback;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ImageFormat;
import android.graphics.Rect;
import android.graphics.Paint;
import android.graphics.YuvImage;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.text.format.Formatter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.MotionEvent;
import android.view.Window;
import android.view.WindowManager;
import android.view.SurfaceView;
import android.util.Log;
import android.widget.ImageButton;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity
implements View.OnTouchListener, CameraView.CameraReadyCallback, OverlayView.UpdateDoneCallback{
private static final String TAG = "TEAONLY";
boolean inProcessing = false;
final int maxVideoNumber = 2;
VideoFrame[] videoFrames = new VideoFrame[maxVideoNumber];
byte[] preFrame = new byte[1024*1024*8];
TeaServer webServer = null;
private CameraView cameraView_;
private OverlayView overlayView_;
private Button btnExit;
private TextView tvMessage;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//NativeAPI.LoadLibraries();
requestWindowFeature(Window.FEATURE_NO_TITLE);
Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
//win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
btnExit = (Button)findViewById(R.id.btn_exit);
btnExit.setOnClickListener(exitAction);
tvMessage = (TextView)findViewById(R.id.tv_message);
for(int i = 0; i < maxVideoNumber; i++) {
videoFrames[i] = new VideoFrame(1024*1024*4);
}
initCamera();
}
@Override
public void onCameraReady() {
if ( initWebServer() ) {
int wid = cameraView_.Width();
int hei = cameraView_.Height();
cameraView_.StopPreview();
cameraView_.setupCamera(wid, hei, previewCb_);
cameraView_.StartPreview();
}
}
@Override
public void onUpdateDone() {
}
@Override
public void onDestroy(){
super.onDestroy();
}
@Override
public void onStart(){
super.onStart();
}
@Override
public void onResume(){
super.onResume();
}
@Override
public void onPause(){
super.onPause();
inProcessing = true;
webServer.stop();
cameraView_.StopPreview();
//cameraView_.Release();
System.exit(0);
//finish();
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
public boolean onTouch(View v, MotionEvent evt) {
return false;
}
private void initCamera() {
SurfaceView cameraSurface = (SurfaceView)findViewById(R.id.surface_camera);
cameraView_ = new CameraView(cameraSurface);
cameraView_.setCameraReadyCallback(this);
overlayView_ = (OverlayView)findViewById(R.id.surface_overlay);
overlayView_.setOnTouchListener(this);
overlayView_.setUpdateDoneCallback(this);
}
public String getLocalIpAddress() {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress() && !inetAddress.isLinkLocalAddress() && inetAddress.isSiteLocalAddress() ) {
String ipAddr = inetAddress.getHostAddress();
return ipAddr;
}
}
}
} catch (SocketException ex) {
Log.d(TAG, ex.toString());
}
return null;
}
private boolean initWebServer() {
String ipAddr = getLocalIpAddress();
if ( ipAddr != null ) {
try{
webServer = new TeaServer(8080, this);
webServer.registerCGI("/cgi/query", doQuery);
webServer.registerCGI("/cgi/setup", doSetup);
webServer.registerCGI("/stream/live.jpg", doCapture);
}catch (IOException e){
webServer = null;
}
}
if ( webServer != null) {
tvMessage.setText( getString(R.string.msg_access) + " http://" + ipAddr + ":8080" );
return true;
} else {
tvMessage.setText( getString(R.string.msg_error) );
return false;
}
}
private OnClickListener exitAction = new OnClickListener() {
@Override
public void onClick(View v) {
onPause();
}
};
private PreviewCallback previewCb_ = new PreviewCallback() {
public void onPreviewFrame(byte[] frame, Camera c) {
if ( !inProcessing ) {
inProcessing = true;
int picWidth = cameraView_.Width();
int picHeight = cameraView_.Height();
ByteBuffer bbuffer = ByteBuffer.wrap(frame);
bbuffer.get(preFrame, 0, picWidth*picHeight + picWidth*picHeight/2);
inProcessing = false;
}
}
};
private TeaServer.CommonGatewayInterface doQuery = new TeaServer.CommonGatewayInterface () {
@Override
public String run(Properties parms) {
String ret = "";
List<Camera.Size> supportSize = cameraView_.getSupportedPreviewSize();
ret = ret + "" + cameraView_.Width() + "x" + cameraView_.Height() + "|";
for(int i = 0; i < supportSize.size() - 1; i++) {
ret = ret + "" + supportSize.get(i).width + "x" + supportSize.get(i).height + "|";
}
int i = supportSize.size() - 1;
ret = ret + "" + supportSize.get(i).width + "x" + supportSize.get(i).height ;
return ret;
}
@Override
public InputStream streaming(Properties parms) {
return null;
}
};
private TeaServer.CommonGatewayInterface doSetup = new TeaServer.CommonGatewayInterface () {
@Override
public String run(Properties parms) {
int wid = Integer.parseInt(parms.getProperty("wid"));
int hei = Integer.parseInt(parms.getProperty("hei"));
Log.d("TEAONLY", ">>>>>>>run in doSetup wid = " + wid + " hei=" + hei);
cameraView_.StopPreview();
cameraView_.setupCamera(wid, hei, previewCb_);
cameraView_.StartPreview();
return "OK";
}
@Override
public InputStream streaming(Properties parms) {
return null;
}
};
private TeaServer.CommonGatewayInterface doCapture = new TeaServer.CommonGatewayInterface () {
@Override
public String run(Properties parms) {
return null;
}
@Override
public InputStream streaming(Properties parms) {
VideoFrame targetFrame = null;
for(int i = 0; i < maxVideoNumber; i++) {
if ( videoFrames[i].acquire() ) {
targetFrame = videoFrames[i];
}
}
// return 503 internal error
if ( targetFrame == null) {
Log.d("TEAONLY", "No free videoFrame found!");
return null;
}
// compress yuv to jpeg
int picWidth = cameraView_.Width();
int picHeight = cameraView_.Height();
YuvImage newImage = new YuvImage(preFrame, ImageFormat.NV21, picWidth, picHeight, null);
targetFrame.reset();
boolean ret;
inProcessing = true;
try{
ret = newImage.compressToJpeg( new Rect(0,0,picWidth,picHeight), 30, targetFrame);
}catch (Exception ex) {
ret = false;
}
inProcessing = false;
// compress success, return ok
if ( ret == true) {
parms.setProperty("mime", "image/jpeg");
InputStream ins = targetFrame.getInputStream();
return ins;
}
// send 503 error
targetFrame.release();
return null;
}
};
private class AnalyseThread extends Thread {
@Override
public void run() {
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
6a7d739a1c75c1614a16f901cbec5c9d26b717f6 | 4d6f449339b36b8d4c25d8772212bf6cd339f087 | /netreflected/src/Framework/Microsoft.Build.Framework,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a/microsoft/build/framework/INodeLogger.java | 24461c183743a316d0fa959c56617bff303f530b | [
"MIT"
] | permissive | lvyitian/JCOReflector | 299a64550394db3e663567efc6e1996754f6946e | 7e420dca504090b817c2fe208e4649804df1c3e1 | refs/heads/master | 2022-12-07T21:13:06.208025 | 2020-08-28T09:49:29 | 2020-08-28T09:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,931 | java | /*
* MIT License
*
* Copyright (c) 2020 MASES s.r.l.
*
* 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.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package microsoft.build.framework;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
// Import section
import microsoft.build.framework.ILogger;
import microsoft.build.framework.ILoggerImplementation;
import microsoft.build.framework.IEventSource;
import microsoft.build.framework.IEventSourceImplementation;
import microsoft.build.framework.LoggerVerbosity;
/**
* The base .NET class managing Microsoft.Build.Framework.INodeLogger, Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Implements {@link IJCOBridgeReflected}.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/Microsoft.Build.Framework.INodeLogger" target="_top">https://docs.microsoft.com/en-us/dotnet/api/Microsoft.Build.Framework.INodeLogger</a>
*/
public interface INodeLogger extends IJCOBridgeReflected, ILogger {
/**
* Fully assembly qualified name: Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
*/
public static final String assemblyFullName = "Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/**
* Assembly name: Microsoft.Build.Framework
*/
public static final String assemblyShortName = "Microsoft.Build.Framework";
/**
* Qualified class name: Microsoft.Build.Framework.INodeLogger
*/
public static final String className = "Microsoft.Build.Framework.INodeLogger";
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link INodeLogger}, a cast assert is made to check if types are compatible.
*/
public static INodeLogger ToINodeLogger(IJCOBridgeReflected from) throws Throwable {
JCOBridge bridge = JCOBridgeInstance.getInstance("Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
JCType classType = bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
NetType.AssertCast(classType, from);
return new INodeLoggerImplementation(from.getJCOInstance());
}
/**
* Returns the reflected Assembly name
*
* @return A {@link String} representing the Fullname of reflected Assembly
*/
public String getJCOAssemblyName();
/**
* Returns the reflected Class name
*
* @return A {@link String} representing the Fullname of reflected Class
*/
public String getJCOClassName();
/**
* Returns the reflected Class name used to build the object
*
* @return A {@link String} representing the name used to allocated the object
* in CLR context
*/
public String getJCOObjectName();
/**
* Returns the instantiated class
*
* @return An {@link Object} representing the instance of the instantiated Class
*/
public Object getJCOInstance();
/**
* Returns the instantiated class Type
*
* @return A {@link JCType} representing the Type of the instantiated Class
*/
public JCType getJCOType();
// Methods section
public void Initialize(IEventSource eventSource, int nodeCount) throws Throwable;
// Properties section
// Instance Events section
} | [
"mario.mastrodicasa@masesgroup.com"
] | mario.mastrodicasa@masesgroup.com |
d456e1375c52f7c7e5def8b54723faf5d1432714 | e73bd7bbae7ea4c75681f1fb03ca3e1851811cf2 | /entando-components-enterprise/plugins/entando-plugin-jppentaho/src/test/java/com/agiletec/plugins/jppentaho/apsadmin/JpPentahoApsAdminBaseTestCase.java | 1e7d39b9f203aa841d1e31601cd9ec8bb59fd62c | [] | no_license | pietrangelo/entando-base-image-4.3.2 | b4f3ee6bb98e5b3b651fdddf0803b88c5132af55 | d8014859a2c0e8808efb34867e87d3c34764fe2c | refs/heads/master | 2021-07-21T12:02:21.780905 | 2017-11-02T11:13:40 | 2017-11-02T11:13:40 | 109,249,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | java | /*
*
* Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved.
*
* This file is part of Entando Enterprise Edition software.
* You can redistribute it and/or modify it
* under the terms of the Entando's EULA
*
* See the file License for the specific language governing permissions
* and limitations under the License
*
*
*
* Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved.
*
*/
package com.agiletec.plugins.jppentaho.apsadmin;
import com.agiletec.ConfigTestUtils;
import com.agiletec.apsadmin.ApsAdminBaseTestCase;
import com.agiletec.plugins.jppentaho.PluginConfigTestUtils;
public class JpPentahoApsAdminBaseTestCase extends ApsAdminBaseTestCase {
@Override
protected ConfigTestUtils getConfigUtils() {
return new PluginConfigTestUtils();
}
} | [
"p.masala@entando.com"
] | p.masala@entando.com |
a0afde950244a064f70ec929c1e425e7efd6c495 | 0f2e99ff1a68198d220aec0ab847265848cd892a | /RMIprintserver/src/rmiprintserver/ConfigManager.java | f3029a6cbd8cc2bc9a056ad6fe6c05d2c4633c7a | [] | no_license | NikolaPeevski/ds_authentication | 6e3bac499fb3e72ce027c3d79ef0e1a555f869d7 | 41f1617663bbfce6761bab4414bbb4507ed5d7a0 | refs/heads/master | 2020-04-06T12:11:58.802374 | 2018-11-13T20:29:58 | 2018-11-13T20:29:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 82 | java | package rmiprintserver;
public class ConfigManager {
//TODO:Implement this
}
| [
"Jeratull@hotmail.com"
] | Jeratull@hotmail.com |
72de8231713992cc8c19da4ad1d03f66445e5915 | 5f945039aa6fe1dc7777acb560f05fc41fa89f2b | /opg-old/src/edu/byu/cs/roots/opg/chart/selectvertical/AncesTree.java | 383639a0b315058e1dc30d3e3b670dce628afdb8 | [] | no_license | sam-m888/opg | 0e7f968289d2ba1252200f84b21f8666fa429a0f | f456a8dc840c86305bdf5032a89635b8173168e1 | refs/heads/master | 2021-01-13T06:08:05.841136 | 2015-06-29T06:58:01 | 2015-06-29T06:58:01 | 38,231,903 | 0 | 0 | null | 2015-06-29T06:43:07 | 2015-06-29T06:43:07 | null | UTF-8 | Java | false | false | 1,909 | java | package edu.byu.cs.roots.opg.chart.selectvertical;
import java.util.ArrayList;
import edu.byu.cs.roots.opg.model.Individual;
public class AncesTree {
public AncesBox ancesBox = null;
public ArrayList<ArrayList<AncesBox>> ancesGenPositions;
public AncesTree(Individual root)
{
ancesBox = new AncesBox(root);
ancesGenPositions = new ArrayList<ArrayList<AncesBox>>();
ancesBox.gen = 0;
ancesGenPositions.add(new ArrayList<AncesBox>());
ancesGenPositions.get(0).add(ancesBox);
ancesBox.numInGen = 0;
AncesBox.duplicateMap.put(ancesBox.indi.id,0); //add root to duplicate map
ancesBox.buildBoxTree(ancesGenPositions, 1);
}
public void DrawTree(ChartMargins chart, VerticalChartOptions options, double x, double y)
{
ancesBox.drawAncesRootTree(chart, options, ancesGenPositions, x, y);
}
public void setDuplicateNumbers()
{
for(int i=0; i < ancesGenPositions.size(); i++)
{
for(AncesBox ab : ancesGenPositions.get(i))
ab.setDuplicateIndex();
}
}
public int getLargestGen()
{
double max = 0;
int index = 0;
for(int i=0; i < ancesGenPositions.size(); i++)
{
double temp = ancesGenPositions.get(i).size();
if(max < temp )
{
max = temp;
index = i;
}
}
return index;
}
public int getGenAtMaxHieght(double maxheight, BoxFormat bf)
{
double temp;
double bh = bf.getMinHeight();
int i;
for(i=0; i < ancesGenPositions.size(); i++)
{
temp = ancesGenPositions.get(i).size()*bh;
if(maxheight < temp )
{
i--;
break;
}
}
return i;
}
public double getLargestGenHeight(BoxFormat bf)
{
int l = getLargestGen();
double mh = bf.getMinHeight();
return ancesGenPositions.get(l).size()*mh;
}
public int geGenerationSize(int gen)
{
return ancesGenPositions.get(gen).size();
}
public double getHeight()
{
return ancesBox.upperSubTreeHeight - ancesBox.lowerSubTreeHeight;
}
}
| [
"JRASM91@gmail.com"
] | JRASM91@gmail.com |
835dfdda7c8235914f19a455f78f87301bd77e09 | 398c56f1cd233d312cdc1952c9aef0c498b4b9dd | /src/main/java/com/goodfor/web/customer/Customer.java | dda5f7a098c9854aae9be045f2884ce2ad3d8ed4 | [] | no_license | kimseho91/goodfor1 | 183c419452193b84de8498ecc020b80b71d5ca32 | b1d01089fdb127f2bf505cf1388604ecd1d3fb76 | refs/heads/master | 2022-12-21T22:06:12.345869 | 2020-02-03T03:49:55 | 2020-02-03T03:49:55 | 234,305,105 | 0 | 5 | null | 2022-12-16T05:09:44 | 2020-01-16T11:26:57 | CSS | UTF-8 | Java | false | false | 321 | java | package com.goodfor.web.customer;
import org.springframework.stereotype.Component;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Component
@AllArgsConstructor
@NoArgsConstructor
public class Customer {
private String cid, cpw, cname, email, pnumber, invest, rating;
} | [
"53929396+kimseho91@users.noreply.github.com"
] | 53929396+kimseho91@users.noreply.github.com |
8a1ec0d0a60b48eeb7b749ffb043b040c5126984 | 85fdcf0631ca2cc72ce6385c2bc2ac3c1aea4771 | /temp/src/minecraft/net/minecraft/src/BlockDeadBush.java | e77245dbfb65c62e227600a52af8617e116f126f | [] | no_license | lcycat/Cpsc410-Code-Trip | c3be6d8d0d12fd7c32af45b7e3b8cd169e0e28d4 | cb7f76d0f98409af23b602d32c05229f5939dcfb | refs/heads/master | 2020-12-24T14:45:41.058181 | 2014-11-21T06:54:49 | 2014-11-21T06:54:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,760 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// BlockFlower, Material, Block, World,
// EntityPlayer, ItemStack, Item, ItemShears,
// StatList
public class BlockDeadBush extends BlockFlower
{
protected BlockDeadBush(int p_i3932_1_, int p_i3932_2_)
{
super(p_i3932_1_, p_i3932_2_, Material.field_76255_k);
float f = 0.4F;
func_71905_a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
}
protected boolean func_72263_d_(int p_72263_1_)
{
return p_72263_1_ == Block.field_71939_E.field_71990_ca;
}
public int func_71858_a(int p_71858_1_, int p_71858_2_)
{
return field_72059_bZ;
}
public int func_71885_a(int p_71885_1_, Random p_71885_2_, int p_71885_3_)
{
return -1;
}
public void func_71893_a(World p_71893_1_, EntityPlayer p_71893_2_, int p_71893_3_, int p_71893_4_, int p_71893_5_, int p_71893_6_)
{
if(!p_71893_1_.field_72995_K && p_71893_2_.func_71045_bC() != null && p_71893_2_.func_71045_bC().field_77993_c == Item.field_77745_be.field_77779_bT)
{
p_71893_2_.func_71064_a(StatList.field_75934_C[field_71990_ca], 1);
func_71929_a(p_71893_1_, p_71893_3_, p_71893_4_, p_71893_5_, new ItemStack(Block.field_71961_Y, 1, p_71893_6_));
} else
{
super.func_71893_a(p_71893_1_, p_71893_2_, p_71893_3_, p_71893_4_, p_71893_5_, p_71893_6_);
}
}
}
| [
"kye.13@hotmail.com"
] | kye.13@hotmail.com |
8c6d83078617531b58bee10fcb158f7055403c75 | 674397b11d54f438db9535c466822f8f39a7d553 | /twister2/taskscheduler/src/java/edu/iu/dsc/tws/tsched/utils/HierarchicalTaskGraphParser.java | 782704b5f973652fa8fdfdacf685d7269bfa7e0e | [
"Apache-2.0"
] | permissive | FreddieSun/twister2 | 9925a7323f1f0270d5641de9f4591e4200d00c41 | 4c0a8ef7c86413cf190883cb7e1d9164467979e8 | refs/heads/master | 2020-04-07T14:56:54.830021 | 2018-11-20T19:31:47 | 2018-11-20T19:31:47 | 158,467,342 | 0 | 0 | Apache-2.0 | 2018-11-21T00:13:03 | 2018-11-21T00:13:03 | null | UTF-8 | Java | false | false | 2,806 | java | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package edu.iu.dsc.tws.tsched.utils;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.logging.Logger;
import edu.iu.dsc.tws.task.graph.DataFlowTaskGraph;
import edu.iu.dsc.tws.task.graph.HierarchicalTaskGraph;
import edu.iu.dsc.tws.task.graph.Vertex;
public class HierarchicalTaskGraphParser {
private static final Logger LOG = Logger.getLogger(HierarchicalTaskGraphParser.class.getName());
private HierarchicalTaskGraph hierarchicalTaskGraph;
private List<DataFlowTaskGraph> taskgraphList = new LinkedList<>();
public HierarchicalTaskGraphParser(HierarchicalTaskGraph graph) {
this.hierarchicalTaskGraph = graph;
}
public List<DataFlowTaskGraph> hierarchicalTaskGraphParse() {
Set<DataFlowTaskGraph> taskGraphSet = hierarchicalTaskGraph.getTaskGraphSet();
//To parse the hierachical dataflow task graph and its vertex names.
Iterator<DataFlowTaskGraph> iterator = taskGraphSet.iterator();
while (iterator.hasNext()) {
DataFlowTaskGraph dataFlowTaskGraph = iterator.next();
Set<Vertex> vertexSet = dataFlowTaskGraph.getTaskVertexSet();
Iterator<Vertex> vertexIterator = vertexSet.iterator();
LOG.fine("Dataflow task graph name:" + dataFlowTaskGraph.getTaskGraphName() + "\t"
+ "(" + dataFlowTaskGraph.getOperationMode() + ")\t"
+ vertexSet);
while (vertexIterator.hasNext()) {
LOG.fine("Vertex names:" + vertexIterator.next().getName());
}
}
for (DataFlowTaskGraph dataFlowTaskGraph : taskGraphSet) {
if (hierarchicalTaskGraph.inDegreeOfTaskGraph(dataFlowTaskGraph) == 0) {
taskgraphList.add(dataFlowTaskGraph);
} else if ((hierarchicalTaskGraph.incomingTaskGraphEdgesOf(dataFlowTaskGraph).size() == 1)
&& (hierarchicalTaskGraph.outgoingTaskGraphEdgesOf(dataFlowTaskGraph).size() == 0)) {
taskgraphList.add(dataFlowTaskGraph);
}
}
for (int i = 0; i < taskgraphList.size(); i++) {
DataFlowTaskGraph dataFlowTaskGraph = taskgraphList.get(i);
LOG.info("Dataflow Task Graph and Type:" + dataFlowTaskGraph + "\t"
+ dataFlowTaskGraph.getOperationMode());
}
return taskgraphList;
}
}
| [
"kannan.gridlab@gmail.com"
] | kannan.gridlab@gmail.com |
8ee488cea029aa1f423121103007efe01c3fe7cb | 89e9f27fdbc28b80e5d89d7b9ee0fdd588ac2bfb | /src/com/facebook/buck/d/DBinaryDescription.java | 844652c6a49de6b75baea9bc8ce3e9e5c022311d | [
"Apache-2.0"
] | permissive | longseespace/buck | a108bc826a513eb7ec58e17407f90d64c7639cc1 | c1962f963e72f920ea53a99e66165ae7e7c1c4aa | refs/heads/master | 2020-12-13T21:52:43.176739 | 2015-05-13T08:05:57 | 2015-05-13T08:05:57 | 35,529,932 | 0 | 0 | null | 2015-05-13T05:26:53 | 2015-05-13T05:26:53 | null | UTF-8 | Java | false | false | 2,126 | java | /*
* Copyright 2015-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.d;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.BuildRuleType;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.SourcePath;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.infer.annotation.SuppressFieldNotInitialized;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
public class DBinaryDescription implements Description<DBinaryDescription.Arg> {
private static final BuildRuleType TYPE = BuildRuleType.of("d_binary");
private final DBuckConfig dBuckConfig;
public DBinaryDescription(DBuckConfig dBuckConfig) {
this.dBuckConfig = dBuckConfig;
}
@Override
public BuildRuleType getBuildRuleType() {
return TYPE;
}
@Override
public Arg createUnpopulatedConstructorArg() {
return new Arg();
}
@Override
public <A extends Arg> BuildRule createBuildRule(
BuildRuleParams params,
BuildRuleResolver resolver,
A args) {
return new DBinary(
params,
new SourcePathResolver(resolver),
args.srcs,
dBuckConfig.getDCompiler());
}
@SuppressFieldNotInitialized
public static class Arg {
public ImmutableSet<SourcePath> srcs;
public Optional<ImmutableSortedSet<BuildTarget>> deps;
}
}
| [
"sdwilsh@fb.com"
] | sdwilsh@fb.com |
a2f4e0fa1977c24507116003356ff721889f87fb | 2168f607854a3bd67f0d6710631bef2bcdc0105b | /osworkflow-build/propertyset/src/main/java/com/opensymphony/module/propertyset/hibernate/HibernateConfigurationProvider.java | 5fdd317446b67ca2d30708435f6706f3af6bdf02 | [] | no_license | stephen-lane/oswokflow-repository | 737d7a663a700ef77ff23c245d838423e601e169 | 219e7e3a2981f82c091cea2d660e7f0840213647 | refs/heads/master | 2020-07-23T19:23:27.509318 | 2015-12-24T19:27:04 | 2015-12-24T19:27:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | /*
* Copyright (c) 2002-2003 by OpenSymphony
* All rights reserved.
*/
package com.opensymphony.module.propertyset.hibernate;
import net.sf.hibernate.cfg.Configuration;
import java.util.Map;
/**
* Use this class to provide your own configurations to the PropertySet hibernate providers.
* <p>
* Simply implement this interface and return a Hibernate Configuration object.
* <p>
* This is setup by using the configuration.provider.class property, with the classname
* of your implementation.
*/
public interface HibernateConfigurationProvider {
//~ Methods ////////////////////////////////////////////////////////////////
/**
* Get a Hibernate configuration object
*/
public Configuration getConfiguration();
HibernatePropertySetDAO getPropertySetDAO();
/**
* Setup a Hibernate configuration object with the given properties.
*
* This will always be called before getConfiguration().
*/
void setupConfiguration(Map properties);
}
| [
"giuseppemiscione@gmail.com"
] | giuseppemiscione@gmail.com |
9147194ee8feb7a4d0c6f64a5eaab054f1661251 | 00b8a77d2ef37e33cdb0e18bd4feb38c0d203291 | /src/main/java/matrixUtils/MatrixInverse.java | c8f8b33bf6c4b8a218b5439128d6eb1c896a51c3 | [] | no_license | Noir-Nuclear/tpprLab2 | bb0240534bf0cc964d1c746f267409c825455a72 | 79b177f331522b5d5120dcafa840359820eaba0d | refs/heads/master | 2022-05-28T21:55:32.204832 | 2019-12-10T19:24:28 | 2019-12-10T19:24:28 | 227,182,810 | 0 | 0 | null | 2022-05-20T21:19:47 | 2019-12-10T17:51:36 | Java | UTF-8 | Java | false | false | 3,042 | java | package matrixUtils;
public class MatrixInverse {
// Define a small value of epsilon to compare double values
static final double EPS = 0.00000001;
// Invert the specified matrix. Assumes invertibility. Time Complexity: O(r²c)
public static double[][] inverse(double[][] matrix) {
if (matrix.length != matrix[0].length) return null;
int n = matrix.length;
double[][] augmented = new double[n][n * 2];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) augmented[i][j] = matrix[i][j];
augmented[i][i + n] = 1;
}
solve(augmented);
double[][] inv = new double[n][n];
for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) inv[i][j] = augmented[i][j + n];
return inv;
}
// Solves a system of linear equations as an augmented matrix
// with the rightmost column containing the constants. The answers
// will be stored on the rightmost column after the algorithm is done.
// NOTE: make sure your matrix is consistent and does not have multiple
// solutions before you solve the system if you want a unique valid answer.
// Time Complexity: O(r²c)
static void solve(double[][] augmentedMatrix) {
int nRows = augmentedMatrix.length, nCols = augmentedMatrix[0].length, lead = 0;
for (int r = 0; r < nRows; r++) {
if (lead >= nCols) break;
int i = r;
while (Math.abs(augmentedMatrix[i][lead]) < EPS) {
if (++i == nRows) {
i = r;
if (++lead == nCols) return;
}
}
double[] temp = augmentedMatrix[r];
augmentedMatrix[r] = augmentedMatrix[i];
augmentedMatrix[i] = temp;
double lv = augmentedMatrix[r][lead];
for (int j = 0; j < nCols; j++) augmentedMatrix[r][j] /= lv;
for (i = 0; i < nRows; i++) {
if (i != r) {
lv = augmentedMatrix[i][lead];
for (int j = 0; j < nCols; j++) augmentedMatrix[i][j] -= lv * augmentedMatrix[r][j];
}
}
lead++;
}
}
// Checks if the matrix is inconsistent
static boolean isInconsistent(double[][] arr) {
int nCols = arr[0].length;
outer:
for (int y = 0; y < arr.length; y++) {
if (Math.abs(arr[y][nCols - 1]) > EPS) {
for (int x = 0; x < nCols - 1; x++) if (Math.abs(arr[y][x]) > EPS) continue outer;
return true;
}
}
return false;
}
// Make sure your matrix is consistent as well
static boolean hasMultipleSolutions(double[][] arr) {
int nCols = arr[0].length, nEmptyRows = 0;
outer:
for (int y = 0; y < arr.length; y++) {
for (int x = 0; x < nCols; x++) if (Math.abs(arr[y][x]) > EPS) continue outer;
nEmptyRows++;
}
return nCols - 1 > arr.length - nEmptyRows;
}
}
| [
"filstormborn@mail.ru"
] | filstormborn@mail.ru |
eeafe1f45fd33586b9d2c36af6c6945ead27d63d | 650df0e6f34c43c2ca31fd4a162ea317ef5227a9 | /src/main/java/com/almundo/callcenter/CallCenter.java | 5649b3a006633be124aa8dfa0dcd1ee273b5609d | [] | no_license | walexisp2/CallCenter | bc3217b9444f5008016d7ed16bf8210996b0e738 | 12ccebd9160b28483789dbeaa8f341f7d9495cbd | refs/heads/master | 2021-01-24T16:27:20.759505 | 2018-03-06T20:50:15 | 2018-03-06T20:50:15 | 123,195,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 667 | 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 com.almundo.callcenter;
import domain.Llamada;
import domain.Operador;
import services.Dispatcher;
import services.GenerarLlamada;
/**
*
* @author Asus
*/
public class CallCenter {
public static void main(String[] args)
{
/*for ( int i = 0; i < 3; i++ )
{
new Operador( i + 1 ).start();
}*/
//new Dispatcher().start();
new GenerarLlamada().start();
new Dispatcher().dispatchCall();
}
}
| [
"walexisp2@gmail.com"
] | walexisp2@gmail.com |
d10e45d7cc16801515a774240821597d90c4113a | f6384dcb06e84f8a811900513ba1a7e89caafee5 | /semestralni prace/src/main/java/cz/mazl/tul/dto/in/city/CreateCityDTO.java | 38c59cd248d6db8fd27a5e27cbb76c09d0816e02 | [] | no_license | LukasMazl/PPJ-2020 | 7228ffb24be4e037310289a0d5cc64f69cae5c7c | 95afb104d3a3b7aec932cc9548529681dbec7200 | refs/heads/master | 2022-12-02T02:38:41.932976 | 2021-01-17T16:37:04 | 2021-01-17T16:37:04 | 243,306,035 | 0 | 1 | null | 2022-11-24T08:22:26 | 2020-02-26T16:09:29 | Java | UTF-8 | Java | false | false | 81 | java | package cz.mazl.tul.dto.in.city;
public class CreateCityDTO extends CityDTO {
}
| [
"lukas.mazl@plus4u.net"
] | lukas.mazl@plus4u.net |
73a94b14b476af447c81e7af9f54ec642a8eda1a | 5c77aab23a44bd00f55c7347d3dbf6c7ca52f0ba | /src/main/java/com/XliXli/service/impl/PhotoalbumServiceImpl.java | da774e2253bf2d3f014a74a9fc3091f1eb4709db | [] | no_license | mingyue0206/XliXliFrame | bb0defd49c38733f1e202003c0d4bffac545606e | 6cbb5a905fa2ae18886a7fc36d9d89d241f739b2 | refs/heads/master | 2020-05-16T01:50:03.776427 | 2019-04-22T02:49:43 | 2019-04-22T02:49:43 | 182,612,782 | 1 | 0 | null | 2019-04-22T02:56:57 | 2019-04-22T02:56:56 | null | UTF-8 | Java | false | false | 1,220 | java | package com.XliXli.service.impl;
import com.XliXli.mapper.PhotoalbumMapper;
import com.XliXli.pojo.Photoalbum;
import com.XliXli.service.PhotoalbumService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 相册表 服务实现类
* </p>
*
* @author chenwei
* @since 2019-04-19
*/
@Service
public class PhotoalbumServiceImpl extends ServiceImpl<PhotoalbumMapper, Photoalbum> implements PhotoalbumService {
@Override
public int createPhotoalbum(Photoalbum photoalbum) {
return 0;
}
@Override
public int deletePhotoalbumById(Long PA_Id) {
return 0;
}
@Override
public int deletePhotoalbumByIdList(List<Long> PA_IdList) {
return 0;
}
@Override
public int updatePhotoalbumById(Long PA_Id, Photoalbum photoalbum, Boolean isNull) {
return 0;
}
@Override
public Photoalbum findById(Long PA_Id) {
return null;
}
@Override
public List<Photoalbum> findByIdList(List<Long> PA_IdList) {
return null;
}
@Override
public List<Photoalbum> findByUserId(Long PA_UserId) {
return null;
}
}
| [
"1936911833@qq.com"
] | 1936911833@qq.com |
706976a5b23e86f562cb8bc29df01b571522bb45 | 6dd287a68ebcad68e9f3c1b0c1e8dcda57524e8e | /approach/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/api/data/textextraction/PhraseMappingChangeListener.java | 67280e5bf923bf53b0de74f310d00263a2cd47b0 | [
"MIT"
] | permissive | ArDoCo/DetectingInconsistenciesInSoftwareArchitectureDocumentationUsingTraceabilityLinkRecovery | fa248bfe42074e8d8f6dde968697d02137365828 | db1e8d5685c81f218e424af15fd555fb7ba79ca0 | refs/heads/main | 2023-04-08T04:12:01.276499 | 2023-02-17T13:03:54 | 2023-02-17T13:03:54 | 554,837,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | /* Licensed under MIT 2022. */
package edu.kit.kastel.mcse.ardoco.core.api.data.textextraction;
public interface PhraseMappingChangeListener {
void onDelete(PhraseMapping deletedPhraseMapping, PhraseMapping replacement);
}
| [
"dominik.fuchss@kit.edu"
] | dominik.fuchss@kit.edu |
a5aa1a4f1d0b5362513f8f3c852294094b893f97 | 22e6d720e401e21d529a8bcc2546f2e97a5c53c3 | /JavaProject002.javase/javase/src/com/yanqi/task18/SubThreadRun.java | 54199957a692b16a5f4b5fdfae0d7143ed1d6522 | [] | no_license | yanqivip/Javase_project | 363207677b9d27fa1e0256ee0dcd13525f4b03f3 | a57d895c39e6a11076da747810cf40d88a9b5bae | refs/heads/master | 2023-07-10T19:16:33.280120 | 2021-08-14T15:29:40 | 2021-08-14T15:29:40 | 391,399,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.yanqi.task18;
public class SubThreadRun extends Thread {
@Override
public void run() {
// 打印1 ~ 20之间的所有整数
for (int i = 1; i <= 20; i++) {
System.out.println("run方法中:i = " + i); // 1 2 ... 20
}
}
}
| [
"yanqi_vip@yeah.net"
] | yanqi_vip@yeah.net |
6746d535668c29258482cc4bfb744746ffbd038a | 2ad02af128c1893f93f6b1f3d65c803e5316a144 | /src/main/java/br/com/acme/services/TaskService.java | 361f0b482726f5fb2cef7ed7e797abb7fb8c7bae | [] | no_license | eltondornelas/desafio-acc-backend | cfcaf6039097da71cec6b1c6afaa8daccdb6d1e7 | f9798f138ae096b7c8d0e1f38e905622f16c8757 | refs/heads/master | 2022-11-23T06:33:23.214934 | 2020-07-24T03:59:29 | 2020-07-24T03:59:29 | 282,118,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | package br.com.acme.services;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import br.com.acme.entities.Task;
import br.com.acme.entities.TaskItem;
import br.com.acme.repositories.TaskItemRepository;
import br.com.acme.repositories.TaskRepository;
import javassist.tools.rmi.ObjectNotFoundException;
@Service
public class TaskService {
private static final String ERRO_ITEM_NAO_ENCONTRADO = "Item não encontrado";
private static final String ERRO_TAREFA_NAO_ENCONTRADA = "Tarefa não encontrada";
@Autowired
private TaskRepository taskRepository;
@Autowired
private TaskItemRepository taskItemRepository;
public List<Task> findAll() {
return taskRepository.findAll();
}
public Task find(Long id) throws ObjectNotFoundException {
Optional<Task> task = taskRepository.findById(id);
return task.orElseThrow(() -> new ObjectNotFoundException(ERRO_TAREFA_NAO_ENCONTRADA));
}
public Task insert(Task task) {
task.setId(null);
return taskRepository.save(task);
}
public Task update(Task updatedTask, Long id) throws ObjectNotFoundException {
Task task = find(id);
updateTask(task, updatedTask);
return taskRepository.save(task);
}
public void delete(Long id) throws ObjectNotFoundException {
Task task = find(id);
taskRepository.delete(task);
}
private void updateTask(Task task, Task updatedTask) {
task.setTitle(updatedTask.getTitle());
}
public TaskItem findItem(Long id) throws ObjectNotFoundException {
Optional<TaskItem> taskItem = taskItemRepository.findById(id);
return taskItem.orElseThrow(() -> new ObjectNotFoundException(ERRO_ITEM_NAO_ENCONTRADO));
}
public Task insertItem(Task task, TaskItem taskItem) {
taskItem.setId(null);
taskItem.setTask(task);
taskItem = taskItemRepository.save(taskItem);
task.getItems().add(taskItem);
return taskRepository.save(task);
}
public void updateItem(Task task, TaskItem updatedTaskItem) throws ObjectNotFoundException {
TaskItem taskItem = findItem(updatedTaskItem.getId());
taskItem.setDescription(updatedTaskItem.getDescription());
taskItemRepository.save(taskItem);;
}
public void deleteItem(Long itemId) throws ObjectNotFoundException {
TaskItem taskItem = findItem(itemId);
taskItemRepository.delete(taskItem);
}
}
| [
"eltondornelas@gmail.com"
] | eltondornelas@gmail.com |
f754c3aa38113a01ae5427cd4deaa8e701c6eed5 | 5f7cf48e999874c0b1e8b8c2a69f2d11d17b1f6a | /src/cn/gmluo/searchapitest/requestsource/searchapisource/scenicspot/district/ScenicInterventionSource.java | 33d082aea6eb7cf0b92e49082f56fee7beda285e | [] | no_license | gmluo1988/springmvc-searchautotest | 273334f0961cd424bc32395f69c50e58bfa2019c | 07d63f677bd42068fba64168ab48d6cfaef034fc | refs/heads/master | 2020-03-17T10:02:13.212906 | 2018-05-15T10:37:33 | 2018-05-15T10:37:33 | 133,497,732 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,961 | java | package cn.gmluo.searchapitest.requestsource.searchapisource.scenicspot.district;
import cn.gmluo.searchapitest.apibase.searchapibase.scenicspot.*;
import com.alibaba.fastjson.JSON;
import java.util.List;
/**
* 门票目的地列表页人工干预报文模板
* Created by gmluo on 2018/5/10.
*/
public class ScenicInterventionSource extends ScenicSpotSearchSourceBase {
private String districtID;
public String getDistrictID() {
return districtID;
}
public void setDistrictID(String districtID) {
this.districtID = districtID;
}
public String getScenicSearchSource() {
/**
* 获取继承的requestType对象
*/
ScenicSpotSearchRequestType requestType = super.scenicspotBase();
/**
* 针对requestType对象进行相应的数据重写
* 需要构造什么报文就变更相应地方的数据即可
*/
/**
* 重写操作
* 设置搜索场景7:目的地搜索
*/
SearchParameter searchParameter = requestType.getSearchParameter();
searchParameter.setSearchMode(7);
/**
* 重写操作
* 设置目的地参数:districtID
*/
List<FilterParameter> filterParameterList = requestType.getFilterList();
FilterParameter filterParameter = new FilterParameter();
filterParameter.setType("8");
filterParameter.setValue(districtID);
filterParameterList.add(filterParameter);
/**
*重写操作
*设置默认排序
*/
SortParameter sortParameter = requestType.getSortParameter();
/**
* 将requestType序列化为json类型的String字符
* 使用fastjson进行序列化操作
*/
String requestSource = JSON.toJSONString(requestType);
/**
* 返回相应的请求报文
*/
return requestSource;
}
}
| [
"gmluo@Ctrip.com"
] | gmluo@Ctrip.com |
55beca7720a52404ff479a7745bca68ac27eff3c | fc0df159e697e3bf426da5ecdf178717d1fa435e | /ofdrw-layout/src/test/java/org/ofdrw/layout/engine/SegmentationEngineTest.java | 15e6261af0ef059d4084285344f5610467e25b24 | [
"MIT"
] | permissive | Millieen/ofdrw | ec85496adff9e7eab21a7615d8fc29e98316d947 | c22b9ae235ae5b979bee083323a5190692101dff | refs/heads/master | 2022-04-14T11:17:30.973266 | 2020-03-30T03:49:12 | 2020-03-30T03:49:12 | 251,196,350 | 4 | 1 | MIT | 2020-03-30T03:55:55 | 2020-03-30T03:55:54 | null | UTF-8 | Java | false | false | 1,539 | java | package org.ofdrw.layout.engine;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.ofdrw.layout.PageLayout;
import org.ofdrw.layout.element.AFloat;
import org.ofdrw.layout.element.Clear;
import org.ofdrw.layout.element.Div;
import java.util.LinkedList;
import java.util.List;
public class SegmentationEngineTest {
@Test
public void process() {
// w: 138 h: 225
SegmentationEngine sgnEngine = new SegmentationEngine(PageLayout.A4);
List<Div> list = new LinkedList<>();
list.add(new Div(50d, 25d).setFloat(AFloat.center));
// w: 138 - 38 = 100
Div div = new Div()
.setClear(Clear.none)
.setFloat(AFloat.left)
.setWidth(38d)
.setHeight(10d);
list.add(div);
List<Segment> segments = sgnEngine.process(list);
Assertions.assertEquals(segments.size(), 2);
// w: 100 - 90 = 10
list.add(new Div()
.setClear(Clear.none)
.setFloat(AFloat.left)
.setWidth(90d)
.setHeight(70d));
segments = sgnEngine.process(list);
Assertions.assertEquals(segments.size(), 2);
// h: 120 w: 138 - 70
list.add(new Div()
.setClear(Clear.none)
.setFloat(AFloat.left)
.setWidth(70d)
.setHeight(70d));
segments = sgnEngine.process(list);
Assertions.assertEquals(segments.size(), 3);
}
}
| [
"quanguanyu@qq.com"
] | quanguanyu@qq.com |
ea1c99269edf927e045737491257c54aa81118bb | 3dd197850555ce0360152909e64daf56a6d8fa5a | /app/src/main/java/com/example/thanh/android_project_mob204/fragment/TrendingFragment.java | 24a9cf6c6e3293f9f99cbb5ff2b6ca4253e2653e | [] | no_license | vuongquocthanh/BookManagement | 03a2b14178b7e5b7316f8cba17ea9ceb19d8da04 | e3873e9b824245eebc0d88635cd5b301b4b3dacb | refs/heads/master | 2020-04-07T11:59:03.566846 | 2018-10-11T08:20:20 | 2018-10-11T08:20:20 | 158,349,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,449 | java | package com.example.thanh.android_project_mob204.fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import com.example.thanh.android_project_mob204.R;
import com.example.thanh.android_project_mob204.adapter.AdapterBook;
import com.example.thanh.android_project_mob204.adapter.AdapterBookTrending;
import com.example.thanh.android_project_mob204.database.DatabaseHelper;
import com.example.thanh.android_project_mob204.model.Book;
import com.example.thanh.android_project_mob204.model.BookTrending;
import com.example.thanh.android_project_mob204.model.Invoice;
import com.example.thanh.android_project_mob204.model.InvoiceDetail;
import com.example.thanh.android_project_mob204.sqlitedao.DAOBook;
import com.example.thanh.android_project_mob204.sqlitedao.DAOInvoice;
import com.example.thanh.android_project_mob204.sqlitedao.DAOInvoiceDetail;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class TrendingFragment extends Fragment {
private RecyclerView recyclerViewBookTrending;
private DatabaseHelper databaseHelper;
private DAOBook daoBook;
private DAOInvoiceDetail daoInvoiceDetail;
private DAOInvoice daoInvoice;
private List<Book> listBook;
private EditText edFindBookTrending;
private AdapterBook adapterBook;
private Button btFindTrending;
private AdapterBookTrending adapterBookTrending;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View viewTrending = inflater.inflate(R.layout.fragment_statistics_trending, container, false);
btFindTrending = viewTrending.findViewById(R.id.btFindTrending);
recyclerViewBookTrending = viewTrending.findViewById(R.id.recyclerViewBookTrending);
edFindBookTrending = viewTrending.findViewById(R.id.edFindTrending);
btFindTrending.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String month = edFindBookTrending.getText().toString();
if(month.length()<2){
month = "0"+month;
}
if (month.equalsIgnoreCase("")){
edFindBookTrending.setError("Please enter month!!");
}
databaseHelper = new DatabaseHelper(getContext());
daoInvoiceDetail = new DAOInvoiceDetail(databaseHelper);
daoBook = new DAOBook(databaseHelper);
List<InvoiceDetail> listInvoiceDetail = new ArrayList<>();
daoInvoice = new DAOInvoice(databaseHelper);
List<Invoice> listAllInvoice = new ArrayList<>();
listAllInvoice.addAll(daoInvoice.getAllInvoice());
List<Invoice> listMonthInvoice = new ArrayList<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (int i = 0; i < listAllInvoice.size(); i++) {
String dateConvert = simpleDateFormat.format(listAllInvoice.get(i).getInvoice_date());
String subDateConvert = dateConvert.substring(5, 7);
if (subDateConvert.equalsIgnoreCase(month)) {
listMonthInvoice.add(listAllInvoice.get(i));
}
}
List<Book> listBook = new ArrayList<>();
for(int i=0; i<listMonthInvoice.size(); i++){
listInvoiceDetail.addAll(daoInvoiceDetail.getAllInvoiceDetailByInvoiceID(listMonthInvoice.get(i).getInvoice_ID()));
}
Map<String, Integer> map = new TreeMap<String, Integer>();
for(int i=0; i<listInvoiceDetail.size(); i++){
addElement(map, listInvoiceDetail.get(i).getBookID());
}
Log.e("listMonthInvoice", listMonthInvoice.size() + "");
Log.e("listInvoiceDetail", listInvoiceDetail.size()+"");
for(int j = 0; j<map.size(); j++){
Log.e("value key",map.keySet().toArray()[j]+"");
}
List<BookTrending> listBookTrending = new ArrayList<>();
for(int j = 0; j<map.size(); j++){
int count = 0;
for(int i=0; i<listInvoiceDetail.size(); i++){
if(listInvoiceDetail.get(i).getBookID().equalsIgnoreCase((String) map.keySet().toArray()[j])){
count += listInvoiceDetail.get(i).getPurchaseNumber();
}
}
BookTrending bookTrending = new BookTrending(map.keySet().toArray()[j]+"", daoBook.getBook(map.keySet().toArray()[j]+"").getBookName(), daoBook.getBook(map.keySet().toArray()[j]+"").getBookDescription(), daoBook.getBook(map.keySet().toArray()[j]+"").getBookAvatar(), count);
listBookTrending.add(bookTrending);
}
List<BookTrending> listBookTrendingSort = new ArrayList<>();
Collections.sort(listBookTrending, new QuantityComparator());
for(BookTrending bookTrending:listBookTrending){
listBookTrendingSort.add(bookTrending);
}
List<BookTrending> listBookTop10 = new ArrayList<>();
for(int i=0; i<listBookTrendingSort.size(); i++){
if(i<10){
listBookTop10.add(listBookTrendingSort.get(i));
}
}
adapterBookTrending = new AdapterBookTrending(listBookTop10);
recyclerViewBookTrending.setAdapter(adapterBookTrending);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
recyclerViewBookTrending.setLayoutManager(layoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(getContext(), ((LinearLayoutManager) layoutManager).getOrientation());
recyclerViewBookTrending.addItemDecoration(dividerItemDecoration);
}
});
return viewTrending;
}
public class QuantityComparator implements Comparator<BookTrending>{
@Override
public int compare(BookTrending t1, BookTrending t2) {
if(t1.getCountTrending()==t2.getCountTrending()){
return 0;
}else if(t1.getCountTrending()<t2.getCountTrending()){
return 1;
}else{
return -1;
}
}
}
public void addElement(Map<String, Integer> map, String element){
if(map.containsKey(element)){
int count = map.get(element)+1;
map.put(element, count);
}else{
map.put(element, 1);
}
}
}
| [
"thanhvq010496@gmail.com"
] | thanhvq010496@gmail.com |
97cffccf2e38367c3ced2a3c629cbbe3fa7a402a | 224316208b7a6ddd49c3d1b7a5ecfd5ca985775c | /activemq-things/src/test/java/posta/MyProcessor.java | 687a2bf162396a59e3cea9ae623a44eee09b1569 | [] | no_license | b2kalyan/camel-sandbox | dbb256c49f552397452eabf34eb34c28b0d66d2e | 69df21605d7582e673eb3f926d27241a8d91ab80 | refs/heads/master | 2020-03-06T22:55:18.475804 | 2014-07-29T21:46:24 | 2014-07-29T21:46:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,150 | 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 posta;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
/**
* @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
*/
public class MyProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setBody(new TheBean());
}
}
| [
"christian.posta@gmail.com"
] | christian.posta@gmail.com |
f70b67ebb283b5a0c59704b6c90b164460c90af1 | 40daba4ea8a0061ed98b909456baeb489cd52397 | /plugins/github/src/org/jetbrains/plugins/github/GithubSettings.java | 80ccdc2542ea3016a625a05ecfe2c58d39258bd6 | [
"Apache-2.0"
] | permissive | collinsmith/idea-community | 3a0bbed399f34feec531533bf62585c7463f9ae0 | 1fa2c45953ed08667da52b1b83d44c56eb83b043 | refs/heads/master | 2020-12-24T11:37:41.330255 | 2011-01-26T21:04:53 | 2011-01-26T21:04:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,724 | java | package org.jetbrains.plugins.github;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.util.PasswordUtil;
import com.intellij.openapi.util.text.StringUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
/**
* @author oleg
*/
@State(
name = "GithubSettings",
storages = {
@Storage(
id = "main",
file = "$APP_CONFIG$/github_settings.xml"
)}
)
public class GithubSettings implements PersistentStateComponent<Element> {
private static final String GITHUB_SETTINGS_TAG = "GithubSettings";
private static final String LOGIN = "Login";
private static final String PASSWORD = "Password";
private static final String CLONE_PATH = "ClonePath";
private String myLogin;
private String myPassword;
private String myClonePath;
public static GithubSettings getInstance(){
return ServiceManager.getService(GithubSettings.class);
}
public Element getState() {
if (StringUtil.isEmptyOrSpaces(myLogin) && StringUtil.isEmptyOrSpaces(myPassword) && StringUtil.isEmpty(myClonePath)) {
return null;
}
final Element element = new Element(GITHUB_SETTINGS_TAG);
element.setAttribute(LOGIN, getLogin());
element.setAttribute(PASSWORD, getEncodedPassword());
element.setAttribute(CLONE_PATH, getClonePath());
return element;
}
public String getEncodedPassword() {
return PasswordUtil.encodePassword(getPassword());
}
public void setEncodedPassword(final String password) {
try {
setPassword(PasswordUtil.decodePassword(password));
}
catch (NumberFormatException e) {
// do nothing
}
}
public void loadState(@NotNull final Element element) {
try {
setLogin(element.getAttributeValue(LOGIN));
setEncodedPassword(element.getAttributeValue(PASSWORD));
setClonePath(element.getAttributeValue(CLONE_PATH));
}
catch (Exception e) {
// ignore
}
}
@NotNull
public String getLogin() {
return myLogin != null ? myLogin : "";
}
@NotNull
public String getPassword() {
return myPassword != null ? myPassword : "";
}
@NotNull
public String getClonePath() {
return myClonePath != null ? myClonePath : "";
}
public void setLogin(final String login) {
myLogin = login != null ? login : "";
}
public void setPassword(final String password) {
myPassword = password != null ? password : "";
}
public void setClonePath(final String clonePath) {
myClonePath = clonePath != null ? clonePath : "";
}
} | [
"oleg.shpynov@jebrains.com"
] | oleg.shpynov@jebrains.com |
4a569076a365a5822483c54d7385d175b43d3558 | 5e1fbd2b0cc32ca3608ff6fcd98dd4b419722e8d | /app/src/main/java/com/xuan/asange/databindingdemo/BaseApplication.java | bb989f031699fe843d3328561893c9642ec7258d | [] | no_license | NBXXF/databindingDemo | 3c468b632e83738701e1ec556b9cf5e9b28b8497 | 9188632bd2f8aef1b0aec4cfe98efd2510b7a3f7 | refs/heads/master | 2021-06-10T02:35:22.147567 | 2016-12-14T08:11:45 | 2016-12-14T08:11:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | package com.xuan.asange.databindingdemo;
import android.app.Application;
/**
* Description
* Company
* author youxuan E-mail:xuanyouwu@163.com
* date createTime:16/12/14
* version
*/
public class BaseApplication extends Application {
}
| [
"xuanyouwu@163.com"
] | xuanyouwu@163.com |
ff60323ab5f3b134eaefc1bf4004e8d46ca3b5ec | 8415fc9f82f0561c3e2f78f84930527231cc3a7b | /main/src/com/google/refine/commands/CSRFTokenFactory.java | af9c1ac36cad5eb5e9158c5bc3ad3c74b6a9805d | [
"BSD-3-Clause"
] | permissive | snac-cooperative/OpenRefine | d18c9594b5ba4896ae3a50bfbd563390fb71efde | 14341d6683919b0b1eb44a2eae0263f7ab512f1f | refs/heads/master | 2021-06-16T11:51:23.612409 | 2020-01-17T20:00:35 | 2020-01-17T20:00:35 | 191,580,601 | 2 | 2 | BSD-3-Clause | 2020-11-18T18:49:14 | 2019-06-12T13:51:01 | Java | UTF-8 | Java | false | false | 2,298 | java | package com.google.refine.commands;
import java.time.Instant;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.RandomStringUtils;
import java.security.SecureRandom;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
/**
* Generates CSRF tokens and checks their validity.
* @author Antonin Delpeuch
*
*/
public class CSRFTokenFactory {
/**
* Maps each token to the time it was generated
*/
protected final LoadingCache<String, Instant> tokenCache;
/**
* Time to live for tokens, in seconds
*/
protected final long timeToLive;
/**
* Length of the tokens to generate
*/
protected final int tokenLength;
/**
* Random number generator used to create tokens
*/
protected final SecureRandom rng;
/**
* Constructs a new CSRF token factory.
*
* @param timeToLive
* Time to live for tokens, in seconds
* @param tokenLength
* Length of the tokens generated
*/
public CSRFTokenFactory(long timeToLive, int tokenLength) {
tokenCache = CacheBuilder.newBuilder()
.expireAfterWrite(timeToLive, TimeUnit.SECONDS)
.build(
new CacheLoader<String, Instant>() {
@Override
public Instant load(String key) {
return Instant.now();
}
});
this.timeToLive = timeToLive;
this.rng = new SecureRandom();
this.tokenLength = tokenLength;
}
/**
* Generates a fresh CSRF token, which will remain valid for the configured amount of time.
*/
public String getFreshToken() {
// Generate a random token
String token = RandomStringUtils.random(tokenLength, 0, 0, true, true, null, rng);
// Put it in the cache
try {
tokenCache.get(token);
} catch (ExecutionException e) {
// cannot happen
}
return token;
}
/**
* Checks that a given CSRF token is valid.
* @param token
* the token to verify
* @return
* true if the token is valid
*/
public boolean validToken(String token) {
Map<String, Instant> map = tokenCache.asMap();
Instant cutoff = Instant.now().minusSeconds(timeToLive);
return map.containsKey(token) && map.get(token).isAfter(cutoff);
}
}
| [
"antonin@delpeuch.eu"
] | antonin@delpeuch.eu |
8cda158986b1a40620b6536f7fb1cc97554fe90b | f5b407377a491a7cd475414c7faeed18468ac5b0 | /feilong-core/src/test/java/com/feilong/core/bean/propertyutiltest/CopyPropertiesTest.java | 4f22d92db00a8d0ef08ded4ff59efb34f90ae7ab | [
"Apache-2.0"
] | permissive | luchao0111/feilong | 100a7b7784fc6fbfb8252bd468c52899dc4b5169 | 4024b8abb5b19f1378295fa8d1bd8ee3b86cfdad | refs/heads/master | 2022-05-29T02:09:55.324155 | 2020-05-06T14:50:17 | 2020-05-06T14:50:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,922 | 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.core.bean.propertyutiltest;
import static com.feilong.core.bean.ConvertUtil.toArray;
import static com.feilong.core.date.DateUtil.now;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasProperty;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import java.util.Date;
import org.junit.Test;
import com.feilong.core.bean.BeanOperationException;
import com.feilong.core.bean.PropertyUtil;
import com.feilong.store.member.Person;
import com.feilong.store.member.User;
/**
* The Class PropertyUtilTest.
*
* @author <a href="http://feitianbenyue.iteye.com/">feilong</a>
* @since 1.2.2
*/
public class CopyPropertiesTest{
/**
* Test copy properties.
*/
@Test
public void testCopyProperties(){
Date now = now();
String[] array = toArray("feilong", "飞天奔月", "venusdrogon");
User oldUser = new User();
oldUser.setId(5L);
oldUser.setMoney(new BigDecimal(500000));
oldUser.setDate(now);
oldUser.setNickNames(array);
User newUser = new User();
PropertyUtil.copyProperties(newUser, oldUser, "date", "money", "nickNames");
assertThat(
newUser,
allOf(//
hasProperty("money", equalTo(new BigDecimal(500000))),
hasProperty("date", is(now)),
hasProperty("nickNames", equalTo(array))
//
));
}
//---------------------------------------------------------------
@Test
public void testCopyPropertiesNullValue(){
User oldUser = new User();
oldUser.setId(null);
User newUser = new User();
PropertyUtil.copyProperties(newUser, oldUser);
assertEquals(null, newUser.getId());
}
//---------------------------------------------------------------
/**
* Test copy properties null to obj.
*/
@Test(expected = NullPointerException.class)
public void testCopyPropertiesNullToObj(){
PropertyUtil.copyProperties(null, new Person());
}
/**
* Test copy properties null from obj.
*/
@Test(expected = NullPointerException.class)
public void testCopyPropertiesNullFromObj(){
PropertyUtil.copyProperties(new Person(), null);
}
/**
* Test copy properties from obj no exist property name.
*/
@Test(expected = BeanOperationException.class)
public void testCopyPropertiesFromObjNoExistPropertyName(){
User oldUser = new User();
oldUser.setId(5L);
User newUser = new User();
PropertyUtil.copyProperties(newUser, oldUser, "date1");
}
/**
* Test copy properties to obj no exist property name.
*/
@Test(expected = BeanOperationException.class)
public void testCopyPropertiesToObjNoExistPropertyName(){
User oldUser = new User();
oldUser.setId(5L);
oldUser.setMoney(new BigDecimal(500000));
PropertyUtil.copyProperties(new Person(), oldUser, "date");
}
}
| [
"venusdrogon@163.com"
] | venusdrogon@163.com |
2ce8ff7a660fc9579109c87ae41fb830f621c7cb | f1e668c66d26573e6a08167d673ab99c9fa699f6 | /src/main/java/lxing/controller/ArticleController.java | 574a7e3665cacc421d7de37726399c3fd8e8a3aa | [] | no_license | Goflyinging/ssm | 970b3f003cf44eb1694f138c7e44c9a893ae15ea | 790fede1f90451b375733d2d609348461391f4ee | refs/heads/master | 2021-01-01T18:24:04.404161 | 2017-07-25T15:49:16 | 2017-07-25T15:49:16 | 98,323,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,263 | java | package lxing.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import lxing.entity.Article;
import lxing.entity.Page;
import lxing.service.SearchService;
import java.util.HashMap;
/**
* Created by lxing on 2017/3/11.
*/
@Controller
@RequestMapping("/article")
public class ArticleController {
@Autowired
private SearchService searchService;
@RequestMapping("/search")
public String view(String queryString, HttpServletRequest request) {
request.setAttribute("queryString", queryString);
return "content";
}
@RequestMapping("/list")
@ResponseBody
public Object list(String id ,HttpServletRequest request) {
System.out.println(id);
System.out.println();
HashMap<String,String> map = new HashMap<>();
map.put("aaa","aaa1");
map.put("bbb","bbb1");
map.put("ccc","ccc1");
return map;
}
@RequestMapping("/index")
public String index(HttpServletRequest request) {
return "index";
}
}
| [
"lxcurtain@gmail.com"
] | lxcurtain@gmail.com |
7a44850b8969822f256c1d705cdd99e22ccf3c6e | c34c16c923802c7bd63ba7666da7406ea179c8db | /server/mianshi-service/src/main/java/cn/xyz/mianshi/utils/SMSVerificationUtils.java | a4188893a4422d5ae59968754337028083fb1b01 | [] | no_license | xeon-ye/bailian | 36f322b40a4bc3a9f4cc6ad76e95efe3216258ed | ec84ac59617015a5b7529845f551d4fa136eef4e | refs/heads/main | 2023-06-29T06:12:53.074219 | 2021-08-07T11:56:38 | 2021-08-07T11:56:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,152 | java | package cn.xyz.mianshi.utils;
import java.io.UnsupportedEncodingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import cn.xyz.commons.autoconfigure.KApplicationProperties.SmsConfig;
import cn.xyz.commons.utils.DateUtil;
import cn.xyz.commons.utils.HttpClientUtil;
import cn.xyz.commons.utils.WebNetEncode;
import cn.xyz.mianshi.vo.SmsRecord;
/** @version:(1.0)
* @ClassName SMSPushUtils
* @Description: (短信验证服务)
* @date:2018年9月8日下午12:20:30
*/
@Component
public class SMSVerificationUtils {
protected static Logger smsLogger=LoggerFactory.getLogger("SMSVerificationUtils");
public static SmsConfig getSmsConfig() {
return SKBeanUtils.getSmsConfig();
}
public static final String SMSFORMAT = "00";
public static SendSmsResponse sendSms(String telephone, String code, String areaCode) throws ClientException {
// 可自助调整超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
// 初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", getSmsConfig().getAccesskeyid(),
getSmsConfig().getAccesskeysecret());
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", getSmsConfig().getProduct(),
getSmsConfig().getDomain());
IAcsClient acsClient = new DefaultAcsClient(profile);
// 组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest request = new SendSmsRequest();
// 必填:待发送手机号
smsLogger.info("格式化手机号 : 00 + 国际区号 + 号码 ==========>"+" SMSFORMAT :"+ SMSFORMAT +" areaCode: " + areaCode);
request.setPhoneNumbers(SMSFORMAT + telephone);// 接收号码格式为00+国际区号+号码
// 必填:短信签名-可在短信控制台中找到
request.setSignName(getSmsConfig().getSignname());
// 必填:短信模板-可在短信控制台中找到
request.setTemplateCode(getSmsConfig().getEnglish_templetecode());
if ("86".equals(areaCode) || "886".equals(areaCode) || "852".equals(areaCode))
request.setTemplateCode(getSmsConfig().getChinase_templetecode());
// 可选:模板中的变量替换JSON串,如模板内容为"亲爱的用户,您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\"" + code + "\"}");
// 选填-上行短信扩展码(无特殊需求用户请忽略此字段)
// request.setSmsUpExtendCode("90997");
// 可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
// request.setOutId("yourOutId");
// hint 此处可能会抛出异常,注意catch
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
smsLogger.info("阿里云短信服务回执详情:"+JSONObject.toJSONString(sendSmsResponse));
if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) {
smsLogger.info("短信发送成功!");
saveSMSToDB(request.getPhoneNumbers(), areaCode, code, request.getSignName()+request.getTemplateCode(), sendSmsResponse.getRequestId());
} else {
smsLogger.info("短信发送失败!");
}
return sendSmsResponse;
}
// 使用天天国际短信平台发送国际短信
public static String sendSmsToMs360(String telephone, String areaCode, String code) {
String msgId = null;
try {
String ip = getSmsConfig().getHost();
int port = getSmsConfig().getPort();
// HTTP 请求工具
HttpClientUtil util = new HttpClientUtil(ip, port, getSmsConfig().getApi());
String user = getSmsConfig().getUsername();// 你的用户名
String pwd = getSmsConfig().getPassword();// 你的密码:
String ServiceID = "SEND"; // 固定,不需要改变
String dest = telephone; // 你的目的号码【收短信的电话号码】
String sender = "";// 你的原号码,可空【大部分国家原号码带不过去,只有少数国家支持透传,所有一般为空】
String templateEnglishSMS = new String(getSmsConfig().getTemplateEnglishSMS().getBytes("ISO-8859-1"),"utf-8");
String msg = templateEnglishSMS + code;// 你的短信内容
if ("86".equals(areaCode) || "886".equals(areaCode) || "852".equals(areaCode)) {
String templateChineseSMS = new String(getSmsConfig().getTemplateChineseSMS().getBytes("ISO-8859-1"),"utf-8");
msg = templateChineseSMS + code;
}
// codec=8 Unicode 编码, 3 ISO-8859-1, 0 ASCII
// 短信内容 HEX 编码,8 为 UTF-16BE HEX 编码, dataCoding = 8 ,支持所有国家的语言,建议直接使用
// 8
String hex = WebNetEncode.encodeHexStr(8, msg);
hex = hex.trim() + "&codec=8";
// HTTP 封包请求, util.sendPostMessage 返回结果,
// 如果是以 “-” 开头的为发送失败,请查看错误代码,否则为MSGID
msgId = util.sendGetMessage(user, pwd, ServiceID, dest, sender, hex);
smsLogger.info("msgid = " + msgId + " msg = " + msg);
// 发送短信记录保存到数据库
saveSMSToDB(telephone, areaCode, code, msg, msgId);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return msgId;
}
/**
* @Description:(短信详情存库)
* @param telephone
* @param areaCode
* @param code
* @param content
* @param msgId
**/
public static void saveSMSToDB(String telephone, String areaCode, String code, String content, String msgId) {
SmsRecord sms = ConstantUtil.getSmsPrice(areaCode);
if (null == sms)
sms = new SmsRecord();
sms.setAreaCode(areaCode);
sms.setTelephone(telephone);
sms.setCode(code);
sms.setContent(content);
sms.setMsgId(msgId);
sms.setTime(DateUtil.currentTimeSeconds());
ConstantUtil.dsForRW.save(sms);
}
}
| [
"xiexun6943@gmail.com"
] | xiexun6943@gmail.com |
467cbde7a1dfa077137e1cc6a65f6736de07eab7 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_34092.java | e20c555141f87f5934377e417f54742d278aea82 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | /**
* A custom enhancer for the authorization request
* @param authorizationRequestEnhancer
*/
public void setAuthorizationRequestEnhancer(RequestEnhancer authorizationRequestEnhancer){
this.authorizationRequestEnhancer=authorizationRequestEnhancer;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
83b5535123899542b12b9d8a5cb1dc852ed8b649 | fcc07be63192e98e089a6c33958a9457bf656b32 | /src/main/java/test/service/package-info.java | b91f6434a28aec15f7da70d401476718449be154 | [] | no_license | pintusingh01/microservices-boilerplate | 754b133b0f7a22e3152d0251d33eb0a832dc32c6 | f78fa6f6e12ac99f4eb50b5441b02106956f093b | refs/heads/master | 2022-12-11T10:59:25.741812 | 2020-09-12T06:37:49 | 2020-09-12T06:37:49 | 295,323,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 54 | java | /**
* Service layer beans.
*/
package test.service;
| [
"ankush@bonamisoftware.com"
] | ankush@bonamisoftware.com |
8ac45677b7628b0e496c4a67dae562a67a2fa7a9 | 3fc5bad56d9f04f8527465e7458f6e32d455831c | /HelloWorld/src/LeapYear.java | 3ae529f75e42d1040c4ceb8ffc3d403ca7ed0c72 | [] | no_license | mubasherM/javaPrograming | 95ced1191dfa96f60834a04a223339453a043a7b | 3377fa1a257adcc9b5eba94fe79fe212e82442bc | refs/heads/master | 2021-01-19T07:46:12.915033 | 2015-07-15T10:18:30 | 2015-07-15T10:18:30 | 38,048,064 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | /**
* @author Mubasher Mohammed
* simple application that will determine if the year is leap year or not
* by using logical operators
*/
import java.util.Scanner;
public class LeapYear {
public static void main(String args[]){
int year=100 ;
Scanner scan = new Scanner(System.in);
//year = scan.nextInt();
LeapYear myYear = new LeapYear();
for(int i=1850;i<2050; i++){
System.out.println(i+" leap year is: "+myYear.isLeapYear(i) );
}
}
public boolean isLeapYear(int year){
if(((year % 4 ==0) && (year %100 != 0)) ||( year %400 ==0)){
return true;
}else{
return false;
}
}
}
| [
"User1@User2-PC"
] | User1@User2-PC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.