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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
59764ab0ba269ba5ee1776223f10abce977ef645
|
696aa05ec959063d58807051902d8e2c48a989b9
|
/ole-docstore/ole-docstore-engine/src/test/java/org/kuali/ole/docstore/util/DocStoreEnvUtil_UT.java
|
332a79ac673b353f51f6667da91a2676a45c83fb
|
[] |
no_license
|
sheiksalahudeen/ole-30-sprint-14-intermediate
|
3e8bcd647241eeb741d7a15ff9aef72f8ad34b33
|
2aef659b37628bd577e37077f42684e0977e1d43
|
refs/heads/master
| 2023-01-09T00:59:02.123787
| 2017-01-26T06:09:02
| 2017-01-26T06:09:02
| 80,089,548
| 0
| 0
| null | 2023-01-02T22:05:38
| 2017-01-26T05:47:58
|
PLSQL
|
UTF-8
|
Java
| false
| false
| 1,712
|
java
|
package org.kuali.ole.docstore.util;
import org.junit.Test;
import org.kuali.ole.BaseTestCase;
import java.io.IOException;
import java.util.Properties;
/**
* Created with IntelliJ IDEA.
* User: ?
* Date: 1/21/13
* Time: 5:04 PM
* To change this template use File | Settings | File Templates.
*/
public class DocStoreEnvUtil_UT extends BaseTestCase {
@Test
public void testDocStoreEnvUtil() throws IOException {
DocStoreEnvUtil docStoreEnvUtil = new DocStoreEnvUtil();
docStoreEnvUtil.getDocStorePropertiesFilePath();
docStoreEnvUtil.setDocStorePropertiesFilePath(docStoreEnvUtil.getDocStorePropertiesFilePath());
docStoreEnvUtil.getDocStorePropertiesFolderPath();
docStoreEnvUtil.setDocStorePropertiesFolderPath(docStoreEnvUtil.getDocStorePropertiesFolderPath());
// docStoreEnvUtil.getJackrabbitConfigFolderPath();
// docStoreEnvUtil.setJackrabbitConfigFolderPath(docStoreEnvUtil.getJackrabbitConfigFolderPath());
// docStoreEnvUtil.getJackrabbitPropertyFilePath();
// docStoreEnvUtil.setJackrabbitPropertyFilePath(docStoreEnvUtil.getJackrabbitPropertyFilePath());
// docStoreEnvUtil.getJackrabbitFolderPath();
// docStoreEnvUtil.setJackrabbitFolderPath(docStoreEnvUtil.getJackrabbitFolderPath());
docStoreEnvUtil.setRootFolderPath(docStoreEnvUtil.getRootFolderPath());
docStoreEnvUtil.setVendor("derby");
docStoreEnvUtil.setProperties(new Properties());
docStoreEnvUtil.initTestEnvironment();
docStoreEnvUtil.initEnvironment();
docStoreEnvUtil.getRootFolderPath();
docStoreEnvUtil.logEnvironment();
docStoreEnvUtil.printEnvironment();
}
}
|
[
"sheiksalahudeen.m@kuali.org"
] |
sheiksalahudeen.m@kuali.org
|
e861dfafe8a1a3d8992b641bf3c5e0841192b8d2
|
66af795db6b5ed5332e65c7d34e611bc358d7d81
|
/src/main/java/Trie/Trie.java
|
1bcb015adce256504cfab5c639c1b3143e314a96
|
[] |
no_license
|
wongswoon/testProject
|
850f32bae3a2d1e27ca225bf038b33256a395136
|
b62d1e9cc0b39d95edb98e5c7239fecd0c992fb9
|
refs/heads/master
| 2020-12-24T18:03:40.062716
| 2015-08-28T06:25:10
| 2015-08-28T06:25:10
| 35,925,040
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 690
|
java
|
package Trie;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Lenovo on 15-5-10.
*/
public class Trie {
private TrieNode root;
public Trie() {
root = new TrieNode();
}
// Inserts a word into the trie.
public void insert(String word) {
root.insert(word, 1);
}
// Returns if the word is in the trie.
public boolean search(String word) {
int res = root.findWithDot(word,0,0);
return res != -1 && res != 0;
}
// Returns if there is any word in the trie
// that starts with the given prefix.
public boolean startsWith(String prefix) {
return root.find(prefix) != -1;
}
}
|
[
"wangshun@staff.weibo.com"
] |
wangshun@staff.weibo.com
|
ef0bb0fe1f079129fd821578e60a30797702a00d
|
ea17869f6de19053add9a6bfa3eb3550867e7d7f
|
/app/src/main/java/com/example/administrator/yilan000/ui/base/BaseActivity.java
|
94f7fd1dbe81a26b8bd6e625a6470349cc43729d
|
[] |
no_license
|
HuRuWo/YiLan
|
63e05b7e10af70f8612ea1c57e3c6b8a0655adda
|
6865d1d0cdd68778118fff28c558078c760ecd81
|
refs/heads/master
| 2021-11-27T22:46:20.004024
| 2021-11-15T06:20:27
| 2021-11-15T06:20:27
| 71,859,697
| 100
| 45
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 715
|
java
|
package com.example.administrator.yilan000.ui.base;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
/**
* Created by xinghongfei on 16/8/12.
*/
public class BaseActivity extends AppCompatActivity {
String TAG=getClass().getSimpleName();
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
// TODO: 16/9/1 add the third service. eg.umeng ...
Log.e(TAG,TAG+"创建");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.e(TAG,TAG+"销毁");
}
}
|
[
"1458476478@qq.com"
] |
1458476478@qq.com
|
7a3f57fa0871e6e577c4ad92359ca1bbd9061c14
|
a6d8455c9176bb089e6e1a3e3570c1f094817eae
|
/Android/app/src/main/java/com/example/hanwe/mdp/Configuration/Protocol.java
|
3758d91a9b2b1fde2e0e592342770d9153e774b6
|
[] |
no_license
|
Daneaz/MDP_3004
|
be80b677870e94d7d3ed2238547a149d0a357054
|
cb58e69e8d279887454429a37b1c24e5c8bca1a0
|
refs/heads/master
| 2021-09-12T12:06:32.696200
| 2018-04-16T15:14:54
| 2018-04-16T15:14:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,943
|
java
|
package com.example.hanwe.mdp.Configuration;
public interface Protocol {
int MESSAGE_STATE_CHANGE = 1;
int MESSAGE_READ = 2;
int MESSAGE_WRITE = 3;
int MESSAGE_DEVICE_NAME = 4;
int MESSAGE_TOAST = 5;
String UUID = "00001101-0000-1000-8000-00805F9B34FB";
String LOG_FILE_DIR = "MDP_LOG";
String LOG_FILE_NAME = "log.txt";
String TOAST = "toast";
String DEVICE_NAME = "device_name";
String DEVICE_MAC = "device_address";
String PROTOCOLPREF = "protocolPref";
String F1 = "F1";
String F2 = "F2";
String MESSAGE_TYPE = "MESSAGE_TYPE";
String MESSAGE_BYTES = "MESSAGE_BYTES";
String MESSAGE_BUFFER = "MESSAGE_BUFFER";
String MESSAGE_ARG1 = "MESSAGE_ARG1";
String ARDUINO_MESSAGE_HEADER = "A";
String PC_MESSAGE_HEADER = "P";
String STATUS_FORWARD = "Moving Forward";
String STATUS_TURN_LEFT = "Turning Left";
String STATUS_TURN_RIGHT = "Turning Right";
String STATUS_REVERSE = "Reversing";
String STATUS_IDLE = "Idling";
String MOVE_FORWARD = "pF";
String TURN_LEFT = "pL";
String TURN_RIGHT = "pD";
String REVERSE = "pR";
String START_EXPLORATION = "pe";
String STOP_EXPLORATION = "se";
String START_FASTEST = "pf";
String STOP_FASTEST = "sf";
String SEND_ARENA = "pse";
//========== Protocol for communication with AMDTool ==========
//String AMD_DEVICE_NAME = "DESKTOP-UFDFUCR";
//String AMD_DEVICE_MAC = "48:45:20:91:cd:95";
String AMD_DEVICE_NAME = "DESKTOP-PN6SGT9";
String AMD_DEVICE_MAC = "40:E2:30:68:D8:6A";
String AMD_TURN_LEFT = "tl";
String AMD_TURN_RIGHT = "tr";
String AMD_MOVE_FORWARD = "f";
String AMD_REVERSE = "r";
String AMD_SEND_ARENA = "sendArena";
String AMD_START_EXPLORATION = "beginExplore";
String AMD_START_FASTEST = "beginFastest";
//========== ========== ========== ========== ==========
}
|
[
"chiangbinhao@gmail.com"
] |
chiangbinhao@gmail.com
|
3387c862ae81598528975f639807b300418d0f20
|
83c2f56955a0c338e0c60db13ab7379ef106ca79
|
/src/main/java/com/badlogic/gdx/graphics/glutils/IndexArray.java
|
cab14fba454f6a67226519132923e71ec020a0d1
|
[] |
no_license
|
Harium/propan-gdx-util
|
36b625bc2454861f618c4892424c9622fa0d56f9
|
4065ae04a569c01f65aa4550c32545483f3c02c9
|
refs/heads/master
| 2021-09-10T23:03:46.234187
| 2018-04-03T21:26:12
| 2018-04-03T21:26:12
| 100,196,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,004
|
java
|
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* 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.badlogic.gdx.graphics.glutils;
import com.badlogic.gdx.utils.BufferUtils;
import java.nio.ByteBuffer;
import java.nio.ShortBuffer;
public class IndexArray implements IndexData {
final ShortBuffer buffer;
final ByteBuffer byteBuffer;
// used to work around bug: https://android-review.googlesource.com/#/c/73175/
private final boolean empty;
/** Creates a new IndexArray to be used with vertex arrays.
*
* @param maxIndices the maximum number of indices this buffer can hold */
public IndexArray (int maxIndices) {
empty = maxIndices == 0;
if (empty) {
maxIndices = 1; // avoid allocating a zero-sized buffer because of bug in Android's ART < Android 5.0
}
byteBuffer = BufferUtils.newUnsafeByteBuffer(maxIndices * 2);
buffer = byteBuffer.asShortBuffer();
buffer.flip();
byteBuffer.flip();
}
/** @return the number of indices currently stored in this buffer */
public int getNumIndices () {
return empty ? 0 : buffer.limit();
}
/** @return the maximum number of indices this IndexArray can store. */
public int getNumMaxIndices () {
return empty ? 0 : buffer.capacity();
}
/** <p>
* Sets the indices of this IndexArray, discarding the old indices. The count must equal the number of indices to be copied to
* this IndexArray.
* </p>
*
* <p>
* This can be called in between calls to {@link #bind()} and {@link #unbind()}. The index data will be updated instantly.
* </p>
*
* @param indices the vertex data
* @param offset the offset to start copying the data from
* @param count the number of shorts to copy */
public void setIndices (short[] indices, int offset, int count) {
buffer.clear();
buffer.put(indices, offset, count);
buffer.flip();
byteBuffer.position(0);
byteBuffer.limit(count << 1);
}
public void setIndices (ShortBuffer indices) {
int pos = indices.position();
buffer.clear();
buffer.limit(indices.remaining());
buffer.put(indices);
buffer.flip();
indices.position(pos);
byteBuffer.position(0);
byteBuffer.limit(buffer.limit() << 1);
}
@Override
public void updateIndices (int targetOffset, short[] indices, int offset, int count) {
final int pos = byteBuffer.position();
byteBuffer.position(targetOffset * 2);
BufferUtils.copy(indices, offset, byteBuffer, count);
byteBuffer.position(pos);
}
/** <p>
* Returns the underlying ShortBuffer. If you modify the buffer contents they wil be uploaded on the call to {@link #bind()}.
* If you need immediate uploading use {@link #setIndices(short[], int, int)}.
* </p>
*
* @return the underlying short buffer. */
public ShortBuffer getBuffer () {
return buffer;
}
/** Binds this IndexArray for rendering with glDrawElements. */
public void bind () {
}
/** Unbinds this IndexArray. */
public void unbind () {
}
/** Invalidates the IndexArray so a new OpenGL buffer handle is created. Use this in case of a context loss. */
public void invalidate () {
}
/** Disposes this IndexArray and all its associated OpenGL resources. */
public void dispose () {
BufferUtils.disposeUnsafeByteBuffer(byteBuffer);
}
}
|
[
"yuripourre@gmail.com"
] |
yuripourre@gmail.com
|
58c2d8074a0e21213e643dc536f8d088e226c61a
|
28c23066968982c574e90c274f25af96655c833c
|
/android-exception-handler-testapp/src/jp/ne/sakura/kkkon/android/exceptionhandler/testapp/ExceptionHandlerTestApp.java
|
aba5bd4322d12744fbb2f16575ccca13cb0ae19c
|
[
"MIT"
] |
permissive
|
kkkon/android-exception-handler
|
9a1d71d1a8b701c260915af188e8e919d0b62259
|
8655123dde1846eed96eb5bc406add17d7c3bf0d
|
refs/heads/master
| 2021-01-19T10:08:14.451046
| 2014-08-16T16:17:56
| 2014-08-16T16:17:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,233
|
java
|
/*
* The MIT License
*
* Copyright (C) 2014 Kiyofumi Kondoh
*
* 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.
*/
package jp.ne.sakura.kkkon.android.exceptionhandler.testapp;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import jp.ne.sakura.kkkon.android.exceptionhandler.ExceptionHandler;
/**
*
* @author Kiyofumi Kondoh
*/
public class ExceptionHandlerTestApp extends Activity
{
public static final String TAG = "appKK";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
final Context context = this.getApplicationContext();
{
ExceptionHandler.initialize( context );
if ( ExceptionHandler.needReport() )
{
Intent reportIntent = new Intent( context, ExceptionHandlerReportApp.class );
try
{
this.startActivity( reportIntent );
}
catch ( ActivityNotFoundException e )
{
Log.d( TAG, "need add Activity\n" + "<activity android:name=\"" + ExceptionHandlerReportApp.class.getName() + "\"/>\n" );
}
}
Log.d( TAG, "pre registHandler" );
ExceptionHandler.registHandler();
}
super.onCreate(savedInstanceState);
/* Create a TextView and set its content.
* the text is retrieved by calling a native
* function.
*/
LinearLayout layout = new LinearLayout( this );
layout.setOrientation( LinearLayout.VERTICAL );
TextView tv = new TextView(this);
tv.setText( "ExceptionHandler" );
layout.addView( tv );
Button btn1 = new Button( this );
btn1.setText( "invoke Exception" );
btn1.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view)
{
final int count = 2;
int[] array = new int[count];
int value = array[count]; // invoke IndexOutOfBOundsException
}
} );
layout.addView( btn1 );
Button btn2 = new Button( this );
btn2.setText( "switch Activity" );
btn2.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view)
{
Intent reportIntent = new Intent( context, ExceptionHandlerReportApp.class );
try
{
startActivity( reportIntent );
}
catch ( ActivityNotFoundException e )
{
Log.d( TAG, "need add Activity\n" + "<activity android:name=\"" + ExceptionHandlerReportApp.class.getName() + "\"/>\n", e );
}
}
} );
layout.addView( btn2 );
setContentView( layout );
}
}
|
[
"kiyofumi.kondoh+github@gmail.com"
] |
kiyofumi.kondoh+github@gmail.com
|
89c81463b67a738324c8b7fb9fe7a0df56827d11
|
7f497f7f47b53c17ca82dccda2a66abb58b53408
|
/src/JFrameMotoristas.java
|
0f001680d658849b9c45a01f99282a8b39b90487
|
[] |
no_license
|
vmfvmf/onibus
|
20392d62e70593edbfbb4f4fce4439db08c84b6f
|
f2bf559ea4ee5abc806a17b72ab554b656c3d082
|
refs/heads/master
| 2016-09-05T10:42:30.649369
| 2015-03-19T13:25:21
| 2015-03-19T13:25:21
| 31,274,539
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 31,272
|
java
|
import lib.jdb.connection.JDBConnection;
/*
* 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.
*/
/**
*
* @author vmf
*/
public class JFrameMotoristas extends javax.swing.JFrame {
/**
* Creates new form JFrameMotoristas
*/
public JFrameMotoristas() {
initComponents();
}
public JFrameMotoristas(JDBConnection jdb) {
initComponents();
jDBQueryMotorista.setJDBConnection(jdb);
jDBQuerySlaveMotoristaContatos.setJDBConnection(jdb);
jDBQuerySlaveMotoristaEndereco.setJDBConnection(jdb);
jDBQueryMotorista.execQuery();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jDBQuerySlaveMotoristaContatos = new lib.jdb.jdbquery.JDBQuerySlave();
jDBQueryMotorista = new lib.jdb.jdbquery.JDBQuery();
jDBControlStyle1 = new lib.jdb.control.jdbcontrolstyle.JDBControlStyle();
jDBQuerySlaveMotoristaEndereco = new lib.jdb.jdbquery.JDBQuerySlave();
jScrollPane3 = new javax.swing.JScrollPane();
jDBTable3 = new lib.jdb.control.jdbtable.JDBTable();
jTabbedPane3 = new javax.swing.JTabbedPane();
jPanel9 = new javax.swing.JPanel();
jLabel16 = new javax.swing.JLabel();
jDBTextField13 = new lib.jdb.control.jdbtextfield.JDBTextField();
jDBTextField14 = new lib.jdb.control.jdbtextfield.JDBTextField();
jLabel17 = new javax.swing.JLabel();
jDBTextFieldSalarioBruto = new lib.jdb.control.jdbtextfield.JDBTextField();
jLabel19 = new javax.swing.JLabel();
jDBButtonSave4 = new lib.jdb.control.jdbbuttonsave.JDBButtonSave();
jDBButtonNew3 = new lib.jdb.control.jdbbuttonnew.JDBButtonNew();
jLabelSalLiquido = new javax.swing.JLabel();
jDBButtonDelete3 = new lib.jdb.control.jdbbuttondelete.JDBButtonDelete();
jLabel3 = new javax.swing.JLabel();
jDBTextField3 = new lib.jdb.control.jdbtextfield.JDBTextField();
jLabel35 = new javax.swing.JLabel();
jDBTextField26 = new lib.jdb.control.jdbtextfield.JDBTextField();
jPanel10 = new javax.swing.JPanel();
jLabel21 = new javax.swing.JLabel();
jDBTextField16 = new lib.jdb.control.jdbtextfield.JDBTextField();
jLabel22 = new javax.swing.JLabel();
jDBTextField17 = new lib.jdb.control.jdbtextfield.JDBTextField();
jLabel23 = new javax.swing.JLabel();
jDBTextField18 = new lib.jdb.control.jdbtextfield.JDBTextField();
jDBButtonSave5 = new lib.jdb.control.jdbbuttonsave.JDBButtonSave();
jPanel11 = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
jDBTable4 = new lib.jdb.control.jdbtable.JDBTable();
jLabel26 = new javax.swing.JLabel();
jDBComboBox4 = new lib.jdb.control.jdbcombobox.JDBComboBox();
jDBTextField21 = new lib.jdb.control.jdbtextfield.JDBTextField();
jDBButtonSave6 = new lib.jdb.control.jdbbuttonsave.JDBButtonSave();
jDBButtonNew4 = new lib.jdb.control.jdbbuttonnew.JDBButtonNew();
jDBButtonDelete2 = new lib.jdb.control.jdbbuttondelete.JDBButtonDelete();
jDBQuerySlaveMotoristaContatos.setJDBQueryMaster(jDBQueryMotorista);
jDBQuerySlaveMotoristaContatos.setSQL("select * from contato where id in( select contato_id from motorista_contatos where motorista_id = {$id})");
jDBQuerySlaveMotoristaContatos.setMasterKeyField("id");
jDBQuerySlaveMotoristaContatos.setSlaveForeignKeyField("id");
jDBQuerySlaveMotoristaContatos.addInsertEventListener(new lib.jdb.jdbquery.event.InsertEventListener() {
public void beforeInsert(lib.jdb.jdbquery.event.InsertEventObject evt) {
jDBQuerySlaveMotoristaContatosBeforeInsert(evt);
}
public void afterInsert(lib.jdb.jdbquery.event.InsertEventObject evt) {
jDBQuerySlaveMotoristaContatosAfterInsert(evt);
}
});
jDBQueryMotorista.setSQL("select * from motorista");
jDBQueryMotorista.addScrollEventListener(new lib.jdb.jdbquery.event.ScrollEventListener() {
public void beforeScroll(lib.jdb.jdbquery.event.ScrollEventObject evt) {
}
public void afterScroll(lib.jdb.jdbquery.event.ScrollEventObject evt) {
jDBQueryMotoristaAfterScroll(evt);
}
});
jDBQuerySlaveMotoristaEndereco.setJDBQueryMaster(jDBQueryMotorista);
jDBQuerySlaveMotoristaEndereco.setSQL("select * from endereco_motorista where motorista_id = {$id}");
jDBQuerySlaveMotoristaEndereco.setMasterKeyField("id");
jDBQuerySlaveMotoristaEndereco.setSaveManually(true);
jDBQuerySlaveMotoristaEndereco.setSlaveForeignKeyField("motorista_id");
jDBQuerySlaveMotoristaEndereco.addExecQueryEventListener(new lib.jdb.jdbquery.event.ExecQueryEventListener() {
public void beforeExecQuery(lib.jdb.jdbquery.event.ExecQueryEventObject evt) {
}
public void afterExecQuery(lib.jdb.jdbquery.event.ExecQueryEventObject evt) {
jDBQuerySlaveMotoristaEnderecoAfterExecQuery(evt);
}
});
jDBQuerySlaveMotoristaEndereco.addSaveManuallyEventListener(new lib.jdb.jdbquery.event.SaveManuallyEventListener() {
public void onSaveManually(lib.jdb.jdbquery.event.SaveManuallyEventObject evt) {
jDBQuerySlaveMotoristaEnderecoOnSaveManually(evt);
}
});
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Motoristas");
jDBTable3.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jDBTable3.setJDBQuery(jDBQueryMotorista);
jDBTable3.setEditable(false);
jDBTable3.setInvisibleFields("id");
jScrollPane3.setViewportView(jDBTable3);
jLabel16.setText("Nome");
jDBTextField13.setJDBQuery(jDBQueryMotorista);
jDBTextField13.setFieldName("motorista");
jDBTextField14.setJDBQuery(jDBQueryMotorista);
jDBTextField14.setFieldName("cpf");
jLabel17.setText("CPF");
jDBTextFieldSalarioBruto.setJDBQuery(jDBQueryMotorista);
jDBTextFieldSalarioBruto.setFieldName("salario");
jDBTextFieldSalarioBruto.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jDBTextFieldSalarioBrutoKeyReleased(evt);
}
});
jLabel19.setText("Salário Bruto");
jDBButtonSave4.setJDBQuery(jDBQueryMotorista);
jDBButtonNew3.setJDBQuery(jDBQueryMotorista);
jLabelSalLiquido.setText("INSS R$ 0,00 + Salário Líquido R$ 0,00");
jDBButtonDelete3.setJDBQuery(jDBQueryMotorista);
jLabel3.setText("Dist. Trajeto");
jDBTextField3.setJDBQuery(jDBQueryMotorista);
jDBTextField3.setFieldName("distancia_trajeto");
jLabel35.setText("Comb./Km");
jDBTextField26.setJDBQuery(jDBQueryMotorista);
jDBTextField26.setFieldName("litro_combustivel_por_km");
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel19)
.addComponent(jLabel17, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING))
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel35)
.addComponent(jLabel3)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addComponent(jDBTextFieldSalarioBruto, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabelSalLiquido, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
.addGap(6, 6, 6))
.addGroup(jPanel9Layout.createSequentialGroup()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jDBTextField13, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
.addComponent(jDBTextField14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(17, 17, 17))
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jDBButtonDelete3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBButtonNew3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBButtonSave4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(jPanel9Layout.createSequentialGroup()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jDBTextField26, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(jDBTextField3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(jDBTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel17)
.addComponent(jDBTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDBTextFieldSalarioBruto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19)
.addComponent(jLabelSalLiquido))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDBTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDBTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel35))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDBButtonSave4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBButtonNew3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBButtonDelete3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jTabbedPane3.addTab("Dados", jPanel9);
jLabel21.setText("Rua");
jDBTextField16.setJDBQuery(jDBQuerySlaveMotoristaEndereco);
jDBTextField16.setFieldName("rua");
jLabel22.setText("Num.");
jDBTextField17.setJDBQuery(jDBQuerySlaveMotoristaEndereco);
jDBTextField17.setFieldName("num");
jLabel23.setText("Bairro");
jDBTextField18.setJDBQuery(jDBQuerySlaveMotoristaEndereco);
jDBTextField18.setFieldName("bairro");
jDBButtonSave5.setJDBQuery(jDBQuerySlaveMotoristaEndereco);
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
jPanel10.setLayout(jPanel10Layout);
jPanel10Layout.setHorizontalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel23)
.addComponent(jLabel21)
.addComponent(jLabel22))
.addGap(4, 4, 4)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDBTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 353, Short.MAX_VALUE)
.addComponent(jDBButtonSave5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel10Layout.createSequentialGroup()
.addComponent(jDBTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel10Layout.setVerticalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel21)
.addComponent(jDBTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel22)
.addComponent(jDBTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel23)
.addComponent(jDBTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
.addComponent(jDBButtonSave5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jTabbedPane3.addTab("Endereço", jPanel10);
jDBTable4.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jDBTable4.setJDBQuery(jDBQuerySlaveMotoristaContatos);
jDBTable4.setInvisibleFields("id");
jScrollPane4.setViewportView(jDBTable4);
jLabel26.setText("Tipo");
jDBComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Celular", "Email", "Telefone" }));
jDBComboBox4.setJDBQuery(jDBQuerySlaveMotoristaContatos);
jDBComboBox4.setFieldName("tipo");
jDBTextField21.setJDBQuery(jDBQuerySlaveMotoristaContatos);
jDBTextField21.setFieldName("contato");
jDBButtonSave6.setJDBQuery(jDBQuerySlaveMotoristaContatos);
jDBButtonNew4.setJDBQuery(jDBQuerySlaveMotoristaContatos);
jDBButtonDelete2.setJDBQuery(jDBQuerySlaveMotoristaContatos);
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 642, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(jLabel26)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBTextField21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jDBButtonDelete2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBButtonNew4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDBButtonSave6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel11Layout.setVerticalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel26)
.addComponent(jDBComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDBButtonSave6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBButtonNew4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDBButtonDelete2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jTabbedPane3.addTab("Contatos", jPanel11);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane3)
.addComponent(jScrollPane3))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jDBTextFieldSalarioBrutoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jDBTextFieldSalarioBrutoKeyReleased
calcInss();
}//GEN-LAST:event_jDBTextFieldSalarioBrutoKeyReleased
private void jDBQuerySlaveMotoristaContatosBeforeInsert(lib.jdb.jdbquery.event.InsertEventObject evt) {//GEN-FIRST:event_jDBQuerySlaveMotoristaContatosBeforeInsert
jDBQuerySlaveMotoristaContatos.setNewCurrentFieldValue("id", null);
}//GEN-LAST:event_jDBQuerySlaveMotoristaContatosBeforeInsert
private void jDBQuerySlaveMotoristaContatosAfterInsert(lib.jdb.jdbquery.event.InsertEventObject evt) {//GEN-FIRST:event_jDBQuerySlaveMotoristaContatosAfterInsert
/* jDBUpdateTransaction1.setSQL("insert into motorista_contatos values("+
jDBQueryMotorista.getCurrentFieldValue("id") +","+
jDBQuerySlaveMotoristaContatos.getCurrentFieldValue("id")+")");
try {
jDBUpdateTransaction1.execUpdate();
} catch (SQLException ex) {
Logger.getLogger(JFramePrincipal.class.getName()).log(Level.SEVERE, null, ex);
}*/
}//GEN-LAST:event_jDBQuerySlaveMotoristaContatosAfterInsert
private void calcInss() {
if(jDBTextFieldSalarioBruto.getText().length() > 0){
float sal = Float.parseFloat(jDBTextFieldSalarioBruto.getText().replace(",", "."));
jLabelSalLiquido.setText(String.format("INSS R$ %.2f + Salário Líquido R$ %.2f",
sal*0.1015,sal-(sal*0.1015)));
}
}
private void jDBQueryMotoristaAfterScroll(lib.jdb.jdbquery.event.ScrollEventObject evt) {//GEN-FIRST:event_jDBQueryMotoristaAfterScroll
calcInss();
}//GEN-LAST:event_jDBQueryMotoristaAfterScroll
private void jDBQuerySlaveMotoristaEnderecoAfterExecQuery(lib.jdb.jdbquery.event.ExecQueryEventObject evt) {//GEN-FIRST:event_jDBQuerySlaveMotoristaEnderecoAfterExecQuery
if(jDBQuerySlaveMotoristaEndereco.getRow() < 1){
jDBQuerySlaveMotoristaEndereco.insert();
}
}//GEN-LAST:event_jDBQuerySlaveMotoristaEnderecoAfterExecQuery
private void jDBQuerySlaveMotoristaEnderecoOnSaveManually(lib.jdb.jdbquery.event.SaveManuallyEventObject evt) {//GEN-FIRST:event_jDBQuerySlaveMotoristaEnderecoOnSaveManually
jDBQuerySlaveMotoristaEndereco.save();
}//GEN-LAST:event_jDBQuerySlaveMotoristaEnderecoOnSaveManually
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(JFrameMotoristas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(JFrameMotoristas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(JFrameMotoristas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JFrameMotoristas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JFrameMotoristas().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private lib.jdb.control.jdbbuttondelete.JDBButtonDelete jDBButtonDelete2;
private lib.jdb.control.jdbbuttondelete.JDBButtonDelete jDBButtonDelete3;
private lib.jdb.control.jdbbuttonnew.JDBButtonNew jDBButtonNew3;
private lib.jdb.control.jdbbuttonnew.JDBButtonNew jDBButtonNew4;
private lib.jdb.control.jdbbuttonsave.JDBButtonSave jDBButtonSave4;
private lib.jdb.control.jdbbuttonsave.JDBButtonSave jDBButtonSave5;
private lib.jdb.control.jdbbuttonsave.JDBButtonSave jDBButtonSave6;
private lib.jdb.control.jdbcombobox.JDBComboBox jDBComboBox4;
private lib.jdb.control.jdbcontrolstyle.JDBControlStyle jDBControlStyle1;
private lib.jdb.jdbquery.JDBQuery jDBQueryMotorista;
private lib.jdb.jdbquery.JDBQuerySlave jDBQuerySlaveMotoristaContatos;
private lib.jdb.jdbquery.JDBQuerySlave jDBQuerySlaveMotoristaEndereco;
private lib.jdb.control.jdbtable.JDBTable jDBTable3;
private lib.jdb.control.jdbtable.JDBTable jDBTable4;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField13;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField14;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField16;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField17;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField18;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField21;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField26;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextField3;
private lib.jdb.control.jdbtextfield.JDBTextField jDBTextFieldSalarioBruto;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel35;
private javax.swing.JLabel jLabelSalLiquido;
private javax.swing.JPanel jPanel10;
private javax.swing.JPanel jPanel11;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JTabbedPane jTabbedPane3;
// End of variables declaration//GEN-END:variables
}
|
[
"vmf@vmf-pc"
] |
vmf@vmf-pc
|
b9638f803448bb47318e1aa7d8c2a3633f4c12f0
|
7a2cd6e07b002598e34a2b4f87b3889111ab23dd
|
/aigou-common-parent/common-service/src/main/java/cn/itsource/commom/controller/RedisController.java
|
5aa03857d9bff6469e9fc82593afe5973078f9bf
|
[] |
no_license
|
Ugly-kai/aigou-parent
|
868b3a054ca4bcb483cab56037da8d06fa563702
|
9f00653275e772b28c6d606fa6dee1154c714b2d
|
refs/heads/master
| 2022-07-03T07:22:44.867637
| 2019-08-07T13:50:12
| 2019-08-07T13:50:12
| 199,229,341
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,528
|
java
|
package cn.itsource.commom.controller;
import cn.itsource.common.client.RedisClient;
import cn.itsource.basic.util.AjaxResult;
import cn.itsource.basic.util.RedisUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class RedisController implements RedisClient {
/**
* 缓存数据
* @param key
* @param value
* @return
*/
@PostMapping("/redis")
public AjaxResult set(@RequestParam("key")String key, @RequestParam("value") String value){
try {
RedisUtils.INSTANCE.set(key,value);
return AjaxResult.me().setSuccess(true).setMessage("保存成功!");
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.me().setSuccess(false).setMessage("保存失败!"+e.getMessage());
}
}
/**
* 获取缓存数据
* @param key
* @return
*/
@GetMapping("/redis")
public AjaxResult get(@RequestParam("key")String key){
try {
String value = RedisUtils.INSTANCE.get(key);
return AjaxResult.me().setSuccess(true).setMessage("成功").setRestObj(value);
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.me().setSuccess(false).setMessage("系统异常!"+e.getMessage());
}
}
}
|
[
"user@163.com"
] |
user@163.com
|
6c2599eaa6a521dd9cb354a5f6392963baa506dd
|
951ff57f2df93eddf0a63e8521124f0ba96d6c03
|
/ProjectRMI/src/main/java/connection/ClientInterface.java
|
180adaa21585fe9f14b4ce87bbcab8d4bfd9cdc4
|
[] |
no_license
|
Stephen-ODriscoll/2018_DistributedSystems
|
cf87298b2ded1ea494d37a42521df829aeba8ba7
|
081572053732ed77030693e3de0873e6a764ccdf
|
refs/heads/master
| 2020-06-07T09:59:01.238031
| 2019-06-23T21:42:11
| 2019-06-23T21:42:11
| 192,993,485
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 318
|
java
|
package connection;
import java.rmi.*;
import java.util.ArrayList;
public interface ClientInterface extends Remote {
public void check(ArrayList<String> newfileNames, ArrayList<byte[]> newFiles) throws RemoteException;
public void add(ArrayList<String> names, ArrayList<byte[]> toAdd) throws RemoteException;
}
|
[
"programming@citsocieties.ie"
] |
programming@citsocieties.ie
|
b2afc1d2aebeb995e51222168c288a66d4ee8348
|
affe223efe18ba4d5e676f685c1a5e73caac73eb
|
/clients/utilities/src/main/java/com/intalio/vmware/general/package-info.java
|
fab533468234f1e08dfcd178dd76a692e43f3663
|
[] |
no_license
|
RohithEngu/VM27
|
486f6093e0af2f6df1196115950b0d978389a985
|
f0f4f177210fd25415c2e058ec10deb13b7c9247
|
refs/heads/master
| 2021-01-16T00:42:30.971054
| 2009-08-14T19:58:16
| 2009-08-14T19:58:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 291
|
java
|
/**
* Several sample applications that demonstrate a variety of inventory operations,
* such as connecting to the server (Connect), browsing the inventory (Browse),
* and moving an entity from one location in the inventory to another (Move).
*/
package com.intalio.vmware.general;
|
[
"sankarachary@intalio.com"
] |
sankarachary@intalio.com
|
f98417097b15da913eda649e9130da63a3fc53a5
|
7afeb6eaedd5a4561995daaa30b46bcfde738f1d
|
/src/kr/or/ddit/basic/JdbcTest06.java
|
3faf7fcfdf39cf8fcebbdecd9b72af5234543275
|
[] |
no_license
|
songhaseob/jdbcTest
|
7fcbfb998d230cf272b88acde9f878f5727a5b1f
|
2667ad2160c403ebfc736695d7e9ba2a3f2480e1
|
refs/heads/master
| 2023-02-28T11:38:35.609985
| 2021-02-06T06:33:57
| 2021-02-06T06:33:57
| 336,472,767
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,473
|
java
|
package kr.or.ddit.basic;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
import kr.or.ddit.util.DBUtil;
import kr.or.ddit.util.DBUtil2;
import kr.or.ddit.util.DBUtil3;
/*
회원을 관리하는 프로그램 작성하기
(DB시스템의 MYMEMBER테이블 이용)
- 처리조건
1. 아래 메뉴의 기능을 모두 구현한다.(CRUD 구현하기)
2. '자료 추가'에서는 입력한 회원 ID가 중복되는지 여부를 검사해서 중복되면 다시 입력 받도록 한다.
3. '자료 삭제'는 회원 ID를 입력 받아 삭제한다.
4. '자료 수정'은 회원 ID를 제외한 전체 자료를 수정한다.
메뉴예시)
-- 작업 선택 --
1. 자료 추가 ---> insert (C)
2. 자료 삭제 ---> delete (D)
3. 자료 수정 ---> update (U)
4. 전체 자료 출력 ---> select (R)
0. 작업 끝.
-----------------
작업 번호 >>
*/
public class JdbcTest06 {
private Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
new JdbcTest06().memberStart();
}
public void memberStart() {
while(true) {
int choice = displayMenu();
switch(choice) {
case 1 : insertMember(); // 추가
break;
case 2 : deleteMember(); // 삭제
break;
case 3 : updateMember(); // 수정
break;
case 4 : displayMember(); // 전체 출력
break;
case 0 :
System.out.println();
System.out.println("프로그램을 종료합니다.");
return;
default :
System.out.println("잘못 선택했습니다. 다시 입력하세요.");
System.out.println();
}
}
}
private int displayMenu() {
System.out.println();
System.out.println(" -- 작업 선택 --");
System.out.println(" 1. 자료 추가");
System.out.println(" 2. 자료 삭제");
System.out.println(" 3. 자료 수정");
System.out.println(" 4. 전체 자료 출력");
System.out.println(" 0. 작업 끝.");
System.out.println("----------------");
System.out.print(" 작업 선택 >> ");
return scan.nextInt();
}
// 회원 정보를 수정하는 메서드
private void updateMember() {
Connection conn = null;
PreparedStatement pstmt = null;
System.out.println();
System.out.println("수정할 회원 정보를 입력하세요.");
System.out.print("수정할 회원 ID >> ");
String memId = scan.next();
int count = getMemberCount(memId);
if(count==0) {
System.out.println(memId + "는 없는 회원 ID 입니다.");
System.out.println("수정 작업 종료");
return;
}
System.out.print("새로운 회원 이름 : ");
String memName = scan.next();
System.out.print("새로운 전화번호 : ");
String memTel = scan.next();
scan.nextLine();
System.out.print("새로운 회원 주소 : ");
String memAddr = scan.nextLine();
try {
conn = DBUtil.getConnection();
String sql = "update mymember set mem_name = ? , mem_tel = ?, "
+ "mem_addr = ? where mem_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, memName);
pstmt.setString(2, memTel);
pstmt.setString(3, memAddr);
pstmt.setString(4, memId);
int cnt = pstmt.executeUpdate();
if(cnt>0) {
System.out.println("update 작업 성공~~~");
}else {
System.out.println("수정 작업 실패!!!");
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
if(pstmt!=null) try { pstmt.close(); }catch(SQLException e) {}
if(conn!=null) try { conn.close(); }catch(SQLException e) {}
}
}
// 회원 정보를 삭제하는 메서드
private void deleteMember() {
Connection conn = null;
PreparedStatement pstmt = null;
System.out.println();
System.out.println("삭제할 회원 정보를 입력하세요.");
System.out.print("삭제할 회원 ID >> ");
String memId = scan.next();
int count = getMemberCount(memId);
if(count==0) {
System.out.println(memId + "는 없는 회원 ID 입니다.");
System.out.println("삭제 작업 종료");
return;
}
try {
conn = DBUtil.getConnection();
String sql = "delete from mymember where mem_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, memId);
int cnt = pstmt.executeUpdate();
if(cnt>0) {
System.out.println("삭제 작업 성공!!!");
}else {
System.out.println("삭제 작업 실패~~~");
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
if(pstmt!=null) try { pstmt.close(); }catch(SQLException e) {}
if(conn!=null) try { conn.close(); }catch(SQLException e) {}
}
}
// 회원 정보를 추가하는 메서드
private void insertMember() {
Connection conn = null;
PreparedStatement pstmt = null;
System.out.println();
System.out.println("추가할 회원 정보를 입력하세요.");
int count = 0;
String memId = null;
do {
System.out.print("회원 ID : ");
memId = scan.next();
count = getMemberCount(memId);
if(count>0) {
System.out.println(memId + "은(는) 이미 등록된 ID입니다.");
System.out.println("다른 회원 ID를 입력하세요.");
System.out.println();
}
}while(count>0);
System.out.print("회원 이름 : ");
String memName = scan.next();
System.out.print("전화번호 : ");
String memTel = scan.next();
scan.nextLine(); // 입력 버퍼 비우기
System.out.print("회원 주소 : ");
String memAddr = scan.nextLine();
try {
conn = DBUtil.getConnection();
String sql = "insert into mymember (mem_id, mem_name, mem_tel, mem_addr) "
+ " values (?, ?, ?, ?) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, memId);
pstmt.setString(2, memName);
pstmt.setString(3, memTel);
pstmt.setString(4, memAddr);
int cnt = pstmt.executeUpdate();
if(cnt>0) {
System.out.println(memId + "회원 정보 추가 성공!!");
}else {
System.out.println("추가 작업 실패~~~~");
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
if(pstmt!=null) try { pstmt.close(); }catch(SQLException e) {}
if(conn!=null) try { conn.close(); }catch(SQLException e) {}
}
}
// 매개변수로 회원ID를 받아서 해당 회원ID의 개수를 반환하는 메서드
private int getMemberCount(String memId) {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
int count = 0; // 회원ID의 개수가 저장될 변수
try {
conn = DBUtil.getConnection();
String sql = "select count(*) cnt from mymember where mem_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, memId);
rs = pstmt.executeQuery();
if(rs.next()) {
count = rs.getInt("cnt");
}
} catch (SQLException e) {
count = 0;
e.printStackTrace();
} finally {
if(rs!=null) try { rs.close(); }catch(SQLException e) {}
if(pstmt!=null) try { pstmt.close(); }catch(SQLException e) {}
if(conn!=null) try { conn.close(); }catch(SQLException e) {}
}
return count;
}
// 전체 회원 정보를 출력하는 메서드
private void displayMember() {
System.out.println();
System.out.println("--------------------------------------");
System.out.println(" ID 이름 전화번호 주소");
System.out.println("--------------------------------------");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
// conn = DBUtil.getConnection();
// conn = DBUtil2.getConnection();
conn = DBUtil3.getConnection();
String sql = "select * from mymember";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next()) {
String memId = rs.getString("mem_id");
String memName = rs.getString("mem_name");
String memTel = rs.getString("mem_tel");
String memAddr = rs.getString("mem_addr");
System.out.println(memId + "\t" + memName +
"\t" + memTel + "\t" + memAddr);
}
System.out.println("--------------------------------------");
} catch (SQLException e) {
e.printStackTrace();
} finally {
if(rs!=null) try { rs.close(); }catch(SQLException e) {}
if(stmt!=null) try { stmt.close(); }catch(SQLException e) {}
if(conn!=null) try { conn.close(); }catch(SQLException e) {}
}
}
}
|
[
"songhaseob@gmail.com"
] |
songhaseob@gmail.com
|
cf9746dee84534a90593579a16cc66836d4294fa
|
1540e8a1e7c3b53c0275b1907d90cffe519e9592
|
/gmall-bean/src/main/java/com/auberge/gmall/bean/SpuSaleAttrValue.java
|
e5c7eaf42eea8df894fc31507b3f132cfcf324ee
|
[] |
no_license
|
auberge/gmall2020
|
52b8a7159bc99c42ed774dedbd221f6e9a044e03
|
a365f0662d9fef811e472822a85440af6e830cb8
|
refs/heads/master
| 2022-10-07T11:24:47.557302
| 2020-02-28T18:41:37
| 2020-02-28T18:41:37
| 239,351,392
| 0
| 0
| null | 2022-09-01T23:21:04
| 2020-02-09T18:17:18
|
HTML
|
UTF-8
|
Java
| false
| false
| 425
|
java
|
package com.auberge.gmall.bean;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
@Data
public class SpuSaleAttrValue implements Serializable {
@Id
@Column
String id;
@Column
String spuId;
@Column
String saleAttrId;
@Column
String saleAttrValueName;
@Transient
String isChecked;
}
|
[
"761476328@qq.com"
] |
761476328@qq.com
|
317b945872716392835fb70c96b249cace19db09
|
ce05b49ec82a7eb0c483b48a523bca679199467a
|
/Uni/Java/WS1516/Programmieren/Assignment6B_Bank/src/edu/kit/informatik/exceptions/AccountDoesNotExistException.java
|
a455f468252a09ade757653a96dae07653ee2acd
|
[
"MIT"
] |
permissive
|
13hannes11/archive
|
7e60e6f5092fb96bf7f5eed339a9f193fd63ac93
|
8c94608805160ff7cf94039cd1ca1a644e0a0fd8
|
refs/heads/master
| 2021-08-08T07:54:59.208100
| 2017-11-09T23:13:57
| 2017-11-09T23:13:57
| 110,175,995
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 351
|
java
|
package edu.kit.informatik.exceptions;
/**
* The Class AccountDoesNotExistException.
*
* @author Hannes Kuchelmeister
* @version 1.0
*/
public class AccountDoesNotExistException extends Exception {
/**
* Instantiates a new account does not exist exception.
*/
public AccountDoesNotExistException() {
super();
}
}
|
[
"13hannes11@gmail.com"
] |
13hannes11@gmail.com
|
3ee4bba44983f1d00235052eda0b97582af67bc5
|
24cd6cb41472f8a57524b86953b58d0f381a8342
|
/src/SecretBox/SHA256Code.java
|
4abc06e4a4da69965931fce6335fdd73c6eb0073
|
[] |
no_license
|
watermelonsuperman/-mySecretBox
|
3abaaa19c25c2334e497c9fbfd778ac69a97db47
|
207b1333f2394ff9ecd08352dcfb5c8f6863a98f
|
refs/heads/main
| 2023-02-09T10:05:15.961870
| 2020-12-31T09:55:49
| 2020-12-31T09:55:49
| 325,733,918
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,252
|
java
|
package SecretBox;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SHA256Code {
public static String getSHA256StrJava(String str){
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("UTF-8"));
encodeStr = byte2Hex(messageDigest.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return encodeStr;
}
/**
* 将byte转为16进制
* @param bytes
* @return
*/
private static String byte2Hex(byte[] bytes){
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i=0;i<bytes.length;i++){
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length()==1){
//1得到一位的进行补0操作
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}
|
[
"15538287230@163.com"
] |
15538287230@163.com
|
9a8996cb0e957c0ae0323811d2a4633df1a2c7d1
|
2c39fe3ccaf28abc39b0a4e49da2d872a27ad3c8
|
/src/main/java/com/dh/tomcat/t03/HttpConnector.java
|
d76b33b62be0d513da4eba4853abbe3cefa4b060
|
[] |
no_license
|
dinghung/tomcat
|
8aefb108dfc352e28d7aef7ecc0c6337eea671ae
|
948c424f07da0cdad631a0ff57574ab7d19490b8
|
refs/heads/master
| 2020-04-02T13:26:30.043286
| 2018-10-29T07:28:20
| 2018-10-29T07:28:20
| 154,481,183
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 60
|
java
|
package com.dh.tomcat.t03;
public class HttpConnector {
}
|
[
"hung12077373@qq.com"
] |
hung12077373@qq.com
|
76a03d3d8813ec7726196d21d08bb8ebdf960422
|
c42a2c7a3705fd49cc71fee3daaf03ceb5d11f45
|
/src/main/java/edu/mum/controller/UserDetailsController.java
|
57fa52e41646349702017f2650beaee3f25eb20a
|
[] |
no_license
|
shirazshrestha/usermgmt
|
0ec1822a87c4e344046f1095ab3626d3d6cee7bd
|
eae9d7b33a9c9cc40a0c2b719873c5ae4b7fa837
|
refs/heads/master
| 2020-06-28T15:28:45.333939
| 2019-08-02T16:52:30
| 2019-08-02T16:52:30
| 200,268,554
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 878
|
java
|
package edu.mum.controller;
import edu.mum.domain.User;
import edu.mum.service.UserService;
import edu.mum.service.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet("/userDetails")
public class UserDetailsController extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserService service = new UserServiceImpl();
List<User> users = service.getAllUser();
request.setAttribute("users", users);
request.getRequestDispatcher("/WEB-INF/jsp/userDetails.jsp").forward(request, response);
}
}
|
[
"shirazshrestha008@gmail.com"
] |
shirazshrestha008@gmail.com
|
350e64e323879658ab831d88e4e9e76bc5b560c8
|
66092bcd764abe09d1d8bdbe7644395fedd4b8c6
|
/src/test/java/hello/typeconverter/converter/ConverterTest.java
|
40321cebe9dcd90dff6ac7f2765a499ad151479e
|
[] |
no_license
|
deokgoni/typeconverter
|
492f8b28d5d70a550c6b976623ab27b898627f41
|
0569b5198e73803eb1af22c8fcea095454b8e148
|
refs/heads/master
| 2023-07-04T02:21:32.556203
| 2021-07-27T05:26:08
| 2021-07-27T05:26:08
| 389,844,079
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,286
|
java
|
package hello.typeconverter.converter;
import hello.typeconverter.type.IpPort;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest
public class ConverterTest {
@Test
void stringToInterger(){
StringToIntegerConverter converter = new StringToIntegerConverter();
Integer convert = converter.convert("22");
assertThat(22).isEqualTo(convert);
}
@Test
void IntegerToString(){
IntegerToStringConverter conv = new IntegerToStringConverter();
String result = conv.convert(333);
assertThat("333").isEqualTo(result);
}
@Test
void stringIpPort(){
IpPortToStringConverter converter = new IpPortToStringConverter();
IpPort source = new IpPort("127.0.0.1", 8080);
String result = converter.convert(source);
assertThat("127.0.0.1:8080").isEqualTo(result);
}
@Test
void IpPortString(){
StringToIpPortConverter converter = new StringToIpPortConverter();
IpPort result = converter.convert("127.0.0.1:8080");
System.out.println("result = " + result);
assertThat(result).isEqualTo(new IpPort("127.0.0.1", 8080));
}
}
|
[
"topgon86@naver.com"
] |
topgon86@naver.com
|
2433cbe92d61867a1a05ddbde2faec212cf8b8bf
|
406ea9dbcaed427aecc02847a7cabbc42b5f8976
|
/src/main/java/com/landawn/abacus/validator/Validator.java
|
b07c1b8b60af80e4357ecf29e054b9fc7b51128e
|
[
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
landawn/abacus-entity-manager
|
9348c059e03487474f0b362d384414765b50449b
|
8726d717d475397e81ef5725dc1f6da79e4249c3
|
refs/heads/master
| 2023-08-05T03:15:40.124006
| 2023-07-28T02:18:53
| 2023-07-28T02:18:53
| 200,414,924
| 1
| 0
|
Apache-2.0
| 2023-07-28T02:18:54
| 2019-08-03T19:46:12
|
Java
|
UTF-8
|
Java
| false
| false
| 1,364
|
java
|
/*
* Copyright (C) 2015 HaiYang Li
*
* 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.landawn.abacus.validator;
import com.landawn.abacus.exception.ValidationException;
import com.landawn.abacus.type.Type;
// TODO: Auto-generated Javadoc
/**
*
* @author Haiyang Li
* @param <T>
* @since 0.8
*/
public interface Validator<T> {
/**
*
* @return Property
*/
String getPropName();
/**
*
* @return Type
*/
Type<T> getType();
/**
*
* @param propValue
* @return boolean
*/
boolean isValid(T propValue);
/**
*
* @param propValue
* @return TODO
* @throws ValidationException if {@code isValid()} returns {@code false}
*/
T validate(T propValue) throws ValidationException;
}
|
[
"landawn@users.noreply.github.com"
] |
landawn@users.noreply.github.com
|
1c1c6fbf7a17b1a24c3328eb1342c8d144884239
|
5045fb7f16459cd25897a0829345ddf5436ed229
|
/FtcRobotController/src/main/java/org/firstinspires/ftc/team7316/util/commands/conditions/ButtonCondition.java
|
442ff197af0f164746ac5c77632dc255caede4fd
|
[
"BSD-3-Clause"
] |
permissive
|
Iron-Panthers/FTC-2016
|
4b8ea6ff2c82eb45b0e4f7d3ebbbe4abbc03ea73
|
bbd82181bd9e4f8ae455018f9fb33e1b9214a206
|
refs/heads/master
| 2020-04-03T10:31:15.500983
| 2017-09-04T05:25:22
| 2017-09-04T05:25:22
| 68,863,512
| 1
| 0
| null | 2016-11-02T03:06:56
| 2016-09-21T22:41:24
|
Java
|
UTF-8
|
Java
| false
| false
| 425
|
java
|
package org.firstinspires.ftc.team7316.util.commands.conditions;
import com.qualcomm.robotcore.hardware.TouchSensor;
/**
* Created by andrew on 11/17/16.
*/
public class ButtonCondition implements Conditional {
private TouchSensor sensor;
public ButtonCondition(TouchSensor sensor) {
this.sensor = sensor;
}
@Override
public boolean state() {
return this.sensor.isPressed();
}
}
|
[
"agcummings11@gmail.com"
] |
agcummings11@gmail.com
|
c70c3282b789354cd42f50d9fbc47ff8803662c7
|
5c5efb6e06ef21ca74ee3e0a9cae8f3e7bf893b8
|
/src/main/java/Booking.java
|
a8a25589f47ce9773abacceee97b87a3c7483d75
|
[] |
no_license
|
mqprogramming/week-11-cc-tower-lab
|
159414693da292ccd5c3fbb37cdcdc9132a3ac2f
|
66e314ccd7c8798140e5812a01fa3c0c19702d3f
|
refs/heads/master
| 2022-04-26T14:23:42.981969
| 2020-04-29T14:04:26
| 2020-04-29T14:04:26
| 259,946,942
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 318
|
java
|
public class Booking {
private int nightsBooked;
private Bedroom bedroom;
public Booking(int nightsBooked, Bedroom bedroom){
this.nightsBooked = nightsBooked;
this.bedroom = bedroom;
}
public int totalBill() {
return (this.nightsBooked * this.bedroom.getRate());
}
}
|
[
"matt.qgley@gmail.com"
] |
matt.qgley@gmail.com
|
f516f99f51735313a086ca77aa21cd381c7c7685
|
ae7b910663c454b51db59d087ada954de6c3808c
|
/profile-api/src/main/java/net/engining/profile/api/bean/request/department/UpdateDepartmentRequest.java
|
79a391536a4400cb97b9eac9fe65c80584fa18f8
|
[
"MIT"
] |
permissive
|
crazythinking/profile
|
34be76125f49e0185e813e9f2532efb9e136d147
|
f650409070edbeed2692bdbe03d1a201e1c2b83c
|
refs/heads/master
| 2021-06-11T03:42:37.215001
| 2021-01-08T02:44:51
| 2021-01-08T02:44:51
| 139,696,642
| 1
| 1
|
MIT
| 2020-01-04T03:16:21
| 2018-07-04T09:01:33
|
Java
|
UTF-8
|
Java
| false
| false
| 1,701
|
java
|
package net.engining.profile.api.bean.request.department;
import io.swagger.annotations.ApiModelProperty;
import net.engining.profile.api.bean.request.BaseOperateRequest;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @author zhaoyuanmin
* @version 1.0.0
* @date 2020/9/28 19:43
* @since 1.0.0
*/
public class UpdateDepartmentRequest extends BaseOperateRequest {
/**
* 部门ID
*/
@NotBlank(message = "请输入:部门ID")
@Length(max = 6, message = "部门ID的字段长度不能超过6个数字")
@ApiModelProperty(value = "部门ID|1-6位数字", example = "100001", required = true)
private String departmentId;
/**
* 部门名称
*/
@NotBlank(message = "请输入:部门名称")
@Length(max = 25, message = "部门名称的字段长度不能超过25个中文字符")
@ApiModelProperty(value = "部门名称|1-25个中文字符", example = "信息科技部", required = true)
private String departmentName;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
@Override
public String toString() {
return "UpdateDepartmentRequest{" +
"departmentId='" + departmentId + '\'' +
", departmentName='" + departmentName + '\'' +
", operatorId='" + operatorId + '\'' +
'}';
}
}
|
[
"1264859189@qq.com"
] |
1264859189@qq.com
|
0e77520646249184a42fcbbc34cdc0ddff2a281f
|
538334148a8f7bb39573ca81213b91175867001f
|
/src/main/java/com/movie/utils/PagingUtil.java
|
2845a21fb7de0ac1b14e6d3de4e3ecfce0ee321c
|
[] |
no_license
|
Kim-Hyeonseok/MyPortfolio
|
743ae8af28823e4b1612fbcd16a0043b474b1141
|
33c86bf1b8d741c4c5a58b7744e3d9f5fbe522fc
|
refs/heads/master
| 2023-06-12T21:58:07.987928
| 2021-07-11T14:54:46
| 2021-07-11T14:54:46
| 384,973,611
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,413
|
java
|
package com.movie.utils;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import javax.servlet.http.HttpServletResponse;
public class PagingUtil {
public static HashMap<String, Integer> setPaging(String clickedPage, int total) {
HashMap<String, Integer> hashMap = new HashMap<String, Integer>();
if (clickedPage == null) {
clickedPage = "1";
}
int pagePerCount = 9;
int numbering = 0;
int currentPage = Integer.parseInt(clickedPage);
int start = (currentPage - 1) * pagePerCount + 1;
int end = currentPage * pagePerCount;
int paginationTotal = (int) Math.floor(total / pagePerCount) + 1;
int pageGroup = 10;
int startPage = 1;
numbering = total - (currentPage - 1) * pagePerCount;
if (currentPage % pageGroup != 0) {
startPage = (int) (currentPage / pageGroup) * pageGroup + 1;
} else {
startPage = ((int) (currentPage / pageGroup) - 1) * pageGroup + 1;
}
int endPage = startPage + pageGroup - 1;
if (endPage > paginationTotal) {
endPage = paginationTotal;
}
hashMap.put("start", start);
hashMap.put("end", end);
hashMap.put("pageGroup", pageGroup);
hashMap.put("startPage", startPage);
hashMap.put("endPage", endPage);
hashMap.put("numbering", numbering);
hashMap.put("currentPage", currentPage);
return hashMap;
}
}
|
[
"k01085537827@gmail.com"
] |
k01085537827@gmail.com
|
3d445955591ceb1af6b9321280ad01e677f030ee
|
ccf3a77aea207f849bb2a403c06ea07df2f3ff94
|
/70.Climbing Stairs/code.java
|
d94838711b6458279a0fa6a12fcd72460387fd75
|
[] |
no_license
|
Yiel1990/Leetcode
|
100c5571a4b3e11beba559d27bd06b12cd98e1f0
|
1e9d6988809ff4303d4addcb0121493775e79342
|
refs/heads/master
| 2020-06-24T21:50:06.299516
| 2016-11-23T23:39:54
| 2016-11-23T23:39:54
| 74,618,510
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 623
|
java
|
public class Solution {
/*public int climbStairs(int n) {
int result ;
if(n == 0) return 1;
if(n == 1) return 1;
result = climbStairs(n - 1) + climbStairs(n - 2);
return result;
}*/
public int climbStairs(int n) {
// d[n] = d[n-1] + d[n-2]
int [] result = new int[n + 1];
for(int i = 0;i <= n;i++){
if(i == 0 || i == 1) result[i] = 1;
else result[i] = result[i - 1] + result[i - 2];
}
return result[n];
}
}
|
[
"zhaoyiou1990@163.com"
] |
zhaoyiou1990@163.com
|
fa5360ee33209b2f075c78c40236f10807e2ca42
|
754382d75fe48ca146bc1b88d63c2ff7f416bb51
|
/2.JavaCore/src/com/javarush/task/task18/task1814/TxtInputStream.java
|
18d78642974a7c32096fe85fe81a7b2ea32d4d8a
|
[] |
no_license
|
fromzer/JavaRushTasks
|
520fb8bf86ab0ba9b0a53cac66b88b405be0a901
|
dad199387c9aa64945352555f2cfa85af6724976
|
refs/heads/master
| 2021-04-08T04:34:13.584911
| 2020-04-25T09:24:04
| 2020-04-25T09:24:04
| 248,740,406
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 576
|
java
|
package com.javarush.task.task18.task1814;
import java.io.*;
import java.nio.channels.FileChannel;
/*
UnsupportedFileName
*/
public class TxtInputStream extends FileInputStream {
public TxtInputStream(String fileName) throws IOException, UnsupportedFileNameException {
super(fileName);
if (!fileName.endsWith(".txt")) {
super.close();
throw new UnsupportedFileNameException();
}
}
public TxtInputStream(FileDescriptor fdObj) {
super(fdObj);
}
public static void main(String[] args) {
}
}
|
[
"fromzer@mail.ru"
] |
fromzer@mail.ru
|
52e5dd667ba4d7bfb4f23c971c1d14be87de5151
|
54ef92fbe81f2a21bd9a1794484b77117d4806ae
|
/src/java/br/com/ads/siscee/model/entidade/Produto.java
|
2fee0b2b3e354c99be7c43757e2055ff6bb42165
|
[] |
no_license
|
eversontalpai/siscee
|
271fa73c48027745584edda1417581a428d57df6
|
cc4b1ed3981526a2dc58c95119313cb46265e7c3
|
refs/heads/master
| 2021-09-09T05:31:40.554896
| 2018-03-14T01:32:26
| 2018-03-14T01:32:26
| 125,136,592
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,742
|
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 br.com.ads.siscee.model.entidade;
import java.io.Serializable;
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;
/**
*
* @author Everson
*/
@Entity
@NamedQueries({
@NamedQuery(name = "Produto.consultarPorNome",
query = "SELECT p FROM Produto p WHERE p.nome LIKE :nome ORDER BY p.nome")
})
public class Produto implements EntidadeBase, Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(nullable = false)
private String nome;
@Column(name = "Quantidade_Estoque", nullable = false)
private int quantidadeEstoque;
@Column(name = "Valor_Cento", nullable = false)
private double valorCento;
@Override
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.toUpperCase();
}
public int getQuantidadeEstoque() {
return quantidadeEstoque;
}
public void setQuantidadeEstoque(int quantidadeEstoque) {
this.quantidadeEstoque = quantidadeEstoque;
}
public double getValorCento() {
return valorCento;
}
public void setValorCento(double valorCento) {
this.valorCento = valorCento;
}
}
|
[
"eversontalpai@gmail.com"
] |
eversontalpai@gmail.com
|
0179dffc6316991248d0b21c8436d409c6c03f5e
|
c7beecb670919c6795441a2d178719808e288bfd
|
/java/com/fetchrewards/contacts/MainPresenter.java
|
3033716b63cdca7731cc0d9fa10cf3b8e6cc9909
|
[] |
no_license
|
Joe7pack/FetchRewards
|
86dd2bb9c725297e1f5aad844297f3bb2047c60d
|
512757368823d2670758e29b1d3941662371c460
|
refs/heads/master
| 2020-12-14T08:12:28.036756
| 2020-01-18T17:20:52
| 2020-01-18T17:20:52
| 234,680,360
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,501
|
java
|
package com.fetchrewards.contacts;
import android.content.Context;
import java.util.List;
public class MainPresenter implements Presenter<MvpView> {
private Context context;
private Repository model;
private MvpView mvpView;
private List<Repository.Employee> employeeList;
private List<Repository.FetchNameList> fetchNameList;
public MainPresenter(Context context) {
model = new Repository(context);
setModel(model);
}
@Override
public void attachView(MvpView view) {
this.mvpView = view;
}
@Override
public void setContext(Context context) {
this.context = context;
}
@Override
public Context getContext() {
return context;
}
@Override
public void detachView() {
this.mvpView = null;
}
@Override
public List<Repository.Employee> getEmployeeList() {
employeeList = getModel().getEmployeeList();
return employeeList;
}
@Override
public List<Repository.FetchNameList> getNameList() {
fetchNameList = getModel().getNameList();
return fetchNameList;
}
@Override
public void setEmployeeList() {
getModel().setEmployeeList();
}
public boolean getDataLoaded() {
return getModel().getDataLoaded();
}
@Override
public void setModel(Repository model) {
this.model = model;
}
@Override
public Repository getModel() {
return this.model;
}
}
|
[
"Joe@Guzzardo.com"
] |
Joe@Guzzardo.com
|
af37b2546f467364099b684a595399eb2ea054bc
|
8fa2a06a58cdb20f8d2a12eea76572e02cc4bd64
|
/Phase3Interface/src/phase3/TestLSH.java
|
a03b8e5696c4f1b1f92bd176d7bab39f308bbf2e
|
[] |
no_license
|
busybug91/Gesture-Analysis--Indexing-and-Retrieval
|
fd3386034289979093d8045c2d814e473111640d
|
403420284dda572e75b6864f755544e97b0440ff
|
refs/heads/master
| 2021-01-01T19:55:54.630022
| 2014-03-01T01:06:22
| 2014-03-01T01:06:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,302
|
java
|
package phase3;
import phase2.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
import matlabcontrol.MatlabConnectionException;
import matlabcontrol.MatlabInvocationException;
import phase2.*;
import phase1.*;
public class TestLSH {
public static void main(String args[]) throws IOException, InterruptedException, MatlabConnectionException, MatlabInvocationException
{
ScannerInterface.scannerInitialize();
Scanner sc=ScannerInterface.getScanner();
System.out.println("Enter path for matlab resources: ");
String mpath=sc.nextLine();
//mpath=mpath.replace("\\", "\\\\");
mpath="cd('"+mpath+"')";
System.out.println(mpath);
Consatnts.pathMatlab="cd(\'C:\\Users\\asahu3\\Desktop\\resources\')";
System.err.println(Consatnts.pathMatlab);
Consatnts.pathMatlab=mpath;
Consatnts.PATH1="C:\\Users\\asahu3\\Desktop\\3classdata\\";
MatlabInterface.MatlabInitialize();
String path=Consatnts.PATH1+"labels.csv";
TrainingData.setTrainingData(path);
//TrainingData.getTrainingDataNumbers();
System.out.println(TrainingData.getTrainingDataNumbers());
Data.setData();
Data.KNNClassify(8,589);
//Data.SVMClassify();
ScannerInterface.close();
MatlabInterface.disconnect();
}
}
|
[
"nahuja1@asu.edu"
] |
nahuja1@asu.edu
|
44a481cdc8087c5fd5e7b7f858927857b3e9cda4
|
8ba07c0cb84b45d0f8d2b21e6030d37ea82c871b
|
/app/src/main/java/com/example/yellow/gpssensor/GroupActivity.java
|
37139d878070c07e72306fe77ce4c4534d7ac4ca
|
[] |
no_license
|
typelunar/GPSSensor
|
bb6e75aaf57d025a35d5d31e618dfd8b4ad32647
|
0170f9d85f8f2537298926bf5d12ea93afe1bc66
|
refs/heads/master
| 2021-05-11T05:48:27.750466
| 2018-01-18T10:45:55
| 2018-01-18T10:45:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 17,064
|
java
|
package com.example.yellow.gpssensor;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import de.hdodenhof.circleimageview.CircleImageView;
/**
* Created by asus2 on 2017/12/31.
*/
public class GroupActivity extends AppCompatActivity {
private MYSQL sql;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_group);
sql=new MYSQL(this);
init_group();
init_adapter();
}
private void init_group()
{
CircleImageView icon = (CircleImageView)findViewById(R.id.group_profile_photo);
TextView name = (TextView)findViewById(R.id.group_title_name);
DataShare ds = ((DataShare)getApplicationContext());
String id = ds.getUserid();
Cursor c = sql.select_user(id);
c.moveToNext();
//icon.setImageURI(Uri.parse(c.getString(3)));
name.setText(c.getString(1));
final TextView dongtai_text = (TextView)findViewById(R.id.group_title_dongtai);
final TextView withme_text = (TextView)findViewById(R.id.group_title_withme);
final TextView sixin_text = (TextView)findViewById(R.id.group_title_sixin);
final LinearLayout dongtai_view = (LinearLayout) findViewById(R.id.group_view_dongtai);
final LinearLayout withme_view = (LinearLayout) findViewById(R.id.group_view_withme);
final LinearLayout sixin_view = (LinearLayout) findViewById(R.id.group_view_sixin);
final ImageButton group_title_add_icon = (ImageButton)findViewById(R.id.group_title_add_icon) ;
View.OnClickListener dongtai_OnClick = new View.OnClickListener() {
@Override
public void onClick(View v) {
dongtai_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.listbgc_half));
withme_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
sixin_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
dongtai_view.setVisibility(View.VISIBLE);
withme_view.setVisibility(View.INVISIBLE);
sixin_view.setVisibility(View.INVISIBLE);
}
};
View.OnClickListener withme_OnClick = new View.OnClickListener() {
@Override
public void onClick(View v) {
dongtai_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
withme_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.listbgc_half));
sixin_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
dongtai_view.setVisibility(View.INVISIBLE);
withme_view.setVisibility(View.VISIBLE);
sixin_view.setVisibility(View.INVISIBLE);
}
};
View.OnClickListener sixin_OnClick = new View.OnClickListener() {
@Override
public void onClick(View v) {
dongtai_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
withme_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.fade_text));
sixin_text.setTextColor((ColorStateList) ((Resources) getBaseContext().getResources()).getColorStateList(R.color.listbgc_half));
dongtai_view.setVisibility(View.INVISIBLE);
withme_view.setVisibility(View.INVISIBLE);
sixin_view.setVisibility(View.VISIBLE);
}
};
group_title_add_icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(GroupActivity.this,ShareActivity.class);
startActivity(intent);
}
});
dongtai_text.setOnClickListener(dongtai_OnClick);
withme_text.setOnClickListener(withme_OnClick);
sixin_text.setOnClickListener(sixin_OnClick);
}
private void init_adapter()
{
ListView dongtai_view = (ListView) findViewById(R.id.group_list_dongtai);
ListView withme_view = (ListView) findViewById(R.id.group_list_withme);
ListView sixin_view = (ListView) findViewById(R.id.group_list_sixin);
FatherViewAdapter dongtai_adapter = new FatherViewAdapter(this,null);
DataShare ds=((DataShare)getApplicationContext());
final ChatViewAdapter sixin_adapter = new ChatViewAdapter(this,sql.get_chat_list(ds.getUserid()));//intentin.getStringExtra("user")
dongtai_view.setAdapter(dongtai_adapter);
dongtai_adapter.mList=sql.select_guanzhu_all();
dongtai_adapter.notifyDataSetChanged();
sixin_view.setAdapter(sixin_adapter);
sixin_adapter.notifyDataSetChanged();
sixin_view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cursor c = sixin_adapter.mList;
c.moveToFirst();
c.move(position);
Intent in=new Intent(GroupActivity.this,ChatActivity.class);
in.putExtra("user_id",c.getString(1));
in.putExtra("friend_id",c.getString(2));
startActivity(in);
}
});
}
public void goToI(View view){
Intent intent=new Intent(this,I_Activity.class);
Intent this_intent = getIntent();
intent.putExtra("user",this_intent.getStringExtra("user"));
startActivity(intent);
this.finish();
}
public void goToMap(View view){
Intent intent=new Intent(this,MapActivity.class);
Intent this_intent = getIntent();
intent.putExtra("user",this_intent.getStringExtra("user"));
startActivity(intent);
this.finish();
}
public void goToHome(View view){
Intent intent=new Intent(this,home_page.class);
Intent this_intent = getIntent();
intent.putExtra("user",this_intent.getStringExtra("user"));
startActivity(intent);
this.finish();
}
public class FatherViewAdapter extends BaseAdapter {
//数据源
private Cursor mList;
//列数
private Context mContext;
public FatherViewAdapter(Context context,Cursor item) {
super();
this.mContext = context;
this.mList = item;
}
/**
* 这部很重要
*(核心)
* @return listview的行数
*/
@Override
public int getCount() {
try{
return mList.getCount();
}catch (Exception e){
return 0;
}
}
/*
@Override
public int getCount() {
int count = mList.size() / mColumn;
if (mList.size() % mColumn > 0) {
count++;
}
return count;
}*/
private class iitem{
String l1;
String l2;
String l3;
String l4;
String l5;
String l6;
String l7;
String l8;
}
@Override
public iitem getItem(int position) {
mList.moveToFirst();
mList.move(position);
iitem i=new iitem();
i.l1=mList.getString(2);
i.l2=mList.getString(1);
i.l3=mList.getString(3);
i.l4=mList.getString(4);
i.l5=mList.getString(5);
i.l6=mList.getString(6);
i.l7=mList.getString(7);
i.l8=mList.getString(7);
return i;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.care_item, parent, false);
holder = new ViewHolder(convertView);
} else {
holder = (ViewHolder) convertView.getTag();
}
iitem i=getItem(position);
//更新数据源(核心)
try{
holder.gadapter.setmList(sql.select_pic(i.l7));
holder.ladapter.setmList(sql.select_pinglun(i.l8));
holder.img.setImageURI(Uri.parse(sql.get_user_icon(i.l2)));
holder.name.setText(sql.get_user_name(i.l2));
holder.time.setText(i.l3);
holder.data.setText(i.l4);
holder.zan.setText(i.l5);
holder.tiaozhuan.setText(i.l6);
}catch (Exception e){}
holder.gadapter.notifyDataSetChanged();
holder.ladapter.notifyDataSetChanged();
return convertView;
}
class ViewHolder {
ImageView img;
TextView name;
TextView time;
TextView data;
TextView zan;
TextView tiaozhuan;
GridView gridView;
ListView listView;
ListViewAdapter ladapter;
GridViewAdapter gadapter;
public ViewHolder(View view) {
tiaozhuan=(TextView) findViewById(R.id.care_do_num) ;
listView = (ListView) view.findViewById(R.id.care_pinglun_list);
ladapter = new ListViewAdapter(mContext);
listView.setAdapter(ladapter);
gridView = (GridView) view.findViewById(R.id.care_gridview_picture);
gadapter = new GridViewAdapter(mContext);
gridView.setAdapter(gadapter);
img=(ImageView) view.findViewById(R.id.care_profile_photo);
name=(TextView) view.findViewById(R.id.care_nick_name) ;
time=(TextView) view.findViewById(R.id.care_share_time) ;
data=(TextView) view.findViewById(R.id.care_share_content) ;
zan=(TextView) view.findViewById(R.id.care_zan_num) ;
view.setTag(this);
}
}
}
public class ListViewAdapter extends BaseAdapter {
//数据源
private Cursor mList;
private Context mContext;
public ListViewAdapter(Context context) {
super();
this.mContext = context;
}
public Cursor getmList() {
return mList;
}
public void setmList(Cursor mList) {
this.mList = mList;
}
@Override
public int getCount() {
try{
return mList.getCount();
}catch (Exception e){
return 0;
}
}
@Override
public Cursor getItem(int position) {
mList.moveToFirst();
mList.move(position);
return mList;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_comment, parent, false);
holder = new ViewHolder(convertView);
} else {
holder = (ViewHolder) convertView.getTag();
}
getItem(position);
try{
holder.comment.setText(mList.getString(3));
holder.name.setText(mList.getString(2));
}catch (Exception e){}
return convertView;
}
class ViewHolder {
TextView name;
TextView comment;
public ViewHolder(View view) {
name = (TextView) view.findViewById(R.id.comment_nick_name);
comment = (TextView) view.findViewById(R.id.comment_content);
view.setTag(this);
}
}
}
public class GridViewAdapter extends BaseAdapter {
//数据源
private Cursor mList ;
private Context mContext;
public GridViewAdapter(Context context) {
super();
this.mContext = context;
}
public Cursor getmList() {
return mList;
}
public void setmList(Cursor mList) {
this.mList = mList;
}
@Override
public int getCount() {
try{
return mList.getCount();
}catch (Exception e){
return 0;
}
}
@Override
public Cursor getItem(int position) {
mList.moveToFirst();
mList.move(position);
return mList;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_img, parent, false);
holder = new ViewHolder(convertView);
} else {
holder = (ViewHolder) convertView.getTag();
}
getItem(position);
holder.iv.setImageURI(Uri.parse(mList.getString(2)));
return convertView;
}
class ViewHolder {
ImageView iv;
public ViewHolder(View view) {
iv = (ImageView) view.findViewById(R.id.item_img_image);
view.setTag(this);
}
}
}
public class ChatViewAdapter extends BaseAdapter {
//数据源
private Cursor mList;
//列数
private Context mContext;
public ChatViewAdapter(Context context, Cursor list) {
super();
this.mContext = context;
this.mList = list;
}
/**
* 这部很重要
*(核心)
* @return listview的行数
*/
@Override
public int getCount() {
try{
return mList.getCount();
}catch (Exception e){
return 0;
}
}
/*
@Override
public int getCount() {
int count = mList.size() / mColumn;
if (mList.size() % mColumn > 0) {
count++;
}
return count;
}*/
@Override
public Cursor getItem(int position) {
mList.moveToFirst();
mList.move(position);
return mList;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_chat_in_homepage, parent, false);
//holder = new ViewHolder(convertView);
} else {
//holder = (ViewHolder) convertView.getTag();
}
TextView I_word;
TextView name;
CircleImageView I_icon;
name = (TextView)convertView.findViewById(R.id.name);
I_word =(TextView)convertView.findViewById(R.id.send_message);
I_icon =(CircleImageView) convertView.findViewById(R.id.avatar2);
int kp=10;
getItem(position);
name.setText(sql.get_user_name(mList.getString(2)));
I_icon.setImageURI(Uri.parse(sql.get_user_icon(mList.getString(2))));
I_word.setText(mList.getString(3));
return convertView;
}
}
}
|
[
"570700160@qq.com"
] |
570700160@qq.com
|
dc4436f2292dac749fcf6e7e4b27431350de11e3
|
40dd2c2ba934bcbc611b366cf57762dcb14c48e3
|
/RI_Stack/jvm/security/gnu-crypto/source/gnu/crypto/jce/sig/DSSRawSignatureSpi.java
|
023038c4f99339efa7db240655de05a482fd5e7b
|
[] |
no_license
|
amirna2/OCAP-RI
|
afe0d924dcf057020111406b1d29aa2b3a796e10
|
254f0a8ebaf5b4f09f4a7c8f4961e9596c49ccb7
|
refs/heads/master
| 2020-03-10T03:22:34.355822
| 2018-04-11T23:08:49
| 2018-04-11T23:08:49
| 129,163,048
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,963
|
java
|
package gnu.crypto.jce.sig;
// ----------------------------------------------------------------------------
// $Id: DSSRawSignatureSpi.java,v 1.2 2005/10/06 04:24:16 rsdio Exp $
//
// Copyright (C) 2001, 2002, Free Software Foundation, Inc.
//
// This file is part of GNU Crypto.
//
// GNU Crypto is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GNU Crypto is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING. If not, write to the
//
// Free Software Foundation Inc.,
// 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301
// USA
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give
// you permission to link this library with independent modules to
// produce an executable, regardless of the license terms of these
// independent modules, and to copy and distribute the resulting
// executable under terms of your choice, provided that you also meet,
// for each linked independent module, the terms and conditions of the
// license of that module. An independent module is a module which is
// not derived from or based on this library. If you modify this
// library, you may extend this exception to your version of the
// library, but you are not obligated to do so. If you do not wish to
// do so, delete this exception statement from your version.
// ----------------------------------------------------------------------------
import gnu.crypto.Registry;
import gnu.crypto.sig.dss.DSSSignatureRawCodec;
/**
* The implementation of <i>Service Provider Interface</i> (<b>SPI</b>) adapter
* for the DSS (Digital Signature Standard) signature scheme, encoded and/or
* decoded in RAW format.<p>
*
* @version $Revision: 33112 $
*/
public class DSSRawSignatureSpi extends SignatureAdapter {
// Constants and variables
// -------------------------------------------------------------------------
// Constructor(s)
// -------------------------------------------------------------------------
public DSSRawSignatureSpi() {
super(Registry.DSS_SIG, new DSSSignatureRawCodec());
}
// Class methods
// -------------------------------------------------------------------------
// Instance methods
// -------------------------------------------------------------------------
}
|
[
"amir.nathoo@ubnt.com"
] |
amir.nathoo@ubnt.com
|
d510c6e9d0132c32b54fe976f5581587a3b4a987
|
4ff0747fa97ee349736ea9246e1a600f81cb6d87
|
/lab1/GameModel.java
|
a33e2223d0912b4c851551bf79515d16eb4c23f7
|
[] |
no_license
|
meemsbror/OOPF-Labbar
|
1f430fa36516d74c4157e2a01223aa5aa4589314
|
97dac7e34c98c85afc659658352508e99d8c8cf5
|
refs/heads/master
| 2021-01-10T08:08:12.274636
| 2015-12-16T10:11:50
| 2015-12-16T10:11:50
| 45,281,872
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,468
|
java
|
package lab1;
import java.awt.Dimension;
/**
* Common superclass for all game model classes.
*
* Constructors of subclasses should initiate matrix elements and additional,
* game-dependent fields.
*/
public abstract class GameModel {
/** A Matrix containing the state of the gameboard. */
private final GameTile[][] gameboardState;
/** The size of the state matrix. */
private final Dimension gameboardSize = Constants.getGameSize();
/**
* Create a new game model. As GameModel is an abstract class, this is only
* intended for subclasses.
*/
protected GameModel() {
this.gameboardState =
new GameTile[this.gameboardSize.width][this.gameboardSize.height];
}
/**
* Set the tile on a specified position in the gameboard.
*
* @param pos
* The position in the gameboard matrix.
* @param tile
* The type of tile to paint in specified position
*/
protected void setGameboardState(final Position pos, final GameTile tile) {
setGameboardState(pos.getX(), pos.getY(), tile);
}
/**
* Set the tile on a specified position in the gameboard.
*
* @param x
* Coordinate in the gameboard matrix.
* @param y
* Coordinate in the gameboard matrix.
* @param tile
* The type of tile to paint in specified position
*/
protected void setGameboardState(final int x, final int y,
final GameTile tile) {
this.gameboardState[x][y] = tile;
}
/**
* Returns the GameTile in logical position (x,y) of the gameboard.
*
* @param pos
* The position in the gameboard matrix.
*/
public GameTile getGameboardState(final Position pos) {
return getGameboardState(pos.getX(), pos.getY());
}
/**
* Returns the GameTile in logical position (x,y) of the gameboard.
*
* @param x
* Coordinate in the gameboard matrix.
* @param y
* Coordinate in the gameboard matrix.
*/
public GameTile getGameboardState(final int x, final int y) {
return this.gameboardState[x][y];
}
/**
* Returns the size of the gameboard.
*/
public Dimension getGameboardSize() {
return this.gameboardSize;
}
/**
* This method is called repeatedly so that the game can update it's state.
*
* @param lastKey
* The most recent keystroke.
*/
public abstract void gameUpdate(int lastKey) throws GameOverException;
}
|
[
"exodusx32@gmail.com"
] |
exodusx32@gmail.com
|
da6a663d5a0523c5384a78e08a47eb405e658c89
|
cb8d3696c404f489a92d98c820ffe1b67678f669
|
/dynamic-proxy/src/main/java/com/zwd/example/SpringApplication.java
|
9849ede222bdffe791f6e31e34ef6a5f90336855
|
[] |
no_license
|
chenglinjava68/spring-examples
|
3dabae67d0523e43e7985c4cdc2eefba475e6c86
|
f39abb830751db310da1fe160bc73ef1f44569d8
|
refs/heads/master
| 2020-04-14T15:53:19.953747
| 2018-12-18T01:02:11
| 2018-12-18T01:02:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 503
|
java
|
package com.zwd.example;
import java.lang.reflect.Proxy;
public class SpringApplication {
public static void main(String[] args) {
LogicClassFir logicClassFir = new LogicClassFir();
ProxyService targetService = new ProxyServiceImpl();
ProxyService proxyService = (ProxyService) Proxy.newProxyInstance(ProxyCreator.class.getClassLoader(),
new Class[]{ProxyService.class},new ProxyCreator(targetService,logicClassFir));
proxyService.testProxy();
}
}
|
[
"810095178@qq.com"
] |
810095178@qq.com
|
a4e2ef94015cf62c5482a043ef9e681425ded710
|
fb33406e9f71a1e050838bc75b42f8055df108f8
|
/Road.java
|
431aefc439087933ce797d9671f062327832edbb
|
[] |
no_license
|
Sakthisks/Road-Management-System
|
34b8a1230a657df9ca93d067cd1d813e1b6c0f4f
|
04445472e660c11efddb50175df39a9bce4379f7
|
refs/heads/master
| 2023-02-08T05:40:47.323259
| 2020-12-28T19:58:56
| 2020-12-28T19:58:56
| 325,103,395
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,564
|
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.
*/
/**
*
* @author sakth
*/
import java.sql.*;
public class Road{
public static void main(String[] args) {
Road r=new Road();
r.insert();
r.delete();
r.drop();
r.update();
r.rename();
r.retreive();
r.citycorporation();
//r.supervisor();
//r.materials();
//r.corporation_admin();
//r.major();
//r.systems();
System.out.println("********ROAD MANAGEMENT***************");
}
private void retreive()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","sakthi","password");
Statement st=con.createStatement();
String sql="select * from resident where aadharno=173";
ResultSet rs=st.executeQuery(sql);
System.out.println("resident details");
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
//citycorporation();
}
catch(Exception e)
{
System.out.println(e);
}
}
private void insert()
{
try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="insert into systems(sys_no,clerk_name,types_of_repair,problemno) values(,'','mess1',18)";
ResultSet rs=st.executeQuery(sql);
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3)+" "+rs.getString(4));
con.close();
}catch(SQLException e)
{ }
}catch(Exception e)
{
System.out.println(e);
}
System.out.println("inserted");
}
private void delete()
{
try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="delete from resident where aadharno=175";
st.executeUpdate(sql);
con.close();
}catch(SQLException e)
{ }
}catch(Exception e)
{
System.out.println(e);
}
System.out.println("deleted");
}
private void drop()
{try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="drop table sample ";
st.executeUpdate(sql);
con.close();
}
catch(SQLException s)
{
}
}
catch(Exception e)
{
System.out.println(e);
}
System.out.println("droped");
}
private void update()
{
try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="update systems set types_of_repair='block' where sys_no=2";
ResultSet rs=st.executeQuery(sql);
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
}
catch(SQLException s)
{
}
}
catch(Exception e)
{
System.out.println(e);
}
}
private void rename()
{
try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="Rename system to systems ";
st.executeUpdate(sql);
//while(rs.next())
// System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
}
catch(SQLException e)
{
}
}
catch(Exception e)
{
System.out.println(e);
}
}
private void citycorporation()
{
try
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","mohana","praveen");
Statement st=con.createStatement();
String sql="select * from citycorporation where corporationid=165";
ResultSet rs=st.executeQuery(sql);
System.out.println("citycorporation");
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3) +" "+rs.getString(4));
con.close();
//supervisor();
}
catch(SQLException e){
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
|
[
"sakthikarthigaiselvi@gmail.com"
] |
sakthikarthigaiselvi@gmail.com
|
84d051dabd48e723b4663ecb8eff67cd0e47223f
|
42f1b3ec42b6cb48a92bfd886d2dada1f6d5047b
|
/src/com/baidu/ueditor/PathFormat.java
|
59a96dd1975e18a4fa2c996dea8fdedf21171a2c
|
[] |
no_license
|
Daiyunfeng/weekly
|
e9ff96abba278ce065fcd394541009464e052c11
|
00c5de41ab97f535499850825fc16c61e32dc98f
|
refs/heads/master
| 2021-04-09T11:27:36.802292
| 2018-06-01T03:35:42
| 2018-06-01T03:35:42
| 125,474,281
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,104
|
java
|
package com.baidu.ueditor;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PathFormat
{
private static final String TIME = "time";
private static final String FULL_YEAR = "yyyy";
private static final String YEAR = "yy";
private static final String MONTH = "mm";
private static final String DAY = "dd";
private static final String HOUR = "hh";
private static final String MINUTE = "ii";
private static final String SECOND = "ss";
private static final String RAND = "rand";
private static Date currentDate = null;
public static String parse(String input)
{
Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(input);
PathFormat.currentDate = new Date();
StringBuffer sb = new StringBuffer();
while (matcher.find())
{
matcher.appendReplacement(sb, PathFormat.getString(matcher.group(1)));
}
matcher.appendTail(sb);
return sb.toString();
}
/**
* 格式化路径, 把windows路径替换成标准路径
*
* @param input
* 待格式化的路径
* @return 格式化后的路径
*/
public static String format(String input)
{
return input.replace("\\", "/");
}
public static String parse(String input, String filename)
{
Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(input);
String matchStr = null;
PathFormat.currentDate = new Date();
StringBuffer sb = new StringBuffer();
while (matcher.find())
{
matchStr = matcher.group(1);
if (matchStr.indexOf("filename") != -1)
{
filename = filename.replace("$", "\\$").replaceAll("[\\/:*?\"<>|]", "");
matcher.appendReplacement(sb, filename);
}
else
{
matcher.appendReplacement(sb, PathFormat.getString(matchStr));
}
}
matcher.appendTail(sb);
return sb.toString();
}
private static String getString(String pattern)
{
pattern = pattern.toLowerCase();
// time 处理
if (pattern.indexOf(PathFormat.TIME) != -1)
{
return PathFormat.getTimestamp();
}
else if (pattern.indexOf(PathFormat.FULL_YEAR) != -1)
{
return PathFormat.getFullYear();
}
else if (pattern.indexOf(PathFormat.YEAR) != -1)
{
return PathFormat.getYear();
}
else if (pattern.indexOf(PathFormat.MONTH) != -1)
{
return PathFormat.getMonth();
}
else if (pattern.indexOf(PathFormat.DAY) != -1)
{
return PathFormat.getDay();
}
else if (pattern.indexOf(PathFormat.HOUR) != -1)
{
return PathFormat.getHour();
}
else if (pattern.indexOf(PathFormat.MINUTE) != -1)
{
return PathFormat.getMinute();
}
else if (pattern.indexOf(PathFormat.SECOND) != -1)
{
return PathFormat.getSecond();
}
else if (pattern.indexOf(PathFormat.RAND) != -1)
{
return PathFormat.getRandom(pattern);
}
return pattern;
}
private static String getTimestamp()
{
return System.currentTimeMillis() + "";
}
private static String getFullYear()
{
return new SimpleDateFormat("yyyy").format(PathFormat.currentDate);
}
private static String getYear()
{
return new SimpleDateFormat("yy").format(PathFormat.currentDate);
}
private static String getMonth()
{
return new SimpleDateFormat("MM").format(PathFormat.currentDate);
}
private static String getDay()
{
return new SimpleDateFormat("dd").format(PathFormat.currentDate);
}
private static String getHour()
{
return new SimpleDateFormat("HH").format(PathFormat.currentDate);
}
private static String getMinute()
{
return new SimpleDateFormat("mm").format(PathFormat.currentDate);
}
private static String getSecond()
{
return new SimpleDateFormat("ss").format(PathFormat.currentDate);
}
private static String getRandom(String pattern)
{
int length = 0;
pattern = pattern.split(":")[1].trim();
length = Integer.parseInt(pattern);
return (Math.random() + "").replace(".", "").substring(0, length);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
}
}
|
[
"879404301@qq.com"
] |
879404301@qq.com
|
fb7fc1e7aefb268d6422c65e0e7747f4343b891c
|
cfcecca26950857b7c5bd2bbcb7b9ba81d47c2de
|
/recorder/src/test/java/com/turing/biz/recoder/ExampleUnitTest.java
|
0b4767e11c5e6ea5194bff0147b25c545b0f5027
|
[] |
no_license
|
moon-sky/AndroidRecorder
|
21840cb94bbfc6fed39ec4556ae6281ae79b8250
|
0ba80c61ce28b5d023cc6f3cc2dd827c4937bd60
|
refs/heads/master
| 2020-03-30T07:34:36.013836
| 2018-09-30T08:58:10
| 2018-09-30T08:58:10
| 150,949,990
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 383
|
java
|
package com.turing.biz.recoder;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"wanghexin@uzoo.cn"
] |
wanghexin@uzoo.cn
|
1b8b54f869b50d7eb8ff048252abef8c073bad6c
|
ff834a88327ce3ffd27a97b557d335f543bdc76d
|
/core/src/ru/kvvartet/lndclient/logic/messages/Message.java
|
0dd692d24893b641bad507348b6c6fff4b164643
|
[] |
no_license
|
KCherkasov/lands-and-dungeons-client
|
e011762be25066139bb9ea4dec77b6d7e51306fa
|
ee3b863918558f9519b87707e046e1e123fec9d1
|
refs/heads/master
| 2020-03-08T05:52:20.019299
| 2018-07-18T22:16:35
| 2018-07-18T22:16:35
| 127,957,932
| 0
| 1
| null | 2018-05-20T22:53:45
| 2018-04-03T19:24:02
|
Java
|
UTF-8
|
Java
| false
| false
| 664
|
java
|
package ru.kvvartet.lndclient.logic.messages;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import ru.kvvartet.lndclient.logic.messages.bag.ItemAddMessage;
import ru.kvvartet.lndclient.logic.messages.bag.ItemRemoveMessage;
import ru.kvvartet.lndclient.logic.messages.bag.SwapItemsMessage;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({ @JsonSubTypes.Type(SwapItemsMessage.class),
@JsonSubTypes.Type(ItemAddMessage.class),
@JsonSubTypes.Type(ItemRemoveMessage.class)})
public abstract class Message {
}
|
[
"kvcherk@live.ru"
] |
kvcherk@live.ru
|
632465cea866818fdab2723486b84c952189759f
|
ebb149d65164873ebb29400f7d311b14ce0efce6
|
/src/view/PanelSelecionaAudienciaPendente.java
|
bf319282c42d1418147d385d1f5b815568173d36
|
[] |
no_license
|
tecnomage/Fidelis
|
aeb7d12bf2f8091eaab89b9ca50984443a885aa6
|
4361a975da403e469e5df3858630c809b9925617
|
refs/heads/master
| 2021-01-10T02:52:09.005683
| 2016-09-26T15:08:23
| 2016-09-26T15:08:23
| 54,496,590
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 4,718
|
java
|
package fidelis.view;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import fidelis.controller.DBDealer;
import fidelis.controller.Sessao;
@SuppressWarnings("serial")
public class PanelSelecionaAudienciaPendente extends JPanel {
public String usuarioLogado = null;
private JComboBox cbNumProcessos = null;
private Vector<String> vtNumProcesso = new Vector<String>();
private Vector<String> vtData = new Vector<String>();
private Vector<String> vtHora = new Vector<String>();
private Vector<String> vtTipo = new Vector<String>();
private Vector<String> vtJuiz = new Vector<String>();
private JLabel lbTipoProcessoVlr = null;
private JLabel lbJuizVlr = null;
private JLabel lbDataVlr = null;
private JLabel lbHoraVlr = null;
@SuppressWarnings("unchecked")
public PanelSelecionaAudienciaPendente(String strUsuarioLogado) {
usuarioLogado = strUsuarioLogado;
JPanel borda = new JPanel();
borda.setLayout(null);
borda.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações Sobre as Audiências Pendentes"));
borda.setBounds(8, 8, 420, 220);
JPanel pSelecao = new JPanel();
pSelecao.setLayout(null);
pSelecao.setBorder(javax.swing.BorderFactory.createEtchedBorder());
//pSelecao.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
pSelecao.setBounds(20, 30, 380, 50);
JPanel pFixo = new JPanel();
pFixo.setLayout(null);
pFixo.setBorder(javax.swing.BorderFactory.createEtchedBorder());
//pFixo.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
pFixo.setBounds(20, 100, 380, 100);
JLabel lbNumProcesso = new JLabel("Número do Processo: ");
lbNumProcesso.setBounds(10, 15, 130, 20);
final DBDealer dealer = new DBDealer(usuarioLogado, "AUDIENCIAS");
Vector vtRetorno = dealer.getAudienciasPendentes();
String [] strRetorno = new String[5];
for (int i = 0; i < vtRetorno.size(); i++) {
strRetorno = (String[]) vtRetorno.elementAt(i);
vtNumProcesso.addElement(strRetorno[0]);
vtData.addElement(strRetorno[1]);
vtHora.addElement(strRetorno[2]);
vtTipo.addElement(strRetorno[3]);
vtJuiz.addElement(strRetorno[4]);
}
cbNumProcessos = new JComboBox(vtNumProcesso);
cbNumProcessos.setBounds(160, 15, 200, 20);
cbNumProcessos.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent event) {
showAudienciaDados(dealer);
}
});
JLabel lbTipoProcesso = new JLabel("Tipo: ");
lbTipoProcesso.setBounds(10, 10, 60, 20);
lbTipoProcesso.setAlignmentY(RIGHT_ALIGNMENT);
lbTipoProcessoVlr = new JLabel("");
lbTipoProcessoVlr.setBounds(75, 10, 100, 20);
lbTipoProcessoVlr.setFont(new Font("Monospaced", Font.PLAIN, 12));
JLabel lbJuiz = new JLabel("Juiz: ");
lbJuiz.setBounds(10, 40, 60, 20);
lbJuiz.setAlignmentY(RIGHT_ALIGNMENT);
lbJuizVlr = new JLabel("");
lbJuizVlr.setBounds(75, 40, 200, 20);
lbJuizVlr.setFont(new Font("Monospaced", Font.PLAIN, 12));
JLabel lbData = new JLabel("Data: ");
lbData.setBounds(10, 70, 60, 20);
lbData.setAlignmentY(RIGHT_ALIGNMENT);
lbDataVlr = new JLabel("");
lbDataVlr.setBounds(75, 70, 100, 20);
lbDataVlr.setFont(new Font("Monospaced", Font.PLAIN, 12));
JLabel lbHora= new JLabel("Hora: ");
lbHora.setBounds(180, 70, 60, 20);
lbHora.setAlignmentY(RIGHT_ALIGNMENT);
lbHoraVlr = new JLabel("");
lbHoraVlr.setBounds(245, 70, 100, 20);
lbHoraVlr.setFont(new Font("Monospaced", Font.PLAIN, 12));
pFixo.add(lbTipoProcesso);
pFixo.add(lbTipoProcessoVlr);
pFixo.add(lbJuiz);
pFixo.add(lbJuizVlr);
pFixo.add(lbData);
pFixo.add(lbDataVlr);
pFixo.add(lbHora);
pFixo.add(lbHoraVlr);
pSelecao.add(lbNumProcesso);
pSelecao.add(cbNumProcessos);
borda.add(pSelecao);
borda.add(pFixo);
this.setLayout(null);
this.add(borda);
showAudienciaDados(dealer);
}
public void showAudienciaDados(DBDealer d) {
int i = cbNumProcessos.getSelectedIndex();
if (i > -1) {
lbTipoProcessoVlr.setText(d.getDescTipoAudiencia(new Integer(vtTipo.elementAt(i))).toString());
lbJuizVlr.setText(vtJuiz.elementAt(i));
lbDataVlr.setText(vtData.elementAt(i));
lbHoraVlr.setText(vtHora.elementAt(i));
Sessao.numProcesso = (String) cbNumProcessos.getSelectedItem();
Sessao.tipo = lbTipoProcessoVlr.getText();
Sessao.juiz = lbJuizVlr.getText();
}
return;
}
}
|
[
"tecnocratay@gmail.com"
] |
tecnocratay@gmail.com
|
c02f76503a000b3f93945e994e44ac74af9179ec
|
74ce58c1006e4ac8a4d4e7a55c5a186c66eea5a8
|
/ranking-builder/src/main/br/com/amil/rankingbuilder/api/game/TimedEvent.java
|
698332d938bf02bd5357a5aa9d7e0c80deea02cd
|
[] |
no_license
|
mvendruscolo/pre-dojo
|
d097451e4c2b9dc501c007eb826c22dd5a811eca
|
1c14ce1ed24641d93b9ac411eaa07ef3d4156903
|
refs/heads/master
| 2021-01-18T17:49:29.773274
| 2014-07-30T02:09:14
| 2014-07-30T02:09:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 291
|
java
|
package br.com.amil.rankingbuilder.api.game;
import java.time.LocalDateTime;
/**
* Representa um evento de um {@link Match} associado a um tempo.
*/
interface TimedEvent {
/**
* Recupera o tempo deste evento.
*
* @return O tempo
*/
LocalDateTime getTime();
}
|
[
"marcus.vv.dias@gmail.com"
] |
marcus.vv.dias@gmail.com
|
a17f94a0515dabc97cb3559c7ee8fdc6c2e129b8
|
f59891e4f090e7ba39e7174202af8b4771530c5e
|
/xpert-framework-war-archetype/trunk/target/test-classes/projects/basic/project/basic/src/main/java/it/pkg/bo/controleacesso/SolicitacaoRecuperacaoSenhaBO.java
|
80ee227bf844223dd2bf327abdb11678a8948cb1
|
[] |
no_license
|
bgarrels/xpert-framework
|
01f31e6b4c0876c6231ffc02a4dc0420d5a4c50f
|
8acf6b1c6dbb471ebe717fb652a7d972ce29f3a7
|
refs/heads/master
| 2021-01-21T02:00:11.091400
| 2015-06-26T13:33:12
| 2015-06-26T13:33:12
| 38,158,915
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,412
|
java
|
package it.pkg.bo.controleacesso;
import it.pkg.bo.email.EmailBO;
import it.pkg.bo.email.ModeloEmailBO;
import com.xpert.core.crud.AbstractBusinessObject;
import com.xpert.core.validation.UniqueField;
import com.xpert.core.exception.BusinessException;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import it.pkg.constante.Constantes;
import it.pkg.dao.controleacesso.SolicitacaoRecuperacaoSenhaDAO;
import it.pkg.dao.controleacesso.UsuarioDAO;
import it.pkg.modelo.controleacesso.SituacaoUsuario;
import it.pkg.modelo.controleacesso.SolicitacaoRecuperacaoSenha;
import it.pkg.modelo.email.TipoAssuntoEmail;
import it.pkg.modelo.controleacesso.TipoRecuperacaoSenha;
import it.pkg.modelo.controleacesso.Usuario;
import com.xpert.persistence.query.Restrictions;
import com.xpert.utils.Encryption;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang.RandomStringUtils;
/**
*
* @author ayslan
*/
@Stateless
public class SolicitacaoRecuperacaoSenhaBO extends AbstractBusinessObject<SolicitacaoRecuperacaoSenha> {
@EJB
private SolicitacaoRecuperacaoSenhaDAO solicitacaoRecuperacaoSenhaDAO;
@EJB
private UsuarioDAO usuarioDAO;
@EJB
private ModeloEmailBO modeloEmailBO;
@EJB
private EmailBO emailBO;
@Override
public SolicitacaoRecuperacaoSenhaDAO getDAO() {
return solicitacaoRecuperacaoSenhaDAO;
}
@Override
public List<UniqueField> getUniqueFields() {
return null;
}
@Override
public void validate(SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha) throws BusinessException {
}
@Override
public boolean isAudit() {
return true;
}
public Date getDataValidade(Date dataCadastro) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MINUTE, Constantes.MINUTOS_VALIDADE_RECUPERACAO_SENHA);
return calendar.getTime();
}
public SolicitacaoRecuperacaoSenha getSolicitacaoRecuperacaoSenha(String token, String email) {
SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha = solicitacaoRecuperacaoSenhaDAO.unique("token", token);
if (solicitacaoRecuperacaoSenha != null && solicitacaoRecuperacaoSenha.getEmail().equals(email)) {
return solicitacaoRecuperacaoSenha;
}
return null;
}
/**
* gera um token para um SolicitacaoRecuperacaoSenha, o token eh um hash SHA256 dos campos: id + string aleatoria + data atual
*
* @param solicitacaoRecuperacaoSenha
* @return
* @throws NoSuchAlgorithmException
*/
public String getToken(SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha) throws NoSuchAlgorithmException {
String key = solicitacaoRecuperacaoSenha.getId() + RandomStringUtils.random(20) + new Date().getTime();
return Encryption.getSHA256(key);
}
public void enviarEmail(SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha, TipoRecuperacaoSenha tipoRecuperacaoSenha) throws BusinessException {
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("solicitacaoRecuperacaoSenha", solicitacaoRecuperacaoSenha);
if (tipoRecuperacaoSenha.equals(TipoRecuperacaoSenha.ESQUECI_SENHA)) {
emailBO.enviarAssincrono(TipoAssuntoEmail.RECUPERACAO_SENHA, parametros, solicitacaoRecuperacaoSenha.getEmail());
} else if (tipoRecuperacaoSenha.equals(TipoRecuperacaoSenha.NOVO_USUARIO)) {
emailBO.enviar(TipoAssuntoEmail.NOVO_USUARIO_SISTEMA, parametros, solicitacaoRecuperacaoSenha.getEmail());
}
}
public void save(String email, TipoRecuperacaoSenha tipoRecuperacaoSenha) throws BusinessException {
if (email == null || email.trim().isEmpty()) {
throw new BusinessException("required.email");
}
Usuario usuario = usuarioDAO.unique("email", email.trim());
if (usuario == null) {
throw new BusinessException("business.usuarioNaoEncontradoComEmail");
}
if(usuario.getSituacaoUsuario() == null || usuario.getSituacaoUsuario().equals(SituacaoUsuario.INATIVO)){
throw new BusinessException("business.usuarioInativo");
}
//inativar anteriores
Restrictions restrictions = new Restrictions();
restrictions.add("usuario", usuario);
restrictions.add("ativo", true);
List<SolicitacaoRecuperacaoSenha> solicitacoesRecuperacaoSenhas = solicitacaoRecuperacaoSenhaDAO.list(restrictions);
if (solicitacoesRecuperacaoSenhas != null) {
for (SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha : solicitacoesRecuperacaoSenhas) {
solicitacaoRecuperacaoSenha.setAtivo(false);
solicitacaoRecuperacaoSenhaDAO.merge(solicitacaoRecuperacaoSenha, false);
}
}
//se o suaurio nao possuir senha cadastrada, deve ser enviado email de novo cadastro
if (usuario.getSenhaCadastrada() == false && tipoRecuperacaoSenha.equals(TipoRecuperacaoSenha.ESQUECI_SENHA)) {
tipoRecuperacaoSenha = TipoRecuperacaoSenha.NOVO_USUARIO;
}
SolicitacaoRecuperacaoSenha solicitacaoRecuperacaoSenha = new SolicitacaoRecuperacaoSenha();
solicitacaoRecuperacaoSenha.setEmail(email);
solicitacaoRecuperacaoSenha.setAtivo(true);
solicitacaoRecuperacaoSenha.setDataCadastro(new Date());
if (tipoRecuperacaoSenha.equals(TipoRecuperacaoSenha.ESQUECI_SENHA)) {
solicitacaoRecuperacaoSenha.setDataValidade(getDataValidade(solicitacaoRecuperacaoSenha.getDataCadastro()));
}
solicitacaoRecuperacaoSenha.setTipoRecuperacaoSenha(tipoRecuperacaoSenha);
solicitacaoRecuperacaoSenha.setUsuario(usuario);
solicitacaoRecuperacaoSenhaDAO.save(solicitacaoRecuperacaoSenha, false);
try {
solicitacaoRecuperacaoSenha.setToken(getToken(solicitacaoRecuperacaoSenha));
enviarEmail(solicitacaoRecuperacaoSenha, tipoRecuperacaoSenha);
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
}
}
}
|
[
"ayslanms@gmail.com"
] |
ayslanms@gmail.com
|
e63aab1722e69c6728fe55af72184ee00208f05d
|
1f034fda19c48e0e95bdcd793b36aec9746dfdee
|
/GitTaller/src/fundamento/HolaMundo.java
|
04e198e38d6cf6b0b77cf788e7dfa4a64d4d6dbe
|
[] |
no_license
|
aldoariel/TALLERIIIFPUNE2017
|
86a5aa085da0727768faf206737df6b2d97e0544
|
b2dfee78b3eec8362bf29fa4bf15ce614c344c20
|
refs/heads/master
| 2021-01-01T04:58:28.339026
| 2017-11-23T11:55:57
| 2017-11-23T11:55:57
| 97,279,770
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 113
|
java
|
public class HolaMundo {
public static void main(String[] args) {
System.out.println("Hola Mundo");
}
}
|
[
"aldoarie@gmail.com"
] |
aldoarie@gmail.com
|
ebf43145586083b53ddc429933aad84c75b65df2
|
f7bc6715dc044e636308009bd27c32eb8085895e
|
/spring-boot/spring-boot-postgresql-angular-ng-zorro-table/src/main/java/com/frontbackend/springboot/person/controller/model/request/PersonFilterRequest.java
|
41f146752891c47442a0cfa3536b430173f9e687
|
[
"MIT"
] |
permissive
|
martinwojtus/tutorials
|
49198772cede622f7ded5856667a646ae420b361
|
f44749aa177d7ab1c32b84fd6dc70855fda12fd5
|
refs/heads/master
| 2023-02-09T16:07:20.893500
| 2022-09-02T20:20:16
| 2022-09-02T20:20:16
| 187,207,196
| 178
| 576
|
MIT
| 2023-02-04T16:22:45
| 2019-05-17T11:47:35
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 420
|
java
|
package com.frontbackend.springboot.person.controller.model.request;
import com.frontbackend.springboot.person.controller.model.paging.PageInfo;
import com.frontbackend.springboot.person.dto.PersonFilter;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@NoArgsConstructor
@Setter
@Getter
public class PersonFilterRequest {
private PageInfo pageInfo;
private PersonFilter filter;
}
|
[
"martin.wojtus@gmail.com"
] |
martin.wojtus@gmail.com
|
0843f48299596ae415a83a8114728d33ae8633f2
|
b395c75a8dbea3f067db16cb3a6d89bda6dd1514
|
/ChartModelShare/src/main/java/th/ac/kmutt/chart/model/FilterM.java
|
8670ee77e1f202694c17c2c5426e293dc581cb82
|
[] |
no_license
|
kosit-gj/kmutt-chart-portlet-v2
|
3b2a42ed698c5c6afbafa85acd0d871c1375d3f9
|
68f805cedbf1d41bf8c89823d70eb8a2cb4075ed
|
refs/heads/master
| 2021-09-11T08:22:56.615639
| 2018-04-06T08:20:02
| 2018-04-06T08:20:02
| 120,425,203
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,219
|
java
|
package th.ac.kmutt.chart.model;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import th.ac.kmutt.chart.xstream.common.ImakeXML;
import java.io.Serializable;
import java.util.List;
@XStreamAlias("FilterM")
public class FilterM extends ImakeXML implements Serializable {
private static final long serialVersionUID = 1L;
private Integer filterId;
private String filterName;
private String valueType;
private String dataType;
private String title;
private String sqlQuery;
private String sqlFlag;
private String globalFlag;
private String activeFlag;
private String systemFlag;
private String autoFill;
private String defaultValue;
private Integer connId;
private List<FilterM> filterList;
private List<FilterValueM> filterValues;
private String selectedValue;
private Integer serviceId; //ref
public Integer getFilterId() {
return filterId;
}
public void setFilterId(Integer filterId) {
this.filterId = filterId;
}
public String getFilterName() {
return filterName;
}
public void setFilterName(String filterName) {
this.filterName = filterName;
}
public String getValueType() {
return valueType;
}
public void setValueType(String valueType) {
this.valueType = valueType;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSqlQuery() {
return sqlQuery;
}
public void setSqlQuery(String sqlQuery) {
this.sqlQuery = sqlQuery;
}
public String getSqlFlag() {
return sqlFlag;
}
public void setSqlFlag(String sqlFlag) {
this.sqlFlag = sqlFlag;
}
public String getGlobalFlag() {
return globalFlag;
}
public void setGlobalFlag(String globalFlag) {
this.globalFlag = globalFlag;
}
public String getActiveFlag() {
return activeFlag;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public Integer getConnId() {
return connId;
}
public void setConnId(Integer connId) {
this.connId = connId;
}
public List<FilterM> getFilterList() {
return filterList;
}
public void setFilterList(List<FilterM> filterList) {
this.filterList = filterList;
}
public List<FilterValueM> getFilterValues() {
return filterValues;
}
public void setFilterValues(List<FilterValueM> filterValues) {
this.filterValues = filterValues;
}
public String getSelectedValue() {
return selectedValue;
}
public void setSelectedValue(String selectedValue) {
this.selectedValue = selectedValue;
}
public Integer getServiceId() {
return serviceId;
}
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getAutoFill() {
return autoFill;
}
public void setAutoFill(String autoFill) {
this.autoFill = autoFill;
}
}
|
[
"kosit@goingjesse.com"
] |
kosit@goingjesse.com
|
31d3c4b69f46590054a82c878332aa0fdcefcecc
|
79a68dbd94ff1261c778f65b9e4c9ce55920ed36
|
/teach_materials/src/com/zs/weixin/mp/bean/WxMpXmlOutVoiceMessage.java
|
867a3e97526870257c5cf05f7b092ab758853b07
|
[] |
no_license
|
Allen5413/tm
|
e6ca0f6c509fb163e391265c65094ab6fdcbb663
|
595d44ccc787588f0995d5769908e12c3c6b387f
|
refs/heads/master
| 2021-01-23T09:33:16.232580
| 2019-11-26T13:50:25
| 2019-11-26T13:50:25
| 34,732,908
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 672
|
java
|
package com.zs.weixin.mp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.zs.weixin.common.api.WxConsts;
import com.zs.weixin.common.util.xml.XStreamMediaIdConverter;
@XStreamAlias("xml")
public class WxMpXmlOutVoiceMessage extends WxMpXmlOutMessage {
@XStreamAlias("Voice")
@XStreamConverter(value = XStreamMediaIdConverter.class)
private String mediaId;
public WxMpXmlOutVoiceMessage() {
this.msgType = WxConsts.XML_MSG_VOICE;
}
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
}
|
[
"2319772333@qq.com"
] |
2319772333@qq.com
|
0f5eade3ec2bff3b7acfe6f974cd025acb1fb986
|
a8a88501b2216d5050ecec91a84c01e84d8d7ff6
|
/springboot_mybatisplus/src/main/java/cn/me/SpringbootMybatisplusApplication.java
|
def79fa6a79adb0c86a6cbaf15c622664f5e2d39
|
[] |
no_license
|
demerzelxd/mybatis_plus
|
3e3ddd93e8ad2a8e5ce6e82e10ac89a5d36966ab
|
e88a8fcf4ade790bb7e4c77bb7a04348babdcf5e
|
refs/heads/master
| 2023-01-06T22:02:53.303177
| 2020-11-02T08:18:58
| 2020-11-02T08:18:58
| 309,233,398
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 469
|
java
|
package cn.me;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("cn.me.mapper")//这种方式更灵活,因为只要扫描一次
public class SpringbootMybatisplusApplication
{
public static void main(String[] args)
{
SpringApplication.run(SpringbootMybatisplusApplication.class, args);
}
}
|
[
"demerzelxd@gmail.com"
] |
demerzelxd@gmail.com
|
601d331e175a2cec8afb8bfd2387b1f15b23e839
|
6e2dbe08a04593ee92f6d789fa9aa33849744211
|
/build/generated/source/r/debug/android/support/v4/R.java
|
70144a07a9e33e7f56e072affe7fc8582b315ad7
|
[
"Apache-2.0"
] |
permissive
|
1136346879/sportlove_
|
f15290e4e56a0f328d7e683dd0ab5972c00a9d53
|
8f45a4b807a45c2d45d614e70f5e2093fdf9c3ef
|
refs/heads/master
| 2020-06-03T00:18:12.936582
| 2019-06-25T06:00:07
| 2019-06-25T06:00:07
| 191,357,466
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,644
|
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v4;
public final class R {
public static final class attr {
public static final int font = 0x7f0100c0;
public static final int fontProviderAuthority = 0x7f0100b9;
public static final int fontProviderCerts = 0x7f0100bc;
public static final int fontProviderFetchStrategy = 0x7f0100bd;
public static final int fontProviderFetchTimeout = 0x7f0100be;
public static final int fontProviderPackage = 0x7f0100ba;
public static final int fontProviderQuery = 0x7f0100bb;
public static final int fontStyle = 0x7f0100bf;
public static final int fontWeight = 0x7f0100c1;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 0x7f080000;
}
public static final class color {
public static final int notification_action_color_filter = 0x7f090000;
public static final int notification_icon_bg_color = 0x7f090046;
public static final int notification_material_background_media_default_color = 0x7f090047;
public static final int primary_text_default_material_dark = 0x7f09004e;
public static final int ripple_material_light = 0x7f090055;
public static final int secondary_text_default_material_dark = 0x7f090056;
public static final int secondary_text_default_material_light = 0x7f090057;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f05005a;
public static final int compat_button_inset_vertical_material = 0x7f05005b;
public static final int compat_button_padding_horizontal_material = 0x7f05005c;
public static final int compat_button_padding_vertical_material = 0x7f05005d;
public static final int compat_control_corner_material = 0x7f05005e;
public static final int notification_action_icon_size = 0x7f05006a;
public static final int notification_action_text_size = 0x7f05006b;
public static final int notification_big_circle_margin = 0x7f05006c;
public static final int notification_content_margin_start = 0x7f05001a;
public static final int notification_large_icon_height = 0x7f05006d;
public static final int notification_large_icon_width = 0x7f05006e;
public static final int notification_main_column_padding_top = 0x7f05001b;
public static final int notification_media_narrow_margin = 0x7f05001c;
public static final int notification_right_icon_size = 0x7f05006f;
public static final int notification_right_side_padding_top = 0x7f050018;
public static final int notification_small_icon_background_padding = 0x7f050070;
public static final int notification_small_icon_size_as_large = 0x7f050071;
public static final int notification_subtext_size = 0x7f050072;
public static final int notification_top_pad = 0x7f050073;
public static final int notification_top_pad_large_text = 0x7f050074;
}
public static final class drawable {
public static final int notification_action_background = 0x7f020190;
public static final int notification_bg = 0x7f020191;
public static final int notification_bg_low = 0x7f020192;
public static final int notification_bg_low_normal = 0x7f020193;
public static final int notification_bg_low_pressed = 0x7f020194;
public static final int notification_bg_normal = 0x7f020195;
public static final int notification_bg_normal_pressed = 0x7f020196;
public static final int notification_icon_background = 0x7f020197;
public static final int notification_template_icon_bg = 0x7f020234;
public static final int notification_template_icon_low_bg = 0x7f020235;
public static final int notification_tile_bg = 0x7f020198;
public static final int notify_panel_notification_icon_bg = 0x7f02019a;
}
public static final class id {
public static final int action0 = 0x7f0b0272;
public static final int action_container = 0x7f0b026f;
public static final int action_divider = 0x7f0b027c;
public static final int action_image = 0x7f0b0270;
public static final int action_text = 0x7f0b0271;
public static final int actions = 0x7f0b0285;
public static final int async = 0x7f0b0029;
public static final int blocking = 0x7f0b002a;
public static final int cancel_action = 0x7f0b0273;
public static final int chronometer = 0x7f0b0281;
public static final int end_padder = 0x7f0b0287;
public static final int forever = 0x7f0b002b;
public static final int icon = 0x7f0b0049;
public static final int icon_group = 0x7f0b0286;
public static final int info = 0x7f0b0282;
public static final int italic = 0x7f0b002c;
public static final int line1 = 0x7f0b000a;
public static final int line3 = 0x7f0b000b;
public static final int media_actions = 0x7f0b027b;
public static final int normal = 0x7f0b0018;
public static final int notification_background = 0x7f0b0284;
public static final int notification_main_column = 0x7f0b027e;
public static final int notification_main_column_container = 0x7f0b027d;
public static final int right_icon = 0x7f0b0283;
public static final int right_side = 0x7f0b027f;
public static final int status_bar_latest_event_content = 0x7f0b027a;
public static final int text = 0x7f0b0012;
public static final int text2 = 0x7f0b0013;
public static final int time = 0x7f0b0280;
public static final int title = 0x7f0b0015;
}
public static final class integer {
public static final int cancel_button_image_alpha = 0x7f0c0002;
public static final int status_bar_notification_info_maxnum = 0x7f0c0005;
}
public static final class layout {
public static final int notification_action = 0x7f030073;
public static final int notification_action_tombstone = 0x7f030074;
public static final int notification_media_action = 0x7f030075;
public static final int notification_media_cancel_action = 0x7f030076;
public static final int notification_template_big_media = 0x7f030079;
public static final int notification_template_big_media_custom = 0x7f03007a;
public static final int notification_template_big_media_narrow = 0x7f03007b;
public static final int notification_template_big_media_narrow_custom = 0x7f03007c;
public static final int notification_template_custom_big = 0x7f03007d;
public static final int notification_template_icon_group = 0x7f03007e;
public static final int notification_template_lines_media = 0x7f03007f;
public static final int notification_template_media = 0x7f030080;
public static final int notification_template_media_custom = 0x7f030081;
public static final int notification_template_part_chronometer = 0x7f030082;
public static final int notification_template_part_time = 0x7f030083;
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f060014;
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f07008d;
public static final int TextAppearance_Compat_Notification_Info = 0x7f07008e;
public static final int TextAppearance_Compat_Notification_Info_Media = 0x7f07008f;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f070122;
public static final int TextAppearance_Compat_Notification_Line2_Media = 0x7f070123;
public static final int TextAppearance_Compat_Notification_Media = 0x7f070090;
public static final int TextAppearance_Compat_Notification_Time = 0x7f070091;
public static final int TextAppearance_Compat_Notification_Time_Media = 0x7f070092;
public static final int TextAppearance_Compat_Notification_Title = 0x7f070093;
public static final int TextAppearance_Compat_Notification_Title_Media = 0x7f070094;
public static final int Widget_Compat_NotificationActionContainer = 0x7f070095;
public static final int Widget_Compat_NotificationActionText = 0x7f070096;
}
public static final class styleable {
public static final int[] FontFamily = { 0x7f0100b9, 0x7f0100ba, 0x7f0100bb, 0x7f0100bc, 0x7f0100bd, 0x7f0100be };
public static final int[] FontFamilyFont = { 0x7f0100bf, 0x7f0100c0, 0x7f0100c1 };
public static final int FontFamilyFont_font = 1;
public static final int FontFamilyFont_fontStyle = 0;
public static final int FontFamilyFont_fontWeight = 2;
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 3;
public static final int FontFamily_fontProviderFetchStrategy = 4;
public static final int FontFamily_fontProviderFetchTimeout = 5;
public static final int FontFamily_fontProviderPackage = 1;
public static final int FontFamily_fontProviderQuery = 2;
}
}
|
[
"1136346879@qq.com"
] |
1136346879@qq.com
|
fa02d069dd355a502c2d560518357022b10ea343
|
5fd6f74ac0cb1944c281f76d504e329a82613bbd
|
/src/main/java/br/com/casadocodigo/loja/configuration/AppWebConfiguration.java
|
bb504f5d455b45ca732e8218906f070f718720d6
|
[
"MIT"
] |
permissive
|
palerique/google-cloud-spring
|
8737764b625fc32cbb4d28a8db1ef6aab9f7b6ba
|
923868e09cc82545dc60a7ec04c59601e0159320
|
refs/heads/master
| 2020-03-22T09:33:59.694243
| 2018-07-05T13:03:08
| 2018-07-05T13:03:08
| 139,845,651
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,027
|
java
|
package br.com.casadocodigo.loja.configuration;
import com.google.common.cache.CacheBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.guava.GuavaCacheManager;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.format.datetime.DateFormatter;
import org.springframework.format.datetime.DateFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.mail.MailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.web.accept.ContentNegotiationManager;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.i18n.CookieLocaleResolver;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@EnableWebMvc
@ComponentScan(basePackages = "br.com.casadocodigo.loja")
@EnableCaching
public class AppWebConfiguration extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
resolver.setExposedContextBeanNames("carrinhoCompras");
return resolver;
}
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("/WEB-INF/messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(1);
return messageSource;
}
@Bean
public FormattingConversionService mvcConversionService() {
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
DateFormatterRegistrar registrar = new DateFormatterRegistrar();
registrar.setFormatter(new DateFormatter("dd/MM/yyyy"));
registrar.registerFormatters(conversionService);
return conversionService;
}
@Bean
public MultipartResolver multipartResolver() {
return new StandardServletMultipartResolver();
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
@Bean
public CacheManager cacheManager() {
CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().maximumSize(100)
.expireAfterAccess(5, TimeUnit.MINUTES);
GuavaCacheManager manager = new GuavaCacheManager();
manager.setCacheBuilder(builder);
return manager;
}
@Bean
public ViewResolver contentNegotiationViewResolver(ContentNegotiationManager manager) {
List<ViewResolver> viewResolvers = new ArrayList<>();
viewResolvers.add(internalResourceViewResolver());
viewResolvers.add(new JsonViewResolver());
ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();
resolver.setViewResolvers(viewResolvers);
resolver.setContentNegotiationManager(manager);
return resolver;
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LocaleChangeInterceptor());
}
@Bean
public LocaleResolver localeResolver() {
return new CookieLocaleResolver();
}
@Bean
public MailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost("smtp.gmail.com");
mailSender.setUsername("alura.springmvc@gmail.com");
mailSender.setPassword("alura2015");
mailSender.setPort(587);
Properties mailProperties = new Properties();
mailProperties.put("mail.smtp.auth", true);
mailProperties.put("mail.smtp.starttls.enable", true);
mailSender.setJavaMailProperties(mailProperties);
return mailSender;
}
}
|
[
"palerique@gmail.com"
] |
palerique@gmail.com
|
dc80261c90caea68bd65ffaa47596a49ef68508e
|
c3498924c12bbafe144ec7ca1402fee6859af46c
|
/src/main/java/com/example/Leetcode/Roman_Int_2.java
|
d20cf6367fcc0b11ddd0751e88a362c0f24918fe
|
[] |
no_license
|
BharathKumarRV/Leetcode
|
7e9dc88a0bde51b86d57b8f00f709bb7799c3e6b
|
dda20e506d15b47deb846c6e5ad56ecefb54120c
|
refs/heads/master
| 2022-09-29T16:49:58.435316
| 2022-09-18T10:15:18
| 2022-09-18T10:15:18
| 247,475,146
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,019
|
java
|
package com.example.Leetcode;
import org.springframework.boot.SpringApplication;
public class Roman_Int_2 {
public static void main(String[] args) {
SpringApplication.run(LeetcodeApplication.class, args);
int res = romanToInt("IX");
System.out.println(res);
}
public static int romanToInt(String s) {
int sum = 0;
if (s.indexOf("IV") != -1) {
sum -= 2;
}
if (s.indexOf("IX") != -1) {
sum -= 2;
}
if (s.indexOf("XL") != -1) {
sum -= 20;
}
if (s.indexOf("XC") != -1) {
sum -= 20;
}
if (s.indexOf("CD") != -1) {
sum -= 200;
}
if (s.indexOf("CM") != -1) {
sum -= 200;
}
char c[] = s.toCharArray();
int count = 0;
for (; count <= s.length() - 1; count++) {
if (c[count] == 'M')
sum += 1000;
if (c[count] == 'D')
sum += 500;
if (c[count] == 'C')
sum += 100;
if (c[count] == 'L')
sum += 50;
if (c[count] == 'X')
sum += 10;
if (c[count] == 'V')
sum += 5;
if (c[count] == 'I')
sum += 1;
}
return sum;
}
}
|
[
"bkumarrv@deloitte.com"
] |
bkumarrv@deloitte.com
|
51b129c8da81b275c5968351f9793c75d87ceb45
|
6369a01f0d8f4727bdb6c7e556211e44eb5f1e72
|
/src/test/java/com/github/marschall/memoryfilesystem/FileSystemRule.java
|
b7c8dc9d1cc63c686d8e5c496c1e3c4d3b90e84e
|
[] |
no_license
|
ferstl/memoryfilesystem
|
3a61c2a53e400373c0d25d81f9ef2fcfad6e83f6
|
248f766591f50bca8a46db1917ed15c2b6ee8714
|
refs/heads/master
| 2021-01-17T20:26:06.414623
| 2019-01-05T15:48:42
| 2019-01-05T15:48:42
| 45,345,697
| 0
| 0
| null | 2015-11-01T15:26:21
| 2015-11-01T15:26:21
| null |
UTF-8
|
Java
| false
| false
| 758
|
java
|
package com.github.marschall.memoryfilesystem;
import java.nio.file.FileSystem;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
final class FileSystemRule implements TestRule {
private FileSystem fileSystem;
FileSystem getFileSystem() {
return this.fileSystem;
}
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
FileSystemRule.this.fileSystem = MemoryFileSystemBuilder.newEmpty().build("name");
try {
base.evaluate();
} finally {
FileSystemRule.this.fileSystem.close();
}
}
};
}
}
|
[
"philippe.marschall@gmail.com"
] |
philippe.marschall@gmail.com
|
15717492138f6146f7022c08bcb228214c98e4f7
|
43dcdc6bc343218b08e60c776d97cfb12b5fb6e8
|
/baselibs/src/main/java/com/unistrong/baselibs/ui/chart/BaseMeasure.java
|
c5b0c20288ebc0b62281773e805af3e94c2c190d
|
[] |
no_license
|
wangaowu/EmploymentService
|
8b8a706f8eb7b29892cb0f747314ac297be4f9f3
|
d15dd4c47b5fbc853ca407cebbbe71bc10dc3750
|
refs/heads/master
| 2020-03-22T07:09:03.501716
| 2018-07-11T09:40:27
| 2018-07-11T09:40:27
| 138,865,485
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,957
|
java
|
package com.unistrong.baselibs.ui.chart;
import android.content.Context;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import com.unistrong.baselibs.utils.DensityUtils;
import com.unistrong.baselibs.utils.NumberUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 自定义view计算基类
*/
public class BaseMeasure extends View {
protected static final String TAG = "BaseMeasure";
private static final int MIN_WIDTH = 300;
private static final int MIN_HEIGHT = 100;
private static final int PADDING_LEFT = 40;
private static final int PADDING_RIGHT = 20;
private static final int PADDING_VERTICAL = 20;
protected static final int ANXIUS_Y_COUNT = 6; //Y轴坐标的个数
private int viewWidth;
private int viewHeight;
private int paddingLeft;
private int paddingRight;
private int paddingVertical;
protected List<RectF> elementRectFs = new ArrayList<>();
protected RectF chartRectF;
protected List<BindData> bindDatas;
protected int maxValue;
protected String unit;
public BaseMeasure(Context context) {
super(context);
}
public BaseMeasure(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public BaseMeasure(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public void setData(float maxValue, List<BindData> datas, String unit) {
if (datas == null) return;
this.maxValue = invalidateMax(maxValue);
this.unit = unit;
for (int i = 0; i < datas.size(); i++) {
BindData bindData = datas.get(i);
bindData.yRatio = bindData.valueY / this.maxValue;
}
this.bindDatas = datas;
scaleElementsRect();
postInvalidate();
}
protected boolean measureComplete() {
return chartRectF != null
&& bindDatas != null
&& !bindDatas.isEmpty();
}
/**
* 取动态竖轴值
*
* @param yValue 值
* @param useThou 是否使用 "千" 单位
* @return
*/
protected String getDynamicYFlag(int yValue, boolean useThou) {
return useThou ? String.valueOf(NumberUtils.keepPrecision(yValue * .001f, 2))
: String.valueOf(yValue);
}
/**
* 取整最大值
*/
private int invalidateMax(float maxValue) {
if (maxValue < 10) return 10;
if (maxValue < 1000) {
int step = (ANXIUS_Y_COUNT - 1) * 10;
return (((int) maxValue) / step + 1) * step;
}
if (maxValue < 10000) {
int step = (ANXIUS_Y_COUNT - 1) * 100;
return (((int) maxValue) / step + 1) * step;
}
int step = (ANXIUS_Y_COUNT - 1) * 1000;
return (((int) maxValue) / step + 1) * step;
}
private void scaleElementsRect() {
//没有数据or测量未完成
if (!measureComplete()) return;
elementRectFs.clear();
int xDistance = (viewWidth - paddingLeft - paddingRight) / bindDatas.size();
int index = 0;
for (BindData bindData : bindDatas) {
float left = paddingLeft + index * xDistance;
float top = (1 - bindData.yRatio) * (chartRectF.height()) + chartRectF.top;
float bottom = chartRectF.bottom;
RectF elementRect = new RectF(left, top, left + xDistance, bottom);
elementRectFs.add(elementRect);
index++;
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
this.viewWidth = getSize(widthMeasureSpec, DensityUtils.dp2px(getContext(), MIN_WIDTH));
this.viewHeight = getSize(heightMeasureSpec, DensityUtils.dp2px(getContext(), MIN_HEIGHT));
initBounds();
scaleElementsRect();
}
private void initBounds() {
this.paddingLeft = DensityUtils.dp2px(getContext(), PADDING_LEFT) + getPaddingLeft();
this.paddingRight = DensityUtils.dp2px(getContext(), PADDING_RIGHT) + getPaddingRight();
this.paddingVertical = DensityUtils.dp2px(getContext(), PADDING_VERTICAL);
this.chartRectF = new RectF(paddingLeft, paddingVertical, viewWidth - paddingRight, viewHeight - paddingVertical);
}
private int getSize(int sizeMeasureSpec, int atMost) {
int size = 0;
switch (MeasureSpec.getMode(sizeMeasureSpec)) {
case MeasureSpec.EXACTLY:
size = MeasureSpec.getSize(sizeMeasureSpec);
break;
case MeasureSpec.UNSPECIFIED:
size = atMost;
DensityUtils.dp2px(getContext(), 30);
break;
}
return size;
}
protected int getDynamicStep(Paint paint, String measureText) {
float textWidth = paint.measureText(measureText);
int horPadding = DensityUtils.dp2px(getContext(), 8);
textWidth = textWidth + 2 * horPadding;
float count;
if (textWidth > PADDING_LEFT) {
//文字宽度>左间距,用控件尺寸计算
count = viewWidth / textWidth;
} else {
count = chartRectF.width() / textWidth;
}
return (int) (elementRectFs.size() / count) + 1;
}
public static class BindData {
/**
* 传入构造
*
* @param valueY 竖轴的值
* @param flagX 横轴的文字
*/
public BindData(float valueY, String flagX) {
this.valueY = valueY;
this.flagX = flagX;
}
public float x;
public float yRatio;
public float valueY;
public String flagX;
public String flagY;
public Object data;
}
}
|
[
"wang_gaowu@qq.com"
] |
wang_gaowu@qq.com
|
6c27f47aecc7e9e0c1d488d5d9dc17b20d647368
|
de7b67d4f8aa124f09fc133be5295a0c18d80171
|
/workspace/ActiveMQ-5.5-Spring/src/com/springactivemq/HelloSender.java
|
5efd59ddee2f05a7cd8e6461726c44ceb1e02305
|
[] |
no_license
|
lin-lee/eclipse_workspace_test
|
adce936e4ae8df97f7f28965a6728540d63224c7
|
37507f78bc942afb11490c49942cdfc6ef3dfef8
|
refs/heads/master
| 2021-05-09T10:02:55.854906
| 2018-01-31T07:19:02
| 2018-01-31T07:19:02
| 119,460,523
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 999
|
java
|
package com.springactivemq;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
public class HelloSender {
public static void main(String [] args){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext-jms.xml");
JmsTemplate template = (JmsTemplate)applicationContext.getBean("jmsTemplate");
Destination destination = (Destination)applicationContext.getBean("destination");
template.send(destination, new MessageCreator(){
public Message createMessage(Session session)throws JMSException{
return session.createTextMessage("发送消息:Hello ActionMQ Text Messaage2!");
}
});
System.out.println("成功发送了一条JMS消息");
}
}
|
[
"lilin@lvmama.com"
] |
lilin@lvmama.com
|
e46569959c00f70510a3d0e2e8828c18276885d7
|
6d135287c5aeccf2720af4402a80df789281a785
|
/src/org/xmlsoap/schemas/soap/encoding/LongDocument.java
|
089feffbf13c788d4368f3cdbb3016fea0c0de82
|
[] |
no_license
|
ala-nasri/CallFireAPI
|
364401e23a4c84eb59eb981731e90eebe8128558
|
eee34787290de81972fa7bbaf144325f416024e4
|
refs/heads/master
| 2021-05-26T16:55:11.770949
| 2013-07-02T22:18:43
| 2013-07-02T22:18:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,506
|
java
|
/*
* An XML document type.
* Localname: long
* Namespace: http://schemas.xmlsoap.org/soap/encoding/
* Java type: org.xmlsoap.schemas.soap.encoding.LongDocument
*
* Automatically generated - do not modify.
*/
package org.xmlsoap.schemas.soap.encoding;
/**
* A document containing one long(@http://schemas.xmlsoap.org/soap/encoding/) element.
*
* This is a complex type.
*/
public interface LongDocument extends org.apache.xmlbeans.XmlObject
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(LongDocument.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.sF5862003E60B0EFBE9BF7C4370E02CB6").resolveHandle("long0d92doctype");
/**
* Gets the "long" element
*/
org.xmlsoap.schemas.soap.encoding.Long getLong();
/**
* Sets the "long" element
*/
void setLong(org.xmlsoap.schemas.soap.encoding.Long xlong);
/**
* Appends and returns a new empty "long" element
*/
org.xmlsoap.schemas.soap.encoding.Long addNewLong();
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.xmlsoap.schemas.soap.encoding.LongDocument newInstance() {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.xmlsoap.schemas.soap.encoding.LongDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.xmlsoap.schemas.soap.encoding.LongDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}
|
[
"alaeddine.nasri@gmail.com"
] |
alaeddine.nasri@gmail.com
|
c21145c567a5155efd76fa162801ac716e8dddd4
|
b990f0d928c3bf12cc91c86f1e695c8c1a828243
|
/src/test/PedidoCompra/Test02.java
|
cd5f58367aedc40d83b301fe47039a5a134efd49
|
[] |
no_license
|
romanixp/UltraColorDAO
|
0ba7d47a74a8b0ca5e93dd9605de43588b658d43
|
ace75025e639d014b53693da9ee286364301efb4
|
refs/heads/master
| 2016-09-03T07:04:19.661358
| 2013-12-23T04:38:24
| 2013-12-23T04:38:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 987
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test.PedidoCompra;
import dao.DAOFactory;
import dao.design.IPedidoCompraDAO;
import dao.to.PedidoCompraTO;
import java.sql.Date;
/**
*
* @author Sistemas
*/
public class Test02 { //prueba de actualizacion
public static void main(String[] args) {
//datos
PedidoCompraTO pedidoCompraTO = new PedidoCompraTO();
pedidoCompraTO.setCodigo("0000001");
pedidoCompraTO.setCompCodigo(null);
pedidoCompraTO.setProdCodigo(null);
pedidoCompraTO.setCantidad(0);
try {
IPedidoCompraDAO pedidoCompraDAO = DAOFactory.getInstance().getPedidoCompraDAO();
pedidoCompraDAO.actualizar(pedidoCompraTO);
//System.out.println("Código generado: " + pedidoCompraTO.getCodigo());
} catch (Exception e) {
e.printStackTrace();
}
} // main
}
|
[
"romanixd@gmail.com"
] |
romanixd@gmail.com
|
c3dd88ab88bcb90c2f836a6ed29425a7671ca3db
|
914f9adba1d88db1ba32aebc60118f459fbbfad9
|
/src/activity2_objectclasses/FirstObject.java
|
2b66a87dce55bc4be68e7d7f00b5ee3557d26d3c
|
[] |
no_license
|
StarTrekManiac2/Lecture7
|
28e8c432653c96674200e97bc948a0b6d15d3df5
|
2197577150d6052441f6b997280c5e287226eb0d
|
refs/heads/master
| 2020-09-05T21:33:56.517060
| 2019-11-18T18:53:49
| 2019-11-18T18:53:49
| 220,220,511
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 422
|
java
|
package activity2_objectclasses;
public class FirstObject
{
public static void main(String[] args)
{
// Get the object's colour and body type from Object class (Car)
System.out.println("PAINT STYLE:\t" + Car.colour);
System.out.println("BODY TYPE:\t\t" + Car.bodyType);
// Call acceleration method from Object class (Car)
System.out.println(Car.accelerate());
}
}
|
[
"chrissy14az@hotmail.co.uk"
] |
chrissy14az@hotmail.co.uk
|
0fe6975f6bc5b3cd384382a9ca1ede41f13a3b5f
|
ba3a1f14adc3f443ceb0ae0a9243855bdd56cbd3
|
/src/main/java/isi/taskmanager/security/oauth2/user/OAuth2UserInfoFactory.java
|
ae173257559e34ce4b7781ae2b9501e2b38d1852
|
[] |
no_license
|
albertrzcinski/TaskManagerSpringBoot
|
9f3eacc9ea8379160b2b7784ae3c3db9b40b1e2a
|
8e3e0ef3d72f1880ba9e93f6d5c16503c7c6cd68
|
refs/heads/master
| 2022-02-17T15:15:42.338492
| 2019-09-11T17:15:21
| 2019-09-11T17:15:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 636
|
java
|
package isi.taskmanager.security.oauth2.user;
import isi.taskmanager.exception.OAuth2AuthenticationProcessingException;
import isi.taskmanager.model.AuthProvider;
import java.util.Map;
public class OAuth2UserInfoFactory {
public static OAuth2UserInfo getOAuth2UserInfo(String registrationId, Map<String, Object> attributes) {
if (registrationId.equalsIgnoreCase(AuthProvider.facebook.toString())) {
return new FacebookOAuth2UserInfo(attributes);
} else {
throw new OAuth2AuthenticationProcessingException("Sorry! Login with " + registrationId + " is not supported yet.");
}
}
}
|
[
"albertrzcinski@gmail.com"
] |
albertrzcinski@gmail.com
|
8889f6ad963dab96f0bf155832ddb8bd5272ee08
|
c4152864ea8492868998b95f5e968f75d95399e3
|
/app/src/androidTest/java/com/dev/bob/beestart/ExampleInstrumentedTest.java
|
f6fd37d8203b47004f83d53d091ca4a8f66ec46a
|
[] |
no_license
|
henriquemendesc/beestart
|
4f0cd80583d398c5bfa601ab8a0e102fa05d9a95
|
5efe0c2c7947bdd9db08ce170d97c364f47ed76f
|
refs/heads/master
| 2021-07-17T19:36:24.955635
| 2017-10-23T14:38:07
| 2017-10-23T14:38:07
| 107,972,034
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 744
|
java
|
package com.dev.bob.beestart;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.dev.bob.beestart", appContext.getPackageName());
}
}
|
[
"henriiimendesc@gmail.com"
] |
henriiimendesc@gmail.com
|
59ba67db0613dbfe6b2e13bd7574381f7d0033e3
|
c60a8f21b73de7c7cb219585fe60ab59de7f6fd1
|
/src/main/java/org/wannagoframework/dto/serviceQuery/googlePlaceSearch/AutocompleteSearchRequestQuery.java
|
ba1ba1b98e0fe169ceea6a29e270e0aa866ab904
|
[] |
no_license
|
wannagodev1/shared-dto
|
7bae2cf75abd2c7301d6d6770ae792ca1d612510
|
07fac200da24c8aaa86ad5378c5f622fe307ea60
|
refs/heads/master
| 2020-12-27T18:44:56.122283
| 2020-04-21T14:11:32
| 2020-04-21T14:11:32
| 237,974,972
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,339
|
java
|
/*
*
* DO YOU WANNA PLAY CONFIDENTIAL
* __________________
*
* [2018] - [2019] Do You Wanna Play
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of "Do You Wanna Play"
* and its suppliers, if any. The intellectual and technical concepts contained herein are
* proprietary to "Do You Wanna Play" and its suppliers and may be covered by Morocco. and Foreign
* Patents, patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material is strictly forbidden unless
* prior written permission is obtained from "Do You Wanna Play".
*/
package org.wannagoframework.dto.serviceQuery.googlePlaceSearch;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.wannagoframework.dto.serviceQuery.BaseRemoteQuery;
import org.wannagoframework.dto.utils.LatLng;
/**
* @author Wannago dev1.
* @version 1.0
* @since 2019-06-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class AutocompleteSearchRequestQuery extends BaseRemoteQuery implements Serializable {
private String query;
private LatLng location;
private Double radius;
}
|
[
"wannago.dev1@gmail.com"
] |
wannago.dev1@gmail.com
|
4cb3da93410733e73e38bdd27334076687d52b56
|
646ec89e95b0d5bfced010d1e68bf31f5c6d00f2
|
/java/src/cs224n/features/FeatureValue.java
|
acbe830ed762431026d49e613a5c945596fb4491
|
[] |
no_license
|
qiaojingy/MC
|
07d4cf5b7d93fda46968fa8c42864b764c8a04a8
|
341be79a6e8c2dd8ced78c275654b84074e0a06b
|
refs/heads/master
| 2021-01-10T04:43:45.762819
| 2017-08-19T04:56:43
| 2017-08-19T04:56:43
| 46,260,990
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 403
|
java
|
package cs224n.features;
public class FeatureValue {
private final String FEATURE_NAME;
private double value;
public FeatureValue(String name, double value) {
this.FEATURE_NAME = name;
this.value = value;
}
public String getName() {
return FEATURE_NAME;
}
public double getValue() {
return value;
}
public String toString() {
return this.getName() + ": " + this.getValue();
}
}
|
[
"qiaojingyan9@gmail.com"
] |
qiaojingyan9@gmail.com
|
0d292e7767e35b0bb234c639055790652fe64d6c
|
16512a1ad501ef75409fa35265e32a5c784a8d2d
|
/android/app/src/main/java/com/darlinnative/MainApplication.java
|
2f8941c4cc589a812bde4b3b15ef9832fe97bf60
|
[] |
no_license
|
doxiaodong/darlin-native
|
c8f0021d5e86233a195cb38ab2be148141b46cea
|
6d5ff997811b311cae921ae4cf2bcc18ee2518c1
|
refs/heads/master
| 2021-05-12T03:42:24.577604
| 2018-01-16T03:07:18
| 2018-01-16T03:07:18
| 117,623,779
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,137
|
java
|
package com.darlinnative;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
|
[
"duxiaodong@darlin.me"
] |
duxiaodong@darlin.me
|
f89fb6b714d471a0461603ac99436e2574d29012
|
28e564d40228754d39ae40f7842609ad94df26d1
|
/JavaApplication14/src/clases/ClasePadre_Abstracta.java
|
15a6a4fe2ee9370f514ab7b81cc0198cef392270
|
[] |
no_license
|
Sempiterman/Java-POO
|
6973b1d7ef1c59d6994a80ff1299e641f08003a3
|
363f22c5eb55e79d47f4b9e58bd6a481957694a1
|
refs/heads/master
| 2021-01-02T16:43:50.202587
| 2020-02-11T07:58:04
| 2020-02-11T07:58:04
| 239,706,714
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,430
|
java
|
package clases;
import java.util.Scanner;
public abstract class ClasePadre_Abstracta {
protected int transacciones, retiro, deposito;
private static int saldo;
Scanner entrada = new Scanner(System.in);
public void Operaciones() {
int bandera = 0;
int seleccion = 0;
do {
do {
System.out.println("Porfavor seleccione una opción:");
System.out.println(" 1. Consulta de saldo.");
System.out.println(" 2. Retiro de efectivo.");
System.out.println(" 3. Deposito de efectivo.");
System.out.println(" 4. Salir.");
seleccion = entrada.nextInt();
if (seleccion >= 1 && seleccion <= 4) {
bandera = 1;
} else {
System.out.println("-------------------------------------------------");
System.out.println("Opción no disponible, vuelva a intentar porfavor.");
System.out.println("-------------------------------------------------");
}
} while (bandera == 0);
if(seleccion == 1){
ClasePadre_Abstracta mensajero = new ClaseHija_Consulta();
mensajero.Transacciones();
}else if(seleccion == 2){
ClasePadre_Abstracta mensajero = new ClaseHija_Retiro();
mensajero.Transacciones();
} else if(seleccion == 3){
ClasePadre_Abstracta mensajero = new ClaseHija_Deposito();
mensajero.Transacciones();
} else if(seleccion == 4){
System.out.println("--------------------------");
System.out.println("¡Gracias!, vuelva pronto.");
System.out.println("--------------------------");
bandera = 2;
}
} while (bandera != 2);
}
//Método para solicitar cantidad de retiro
public void Retiro(){
retiro = entrada.nextInt();
}
//Método para solicitar deposito
public void Deposito(){
deposito = entrada.nextInt();
}
//Método abstracto
public abstract void Transacciones();
//Métodos setter y getter
public int getSaldo(){
return saldo;
}
public void setSaldo(int saldo){
this.saldo = saldo;
}
}
|
[
"Sempiterman@gmail.com"
] |
Sempiterman@gmail.com
|
b7d65ffe8dbb82df6ba67e68deac541bd00542eb
|
533f81864e83b9aa1df1ce3497181ae4582ae2ef
|
/DesignPatterns-Java/builder/src/main/java/builder/Main.java
|
51a8c73a514f738b739cc7e584f6904053da848a
|
[] |
no_license
|
sharma-lokesh/Design-Patterns-Java
|
3ed6108341ecf5b2ffef9e6a03a3e83c3e097716
|
9f859ed2c3ee808584cba2598d4cc39de5128d3c
|
refs/heads/master
| 2020-09-08T15:49:38.688370
| 2019-11-12T09:36:27
| 2019-11-12T09:36:27
| 221,176,049
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 242
|
java
|
package builder;
public enum Main {
BURGER("Burger"), PIZZA("Pizza"), WRAP("Wrap"), SANDWICH("Sandwich");
private String title;
Main(String title) {
this.title = title;
}
@Override
public String toString() {
return title;
}
}
|
[
"lokeshsharmalive@hotmail.com"
] |
lokeshsharmalive@hotmail.com
|
ed87fbeec14f61c9979f966ad8e5da13d4ee1b2a
|
d60e287543a95a20350c2caeabafbec517cabe75
|
/LACCPlus/Hadoop/2005_1.java
|
22ced82c7fff1be224537eee5666866acc9243cc
|
[
"MIT"
] |
permissive
|
sgholamian/log-aware-clone-detection
|
242067df2db6fd056f8d917cfbc143615c558b2c
|
9993cb081c420413c231d1807bfff342c39aa69a
|
refs/heads/main
| 2023-07-20T09:32:19.757643
| 2021-08-27T15:02:50
| 2021-08-27T15:02:50
| 337,837,827
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 836
|
java
|
//,temp,TestDistCpViewFs.java,354,374,temp,TestIntegration.java,396,417
//,3
public class xxx {
@Test
public void testUpdateGlobTargetMissingSingleLevel() {
try {
Path listFile = new Path("target/tmp1/listing").makeQualified(fs.getUri(),
fs.getWorkingDirectory());
addEntries(listFile, "*");
createFiles("multifile/file3", "multifile/file4", "multifile/file5");
createFiles("singledir/dir2/file6");
runTest(listFile, target, false, true);
checkResult(target, 4, "file3", "file4", "file5", "dir2/file6");
} catch (IOException e) {
LOG.error("Exception encountered while running distcp", e);
Assert.fail("distcp failure");
} finally {
TestDistCpUtils.delete(fs, root);
TestDistCpUtils.delete(fs, "target/tmp1");
}
}
};
|
[
"sgholami@uwaterloo.ca"
] |
sgholami@uwaterloo.ca
|
fc9d4bc48088712d40617da0a86ad9ec390aa9e4
|
e9349051fa51df52f624f48c9712aeed919c538c
|
/src/main/java/com/bankapp/model/CurrencyConversionRate.java
|
0b9a4db9c4a9fd6446660f54b26ff33493c25324
|
[] |
no_license
|
ThiMpanza/BankSystem
|
e0408cb93d7f845b8c9dc842b988e9fcd8d7791c
|
ae6c5e6a3bd3e848a585870a425b0e715436b1f6
|
refs/heads/master
| 2023-03-12T08:48:19.273605
| 2021-02-24T14:35:47
| 2021-02-24T14:35:47
| 341,927,460
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,784
|
java
|
package com.bankapp.model;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;
@Entity
@Table(name = "CURRENCY_CONVERSION_RATE", schema = "PUBLIC", catalog = "TESTDB")
public class CurrencyConversionRate {
@Id
@GeneratedValue
private Long id;
@Id
@Column(name = "CURRENCY_CODE", nullable = false, length = 3)
private String currencyCode;
private String conversionIndicator;
private BigDecimal rate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
@Basic
@Column(name = "CONVERSION_INDICATOR", nullable = false, length = 1)
public String getConversionIndicator() {
return conversionIndicator;
}
public void setConversionIndicator(String conversionIndicator) {
this.conversionIndicator = conversionIndicator;
}
@Basic
@Column(name = "RATE", nullable = false, precision = 8)
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CurrencyConversionRate that = (CurrencyConversionRate) o;
return Objects.equals(currencyCode, that.currencyCode) && Objects.equals(conversionIndicator, that.conversionIndicator) && Objects.equals(rate, that.rate);
}
@Override
public int hashCode() {
return Objects.hash(currencyCode, conversionIndicator, rate);
}
}
|
[
"NmthandazoM@discovery.co.za"
] |
NmthandazoM@discovery.co.za
|
df94dc76c4cdad37956b536c42595509439a0e5d
|
9f96fd0ba30f2a1c5948130be0bc98d09957d3e4
|
/add/src/main/java/com/hcentive/training/addition/AdditionController.java
|
96bd797c9d71f983b34c94f610813bd90a4a53c4
|
[] |
no_license
|
sumit-chandna/microservice
|
28c2c221b8bd2c069fb4439ceee5ea6257af2f27
|
fa423438ae396b2ebf342ac631750aff3978e631
|
refs/heads/master
| 2020-03-28T17:30:29.792052
| 2018-09-14T14:05:57
| 2018-09-14T14:05:57
| 148,796,337
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 694
|
java
|
package com.hcentive.training.addition;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/v1/number")
public class AdditionController {
@GetMapping(value="/{first}/{second}")
public ResponseEntity<Integer> addNumbers(@PathVariable("first") Integer first,
@PathVariable("second") Integer second) {
System.out.println("**********Inside add Numbers *****");
return ResponseEntity.ok(second + first);
}
}
|
[
"chandna.sumit@hcentive.com"
] |
chandna.sumit@hcentive.com
|
1149902ccc9deab6e892e778ffe8e48b85e83ddc
|
1d68f0e3655fbb687c1c008d638bc94056951cc0
|
/com.qbao.recommend.stream/src/main/java/com/qbao/recommend/stream/cmp/parser/binlog/CartBinLogParser.java
|
eaa57df04f5738a9d78bb91a9896cfd7f599963a
|
[] |
no_license
|
jackandyao/com.qbao.common.parent
|
47fa5485e6763b3f04f3566153b82b3f94a790a2
|
a94595b88aacee9c66324e75ff4267001e3bb383
|
refs/heads/master
| 2021-05-09T02:55:50.583922
| 2018-01-28T03:45:06
| 2018-01-28T03:45:06
| 119,225,146
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,021
|
java
|
/**
*
*/
package com.qbao.recommend.stream.cmp.parser.binlog;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.qbao.recommend.stream.cmp.domain.nginx.Record;
import com.qbao.recommend.stream.cmp.enums.EventType;
import com.qbao.recommend.stream.cmp.enums.TopicType;
import com.qbao.recommend.stream.cmp.parser.KafkaParser;
/**
* @author sjwangping@qbao.com
*
* $LastChangedDate: 2016-09-05 18:26:32 +0800 (Mon, 05 Sep 2016) $
* $LastChangedRevision: 896 $
* $LastChangedBy: jiahongping $
*/
public class CartBinLogParser extends KafkaParser<Record> {
private Gson gson = new GsonBuilder().serializeNulls().create();
public CartBinLogParser(TopicType type) {
super(type);
}
@Override
public Record parse(String line) {
// TODO Auto-generated method stub
return null;
}
@Override
public EventType getEventType() {
// TODO Auto-generated method stub
return null;
}
}
|
[
"786648643@qq.com"
] |
786648643@qq.com
|
56a23daed8b7335eb3568ea857fcf6e12dc2ec4f
|
43f02a9e439f51f71739a2a6ea979ffeb96a4438
|
/Academico/academico-web/src/main/java/br/com/iasc/seguranca/filtro/CharsetFilter.java
|
eaa057aebd7ba62f74a0ea5de7e5627d6a6e1768
|
[] |
no_license
|
acfmarco/academico
|
0dcd60f03b6b13ca72b7a1b558c9573631c56e8e
|
c4982cdcf1643ace99c88537c2395a0de85fbc57
|
refs/heads/master
| 2021-01-23T08:28:30.327977
| 2018-03-13T18:24:04
| 2018-03-13T18:24:04
| 102,523,765
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,561
|
java
|
/**
*
*/
package br.com.iasc.seguranca.filtro;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* @author tiago.menezes
*
*/
public class CharsetFilter implements Filter {
private String encoding;
/*
* (non-Javadoc)
*
* @see javax.servlet.Filter#destroy()
*/
public void destroy() {
}
/*
* (non-Javadoc)
*
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
* javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if (request.getCharacterEncoding() == null) {
request.setCharacterEncoding(this.encoding);
}
// response.setContentType("text/html; charset=ISO-8859-1");
// response.setCharacterEncoding("ISO-8859-1");
response.setContentType("text/html; charset=UTF-8");
//response.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);
}
/*
* (non-Javadoc)
*
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
*/
public void init(FilterConfig config) throws ServletException {
this.encoding = config.getInitParameter("requestEncoding");
if (this.encoding == null) {
this.encoding = "UTF-8";
// this.encoding = "ISO-8859-1";
}
}
}
|
[
"marcosaig@hotmail.com"
] |
marcosaig@hotmail.com
|
0cad53ae25636a196c9ec88f2ecad6eb532a08b9
|
4c0d1f902ff8a8701ab2ac56f4e9f342c1946587
|
/src/main/java/org/gwtbootstrap3/extras/notify/client/event/NotifyShownHandler.java
|
efed8833563c8c3cd52ef5f93d49650d7d27798a
|
[
"Apache-2.0"
] |
permissive
|
gwtbootstrap3/gwtbootstrap3-extras
|
80206616f84db1098b27f8397577655c8ef638b0
|
3b4c82f547f39fbfcf9d44b4b912ea3fdd61c13b
|
refs/heads/master
| 2021-04-12T12:07:58.800553
| 2019-11-15T15:10:08
| 2019-11-15T15:10:08
| 15,231,680
| 31
| 91
|
Apache-2.0
| 2019-11-14T17:38:11
| 2013-12-16T17:01:41
|
Java
|
UTF-8
|
Java
| false
| false
| 1,080
|
java
|
package org.gwtbootstrap3.extras.notify.client.event;
/*
* #%L
* GwtBootstrap3
* %%
* Copyright (C) 2013 - 2015 GwtBootstrap3
* %%
* 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.
* #L%
*/
/**
* Handler interface for Notify shown events.
*/
public interface NotifyShownHandler {
/**
* Called when Notify shown event is fired.
*/
void onShown();
/**
* Default Notify's shown handler
*/
static NotifyShownHandler DEFAULT_SHOWN_HANDLER = new NotifyShownHandler() {
@Override
public void onShown() {}
};
}
|
[
"xiaodong.sun@wallix.com"
] |
xiaodong.sun@wallix.com
|
d55c50dbe8e03e1695d1765acd2afa2f0b1b549e
|
d03db1fb8dccd20fcf0e0c8a3ff1c7ab5fdabc11
|
/src/main/java/com/scitc/blog/service/impl/TagsServiceImpl.java
|
90ed2b4f6d96194b47ad4e66e5b5ed3feeada751
|
[] |
no_license
|
unborn-chy/blog
|
70ba81fa0735eccc6df65a878747065ae9283888
|
157f1721686332589016710a60f7a46747fc9ea3
|
refs/heads/master
| 2021-06-27T02:28:44.981285
| 2019-11-06T10:59:29
| 2019-11-06T10:59:29
| 219,903,368
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,610
|
java
|
package com.scitc.blog.service.impl;
import com.scitc.blog.dto.OperationExecution;
import com.scitc.blog.enums.OperationEnums;
import com.scitc.blog.exception.BlogException;
import com.scitc.blog.mapper.TagsMapper;
import com.scitc.blog.model.Tags;
import com.scitc.blog.service.TagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Service
public class TagsServiceImpl implements TagsService {
@Autowired
private TagsMapper tagsMapper;
@Override
// @Cacheable("tagList")
public OperationExecution getTagsList() {
List<Tags> tagsList = tagsMapper.queryTags();
OperationExecution<Tags> oe = new OperationExecution<>();
oe.setDataList(tagsList);
oe.setCount(tagsList.size());
return oe;
}
@Override
@Transactional
public OperationExecution insertTags(Tags tags) throws BlogException {
tags.setCreateTime(new Date());
int effectedNum = tagsMapper.insertTags(tags);
if (effectedNum <= 0) {
throw new BlogException(OperationEnums.INNER_ERROR);
}
return new OperationExecution(OperationEnums.INNER_SUCCESS);
}
@Override
public OperationExecution getTagsById(Integer tagId) throws BlogException {
Tags tags = tagsMapper.queryTagsById(tagId);
if(tags==null){
throw new BlogException(OperationEnums.NULL_INFO);
}
return new OperationExecution<Tags>(OperationEnums.SUCCESS, tags);
}
@Override
@Transactional
public OperationExecution deleteTags(Integer tagId) throws BlogException {
try {
Tags tags = tagsMapper.queryTagsById(tagId);
int effected = tagsMapper.deleteTags(tags.getTagId());
if (effected <= 0) {
throw new BlogException(OperationEnums.DELETE_ERROR);
}
return new OperationExecution(OperationEnums.DELETE_SUCCESS);
} catch (Exception e) {
throw new BlogException(OperationEnums.NULL_INFO);
}
}
@Override
@Transactional
public OperationExecution updateTags(Tags tags) throws BlogException {
int effectedNum = tagsMapper.updateTags(tags);
if (effectedNum <= 0) {
throw new BlogException(OperationEnums.UPDATE_ERROR);
}
return new OperationExecution(OperationEnums.UPDATE_SUCCESS);
}
}
|
[
"626532990@qq.com"
] |
626532990@qq.com
|
2042ed98be805d5cd1590f664f9fe0404cf17635
|
1555afaffd25b53a065816c839ad731d781480de
|
/docroot/WEB-INF/service/xyz/fanqi/liferay/demo/service/persistence/StudentActionableDynamicQuery.java
|
ddae829a1b46e8a8a6d7c5c98593693d67265d1a
|
[] |
no_license
|
fanqi/liferay-ce-6.2.5-curd-portlet
|
08c5a23548773695c3f42f5d21edad0443004964
|
4502ac51e0da2a13b2e0e001ad6e06e75b1d5b3e
|
refs/heads/master
| 2020-03-27T19:48:18.533062
| 2016-06-05T17:09:26
| 2016-06-05T17:09:26
| 60,409,858
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,302
|
java
|
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package xyz.fanqi.liferay.demo.service.persistence;
import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import xyz.fanqi.liferay.demo.model.Student;
import xyz.fanqi.liferay.demo.service.StudentLocalServiceUtil;
/**
* @author fanqi
* @generated
*/
public abstract class StudentActionableDynamicQuery
extends BaseActionableDynamicQuery {
public StudentActionableDynamicQuery() throws SystemException {
setBaseLocalService(StudentLocalServiceUtil.getService());
setClass(Student.class);
setClassLoader(xyz.fanqi.liferay.demo.service.ClpSerializer.class.getClassLoader());
setPrimaryKeyPropertyName("studentId");
}
}
|
[
"github@fanqi.xyz"
] |
github@fanqi.xyz
|
57d405ba53816d6f6a72a0a0a460e565e7416d12
|
b529f8ca8400cdbf8ab069efed5b6f9d8727c56f
|
/term2/hw5/src/test/java/spbau/eliseeva/XUnit/IgnoreTest.java
|
d1a9d7f14e5123e9f33fc8e6584015acd7c3aec7
|
[] |
no_license
|
MariEliseeva/java_hw
|
369d5e50857906060d0549d6547ffceeaaf6b6e4
|
87cfb6bb95d55662724e7761f173d28385ba6356
|
refs/heads/master
| 2018-09-11T23:11:32.820105
| 2018-06-20T07:33:30
| 2018-06-20T07:33:30
| 103,033,273
| 0
| 0
| null | 2018-06-20T07:37:48
| 2017-09-10T13:55:17
|
Java
|
UTF-8
|
Java
| false
| false
| 167
|
java
|
package spbau.eliseeva.XUnit;
import spbau.eliseeva.XUnit.annotations.Test;
public class IgnoreTest {
@Test(ignore = "reason")
public void test1() {
}
}
|
[
"eliseevamary@mail.ru"
] |
eliseevamary@mail.ru
|
2e1cc31edf75232588b5d9c030da67921f153843
|
af8f2d1b600d794aea496f5f8005a20ed016960b
|
/system/trunk/src/java/net/zdsoft/eis/system/frame/dao/FlowDiagramDao.java
|
8a84160fa262e4d82299f2fc8a2967abf15b8a03
|
[] |
no_license
|
thyjxcf/learn
|
46c033f8434c0b0b0809e2a6b1d5601910b36c0d
|
99b9e04aa9c0e7ee00571dffb8735283cf33b1c1
|
refs/heads/master
| 2021-01-06T20:43:53.071081
| 2017-09-15T10:11:53
| 2017-09-15T10:11:53
| 99,546,817
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 325
|
java
|
package net.zdsoft.eis.system.frame.dao;
import java.util.List;
import net.zdsoft.eis.system.frame.entity.FlowDiagram;
public interface FlowDiagramDao {
/**
* 获取其流程图List
* @param subSystem
* @param unitClass
* @return
*/
public List<FlowDiagram> getFlowDiagramList(int subSystem,int unitClass);
}
|
[
"1129820421@qq.com"
] |
1129820421@qq.com
|
4932c7ec6cc4ac6d05ed627fe92b528c9554c3d0
|
31a81a39ae624d721b7a4339184034ae1c2800e2
|
/chat/ClientInterface.java
|
f1f672a72d08c40e883f5c80f1076e4e028598aa
|
[] |
no_license
|
storme-weather/Algorithms
|
0804ae61747d51aeeb81821e1c41bf7876aac16d
|
1b9980a7403b79f58f797a6a297ca093ee3617d8
|
refs/heads/master
| 2016-09-12T03:48:30.138926
| 2016-04-21T21:02:19
| 2016-04-21T21:02:19
| 55,113,011
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 166
|
java
|
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ClientInterface extends Remote{
void retrieve(String message) throws RemoteException;
}
|
[
"stormeb@email.arizona.edu"
] |
stormeb@email.arizona.edu
|
7ff9821756e0a016f319671173427406c6d9290f
|
84223fa100b9ed9d05c4ebda7ee42bef786c64b0
|
/app/src/main/java/com/tw/bt/BluetoothServiceHandler.java
|
067e90b7d7d9290a41ee2ed7b411897c3f7c0268
|
[] |
no_license
|
asb72/dvd-bt
|
6ab4925a594e91eeffdb883bcfda00a1338875c7
|
d1037bce1aca39a3585bc59dc0deb03e358f92bd
|
refs/heads/master
| 2021-01-10T19:37:42.442042
| 2015-01-22T14:36:43
| 2015-01-22T14:36:43
| 29,597,294
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,193
|
java
|
package com.tw.bt;
import android.bluetooth.BluetoothAdapter;
import android.os.Handler;
import android.os.Message;
import android.tw.john.TWUtil.TWObject;
import android.util.Log;
class BluetoothServiceHandler extends Handler {
final ATBluetoothService aTBluetoothService;
BluetoothServiceHandler(ATBluetoothService aTBluetoothService) {
this.aTBluetoothService = aTBluetoothService;
}
public void handleMessage(Message message) {
int i = 1;
int bluetoothState = 0;
try {
switch (message.what) {
case 7:
if (ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService) != message.arg1) {
ATBluetoothService.SetBluetoothConnectionState(this.aTBluetoothService, message.arg1);
if (ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService) != BluetoothAdapter.STATE_CONNECTED) {
ATBluetoothService.SetCallingState(this.aTBluetoothService, 0);
// CallingLayoutManipulations
ATBluetoothService.GetHandler(this.aTBluetoothService).sendEmptyMessage(65280);
}
ATBluetoothService.SetBluetoothConnectionState_(this.aTBluetoothService, ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService));
}
break;
case 9:
switch (message.arg1) {
case 2:
bluetoothState = BluetoothAdapter.STATE_CONNECTING;
break;
case 3:
case 4:
case 5:
case 6:
bluetoothState = BluetoothAdapter.STATE_CONNECTED;
break;
}
if (ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService) != bluetoothState) {
ATBluetoothService.SetBluetoothConnectionState(this.aTBluetoothService, bluetoothState);
if (ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService) != BluetoothAdapter.STATE_CONNECTED) {
ATBluetoothService.SetCallingState(this.aTBluetoothService, 0);
// CallingLayoutManipulations
ATBluetoothService.GetHandler(this.aTBluetoothService).sendEmptyMessage(65280);
}
ATBluetoothService.SetBluetoothConnectionState_(this.aTBluetoothService, ATBluetoothService.GetBluetoothConnectionState(this.aTBluetoothService));
}
break;
case 11:
String str;
String str2;
if (message.obj instanceof TWObject) {
TWObject tWObject = (TWObject) message.obj;
str = (String) tWObject.obj3;
str2 = (String) tWObject.obj4;
} else {
str = (String) message.obj;
str2 = null;
}
if (ATBluetoothService.GetCallingState(this.aTBluetoothService) != message.arg1) {
ATBluetoothService.SetCallingState(this.aTBluetoothService, message.arg1);
switch (ATBluetoothService.GetCallingState(this.aTBluetoothService)) {
case 0:
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(1283, 0);
break;
case 1:
ATBluetoothService.SetIncomingContactNumber(this.aTBluetoothService, str);
ATBluetoothService.SetIncomingContactName(this.aTBluetoothService, str2);
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(1283, 1);
break;
case 2:
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(1283, 3);
break;
case 3:
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(1283, 2);
break;
}
// CallingLayoutManipulations
ATBluetoothService.GetHandler(this.aTBluetoothService).sendEmptyMessage(65280);
}
break;
case 13: // Release sound stream
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(770, message.arg1);
break;
case 47: // Incoming Call
if (message.arg1 == 0) {
ATBluetoothService.StopPlayer(this.aTBluetoothService);
return;
}
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(770, 2);
ATBluetoothService.PlayFile(this.aTBluetoothService, "/system/etc/goc/ring.mp3");
ATBluetoothService.StartPlayer(this.aTBluetoothService);
break;
case 513: // Remote control: ACCEPT = 24, REJECT = 25
if (message.arg2 == 24 || message.arg2 == 25) {
switch (ATBluetoothService.GetCallingState(this.aTBluetoothService)) {
case 1:
if (message.arg2 == 24 && message.arg1 == 1) {
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(10, 1);
} else {
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(10, 2);
}
break;
case 2:
case 3:
case 4: // outgoing call
if (message.arg2 != 24 || message.arg1 == 1) {
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(10, 0);
} else {
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(33281, 1, 47);
}
break;
default:
break;
}
}
break;
case 769:
if (ATBluetoothService.b(this.aTBluetoothService) != message.arg1) {
ATBluetoothService.a(this.aTBluetoothService, message.arg1);
twUtil a = ATBluetoothService.GetTwUtil(this.aTBluetoothService);
if (ATBluetoothService.b(this.aTBluetoothService) != 8) {
i = 0;
}
a.write(46, i);
}
break;
case 40456:
switch (message.arg1) {
case 0:
switch (message.arg2) {
case 0:
case 1:
case 2:
case 3:
ATBluetoothService.GetTwUtil(this.aTBluetoothService).a(10, message.arg2, (String) message.obj);
break;
case 4:
ATBluetoothService.GetTwUtil(this.aTBluetoothService).write(10, 4, ((String) message.obj).charAt(0));
break;
default:
break;
}
break;
default:
break;
}
break;
case 65280:
switch (ATBluetoothService.GetCallingState(this.aTBluetoothService)) {
case 0:
ATBluetoothService.GetIncomingCallLayout(this.aTBluetoothService).hide();
ATBluetoothService.GetCallingLayout(this.aTBluetoothService).hide();
if (ATBluetoothService.GetPlayingStatus(this.aTBluetoothService)) {
ATBluetoothService.StopPlayer(this.aTBluetoothService);
}
break;
case 1:
ATBluetoothService.GetIncomingCallLayout(this.aTBluetoothService).show(true);
break;
case 2:
ATBluetoothService.GetIncomingCallLayout(this.aTBluetoothService).hide();
ATBluetoothService.GetCallingLayout(this.aTBluetoothService).show();
break;
case 3:
case 4:
ATBluetoothService.GetCallingLayout(this.aTBluetoothService).show();
break;
default:
break;
}
break;
case 65281:
ATBluetoothService.GetCallingLayout(this.aTBluetoothService).hide();
break;
case 65283:
if (ATBluetoothService.b(this.aTBluetoothService) == 8) {
ATBluetoothService.GetTwUtil(this.aTBluetoothService).b(false);
}
break;
default:
break;
}
} catch (Throwable e) {
Log.e("ATBluetoothService", Log.getStackTraceString(e));
}
}
}
|
[
"spam-suda@mail.ru"
] |
spam-suda@mail.ru
|
c7893dd85895f178f846344edbd0e00cd6224958
|
f5da7e64fd3d91d2bd66d59b34be154af8b5e4eb
|
/src/test/java/com/prac/springboot/web/PostsApiControllerTest.java
|
4dd9d1aa7c205e38448b3bf10d1fc2bcab7e6e7d
|
[] |
no_license
|
inthestream/springbootAWS6
|
7ecb89cd54ea3a8ac816873619c9b1b01877caa1
|
a222af0a5fcca35046d7440f3d1a7a9c6264b470
|
refs/heads/master
| 2022-10-10T04:33:58.627752
| 2020-06-11T18:16:09
| 2020-06-11T18:16:09
| 266,812,095
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,178
|
java
|
package com.prac.springboot.web;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.prac.springboot.domain.posts.Posts;
import com.prac.springboot.domain.posts.PostsRepository;
import com.prac.springboot.web.dto.PostsSaveRequestDto;
import com.prac.springboot.web.dto.PostsUpdateRequestDto;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
// For mockMvc
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PostsApiControllerTest {
@LocalServerPort
private int port;
@Autowired
private TestRestTemplate restTemplate;
@Autowired
private PostsRepository postsRepository;
@Autowired
private WebApplicationContext context;
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
.apply(springSecurity())
.build();
}
@After
public void tearDown() throws Exception {
postsRepository.deleteAll();
}
@Test
@WithMockUser(roles="USER")
public void PostsRegister() throws Exception {
//given
String title = "title";
String content = "content";
PostsSaveRequestDto requestDto = PostsSaveRequestDto.builder()
.title(title)
.content(content)
.author("author")
.build();
String url = "http://localhost:" + port + "/api/v1/posts";
//when
mvc.perform(post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.content(new ObjectMapper().writeValueAsString(requestDto)))
.andExpect(status().isOk());
//then
List<Posts> all = postsRepository.findAll();
assertThat(all.get(0).getTitle()).isEqualTo(title);
assertThat(all.get(0).getContent()).isEqualTo(content);
}
@Test
@WithMockUser(roles="USER")
public void PostsUpdate() throws Exception {
//given
Posts savedPosts = postsRepository.save(Posts.builder()
.title("title")
.content("content")
.author("author")
.build());
Long updateId = savedPosts.getId();
String expectedTitle = "title2";
String expectedContent = "content2";
PostsUpdateRequestDto requestDto = PostsUpdateRequestDto.builder()
.title(expectedTitle)
.content(expectedContent)
.build();
String url = "http://localhost:" + port + "/api/v1/posts/" + updateId;
//when
mvc.perform(put(url)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.content(new ObjectMapper().writeValueAsString(requestDto)))
.andExpect(status().isOk());
//then
List<Posts> all = postsRepository.findAll();
assertThat(all.get(0).getTitle()).isEqualTo(expectedTitle);
assertThat(all.get(0).getContent()).isEqualTo(expectedContent);
}
}
|
[
"seongukyun17@gmail.com"
] |
seongukyun17@gmail.com
|
dac5f1222724c07a598788f77acfb634d146cd06
|
153e31bcb0a935391a4bc2d15cc05d1317ff2cf7
|
/assignments/Unit3/HW17MatrixLibrary/MatrixOperation/src/matrixoperation/MatrixOperation.java
|
7762f36aab1c397c013304d80353c510b9193bd6
|
[] |
no_license
|
AlquingaDennis/ESPE202011-FP-GEO-3285
|
36db3dc0b6a98f5253c7328cb92193540bd3fdf3
|
e50b9c36834cb57544f47b59a02d5bdf735477eb
|
refs/heads/main
| 2023-04-01T02:23:52.400560
| 2021-04-05T19:13:26
| 2021-04-05T19:13:26
| 318,601,792
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,683
|
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 matrixoperation;
import ec.edu.espe.Matrix.BasciOperationMatrix;
import java.util.Scanner;
/**
*
* @author Asus
*/
public class MatrixOperation {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int matrixA[][] = new int[3][3];
int matrixB[][] = new int[3][3];
Scanner scanner = new Scanner(System.in);
System.out.println("☾☾☾☾☾Enter matrix A:☽☽☽☽☽");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print("Row " + (i + 1) + " Column " + (j + 1) + " = ");
matrixA[i][j] = scanner.nextInt();
}
}
System.out.println("****************");
System.out.println("☾☾☾☾☾Enter matrix B:☽☽☽☽☽");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print("Row " + (i + 1) + " Column " + (j + 1) + " = ");
matrixB[i][j] = scanner.nextInt();
}
}
System.out.println("Matrix A and Matrix B:");
System.out.println("");
System.out.println("----MATRIX A----");
System.out.println("************");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(matrixA[i][j] + " ");
if (j == 2) {
System.out.println("");
}
}
}
System.out.println("-----MATRIX B-----");
System.out.println("************");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(matrixB[i][j] + " ");
if (j == 2) {
System.out.println("");
}
}
}
System.out.println("🎥🎥🎥🎥🎥 Matrix sum 🎥🎥🎥🎥🎥");
System.out.println("");
BasciOperationMatrix.addMatrix(matrixA, matrixB);
System.out.println("🌛🌛🌛🌛🌛Matrix Subtraction🌛🌛🌛🌛🌛");
System.out.println("");
BasciOperationMatrix.subtractionMatrix(matrixA, matrixB);
System.out.println("🌞🌞🌞🌞🌞Matrix Multiplication🌞🌞🌞🌞🌞");
System.out.println("");
BasciOperationMatrix.multiplyMatrix(matrixA, matrixB);
}
}
|
[
"denisalquinga123@gmail.com"
] |
denisalquinga123@gmail.com
|
faf2ac5b062edf89ede63597f4b1a5b4a48b3b3e
|
8c08b41a6bb5f0ae1fc12db1ab5bd5cdf1237103
|
/src/main/java/pl/khamul/charity/user/User.java
|
8b4112094b9321f37759a690e3cd32b64b16399d
|
[] |
no_license
|
khamul1986/charity-thyme
|
7bd5712aa7a721b454f6c9605cd4f867c5097e7e
|
40702d15a98b22183ed4461acdb9881c1e1bafa9
|
refs/heads/master
| 2023-03-25T04:23:03.350774
| 2021-03-22T19:26:38
| 2021-03-22T19:26:38
| 348,372,499
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,112
|
java
|
package pl.khamul.charity.user;
import pl.khamul.charity.role.Role;
import javax.persistence.*;
import java.util.Set;
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String email;
private String userName;
private String password;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Role> role;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
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 Set<Role> getRole() {
return role;
}
public void setRole(Set<Role> role) {
this.role = role;
}
}
|
[
"lumahk6891@hmail.com"
] |
lumahk6891@hmail.com
|
fa177fc621ba521619b164f12c2bc83be54f5d12
|
58b0102ab0c765b0b7956ac1feb103aed3be618f
|
/K7_Projeto_DAO/src/modelo/entidades/Vendedor.java
|
c760a01bc18c5f1ef1b6194021e7edfed56797b3
|
[] |
no_license
|
nilsonj23/Java-topicos
|
cc2c6688823674b22b6dd832a48f25d82ddbd9c1
|
b922dc75ee18490a39c4065d6eccdef65cf4a6e9
|
refs/heads/master
| 2022-07-08T23:55:29.596799
| 2020-04-25T20:44:07
| 2020-04-25T20:44:07
| 238,217,929
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,178
|
java
|
package modelo.entidades;
import java.io.Serializable;
import java.util.Date;
public class Vendedor implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String nome;
private String email;
private Date dataNasc;
private Double salarioBase;
private Departamento departamento;
// CONSTRUTOR
public Vendedor() {
}
public Vendedor(Integer id, String nome, String email, Date dataNasc, Double salarioBase, Departamento departamento) {
this.id = id;
this.nome = nome;
this.email = email;
this.dataNasc = dataNasc;
this.salarioBase = salarioBase;
this.departamento = departamento;
}
// GET e SET
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getDataNasc() {
return dataNasc;
}
public void setDataNasc(Date dataNasc) {
this.dataNasc = dataNasc;
}
public Double getSalarioBase() {
return salarioBase;
}
public void setSalarioBase(Double salarioBase) {
this.salarioBase = salarioBase;
}
public Departamento getDepartamento() {
return departamento;
}
public void setDepartamento(Departamento departamento) {
this.departamento = departamento;
}
// HASHCODE e EQUALS
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Vendedor other = (Vendedor) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
// TO STRING
@Override
public String toString() {
return "Vendedor [id=" + id + ", nome=" + nome + ", email=" + email + ", dataNasc=" + dataNasc
+ ", salarioBase=" + salarioBase + ", departamento=" + departamento + "]";
}
}
|
[
"nilsonj23@gmail.com"
] |
nilsonj23@gmail.com
|
de04a45aa0ea06f03455d965cf9277684acb7114
|
22012491da3f71140d3b8548eb59905baf95a7e0
|
/com/planet_ink/coffee_mud/Locales/UnderWaterThinGrid.java
|
a772b474bdbc3f33176ba628a3493fd01869f06e
|
[
"Apache-2.0"
] |
permissive
|
griffenliu/CoffeeMud
|
01018dac96d0381ad27cb49e4e5e89557e2c6247
|
6fb04b990dc6528b01ca8e707a90e752a8310267
|
refs/heads/master
| 2020-03-23T02:38:38.136327
| 2018-07-15T02:18:23
| 2018-07-15T02:18:23
| 140,245,931
| 0
| 0
|
Apache-2.0
| 2018-07-09T07:15:15
| 2018-07-09T07:15:15
| null |
UTF-8
|
Java
| false
| false
| 5,671
|
java
|
package com.planet_ink.coffee_mud.Locales;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2004-2018 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class UnderWaterThinGrid extends StdThinGrid
{
@Override
public String ID()
{
return "UnderWaterThinGrid";
}
public UnderWaterThinGrid()
{
super();
basePhyStats().setDisposition(basePhyStats().disposition()|PhyStats.IS_SWIMMING);
basePhyStats.setWeight(3);
recoverPhyStats();
setDisplayText("Under the water");
setDescription("");
xsize=CMProps.getIntVar(CMProps.Int.SKYSIZE);
ysize=CMProps.getIntVar(CMProps.Int.SKYSIZE);
if(xsize<0)
xsize=xsize*-1;
if(ysize<0)
ysize=ysize*-1;
if((xsize==0)||(ysize==0))
{
xsize=3;
ysize=3;
}
climask=Places.CLIMASK_WET;
atmosphere=RawMaterial.RESOURCE_FRESHWATER;
}
@Override
public int domainType()
{
return Room.DOMAIN_OUTDOORS_UNDERWATER;
}
@Override
protected int baseThirst()
{
return 0;
}
@Override
public CMObject newInstance()
{
if(!CMSecurity.isDisabled(CMSecurity.DisFlag.THINGRIDS))
return super.newInstance();
return new UnderWaterGrid().newInstance();
}
@Override
public String getGridChildLocaleID()
{
return "UnderWater";
}
@Override
public void affectPhyStats(final Physical affected, final PhyStats affectableStats)
{
super.affectPhyStats(affected,affectableStats);
affectableStats.setDisposition(affectableStats.disposition()|PhyStats.IS_SWIMMING);
}
@Override
public List<Integer> resourceChoices()
{
return UnderWater.roomResources;
}
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
switch(UnderWater.isOkUnderWaterAffect(this,msg))
{
case -1: return false;
case 1: return true;
}
return super.okMessage(myHost,msg);
}
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
UnderWater.sinkAffects(this,msg);
}
@Override
protected void fillExitsOfGridRoom(Room R, int x, int y)
{
super.fillExitsOfGridRoom(R,x,y);
if((x<0)||(y<0)||(y>=yGridSize())||(x>=xGridSize()))
return;
// the adjacent rooms created by this method should also take
// into account the possibility that they are on the edge.
// it does NOT
if(ox==null)
ox=CMClass.getExit("Open");
Room R2=null;
if(R.rawDoors()[Directions.UP]==null)
{
if((y==0)&&(rawDoors()[Directions.UP]!=null)&&(exits[Directions.UP]!=null))
linkRoom(R,rawDoors()[Directions.UP],Directions.UP,exits[Directions.UP],exits[Directions.UP]);
else
if(y>0)
{
R2=getMakeSingleGridRoom(x,y-1);
if(R2!=null)
linkRoom(R,R2,Directions.UP,ox,ox);
}
else
if(x>0)
{
R2=getMakeSingleGridRoom(x-1,yGridSize()-1);
if(R2!=null)
linkRoom(R,R2,Directions.UP,ox,ox);
}
else
{
R2=getMakeSingleGridRoom(xGridSize()-1,yGridSize()-1);
if(R2!=null)
linkRoom(R,R2,Directions.UP,ox,ox);
}
}
if(R.rawDoors()[Directions.DOWN]==null)
{
if((y==yGridSize()-1)&&(rawDoors()[Directions.DOWN]!=null)&&(exits[Directions.DOWN]!=null))
linkRoom(R,rawDoors()[Directions.DOWN],Directions.DOWN,exits[Directions.DOWN],exits[Directions.DOWN]);
else
if(y<yGridSize()-1)
{
R2=getMakeSingleGridRoom(x,y+1);
if(R2!=null)
linkRoom(R,R2,Directions.DOWN,ox,ox);
}
else
if(x<xGridSize()-1)
{
R2=getMakeSingleGridRoom(x+1,0);
if(R2!=null)
linkRoom(R,R2,Directions.DOWN,ox,ox);
}
}
if((y==0)&&(R.rawDoors()[Directions.NORTH]==null))
{
R2=getMakeSingleGridRoom(x,yGridSize()-1);
if(R2!=null)
linkRoom(R,R2,Directions.NORTH,ox,ox);
}
else
if((y==yGridSize()-1)&&(R.rawDoors()[Directions.SOUTH]==null))
{
R2=getMakeSingleGridRoom(x,0);
if(R2!=null)
linkRoom(R,R2,Directions.SOUTH,ox,ox);
}
if((x==0)&&(R.rawDoors()[Directions.WEST]==null))
{
R2=getMakeSingleGridRoom(xGridSize()-1,y);
if(R2!=null)
linkRoom(R,R2,Directions.WEST,ox,ox);
}
else
if((x==xGridSize()-1)&&(R.rawDoors()[Directions.EAST]==null))
{
R2=getMakeSingleGridRoom(0,y);
if(R2!=null)
linkRoom(R,R2,Directions.EAST,ox,ox);
}
}
}
|
[
"bo@zimmers.net"
] |
bo@zimmers.net
|
5db04163cb3213319b66f231e1bd777f6216d2cc
|
47af5c135738fa8f0d070f7d4442e60f5b5e61e9
|
/backend/src/main/java/com/amb/demo/DemoApplication.java
|
953d0218e259963a343ac8ae7ee2968b263073cb
|
[] |
no_license
|
ambraj/full-stack-app-demo
|
23c3741a82967cd470de2c6a2d46a81ad2cf6f18
|
3048ad5898cf7c08a090ce4ede55eef7bfa91e47
|
refs/heads/main
| 2023-06-18T23:27:43.498253
| 2021-06-29T21:42:12
| 2021-06-29T21:42:12
| 380,570,134
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 301
|
java
|
package com.amb.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
|
[
"ambraj@gmail.com"
] |
ambraj@gmail.com
|
a653dbdb75746f53442759b7490b13f7ea6e7ad6
|
6fca7c5d75bc33b37bb63e51a5ac27c15dca6a33
|
/src/test/java/project/systemtests/AccountControllerTest.java
|
840e106bb7787b06c02cbba9470cba37363f7b69
|
[
"MIT"
] |
permissive
|
Robustic/Community
|
428a5afc1050e68afb208c3bce341171b813d70b
|
7bff16cb9333c2afbe41cca8d2fc99841de741a5
|
refs/heads/master
| 2020-09-26T03:22:35.300872
| 2020-08-30T19:34:09
| 2020-08-30T19:34:09
| 226,151,563
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,992
|
java
|
package project.systemtests;
import static org.fluentlenium.core.filter.FilterConstructor.containingText;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@ActiveProfiles("test")
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class AccountControllerTest extends org.fluentlenium.adapter.junit.FluentTest {
@LocalServerPort
private Integer port;
private static boolean setUpIsDone = false;
public void setUp() throws InterruptedException {
if (setUpIsDone) {
return;
}
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("rolle");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("Rolle Rol");
find("#alias").fill().with("relaa");
find("form").first().submit();
assertTrue(pageSource().contains("Käyttäjätunnus " + "rolle" + " luotu. Voit nyt kirjautua sisään."));
setUpIsDone = true;
}
@Before
public void before() throws InterruptedException {
setUp();
}
@Test
public void logInWithCorrectAccount() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
assertTrue(pageSource().contains("Login"));
find("a", containingText("Login - Kirjaudu sisään")).click();
find("#username").fill().with("rolle");
find("#password").fill().with("xxxxxxxxxx");
find("form").first().submit();
assertTrue(pageSource().contains("Rolle Rol - relaa"));
assertTrue(pageSource().contains("Etsi syöttämällä kokonaan tai osa haettavasta nimestä."));
goTo("http://localhost:" + port + "/createnewaccount");
assertTrue(pageSource().contains("Communityn käyttö vaatii rekisteröitymisen."));
assertTrue(pageSource().contains("Olet jo kirjautunut sisään."));
assertTrue(pageSource().contains("Rolle Rol"));
assertTrue(pageSource().contains("relaa"));
}
@Test
public void logInWithAccountNotExists() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
assertTrue(pageSource().contains("Login"));
find("a", containingText("Login - Kirjaudu sisään")).click();
find("#username").fill().with("accountnotexists");
find("#password").fill().with("xxxxxxxxxx");
find("form").first().submit();
assertTrue(pageSource().contains("Bad credentials"));
assertTrue(pageSource().contains("Please sign in"));
}
@Test
public void logInWithUncorrectPassword() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
assertTrue(pageSource().contains("Login"));
find("a", containingText("Login - Kirjaudu sisään")).click();
find("#username").fill().with("rolle");
find("#password").fill().with("xxxxxxxxyx");
find("form").first().submit();
assertTrue(pageSource().contains("Bad credentials"));
assertTrue(pageSource().contains("Please sign in"));
}
@Test
public void tryToCreateAccountWhereUsernameAlreadyExists() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("rolle");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("Roltsu");
find("#alias").fill().with("relaa");
find("form").first().submit();
assertTrue(pageSource().contains("Käyttäjätunnus " + "rolle" + " on jo käytössä."));
}
@Test
public void tryToCreateAccountWhereAliasAlreadyExists() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("rolle2");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("Rolle Rol");
find("#alias").fill().with("relaa");
find("form").first().submit();
assertTrue(pageSource().contains("Aliasnimi " + "relaa" + " on jo käytössä."));
}
@Test
public void tryToCreateAccountWhereUsernameIsTooShort() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("aaa");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("b");
find("#alias").fill().with("c");
find("form").first().submit();
assertTrue(pageSource().contains("Käyttäjätunnuksen täytyy olla vähintään 4 merkkiä pitkä."));
}
@Test
public void tryToCreateAccountWherePasswordIsTooShort() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("aaaa");
find("#password").fill().with("xxxxxxxxx");
find("#name").fill().with("b");
find("#alias").fill().with("c");
find("form").first().submit();
assertTrue(pageSource().contains("Salasanan täytyy olla vähintään 10 merkkiä pitkä."));
}
@Test
public void tryToCreateAccountWhereNameIsEmpty() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("aaaa");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("");
find("#alias").fill().with("c");
find("form").first().submit();
assertTrue(pageSource().contains("Nimi ei saa olla tyhjä."));
}
@Test
public void tryToCreateAccountWhereAliasIsEmpty() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("aaaa");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("b");
find("#alias").fill().with("");
find("form").first().submit();
assertTrue(pageSource().contains("Alias ei saa olla tyhjä."));
}
@Test
public void tryToCreateAccountWhereMinimumRequirementsForLenghts() throws InterruptedException {
goTo("http://localhost:" + port + "/createnewaccount");
find("#username").fill().with("aaaa");
find("#password").fill().with("xxxxxxxxxx");
find("#name").fill().with("b");
find("#alias").fill().with("c");
find("form").first().submit();
assertTrue(pageSource().contains("Käyttäjätunnus " + "aaaa" + " luotu. Voit nyt kirjautua sisään."));
}
}
|
[
"juha.malinen@helsinki.fi"
] |
juha.malinen@helsinki.fi
|
a7847a14bd401f7f4b7d6005695c9da6eca44c30
|
a363c46e7cbb080db2b3a69a70ebf912195e25c7
|
/ls-modules/ls-business/src/main/java/cn/lonsun/system/systemlog/internal/service/ICmsLogService.java
|
eaf315322aaa3ea9612074fe2c0ac49cc7338113
|
[] |
no_license
|
pologood/excms
|
601646dd7ea4f58f8423da007413978192090f8d
|
e1c03f574d0ecbf0200aaffa7facf93841bab02c
|
refs/heads/master
| 2020-05-14T20:07:22.979151
| 2018-10-06T10:51:37
| 2018-10-06T10:51:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,470
|
java
|
package cn.lonsun.system.systemlog.internal.service;
import java.util.Date;
import java.util.List;
import cn.lonsun.core.base.service.IMockService;
import cn.lonsun.core.util.Pagination;
import cn.lonsun.system.systemlog.internal.entity.CmsLogEO;
/**
*
* @ClassName: ICmsLogService
* @Description: 操作日志业务逻辑层
* @author Hewbing
* @date 2015年8月25日 上午10:54:22
*
*/
public interface ICmsLogService extends IMockService<CmsLogEO> {
/**
* 日志添加
*
* @param description 内容
* @param caseType 业务对象类型,例如:UserEO
* @param operation 操作,例如:LogEO.Operation.Add.toString(),//新增操作
*/
public void recLog(String description, String caseType, String operation);
/**
* 日志删除
*
* @param logId 日志ID
*/
public void deleteLog(Long logId);
/**
* 日志查询
*
* @param request
* @param pageIndex
* @param pageSize
* @param startDate
* @param endDate
* @param type
* @param key
* @return
*/
public Pagination getPage(Long pageIndex, Integer pageSize, Date startDate, Date endDate, String type, String key,Long siteId);
/**
* 获取所有日志
* @param startDate
* @param endDate
* @param type
* @param key
* @return
*/
public List<CmsLogEO> getAllLogs(Date startDate, Date endDate, String type, String key,Long siteId);
}
|
[
"2885129077@qq.com"
] |
2885129077@qq.com
|
4eb811f1b64e3c17e5693168d111b5786c29e512
|
7bc045016e3c07531bc6ddefc8c3b797e6743b2f
|
/src/com/mySelfie/mail/SendMail.java
|
89c795cb1ac91fecc26a2857d4c02a64355cee91
|
[] |
no_license
|
MichelangeloDiamanti/mySelfie
|
bcf196396f435c9b6f3a82e724e2abeffce1a892
|
ebe2198bd5bd515ef8f86857c64a072f2c049017
|
refs/heads/master
| 2020-05-14T19:36:46.213913
| 2015-07-20T15:23:30
| 2015-07-20T15:23:30
| 37,375,472
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,940
|
java
|
package com.mySelfie.mail;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class SendMail {
/**
* prende in input la mail dello user a cui mandare il messaggio di conferma
* e, dopo aver creato un token random e averlo incorporato in un link manda
* il messaggio.
*
* @param recipientUsername username del nuovo utente
* @param recipientEmailAddress mail del destinatario
* @return il token generato se tutto è andato bene altrimenti null
*/
public static String sendSignupConfirmation(String recipientUsername, String recipientEmailAddress) {
InitialContext initialContext; // necessario a leggere le credenziali dal context
String token = null; // token random verifica mail
try {
/*
* prende le credenziali di accesso della email dal file context.xml
*/
initialContext = new InitialContext();
Context environmentContext = (Context) initialContext.lookup("java:/comp/env");
final String email = (String) environmentContext.lookup("myselfieConfirmationEmail");
final String password = (String) environmentContext.lookup("myselfieConfirmationPassword");
// impostazioni server mail google
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
// apre una sessione SMTP con autenticazione
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(email, password);
}
});
// manda il messaggio
try {
// genera un numero random
SecureRandom random = new SecureRandom();
/*
* genera una stringa randomica di lunghezza 160/5 = 32
* 160 --> è il numero in input di BigInteger rappresenta il numero di bits
* casuali da cui pescare
* 5 --> è 2^5 il numero di bit passati in input al metodo toString
*/
token = new BigInteger(160, random).toString(32);
// dichiara un nuovo messaggio mime
Message message = new MimeMessage(session);
// imposta il sender
message.setFrom(new InternetAddress("myselfieconfirmation@gmail.com"));
// imposta il destinatario
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(recipientEmailAddress));
// imposta l'oggetto della mail
message.setSubject("Myselfie - Confirm Account");
// imposta il testo della mail
message.setText(
"Dear "
+ recipientUsername
+ "\n\nPlease follow this link to confirm your account: "
+ "https://localhost:8443/mySelfie/validation/"
+ token
);
// manda il messaggio
Transport.send(message);
} catch (MessagingException e) {
throw new RuntimeException(e);
}
} catch (NamingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// ritorna il token generato
return token;
}
/**
* prende in input la mail dello user a cui mandare il messaggio
* e, dopo aver creato un token random e averlo incorporato in un link manda
* il messaggio.
*
* @param recipientUsername username del destinatario
* @param recipientEmailAddress mail del destinatario
* @return il token generato se tutto è andato bene altrimenti null
* @throws MessagingException
*/
public static String sendCredentialsResetCode(String recipientUsername, String recipientEmailAddress) throws MessagingException {
InitialContext initialContext; // necessario a leggere le credenziali dal context
String token = null; // token random verifica mail
try {
/*
* prende le credenziali di accesso della email dal file context.xml
*/
initialContext = new InitialContext();
Context environmentContext = (Context) initialContext.lookup("java:/comp/env");
final String email = (String) environmentContext.lookup("myselfieConfirmationEmail");
final String password = (String) environmentContext.lookup("myselfieConfirmationPassword");
// impostazioni server mail google
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
// apre una sessione SMTP con autenticazione
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(email, password);
}
});
// genera un numero random
SecureRandom random = new SecureRandom();
/*
* genera una stringa randomica di lunghezza 160/5 = 32
* 160 --> è il numero in input di BigInteger rappresenta il numero di bits
* casuali da cui pescare
* 5 --> è 2^5 il numero di bit passati in input al metodo toString
*/
token = new BigInteger(160, random).toString(32);
// dichiara un nuovo messaggio mime
Message message = new MimeMessage(session);
// imposta il sender
message.setFrom(new InternetAddress("myselfieconfirmation@gmail.com"));
// imposta il destinatario
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(recipientEmailAddress));
// imposta l'oggetto della mail
message.setSubject("Myselfie - Reset Credentials");
// imposta il testo della mail
message.setText(
"Dear "
+ recipientUsername
+ "\n\nPlease follow this link to reset your credentials: "
+ "https://localhost:8443/mySelfie/resetCredentials/"
+ token
);
// manda il messaggio
Transport.send(message);
} catch (NamingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// ritorna il token generato
return token;
}
}
|
[
"michelangelo.diamanti@gmail.com"
] |
michelangelo.diamanti@gmail.com
|
06a9c5f94633001b0afdac614bd0490500f6b189
|
875045d7f5e6b14e344b13582080202674f96700
|
/src/com/tiger/quicknews/adapter/NewsFragmentPagerAdapter.java
|
f54fc6a516b12bec53000cc18c5297fd2b3810ea
|
[] |
no_license
|
LiMengliang/QuickNews-tiger
|
0d3ccf7a5a7442339c61194be97c95b1b8ef9f87
|
4eafe3a07849a59e888f7066afb468941c822cf1
|
refs/heads/master
| 2021-01-23T12:10:51.857694
| 2015-11-18T12:42:26
| 2015-11-18T12:42:26
| 40,760,794
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,336
|
java
|
package com.tiger.quicknews.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.view.ViewGroup;
import java.util.ArrayList;
public class NewsFragmentPagerAdapter extends FragmentStatePagerAdapter {
private ArrayList<Fragment> fragments = new ArrayList<Fragment>();;
private final FragmentManager fm;
public NewsFragmentPagerAdapter(FragmentManager fm) {
super(fm);
this.fm = fm;
}
public NewsFragmentPagerAdapter(FragmentManager fm,
ArrayList<Fragment> fragments) {
super(fm);
this.fm = fm;
this.fragments = fragments;
}
public void appendList(ArrayList<Fragment> fragment) {
fragments.clear();
if (!fragments.containsAll(fragment) && fragment.size() > 0) {
fragments.addAll(fragment);
}
notifyDataSetChanged();
}
@Override
public int getCount() {
return fragments.size();
}
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
public void setFragments(ArrayList<Fragment> fragments) {
if (this.fragments != null) {
FragmentTransaction ft = fm.beginTransaction();
for (Fragment f : this.fragments) {
ft.remove(f);
}
ft.commit();
ft = null;
fm.executePendingTransactions();
}
this.fragments = fragments;
notifyDataSetChanged();
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
// 这里Destroy的是Fragment的视图层次,并不是Destroy Fragment对象
super.destroyItem(container, position, object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
if (fragments.size() <= position) {
position = position % fragments.size();
}
Fragment obj = (Fragment)super.instantiateItem(container, position);
return obj;
}
}
|
[
"limengliang4007@126.com"
] |
limengliang4007@126.com
|
cee7ea11348732e8f02659d5f758dd394f6efcd4
|
53e6a33d60b23c263ece2e0aa600e6dbf2ecceb4
|
/src/test/java/com/telrock/model/DepartmentTest.java
|
d00d3db68117780a1ca0e0c80c037a19ed20796a
|
[] |
no_license
|
praveenanjha/telrock
|
20f30b47f15243db98ebdf5efe653568fa1f4d59
|
9ef75a4e9e1ee36dce15e4147555badbe66b66ee
|
refs/heads/master
| 2020-03-14T06:29:38.662140
| 2018-04-29T10:33:21
| 2018-04-29T10:33:21
| 131,485,329
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,186
|
java
|
package com.telrock.model;
import static org.junit.Assert.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.junit.Test;
public class DepartmentTest {
@Test
public final void testHashCode() {
final String name = "DeptName";
final String area = "DeptArea";
Department d1 = new Department(name, area);
d1.setId(1L);
Department d2 = new Department(name, area);
d2.setId(1L);
Department d3 = new Department(name, area);
d3.setId(2L);
assertEquals(d1.hashCode(),d2.hashCode());
assertTrue(d1.hashCode()!=d3.hashCode());
}
@Test
public final void testToString() {
final String name = "DeptName";
final String area = "DeptArea";
final long id = 2L;
String expected = new ToStringBuilder(new Department(), ToStringStyle.SHORT_PREFIX_STYLE)
.append("id", id).append("name", name).append("area", area).toString();
Department department = new Department(name, area);
department.setId(id);
assertEquals(expected,department.toString());
}
@Test
public final void testEqualsObject() {
final String name = "DeptName";
final String area = "DeptArea";
Department d1 = new Department(name, area);
d1.setId(1L);
Department d2 = new Department(name, area);
d2.setId(1L);
Department d3 = new Department(name, area);
d3.setId(2L);
assertEquals("Equal objects not returning equal", d1,d2);
assertFalse("Non equal objects return equal",d1.equals(d3));
}
@Test
public final void testCompareTo() {
Department d1 = new Department();
d1.setId(1L);
Department d2 = new Department();
d2.setId(1L);
Department d3 = new Department();
d3.setId(3L);
assertTrue("equal test failed",d1.compareTo(d2)==0);
assertTrue("before test failed",d1.compareTo(d3)<0);
assertTrue("after test failed",d3.compareTo(d1)>0);
}
@Test
public final void testCompareTo_noIDs() {
Department d1 = new Department("a", "a");
Department d2 = new Department("a", "b");
Department d3 = new Department("b", "a");
assertTrue("department to department failed",d1.compareTo(d2)<0);
assertTrue("area to area failed",d2.compareTo(d3)<0);
}
}
|
[
"nisha@nisha-pc"
] |
nisha@nisha-pc
|
5e37ec4cf82f53604464daa87df761ab557a4574
|
64995981fe2fbd07cce5ca7a3ba7b2d8183114eb
|
/zhao_sheng/build/generated/source/apt/debug/com/yfy/app/delay_service/DelayAdminToTeaEventActivity$$ViewBinder.java
|
f95b133d9de6c127f88972767b9eacaff1d9e9a0
|
[] |
no_license
|
Zhaoxianxv/zhao_sheng_old_one
|
f34b71d48f7c671c2005c254e4cf2eb8818b27a7
|
94ca6b035546778b264ce89399e3e8aedde5bb45
|
refs/heads/master
| 2022-12-06T15:47:46.156918
| 2020-09-03T10:14:14
| 2020-09-03T10:14:14
| 292,534,564
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,956
|
java
|
// Generated code from Butter Knife. Do not modify!
package com.yfy.app.delay_service;
import android.view.View;
import butterknife.ButterKnife.Finder;
public class DelayAdminToTeaEventActivity$$ViewBinder<T extends com.yfy.app.delay_service.DelayAdminToTeaEventActivity> extends com.yfy.base.activity.BaseActivity$$ViewBinder<T> {
@Override public void bind(final Finder finder, final T target, Object source) {
super.bind(finder, target, source);
View view;
view = finder.findRequiredView(source, 2131296578, "field 'multi'");
target.multi = finder.castView(view, 2131296578, "field 'multi'");
view = finder.findRequiredView(source, 2131296577, "field 'date_show'");
target.date_show = finder.castView(view, 2131296577, "field 'date_show'");
view = finder.findRequiredView(source, 2131296583, "field 'event_site'");
target.event_site = finder.castView(view, 2131296583, "field 'event_site'");
view = finder.findRequiredView(source, 2131296584, "field 'tea_name' and method 'setChoiceTea'");
target.tea_name = finder.castView(view, 2131296584, "field 'tea_name'");
view.setOnClickListener(
new butterknife.internal.DebouncingOnClickListener() {
@Override public void doClick(
android.view.View p0
) {
target.setChoiceTea();
}
});
view = finder.findRequiredView(source, 2131296582, "field 'repleace_layout'");
target.repleace_layout = finder.castView(view, 2131296582, "field 'repleace_layout'");
view = finder.findRequiredView(source, 2131296581, "field 'replace_tea' and method 'setChoiceReplaceTea'");
target.replace_tea = finder.castView(view, 2131296581, "field 'replace_tea'");
view.setOnClickListener(
new butterknife.internal.DebouncingOnClickListener() {
@Override public void doClick(
android.view.View p0
) {
target.setChoiceReplaceTea();
}
});
view = finder.findRequiredView(source, 2131296576, "field 'class_name'");
target.class_name = finder.castView(view, 2131296576, "field 'class_name'");
view = finder.findRequiredView(source, 2131296580, "field 'content_edit'");
target.content_edit = finder.castView(view, 2131296580, "field 'content_edit'");
view = finder.findRequiredView(source, 2131296579, "field 'num_edit'");
target.num_edit = finder.castView(view, 2131296579, "field 'num_edit'");
view = finder.findRequiredView(source, 2131296585, "field 'type_layout'");
target.type_layout = finder.castView(view, 2131296585, "field 'type_layout'");
}
@Override public void unbind(T target) {
super.unbind(target);
target.multi = null;
target.date_show = null;
target.event_site = null;
target.tea_name = null;
target.repleace_layout = null;
target.replace_tea = null;
target.class_name = null;
target.content_edit = null;
target.num_edit = null;
target.type_layout = null;
}
}
|
[
"1006584058@qq.com"
] |
1006584058@qq.com
|
0674aad5ae3bd58b919820734fa923561d28ba81
|
abe607871d599b6873073b0604bdd266b2e83e38
|
/src (1)/GE_HH/examTimetablingProblem/EvoHyp/TTSelConDistrRun.java
|
3c75a3896e0af2332704741523c92154e4edadb1
|
[] |
no_license
|
kayunga/exam
|
b78a4ad84e802e01096464f50fcad9cbe8caf415
|
8976654d0e99c71ce308406809f332907b853c58
|
refs/heads/main
| 2023-02-07T14:41:21.840104
| 2020-12-29T21:54:03
| 2020-12-29T21:54:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,251
|
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 GE_HH.examTimetablingProblem.EvoHyp;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
* Oct 11, 2016
* @author Derrick Beckedahl
*
* Edited by George Mweshi Nov 28, 2018
*
* This program runs a Selection-Constructive Hyper-Heuristic for the Examination timetabling Problem.
*/
public class TTSelConDistrRun {
/**
* @param args the command line arguments
*
* args[0] -> file containing list of input files
* args[1] -> file containing parameters
* args[2] -> number of runs to perform for each file
* args[3] -> number of cores/threads to use for the runs
* args[4] -> number of cores/threads to use for EvoHyp
* args[5] -> parameter to determine whether or not to print after each generation (primarily for parameter tuning)
* 0 -> don't output after each generation
* 1 -> output after each generation
* args[6] -> parameter to determine whether or not to use hill-climbing
* 0 -> don't use hill-climbing
* 1 -> use hill-climbing (if using hill-climbing number of attempts can be specified with args[7])
* args[7] -> (optional) number of iterations when using hill-climbing (defaults to 1 if specified value < 1)
*
* @throws FileNotFoundException
* @throws IOException
*/
public static void main(String[] args) throws FileNotFoundException, IOException {
// Output usage of the program if no command-line arguments are passed
if (!((args.length == 7) || (args.length == 8))) {
System.out.println();
System.out.println("This program runs a Selection-Constructive Hyper-Heuristic for the Exam Timetabling problem (ETP).");
System.out.println("The command line arguments are as follows:\n");
System.out.println("\targs[0] -> file containing list of input files");
System.out.println("\targs[1] -> file containing parameters");
System.out.println("\targs[2] -> number of runs to perform for each file");
System.out.println("\targs[3] -> number of cores/threads to use for the runs");
System.out.println("\targs[4] -> number of cores/threads to use for EvoHyp");
System.out.println("\targs[5] -> parameter to determine whether or not to print after each generation (primarily for parameter tuning)");
System.out.println("\t\t\t\u00BB 0 -> don't output after each generation");
System.out.println("\t\t\t\u00BB 1 -> output after each generation");
System.out.println("\targs[6] -> parameter to determine whether or not to use hill-climbing");
System.out.println("\t\t\t\u00BB 0 -> don't use hill-climbing");
System.out.println("\t\t\t\u00BB 1 -> use hill-climbing (if using hill-climbing number of attempts can be specified with args[7])");
System.out.println("\targs[7] -> (optional) number of iterations when using hill-climbing (defaults to 1 if specified value < 1)");
System.out.println();
System.exit(0);
}
boolean print = false;
switch (Integer.parseInt(args[5])) {
case 0:
print = false;
break;
case 1:
print = true;
break;
default:
System.out.println("Error with specified generation output parameter value. Run this program without arguments for more information.");
System.out.println("Generation output parameter value given:\t" + Integer.parseInt(args[5]));
System.exit(1);
break;
}
boolean useHC = false;
switch (Integer.parseInt(args[6])) {
case 0:
useHC = false;
break;
case 1:
useHC = true;
break;
default:
System.out.println("Error with specified hill-climbing use parameter value. Run this program without arguments for more information.");
System.out.println("Hill-Climbing use parameter value given:\t" + Integer.parseInt(args[6]));
System.exit(1);
break;
}
int runs = Integer.parseInt(args[2]);
int cores = Integer.parseInt(args[3]);
int evoCores = Integer.parseInt(args[4]);
int hillClimbLim = 1;
if (args.length == 8) {
hillClimbLim = Integer.parseInt(args[7]);
}
if (hillClimbLim < 1) {
hillClimbLim = 1;
}
FileReader fr = new FileReader(args[0]);
String str = "";
while (fr.ready()) {
str += (char) (fr.read());
}
fr.close();
String[] strArr = (str.trim()).split("\n");
for (int i = 0; i < strArr.length; i++) {
strArr[i] = strArr[i].trim();
}
Object Results[][] = new Object[strArr.length][runs];
//Run all the threads simultaneously on the cores and store the output from
//each run in the Results array.
try {
/*
* Distribute the algorithm over multiple cores (Each run is performed on a separate core)
*/
ExecutorService es = Executors.newFixedThreadPool(cores);
for (int files = 0; files < strArr.length; files++) {
for (int r = 0; r < runs; r++) {
Results[files][r] = es.submit(new TTEvoHypSelConDistr(evoCores, strArr[files], args[1], print, useHC, hillClimbLim));
}
}
es.shutdown();
// Initialise Default Values
Output[] bestRun = new Output[strArr.length];
double[] avgObjVal = new double[strArr.length];
double[] objValStdDev = new double[strArr.length];
double[] avgFit = new double[strArr.length];
double[] fitStdDev = new double[strArr.length];
for (int i = 0; i < bestRun.length; i++) {
bestRun[i] = null;
avgObjVal[i] = 0.0;
objValStdDev[i] = 0.0;
avgFit[i] = 0.0;
fitStdDev[i] = 0.0;
}
/*
* Determine the best individual across all runs, according to objective value. In the case of ties in the objective
* value, the best is then determined according to the fitness value. In the case where both the objective value and
* the fitness value are tied, the more recent run is taken to be the best.
*/
for (int files = 0; files < strArr.length; files++) {
Output[] allRuns = new Output[runs];
for (int r = 0; r < runs; r++) {
Future<Output> f = (Future<Output>) Results[files][r];
Output tmp = f.get();
allRuns[r] = tmp;
double objVal = tmp.getObjVal();
double fitVal = tmp.getFitness();
avgObjVal[files] += objVal;
avgFit[files] += fitVal;
if (r == 0) {
bestRun[files] = tmp;
} else if (objVal < bestRun[files].getObjVal()) {
bestRun[files] = tmp;
} else if (objVal == bestRun[files].getObjVal()) {
if (fitVal <= (bestRun[files].getFitness())) {
bestRun[files] = tmp;
}
}
}
/*
* Calculate the average values and the standard deviation
*/
avgObjVal[files] /= runs;
avgFit[files] /= runs;
for (int r = 0; r < runs; r++) {
objValStdDev[files] += Math.pow((allRuns[r].getObjVal() - avgObjVal[files]), 2.0);
fitStdDev[files] += Math.pow((allRuns[r].getFitness() - avgFit[files]), 2.0);
}
objValStdDev[files] /= runs;
objValStdDev[files] = Math.sqrt(objValStdDev[files]);
fitStdDev[files] /= runs;
fitStdDev[files] = Math.sqrt(fitStdDev[files]);
}
/*
* Calculate the average values and the standard deviation
*/
System.out.println("\n###############################\n");
String pm = "+/-";
for (int files = 0; files < strArr.length; files++) {
if (files != 0) {
System.out.println("\t-----\n");
}
System.out.println("File:\t\t" + strArr[files].substring(strArr[files].lastIndexOf("/") + 1, strArr[files].lastIndexOf(".")));
System.out.println("Average Objective Value:\t\t" + avgObjVal[files] + "\t" + pm + "\t" + objValStdDev[files]);
System.out.println("Best Objective Value:\t\t\t" + bestRun[files].getObjVal());
System.out.println("Average Fitness:\t\t\t" + avgFit[files] + "\t" + pm + "\t" + fitStdDev[files]);
System.out.println("Best Fitness:\t\t\t" + bestRun[files].getFitness());
System.out.println("Best Heuristic Combination:\t\t" + bestRun[files].getProg());
System.out.println("Random Generator Seed (for best):\t" + bestRun[files].getSeed());
System.out.println();
}
} catch (Exception e) {
System.out.println("Problem");
System.out.println("Exception:\t" + e);
System.out.println("Cause:\t\t" + e.getCause());
System.out.println("Stack Trace:");
e.printStackTrace();
}
}
}
|
[
"wisdomnyongo20@outlook.com"
] |
wisdomnyongo20@outlook.com
|
3ae67b1850bef10d682e7d32d2a58990c60c59b6
|
1ea4406414e9113b0316c114a17556d5344d4949
|
/src/ro/nextreports/server/web/core/ErrorPanel.java
|
14a24bc15581193a0d6e2faa6d05c9efc0526755
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
nextreports/nextreports-server
|
34039167a0bd4f22d13b26d35b131ab886a300d9
|
0a6b5bde7cb6228a16e7109aaaac8595155c492e
|
refs/heads/master
| 2023-07-10T23:40:50.158795
| 2023-06-30T17:25:32
| 2023-06-30T17:25:32
| 12,408,453
| 30
| 21
|
Apache-2.0
| 2023-06-30T17:25:33
| 2013-08-27T14:37:09
|
Java
|
UTF-8
|
Java
| false
| false
| 1,668
|
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 ro.nextreports.server.web.core;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
public class ErrorPanel extends Panel {
private static final long serialVersionUID = 1L;
public ErrorPanel(String id, String message) {
super(id);
add(new Label("message", "Error: " + message));
add(new AjaxLink<Void>("cancel") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
back(target);
}
});
}
private void back(AjaxRequestTarget target) {
EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
panel.backwardWorkspace(target);
}
}
|
[
"decebal.suiu@gmail.com"
] |
decebal.suiu@gmail.com
|
fe0941089226dd4d5dd00ef5b7ecc4719a307f8b
|
5f08403e9080bd4e23b4d269fe6c62d90620c76d
|
/src/main/java/epplib/model/messages/DomainMessage.java
|
d7525222985425a36daf6689057aa3edf2174faa
|
[
"Apache-2.0"
] |
permissive
|
venglin/epplib
|
3b5a420c10614730a76a3acc4e99567c6b5f6cbd
|
f4a65846729c41bc2691e0365ce3fd31e67d576b
|
refs/heads/master
| 2023-08-13T23:34:04.135138
| 2021-09-19T06:50:59
| 2021-09-19T06:50:59
| 285,779,022
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,164
|
java
|
package epplib.model.messages;
import epplib.model.enums.DomainMessageType;
public class DomainMessage extends Message {
protected String name;
private DomainMessageType type;
public String getName() {
return name;
}
public DomainMessageType getType() {
return type;
}
public void setName(String name) {
this.name = name;
}
public void setType(DomainMessageType type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DomainMessage that = (DomainMessage) o;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (type != that.type) return false;
return true;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "DomainMessage [name=" + name + ", type=" + type + ", message=" + message + "]";
}
}
|
[
"venglin@mbp2017-venglin.local"
] |
venglin@mbp2017-venglin.local
|
152e0415401ef91724ab2b42dad39bbb4ebbeb47
|
abf98834ea6cbca4003aca5b6703b7eae6255f40
|
/tgshop_common_interface/src/main/java/com/bigdata/service/SpecificationService.java
|
8fea9d7f0f093f9374049501a30cff928af2837c
|
[] |
no_license
|
1996yang/tgshop_parent
|
d55d063f24a9be0c2a3bff18d12a883565f51251
|
d8c537897a985199613c133f09782496db988745
|
refs/heads/master
| 2020-04-26T23:05:57.097908
| 2019-03-05T07:00:55
| 2019-03-05T07:00:55
| 173,892,196
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 676
|
java
|
package com.bigdata.service;
import com.bigdata.mypojo.MySpecification;
import com.bigdata.mypojo.PageResult;
import com.bigdata.pojo.Brand;
import com.bigdata.pojo.Specification;
import java.util.List;
import java.util.Map;
public interface SpecificationService {
// 添加
void add(MySpecification mySpecification);
/**
* 根据ID获取实体
*/
MySpecification findOne(Long id);
/**
* 修改
*/
void update(MySpecification MySpecification);
// 删除
void delete(Long[] ids);
// 搜索分页
PageResult findPage(Specification specification, Integer page, Integer rows);
List<Map> selectOptionList();
}
|
[
"1738941222@qq.com"
] |
1738941222@qq.com
|
9cc995b849c64fe074cf0fbc8a5af2b44327e1c2
|
2e8560f2e5c482f056b41f6d7ef9c76ba92f75e4
|
/app/src/main/java/com/sample/foo/usingawarenessapi/FenceActivity.java
|
f8d86acb0e3240c0b717a3416f52a11c676e407f
|
[] |
no_license
|
alonshp/UsingAwarnessAPI
|
9543ec89602ca124ad2bb9037882d4de67cde162
|
9e3e45fe5aba5f8ce74de62ee9d7aafbbd86f651
|
refs/heads/master
| 2021-01-23T04:39:55.991188
| 2017-07-06T17:04:38
| 2017-07-06T17:04:38
| 92,937,629
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,837
|
java
|
package com.sample.foo.usingawarenessapi;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.google.android.gms.awareness.Awareness;
import com.google.android.gms.awareness.fence.AwarenessFence;
import com.google.android.gms.awareness.fence.DetectedActivityFence;
import com.google.android.gms.awareness.fence.FenceUpdateRequest;
import com.google.android.gms.awareness.fence.HeadphoneFence;
import com.google.android.gms.awareness.state.HeadphoneState;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.ResultCallbacks;
import com.google.android.gms.common.api.Status;
public class FenceActivity extends AppCompatActivity {
private static final String TAG = "FenceActivity";
private static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 10001;
private static final String MY_FENCE_RECEIVER_ACTION = "MY_FENCE_ACTION";
public static final String HEADPHONE_FENCE_KEY = "your key here";
public static final String HEADPHONE_AND_WALKING_FENCE_KEY = "your key here";
public static final String HEADPHONE_OR_WALKING_FENCE_KEY = "your key here";
private GoogleApiClient mGoogleApiClient;
private FenceBroadcastReceiver mFenceReceiver;
private Button mAddAction1Button, mRemoveAction1Button;
private Button mAddAction2Button, mRemoveAction2Button;
private Button mAddAction3Button, mRemoveAction3Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fence);
mGoogleApiClient = new GoogleApiClient.Builder(FenceActivity.this)
.addApi(Awareness.API)
.build();
mGoogleApiClient.connect();
mFenceReceiver = new FenceBroadcastReceiver();
mAddAction1Button = (Button) findViewById(R.id.add1Button);
mAddAction1Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addHeadphoneFence();
}
});
mRemoveAction1Button = (Button) findViewById(R.id.remove1Button);
mRemoveAction1Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
removeFence(HEADPHONE_FENCE_KEY);
}
});
mAddAction2Button = (Button) findViewById(R.id.add2Button);
mAddAction2Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addHeadphoneAndLocationFence();
}
});
mRemoveAction2Button = (Button) findViewById(R.id.remove2Button);
mRemoveAction2Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
removeFence(HEADPHONE_AND_WALKING_FENCE_KEY);
}
});
mAddAction3Button = (Button) findViewById(R.id.add3Button);
mAddAction3Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addHeadphoneOrLocationFence();
}
});
mRemoveAction3Button = (Button) findViewById(R.id.remove3Button);
mRemoveAction3Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
removeFence(HEADPHONE_OR_WALKING_FENCE_KEY);
}
});
addHeadphoneAndLocationFence();
}
@Override
protected void onStart() {
super.onStart();
// We want to receive Broadcasts when activity is paused
registerReceiver(mFenceReceiver, new IntentFilter(MY_FENCE_RECEIVER_ACTION));
}
@Override
protected void onStop() {
super.onStop();
// unregisterReceiver(mFenceReceiver);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
private void addHeadphoneFence() {
Intent intent = new Intent(MY_FENCE_RECEIVER_ACTION);
PendingIntent mFencePendingIntent = PendingIntent.getBroadcast(FenceActivity.this,
10001,
intent,
0);
AwarenessFence headphoneFence = HeadphoneFence.during(HeadphoneState.PLUGGED_IN);
Awareness.FenceApi.updateFences(
mGoogleApiClient,
new FenceUpdateRequest.Builder()
.addFence(HEADPHONE_FENCE_KEY, headphoneFence, mFencePendingIntent)
.build())
.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(@NonNull Status status) {
if (status.isSuccess()) {
Log.i(TAG, "Fence was successfully registered.");
} else {
Log.e(TAG, "Fence could not be registered: " + status);
}
}
});
}
private void addHeadphoneAndLocationFence() {
Intent intent = new Intent(MY_FENCE_RECEIVER_ACTION);
PendingIntent mFencePendingIntent = PendingIntent.getBroadcast(FenceActivity.this,
10001,
intent,
0);
AwarenessFence activityFence = DetectedActivityFence.during(DetectedActivityFence.IN_VEHICLE);
Awareness.FenceApi.updateFences(
mGoogleApiClient,
new FenceUpdateRequest.Builder()
.addFence(HEADPHONE_FENCE_KEY, activityFence, mFencePendingIntent)
.build())
.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(@NonNull Status status) {
if (status.isSuccess()) {
Log.i(TAG, "Fence was successfully registered.");
} else {
Log.e(TAG, "Fence could not be registered: " + status);
}
}
});
}
private void addHeadphoneOrLocationFence() {
Intent intent = new Intent(MY_FENCE_RECEIVER_ACTION);
PendingIntent mFencePendingIntent = PendingIntent.getBroadcast(FenceActivity.this,
10001,
intent,
0);
AwarenessFence headphoneFence = HeadphoneFence.during(HeadphoneState.PLUGGED_IN);
AwarenessFence activityFence = DetectedActivityFence.during(DetectedActivityFence.WALKING);
AwarenessFence orFence = AwarenessFence.or(headphoneFence, activityFence);
Awareness.FenceApi.updateFences(
mGoogleApiClient,
new FenceUpdateRequest.Builder()
.addFence(HEADPHONE_OR_WALKING_FENCE_KEY,
orFence, mFencePendingIntent)
.build())
.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(@NonNull Status status) {
if (status.isSuccess()) {
Log.i(TAG, "Headphones OR Walking Fence was successfully registered.");
} else {
Log.e(TAG, "Headphones OR Walking Fence could not be registered: " + status);
}
}
});
}
private void removeFence(final String fenceKey) {
Awareness.FenceApi.updateFences(
mGoogleApiClient,
new FenceUpdateRequest.Builder()
.removeFence(fenceKey)
.build()).setResultCallback(new ResultCallbacks<Status>() {
@Override
public void onSuccess(@NonNull Status status) {
String info = "Fence " + fenceKey + " successfully removed.";
Log.i(TAG, info);
Toast.makeText(FenceActivity.this, info, Toast.LENGTH_LONG).show();
}
@Override
public void onFailure(@NonNull Status status) {
String info = "Fence " + fenceKey + " could NOT be removed.";
Log.i(TAG, info);
Toast.makeText(FenceActivity.this, info, Toast.LENGTH_LONG).show();
}
});
}
}
|
[
"alonshp1@gmail.com"
] |
alonshp1@gmail.com
|
54d685f201d40b532562c29f02864121879f4dc9
|
cab0f1caea6d7b739b032a1e960b24830f90b79c
|
/BonusAction.java
|
9b903a545a80c36b1629ba74172b426452a30964
|
[] |
no_license
|
SarkisyanC/DeadRisingRPG
|
95267e182a9926a07271ed8618fb0ff984e1c501
|
4dea727e6bbcea3ee0711e8874b82120154b04c4
|
refs/heads/master
| 2023-06-08T05:50:19.054621
| 2021-06-28T19:50:37
| 2021-06-28T19:50:37
| 277,578,980
| 0
| 0
| null | 2020-12-03T22:30:36
| 2020-07-06T15:25:33
|
Java
|
UTF-8
|
Java
| false
| false
| 573
|
java
|
/**
* Abstract class BonusAction - write a description of the class here
*
* @author (your name here)
* @version (version number or date here)
*/
public abstract class BonusAction implements Ability
{
// instance variables - replace the example below with your own
private int x;
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public int sampleMethod(int y)
{
// put your code here
return x + y;
}
}
|
[
"csarkisy@uncc.edu"
] |
csarkisy@uncc.edu
|
0f885836cd370fc832888034a1c003fdb516ead1
|
f93e5d873c7652aacb238734290cfbe7058ab5c9
|
/app/src/main/java/com/example/tugasrumah3/ui/home/HomeFragment.java
|
8d22a9724d9663ce56555e7f064f9bf49b32fbc6
|
[] |
no_license
|
Irwandy19211013/tugas3-19211013-irwan
|
2c34bb92ad83f61e27a3d8cb1503abbbe9eaa007
|
729bc5a7a8697be1a963cf60e01560504501f277
|
refs/heads/main
| 2023-08-25T08:31:38.136629
| 2021-10-22T04:48:09
| 2021-10-22T04:48:09
| 419,968,851
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 758
|
java
|
package com.example.tugasrumah3.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.example.tugasrumah3.R;
import com.example.tugasrumah3.databinding.FragmentHomeBinding;
public class HomeFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_home,container,false);
}
}
|
[
"irwandytobing31@gmail.com"
] |
irwandytobing31@gmail.com
|
30a3999e71080f0d13fa5e63f36990096882ad77
|
4026b9c43a932a04739513b7ab195e852e44f760
|
/src/main/java/com/feedback/repository/package-info.java
|
3020f783e3d5a2914121155d7a2a6b674a3df431
|
[] |
no_license
|
Steampunk1453/RetroApp
|
9ccd47bc87bf7c883c6ae0be51d38bd62e67d21d
|
a4a93f8214c3077b31758a7450085cb3142bd548
|
refs/heads/master
| 2022-12-14T21:06:12.667694
| 2017-09-18T19:28:45
| 2017-09-18T19:28:45
| 103,780,869
| 0
| 1
| null | 2020-09-18T16:58:41
| 2017-09-16T20:11:02
|
Java
|
UTF-8
|
Java
| false
| false
| 74
|
java
|
/**
* Spring Data JPA repositories.
*/
package com.feedback.repository;
|
[
"dasies11@gmail.com"
] |
dasies11@gmail.com
|
427908b1fe427c5f7ab540392aed347e24373687
|
411aaa406404c9221be37c8d0352e62000f99ae9
|
/sbggraph/src/main/java/org/craft/demo/dataimport/dbclients/MagellanDBClient.java
|
eab9233991d76af44db1ec2d4b1dee791f105e3e
|
[] |
no_license
|
amit-kumar-sharma/craftdemo
|
79dc69e8fdd88182355490f65928e219f1f9ba00
|
5782732514838de21ca05df3f52223955cf38286
|
refs/heads/master
| 2020-04-10T14:51:30.319408
| 2019-02-08T22:05:17
| 2019-02-08T22:05:17
| 161,089,581
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 835
|
java
|
/**
*
*/
package org.craft.demo.dataimport.dbclients;
import java.nio.file.Path;
import java.util.List;
import org.craft.demo.common.DatabaseType;
import org.craft.demo.dataimport.model.MagellanDataModel;
import org.springframework.stereotype.Component;
/**
* @author asharma
*
* Reads data from Magellan DB.
*/
@Component
public class MagellanDBClient extends BaseDBClient<MagellanDataModel>{
private static final DatabaseType DATABASE_TYPE = DatabaseType.MAGELLAN;
@Override
public List<MagellanDataModel> readData(Path databasePath) {
return super.readCSVData(MagellanDataModel.class, databasePath, DATABASE_TYPE);
}
@Override
public void writeData(MagellanDataModel data) {
throw new UnsupportedOperationException("This method is not yet supported by this client.");
}
}
|
[
"asharma@ctw-sj-asharma.blackarrow-corp.com"
] |
asharma@ctw-sj-asharma.blackarrow-corp.com
|
b522dfa9b7021b9ac1869bf3914bab7bcddd8460
|
89690c872450c400a3e8c51f70387cdf0ca7fd79
|
/app/src/main/java/com/home/pengaduanmesskaryawan/adapter/TaskAdapterKamar.java
|
fca9b95cb08f46ea1fb385cca640487a68b54a8f
|
[] |
no_license
|
imucreative/Android-PengaduanMessKaryawan
|
724c7de6d4dd9189cff0eb4da000fbdc8547a56d
|
68c323f601afccbdf9a629ba87489902a2d3e16f
|
refs/heads/master
| 2022-02-24T07:33:57.961039
| 2019-10-06T14:46:49
| 2019-10-06T14:46:49
| 196,914,756
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,090
|
java
|
package com.home.pengaduanmesskaryawan.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.home.pengaduanmesskaryawan.R;
import com.home.pengaduanmesskaryawan.model.ModelTaskKamar;
import java.util.List;
public class TaskAdapterKamar extends RecyclerView.Adapter<TaskAdapterKamar.MyViewHolder> {
private List<ModelTaskKamar> list;
class MyViewHolder extends RecyclerView.ViewHolder {
TextView nomor, dataKamar;
MyViewHolder(View view) {
super(view);
nomor = view.findViewById(R.id.nomor);
dataKamar = view.findViewById(R.id.dataKamar);
}
}
public TaskAdapterKamar(List<ModelTaskKamar> moviesList) {
this.list = moviesList;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.recyclerviewkamar, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
ModelTaskKamar modalTaskMasjid = list.get(position);
String nomor = modalTaskMasjid.getNomor();
String username = modalTaskMasjid.getUsername();
String blokKamar = modalTaskMasjid.getBlokKamar();
String noKamar = modalTaskMasjid.getNoKamar();
String kdUser = modalTaskMasjid.getKdUser();
String kdKamar = modalTaskMasjid.getKdKamar();
String nama = modalTaskMasjid.getNama();
holder.nomor.setText(nomor);
String dataKamar = "Blok " + blokKamar +" | " + "No. " + noKamar + " | " + nama;
holder.dataKamar.setText(dataKamar);
//holder.noKamar.setText(modalTaskMasjid.getNoKamar());
//holder.nama.setText(modalTaskMasjid.getNama());
}
@Override
public int getItemCount() {
return list.size();
}
}
|
[
"dyanzzz@gmail.com"
] |
dyanzzz@gmail.com
|
34cf215bc636a4d3b142b8923da6f64a272a2fa5
|
2bc2eadc9b0f70d6d1286ef474902466988a880f
|
/branches/mule-2.1.x/core/src/main/java/org/mule/registry/TransientRegistry.java
|
76e6cedfdb06be5071a6a61b25f8f9831d9d40ee
|
[] |
no_license
|
OrgSmells/codehaus-mule-git
|
085434a4b7781a5def2b9b4e37396081eaeba394
|
f8584627c7acb13efdf3276396015439ea6a0721
|
refs/heads/master
| 2022-12-24T07:33:30.190368
| 2020-02-27T19:10:29
| 2020-02-27T19:10:29
| 243,593,543
| 0
| 0
| null | 2022-12-15T23:30:00
| 2020-02-27T18:56:48
| null |
UTF-8
|
Java
| false
| false
| 9,032
|
java
|
/*
* $Id$
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.registry;
import org.mule.MuleServer;
import org.mule.api.MuleContext;
import org.mule.api.MuleException;
import org.mule.api.agent.Agent;
import org.mule.api.endpoint.ImmutableEndpoint;
import org.mule.api.lifecycle.Disposable;
import org.mule.api.lifecycle.Initialisable;
import org.mule.api.lifecycle.InitialisationException;
import org.mule.api.lifecycle.Stoppable;
import org.mule.api.model.Model;
import org.mule.api.registry.ObjectProcessor;
import org.mule.api.registry.RegistrationException;
import org.mule.api.service.Service;
import org.mule.api.transformer.Transformer;
import org.mule.api.transport.Connector;
import org.mule.util.ClassUtils;
import org.mule.util.CollectionUtils;
import org.mule.util.StringUtils;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.collections.functors.InstanceofPredicate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @ThreadSafe Use synchronized(registry) when reading/writing/iterating over the contents of the registry hashmap.
*/
public class TransientRegistry extends AbstractRegistry
{
/** logger used by this class */
protected transient final Log logger = LogFactory.getLog(TransientRegistry.class);
public static final String REGISTRY_ID = "org.mule.Registry.Transient";
//@ThreadSafe synchronized(registry)
private Map registry = new HashMap();
public TransientRegistry()
{
super(REGISTRY_ID);
synchronized(registry)
{
registry.put("_mulePropertyExtractorProcessor", new ExpressionEvaluatorProcessor());
}
}
//@java.lang.Override
protected void doInitialise() throws InitialisationException
{
applyProcessors(lookupObjects(Connector.class));
applyProcessors(lookupObjects(Transformer.class));
applyProcessors(lookupObjects(ImmutableEndpoint.class));
applyProcessors(lookupObjects(Agent.class));
applyProcessors(lookupObjects(Model.class));
applyProcessors(lookupObjects(Service.class));
applyProcessors(lookupObjects(Object.class));
synchronized(registry)
{
Collection allObjects = lookupObjects(Object.class);
Object obj;
for (Iterator iterator = allObjects.iterator(); iterator.hasNext();)
{
obj = iterator.next();
if (obj instanceof Initialisable)
{
((Initialisable) obj).initialise();
}
}
}
}
//@Override
protected void doDispose()
{
synchronized(registry)
{
Collection allObjects = lookupObjects(Object.class);
Object obj;
for (Iterator iterator = allObjects.iterator(); iterator.hasNext();)
{
obj = iterator.next();
if (obj instanceof Disposable)
{
((Disposable) obj).dispose();
}
}
}
}
protected void applyProcessors(Map objects)
{
if (objects == null)
{
return;
}
for (Iterator iterator = objects.values().iterator(); iterator.hasNext();)
{
Object o = iterator.next();
// Is synchronization necessary here? I don't think so
Collection processors = lookupObjects(ObjectProcessor.class);
for (Iterator iterator2 = processors.iterator(); iterator2.hasNext();)
{
ObjectProcessor op = (ObjectProcessor) iterator2.next();
op.process(o);
}
}
}
public void registerObjects(Map objects) throws RegistrationException
{
if (objects == null)
{
return;
}
for (Iterator iterator = objects.entrySet().iterator(); iterator.hasNext();)
{
Map.Entry entry = (Map.Entry) iterator.next();
registerObject(entry.getKey().toString(), entry.getValue());
}
}
public Object lookupObject(String key)
{
synchronized(registry)
{
return registry.get(key);
}
}
public Collection lookupObjects(Class returntype)
{
synchronized(registry)
{
return CollectionUtils.select(registry.values(), new InstanceofPredicate(returntype));
}
}
protected Object applyProcessors(Object object)
{
Object theObject = object;
// this may be an incorrect hack. the problem is that if we try to lookup objects in spring before
// it is initialised, we end up triggering object creation. that causes circular dependencies because
// this may have originally been called while creating objects in spring... so we prevent that by
// only doing the full lookup once everything is stable. ac.
Collection processors = lookupObjects(ObjectProcessor.class);
// Is synchronization necessary here? I don't think so
for (Iterator iterator = processors.iterator(); iterator.hasNext();)
{
ObjectProcessor o = (ObjectProcessor) iterator.next();
theObject = o.process(theObject);
}
return theObject;
}
/**
* Allows for arbitary registration of transient objects
*
* @param key
* @param value
*/
public void registerObject(String key, Object value) throws RegistrationException
{
registerObject(key, value, Object.class);
}
/**
* Allows for arbitary registration of transient objects
*
* @param key
* @param value
*/
public void registerObject(String key, Object object, Object metadata) throws RegistrationException
{
if (StringUtils.isBlank(key))
{
throw new RegistrationException("Attempt to register object with no key");
}
logger.debug("registering object");
if (MuleServer.getMuleContext().isInitialised() || MuleServer.getMuleContext().isInitialising())
{
logger.debug("applying processors");
object = applyProcessors(object);
}
synchronized(registry)
{
if (registry.containsKey(key))
{
// registry.put(key, value) would overwrite a previous entity with the same name. Is this really what we want?
// Not sure whether to throw an exception or log a warning here.
//throw new RegistrationException("TransientRegistry already contains an object named '" + key + "'. The previous object would be overwritten.");
logger.warn("TransientRegistry already contains an object named '" + key + "'. The previous object will be overwritten.");
}
registry.put(key, object);
}
MuleContext mc = MuleServer.getMuleContext();
logger.debug("context: " + mc);
if (mc != null)
{
logger.debug("applying lifecycle");
try
{
mc.getLifecycleManager().applyCompletedPhases(object);
}
catch (MuleException e)
{
throw new RegistrationException(e);
}
}
else
{
throw new RegistrationException("Unable to register object (\""
+ key + ":" + ClassUtils.getSimpleName(object.getClass())
+ "\") because MuleContext has not yet been created.");
}
}
public void unregisterObject(String key, Object metadata) throws RegistrationException
{
Object obj;
synchronized(registry)
{
obj = registry.remove(key);
}
if (obj instanceof Stoppable)
{
try
{
((Stoppable) obj).stop();
}
catch (MuleException e)
{
throw new RegistrationException(e);
}
}
}
public void unregisterObject(String key) throws RegistrationException
{
unregisterObject(key, Object.class);
}
// /////////////////////////////////////////////////////////////////////////
// Registry Metadata
// /////////////////////////////////////////////////////////////////////////
public boolean isReadOnly()
{
return false;
}
public boolean isRemote()
{
return false;
}
}
|
[
"dfeist@bf997673-6b11-0410-b953-e057580c5b09"
] |
dfeist@bf997673-6b11-0410-b953-e057580c5b09
|
e78dd16dd02cdc774800d17954498a0318e79f79
|
dcdb7b92f3d279b57b80bafd49d3e8484c6d0bef
|
/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/NMTokenIdentifierNewForTest.java
|
8153b44b6356fe7221080d4ceab014c2eff560b0
|
[
"LicenseRef-scancode-unknown",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
naver/hadoop
|
87b5684945da4d1a6002bb2039ac35986b64eb64
|
0c0a80f96283b5a7be234663e815bc04bafc8be2
|
refs/heads/master
| 2023-08-24T16:06:00.884300
| 2022-11-03T00:31:17
| 2022-11-03T00:31:17
| 106,681,970
| 42
| 39
|
Apache-2.0
| 2022-11-03T00:31:18
| 2017-10-12T11:06:22
|
Java
|
UTF-8
|
Java
| false
| false
| 4,350
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.yarn.server;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnSecurityTestTokenProtos.NMTokenIdentifierNewProto;
import org.apache.hadoop.yarn.security.NMTokenIdentifier;
import com.google.protobuf.TextFormat;
public class NMTokenIdentifierNewForTest extends NMTokenIdentifier {
private static Log LOG = LogFactory.getLog(NMTokenIdentifierNewForTest.class);
public static final Text KIND = new Text("NMToken");
private NMTokenIdentifierNewProto proto;
private NMTokenIdentifierNewProto.Builder builder;
public NMTokenIdentifierNewForTest(){
builder = NMTokenIdentifierNewProto.newBuilder();
}
public NMTokenIdentifierNewForTest(NMTokenIdentifierNewProto proto) {
this.proto = proto;
}
public NMTokenIdentifierNewForTest(NMTokenIdentifier tokenIdentifier,
String message) {
builder = NMTokenIdentifierNewProto.newBuilder();
builder.setAppAttemptId(tokenIdentifier.getProto().getAppAttemptId());
builder.setNodeId(tokenIdentifier.getProto().getNodeId());
builder.setAppSubmitter(tokenIdentifier.getApplicationSubmitter());
builder.setKeyId(tokenIdentifier.getKeyId());
builder.setMessage(message);
proto = builder.build();
builder = null;
}
@Override
public void write(DataOutput out) throws IOException {
LOG.debug("Writing NMTokenIdentifierNewForTest to RPC layer: " + this);
out.write(proto.toByteArray());
}
@Override
public void readFields(DataInput in) throws IOException {
DataInputStream dis = (DataInputStream)in;
byte[] buffer = IOUtils.toByteArray(dis);
proto = NMTokenIdentifierNewProto.parseFrom(buffer);
}
@Override
public Text getKind() {
return KIND;
}
@Override
public UserGroupInformation getUser() {
return null;
}
public String getMessage() {
return proto.getMessage();
}
public void setMessage(String message) {
builder.setMessage(message);
}
public NMTokenIdentifierNewProto getNewProto() {
return proto;
}
public void build() {
proto = builder.build();
builder = null;
}
public ApplicationAttemptId getApplicationAttemptId() {
return new ApplicationAttemptIdPBImpl(proto.getAppAttemptId());
}
public NodeId getNodeId() {
return new NodeIdPBImpl(proto.getNodeId());
}
public String getApplicationSubmitter() {
return proto.getAppSubmitter();
}
public int getKeyId() {
return proto.getKeyId();
}
@Override
public int hashCode() {
return this.proto.hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getNewProto().equals(this.getClass().cast(other).getNewProto());
}
return false;
}
@Override
public String toString() {
return TextFormat.shortDebugString(this.proto);
}
}
|
[
"jianhe@apache.org"
] |
jianhe@apache.org
|
d694393f7a08117c614d12504e3abd162fff8173
|
c9da6f3d720ff270f116cfa60c568d42191dacb6
|
/Leetcode/Arrays/WordSearch.java
|
8605e2601d5b361221766673a71d51132d45c34c
|
[] |
no_license
|
Rogue-Jaeger/Competitive-Programming
|
afee17aa462d8d6850d01684bbe7d1e54c018092
|
301b0b2000dfb7b1c3be1431884c740025e76bfa
|
refs/heads/master
| 2023-06-27T05:54:17.335646
| 2023-06-25T20:28:00
| 2023-06-25T20:28:00
| 150,009,094
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,597
|
java
|
//https://leetcode.com/problems/word-search/
class Solution {
private char[][] b;
private String s;
private boolean has(int row, int col, String formedWord, boolean[][] visited) {
if (!formedWord.equals(s.substring(0, formedWord.length()))) {
return false;
}
if (formedWord.length() == s.length() - 1) {
return s.equals(formedWord + b[row][col]) ? true : false;
}
visited[row][col] = true;
boolean left = false, right = false, top = false, down = false;
if (col + 1 < b[0].length && !visited[row][col + 1]) {
right = has(row, col + 1, formedWord + b[row][col], visited);
}
if (row + 1 < b.length && !visited[row + 1][col]) {
down = has(row + 1, col, formedWord + b[row][col], visited);
}
if (col - 1 > -1 && !visited[row][col - 1]) {
left = has(row, col - 1, formedWord + b[row][col], visited);
}
if (row - 1 > -1 && !visited[row - 1][col]) {
top = has(row - 1, col, formedWord + b[row][col], visited);
}
visited[row][col] = false;
return left || right || top || down;
}
public boolean exist(char[][] board, String word) {
b = board;
s = word;
boolean[][] visited = new boolean[board.length][board[0].length]; // change this
for(int i = 0; i < board.length; i++)
for(int j = 0; j < board[0].length; j++)
if(board[i][j] == word.charAt(0) && has(i, j, "", visited)) return true;
return false;
}
}
|
[
"yogeshdhmn@gmail.com"
] |
yogeshdhmn@gmail.com
|
7eea14269c1919e733e5d90b591aeb37a2a677b2
|
878af3368208bdb16a44370dfaa2593013e23119
|
/NetWorkRequestMvp/src/main/java/com/wsl/networkrequestmvp/promptdialog/PromptButton.java
|
ddefee46d1f5aaa4ff79bcf188b36a6fce999d8d
|
[] |
no_license
|
laose307/NetWorkRequestMvpTest
|
3df5936550f929aae00d267118ceb7af687cc2d6
|
bddfb75f6f28a89b158fe59524bef88c7f713e0d
|
refs/heads/master
| 2023-03-11T20:32:38.019107
| 2021-02-24T01:29:46
| 2021-02-24T01:29:46
| 288,350,088
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,404
|
java
|
package com.wsl.networkrequestmvp.promptdialog;
import android.graphics.Color;
import android.graphics.RectF;
/**
* Created by FengTing on 2017/5/8.
* https://www.github.com/limxing
*/
public class PromptButton {
private boolean isDelyClick;
private String text = "confirm";
private boolean focus;
private int textColor = Color.BLACK;
private float textSize = 18;
private RectF rect;
private PromptButtonListener listener;
private int focusBacColor= Color.parseColor("#DCDCDC");
private boolean dismissAfterClick=true;
public PromptButton(String text, PromptButtonListener listener) {
this.text = text;
this.listener = listener;
}
public PromptButton(String text, PromptButtonListener listener, boolean delayClick) {
this.text = text;
this.listener = listener;
this.isDelyClick=delayClick;
}
public boolean isFocus() {
return focus;
}
public void setFocus(boolean focus) {
this.focus = focus;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getTextColor() {
return textColor;
}
public float getTextSize() {
return textSize;
}
public void setTouchRect(RectF rectF) {
this.rect = rectF;
}
public void setTextColor(int textColor) {
this.textColor = textColor;
}
public void setTextSize(float textSize) {
this.textSize = textSize;
}
public RectF getRect() {
return rect;
}
public void setRect(RectF rect) {
this.rect = rect;
}
public PromptButtonListener getListener() {
return listener;
}
public void setListener(PromptButtonListener listener) {
this.listener = listener;
}
public int getFocusBacColor() {
return focusBacColor;
}
public void setFocusBacColor(int focusBacColor) {
this.focusBacColor = focusBacColor;
}
public boolean isDismissAfterClick() {
return dismissAfterClick;
}
public void setDismissAfterClick(boolean dismissAfterClick) {
this.dismissAfterClick = dismissAfterClick;
}
public boolean isDelyClick() {
return isDelyClick;
}
public void setDelyClick(boolean delyClick) {
isDelyClick = delyClick;
}
}
|
[
"kcd10086"
] |
kcd10086
|
c73a656ecaed727d9fa2b2b8d008cc51feabed93
|
7cff3d29e6dd849a4ee58bfd6245cca0702baa7f
|
/revisao-poo/src/Aluno.java
|
c53a5207c84d80622b76ab86d4a31b3abdde056f
|
[] |
no_license
|
FlaviaVilar/javaPOO
|
53f7bd040277d139ed1f0676599d808ce61f9acf
|
964cac8bd1e363cd5583d8040c2b9c3f7fde3e89
|
refs/heads/master
| 2020-07-17T19:00:09.483772
| 2019-09-03T13:17:22
| 2019-09-03T13:17:22
| 206,077,988
| 0
| 0
| null | null | null | null |
ISO-8859-2
|
Java
| false
| false
| 553
|
java
|
public class Aluno {
private double nota1;
private double nota2;
public double getNota1() {
return nota1;
}
public void setNota1(double nota1) {
if(nota1 > 0 && nota1 < 10) {
this.nota1 = nota1;
}
else {
System.out.println("Valor inválido");
}
}
public double getNota2() {
return nota2;
}
public void setNota2(double nota2) {
if(nota2 > 0 && nota2 < 10) {
this.nota2 = nota2;
}
else {
System.out.println("Valor inválido");
}
}
public void getMedia() {
System.out.println((nota1+nota2)/2);
}
}
|
[
"flaviamvilar@gmail.com"
] |
flaviamvilar@gmail.com
|
d6d6aafcfe830a47bea337dc229f68cd4c536ae7
|
88b5d009969cdc78838e56ca045c2ff1c9a68152
|
/vize/src/vize/denemeee.java
|
e58fa083505816fa03b578ccdd68fe5d6d5e4e15
|
[] |
no_license
|
erdogangulec/CodeTrials
|
bae9a5496beb82755bfc965b5950aaa56d7c9bfe
|
2b879ccf3f4b6d8ce214c0af16d9e000c3fb3159
|
refs/heads/master
| 2023-03-04T02:16:44.973877
| 2021-02-18T23:52:20
| 2021-02-18T23:52:20
| 340,202,949
| 6
| 0
| null | null | null | null |
ISO-8859-13
|
Java
| false
| false
| 359
|
java
|
package vize;
import java.util.Random;
public class denemeee {
public static void main(String[] args) {
// TODO Auto-generated method stub
Random rand = new Random();
int rasgelesayi = rand.nextInt(100);
if (rasgelesayi%2 != 0) { rasgelesayi += 1;}
System.out.println("Rasgele sayż = "+ rasgelesayi);
}
}
|
[
"90507@DESKTOP-5CG03NV"
] |
90507@DESKTOP-5CG03NV
|
43e99087d106cdc9e840a98400cf45e5b6678818
|
6e24c7efb8b59ff0c4e0f9e89ebd034e5d177604
|
/shiningstarbase/src/main/java/aloha/shiningstarbase/widget/scoll/PowerNestedScrollParentLayout.java
|
8b9206976c96c2530acddf9886bc8ce97267db17
|
[] |
no_license
|
ShiningStarWorld/ShiningStarLibrary
|
053a6da13d0d23c67b27e1ee9ea83c0f4b6cddb8
|
5c3449ddff57bab5184e7958b2165533944c2341
|
refs/heads/master
| 2020-04-05T11:22:16.288760
| 2017-07-29T06:25:51
| 2017-07-29T06:25:51
| 81,404,520
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,082
|
java
|
package aloha.shiningstarbase.widget.scoll;
import android.content.Context;
import android.support.v4.view.NestedScrollingParent;
import android.support.v4.view.NestedScrollingParentHelper;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.OverScroller;
import com.aloha.starworld.logger.LogUtil;
import java.util.ArrayList;
import java.util.List;
/**
* Created by AlohaQoQ on 2016/11/7.
*/
public class PowerNestedScrollParentLayout extends LinearLayout implements NestedScrollingParent {
private NestedScrollingParentHelper mParentHelper;
private List<Integer> childHeightBox;
private PowerNestedScrollChildLayout childLayout;
private OverScroller mScroller;
public PowerNestedScrollParentLayout(Context context) {
this(context,null);
}
public PowerNestedScrollParentLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public PowerNestedScrollParentLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setOrientation(LinearLayout.VERTICAL);
mParentHelper = new NestedScrollingParentHelper(this);
mScroller = new OverScroller(context);
}
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
LogUtil.biu("onStartNestedScroll--"+"child:"+child+",target:"+target+",nestedScrollAxes:"+nestedScrollAxes);
return true;
}
@Override
public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes) {
LogUtil.biu("onNestedScrollAccepted"+"child:"+child+",target:"+target+",nestedScrollAxes:"+nestedScrollAxes);
mParentHelper.onNestedScrollAccepted(child, target, nestedScrollAxes);
}
@Override
public void onStopNestedScroll(View target) {
LogUtil.biu("onStopNestedScroll--target:"+target);
mParentHelper.onStopNestedScroll(target);
}
@Override
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
LogUtil.biu("onNestedScroll--"+"target:"+target+",dxConsumed"+dxConsumed+",dyConsumed:"+dyConsumed
+",dxUnconsumed:"+dxUnconsumed+",dyUnconsumed:"+dyUnconsumed);
}
@Override
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) {
boolean hiddenTop = dy > 0 && getScrollY() < childHeightBox.get(0);
boolean showTop = dy < 0 && getScrollY() >= 0 && !ViewCompat.canScrollVertically(target, -1);
if (hiddenTop || showTop) { //如果父亲自己要滑动,则拦截
scrollBy(0, dy);
consumed[1] = dy;
LogUtil.biu("onNestedPreScroll,Parent滑动:"+dy);
}
LogUtil.biu("onNestedPreScroll--getScrollY():"+getScrollY()+",dx:"+dx+",dy:"+dy+",consumed:"+consumed);
}
@Override
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
LogUtil.biu("onNestedFling--target:"+target);
return false;
}
@Override
public boolean onNestedPreFling(View target, float velocityX, float velocityY) {
LogUtil.biu("onNestedPreFling--target:"+target);
if (getScrollY() >= childHeightBox.get(0))
return false;
fling((int) velocityY);
return true;
}
/*@Override
public int getNestedScrollAxes() {
super.getNestedScrollAxes();
LogUtil.biu("getNestedScrollAxes");
return 0;
}*/
@Override
protected void onFinishInflate() {
super.onFinishInflate();
childHeightBox = new ArrayList<>();
for (int i = 0; i < getChildCount(); i++) {
LogUtil.biu("getChildCount:" + getChildCount());
final int qq = i;
getChildAt(i).getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
childHeightBox.add(qq, getChildAt(qq).getMeasuredHeight());
LogUtil.biu("height:"+getChildAt(qq).getMeasuredHeight());
}
});
}
}
public void fling(int velocityY) {
mScroller.fling(0, getScrollY(), 0, velocityY, 0, 0, 0, childHeightBox.get(0));
invalidate();
}
@Override
public void scrollTo(int x, int y) {
if(y<0)
y=0;
if(y>childHeightBox.get(0))
y=childHeightBox.get(0);
if (y != getScrollY())
super.scrollTo(x, y);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return super.onTouchEvent(event);
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
LogUtil.biu("dispatchTouchEvent:getRawY:"+event.getRawY());
return super.dispatchTouchEvent(event);
}
}
|
[
"757993938@qq.com"
] |
757993938@qq.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.